杨威 4 months ago
parent 57d07a051b
commit 65381775dc

@ -156,6 +156,12 @@ namespace Mesnac.Action.ChemicalWeighing.Qu
HslSwitch HslSwitch16;
HslLanternSimple Hsldq1;
HslLanternSimple Hsldq2;
HslLanternSimple HslKq1;
HslLanternSimple HslKq2;
public void Run(RuntimeParameter runtime)
{
@ -168,6 +174,12 @@ namespace Mesnac.Action.ChemicalWeighing.Qu
HC = controls.FirstOrDefault(x => x.Name == "HC") as HslLanternSimple;
HD = controls.FirstOrDefault(x => x.Name == "HD") as HslLanternSimple;
Hsldq1 = controls.FirstOrDefault(x => x.Name == "Hsldq1") as HslLanternSimple;
Hsldq2 = controls.FirstOrDefault(x => x.Name == "Hsldq2") as HslLanternSimple;
HslKq1 = controls.FirstOrDefault(x => x.Name == "Hslkq1") as HslLanternSimple;
HslKq2 = controls.FirstOrDefault(x => x.Name == "Hslkq2") as HslLanternSimple;
McA = controls.FirstOrDefault(x => x.Name == "McA") as MCButton;
McB = controls.FirstOrDefault(x => x.Name == "McB") as MCButton;
McC = controls.FirstOrDefault(x => x.Name == "McC") as MCButton;
@ -418,13 +430,20 @@ namespace Mesnac.Action.ChemicalWeighing.Qu
HslSwitch13.OnSwitchChanged += HslSwitch1_OnSwitchChanged;
HslSwitch14.OnSwitchChanged += HslSwitch1_OnSwitchChanged;
HslSwitch15.OnSwitchChanged += HslSwitch1_OnSwitchChanged;
HslSwitch16.OnSwitchChanged += HslSwitch1_OnSwitchChanged;
HslSwitch16.OnSwitchChanged += HslSwitch16_OnSwitchChanged;
MCButton2147483644_Click(new object(), new EventArgs());
}
private void HslSwitch16_OnSwitchChanged(object arg1, bool arg2)
{
string add = "DB2119.16.7";
var val = PlcConnect.Instance.ReadBool(add).Content;
PlcConnect.Instance.Write(add, !val);
}
private void HslSwitch1_OnSwitchChanged(object arg1, bool arg2)
{
var hsl = arg1 as HslSwitch;
@ -1145,9 +1164,54 @@ namespace Mesnac.Action.ChemicalWeighing.Qu
HD.LanternBackground = System.Drawing.Color.Gray;
}
var plc = PlcConnect.Instance;
//Hsldq1
var dq = plc.ReadBool("DB2102.245.0").Content;
if (dq)
{
Hsldq1.LanternBackground = System.Drawing.Color.Green;
}
else
{
Hsldq1.LanternBackground = System.Drawing.Color.Gray;
}
dq = plc.ReadBool("DB2102.247.0").Content;
if (dq)
{
Hsldq2.LanternBackground = System.Drawing.Color.Green;
}
else
{
Hsldq2.LanternBackground = System.Drawing.Color.Gray;
}
dq = plc.ReadBool("DB2102.244.7").Content;
if (dq)
{
HslKq1.LanternBackground = System.Drawing.Color.Green;
}
else
{
HslKq1.LanternBackground = System.Drawing.Color.Gray;
}
dq = plc.ReadBool("DB2102.246.7").Content;
if (dq)
{
HslKq2.LanternBackground = System.Drawing.Color.Green;
}
else
{
HslKq2.LanternBackground = System.Drawing.Color.Gray;
}
var plc=PlcConnect.Instance;
var byt = plc.Read("DB2119.15.0", 2).Content;
var at = byt[0];

@ -90,13 +90,73 @@
<Property name="Size">73, 91</Property>
</Object>
<Property name="TabStop">False</Property>
<Property name="Text">缓存仓上位机</Property>
<Property name="Text">大仓底部氮气</Property>
<Property name="Location">30, 757</Property>
<Property name="Name">GroupBox9</Property>
<Property name="Size">1257, 139</Property>
<Property name="TabIndex">20</Property>
</Object>
<Object type="System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="GroupBox8" children="Controls">
<Object type="Mesnac.Controls.ChemicalWeighing.HslLanternSimple, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Hslkq2" children="Controls">
<Property name="Location">497, 91</Property>
<Property name="Name">Hslkq2</Property>
<Property name="Size">39, 32</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLanternSimple, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Hsldq2" children="Controls">
<Property name="Location">386, 91</Property>
<Property name="Name">Hsldq2</Property>
<Property name="Size">39, 32</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLanternSimple, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Hslkq1" children="Controls">
<Property name="Location">497, 37</Property>
<Property name="Name">Hslkq1</Property>
<Property name="Size">39, 32</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLanternSimple, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Hsldq1" children="Controls">
<Property name="Location">388, 37</Property>
<Property name="Name">Hsldq1</Property>
<Property name="Size">39, 32</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel2147483614" children="Controls">
<Property name="Format">
</Property>
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">空气</Property>
<Property name="Location">497, 17</Property>
<Property name="Name">MCLabel2147483614</Property>
<Property name="Size">29, 12</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel2147483615" children="Controls">
<Property name="Format">
</Property>
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">氮气</Property>
<Property name="Location">388, 17</Property>
<Property name="Name">MCLabel2147483615</Property>
<Property name="Size">29, 12</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCButtonB2" children="Controls">
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>

Loading…
Cancel
Save