WriteStartOrStop

dep
我叫锄头 11 months ago
parent 725b5aceed
commit 543d4fc9c3

@ -474,6 +474,13 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
GRepairOnOff(ButtonE, RadioE);
}
if (ButtonE.DryStartOrStop == runtime.Sender)
{
DryStartOrStop(ButtonE, RadioE);
}
#endregion
#region 粘贴数据

@ -81,6 +81,9 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl.Entity
public Button RepairMode { get; set; }
public Button GRepairMode { get; set; }
public Button DryStartOrStop { get; set; }
public Button DryDownload { get; set; }
public Button WaterDownload { get; set; }
public Button PasteDry { get; set; }

@ -169,6 +169,16 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
ConvertBackColor(dB2105Helper.FeededPdG8);
break;
}
int dryIndex = ControlsHelper.DrySelect(RadioE);
if (dryIndex > 0)
{
var startOrStop = dB2105Helper.GetDryStartOrStop();
bool b = startOrStop[dryIndex - 1];
DryStartOrStopColoer(dryIndex,b);
}
}
@ -187,6 +197,22 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
}
}
private void DryStartOrStopColoer(int no,bool b)
{
if (b)
{
buttonE.DryStartOrStop.BackColor = Color.Green;
buttonE.DryStartOrStop.Text = $"干混机{no}(开)";
}
else
{
buttonE.DryStartOrStop.BackColor = Color.Transparent;
buttonE.DryStartOrStop.Text = $"干混机{no}(关)";
}
}
private string ConvertOnOff(bool state)
{
if (state)

@ -1139,6 +1139,80 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
}
}
public static void DryStartOrStop(ButtonEntity buttonEntity, MCRadioButtonEntity RadioE)
{
var index = ControlsHelper.DrySelect(RadioE);
if (index <= 0)
{
MessageBox.Show("请选择机台");
return;
}
if (buttonEntity.DryStartOrStop.Text.Contains("关"))
{
if (MessageBox.Show($"是否启动干混机{index}", "干混机确认",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
return;
}
switch (index)
{
case 1:
DB2105WriteHelper.WriteStartOrStop(1,true);
break;
case 2:
DB2105WriteHelper.WriteStartOrStop(2,true);
break;
case 3:
DB2105WriteHelper.WriteStartOrStop(3,true);
break;
case 4:
DB2105WriteHelper.WriteStartOrStop(4,true);
break;
}
}
else
{
if (buttonEntity.DryStartOrStop.Text.Contains("开"))
{
if (MessageBox.Show($"是否关闭干混机{index}", "干混机确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
return;
}
}
switch (index)
{
case 1:
DB2105WriteHelper.WriteStartOrStop(1, false);
break;
case 2:
DB2105WriteHelper.WriteStartOrStop(2, false);
break;
case 3:
DB2105WriteHelper.WriteStartOrStop(3, false);
break;
case 4:
DB2105WriteHelper.WriteStartOrStop(4, false);
break;
}
}
}
#endregion
#region 湿混机物料封装

@ -19,6 +19,24 @@ namespace DataBlockHelper.DBHelpers
public bool[] End => new FourBoolArrayManager(50, bytes).GetList();
/// <summary>
/// 干混机开始停止
/// </summary>
/// <returns></returns>
public List<bool> GetDryStartOrStop()
{
List<bool> ls = new List<bool>();
var b = bytes.Skip(48).Take(1).First();
for (int i = 0; i < 4; i++) {
ls.Add(b.GetBit(i));
}
return ls;
}
/// <summary>
/// 设置启动运行
/// </summary>

@ -719,6 +719,21 @@ namespace DataBlockHelper.DBHelpers
}
/// <summary>
/// 写入干混机 1 2 3 4
/// </summary>
/// <param name="no"></param>
/// <param name="value"></param>
/// <returns></returns>
public static void WriteStartOrStop(int no, bool value)
{
var siemensS7Net = PlcConnect.Instance;
var b = siemensS7Net.Write($"{DbName}.48.{no-1}",value);
}
public static void AddFeededPd(int start,bool b)
{

@ -975,6 +975,30 @@
<Property name="TabIndex">63</Property>
</Object>
<Object type="System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="GroupBox50" children="Controls">
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="DryStartOrStop" children="Controls">
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAAEAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIERCRTgxOTNENDE2MDRBRDVCOTRBRTNDMkQzNDc1MUQyBgYAAAAY6Ieq5Yqo5o6n5Yi25oyJ6ZKu5LqL5Lu2BgcAAAAY6Ieq5Yqo5o6n5Yi25oyJ6ZKu5LqL5Lu2Cw==</Binary>
</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="MCPurview">False</Property>
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">干混机</Property>
<Property name="Location">6, 405</Property>
<Property name="Name">DryStartOrStop</Property>
<Property name="Size">158, 42</Property>
<Property name="TabIndex">151</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="PasteDry" children="Controls">
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAAEAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIERCRTgxOTNENDE2MDRBRDVCOTRBRTNDMkQzNDc1MUQyBgYAAAAY6Ieq5Yqo5o6n5Yi25oyJ6ZKu5LqL5Lu2BgcAAAAY6Ieq5Yqo5o6n5Yi25oyJ6ZKu5LqL5Lu2Cw==</Binary>
@ -994,9 +1018,9 @@
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">粘贴配方</Property>
<Property name="Location">28, 390</Property>
<Property name="Location">6, 345</Property>
<Property name="Name">PasteDry</Property>
<Property name="Size">114, 42</Property>
<Property name="Size">158, 42</Property>
<Property name="TabIndex">149</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel109" children="Controls">
@ -1015,7 +1039,7 @@
<Property name="MCEnabled">True</Property>
<Property name="Text">产线选择</Property>
<Property name="Font">宋体, 9pt</Property>
<Property name="Location">13, 349</Property>
<Property name="Location">10, 322</Property>
<Property name="Name">MCLabel109</Property>
<Property name="Size">53, 12</Property>
</Object>
@ -1041,7 +1065,7 @@
<Property name="DbOptionType">Query</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Location">72, 342</Property>
<Property name="Location">69, 315</Property>
<Property name="Name">PasteChooseDry</Property>
<Property name="Size">82, 24</Property>
<Property name="TabIndex">147</Property>

Loading…
Cancel
Save