diff --git a/BPASmartClient.Academy/App.xaml.cs b/BPASmartClient.Academy/App.xaml.cs index eed77daf..ccc1b43d 100644 --- a/BPASmartClient.Academy/App.xaml.cs +++ b/BPASmartClient.Academy/App.xaml.cs @@ -100,6 +100,12 @@ namespace BPASmartClient.Academy Json.Save(); BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.LogSave(); TaskManage.GetInstance.Dispose(); + if (Simens_PLC.GetInstance.IsConnected) + { + Simens_PLC.GetInstance.id = ""; + Simens_PLC.GetInstance.siemens.Write("DB1.DBX1002.0", false); + Simens_PLC.GetInstance.siemens.Write("DB1.DBX1002.1", false); + } App.Current.Shutdown(); Environment.Exit(0); //Process.GetCurrentProcess().Kill(); diff --git a/BPASmartClient.Academy/Model/DeviceCtrl.cs b/BPASmartClient.Academy/Model/DeviceCtrl.cs index b94ff57e..123a55c4 100644 --- a/BPASmartClient.Academy/Model/DeviceCtrl.cs +++ b/BPASmartClient.Academy/Model/DeviceCtrl.cs @@ -65,5 +65,11 @@ namespace BPASmartClient.Academy.Model private float _weightWok; public int TempVent { get { return _tempVent; } set { _tempVent = value; OnPropertyChanged(); } } private int _tempVent; + public float PressureWok { get { return _pressureWok; } set { _pressureWok = value; OnPropertyChanged(); } } + private float _pressureWok; + public float PressureWeek { get { return _pressureWeek; } set { _pressureWeek = value; OnPropertyChanged(); } } + private float _pressureWeek; + public float OpenValue { get { return _openValue; } set { _openValue = value; OnPropertyChanged(); } } + private float _openValue; } } diff --git a/BPASmartClient.Academy/Model/Simens_PLC.cs b/BPASmartClient.Academy/Model/Simens_PLC.cs index 6e2bf22b..7980120c 100644 --- a/BPASmartClient.Academy/Model/Simens_PLC.cs +++ b/BPASmartClient.Academy/Model/Simens_PLC.cs @@ -234,6 +234,18 @@ namespace BPASmartClient.Academy.Model { deviceCtrl.TempVent = o.Content; }); + siemens.Read("DB1.DBD2034").OnSuccess((o) => + { + deviceCtrl.PressureWok = o.Content; + }); + siemens.Read("DB1.DBD2038").OnSuccess((o) => + { + deviceCtrl.PressureWeek = o.Content; + }); + siemens.Read("DB1.DBD2014").OnSuccess((o) => + { + deviceCtrl.OpenValue = o.Content; + }); PipeDetect(); Thread.Sleep(100); } diff --git a/BPASmartClient.Academy/View/DeviceChartView.xaml b/BPASmartClient.Academy/View/DeviceChartView.xaml index 916385e2..1ba5eb61 100644 --- a/BPASmartClient.Academy/View/DeviceChartView.xaml +++ b/BPASmartClient.Academy/View/DeviceChartView.xaml @@ -330,7 +330,7 @@