线整理好了

dep_deliver
杨威 5 months ago
parent 731bed9ca9
commit 001dbb71a0

@ -30,6 +30,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
internal static void SetTubeColor(SpecialLabelBlue tube, bool valve1, bool valve2)
{
if (null == tube) {
return;
}
if (valve1 && valve2)
{
tube.BackColor = Color.LightGreen;

@ -37,6 +37,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
{
#region 属性
XianManager xian;
PlcTempEntity PlcTemp = new PlcTempEntity();
private Timer timer;
@ -101,7 +103,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
base.RunIni(runtime); //必须调用
Controls = GetAllControls();
xian = new XianManager(Controls);
AlarmMoveText = Controls.FirstOrDefault(x => x != null && x.Name == "AlarmMoveText") as HslMoveText;
PressureCurve = Controls.FirstOrDefault(x => x.Name == "PressureCurve") as HslCurve;
Conveyer = Controls.FirstOrDefault(x => x.Name == "Conveyer") as HslConveyer;
@ -288,21 +290,21 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
if (a.End==true && a.Start==true)
{
if (no == 1)
{
Db2101HelperWriter.WriterLinAStart(false);
Db2101HelperWriter.WriterLinAEnd(false);
}
if (no == 2)
{
Db2101HelperWriter.WriterLinBStart(false);
Db2101HelperWriter.WriterLinBEnd(false);
}
if (no == 3)
{
Db2101HelperWriter.WriterLinCStart(false);
Db2101HelperWriter.WriterLinCEnd(false);
}
//if (no == 1)
//{
// Db2101HelperWriter.WriterLinAStart(false);
// Db2101HelperWriter.WriterLinAEnd(false);
//}
//if (no == 2)
//{
// Db2101HelperWriter.WriterLinBStart(false);
// Db2101HelperWriter.WriterLinBEnd(false);
//}
//if (no == 3)
//{
// Db2101HelperWriter.WriterLinCStart(false);
// Db2101HelperWriter.WriterLinCEnd(false);
//}
SuSong su =FreeDb.FreeSqlUnit.Instance.
Queryable<SuSong>().

@ -48,6 +48,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliverPressureSetting
SetSpeed();
}
private void SetValueFromPlc()
{
BoxE.ASetValue1.MCValue = DB122.PressureA.SetValue1;

@ -773,6 +773,7 @@
<Compile Include="UserManage\UserHelper.cs" />
<Compile Include="Util\ControlsImprot.cs" />
<Compile Include="Util\UserJudge.cs" />
<Compile Include="XianManager.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Alarm\PmtAlarm\FrmInsert.resx">

@ -0,0 +1,137 @@
using DataBlockHelper.DBHelpers;
using Mesnac.Controls.Default;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing
{
public class XianManager
{
List<Control> Controls;
public XianManager(List<Control> c)
{
this.Controls = c;
PropertyInfo[] sourcePropertyInfoList = this.GetType().GetProperties();
foreach (PropertyInfo sourceProperty in sourcePropertyInfoList)
{
string name = sourceProperty.Name;
var pro = Controls.FirstOrDefault(x => x.Name == name) as SpecialLabelBlue;
sourceProperty.SetValue(this, pro);
}
}
public SpecialLabelBlue SpA1 { get; set; }
public SpecialLabelBlue SpAL { get; set; }
public SpecialLabelBlue SpAR { get; set; }
public SpecialLabelBlue SpA1V { get; set; }
public SpecialLabelBlue SpA1VC01 { get; set; }
public SpecialLabelBlue SpA1VC02 { get; set; }
public SpecialLabelBlue SpA1VC16 { get; set; }
public SpecialLabelBlue SpA1HC16 { get; set; }
public SpecialLabelBlue SpA1HC03 { get; set; }
public SpecialLabelBlue SpA1HC05 { get; set; }
public SpecialLabelBlue SpA1HC17 { get; set; }
public SpecialLabelBlue SpA1HC18 { get; set; }
public SpecialLabelBlue SpA1VC1802 { get; set; }
public SpecialLabelBlue SpA1VC1801 { get; set; }
public SpecialLabelBlue SpA1VC202 { get; set; }
public SpecialLabelBlue SpA1VC201 { get; set; }
public SpecialLabelBlue SpA1VC17 { get; set; }
public SpecialLabelBlue SpA1VC05 { get; set; }
public SpecialLabelBlue SpA1VC19 { get; set; }
public SpecialLabelBlue SpA1VC06 { get; set; }
public SpecialLabelBlue SpA1VC1502 { get; set; }
public SpecialLabelBlue SpA1VC15H { get; set; }
public SpecialLabelBlue SpA1VC1501 { get; set; }
public SpecialLabelBlue SpA1VC113 { get; set; }
public SpecialLabelBlue SpA1VC11 { get; set; }
public SpecialLabelBlue SpA1VC04 { get; set; }
public SpecialLabelBlue SpA1VC10 { get; set; }
public SpecialLabelBlue SpA1HC11 { get; set; }
public SpecialLabelBlue SpA1HC12 { get; set; }
public SpecialLabelBlue SpA1VC121 { get; set; }
public SpecialLabelBlue SpA1VC03 { get; set; }
public SpecialLabelBlue SpA1VC122 { get; set; }
public SpecialLabelBlue SpC1HC14 { get; set; }
public SpecialLabelBlue SpC1HC13 { get; set; }
public SpecialLabelBlue SpC1V01 { get; set; }
public SpecialLabelBlue SpC1 { get; set; }
public SpecialLabelBlue SpB1 { get; set; }
public SpecialLabelBlue SL1 { get; set; }
public SpecialLabelBlue SL2 { get; set; }
public SpecialLabelBlue SL3 { get; set; }
public SpecialLabelBlue SL4 { get; set; }
public SpecialLabelBlue SL5 { get; set; }
public SpecialLabelBlue SL6 { get; set; }
public SpecialLabelBlue SL9 { get; set; }
public SpecialLabelBlue SL11 { get; set; }
public SpecialLabelBlue Sp15 { get; set; }
public SpecialLabelBlue Sp16 { get; set; }
public SpecialLabelBlue SL8 { get; set; }
public SpecialLabelBlue SL7 { get; set; }
public SpecialLabelBlue CrossTubeC3 { get; set; }
public SpecialLabelBlue CrossTubeC2 { get; set; }
public SpecialLabelBlue CrossTubeC1 { get; set; }
public SpecialLabelBlue CrossTubeD { get; set; }
public SpecialLabelBlue SpA1HC02 { get; set; }
public SpecialLabelBlue SpA1HC02V { get; set; }
public SpecialLabelBlue SpA1HC02VC09 { get; set; }
public SpecialLabelBlue CrossTubeB { get; set; }
public void Action()
{
DB112Helper DB122 = new DB112Helper();
var xx = DB122.GetXX();
if (xx.A)
{
}
else
{
}
if (xx.B)
{
}
else
{
}
if (xx.C)
{
}
else
{
}
}
public void SetWhite(SpecialLabelBlue special)
{
special.BackColor = Color.White;
}
public void SetLightGreen(SpecialLabelBlue special)
{
special.BackColor = Color.White;
}
}
}

@ -16,7 +16,20 @@ namespace DataBlockHelper.DBHelpers
OperateResult<byte[]> db112 = PlcConnect.Instance.Read("DB112.0.0", 151);
bytes = db112.Content;
}
/// <summary>
/// 这个就是那个产线在运行
/// </summary>
/// <returns></returns>
public XX GetXX()
{
XX x=new XX();
var content = bytes.Skip(0).Take(1).ToArray().First();
x.A=content.GetBit(0);
x.B=content.GetBit(1);
x.C=content.GetBit(2);
return x;
}
public Conveyor PressureA => new Conveyor(2, bytes);
@ -32,6 +45,14 @@ namespace DataBlockHelper.DBHelpers
}
public class XX
{
public bool A { get; set; }
public bool B { get; set; }
public bool C { get; set; }
}
public class Conveyor
{

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