add - 加入简易报警灯控制和部分日志

master
wangsr 1 year ago
parent 61e5d44119
commit 33807824bd

@ -40,6 +40,7 @@
this.AlarmReset = new System.Windows.Forms.Button(); this.AlarmReset = new System.Windows.Forms.Button();
this.Run = new System.Windows.Forms.Button(); this.Run = new System.Windows.Forms.Button();
this.DMChange = new System.Windows.Forms.ListBox(); this.DMChange = new System.Windows.Forms.ListBox();
this.Alarm = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout(); this.groupBox3.SuspendLayout();
@ -160,22 +161,39 @@
// //
this.DMChange.FormattingEnabled = true; this.DMChange.FormattingEnabled = true;
this.DMChange.ItemHeight = 12; 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.Name = "DMChange";
this.DMChange.Size = new System.Drawing.Size(225, 148); this.DMChange.Size = new System.Drawing.Size(225, 148);
this.DMChange.TabIndex = 4; this.DMChange.TabIndex = 4;
this.DMChange.SelectedIndexChanged += new System.EventHandler(this.DMChange_SelectedIndexChanged); this.DMChange.SelectedIndexChanged += new System.EventHandler(this.DMChange_SelectedIndexChanged);
DMChange.Items.AddRange(new string[] {"二级除尘器除尘风机", "大A组除尘风机", "大仓B组除尘风机", "大仓C组除尘风机", "大仓D组除尘风机", //
"磨粉分析机电机", "磨粉除尘风机电机", "磨粉罗茨风机电机", "磨粉皮带正转电机", "磨粉皮带反转电机"}); // Alarm
//
//{"DM1GDP01", "DM1ASIG01", "DM1BSIG01", "DM1CSIG01", "DM1DSIG01", this.Alarm.Location = new System.Drawing.Point(243, 160);
// "DM1GDS01", "DM1GDS02", "DM1GDS03", "DM1GDS04", "DM1GDS05"}); 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 // ElectronicMachinery
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 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.DMChange);
this.Controls.Add(this.Run); this.Controls.Add(this.Run);
this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox3);
@ -183,6 +201,7 @@
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Name = "ElectronicMachinery"; this.Name = "ElectronicMachinery";
this.Text = "电机控制"; this.Text = "电机控制";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ElectronicMachinery_FormClosing);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout(); this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);
@ -206,5 +225,6 @@
private System.Windows.Forms.Button Running; private System.Windows.Forms.Button Running;
private System.Windows.Forms.Label NowIs; private System.Windows.Forms.Label NowIs;
private System.Windows.Forms.ListBox DMChange; private System.Windows.Forms.ListBox DMChange;
private System.Windows.Forms.Button Alarm;
} }
} }

@ -1,4 +1,5 @@
using Mesnac.Action.ChemicalWeighing.Entity; using DevExpress.DataAccess.Native.ExpressionEditor;
using Mesnac.Action.ChemicalWeighing.Entity;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
@ -8,12 +9,16 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using Mesnac.DoUtils;
using Mesnac.Action.ChemicalWeighing.FinishBatch.SaveHelper;
namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMachinery namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMachinery
{ {
public partial class ElectronicMachinery : Form public partial class ElectronicMachinery : Form
{ {
BasePlcHelper Plc = BasePlcHelper.Instance; BasePlcHelper Plc = BasePlcHelper.Instance;
int ManualModeIsOpen; int ManualModeIsOpen;
int ManualModeIsStart; int ManualModeIsStart;
int AutoModeIsStart; int AutoModeIsStart;
@ -21,8 +26,11 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMach
public ElectronicMachinery() public ElectronicMachinery()
{ {
InitializeComponent(); InitializeComponent();
DoControl AlarmLight = DoControl.Instance;
DoControl.Instance.ComOn();
DoControl.Instance.DOControl(DoUtils.enumInfo.DOName.Green, DoUtils.enumInfo.DOOnOff.On);
StateMonitor(); StateMonitor();
} }
private void StateMonitor() private void StateMonitor()
@ -113,6 +121,7 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMach
break; break;
} }
StateMonitor(); StateMonitor();
ICSharpCode.Core.LoggingService<ElectronicMachinery>.Debug(DMChange.Text + "电机切换成功!");
} }
private void ManualMode_Click(object sender, EventArgs e) 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) 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) private void Running_Click(object sender, EventArgs e)
@ -212,7 +223,27 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ElectronicMach
SetDataValue("_Run", 1); 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 }); /*Plc.PlcWriteByDataKey(GetDataKeyValue(""), new Object[] { 1 });
GetDataKeyValue("").LastValue*/ GetDataKeyValue("").LastValue*/

@ -170,6 +170,10 @@
<Project>{d0c0324f-434e-47eb-8f7c-ba6cd7f233b4}</Project> <Project>{d0c0324f-434e-47eb-8f7c-ba6cd7f233b4}</Project>
<Name>Mesnac.Controls.Feeding</Name> <Name>Mesnac.Controls.Feeding</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\Mesnac.DoUtils\Mesnac.DoUtils.csproj">
<Project>{ad132cad-5288-44dc-a38f-4b0658fc228c}</Project>
<Name>Mesnac.DoUtils</Name>
</ProjectReference>
<ProjectReference Include="..\Mesnac.Basic\Mesnac.Basic.csproj"> <ProjectReference Include="..\Mesnac.Basic\Mesnac.Basic.csproj">
<Project>{28ACACF1-9936-4E97-A866-F84366EC5286}</Project> <Project>{28ACACF1-9936-4E97-A866-F84366EC5286}</Project>
<Name>Mesnac.Basic</Name> <Name>Mesnac.Basic</Name>

Loading…
Cancel
Save