add - 自动控制 - 新版

wangsr
wangsr 1 year ago
parent 745a8fdab2
commit 27fad81be8

@ -0,0 +1,76 @@
using DataBlockHelper.DBHelpers;
using DataBlockHelper.Entity.DB2104Entity;
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 DryerWaterControl : ChemicalWeighingAction, IAction
{
private List<Control> McControls; // 获取Query控件
DryerWaterControlsEntity ControlsEntity = new DryerWaterControlsEntity();
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用
McControls = GetAllControls();
ControlImport();
BottomSelect(runtime);
}
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 void BottomSelect(RuntimeParameter runtime)
{
if(ControlsEntity.WaterConfrim == runtime.Sender)
{
WaterEntity HotA = new WaterEntity();
WaterEntity ColdA = new WaterEntity();
WaterEntity HotB = new WaterEntity();
WaterEntity ColdB = new WaterEntity();
HotA.Set = Convert.ToSingle(ControlsEntity.HotValueA.MCValue);
HotA.TolErance = Convert.ToSingle(ControlsEntity.HotToleranceA.MCValue);
HotB.Set = Convert.ToSingle(ControlsEntity.HotValueB.MCValue);
HotB.TolErance = Convert.ToSingle(ControlsEntity.HotToleranceB.MCValue);
ColdA.Set = Convert.ToSingle(ControlsEntity.ColdValueA.MCValue);
ColdA.TolErance = Convert.ToSingle(ControlsEntity.ColdToleranceA.MCValue);
ColdB.Set = Convert.ToSingle(ControlsEntity.ColdValueB.MCValue);
ColdB.TolErance = Convert.ToSingle(ControlsEntity.ColdToleranceB.MCValue);
}
}
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;
}
}
}

@ -0,0 +1,24 @@
using Mesnac.Action.Base;
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.Entity
{
public class DryerWaterControlsEntity
{
public IBaseControl ColdValueA { get; set; }
public IBaseControl ColdValueB { get; set; }
public IBaseControl HotValueA { get; set; }
public IBaseControl HotValueB { get; set; }
public IBaseControl ColdToleranceA { get; set; }
public IBaseControl ColdToleranceB { get; set; }
public IBaseControl HotToleranceA { get; set; }
public IBaseControl HotToleranceB { get; set; }
public Button WaterConfrim { get; set; }
}
}

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mesnac.Action.ChemicalWeighing.AutoControl.Entity
{
public class GelerWeterControlsEntity
{
}
}

@ -0,0 +1,52 @@
using DataBlockHelper.Entity.DB2104Entity;
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
{
internal class GelerWeterControl : ChemicalWeighingAction, IAction
{
List<DbMCControl> McControllist;
private List<Control> McControls; // 获取Query控件
DryerWaterControlsEntity ControlsEntity = new DryerWaterControlsEntity();
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用
McControls = GetAllControls();
ControlImport();
BottomSelect(runtime);
}
private void ControlImport()
{
}
private void BottomSelect(RuntimeParameter runtime)
{
}
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;
}
}
}

@ -631,33 +631,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
public static DryerView GetDryerD3 => GetDryerView(538);
public static DryerView GetDryerD4 => GetDryerView(778);
public static DryerView GetGelatG1 => GetGelatView(1018);
public static DryerView GetGelatG2 => GetGelatView(1158);
public static DryerView GetGelatG3 => GetGelatView(1298);
public static DryerView GetGelatG4 => GetGelatView(1438);
public static DryerView GetGelatG5 => GetGelatView(1578);
public static DryerView GetGelatG6 => GetGelatView(1718);
public static DryerView GetGelatG7 => GetGelatView(1858);
public static DryerView GetGelatG8 => GetGelatView(1998);
public static List<MixStep> GetWeterM1 = GetWeterView(2138);
public static List<MixStep> GetWeterM2 = GetWeterView(2338);
public static List<MixStep> GetWeterM3 = GetWeterView(2538);
public static List<MixStep> GetWeterM4 = GetWeterView(2738);
public static List<MixStep> GetWeterM5 = GetWeterView(2938);
public static List<MixStep> GetWeterM6 = GetWeterView(3138);
public static List<MixStep> GetWeterM7 = GetWeterView(3338);
public static List<MixStep> GetWeterM8 = GetWeterView(3538);

@ -176,9 +176,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\PlugInPlatform\Mesnac.PlugIn.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Interop.Excel">
<HintPath>..\..\Microsoft.Office.Interop.Excel.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
@ -222,6 +219,10 @@
<Compile Include="Alarm\PmtAlarm\InsertAction.cs" />
<Compile Include="Alarm\PmtAlarm\ModifyAction.cs" />
<Compile Include="Alarm\PmtAlarm\SelectAction.cs" />
<Compile Include="AutoControl\DryerWaterControl.cs" />
<Compile Include="AutoControl\Entity\DryerWaterControlsEntity.cs" />
<Compile Include="AutoControl\Entity\GelerWeterControlsEntity.cs" />
<Compile Include="AutoControl\GelerWeterControl.cs" />
<Compile Include="BaseDataHelper.cs" />
<Compile Include="BasePlcHelper.cs" />
<Compile Include="Basic\BasicHelper.cs" />

@ -8,7 +8,7 @@ namespace DataBlockHelper.DBHelpers
private static readonly string DbName = "DB2104";
/// <summary>
/// 写入水 写入集合顺序 A 热水 B热水 冷水A 冷水B
/// 写入水 写入集合顺序 A热水 B热水 冷水A 冷水B
/// </summary>
/// <param name="ls"></param>
public static bool Write(List<WaterEntity> ls)
@ -23,7 +23,7 @@ namespace DataBlockHelper.DBHelpers
return true;
}
/// <summary>
/// A 热水
/// A热水
/// </summary>
/// <param name="entity"></param>
@ -32,7 +32,7 @@ namespace DataBlockHelper.DBHelpers
Write(3578, entity);
}
/// <summary>
/// B热水
/// B热水
/// </summary>
/// <param name="entity"></param>
public static void WriteBHostWater(WaterEntity entity)
@ -40,7 +40,7 @@ namespace DataBlockHelper.DBHelpers
Write(3588, entity);
}
/// <summary>
/// 冷水A
/// 冷水A
/// </summary>
/// <param name="entity"></param>
public static void WriteAColWater(WaterEntity entity)
@ -48,7 +48,7 @@ namespace DataBlockHelper.DBHelpers
Write(3598, entity);
}
/// <summary>
/// 冷水B
/// 冷水B
/// </summary>
/// <param name="entity"></param>
public static void WriteBColWater(WaterEntity entity)

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>
<ActionService>
<Design>
<Path path="自动控制">
<Action action="E66872FC1EEB430A9EE462CCB102A87B">
<Caption>水称干混机控制</Caption>
<Remark>水称干混机控制</Remark>
</Action>
</Path>
</Design>
<DesignToRuntime>
<!--窗体初始化-->
<Design action="E66872FC1EEB430A9EE462CCB102A87B">
<Runtime action="6C980E4993D746979848D94624179632"/>
</Design>
</DesignToRuntime>
<Runtime>
<Import assembly = "Data/Action/ChemicalWeighing/Mesnac.Action.ChemicalWeighing.dll">
<Action action="6C980E4993D746979848D94624179632" class="Mesnac.Action.ChemicalWeighing.AutoControl.DryerWaterControl"/>
</Import>
</Runtime>
</ActionService>

@ -32,11 +32,10 @@
<Node Name="GelBlackPowderCount" Text="湿混机黑粉下料统计" ToolTipText="GelBlackPowderCount" Tag="GelBlackPowderCount" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="AutoControl" Text="自动控制" ToolTipText="AutoControl" Tag="AutoControl" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="AutoControlA" Text="干混机水称自动参数控制" ToolTipText="AutoControlA" Tag="AutoControlA" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="AutoControlB" Text="湿混机糊化机自动参数控制" ToolTipText="AutoControlB" Tag="AutoControlB" ImageIndex="3" SelectedImageIndex="3" />
</Node>
<Node Name="nodeDevice" Text="设备" ToolTipText="" Tag="nodeDevice" ImageIndex="2" SelectedImageIndex="2">
<Node Name="ParametersWithPc" Text="ParametersWithPc" ToolTipText="" Tag="ParametersWithPc" ImageIndex="5" SelectedImageIndex="5" />
<Node Name="AutoControlB" Text="湿混机糊化机自动参数控制总参数" ToolTipText="AutoControlB" Tag="AutoControlB" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="AutoControlC" Text="湿混糊化自动参数控制" ToolTipText="AutoControlC" Tag="AutoControlC" ImageIndex="3" SelectedImageIndex="3" />
</Node>
<Node Name="nodeDevice" Text="设备" ToolTipText="" Tag="nodeDevice" ImageIndex="2" SelectedImageIndex="2" />
<Node Name="nodeDataSource" Text="数据源" ToolTipText="" Tag="nodeDataSource" ImageIndex="6" SelectedImageIndex="6">
<Node Name="DataSource1" Text="DataSource1" ToolTipText="" Tag="DataSource1" ImageIndex="7" SelectedImageIndex="7" />
</Node>

@ -1,9 +1,9 @@
<Object type="Mesnac.Gui.Common.FrmRunTemplate, Mesnac.Gui.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="AutoControlA" children="Controls">
<Object type="System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="GroupBox18" children="Controls">
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="WaterConform" children="Controls">
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="WaterConfrim" children="Controls">
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAAEAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIEU2Njg3MkZDMUVFQjQzMEE5RUU0NjJDQ0IxMDJBODdCBgYAAAAV5rC056ew5bmy5re35py65o6n5Yi2BgcAAAAV5rC056ew5bmy5re35py65o6n5Yi2Cw==</Binary>
</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
@ -11,7 +11,7 @@
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="DbOptionType">Query</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="MCPurview">False</Property>
@ -21,7 +21,7 @@
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">确定</Property>
<Property name="Location">38, 441</Property>
<Property name="Name">WaterConform</Property>
<Property name="Name">WaterConfrim</Property>
<Property name="Size">98, 41</Property>
<Property name="TabIndex">2</Property>
</Object>
@ -40,7 +40,7 @@
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="DbOptionType">Query</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="TextName" />
@ -63,7 +63,7 @@
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="DbOptionType">Query</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="TextName" />
@ -135,7 +135,7 @@
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="DbOptionType">Query</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="TextName" />
@ -158,7 +158,7 @@
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="DbOptionType">Query</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="TextName" />
@ -230,7 +230,7 @@
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="DbOptionType">Query</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="TextName" />
@ -253,7 +253,7 @@
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="DbOptionType">Query</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="TextName" />
@ -325,7 +325,7 @@
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="DbOptionType">Query</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="TextName" />
@ -348,7 +348,7 @@
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="DbOptionType">Query</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="TextName" />
@ -467,7 +467,7 @@
<Property name="BackColor">Control</Property>
<Property name="Size">1718, 547</Property>
<Property name="StartPosition">WindowsDefaultLocation</Property>
<Property name="Text">自动控制A</Property>
<Property name="Text">干混水称参数控制</Property>
<Property name="WindowState">Normal</Property>
<Property name="BackgroundImage" />
<Property name="BackgroundImageLayout">Tile</Property>

@ -5266,7 +5266,7 @@
<Property name="BackColor">Control</Property>
<Property name="Size">1762, 824</Property>
<Property name="StartPosition">WindowsDefaultLocation</Property>
<Property name="Text">自动控制B</Property>
<Property name="Text">湿混糊化总参数</Property>
<Property name="WindowState">Normal</Property>
<Property name="BackgroundImage" />
<Property name="BackgroundImageLayout">Tile</Property>

File diff suppressed because it is too large Load Diff

@ -229,6 +229,9 @@
<SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Data\EventConfig\小料称量\自动控制.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Data\EventConfig\小料称量\设备细节报表.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>

Loading…
Cancel
Save