From 6378b8faa9184e5981fab12fcaaa6914fcd91b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Sat, 16 Dec 2023 18:34:04 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E8=9E=BA=E6=97=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AutoControl/AutoControl.cs | 37 ++++++++++++++-- .../AutoControl/PlcAutoWriteHelper.cs | 43 +++++++++++++++++++ 2 files changed, 77 insertions(+), 3 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs index 3e1887e..f3de485 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs @@ -360,11 +360,42 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl } } + //设置现场重量 + if(ButtonE.GelSetWeight == runtime.Sender) { - - - + var singE = ControlsHelper.SingleSelect(RadioE); + if (singE == 0) + { + MessageBox.Show("请选择湿混机"); + } + else + { + float t = Convert.ToSingle(TextE.ManualTolerance.MCValue.ToString()); + float w = Convert.ToSingle(TextE.ManualWeight.MCValue.ToString()); + int no = (singE + 1) / 2; + string message = $"确认设置螺旋{no} 现场重量 {w}"; + if (MessageBox.Show($"{message}?", "现场参数确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + if (t < 0.1) + { + MessageBox.Show("公差不能小于0.1!"); + return; + } + + + SetValue value = new SetValue() + { + Value = w, + Toterance = t + }; + + PlcAutoWriteHelper.WetSetWeight(value, RadioE); + } + + } #endregion diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs index 19f7151..c3cdbde 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs @@ -815,6 +815,49 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl } + + + public static bool WetSetWeight(SetValue value, MCRadioButtonEntity RadioE) + { + + + + var singE = ControlsHelper.SingleSelect(RadioE); + + switch (singE) + { + case 1: + case 2: + DB2105WriteHelper.WriteSetValueH1(value); + break; + case 3: + case 4: + + DB2105WriteHelper.WriteSetValueH2(value); + break; + + case 5: + case 6: + DB2105WriteHelper.WriteSetValueH3(value); + + break; + + + case 7: + case 8: + + DB2105WriteHelper.WriteSetValueH4(value); + + break; + + default: + MessageBox.Show("当前未选择产线!"); + return false; + } + + return true; + + } private static void ShowError() { string message = "称量未结束 请稍后"; From 1da3f57a8412c504a105aedf141ca7c820654fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Sat, 16 Dec 2023 18:52:38 +0800 Subject: [PATCH 2/4] =?UTF-8?q?FeededDry=20=E6=97=A5=E5=BF=97=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=94=A8=E6=88=B7=20=E6=98=AF=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E5=90=8C=E4=B8=80=E4=B8=AA=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainDetailControl/MainDetailControlAction.cs | 4 ++-- .../Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index 0062502..19f68d1 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -298,10 +298,10 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl ControlsHelper.SetMCLabel(LabelE.LineKind8, dict[8]); } ReadFlag += 1; - if (ReadFlag >= 10) + if (ReadFlag >= 20) { ReadFlag = 0; - var readName = UserInfo.Instance.RealName; + if (UserJudge.IsNormalUser()) { ReportReadDb.ReadFeededDry(); diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs index 364c5d7..1f12ac5 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs @@ -133,17 +133,17 @@ namespace Mesnac.Action.ChemicalWeighing.Report private static void FeededDry(int deviceno, ReportDosEntity entity) { - + DB2107WriteHelper.CleanSpare(deviceno); int no = deviceno * 2; if (entity.eqNo == 1) { no = no - 1; } var actValue = Convert.ToInt32(entity.actValue); - string logName = $"螺旋{deviceno}向湿混机 [{no}] 投料 {actValue}"; + string logName = $"用户[{UserInfo.Instance.UserName}] 螺旋{deviceno}向湿混机 [{no}] 投料 {actValue}"; LoggingService.Info(logName); LjLogControl.ManualLogControl(logName, actValue, 4, no, 2); - DB2107WriteHelper.CleanSpare(deviceno); + } public static void ReadReport() From 038398e070377d4e9845d814326632ca443fc678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Sun, 17 Dec 2023 09:07:23 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=80=9A=E9=81=93=E9=98=80=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainDetailControlAction.cs | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index 19f68d1..5e57adb 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -842,33 +842,33 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl - PlcReadTemp.DV2PCP01_SetL = DB2102.DV2PCP01.SetLeft; - PlcReadTemp.DV2PCP02_SetL = DB2102.DV2PCP02.SetLeft; - PlcReadTemp.DV2PCP03_SetL = DB2102.DV2PCP03.SetLeft; - PlcReadTemp.DV2PCP04_SetL = DB2102.DV2PCP04.SetLeft; - PlcReadTemp.DV2PCP05_SetL = DB2102.DV2PCP05.SetLeft; - PlcReadTemp.DV2PCP06_SetL = DB2102.DV2PCP06.SetLeft; - PlcReadTemp.DV2PCP07_SetL = DB2102.DV2PCP07.SetLeft; - PlcReadTemp.DV2PCP08_SetL = DB2102.DV2PCP08.SetLeft; - PlcReadTemp.DV2PCP09_SetL = DB2102.DV2PCP09.SetLeft; - PlcReadTemp.DV2PCP10_SetL = DB2102.DV2PCP10.SetLeft; - PlcReadTemp.DV2PCP11_SetL = DB2102.DV2PCP11.SetLeft; - PlcReadTemp.DV2PCP12_SetL = DB2102.DV2PCP12.SetLeft; - PlcReadTemp.DV2PCP13_SetL = DB2102.DV2PCP13.SetLeft; - - PlcReadTemp.DV2PCP01_SetR = DB2102.DV2PCP01.SetRight; - PlcReadTemp.DV2PCP02_SetR = DB2102.DV2PCP02.SetRight; - PlcReadTemp.DV2PCP03_SetR = DB2102.DV2PCP03.SetRight; - PlcReadTemp.DV2PCP04_SetR = DB2102.DV2PCP04.SetRight; - PlcReadTemp.DV2PCP05_SetR = DB2102.DV2PCP05.SetRight; - PlcReadTemp.DV2PCP06_SetR = DB2102.DV2PCP06.SetRight; - PlcReadTemp.DV2PCP07_SetR = DB2102.DV2PCP07.SetRight; - PlcReadTemp.DV2PCP08_SetR = DB2102.DV2PCP08.SetRight; - PlcReadTemp.DV2PCP09_SetR = DB2102.DV2PCP09.SetRight; - PlcReadTemp.DV2PCP10_SetR = DB2102.DV2PCP10.SetRight; - PlcReadTemp.DV2PCP11_SetR = DB2102.DV2PCP11.SetRight; - PlcReadTemp.DV2PCP12_SetR = DB2102.DV2PCP12.SetRight; - PlcReadTemp.DV2PCP13_SetR = DB2102.DV2PCP13.SetRight; + PlcReadTemp.DV2PCP01_SetL = DB2102.DV2PCP01.LeftPosition; + PlcReadTemp.DV2PCP02_SetL = DB2102.DV2PCP02.LeftPosition; + PlcReadTemp.DV2PCP03_SetL = DB2102.DV2PCP03.LeftPosition; + PlcReadTemp.DV2PCP04_SetL = DB2102.DV2PCP04.LeftPosition; + PlcReadTemp.DV2PCP05_SetL = DB2102.DV2PCP05.LeftPosition; + PlcReadTemp.DV2PCP06_SetL = DB2102.DV2PCP06.LeftPosition; + PlcReadTemp.DV2PCP07_SetL = DB2102.DV2PCP07.LeftPosition; + PlcReadTemp.DV2PCP08_SetL = DB2102.DV2PCP08.LeftPosition; + PlcReadTemp.DV2PCP09_SetL = DB2102.DV2PCP09.LeftPosition; + PlcReadTemp.DV2PCP10_SetL = DB2102.DV2PCP10.LeftPosition; + PlcReadTemp.DV2PCP11_SetL = DB2102.DV2PCP11.LeftPosition; + PlcReadTemp.DV2PCP12_SetL = DB2102.DV2PCP12.LeftPosition; + PlcReadTemp.DV2PCP13_SetL = DB2102.DV2PCP13.LeftPosition; + + PlcReadTemp.DV2PCP01_SetR = DB2102.DV2PCP01.RightPosition; + PlcReadTemp.DV2PCP02_SetR = DB2102.DV2PCP02.RightPosition; + PlcReadTemp.DV2PCP03_SetR = DB2102.DV2PCP03.RightPosition; + PlcReadTemp.DV2PCP04_SetR = DB2102.DV2PCP04.RightPosition; + PlcReadTemp.DV2PCP05_SetR = DB2102.DV2PCP05.RightPosition; + PlcReadTemp.DV2PCP06_SetR = DB2102.DV2PCP06.RightPosition; + PlcReadTemp.DV2PCP07_SetR = DB2102.DV2PCP07.RightPosition; + PlcReadTemp.DV2PCP08_SetR = DB2102.DV2PCP08.RightPosition; + PlcReadTemp.DV2PCP09_SetR = DB2102.DV2PCP09.RightPosition; + PlcReadTemp.DV2PCP10_SetR = DB2102.DV2PCP10.RightPosition; + PlcReadTemp.DV2PCP11_SetR = DB2102.DV2PCP11.RightPosition; + PlcReadTemp.DV2PCP12_SetR = DB2102.DV2PCP12.RightPosition; + PlcReadTemp.DV2PCP13_SetR = DB2102.DV2PCP13.RightPosition; PlcReadTemp.DV2PCP01_AlarmL = DB2102.DV2PCP01.AlarmLeftPosition; PlcReadTemp.DV2PCP02_AlarmL = DB2102.DV2PCP02.AlarmLeftPosition; From 13e1c20a05d9dcbae3100f48c4e452b1be607888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Sun, 17 Dec 2023 09:08:45 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=9A=84=E4=B8=8D=E5=AF=B9=20=E4=B8=8D=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E8=8E=B7=E5=8F=96set=20LeftPosition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainDetailControl/MainDetailControlAction.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index 5e57adb..e1080ea 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -842,6 +842,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl + //位置获取的不对 不应该获取set LeftPosition PlcReadTemp.DV2PCP01_SetL = DB2102.DV2PCP01.LeftPosition; PlcReadTemp.DV2PCP02_SetL = DB2102.DV2PCP02.LeftPosition; PlcReadTemp.DV2PCP03_SetL = DB2102.DV2PCP03.LeftPosition;