diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs
index a80b826..750f8a1 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs
@@ -3,6 +3,7 @@ using DataBlockHelper.DBHelpers;
using DataBlockHelper.Entity;
using DevExpress.Data.Filtering.Helpers;
+using DevExpress.Office;
using DevExpress.Utils.FormShadow;
using HslCommunication.LogNet;
@@ -169,6 +170,27 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
this.PressureCurve.SetLeftCurve("C_OUT", null, Color.LightGreen);
}
+ bool IsPowerOfTwo(int number, out int exponent)
+ {
+ exponent = 0;
+ if (number < 1)
+ {
+ return false;
+ }
+
+ while (number > 1)
+ {
+ if (number % 2 != 0)
+ {
+ return false;
+ }
+ number /= 2;
+ exponent++;
+ }
+
+ return true;
+ }
+
///
/// Plc数据刷新
///
@@ -704,6 +726,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
PlcTemp.Cabinet12 = bbb[11];
PlcTemp.Cabinet13 = bbb[12];
PlcTemp.Cabinet14 = bbb[13];
+
+
PlcTemp.Cabinet15 = bbb[14];
PlcTemp.Steps1 = new bool[7]
@@ -1023,6 +1047,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
ControlsImprot.SetControlCabinet(CabinetE.Cabinet8, PlcTemp.Cabinet8);
ControlsImprot.SetControlCabinet(CabinetE.Cabinet9, PlcTemp.Cabinet9);
ControlsImprot.SetControlCabinet(CabinetE.Cabinet10, PlcTemp.Cabinet10);
+
ControlsImprot.SetControlCabinet(CabinetE.Cabinet11, PlcTemp.Cabinet11);
ControlsImprot.SetControlCabinet(CabinetE.Cabinet12, PlcTemp.Cabinet12);
ControlsImprot.SetControlCabinet(CabinetE.Cabinet13, PlcTemp.Cabinet13);
@@ -1036,6 +1061,12 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
ControlsImprot.SetMCLabel(LabelE.PFTStatus5, PlcTemp.Status[4], 3);
ControlsImprot.SetMCLabel(LabelE.PFTStatus6, PlcTemp.Status[5], 3);
+
+
+
+
+
+
ControlsImprot.SetMCLabel(LabelE.PFTStepCode1, ControlsHelper.JudgePFTStatus(PlcTemp.Steps1));
ControlsImprot.SetMCLabel(LabelE.PFTStepCode2, ControlsHelper.JudgePFTStatus(PlcTemp.Steps2));
ControlsImprot.SetMCLabel(LabelE.PFTStepCode3, ControlsHelper.JudgePFTStatus(PlcTemp.Steps3));
@@ -1051,6 +1082,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
ControlsImprot.SetMCLabel(LabelE.PFTStepName6, ControlsHelper.ConvertStepName(ControlsHelper.JudgePFTStatus(PlcTemp.Steps6)));
ControlsHelper.SetHslBottle(bottleE.Bottle1, PlcTemp.Bottle1_Set);
+
ControlsHelper.SetHslBottle(bottleE.Bottle2, PlcTemp.Bottle2_Set);
ControlsHelper.SetHslBottle(bottleE.Bottle3, PlcTemp.Bottle3_Set);
ControlsHelper.SetHslBottle(bottleE.Bottle4, PlcTemp.Bottle4_Set);
@@ -1082,8 +1114,45 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
ControlsImprot.SetMCLabel(LabelE.HslBottleValue13, JiSuan(PlcTemp.Bottle13_Set, dic["碳粉7"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue14, JiSuan(PlcTemp.Bottle14_Set, dic["碳粉8"]) + "t");
ControlsImprot.SetMCLabel(LabelE.HslBottleValue15, JiSuan(PlcTemp.Bottle15_Set, dic["回收罐"]) + "t");
+
+
+ Db2101Helper db2101 = new Db2101Helper();
+ var ab = db2101.LinA;
+ LabelE.linAName.Text = destinations[Get(ab.destination)];
+ LabelE.linANum.Text = ab.number.ToString();
+
+ ab = db2101.LinB;
+ LabelE.linBName.Text = destinations[Get(ab.destination)];
+ LabelE.linBNum.Text = ab.number.ToString();
+
+
+ ab = db2101.LinC;
+ LabelE.linCName.Text = destinations[Get(ab.destination)];
+ LabelE.linCNum.Text = ab.number.ToString();
}
-
+
+ string[] destinations = new string[] {
+ "大仓A", "大仓B", "大仓C", "大仓D", "大仓E", "大仓F", "大仓G", "大仓H",
+ "大仓I", "大仓J", "大仓K", "大仓L", "大仓M", "大仓N", "大仓O", "大仓P",
+ "大仓Q", "大仓R", "大仓S", "大仓T", "大仓U", "大仓V", "大仓W", "大仓X",
+ "大仓Y", "大仓Z"
+};
+
+ public int Get(int destination)
+ {
+ int fan = 0;
+ int number = destination; // 你想要检查的数字
+ if (IsPowerOfTwo(number, out int exponent))
+ {
+ fan = exponent;
+
+ Console.WriteLine($"{number} 是 2 的 {exponent} 次方");
+ }
+
+ return fan;
+
+ }
+
public string JiSuan(double x, DaCangValue daCangValue)
{
var bottleValue3 = Math.Round(x * daCangValue.volume * daCangValue.Density, 2)/100;
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/Entity/DeliverEntity.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/Entity/DeliverEntity.cs
index d5522be..16e27b0 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/Entity/DeliverEntity.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/Entity/DeliverEntity.cs
@@ -98,6 +98,22 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver.Entity
public MCLabel HslBottleValue13 { get; set; }
public MCLabel HslBottleValue14 { get; set; }
public MCLabel HslBottleValue15 { get; set; }
+
+
+ public MCLabel linAName { get; set; }
+ public MCLabel linANum { get; set; }
+ public MCLabel linBName { get; set; }
+ public MCLabel linBNum { get; set; }
+ public MCLabel linCName { get; set; }
+ public MCLabel linCNum { get; set; }
+
+
+
+
+
+
+
+
}
internal class LjSwitchEntity
diff --git a/DataBlockHelper/DBHelpers/MReadHelp.cs b/DataBlockHelper/DBHelpers/MReadHelp.cs
index 9562d1d..04890df 100644
--- a/DataBlockHelper/DBHelpers/MReadHelp.cs
+++ b/DataBlockHelper/DBHelpers/MReadHelp.cs
@@ -42,10 +42,12 @@ namespace DataBlockHelper.DBHelpers
p.ReadBool("M2018.0").Content,
p.ReadBool("M2018.1").Content,
- p.ReadBool("M2201.4").Content,
- p.ReadBool("M2201.5").Content,
- p.ReadBool("M2201.6").Content,
- p.ReadBool("M2201.7").Content,
+ p.ReadBool("M2201.0").Content,
+ p.ReadBool("M2201.1").Content,
+ p.ReadBool("M2201.2").Content,
+ p.ReadBool("M2201.3").Content,
+
+ //0
p.ReadBool("M2018.2").Content,
};
diff --git a/Main/MCEdit/Data/MCProject/nodeForm/LjDeliver.xml b/Main/MCEdit/Data/MCProject/nodeForm/LjDeliver.xml
index cec9f0b..95c0a33 100644
--- a/Main/MCEdit/Data/MCProject/nodeForm/LjDeliver.xml
+++ b/Main/MCEdit/Data/MCProject/nodeForm/LjDeliver.xml
@@ -1,6 +1,306 @@