|
@ -69,7 +69,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel |
|
|
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
|
|
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
|
|
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径
|
|
|
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径
|
|
|
public static DataTable Machines = new DataTable(); //设备表缓存
|
|
|
public static DataTable Machines = new DataTable(); //设备表缓存
|
|
|
public static DataRow MachinesROW; |
|
|
// public static DataRow MachinesROW;
|
|
|
public static DataTable USER_data = new DataTable(); |
|
|
public static DataTable USER_data = new DataTable(); |
|
|
public static UserControls.info[] inf = new UserControls.info[999]; //定义总览信息卡
|
|
|
public static UserControls.info[] inf = new UserControls.info[999]; //定义总览信息卡
|
|
|
public static int ERR_c = 0;//错误计数器
|
|
|
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]; |
|
|
USER_data = SQLiteHelpers.ExecuteDataSet("select * from USER order by Name desc", null).Tables[0]; |
|
|
SQLiteHelpers.Close(); |
|
|
SQLiteHelpers.Close(); |
|
|
|
|
|
|
|
|
MachinesROW = Machines.NewRow(); |
|
|
// MachinesROW = Machines.NewRow();
|
|
|
|
|
|
|
|
|
USERCapacity(App.USER_Purview);//App.USER_Purview);
|
|
|
USERCapacity(App.USER_Purview);//App.USER_Purview);
|
|
|
CountDown(); |
|
|
CountDown(); |
|
@ -327,6 +327,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel |
|
|
MachiensTcpClient[i] = new TcpClient(); |
|
|
MachiensTcpClient[i] = new TcpClient(); |
|
|
DataRow dt = machinesdata[i]; |
|
|
DataRow dt = machinesdata[i]; |
|
|
Updata_Machines(Machines, "State", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "800"); |
|
|
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连接
|
|
|
_ = AsyncTcpClient.TcpClient(MachiensTcpClient[i] //建立tcp连接
|
|
|
, Selet_Machines(Machines, "IP", "ID='" + Convert.ToInt16(dt["ID"]) + "'").ToString() |
|
|
, Selet_Machines(Machines, "IP", "ID='" + Convert.ToInt16(dt["ID"]) + "'").ToString() |
|
|
, Selet_Machines(Machines, "PORT", "ID='" + Convert.ToInt16(dt["ID"]) + "'").ToString()); |
|
|
, Selet_Machines(Machines, "PORT", "ID='" + Convert.ToInt16(dt["ID"]) + "'").ToString()); |
|
|