|
|
@ -28,6 +28,7 @@ using System.Xml.Linq; |
|
|
|
using ScottPlot; |
|
|
|
using System.Collections; |
|
|
|
using DyeingComputer.UserClass; |
|
|
|
using System.Windows; |
|
|
|
|
|
|
|
namespace SunlightCentralizedControlManagement_SCCM_.UserClass |
|
|
|
{/// <summary>
|
|
|
@ -99,6 +100,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass |
|
|
|
string SYSAPI = e.ByteBlock.Span.ToString(Encoding.ASCII).Substring(0, 5); |
|
|
|
string DAT = e.ByteBlock.Span.ToString(Encoding.UTF8); |
|
|
|
if (SYSAPI == "SC800") |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1); |
|
|
|
Dictionary<string, object> Chart_new = new Dictionary<string, object>();//缓存函数
|
|
|
@ -113,7 +116,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass |
|
|
|
drEmployee.AcceptChanges(); |
|
|
|
drEmployee.ClearErrors(); |
|
|
|
} |
|
|
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; } |
|
|
|
} |
|
|
|
else if (SYSAPI == "SC810") |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1); |
|
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
|
@ -122,7 +129,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass |
|
|
|
"WorkOrder ='" + DAT + "'", null); |
|
|
|
SQLiteHelpers.Close(); |
|
|
|
} |
|
|
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; } |
|
|
|
} |
|
|
|
else if (SYSAPI == "SC811") |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1); |
|
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
|
@ -130,8 +141,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass |
|
|
|
SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 101 } }, |
|
|
|
"WorkOrder ='" + DAT + "'", null); |
|
|
|
SQLiteHelpers.Close(); |
|
|
|
}catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; } |
|
|
|
} |
|
|
|
else if (SYSAPI == "SC830") |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1); |
|
|
|
Dictionary<string, object> _new = new Dictionary<string, object>();//缓存函数
|
|
|
@ -172,62 +186,107 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass |
|
|
|
SQLiteHelpers.Close(); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; } |
|
|
|
} |
|
|
|
else if (SYSAPI == "SC831") |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1); |
|
|
|
MainWindowViewModel.dt_TP = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
|
|
|
} |
|
|
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; } |
|
|
|
} |
|
|
|
else if (SYSAPI == "SC832") |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
MainWindowViewModel.MachineLOG = DAT.Substring(DAT.IndexOf("]") + 1); |
|
|
|
|
|
|
|
} |
|
|
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; } |
|
|
|
}//当前细节信息
|
|
|
|
else if (SYSAPI == "SC833") |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
MainWindowViewModel.MachineLOG = DAT.Substring(DAT.IndexOf("]") + 1); |
|
|
|
|
|
|
|
} |
|
|
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; } |
|
|
|
}//当前领料单信息
|
|
|
|
else if (SYSAPI == "SC851") |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1); |
|
|
|
MainWindowViewModel.dt_d = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
|
|
|
} |
|
|
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; } |
|
|
|
}//数字开关表
|
|
|
|
else if (SYSAPI == "SC852") |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1); |
|
|
|
MainWindowViewModel.dt_a = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
|
|
|
} |
|
|
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; } |
|
|
|
}//寄存器表
|
|
|
|
else if (SYSAPI == "SC853") |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1); |
|
|
|
MainWindowViewModel.dt_m = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
|
|
|
} |
|
|
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; } |
|
|
|
}//缓存表
|
|
|
|
else if (SYSAPI == "SC854") |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1); |
|
|
|
MainWindowViewModel.dt_ParameterSet = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
|
|
|
} |
|
|
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; } |
|
|
|
}//程序设置表
|
|
|
|
else if (SYSAPI == "SC855") |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1); |
|
|
|
MainWindowViewModel.dt_SysSet = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
|
|
|
} |
|
|
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; } |
|
|
|
}//系统设置表
|
|
|
|
else if (SYSAPI == "SC910") |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1); |
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
|
SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 109 } }, |
|
|
|
"WorkOrder ='" + DAT + "'", null); |
|
|
|
SQLiteHelpers.Close(); |
|
|
|
} |
|
|
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; } |
|
|
|
}//发布失败
|
|
|
|
else if (SYSAPI == "SC911") |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1); |
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
|
SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 119 } }, |
|
|
|
"WorkOrder ='" + DAT + "'", null); |
|
|
|
SQLiteHelpers.Close(); |
|
|
|
} |
|
|
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; } |
|
|
|
}//细节错误
|
|
|
|
else if (SYSAPI == "SC980") |
|
|
|
{ |
|
|
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1); |
|
|
|
MessageBox.Show(DAT); |
|
|
|
} |
|
|
|
|
|
|
|
return EasyTask.CompletedTask; |
|
|
|
}; |
|
|
|