Browse Source

180界面更新

样式分支
taoye 2 years ago
parent
commit
a1206c1b14
5 changed files with 867 additions and 3 deletions
  1. +92
    -1
      FryPot_DosingSystem/Control/DosingLogicControl.cs
  2. +44
    -0
      FryPot_DosingSystem/Model/RollerLineBarrelSerialModel.cs
  3. +636
    -1
      FryPot_DosingSystem/View/HardWareStatusView.xaml
  4. +47
    -1
      FryPot_DosingSystem/View/HardWareStatusView.xaml.cs
  5. +48
    -0
      FryPot_DosingSystem/ViewModel/HardWareStatusViewModel.cs

+ 92
- 1
FryPot_DosingSystem/Control/DosingLogicControl.cs View File

@@ -5,6 +5,7 @@ using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Helper;
using BPASmartClient.HubHelper;
using FryPot_DosingSystem.Model;
using FryPot_DosingSystem.ViewModel;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
@@ -14,6 +15,7 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Media;

namespace FryPot_DosingSystem.Control
{
@@ -38,6 +40,10 @@ namespace FryPot_DosingSystem.Control
/// 全局变量对象声明
/// </summary>
GlobalVariable globalVar;
/// <summary>
/// 线体状态对象声明
/// </summary>
HardWareStatusViewModel hardWareStatusModel;

#region 上位机内部变量
//int lineAlarm = 0;//线体故障信号 1:无故障 -1:故障
@@ -55,6 +61,7 @@ namespace FryPot_DosingSystem.Control
public DosingLogicControl()
{
globalVar = new GlobalVariable();
hardWareStatusModel = HardWareStatusViewModel.GetInstance;
ActionManage.GetInstance.Register(new Action<object>(RecipeDataParse), "RecipeSetDown");
ActionManage.GetInstance.Register(new Action(() => { RecipeQuene.Clear(); InputMaterialQuene.Clear(); OutputMaterialQuene.Clear(); }), "ClearRecipes");
ActionManage.GetInstance.Register(new Action(() => { globalVar.PlcInite = 1; }), "StartPlcInite");
@@ -66,6 +73,7 @@ namespace FryPot_DosingSystem.Control
ReadPlcData();
IniteTask();
}
/// <summary>
/// AGV上下料上报数据解析
/// </summary>
@@ -252,11 +260,94 @@ namespace FryPot_DosingSystem.Control

globalVar.CleadBarrelExitSingle = data[0];
}));
globalVar.rollerLineOne.OutMaterialingSingle = 1;
globalVar.rollerLineOne.StationOne = 401;
RollerLineStatusDisplay();
Thread.Sleep(10);
}), "MainViewReadPlcData");

}
/// <summary>
/// 滚筒线运行状态显示
/// </summary>
private void RollerLineStatusDisplay()
{
hardWareStatusModel.RollerOneModel.LocOneRollerSerial = globalVar.rollerLineOne.StationOne;
hardWareStatusModel.RollerOneModel.LocTwoRollerSerial = globalVar.rollerLineOne.StationTwo;
hardWareStatusModel.RollerOneModel.LocThreeRollerSerial = globalVar.rollerLineOne.StationThree;
hardWareStatusModel.RollerOneModel.LocFourRollerSerial=globalVar.rollerLineOne.StationFour;
hardWareStatusModel.RollerOneModel.LocFiveRollerSerial=globalVar.rollerLineOne.StationFive;
hardWareStatusModel.RollerOneModel.LocSixRollerSerial = globalVar.rollerLineOne.StationSix;
hardWareStatusModel.RollerOneModel.LocSevenRollerSerial = globalVar.rollerLineOne.StationSeven;
hardWareStatusModel.RollerOneModel.LocEightRollerSerial = globalVar.rollerLineOne.StationEight;
if (globalVar.rollerLineOne.OutMaterialingTroubleSingle == 0)
{
// ActionManage.GetInstance.Send("RedToGray", 1);//无故障
}
else
{
// ActionManage.GetInstance.Send("ToRed",1);//有故障
}
if (globalVar.rollerLineOne.OutMaterialingSingle == 1)//运行中
{
// ActionManage.GetInstance.Send("ToGreen",1);
}
else
{
// ActionManage.GetInstance.Send("GreenToGray",1); //未运行
}
hardWareStatusModel.RollerTwoModel.LocOneRollerSerial = globalVar.rollerLineTwo.StationOne;
hardWareStatusModel.RollerTwoModel.LocTwoRollerSerial = globalVar.rollerLineTwo.StationTwo;
hardWareStatusModel.RollerTwoModel.LocThreeRollerSerial = globalVar.rollerLineTwo.StationThree;
hardWareStatusModel.RollerTwoModel.LocFourRollerSerial = globalVar.rollerLineTwo.StationFour;
hardWareStatusModel.RollerTwoModel.LocFiveRollerSerial = globalVar.rollerLineTwo.StationFive;
hardWareStatusModel.RollerTwoModel.LocSixRollerSerial = globalVar.rollerLineTwo.StationSix;
hardWareStatusModel.RollerTwoModel.LocSevenRollerSerial = globalVar.rollerLineTwo.StationSeven;
hardWareStatusModel.RollerTwoModel.LocEightRollerSerial = globalVar.rollerLineTwo.StationEight;
if (globalVar.rollerLineTwo.OutMaterialingTroubleSingle == 0)
{
//ActionManage.GetInstance.Send("RedToGray", 2);//无故障
}
else
{

//ActionManage.GetInstance.Send("ToRed", 2);//有故障
}
if (globalVar.rollerLineTwo.OutMaterialingSingle == 1)//运行中
{

// ActionManage.GetInstance.Send("ToGreen",2);

}
else
{
// ActionManage.GetInstance.Send("GreenToGray", 2);//未运行
}
hardWareStatusModel.RollerThreeModel.LocOneRollerSerial = globalVar.rollerLineThree.StationOne;
hardWareStatusModel.RollerThreeModel.LocTwoRollerSerial = globalVar.rollerLineThree.StationTwo;
hardWareStatusModel.RollerThreeModel.LocThreeRollerSerial = globalVar.rollerLineThree.StationThree;
hardWareStatusModel.RollerThreeModel.LocFourRollerSerial = globalVar.rollerLineThree.StationFour;
hardWareStatusModel.RollerThreeModel.LocFiveRollerSerial = globalVar.rollerLineThree.StationFive;
hardWareStatusModel.RollerThreeModel.LocSixRollerSerial = globalVar.rollerLineThree.StationSix;
hardWareStatusModel.RollerThreeModel.LocSevenRollerSerial = globalVar.rollerLineThree.StationSeven;
hardWareStatusModel.RollerThreeModel.LocEightRollerSerial = globalVar.rollerLineThree.StationEight;
if (globalVar.rollerLineThree.OutMaterialingTroubleSingle == 0)
{
// ActionManage.GetInstance.Send("RedToGray", 3);//无故障
}
else
{
// ActionManage.GetInstance.Send("ToRed", 3);//有故障
}
if (globalVar.rollerLineThree.OutMaterialingSingle == 1)//运行中
{
// ActionManage.GetInstance.Send("ToGreen", 3);
}
else
{
//ActionManage.GetInstance.Send("GreenToGray",3);//未运行
}
}
/// <summary>
/// 返回指定地址指定长度的数据
/// </summary>


+ 44
- 0
FryPot_DosingSystem/Model/RollerLineBarrelSerialModel.cs View File

@@ -0,0 +1,44 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace FryPot_DosingSystem.Model
{
internal class RollerLineBarrelSerialModel:ObservableObject
{
private int _locOneRollerSerial;
public int LocOneRollerSerial { get { return _locOneRollerSerial; } set { _locOneRollerSerial = value;OnPropertyChanged(); } }

private int _locTwoRollerSerial;
public int LocTwoRollerSerial { get { return _locTwoRollerSerial; } set { _locTwoRollerSerial = value; OnPropertyChanged(); } }

private int _locThreeRollerSerial;
public int LocThreeRollerSerial { get { return _locThreeRollerSerial; } set { _locThreeRollerSerial = value; OnPropertyChanged(); } }

private int _locFourRollerSerial;
public int LocFourRollerSerial { get { return _locFourRollerSerial; } set { _locFourRollerSerial = value; OnPropertyChanged(); } }

private int _locFiveRollerSerial;
public int LocFiveRollerSerial { get { return _locFiveRollerSerial; } set { _locFiveRollerSerial = value; OnPropertyChanged(); } }

private int _locSixRollerSerial;
public int LocSixRollerSerial { get { return _locSixRollerSerial; } set { _locSixRollerSerial = value; OnPropertyChanged(); } }

private int _locSevenRollerSerial;
public int LocSevenRollerSerial { get { return _locSevenRollerSerial; } set { _locSevenRollerSerial = value; OnPropertyChanged(); } }

private int _locEightRollerSerial;
public int LocEightRollerSerial { get { return _locEightRollerSerial; } set { _locEightRollerSerial = value; OnPropertyChanged(); } }

//private Brush? _rollerRunState;
//public Brush RollerRunState { get { return _rollerRunState; } set { _rollerRunState = value; OnPropertyChanged(); } }


//private Color _rollerAlarmState;
//public Color RollerAlarmState { get { return _rollerAlarmState; } set { _rollerAlarmState = value; OnPropertyChanged(); } }
}
}

+ 636
- 1
FryPot_DosingSystem/View/HardWareStatusView.xaml View File

@@ -4,9 +4,644 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FryPot_DosingSystem.View"
xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.DataContext>
<vm:HardWareStatusViewModel></vm:HardWareStatusViewModel>
</UserControl.DataContext>
<Viewbox>
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,2" BorderBrush="DarkBlue" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border BorderThickness="0,0,2,0" BorderBrush="DarkOrange">
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<StackPanel VerticalAlignment="Center">
<TextBlock Text="滚筒线1" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="CadetBlue" Margin="0,0,0,5"></TextBlock>
<Line X1="0" Y1="0" X2="78" Y2="0" Stroke="DarkOrange" StrokeThickness="2" StrokeDashArray="2"></Line>
</StackPanel>
<StackPanel Margin="0,43,0,0" Grid.RowSpan="2" >
<Border Width="15" Height="15" CornerRadius="15" HorizontalAlignment="Left" Margin="12,10,0,0" >
<Border.Background>
<RadialGradientBrush>
<GradientStop Color="DimGray" Offset="0.5" x:Name="gsGreen1"/>
<GradientStop Color="White"/>
</RadialGradientBrush>
</Border.Background>
</Border>
<Border Width="15" Height="15" CornerRadius="15" HorizontalAlignment="Left" Margin="12,10,0,0">
<Border.Background>
<RadialGradientBrush>
<GradientStop Color="DimGray" Offset="0.5" x:Name="gsRed1"/>
<GradientStop Color="White"/>
</RadialGradientBrush>
</Border.Background>
</Border>

</StackPanel>
</Grid>


</Border>
<Grid Grid.Column="1">
<Line X1="0" Y1="0" X2="720" Y2="0" Stroke="Aqua" StrokeThickness="2" StrokeDashArray="2" Margin="0,11,0,0"></Line>
<Border Margin="10,10" BorderThickness="0,0,0,0" BorderBrush="White" CornerRadius="10">

<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerOneModel.LocOneRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位1" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="1" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerOneModel.LocTwoRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位2" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="2" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerOneModel.LocThreeRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位3" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="3" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerOneModel.LocFourRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位4" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="4" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerOneModel.LocFiveRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位5" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="5" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerOneModel.LocSixRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位6" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="6" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerOneModel.LocSevenRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位7" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="7">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerOneModel.LocEightRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位8" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
</Grid>
</Border>
<Line X1="0" Y1="0" X2="720" Y2="0" Stroke="Aqua" StrokeThickness="2" StrokeDashArray="2" Margin="0,98,0,0"></Line>
</Grid>
</Grid>
</Border>
<Border Grid.Row="1" BorderThickness="0,0,0,2" BorderBrush="DarkBlue" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border BorderThickness="0,0,2,0" BorderBrush="DarkOrange">
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<StackPanel VerticalAlignment="Center">
<TextBlock Text="滚筒线2" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="CadetBlue" Margin="0,0,0,5"></TextBlock>
<Line X1="0" Y1="0" X2="78" Y2="0" Stroke="DarkOrange" StrokeThickness="2" StrokeDashArray="2"></Line>
</StackPanel>
<StackPanel Margin="0,43,0,0" Grid.RowSpan="2" >
<Border Width="15" Height="15" CornerRadius="15" HorizontalAlignment="Left" Margin="12,10,0,0">
<Border.Background>
<RadialGradientBrush>
<GradientStop Color="DimGray" Offset="0.5" x:Name="gsGreen2"/>
<GradientStop Color="White"/>
</RadialGradientBrush>
</Border.Background>
</Border>
<Border Width="15" Height="15" CornerRadius="15" HorizontalAlignment="Left" Margin="12,10,0,0">
<Border.Background>
<RadialGradientBrush>
<GradientStop Color="DimGray" Offset="0.5" x:Name="gsRed2"/>
<GradientStop Color="White"/>
</RadialGradientBrush>
</Border.Background>
</Border>

</StackPanel>
</Grid>


</Border>
<Grid Grid.Column="1">
<Line X1="0" Y1="0" X2="720" Y2="0" Stroke="Aqua" StrokeThickness="2" StrokeDashArray="2" Margin="0,11,0,0"></Line>
<Border Margin="10,10" BorderThickness="0,0,0,0" BorderBrush="White" CornerRadius="10">

<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerTwoModel.LocOneRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位1" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="1" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerTwoModel.LocTwoRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位2" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="2" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerTwoModel.LocThreeRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位3" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="3" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerTwoModel.LocFourRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位4" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="4" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerTwoModel.LocFiveRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位5" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="5" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerTwoModel.LocSixRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位6" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="6" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerTwoModel.LocSevenRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位7" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="7">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerTwoModel.LocEightRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位8" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
</Grid>
</Border>
<Line X1="0" Y1="0" X2="720" Y2="0" Stroke="Aqua" StrokeThickness="2" StrokeDashArray="2" Margin="0,98,0,0"></Line>
</Grid>
</Grid>
</Border>
<Border Grid.Row="2" BorderThickness="0,0,0,2" BorderBrush="DarkBlue" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border BorderThickness="0,0,2,0" BorderBrush="DarkOrange">
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<StackPanel VerticalAlignment="Center">
<TextBlock Text="滚筒线3" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="CadetBlue" Margin="0,0,0,5"></TextBlock>
<Line X1="0" Y1="0" X2="78" Y2="0" Stroke="DarkOrange" StrokeThickness="2" StrokeDashArray="2"></Line>
</StackPanel>
<StackPanel Margin="0,43,0,0" Grid.RowSpan="2" >
<Border Width="15" Height="15" CornerRadius="15" HorizontalAlignment="Left" Margin="12,10,0,0">
<Border.Background>
<RadialGradientBrush>
<GradientStop Color="DimGray" Offset="0.5" x:Name="gsGreen3"/>
<GradientStop Color="White"/>
</RadialGradientBrush>
</Border.Background>
</Border>
<Border Width="15" Height="15" CornerRadius="15" HorizontalAlignment="Left" Margin="12,10,0,0">
<Border.Background>
<RadialGradientBrush>
<GradientStop Color="DimGray" Offset="0.5" x:Name="gsRed3"/>
<GradientStop Color="White"/>
</RadialGradientBrush>
</Border.Background>
</Border>

</StackPanel>
</Grid>


</Border>
<Grid Grid.Column="1">
<Line X1="0" Y1="0" X2="720" Y2="0" Stroke="Aqua" StrokeThickness="2" StrokeDashArray="2" Margin="0,11,0,0"></Line>
<Border Margin="10,10" BorderThickness="0,0,0,0" BorderBrush="White" CornerRadius="10">

<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerThreeModel.LocOneRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位1" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="1" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerThreeModel.LocTwoRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位2" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="2" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerThreeModel.LocThreeRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位3" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="3" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerThreeModel.LocFourRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位4" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="4" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerThreeModel.LocFiveRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位5" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="5" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerThreeModel.LocSixRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位6" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="6" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerThreeModel.LocSevenRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位7" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="7">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerThreeModel.LocEightRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位8" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
</Grid>
</Border>
<Line X1="0" Y1="0" X2="720" Y2="0" Stroke="Aqua" StrokeThickness="2" StrokeDashArray="2" Margin="0,98,0,0"></Line>
</Grid>
</Grid>
</Border>
<Border Grid.Row="3" BorderThickness="0,0,0,2" BorderBrush="DarkBlue" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border BorderThickness="0,0,2,0" BorderBrush="DarkOrange">
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<StackPanel VerticalAlignment="Center">
<TextBlock Text="滚筒线4" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="CadetBlue" Margin="0,0,0,5"></TextBlock>
<Line X1="0" Y1="0" X2="78" Y2="0" Stroke="DarkOrange" StrokeThickness="2" StrokeDashArray="2"></Line>
</StackPanel>
<StackPanel Margin="0,43,0,0" Grid.RowSpan="2" >
<Border Width="15" Height="15" CornerRadius="15" HorizontalAlignment="Left" Margin="12,10,0,0">
<Border.Background>
<RadialGradientBrush>
<GradientStop Color="DimGray" Offset="0.5" x:Name="gsGreen4"/>
<GradientStop Color="White"/>
</RadialGradientBrush>
</Border.Background>
</Border>
<Border Width="15" Height="15" CornerRadius="15" HorizontalAlignment="Left" Margin="12,10,0,0">
<Border.Background>
<RadialGradientBrush>
<GradientStop Color="DimGray" Offset="0.5" x:Name="gsRed4"/>
<GradientStop Color="White"/>
</RadialGradientBrush>
</Border.Background>
</Border>

</StackPanel>
</Grid>


</Border>
<Grid Grid.Column="1">
<Line X1="0" Y1="0" X2="720" Y2="0" Stroke="Aqua" StrokeThickness="2" StrokeDashArray="2" Margin="0,11,0,0"></Line>
<Border Margin="10,10" BorderThickness="0,0,0,0" BorderBrush="White" CornerRadius="10">

<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerFourModel.LocOneRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位1" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="1" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerFourModel.LocTwoRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位2" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="2" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerFourModel.LocThreeRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位3" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="3" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerFourModel.LocFourRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位4" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="4" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerFourModel.LocFiveRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位5" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="5" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerFourModel.LocSixRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位6" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="6" BorderThickness="0,0,2,0" BorderBrush="Gray">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerFourModel.LocSevenRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位7" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
<Border Grid.Column="7">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="60" Height="60" CornerRadius="30" BorderThickness="2" VerticalAlignment="Bottom" BorderBrush="HotPink">
<TextBlock Text="{Binding RollerFourModel.LocEightRollerSerial}" FontSize="30" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="DarkOrange"></TextBlock>
</Border>
<TextBlock Grid.Row="1" Text="工位8" HorizontalAlignment="Center" Foreground="DeepSkyBlue"></TextBlock>
</Grid>
</Border>
</Grid>
</Border>
<Line X1="0" Y1="0" X2="720" Y2="0" Stroke="Aqua" StrokeThickness="2" StrokeDashArray="2" Margin="0,98,0,0"></Line>
</Grid>
</Grid>
</Border>
</Grid>
</Viewbox>
</UserControl>

+ 47
- 1
FryPot_DosingSystem/View/HardWareStatusView.xaml.cs View File

@@ -1,4 +1,5 @@
using System;
using BPASmartClient.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -23,6 +24,51 @@ namespace FryPot_DosingSystem.View
public HardWareStatusView()
{
InitializeComponent();
ActionManage.GetInstance.Register(new Action<object>((a) =>
{
switch (a)
{
case 1: gsGreen1.Color = Color.FromRgb(130, 232, 139);break;
case 2: gsGreen2.Color = Color.FromRgb(130, 232, 139); break;
case 3: gsGreen3.Color = Color.FromRgb(130, 232, 139); break;
case 4: gsGreen4.Color = Color.FromRgb(130, 232, 139); break;
}
}), "ToGreen");
ActionManage.GetInstance.Register(new Action<object>((a) =>
{
switch (a)
{
case 1: gsRed1.Color = Color.FromRgb(243, 165, 230); break;
case 2: gsRed2.Color = Color.FromRgb(243, 165, 230); break;
case 3: gsRed3.Color = Color.FromRgb(243, 165, 230); break;
case 4: gsRed4.Color = Color.FromRgb(243, 165, 230); break;
}

}), "ToRed");
ActionManage.GetInstance.Register(new Action<object>((a) =>
{
switch (a)
{
case 1: gsGreen1.Color = Color.FromRgb(84,84,84); break;
case 2: gsGreen2.Color = Color.FromRgb(84,84,84); break;
case 3: gsGreen3.Color = Color.FromRgb(84,84,84); break;
case 4: gsGreen4.Color = Color.FromRgb(84,84,84); break;
}

}), "GreenToGray");
ActionManage.GetInstance.Register(new Action<object>((a) =>
{
switch (a)
{
case 1: gsRed1.Color = Color.FromRgb(84,84,84); break;
case 2: gsRed2.Color = Color.FromRgb(84,84,84); break;
case 3: gsRed3.Color = Color.FromRgb(84,84,84); break;
case 4: gsRed4.Color = Color.FromRgb(84,84,84); break;
}

}), "RedToGray");

}
}
}

+ 48
- 0
FryPot_DosingSystem/ViewModel/HardWareStatusViewModel.cs View File

@@ -0,0 +1,48 @@
using BPASmartClient.Helper;
using FryPot_DosingSystem.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FryPot_DosingSystem.ViewModel
{
internal class HardWareStatusViewModel:ObservableObject
{
private static HardWareStatusViewModel _instance;
public static HardWareStatusViewModel GetInstance=>_instance??=new HardWareStatusViewModel();
public HardWareStatusViewModel()
{
RollerOneModel = new RollerLineBarrelSerialModel();
RollerTwoModel = new RollerLineBarrelSerialModel();
RollerThreeModel = new RollerLineBarrelSerialModel();
}
/// <summary>
/// 线体1 工位->桶号
/// </summary>
private RollerLineBarrelSerialModel _rollerOneModel;
public RollerLineBarrelSerialModel RollerOneModel { get { return _rollerOneModel; }set { _rollerOneModel = value;OnPropertyChanged(); } }

/// <summary>
/// 线体2 工位->桶号
/// </summary>
private RollerLineBarrelSerialModel _rollerTwoModel;
public RollerLineBarrelSerialModel RollerTwoModel { get { return _rollerTwoModel; } set { _rollerTwoModel = value; OnPropertyChanged(); } }

/// <summary>
/// 线体3 工位->桶号
/// </summary>
private RollerLineBarrelSerialModel _rollerThreeModel;
public RollerLineBarrelSerialModel RollerThreeModel { get { return _rollerThreeModel; } set { _rollerThreeModel = value; OnPropertyChanged(); } }
/// <summary>
/// 线体4 工位->桶号s
/// </summary>
private RollerLineBarrelSerialModel _rollerFourModel;
public RollerLineBarrelSerialModel RollerFourModel { get { return _rollerFourModel; } set { _rollerFourModel = value; OnPropertyChanged(); } }
}
}

Loading…
Cancel
Save