diff --git a/ProductionSystem/Forms/HomeFormInfo.cs b/ProductionSystem/Forms/HomeFormInfo.cs index 7d00d7d..8ff5414 100644 --- a/ProductionSystem/Forms/HomeFormInfo.cs +++ b/ProductionSystem/Forms/HomeFormInfo.cs @@ -1575,7 +1575,7 @@ namespace ProductionSystem.Forms string plcTiaoMa=readM248.val.ToString().Replace("\r", "").Replace("\n", ""); string tiaoma = txtProductCode.Text.Replace("\r", "").Replace("\n", ""); //彻底解决页面闪烁的问题 - if (string.IsNullOrEmpty(plcTiaoMa) || tiaoma.Contains("暂无条码") || tiaoma == "" || tiaoma.Contains("暂")) + if (string.IsNullOrEmpty(plcTiaoMa) || tiaoma.Contains("暂无条码") || tiaoma.Contains("暂")) { for (int i = 1; i < 9; i++) { @@ -1635,11 +1635,9 @@ namespace ProductionSystem.Forms if (entity != null) { string productBarCode = GetCode(); - - - + var value = OmronHelper.GetPlcVal(entity.DataType, entity.Address); - if (value.Item2.ToDouble().ToInt()==1) + if (value.Item2.ToDouble().ToInt() == 1) { T_Result2 t = new T_Result2 { @@ -1658,50 +1656,76 @@ namespace ProductionSystem.Forms { t.Electricity = GetPlcValue("D1202"); t.Voltage = GetPlcValue("D1200"); - _result2Service.AddTResult2(t); + if (t.Electricity != "0.000" || t.Voltage != "0.0000") + { + _result2Service.AddTResult2(t); + } + } if (par == "BZ2") { t.Electricity = GetPlcValue("D1206"); t.Voltage = GetPlcValue("D1204"); - _result2Service.AddTResult2(t); + if (t.Electricity != "0.000" || t.Voltage != "0.0000") + { + _result2Service.AddTResult2(t); + } } if (par == "BZ3") { t.Electricity = GetPlcValue("D1210"); t.Voltage = GetPlcValue("D1208"); - _result2Service.AddTResult2(t); + if (t.Electricity != "0.000" || t.Voltage != "0.0000") + { + _result2Service.AddTResult2(t); + } } //高压 if (par == "BZ4") { t.Xll = GetPlcValue("D1224"); t.Xllzt = GetPlcValue("D1226"); - _result2Service.AddTResult2(t); + if (t.Xll != "0.000" || t.Xllzt != "0.0000") + { + _result2Service.AddTResult2(t); + } + } //内1 if (par == "BZ5") { - t.Xll = GetPlcValue("D1212"); - t.Xllzt = GetPlcValue("D1112"); - _result2Service.AddTResult2(t); + + t.Xll = GetPlcValue("D1214"); + t.Xllzt = GetPlcValue("D1114"); + if (t.Xll != "0.000" || t.Xllzt != "0.0000") + { + _result2Service.AddTResult2(t); + } + + } //内2 if (par == "BZ6") { - t.Xll = GetPlcValue("D1214"); - t.Xllzt = GetPlcValue("D1114"); - _result2Service.AddTResult2(t); + t.Xll = GetPlcValue("D1216"); + t.Xllzt = GetPlcValue("D1116"); + if (t.Xll != "0.000" || t.Xllzt != "0.0000") + { + _result2Service.AddTResult2(t); + } } //外漏 if (par == "BZ7") { - t.Xll = GetPlcValue("D1216"); - t.Xllzt = GetPlcValue("D1116"); - _result2Service.AddTResult2(t); + t.Xll = GetPlcValue("D1212"); + t.Xllzt = GetPlcValue("D1112"); + if (t.Xll != "0.000" || t.Xllzt != "0.0000") + { + _result2Service.AddTResult2(t); + } }