|
|
|
@ -1,6 +1,10 @@
|
|
|
|
|
using DataBlockHelper;
|
|
|
|
|
using DataBlockHelper.DBHelpers;
|
|
|
|
|
using DataBlockHelper.Entity.DB2106Entity;
|
|
|
|
|
|
|
|
|
|
using HslCommunication;
|
|
|
|
|
using HslCommunication.Instrument.DLT;
|
|
|
|
|
|
|
|
|
|
using log4net;
|
|
|
|
|
using log4net.Config;
|
|
|
|
|
using Mesnac.Action.Base;
|
|
|
|
@ -11,10 +15,12 @@ using Mesnac.Action.ChemicalWeighing.LjMaterial;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.LjReport.OpenDoor;
|
|
|
|
|
using Mesnac.Basic;
|
|
|
|
|
using Mesnac.Controls.Base;
|
|
|
|
|
using Mesnac.Controls.Default;
|
|
|
|
|
using Mesnac.Core.Service;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
@ -33,7 +39,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
|
|
|
|
|
List<DbMCControl> McControllist;
|
|
|
|
|
List<DbMCControl> _McControllist;
|
|
|
|
|
|
|
|
|
|
List<Control> allControl;
|
|
|
|
|
OperateResult<byte[]> Read;
|
|
|
|
|
|
|
|
|
|
byte[] content;
|
|
|
|
@ -84,6 +90,28 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
bool State2;
|
|
|
|
|
byte Byt;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Color backColor;
|
|
|
|
|
|
|
|
|
|
MCRadioButton Gel1;
|
|
|
|
|
MCRadioButton Gel2;
|
|
|
|
|
MCRadioButton Gel3;
|
|
|
|
|
MCRadioButton Gel4;
|
|
|
|
|
MCRadioButton Gel5;
|
|
|
|
|
MCRadioButton Gel6;
|
|
|
|
|
MCRadioButton Gel7;
|
|
|
|
|
MCRadioButton Gel8;
|
|
|
|
|
MCRadioButton Wet1;
|
|
|
|
|
MCRadioButton Wet2;
|
|
|
|
|
MCRadioButton Wet3;
|
|
|
|
|
MCRadioButton Wet4;
|
|
|
|
|
MCRadioButton Wet5;
|
|
|
|
|
MCRadioButton Wet6;
|
|
|
|
|
MCRadioButton Wet7;
|
|
|
|
|
MCRadioButton Wet8;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Run(RuntimeParameter runtime)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
@ -93,7 +121,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
|
|
|
|
|
McControllist = GetAllDbMCControlsByOption(DbOptionTypes.InitData);
|
|
|
|
|
_McControllist = GetAllDbMCControlsByOption(DbOptionTypes.Modify);
|
|
|
|
|
|
|
|
|
|
allControl = GetAllControls();
|
|
|
|
|
WaterActualValue1 = GetBaseControl("WaterActualValue1");
|
|
|
|
|
WaterActualValue2 = GetBaseControl("WaterActualValue2");
|
|
|
|
|
WaterActualValue3 = GetBaseControl("WaterActualValue3");
|
|
|
|
@ -143,7 +171,50 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
MesnacServiceManager.Instance.LoggingService.Info("配置已加载");
|
|
|
|
|
ManualLogControl("配置已加载 ");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Gel1 = GetMCRadioButton("Gel1");
|
|
|
|
|
backColor = Gel1.BackColor;
|
|
|
|
|
Gel1.CheckedChanged += McradionA_CheckedChanged;
|
|
|
|
|
Gel2 = GetMCRadioButton("Gel2");
|
|
|
|
|
Gel2.CheckedChanged += McradionA_CheckedChanged;
|
|
|
|
|
Gel3 = GetMCRadioButton("Gel3");
|
|
|
|
|
Gel3.CheckedChanged += McradionA_CheckedChanged;
|
|
|
|
|
Gel4 = GetMCRadioButton("Gel4");
|
|
|
|
|
Gel4.CheckedChanged += McradionA_CheckedChanged;
|
|
|
|
|
|
|
|
|
|
Gel5 = GetMCRadioButton("Gel5");
|
|
|
|
|
Gel5.CheckedChanged += McradionB_CheckedChanged;
|
|
|
|
|
Gel6 = GetMCRadioButton("Gel6");
|
|
|
|
|
Gel6.CheckedChanged += McradionB_CheckedChanged;
|
|
|
|
|
Gel7 = GetMCRadioButton("Gel7");
|
|
|
|
|
Gel7.CheckedChanged += McradionB_CheckedChanged;
|
|
|
|
|
Gel8 = GetMCRadioButton("Gel8");
|
|
|
|
|
Gel8.CheckedChanged += McradionB_CheckedChanged;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Wet1 = GetMCRadioButton("Wet1");
|
|
|
|
|
Wet1.CheckedChanged += Wet1_CheckedChanged;
|
|
|
|
|
Wet2 = GetMCRadioButton("Wet2");
|
|
|
|
|
Wet2.CheckedChanged += Wet1_CheckedChanged;
|
|
|
|
|
|
|
|
|
|
Wet3 = GetMCRadioButton("Wet3");
|
|
|
|
|
Wet3.CheckedChanged += Wet3_CheckedChanged;
|
|
|
|
|
Wet4 = GetMCRadioButton("Wet4");
|
|
|
|
|
Wet4.CheckedChanged += Wet3_CheckedChanged;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Wet5 = GetMCRadioButton("Wet5");
|
|
|
|
|
Wet5.CheckedChanged += Wet5_CheckedChanged;
|
|
|
|
|
Wet6 = GetMCRadioButton("Wet6");
|
|
|
|
|
Wet6.CheckedChanged += Wet5_CheckedChanged;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Wet7 = GetMCRadioButton("Wet7");
|
|
|
|
|
Wet7.CheckedChanged += Wet7_CheckedChanged;
|
|
|
|
|
Wet8 = GetMCRadioButton("Wet8");
|
|
|
|
|
|
|
|
|
|
Wet8.CheckedChanged += Wet7_CheckedChanged;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
timer = new Timer();
|
|
|
|
|
timer.Interval = 1000;
|
|
|
|
@ -151,6 +222,38 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
timer.Tick += new EventHandler(ReadFromPlc);//添加事件
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Wet1_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
MCRadioButton mCRadio = sender as MCRadioButton;
|
|
|
|
|
Wet1.BackColor = backColor;
|
|
|
|
|
Wet2.BackColor=backColor;
|
|
|
|
|
mCRadio.BackColor = Color.GreenYellow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Wet3_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
MCRadioButton mCRadio = sender as MCRadioButton;
|
|
|
|
|
Wet3.BackColor = backColor;
|
|
|
|
|
Wet4.BackColor = backColor;
|
|
|
|
|
mCRadio.BackColor = Color.GreenYellow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Wet5_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
MCRadioButton mCRadio = sender as MCRadioButton;
|
|
|
|
|
Wet5.BackColor = backColor;
|
|
|
|
|
Wet6.BackColor = backColor;
|
|
|
|
|
mCRadio.BackColor = Color.GreenYellow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Wet7_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
MCRadioButton mCRadio = sender as MCRadioButton;
|
|
|
|
|
Wet7.BackColor = backColor;
|
|
|
|
|
Wet8.BackColor = backColor;
|
|
|
|
|
mCRadio.BackColor = Color.GreenYellow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Timer1_Tick()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
@ -212,7 +315,34 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private MCRadioButton GetMCRadioButton(string name)
|
|
|
|
|
{
|
|
|
|
|
var mcradion= allControl.Where(t => t.Name == name).FirstOrDefault() as MCRadioButton;
|
|
|
|
|
|
|
|
|
|
return mcradion;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void McradionA_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
MCRadioButton mCRadio=sender as MCRadioButton;
|
|
|
|
|
Gel1.BackColor = backColor;
|
|
|
|
|
Gel2.BackColor = backColor;
|
|
|
|
|
Gel3.BackColor = backColor;
|
|
|
|
|
Gel4.BackColor = backColor;
|
|
|
|
|
mCRadio.BackColor = Color.GreenYellow;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void McradionB_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
MCRadioButton mCRadio = sender as MCRadioButton;
|
|
|
|
|
Gel5.BackColor = backColor;
|
|
|
|
|
Gel6.BackColor = backColor;
|
|
|
|
|
Gel7.BackColor = backColor;
|
|
|
|
|
Gel8.BackColor = backColor;
|
|
|
|
|
mCRadio.BackColor = Color.GreenYellow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ReadFromPlc(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|