From 44119234a7ddd973eaa8d5eb685f670ff61ba7eb Mon Sep 17 00:00:00 2001 From: wangsr Date: Mon, 25 Dec 2023 15:06:11 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E7=94=B5=E6=9C=BA=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E6=8E=A7=E5=88=B6=E5=88=A0=E9=99=A4=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=20=E5=90=88=E5=B9=B6=E7=A3=A8=E7=B2=89?= =?UTF-8?q?=E7=94=B5=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ControlBoardButtonAction.cs | 54 +----------- .../Entity/ControlBoardEntity.cs | 4 +- .../LjDeliverControlBoard/InitAction.cs | 84 +++++++++---------- .../nodeForm/DeliverControlBoard.xml | 76 ++--------------- 4 files changed, 50 insertions(+), 168 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverControlBoard/ControlBoardButtonAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverControlBoard/ControlBoardButtonAction.cs index 63d77dd..4773892 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverControlBoard/ControlBoardButtonAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverControlBoard/ControlBoardButtonAction.cs @@ -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() diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverControlBoard/Entity/ControlBoardEntity.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverControlBoard/Entity/ControlBoardEntity.cs index 857422b..d9e16d0 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverControlBoard/Entity/ControlBoardEntity.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverControlBoard/Entity/ControlBoardEntity.cs @@ -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; } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverControlBoard/InitAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverControlBoard/InitAction.cs index 91b8acf..3ff4bf1 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverControlBoard/InitAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverControlBoard/InitAction.cs @@ -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)) { diff --git a/Main/MCEdit/Data/MCProject/nodeForm/DeliverControlBoard.xml b/Main/MCEdit/Data/MCProject/nodeForm/DeliverControlBoard.xml index 4b378d8..9ab25b8 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/DeliverControlBoard.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/DeliverControlBoard.xml @@ -17,7 +17,7 @@ True 未设置 宋体, 12pt - 212, 238 + 212, 187 NowManual 56, 16 @@ -37,30 +37,10 @@ True 当前状态: 宋体, 12pt - 134, 238 + 134, 187 MCLabel77 88, 16 - - - - Red - DarkGray - - - False - - - - None - True - True - 未设置 - 宋体, 12pt - 212, 186 - NowAuto - 56, 16 - AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAAEAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIDZCOEFDN0I0QjQ2QzQxMjZBMjk1RjVCQzJCQkIyQzAyBgYAAAAM5oyJ6ZKu5LqL5Lu2BgcAAAAM5oyJ6ZKu5LqL5Lu2Cw== @@ -82,57 +62,11 @@ MiddleRight 手动模式开关 宋体, 12pt - 6, 223 + 6, 172 ManualModeOnOff 122, 46 128 - - - AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAAGAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIDZCOEFDN0I0QjQ2QzQxMjZBMjk1RjVCQzJCQkIyQzAyBgYAAAAM5oyJ6ZKu5LqL5Lu2BgcAAAAM5oyJ6ZKu5LqL5Lu2Cw== - - - - False - - - - None - True - True - False - - - Red - DarkGray - MiddleRight - 自动模式开关 - 宋体, 12pt - 6, 171 - AutoModeOnOff - 122, 46 - 127 - - - - - Red - DarkGray - - - False - - - - None - True - True - 当前状态: - 宋体, 12pt - 134, 186 - MCLabel79 - 88, 16 - @@ -200,7 +134,7 @@ 124 - True + False AAEAAAD/////AQAAAAAAAAAMAgAAAE5NZXNuYWMuQ29udHJvbHMuRGVmYXVsdCwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuRGVmYXVsdC5Db21ib2JveEl0ZW1zLCBNZXNuYWMuQ29udHJvbHMuRGVmYXVsdCwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAJ01lc25hYy5Db250cm9scy5EZWZhdWx0LkNvbWJvYm94SXRlbXNbXQIAAAAICAkDAAAAAAAAAAAAAAAHAwAAAAABAAAAAAAAAAQlTWVzbmFjLkNvbnRyb2xzLkRlZmF1bHQuQ29tYm9ib3hJdGVtcwIAAAAL @@ -256,7 +190,7 @@ 电机手动控制 1403, 13 GroupBox13 - 285, 275 + 285, 224 115