Kaynağa Gözat

提交大屏展示界面

master
fyf 2 yıl önce
ebeveyn
işleme
4504dcab42
30 değiştirilmiş dosya ile 1673 ekleme ve 1758 silme
  1. +4
    -3
      BPASmartClient.ScreenALL/App.config
  2. +1
    -1
      BPASmartClient.ScreenALL/BPASmartClient.ScreenALL.csproj
  3. +1
    -1
      BPASmartClient.ScreenLib/BPASmartClient.ScreenLib.csproj
  4. +50
    -8
      BPASmartClient.ScreenLib/Helper/Main.cs
  5. +0
    -20
      BPASmartClient.ScreenLib/Model/DevRunStatus.cs
  6. +1
    -57
      BPASmartClient.ScreenLib/Model/OrderMakeModel.cs
  7. +39
    -42
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1.xaml
  8. +17
    -102
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1ViewModel.cs
  9. +48
    -83
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2.xaml
  10. +17
    -102
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2ViewModel.cs
  11. +49
    -84
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl3.xaml
  12. +17
    -102
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl3ViewModel.cs
  13. +272
    -114
      BPASmartClient.ScreenLib/总监视大屏/ScreenALLControl.xaml
  14. +159
    -129
      BPASmartClient.ScreenLib/总监视大屏/ScreenALLControlViewModel.cs
  15. +160
    -115
      BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControl.xaml
  16. +17
    -133
      BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControlViewModel.cs
  17. +206
    -143
      BPASmartClient.ScreenLib/炒锅/ScreenMinWokControl.xaml
  18. +17
    -148
      BPASmartClient.ScreenLib/炒锅/ScreenMinWokControlViewModel.cs
  19. +134
    -113
      BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml
  20. +29
    -249
      BPASmartClient.ScreenLib/煮面机/ScreenMorksControlViewModel.cs
  21. +4
    -3
      BPASmartClient.ScreenMinWok/App.config
  22. +4
    -3
      BPASmartClient.ScreenMorks/App.config
  23. +4
    -3
      BPASmartClient.ScreenSplitMeals/App.config
  24. +23
    -0
      SmartClient.sln
  25. +9
    -0
      WpfTest/App.xaml
  26. +17
    -0
      WpfTest/App.xaml.cs
  27. +10
    -0
      WpfTest/AssemblyInfo.cs
  28. +12
    -0
      WpfTest/MainWindow.xaml
  29. +338
    -0
      WpfTest/MainWindow.xaml.cs
  30. +14
    -0
      WpfTest/WpfTest.csproj

+ 4
- 3
BPASmartClient.ScreenALL/App.config Dosyayı Görüntüle

@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<!--Redis配置-->
<add key="RedisConnection" value="10.2.1.254,6379,BapAdmin123456.,1"/>
<add key="DeviceMC" value="1"/>
<!--MQTT配置-->
<add key="MQTTConnection" value="10.2.1.254,1883,admin,public"/>
<!--订阅主题设置:大炒,小炒,分餐机,煮面机-->
<add key="DeviceMC" value="大炒,小炒,分餐机,煮面机"/>
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>
</appSettings>
</configuration>

+ 1
- 1
BPASmartClient.ScreenALL/BPASmartClient.ScreenALL.csproj Dosyayı Görüntüle

@@ -5,7 +5,7 @@
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<AssemblyName>监控大屏</AssemblyName>
<AssemblyName>海科食堂监控大屏</AssemblyName>
<ApplicationIcon>hbl.ico</ApplicationIcon>

</PropertyGroup>


+ 1
- 1
BPASmartClient.ScreenLib/BPASmartClient.ScreenLib.csproj Dosyayı Görüntüle

@@ -19,7 +19,7 @@
</COMReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="BPA.CustomResource" Version="1.0.5" />
<PackageReference Include="BPA.CustomResource" Version="1.0.12" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1418.22" />
</ItemGroup>



+ 50
- 8
BPASmartClient.ScreenLib/Helper/Main.cs Dosyayı Görüntüle

@@ -70,7 +70,7 @@ namespace BPASmartClient.ScreenLib
/// <summary>
/// 设备数据
/// </summary>
public Dictionary<string, Dictionary<string, string>> mqttDatasDic = new Dictionary<string, Dictionary<string, string>>();
public Dictionary<ScreenDeviceType, object> mqttDatasDic = new Dictionary<ScreenDeviceType, object>();
/// <summary>
/// 配置数据
/// </summary>
@@ -96,11 +96,23 @@ namespace BPASmartClient.ScreenLib
if (msg.Count > 0 && msg.TryDequeue(out string s))
{
SendScreenDataModel read= JsonConvert.DeserializeObject<SendScreenDataModel>(s);
if (read != null)
if (read != null && read.Value!=null)
{
read?.mqttAicDatasDic?.ToList().ForEach(data => {
mqttDatasDic[data.Key]= data.Value;
});
switch (read.Name)
{
case ScreenDeviceType.大炒:
mqttDatasDic[read.Name] = JsonConvert.DeserializeObject<ScreenModelMaxWok>(read.Value.ToString());
break;
case ScreenDeviceType.小炒:
mqttDatasDic[read.Name] = JsonConvert.DeserializeObject<ScreenModelMinWok>(read.Value.ToString());
break;
case ScreenDeviceType.分餐机:
mqttDatasDic[read.Name] = JsonConvert.DeserializeObject<ScreenModelSplitMeals>(read.Value.ToString());
break;
case ScreenDeviceType.煮面机:
mqttDatasDic[read.Name] = JsonConvert.DeserializeObject<ScreenModelMorkS>(read.Value.ToString());
break;
}
}
}
}
@@ -208,19 +220,49 @@ namespace BPASmartClient.ScreenLib
{
Name.Split(',')?.ToList().ForEach(x =>
{
mqttHelper.Subscrib(x);
if (x == "大炒")
{
mqttHelper.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.大炒));
}else if (x == "小炒")
{
mqttHelper.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.小炒));
}
else if (x == "分餐机")
{
mqttHelper.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.分餐机));
}
else if (x == "煮面机")
{
mqttHelper.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机));
}
});
}
else
{
mqttHelper.Subscrib(Name);
if (Name == "大炒")
{
mqttHelper.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.大炒));
}
else if (Name == "小炒")
{
mqttHelper.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.小炒));
}
else if (Name == "分餐机")
{
mqttHelper.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.分餐机));
}
else if (Name == "煮面机")
{
mqttHelper.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机));
}
}
});
mqttHelper.MessageRecive = new Action<string>((s) => { msg.Enqueue(s); });
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"{Name}:初始化连接Redis MQTT,原因:{ex.Message}");
MessageLog.GetInstance.ShowEx($"{Name}:初始化连接 MQTT,原因:{ex.Message}");
}

}


+ 0
- 20
BPASmartClient.ScreenLib/Model/DevRunStatus.cs Dosyayı Görüntüle

@@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.ScreenLib
{
public enum DevRunStatus
{
正常,
异常
}

public enum DevIsRun
{
运行,
停止
}
}

+ 1
- 57
BPASmartClient.ScreenLib/Model/OrderMakeModel.cs Dosyayı Görüntüle

@@ -12,7 +12,7 @@ namespace BPASmartClient.ScreenLib
/// <summary>
/// 订单制作Model
/// </summary>
public class OrderMakeModel : NotifyBase
public class OrderMakeFormModel : NotifyBase
{
/// <summary>
/// 状态
@@ -104,60 +104,4 @@ namespace BPASmartClient.ScreenLib
}
}

/// <summary>
/// 告警数据
/// </summary>
public class AlarmMsModel : NotifyBase
{
private string _AlarmTime;
public string AlarmTime
{
get { return _AlarmTime; }
set
{
_AlarmTime = value;
OnPropertyChanged();
}
}


private string _AlarmMs;
public string AlarmMs
{
get { return _AlarmMs; }
set
{
_AlarmMs = value;
OnPropertyChanged();
}
}
}

/// <summary>
/// 菜品类型
/// </summary>
public class CookType : NotifyBase
{
private string _Name;
public string Name
{
get { return _Name; }
set
{
_Name = value;
OnPropertyChanged();
}
}

private string _Name1;
public string Name1
{
get { return _Name1; }
set
{
_Name1 = value;
OnPropertyChanged();
}
}
}
}

+ 39
- 42
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1.xaml Dosyayı Görüntüle

@@ -33,7 +33,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -48,7 +48,7 @@
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备是否运行</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
</StackPanel>
</Grid>
@@ -60,11 +60,11 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="张三"></TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardNameBefore_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">前一位刷卡人</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="李四"></TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="{Binding ViewData.SplitMeals_CreditCardName_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前刷卡人</TextBlock>
</StackPanel>
</Grid>
@@ -72,11 +72,11 @@

</GroupBox>
<GroupBox Margin="0,20,10,0" Height="480" Width="450" Header="今日菜品列表" Style="{DynamicResource from}" Tag="Start">
<ListBox ItemsSource="{Binding CookTypeListLeft,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox ItemsSource="{Binding ViewData.SplitMeals_CookType_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
<Button Width="370" Height="100" Margin="20,20,0,0" FontSize="60" Content="{Binding Name}"/>
<Button Width="370" Height="100" Margin="20,20,0,0" FontSize="60" Content="{Binding .}"/>
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>
@@ -90,36 +90,32 @@
<wv2:WebView2 Name="webView" Source="{Binding GgAdder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Grid>
</GroupBox>

<StackPanel Orientation="Horizontal">

<GroupBox Margin="5,0,0,0" Height="340" Width="950" Header="设备告警详情" Style="{DynamicResource from}">
<DataGrid Margin="0,10,0,0" ItemsSource="{Binding AlarmList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="160">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#FFD86E03" FontSize="14" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="300">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#FFD86E03" FontSize="14" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</StackPanel>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="告警信息展示区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="250">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</StackPanel>

<StackPanel Grid.Column="2" Margin="0,10,0,0">
@@ -133,7 +129,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -148,7 +144,7 @@
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备是否运行</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
</StackPanel>
</Grid>
@@ -160,22 +156,23 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="张三"></TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardNameBefore_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">前一位刷卡人</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="李四"></TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="{Binding ViewData.SplitMeals_CreditCardName_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前刷卡人</TextBlock>
</StackPanel>
</Grid>
</StackPanel>

</GroupBox>
<GroupBox Margin="0,20,10,0" Height="480" Width="450" Header="今日菜品列表" Style="{DynamicResource from}" Tag="Start">
<ListBox ItemsSource="{Binding CookTypeListReit,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox ItemsSource="{Binding ViewData.SplitMeals_CookType_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
<Button Width="370" Height="100" Margin="20,20,0,0" FontSize="60" Content="{Binding Name}"/>
<Button Width="370" Height="100" Margin="20,20,0,0" FontSize="60" Content="{Binding .}"/>
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>


+ 17
- 102
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1ViewModel.cs Dosyayı Görüntüle

@@ -1,4 +1,5 @@
using BPA.Helper;
using BPA.Message;
using BPA.Message.Enum;
using System;
using System.Collections.Generic;
@@ -13,132 +14,46 @@ namespace BPASmartClient.ScreenLib
public class ScreenSplitMealsControl1ViewModel : NotifyBase
{
#region 变量
/// <summary>
/// 柱状图显示集合
/// </summary>
public IEnumerable<KeyValuePair<string, double>> Histogram { get { return _Histogram; } set { _Histogram = value; OnPropertyChanged(); } }
private IEnumerable<KeyValuePair<string, double>> _Histogram = new List<KeyValuePair<string, double>>();

/// <summary>
/// 设备是否运行
/// </summary>
public DevIsRun DevIsRun { get { return _DevIsRun; } set { _DevIsRun = value; OnPropertyChanged(); } }
private DevIsRun _DevIsRun = DevIsRun.停止;

/// <summary>
/// 设备状态
/// </summary>
public DevRunStatus RunStatus { get { return _RunStatus; } set { _RunStatus = value; OnPropertyChanged(); } }
private DevRunStatus _RunStatus = DevRunStatus.正常;

/// <summary>
/// 订单数
/// </summary>
public int DdCount { get { return _DdCount; } set { _DdCount = value; OnPropertyChanged(); } }
private int _DdCount = 0;

/// <summary>
/// 异常订单数
/// </summary>
public int YCDdCount { get { return _YCDdCount; } set { _YCDdCount = value; OnPropertyChanged(); } }
private int _YCDdCount = 0;

/// <summary>
/// 广告地址
/// </summary>
public Uri GgAdder { get { return _GgAdder; } set { _GgAdder = value; OnPropertyChanged(); } }
private Uri _GgAdder = new Uri(System.Configuration.ConfigurationManager.AppSettings["GgAdder"].ToString());

/// <summary>
/// 告警数据
/// 界面数据绑定
/// </summary>
public ObservableCollection<AlarmMsModel> AlarmList
public ScreenModelSplitMeals ViewData
{
get { return _AlarmList; }
get { return _ViewData; }
set
{
_AlarmList = value;
_ViewData = value;
OnPropertyChanged();
}
}
private ObservableCollection<AlarmMsModel> _AlarmList = new ObservableCollection<AlarmMsModel>();
private ScreenModelSplitMeals _ViewData = new ScreenModelSplitMeals();

/// <summary>
/// 菜品类型-左
/// 当前刷新数据类型
/// </summary>
public ObservableCollection<CookType> CookTypeListLeft
{
get { return _CookTypeListLeft; }
set
{
_CookTypeListLeft = value;
OnPropertyChanged();
}
}
private ObservableCollection<CookType> _CookTypeListLeft = new ObservableCollection<CookType>();

/// <summary>
/// 菜品类型-右边
/// </summary>
public ObservableCollection<CookType> CookTypeListReit
{
get { return _CookTypeListReit; }
set
{
_CookTypeListReit = value;
OnPropertyChanged();
}
}
private ObservableCollection<CookType> _CookTypeListReit = new ObservableCollection<CookType>();
public ScreenDeviceType type = ScreenDeviceType.分餐机;
#endregion
public ScreenSplitMealsControl1ViewModel()
{
Init();
}

/// <summary>
/// 初始化
/// </summary>
public void Init()
public ScreenSplitMealsControl1ViewModel()
{
ThreadManage.GetInstance().StartLong(new Action(() =>
{
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() =>
{
RunStatus = RunStatus == DevRunStatus.正常 ? DevRunStatus.异常 : DevRunStatus.正常;
DevIsRun = DevIsRun == DevIsRun.运行 ? DevIsRun.停止 : DevIsRun.运行;
DdCount = new Random().Next(0, 400);
YCDdCount = new Random().Next(0, 400);

List<ORDER_STATUS> oRDER_s = new List<ORDER_STATUS>() { ORDER_STATUS.WAIT, ORDER_STATUS.COOKING };
List<ORDER_STATUS> oRDER_s1 = new List<ORDER_STATUS>() { ORDER_STATUS.COMPLETED_COOK, ORDER_STATUS.COMPLETED_TAKE };

List<string> name_s = new List<string>() { "担担面", "鸡蛋面", "火鸡面", "扬州炒饭", "回锅肉盖饭", "炒茄子" };
CookTypeListReit = new ObservableCollection<CookType>();
CookTypeListReit.Add(new CookType { Name = name_s[0],Name1= name_s[1] });
CookTypeListReit.Add(new CookType { Name = name_s[2], Name1 = name_s[3] });
CookTypeListReit.Add(new CookType { Name = name_s[4], Name1 = name_s[5] });

CookTypeListLeft = new ObservableCollection<CookType>();
CookTypeListLeft.Add(new CookType { Name = name_s[0], Name1 = name_s[1] });
CookTypeListLeft.Add(new CookType { Name = name_s[2], Name1 = name_s[3] });
CookTypeListLeft.Add(new CookType { Name = name_s[4], Name1 = name_s[5] });

AlarmList = new ObservableCollection<AlarmMsModel>();
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
Histogram = new[] {
new KeyValuePair<string, double>(name_s[0], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[1], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[2], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[3], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[4], new Random().Next(0,400))};
if (Main.GetInstance.mqttDatasDic.ContainsKey(type))
{
ScreenModelSplitMeals modelMaxWok = Main.GetInstance.mqttDatasDic[type] as ScreenModelSplitMeals;
if (modelMaxWok != null && modelMaxWok.Alarm != null)
modelMaxWok.Alarm = modelMaxWok.Alarm?.OrderByDescending(k => DateTime.Parse(k.AlarmTime)).ToList();
ViewData = modelMaxWok;
}
}));
Thread.Sleep(5000);
Thread.Sleep(1000);
}), $"{DateTime.Now}_1,线程服务");
}
}


+ 48
- 83
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2.xaml Dosyayı Görüntüle

@@ -33,7 +33,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -47,23 +47,12 @@
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备是否运行</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备当前状态</TextBlock>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="刷卡信息统计" Margin="20,10,0,0"/>
<GroupBox Header="当前操作信息" Margin="20,10,0,0"/>
<Grid Height="160">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@@ -71,25 +60,23 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardNameBefore_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">前一位刷卡人</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="#FFEC3107" FontSize="52" Text="{Binding YCDdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">异常刷卡数</TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="{Binding ViewData.SplitMeals_CreditCardName_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前刷卡人</TextBlock>
</StackPanel>
</Grid>

</StackPanel>

</GroupBox>
<GroupBox Margin="0,20,10,0" Height="480" Width="450" Header="今日菜品列表" Style="{DynamicResource from}" Tag="Start">
<ListBox ItemsSource="{Binding CookTypeListLeft,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox ItemsSource="{Binding ViewData.SplitMeals_CookType_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
<Button Width="170" Height="100" Margin="20,20,0,0" Content="{Binding Name}"/>
<Button Width="170" Height="100" Margin="20,20,0,0" Content="{Binding Name1}"/>
<Button Width="370" Height="100" Margin="20,20,0,0" FontSize="60" Content="{Binding .}"/>
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>
@@ -103,41 +90,32 @@
<wv2:WebView2 Name="webView" Source="{Binding GgAdder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Grid>
</GroupBox>

<StackPanel Orientation="Horizontal">
<GroupBox Margin="5,0,0,0" Height="340" Width="470" Header="今日菜品刷卡统计图" Style="{DynamicResource from}">
<StackPanel>
<con:BasicBarChart Margin="30,40,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" SeriesArray="{Binding Histogram,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="410" Height="200" ShowSize="50"></con:BasicBarChart>
</StackPanel>
</GroupBox>

<GroupBox Margin="10,0,0,0" Height="340" Width="470" Header="设备告警详情" Style="{DynamicResource from}">
<DataGrid Margin="0,10,0,0" ItemsSource="{Binding AlarmList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="160">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#FFD86E03" FontSize="14" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="300">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#FFD86E03" FontSize="14" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</StackPanel>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="告警信息展示区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="250">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</StackPanel>

<StackPanel Grid.Column="2" Margin="0,10,0,0">
@@ -151,7 +129,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -165,23 +143,12 @@
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备是否运行</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备当前状态</TextBlock>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="刷卡信息统计" Margin="20,10,0,0"/>
<GroupBox Header="当前操作信息" Margin="20,10,0,0"/>
<Grid Height="160">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@@ -189,25 +156,23 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardNameBefore_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">前一位刷卡人</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="#FFEC3107" FontSize="52" Text="{Binding YCDdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">异常刷卡数</TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="{Binding ViewData.SplitMeals_CreditCardName_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前刷卡人</TextBlock>
</StackPanel>
</Grid>

</StackPanel>

</GroupBox>
<GroupBox Margin="0,20,10,0" Height="480" Width="450" Header="今日菜品列表" Style="{DynamicResource from}" Tag="Start">
<ListBox ItemsSource="{Binding CookTypeListReit,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox ItemsSource="{Binding ViewData.SplitMeals_CookType_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
<Button Width="170" Height="100" Margin="20,20,0,0" Content="{Binding Name}"/>
<Button Width="170" Height="100" Margin="20,20,0,0" Content="{Binding Name1}"/>
<Button Width="370" Height="100" Margin="20,20,0,0" FontSize="60" Content="{Binding .}"/>
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>


+ 17
- 102
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2ViewModel.cs Dosyayı Görüntüle

@@ -1,4 +1,5 @@
using BPA.Helper;
using BPA.Message;
using BPA.Message.Enum;
using System;
using System.Collections.Generic;
@@ -13,132 +14,46 @@ namespace BPASmartClient.ScreenLib
public class ScreenSplitMealsControl2ViewModel : NotifyBase
{
#region 变量
/// <summary>
/// 柱状图显示集合
/// </summary>
public IEnumerable<KeyValuePair<string, double>> Histogram { get { return _Histogram; } set { _Histogram = value; OnPropertyChanged(); } }
private IEnumerable<KeyValuePair<string, double>> _Histogram = new List<KeyValuePair<string, double>>();

/// <summary>
/// 设备是否运行
/// </summary>
public DevIsRun DevIsRun { get { return _DevIsRun; } set { _DevIsRun = value; OnPropertyChanged(); } }
private DevIsRun _DevIsRun = DevIsRun.停止;

/// <summary>
/// 设备状态
/// </summary>
public DevRunStatus RunStatus { get { return _RunStatus; } set { _RunStatus = value; OnPropertyChanged(); } }
private DevRunStatus _RunStatus = DevRunStatus.正常;

/// <summary>
/// 订单数
/// </summary>
public int DdCount { get { return _DdCount; } set { _DdCount = value; OnPropertyChanged(); } }
private int _DdCount = 0;

/// <summary>
/// 异常订单数
/// </summary>
public int YCDdCount { get { return _YCDdCount; } set { _YCDdCount = value; OnPropertyChanged(); } }
private int _YCDdCount = 0;

/// <summary>
/// 广告地址
/// </summary>
public Uri GgAdder { get { return _GgAdder; } set { _GgAdder = value; OnPropertyChanged(); } }
private Uri _GgAdder = new Uri(System.Configuration.ConfigurationManager.AppSettings["GgAdder"].ToString());

/// <summary>
/// 告警数据
/// 界面数据绑定
/// </summary>
public ObservableCollection<AlarmMsModel> AlarmList
public ScreenModelSplitMeals ViewData
{
get { return _AlarmList; }
get { return _ViewData; }
set
{
_AlarmList = value;
_ViewData = value;
OnPropertyChanged();
}
}
private ObservableCollection<AlarmMsModel> _AlarmList = new ObservableCollection<AlarmMsModel>();
private ScreenModelSplitMeals _ViewData = new ScreenModelSplitMeals();

/// <summary>
/// 菜品类型-左
/// 当前刷新数据类型
/// </summary>
public ObservableCollection<CookType> CookTypeListLeft
{
get { return _CookTypeListLeft; }
set
{
_CookTypeListLeft = value;
OnPropertyChanged();
}
}
private ObservableCollection<CookType> _CookTypeListLeft = new ObservableCollection<CookType>();

/// <summary>
/// 菜品类型-右边
/// </summary>
public ObservableCollection<CookType> CookTypeListReit
{
get { return _CookTypeListReit; }
set
{
_CookTypeListReit = value;
OnPropertyChanged();
}
}
private ObservableCollection<CookType> _CookTypeListReit = new ObservableCollection<CookType>();
public ScreenDeviceType type = ScreenDeviceType.分餐机;
#endregion
public ScreenSplitMealsControl2ViewModel()
{
Init();
}

/// <summary>
/// 初始化
/// </summary>
public void Init()
public ScreenSplitMealsControl2ViewModel()
{
ThreadManage.GetInstance().StartLong(new Action(() =>
{
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() =>
{
RunStatus = RunStatus == DevRunStatus.正常 ? DevRunStatus.异常 : DevRunStatus.正常;
DevIsRun = DevIsRun == DevIsRun.运行 ? DevIsRun.停止 : DevIsRun.运行;
DdCount = new Random().Next(0, 400);
YCDdCount = new Random().Next(0, 400);

List<ORDER_STATUS> oRDER_s = new List<ORDER_STATUS>() { ORDER_STATUS.WAIT, ORDER_STATUS.COOKING };
List<ORDER_STATUS> oRDER_s1 = new List<ORDER_STATUS>() { ORDER_STATUS.COMPLETED_COOK, ORDER_STATUS.COMPLETED_TAKE };

List<string> name_s = new List<string>() { "担担面", "鸡蛋面", "火鸡面", "扬州炒饭", "回锅肉盖饭", "炒茄子" };
CookTypeListReit = new ObservableCollection<CookType>();
CookTypeListReit.Add(new CookType { Name = name_s[0], Name1 = name_s[1] });
CookTypeListReit.Add(new CookType { Name = name_s[2], Name1 = name_s[3] });
CookTypeListReit.Add(new CookType { Name = name_s[4], Name1 = name_s[5] });

CookTypeListLeft = new ObservableCollection<CookType>();
CookTypeListLeft.Add(new CookType { Name = name_s[0], Name1 = name_s[1] });
CookTypeListLeft.Add(new CookType { Name = name_s[2], Name1 = name_s[3] });
CookTypeListLeft.Add(new CookType { Name = name_s[4], Name1 = name_s[5] });

AlarmList = new ObservableCollection<AlarmMsModel>();
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
Histogram = new[] {
new KeyValuePair<string, double>(name_s[0], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[1], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[2], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[3], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[4], new Random().Next(0,400))};
if (Main.GetInstance.mqttDatasDic.ContainsKey(type))
{
ScreenModelSplitMeals modelMaxWok = Main.GetInstance.mqttDatasDic[type] as ScreenModelSplitMeals;
if (modelMaxWok != null && modelMaxWok.Alarm != null)
modelMaxWok.Alarm = modelMaxWok.Alarm?.OrderByDescending(k => DateTime.Parse(k.AlarmTime)).ToList();
ViewData = modelMaxWok;
}
}));
Thread.Sleep(5000);
Thread.Sleep(1000);
}), $"{DateTime.Now}_2,线程服务");
}
}


+ 49
- 84
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl3.xaml Dosyayı Görüntüle

@@ -23,7 +23,7 @@
</Grid.ColumnDefinitions>

<StackPanel Margin="0,10,0,0">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="460" Width="450" Header="6 号档口" Style="{DynamicResource from}" Tag="Start">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="460" Width="450" Header="2 号档口" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="设备运行情况" Margin="20,10,0,0"/>
<Grid Height="160" >
@@ -33,7 +33,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -47,23 +47,12 @@
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备是否运行</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备当前状态</TextBlock>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_6,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="刷卡信息统计" Margin="20,10,0,0"/>
<GroupBox Header="当前操作信息" Margin="20,10,0,0"/>
<Grid Height="160">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@@ -71,25 +60,23 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardNameBefore_6,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">前一位刷卡人</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="#FFEC3107" FontSize="52" Text="{Binding YCDdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">异常刷卡数</TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="{Binding ViewData.SplitMeals_CreditCardName_6,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前刷卡人</TextBlock>
</StackPanel>
</Grid>

</StackPanel>

</GroupBox>
<GroupBox Margin="0,20,10,0" Height="480" Width="450" Header="今日菜品列表" Style="{DynamicResource from}" Tag="Start">
<ListBox ItemsSource="{Binding CookTypeListLeft,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox ItemsSource="{Binding ViewData.SplitMeals_CookType_6,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
<Button Width="170" Height="100" Margin="20,20,0,0" Content="{Binding Name}"/>
<Button Width="170" Height="100" Margin="20,20,0,0" Content="{Binding Name1}"/>
<Button Width="370" Height="100" Margin="20,20,0,0" FontSize="60" Content="{Binding .}"/>
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>
@@ -103,41 +90,32 @@
<wv2:WebView2 Name="webView" Source="{Binding GgAdder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Grid>
</GroupBox>

<StackPanel Orientation="Horizontal">
<GroupBox Margin="5,0,0,0" Height="340" Width="470" Header="今日菜品刷卡统计图" Style="{DynamicResource from}">
<StackPanel>
<con:BasicBarChart Margin="30,40,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" SeriesArray="{Binding Histogram,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="410" Height="200" ShowSize="50"></con:BasicBarChart>
</StackPanel>
</GroupBox>

<GroupBox Margin="10,0,0,0" Height="340" Width="470" Header="设备告警详情" Style="{DynamicResource from}">
<DataGrid Margin="0,10,0,0" ItemsSource="{Binding AlarmList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="160">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#FFD86E03" FontSize="14" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="300">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#FFD86E03" FontSize="14" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</StackPanel>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="告警信息展示区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="250">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</StackPanel>

<StackPanel Grid.Column="2" Margin="0,10,0,0">
@@ -151,7 +129,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -165,23 +143,12 @@
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备是否运行</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备当前状态</TextBlock>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_5,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="刷卡信息统计" Margin="20,10,0,0"/>
<GroupBox Header="当前操作信息" Margin="20,10,0,0"/>
<Grid Height="160">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@@ -189,25 +156,23 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardNameBefore_5,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">前一位刷卡人</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="#FFEC3107" FontSize="52" Text="{Binding YCDdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">异常刷卡数</TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="{Binding ViewData.SplitMeals_CreditCardName_5,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前刷卡人</TextBlock>
</StackPanel>
</Grid>

</StackPanel>

</GroupBox>
<GroupBox Margin="0,20,10,0" Height="480" Width="450" Header="今日菜品列表" Style="{DynamicResource from}" Tag="Start">
<ListBox ItemsSource="{Binding CookTypeListReit,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox ItemsSource="{Binding ViewData.SplitMeals_CookType_5,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
<Button Width="170" Height="100" Margin="20,20,0,0" Content="{Binding Name}"/>
<Button Width="170" Height="100" Margin="20,20,0,0" Content="{Binding Name1}"/>
<Button Width="370" Height="100" Margin="20,20,0,0" FontSize="60" Content="{Binding .}"/>
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>


+ 17
- 102
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl3ViewModel.cs Dosyayı Görüntüle

@@ -1,4 +1,5 @@
using BPA.Helper;
using BPA.Message;
using BPA.Message.Enum;
using System;
using System.Collections.Generic;
@@ -14,132 +15,46 @@ namespace BPASmartClient.ScreenLib
public class ScreenSplitMealsControl3ViewModel : NotifyBase
{
#region 变量
/// <summary>
/// 柱状图显示集合
/// </summary>
public IEnumerable<KeyValuePair<string, double>> Histogram { get { return _Histogram; } set { _Histogram = value; OnPropertyChanged(); } }
private IEnumerable<KeyValuePair<string, double>> _Histogram = new List<KeyValuePair<string, double>>();

/// <summary>
/// 设备是否运行
/// </summary>
public DevIsRun DevIsRun { get { return _DevIsRun; } set { _DevIsRun = value; OnPropertyChanged(); } }
private DevIsRun _DevIsRun = DevIsRun.停止;

/// <summary>
/// 设备状态
/// </summary>
public DevRunStatus RunStatus { get { return _RunStatus; } set { _RunStatus = value; OnPropertyChanged(); } }
private DevRunStatus _RunStatus = DevRunStatus.正常;

/// <summary>
/// 订单数
/// </summary>
public int DdCount { get { return _DdCount; } set { _DdCount = value; OnPropertyChanged(); } }
private int _DdCount = 0;

/// <summary>
/// 异常订单数
/// </summary>
public int YCDdCount { get { return _YCDdCount; } set { _YCDdCount = value; OnPropertyChanged(); } }
private int _YCDdCount = 0;

/// <summary>
/// 广告地址
/// </summary>
public Uri GgAdder { get { return _GgAdder; } set { _GgAdder = value; OnPropertyChanged(); } }
private Uri _GgAdder = new Uri(System.Configuration.ConfigurationManager.AppSettings["GgAdder"].ToString());

/// <summary>
/// 告警数据
/// 界面数据绑定
/// </summary>
public ObservableCollection<AlarmMsModel> AlarmList
public ScreenModelSplitMeals ViewData
{
get { return _AlarmList; }
get { return _ViewData; }
set
{
_AlarmList = value;
_ViewData = value;
OnPropertyChanged();
}
}
private ObservableCollection<AlarmMsModel> _AlarmList = new ObservableCollection<AlarmMsModel>();
private ScreenModelSplitMeals _ViewData = new ScreenModelSplitMeals();

/// <summary>
/// 菜品类型-左
/// 当前刷新数据类型
/// </summary>
public ObservableCollection<CookType> CookTypeListLeft
{
get { return _CookTypeListLeft; }
set
{
_CookTypeListLeft = value;
OnPropertyChanged();
}
}
private ObservableCollection<CookType> _CookTypeListLeft = new ObservableCollection<CookType>();

/// <summary>
/// 菜品类型-右边
/// </summary>
public ObservableCollection<CookType> CookTypeListReit
{
get { return _CookTypeListReit; }
set
{
_CookTypeListReit = value;
OnPropertyChanged();
}
}
private ObservableCollection<CookType> _CookTypeListReit = new ObservableCollection<CookType>();
public ScreenDeviceType type = ScreenDeviceType.分餐机;
#endregion
public ScreenSplitMealsControl3ViewModel()
{
Init();
}

/// <summary>
/// 初始化
/// </summary>
public void Init()
public ScreenSplitMealsControl3ViewModel()
{
ThreadManage.GetInstance().StartLong(new Action(() =>
{
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() =>
{
RunStatus = RunStatus == DevRunStatus.正常 ? DevRunStatus.异常 : DevRunStatus.正常;
DevIsRun = DevIsRun == DevIsRun.运行 ? DevIsRun.停止 : DevIsRun.运行;
DdCount = new Random().Next(0, 400);
YCDdCount = new Random().Next(0, 400);

List<ORDER_STATUS> oRDER_s = new List<ORDER_STATUS>() { ORDER_STATUS.WAIT, ORDER_STATUS.COOKING };
List<ORDER_STATUS> oRDER_s1 = new List<ORDER_STATUS>() { ORDER_STATUS.COMPLETED_COOK, ORDER_STATUS.COMPLETED_TAKE };

List<string> name_s = new List<string>() { "担担面", "鸡蛋面", "火鸡面", "扬州炒饭", "回锅肉盖饭", "炒茄子" };
CookTypeListReit = new ObservableCollection<CookType>();
CookTypeListReit.Add(new CookType { Name = name_s[0], Name1 = name_s[1] });
CookTypeListReit.Add(new CookType { Name = name_s[2], Name1 = name_s[3] });
CookTypeListReit.Add(new CookType { Name = name_s[4], Name1 = name_s[5] });

CookTypeListLeft = new ObservableCollection<CookType>();
CookTypeListLeft.Add(new CookType { Name = name_s[0], Name1 = name_s[1] });
CookTypeListLeft.Add(new CookType { Name = name_s[2], Name1 = name_s[3] });
CookTypeListLeft.Add(new CookType { Name = name_s[4], Name1 = name_s[5] });

AlarmList = new ObservableCollection<AlarmMsModel>();
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
Histogram = new[] {
new KeyValuePair<string, double>(name_s[0], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[1], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[2], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[3], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[4], new Random().Next(0,400))};
if (Main.GetInstance.mqttDatasDic.ContainsKey(type))
{
ScreenModelSplitMeals modelMaxWok = Main.GetInstance.mqttDatasDic[type] as ScreenModelSplitMeals;
if (modelMaxWok != null && modelMaxWok.Alarm != null)
modelMaxWok.Alarm = modelMaxWok.Alarm?.OrderByDescending(k => DateTime.Parse(k.AlarmTime)).ToList();
ViewData = modelMaxWok;
}
}));
Thread.Sleep(5000);
Thread.Sleep(1000);
}), $"{DateTime.Now}_3,线程服务");
}
}


+ 272
- 114
BPASmartClient.ScreenLib/总监视大屏/ScreenALLControl.xaml Dosyayı Görüntüle

@@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.ScreenLib"
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
xmlns:con="clr-namespace:BPA.CustomResource.UserControls;assembly=BPA.CustomResource"
mc:Ignorable="d"
d:DesignHeight="1080" d:DesignWidth="1920">
@@ -13,6 +13,135 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPA.CustomResource;component/Themes/ProlineStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="bfb" TargetType="{x:Type ProgressBar}">
<Setter Property="Foreground" Value="{StaticResource ProgressBar.Progress}" />
<Setter Property="Background" Value="{StaticResource ProgressBar.Background}" />
<Setter Property="BorderBrush" Value="{StaticResource ProgressBar.Border}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Height" Value="16" />
<Setter Property="Width" Value="100" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ProgressBar}">
<ControlTemplate.Resources>
<Storyboard x:Key="maindh" RepeatBehavior="Forever">
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="dh" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
<EasingDoubleKeyFrame KeyTime="0" Value="0.25" />
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.25" />
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.25" />
</DoubleAnimationUsingKeyFrames>
<PointAnimationUsingKeyFrames Storyboard.TargetName="dh" Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)">
<EasingPointKeyFrame KeyTime="0" Value="-0.5,0.5" />
<EasingPointKeyFrame KeyTime="0:0:1" Value="0.5,0.5" />
<EasingPointKeyFrame KeyTime="0:0:2" Value="1.5,0.5" />
</PointAnimationUsingKeyFrames>
</Storyboard>
</ControlTemplate.Resources>
<Grid x:Name="TemplateRoot">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Opacity="0.3" />
<Rectangle x:Name="PART_Track" />
<Grid
x:Name="PART_Indicator"
HorizontalAlignment="Left"
ClipToBounds="true">
<Rectangle x:Name="dh" Fill="{DynamicResource ProgressBar.动画}">
<Rectangle.RenderTransform>
<TransformGroup>
<!-- 缩放变换 -->
<ScaleTransform ScaleX="1" ScaleY="1" />
<!-- 倾斜变换 -->
<SkewTransform AngleX="-45" AngleY="0" />
<!-- 旋转变换 -->
<RotateTransform Angle="0" />
<!-- 移动变换 -->
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<Rectangle
x:Name="Indicator"
Fill="{TemplateBinding Foreground}"
Visibility="Collapsed" />
<Rectangle
x:Name="Animation"
Fill="{DynamicResource ProgressBar.动画}"
RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<!-- 缩放变换 -->
<ScaleTransform ScaleX="1" ScaleY="1" />
<!-- 倾斜变换 -->
<SkewTransform AngleX="-45" AngleY="0" />
<!-- 旋转变换 -->
<RotateTransform Angle="0" />
<!-- 移动变换 -->
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
</Grid>
<TextBlock
x:Name="textBlock"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="../Fonts/#Quartz M"
FontSize="12"
Foreground="{DynamicResource Titleforeground}"
Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value, StringFormat={}百分比: {0:f2} %}"
Visibility="Collapsed" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Determinate" />
<VisualState x:Name="Indeterminate">
<Storyboard RepeatBehavior="Forever">
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Animation" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
<EasingDoubleKeyFrame KeyTime="0" Value="0.25" />
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.25" />
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.25" />
</DoubleAnimationUsingKeyFrames>
<PointAnimationUsingKeyFrames Storyboard.TargetName="Animation" Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)">
<EasingPointKeyFrame KeyTime="0" Value="-0.5,0.5" />
<EasingPointKeyFrame KeyTime="0:0:1" Value="0.5,0.5" />
<EasingPointKeyFrame KeyTime="0:0:2" Value="1.5,0.5" />
</PointAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="Orientation" Value="Vertical">
<Setter TargetName="TemplateRoot" Property="LayoutTransform">
<Setter.Value>
<RotateTransform Angle="90" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsIndeterminate" Value="true">
<Setter TargetName="Indicator" Property="Visibility" Value="Collapsed" />
<Setter TargetName="dh" Property="Visibility" Value="Collapsed" />
<Setter TargetName="Animation" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsIndeterminate" Value="False">
<Setter TargetName="Indicator" Property="Visibility" Value="Visible" />
<Setter TargetName="dh" Property="Visibility" Value="Visible" />
<Setter TargetName="Animation" Property="Visibility" Value="Collapsed" />
</Trigger>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard Storyboard="{StaticResource maindh}" />
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
@@ -25,7 +154,7 @@
<StackPanel Margin="0,10,0,0">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="310" Width="450" Header="大炒设备" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="1 号炒锅" Margin="20,0,0,0"/>
<GroupBox Header="设备信息" Margin="20,0,0,0"/>
<Grid Height="80" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@@ -33,7 +162,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="60" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData[大炒].IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -45,46 +174,66 @@
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">设备状态</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">今日刷卡数</TextBlock>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding MaxCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock FontSize="42" Text="/"></TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding ViewData[大炒].FailuresCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
</StackPanel>
<TextBlock Style="{DynamicResource textms}" >订单总数/故障数</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="2 号炒锅" Margin="20,0,0,0"/>
<GroupBox Header="工作状态" Margin="20,0,0,0"/>
<Grid Height="80">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="60" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData[大炒].WorkStatus_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Trigger Property="Text" Value="待机">
<Setter Property="Foreground" Value="Yellow"/>
</Trigger>
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource textms}" >1号炒锅</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">今日刷卡数</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData[大炒].WorkStatus_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="待机">
<Setter Property="Foreground" Value="Yellow"/>
</Trigger>
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" >2号炒锅</TextBlock>
</StackPanel>
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Grid.Row="0" Margin="10,10,10,0" Height="320" Width="450" Header="小炒设备" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="1 号炒锅" Margin="20,0,0,0"/>
<GroupBox Header="设备信息" Margin="20,0,0,0"/>
<Grid Height="80" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@@ -92,7 +241,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="60" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData[小炒].IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -104,46 +253,66 @@
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">设备状态</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">今日刷卡数</TextBlock>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding MinCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock FontSize="42" Text="/"></TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding ViewData[小炒].FailuresCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
</StackPanel>
<TextBlock Style="{DynamicResource textms}" >订单总数/故障数</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="2 号炒锅" Margin="20,0,0,0"/>
<GroupBox Header="工作状态" Margin="20,0,0,0"/>
<Grid Height="80">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="60" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData[小炒].WorkStatus_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Trigger Property="Text" Value="待机">
<Setter Property="Foreground" Value="Yellow"/>
</Trigger>
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource textms}" >1号炒锅</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">今日刷卡数</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData[小炒].WorkStatus_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="待机">
<Setter Property="Foreground" Value="Yellow"/>
</Trigger>
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" >2号炒锅</TextBlock>
</StackPanel>
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Grid.Row="0" Margin="10,10,10,0" Height="310" Width="450" Header="煮面设备 MorkS" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="设备运行情况" Margin="20,0,0,0"/>
<GroupBox Header="设备信息" Margin="20,0,0,0"/>
<Grid Height="80" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@@ -151,7 +320,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="60" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData[煮面机].IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -163,25 +332,28 @@
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19" >设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">设备状态</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData[煮面机].WorkStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Trigger Property="Text" Value="待机">
<Setter Property="Foreground" Value="Yellow"/>
</Trigger>
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">设备当前状态</TextBlock>
<TextBlock Style="{DynamicResource textms}" >工作状态</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="订单信息统计" Margin="20,0,0,0"/>
<GroupBox Header="信息统计" Margin="20,0,0,0"/>
<Grid Height="80">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@@ -189,29 +361,50 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="60" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">今日订单数</TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding ViewData[煮面机].MorkS_OrderCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" >订单数</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="#FFEC3107" FontSize="42" Text="{Binding YCDdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">异常订单数</TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding ViewData[煮面机].FailuresCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" >故障数</TextBlock>
</StackPanel>
</Grid>
</StackPanel>
</GroupBox>
</StackPanel>
<Grid Grid.Column="1" >
<Grid> <Grid VerticalAlignment="Top" Margin="0,-30,0,0"> <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="10000" Style="{DynamicResource GroupStyle圆形}" Tag="累计收入" Content="万元" Width="100"/> <GroupBox Margin="600,400,0,0" Header="988" Style="{DynamicResource GroupStyle圆形}" Tag="累计刷卡" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障" Content="次" Width="160"/> </Grid> <GroupBox Margin="10,10,10,10" Height="260" Width="940" HorizontalAlignment="Center" VerticalAlignment="Bottom" Style="{DynamicResource fromNoTitle}"> <Grid Margin="0,10,0,0"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid> <GroupBox Header="商品分布图" Margin="20,0,0,0"/>
<con:RadarChart x:Name="生存图示例" Margin="0,10,0,0" Width="120" Height="150" RadarArray="{Binding RadarModelList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ></con:RadarChart> </Grid> <Grid Grid.Column="1"> <GroupBox Header="商品统计图" Margin="20,0,0,0"/>
<con:BasicBarChart Margin="30,20,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" SeriesArray="{Binding Histogram,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="370" Height="150" ShowSize="50"></con:BasicBarChart>
</Grid> </Grid> </GroupBox> </Grid>
<Grid> <Grid VerticalAlignment="Top" Margin="0,-30,0,0"> <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding GZallCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="{Binding SplitMealsCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="食堂累计刷卡次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding UserCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid> <GroupBox Margin="0,0,0,10" Height="310" Width="950" VerticalAlignment="Bottom" Header="告警信息展示区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding AlarmAll,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="250">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox> </Grid>
</Grid>
<StackPanel Grid.Column="2" Margin="0,10,0,0">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="420" Width="450" Header="分餐机设备" Style="{DynamicResource from}" Tag="Start">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="310" Width="450" Header="分餐机设备" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="1 号分餐机" Margin="20,0,0,0"/>
<GroupBox Header="设备信息" Margin="20,0,0,0"/>
<Grid Height="80" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@@ -219,7 +412,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="60" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData[分餐机].IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -231,102 +424,67 @@
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">设备状态</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">今日刷卡数</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="2 号分餐机" Margin="20,0,0,0"/>
<Grid Height="80" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="60" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData[分餐机].WorkStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Trigger Property="Text" Value="待机">
<Setter Property="Foreground" Value="Yellow"/>
</Trigger>
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">设备是否运行</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">今日刷卡数</TextBlock>
<TextBlock Style="{DynamicResource textms}" >工作状态</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="3 号分餐机" Margin="20,0,0,0"/>
<Grid Height="80" >
<GroupBox Header="信息统计" Margin="20,0,0,0"/>
<Grid Height="80">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="60" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding SplitMealsCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" >刷卡总数</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,0,0,0" FontSize="19">今日刷卡数</TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="42" Foreground="#FFD2C106" Text="{Binding ViewData[分餐机].FailuresCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" >故障数</TextBlock>
</StackPanel>
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Margin="10,10,10,0" Height="260" Width="450" Header="今日商品统计图" Style="{DynamicResource from}">
<StackPanel>
<con:BasicBarChart Margin="30,20,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" SeriesArray="{Binding Histogram,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="410" Height="160" ShowSize="50"></con:BasicBarChart>
</StackPanel>
</GroupBox>
<GroupBox Margin="10,10,10,0" Height="640" Width="450" Header="今日商品热销统计" Style="{DynamicResource from}">
<ListBox
Background="Transparent"
BorderThickness="0"
ItemsSource="{Binding StatsCountAll,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel x:Name="mainPanel1" Margin="15,10,0,0" >
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Style="{DynamicResource textms}" Margin="10,10,0,0" FontSize="20" Text="{Binding Name}"/>
<TextBlock HorizontalAlignment="Left" Style="{DynamicResource textms}" Margin="10,10,0,0" FontSize="20" Text="/"/>
<TextBlock HorizontalAlignment="Left" Style="{DynamicResource textms}" Margin="10,10,0,0" FontSize="20" Text="{Binding Count, StringFormat={}{0} 单}"/>
</StackPanel>
<Grid HorizontalAlignment="Left" Margin="0,10,0,0">
<ProgressBar Style="{DynamicResource bfb}" Value="{Binding bfb,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="360" Height="35" Margin="10,0,0,0"></ProgressBar>
</Grid>
<GroupBox Margin="10,10,10,0" Height="260" Width="450" Header="设备告警详情" Style="{DynamicResource from}">
<DataGrid Margin="0,10,0,0" ItemsSource="{Binding AlarmList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="160">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#FFD86E03" FontSize="14" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="300">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#FFD86E03" FontSize="14" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
</StackPanel>
</Grid>

+ 159
- 129
BPASmartClient.ScreenLib/总监视大屏/ScreenALLControlViewModel.cs Dosyayı Görüntüle

@@ -1,6 +1,8 @@
using BPA.CustomResource.UserControls;
using BPA.Helper;
using BPA.Message;
using BPA.Message.Enum;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -15,99 +17,125 @@ namespace BPASmartClient.ScreenLib
{
#region 变量
/// <summary>
/// 柱状图显示集合
/// 广告地址
/// </summary>
public IEnumerable<KeyValuePair<string, double>> Histogram { get { return _Histogram; } set { _Histogram = value; OnPropertyChanged(); } }
private IEnumerable<KeyValuePair<string, double>> _Histogram = new List<KeyValuePair<string, double>>();

public Uri GgAdder { get { return _GgAdder; } set { _GgAdder = value; OnPropertyChanged(); } }
private Uri _GgAdder = new Uri(System.Configuration.ConfigurationManager.AppSettings["GgAdder"].ToString());

/// <summary>
/// 分布统计图
/// 界面数据绑定
/// </summary>
public ObservableCollection<RadarModel> RadarModelList
public Dictionary<ScreenDeviceType, object> ViewData
{
get { return _RadarModelList; }
get { return _ViewData; }
set
{
_RadarModelList = value;
_ViewData = value;
OnPropertyChanged();
}
}
private ObservableCollection<RadarModel> _RadarModelList = new ObservableCollection<RadarModel>();
private Dictionary<ScreenDeviceType, object> _ViewData = new Dictionary<ScreenDeviceType, object>();

/// <summary>
/// 设备是否运行
/// 小炒总数
/// </summary>
public DevIsRun DevIsRun { get { return _DevIsRun; } set { _DevIsRun = value; OnPropertyChanged(); } }
private DevIsRun _DevIsRun = DevIsRun.停止;
public int MinCout
{
get { return _MinCout; }
set
{
_MinCout = value;
OnPropertyChanged();
}
}
private int _MinCout = 0;

/// <summary>
/// 设备状态
/// 大炒总数
/// </summary>
public DevRunStatus RunStatus { get { return _RunStatus; } set { _RunStatus = value; OnPropertyChanged(); } }
private DevRunStatus _RunStatus = DevRunStatus.正常;
public int MaxCout
{
get { return _MaxCout; }
set
{
_MaxCout = value;
OnPropertyChanged();
}
}
private int _MaxCout = 0;

/// <summary>
/// 订单数
/// </summary>
public int DdCount { get { return _DdCount; } set { _DdCount = value; OnPropertyChanged(); } }
private int _DdCount = 0;

/// <summary>
/// 异常订单
/// 分餐区总数
/// </summary>
public int YCDdCount { get { return _YCDdCount; } set { _YCDdCount = value; OnPropertyChanged(); } }
private int _YCDdCount = 0;
public int SplitMealsCout
{
get { return _SplitMealsCout; }
set
{
_SplitMealsCout = value;
OnPropertyChanged();
}
}
private int _SplitMealsCout = 0;


/// <summary>
/// 广告地址
/// 日总接待人数
/// </summary>
public Uri GgAdder { get { return _GgAdder; } set { _GgAdder = value; OnPropertyChanged(); } }
private Uri _GgAdder = new Uri(System.Configuration.ConfigurationManager.AppSettings["GgAdder"].ToString());
public int UserCout
{
get { return _UserCout; }
set
{
_UserCout = value;
OnPropertyChanged();
}
}
private int _UserCout = 0;

/// <summary>
/// 正在制作订单数据
/// 累计故障数
/// </summary>
public ObservableCollection<OrderMakeModel> OrderMakeList
public int GZallCout
{
get { return _OrderMakeList; }
get { return _GZallCout; }
set
{
_OrderMakeList = value;
_GZallCout = value;
OnPropertyChanged();
}
}
private ObservableCollection<OrderMakeModel> _OrderMakeList = new ObservableCollection<OrderMakeModel>();
private int _GZallCout = 0;


/// <summary>
/// 制作完成订单数据
/// 总告警列表
/// </summary>
public ObservableCollection<OrderMakeModel> OrderMakeListOver
public ObservableCollection<AlarmModel> AlarmAll
{
get { return _OrderMakeListOver; }
get { return _AlarmAll; }
set
{
_OrderMakeListOver = value;
_AlarmAll = value;
OnPropertyChanged();
}
}
private ObservableCollection<OrderMakeModel> _OrderMakeListOver = new ObservableCollection<OrderMakeModel>();
private ObservableCollection<AlarmModel> _AlarmAll =new ObservableCollection<AlarmModel>();

/// <summary>
/// 告警数据
/// 今日商品热销统计
/// </summary>
public ObservableCollection<AlarmMsModel> AlarmList
public ObservableCollection<StatsAllModel> StatsCountAll
{
get { return _AlarmList; }
get { return _StatsBFB; }
set
{
_AlarmList = value;
_StatsBFB = value;
OnPropertyChanged();
}
}
private ObservableCollection<AlarmMsModel> _AlarmList = new ObservableCollection<AlarmMsModel>();


private ObservableCollection<StatsAllModel> _StatsBFB = new ObservableCollection<StatsAllModel>();
#endregion
public ScreenALLControlViewModel()
{
@@ -123,94 +151,96 @@ namespace BPASmartClient.ScreenLib
{
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() =>
{
RunStatus = RunStatus == DevRunStatus.正常 ? DevRunStatus.异常 : DevRunStatus.正常;
DevIsRun = DevIsRun == DevIsRun.运行 ? DevIsRun.停止 : DevIsRun.运行;
DdCount = new Random().Next(0, 400);
YCDdCount = new Random().Next(0, 400);

List<ORDER_STATUS> oRDER_s = new List<ORDER_STATUS>() { ORDER_STATUS.WAIT, ORDER_STATUS.COOKING };
List<ORDER_STATUS> oRDER_s1 = new List<ORDER_STATUS>() { ORDER_STATUS.COMPLETED_COOK, ORDER_STATUS.COMPLETED_TAKE };

List<string> name_s = new List<string>() { "担担面", "鸡蛋面", "火鸡面", "扬州炒饭", "回锅肉盖饭" };
OrderMakeList = new ObservableCollection<OrderMakeModel>();
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "011", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "012", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "013", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "014", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });

OrderMakeListOver = new ObservableCollection<OrderMakeModel>();
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "001", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "002", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "003", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "005", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "006", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "008", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "009", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "010", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });


AlarmList = new ObservableCollection<AlarmMsModel>();
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
Histogram = new[] {
new KeyValuePair<string, double>(name_s[0], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[1], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[2], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[3], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[4], new Random().Next(0,400))};

RadarModelList = new ObservableCollection<RadarModel>();
RadarModelList.Add(new RadarModel { Text = name_s[0], ValueMax = new Random().Next(0, 100) });
RadarModelList.Add(new RadarModel { Text = name_s[1], ValueMax = new Random().Next(0, 100) });
RadarModelList.Add(new RadarModel { Text = name_s[2], ValueMax = new Random().Next(0, 100) });
RadarModelList.Add(new RadarModel { Text = name_s[3], ValueMax = new Random().Next(0, 100) });
RadarModelList.Add(new RadarModel { Text = name_s[4], ValueMax = new Random().Next(0, 100) });

ViewData = Main.GetInstance.mqttDatasDic;
List<AlarmModel> alarms = new List<AlarmModel>();
List<StatsModel> Stats = new List<StatsModel>();
foreach (var item in Main.GetInstance.mqttDatasDic)
{
if (item.Value != null)
{
if((item.Value as ScreenModelBase).Alarm!=null)
alarms.AddRange((item.Value as ScreenModelBase).Alarm);
if ((item.Value as ScreenModelBase).StatsCount != null)
Stats.AddRange((item.Value as ScreenModelBase).StatsCount);
}
}

AlarmAll.Clear();
alarms?.OrderByDescending(k => DateTime.Parse(k.AlarmTime))?.ToList().ForEach(alarm => {
AlarmAll.Add(alarm);
});


int gz = 0;
if (ViewData.ContainsKey(ScreenDeviceType.小炒))
{
ScreenModelMinWok min = ViewData[ScreenDeviceType.小炒] as ScreenModelMinWok;
MinCout = min.MinWok_OrderCount_1 + min.MinWok_OrderCount_2;
gz += min.FailuresCount;
}

if (ViewData.ContainsKey(ScreenDeviceType.大炒))
{
ScreenModelMaxWok min = ViewData[ScreenDeviceType.大炒] as ScreenModelMaxWok;
MaxCout = min.MaxWok_OrderCount_1 + min.MaxWok_OrderCount_2;
gz += min.FailuresCount;

}

if (ViewData.ContainsKey(ScreenDeviceType.分餐机))
{
ScreenModelSplitMeals min = ViewData[ScreenDeviceType.分餐机] as ScreenModelSplitMeals;
SplitMealsCout = min.SplitMeals_CreditCardCount_1 + min.SplitMeals_CreditCardCount_2
+ min.SplitMeals_CreditCardCount_3 + min.SplitMeals_CreditCardCount_4
+ min.SplitMeals_CreditCardCount_5 + min.SplitMeals_CreditCardCount_6;
gz += min.FailuresCount;

}

int zmj_count = 0;
if (ViewData.ContainsKey(ScreenDeviceType.煮面机))
{
ScreenModelMorkS morks = ViewData[ScreenDeviceType.煮面机] as ScreenModelMorkS;
zmj_count = morks.MorkS_OrderCount;
gz += morks.FailuresCount;

}
UserCout = SplitMealsCout + MaxCout + MinCout + zmj_count;

GZallCout = gz;


if (Stats != null && Stats.Count > 0)
{
Dictionary<string, int> _Stats = new Dictionary<string, int>();
foreach (StatsModel item in Stats)
{
if(!_Stats.ContainsKey(item.Name))
_Stats[item.Name]= item.Count;
else
_Stats[item.Name] += item.Count;
}
List<StatsAllModel> _Statsall = new List<StatsAllModel>();
_Stats?.ToList().ForEach(par => {
_Statsall.Add(new StatsAllModel { Name = par.Key,Count = par.Value });
});
int maxcount = Stats.Max(k => k.Count);
_Statsall?.ForEach(par =>
{
par.bfb = (int)(((double)par.Count / (double)maxcount) * 100.0);
});
string str = JsonConvert.SerializeObject(_Statsall?.OrderByDescending(k => k.Count)?.ToList());
StatsCountAll= JsonConvert.DeserializeObject<ObservableCollection<StatsAllModel>>(str);
}
}));
Thread.Sleep(5000);
Thread.Sleep(2000);
}), $"{DateTime.Now},线程服务");
}
}

public class StatsAllModel: StatsModel
{
public int bfb { get; set; }
}
}

+ 160
- 115
BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControl.xaml Dosyayı Görüntüle

@@ -33,7 +33,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -45,32 +45,99 @@
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备状态</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Trigger Property="Text" Value="待机">
<Setter Property="Foreground" Value="Yellow"/>
</Trigger>
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备当前状态</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">工作状态</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="正在炒制菜品" Margin="20,10,0,0"/>
<GroupBox Header="炒锅运行情况" Margin="20,10,0,0"/>
<Grid Height="100">
<TextBlock FontSize="60" Foreground="#FFD2C106">炒制作中</TextBlock>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock FontSize="40" Text="{Binding ViewData.MaxWok_Task_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock FontSize="40" Foreground="#FFD2C106" Text="{Binding ViewData.MaxWok_Dishes_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}-{0:f2}}"></TextBlock>
</StackPanel>
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Margin="10,20,10,0" Height="275" Width="450" Header="设备当前流程" Style="{DynamicResource from}" Tag="Start">
<Grid>
<ListBox x:Name="PageList" BorderThickness="0" Margin="0,-20,0,0" Height="270" HorizontalAlignment="Stretch" VerticalAlignment="Top"
ItemsSource="{Binding ViewData.MaxWok_Process_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Background="Transparent" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" >
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Width="500"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<DataTemplate.Resources>
<Storyboard RepeatBehavior="Forever" x:Key="csd_dh">
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.5" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:01" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:1.5" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:2" Value="{x:Static Visibility.Visible}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</DataTemplate.Resources>
<Grid Margin="0,10,0,0" Height="100" Width="130" VerticalAlignment="Top" HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<Border Background="{DynamicResource 椭圆}" >
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock x:Name="wb" FontSize="32" Text="{Binding Name}"></TextBlock>
<TextBlock x:Name="xs" Style="{DynamicResource 数码管Text}" FontSize="24" Margin="0,0,0,0" Text="{Binding Id}"></TextBlock>
</StackPanel>
</Border>
<Image x:Name="image" Grid.Column="1" Style="{DynamicResource image右1}" Cursor="Hand" ></Image>
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsRun}" Value="true">
<Setter TargetName="xs" Property="Foreground" Value="#FFD2C106"/>
<Setter TargetName="wb" Property="Foreground" Value="#FFD2C106"/>
<DataTrigger.EnterActions>
<BeginStoryboard x:Name="begin_name" Storyboard="{StaticResource csd_dh}"/>
</DataTrigger.EnterActions>
</DataTrigger>
<DataTrigger Binding="{Binding IsRun}" Value="false">
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="begin_name"/>
</DataTrigger.EnterActions>
<Setter TargetName="xs" Property="Foreground" Value="#a2c2e8"/>
<Setter TargetName="wb" Property="Foreground" Value="#a2c2e8"/>
</DataTrigger>

<DataTrigger Binding="{Binding Id}" Value="4">
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="begin_name"/>
</DataTrigger.EnterActions>
<Setter TargetName="image" Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</GroupBox>
<GroupBox Margin="10,20,10,0" Height="275" Width="450" Header="设备当前状态" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
@@ -81,33 +148,11 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MaxWok_HeatGear_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2} 档}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">炒锅加热挡位</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MaxWok_StirGear_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2} 档}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">炒锅搅拌挡位</TextBlock>
</StackPanel>
</Grid>
@@ -118,33 +163,11 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MaxWok_FlipSpeed_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2}rpm}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">炒锅翻转速度</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MaxWok_Temp_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2}°C}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前锅底温度</TextBlock>
</StackPanel>
</Grid>
@@ -160,15 +183,15 @@
</GroupBox>

<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="告警信息展示区域" Style="{DynamicResource from}">
<DataGrid Margin="0,10,0,0" ItemsSource="{Binding AlarmList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="160">
<DataGridTemplateColumn Width="250">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#FFD86E03" FontSize="14" HorizontalAlignment="Center"/>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
@@ -178,7 +201,7 @@
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#FFD86E03" FontSize="14" HorizontalAlignment="Center"/>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
@@ -190,7 +213,7 @@
<StackPanel Grid.Column="2" Margin="0,10,0,0">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="370" Width="450" Header="1 号炒锅" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="设备运行状态" Margin="20,10,0,0"/>
<GroupBox Header="设备运行情况" Margin="20,10,0,0"/>
<Grid Height="100" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@@ -198,7 +221,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -210,32 +233,98 @@
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备状态</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Trigger Property="Text" Value="待机">
<Setter Property="Foreground" Value="Yellow"/>
</Trigger>
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备当前状态</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">工作状态</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="炒锅运行情况" Margin="20,10,0,0"/>
<Grid Height="100">
<TextBlock FontSize="60" Foreground="#FFD2C106">炒制作中</TextBlock>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock FontSize="40" Text="{Binding ViewData.MaxWok_Task_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock FontSize="40" Foreground="#FFD2C106" Text="{Binding ViewData.MaxWok_Dishes_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}-{0:f2}}"></TextBlock>
</StackPanel>
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Margin="10,20,10,0" Height="275" Width="450" Header="设备当前流程" Style="{DynamicResource from}" Tag="Start">
<Grid>
<ListBox BorderThickness="0" Margin="0,-20,0,0" Height="270" HorizontalAlignment="Stretch" VerticalAlignment="Top"
ItemsSource="{Binding ViewData.MaxWok_Process_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Background="Transparent" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" >
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Width="500"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<DataTemplate.Resources>
<Storyboard RepeatBehavior="Forever" x:Key="csd_dh">
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.5" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:01" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:1.5" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:2" Value="{x:Static Visibility.Visible}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</DataTemplate.Resources>
<Grid Margin="0,10,0,0" Height="100" Width="130" VerticalAlignment="Top" HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<Border Background="{DynamicResource 椭圆}" >
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock x:Name="wb" FontSize="32" Text="{Binding Name}"></TextBlock>
<TextBlock x:Name="xs" Style="{DynamicResource 数码管Text}" FontSize="24" Margin="0,0,0,0" Text="{Binding Id}"></TextBlock>
</StackPanel>
</Border>
<Image x:Name="image" Grid.Column="1" Style="{DynamicResource image右1}" Cursor="Hand" ></Image>
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsRun}" Value="true">
<Setter TargetName="xs" Property="Foreground" Value="#FFD2C106"/>
<Setter TargetName="wb" Property="Foreground" Value="#FFD2C106"/>
<DataTrigger.EnterActions>
<BeginStoryboard x:Name="begin_name" Storyboard="{StaticResource csd_dh}"/>
</DataTrigger.EnterActions>
</DataTrigger>
<DataTrigger Binding="{Binding IsRun}" Value="false">
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="begin_name"/>
</DataTrigger.EnterActions>
<Setter TargetName="xs" Property="Foreground" Value="#a2c2e8"/>
<Setter TargetName="wb" Property="Foreground" Value="#a2c2e8"/>
</DataTrigger>
<DataTrigger Binding="{Binding Id}" Value="4">
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="begin_name"/>
</DataTrigger.EnterActions>
<Setter TargetName="image" Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</GroupBox>
<GroupBox Margin="10,20,10,0" Height="275" Width="450" Header="设备当前状态" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
@@ -246,33 +335,11 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MaxWok_HeatGear_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2} 档}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">炒锅加热挡位</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MaxWok_StirGear_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2} 档}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">炒锅搅拌挡位</TextBlock>
</StackPanel>
</Grid>
@@ -283,33 +350,11 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MaxWok_FlipSpeed_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2}rpm}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">炒锅翻转速度</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MaxWok_Temp_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2}°C}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前锅底温度</TextBlock>
</StackPanel>
</Grid>


+ 17
- 133
BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControlViewModel.cs Dosyayı Görüntüle

@@ -1,4 +1,5 @@
using BPA.Helper;
using BPA.Message;
using BPA.Message.Enum;
using System;
using System.Collections.Generic;
@@ -18,158 +19,41 @@ namespace BPASmartClient.ScreenLib
/// </summary>
public Uri GgAdder { get { return _GgAdder; } set { _GgAdder = value; OnPropertyChanged(); } }
private Uri _GgAdder = new Uri(System.Configuration.ConfigurationManager.AppSettings["GgAdder"].ToString());

/// <summary>
/// 设备是否运行
/// </summary>
public DevIsRun DevIsRun { get { return _DevIsRun; } set { _DevIsRun = value; OnPropertyChanged(); } }
private DevIsRun _DevIsRun = DevIsRun.停止;

/// <summary>
/// 设备状态
/// </summary>
public DevRunStatus RunStatus { get { return _RunStatus; } set { _RunStatus = value; OnPropertyChanged(); } }
private DevRunStatus _RunStatus = DevRunStatus.正常;

/// <summary>
/// 订单数
/// </summary>
public int DdCount { get { return _DdCount; } set { _DdCount = value; OnPropertyChanged(); } }
private int _DdCount = 0;

/// <summary>
/// 异常订单数
/// 界面数据绑定
/// </summary>
public int YCDdCount { get { return _YCDdCount; } set { _YCDdCount = value; OnPropertyChanged(); } }
private int _YCDdCount = 0;

/// <summary>
/// 正在制作订单数据
/// </summary>
public ObservableCollection<OrderMakeModel> OrderMakeList { get { return _OrderMakeList; } set {
_OrderMakeList = value;
OnPropertyChanged();
} }
private ObservableCollection<OrderMakeModel> _OrderMakeList = new ObservableCollection<OrderMakeModel>();

/// <summary>
/// 制作完成订单数据
/// </summary>
public ObservableCollection<OrderMakeModel> OrderMakeListOver
public ScreenModelMaxWok ViewData
{
get { return _OrderMakeListOver; }
get { return _ViewData; }
set
{
_OrderMakeListOver = value;
_ViewData = value;
OnPropertyChanged();
}
}
private ObservableCollection<OrderMakeModel> _OrderMakeListOver = new ObservableCollection<OrderMakeModel>();
private ScreenModelMaxWok _ViewData = new ScreenModelMaxWok();

/// <summary>
/// 告警数据
/// 当前刷新数据类型
/// </summary>
public ObservableCollection<AlarmMsModel> AlarmList
{
get { return _AlarmList; }
set
{
_AlarmList = value;
OnPropertyChanged();
}
}
private ObservableCollection<AlarmMsModel> _AlarmList = new ObservableCollection<AlarmMsModel>();


public ScreenDeviceType type = ScreenDeviceType.大炒;
#endregion
public ScreenMaxWokControlViewModel()
{
Init();
}

/// <summary>
/// 初始化
/// </summary>
public void Init()
public ScreenMaxWokControlViewModel()
{
ThreadManage.GetInstance().StartLong(new Action(() =>
{
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() =>
{
RunStatus = RunStatus == DevRunStatus.正常 ? DevRunStatus.异常 : DevRunStatus.正常;
DevIsRun = DevIsRun == DevIsRun.运行 ? DevIsRun.停止 : DevIsRun.运行;
DdCount = new Random().Next(0, 400);
YCDdCount = new Random().Next(0, 400);

List<ORDER_STATUS> oRDER_s = new List<ORDER_STATUS>() { ORDER_STATUS.WAIT, ORDER_STATUS.COOKING };
List<ORDER_STATUS> oRDER_s1 = new List<ORDER_STATUS>() { ORDER_STATUS.COMPLETED_COOK, ORDER_STATUS.COMPLETED_TAKE };

List<string> name_s = new List<string>() { "担担面", "鸡蛋面", "火鸡面", "扬州炒饭", "回锅肉盖饭" };
OrderMakeList = new ObservableCollection<OrderMakeModel>();
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "011", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "012", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "013", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "014", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });

OrderMakeListOver = new ObservableCollection<OrderMakeModel>();
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "001", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "002", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "003", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "005", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "006", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "008", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "009", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "010", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });


AlarmList = new ObservableCollection<AlarmMsModel>();
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
if (Main.GetInstance.mqttDatasDic.ContainsKey(type))
{
ScreenModelMaxWok modelMaxWok= Main.GetInstance.mqttDatasDic[type] as ScreenModelMaxWok;
if(modelMaxWok != null && modelMaxWok.Alarm!=null)
modelMaxWok.Alarm= modelMaxWok.Alarm?.OrderByDescending(k =>DateTime.Parse(k.AlarmTime)).ToList();
ViewData = modelMaxWok;
}
}));
Thread.Sleep(5000);
Thread.Sleep(1000);
}), $"{DateTime.Now},线程服务");
}
}


+ 206
- 143
BPASmartClient.ScreenLib/炒锅/ScreenMinWokControl.xaml Dosyayı Görüntüle

@@ -25,42 +25,119 @@
<StackPanel Margin="0,10,0,0">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="370" Width="450" Header="2 号炒锅" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="设备运行状态" Margin="20,10,0,0"/>
<GroupBox Header="设备运行情况" Margin="20,10,0,0"/>
<Grid Height="100" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备当前状态</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备状态</TextBlock>
</StackPanel>

<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日订单数</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="待机">
<Setter Property="Foreground" Value="Yellow"/>
</Trigger>
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">工作状态</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="炒锅运行情况" Margin="20,10,0,0"/>
<Grid Height="100">
<TextBlock FontSize="60" Foreground="#FFD2C106">炒制作中</TextBlock>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock FontSize="40" Text="{Binding ViewData.MinWok_Task_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock FontSize="40" Foreground="#FFD2C106" Text="{Binding ViewData.MinWok_Dishes_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}-{0:f2}}"></TextBlock>
</StackPanel>
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Margin="10,20,10,0" Height="275" Width="450" Header="设备当前流程" Style="{DynamicResource from}" Tag="Start">
<Grid>
<ListBox x:Name="PageList" BorderThickness="0" Margin="0,-20,0,0" Height="270" HorizontalAlignment="Stretch" VerticalAlignment="Top"
ItemsSource="{Binding ViewData.MinWok_Process_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Background="Transparent" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" >
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Width="500"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<DataTemplate.Resources>
<Storyboard RepeatBehavior="Forever" x:Key="csd_dh">
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.5" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:01" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:1.5" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:2" Value="{x:Static Visibility.Visible}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</DataTemplate.Resources>
<Grid Margin="0,10,0,0" Height="100" Width="130" VerticalAlignment="Top" HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<Border Background="{DynamicResource 椭圆}" >
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock x:Name="wb" FontSize="32" Text="{Binding Name}"></TextBlock>
<TextBlock x:Name="xs" Style="{DynamicResource 数码管Text}" FontSize="24" Margin="0,0,0,0" Text="{Binding Id}"></TextBlock>
</StackPanel>
</Border>
<Image x:Name="image" Grid.Column="1" Style="{DynamicResource image右1}" Cursor="Hand" ></Image>
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsRun}" Value="true">
<Setter TargetName="xs" Property="Foreground" Value="#FFD2C106"/>
<Setter TargetName="wb" Property="Foreground" Value="#FFD2C106"/>
<DataTrigger.EnterActions>
<BeginStoryboard x:Name="begin_name" Storyboard="{StaticResource csd_dh}"/>
</DataTrigger.EnterActions>
</DataTrigger>
<DataTrigger Binding="{Binding IsRun}" Value="false">
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="begin_name"/>
</DataTrigger.EnterActions>
<Setter TargetName="xs" Property="Foreground" Value="#a2c2e8"/>
<Setter TargetName="wb" Property="Foreground" Value="#a2c2e8"/>
</DataTrigger>

<DataTrigger Binding="{Binding Id}" Value="4">
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="begin_name"/>
</DataTrigger.EnterActions>
<Setter TargetName="image" Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</GroupBox>
<GroupBox Margin="10,20,10,0" Height="275" Width="450" Header="设备当前状态" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
@@ -71,33 +148,11 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MinWok_HeatGear_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2} 档}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">炒锅加热挡位</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MinWok_StirGear_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2} 档}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">炒锅搅拌挡位</TextBlock>
</StackPanel>
</Grid>
@@ -108,33 +163,11 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MinWok_FlipSpeed_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2}rpm}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">炒锅翻转速度</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MinWok_Temp_1,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2}°C}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前锅底温度</TextBlock>
</StackPanel>
</Grid>
@@ -149,75 +182,149 @@
</Grid>
</GroupBox>

<StackPanel Orientation="Horizontal">
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="告警信息展示区域" Style="{DynamicResource from}">
<DataGrid Margin="0,10,0,0" ItemsSource="{Binding AlarmList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="160">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#FFD86E03" FontSize="14" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#FFD86E03" FontSize="14" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</StackPanel>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="告警信息展示区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="250">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</StackPanel>

<StackPanel Grid.Column="2" Margin="0,10,0,0">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="370" Width="450" Header="1 号炒锅" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="设备运行状态" Margin="20,10,0,0"/>
<GroupBox Header="设备运行情况" Margin="20,10,0,0"/>
<Grid Height="100" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备当前状态</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备状态</TextBlock>
</StackPanel>

<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日订单数</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="待机">
<Setter Property="Foreground" Value="Yellow"/>
</Trigger>
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">工作状态</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="炒锅运行情况" Margin="20,10,0,0"/>
<Grid Height="100">
<TextBlock FontSize="60" Foreground="#FFD2C106">炒制作中</TextBlock>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock FontSize="40" Text="{Binding ViewData.MinWok_Task_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock FontSize="40" Foreground="#FFD2C106" Text="{Binding ViewData.MinWok_Dishes_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}-{0:f2}}"></TextBlock>
</StackPanel>
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Margin="10,20,10,0" Height="275" Width="450" Header="设备当前流程" Style="{DynamicResource from}" Tag="Start">

<Grid>
<ListBox BorderThickness="0" Margin="0,-20,0,0" Height="270" HorizontalAlignment="Stretch" VerticalAlignment="Top"
ItemsSource="{Binding ViewData.MinWok_Process_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Background="Transparent" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" >
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Width="500"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<DataTemplate.Resources>
<Storyboard RepeatBehavior="Forever" x:Key="csd_dh">
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:0.5" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:01" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:1.5" Value="{x:Static Visibility.Collapsed}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:2" Value="{x:Static Visibility.Visible}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</DataTemplate.Resources>
<Grid Margin="0,10,0,0" Height="100" Width="130" VerticalAlignment="Top" HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<Border Background="{DynamicResource 椭圆}" >
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock x:Name="wb" FontSize="32" Text="{Binding Name}"></TextBlock>
<TextBlock x:Name="xs" Style="{DynamicResource 数码管Text}" FontSize="24" Margin="0,0,0,0" Text="{Binding Id}"></TextBlock>
</StackPanel>
</Border>
<Image x:Name="image" Grid.Column="1" Style="{DynamicResource image右1}" Cursor="Hand" ></Image>
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsRun}" Value="true">
<Setter TargetName="xs" Property="Foreground" Value="#FFD2C106"/>
<Setter TargetName="wb" Property="Foreground" Value="#FFD2C106"/>
<DataTrigger.EnterActions>
<BeginStoryboard x:Name="begin_name" Storyboard="{StaticResource csd_dh}"/>
</DataTrigger.EnterActions>
</DataTrigger>
<DataTrigger Binding="{Binding IsRun}" Value="false">
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="begin_name"/>
</DataTrigger.EnterActions>
<Setter TargetName="xs" Property="Foreground" Value="#a2c2e8"/>
<Setter TargetName="wb" Property="Foreground" Value="#a2c2e8"/>
</DataTrigger>
<DataTrigger Binding="{Binding Id}" Value="4">
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="begin_name"/>
</DataTrigger.EnterActions>
<Setter TargetName="image" Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</GroupBox>
<GroupBox Margin="10,20,10,0" Height="275" Width="450" Header="设备当前状态" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
@@ -228,33 +335,11 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MinWok_HeatGear_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2} 档}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">炒锅加热挡位</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MinWok_StirGear_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2} 档}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">炒锅搅拌挡位</TextBlock>
</StackPanel>
</Grid>
@@ -265,33 +350,11 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MinWok_FlipSpeed_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2}rpm}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">炒锅翻转速度</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MinWok_Temp_2,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat={}{0:f2}°C}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前锅底温度</TextBlock>
</StackPanel>
</Grid>


+ 17
- 148
BPASmartClient.ScreenLib/炒锅/ScreenMinWokControlViewModel.cs Dosyayı Görüntüle

@@ -1,4 +1,5 @@
using BPA.Helper;
using BPA.Message;
using BPA.Message.Enum;
using System;
using System.Collections.Generic;
@@ -13,178 +14,46 @@ namespace BPASmartClient.ScreenLib
public class ScreenMinWokControlViewModel : NotifyBase
{
#region 变量
/// <summary>
/// 柱状图显示集合
/// </summary>
public IEnumerable<KeyValuePair<string, double>> Histogram { get { return _Histogram; } set { _Histogram = value; OnPropertyChanged(); } }
private IEnumerable<KeyValuePair<string, double>> _Histogram = new List<KeyValuePair<string, double>>();

/// <summary>
/// 设备是否运行
/// </summary>
public DevIsRun DevIsRun { get { return _DevIsRun; } set { _DevIsRun = value; OnPropertyChanged(); } }
private DevIsRun _DevIsRun = DevIsRun.停止;

/// <summary>
/// 设备状态
/// </summary>
public DevRunStatus RunStatus { get { return _RunStatus; } set { _RunStatus = value; OnPropertyChanged(); } }
private DevRunStatus _RunStatus = DevRunStatus.正常;

/// <summary>
/// 订单数
/// </summary>
public int DdCount { get { return _DdCount; } set { _DdCount = value; OnPropertyChanged(); } }
private int _DdCount = 0;

/// <summary>
/// 异常订单数
/// </summary>
public int YCDdCount { get { return _YCDdCount; } set { _YCDdCount = value; OnPropertyChanged(); } }
private int _YCDdCount = 0;

/// <summary>
/// 广告地址
/// </summary>
public Uri GgAdder { get { return _GgAdder; } set { _GgAdder = value; OnPropertyChanged(); } }
private Uri _GgAdder = new Uri(System.Configuration.ConfigurationManager.AppSettings["GgAdder"].ToString());

/// <summary>
/// 正在制作订单数据
/// 界面数据绑定
/// </summary>
public ObservableCollection<OrderMakeModel> OrderMakeList
public ScreenModelMinWok ViewData
{
get { return _OrderMakeList; }
get { return _ViewData; }
set
{
_OrderMakeList = value;
_ViewData = value;
OnPropertyChanged();
}
}
private ObservableCollection<OrderMakeModel> _OrderMakeList = new ObservableCollection<OrderMakeModel>();
private ScreenModelMinWok _ViewData = new ScreenModelMinWok();

/// <summary>
/// 制作完成订单数据
/// 当前刷新数据类型
/// </summary>
public ObservableCollection<OrderMakeModel> OrderMakeListOver
{
get { return _OrderMakeListOver; }
set
{
_OrderMakeListOver = value;
OnPropertyChanged();
}
}
private ObservableCollection<OrderMakeModel> _OrderMakeListOver = new ObservableCollection<OrderMakeModel>();

/// <summary>
/// 告警数据
/// </summary>
public ObservableCollection<AlarmMsModel> AlarmList
{
get { return _AlarmList; }
set
{
_AlarmList = value;
OnPropertyChanged();
}
}
private ObservableCollection<AlarmMsModel> _AlarmList = new ObservableCollection<AlarmMsModel>();

public ScreenDeviceType type = ScreenDeviceType.小炒;
#endregion
public ScreenMinWokControlViewModel()
{
Init();
}

/// <summary>
/// 初始化
/// </summary>
public void Init()
public ScreenMinWokControlViewModel()
{
ThreadManage.GetInstance().StartLong(new Action(() =>
{
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() =>
{
RunStatus = RunStatus == DevRunStatus.正常 ? DevRunStatus.异常 : DevRunStatus.正常;
DevIsRun = DevIsRun == DevIsRun.运行 ? DevIsRun.停止 : DevIsRun.运行;
DdCount = new Random().Next(0, 400);
YCDdCount = new Random().Next(0, 400);

List<ORDER_STATUS> oRDER_s = new List<ORDER_STATUS>() { ORDER_STATUS.WAIT, ORDER_STATUS.COOKING };
List<ORDER_STATUS> oRDER_s1 = new List<ORDER_STATUS>() { ORDER_STATUS.COMPLETED_COOK, ORDER_STATUS.COMPLETED_TAKE };

List<string> name_s = new List<string>() { "担担面", "鸡蛋面", "火鸡面", "扬州炒饭", "回锅肉盖饭" };
OrderMakeList = new ObservableCollection<OrderMakeModel>();
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "011", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "012", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "013", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "014", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });

OrderMakeListOver = new ObservableCollection<OrderMakeModel>();
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "001", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "002", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "003", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "005", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "006", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "008", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "009", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "010", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });


AlarmList = new ObservableCollection<AlarmMsModel>();
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
Histogram = new[] {
new KeyValuePair<string, double>(name_s[0], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[1], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[2], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[3], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[4], new Random().Next(0,400))};
if (Main.GetInstance.mqttDatasDic.ContainsKey(type))
{
ScreenModelMinWok modelMaxWok = Main.GetInstance.mqttDatasDic[type] as ScreenModelMinWok;
if (modelMaxWok != null && modelMaxWok.Alarm != null)
modelMaxWok.Alarm = modelMaxWok.Alarm?.OrderByDescending(k => DateTime.Parse(k.AlarmTime)).ToList();
ViewData = modelMaxWok;
}
}));
Thread.Sleep(5000);
Thread.Sleep(1000);
}), $"{DateTime.Now},线程服务");
}
}


+ 134
- 113
BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml Dosyayı Görüntüle

@@ -31,7 +31,7 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.IsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
@@ -43,22 +43,25 @@
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备是否运行</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备状态</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="异常">
<Trigger Property="Text" Value="待机">
<Setter Property="Foreground" Value="Yellow"/>
</Trigger>
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备当前状态</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">工作状态</TextBlock>
</StackPanel>
</Grid>
</GroupBox>
@@ -67,41 +70,41 @@
<DataGrid.Columns>
<DataGridTemplateColumn Width="60">
<DataGridTemplateColumn.Header>
<TextBlock Text="订单号" Foreground="White"/>
<TextBlock Text="订单号" FontSize="18" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding SortNum,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Foreground="{Binding foreground,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="14" VerticalAlignment="Bottom" HorizontalAlignment="Center"/>
<TextBlock Margin="0,5,0,5" Text="{Binding SortNum,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Foreground="{Binding foreground,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="20" VerticalAlignment="Bottom" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="120">
<DataGridTemplateColumn.Header>
<TextBlock Text="商品名称" Foreground="White"/>
<TextBlock Text="商品名称" FontSize="18" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding GoodName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Foreground="{Binding foreground,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Margin="0,5,0,5" Text="{Binding GoodName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Foreground="{Binding foreground,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="160">
<DataGridTemplateColumn.Header>
<TextBlock Text="开始时间" Foreground="White"/>
<TextBlock Text="开始时间" FontSize="18" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding StartTime,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Foreground="{Binding foreground,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Margin="0,5,0,5" Text="{Binding StartTime,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Foreground="{Binding foreground,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="80">
<DataGridTemplateColumn.Header>
<TextBlock Text="状态" Foreground="White"/>
<TextBlock Text="状态" FontSize="18" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding MakeStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Foreground="{Binding foreground,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Margin="0,5,0,5" Text="{Binding MakeStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Foreground="{Binding foreground,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
@@ -117,35 +120,32 @@
</Grid>
</GroupBox>

<StackPanel Orientation="Horizontal">

<GroupBox Margin="5,0,0,0" Height="340" Width="950" Header="告警信息展示区域" Style="{DynamicResource from}">
<DataGrid Margin="0,10,0,0" ItemsSource="{Binding AlarmList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="160">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#FFD86E03" FontSize="14" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#FFD86E03" FontSize="14" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</StackPanel>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="告警信息展示区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="250">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.Header>
<TextBlock Text="告警描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</StackPanel>

<StackPanel Grid.Column="2" Margin="0,10,0,0">
@@ -157,32 +157,49 @@
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding DdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.MorkS_OrderCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日订单数</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="#FFEC3107" FontSize="52" Text="{Binding YCDdCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">机器人当前状态</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.RobotStatu,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="待机">
<Setter Property="Foreground" Value="Yellow"/>
</Trigger>
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">机器人状态</TextBlock>
</StackPanel>
</Grid>
</GroupBox>
<GroupBox Margin="10,20,0,0" Height="780" Width="450" Header="设备当前状态" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<Grid Height="100" >
<GroupBox Margin="0,10,0,0" Header="煮面炉状态监控"></GroupBox>
<Grid Height="100" Margin="0,10,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" >
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Setter Property="Foreground" Value="#FFD2C106"></Setter>
<Setter Property="Text" Value="下降"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="下降">
<Setter Property="Foreground" Value="#FFD2C106"/>
</Trigger>
<DataTrigger Binding="{Binding ViewData.MorkS_NoodleUpOrDown_1}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="上升"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
@@ -190,14 +207,16 @@
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">煮面炉1号</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" >
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Setter Property="Foreground" Value="#FFD2C106"></Setter>
<Setter Property="Text" Value="下降"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="下降">
<Setter Property="Foreground" Value="#FFD2C106"/>
</Trigger>
<DataTrigger Binding="{Binding ViewData.MorkS_NoodleUpOrDown_2}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="上升"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
@@ -205,58 +224,64 @@
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">煮面炉2号</TextBlock>
</StackPanel>
</Grid>
<Grid Height="100" >
<Grid Height="100" Margin="0,10,0,0" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" >
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Setter Property="Foreground" Value="#FFD2C106"></Setter>
<Setter Property="Text" Value="下降"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="下降">
<Setter Property="Foreground" Value="#FFD2C106"/>
</Trigger>
<DataTrigger Binding="{Binding ViewData.MorkS_NoodleUpOrDown_3}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="上升"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">煮面炉1号</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">煮面炉3号</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" >
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Setter Property="Foreground" Value="#FFD2C106"></Setter>
<Setter Property="Text" Value="下降"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="下降">
<Setter Property="Foreground" Value="#FFD2C106"/>
</Trigger>
<DataTrigger Binding="{Binding ViewData.MorkS_NoodleUpOrDown_4}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="上升"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">煮面炉2号</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">煮面炉4号</TextBlock>
</StackPanel>
</Grid>
<Grid Height="100" >
<Grid Height="100" Margin="0,10,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" >
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Setter Property="Foreground" Value="#FFD2C106"></Setter>
<Setter Property="Text" Value="下降"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="下降">
<Setter Property="Foreground" Value="#FFD2C106"/>
</Trigger>
<DataTrigger Binding="{Binding ViewData.MorkS_NoodleUpOrDown_5}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="上升"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
@@ -264,14 +289,16 @@
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">煮面炉5号</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" >
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Setter Property="Foreground" Value="#FFD2C106"></Setter>
<Setter Property="Text" Value="下降"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="下降">
<Setter Property="Foreground" Value="#FFD2C106"/>
</Trigger>
<DataTrigger Binding="{Binding ViewData.MorkS_NoodleUpOrDown_6}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="上升"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
@@ -279,22 +306,25 @@
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">煮面炉6号</TextBlock>
</StackPanel>
</Grid>

<Grid Height="100" >
<GroupBox Margin="0,40,0,0" Header="其他状态检测"></GroupBox>
<Grid Height="100" Margin="0,10,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" >
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Setter Property="Foreground" Value="#a70909"></Setter>
<Setter Property="Text" Value="加热中"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="下降">
<Setter Property="Foreground" Value="#FFD2C106"/>
</Trigger>
<DataTrigger Binding="{Binding ViewData.MorkS_Temp}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="已开"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
@@ -302,52 +332,44 @@
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">温度状态</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="下降">
<Setter Property="Foreground" Value="#FFD2C106"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.MorkS_BinLocation}"/>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">料仓位置</TextBlock>
</StackPanel>
</Grid>

<Grid Height="100" >
<Grid Height="100" Margin="0,10,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding DevIsRun,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" >
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Setter Property="Foreground" Value="#a70909"></Setter>
<Setter Property="Text" Value="物料缺失"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="下降">
<Setter Property="Foreground" Value="#FFD2C106"/>
</Trigger>
<DataTrigger Binding="{Binding ViewData.MorkS_SiloMeas}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="物料充足"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">料仓上下物料检测</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">料仓物料检测</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding RunStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock HorizontalAlignment="Center" FontSize="42" >
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Setter Property="Foreground" Value="#a70909"></Setter>
<Setter Property="Text" Value="无碗"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="下降">
<Setter Property="Foreground" Value="#FFD2C106"/>
</Trigger>
<DataTrigger Binding="{Binding ViewData.MorkS_NoBowMeas}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="有碗"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
@@ -355,7 +377,6 @@
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">落碗机构缺碗检测</TextBlock>
</StackPanel>
</Grid>

</StackPanel>
</GroupBox>
</StackPanel>


+ 29
- 249
BPASmartClient.ScreenLib/煮面机/ScreenMorksControlViewModel.cs Dosyayı Görüntüle

@@ -8,6 +8,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json;
using BPA.Message;

namespace BPASmartClient.ScreenLib
{
@@ -19,41 +20,29 @@ namespace BPASmartClient.ScreenLib
/// </summary>
public Uri GgAdder { get { return _GgAdder; } set { _GgAdder = value; OnPropertyChanged(); } }
private Uri _GgAdder = new Uri(System.Configuration.ConfigurationManager.AppSettings["GgAdder"].ToString());

/// <summary>
/// 柱状图显示集合
/// </summary>
public IEnumerable<KeyValuePair<string, double>> Histogram { get { return _Histogram; } set { _Histogram = value; OnPropertyChanged(); } }
private IEnumerable<KeyValuePair<string, double>> _Histogram = new List<KeyValuePair<string, double>>();

/// <summary>
/// 设备是否运行
/// </summary>
public DevIsRun DevIsRun { get { return _DevIsRun; } set { _DevIsRun = value; OnPropertyChanged(); } }
private DevIsRun _DevIsRun = DevIsRun.停止;

/// <summary>
/// 设备状态
/// </summary>
public DevRunStatus RunStatus { get { return _RunStatus; } set { _RunStatus = value; OnPropertyChanged(); } }
private DevRunStatus _RunStatus = DevRunStatus.正常;

/// <summary>
/// 订单数
/// 界面数据绑定
/// </summary>
public int DdCount { get { return _DdCount; } set { _DdCount = value; OnPropertyChanged(); } }
private int _DdCount = 0;
public ScreenModelMorkS ViewData
{
get { return _ViewData; }
set
{
_ViewData = value;
OnPropertyChanged();
}
}
private ScreenModelMorkS _ViewData = new ScreenModelMorkS();

/// <summary>
/// 异常订单数
/// 当前刷新数据类型
/// </summary>
public int YCDdCount { get { return _YCDdCount; } set { _YCDdCount = value; OnPropertyChanged(); } }
private int _YCDdCount = 0;
public ScreenDeviceType type = ScreenDeviceType.煮面机;

/// <summary>
/// 正在制作订单数据
/// </summary>
public ObservableCollection<OrderMakeModel> OrderMakeList
public ObservableCollection<OrderMakeFormModel> OrderMakeList
{
get { return _OrderMakeList; }
set
@@ -62,12 +51,12 @@ namespace BPASmartClient.ScreenLib
OnPropertyChanged();
}
}
private ObservableCollection<OrderMakeModel> _OrderMakeList = new ObservableCollection<OrderMakeModel>();
private ObservableCollection<OrderMakeFormModel> _OrderMakeList = new ObservableCollection<OrderMakeFormModel>();

/// <summary>
/// 制作完成订单数据
/// </summary>
public ObservableCollection<OrderMakeModel> OrderMakeListOver
public ObservableCollection<OrderMakeFormModel> OrderMakeListOver
{
get { return _OrderMakeListOver; }
set
@@ -76,236 +65,27 @@ namespace BPASmartClient.ScreenLib
OnPropertyChanged();
}
}
private ObservableCollection<OrderMakeModel> _OrderMakeListOver = new ObservableCollection<OrderMakeModel>();

/// <summary>
/// 告警数据
/// </summary>
public ObservableCollection<AlarmMsModel> AlarmList
{
get { return _AlarmList; }
set
{
_AlarmList = value;
OnPropertyChanged();
}
}
private ObservableCollection<AlarmMsModel> _AlarmList = new ObservableCollection<AlarmMsModel>();

private ObservableCollection<OrderMakeFormModel> _OrderMakeListOver = new ObservableCollection<OrderMakeFormModel>();
#endregion
public ScreenMorksControlViewModel()
{
Init();
}

/// <summary>
/// 初始化
/// </summary>
public void Init()
public ScreenMorksControlViewModel()
{
ThreadManage.GetInstance().StartLong(new Action(() =>
{
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() =>
{
RunStatus = RunStatus == DevRunStatus.正常 ? DevRunStatus.异常 : DevRunStatus.正常;
DevIsRun = DevIsRun == DevIsRun.运行 ? DevIsRun.停止 : DevIsRun.运行;
DdCount = new Random().Next(0, 400);
YCDdCount = new Random().Next(0, 400);

List<ORDER_STATUS> oRDER_s = new List<ORDER_STATUS>() { ORDER_STATUS.WAIT, ORDER_STATUS.COOKING };
List<ORDER_STATUS> oRDER_s1 = new List<ORDER_STATUS>() { ORDER_STATUS.COMPLETED_COOK, ORDER_STATUS.COMPLETED_TAKE };

List<string> name_s = new List<string>() { "担担面", "鸡蛋面", "火鸡面", "扬州炒饭", "回锅肉盖饭" };
OrderMakeList = new ObservableCollection<OrderMakeModel>();
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "011", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "012", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "013", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "014", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeList.Add(new OrderMakeModel { Status = oRDER_s[new Random().Next(0, 2)], SortNum = "015", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });

OrderMakeListOver = new ObservableCollection<OrderMakeModel>();
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "001", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "002", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "003", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "005", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "006", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "008", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "009", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "010", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });
OrderMakeListOver.Add(new OrderMakeModel { Status = oRDER_s1[new Random().Next(0, 2)], SortNum = "007", GoodName = name_s[new Random().Next(0, 5)], StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), StopTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") });


AlarmList = new ObservableCollection<AlarmMsModel>();
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
AlarmList.Add(new AlarmMsModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" });
Histogram = new[] {
new KeyValuePair<string, double>(name_s[0], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[1], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[2], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[3], new Random().Next(0,400)),
new KeyValuePair<string, double>(name_s[4], new Random().Next(0,400))};
if (Main.GetInstance.mqttDatasDic.ContainsKey(type))
{
ScreenModelMorkS modelMaxWok = Main.GetInstance.mqttDatasDic[type] as ScreenModelMorkS;
if (modelMaxWok != null && modelMaxWok.Alarm != null)
modelMaxWok.Alarm = modelMaxWok.Alarm?.OrderByDescending(k => DateTime.Parse(k.AlarmTime)).ToList();
ViewData = modelMaxWok;
OrderMakeList = JsonConvert.DeserializeObject<ObservableCollection<OrderMakeFormModel>>(JsonConvert.SerializeObject(ViewData.MakeOrder));
OrderMakeListOver = JsonConvert.DeserializeObject<ObservableCollection<OrderMakeFormModel>>(JsonConvert.SerializeObject(ViewData.MakeOrderOver));
}
}));
Thread.Sleep(5000);
Thread.Sleep(1000);
}), $"{DateTime.Now},线程服务");
}

/// <summary>
/// 数据运行器
/// </summary>
public void DataRun()
{
string Dev = "MorkS";//当前设备名称
string name = Main.GetInstance.PZdic.ContainsKey($"{Dev}_Name") ? Main.GetInstance.PZdic[$"{Dev}_Name"].ToString(): DateTime.Now.ToString();
//ThreadManage.GetInstance().StartLong(new Action(() =>
//{
// System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() =>
// {
// if (!string.IsNullOrEmpty(name) && Main.GetInstance.redisDatasDic != null && Main.GetInstance.redisDatasDic.ContainsKey(name) && Main.GetInstance.redisDatasDic[name]!=null)
// {
// List<string> list=new List<string> { "IsRun", "RunStatus", "OrderCount", "ErrorOrderCount", "OrderMakeList", "OrderMakeListOver", "AlarmList" };
// list?.ForEach(x => {
// if (Main.GetInstance.PZdic.ContainsKey($"{Dev}_{x}"))
// {
// if (Main.GetInstance.redisDatasDic[name].ContainsKey(Main.GetInstance.PZdic[$"{Dev}_{x}"]))
// {
// string _value = Main.GetInstance.redisDatasDic[name][Main.GetInstance.PZdic[$"{Dev}_{x}"]].VarVaule;
// #region 执行更新界面数据
// switch (x)
// {
// case "IsRun"://是否运行
// DevIsRun = _value == "0" ? DevIsRun.停止 : DevIsRun.运行;
// break;
// case "RunStatus"://运行状态
// DevIsRun = _value == "0" ? DevIsRun.停止 : DevIsRun.运行;
// break;
// case "OrderCount"://是否运行
// try
// {
// DdCount = int.Parse(_value);
// }
// catch (Exception ex)
// {
// DdCount = 0;
// }
// break;
// case "ErrorOrderCount":
// try
// {
// YCDdCount = int.Parse(_value);
// }
// catch (Exception ex)
// {
// YCDdCount = 0;
// }
// break;
// case "OrderMakeList":
// try
// {
// OrderMakeList = new ObservableCollection<OrderMakeModel>();
// JsonConvert.DeserializeObject<List<OrderMakeModel>>(_value)?.OrderBy(l => l.SortNum)?.ToList().ForEach(par => {
// OrderMakeList.Add(par);
// });
// }
// catch (Exception ex)
// {
// OrderMakeList = new ObservableCollection<OrderMakeModel>();
// }
// break;
// case "OrderMakeListOver":
// try
// {
// OrderMakeListOver = new ObservableCollection<OrderMakeModel>();
// JsonConvert.DeserializeObject<List<OrderMakeModel>>(_value)?.OrderBy(l => l.SortNum)?.ToList().ForEach(par => {
// OrderMakeListOver.Add(par);
// });
// //OrderMakeListOver?.ToList().FindAll(m => m.GoodName).di
// }
// catch (Exception ex)
// {
// OrderMakeListOver = new ObservableCollection<OrderMakeModel>();
// }
// break;
// case "AlarmList":
// try
// {
// AlarmList = new ObservableCollection<AlarmMsModel>();
// JsonConvert.DeserializeObject<List<AlarmMsModel>>(_value)?.OrderBy(l => l.AlarmTime)?.ToList().ForEach(par => {
// AlarmList.Add(par);
// });


// //Histogram=new
// //if (AlarmList.Count > 0)
// //{

// //}
// }
// catch (Exception ex)
// {
// OrderMakeListOver = new ObservableCollection<OrderMakeModel>();
// }
// break;
// default:
// break;
// }
// #endregion

// }
// }

// });
// }
// //Histogram = new[] {
// // new KeyValuePair<string, double>(name_s[0], new Random().Next(0,400)),
// // new KeyValuePair<string, double>(name_s[1], new Random().Next(0,400)),
// // new KeyValuePair<string, double>(name_s[2], new Random().Next(0,400)),
// // new KeyValuePair<string, double>(name_s[3], new Random().Next(0,400)),
// // new KeyValuePair<string, double>(name_s[4], new Random().Next(0,400))};
// }));
// Thread.Sleep(500);
//}), $"{name},线程服务");
}
}
}

+ 4
- 3
BPASmartClient.ScreenMinWok/App.config Dosyayı Görüntüle

@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<!--Redis配置-->
<add key="RedisConnection" value="10.2.1.254,6379,BapAdmin123456.,1"/>
<add key="DeviceMC" value="1"/>
<!--MQTT配置-->
<add key="MQTTConnection" value="10.2.1.254,1883,admin,public"/>
<!--订阅主题设置:大炒,小炒,分餐机,煮面机-->
<add key="DeviceMC" value="大炒,小炒,分餐机,煮面机"/>
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>
</appSettings>
</configuration>

+ 4
- 3
BPASmartClient.ScreenMorks/App.config Dosyayı Görüntüle

@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<!--Redis配置-->
<add key="RedisConnection" value="10.2.1.254,6379,BapAdmin123456.,1"/>
<add key="DeviceMC" value="1"/>
<!--MQTT配置-->
<add key="MQTTConnection" value="10.2.1.254,1883,admin,public"/>
<!--订阅主题设置:大炒,小炒,分餐机,煮面机-->
<add key="DeviceMC" value="大炒,小炒,分餐机,煮面机"/>
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>
</appSettings>
</configuration>

+ 4
- 3
BPASmartClient.ScreenSplitMeals/App.config Dosyayı Görüntüle

@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<!--Redis配置-->
<add key="RedisConnection" value="10.2.1.254,6379,BapAdmin123456.,1"/>
<add key="DeviceMC" value="1"/>
<!--MQTT配置-->
<add key="MQTTConnection" value="10.2.1.254,1883,admin,public"/>
<!--订阅主题设置:大炒,小炒,分餐机,煮面机-->
<add key="DeviceMC" value="大炒,小炒,分餐机,煮面机"/>
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>
</appSettings>
</configuration>

+ 23
- 0
SmartClient.sln Dosyayı Görüntüle

@@ -192,6 +192,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.ScreenSplitM
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.ScreenLib", "BPASmartClient.ScreenLib\BPASmartClient.ScreenLib.csproj", "{798BBFFE-3BA2-40BA-BFE1-9502398F1F08}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfTest", "WpfTest\WpfTest.csproj", "{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -1786,6 +1788,26 @@ Global
{798BBFFE-3BA2-40BA-BFE1-9502398F1F08}.Release|x64.Build.0 = Release|Any CPU
{798BBFFE-3BA2-40BA-BFE1-9502398F1F08}.Release|x86.ActiveCfg = Release|Any CPU
{798BBFFE-3BA2-40BA-BFE1-9502398F1F08}.Release|x86.Build.0 = Release|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Debug|ARM.ActiveCfg = Debug|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Debug|ARM.Build.0 = Debug|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Debug|ARM64.Build.0 = Debug|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Debug|x64.ActiveCfg = Debug|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Debug|x64.Build.0 = Debug|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Debug|x86.ActiveCfg = Debug|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Debug|x86.Build.0 = Debug|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Release|Any CPU.Build.0 = Release|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Release|ARM.ActiveCfg = Release|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Release|ARM.Build.0 = Release|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Release|ARM64.ActiveCfg = Release|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Release|ARM64.Build.0 = Release|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Release|x64.ActiveCfg = Release|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Release|x64.Build.0 = Release|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Release|x86.ActiveCfg = Release|Any CPU
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1874,6 +1896,7 @@ Global
{286A2E28-B04E-4EA6-9017-D6FA6F8B9A48} = {C5968A90-F4CF-4904-88C4-62C77C820A04}
{135A0978-351F-4727-82CE-2B7A8632AF1B} = {C5968A90-F4CF-4904-88C4-62C77C820A04}
{798BBFFE-3BA2-40BA-BFE1-9502398F1F08} = {C6984F48-A0FE-47A4-B63B-E4E5BCFCD6D3}
{CD43FABA-D1ED-4524-AC51-60ECDE2EAD44} = {7BE13E55-D8B1-4232-AE63-8BF122633297}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC}


+ 9
- 0
WpfTest/App.xaml Dosyayı Görüntüle

@@ -0,0 +1,9 @@
<Application x:Class="WpfTest.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfTest"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

+ 17
- 0
WpfTest/App.xaml.cs Dosyayı Görüntüle

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace WpfTest
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

+ 10
- 0
WpfTest/AssemblyInfo.cs Dosyayı Görüntüle

@@ -0,0 +1,10 @@
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]

+ 12
- 0
WpfTest/MainWindow.xaml Dosyayı Görüntüle

@@ -0,0 +1,12 @@
<Window x:Class="WpfTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfTest"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>

</Grid>
</Window>

+ 338
- 0
WpfTest/MainWindow.xaml.cs Dosyayı Görüntüle

@@ -0,0 +1,338 @@
using BPA.Communication;
using BPA.Helper;
using BPA.Message;
using BPA.Message.Enum;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfTest
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
/// <summary>
/// MQTT连接信息
/// </summary>
public string MQTTConnection { get; set; } = "10.2.1.254,1883,admin,public";

/// <summary>
/// Mqtt是否运行
/// </summary>
public bool IsRunningMqtt = false;
/// <summary>
/// Mqtt
/// </summary>
public MqttHelper mqttHelper = new MqttHelper();

public MainWindow()
{
InitializeComponent();
Connection();
ThreadServer();
}
public void ThreadServer()
{
ThreadManage.GetInstance().StartLong(new Action(() =>
{
try
{
if (IsRunningMqtt)
{
Send(ScreenDeviceType.大炒);
Thread.Sleep(1000);
Send(ScreenDeviceType.小炒); Thread.Sleep(1000);

Send(ScreenDeviceType.煮面机); Thread.Sleep(1000);

Send(ScreenDeviceType.分餐机); Thread.Sleep(1000);

}
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"{Name}:线程服务异常,原因:{ex.Message}");
}
Thread.Sleep(100);
}), $"{Name},线程服务");
}
/// <summary>
/// 初始化连接Redis MQTT
/// </summary>
public void Connection()
{
try
{
//2.Mqtt连接
if (!string.IsNullOrEmpty(this.MQTTConnection) && this.MQTTConnection.Contains(','))
{
string[] mqttcom = this.MQTTConnection.Split(',');
if (mqttcom != null && mqttcom.Count() == 4)
{
mqttHelper.Connect(mqttcom[2], mqttcom[3], mqttcom[0], int.Parse(mqttcom[1]), $"{Name}:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
}
}
mqttHelper.Disconnect = new Action(() =>
{
IsRunningMqtt = false;
MessageLog.GetInstance.ShowEx($"{Name}:MQTT异常断开....");
});
mqttHelper.ConnectOk = new Action(() =>
{
IsRunningMqtt = true;//连接成功
});
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"{Name}:初始化连接 MQTT,原因:{ex.Message}");
}

}

public void Send(ScreenDeviceType screen)
{
List<ORDER_STATUS> oRDER_STATUS = new List<ORDER_STATUS>() { ORDER_STATUS.WAIT, ORDER_STATUS.COOKING, ORDER_STATUS.COMPLETED_COOK, ORDER_STATUS.COMPLETED_TAKE, ORDER_STATUS.ERR_NOT_REPLY_WHEN_COOKING };
List<string> name_s = new List<string>() { "担担面", "鸡蛋面", "火鸡面", "扬州炒饭", "回锅肉盖饭" };
List<string> name_XM = new List<string>() { "张三", "李四", "王五", "王麻子", "二狗子" };

int k = new Random().Next(0, 5);
int M = new Random().Next(0, 5);
if (screen == ScreenDeviceType.大炒)
{
SendScreenDataModel sendScreenData = new SendScreenDataModel();
sendScreenData.Name = screen;
sendScreenData.Value = new ScreenModelMaxWok
{
IsRun = new Random().Next(0, 2) == 0 ? IsRun.运行 : IsRun.停止,
WorkStatus_1 = new Random().Next(0, 2) == 0 ? WorkStatus.工作 : WorkStatus.待机,
WorkStatus_2 = new Random().Next(0, 2) == 0 ? WorkStatus.工作 : WorkStatus.待机,
RobotStatu = new Random().Next(0, 2) == 0 ? WorkStatus.工作 : WorkStatus.待机,
Alarm = new List<AlarmModel> {
new AlarmModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" },
new AlarmModel { AlarmTime = DateTime.Now.AddSeconds(1).ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" },
new AlarmModel { AlarmTime = DateTime.Now.AddSeconds(2).ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" },
},
FailuresCount = 0,
StatsCount = new List<StatsModel> {
new StatsModel{Name= name_s[0],Count=new Random().Next(0, 100)},
new StatsModel{Name= name_s[1],Count=new Random().Next(0, 100)},
new StatsModel{Name= name_s[2],Count=new Random().Next(0, 100)},
new StatsModel{Name= name_s[3],Count=new Random().Next(0, 100)},
new StatsModel{Name= name_s[4],Count=new Random().Next(0, 100)},
},
MaxWok_Dishes_1 = "猪肉炖粉条",
MaxWok_Task_1 = "炒菜中",
MaxWok_Process_1 = new List<ProcessModel> {
new ProcessModel{ Id=0,Name= "清洗", IsRun=M>=0 ?true:false},
new ProcessModel{ Id=1,Name= "到菜", IsRun=M>=1 ?true:false},
new ProcessModel{ Id=2,Name= "翻炒", IsRun=M>=2?true:false},
new ProcessModel{ Id=3,Name= "调料", IsRun=M>=3 ?true:false},
new ProcessModel{ Id=4,Name= "完成", IsRun=M>=4 ?true:false},
},
MaxWok_HeatGear_1 = "1",
MaxWok_StirGear_1 = "2",
MaxWok_FlipSpeed_1 = "30",
MaxWok_Temp_1 = "102",
MaxWok_OrderCount_1 = new Random().Next(0, 100),
MaxWok_ErrorOrderCount_1 = new Random().Next(0, 100),

MaxWok_Dishes_2 = "烂肉排骨",
MaxWok_Task_2 = "结算中",
MaxWok_Process_2 = new List<ProcessModel> {
new ProcessModel{ Id=0,Name= "清洗", IsRun=k>=0 ?true:false},
new ProcessModel{ Id=1,Name= "到菜", IsRun=k>=1 ?true:false},
new ProcessModel{ Id=2,Name= "翻炒", IsRun=k>=2 ?true:false},
new ProcessModel{ Id=3,Name= "调料", IsRun=k>=3 ?true:false},
new ProcessModel{ Id=4,Name= "完成", IsRun=k>=4 ?true:false},
},
MaxWok_HeatGear_2 = "2",
MaxWok_StirGear_2 = "3",
MaxWok_FlipSpeed_2 = "32",
MaxWok_Temp_2 = "132",
MaxWok_OrderCount_2 = new Random().Next(0, 100),
MaxWok_ErrorOrderCount_2 = new Random().Next(0, 100),
};
mqttHelper.Publish(ScreenTOPIC.GetInstance.GetTopic(screen), JsonConvert.SerializeObject(sendScreenData));
}
else if (screen == ScreenDeviceType.小炒)
{
SendScreenDataModel sendScreenData = new SendScreenDataModel();
sendScreenData.Name = screen;
sendScreenData.Value = new ScreenModelMinWok
{
IsRun = new Random().Next(0, 2) == 0 ? IsRun.运行 : IsRun.停止,
WorkStatus_1 = new Random().Next(0, 2) == 0 ? WorkStatus.工作 : WorkStatus.待机,
WorkStatus_2 = new Random().Next(0, 2) == 0 ? WorkStatus.工作 : WorkStatus.待机,
RobotStatu = new Random().Next(0, 2) == 0 ? WorkStatus.工作 : WorkStatus.待机,
Alarm = new List<AlarmModel> {
new AlarmModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" },
new AlarmModel { AlarmTime = DateTime.Now.AddSeconds(1).ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" },
new AlarmModel { AlarmTime = DateTime.Now.AddSeconds(2).ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" },
},
FailuresCount = 0,
StatsCount = new List<StatsModel> {
new StatsModel{Name= name_s[0],Count=new Random().Next(0, 100)},
new StatsModel{Name= name_s[1],Count=new Random().Next(0, 100)},
new StatsModel{Name= name_s[2],Count=new Random().Next(0, 100)},
new StatsModel{Name= name_s[3],Count=new Random().Next(0, 100)},
new StatsModel{Name= name_s[4],Count=new Random().Next(0, 100)},
},
MinWok_Dishes_1 = "猪肉炖粉条",
MinWok_Task_1 = "炒菜中",
MinWok_Process_1 = new List<ProcessModel> {
new ProcessModel{ Id=0,Name= "清洗", IsRun=M>=0 ?true:false},
new ProcessModel{ Id=1,Name= "到菜", IsRun=M>=1 ?true:false},
new ProcessModel{ Id=2,Name= "翻炒", IsRun=M>=2?true:false},
new ProcessModel{ Id=3,Name= "调料", IsRun=M>=3 ?true:false},
new ProcessModel{ Id=4,Name= "完成", IsRun=M>=4 ?true:false},
},
MinWok_HeatGear_1 = "1",
MinWok_StirGear_1 = "2",
MinWok_FlipSpeed_1 = "30",
MinWok_Temp_1 = "102",
MinWok_OrderCount_1 = new Random().Next(0, 100),
MinWok_ErrorOrderCount_1 = new Random().Next(0, 100),

MinWok_Dishes_2 = "烂肉排骨",
MinWok_Task_2 = "结算中",
MinWok_Process_2 = new List<ProcessModel> {
new ProcessModel{ Id=0,Name= "清洗", IsRun=k>=0 ?true:false},
new ProcessModel{ Id=1,Name= "到菜", IsRun=k>=1 ?true:false},
new ProcessModel{ Id=2,Name= "翻炒", IsRun=k>=2 ?true:false},
new ProcessModel{ Id=3,Name= "调料", IsRun=k>=3 ?true:false},
new ProcessModel{ Id=4,Name= "完成", IsRun=k>=4 ?true:false},
},
MinWok_HeatGear_2 = "2",
MinWok_StirGear_2 = "3",
MinWok_FlipSpeed_2 = "32",
MinWok_Temp_2 = "132",
MinWok_OrderCount_2 = new Random().Next(0, 100),
MinWok_ErrorOrderCount_2 = new Random().Next(0, 100),
};
mqttHelper.Publish(ScreenTOPIC.GetInstance.GetTopic(screen), JsonConvert.SerializeObject(sendScreenData));
}
else if (screen == ScreenDeviceType.煮面机)
{
SendScreenDataModel sendScreenData = new SendScreenDataModel();
sendScreenData.Name = screen;
sendScreenData.Value = new ScreenModelMorkS
{
IsRun = new Random().Next(0, 2) == 0 ? IsRun.运行 : IsRun.停止,
WorkStatus = new Random().Next(0, 2) == 0 ? WorkStatus.工作 : WorkStatus.待机,
RobotStatu = new Random().Next(0, 2) == 0 ? WorkStatus.工作 : WorkStatus.待机,
Alarm = new List<AlarmModel> {
new AlarmModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" },
new AlarmModel { AlarmTime = DateTime.Now.AddSeconds(1).ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" },
new AlarmModel { AlarmTime = DateTime.Now.AddSeconds(2).ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" },
},
FailuresCount = 0,
StatsCount = new List<StatsModel> {
new StatsModel{Name= name_s[0],Count=new Random().Next(0, 100)},
new StatsModel{Name= name_s[1],Count=new Random().Next(0, 100)},
new StatsModel{Name= name_s[2],Count=new Random().Next(0, 100)},
new StatsModel{Name= name_s[3],Count=new Random().Next(0, 100)},
new StatsModel{Name= name_s[4],Count=new Random().Next(0, 100)},
},
MorkS_OrderCount= new Random().Next(0, 100),
MorkS_ErrorOrderCount = new Random().Next(0, 100),
MorkS_NoodleUpOrDown_1 = new Random().Next(0, 2) == 0 ? "true" : "false",
MorkS_NoodleUpOrDown_2 = new Random().Next(0, 2) == 0 ? "true" : "false",
MorkS_NoodleUpOrDown_3 = new Random().Next(0, 2) == 0 ? "true" : "false",
MorkS_NoodleUpOrDown_4 = new Random().Next(0, 2) == 0 ? "true" : "false",
MorkS_NoodleUpOrDown_5 = new Random().Next(0, 2) == 0 ? "true" : "false",
MorkS_NoodleUpOrDown_6 = new Random().Next(0, 2) == 0 ? "true" : "false",

MorkS_Temp = new Random().Next(0, 2) == 0 ? "true" : "false",
MorkS_BinLocation = new Random().Next(0, 6).ToString(),
MorkS_SiloMeas = new Random().Next(0, 2) == 0 ? "true" : "false",
MorkS_NoBowMeas = new Random().Next(0, 2) == 0 ? "true" : "false",
MakeOrder=new List<OrderMakeModel> {
new OrderMakeModel { GoodName= name_s[new Random().Next(0, 5)], StartTime=DateTime.Now.ToString("HH:mm:ss"), Status=oRDER_STATUS[new Random().Next(0, 5)], SortNum=new Random().Next(0,100).ToString()},
new OrderMakeModel { GoodName= name_s[new Random().Next(0, 5)], StartTime=DateTime.Now.ToString("HH:mm:ss"), Status=oRDER_STATUS[new Random().Next(0, 5)], SortNum=new Random().Next(0,100).ToString()},
new OrderMakeModel { GoodName= name_s[new Random().Next(0, 5)], StartTime=DateTime.Now.ToString("HH:mm:ss"), Status=oRDER_STATUS[new Random().Next(0, 5)], SortNum=new Random().Next(0,100).ToString()},
new OrderMakeModel { GoodName= name_s[new Random().Next(0, 5)], StartTime=DateTime.Now.ToString("HH:mm:ss"), Status=oRDER_STATUS[new Random().Next(0, 5)], SortNum=new Random().Next(0,100).ToString()},
new OrderMakeModel { GoodName= name_s[new Random().Next(0, 5)], StartTime=DateTime.Now.ToString("HH:mm:ss"), Status=oRDER_STATUS[new Random().Next(0, 5)], SortNum=new Random().Next(0,100).ToString()},
new OrderMakeModel { GoodName= name_s[new Random().Next(0, 5)], StartTime=DateTime.Now.ToString("HH:mm:ss"), Status=oRDER_STATUS[new Random().Next(0, 5)], SortNum=new Random().Next(0,100).ToString()},
new OrderMakeModel { GoodName= name_s[new Random().Next(0, 5)], StartTime=DateTime.Now.ToString("HH:mm:ss"), Status=oRDER_STATUS[new Random().Next(0, 5)], SortNum=new Random().Next(0,100).ToString()},
new OrderMakeModel { GoodName= name_s[new Random().Next(0, 5)], StartTime=DateTime.Now.ToString("HH:mm:ss"), Status=oRDER_STATUS[new Random().Next(0, 5)], SortNum=new Random().Next(0,100).ToString()},
new OrderMakeModel { GoodName= name_s[new Random().Next(0, 5)], StartTime=DateTime.Now.ToString("HH:mm:ss"), Status=oRDER_STATUS[new Random().Next(0, 5)], SortNum=new Random().Next(0,100).ToString()},
new OrderMakeModel { GoodName= name_s[new Random().Next(0, 5)], StartTime=DateTime.Now.ToString("HH:mm:ss"), Status=oRDER_STATUS[new Random().Next(0, 5)], SortNum=new Random().Next(0,100).ToString()},
new OrderMakeModel { GoodName= name_s[new Random().Next(0, 5)], StartTime=DateTime.Now.ToString("HH:mm:ss"), Status=oRDER_STATUS[new Random().Next(0, 5)], SortNum=new Random().Next(0,100).ToString()},
},
};
mqttHelper.Publish(ScreenTOPIC.GetInstance.GetTopic(screen), JsonConvert.SerializeObject(sendScreenData));
}
else if (screen == ScreenDeviceType.分餐机)
{
SendScreenDataModel sendScreenData = new SendScreenDataModel();
sendScreenData.Name = screen;
sendScreenData.Value = new ScreenModelSplitMeals
{
IsRun = new Random().Next(0, 2) == 0 ? IsRun.运行 : IsRun.停止,
WorkStatus = new Random().Next(0, 2) == 0 ? WorkStatus.工作 : WorkStatus.待机,
RobotStatu = new Random().Next(0, 2) == 0 ? WorkStatus.工作 : WorkStatus.待机,
Alarm = new List<AlarmModel> {
new AlarmModel { AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" },
new AlarmModel { AlarmTime = DateTime.Now.AddSeconds(1).ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" },
new AlarmModel { AlarmTime = DateTime.Now.AddSeconds(2).ToString("yyyy-MM-dd HH:mm:ss"), AlarmMs = "XXXX机构出现故障!!!!" },
},
FailuresCount = 0,
StatsCount = new List<StatsModel> {
new StatsModel { Name = name_s[0], Count = new Random().Next(0, 100) },
new StatsModel { Name = name_s[1], Count = new Random().Next(0, 100) },
new StatsModel { Name = name_s[2], Count = new Random().Next(0, 100) },
new StatsModel { Name = name_s[3], Count = new Random().Next(0, 100) },
new StatsModel { Name = name_s[4], Count = new Random().Next(0, 100) },
},
SplitMeals_CreditCardCount_1 = new Random().Next(0, 100),
SplitMeals_CreditCardNameBefore_1 = name_XM[new Random().Next(0, 5)],
SplitMeals_CreditCardName_1 = name_XM[new Random().Next(0, 5)],
SplitMeals_CookType_1 = new List<string>() { "担担面", "鸡蛋面", "火鸡面" },

SplitMeals_CreditCardCount_2 = new Random().Next(0, 100),
SplitMeals_CreditCardNameBefore_2 = name_XM[new Random().Next(0, 5)],
SplitMeals_CreditCardName_2 = name_XM[new Random().Next(0, 5)],
SplitMeals_CookType_2 = new List<string>() { "担担面", "鸡蛋面", "火鸡面" },

SplitMeals_CreditCardCount_3 = new Random().Next(0, 100),
SplitMeals_CreditCardNameBefore_3 = name_XM[new Random().Next(0, 5)],
SplitMeals_CreditCardName_3= name_XM[new Random().Next(0, 5)],
SplitMeals_CookType_3 = new List<string>() { "担担面", "鸡蛋面", "火鸡面" },

SplitMeals_CreditCardCount_4 = new Random().Next(0, 100),
SplitMeals_CreditCardNameBefore_4 = name_XM[new Random().Next(0, 5)],
SplitMeals_CreditCardName_4 = name_XM[new Random().Next(0, 5)],
SplitMeals_CookType_4 = new List<string>() { "担担面", "鸡蛋面", "火鸡面" },

SplitMeals_CreditCardCount_5 = new Random().Next(0, 100),
SplitMeals_CreditCardNameBefore_5 = name_XM[new Random().Next(0, 5)],
SplitMeals_CreditCardName_5 = name_XM[new Random().Next(0, 5)],
SplitMeals_CookType_5 = new List<string>() { "担担面", "鸡蛋面", "火鸡面" },

SplitMeals_CreditCardCount_6 = new Random().Next(0, 100),
SplitMeals_CreditCardNameBefore_6 = name_XM[new Random().Next(0, 5)],
SplitMeals_CreditCardName_6 = name_XM[new Random().Next(0, 5)],
SplitMeals_CookType_6 = new List<string>() { "担担面", "鸡蛋面", "火鸡面" },

};
mqttHelper.Publish(ScreenTOPIC.GetInstance.GetTopic(screen), JsonConvert.SerializeObject(sendScreenData));
}
}
}
}

+ 14
- 0
WpfTest/WpfTest.csproj Dosyayı Görüntüle

@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BPA.CustomResource" Version="1.0.12" />
</ItemGroup>

</Project>

Yükleniyor…
İptal
Kaydet