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 f59cdb3..e4bf65d 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ElectronicMachinery/ElectronicMachinery.Designer.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ElectronicMachinery/ElectronicMachinery.Designer.cs @@ -40,6 +40,7 @@ this.AlarmReset = new System.Windows.Forms.Button(); this.Run = new System.Windows.Forms.Button(); this.DMChange = new System.Windows.Forms.ListBox(); + this.Alarm = new System.Windows.Forms.Button(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -160,22 +161,39 @@ // this.DMChange.FormattingEnabled = true; this.DMChange.ItemHeight = 12; - this.DMChange.Location = new System.Drawing.Point(323, 12); + this.DMChange.Items.AddRange(new object[] { + "二级除尘器除尘风机", + "大A组除尘风机", + "大仓B组除尘风机", + "大仓C组除尘风机", + "大仓D组除尘风机", + "磨粉分析机电机", + "磨粉除尘风机电机", + "磨粉罗茨风机电机", + "磨粉皮带正转电机", + "磨粉皮带反转电机"}); + this.DMChange.Location = new System.Drawing.Point(12, 160); this.DMChange.Name = "DMChange"; this.DMChange.Size = new System.Drawing.Size(225, 148); this.DMChange.TabIndex = 4; this.DMChange.SelectedIndexChanged += new System.EventHandler(this.DMChange_SelectedIndexChanged); - DMChange.Items.AddRange(new string[] {"二级除尘器除尘风机", "大A组除尘风机", "大仓B组除尘风机", "大仓C组除尘风机", "大仓D组除尘风机", - "磨粉分析机电机", "磨粉除尘风机电机", "磨粉罗茨风机电机", "磨粉皮带正转电机", "磨粉皮带反转电机"}); - - //{"DM1GDP01", "DM1ASIG01", "DM1BSIG01", "DM1CSIG01", "DM1DSIG01", - // "DM1GDS01", "DM1GDS02", "DM1GDS03", "DM1GDS04", "DM1GDS05"}); + // + // Alarm + // + this.Alarm.Location = new System.Drawing.Point(243, 160); + this.Alarm.Name = "Alarm"; + this.Alarm.Size = new System.Drawing.Size(74, 39); + this.Alarm.TabIndex = 5; + this.Alarm.Text = "报警"; + this.Alarm.UseVisualStyleBackColor = true; + this.Alarm.Click += new System.EventHandler(this.Alarm_Click); // // ElectronicMachinery // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(560, 168); + 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); @@ -183,6 +201,7 @@ this.Controls.Add(this.groupBox1); this.Name = "ElectronicMachinery"; this.Text = "电机控制"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ElectronicMachinery_FormClosing); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -206,5 +225,6 @@ private System.Windows.Forms.Button Running; private System.Windows.Forms.Label NowIs; private System.Windows.Forms.ListBox DMChange; + private System.Windows.Forms.Button Alarm; } } \ No newline at end of file diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ElectronicMachinery/ElectronicMachinery.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ElectronicMachinery/ElectronicMachinery.cs index af2e538..3b85e8e 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ElectronicMachinery/ElectronicMachinery.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/ElectronicMachinery/ElectronicMachinery.cs @@ -1,4 +1,5 @@ -using Mesnac.Action.ChemicalWeighing.Entity; +using DevExpress.DataAccess.Native.ExpressionEditor; +using Mesnac.Action.ChemicalWeighing.Entity; using System; using System.Collections.Generic; using System.ComponentModel; @@ -8,12 +9,16 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using Mesnac.DoUtils; +using Mesnac.Action.ChemicalWeighing.FinishBatch.SaveHelper; namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMachinery { + public partial class ElectronicMachinery : Form { BasePlcHelper Plc = BasePlcHelper.Instance; + int ManualModeIsOpen; int ManualModeIsStart; int AutoModeIsStart; @@ -21,8 +26,11 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMach public ElectronicMachinery() { InitializeComponent(); - + DoControl AlarmLight = DoControl.Instance; + DoControl.Instance.ComOn(); + DoControl.Instance.DOControl(DoUtils.enumInfo.DOName.Green, DoUtils.enumInfo.DOOnOff.On); StateMonitor(); + } private void StateMonitor() @@ -113,6 +121,7 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMach break; } StateMonitor(); + ICSharpCode.Core.LoggingService.Debug(DMChange.Text + "电机切换成功!"); } private void ManualMode_Click(object sender, EventArgs e) @@ -199,7 +208,9 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMach private void AlarmReset_Click(object sender, EventArgs e) { - SetDataValue("_AlarmReset", 1); + 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 Running_Click(object sender, EventArgs e) @@ -212,7 +223,27 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMach SetDataValue("_Run", 1); } - + 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 ElectronicMachinery_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(); + } + + + + + + + + /*Plc.PlcWriteByDataKey(GetDataKeyValue(""), new Object[] { 1 }); GetDataKeyValue("").LastValue*/ diff --git a/Main/MCEdit/MCEdit.csproj b/Main/MCEdit/MCEdit.csproj index c2e608d..d66ef44 100644 --- a/Main/MCEdit/MCEdit.csproj +++ b/Main/MCEdit/MCEdit.csproj @@ -170,6 +170,10 @@ {d0c0324f-434e-47eb-8f7c-ba6cd7f233b4} Mesnac.Controls.Feeding + + {ad132cad-5288-44dc-a38f-4b0658fc228c} + Mesnac.DoUtils + {28ACACF1-9936-4E97-A866-F84366EC5286} Mesnac.Basic