添加锁定功能
This commit is contained in:
commit
3152fecff6
2 files changed
+49
-13
No files matched your search
+47
-10
@@ -122,14 +122,20 @@ namespace DyeingComputer.UserClass
|
||||
WorkOrder_dat.GetValue("ProgramID").ToString(),
|
||||
WorkOrder_dat.GetValue("color").ToString(),
|
||||
WorkOrder_dat.GetValue("Dyelot").ToString());
|
||||
if (!dat_w) { client.SendAsync("SC910" + "[" + MainWindowViewModel.S01 + "]" +
|
||||
WorkOrder_dat.GetValue("WorkOrder").ToString()); }
|
||||
else { client.SendAsync("SC810" + "[" + MainWindowViewModel.S01 + "]" +
|
||||
WorkOrder_dat.GetValue("WorkOrder").ToString()); MainWindowViewModel.TX++; }
|
||||
if (!dat_w)
|
||||
{
|
||||
client.SendAsync("SC910" + "[" + MainWindowViewModel.S01 + "]" +
|
||||
WorkOrder_dat.GetValue("WorkOrder").ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
client.SendAsync("SC810" + "[" + MainWindowViewModel.S01 + "]" +
|
||||
WorkOrder_dat.GetValue("WorkOrder").ToString()); MainWindowViewModel.TX++;
|
||||
}
|
||||
|
||||
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
client.SendAsync("SC990" + "[" + MainWindowViewModel.S01 + "]" + ex);
|
||||
}
|
||||
@@ -158,7 +164,7 @@ namespace DyeingComputer.UserClass
|
||||
}
|
||||
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
client.SendAsync("SC991" + "[" + MainWindowViewModel.S01 + "]" + ex);
|
||||
}
|
||||
@@ -290,8 +296,8 @@ namespace DyeingComputer.UserClass
|
||||
//_TechnologicalProcessView.Grid.SelectedIndex = -1;
|
||||
/**存入信息**/
|
||||
/**存入信息**/
|
||||
// SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
// SQLiteHelpers.Open(); //打开数据库
|
||||
// SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
// SQLiteHelpers.Open(); //打开数据库
|
||||
SQLiteHelpers.Delete("RUN", null, null);
|
||||
DataTable data_t = MainWindowViewModel.dt_TP.Clone();
|
||||
for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++)
|
||||
@@ -395,11 +401,41 @@ namespace DyeingComputer.UserClass
|
||||
}
|
||||
else { client.SendAsync("SC999"); }
|
||||
}//启停跳步指令
|
||||
else if (SYSAPI == "SC829")
|
||||
{
|
||||
if (SYSKEY == MainWindowViewModel.SYSKEY)
|
||||
{
|
||||
try
|
||||
{
|
||||
Dictionary<string, object> dat_829;
|
||||
dat_829 = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT);
|
||||
if (dat_829.GetValue("LOCK").ToString() == "TRUE")
|
||||
{
|
||||
MainWindowViewModel._Lock_bool = true;
|
||||
client.SendAsync("SC829" + SYSKEY + SYSDAT);
|
||||
}
|
||||
else if (dat_829.GetValue("LOCK").ToString() == "FALSE")
|
||||
{
|
||||
MainWindowViewModel._Lock_bool = false;
|
||||
client.SendAsync("SC829" + SYSKEY + SYSDAT);
|
||||
}
|
||||
else
|
||||
{
|
||||
client.SendAsync("SC829" + "[NOT]");
|
||||
}
|
||||
MainWindowViewModel.TX++;
|
||||
APILog.DBlog(client.IP, SYSKEY, SYSAPI, SYSDAT);//记录指令
|
||||
}
|
||||
catch (Exception ex) { client.SendAsync("SC929" + "[" + MainWindowViewModel.S01 + "]" + ex); }
|
||||
}
|
||||
else { client.SendAsync("SC999"); }
|
||||
}//锁指令
|
||||
else if (SYSAPI == "SC830")
|
||||
{
|
||||
if (SYSKEY == MainWindowViewModel.SYSKEY)
|
||||
{
|
||||
try {
|
||||
try
|
||||
{
|
||||
Dictionary<string, object> Chart_new = new Dictionary<string, object>();//缓存函数
|
||||
Chart_new.Add("Status", MainWindowViewModel.StatusStr);
|
||||
Chart_new.Add("Machine", MainWindowViewModel.S01);
|
||||
@@ -443,7 +479,8 @@ namespace DyeingComputer.UserClass
|
||||
if (SYSKEY == MainWindowViewModel.SYSKEY)
|
||||
{
|
||||
try
|
||||
{ client.SendAsync("SC832" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.SYSlog);
|
||||
{
|
||||
client.SendAsync("SC832" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.SYSlog);
|
||||
MainWindowViewModel.TX++;
|
||||
}
|
||||
catch (Exception ex) { client.SendAsync("SC932" + "[" + MainWindowViewModel.S01 + "]" + ex); }
|
||||
|
||||
@@ -309,7 +309,7 @@ namespace DyeingComputer.ViewModel
|
||||
OnPropertyChanged("UserButton");
|
||||
}
|
||||
}
|
||||
bool _Lock_bool;
|
||||
public static bool _Lock_bool;
|
||||
Visibility _Lock_bool_xml;
|
||||
public Visibility Lock_bool//锁图标
|
||||
{
|
||||
@@ -449,8 +449,7 @@ namespace DyeingComputer.ViewModel
|
||||
uint TX_t;
|
||||
void Tick_Event_5S()//Tick_Event周期执行事件5S
|
||||
{
|
||||
if (TX_t != TX) { _Link_bool = true; } else { _Link_bool = false; }
|
||||
TX_t = TX;
|
||||
if (TX_t != TX) { _Link_bool = true; TX_t = TX; } else { _Link_bool = false; TX_t = TX; } //中央连接状态判断
|
||||
|
||||
if(WORK_RUN !=0) Chart();//写入记录
|
||||
|
||||
|
||||
Reference in new issue
Block a user