using Mesnac.Action.ChemicalWeighing.Entity; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.NewFolder1 { public partial class ValveInitStateMonitor : Form { string DmName_S = "BU1ASF01"; string DmName_D = "DV2PCP01"; public ValveInitStateMonitor() { InitializeComponent(); StateMonitor_D(DmName_D); StateMonitor_S(DmName_S); } private void DmChange_S_SelectedIndexChanged(object sender, EventArgs e) { DmName_S = dmNameValue[DmChange_S.Text]; StateMonitor_S(DmName_S); } private void StateMonitor_S(string dmName) { ManualMode_S.Text = PlcCommunicationUtil.GetDataToString(dmName, "_ManualMode"); AutoMode_S.Text = PlcCommunicationUtil.GetDataToString(dmName, "_AutoMode"); AlarmReset_S.Text = PlcCommunicationUtil.GetDataToString(dmName, "_AlarmReset"); SetManual_S.Text = PlcCommunicationUtil.GetDataToString(dmName, "_SetManual"); SetAuto_S.Text = PlcCommunicationUtil.GetDataToString(dmName, "_SetAuto"); SetPosition_S.Text = PlcCommunicationUtil.GetDataToString(dmName, "_SetPosition"); UnSetPosition_S.Text = PlcCommunicationUtil.GetDataToString(dmName, "_UnSetPosition"); Set_S.Text = PlcCommunicationUtil.GetDataToString(dmName, "_Set"); AlarmSetPos_S.Text = PlcCommunicationUtil.GetDataToString(dmName, "_AlarmSetPos"); AlarmUnSetPos_S.Text = PlcCommunicationUtil.GetDataToString(dmName, "_AlarmUnSetPos"); AlarmPosition_S.Text = PlcCommunicationUtil.GetDataToString(dmName, "_AlarmPosition"); Alarm_S.Text = PlcCommunicationUtil.GetDataToString(dmName, "_Alarm"); P_S.Text = PlcCommunicationUtil.GetDataToString(dmName, "_P"); } private void DmChange_D_SelectedIndexChanged(object sender, EventArgs e) { DmName_D = dmNameValue[DmChange_D.Text]; StateMonitor_D(DmName_D); } private void StateMonitor_D(string dmName) { ManualMode_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_ManualMode"); AutoMode_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_AutoMode"); SetLeftManual_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_SetLeftManual"); SetRightManual_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_SetRightManual"); SetLeftAuto_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_SetLeftAuto"); SetRightAuto_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_SetRightAuto"); AlarmReset_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_AlarmReset"); LeftPosition_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_LeftPosition"); RightPosition_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_RightPosition"); SetLeft_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_SetLeft"); SetRight_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_SetRight"); AlarmLeftPosition_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_AlarmLeftPosition"); AlarmRightPosition_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_AlarmRightPosition"); AlarmPosition_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_AlarmPosition"); Alarm_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_Alarm"); } private void Refresh_Click(object sender, EventArgs e) { StateMonitor_D(DmName_D); StateMonitor_S(DmName_S); } private IDictionary dmNameValue = new Dictionary() { ["螺旋输送机1A出料蝶阀"] = "BU1ASF01", ["螺旋输送机1B出料蝶阀"] = "BU1BSF01", ["螺旋输送机1C出料蝶阀"] = "BU1CSF01", ["螺旋输送机1D出料蝶阀"] = "BU1DSF01", ["螺旋输送机1E出料蝶阀"] = "BU1ESF01", ["螺旋输送机1F出料蝶阀"] = "BU1FSF01", ["螺旋输送机1G出料蝶阀"] = "BU1GSF01", ["螺旋输送机1H出料蝶阀"] = "BU1HSF01", ["螺旋输送机1I出料蝶阀"] = "BU1ISF01", ["螺旋输送机1J出料蝶阀"] = "BU1JSF01", ["螺旋输送机1K出料蝶阀"] = "BU1KSF01", ["螺旋输送机1L出料蝶阀"] = "BU1LSF01", ["螺旋输送机1M出料蝶阀"] = "BU1MSF01", ["螺旋输送机1N出料蝶阀"] = "BU1NSF01", ["螺旋输送机1O出料蝶阀"] = "BU1OSF01", ["压送秤A进料蝶阀1"] = "BU1BLT01", ["压送秤A进料蝶阀2"] = "BU1BLT02", ["压送秤A进料蝶阀3"] = "BU1BLT03", ["压送秤A进料蝶阀4"] = "BU1BLT04", ["压送秤A返气蝶阀"] = "BU1BLT05", ["压送秤A出料蝶阀"] = "BU1BLT06", ["压送秤A除尘出料蝶阀"] = "BU1BLT07", ["压送秤B进料蝶阀1"] = "BU2BLT01", ["压送秤B进料蝶阀2"] = "BU2BLT02", ["压送秤B返气蝶阀"] = "BU2BLT03", ["压送秤B出料蝶阀"] = "BU2BLT04", ["压送秤B除尘出料蝶阀"] = "BU2BLT05", ["压送秤C进料蝶阀1"] = "BU3BLT01", ["压送秤C进料蝶阀2"] = "BU3BLT02", ["压送秤C进料蝶阀3"] = "BU3BLT03", ["压送秤C进料蝶阀4"] = "BU3BLT04", ["压送秤C返气蝶阀"] = "BU3BLT05", ["压送秤C出料蝶阀"] = "BU3BLT06", ["压送秤C除尘出料蝶阀"] = "BU3BLT07", ["压送秤D进料蝶阀1"] = "BU4BLT01", ["压送秤D进料蝶阀2"] = "BU4BLT02", ["压送秤D进料蝶阀3"] = "BU4BLT03", ["压送秤D进料蝶阀4"] = "BU4BLT04", ["压送秤D返气蝶阀"] = "BU4BLT05", ["压送秤D出料蝶阀"] = "BU4BLT06", ["压送秤D除尘出料蝶阀"] = "BU4BLT07", ["压送秤E进料蝶阀"] = "BU5BLT01", ["压送秤E返气蝶阀"] = "BU5BLT02", ["压送秤E出料蝶阀"] = "BU5BLT03", ["压送秤E除尘出料蝶阀"] = "BU5BLT04", ["双向螺旋输送机2A出料蝶阀1"] = "BU2ASF01", ["双向螺旋输送机2A出料蝶阀2"] = "BU2ASF02", ["双向螺旋输送机2B出料蝶阀1"] = "BU2BSF01", ["双向螺旋输送机2B出料蝶阀2"] = "BU2BSF02", ["双向螺旋输送机2C出料蝶阀1"] = "BU2CSF01", ["双向螺旋输送机2C出料蝶阀2"] = "BU2CSF02", ["双向螺旋输送机2D出料蝶阀1"] = "BU2DSF01", ["双向螺旋输送机2D出料蝶阀2"] = "BU2DSF02", ["缓存仓1A出料蝶阀"] = "BU1ADB01", ["缓存仓1B出料蝶阀"] = "BU1BDB01", ["缓存仓1C出料蝶阀"] = "BU1CDB01", ["缓存仓1D出料蝶阀"] = "BU1DDB01", ["缓存仓1E出料蝶阀"] = "BU1EDB01", ["缓存仓1F出料蝶阀"] = "BU1FDB01", ["缓存仓1G出料蝶阀"] = "BU1GDB01", ["缓存仓1H出料蝶阀"] = "BU1HDB01", ["缓存仓1I出料蝶阀"] = "BU1IDB01", ["缓存仓1J出料蝶阀"] = "BU1JDB01", ["缓存仓1K出料蝶阀"] = "BU1KDB01", ["缓存仓1L出料蝶阀"] = "BU1LDB01", ["二级气力输送管道分配阀1"] = "DV2PCP01", ["二级气力输送管道分配阀2"] = "DV2PCP02", ["二级气力输送管道分配阀3"] = "DV2PCP03", ["二级气力动送管道分配阀4"] = "DV2PCP04", ["二级气力输送管道分配阀5"] = "DV2PCP05", ["二级气力输送管道分配阀6"] = "DV2PCP06", ["二级气力动送管道分配阀7"] = "DV2PCP07", ["二级气力输送管道分配阀8"] = "DV2PCP08", ["二级气力输送管道分配阀9"] = "DV2PCP09", ["二级气力动送管道分配阀10"] = "DV2PCP10", ["二级气力输送管道分配阀11"] = "DV2PCP11", ["二级气力输送管道分配阀12"] = "DV2PCP12", ["二级气力动送管道分配阀13"] = "DV2PCP13", ["二级气力输送管道分配阀14"] = "DV2PCP14", ["干混机卸料阀1"] = "BU1DRB01", ["干混机卸料阀2"] = "BU2DRB01", ["干混机卸料阀3"] = "BU3DRB01", ["干混机卸料阀4"] = "BU4DRB01", ["糊化机卸料阀1"] = "BU1GEB01", ["糊化机卸料阀2"] = "BU2GEB01", ["糊化机卸料阀3"] = "BU3GEB01", ["糊化机卸料阀4"] = "BU4GEB01", ["糊化机卸料阀5"] = "BU5GEB01", ["糊化机卸料阀6"] = "BU6GEB01", ["糊化机卸料阀7"] = "BU7GEB01", ["糊化机卸料阀8"] = "BU8GEB01" }; } }