From 465f35da1315efb3c725285e869cedc79148a937 Mon Sep 17 00:00:00 2001 From: wangsr Date: Tue, 5 Dec 2023 15:42:19 +0800 Subject: [PATCH] =?UTF-8?q?add=20-=20=E6=B7=BB=E5=8A=A0=20=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entity/DeviceDetailEntity.cs | 24 ++ .../MainDetailControlAction.cs | 98 ++++++- .../Data/MCProject/nodeForm/MainDetail.xml | 273 ++++++++++++------ 3 files changed, 290 insertions(+), 105 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/Entity/DeviceDetailEntity.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/Entity/DeviceDetailEntity.cs index 9d7a296..2de2788 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/Entity/DeviceDetailEntity.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/Entity/DeviceDetailEntity.cs @@ -165,6 +165,30 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl.Entity public MCLabel GelStepTime6 { get; set; } public MCLabel GelStepTime7 { get; set; } public MCLabel GelStepTime8 { get; set; } + + public MCLabel DryStepName4 { get; set; } + public MCLabel DryStepName3 { get; set; } + public MCLabel DryStepName2 { get; set; } + public MCLabel DryStepName1 { get; set; } + + public MCLabel WetStepName4 { get; set; } + public MCLabel WetStepName3 { get; set; } + public MCLabel WetStepName2 { get; set; } + public MCLabel WetStepName1 { get; set; } + public MCLabel WetStepName5 { get; set; } + public MCLabel WetStepName6 { get; set; } + public MCLabel WetStepName7 { get; set; } + public MCLabel WetStepName8 { get; set; } + + public MCLabel GelStepName4 { get; set; } + public MCLabel GelStepName3 { get; set; } + public MCLabel GelStepName2 { get; set; } + public MCLabel GelStepName1 { get; set; } + public MCLabel GelStepName5 { get; set; } + public MCLabel GelStepName6 { get; set; } + public MCLabel GelStepName7 { get; set; } + public MCLabel GelStepName8 { get; set; } + } public class SwitchLightEntity diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index c75c01e..645c081 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -377,7 +377,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl private void RGVRecordShow() { - for (int i = 0; i < 6; i++) + for (int i = 0; i < 8; i++) { int deviceNo = i + 1; //判断有没有done = false的设备记录,如果为空就新建一条记录 @@ -418,6 +418,16 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl LedDisplayE.WetWaitDisPlay6.ForeColor = MixTimeBackColor(record); LedDisplayE.RGVWaitDisPlay6.DisplayText = "00:00"; break; + case 7: + LedDisplayE.WetWaitDisPlay7.DisplayText = MixWaitTimeLed(record); + LedDisplayE.WetWaitDisPlay7.ForeColor = MixTimeBackColor(record); + LedDisplayE.RGVWaitDisPlay7.DisplayText = "00:00"; + break; + case 8: + LedDisplayE.WetWaitDisPlay8.DisplayText = MixWaitTimeLed(record); + LedDisplayE.WetWaitDisPlay8.ForeColor = MixTimeBackColor(record); + LedDisplayE.RGVWaitDisPlay8.DisplayText = "00:00"; + break; default: break; } @@ -450,6 +460,14 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl LedDisplayE.RGVWaitDisPlay6.DisplayText = RGVWaitTimeLed(record); LedDisplayE.RGVWaitDisPlay6.ForeColor = RGVTimeBackColor(record); break; + case 7: + LedDisplayE.RGVWaitDisPlay7.DisplayText = RGVWaitTimeLed(record); + LedDisplayE.RGVWaitDisPlay7.ForeColor = RGVTimeBackColor(record); + break; + case 8: + LedDisplayE.RGVWaitDisPlay8.DisplayText = RGVWaitTimeLed(record); + LedDisplayE.RGVWaitDisPlay8.ForeColor = RGVTimeBackColor(record); + break; default: break; } @@ -1531,36 +1549,89 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl SetControlCabinet(ControlCabinetE.PM1KDF01, PlcReadTemp.PM1KDF01_Set); SetControlCabinet(ControlCabinetE.PM1LDF01, PlcReadTemp.PM1LDF01_Set); - SetMCLabel(LabelE.DryMode4, DB2107.Dryer[3].Mode ? "自动" : "手动"); - SetMCLabel(LabelE.DryStatus4, DB2107.Dryer[3].Status ? "开启" : "关闭"); + SetMCLabel(LabelE.DryMode4, DB2107.Dryer[3].Mode ? "自动" : "手动", DB2107.Dryer[3].Mode ? Color.Green : Color.Yellow); + SetMCLabel(LabelE.DryStatus4, DB2107.Dryer[3].Status ? "开启" : "关闭", DB2107.Dryer[3].Status ? Color.Green : Color.Yellow); SetMCLabel(LabelE.DryStepCode4, DB2107.Dryer[3].StepCode); + SetMCLabel(LabelE.DryStepName4, DryStepConvert(DB2107.Dryer[3].StepCode)); SetMCLabel(LabelE.DryTotalTime4, DB2107.Dryer[3].TotalTime); SetMCLabel(LabelE.DryStepTime4, DB2107.Dryer[3].StepTime); - SetMCLabel(LabelE.GelMode7, DB2107.Gelater[6].Mode ? "自动" : "手动"); - SetMCLabel(LabelE.GelStatus7, DB2107.Gelater[6].Status ? "开启" : "关闭"); + SetMCLabel(LabelE.GelMode7, DB2107.Gelater[6].Mode ? "自动" : "手动", DB2107.Gelater[6].Mode ? Color.Green : Color.Yellow); + SetMCLabel(LabelE.GelStatus7, DB2107.Gelater[6].Status ? "开启" : "关闭", DB2107.Gelater[6].Status ? Color.Green : Color.Yellow); SetMCLabel(LabelE.GelStepCode7, DB2107.Gelater[6].StepCode); + SetMCLabel(LabelE.GelStepName7, GelStepConvert(DB2107.Gelater[6].StepCode)); SetMCLabel(LabelE.GelTotalTime7, DB2107.Gelater[6].TotalTime); SetMCLabel(LabelE.GelStepTime7, DB2107.Gelater[6].StepTime); - SetMCLabel(LabelE.GelMode8, DB2107.Gelater[7].Mode ? "自动" : "手动"); - SetMCLabel(LabelE.GelStatus8, DB2107.Gelater[7].Status ? "开启" : "关闭"); + SetMCLabel(LabelE.GelMode8, DB2107.Gelater[7].Mode ? "自动" : "手动", DB2107.Gelater[7].Mode ? Color.Green : Color.Yellow); + SetMCLabel(LabelE.GelStatus8, DB2107.Gelater[7].Status ? "开启" : "关闭", DB2107.Gelater[7].Status ? Color.Green : Color.Yellow); SetMCLabel(LabelE.GelStepCode8, DB2107.Gelater[7].StepCode); + SetMCLabel(LabelE.GelStepName8, GelStepConvert(DB2107.Gelater[7].StepCode)); SetMCLabel(LabelE.GelTotalTime8, DB2107.Gelater[7].TotalTime); SetMCLabel(LabelE.GelStepTime8, DB2107.Gelater[7].StepTime); - SetMCLabel(LabelE.WetMode7, DB2107.Weter[6].Mode ? "自动" : "手动"); - SetMCLabel(LabelE.WetStatus7, DB2107.Weter[6].Status ? "开启" : "关闭"); + SetMCLabel(LabelE.WetMode7, DB2107.Weter[6].Mode ? "自动" : "手动", DB2107.Weter[6].Mode ? Color.Green : Color.Yellow); + SetMCLabel(LabelE.WetStatus7, DB2107.Weter[6].Status ? "开启" : "关闭", DB2107.Weter[6].Status ? Color.Green : Color.Yellow); SetMCLabel(LabelE.WetStepCode7, DB2107.Weter[6].StepCode); + SetMCLabel(LabelE.WetStepName7, WetStepConvert(DB2107.Weter[6].StepCode)); SetMCLabel(LabelE.WetTotalTime7, DB2107.Weter[6].TotalTime); SetMCLabel(LabelE.WetStepTime7, DB2107.Weter[6].StepTime); - SetMCLabel(LabelE.WetMode8, DB2107.Weter[7].Mode ? "自动" : "手动"); - SetMCLabel(LabelE.WetStatus8, DB2107.Weter[7].Status ? "开启" : "关闭"); + SetMCLabel(LabelE.WetMode8, DB2107.Weter[7].Mode ? "自动" : "手动", DB2107.Weter[7].Mode ? Color.Green : Color.Yellow); + SetMCLabel(LabelE.WetStatus8, DB2107.Weter[7].Status ? "开启" : "关闭", DB2107.Weter[7].Status ? Color.Green : Color.Yellow); SetMCLabel(LabelE.WetStepCode8, DB2107.Weter[7].StepCode); + SetMCLabel(LabelE.WetStepName8, WetStepConvert(DB2107.Weter[7].StepCode)); SetMCLabel(LabelE.WetTotalTime8, DB2107.Weter[7].TotalTime); SetMCLabel(LabelE.WetStepTime8, DB2107.Weter[7].StepTime); } + /// + /// 干混机步骤代码转换为步骤名 + /// + private string DryStepConvert(int code) + { + switch(code) + { + case 1: return "加粉料"; + case 4: return "等待"; + case 6: return "排料等待"; + default: return "无"; + } + } + + /// + /// 干混机步骤代码转换为步骤名 + /// + private string WetStepConvert(int code) + { + switch (code) + { + case 1: return "加糊化料"; + case 2: return "加粉料"; + case 3: return "搅拌"; + case 4: return "加热水"; + case 5: return "等待"; + case 6: return "等待确认"; + case 7: return "排料等待"; + default: return "无"; + } + } + + /// + /// 干混机步骤代码转换为步骤名 + /// + private string GelStepConvert(int code) + { + switch (code) + { + case 1: return "调糊化料"; + case 2: return "下干料"; + case 3: return "搅拌"; + case 4: return "等待确认"; + case 5: return "排料等待"; + default: return "无"; + } + } + #endregion #region 图像控件交互 @@ -1706,6 +1777,11 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl { obj.Text = Convert.ToString(set); } + public void SetMCLabel(MCLabel obj, object set, Color color) + { + obj.Text = Convert.ToString(set); + obj.ForeColor = color; + } /// /// 三通 diff --git a/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml b/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml index bfbdcd0..bd1357b 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml @@ -1,9 +1,128 @@ + + + + Red + DarkGray + + + False + + + + None + True + True + 0 + ButtonHighlight + 1767, 783 + GelStepName8 + 11, 12 + + + + + Red + DarkGray + + + False + + + + None + True + True + 0 + ButtonHighlight + 1767, 742 + GelStepName7 + 11, 12 + + + + + Red + DarkGray + + + False + + + + None + True + True + 0 + ButtonHighlight + 1767, 881 + WetStepName8 + 11, 12 + + + + + Red + DarkGray + + + False + + + + None + True + True + 0 + ButtonHighlight + 1767, 840 + WetStepName7 + 11, 12 + + + + + Red + DarkGray + + + False + + + + None + True + True + 0 + ButtonHighlight + 1767, 688 + DryStepName4 + 11, 12 + + + + + Red + DarkGray + + + False + + + + None + True + True + 步骤名称 + ButtonHighlight + 1767, 647 + MCLabel97 + 53, 12 + - - + Red DarkGray @@ -23,8 +142,7 @@ 35, 12 - - + Red DarkGray @@ -39,13 +157,12 @@ True 0 ButtonHighlight - 1859, 783 + 1826, 783 GelStepTime8 11, 12 - - + Red DarkGray @@ -60,13 +177,12 @@ True 0 ButtonHighlight - 1810, 783 + 1861, 783 GelTotalTime8 11, 12 - - + Red DarkGray @@ -81,13 +197,12 @@ True 0 ButtonHighlight - 1761, 783 + 1732, 783 GelStepCode8 11, 12 - - + Red DarkGray @@ -102,13 +217,12 @@ True 0 ButtonHighlight - 1711, 783 + 1697, 783 GelStatus8 11, 12 - - + Red DarkGray @@ -128,8 +242,7 @@ 11, 12 - - + Red DarkGray @@ -149,8 +262,7 @@ 35, 12 - - + Red DarkGray @@ -165,13 +277,12 @@ True 0 ButtonHighlight - 1859, 742 + 1826, 742 GelStepTime7 11, 12 - - + Red DarkGray @@ -186,13 +297,12 @@ True 0 ButtonHighlight - 1810, 742 + 1861, 742 GelTotalTime7 11, 12 - - + Red DarkGray @@ -207,13 +317,12 @@ True 0 ButtonHighlight - 1761, 742 + 1732, 742 GelStepCode7 11, 12 - - + Red DarkGray @@ -228,13 +337,12 @@ True 0 ButtonHighlight - 1711, 742 + 1697, 742 GelStatus7 11, 12 - - + Red DarkGray @@ -254,8 +362,7 @@ 11, 12 - - + Red DarkGray @@ -275,8 +382,7 @@ 35, 12 - - + Red DarkGray @@ -291,13 +397,12 @@ True 0 ButtonHighlight - 1859, 881 + 1826, 881 WetStepTime8 11, 12 - - + Red DarkGray @@ -312,13 +417,12 @@ True 0 ButtonHighlight - 1810, 881 + 1861, 881 WetTotalTime8 11, 12 - - + Red DarkGray @@ -333,13 +437,12 @@ True 0 ButtonHighlight - 1761, 881 + 1732, 881 WetStepCode8 11, 12 - - + Red DarkGray @@ -354,13 +457,12 @@ True 0 ButtonHighlight - 1711, 881 + 1697, 881 WetStatus8 11, 12 - - + Red DarkGray @@ -380,8 +482,7 @@ 11, 12 - - + Red DarkGray @@ -401,8 +502,7 @@ 35, 12 - - + Red DarkGray @@ -417,13 +517,12 @@ True 0 ButtonHighlight - 1859, 840 + 1826, 840 WetStepTime7 11, 12 - - + Red DarkGray @@ -438,13 +537,12 @@ True 0 ButtonHighlight - 1810, 840 + 1861, 840 WetTotalTime7 11, 12 - - + Red DarkGray @@ -459,13 +557,12 @@ True 0 ButtonHighlight - 1761, 840 + 1732, 840 WetStepCode7 11, 12 - - + Red DarkGray @@ -480,13 +577,12 @@ True 0 ButtonHighlight - 1711, 840 + 1697, 840 WetStatus7 11, 12 - - + Red DarkGray @@ -506,8 +602,7 @@ 11, 12 - - + Red DarkGray @@ -527,8 +622,7 @@ 35, 12 - - + Red DarkGray @@ -543,13 +637,12 @@ True 0 ButtonHighlight - 1859, 688 + 1826, 688 DryStepTime4 11, 12 - - + Red DarkGray @@ -564,13 +657,12 @@ True 0 ButtonHighlight - 1810, 688 + 1861, 688 DryTotalTime4 11, 12 - - + Red DarkGray @@ -585,13 +677,12 @@ True 0 ButtonHighlight - 1761, 688 + 1732, 688 DryStepCode4 11, 12 - - + Red DarkGray @@ -606,13 +697,12 @@ True 0 ButtonHighlight - 1711, 688 + 1697, 688 DryStatus4 11, 12 - - + Red DarkGray @@ -632,8 +722,7 @@ 11, 12 - - + Red DarkGray @@ -648,13 +737,12 @@ True 步时 ButtonHighlight - 1859, 647 + 1826, 647 MCLabel128 29, 12 - - + Red DarkGray @@ -669,13 +757,12 @@ True 总时 ButtonHighlight - 1810, 647 + 1861, 647 MCLabel130 29, 12 - - + Red DarkGray @@ -690,13 +777,12 @@ True 步序 ButtonHighlight - 1761, 647 + 1732, 647 MCLabel129 29, 12 - - + Red DarkGray @@ -711,13 +797,12 @@ True 状态 ButtonHighlight - 1711, 647 + 1697, 647 MCLabel131 29, 12 - - + Red DarkGray