Procházet zdrojové kódy

增加连接状态

master
applelon před 2 roky
rodič
revize
94a146a6c5
2 změnil soubory, kde provedl 30 přidání a 0 odebrání
  1. +19
    -0
      HBLConsole.Debug/Debug_MORKIC.xaml
  2. +11
    -0
      HBLConsole.Debug/ViewModel/ViewModel_MORKIC.cs

+ 19
- 0
HBLConsole.Debug/Debug_MORKIC.xaml Zobrazit soubor

@@ -80,6 +80,7 @@
<RowDefinition Height="50" />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Margin="0,10,0,0" Orientation="Horizontal">
<Button
Width="130"
@@ -95,8 +96,26 @@
Content="冰淇淋模拟"
Style="{StaticResource ButtonStyle}" />
</StackPanel>
<StackPanel Grid.Row="1" Margin="0,10,0,0" Orientation="Vertical">
<Grid HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock>机器人连接状态</TextBlock>
<TextBlock Grid.Column="1" Text="{Binding RobotConnected}"></TextBlock>

<TextBlock Grid.Column="2">冰淇淋机连接状态</TextBlock>
<TextBlock Grid.Column="3" Text="{Binding IceCreamConnected}"></TextBlock>

<TextBlock Grid.Column="4">咖啡机连接状态</TextBlock>
<TextBlock Grid.Column="5" Text="{Binding CoffeeConnected}"></TextBlock>
</Grid>
</StackPanel>
</Grid>
</GroupBox>
<!--#endregion-->


+ 11
- 0
HBLConsole.Debug/ViewModel/ViewModel_MORKIC.cs Zobrazit soubor

@@ -1,4 +1,5 @@
using BPA.Utility;
using HBLConsole.Communication;
using HBLConsole.Service;
using HBLDevice.Coffee;
using HBLDevice.IceCream;
@@ -15,6 +16,10 @@ namespace HBLConsole.Debug
[AddINotifyPropertyChangedInterface]
internal class ViewModel_MORKIC
{
public string RobotConnected { get; set; }
public string IceCreamConnected { get; set; }
public string CoffeeConnected { get; set; }

#region 咖啡机
/// <summary>
/// 咖啡机状态
@@ -102,6 +107,12 @@ namespace HBLConsole.Debug

ThreadOperate.GetInstance.StartLong(new Action(() =>
{
RobotConnected = LebaiHelper.GetInstance.IsConnected?"已连接":"未连接";
IceCreamConnected = MorkIStatus.GetInstance().CanDo?"已连接":"未连接";
CoffeeConnected = MorkCStatus.GetInstance().CanDo ? "已连接": "未连接";



CoffeeStatus = MorkCStatus.GetInstance().CoffeeStatus;
AppStatus = MorkCStatus.GetInstance().AppStatus;
Warning = MorkCStatus.GetInstance().Warning;


Načítá se…
Zrušit
Uložit