diff --git a/UserClass/AsyncTcpClient.cs b/UserClass/AsyncTcpClient.cs index 5437742..7362c0e 100644 --- a/UserClass/AsyncTcpClient.cs +++ b/UserClass/AsyncTcpClient.cs @@ -182,6 +182,10 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass drEmployee["WaterLevel"] = _new.GetValue("MTL"); drEmployee["Process"] = _new.GetValue("Process"); drEmployee["Step"] = _new.GetValue("Step"); + drEmployee["UserButton"] = _new.GetValue("UserButton"); + drEmployee["WORK_RUN"] = _new.GetValue("WORK_RUN"); + drEmployee["RUN_STEPID"] = _new.GetValue("RUN_STEPID"); + drEmployee["CALL"] = _new.GetValue("CALL"); drEmployee.EndEdit(); drEmployee.AcceptChanges(); diff --git a/View/Whole.xaml.cs b/View/Whole.xaml.cs index 1803849..01a45c1 100644 --- a/View/Whole.xaml.cs +++ b/View/Whole.xaml.cs @@ -55,7 +55,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View else { inf[i].name.Background = new SolidColorBrush(Color.FromRgb(255, 0, 0)); } - inf[i].temp.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Temperature", i) + "°C"; + inf[i].temp.Text = Selet_Machines(MainWindowViewModel.Machines, "Temperature", i).ToString() + "°C"; inf[i].Process.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Process", i); inf[i].Step.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Step", i); inf[i].Message.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Message", i); @@ -109,7 +109,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View else { inf[i].name.Background = new SolidColorBrush(Color.FromRgb(255, 0, 0)); } - inf[i].temp.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Temperature", i) + "°C"; + inf[i].temp.Text = Selet_Machines(MainWindowViewModel.Machines, "Temperature", i).ToString() + "°C"; inf[i].Process.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Process", i); inf[i].Step.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Step", i); inf[i].Message.Text = (string)Selet_Machines(MainWindowViewModel.Machines, "Message", i); diff --git a/ViewModel/MainWindowViewModel.cs b/ViewModel/MainWindowViewModel.cs index 404dfc2..2805788 100644 --- a/ViewModel/MainWindowViewModel.cs +++ b/ViewModel/MainWindowViewModel.cs @@ -69,7 +69,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel private SQLiteHelper SQLiteHelpers = null; //定义数据库 private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径 public static DataTable Machines = new DataTable(); //设备表缓存 - public static DataRow MachinesROW; + // public static DataRow MachinesROW; public static DataTable USER_data = new DataTable(); public static UserControls.info[] inf = new UserControls.info[999]; //定义总览信息卡 public static int ERR_c = 0;//错误计数器 @@ -96,7 +96,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel USER_data = SQLiteHelpers.ExecuteDataSet("select * from USER order by Name desc", null).Tables[0]; SQLiteHelpers.Close(); - MachinesROW = Machines.NewRow(); + // MachinesROW = Machines.NewRow(); USERCapacity(App.USER_Purview);//App.USER_Purview); CountDown(); @@ -327,6 +327,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel MachiensTcpClient[i] = new TcpClient(); DataRow dt = machinesdata[i]; Updata_Machines(Machines, "State", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "800"); + Updata_Machines(Machines, "Temperature", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "0.0"); + Updata_Machines(Machines, "WaterLevel", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "0"); _ = AsyncTcpClient.TcpClient(MachiensTcpClient[i] //建立tcp连接 , Selet_Machines(Machines, "IP", "ID='" + Convert.ToInt16(dt["ID"]) + "'").ToString() , Selet_Machines(Machines, "PORT", "ID='" + Convert.ToInt16(dt["ID"]) + "'").ToString());