From 2e94fb7cb205148f401f2b6f2364604437d51f1c Mon Sep 17 00:00:00 2001 From: nodyang Date: Fri, 27 Oct 2023 13:42:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D-1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LjPlanning/LjPlanningPlcHelp.cs | 184 +++++++++--------- 1 file changed, 95 insertions(+), 89 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/LjPlanningPlcHelp.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/LjPlanningPlcHelp.cs index 99403f2..37ae21c 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/LjPlanningPlcHelp.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/LjPlanningPlcHelp.cs @@ -38,10 +38,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning /// /// public static void DownD1Recipe(List recipePlcViews, List recipeSteps) - { - + { + + recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); int begin = 58; - //DownCleanD1Recipe(begin); + DownCleanD1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; @@ -67,9 +68,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownD2Recipe(List recipePlcViews, List recipeSteps) { - + recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); int begin = 298; - //DownCleanD1Recipe(begin); + DownCleanD1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; @@ -94,9 +95,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownD3Recipe(List recipePlcViews, List recipeSteps) { - + recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); int begin = 538; - //DownCleanD1Recipe(begin); + DownCleanD1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; @@ -119,8 +120,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownD4Recipe(List recipePlcViews, List recipeSteps) { + recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); int begin = 778; - //DownCleanD1Recipe(begin); + DownCleanD1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; @@ -147,9 +149,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownG1Recipe(List recipePlcViews,List recipeSteps) { - + recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); int begin = 1018; - //DownCleanG1Recipe(begin); + DownCleanG1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; @@ -172,8 +174,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownG2Recipe(List recipePlcViews, List recipeSteps) { + recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); int begin = 1158; - //DownCleanG1Recipe(begin); + DownCleanG1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; @@ -198,8 +201,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning } public static void DownG3Recipe(List recipePlcViews, List recipeSteps) { + recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); int begin = 1298; - //DownCleanG1Recipe(begin); + DownCleanG1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; @@ -223,8 +227,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning } public static void DownG4Recipe(List recipePlcViews, List recipeSteps) { + recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); int begin = 1438; - //DownCleanG1Recipe(begin); + DownCleanG1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; @@ -249,8 +254,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownG5Recipe(List recipePlcViews, List recipeSteps) { + recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); int begin = 1578; - //DownCleanG1Recipe(begin); + DownCleanG1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; @@ -274,9 +280,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning } public static void DownG6Recipe(List recipePlcViews, List recipeSteps) { - + recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); int begin =1718; - //DownCleanG1Recipe(begin); + DownCleanG1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; @@ -301,9 +307,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning } public static void DownG7Recipe(List recipePlcViews, List recipeSteps) { - + recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); int begin =1858; - //DownCleanG1Recipe(begin); + DownCleanG1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; @@ -328,9 +334,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownG8Recipe(List recipePlcViews, List recipeSteps) { - + recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); int begin =1998; - //DownCleanG1Recipe(begin); + DownCleanG1Recipe(begin); for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; @@ -355,7 +361,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning { int begin = 2138; - //DownM1CleanRecipe(begin); + DownM1CleanRecipe(begin); for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; @@ -373,7 +379,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownM2Recipe(List recipeSteps) { int begin = 2338; - //DownM1CleanRecipe(begin); + DownM1CleanRecipe(begin); for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; @@ -387,7 +393,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownM3Recipe(List recipeSteps) { int begin = 2538; - //DownM1CleanRecipe(begin); + DownM1CleanRecipe(begin); for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; @@ -401,7 +407,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownM4Recipe(List recipeSteps) { int begin = 2738; - //DownM1CleanRecipe(begin); + DownM1CleanRecipe(begin); for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; @@ -415,7 +421,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownM5Recipe(List recipeSteps) { int begin = 2938; - //DownM1CleanRecipe(begin); + DownM1CleanRecipe(begin); for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; @@ -429,7 +435,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownM6Recipe(List recipeSteps) { int begin = 3138; - //DownM1CleanRecipe(begin); + DownM1CleanRecipe(begin); for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; @@ -442,7 +448,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownM7Recipe(List recipeSteps) { int begin = 3338; - //DownM1CleanRecipe(begin); + DownM1CleanRecipe(begin); for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; @@ -455,7 +461,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning public static void DownM8Recipe(List recipeSteps) { int begin = 3538; - //DownM1CleanRecipe(begin); + DownM1CleanRecipe(begin); for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; @@ -599,67 +605,67 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning return lsSteps; } - // private static void DownCleanD1Recipe(int begin) - // { - // List recipePlcViews = GetClean(12); - // List recipeSteps = GetCleanStep(10); - // - // for (int i = 0; i < recipePlcViews.Count(); i++) - // { - // var view = recipePlcViews[i]; - // Dowd(begin, view); - // begin += 10; - // } - // - // begin += 120; - // for (int i = 0; i < recipeSteps.Count(); i++) - // { - // var view = recipeSteps[i]; - // DowSteps(begin, view); - // begin += 12; - // - // } - // - // } - - // private static void DownCleanG1Recipe(int begin) - // { - // List recipePlcViews = GetClean(2); - // List recipeSteps = GetCleanStep(10); - // - // for (int i = 0; i < recipePlcViews.Count(); i++) - // { - // var view = recipePlcViews[i]; - // Dowd(begin, view); - // begin += 10; - // } - // - // begin += 20; - // for (int i = 0; i < recipeSteps.Count(); i++) - // { - // var view = recipeSteps[i]; - // DowSteps(begin, view); - // begin += 12; - // - // } - // - // } - - - // private static void DownM1CleanRecipe(int begin) - // { - // - // List recipeSteps = GetCleanMixStep(10); - // - // for (int i = 0; i < recipeSteps.Count(); i++) - // { - // var view = recipeSteps[i]; - // DowMSteps(begin, view); - // begin += 20; - // - // } - // - // } + private static void DownCleanD1Recipe(int begin) + { + List recipePlcViews = GetClean(12); + List recipeSteps = GetCleanStep(10); + + for (int i = 0; i < recipePlcViews.Count(); i++) + { + var view = recipePlcViews[i]; + Dowd(begin, view); + begin += 10; + } + + begin += 120; + for (int i = 0; i < recipeSteps.Count(); i++) + { + var view = recipeSteps[i]; + DowSteps(begin, view); + begin += 12; + + } + + } + + private static void DownCleanG1Recipe(int begin) + { + List recipePlcViews = GetClean(2); + List recipeSteps = GetCleanStep(10); + + for (int i = 0; i < recipePlcViews.Count(); i++) + { + var view = recipePlcViews[i]; + Dowd(begin, view); + begin += 10; + } + + begin += 20; + for (int i = 0; i < recipeSteps.Count(); i++) + { + var view = recipeSteps[i]; + DowSteps(begin, view); + begin += 12; + + } + + } + + + private static void DownM1CleanRecipe(int begin) + { + + List recipeSteps = GetCleanMixStep(10); + + for (int i = 0; i < recipeSteps.Count(); i++) + { + var view = recipeSteps[i]; + DowMSteps(begin, view); + begin += 20; + + } + + } private static void Dowd(int start, RecipePlcView view)