串口功能逻辑,810,811,812指令修改
This commit is contained in:
commit
7403914ba5
4 files changed
+212
-131
No files matched your search
@@ -95,32 +95,50 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
||||
{
|
||||
try
|
||||
{
|
||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||
Dictionary<string, object> _dat;
|
||||
_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(DAT);
|
||||
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 111 } },
|
||||
"WorkOrder ='" + DAT + "'", null);
|
||||
"WorkOrder ='" + _dat.GetValue("WorkOrder") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "'", null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++;
|
||||
}
|
||||
}
|
||||
}//回复的工单记录状态后就位111
|
||||
else if (SYSAPI == "SC811")
|
||||
{
|
||||
try
|
||||
{
|
||||
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 113 } },
|
||||
"WorkOrder ='" + DAT + "'", null);
|
||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||
Dictionary<string, object> _dat;
|
||||
_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(DAT);
|
||||
MainWindowViewModel.SQLiteHelpers.Update("WorkorderSteps", new Dictionary<string, object> { { "Mode", 1 } },
|
||||
"WorkOrder ='" + _dat.GetValue("Order") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "' AND Step ='" +
|
||||
_dat.GetValue("Step") + "'", null);
|
||||
|
||||
int x = MainWindowViewModel.SQLiteHelpers.ExecuteDataSet("select * from WorkorderSteps where WorkOrder='"+
|
||||
_dat.GetValue("Order") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "' AND Mode <> '1'", null).Tables[0].Rows.Count;
|
||||
if (x == 0)
|
||||
{
|
||||
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 113 } },
|
||||
"WorkOrder ='" + _dat.GetValue("Order") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "'", null);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||
}
|
||||
}//回复的工单明细状态后就位113
|
||||
else if (SYSAPI == "SC812")
|
||||
{
|
||||
try
|
||||
{
|
||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||
Dictionary<string, object> _dat;
|
||||
_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(DAT);
|
||||
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 101 } },
|
||||
"WorkOrder ='" + DAT + "'", null);
|
||||
"WorkOrder ='" + _dat.GetValue("WorkOrder") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "'", null);
|
||||
}
|
||||
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||
}
|
||||
}//回复的工单设置状态后就位101
|
||||
else if (SYSAPI == "SC827")
|
||||
{
|
||||
try
|
||||
@@ -427,7 +445,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
||||
_responseEvent.Reset();
|
||||
serialPortClients.Send(command); // 发送指令
|
||||
// 等待500毫秒或直到收到响应
|
||||
_responseEvent.Wait(TimeSpan.FromMilliseconds(500));
|
||||
_responseEvent.Wait(TimeSpan.FromMilliseconds(1000));
|
||||
// 重置事件状态
|
||||
_responseEvent.Set();
|
||||
//清楚了解状态
|
||||
|
||||
@@ -159,9 +159,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
||||
{
|
||||
try
|
||||
{
|
||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||
Dictionary<string, object> _dat;
|
||||
_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(DAT);
|
||||
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 111 } },
|
||||
"WorkOrder ='" + DAT + "'", null);
|
||||
"WorkOrder ='" + _dat.GetValue("WorkOrder") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "'", null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -173,8 +175,10 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
||||
try
|
||||
{
|
||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||
Dictionary<string, object> _dat;
|
||||
_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(DAT);
|
||||
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 113 } },
|
||||
"WorkOrder ='" + DAT + "'", null);
|
||||
"WorkOrder ='" + _dat.GetValue("WorkOrder") + "' AND ReDye ='"+ _dat.GetValue("ReDye") + "'", null);
|
||||
}
|
||||
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user