|
|
@ -202,16 +202,17 @@ namespace DyeingComputer.View |
|
|
|
|
|
|
|
|
private void Parameter_set_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e) |
|
|
private void Parameter_set_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e) |
|
|
{ |
|
|
{ |
|
|
string ID; |
|
|
string VID; |
|
|
string newValue = (e.EditingElement as TextBox).Text;//获得输入单元格信息
|
|
|
string newValue = (e.EditingElement as TextBox).Text;//获得输入单元格信息
|
|
|
|
|
|
|
|
|
int rownum = Parameter_set.SelectedIndex;//获取鼠标选中行并定义变量
|
|
|
int rownum = Parameter_set.SelectedIndex;//获取鼠标选中行并定义变量
|
|
|
if (rownum != -1)//判断鼠标定位是否有效
|
|
|
if (rownum != -1)//判断鼠标定位是否有效
|
|
|
{ |
|
|
{ |
|
|
ID = (Parameter_set.Columns[2].GetCellContent(Parameter_set.Items[rownum]) as TextBlock).Text;//定位第0列,
|
|
|
string Vname = (Parameter_set.Columns[0].GetCellContent(Parameter_set.Items[rownum]) as TextBlock).Text;//定位第0列,
|
|
|
|
|
|
VID = (Parameter_set.Columns[2].GetCellContent(Parameter_set.Items[rownum]) as TextBlock).Text;//定位第列,
|
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
if (ID == "ClothWheel") |
|
|
if (VID == "ClothWheel") |
|
|
{ |
|
|
{ |
|
|
MainWindowViewModel.Updata_dtm("1025", Convert.ToDouble(newValue)); |
|
|
MainWindowViewModel.Updata_dtm("1025", Convert.ToDouble(newValue)); |
|
|
MainWindowViewModel.Updata_dtm("1026", Convert.ToDouble(newValue)); |
|
|
MainWindowViewModel.Updata_dtm("1026", Convert.ToDouble(newValue)); |
|
|
@ -230,12 +231,16 @@ namespace DyeingComputer.View |
|
|
{ |
|
|
{ |
|
|
int i = Convert.ToInt16(newValue); |
|
|
int i = Convert.ToInt16(newValue); |
|
|
if (i > 999) i = 999; |
|
|
if (i > 999) i = 999; |
|
|
if ((ID == "1020") || (ID == "1021") || (ID == "1041")) |
|
|
if ((VID == "1020") || (VID == "1021") || (VID == "1041")) |
|
|
{ |
|
|
{ |
|
|
if (i > 100) i = 100; |
|
|
if (i > 100) i = 100; |
|
|
} |
|
|
} |
|
|
MainWindowViewModel.Updata_dtm(ID, i); |
|
|
MainWindowViewModel.Updata_dtm(VID, i); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Parameter", |
|
|
|
|
|
"ID=" + VID + ";Name=" + Vname + ";Value="+newValue); |
|
|
} |
|
|
} |
|
|
catch { } |
|
|
catch { } |
|
|
ParameterSet_d(); |
|
|
ParameterSet_d(); |
|
|
@ -347,6 +352,7 @@ namespace DyeingComputer.View |
|
|
{ |
|
|
{ |
|
|
if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; } |
|
|
if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; } |
|
|
if (ID == null) ID = sql.Tables[0].Rows.Count.ToString(); |
|
|
if (ID == null) ID = sql.Tables[0].Rows.Count.ToString(); |
|
|
|
|
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Edit", "STEP = " + ID); |
|
|
ViewStep viewstop = new ViewStep(Numder, P1, P2, P3, P4, P5); |
|
|
ViewStep viewstop = new ViewStep(Numder, P1, P2, P3, P4, P5); |
|
|
viewstop.data = ID; |
|
|
viewstop.data = ID; |
|
|
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked); |
|
|
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked); |
|
|
@ -390,6 +396,10 @@ namespace DyeingComputer.View |
|
|
SQLiteHelpers.InsertData("RUN", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
|
|
SQLiteHelpers.InsertData("RUN", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
|
|
} |
|
|
} |
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
|
|
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "STEP = " + n, |
|
|
|
|
|
"StepID="+ e.StepID + ";StepName="+ e.StepNAME+";P1="+ e.P1+ |
|
|
|
|
|
";P2="+ e.P2+";P3="+ e.P3+";P4="+ e.P4+";P5="+ e.P5); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
public static void Dat()//行号刷新
|
|
|
public static void Dat()//行号刷新
|
|
|
{ |
|
|
{ |
|
|
@ -434,6 +444,7 @@ namespace DyeingComputer.View |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
|
|
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Delete", "STEP = " + ID); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void ProgramgroupView_Insert_Click(object sender, RoutedEventArgs e)//插入
|
|
|
private void ProgramgroupView_Insert_Click(object sender, RoutedEventArgs e)//插入
|
|
|
@ -454,9 +465,9 @@ namespace DyeingComputer.View |
|
|
|
|
|
|
|
|
sql.Tables[0].Rows.InsertAt(dr, d - 1); |
|
|
sql.Tables[0].Rows.InsertAt(dr, d - 1); |
|
|
// ID = null;
|
|
|
// ID = null;
|
|
|
|
|
|
|
|
|
Dat(); |
|
|
Dat(); |
|
|
|
|
|
|
|
|
|
|
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Insert", "STEP = "+ID); |
|
|
if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; } |
|
|
if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; } |
|
|
if (ID == null) ID = sql.Tables[0].Rows.Count.ToString(); |
|
|
if (ID == null) ID = sql.Tables[0].Rows.Count.ToString(); |
|
|
ViewStep viewstop = new ViewStep(null, "0", "0", "0", "0", "0"); |
|
|
ViewStep viewstop = new ViewStep(null, "0", "0", "0", "0", "0"); |
|
|
@ -496,20 +507,37 @@ namespace DyeingComputer.View |
|
|
if (MainWindowViewModel.WORK_RUN == 2) |
|
|
if (MainWindowViewModel.WORK_RUN == 2) |
|
|
{ |
|
|
{ |
|
|
MainWindowViewModel.WORK_RUN = 1;// 运行时停止键为暂停
|
|
|
MainWindowViewModel.WORK_RUN = 1;// 运行时停止键为暂停
|
|
|
|
|
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "WORK_RUN = Pause", MainWindowViewModel.WORK_RUN.ToString()); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
MainWindowViewModel.WORK_RUN = 2;// 运行时停止键为
|
|
|
MainWindowViewModel.WORK_RUN = 2;// 运行时停止键为
|
|
|
|
|
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "WORK_RUN = RUN", MainWindowViewModel.WORK_RUN.ToString()); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void ProgramgroupView_Jump_Click(object sender, RoutedEventArgs e) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
MainWindowViewModel.RUN_STEPID = Convert.ToInt16(ID);//插入步骤号
|
|
|
|
|
|
MainWindowViewModel.STEP_START(Numder, Convert.ToDouble(P1),Convert.ToDouble(P2), Convert.ToDouble(P3), |
|
|
|
|
|
Convert.ToDouble(P4), Convert.ToDouble(P5)); |
|
|
|
|
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Jump", "STEP = " + ID+ |
|
|
|
|
|
";StepID=" + Numder + ";P1=" + P1 + ";P2=" + P2 + ";P3=" + P3 + ";P4=" + P4 + ";P5=" + P5); |
|
|
|
|
|
|
|
|
|
|
|
}//跳步
|
|
|
|
|
|
|
|
|
private void ProgramgroupView_stop_Click(object sender, RoutedEventArgs e)//结束工艺
|
|
|
private void ProgramgroupView_stop_Click(object sender, RoutedEventArgs e)//结束工艺
|
|
|
{ |
|
|
{ |
|
|
|
|
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "WORK_RUN = STOP", MainWindowViewModel.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;// 运行时停止键为
|
|
|
MainWindowViewModel.WORK_RUN = 0;// 运行时停止键为
|
|
|
MainWindowViewModel.DIDETime = 0; |
|
|
MainWindowViewModel.DIDETime = 0; |
|
|
|
|
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "PROCESS_END", MainWindowViewModel.WORK_RUN.ToString()); |
|
|
|
|
|
|
|
|
MainWindowViewModel.dt_TP.Rows.Clear(); |
|
|
MainWindowViewModel.dt_TP.Rows.Clear(); |
|
|
ProgramgroupView_stop.IsEnabled = false; |
|
|
ProgramgroupView_stop.IsEnabled = false; |
|
|
@ -521,7 +549,7 @@ namespace DyeingComputer.View |
|
|
|
|
|
|
|
|
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e) |
|
|
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e) |
|
|
{ |
|
|
{ |
|
|
if (MainWindowViewModel.WORK_RUN == 2) GridSTEP.SelectedIndex = MainWindowViewModel.RUN_STEPID - 1;//设定图表显示
|
|
|
// if (MainWindowViewModel.WORK_RUN == 2) GridSTEP.SelectedIndex = MainWindowViewModel.RUN_STEPID - 1;//设定图表显示
|
|
|
int rownum = GridSTEP.SelectedIndex;//获取鼠标选中行并定义变量
|
|
|
int rownum = GridSTEP.SelectedIndex;//获取鼠标选中行并定义变量
|
|
|
if (rownum != -1)//判断鼠标定位是否有效
|
|
|
if (rownum != -1)//判断鼠标定位是否有效
|
|
|
{ |
|
|
{ |
|
|
@ -533,9 +561,7 @@ namespace DyeingComputer.View |
|
|
P4 = (GridSTEP.Columns[9].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//定位第9列,
|
|
|
P4 = (GridSTEP.Columns[9].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//定位第9列,
|
|
|
P5 = (GridSTEP.Columns[10].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//定位第10列,
|
|
|
P5 = (GridSTEP.Columns[10].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//定位第10列,
|
|
|
|
|
|
|
|
|
ProgramgroupView_edit.IsEnabled = true; |
|
|
|
|
|
ProgramgroupView_del.IsEnabled = true; |
|
|
|
|
|
ProgramgroupView_Insert.IsEnabled = true; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|