add - 自动控制水称停止恢复按钮

dep
wangsr 12 months ago
parent 3c87078459
commit 7c05455c2c

@ -295,22 +295,59 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
if (ButtonE.CAOnOff == runtime.Sender)
{
if(ButtonE.CAOnOff.Text == "停止称量")
{
DB2105WriteHelper.StopWater(0);
ButtonE.CAOnOff.Text = "恢复称量";
}
else if(ButtonE.CAOnOff.Text == "恢复称量")
{
DB2105WriteHelper.StartWater(0);
ButtonE.CAOnOff.Text = "停止称量";
}
}
if (ButtonE.CBOnOff == runtime.Sender)
{
if (ButtonE.CBOnOff.Text == "停止称量")
{
DB2105WriteHelper.StopWater(2);
ButtonE.CBOnOff.Text = "恢复称量";
}
else if (ButtonE.CBOnOff.Text == "恢复称量")
{
DB2105WriteHelper.StartWater(2);
ButtonE.CBOnOff.Text = "停止称量";
}
}
if (ButtonE.HAOnOff == runtime.Sender)
{
if (ButtonE.HAOnOff.Text == "停止称量")
{
DB2105WriteHelper.StopWater(1);
ButtonE.HAOnOff.Text = "恢复称量";
}
else if (ButtonE.HAOnOff.Text == "恢复称量")
{
DB2105WriteHelper.StartWater(1);
ButtonE.HAOnOff.Text = "停止称量";
}
}
if (ButtonE.HBOnOff == runtime.Sender)
{
if (ButtonE.HBOnOff.Text == "停止称量")
{
DB2105WriteHelper.StopWater(3);
ButtonE.HBOnOff.Text = "恢复称量";
}
else if (ButtonE.HBOnOff.Text == "恢复称量")
{
DB2105WriteHelper.StartWater(3);
ButtonE.HBOnOff.Text = "停止称量";
}
}
#endregion

@ -21,6 +21,7 @@ using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Button = System.Windows.Forms.Button;
using IAction = Mesnac.Action.Base.IAction;
namespace Mesnac.Action.ChemicalWeighing.AutoControl
@ -33,6 +34,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
MCLabelEntity LabelE = new MCLabelEntity();
MCComboBoxEntity ComboE = new MCComboBoxEntity();
MCRadioButtonEntity RadioE = new MCRadioButtonEntity();
ButtonEntity buttonE = new ButtonEntity();
DB2105Helper dB2105Helper = new DB2105Helper();
DB2104Helper dB2104Helper = new DB2104Helper();
@ -58,6 +60,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
ControlsHelper.ControlImport<MCCombobox>(ComboE, McControls);
ControlsHelper.ControlImport<MCLabel>(LabelE, McControls);
ControlsHelper.ControlImport<MCRadioButton>(RadioE, McControls);
ControlsHelper.ControlImport<Button>(buttonE, McControls);
ControlInit();
@ -266,6 +269,43 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
TextE.CBDeviation.MCValue = cb.differ;
ComboE.CBLeftOrRight.MCValue = cb.stand;
if (!DB2105WriteHelper.GetWaterStatus()[0])
{
buttonE.CAOnOff.Text = "停止称量";
}
else
{
buttonE.CAOnOff.Text = "恢复称量";
}
if (!DB2105WriteHelper.GetWaterStatus()[1])
{
buttonE.HAOnOff.Text = "停止称量";
}
else
{
buttonE.HAOnOff.Text = "恢复称量";
}
if (!DB2105WriteHelper.GetWaterStatus()[2])
{
buttonE.CBOnOff.Text = "停止称量";
}
else
{
buttonE.CBOnOff.Text = "恢复称量";
}
if (!DB2105WriteHelper.GetWaterStatus()[3])
{
buttonE.HBOnOff.Text = "停止称量";
}
else
{
buttonE.HBOnOff.Text = "恢复称量";
}
}

@ -16,12 +16,11 @@
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="MCPurview">False</Property>
<Property name="Format">
</Property>
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">开始称量</Property>
<Property name="Text">停止称量</Property>
<Property name="Font">宋体, 12pt</Property>
<Property name="Location">213, 31</Property>
<Property name="Name">HAOnOff</Property>
@ -227,12 +226,11 @@
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="MCPurview">False</Property>
<Property name="Format">
</Property>
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">开始称量</Property>
<Property name="Text">停止称量</Property>
<Property name="Font">宋体, 12pt</Property>
<Property name="Location">213, 31</Property>
<Property name="Name">HBOnOff</Property>
@ -438,12 +436,11 @@
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="MCPurview">False</Property>
<Property name="Format">
</Property>
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">开始称量</Property>
<Property name="Text">停止称量</Property>
<Property name="Font">宋体, 12pt</Property>
<Property name="Location">212, 31</Property>
<Property name="Name">CAOnOff</Property>
@ -649,12 +646,11 @@
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="MCPurview">False</Property>
<Property name="Format">
</Property>
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">开始称量</Property>
<Property name="Text">停止称量</Property>
<Property name="Font">宋体, 12pt</Property>
<Property name="Location">211, 31</Property>
<Property name="Name">CBOnOff</Property>

Loading…
Cancel
Save