using DataBlockHelper.DBHelpers; using Mesnac.Action.Base; using Mesnac.Action.ChemicalWeighing.LjDeliverPressureSetting.Entity; using Mesnac.Controls.Default; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Mesnac.Action.ChemicalWeighing.LjDeliverPressureSetting { public class InitAction : ChemicalWeighingAction, IAction { DB112Helper DB122 = new DB112Helper(); MCTextboxEntity BoxE = new MCTextboxEntity(); List Controls; public void Run(RuntimeParameter runtime) { base.RunIni(runtime); Controls = GetAllControls(); ControlsHelper.ControlImport(BoxE, Controls); SetValueFromPlc(); } private void SetValueFromPlc() { BoxE.ASetValue1.MCValue = DB122.PressureA.SetValue1; BoxE.ASetValue2.MCValue = DB122.PressureA.SetValue2; BoxE.ASetValue3.MCValue = DB122.PressureA.SetValue3; BoxE.ASetValue4.MCValue = DB122.PressureA.SetValue4; BoxE.ASetValue5.MCValue = DB122.PressureA.SetValue5; BoxE.ASetValue6.MCValue = DB122.PressureA.SetValue6; BoxE.ASetValue7.MCValue = DB122.PressureA.SetValue7; BoxE.ASetValue8.MCValue = DB122.PressureA.SetValue8; BoxE.BSetValue1.MCValue = DB122.PressureB.SetValue1; BoxE.BSetValue2.MCValue = DB122.PressureB.SetValue2; BoxE.BSetValue3.MCValue = DB122.PressureB.SetValue3; BoxE.BSetValue4.MCValue = DB122.PressureB.SetValue4; BoxE.BSetValue5.MCValue = DB122.PressureB.SetValue5; BoxE.BSetValue6.MCValue = DB122.PressureB.SetValue6; BoxE.BSetValue7.MCValue = DB122.PressureB.SetValue7; BoxE.BSetValue8.MCValue = DB122.PressureB.SetValue8; BoxE.CSetValue1.MCValue = DB122.PressureC.SetValue1; BoxE.CSetValue2.MCValue = DB122.PressureC.SetValue2; BoxE.CSetValue3.MCValue = DB122.PressureC.SetValue3; BoxE.CSetValue4.MCValue = DB122.PressureC.SetValue4; BoxE.CSetValue5.MCValue = DB122.PressureC.SetValue5; BoxE.CSetValue6.MCValue = DB122.PressureC.SetValue6; BoxE.CSetValue7.MCValue = DB122.PressureC.SetValue7; BoxE.CSetValue8.MCValue = DB122.PressureC.SetValue8; BoxE.ATimeSetValue1.MCValue = DB122.LineTimeA.SetValue1; BoxE.ATimeSetValue2.MCValue = DB122.LineTimeA.SetValue2; BoxE.BTimeSetValue1.MCValue = DB122.LineTimeB.SetValue1; BoxE.BTimeSetValue2.MCValue = DB122.LineTimeB.SetValue2; BoxE.CTimeSetValue1.MCValue = DB122.LineTimeC.SetValue1; BoxE.CTimeSetValue2.MCValue = DB122.LineTimeC.SetValue2; } } }