锁定功能
This commit is contained in:
commit
54addaff17
4 files changed
+113
-7
No files matched your search
@@ -129,7 +129,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static async void SQL_LINK()//连接dbc数据库
|
||||
{
|
||||
if (conn_SC.State == ConnectionState.Open) conn_SC.Close();
|
||||
@@ -164,7 +163,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
{
|
||||
Interval = TimeSpan.FromMilliseconds(10) //毫秒
|
||||
};
|
||||
dis50ms.Tick += new EventHandler(DisTimer_50MS);//每一秒执行的方法
|
||||
dis50ms.Tick += new EventHandler(DisTimer_50MS);//每执行的方法
|
||||
dis50ms.Start();//计时开始
|
||||
}//时间周期初始化
|
||||
void DisTimer_50MS(object sender, EventArgs e)//Tick_Event周期执行事件50MS
|
||||
@@ -176,7 +175,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Tick_Main_1S(object sender, EventArgs e)//Tick_Event周期执行事件1S
|
||||
{
|
||||
DATA_view();
|
||||
@@ -240,6 +238,21 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
DAT = "SC830" + Selet_Machines(Machines, "SYSKEY", "ID='" + i + "'").ToString()
|
||||
});//信息插入队列
|
||||
|
||||
string mode = Machines.Select("NAME='" + machine + "'").First().Field<string>("LOCK");
|
||||
if (mode == "TRUE")
|
||||
{
|
||||
Dictionary<string, object> dat_821 = new Dictionary<string, object>();
|
||||
dat_821.Clear();
|
||||
dat_821.Add("LOCK", "TRUE");
|
||||
DataRow drEmployee = Machines.Select("NAME='" + machine + "'").First();
|
||||
int index = Convert.ToInt16(drEmployee.Field<object>("ID"));
|
||||
stringQueue.Enqueue(new QueueString
|
||||
{
|
||||
ID = index,
|
||||
DAT = "SC829" + Selet_Machines(Machines, "SYSKEY", "ID='" + index + "'") + dat_821.ToJsonString()
|
||||
});
|
||||
}
|
||||
|
||||
Updata_Machines(Machines, "State", "ID='" + i + "'", "101");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user