diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Qu/InitAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Qu/InitAction.cs
index 95a615c..f5209c6 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Qu/InitAction.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Qu/InitAction.cs
@@ -63,12 +63,41 @@ namespace Mesnac.Action.ChemicalWeighing.Qu
MCButton BtnCoolWaterB;
MCButton BtnHotWaterA;
MCButton BtnHotWaterB;
+
+
+ HslLanternSimple HslDa;
+ HslLanternSimple HslDb;
+ HslLanternSimple HslDc;
+ HslLanternSimple HslDd;
+
+ MCButton BtnDa;
+ MCButton BtnDb;
+ MCButton BtnDc;
+ MCButton BtnDd;
+
+
+
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须调用
var controls = GetAllControls();
+ HslDa=controls.FirstOrDefault(x => x.Name == "HslDa") as HslLanternSimple;
+ HslDb = controls.FirstOrDefault(x => x.Name == "HslDb") as HslLanternSimple;
+ HslDc = controls.FirstOrDefault(x => x.Name == "HslDc") as HslLanternSimple;
+ HslDd = controls.FirstOrDefault(x => x.Name == "HslDd") as HslLanternSimple;
+
+ BtnDa=controls.FirstOrDefault(x => x.Name == "BtnDa") as MCButton;
+ BtnDb = controls.FirstOrDefault(x => x.Name == "BtnDb") as MCButton;
+ BtnDc = controls.FirstOrDefault(x => x.Name == "BtnDc") as MCButton;
+ BtnDd = controls.FirstOrDefault(x => x.Name == "BtnDd") as MCButton;
+
+ BtnDa.Click += BtnDa_Click;
+ BtnDb.Click += BtnDb_Click;
+ BtnDc.Click += BtnDc_Click;
+ BtnDd.Click += BtnDd_Click;
+
BtnCoolWaterA = controls.FirstOrDefault(x => x.Name == "BtnCoolWaterA") as MCButton;
@@ -163,6 +192,57 @@ namespace Mesnac.Action.ChemicalWeighing.Qu
timer.Enabled = true;
timer.Tick += new EventHandler(StateRefresh);//添加事件
+
+
+
+ }
+
+ private void BtnDd_Click(object sender, EventArgs e)
+ {
+ if (BtnDd.MCValue.ToString().Contains("开"))
+ {
+ DB2108HelperWriteNew.WriteD(true);
+ }
+ else
+ {
+ DB2108HelperWriteNew.WriteD(false);
+ }
+ }
+
+ private void BtnDc_Click(object sender, EventArgs e)
+ {
+ if (BtnDc.MCValue.ToString().Contains("开"))
+ {
+ DB2108HelperWriteNew.WriteC(true);
+ }
+ else
+ {
+ DB2108HelperWriteNew.WriteC(false);
+ }
+ }
+
+ private void BtnDb_Click(object sender, EventArgs e)
+ {
+ if (BtnDb.MCValue.ToString().Contains("开"))
+ {
+ DB2108HelperWriteNew.WriteB(true);
+ }
+ else
+ {
+ DB2108HelperWriteNew.WriteB(false);
+ }
+ }
+
+ private void BtnDa_Click(object sender, EventArgs e)
+ {
+ if (BtnDd.MCValue.ToString().Contains("开"))
+ {
+ DB2108HelperWriteNew.WriteA(true);
+ }
+ else
+ {
+ DB2108HelperWriteNew.WriteA(false);
+ }
}
private void BtnHotWaterB_Click(object sender, EventArgs e)
@@ -476,6 +556,57 @@ namespace Mesnac.Action.ChemicalWeighing.Qu
HotWaterB.LanternBackground = System.Drawing.Color.Gray;
}
+ //干混机
+ ab = dB2108.DryA;
+ if (ab.enable)
+ {
+ BtnDa.MCValue = "干混A使能关";
+ HslDa.LanternBackground = System.Drawing.Color.Green;
+ }
+ else
+ {
+ BtnDa.MCValue = "干混A使能开";
+ HslDa.LanternBackground = System.Drawing.Color.Gray;
+ }
+
+ ab = dB2108.DryB;
+ if (ab.enable)
+ {
+ BtnDb.MCValue = "干混B使能关";
+ HslDb.LanternBackground = System.Drawing.Color.Green;
+ }
+ else
+ {
+ BtnDb.MCValue = "干混B使能开";
+ HslDb.LanternBackground = System.Drawing.Color.Gray;
+ }
+
+
+ ab = dB2108.DryC;
+ if (ab.enable)
+ {
+ BtnDc.MCValue = "干混C使能关";
+ HslDc.LanternBackground = System.Drawing.Color.Green;
+ }
+ else
+ {
+ BtnDc.MCValue = "干混C使能开";
+ HslDc.LanternBackground = System.Drawing.Color.Gray;
+ }
+
+
+ ab = dB2108.DryD;
+ if (ab.enable)
+ {
+ BtnDd.MCValue = "干混D使能关";
+ HslDd.LanternBackground = System.Drawing.Color.Green;
+ }
+ else
+ {
+ BtnDd.MCValue = "干混D使能开";
+ HslDd.LanternBackground = System.Drawing.Color.Gray;
+ }
+
}
}
}
diff --git a/DataBlockHelper/DBHelpers/DB2108HelperWriteNew.cs b/DataBlockHelper/DBHelpers/DB2108HelperWriteNew.cs
index e89b366..4a10688 100644
--- a/DataBlockHelper/DBHelpers/DB2108HelperWriteNew.cs
+++ b/DataBlockHelper/DBHelpers/DB2108HelperWriteNew.cs
@@ -52,5 +52,28 @@ namespace DataBlockHelper.DBHelpers
siemensS7Net.Write($"{DbName}.{start}.0", time.PlsHopperOff);
}
+
+
+
+ public static void WriteA(bool b)
+ {
+ var siemensS7Net = PlcConnect.Instance;
+ siemensS7Net.Write($"{DbName}.72.0", b);
+ }
+ public static void WriteB(bool b)
+ {
+ var siemensS7Net = PlcConnect.Instance;
+ siemensS7Net.Write($"{DbName}.74.0", b);
+ }
+ public static void WriteC(bool b)
+ {
+ var siemensS7Net = PlcConnect.Instance;
+ siemensS7Net.Write($"{DbName}.76.0", b);
+ }
+ public static void WriteD(bool b)
+ {
+ var siemensS7Net = PlcConnect.Instance;
+ siemensS7Net.Write($"{DbName}.78.0", b);
+ }
}
}
diff --git a/Main/MCEdit/Data/MCProject/nodeForm/FrmQu.xml b/Main/MCEdit/Data/MCProject/nodeForm/FrmQu.xml
index 6bb43aa..3558e6d 100644
--- a/Main/MCEdit/Data/MCProject/nodeForm/FrmQu.xml
+++ b/Main/MCEdit/Data/MCProject/nodeForm/FrmQu.xml
@@ -1,5 +1,129 @@
@@ -839,9 +963,9 @@
False
取消队列
- 25, 358
+ 731, 528
GroupBox1
- 662, 151
+ 556, 151
12
@@ -860,7 +984,7 @@
False
False
Control
- 1246, 717
+ 1370, 805
WindowsDefaultLocation
缓存队列取消
Normal