change - 电机手动控制删除自动控制 合并磨粉电机

dep_deliver
wangsr 11 months ago
parent 1e160486fc
commit 44119234a7

@ -240,7 +240,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliverControlBoard
{
string name = MotorSelect.Text;
string str = MotorSelect.MCValue.ToString();
byte byt = ControlsHelper.ReadMode(name);
byte byt = ControlsHelper.ReadMode(str);
int value = Convert.ToInt32(str);
if (value <= 32)
{
@ -281,60 +281,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliverControlBoard
}
}
}
if (runtime.Sender == ButtonE.AutoModeOnOff)
{
string name = MotorSelect.Text;
string str = MotorSelect.MCValue.ToString();
byte byt = ControlsHelper.ReadMode(name);
int value = Convert.ToInt32(str);
if (value <= 32)
{
if (byt.GetBit(5))
{
if (MessageBox.Show($"确认开启{name}的自动模式?", "电机模式切换确认", MessageBoxButtons.YesNo) == DialogResult.No)
{
return;
}
ControlsHelper.WriteModeP2(str, true);
}
else
{
if (MessageBox.Show($"确认关闭{name}的自动模式?", "电机模式切换确认", MessageBoxButtons.YesNo) == DialogResult.No)
{
return;
}
ControlsHelper.WriteModeP2(str, false);
}
}
else
{
if (byt.GetBit(3))
{
if (MessageBox.Show($"确认开启{name}的自动模式?", "电机模式切换确认", MessageBoxButtons.YesNo) == DialogResult.No)
{
return;
}
ControlsHelper.WriteModeP1(str, true);
}
else
{
if (MessageBox.Show($"确认关闭{name}的自动模式?", "电机模式切换确认", MessageBoxButtons.YesNo) == DialogResult.No)
{
return;
}
ControlsHelper.WriteModeP1(str, false);
}
}
}
}
private void SetAllControls()

@ -28,14 +28,14 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliverControlBoard.Entity
public MCButton SwitchAutoMode { get; set; }
public MCButton SwitchManualMode { get; set; }
public MCButton ManualModeOnOff { get; set; }
public MCButton AutoModeOnOff { get; set; }
//public MCButton AutoModeOnOff { get; set; }
}
public class MCLabelEntity
{
public MCLabel NowMode { get; set; }
public MCLabel NowAuto { get; set; }
//public MCLabel NowAuto { get; set; }
public MCLabel NowManual { get; set; }
}

@ -239,28 +239,28 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliverControlBoard
dataTable.Rows.Add(dr);
dr = dataTable.NewRow();
dr[0] = "22";
dr[1] = "磨粉主机电机主接触器";
dataTable.Rows.Add(dr);
dr = dataTable.NewRow();
dr[0] = "24";
dr[1] = "磨粉主机电机星型接触器";
dataTable.Rows.Add(dr);
dr = dataTable.NewRow();
dr[0] = "26";
dr[1] = "磨粉主机电机三角型接触器";
dr[1] = "磨粉主机电机"; //主接触器
dataTable.Rows.Add(dr);
//dr = dataTable.NewRow();
//dr[0] = "24";
//dr[1] = "磨粉主机电机星型接触器";
//dataTable.Rows.Add(dr);
//dr = dataTable.NewRow();
//dr[0] = "26";
//dr[1] = "磨粉主机电机三角型接触器";
//dataTable.Rows.Add(dr);
dr = dataTable.NewRow();
dr[0] = "28";
dr[1] = "磨粉风机机电机主接触器";
dataTable.Rows.Add(dr);
dr = dataTable.NewRow();
dr[0] = "30";
dr[1] = "磨粉风机机电机星型接触器";
dataTable.Rows.Add(dr);
dr = dataTable.NewRow();
dr[0] = "32";
dr[1] = "磨粉风机机电机三角型接触器";
dr[1] = "磨粉风机电机"; //主接触器
dataTable.Rows.Add(dr);
//dr = dataTable.NewRow();
//dr[0] = "30";
//dr[1] = "磨粉风机机电机星型接触器";
//dataTable.Rows.Add(dr);
//dr = dataTable.NewRow();
//dr[0] = "32";
//dr[1] = "磨粉风机机电机三角型接触器";
//dataTable.Rows.Add(dr);
dr = dataTable.NewRow();
dr[0] = "34";
dr[1] = "筛分机 A 电机";
@ -325,18 +325,18 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliverControlBoard
LabelE.NowManual.MCValue = "未设置";
}
if (!byt.GetBit(4) && byt.GetBit(5))
{
LabelE.NowAuto.MCValue = "关闭";
}
else if (byt.GetBit(4) && !byt.GetBit(5))
{
LabelE.NowAuto.MCValue = "开启";
}
else
{
LabelE.NowAuto.MCValue = "未设置";
}
//if (!byt.GetBit(4) && byt.GetBit(5))
//{
// LabelE.NowAuto.MCValue = "关闭";
//}
//else if (byt.GetBit(4) && !byt.GetBit(5))
//{
// LabelE.NowAuto.MCValue = "开启";
//}
//else
//{
// LabelE.NowAuto.MCValue = "未设置";
//}
}
else
{
@ -353,18 +353,18 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliverControlBoard
LabelE.NowMode.MCValue = "未设置";
}
if (!byt.GetBit(2) && byt.GetBit(3))
{
LabelE.NowAuto.MCValue = "关闭";
}
else if (byt.GetBit(2) && !byt.GetBit(3))
{
LabelE.NowAuto.MCValue = "开启";
}
else
{
LabelE.NowAuto.MCValue = "未设置";
}
//if (!byt.GetBit(2) && byt.GetBit(3))
//{
// LabelE.NowAuto.MCValue = "关闭";
//}
//else if (byt.GetBit(2) && !byt.GetBit(3))
//{
// LabelE.NowAuto.MCValue = "开启";
//}
//else
//{
// LabelE.NowAuto.MCValue = "未设置";
//}
if (!byt.GetBit(4) && byt.GetBit(5))
{

@ -17,7 +17,7 @@
<Property name="MCEnabled">True</Property>
<Property name="Text">未设置</Property>
<Property name="Font">宋体, 12pt</Property>
<Property name="Location">212, 238</Property>
<Property name="Location">212, 187</Property>
<Property name="Name">NowManual</Property>
<Property name="Size">56, 16</Property>
</Object>
@ -37,30 +37,10 @@
<Property name="MCEnabled">True</Property>
<Property name="Text">当前状态:</Property>
<Property name="Font">宋体, 12pt</Property>
<Property name="Location">134, 238</Property>
<Property name="Location">134, 187</Property>
<Property name="Name">MCLabel77</Property>
<Property name="Size">88, 16</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="NowAuto" children="Controls">
<Property name="Format" />
<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="Font">宋体, 12pt</Property>
<Property name="Location">212, 186</Property>
<Property name="Name">NowAuto</Property>
<Property name="Size">56, 16</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="ManualModeOnOff" children="Controls">
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAAEAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIDZCOEFDN0I0QjQ2QzQxMjZBMjk1RjVCQzJCQkIyQzAyBgYAAAAM5oyJ6ZKu5LqL5Lu2BgcAAAAM5oyJ6ZKu5LqL5Lu2Cw==</Binary>
@ -82,57 +62,11 @@
<Property name="ImageAlign">MiddleRight</Property>
<Property name="Text">手动模式开关</Property>
<Property name="Font">宋体, 12pt</Property>
<Property name="Location">6, 223</Property>
<Property name="Location">6, 172</Property>
<Property name="Name">ManualModeOnOff</Property>
<Property name="Size">122, 46</Property>
<Property name="TabIndex">128</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="AutoModeOnOff" children="Controls">
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAAGAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIDZCOEFDN0I0QjQ2QzQxMjZBMjk1RjVCQzJCQkIyQzAyBgYAAAAM5oyJ6ZKu5LqL5Lu2BgcAAAAM5oyJ6ZKu5LqL5Lu2Cw==</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="ImageAlign">MiddleRight</Property>
<Property name="Text">自动模式开关</Property>
<Property name="Font">宋体, 12pt</Property>
<Property name="Location">6, 171</Property>
<Property name="Name">AutoModeOnOff</Property>
<Property name="Size">122, 46</Property>
<Property name="TabIndex">127</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel79" children="Controls">
<Property name="Format" />
<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="Font">宋体, 12pt</Property>
<Property name="Location">134, 186</Property>
<Property name="Name">MCLabel79</Property>
<Property name="Size">88, 16</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="NowMode" children="Controls">
<Property name="Format" />
<Property name="TextName" />
@ -200,7 +134,7 @@
<Property name="TabIndex">124</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCCombobox, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MotorSelect" children="Controls">
<Property name="AllowTypeAllSymbols">True</Property>
<Property name="AllowTypeAllSymbols">False</Property>
<Property name="ComboboxList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAE5NZXNuYWMuQ29udHJvbHMuRGVmYXVsdCwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuRGVmYXVsdC5Db21ib2JveEl0ZW1zLCBNZXNuYWMuQ29udHJvbHMuRGVmYXVsdCwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAJ01lc25hYy5Db250cm9scy5EZWZhdWx0LkNvbWJvYm94SXRlbXNbXQIAAAAICAkDAAAAAAAAAAAAAAAHAwAAAAABAAAAAAAAAAQlTWVzbmFjLkNvbnRyb2xzLkRlZmF1bHQuQ29tYm9ib3hJdGVtcwIAAAAL</Binary>
</Property>
@ -256,7 +190,7 @@
<Property name="Text">电机手动控制</Property>
<Property name="Location">1403, 13</Property>
<Property name="Name">GroupBox13</Property>
<Property name="Size">285, 275</Property>
<Property name="Size">285, 224</Property>
<Property name="TabIndex">115</Property>
</Object>
<Object type="System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="GroupBox3" children="Controls">

Loading…
Cancel
Save