add - 输送前后端连接 准备对点位

dep
wangsr 12 months ago
parent d2a47627bc
commit 3f15104ee0

@ -165,7 +165,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
if (ButtonE.WetManualGel == runtime.Sender)
{
if (MessageBox.Show("请使用手动加料", "请使用手动加料", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
if (MessageBox.Show("请使用手动加料", "请使用手动加料", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
return;
}

@ -2,15 +2,20 @@
using DevExpress.Utils.FormShadow;
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.LjDeliver.Entity;
using Mesnac.Controls.Base;
using Mesnac.Controls.ChemicalWeighing;
using Mesnac.Controls.Default;
using Mesnac.Controls.Feeding;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Timer = System.Windows.Forms.Timer;
namespace Mesnac.Action.ChemicalWeighing.LjDeliver
{
@ -19,6 +24,16 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
List<Control> Controls;
HslBottleEntity bottleE = new HslBottleEntity();
SwitchLightEntity SwitchlightE = new SwitchLightEntity();
JzfEntity JzfE = new JzfEntity();
ThreeWayValveEntity ThreeWayValveE = new ThreeWayValveEntity();
LjSwitchEntity LjSwitchE = new LjSwitchEntity();
RSCREWBIGEntity RSCREWBIGE = new RSCREWBIGEntity();
MCLabelEntity LabelE = new MCLabelEntity();
private Timer timer;
public void Run(RuntimeParameter runtime)
{
@ -26,13 +41,36 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
Controls = GetAllControls();
ControlsHelper.ControlImport<HslBottle>(bottleE, Controls);
SetAllControls();
//wangsr();
timer = new Timer();
timer.Interval = 1000;
timer.Enabled = true;
timer.Tick += GetPlcValue;//添加事件
}
private void SetAllControls()
{
ControlsHelper.ControlImport<HslBottle>(bottleE, Controls);
ControlsHelper.ControlImport<SwitchLight>(SwitchlightE, Controls);
ControlsHelper.ControlImport<Jzf>(JzfE, Controls);
ControlsHelper.ControlImport<ThreeWayValve>(ThreeWayValveE, Controls);
ControlsHelper.ControlImport<LjSwith>(LjSwitchE, Controls);
ControlsHelper.ControlImport<RSCREWBIG>(RSCREWBIGE, Controls);
ControlsHelper.ControlImport<MCLabel>(LabelE, Controls);
}
private void GetPlcValue(object sender, EventArgs e)
{
if (GetAllDbMCControlsByOption(DbOptionTypes.QueryAndModify).Count == 0)
{
timer.Stop();
timer.Dispose();
}
}
@ -61,7 +99,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
//测试程序
/// <summary>
/// 测试程序
/// </summary>
private void wangsr()
{
Random rd = new Random();

@ -1,4 +1,5 @@
using Mesnac.Controls.ChemicalWeighing;
using Mesnac.Controls.Default;
using System;
using System.Collections.Generic;
using System.Linq;
@ -7,7 +8,211 @@ using System.Threading.Tasks;
namespace Mesnac.Action.ChemicalWeighing.LjDeliver.Entity
{
public class HslBottleEntity
internal class MCLabelEntity
{
public MCLabel PR1ASI01 { get; set; }
public MCLabel PR1BSI01 { get; set; }
public MCLabel PR1CSI01 { get; set; }
public MCLabel PR1DSI01 { get; set; }
public MCLabel PR1ESI01 { get; set; }
public MCLabel PR1FSI01 { get; set; }
public MCLabel PR1GSI01 { get; set; }
public MCLabel PR1HSI01 { get; set; }
public MCLabel PR1ISI01 { get; set; }
public MCLabel PR1JSI01 { get; set; }
public MCLabel PR1KSI01 { get; set; }
public MCLabel PR1LSI01 { get; set; }
public MCLabel PR1MSI01 { get; set; }
public MCLabel PR1NSI01 { get; set; }
public MCLabel PR1OSI01 { get; set; }
public MCLabel HR1ASI01 { get; set; }
public MCLabel HR1BSI01 { get; set; }
public MCLabel HR1CSI01 { get; set; }
public MCLabel HR1DSI01 { get; set; }
public MCLabel HR1ESI01 { get; set; }
public MCLabel HR1FSI01 { get; set; }
public MCLabel HR1GSI01 { get; set; }
public MCLabel HR1HSI01 { get; set; }
public MCLabel HR1ISI01 { get; set; }
public MCLabel HR1JSI01 { get; set; }
public MCLabel HR1KSI01 { get; set; }
public MCLabel HR1LSI01 { get; set; }
public MCLabel HR1MSI01 { get; set; }
public MCLabel HR1NSI01 { get; set; }
public MCLabel HR1OSI01 { get; set; }
public MCLabel HR1ASI02 { get; set; }
public MCLabel HR1BSI02 { get; set; }
public MCLabel HR1CSI02 { get; set; }
public MCLabel HR1DSI02 { get; set; }
public MCLabel HR1ESI02 { get; set; }
public MCLabel HR1FSI02 { get; set; }
public MCLabel HR1GSI02 { get; set; }
public MCLabel HR1HSI02 { get; set; }
public MCLabel HR1ISI02 { get; set; }
public MCLabel HR1JSI02 { get; set; }
public MCLabel HR1KSI02 { get; set; }
public MCLabel HR1LSI02 { get; set; }
public MCLabel HR1MSI02 { get; set; }
public MCLabel HR1NSI02 { get; set; }
public MCLabel HR1OSI02 { get; set; }
}
internal class RSCREWBIGEntity
{
public RSCREWBIG DM1ASF01 { get; set; }
public RSCREWBIG DM1BSF01 { get; set; }
public RSCREWBIG DM1CSF01 { get; set; }
public RSCREWBIG DM1DSF01 { get; set; }
public RSCREWBIG DM1ESF01 { get; set; }
public RSCREWBIG DM1FSF01 { get; set; }
public RSCREWBIG DM1GSF01 { get; set; }
public RSCREWBIG DM1HSF01 { get; set; }
public RSCREWBIG DM1ISF01 { get; set; }
public RSCREWBIG DM1JSF01 { get; set; }
public RSCREWBIG DM1KSF01 { get; set; }
public RSCREWBIG DM1LSF01 { get; set; }
public RSCREWBIG DM1MSF01 { get; set; }
public RSCREWBIG DM1NSF01 { get; set; }
public RSCREWBIG DM1OSF01 { get; set; }
}
internal class LjSwitchEntity
{
public LjSwith BU1DBT01 { get; set; }
public LjSwith BU1DBT02 { get; set; }
public LjSwith BU1DBT03 { get; set; }
public LjSwith BU1DBT04 { get; set; }
public LjSwith BU1DBT06 { get; set; }
public LjSwith BU1DBT07 { get; set; }
public LjSwith BU2DBT01 { get; set; }
public LjSwith BU2DBT02 { get; set; }
public LjSwith BU2DBT03 { get; set; }
public LjSwith BU2DBT04 { get; set; }
public LjSwith BU2DBT06 { get; set; }
public LjSwith BU2DBT07 { get; set; }
public LjSwith BU3DBT01 { get; set; }
public LjSwith BU3DBT02 { get; set; }
public LjSwith BU3DBT03 { get; set; }
public LjSwith BU3DBT04 { get; set; }
public LjSwith BU3DBT06 { get; set; }
public LjSwith BU3DBT07 { get; set; }
public LjSwith AS1DBT01 { get; set; }
public LjSwith AS1DBT02 { get; set; }
public LjSwith AS1DBT03 { get; set; }
public LjSwith AS1DBT04 { get; set; }
public LjSwith AS1DBT05 { get; set; }
public LjSwith AS1DBT06 { get; set; }
public LjSwith AS1DBT07 { get; set; }
public LjSwith AS2DBT01 { get; set; }
public LjSwith AS2DBT02 { get; set; }
public LjSwith AS2DBT03 { get; set; }
public LjSwith AS2DBT04 { get; set; }
public LjSwith AS2DBT05 { get; set; }
public LjSwith AS2DBT06 { get; set; }
public LjSwith AS2DBT07 { get; set; }
public LjSwith AS3DBT01 { get; set; }
public LjSwith AS3DBT02 { get; set; }
public LjSwith AS3DBT03 { get; set; }
public LjSwith AS3DBT04 { get; set; }
public LjSwith AS3DBT05 { get; set; }
public LjSwith AS3DBT06 { get; set; }
public LjSwith AS3DBT07 { get; set; }
public LjSwith AS1PCP01 { get; set; }
public LjSwith AS1PCP02 { get; set; }
public LjSwith AS1PCP03 { get; set; }
public LjSwith AS1ASI01 { get; set; }
public LjSwith AS1BSI01 { get; set; }
public LjSwith AS1CSI01 { get; set; }
public LjSwith AS1DSI01 { get; set; }
public LjSwith AS1ESI01 { get; set; }
public LjSwith AS1FSI01 { get; set; }
public LjSwith AS1GSI01 { get; set; }
public LjSwith AS1HSI01 { get; set; }
public LjSwith AS1ISI01 { get; set; }
public LjSwith AS1JSI01 { get; set; }
public LjSwith AS1KSI01 { get; set; }
public LjSwith AS1LSI01 { get; set; }
public LjSwith AS1MSI01 { get; set; }
public LjSwith AS1NSI01 { get; set; }
public LjSwith AS1OSI01 { get; set; }
}
internal class ThreeWayValveEntity
{
public ThreeWayValve DV1PCP01 { get; set; }
public ThreeWayValve DV1PCP02 { get; set; }
public ThreeWayValve DV1PCP03 { get; set; }
public ThreeWayValve DV1PCP04 { get; set; }
public ThreeWayValve DV1PCP05 { get; set; }
public ThreeWayValve DV1PCP06 { get; set; }
public ThreeWayValve DV1PCP07 { get; set; }
public ThreeWayValve DV1PCP08 { get; set; }
public ThreeWayValve DV1PCP09 { get; set; }
public ThreeWayValve DV1PCP10 { get; set; }
public ThreeWayValve DV1PCP11 { get; set; }
public ThreeWayValve DV1PCP12 { get; set; }
public ThreeWayValve DV1PCP13 { get; set; }
public ThreeWayValve DV1PCP14 { get; set; }
public ThreeWayValve DV1PCP15 { get; set; }
public ThreeWayValve DV1PCP16 { get; set; }
public ThreeWayValve DV1PCP17 { get; set; }
public ThreeWayValve DV1PCP18 { get; set; }
public ThreeWayValve DV1PCP19 { get; set; }
public ThreeWayValve DV1PCP20 { get; set; }
}
internal class JzfEntity
{
public MCLabel SPV1DBT01 { get; set; }
public MCLabel SPV1DBT02 { get; set; }
public MCLabel SPV2DBT01 { get; set; }
public MCLabel SPV2DBT02 { get; set; }
public MCLabel SPV3DBT01 { get; set; }
public MCLabel SPV3DBT02 { get; set; }
}
internal class SwitchLightEntity
{
public SwitchLight HSiloA { get; set; }
public SwitchLight HSiloB { get; set; }
public SwitchLight HSiloC { get; set; }
public SwitchLight HSiloD { get; set; }
public SwitchLight HSiloE { get; set; }
public SwitchLight HSiloF { get; set; }
public SwitchLight HSiloG { get; set; }
public SwitchLight HSiloH { get; set; }
public SwitchLight HSiloI { get; set; }
public SwitchLight HSiloJ { get; set; }
public SwitchLight HSiloK { get; set; }
public SwitchLight HSiloL { get; set; }
public SwitchLight HSiloM { get; set; }
public SwitchLight HSiloN { get; set; }
public SwitchLight HSiloO { get; set; }
public SwitchLight LSiloA { get; set; }
public SwitchLight LSiloB { get; set; }
public SwitchLight LSiloC { get; set; }
public SwitchLight LSiloD { get; set; }
public SwitchLight LSiloE { get; set; }
public SwitchLight LSiloF { get; set; }
public SwitchLight LSiloG { get; set; }
public SwitchLight LSiloH { get; set; }
public SwitchLight LSiloI { get; set; }
public SwitchLight LSiloJ { get; set; }
public SwitchLight LSiloK { get; set; }
public SwitchLight LSiloL { get; set; }
public SwitchLight LSiloM { get; set; }
public SwitchLight LSiloN { get; set; }
public SwitchLight LSiloO { get; set; }
public SwitchLight Atank1 { get; set; }
public SwitchLight Atank2 { get; set; }
public SwitchLight Atank3 { get; set; }
public SwitchLight Atank4 { get; set; }
public SwitchLight Atank5 { get; set; }
public SwitchLight Atank6 { get; set; }
}
internal class HslBottleEntity
{
public HslBottle Bottle1 { get; set; }
public HslBottle Bottle2 { get; set; }

@ -1455,7 +1455,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
#region 下发请求
if(DownloadRequest == runtime.Sender)
if (DownloadRequest == runtime.Sender)
{
bool mixok1 = PlcConnect.Instance.ReadBool("DB3000.0.0").Content;
Time(1, mixok1 ? 1 : 0);

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save