sc 1 year ago
parent
commit
a264db4b52
  1. 4
      View/TechnologicalProcessView.xaml.cs
  2. 12
      ViewModel/MainWindowViewModel.cs

4
View/TechnologicalProcessView.xaml.cs

@ -96,6 +96,8 @@ namespace DyeingComputer.View
TechnologicalProcess_sql(); TechnologicalProcess_sql();
// Grid.SelectedIndex = Convert.ToInt16(MainWindowViewModel.Process_step); // Grid.SelectedIndex = Convert.ToInt16(MainWindowViewModel.Process_step);
} }
if(MainWindowViewModel.WORK_RUN !=0)Grid.SelectedIndex = MainWindowViewModel.RUN_STEPID-1;//设定图表显示
} }
private void UserControl_KeyDown(object sender, KeyEventArgs e) //键盘监控 private void UserControl_KeyDown(object sender, KeyEventArgs e) //键盘监控
@ -106,6 +108,8 @@ namespace DyeingComputer.View
{ {
if (e.Key == Key.Y) //按键y if (e.Key == Key.Y) //按键y
{ {
MainWindowViewModel.RUN_DATATABLE = sql.Tables[0];//缓存表
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)); MainWindowViewModel.STEP_START(Numder, Convert.ToDouble(P1), Convert.ToDouble(P2), Convert.ToDouble(P3), Convert.ToDouble(P4), Convert.ToDouble(P5));
} }
} }

12
ViewModel/MainWindowViewModel.cs

@ -53,7 +53,9 @@ namespace DyeingComputer.ViewModel
private SQLiteHelper SQLiteHelpers = null; //定义数据库 private SQLiteHelper SQLiteHelpers = null; //定义数据库
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径 private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
private IniFile.IniFiles Configini = new IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "DyeingComputer.ini"); private IniFile.IniFiles Configini = new IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "DyeingComputer.ini");
PID pid = new PID(); private PID pid = new PID();
public static DataTable RUN_DATATABLE = new DataTable();//缓存工作表
public static int RUN_STEPID;//当前步骤
public MainWindowViewModel() public MainWindowViewModel()
{ {
@ -61,7 +63,7 @@ namespace DyeingComputer.ViewModel
SYS_SET(); //crbl SYS_SET(); //crbl
CountDown(); //启动循环任务 CountDown(); //启动循环任务
SQL_data(); //读数据库 SQL_data(); //读数据库
UPort(); //启动串口 UPort(); //启动串口
} }
private static int MT05;//主缸排水延时 private static int MT05;//主缸排水延时
@ -89,7 +91,6 @@ namespace DyeingComputer.ViewModel
MT33 = Convert.ToDouble(Selet_sys("MT33"));//温度偏差参数 MT33 = Convert.ToDouble(Selet_sys("MT33"));//温度偏差参数
MT90 = Convert.ToInt16(Selet_sys("MT90"));//呼叫操作员 MT90 = Convert.ToInt16(Selet_sys("MT90"));//呼叫操作员
} }
DataTable dt_sys = new DataTable(); DataTable dt_sys = new DataTable();
public string Selet_sys(string key)//配置缓存 public string Selet_sys(string key)//配置缓存
@ -776,6 +777,11 @@ namespace DyeingComputer.ViewModel
} }
else else
{ {
if (STEP_finish)
{
}
if (string.IsNullOrEmpty(Name_err.ToString())) if (string.IsNullOrEmpty(Name_err.ToString()))
{ {
Status_Str = Resources.Await; Status_Str = Resources.Await;

Loading…
Cancel
Save