change - 水称加入初始化读取

wangsr
wangsr 1 year ago
parent dee332a98f
commit 3cc7023fb5

@ -0,0 +1,77 @@
using DataBlockHelper.DBHelpers;
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.AutoControl.Entity;
using Mesnac.Controls.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.AutoControl
{
public class WaterInitAction : ChemicalWeighingAction, IAction
{
DryerWaterControlsEntity ControlsEntity = new DryerWaterControlsEntity();
private List<Control> McControls;
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用
McControls = GetAllControls();
ControlImport();
ControlInitFromPLC();
}
/// <summary>
/// 控件从Plc初始化
/// </summary>
private void ControlInitFromPLC()
{
DB2104Helper dB2104Helper = new DB2104Helper();
ControlsEntity.ColdValueA.MCValue = dB2104Helper.GetAColWater.Set;
ControlsEntity.ColdValueB.MCValue = dB2104Helper.GetBColWater.Set;
ControlsEntity.HotValueA.MCValue = dB2104Helper.GetAHotWater.Set;
ControlsEntity.HotValueB.MCValue = dB2104Helper.GetBHotWater.Set;
ControlsEntity.ColdToleranceA.MCValue = dB2104Helper.GetAColWater.Tolerance;
ControlsEntity.ColdToleranceB.MCValue = dB2104Helper.GetBColWater.Tolerance;
ControlsEntity.HotToleranceA.MCValue = dB2104Helper.GetAHotWater.Tolerance;
ControlsEntity.HotToleranceB.MCValue = dB2104Helper.GetBHotWater.Tolerance;
}
private void ControlImport()
{
ControlsEntity.WaterConfrim = GetButtonControl("WaterConfrim");
ControlsEntity.ColdValueA = GetBaseControl("ColdValueA");
ControlsEntity.ColdValueB = GetBaseControl("ColdValueB");
ControlsEntity.HotValueA = GetBaseControl("HotValueA");
ControlsEntity.HotValueB = GetBaseControl("HotValueB");
ControlsEntity.ColdToleranceA = GetBaseControl("ColdToleranceA");
ControlsEntity.ColdToleranceB = GetBaseControl("ColdToleranceB");
ControlsEntity.HotToleranceA = GetBaseControl("HotToleranceA");
ControlsEntity.HotToleranceB = GetBaseControl("HotToleranceB");
}
private IBaseControl GetBaseControl(string name)
{
return McControls.First(x => x.Name == name) as IBaseControl;
}
private Button GetButtonControl(string name)
{
return McControls.First(x => x.Name == name) as Button;
}
}
}

@ -228,6 +228,7 @@
<Compile Include="AutoControl\GelerWeterControl.cs" />
<Compile Include="AutoControl\InitAction.cs" />
<Compile Include="AutoControl\RefreshAction.cs" />
<Compile Include="AutoControl\WaterInitAction.cs" />
<Compile Include="BaseDataHelper.cs" />
<Compile Include="BasePlcHelper.cs" />
<Compile Include="Basic\BasicHelper.cs" />

@ -11,13 +11,17 @@
<Remark>湿混糊化机控制</Remark>
</Action>
<Action action="8A56C0B7BCE44AE6835221CAA3E1130E">
<Caption>界面初始化</Caption>
<Remark>界面初始化</Remark>
<Caption>湿混糊化界面初始化</Caption>
<Remark>湿混糊化界面初始化</Remark>
</Action>
<Action action="469F4DDEC2994D568465BEAB6F629E29">
<Caption>刷新事件</Caption>
<Remark>刷新事件</Remark>
</Action>
<Action action="4B774D9DDFA342EAA17F57800177E7DA">
<Caption>干混水称界面初始化</Caption>
<Remark>干混水称界面初始化</Remark>
</Action>
</Path>
</Design>
@ -35,6 +39,9 @@
<Design action="469F4DDEC2994D568465BEAB6F629E29">
<Runtime action="469EE6B30E114E31B00113D69F86C036"/>
</Design>
<Design action="4B774D9DDFA342EAA17F57800177E7DA">
<Runtime action="2A5DE8E63DC94DFA882F94080FE43845"/>
</Design>
</DesignToRuntime>
<Runtime>
@ -43,6 +50,7 @@
<Action action="FBB09CEE7C71473B8717C735C1B7E320" class="Mesnac.Action.ChemicalWeighing.AutoControl.GelerWeterControl"/>
<Action action="1B0FD7B35DBC4677B4A791B8224C68DA" class="Mesnac.Action.ChemicalWeighing.AutoControl.InitAction"/>
<Action action="469EE6B30E114E31B00113D69F86C036" class="Mesnac.Action.ChemicalWeighing.AutoControl.RefreshAction"/>
<Action action="2A5DE8E63DC94DFA882F94080FE43845" class="Mesnac.Action.ChemicalWeighing.AutoControl.WaterInitAction"/>
</Import>
</Runtime>
</ActionService>

@ -450,7 +450,7 @@
<Property name="TabIndex">7</Property>
</Object>
<Property name="LoadActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAACAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIDRCNzc0RDlEREZBMzQyRUFBMTdGNTc4MDAxNzdFN0RBBgYAAAAb5bmy5re35rC056ew55WM6Z2i5Yid5aeL5YyWBgcAAAAb5bmy5re35rC056ew55WM6Z2i5Yid5aeL5YyWCw==</Binary>
</Property>
<Property name="ActivatedActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>

Loading…
Cancel
Save