diff --git a/DyeingComputer.csproj b/DyeingComputer.csproj index 371a829..7be0a13 100644 --- a/DyeingComputer.csproj +++ b/DyeingComputer.csproj @@ -451,6 +451,9 @@ + + + diff --git a/Lmage/10009-0.png b/Lmage/10009-0.png new file mode 100644 index 0000000..7c4594a Binary files /dev/null and b/Lmage/10009-0.png differ diff --git a/Lmage/10009-1.png b/Lmage/10009-1.png new file mode 100644 index 0000000..dd58722 Binary files /dev/null and b/Lmage/10009-1.png differ diff --git a/Lmage/12500-1.png b/Lmage/12500-1.png new file mode 100644 index 0000000..c572ad7 Binary files /dev/null and b/Lmage/12500-1.png differ diff --git a/View/EquipmentSimulationView.xaml b/View/EquipmentSimulationView.xaml index ea62f10..d9943be 100644 --- a/View/EquipmentSimulationView.xaml +++ b/View/EquipmentSimulationView.xaml @@ -13,78 +13,161 @@ + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - + - - - - - - + Padding="5,0,5,0" Margin="150,165,331,0" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + - + - - - - - - - - - + Padding="5,0,5,0" Margin="150,165,20,0" /> + + diff --git a/View/EquipmentSimulationView.xaml.cs b/View/EquipmentSimulationView.xaml.cs index b24296e..8b4294e 100644 --- a/View/EquipmentSimulationView.xaml.cs +++ b/View/EquipmentSimulationView.xaml.cs @@ -1,6 +1,7 @@ using DyeingComputer.ViewModel; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -21,22 +22,72 @@ namespace DyeingComputer.View /// /// EquipmentSimulationView.xaml 的交互逻辑 /// - public partial class EquipmentSimulationView : UserControl + public partial class EquipmentSimulationView : UserControl, INotifyPropertyChanged { + public event PropertyChangedEventHandler PropertyChanged; + protected virtual void OnPropertyChanged(string propertyName) + { + if (PropertyChanged != null) + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + public void RaisePropertyChanged(string propertyName) + { + if (PropertyChanged != null) + { + if (propertyName != null) + { + PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + public EquipmentSimulationView() { InitializeComponent(); + DataContext = this; CountDown(); } + bool _ID3007, _ID3008,_ID3020; + public bool ID3007 + { + get => _ID3007; + set + { + _ID3007 = value; + OnPropertyChanged("ID3007"); + } + } + public bool ID3008 + { + get => _ID3008; + set + { + _ID3008 = value; + OnPropertyChanged("ID3008"); + } + } + public bool ID3020 + { + get => _ID3020; + set + { + _ID3020 = value; + OnPropertyChanged("ID3020"); + } + } + void Tick_Event_1S(object sender, EventArgs e)//Tick_Event周期执行事件1S { M_T.Text = string.Format(" {0:###.#}", Convert.ToDouble(MainWindowViewModel.Selet_dtm("1010"))) + "°C";//主缸温度 M_L.Text = string.Format("{0:D4}", Convert.ToInt16(MainWindowViewModel.Selet_dtm("1015"))) + "L";//主缸水 - if (MainWindowViewModel.Selet_dtd("3023") || MainWindowViewModel.Selet_dtd("3024"))//摆动显示 - { Swing_.Visibility = Visibility.Visible; } - else { Swing_.Visibility = Visibility.Collapsed; } + S1_T.Text = string.Format(" {0:###.#}", Convert.ToDouble(MainWindowViewModel.Selet_dtm("1012"))) + "°C";//缸1温度 + S1_L.Text = string.Format("{0:D4}", Convert.ToInt16(MainWindowViewModel.Selet_dtm("1017"))) + "L";//缸1水 + S2_T.Text = string.Format(" {0:###.#}", Convert.ToDouble(MainWindowViewModel.Selet_dtm("1013"))) + "°C";//缸2温度 + S2_L.Text = string.Format("{0:D4}", Convert.ToInt16(MainWindowViewModel.Selet_dtm("1018"))) + "L";//缸2水 + + } public void CountDown() @@ -47,6 +98,23 @@ namespace DyeingComputer.View }; timer1s.Tick += Tick_Event_1S; timer1s.Start(); - } + } + + + + + private void ID3007_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + ID3007 = !ID3007; + } + private void ID3008_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + ID3008 = !ID3008; + } + private void ID3020_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + ID3020 = !ID3020; + } + } }