diff --git a/HBLConsole.Model/ProcessConditions.cs b/HBLConsole.Model/ProcessConditions.cs new file mode 100644 index 0000000..56b8917 --- /dev/null +++ b/HBLConsole.Model/ProcessConditions.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Toolkit.Mvvm.ComponentModel; +using Microsoft.Toolkit.Mvvm.Input; +using System.Collections.ObjectModel; + +namespace HBLConsole.Model +{ + /// + /// 流程数据信息 + /// + public class ProcessConditions : ObservableObject + { + /// + /// 流程标题 + /// + public string ProcessTitl { get { return _mProcessTitl; } set { _mProcessTitl = value; OnPropertyChanged(); } } + private string _mProcessTitl; + + public ObservableCollection Conditions { get; set; } = new ObservableCollection(); + + } + + public class Condition : ObservableObject + { + + public bool ConditionMet { get { return _mConditionMet; } set { _mConditionMet = value; OnPropertyChanged(); } } + private bool _mConditionMet; + + public string ConditionName { get { return _mConditionName; } set { _mConditionName = value; OnPropertyChanged(); } } + private string _mConditionName; + + + } + + +} diff --git a/HBLConsole/Resources/ResourceDictionarys/BasicStyle.xaml b/HBLConsole/Resources/ResourceDictionarys/BasicStyle.xaml index 628c072..13b80a7 100644 --- a/HBLConsole/Resources/ResourceDictionarys/BasicStyle.xaml +++ b/HBLConsole/Resources/ResourceDictionarys/BasicStyle.xaml @@ -255,6 +255,7 @@ Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" /> + diff --git a/HBLConsole/View/DebugView.xaml b/HBLConsole/View/DebugView.xaml index 8635543..b834fdf 100644 --- a/HBLConsole/View/DebugView.xaml +++ b/HBLConsole/View/DebugView.xaml @@ -16,57 +16,94 @@ - - - - - - - + + + + + + + + + + + + + + + + @@ -127,13 +164,46 @@ Style="{StaticResource ButtonStyle}" /> - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HBLConsole/View/MainView.xaml b/HBLConsole/View/MainView.xaml index 9fd00d4..1b40c79 100644 --- a/HBLConsole/View/MainView.xaml +++ b/HBLConsole/View/MainView.xaml @@ -11,6 +11,7 @@ Title="MainView" Width="1400" Height="850" + Topmost="True" AllowsTransparency="True" Background="{x:Null}" WindowStartupLocation="CenterScreen" diff --git a/HBLConsole/ViewModel/DebugViewModel.cs b/HBLConsole/ViewModel/DebugViewModel.cs index e198849..75ff11a 100644 --- a/HBLConsole/ViewModel/DebugViewModel.cs +++ b/HBLConsole/ViewModel/DebugViewModel.cs @@ -10,6 +10,7 @@ using HBLConsole.Business.Devices; using System.ComponentModel; using System.Runtime.CompilerServices; using HBLConsole.Communication; +using HBLConsole.Model; namespace HBLConsole.ViewModel { @@ -21,7 +22,7 @@ namespace HBLConsole.ViewModel SimOrderCommand = new RelayCommand(() => { ActionManagerment.GetInstance.Send("SimOrder"); }); InitCommand = new RelayCommand(() => { MORKS.GetInstance.DeviceInit(); }); - + ProcessCondition(); ThreadManagerment.GetInstance.StartLong(new Action(() => { NoodleCount = MORKS.GetInstance.mORKS.RBTakeNoodleTask.Count; @@ -30,6 +31,77 @@ namespace HBLConsole.ViewModel }), "数据监控"); } + private void ProcessCondition() + { + ProcessConditions process = new ProcessConditions(); + process.ProcessTitl = "机器人"; + process.Conditions.Add(new Condition() { ConditionName = "机器人空闲", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "温度到达", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "取面中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "取碗中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "到面中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "出餐中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "机器人空闲", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "温度到达", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "取面中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "取碗中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "到面中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "出餐中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "机器人空闲", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "温度到达", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "取面中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "取碗中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "到面中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "出餐中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "机器人空闲", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "温度到达", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "取面中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "取碗中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "到面中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "出餐中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "机器人空闲", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "温度到达", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "取面中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "取碗中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "到面中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "出餐中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "机器人空闲", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "温度到达", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "取面中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "取碗中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "到面中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "出餐中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "机器人空闲", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "温度到达", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "取面中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "取碗中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "到面中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "出餐中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "机器人空闲", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "温度到达", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "取面中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "取碗中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "到面中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "出餐中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "机器人空闲", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "温度到达", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "取面中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "取碗中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "到面中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "出餐中", ConditionMet = false }); + processConditions.Add(process); + + process = new ProcessConditions(); + process.ProcessTitl = "取完机构"; + process.Conditions.Add(new Condition() { ConditionName = "机器人空闲", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "温度到达", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "取面中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "取碗中", ConditionMet = false }); + process.Conditions.Add(new Condition() { ConditionName = "到面中", ConditionMet = true }); + process.Conditions.Add(new Condition() { ConditionName = "出餐中", ConditionMet = true }); + processConditions.Add(process); + } + public static event EventHandler StaticPropertyChanged; private static void OnStaticPropertyChanged([CallerMemberName] string PropName = "") diff --git a/HBLConsole/ViewModel/ViewModelBase.cs b/HBLConsole/ViewModel/ViewModelBase.cs index ca5f729..4463624 100644 --- a/HBLConsole/ViewModel/ViewModelBase.cs +++ b/HBLConsole/ViewModel/ViewModelBase.cs @@ -67,6 +67,14 @@ namespace HBLConsole.ViewModel public static string WindowName { get { return _mWindowName; } set { _mWindowName = value; OnStaticPropertyChanged(); } } private static string _mWindowName = string.Empty; + + #region 流程监控属性 + /// + /// 流程条件监控 + /// + public static ObservableCollection processConditions { get; set; } = new ObservableCollection(); + #endregion + #endregion ///