From 6eb07eb65dbd1de1d1316fc3b0efcea8dda60b12 Mon Sep 17 00:00:00 2001 From: wangsr Date: Wed, 13 Dec 2023 08:57:30 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E5=BC=BA=E5=88=B6=E6=8E=92?= =?UTF-8?q?=E6=B0=B4=E9=97=AE=E9=A2=98=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ManualControl/ForceWaterControl.cs | 19 +++++++++++++------ .../Report/LjLogReport.cs | 2 ++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ForceWaterControl.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ForceWaterControl.cs index 35eb7a8..a59b3f2 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ForceWaterControl.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ForceWaterControl.cs @@ -42,14 +42,15 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl SetAllControls(); - BottomSelect(runtime); - HslSwitchE.ForceControlHA.OnSwitchChanged += ForceControl_OnSwitchChanged; HslSwitchE.ForceControlCA.OnSwitchChanged += ForceControl_OnSwitchChanged; HslSwitchE.ForceControlHB.OnSwitchChanged += ForceControl_OnSwitchChanged; HslSwitchE.ForceControlCB.OnSwitchChanged += ForceControl_OnSwitchChanged; StateRefresh(new object(), new EventArgs()); + + BottomSelect(runtime); + //timer = new Timer(); //timer.Interval = 1000; //timer.Enabled = true; @@ -58,11 +59,14 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl private void ForceControl_OnSwitchChanged(object obj, bool state) { - if(state) + DB2119 = new DB2119Helper(); + if (state) { if (MessageBox.Show("是否要打开强制排水模式?", "强制模式启动确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { + HslSwitch hs = obj as HslSwitch; + hs.SwitchStatus = false; return; } } @@ -84,7 +88,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl break; default: break; } - DefaultSwitch(hslSwitch); + DefaultSwitch(hslSwitch, state); } private void StateRefresh(object sender, EventArgs e) @@ -93,10 +97,13 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl HslSwitchE.ForceControlCA.SwitchStatus = DB2119.Force_CA.forceOn; HslSwitchE.ForceControlHB.SwitchStatus = DB2119.Force_HB.forceOn; HslSwitchE.ForceControlCB.SwitchStatus = DB2119.Force_CB.forceOn; + DefaultSwitch(HslSwitchE.ForceControlHA, DB2119.Force_HA.forceOn); } private void BottomSelect(RuntimeParameter runtime) { + DB2119 = new DB2119Helper(); + SingleSelect(); if (ButtonE.StartMetage1 == runtime.Sender) @@ -248,9 +255,9 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl } - private void DefaultSwitch(HslSwitch hslSwitch) + private void DefaultSwitch(HslSwitch hslSwitch, bool state) { - string status = hslSwitch.SwitchStatus ? "强制状态开" : "强制状态关"; + string status = state ? "强制状态开" : "强制状态关"; hslSwitch.Text = status; } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs index e66a83e..80a9df4 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs @@ -71,6 +71,8 @@ namespace Mesnac.Action.ChemicalWeighing.Report } Line.DataSource = dataTable; + StartDate.MCValue = DateTime.Now.AddDays(-7); + SetForm(""); SelectButton.Click += SelectByTime;