From df8ed104072de8a904786442dc87af152328013a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=84=E5=A4=B4?= Date: Thu, 20 Jun 2024 08:44:31 +0800 Subject: [PATCH] fab --- .../AutoControl/PlcAutoWriteHelper.cs | 94 +------------------ .../LjPlanning/LjPlanningPlcHelp.cs | 34 +++---- Main/MCEdit/Data/MCProject/nodeDataSource.xml | 2 +- 3 files changed, 20 insertions(+), 110 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs index b79b71f..1abb7a8 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs @@ -301,69 +301,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl MessageBox.Show("数据下传成功!"); } - private static bool GWComparePLC(List recipes, List steps, List mixSteps, MCRadioButtonEntity RadioE) - { - var getGelatG1 = LjPlanningPlcHelp.GetGelatG1; - var getWeterM1 = LjPlanningPlcHelp.GetWeterM1; - var getGelatG2 = LjPlanningPlcHelp.GetGelatG2; - var getWeterM2 = LjPlanningPlcHelp.GetWeterM2; - var getGelatG3 = LjPlanningPlcHelp.GetGelatG3; - var getWeterM3 = LjPlanningPlcHelp.GetWeterM3; - var getGelatG4 = LjPlanningPlcHelp.GetGelatG4; - var getWeterM4 = LjPlanningPlcHelp.GetWeterM4; - var getGelatG5 = LjPlanningPlcHelp.GetGelatG5; - var getWeterM5 = LjPlanningPlcHelp.GetWeterM5; - var getGelatG6 = LjPlanningPlcHelp.GetGelatG6; - var getWeterM6 = LjPlanningPlcHelp.GetWeterM6; - var getGelatG7 = LjPlanningPlcHelp.GetGelatG7; - var getWeterM7 = LjPlanningPlcHelp.GetWeterM7; - var getGelatG8 = LjPlanningPlcHelp.GetGelatG8; - var getWeterM8 = LjPlanningPlcHelp.GetWeterM8; - - string j1 = ControlsHelper.JsonSerialize(recipes); - string j2 = ControlsHelper.JsonSerialize(steps); - string j3 = ControlsHelper.JsonSerialize(mixSteps); - - switch (ControlsHelper.SingleSelect(RadioE)) - { - case 1: - return j1 == ControlsHelper.JsonSerialize(getGelatG1.RecipePlcViews) - && j2 == ControlsHelper.JsonSerialize(getGelatG1.RecipeSteps) - && j3 == ControlsHelper.JsonSerialize(getWeterM1); - case 2: - return j1 == ControlsHelper.JsonSerialize(getGelatG2.RecipePlcViews) - && j2 == ControlsHelper.JsonSerialize(getGelatG2.RecipeSteps) - && j3 == ControlsHelper.JsonSerialize(getWeterM2); - case 3: - return j1 == ControlsHelper.JsonSerialize(getGelatG3.RecipePlcViews) - && j2 == ControlsHelper.JsonSerialize(getGelatG3.RecipeSteps) - && j3 == ControlsHelper.JsonSerialize(getWeterM3); - case 4: - return j1 == ControlsHelper.JsonSerialize(getGelatG4.RecipePlcViews) - && j2 == ControlsHelper.JsonSerialize(getGelatG4.RecipeSteps) - && j3 == ControlsHelper.JsonSerialize(getWeterM4); - case 5: - return j1 == ControlsHelper.JsonSerialize(getGelatG5.RecipePlcViews) - && j2 == ControlsHelper.JsonSerialize(getGelatG5.RecipeSteps) - && j3 == ControlsHelper.JsonSerialize(getWeterM5); - case 6: - return j1 == ControlsHelper.JsonSerialize(getGelatG6.RecipePlcViews) - && j2 == ControlsHelper.JsonSerialize(getGelatG6.RecipeSteps) - && j3 == ControlsHelper.JsonSerialize(getWeterM6); - case 7: - return j1 == ControlsHelper.JsonSerialize(getGelatG7.RecipePlcViews) - && j2 == ControlsHelper.JsonSerialize(getGelatG7.RecipeSteps) - && j3 == ControlsHelper.JsonSerialize(getWeterM7); - case 8: - return j1 == ControlsHelper.JsonSerialize(getGelatG8.RecipePlcViews) - && j2 == ControlsHelper.JsonSerialize(getGelatG8.RecipeSteps) - && j3 == ControlsHelper.JsonSerialize(getWeterM8); - default: - MessageBox.Show("未选择产线!"); - return true; - } - - } + #endregion @@ -493,35 +431,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl } - private static bool DYComparePLC(List recipes, List steps, MCRadioButtonEntity RadioE) - { - var getDryerD1 = LjPlanningPlcHelp.GetDryerD1; - var getDryerD2 = LjPlanningPlcHelp.GetDryerD2; - var getDryerD3 = LjPlanningPlcHelp.GetDryerD3; - var getDryerD4 = LjPlanningPlcHelp.GetDryerD4; - - string j1 = ControlsHelper.JsonSerialize(recipes); - string j2 = ControlsHelper.JsonSerialize(steps); - - switch (ControlsHelper.DrySelect(RadioE)) - { - case 1: - return j1 == ControlsHelper.JsonSerialize(getDryerD1.RecipePlcViews) - && j2 == ControlsHelper.JsonSerialize(getDryerD1.RecipeSteps); - case 2: - return j1 == ControlsHelper.JsonSerialize(getDryerD2.RecipePlcViews) - && j2 == ControlsHelper.JsonSerialize(getDryerD2.RecipeSteps); - case 3: - return j1 == ControlsHelper.JsonSerialize(getDryerD3.RecipePlcViews) - && j2 == ControlsHelper.JsonSerialize(getDryerD3.RecipeSteps); - case 4: - return j1 == ControlsHelper.JsonSerialize(getDryerD4.RecipePlcViews) - && j2 == ControlsHelper.JsonSerialize(getDryerD4.RecipeSteps); - default: - MessageBox.Show("未选择产线!"); - return true; - } - } + #endregion diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/LjPlanningPlcHelp.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/LjPlanningPlcHelp.cs index 6089112..ac913aa 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/LjPlanningPlcHelp.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/LjPlanningPlcHelp.cs @@ -44,7 +44,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning { recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); - int begin = 58; + int begin = 128; DownCleanD1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { @@ -54,7 +54,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning } - begin = 178; + begin = 278; for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; @@ -72,7 +72,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownD2Recipe(List recipePlcViews, List recipeSteps) { recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); - int begin = 298; + int begin = 398; DownCleanD1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { @@ -82,7 +82,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning } - begin = 418; + begin = 548; for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; @@ -99,7 +99,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownD3Recipe(List recipePlcViews, List recipeSteps) { recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); - int begin = 538; + int begin = 668; DownCleanD1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { @@ -109,7 +109,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning } - begin = 658; + begin = 818; for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; @@ -124,7 +124,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownD4Recipe(List recipePlcViews, List recipeSteps) { recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); - int begin = 778; + int begin = 938; DownCleanD1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { @@ -134,7 +134,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning } - begin = 898; + begin = 1088; for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; @@ -610,7 +610,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning } private static void DownCleanD1Recipe(int begin) { - List recipePlcViews = GetClean(12); + List recipePlcViews = GetClean(15); List recipeSteps = GetCleanStep(10); for (int i = 0; i < recipePlcViews.Count(); i++) @@ -619,7 +619,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning Dowd(begin, view); begin += 10; } - + for (int i = 0; i < recipeSteps.Count(); i++) { @@ -674,26 +674,26 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning private static void Dowd(int start, RecipePlcView view) { int bin = start; - PlcConnect.Instance.Write($"DB2104.{bin}.0", view.Bin); + PlcConnect.Instance.Write($"DB2108.{bin}.0", view.Bin); int set = start + 2; - PlcConnect.Instance.Write($"DB2104.{set}.0", view.Set); + PlcConnect.Instance.Write($"DB2108.{set}.0", view.Set); int tolerance = start + 6; - PlcConnect.Instance.Write($"DB2104.{tolerance}.0", view.Tolerance); + PlcConnect.Instance.Write($"DB2108.{tolerance}.0", view.Tolerance); } private static void DowSteps(int start, Step step) { int mixCode = start; - var info= PlcConnect.Instance.Write($"DB2104.{mixCode}.0", step.MixCode); + var info= PlcConnect.Instance.Write($"DB2108.{mixCode}.0", step.MixCode); int mixTime = start + 2; - PlcConnect.Instance.Write($"DB2104.{mixTime}.0", step.MixTime); + PlcConnect.Instance.Write($"DB2108.{mixTime}.0", step.MixTime); int mixTemp = start + 4; - PlcConnect.Instance.Write($"DB2104.{mixTemp}.0", step.MixTemp); + PlcConnect.Instance.Write($"DB2108.{mixTemp}.0", step.MixTemp); int mixSpeed = start + 8; - PlcConnect.Instance.Write($"DB2104.{mixSpeed}.0", step.MixSpeed); + PlcConnect.Instance.Write($"DB2108.{mixSpeed}.0", step.MixSpeed); } diff --git a/Main/MCEdit/Data/MCProject/nodeDataSource.xml b/Main/MCEdit/Data/MCProject/nodeDataSource.xml index 224ba3d..a90b1d2 100644 --- a/Main/MCEdit/Data/MCProject/nodeDataSource.xml +++ b/Main/MCEdit/Data/MCProject/nodeDataSource.xml @@ -1,3 +1,3 @@ - + \ No newline at end of file