|
|
@ -54,21 +54,31 @@ namespace DyeingComputer.View |
|
|
|
{ |
|
|
|
InitializeComponent(); |
|
|
|
//Grid.DataContext = new MainWindowViewModel();
|
|
|
|
// FocusManager.SetFocusedElement(Grid, Grid);
|
|
|
|
// if (workName != null)
|
|
|
|
// {
|
|
|
|
// TechnologicalProcess_Import();
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
TechnologicalProcess_sql(); |
|
|
|
// FocusManager.SetFocusedElement(Grid, Grid);
|
|
|
|
// if (workName != null)
|
|
|
|
// {
|
|
|
|
// TechnologicalProcess_Import();
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
TechnologicalProcess_sql(); |
|
|
|
// }
|
|
|
|
|
|
|
|
// ProgramgroupView_edit.IsEnabled = false;
|
|
|
|
// ProgramgroupView_del.IsEnabled = false;
|
|
|
|
// ProgramgroupView_Insert.IsEnabled = false;
|
|
|
|
} |
|
|
|
|
|
|
|
// ProgramgroupView_edit.IsEnabled = false;
|
|
|
|
// ProgramgroupView_del.IsEnabled = false;
|
|
|
|
// ProgramgroupView_Insert.IsEnabled = false;
|
|
|
|
tblDatas.Columns.Add("Name", Type.GetType("System.String")); |
|
|
|
tblDatas.Columns.Add("Value", Type.GetType("System.Double")); |
|
|
|
tblDatas.Columns.Add("ID", Type.GetType("System.String")); |
|
|
|
|
|
|
|
DataRow newRow; |
|
|
|
newRow = tblDatas.NewRow(); |
|
|
|
newRow["Name"] = Properties.Resources.PumpSpeed;//
|
|
|
|
newRow["Value"] = MainWindowViewModel.Selet_dtm("1020"); |
|
|
|
newRow["ID"] = "1020"; |
|
|
|
tblDatas.Rows.Add(newRow); |
|
|
|
} |
|
|
|
DataTable tblDatas = new DataTable("Datas"); |
|
|
|
public static object workName; |
|
|
|
public static SQLiteHelper SQLiteHelpers = null; //定义数据库
|
|
|
|
public static readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
|
|
|
@ -125,7 +135,7 @@ namespace DyeingComputer.View |
|
|
|
|
|
|
|
private void UserControl_Loaded(object sender, RoutedEventArgs e) |
|
|
|
{ |
|
|
|
// FocusManager.SetFocusedElement(Grid, Grid);
|
|
|
|
// FocusManager.SetFocusedElement(Grid, Grid);
|
|
|
|
// Grid.DataContext = new MainWindowViewModel();
|
|
|
|
if (workName != null) |
|
|
|
{ |
|
|
@ -150,7 +160,7 @@ namespace DyeingComputer.View |
|
|
|
{ |
|
|
|
MainWindowViewModel.WORK_RUN = 2; |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
MainWindowViewModel.RUN_DATATABLE = sql.Tables[0];//缓存表
|
|
|
|
MainWindowViewModel.RUN_STEPID = Convert.ToInt16(ID);//插入步骤号
|
|
|
@ -173,7 +183,7 @@ namespace DyeingComputer.View |
|
|
|
private void Address_ButtonClicked(object sender, AddressUpdateEventArgs e)//编辑返回结果
|
|
|
|
{ |
|
|
|
int n = Convert.ToInt16(ID); |
|
|
|
ID=null; |
|
|
|
ID = null; |
|
|
|
DataRow dr = sql.Tables[0].Rows[n - 1]; |
|
|
|
dr.BeginEdit(); |
|
|
|
dr["StepID"] = e.StepID; |
|
|
@ -271,7 +281,7 @@ namespace DyeingComputer.View |
|
|
|
dr["Program"] = ProgramNAME; |
|
|
|
|
|
|
|
sql.Tables[0].Rows.InsertAt(dr, d - 1); |
|
|
|
// ID = null;
|
|
|
|
// ID = null;
|
|
|
|
|
|
|
|
Dat(); |
|
|
|
|
|
|
@ -288,26 +298,33 @@ namespace DyeingComputer.View |
|
|
|
string ID = null; |
|
|
|
string P1 = "0", P2 = "0", P3 = "0", P4 = "0", P5 = "0"; |
|
|
|
|
|
|
|
private void DyeingMachine_Click(object sender, RoutedEventArgs e) |
|
|
|
private void DyeingMachine_Click(object sender, RoutedEventArgs e)//染色剂
|
|
|
|
{ |
|
|
|
|
|
|
|
Receip.Visibility = Visibility.Collapsed; |
|
|
|
// Parameter_Scroll.Visibility = Visibility.Collapsed;
|
|
|
|
} |
|
|
|
private void Receipt_Click(object sender, RoutedEventArgs e) |
|
|
|
private void Receipt_Click(object sender, RoutedEventArgs e)//领料单
|
|
|
|
{ |
|
|
|
|
|
|
|
Receip.Visibility = Visibility.Visible; |
|
|
|
// Parameter_Scroll.Visibility = Visibility.Collapsed;
|
|
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
|
string sql_script = "select * from Dyelot where WorkOrder = '" + MainWindowViewModel.WorkNumder + "'"; |
|
|
|
Receip.ItemsSource = SQLiteHelpers.ExecuteDataSet(sql_script, null).Tables[0].DefaultView; //转换显示
|
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
|
} |
|
|
|
|
|
|
|
private void ProgramgroupView_run_Click(object sender, RoutedEventArgs e)//运行/暂停
|
|
|
|
private void ParameterSet_Click(object sender, RoutedEventArgs e)//参数
|
|
|
|
{ |
|
|
|
|
|
|
|
// Parameter_Scroll.Visibility = Visibility.Visible;
|
|
|
|
Receip.Visibility = Visibility.Collapsed; |
|
|
|
} |
|
|
|
|
|
|
|
private void ProgramgroupView_stop_Click(object sender, RoutedEventArgs e)//结束工艺
|
|
|
|
private void ProgramgroupView_run_Click(object sender, RoutedEventArgs e)//运行/暂停
|
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private void ParameterSet_Click(object sender, RoutedEventArgs e) |
|
|
|
private void ProgramgroupView_stop_Click(object sender, RoutedEventArgs e)//结束工艺
|
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
@ -331,7 +348,7 @@ namespace DyeingComputer.View |
|
|
|
ProgramgroupView_Insert.IsEnabled = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void CountDown() |
|
|
|
{ |
|
|
|
DispatcherTimer timer1s = new DispatcherTimer//初始化循环,每1秒调用一次Tick
|
|
|
@ -344,10 +361,14 @@ namespace DyeingComputer.View |
|
|
|
void Tick_Event_1S(object sender, EventArgs e)//Tick_Event周期执行事件1S
|
|
|
|
{ |
|
|
|
if (MainWindowViewModel.WORK_RUN == 2) GridSTEP.SelectedIndex = MainWindowViewModel.RUN_STEPID - 1;//设定图表显示
|
|
|
|
if (sql != null) |
|
|
|
if (sql != null) |
|
|
|
{ |
|
|
|
dt_TP= sql.Tables[0]; |
|
|
|
dt_TP = sql.Tables[0]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|