|
|
|
@ -9,6 +9,7 @@ using Mesnac.Controls.Default;
|
|
|
|
|
using Microsoft.Office.Interop.Excel;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
@ -21,6 +22,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
|
|
|
|
|
{
|
|
|
|
|
GelerWeterControlsEntity ControlsEntity = new GelerWeterControlsEntity();
|
|
|
|
|
private List<Control> McControls;
|
|
|
|
|
Color backColor = Color.Transparent;
|
|
|
|
|
|
|
|
|
|
public void Run(RuntimeParameter runtime)
|
|
|
|
|
{
|
|
|
|
@ -32,11 +34,35 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
|
|
|
|
|
ControlImport();
|
|
|
|
|
|
|
|
|
|
ControlsEntity.Line1.MCValue = true;
|
|
|
|
|
ControlsEntity.Line1.BackColor = System.Drawing.Color.LightGreen;
|
|
|
|
|
|
|
|
|
|
ControlsEntity.Line1.CheckedChanged += Mcradion_CheckedChanged;
|
|
|
|
|
ControlsEntity.Line2.CheckedChanged += Mcradion_CheckedChanged;
|
|
|
|
|
ControlsEntity.Line3.CheckedChanged += Mcradion_CheckedChanged;
|
|
|
|
|
ControlsEntity.Line4.CheckedChanged += Mcradion_CheckedChanged;
|
|
|
|
|
ControlsEntity.Line5.CheckedChanged += Mcradion_CheckedChanged;
|
|
|
|
|
ControlsEntity.Line6.CheckedChanged += Mcradion_CheckedChanged;
|
|
|
|
|
ControlsEntity.Line7.CheckedChanged += Mcradion_CheckedChanged;
|
|
|
|
|
ControlsEntity.Line8.CheckedChanged += Mcradion_CheckedChanged;
|
|
|
|
|
|
|
|
|
|
ControlInitFromPLC();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Mcradion_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
MCRadioButton mCRadio = sender as MCRadioButton;
|
|
|
|
|
ControlsEntity.Line1.BackColor = backColor;
|
|
|
|
|
ControlsEntity.Line2.BackColor = backColor;
|
|
|
|
|
ControlsEntity.Line3.BackColor = backColor;
|
|
|
|
|
ControlsEntity.Line4.BackColor = backColor;
|
|
|
|
|
ControlsEntity.Line5.BackColor = backColor;
|
|
|
|
|
ControlsEntity.Line6.BackColor = backColor;
|
|
|
|
|
ControlsEntity.Line7.BackColor = backColor;
|
|
|
|
|
ControlsEntity.Line8.BackColor = backColor;
|
|
|
|
|
mCRadio.BackColor = Color.LightGreen;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 控件从Plc初始化
|
|
|
|
|
/// </summary>
|
|
|
|
@ -128,7 +154,14 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void ControlImport()
|
|
|
|
|
{
|
|
|
|
|
ControlsEntity.Line1 = GetBaseControl("Line1");
|
|
|
|
|
ControlsEntity.Line1 = GetMCRadioButtonControl("Line1");
|
|
|
|
|
ControlsEntity.Line2 = GetMCRadioButtonControl("Line2");
|
|
|
|
|
ControlsEntity.Line3 = GetMCRadioButtonControl("Line3");
|
|
|
|
|
ControlsEntity.Line4 = GetMCRadioButtonControl("Line4");
|
|
|
|
|
ControlsEntity.Line5 = GetMCRadioButtonControl("Line5");
|
|
|
|
|
ControlsEntity.Line6 = GetMCRadioButtonControl("Line6");
|
|
|
|
|
ControlsEntity.Line7 = GetMCRadioButtonControl("Line7");
|
|
|
|
|
ControlsEntity.Line8 = GetMCRadioButtonControl("Line8");
|
|
|
|
|
|
|
|
|
|
ControlsEntity.ChooseMaterial1 = GetComboBoxControl("ChooseMaterial1");
|
|
|
|
|
ControlsEntity.ChooseMaterial2 = GetComboBoxControl("ChooseMaterial2");
|
|
|
|
@ -161,5 +194,11 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
|
|
|
|
|
{
|
|
|
|
|
return McControls.First(x => x.Name == name) as MCCombobox;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private MCRadioButton GetMCRadioButtonControl(string name)
|
|
|
|
|
{
|
|
|
|
|
return McControls.First(x => x.Name == name) as MCRadioButton;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|