diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index 30991ca..3fd6bdd 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -106,6 +106,10 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl // DeviceDetailEntity DetailE = new DeviceDetailEntity(); HslLedDisplayEntity LedDisplayE = new HslLedDisplayEntity(); + + MCLabel mCLabelA; + + MCLabel mCLabelB; #endregion #region Run方法 @@ -127,6 +131,9 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl // MCWatchDog = Controls.FirstOrDefault(x => x.Name == "MCWatchDog") as MCLabel; AlarmMoveText = Controls.FirstOrDefault(x => x.Name == "AlarmMoveText") as HslMoveText; + mCLabelA = Controls.FirstOrDefault(x => x.Name == "MCLabelA") as MCLabel; + + mCLabelB = Controls.FirstOrDefault(x => x.Name == "MCLabelB") as MCLabel; SetAllControls(); //ParametersWithPCTable.Columns.Add("id", typeof(string)); @@ -456,7 +463,11 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl AlarmControl(); //现有报警刷新 + var db2110 = new Db2110Help(); + + mCLabelA.MCValue = db2110.GetA(); + mCLabelB.MCValue = db2110.GetB(); } #endregion diff --git a/DataBlockHelper/DBHelpers/Db2110Help.cs b/DataBlockHelper/DBHelpers/Db2110Help.cs index f22f141..69c624c 100644 --- a/DataBlockHelper/DBHelpers/Db2110Help.cs +++ b/DataBlockHelper/DBHelpers/Db2110Help.cs @@ -39,6 +39,12 @@ namespace DataBlockHelper.DBHelpers list.Add(GetAvalue(queA2)); list.Add(GetAvalue(queA3)); list.Add(GetAvalue(queA4)); + + if (list.Count == list.Where(x => x == "0").Count()) + { + return ""; + } + StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < list.Count; i++) @@ -71,7 +77,11 @@ namespace DataBlockHelper.DBHelpers list.Add(GetAvalue(queB6)); list.Add(GetAvalue(queB7)); list.Add(GetAvalue(queB8)); - + + if (list.Count == list.Where(x => x == "0").Count()) + { + return ""; + } StringBuilder stringBuilder = new StringBuilder(); @@ -80,7 +90,7 @@ namespace DataBlockHelper.DBHelpers string a = list[i]; if (i > 0) { - stringBuilder.Append("=>" + a); + stringBuilder.Append("=> " + a); } else { diff --git a/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml b/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml index 74be0e4..6236513 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml @@ -1,6 +1,91 @@ + + + + Red + DarkGray + + + False + + + + None + True + True + A=>B + Transparent + White + 266, 419 + MCLabelB + 29, 12 + + + + + Red + DarkGray + + + False + + + + None + True + True + A=>B + Transparent + White + 48, 419 + MCLabelA + 29, 12 + + + + TurnOn + 1193, 268 + PControl23 + 10, 15 + + + + + + + False + + + + None + True + True + MiddleCenter + MintCream + 881, 57 + SpecialLabelBlue228 + 1, 227 + + + + + + + False + + + + None + True + True + MiddleCenter + MintCream + 854, 54 + SpecialLabelBlue229 + 335, 1 + 1844, 288 DayBin8 @@ -98,9 +183,9 @@ True MiddleCenter MintCream - 1187, 33 + 1187, 55 SpecialLabelBlue231 - 1, 252 + 1, 229 @@ -116,9 +201,9 @@ True MiddleCenter MintCream - 878, 32 + 852, 33 SpecialLabelBlue232 - 1, 252 + 1, 22 @@ -172,7 +257,7 @@ - 1177, 24 + 872, 49 DV2PCP16 22, 12 @@ -181,7 +266,7 @@ - 868, 24 + 842, 24 DV2PCP15 22, 12