|
@ -122,8 +122,7 @@ namespace DyeingComputer.ViewModel |
|
|
execute:ProgramgroupView_run_ );//开始/暂停事件
|
|
|
execute:ProgramgroupView_run_ );//开始/暂停事件
|
|
|
ProgramgroupView_stop = new RelayCommand( |
|
|
ProgramgroupView_stop = new RelayCommand( |
|
|
execute: ProgramgroupView_stop_);//结束事件
|
|
|
execute: ProgramgroupView_stop_);//结束事件
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DataTable dt_con = new DataTable(); |
|
|
DataTable dt_con = new DataTable(); |
|
|
DataTable dt_sys = new DataTable(); |
|
|
DataTable dt_sys = new DataTable(); |
|
@ -267,16 +266,16 @@ namespace DyeingComputer.ViewModel |
|
|
public ICommand ProgramgroupView_run { get; } |
|
|
public ICommand ProgramgroupView_run { get; } |
|
|
private void ProgramgroupView_stop_()//结束
|
|
|
private void ProgramgroupView_stop_()//结束
|
|
|
{ |
|
|
{ |
|
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "WORK_RUN = STOP", MainWindowViewModel.WORK_RUN.ToString()); |
|
|
APILog.LOGlog(WorkNumder.ToString(), "UserActions", "WORK_RUN = STOP", WORK_RUN.ToString()); |
|
|
|
|
|
|
|
|
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) |
|
|
{ |
|
|
{ |
|
|
MainWindowViewModel.WORK_RUN = 0;// 运行时停止键为
|
|
|
WORK_RUN = 0;// 运行时停止键为
|
|
|
MainWindowViewModel.DIDETime = 0; |
|
|
DIDETime = 0; |
|
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "PROCESS_END", MainWindowViewModel.WORK_RUN.ToString()); |
|
|
APILog.LOGlog(WorkNumder.ToString(), "UserActions", "PROCESS_END", WORK_RUN.ToString()); |
|
|
|
|
|
|
|
|
MainWindowViewModel.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); |
|
@ -1496,7 +1495,7 @@ namespace DyeingComputer.ViewModel |
|
|
case "067": |
|
|
case "067": |
|
|
|
|
|
|
|
|
STEP_finish = true; |
|
|
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控制
|
|
|
if (PH_start) |
|
|
if (PH_start) |
|
@ -1659,35 +1658,20 @@ namespace DyeingComputer.ViewModel |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static bool CALL_FR = false; |
|
|
void FeedingRecords(string WorkOrder,string Dyelot,int TANK,int STEP,int Type) //呼叫输送
|
|
|
void FeedingRecords(string WorkOrder,string Dyelot,int TANK,int STEP,int Type) //呼叫输送
|
|
|
{ |
|
|
{ |
|
|
DataTable data_t = new DataTable(); |
|
|
Dictionary<string, object> dat_FR = new Dictionary<string, object>(); |
|
|
data_t.Columns.Add("Dyelot", typeof(string)); //添加列
|
|
|
dat_FR.Add("State", "201"); |
|
|
data_t.Columns.Add("Machine", typeof(string)); |
|
|
dat_FR.Add("Tank", TANK.ToString()); |
|
|
data_t.Columns.Add("WorkOrder", typeof(string)); |
|
|
dat_FR.Add("Machine", S01); |
|
|
data_t.Columns.Add("TIME", typeof(string)); |
|
|
dat_FR.Add("CALL_TIME", sys_Time); |
|
|
data_t.Columns.Add("Tank", typeof(int)); |
|
|
|
|
|
data_t.Columns.Add("STEP", typeof(int)); |
|
|
|
|
|
data_t.Columns.Add("Type", typeof(int)); |
|
|
|
|
|
data_t.Columns.Add("State", typeof(int)); |
|
|
|
|
|
data_t.Columns.Add("Redye", typeof(int)); |
|
|
|
|
|
DataRow dr = data_t.NewRow(); |
|
|
|
|
|
dr.BeginEdit(); //添加订单号
|
|
|
|
|
|
dr["Dyelot"] = Dyelot; |
|
|
|
|
|
dr["Machine"] = S01; |
|
|
|
|
|
dr["WorkOrder"] = WorkOrder; |
|
|
|
|
|
dr["TIME"] = sys_Time; |
|
|
|
|
|
dr["Tank"] = TANK; |
|
|
|
|
|
dr["STEP"] = STEP; |
|
|
|
|
|
dr["Type"] = Type; |
|
|
|
|
|
dr["State"] = 201; |
|
|
|
|
|
dr["Redye"] = SYS_REDYE; |
|
|
|
|
|
dr.EndEdit(); |
|
|
|
|
|
data_t.Rows.InsertAt(dr, 0); //行转换
|
|
|
|
|
|
|
|
|
|
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
SQLiteHelpers.InsertData("FeedingRecords", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
|
|
int SQLI = SQLiteHelpers.ExecuteDataSet("select * from Dyelot where " + |
|
|
|
|
|
"Dyelot = '"+Dyelot+ "' AND Step = '"+STEP+ "' AND Redye ='"+SYS_REDYE+"' AND State = '101'", null).Tables[0].Rows.Count; |
|
|
|
|
|
if(SQLI>0) SQLiteHelpers.Update("Dyelot", dat_FR, "Dyelot = '"+Dyelot+ "' AND Step = '"+STEP+ "' AND Redye ='"+SYS_REDYE+"'", null);//行更新
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|