diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index f69ae27..b855d81 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -122,6 +122,16 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl HslLanternSimple HslLanternSimple3316; Color color; + + HslLanternSimple Fish1; + HslLanternSimple Fish2; + HslLanternSimple Fish3; + HslLanternSimple Fish4; + HslLanternSimple Fish5; + HslLanternSimple Fish6; + HslLanternSimple Fish7; + HslLanternSimple Fish8; + #endregion #region Run方法 @@ -137,7 +147,16 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl Controls = GetAllControls(); - MCLabel3312= Controls.FirstOrDefault(x => x.Name == "MCLabel3312") as MCLabel; + Fish1 = Controls.FirstOrDefault(x => x.Name == "Fish1") as HslLanternSimple; + Fish2 = Controls.FirstOrDefault(x => x.Name == "Fish2") as HslLanternSimple; + Fish3 = Controls.FirstOrDefault(x => x.Name == "Fish3") as HslLanternSimple; + Fish4 = Controls.FirstOrDefault(x => x.Name == "Fish4") as HslLanternSimple; + Fish5 = Controls.FirstOrDefault(x => x.Name == "Fish5") as HslLanternSimple; + Fish6 = Controls.FirstOrDefault(x => x.Name == "Fish6") as HslLanternSimple; + Fish7 = Controls.FirstOrDefault(x => x.Name == "Fish7") as HslLanternSimple; + Fish8 = Controls.FirstOrDefault(x => x.Name == "Fish8") as HslLanternSimple; + + MCLabel3312 = Controls.FirstOrDefault(x => x.Name == "MCLabel3312") as MCLabel; MCLabel3316 = Controls.FirstOrDefault(x => x.Name == "MCLabel3316") as MCLabel; @@ -270,13 +289,13 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl DB2102 = new DB2102Helper(); DB2103 = new DB2103Helper(); DB2107 = new DB2107Helper(); - DB2119 = new DB2119Helper(); + dB2108 = new DB2108HelperNew(); NewThreadDb2102(); NewThreadDb2103(); NewThreadDb2107(); - NewThreadDB2108(); + RGVRecordShow(); //SetHslLanternAlarm(hslAlarmEntity.HslLanternAlarm3, list[2].Error); @@ -578,8 +597,11 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl mCLabelA.MCValue = db2110.GetA(); mCLabelB.MCValue = db2110.GetB(); + NewThreadDB2119(); } + + #endregion #region 对接RGV计时记录 @@ -942,6 +964,10 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl b3 = DB2103.bytes; b7 = DB2107.bytes; + var b2119 = new DB2119Helper(); + + var b9 = b2119.bytes; + List list = new List(); StringBuilder sb = new StringBuilder(); @@ -1011,6 +1037,23 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl } + if ((int)rows["Alarm_Block"] == 2119 && b9[(int)rows["Alarm_Word"]].GetBit((int)rows["Alarm_bit"]) == true) + { + sb.Append(rows["Alarm_Other_Info"].ToString()); + sb.Append(" "); + sb.Append(rows["Alarm_Cn_Info"].ToString()); + sb.Append(@" \ "); + + warnTable.Status = 1; + + } + else + { + warnTable.Status = 0; + + } + + list.Add(warnTable); } @@ -1057,8 +1100,17 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl #region 图像数据读取、控件赋值 - private void NewThreadDB2108() + private void NewThreadDB2119() { + DB2119 = new DB2119Helper(); + ControlsHelper.SetHsl(Fish1, DB2119.Finish1); + ControlsHelper.SetHsl(Fish2, DB2119.Finish2); + ControlsHelper.SetHsl(Fish3, DB2119.Finish3); + ControlsHelper.SetHsl(Fish4, DB2119.Finish4); + ControlsHelper.SetHsl(Fish5, DB2119.Finish5); + ControlsHelper.SetHsl(Fish6, DB2119.Finish6); + ControlsHelper.SetHsl(Fish7, DB2119.Finish7); + ControlsHelper.SetHsl(Fish8, DB2119.Finish8); } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/InitAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/InitAction.cs index 0e642ff..ac8e4e3 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/InitAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/InitAction.cs @@ -487,101 +487,101 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl #region 称量结束日志 - if (DB2119.Coolwater_A.Dos_End) - { - if (PlcControl("DB2119.28.3", false)) - { - LjLogControl.ManualLogControl("冷水称A称量结束", DB2119.Coolwater_A.Value_Initial, 2, 3, 1); - LogSelect(""); - } - } - if (DB2119.Hotwater_A.Dos_End) - { - if (PlcControl("DB2119.8.3", false)) - { - LjLogControl.ManualLogControl("热水称A称量结束", DB2119.Hotwater_A.Value_Initial, 2, 1, 1); - LogSelect(""); - } - } - if (DB2119.Coolwater_B.Dos_End) - { - if (PlcControl("DB2119.38.3", false)) - { - LjLogControl.ManualLogControl("冷水称B称量结束", DB2119.Coolwater_B.Value_Initial, 2, 4, 1); - LogSelect(""); - } - } - if (DB2119.Hotwater_B.Dos_End) - { - if (PlcControl("DB2119.18.3", false)) - { - LjLogControl.ManualLogControl("热水称B称量结束", DB2119.Hotwater_B.Value_Initial, 2, 2, 1); - LogSelect(""); - } - } - if (DB2119.Spiral_A.Dos_End) - { - if (PlcControl("DB2119.60.3", false)) - { - if (DB2119.Spiral_A.Weter_Bin == 1) - { - LjLogControl.ManualLogControl("湿混机1称量结束", DB2119.Spiral_A.Value_Weight, 4, 1, 2); - LogSelect(""); - } - else if (DB2119.Spiral_A.Weter_Bin == 2) - { - LjLogControl.ManualLogControl("湿混机2称量结束", DB2119.Spiral_A.Value_Weight, 4, 2, 2); - LogSelect(""); - } - else - { - LjLogControl.ManualLogControl("螺旋1称量结束", DB2119.Spiral_A.Value_Weight, 4, 12, 2); - LogSelect(""); - } - } - } - if (DB2119.Spiral_B.Dos_End) - { - if (PlcControl("DB2119.82.3", false)) - { - if (DB2119.Spiral_B.Weter_Bin == 1) - { - LjLogControl.ManualLogControl("湿混机3称量结束", DB2119.Spiral_B.Value_Weight, 4, 3, 2); - LogSelect(""); - } - else if (DB2119.Spiral_B.Weter_Bin == 2) - { - LjLogControl.ManualLogControl("湿混机4称量结束", DB2119.Spiral_B.Value_Weight, 4, 4, 2); - LogSelect(""); - } - else - { - LjLogControl.ManualLogControl("螺旋2称量结束", DB2119.Spiral_B.Value_Weight, 4, 34, 2); - LogSelect(""); - } - } - } - if (DB2119.Spiral_C.Dos_End) - { - if (PlcControl("DB2119.104.3", false)) - { - if (DB2119.Spiral_C.Weter_Bin == 1) - { - LjLogControl.ManualLogControl("湿混机5称量结束", DB2119.Spiral_C.Value_Weight, 4, 5, 2); - LogSelect(""); - } - else if (DB2119.Spiral_C.Weter_Bin == 2) - { - LjLogControl.ManualLogControl("湿混机6称量结束", DB2119.Spiral_C.Value_Weight, 4, 6, 2); - LogSelect(""); - } - else - { - LjLogControl.ManualLogControl("螺旋1称量结束", DB2119.Spiral_C.Value_Weight, 4, 56, 2); - LogSelect(""); - } - } - } + //if (DB2119.Coolwater_A.Dos_End) + //{ + // if (PlcControl("DB2119.28.3", false)) + // { + // LjLogControl.ManualLogControl("冷水称A称量结束", DB2119.Coolwater_A.Value_Initial, 2, 3, 1); + // LogSelect(""); + // } + //} + //if (DB2119.Hotwater_A.Dos_End) + //{ + // if (PlcControl("DB2119.8.3", false)) + // { + // LjLogControl.ManualLogControl("热水称A称量结束", DB2119.Hotwater_A.Value_Initial, 2, 1, 1); + // LogSelect(""); + // } + //} + //if (DB2119.Coolwater_B.Dos_End) + //{ + // if (PlcControl("DB2119.38.3", false)) + // { + // LjLogControl.ManualLogControl("冷水称B称量结束", DB2119.Coolwater_B.Value_Initial, 2, 4, 1); + // LogSelect(""); + // } + //} + //if (DB2119.Hotwater_B.Dos_End) + //{ + // if (PlcControl("DB2119.18.3", false)) + // { + // LjLogControl.ManualLogControl("热水称B称量结束", DB2119.Hotwater_B.Value_Initial, 2, 2, 1); + // LogSelect(""); + // } + //} + //if (DB2119.Spiral_A.Dos_End) + //{ + // if (PlcControl("DB2119.60.3", false)) + // { + // if (DB2119.Spiral_A.Weter_Bin == 1) + // { + // LjLogControl.ManualLogControl("湿混机1称量结束", DB2119.Spiral_A.Value_Weight, 4, 1, 2); + // LogSelect(""); + // } + // else if (DB2119.Spiral_A.Weter_Bin == 2) + // { + // LjLogControl.ManualLogControl("湿混机2称量结束", DB2119.Spiral_A.Value_Weight, 4, 2, 2); + // LogSelect(""); + // } + // else + // { + // LjLogControl.ManualLogControl("螺旋1称量结束", DB2119.Spiral_A.Value_Weight, 4, 12, 2); + // LogSelect(""); + // } + // } + //} + //if (DB2119.Spiral_B.Dos_End) + //{ + // if (PlcControl("DB2119.82.3", false)) + // { + // if (DB2119.Spiral_B.Weter_Bin == 1) + // { + // LjLogControl.ManualLogControl("湿混机3称量结束", DB2119.Spiral_B.Value_Weight, 4, 3, 2); + // LogSelect(""); + // } + // else if (DB2119.Spiral_B.Weter_Bin == 2) + // { + // LjLogControl.ManualLogControl("湿混机4称量结束", DB2119.Spiral_B.Value_Weight, 4, 4, 2); + // LogSelect(""); + // } + // else + // { + // LjLogControl.ManualLogControl("螺旋2称量结束", DB2119.Spiral_B.Value_Weight, 4, 34, 2); + // LogSelect(""); + // } + // } + //} + //if (DB2119.Spiral_C.Dos_End) + //{ + // if (PlcControl("DB2119.104.3", false)) + // { + // if (DB2119.Spiral_C.Weter_Bin == 1) + // { + // LjLogControl.ManualLogControl("湿混机5称量结束", DB2119.Spiral_C.Value_Weight, 4, 5, 2); + // LogSelect(""); + // } + // else if (DB2119.Spiral_C.Weter_Bin == 2) + // { + // LjLogControl.ManualLogControl("湿混机6称量结束", DB2119.Spiral_C.Value_Weight, 4, 6, 2); + // LogSelect(""); + // } + // else + // { + // LjLogControl.ManualLogControl("螺旋1称量结束", DB2119.Spiral_C.Value_Weight, 4, 56, 2); + // LogSelect(""); + // } + // } + //} #endregion @@ -595,13 +595,13 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl WaterActualValue4.MCValue = DB2107.Weight.WScale_2.ActWeight; - WaterMetValue1.MCValue = DB2119.Coolwater_A.Value_Initial; + //WaterMetValue1.MCValue = DB2119.Coolwater_A.Value_Initial; - WaterMetValue2.MCValue = DB2119.Hotwater_A.Value_Initial; + //WaterMetValue2.MCValue = DB2119.Hotwater_A.Value_Initial; - WaterMetValue3.MCValue = DB2119.Coolwater_B.Value_Initial; + //WaterMetValue3.MCValue = DB2119.Coolwater_B.Value_Initial; - WaterMetValue4.MCValue = DB2119.Hotwater_B.Value_Initial; + //WaterMetValue4.MCValue = DB2119.Hotwater_B.Value_Initial; SpiralActValue1.MCValue = DB2103.DM2ASF01.ACT_Speed; @@ -611,118 +611,118 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl SpiralActValue4.MCValue = DB2103.DM2DSF01.ACT_Speed; - SpiralMetValue1.MCValue = DB2119.Spiral_A.Value_Weight; + //SpiralMetValue1.MCValue = DB2119.Spiral_A.Value_Weight; - SpiralMetValue2.MCValue = DB2119.Spiral_B.Value_Weight; + //SpiralMetValue2.MCValue = DB2119.Spiral_B.Value_Weight; - SpiralMetValue3.MCValue = DB2119.Spiral_C.Value_Weight; + //SpiralMetValue3.MCValue = DB2119.Spiral_C.Value_Weight; #endregion #region 水称状态指示 - if (DB2119.Coolwater_A.Dos_Status) - { - MetageState1.MCValue = "正在称量"; - } - else - { - MetageState1.MCValue = "停止称量"; - } + //if (DB2119.Coolwater_A.Dos_Status) + //{ + // MetageState1.MCValue = "正在称量"; + //} + //else + //{ + // MetageState1.MCValue = "停止称量"; + //} - if (DB2119.Coolwater_A.Dis_Status) - { - WaterOutState1.MCValue = "正在排水"; - } - else - { - WaterOutState1.MCValue = "停止排水"; - } + //if (DB2119.Coolwater_A.Dis_Status) + //{ + // WaterOutState1.MCValue = "正在排水"; + //} + //else + //{ + // WaterOutState1.MCValue = "停止排水"; + //} - if (DB2119.Hotwater_A.Dos_Status) - { - MetageState2.MCValue = "正在称量"; - } - else - { - MetageState2.MCValue = "停止称量"; - } + //if (DB2119.Hotwater_A.Dos_Status) + //{ + // MetageState2.MCValue = "正在称量"; + //} + //else + //{ + // MetageState2.MCValue = "停止称量"; + //} - if (DB2119.Hotwater_A.Dis_Status) - { - WaterOutState2.MCValue = "正在排水"; - } - else - { - WaterOutState2.MCValue = "停止排水"; - } + //if (DB2119.Hotwater_A.Dis_Status) + //{ + // WaterOutState2.MCValue = "正在排水"; + //} + //else + //{ + // WaterOutState2.MCValue = "停止排水"; + //} - if (DB2119.Coolwater_B.Dos_Status) - { - MetageState3.MCValue = "正在称量"; - } - else - { - MetageState3.MCValue = "停止称量"; - } + //if (DB2119.Coolwater_B.Dos_Status) + //{ + // MetageState3.MCValue = "正在称量"; + //} + //else + //{ + // MetageState3.MCValue = "停止称量"; + //} - if (DB2119.Coolwater_B.Dis_Status) - { - WaterOutState3.MCValue = "正在排水"; - } - else - { - WaterOutState3.MCValue = "停止排水"; - } + //if (DB2119.Coolwater_B.Dis_Status) + //{ + // WaterOutState3.MCValue = "正在排水"; + //} + //else + //{ + // WaterOutState3.MCValue = "停止排水"; + //} - if (DB2119.Hotwater_B.Dos_Status) - { - MetageState4.MCValue = "正在称量"; - } - else - { - MetageState4.MCValue = "停止称量"; - } + //if (DB2119.Hotwater_B.Dos_Status) + //{ + // MetageState4.MCValue = "正在称量"; + //} + //else + //{ + // MetageState4.MCValue = "停止称量"; + //} - if (DB2119.Hotwater_B.Dis_Status) - { - WaterOutState4.MCValue = "正在排水"; - } - else - { - WaterOutState4.MCValue = "停止排水"; - } + //if (DB2119.Hotwater_B.Dis_Status) + //{ + // WaterOutState4.MCValue = "正在排水"; + //} + //else + //{ + // WaterOutState4.MCValue = "停止排水"; + //} #endregion #region 螺旋状态指示 - if (DB2119.Spiral_A.Dos_Status) - { - SpiralState1.MCValue = "正在螺旋"; - } - else - { - SpiralState1.MCValue = "停止螺旋"; - } + //if (DB2119.Spiral_A.Dos_Status) + //{ + // SpiralState1.MCValue = "正在螺旋"; + //} + //else + //{ + // SpiralState1.MCValue = "停止螺旋"; + //} - if (DB2119.Spiral_B.Dos_Status) - { - SpiralState2.MCValue = "正在螺旋"; - } - else - { - SpiralState2.MCValue = "停止螺旋"; - } + //if (DB2119.Spiral_B.Dos_Status) + //{ + // SpiralState2.MCValue = "正在螺旋"; + //} + //else + //{ + // SpiralState2.MCValue = "停止螺旋"; + //} - if (DB2119.Spiral_C.Dos_Status) - { - SpiralState3.MCValue = "正在螺旋"; - } - else - { - SpiralState3.MCValue = "停止螺旋"; - } + //if (DB2119.Spiral_C.Dos_Status) + //{ + // SpiralState3.MCValue = "正在螺旋"; + //} + //else + //{ + // SpiralState3.MCValue = "停止螺旋"; + //} //Read = PlcConnect.Instance.Read("DB2119..0", 1); diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ManualControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ManualControlAction.cs index 625ef16..115b813 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ManualControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ManualControlAction.cs @@ -368,11 +368,11 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl if (StartMetage1 == runtime.Sender) { - if (DB2119.Coolwater_A.Dos_Status) - { - MessageBox.Show("冷水称A正在排水!请稍后再称量"); - return; - } + //if (DB2119.Coolwater_A.Dos_Status) + //{ + // MessageBox.Show("冷水称A正在排水!请稍后再称量"); + // return; + //} short value; if (short.TryParse(Convert.ToString(SetWaterValue1.MCValue), out value)) { @@ -405,11 +405,11 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl if (StartMetage2 == runtime.Sender) { - if (DB2119.Hotwater_A.Dos_Status) - { - MessageBox.Show("热水称A正在排水!请稍后再称量"); - return; - } + //if (DB2119.Hotwater_A.Dos_Status) + //{ + // MessageBox.Show("热水称A正在排水!请稍后再称量"); + // return; + //} short value; if (short.TryParse(Convert.ToString(SetWaterValue2.MCValue), out value)) { @@ -443,11 +443,11 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl if (StartMetage3 == runtime.Sender) { - if (DB2119.Coolwater_B.Dos_Status) - { - MessageBox.Show("冷水称B正在排水!请稍后再称量"); - return; - } + //if (DB2119.Coolwater_B.Dos_Status) + //{ + // MessageBox.Show("冷水称B正在排水!请稍后再称量"); + // return; + //} short value; if (short.TryParse(Convert.ToString(SetWaterValue3.MCValue), out value)) { @@ -480,30 +480,30 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl if (StartMetage4 == runtime.Sender) { - if (DB2119.Hotwater_B.Dos_Status) - { - MessageBox.Show("热水称B正在排水!请稍后再称量"); - return; - } - short value; - if (short.TryParse(Convert.ToString(SetWaterValue4.MCValue), out value)) - { - if (MessageBox.Show("热水称B确认开始称量?", "称量确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) - { - return; - } - MesnacServiceManager.Instance.LoggingService.Info("热水称B开始称量" + value); - LjLogControl.ManualLogControl("热水称B开始称量", value, 1, 2, 1); - PlcControl("DB2119.10.0", value); - PlcControl("DB2119.18.0", true); - LogSelect(""); - } - else - { - MesnacServiceManager.Instance.LoggingService.Info("热水称B输入数值的格式有误"); - MessageBox.Show("输入数值的格式有误!"); - return; - } + // if (DB2119.Hotwater_B.Dos_Status) + // { + // MessageBox.Show("热水称B正在排水!请稍后再称量"); + // return; + // } + // short value; + // if (short.TryParse(Convert.ToString(SetWaterValue4.MCValue), out value)) + // { + // if (MessageBox.Show("热水称B确认开始称量?", "称量确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + // { + // return; + // } + // MesnacServiceManager.Instance.LoggingService.Info("热水称B开始称量" + value); + // LjLogControl.ManualLogControl("热水称B开始称量", value, 1, 2, 1); + // PlcControl("DB2119.10.0", value); + // PlcControl("DB2119.18.0", true); + // LogSelect(""); + // } + // else + // { + // MesnacServiceManager.Instance.LoggingService.Info("热水称B输入数值的格式有误"); + // MessageBox.Show("输入数值的格式有误!"); + // return; + // } } if (StopMetage4 == runtime.Sender) @@ -522,11 +522,11 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl if (WaterOut1 == runtime.Sender) { - if (DB2119.Coolwater_A.Dis_Status) - { - MessageBox.Show("冷水称A正在排水 请稍后"); - return; - } + //if (DB2119.Coolwater_A.Dis_Status) + //{ + // MessageBox.Show("冷水称A正在排水 请稍后"); + // return; + //} if (MessageBox.Show("冷水称A确认开始排水?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { @@ -604,16 +604,16 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl if (WaterOut2 == runtime.Sender) { - if (DB2119.Hotwater_A.Dis_Status) - { - MessageBox.Show("热水称A正在排水 请稍后"); - return; - } + //if (DB2119.Hotwater_A.Dis_Status) + //{ + // MessageBox.Show("热水称A正在排水 请稍后"); + // return; + //} - if (MessageBox.Show("热水称A确认开始排水?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) - { - return; - } + //if (MessageBox.Show("热水称A确认开始排水?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + //{ + // return; + //} switch (GelChooseA) { @@ -685,11 +685,11 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl if (WaterOut3 == runtime.Sender) { - if (DB2119.Coolwater_B.Dis_Status) - { - MessageBox.Show("冷水称B正在排水 请稍后"); - return; - } + //if (DB2119.Coolwater_B.Dis_Status) + //{ + // MessageBox.Show("冷水称B正在排水 请稍后"); + // return; + //} if (MessageBox.Show("冷水称B确认开始排水?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) @@ -768,16 +768,16 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl if (WaterOut4 == runtime.Sender) { - if (DB2119.Hotwater_B.Dis_Status) - { - MessageBox.Show("热水称B正在排水 请稍后"); - return; - } + //if (DB2119.Hotwater_B.Dis_Status) + //{ + // MessageBox.Show("热水称B正在排水 请稍后"); + // return; + //} - if (MessageBox.Show("热水称B确认开始排水?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) - { - return; - } + //if (MessageBox.Show("热水称B确认开始排水?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + //{ + // return; + //} switch (GelChooseB) { diff --git a/DataBlockHelper/DBHelpers/DB2119Helper.cs b/DataBlockHelper/DBHelpers/DB2119Helper.cs index 310200a..e09e552 100644 --- a/DataBlockHelper/DBHelpers/DB2119Helper.cs +++ b/DataBlockHelper/DBHelpers/DB2119Helper.cs @@ -12,19 +12,64 @@ namespace DataBlockHelper.DBHelpers { public DB2119Helper() { - bytes = PlcConnect.Instance.Read("DB2119.0.0", 138).Content; + bytes = PlcConnect.Instance.Read("DB2119.0.0", 12).Content; + + var a=bytes.First(); + VesselA = a.GetBit(0); + VesselB = a.GetBit(1); + VesselC = a.GetBit(2); + VesselD = a.GetBit(3); + VesselE = a.GetBit(4); + PD3 = PlcConnect.Instance.ByteTransform.TransSingle(bytes, 2); + PD3 = PlcConnect.Instance.ByteTransform.TransSingle(bytes, 6); + + a= bytes.Skip(10).Take(1).First(); + PD3Alarm=a.GetBit(0); + HR3Alarm=a.GetBit(1); + Finish1 = a.GetBit(2); + Finish2 = a.GetBit(3); + Finish3 = a.GetBit(4); + Finish4 = a.GetBit(5); + Finish5 = a.GetBit(6); + Finish6 = a.GetBit(7); + a = bytes.Skip(11).Take(1).First(); + Finish7 = a.GetBit(0); + Finish8 = a.GetBit(1); + RP2PcA = a.GetBit(2); + RP2PcB=a.GetBit(3); + RP2PcC=a.GetBit(4); + RP2PcD=a.GetBit(5); + } - public WaterTempEntity Hotwater_A => new WaterTempEntity(0, bytes); - public WaterTempEntity Hotwater_B => new WaterTempEntity(10, bytes); - public WaterTempEntity Coolwater_A => new WaterTempEntity(20, bytes); - public WaterTempEntity Coolwater_B => new WaterTempEntity(30, bytes); - public SprialTempEntity Spiral_A => new SprialTempEntity(40, bytes); - public SprialTempEntity Spiral_B => new SprialTempEntity(62, bytes); - public SprialTempEntity Spiral_C => new SprialTempEntity(84, bytes); - public ForceWaterEntity Force_HA => new ForceWaterEntity(106, bytes); - public ForceWaterEntity Force_HB => new ForceWaterEntity(114, bytes); - public ForceWaterEntity Force_CA => new ForceWaterEntity(122, bytes); - public ForceWaterEntity Force_CB => new ForceWaterEntity(130, bytes); + + public bool VesselA { get; set; } + public bool VesselB { get; set; } + public bool VesselC { get; set; } + public bool VesselD { get; set; } + public bool VesselE { get; set; } + public float PD3 { get; set; } + public float HR3 { get; set; } + + public bool PD3Alarm { get; set; } + public bool HR3Alarm { get; set; } + + + public bool Finish1 { get; set; } + public bool Finish2 { get; set; } + public bool Finish3 { get; set; } + public bool Finish4 { get; set; } + public bool Finish5 { get; set; } + public bool Finish6{ get; set; } + public bool Finish7 { get; set; } + + public bool Finish8 { get; set; } + + public bool RP2PcA { get; set; } + public bool RP2PcB { get; set; } + public bool RP2PcC { get; set; } + public bool RP2PcD { get; set; } + + } } diff --git a/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml b/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml index b0b60a9..3b02afb 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml @@ -1,6 +1,51 @@ + + 1817, 570 + Fish8 + 7, 7 + + + 1657, 570 + Fish7 + 7, 7 + + + 1502, 570 + Fish6 + 7, 7 + + + 959, 469 + HslLanternSimple3322 + 7, 7 + + + 1344, 570 + Fish5 + 7, 7 + + + 1260, 570 + Fish4 + 7, 7 + + + 1100, 568 + Fish3 + 7, 7 + + + 952, 568 + Fish2 + 7, 7 + + + 792, 568 + Fish1 + 7, 7 + 1906, 44 HslLanternSimple3316