diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ElectronicMachinery/ElectronicMachinery.Designer.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ElectronicMachinery/ElectronicMachinery.Designer.cs index e4bf65d..370ef38 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ElectronicMachinery/ElectronicMachinery.Designer.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ElectronicMachinery/ElectronicMachinery.Designer.cs @@ -118,11 +118,12 @@ // // groupBox3 // + this.groupBox3.Controls.Add(this.Alarm); this.groupBox3.Controls.Add(this.Running); this.groupBox3.Controls.Add(this.AlarmReset); this.groupBox3.Location = new System.Drawing.Point(204, 12); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(113, 98); + this.groupBox3.Size = new System.Drawing.Size(113, 142); this.groupBox3.TabIndex = 3; this.groupBox3.TabStop = false; this.groupBox3.Text = "其他控制"; @@ -149,7 +150,7 @@ // // Run // - this.Run.Location = new System.Drawing.Point(204, 116); + this.Run.Location = new System.Drawing.Point(204, 160); this.Run.Name = "Run"; this.Run.Size = new System.Drawing.Size(113, 38); this.Run.TabIndex = 2; @@ -174,15 +175,15 @@ "磨粉皮带反转电机"}); this.DMChange.Location = new System.Drawing.Point(12, 160); this.DMChange.Name = "DMChange"; - this.DMChange.Size = new System.Drawing.Size(225, 148); + this.DMChange.Size = new System.Drawing.Size(186, 148); this.DMChange.TabIndex = 4; this.DMChange.SelectedIndexChanged += new System.EventHandler(this.DMChange_SelectedIndexChanged); // // Alarm // - this.Alarm.Location = new System.Drawing.Point(243, 160); + this.Alarm.Location = new System.Drawing.Point(6, 96); this.Alarm.Name = "Alarm"; - this.Alarm.Size = new System.Drawing.Size(74, 39); + this.Alarm.Size = new System.Drawing.Size(100, 40); this.Alarm.TabIndex = 5; this.Alarm.Text = "报警"; this.Alarm.UseVisualStyleBackColor = true; @@ -193,7 +194,6 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(330, 317); - this.Controls.Add(this.Alarm); this.Controls.Add(this.DMChange); this.Controls.Add(this.Run); this.Controls.Add(this.groupBox3); diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ElectronicMachinery/ElectronicMachinery.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ElectronicMachinery/ElectronicMachinery.cs index 3b85e8e..9582fce 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ElectronicMachinery/ElectronicMachinery.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ElectronicMachinery/ElectronicMachinery.cs @@ -33,6 +33,9 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMach } + /// + /// 状态监测类 + /// private void StateMonitor() { ManualModeIsOpen = GetDataToInt("_ManualMode"); @@ -70,21 +73,41 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMach } } + /// + /// 根据属性名和现在选择的数据块名得到PLC数据块的具体引用 + /// + /// 数据块属性名 + /// private DataKeyValue GetDataNameValue(string dmValue) { return new DataKeyValue(DmName + dmValue); } + /// + /// 从PLC中读取值 + /// + /// 要读取的属性 + /// private int GetDataToInt(String dmValue) { return GetDataNameValue(dmValue).NowValue.ToInt(); } + /// + /// 向PLC中写入值 + /// + /// 要写入的属性 + /// 写入的值 private void SetDataValue(String dmValue, int value) { Plc.PlcWriteByDataKey(GetDataNameValue(dmValue), new Object[] { value }); } + /// + /// 列表框,选择设备对应数据块 + /// + /// + /// private void DMChange_SelectedIndexChanged(object sender, EventArgs e) { switch (DMChange.Text) @@ -124,6 +147,11 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMach ICSharpCode.Core.LoggingService.Debug(DMChange.Text + "电机切换成功!"); } + /// + /// 模式切换 + /// + /// + /// private void ManualMode_Click(object sender, EventArgs e) { if(ManualModeIsOpen == 0) @@ -164,6 +192,11 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMach } } + /// + /// 模式开关切换 + /// + /// + /// private void OnOffControl_Click(object sender, EventArgs e) { if (ManualModeIsOpen == 0) @@ -206,6 +239,11 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMach } } + /// + /// 报警灯重置 + /// + /// + /// private void AlarmReset_Click(object sender, EventArgs e) { SetDataValue("_Alarm", 0); @@ -213,16 +251,31 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMach DoControl.Instance.DOControl(DoUtils.enumInfo.DOName.Red, DoUtils.enumInfo.DOOnOff.Off); } + /// + /// 运行监测 + /// + /// + /// private void Running_Click(object sender, EventArgs e) { SetDataValue("_Running", 1); } + /// + /// 运行 + /// + /// + /// private void Run_Click(object sender, EventArgs e) { SetDataValue("_Run", 1); } + /// + /// 报警 + /// + /// + /// private void Alarm_Click(object sender, EventArgs e) { SetDataValue("_Alarm", 1); @@ -230,6 +283,11 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMach DoControl.Instance.DOControl(DoUtils.enumInfo.DOName.Green, DoUtils.enumInfo.DOOnOff.Off); } + /// + /// 窗口关闭 重置报警灯 + /// + /// + /// private void ElectronicMachinery_FormClosing(object sender, FormClosingEventArgs e) { DoControl.Instance.DOControl(DoUtils.enumInfo.DOName.Green, DoUtils.enumInfo.DOOnOff.Off); diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ValveStateControl/ValveStateControl.Designer.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ValveStateControl/ValveStateControl.Designer.cs new file mode 100644 index 0000000..65cef9e --- /dev/null +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ValveStateControl/ValveStateControl.Designer.cs @@ -0,0 +1,284 @@ +namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ValveStateControl +{ + partial class ValveStateControl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.modeCutGroup = new System.Windows.Forms.GroupBox(); + this.ControlMode = new System.Windows.Forms.Button(); + this.NowIs = new System.Windows.Forms.Label(); + this.ModeStateLable = new System.Windows.Forms.Label(); + this.onOffControlGroup = new System.Windows.Forms.GroupBox(); + this.OnOffLable = new System.Windows.Forms.Label(); + this.OnOffControl = new System.Windows.Forms.Button(); + this.otherGroup = new System.Windows.Forms.GroupBox(); + this.Alarm = new System.Windows.Forms.Button(); + this.AlarmSet = new System.Windows.Forms.Button(); + this.Set = new System.Windows.Forms.Button(); + this.DmChange = new System.Windows.Forms.ListBox(); + this.modeCutGroup.SuspendLayout(); + this.onOffControlGroup.SuspendLayout(); + this.otherGroup.SuspendLayout(); + this.SuspendLayout(); + // + // modeCutGroup + // + this.modeCutGroup.Controls.Add(this.ControlMode); + this.modeCutGroup.Controls.Add(this.NowIs); + this.modeCutGroup.Controls.Add(this.ModeStateLable); + this.modeCutGroup.Location = new System.Drawing.Point(12, 12); + this.modeCutGroup.Name = "modeCutGroup"; + this.modeCutGroup.Size = new System.Drawing.Size(234, 70); + this.modeCutGroup.TabIndex = 0; + this.modeCutGroup.TabStop = false; + this.modeCutGroup.Text = "模式切换"; + // + // ControlMode + // + this.ControlMode.Location = new System.Drawing.Point(6, 20); + this.ControlMode.Name = "ControlMode"; + this.ControlMode.Size = new System.Drawing.Size(99, 44); + this.ControlMode.TabIndex = 4; + this.ControlMode.Text = "切换自动模式"; + this.ControlMode.UseVisualStyleBackColor = true; + this.ControlMode.Click += new System.EventHandler(this.ControlMode_Click); + // + // NowIs + // + this.NowIs.AutoSize = true; + this.NowIs.Location = new System.Drawing.Point(111, 17); + this.NowIs.Name = "NowIs"; + this.NowIs.Size = new System.Drawing.Size(41, 12); + this.NowIs.TabIndex = 6; + this.NowIs.Text = "现在为"; + // + // ModeStateLable + // + this.ModeStateLable.AutoSize = true; + this.ModeStateLable.Location = new System.Drawing.Point(111, 36); + this.ModeStateLable.Name = "ModeStateLable"; + this.ModeStateLable.Size = new System.Drawing.Size(53, 12); + this.ModeStateLable.TabIndex = 7; + this.ModeStateLable.Text = "手动模式"; + // + // onOffControlGroup + // + this.onOffControlGroup.Controls.Add(this.OnOffLable); + this.onOffControlGroup.Controls.Add(this.OnOffControl); + this.onOffControlGroup.Location = new System.Drawing.Point(12, 88); + this.onOffControlGroup.Name = "onOffControlGroup"; + this.onOffControlGroup.Size = new System.Drawing.Size(234, 70); + this.onOffControlGroup.TabIndex = 1; + this.onOffControlGroup.TabStop = false; + this.onOffControlGroup.Text = "启停控制"; + // + // OnOffLable + // + this.OnOffLable.AutoSize = true; + this.OnOffLable.Location = new System.Drawing.Point(111, 36); + this.OnOffLable.Name = "OnOffLable"; + this.OnOffLable.Size = new System.Drawing.Size(53, 12); + this.OnOffLable.TabIndex = 8; + this.OnOffLable.Text = "状态:关"; + // + // OnOffControl + // + this.OnOffControl.Location = new System.Drawing.Point(6, 20); + this.OnOffControl.Name = "OnOffControl"; + this.OnOffControl.Size = new System.Drawing.Size(99, 44); + this.OnOffControl.TabIndex = 5; + this.OnOffControl.Text = "启动"; + this.OnOffControl.UseVisualStyleBackColor = true; + this.OnOffControl.Click += new System.EventHandler(this.OnOffControl_Click); + // + // otherGroup + // + this.otherGroup.Controls.Add(this.Alarm); + this.otherGroup.Controls.Add(this.AlarmSet); + this.otherGroup.Controls.Add(this.Set); + this.otherGroup.Location = new System.Drawing.Point(252, 12); + this.otherGroup.Name = "otherGroup"; + this.otherGroup.Size = new System.Drawing.Size(118, 166); + this.otherGroup.TabIndex = 2; + this.otherGroup.TabStop = false; + this.otherGroup.Text = "其他控制"; + // + // Alarm + // + this.Alarm.Location = new System.Drawing.Point(6, 20); + this.Alarm.Name = "Alarm"; + this.Alarm.Size = new System.Drawing.Size(106, 42); + this.Alarm.TabIndex = 2; + this.Alarm.Text = "故障指示"; + this.Alarm.UseVisualStyleBackColor = true; + this.Alarm.Click += new System.EventHandler(this.Alarm_Click); + // + // AlarmSet + // + this.AlarmSet.Location = new System.Drawing.Point(6, 68); + this.AlarmSet.Name = "AlarmSet"; + this.AlarmSet.Size = new System.Drawing.Size(106, 42); + this.AlarmSet.TabIndex = 0; + this.AlarmSet.Text = "报警复位"; + this.AlarmSet.UseVisualStyleBackColor = true; + this.AlarmSet.Click += new System.EventHandler(this.AlarmSet_Click); + // + // Set + // + this.Set.Location = new System.Drawing.Point(6, 116); + this.Set.Name = "Set"; + this.Set.Size = new System.Drawing.Size(106, 42); + this.Set.TabIndex = 1; + this.Set.Text = "输出指令"; + this.Set.UseVisualStyleBackColor = true; + this.Set.Click += new System.EventHandler(this.Set_Click); + // + // DmChange + // + this.DmChange.FormattingEnabled = true; + this.DmChange.ItemHeight = 12; + this.DmChange.Items.AddRange(new object[] { + "输送线C1号压送罐出料蝶阀电磁阀", + "输送线C2号压送罐出料蝶阀电磁阀", + "输送线A1号压送罐进料蝶阀电磁阀", + "输送线A1号压送罐返气蝶阀电磁阀", + "输送线A2号压送罐进料蝶阀电磁阀", + "输送线A2号压送罐返气蝶阀电磁阀", + "输送线B1号压送罐进料蝶阀电磁阀", + "输送线B1号压送罐返气蝶阀电磁阀", + "输送线B2号压送罐进料蝶阀电磁阀", + "输送线B2号压送罐返气蝶阀电磁阀", + "输送线C1号压送罐进料蝶阀电磁阀", + "输送线C1号压送罐返气蝶阀电磁阀", + "输送线C2号压送罐进料蝶阀电磁阀", + "输送线C2号压送罐返气蝶阀电磁阀", + "输送线A1号压送罐出料蝶阀电磁阀", + "输送线A2号压送罐出料蝶阀电磁阀", + "输送线B1号压送罐出料蝶阀电磁阀", + "输送线B2号压送罐出料蝶阀电磁阀", + "输送线A1号压送罐充气角座阀", + "输送线A2号压送罐充气角座阀", + "输送线A清扫角座阀", + "输送线A1号压送罐流态化角座阀", + "输送线A2号压送罐流态化角座阀", + "输送线A压送罐出料主管角座阀", + "输送线A压送罐出料辅管角座阀", + "输送线B1号压送罐充气角座阀", + "输送线B2号压送罐充气角座阀", + "输送线B清扫角座阀", + "输送线B1号压送罐流态化角座阀", + "输送线B2号压送罐流态化角座阀", + "输送线B压送罐出料主管角座阀", + "输送线B压送罐出料辅管角座阀", + "输送线C1号压送罐充气角座阀", + "输送线C2号压送罐充气角座阀", + "输送线C清扫角座阀", + "输送线C1号压送罐流态化角座阀", + "输送线C2号压送罐流态化角座阀", + "输送线C压送罐出料主管角座阀", + "输送线C压送罐出料辅管角座阀", + "输送线A辅管角座阀", + "输送线B辅管角座阀", + "输送线C辅管角座阀", + "大仓A外喷淋阀门", + "大仓B外喷淋阀门", + "大仓C外喷淋阀门", + "大仓D外喷淋阀门", + "大仓E外喷淋阀门", + "大仓F外喷淋阀门", + "大仓G外喷淋阀门", + "大仓H外喷淋阀门", + "大仓I外喷淋阀门", + "大仓J外喷淋阀门", + "大仓O外喷淋阀门", + "输送线A滚筒筛分机侧吹阀", + "输送线A滚筒筛分机振动阀", + "输送线B滚筒筛分机侧吹阀", + "输送线B滚筒筛分机振动阀", + "输送线C滚筒筛分机侧吹阀", + "输送线C滚筒筛分机振动阀", + "二级除尘器侧吹脉冲阀1", + "二级除尘器侧吹脉冲阀2", + "分配阀1直通电磁阀", + "分配阀2直通电磁阀", + "分配阀3直通电磁阀", + "分配阀4直通电磁阀", + "分配阀5直通电磁阀", + "分配阀6直通电磁阀", + "分配阀7直通电磁阀", + "分配阀8直通电磁阀", + "分配阀9直通电磁阀", + "分配阀10直通电磁阀", + "分配阀11直通电磁阀", + "分配阀12直通电磁阀", + "分配阀13直通电磁阀", + "分配阀14直通电磁阀", + "分配阀15直通电磁阀", + "磨粉系统旋转阀气密封电磁阀"}); + this.DmChange.Location = new System.Drawing.Point(12, 164); + this.DmChange.Name = "DmChange"; + this.DmChange.Size = new System.Drawing.Size(234, 172); + this.DmChange.TabIndex = 3; + this.DmChange.SelectedIndexChanged += new System.EventHandler(this.DmChange_SelectedIndexChanged); + // + // ValveStateControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(382, 348); + this.Controls.Add(this.DmChange); + this.Controls.Add(this.otherGroup); + this.Controls.Add(this.onOffControlGroup); + this.Controls.Add(this.modeCutGroup); + this.Name = "ValveStateControl"; + this.Text = "阀门控制"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ValveStateControl_FormClosing); + this.modeCutGroup.ResumeLayout(false); + this.modeCutGroup.PerformLayout(); + this.onOffControlGroup.ResumeLayout(false); + this.onOffControlGroup.PerformLayout(); + this.otherGroup.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox modeCutGroup; + private System.Windows.Forms.GroupBox onOffControlGroup; + private System.Windows.Forms.GroupBox otherGroup; + private System.Windows.Forms.ListBox DmChange; + private System.Windows.Forms.Button ControlMode; + private System.Windows.Forms.Button OnOffControl; + private System.Windows.Forms.Label NowIs; + private System.Windows.Forms.Label ModeStateLable; + private System.Windows.Forms.Label OnOffLable; + private System.Windows.Forms.Button Alarm; + private System.Windows.Forms.Button Set; + private System.Windows.Forms.Button AlarmSet; + } +} \ No newline at end of file diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ValveStateControl/ValveStateControl.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ValveStateControl/ValveStateControl.cs new file mode 100644 index 0000000..710232c --- /dev/null +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ValveStateControl/ValveStateControl.cs @@ -0,0 +1,321 @@ +using Mesnac.Action.ChemicalWeighing.Entity; +using Mesnac.PlcUtils; +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; +using Mesnac.DoUtils; + +namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ValveStateControl +{ + public partial class ValveStateControl : Form + { + BasePlcHelper Plc = BasePlcHelper.Instance; + + string DmName = "BU3DBT06"; + int ManualModeIsOpen; + int ManualModeIsStart; + int AutoModeIsStart; + + public ValveStateControl() + { + InitializeComponent(); + DoControl AlarmLight = DoControl.Instance; + DoControl.Instance.ComOn(); + DoControl.Instance.DOControl(DoUtils.enumInfo.DOName.Green, DoUtils.enumInfo.DOOnOff.On); + StateMonitor(); + } + + /// + /// 状态监测类 + /// + private void StateMonitor() + { + ManualModeIsOpen = GetDataToInt("_ManualMode"); + ManualModeIsStart = GetDataToInt("_SetManual"); + AutoModeIsStart = GetDataToInt("_SetAuto"); + if (ManualModeIsOpen == 0) + { + ControlMode.Text = "切换手动模式"; + ModeStateLable.Text = "自动模式"; + if (AutoModeIsStart == 0) + { + OnOffControl.Text = "启动"; + OnOffLable.Text = "状态:关"; + } + else + { + OnOffControl.Text = "关闭"; + OnOffLable.Text = "状态:开"; + } + } + else + { + ControlMode.Text = "切换自动模式"; + ModeStateLable.Text = "手动模式"; + if (ManualModeIsStart == 0) + { + OnOffControl.Text = "启动"; + OnOffLable.Text = "状态:关"; + } + else + { + OnOffControl.Text = "关闭"; + OnOffLable.Text = "状态:开"; + } + } + } + + /// + /// 根据属性名和现在选择的数据块名得到PLC数据块的具体引用 + /// + /// 数据块属性名 + /// + private DataKeyValue GetDataNameValue(string dmValue) + { + return new DataKeyValue(DmName + dmValue); + } + + /// + /// 从PLC中读取值 + /// + /// 要读取的属性 + /// + private int GetDataToInt(String dmValue) + { + return GetDataNameValue(dmValue).NowValue.ToInt(); + } + + /// + /// 向PLC中写入值 + /// + /// 要写入的属性 + /// 写入的值 + private void SetDataValue(String dmValue, int value) + { + Plc.PlcWriteByDataKey(GetDataNameValue(dmValue), new Object[] { value }); + } + + /// + /// 列表框,选择设备对应数据块 + /// + /// + /// + private void DmChange_SelectedIndexChanged(object sender, EventArgs e) + { + DmName = dmNameValue[DmChange.Text]; + StateMonitor(); + } + + private void ControlMode_Click(object sender, EventArgs e) + { + if (ManualModeIsOpen == 0) + { + SetDataValue("_ManualMode", 1); + SetDataValue("_AutoMode", 0); + ControlMode.Text = "切换自动模式"; + ModeStateLable.Text = "手动模式"; + ManualModeIsOpen = 1; + if (ManualModeIsStart == 0) + { + OnOffControl.Text = "启动"; + OnOffLable.Text = "状态:关"; + } + else + { + OnOffControl.Text = "关闭"; + OnOffLable.Text = "状态:开"; + } + } + else + { + SetDataValue("_ManualMode", 0); + SetDataValue("_AutoMode", 1); + ControlMode.Text = "切换手动模式"; + ModeStateLable.Text = "自动模式"; + ManualModeIsOpen = 0; + if (AutoModeIsStart == 0) + { + OnOffControl.Text = "启动"; + OnOffLable.Text = "状态:关"; + } + else + { + OnOffControl.Text = "关闭"; + OnOffLable.Text = "状态:开"; + } + } + } + + + private void OnOffControl_Click(object sender, EventArgs e) + { + if (ManualModeIsOpen == 0) + { + if (AutoModeIsStart == 0) + { + SetDataValue("_SetAuto", 1); + OnOffControl.Text = "关闭"; + OnOffLable.Text = "状态:开"; + AutoModeIsStart = 1; + } + else + { + SetDataValue("_SetAuto", 0); + OnOffControl.Text = "启动"; + OnOffLable.Text = "状态:关"; + AutoModeIsStart = 0; + } + } + else + { + if (ManualModeIsStart == 0) + { + SetDataValue("_SetManual", 1); + OnOffControl.Text = "关闭"; + OnOffLable.Text = "状态:开"; + ManualModeIsStart = 1; + } + else + { + SetDataValue("_SetManual", 0); + OnOffControl.Text = "启动"; + OnOffLable.Text = "状态:关"; + ManualModeIsStart = 0; + } + } + } + + /// + /// 报警 + /// + /// + /// + private void Alarm_Click(object sender, EventArgs e) + { + SetDataValue("_Alarm", 1); + DoControl.Instance.DOControl(DoUtils.enumInfo.DOName.Red, DoUtils.enumInfo.DOOnOff.On); + DoControl.Instance.DOControl(DoUtils.enumInfo.DOName.Green, DoUtils.enumInfo.DOOnOff.Off); + } + + /// + /// 报警灯重置 + /// + /// + /// + private void AlarmSet_Click(object sender, EventArgs e) + { + SetDataValue("_Alarm", 0); + DoControl.Instance.DOControl(DoUtils.enumInfo.DOName.Green, DoUtils.enumInfo.DOOnOff.On); + DoControl.Instance.DOControl(DoUtils.enumInfo.DOName.Red, DoUtils.enumInfo.DOOnOff.Off); + } + + /// + /// 输出指令 + /// + /// + /// + private void Set_Click(object sender, EventArgs e) + { + SetDataValue("_Set", 1); + } + + /// + /// 窗口关闭 重置报警灯 + /// + /// + /// + private void ValveStateControl_FormClosing(object sender, FormClosingEventArgs e) + { + DoControl.Instance.DOControl(DoUtils.enumInfo.DOName.Green, DoUtils.enumInfo.DOOnOff.Off); + DoControl.Instance.DOControl(DoUtils.enumInfo.DOName.Red, DoUtils.enumInfo.DOOnOff.Off); + DoControl.Instance.ComOff(); + } + + private IDictionary dmNameValue = new Dictionary() + { + ["输送线C1号压送罐出料蝶阀电磁阀"] = "BU3DBT06", + ["输送线C2号压送罐出料蝶阀电磁阀"] = "BU3DBT07", + ["输送线A1号压送罐进料蝶阀电磁阀"] = "BU1DBT01", + ["输送线A1号压送罐返气蝶阀电磁阀"] = "BU1DBT03", + ["输送线A2号压送罐进料蝶阀电磁阀"] = "BU1DBT02", + ["输送线A2号压送罐返气蝶阀电磁阀"] = "BU1DBT04", + ["输送线B1号压送罐进料蝶阀电磁阀"] = "BU2DBT01", + ["输送线B1号压送罐返气蝶阀电磁阀"] = "BU2DBT03", + ["输送线B2号压送罐进料蝶阀电磁阀"] = "BU2DBT02", + ["输送线B2号压送罐返气蝶阀电磁阀"] = "BU2DBT04", + ["输送线C1号压送罐进料蝶阀电磁阀"] = "BU3DBT01", + ["输送线C1号压送罐返气蝶阀电磁阀"] = "BU3DBT03", + ["输送线C2号压送罐进料蝶阀电磁阀"] = "BU3DBT02", + ["输送线C2号压送罐返气蝶阀电磁阀"] = "BU3DBT04", + ["输送线A1号压送罐出料蝶阀电磁阀"] = "BU1DBT06", + ["输送线A2号压送罐出料蝶阀电磁阀"] = "BU1DBT07", + ["输送线B1号压送罐出料蝶阀电磁阀"] = "BU2DBT06", + ["输送线B2号压送罐出料蝶阀电磁阀"] = "BU2DBT07", + ["输送线A1号压送罐充气角座阀"] = "AS1DBT01", + ["输送线A2号压送罐充气角座阀"] = "AS1DBT02", + ["输送线A清扫角座阀"] = "AS1DBT03", + ["输送线A1号压送罐流态化角座阀"] = "AS1DBT04", + ["输送线A2号压送罐流态化角座阀"] = "AS1DBT05", + ["输送线A压送罐出料主管角座阀"] = "AS1DBT06", + ["输送线A压送罐出料辅管角座阀"] = "AS1DBT07", + ["输送线B1号压送罐充气角座阀"] = "AS2DBT01", + ["输送线B2号压送罐充气角座阀"] = "AS2DBT02", + ["输送线B清扫角座阀"] = "AS2DBT03", + ["输送线B1号压送罐流态化角座阀"] = "AS2DBT04", + ["输送线B2号压送罐流态化角座阀"] = "AS2DBT05", + ["输送线B压送罐出料主管角座阀"] = "AS2DBT06", + ["输送线B压送罐出料辅管角座阀"] = "AS2DBT07", + ["输送线C1号压送罐充气角座阀"] = "AS3DBT01", + ["输送线C2号压送罐充气角座阀"] = "AS3DBT02", + ["输送线C清扫角座阀"] = "AS3DBT03", + ["输送线C1号压送罐流态化角座阀"] = "AS3DBT04", + ["输送线C2号压送罐流态化角座阀"] = "AS3DBT05", + ["输送线C压送罐出料主管角座阀"] = "AS3DBT06", + ["输送线C压送罐出料辅管角座阀"] = "AS3DBT07", + ["输送线A辅管角座阀"] = "AS1PCP01", + ["输送线B辅管角座阀"] = "AS1PCP02", + ["输送线C辅管角座阀"] = "AS1PCP03", + ["大仓A外喷淋阀门"] = "AS1ASI01", + ["大仓B外喷淋阀门"] = "AS1BSI01", + ["大仓C外喷淋阀门"] = "AS1CSI01", + ["大仓D外喷淋阀门"] = "AS1DSI01", + ["大仓E外喷淋阀门"] = "AS1ESI01", + ["大仓F外喷淋阀门"] = "AS1FSI01", + ["大仓G外喷淋阀门"] = "AS1GSI01", + ["大仓H外喷淋阀门"] = "AS1HSI01", + ["大仓I外喷淋阀门"] = "AS1ISI01", + ["大仓J外喷淋阀门"] = "AS1JSI01", + ["大仓O外喷淋阀门"] = "AS1OSI01", + ["输送线A滚筒筛分机侧吹阀"] = "SV1DSM01", + ["输送线A滚筒筛分机振动阀"] = "SV1DSM02", + ["输送线B滚筒筛分机侧吹阀"] = "SV2DSM01", + ["输送线B滚筒筛分机振动阀"] = "SV2DSM02", + ["输送线C滚筒筛分机侧吹阀"] = "SV3DSM01", + ["输送线C滚筒筛分机振动阀"] = "SV3DSM02", + ["二级除尘器侧吹脉冲阀1"] = "PV1GDC01", + ["二级除尘器侧吹脉冲阀2"] = "PV1GDC02", + ["分配阀1直通电磁阀"] = "DV1PCP01", + ["分配阀2直通电磁阀"] = "DV1PCP02", + ["分配阀3直通电磁阀"] = "DV1PCP03", + ["分配阀4直通电磁阀"] = "DV1PCP04", + ["分配阀5直通电磁阀"] = "DV1PCP05", + ["分配阀6直通电磁阀"] = "DV1PCP06", + ["分配阀7直通电磁阀"] = "DV1PCP07", + ["分配阀8直通电磁阀"] = "DV1PCP08", + ["分配阀9直通电磁阀"] = "DV1PCP09", + ["分配阀10直通电磁阀"] = "DV1PCP10", + ["分配阀11直通电磁阀"] = "DV1PCP11", + ["分配阀12直通电磁阀"] = "DV1PCP12", + ["分配阀13直通电磁阀"] = "DV1PCP13", + ["分配阀14直通电磁阀"] = "DV1PCP14", + ["分配阀15直通电磁阀"] = "DV1PCP15", + ["磨粉系统旋转阀气密封电磁阀"] = "SV1GDS01" + }; + } +} diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ValveStateControl/ValveStateControl.resx b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ValveStateControl/ValveStateControl.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ValveStateControl/ValveStateControl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj index 335e04b..d3ba0dc 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj @@ -218,6 +218,12 @@ ElectronicMachinery.cs + + Form + + + ValveStateControl.cs + @@ -674,6 +680,9 @@ ElectronicMachinery.cs + + ValveStateControl.cs + FrmDevice.cs diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs index 8f36979..38a195a 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs @@ -7,6 +7,7 @@ using System.Windows.Forms; using ICSharpCode.Core; using Mesnac.Action.Base; using Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMachinery; +using Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ValveStateControl; using Mesnac.Action.ChemicalWeighing.Entity; using Mesnac.Action.ChemicalWeighing.LjMetageFormula; using Mesnac.Action.ChemicalWeighing.LjMixFormula; @@ -39,8 +40,8 @@ namespace Mesnac.Action.ChemicalWeighing.Test // dbHelper.CommandText = sql; - ElectronicMachinery FM = new ElectronicMachinery(); - FM.Show(); + ValveStateControl Form = new ValveStateControl(); + Form.Show(); diff --git a/Main/MCEdit/Data/MCProject/nodeDevice.xml b/Main/MCEdit/Data/MCProject/nodeDevice.xml index 89640eb..4bcdf88 100644 --- a/Main/MCEdit/Data/MCProject/nodeDevice.xml +++ b/Main/MCEdit/Data/MCProject/nodeDevice.xml @@ -6147,7 +6147,7 @@ - + @@ -6429,1240 +6429,1240 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7697,14 +7697,7 @@ - - - - - - - - + \ No newline at end of file