fyf 2 лет назад
Родитель
Сommit
abc9b989ff
3 измененных файлов: 38 добавлений и 11 удалений
  1. +5
    -0
      BPASmartClient.ScreenLib/Helper/Main.cs
  2. +21
    -2
      BPASmartClient.ScreenLib/总监视大屏/ScreenALLControl.xaml
  3. +12
    -9
      BPASmartClient.ScreenLib/总监视大屏/ScreenALLControlViewModel.cs

+ 5
- 0
BPASmartClient.ScreenLib/Helper/Main.cs Просмотреть файл

@@ -78,6 +78,11 @@ namespace BPASmartClient.ScreenLib
MQTTConnection = PZdic["MQTTConnection"];
if (PZdic.ContainsKey("DeviceMC"))
Name = PZdic["DeviceMC"];
mqttDatasDic[ScreenDeviceType.大炒] = new ScreenModelMaxWok();
mqttDatasDic[ScreenDeviceType.小炒] = new ScreenModelMinWok();
mqttDatasDic[ScreenDeviceType.分餐机] = new ScreenModelSplitMeals();
mqttDatasDic[ScreenDeviceType.煮面机] = new ScreenModelMorkS();

}
/// <summary>
/// 设备数据


+ 21
- 2
BPASmartClient.ScreenLib/总监视大屏/ScreenALLControl.xaml Просмотреть файл

@@ -204,6 +204,9 @@
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
@@ -222,6 +225,9 @@
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
@@ -283,6 +289,9 @@
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
@@ -301,6 +310,9 @@
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
@@ -346,6 +358,9 @@
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
@@ -372,6 +387,7 @@
</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="{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,0" Height="340" Width="950" Header="信息通知区域" VerticalAlignment="Bottom" Style="{DynamicResource from}">
<!--<ListBox Margin="10,-10,10,10" ScrollViewer.VerticalScrollBarVisibility="Disabled" ItemsSource="{Binding AlarmAll,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
@@ -457,6 +473,9 @@
<Trigger Property="Text" Value="故障">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
@@ -490,14 +509,14 @@
ItemsSource="{Binding StatsCountAll,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel x:Name="mainPanel1" Margin="15,5,0,0" >
<StackPanel x:Name="mainPanel1" Margin="15,0,0,0" >
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Style="{DynamicResource textms}" Margin="10,5,0,0" FontSize="20" Text="{Binding Name}"/>
<TextBlock HorizontalAlignment="Left" Style="{DynamicResource textms}" Margin="10,5,0,0" FontSize="20" Text="/"/>
<TextBlock HorizontalAlignment="Left" Style="{DynamicResource textms}" Margin="10,5,0,0" FontSize="20" Text="{Binding Count, StringFormat={}{0} 单}"/>
</StackPanel>
<Grid HorizontalAlignment="Left" Margin="0,5,0,0">
<ProgressBar Style="{DynamicResource bfb}" Value="{Binding bfb,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="360" Height="24" Margin="10,0,0,0"></ProgressBar>
<ProgressBar Style="{DynamicResource bfb}" Value="{Binding bfb,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="360" Height="19" Margin="10,0,0,0"></ProgressBar>
</Grid>
</StackPanel>


+ 12
- 9
BPASmartClient.ScreenLib/总监视大屏/ScreenALLControlViewModel.cs Просмотреть файл

@@ -152,8 +152,12 @@ namespace BPASmartClient.ScreenLib
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() =>
{
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)
@@ -184,7 +188,6 @@ namespace BPASmartClient.ScreenLib
ScreenModelMaxWok min = ViewData[ScreenDeviceType.大炒] as ScreenModelMaxWok;
MaxCout = min.MaxWok_OrderCount_1 + min.MaxWok_OrderCount_2;
gz += min.FailuresCount;

}

if (ViewData.ContainsKey(ScreenDeviceType.分餐机))
@@ -194,7 +197,6 @@ namespace BPASmartClient.ScreenLib
+ min.SplitMeals_CreditCardCount_3 + min.SplitMeals_CreditCardCount_4
+ min.SplitMeals_CreditCardCount_5 + min.SplitMeals_CreditCardCount_6;
gz += min.FailuresCount;

}

int zmj_count = 0;
@@ -203,23 +205,24 @@ namespace BPASmartClient.ScreenLib
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;
if (!string.IsNullOrEmpty(item.Name))
{
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 => {


Загрузка…
Отмена
Сохранить