diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs index 7fb6dfb..1cf3c5a 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs @@ -9,6 +9,7 @@ using Mesnac.Controls.Default; using Mesnac.Core.Service; using System; using System.Collections.Generic; +using System.Linq; using System.Windows.Forms; using static Mesnac.Action.ChemicalWeighing.AutoControl.AutoLogHelper; @@ -66,6 +67,12 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl } } + if(b1 == b2) + { + MessageBox.Show("两种物料不可相同!"); + return; + } + if(GelSpeed > 50) { MessageBox.Show("速度不能大于五十!"); @@ -362,6 +369,13 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl return; } + var a = recipes.Where(x => x.Bin != -1).GroupBy(x => x.Bin).All(x => x.Count() == 1); + if (!a) + { + MessageBox.Show("两种物料不可相同!"); + return; + } + short dryWaitTime = Convert.ToInt16(TextE.DryWaitTime.MCValue.ToString()); short dryOutDelayTime = Convert.ToInt16(TextE.DryOutDelayTime.MCValue.ToString()); float drySpeed1 = Convert.ToSingle(TextE.DrySpeed1.MCValue.ToString());