diff --git a/ViewModel/MainWindowViewModel.cs b/ViewModel/MainWindowViewModel.cs index 01e775f..ec9bbce 100644 --- a/ViewModel/MainWindowViewModel.cs +++ b/ViewModel/MainWindowViewModel.cs @@ -196,7 +196,6 @@ namespace DyeingComputer.ViewModel set { program_Name = value; OnPropertyChanged("Program_Name"); } } public static int ViewID = 0;//页面id - public static object Name_err = ""; public static object SYSTime = "-----"; public static object WorkNumder = "-----"; @@ -217,7 +216,6 @@ namespace DyeingComputer.ViewModel SYS_SET(); //crbl SQL_data(); //读数据库 if(S04!="1") UPort(); //启动串口 - if (dt_TP.Rows.Count > 0) { MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(Properties.Resources.RunningProcess, "800", MessageBoxButton.YesNo); @@ -243,7 +241,6 @@ namespace DyeingComputer.ViewModel SQLiteHelpers.Close(); }//清楚任务列表 }//如果有未完成的工艺 - CountDown(); //启动循环任务 _ = AsyncTcpServer.Main(); @@ -415,14 +412,17 @@ namespace DyeingComputer.ViewModel MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(Properties.Resources.StopProcess, "800", MessageBoxButton.OKCancel); if (messageBoxResult == MessageBoxResult.OK) { + Dictionary _temp = new Dictionary();//缓存函数 + _temp.Clear(); //使用前清缓存 + _temp.Add("State", 301); WORK_RUN = 0;// 运行时停止键为 DIDETime = 0; - APILog.LOGlog(WorkNumder.ToString(), "UserActions", "PROCESS_END", WORK_RUN.ToString()); - + APILog.LOGlog(WorkNumder.ToString(), "UserActions", "PROCESS_END", WORK_RUN.ToString()); dt_TP.Rows.Clear(); SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 SQLiteHelpers.Open(); //打开数据库 SQLiteHelpers.Delete("RUN", null, null); + SQLiteHelpers.Update("WorkOrder", _temp, "WorkOrder='" + WorkNumder + "'", null); SQLiteHelpers.Close(); //关闭连接 UserButton = false; @@ -1806,8 +1806,7 @@ namespace DyeingComputer.ViewModel if (WORK_RUN == 2) { switch (STEP_ID) - { - + { case "015": break;//溢流水洗 @@ -1834,7 +1833,6 @@ namespace DyeingComputer.ViewModel { TANK1 = Resources.Ready + Resources.Finish; Updata_dtd("3040", false); - STEP_finish = true; } else { @@ -1884,7 +1882,6 @@ namespace DyeingComputer.ViewModel { TANK2 = Resources.Ready + Resources.Finish; Updata_dtd("3050", false); - STEP_finish = true; } else { @@ -1934,7 +1931,6 @@ namespace DyeingComputer.ViewModel { TANK3 = Resources.Ready + Resources.Finish; Updata_dtd("3060", false); - STEP_finish = true; } else { @@ -1966,29 +1962,6 @@ namespace DyeingComputer.ViewModel if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 3 :" + Resources.Ready; }//药缸3 break;//药缸备药 - case "065": - 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 (errTabler.Rows.Count == 0) 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 (errTabler.Rows.Count == 0) 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 (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 3 :" + Resources.AddTheMedicine; - }//药缸3 - break;//药缸加药 case "066": if (STEP_P1 == 1) { @@ -2020,8 +1993,7 @@ namespace DyeingComputer.ViewModel //STEP_finish = true; break;//呼叫输送 case "067": - - STEP_finish = true; + break;//等待输送 case "090": if (((STEP_P1 - 1) < Selet_dtm("1010")) && (Selet_dtm("1010") < (STEP_P1 + 1))) PH_start = true;//达到温度开始ph控制 diff --git a/Windows/ViewStep.xaml.cs b/Windows/ViewStep.xaml.cs index 91f352b..ad2a477 100644 --- a/Windows/ViewStep.xaml.cs +++ b/Windows/ViewStep.xaml.cs @@ -340,10 +340,11 @@ namespace DyeingComputer.Windows } - private readonly string[] id_dat = {"001","007","008","013","015" ,"017", "020", "022", "031", "035", "036", "039", "040", "041", "049", "050", - "051", "054", "055", "056","064","065","066","067","090","091","093","094" }; - private readonly string[] id_datp = {" ","001","007","008","013","015" ,"017", "020", "022", "031", "035", "036", "039", "040", "041", "049", "050", - "051", "054", "055", "056","064","065","066","067","090","091","093","094" }; + private readonly string[] id_dat = {"001","007","008","013","015" ,"017", "020", "022", "031", "035", + "036", "039", "040", "041", "049", "050", "051", "054", "055", "056","064","065","066","067","090", + "091","093","094" }; + private readonly string[] id_datp = {" ","015" ,"017", "050", "051", "064", "066","067","090","091", + "093","094" }; private void Form1_Load() { @@ -377,29 +378,12 @@ namespace DyeingComputer.Windows this.boxID.Items.Add(Properties.Resources.PHControl);//ph控制094 - this.boxIDp.Items.Add("");//温度控制001 - this.boxIDp.Items.Add(Properties.Resources.TemperatureControl);//温度控制001 - this.boxIDp.Items.Add(Properties.Resources.AddWater + "(" + Properties.Resources.WaterLevel + ")");//水位进水007 - this.boxIDp.Items.Add(Properties.Resources.AddWater + "(" + Properties.Resources.Flowmeter + ")");//流量进水008 - this.boxIDp.Items.Add(Properties.Resources.Washing + "(" + Properties.Resources.WaterLevel + ")");//水位水洗013 + this.boxIDp.Items.Add("");// this.boxIDp.Items.Add(Properties.Resources.Washing + "(" + Properties.Resources.Overflow + ")");//溢流水洗015 this.boxIDp.Items.Add(Properties.Resources.Washing + "(" + Properties.Resources.Cooling + ")");//降温水洗017 - this.boxIDp.Items.Add(Properties.Resources.Drainage);//排水020 - this.boxIDp.Items.Add(Properties.Resources.PumpDrainage);//主泵排水022 - this.boxIDp.Items.Add(Properties.Resources.RunningTime);//运转031 - this.boxIDp.Items.Add(Properties.Resources.ClothIntake);//入布035 - this.boxIDp.Items.Add(Properties.Resources.OutTheCloth);//出布036 - this.boxIDp.Items.Add(Properties.Resources.CallWorkers);//呼叫操作员039 - this.boxIDp.Items.Add(Properties.Resources.Sampling);//取样040 - this.boxIDp.Items.Add(Properties.Resources.End);//程序结束041 - this.boxIDp.Items.Add(Properties.Resources.Await);//等待049 this.boxIDp.Items.Add(Properties.Resources.Pressurized);//加压050 this.boxIDp.Items.Add(Properties.Resources.Depressurized);//减压051 - this.boxIDp.Items.Add(Properties.Resources.Pump + "/" + Properties.Resources.Blower);//泵风机速度054 - this.boxIDp.Items.Add(Properties.Resources.PumpStart);//泵启动055 - this.boxIDp.Items.Add(Properties.Resources.PumpStops);//泵停止056 this.boxIDp.Items.Add(Properties.Resources.PrepareMedications);//备药064 - this.boxIDp.Items.Add(Properties.Resources.AddTheMedicine);//加药065 this.boxIDp.Items.Add(Properties.Resources.CallDistribution);//呼叫输送066 this.boxIDp.Items.Add(Properties.Resources.CallPreparation);//呼叫准备067 this.boxIDp.Items.Add(Properties.Resources.RapidAcidAddition);//快速加酸090