diff --git a/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs b/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs index 673d005d..59146c30 100644 --- a/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs +++ b/BPASmartClient.Model/柔性味魔方/RawMaterialModel.cs @@ -114,9 +114,9 @@ namespace BPASmartClient.Model set { _mRecipeStatus = value; - if (value == 1 && Status != Status.配料完成) Status = Status.等待配料; - else if (value == 2) Status = Status.正在配料; - else if (value == 3) Status = Status.配料完成; + //if (value == 1 && Status != Status.配料完成) Status = Status.等待配料; + //else if (value == 2) Status = Status.正在配料; + //else if (value == 3) Status = Status.配料完成; OnPropertyChanged(); } } diff --git a/DosingSystem/Model/DeviceInquire.cs b/DosingSystem/Model/DeviceInquire.cs index a87d365e..47ff40d9 100644 --- a/DosingSystem/Model/DeviceInquire.cs +++ b/DosingSystem/Model/DeviceInquire.cs @@ -401,12 +401,11 @@ namespace BPASmartClient.DosingSystem public void StatusReset() { - // prop1: + // prop1: this.modbusTcp.Write(DeviceAddress.FinfishStatus.ToAdd(), (ushort)1); + //MessageNotify.GetInstance.ShowRunLog($"料仓复位,值:{1}"); //var value = this.modbusTcp.Read(DeviceAddress.FinfishStatus.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; //if (value != null && value.ToString() != 1.ToString()) goto prop1; - //MessageNotify.GetInstance.ShowRunLog($"料仓复位,值:{this.modbusTcp.Read(DeviceAddress.FinfishStatus.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content}"); - } public void Dispose() @@ -421,67 +420,112 @@ namespace BPASmartClient.DosingSystem var res = Json.Data.deviceParModels.FirstOrDefault(p => p.MaterialName == DeviceName); if (res != null) { + //modbusTcp.Write(DeviceAddress.SlowlyAddWeight.ToAdd(), res.SlowlyAddWeight); + + //modbusTcp.Write(DeviceAddress.PreCloseValveWeight.ToAdd(), res.PreCloseValveWeight); + //modbusTcp.Write(DeviceAddress.RapidAcceleration.ToAdd(), (uint)res.RapidAcceleration); + //modbusTcp.Write(DeviceAddress.SlowAcceleration.ToAdd(), (uint)res.SlowAcceleration); + //modbusTcp.Write(DeviceAddress.ServoManualSpeed.ToAdd(), (uint)res.ServoManualSpeed); + //modbusTcp.Write(DeviceAddress.SiloUpperLimitWeight.ToAdd(), (uint)res.SiloUpperLimitWeight); + //modbusTcp.Write(DeviceAddress.LowerLimitWeightOfSilo.ToAdd(), (uint)res.LowerLimitWeightOfSilo); + //modbusTcp.Write(DeviceAddress.StirringSpeed.ToAdd(), (uint)res.StirringSpeed); + + //MessageNotify.GetInstance.ShowRunLog($"{res.MaterialName},配料参数下发完成"); + + prop1: modbusTcp.Write(DeviceAddress.SlowlyAddWeight.ToAdd(), res.SlowlyAddWeight); - + MessageNotify.GetInstance.ShowRunLog($"{DeviceName},设置慢加重量:{res.SlowlyAddWeight}"); + var value1 = modbusTcp.Read(DeviceAddress.SlowlyAddWeight.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; + if (value1 != null && value1.ToString() != res.SlowlyAddWeight.ToString()) goto prop1; + prop2: modbusTcp.Write(DeviceAddress.PreCloseValveWeight.ToAdd(), res.PreCloseValveWeight); + MessageNotify.GetInstance.ShowRunLog($"{DeviceName},设置提前关阀重量:{res.PreCloseValveWeight}"); + var value2 = modbusTcp.Read(DeviceAddress.PreCloseValveWeight.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; + if (value2 != null && value2.ToString() != res.PreCloseValveWeight.ToString()) goto prop2; + prop3: modbusTcp.Write(DeviceAddress.RapidAcceleration.ToAdd(), (uint)res.RapidAcceleration); + MessageNotify.GetInstance.ShowRunLog($"{DeviceName},设置快加速度:{res.RapidAcceleration}"); + var value3 = modbusTcp.Read(DeviceAddress.RapidAcceleration.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; + if (value3 != null && value3.ToString() != res.RapidAcceleration.ToString()) goto prop3; + prop4: modbusTcp.Write(DeviceAddress.SlowAcceleration.ToAdd(), (uint)res.SlowAcceleration); + MessageNotify.GetInstance.ShowRunLog($"{DeviceName},设置慢加速度:{res.SlowAcceleration}"); + var value4 = modbusTcp.Read(DeviceAddress.SlowAcceleration.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; + if (value4 != null && value4.ToString() != res.SlowAcceleration.ToString()) goto prop4; + prop5: modbusTcp.Write(DeviceAddress.ServoManualSpeed.ToAdd(), (uint)res.ServoManualSpeed); + MessageNotify.GetInstance.ShowRunLog($"{DeviceName},设置伺服手动速度:{res.ServoManualSpeed}"); + var value5 = modbusTcp.Read(DeviceAddress.ServoManualSpeed.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; + if (value5 != null && value5.ToString() != res.ServoManualSpeed.ToString()) goto prop5; + + prop6: modbusTcp.Write(DeviceAddress.SiloUpperLimitWeight.ToAdd(), (uint)res.SiloUpperLimitWeight); + MessageNotify.GetInstance.ShowRunLog($"{DeviceName},设置料仓上限重量:{res.SiloUpperLimitWeight}"); + var value6 = modbusTcp.Read(DeviceAddress.SiloUpperLimitWeight.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; + if (value6 != null && value6.ToString() != res.SiloUpperLimitWeight.ToString()) goto prop6; + prop7: modbusTcp.Write(DeviceAddress.LowerLimitWeightOfSilo.ToAdd(), (uint)res.LowerLimitWeightOfSilo); + MessageNotify.GetInstance.ShowRunLog($"{DeviceName},设置料仓下限重量:{res.LowerLimitWeightOfSilo}"); + var value7 = modbusTcp.Read(DeviceAddress.LowerLimitWeightOfSilo.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; + if ((value7 != null && value7.ToString() != res.LowerLimitWeightOfSilo.ToString())) goto prop7; + prop8: modbusTcp.Write(DeviceAddress.StirringSpeed.ToAdd(), (uint)res.StirringSpeed); - // MessageNotify.GetInstance.ShowRunLog($"当前下发重量:{res.SlowlyAddWeight}:{modbusTcp.Read(DeviceAddress.SlowlyAddWeight.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content}"); + MessageNotify.GetInstance.ShowRunLog($"{DeviceName},设置搅拌速度:{res.StirringSpeed}"); + var value8 = modbusTcp.Read(DeviceAddress.StirringSpeed.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; + if (value8 != null && value8.ToString() != res.StirringSpeed.ToString()) goto prop8; MessageNotify.GetInstance.ShowRunLog($"{res.MaterialName},配料参数下发完成"); - - //prop1: - // modbusTcp.Write(DeviceAddress.SlowlyAddWeight.ToAdd(), res.SlowlyAddWeight); - // var value1 = modbusTcp.Read(DeviceAddress.SlowlyAddWeight.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; - // if (value1 != null && value1.ToString() != res.SlowlyAddWeight.ToString()) goto prop1; - // prop2: - // modbusTcp.Write(DeviceAddress.PreCloseValveWeight.ToAdd(), res.PreCloseValveWeight); - // var value2 = modbusTcp.Read(DeviceAddress.PreCloseValveWeight.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; - // if (value2 != null && value2.ToString() != res.PreCloseValveWeight.ToString()) goto prop2; - // prop3: - // modbusTcp.Write(DeviceAddress.RapidAcceleration.ToAdd(), (uint)res.RapidAcceleration); - // var value3 = modbusTcp.Read(DeviceAddress.RapidAcceleration.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; - // if (value3 != null && value3.ToString() != res.RapidAcceleration.ToString()) goto prop3; - // prop4: - // modbusTcp.Write(DeviceAddress.SlowAcceleration.ToAdd(), (uint)res.SlowAcceleration); - // var value4 = modbusTcp.Read(DeviceAddress.SlowAcceleration.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; - // if (value4 != null && value4.ToString() != res.SlowAcceleration.ToString()) goto prop4; - // prop5: - // modbusTcp.Write(DeviceAddress.ServoManualSpeed.ToAdd(), (uint)res.ServoManualSpeed); - // var value5 = modbusTcp.Read(DeviceAddress.ServoManualSpeed.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; - // if (value5 != null && value5.ToString() != res.ServoManualSpeed.ToString()) goto prop5; - - // prop6: - // modbusTcp.Write(DeviceAddress.SiloUpperLimitWeight.ToAdd(), (uint)res.SiloUpperLimitWeight); - // var value6 = modbusTcp.Read(DeviceAddress.SiloUpperLimitWeight.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; - // if (value6 != null && value6.ToString() != res.SiloUpperLimitWeight.ToString()) goto prop6; - // prop7: - // modbusTcp.Write(DeviceAddress.LowerLimitWeightOfSilo.ToAdd(), (uint)res.LowerLimitWeightOfSilo); - // var value7 = modbusTcp.Read(DeviceAddress.LowerLimitWeightOfSilo.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; - // if ((value7 != null && value7.ToString() != res.LowerLimitWeightOfSilo.ToString())) goto prop7; - // prop8: - // modbusTcp.Write(DeviceAddress.StirringSpeed.ToAdd(), (uint)res.StirringSpeed); - // var value8 = modbusTcp.Read(DeviceAddress.StirringSpeed.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; - // if (value8 != null && value8.ToString() != res.StirringSpeed.ToString()) goto prop8; - // MessageNotify.GetInstance.ShowRunLog($"{res.MaterialName},配料参数下发完成"); } prop9: - //modbusTcp.Write(DeviceAddress.WeightSet.ToAdd(), Value);//写入配方重量 - //var value9 = modbusTcp.Read(DeviceAddress.WeightSet.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; - //if ((value9 != null && value9.ToString() != Value.ToString()) || value9 == 0) goto prop9; + modbusTcp.Write(DeviceAddress.WeightSet.ToAdd(), Value);//写入配方重量 + MessageNotify.GetInstance.ShowRunLog($"{DeviceName},设置重量:{Value}"); + + var value9 = modbusTcp.Read(DeviceAddress.WeightSet.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; + if ((value9 != null && value9.ToString() != Value.ToString()) || value9 == 0) goto prop9; //prop10: //MessageNotify.GetInstance.ShowRunLog($"写入配方重量,值{Value}:{value9}"); //modbusTcp.Write(DeviceAddress.Start.ToAdd(), (ushort)1);//设备启动写入 //var value10 = modbusTcp.Read(DeviceAddress.Start.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; //if ((value10 != null && value10.ToString() != 1.ToString())||value10==0) goto prop10; - modbusTcp.Write(DeviceAddress.WeightSet.ToAdd(), Value);//写入配方重量 + //modbusTcp.Write(DeviceAddress.WeightSet.ToAdd(), Value);//写入配方重量 modbusTcp.Write(DeviceAddress.Start.ToAdd(), (ushort)1);//设备启动写入 - MessageNotify.GetInstance.ShowRunLog($"设备启动写入,值1:{Value}"); + Task.Run(() => + { + while (true) + { + ushort c = modbusTcp.Read(DeviceAddress.DeviceAlarmCode.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content; + MessageNotify.GetInstance.ShowRunLog($"{IpAddress}:LW51,值:{modbusTcp.Read(DeviceAddress.DeviceAlarmCode.ToAdd(), 1, BPA.Helper.DataFormat.CDAB).Content}"); + string str = DecToBinary(c); + if (str[8].ToString() == 0.ToString()) + { + modbusTcp.Write(DeviceAddress.Start.ToAdd(), (ushort)1);//设备启动写入 + } + else + return; + } + + + }); + MessageNotify.GetInstance.ShowRunLog($"{DeviceName},设置重量:{Value},味魔方启动配料"); } } + static string DecToBinary(int a) + { + int r; + string s = ""; + do + { + r = a % 2; + a /= 2; + s = r + s; + } + while (a != 0); + int length = s.Length; + for (int i = 0; i < 16 - length; i++) + { + s = 0 + s; + } + return s; + } } } diff --git a/DosingSystem/ViewModel/RecipeControlViewModel.cs b/DosingSystem/ViewModel/RecipeControlViewModel.cs index c47e61d9..12b9a982 100644 --- a/DosingSystem/ViewModel/RecipeControlViewModel.cs +++ b/DosingSystem/ViewModel/RecipeControlViewModel.cs @@ -19,11 +19,13 @@ using System.Data.SqlClient; using S7.Net.Types; using BPA.Communication; using BPASmartClient.DosingSystem.Model; +using System.Security.Cryptography; namespace BPASmartClient.DosingSystem.ViewModel { public class RecipeControlViewModel : NotifyBase { + int ComCount = 0;//配料完成计数 static ConcurrentQueue RecipeNames = new ConcurrentQueue(); static ObservableCollection StockStatus = new ObservableCollection(); public RecipeControlViewModel() @@ -160,7 +162,7 @@ namespace BPASmartClient.DosingSystem.ViewModel if ((values != null && values.ToString() != (item + item1).ToString()) || values == null) goto prop1; if (RE.IsSuccess) - MessageNotify.GetInstance.ShowRunLog($"下发配方DB4.DBD{2 + (tempDevice.DeviceNum - 1) * 4} :{(byte)tInfo.ElementAt(i).ElementAt(m).Loc}-{item+item1}-{(item+item1).ToBinString()}"); + MessageNotify.GetInstance.ShowRunLog($"下发配方DB4.DBD{2 + (tempDevice.DeviceNum - 1) * 4} :{(byte)tInfo.ElementAt(i).ElementAt(m).Loc}-{item + item1}-{(item + item1).ToBinString()}"); else MessageNotify.GetInstance.ShowRunLog($"下发配方DB4.DBD{2 + (tempDevice.DeviceNum - 1) * 4} 失败"); } @@ -294,7 +296,8 @@ namespace BPASmartClient.DosingSystem.ViewModel Thread.Sleep(100); }), "启动配方下发", true); } - int ComCount = 0; + + /// /// 配方执行状态监听 /// @@ -727,7 +730,7 @@ namespace BPASmartClient.DosingSystem.ViewModel //设备状态显示 if (Recipes.ElementAt(i).RecipeName == CurrentRecipeName) { - string tempRawMaterialName = DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp).DeviceName; + string tempRawMaterialName = DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp).DeviceName; int recIndex = recipeProcesses.ToList().FindIndex(p => p.RecipeName == CurrentRecipeName); if (recIndex >= 0 && recIndex < recipeProcesses.Count) { @@ -735,9 +738,12 @@ namespace BPASmartClient.DosingSystem.ViewModel if (index >= 0 && index < recipeProcesses.ElementAt(recIndex).RawMaterials.Count) { + //测试使用 recipeProcesses.ElementAt(recIndex).RawMaterials.ElementAt(index).RecipeStatus = RunStatus; + + } for (int j = 0; j < GlobalDevice.PlcData.IsAllowIngredients.Length; j++) { @@ -778,13 +784,12 @@ namespace BPASmartClient.DosingSystem.ViewModel if (DeviceNum > 0) { float weight = Recipes.ElementAt(i).RawMaterials.ElementAt(Location1).RawMaterialWeight; - //测试 - // int loc1 = Array.FindIndex(recipeProcesses.ElementAt(recIndex).RawMaterials.ToArray(),p=>p.RawMaterialName==RawName&&p.RecipeStatus==1); + int loc = Array.FindIndex(Recipes.ElementAt(i).RawMaterials.ToArray(), p => (p.RawMaterialName == RawName)); if (loc >= 0 && RawName != null && weight >= 0) { int St_index = Array.FindIndex(StockStatus.ToArray(), p => p.MaterialName == RawName); - // int materialCount = recipeProcesses.ElementAt(recIndex).RawMaterials.Where(p => p.RawMaterialName == RawName).Count(); + // int materialCount = recipeProcesses.ElementAt(recIndex).RawMaterials.Where(p => p.RawMaterialName == RawName).Count(); if (St_index < 0) //|| (StockStatus.Count < materialCount && St_index > 0) { StockStatus.Add(new StockStatusModel() @@ -794,16 +799,17 @@ namespace BPASmartClient.DosingSystem.ViewModel IssueStatus = 0, }); } - St_index = Array.FindIndex(StockStatus.ToArray(), p => p.MaterialName == RawName );//&& p.IssueStatus == 0) + St_index = Array.FindIndex(StockStatus.ToArray(), p => p.MaterialName == RawName);//&& p.IssueStatus == 0) // int St_index1 = Array.FindIndex(StockStatus.ToArray(), p => (p.MaterialName == RawName && p.IssueStatus == 1)); if (St_index >= 0) { + if (RTrig.GetInstance($"ac{j}-{St_index}").Start(GlobalDevice.PlcData.IsAllowIngredients[j])) { MessageNotify.GetInstance.ShowRunLog($"{St_index}-{j}--》允许配料"); if (StockStatus.ElementAt(St_index).IssueStatus == 2) - { + { StockStatus.ElementAt(St_index).IssueStatus = 0; MessageNotify.GetInstance.ShowRunLog($"{St_index}-复位"); } @@ -811,36 +817,51 @@ namespace BPASmartClient.DosingSystem.ViewModel var rrr = DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(i).RawMaterials.ElementAt(loc).DeviceIp).deviceStatus.RunStatus; if ((recipeProcesses.ElementAt(recIndex).RawMaterials.ElementAt(loc).RecipeStatus == 1 && StockStatus.ElementAt(St_index).IssueStatus == 0))// { + StockStatus.ElementAt(St_index).IssueStatus = 1; DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(i).RawMaterials.ElementAt(loc).DeviceIp).Start(weight); - + var res = recipeProcesses.ElementAt(recIndex).RawMaterials.FirstOrDefault(p => p.Status !=Status.正在配料 &&p.Status!=Status.配料完成&& p.RawMaterialName == tempRawMaterialName && p.Loc == j + 1); + if (res != null) + res.Status = Status.正在配料; + MessageNotify.GetInstance.ShowRunLog($"设备执行状态:{rrr}"); MessageNotify.GetInstance.ShowRunLog($"柔性味魔方{Recipes.ElementAt(i).RawMaterials.ElementAt(loc).DeviceIp},开始出料"); } if (recipeProcesses.ElementAt(recIndex).RawMaterials.ElementAt(loc).RecipeStatus == 3 && StockStatus.ElementAt(St_index).IssueStatus == 1) { //GlobalDevice.PlcData.IsAllowIngredients[j] = false;//测试使用 - + ComCount++; StockStatus.ElementAt(St_index).IssueStatus = 2; DeviceInquire.GetInstance.GetDevice(Recipes.ElementAt(i).RawMaterials.ElementAt(loc).DeviceIp).StatusReset(); //int a = 0.SetBitValue((byte)(DeviceNum), true); //byte[] test1 = a.ToBytes(BPA.Helper.DataFormat.BADC); //int item = test1.ToInt(); - //prop1: - // SiemensDevice.GetInstance.MySiemens.Write("DB4.DBD130", item); - SiemensDevice.GetInstance.MySiemens.Write($"DB4.DBX130.{DeviceNum - 1}", true).OnSuccess(() => + //prop1: + // SiemensDevice.GetInstance.MySiemens.Write("DB4.DBD130", item); + SiemensDevice.GetInstance.MySiemens.Write($"DB4.DBX130.{DeviceNum - 1}", true); + Task.Run(() => { - MessageNotify.GetInstance.ShowRunLog($"设备完成信号写入成功!DB4.DBX130.{{DeviceNum - 1}}:true\""); - }).OnFail(s => - { - MessageNotify.GetInstance.ShowRunLog($"设备完成信号写入失败!{s}"); - }); + int cout = DeviceNum - 1; + while (!SiemensDevice.GetInstance.MySiemens.Read($"DB3.DBX148.{cout}").Content) //DB3.DBX148.0-31 148.0-148.5代表6个料仓位置 + { + SiemensDevice.GetInstance.MySiemens.Write($"DB4.DBX130.{cout}", true); + Thread.Sleep(200); + } + while (SiemensDevice.GetInstance.MySiemens.Read($"DB3.DBX148.{cout}").Content) + { + SiemensDevice.GetInstance.MySiemens.Write($"DB4.DBX130.{cout}", false); + } + MessageNotify.GetInstance.ShowRunLog($"{cout}号气缸复位信号写入成功!"); + }); + var res = recipeProcesses.ElementAt(recIndex).RawMaterials.FirstOrDefault(p => p.Status != Status.配料完成 && p.RawMaterialName == tempRawMaterialName && p.Loc == j + 1); + if (res != null) + res.Status = Status.配料完成; //var values = SiemensDevice.GetInstance.MySiemens.Read("DB4.DBD130").Content; //if ((values != null && values.ToString() != item.ToString()) || values == null) // goto prop1; - + //SiemensDevice.GetInstance.MySiemens.Write("DB4.DBD130", true).OnSuccess(() => //{ // MessageNotify.GetInstance.ShowRunLog($"设备完成信号写入成功!"); @@ -848,11 +869,10 @@ namespace BPASmartClient.DosingSystem.ViewModel //{ // MessageNotify.GetInstance.ShowRunLog($"设备完成信号写入失败!{s}"); //}); - //MessageNotify.GetInstance.ShowRunLog($"{res}"); + MessageNotify.GetInstance.ShowRunLog($"设备完成执行状态:{rrr}"); - MessageNotify.GetInstance.ShowRunLog($"DB4.DBD130:{item.ToBinString()}"); MessageNotify.GetInstance.ShowRunLog($"柔性味魔方{Recipes.ElementAt(i).RawMaterials.ElementAt(loc).DeviceIp},出料完成,状态复位"); - + } //测试 @@ -972,7 +992,7 @@ namespace BPASmartClient.DosingSystem.ViewModel // }); // } // St_index = Array.FindIndex(StockStatus.ToArray(), p => p.MaterialName == RawName); - + // if (St_index >= 0) // { // if (RTrig.GetInstance($"ac{j}").Start(GlobalDevice.PlcData.IsAllowIngredients[j])) @@ -1146,9 +1166,18 @@ namespace BPASmartClient.DosingSystem.ViewModel } //int Finish_Count = StockStatus.Where(s => s.IssueStatus == 2).Count(); //int Finish_Count = recipeProcesses.ElementAt(recIndex).RawMaterials.Where(p => p.RecipeStatus == 3).Count(); - if ( ComCount >= Recipes.ElementAt(i).RawMaterials.Count) //配方配料完成 StockStatus.Count >= Recipes.ElementAt(i).RawMaterials.Count && + if (ComCount >= Recipes.ElementAt(i).RawMaterials.Count) //配方配料完成 StockStatus.Count >= Recipes.ElementAt(i).RawMaterials.Count && { + int cc = recipeProcesses.ElementAt(recIndex).RawMaterials.OrderBy(p => p.RawMaterialName).Count(); + for (int k = 0; k < 32; k++) + { + for (int l = 0; l < cc; l++) + { + RTrig.GetInstance($"ac{k}-{l}").Start(false); + } + } ComCount = 0; + StockStatus.Clear(); MessageNotify.GetInstance.ShowUserLog($"配方:{recipeProcesses.ElementAt(recIndex).RecipeName},配料完成"); foreach (var item in recipeProcesses.ElementAt(recIndex).RawMaterials)