diff --git a/DyeingComputer.csproj b/DyeingComputer.csproj index 2c89cda..b945504 100644 --- a/DyeingComputer.csproj +++ b/DyeingComputer.csproj @@ -356,6 +356,9 @@ 8.0.0 + + 13.0.3 + 3.0.81 diff --git a/ViewModel/MainWindowViewModel.cs b/ViewModel/MainWindowViewModel.cs index 1908a45..01abdd9 100644 --- a/ViewModel/MainWindowViewModel.cs +++ b/ViewModel/MainWindowViewModel.cs @@ -523,6 +523,8 @@ namespace DyeingComputer.ViewModel TimeSpan ts = new TimeSpan(00,00,01);//1秒间隔 private int temp_time10s = 10;//开关周期时间 private bool PH_start = false; + private double TANK1_L,TANK2_L,TANK3_L,TANK1_SL,TANK2_SL,TANK3_SL;//实际加料量|每秒加料量 + private double TANK1_Pt, TANK1_Pc, TANK2_Pt, TANK2_Pc, TANK3_Pt, TANK3_Pc;//加料比例开度与模拟 private string TANK1, TANK2, TANK3;//料桶信息 public static string TANK1_DYELOT, TANK2_DYELOT, TANK3_DYELOT;//料单号 private int TANK1_REDYE,TANK1_STEP, TANK2_REDYE, TANK2_STEP, TANK3_REDYE, TANK3_STEP; @@ -1142,21 +1144,25 @@ namespace DyeingComputer.ViewModel }//药缸3 break;//药缸备药 case "065": - if ((STEP_P1 == 1) || (STEP_P1 == 0)) + if (STEP_P1 == 1) { - + if ((TANK1_L - Selet_dtm("1017")) > TANK1_SL) { TANK1_Pc = TANK2_Pc - 3.3; }//计算比例 + else { TANK1_Pc = TANK1_Pc + 3.3; } + if (((TANK1_Pt - TANK1_Pc) > 5) || ((TANK1_Pt - TANK1_Pc) > -5)) TANK1_Pt = TANK1_Pc;//调整比例 if (string.IsNullOrEmpty(Name_err.ToString())) Status_Str = Resources.Tank + " 1 :" + Resources.AddTheMedicine; } //药缸1 else if (STEP_P1 == 2) { - - + if ((TANK2_L - Selet_dtm("1018")) > TANK2_SL) { TANK2_Pc = TANK2_Pc - 3.3; }//计算比例 + else { TANK2_Pc = TANK2_Pc + 3.3; } + if (((TANK2_Pt - TANK2_Pc) > 5) || ((TANK2_Pt - TANK2_Pc) > -5)) TANK2_Pt = TANK2_Pc;//调整比例 if (string.IsNullOrEmpty(Name_err.ToString())) Status_Str = Resources.Tank + " 2 :" + Resources.AddTheMedicine; }//药缸2 else if (STEP_P1 == 3) { - - + if ((TANK3_L - Selet_dtm("1019")) > TANK3_SL) { TANK3_Pc = TANK3_Pc - 3.3; }//计算比例 + else { TANK3_Pc = TANK3_Pc + 3.3; } + if (((TANK3_Pt - TANK3_Pc) > 5) || ((TANK3_Pt - TANK3_Pc) > -5)) TANK3_Pt = TANK3_Pc;//调整比例 if (string.IsNullOrEmpty(Name_err.ToString())) Status_Str = Resources.Tank + " 3 :" + Resources.AddTheMedicine; }//药缸3 break;//药缸加药