|
|
@ -196,7 +196,6 @@ namespace DyeingComputer.ViewModel |
|
|
set { program_Name = value; OnPropertyChanged("Program_Name"); } |
|
|
set { program_Name = value; OnPropertyChanged("Program_Name"); } |
|
|
} |
|
|
} |
|
|
public static int ViewID = 0;//页面id
|
|
|
public static int ViewID = 0;//页面id
|
|
|
|
|
|
|
|
|
public static object Name_err = ""; |
|
|
public static object Name_err = ""; |
|
|
public static object SYSTime = "-----"; |
|
|
public static object SYSTime = "-----"; |
|
|
public static object WorkNumder = "-----"; |
|
|
public static object WorkNumder = "-----"; |
|
|
@ -217,7 +216,6 @@ namespace DyeingComputer.ViewModel |
|
|
SYS_SET(); //crbl
|
|
|
SYS_SET(); //crbl
|
|
|
SQL_data(); //读数据库
|
|
|
SQL_data(); //读数据库
|
|
|
if(S04!="1") UPort(); //启动串口
|
|
|
if(S04!="1") UPort(); //启动串口
|
|
|
|
|
|
|
|
|
if (dt_TP.Rows.Count > 0) |
|
|
if (dt_TP.Rows.Count > 0) |
|
|
{ |
|
|
{ |
|
|
MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(Properties.Resources.RunningProcess, "800", MessageBoxButton.YesNo); |
|
|
MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(Properties.Resources.RunningProcess, "800", MessageBoxButton.YesNo); |
|
|
@ -243,7 +241,6 @@ namespace DyeingComputer.ViewModel |
|
|
SQLiteHelpers.Close(); |
|
|
SQLiteHelpers.Close(); |
|
|
}//清楚任务列表
|
|
|
}//清楚任务列表
|
|
|
}//如果有未完成的工艺
|
|
|
}//如果有未完成的工艺
|
|
|
|
|
|
|
|
|
CountDown(); //启动循环任务
|
|
|
CountDown(); //启动循环任务
|
|
|
|
|
|
|
|
|
_ = AsyncTcpServer.Main(); |
|
|
_ = AsyncTcpServer.Main(); |
|
|
@ -415,14 +412,17 @@ namespace DyeingComputer.ViewModel |
|
|
MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(Properties.Resources.StopProcess, "800", MessageBoxButton.OKCancel); |
|
|
MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(Properties.Resources.StopProcess, "800", MessageBoxButton.OKCancel); |
|
|
if (messageBoxResult == MessageBoxResult.OK) |
|
|
if (messageBoxResult == MessageBoxResult.OK) |
|
|
{ |
|
|
{ |
|
|
|
|
|
Dictionary<string, object> _temp = new Dictionary<string, object>();//缓存函数
|
|
|
|
|
|
_temp.Clear(); //使用前清缓存
|
|
|
|
|
|
_temp.Add("State", 301); |
|
|
WORK_RUN = 0;// 运行时停止键为
|
|
|
WORK_RUN = 0;// 运行时停止键为
|
|
|
DIDETime = 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(); |
|
|
dt_TP.Rows.Clear(); |
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
SQLiteHelpers.Delete("RUN", null, null); |
|
|
SQLiteHelpers.Delete("RUN", null, null); |
|
|
|
|
|
SQLiteHelpers.Update("WorkOrder", _temp, "WorkOrder='" + WorkNumder + "'", null); |
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
|
|
|
|
|
|
UserButton = false; |
|
|
UserButton = false; |
|
|
@ -1806,8 +1806,7 @@ namespace DyeingComputer.ViewModel |
|
|
if (WORK_RUN == 2) |
|
|
if (WORK_RUN == 2) |
|
|
{ |
|
|
{ |
|
|
switch (STEP_ID) |
|
|
switch (STEP_ID) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
case "015": |
|
|
case "015": |
|
|
|
|
|
|
|
|
break;//溢流水洗
|
|
|
break;//溢流水洗
|
|
|
@ -1834,7 +1833,6 @@ namespace DyeingComputer.ViewModel |
|
|
{ |
|
|
{ |
|
|
TANK1 = Resources.Ready + Resources.Finish; |
|
|
TANK1 = Resources.Ready + Resources.Finish; |
|
|
Updata_dtd("3040", false); |
|
|
Updata_dtd("3040", false); |
|
|
STEP_finish = true; |
|
|
|
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
@ -1884,7 +1882,6 @@ namespace DyeingComputer.ViewModel |
|
|
{ |
|
|
{ |
|
|
TANK2 = Resources.Ready + Resources.Finish; |
|
|
TANK2 = Resources.Ready + Resources.Finish; |
|
|
Updata_dtd("3050", false); |
|
|
Updata_dtd("3050", false); |
|
|
STEP_finish = true; |
|
|
|
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
@ -1934,7 +1931,6 @@ namespace DyeingComputer.ViewModel |
|
|
{ |
|
|
{ |
|
|
TANK3 = Resources.Ready + Resources.Finish; |
|
|
TANK3 = Resources.Ready + Resources.Finish; |
|
|
Updata_dtd("3060", false); |
|
|
Updata_dtd("3060", false); |
|
|
STEP_finish = true; |
|
|
|
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
@ -1966,29 +1962,6 @@ namespace DyeingComputer.ViewModel |
|
|
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 3 :" + Resources.Ready; |
|
|
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 3 :" + Resources.Ready; |
|
|
}//药缸3
|
|
|
}//药缸3
|
|
|
break;//药缸备药
|
|
|
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": |
|
|
case "066": |
|
|
if (STEP_P1 == 1) |
|
|
if (STEP_P1 == 1) |
|
|
{ |
|
|
{ |
|
|
@ -2020,8 +1993,7 @@ namespace DyeingComputer.ViewModel |
|
|
//STEP_finish = true;
|
|
|
//STEP_finish = true;
|
|
|
break;//呼叫输送
|
|
|
break;//呼叫输送
|
|
|
case "067": |
|
|
case "067": |
|
|
|
|
|
|
|
|
STEP_finish = true; |
|
|
|
|
|
break;//等待输送
|
|
|
break;//等待输送
|
|
|
case "090": |
|
|
case "090": |
|
|
if (((STEP_P1 - 1) < Selet_dtm("1010")) && (Selet_dtm("1010") < (STEP_P1 + 1))) PH_start = true;//达到温度开始ph控制
|
|
|
if (((STEP_P1 - 1) < Selet_dtm("1010")) && (Selet_dtm("1010") < (STEP_P1 + 1))) PH_start = true;//达到温度开始ph控制
|
|
|
|