添加错误记录与计数器
This commit is contained in:
commit
e56ca33ecb
2 files changed
+62
-2
No files matched your search
@@ -28,6 +28,7 @@ using System.Xml.Linq;
|
|||||||
using ScottPlot;
|
using ScottPlot;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using DyeingComputer.UserClass;
|
using DyeingComputer.UserClass;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
||||||
{/// <summary>
|
{/// <summary>
|
||||||
@@ -99,6 +100,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
string SYSAPI = e.ByteBlock.Span.ToString(Encoding.ASCII).Substring(0, 5);
|
string SYSAPI = e.ByteBlock.Span.ToString(Encoding.ASCII).Substring(0, 5);
|
||||||
string DAT = e.ByteBlock.Span.ToString(Encoding.UTF8);
|
string DAT = e.ByteBlock.Span.ToString(Encoding.UTF8);
|
||||||
if (SYSAPI == "SC800")
|
if (SYSAPI == "SC800")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
Dictionary<string, object> Chart_new = new Dictionary<string, object>();//缓存函数
|
Dictionary<string, object> Chart_new = new Dictionary<string, object>();//缓存函数
|
||||||
@@ -113,7 +116,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
drEmployee.AcceptChanges();
|
drEmployee.AcceptChanges();
|
||||||
drEmployee.ClearErrors();
|
drEmployee.ClearErrors();
|
||||||
}
|
}
|
||||||
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
|
}
|
||||||
else if (SYSAPI == "SC810")
|
else if (SYSAPI == "SC810")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
@@ -122,7 +129,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
"WorkOrder ='" + DAT + "'", null);
|
"WorkOrder ='" + DAT + "'", null);
|
||||||
SQLiteHelpers.Close();
|
SQLiteHelpers.Close();
|
||||||
}
|
}
|
||||||
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
|
}
|
||||||
else if (SYSAPI == "SC811")
|
else if (SYSAPI == "SC811")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
@@ -130,8 +141,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 101 } },
|
SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 101 } },
|
||||||
"WorkOrder ='" + DAT + "'", null);
|
"WorkOrder ='" + DAT + "'", null);
|
||||||
SQLiteHelpers.Close();
|
SQLiteHelpers.Close();
|
||||||
|
}catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
}
|
}
|
||||||
else if (SYSAPI == "SC830")
|
else if (SYSAPI == "SC830")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
Dictionary<string, object> _new = new Dictionary<string, object>();//缓存函数
|
Dictionary<string, object> _new = new Dictionary<string, object>();//缓存函数
|
||||||
@@ -172,62 +186,107 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
SQLiteHelpers.Close();
|
SQLiteHelpers.Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
|
}
|
||||||
else if (SYSAPI == "SC831")
|
else if (SYSAPI == "SC831")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
MainWindowViewModel.dt_TP = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
MainWindowViewModel.dt_TP = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
||||||
}
|
}
|
||||||
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
|
}
|
||||||
else if (SYSAPI == "SC832")
|
else if (SYSAPI == "SC832")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
MainWindowViewModel.MachineLOG = DAT.Substring(DAT.IndexOf("]") + 1);
|
MainWindowViewModel.MachineLOG = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
|
}
|
||||||
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
}//当前细节信息
|
}//当前细节信息
|
||||||
else if (SYSAPI == "SC833")
|
else if (SYSAPI == "SC833")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
MainWindowViewModel.MachineLOG = DAT.Substring(DAT.IndexOf("]") + 1);
|
MainWindowViewModel.MachineLOG = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
|
}
|
||||||
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
}//当前领料单信息
|
}//当前领料单信息
|
||||||
else if (SYSAPI == "SC851")
|
else if (SYSAPI == "SC851")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
MainWindowViewModel.dt_d = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
MainWindowViewModel.dt_d = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
||||||
|
}
|
||||||
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
}//数字开关表
|
}//数字开关表
|
||||||
else if (SYSAPI == "SC852")
|
else if (SYSAPI == "SC852")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
MainWindowViewModel.dt_a = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
MainWindowViewModel.dt_a = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
||||||
|
}
|
||||||
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
}//寄存器表
|
}//寄存器表
|
||||||
else if (SYSAPI == "SC853")
|
else if (SYSAPI == "SC853")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
MainWindowViewModel.dt_m = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
MainWindowViewModel.dt_m = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
||||||
|
}
|
||||||
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
}//缓存表
|
}//缓存表
|
||||||
else if (SYSAPI == "SC854")
|
else if (SYSAPI == "SC854")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
MainWindowViewModel.dt_ParameterSet = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
MainWindowViewModel.dt_ParameterSet = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
||||||
|
}
|
||||||
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
}//程序设置表
|
}//程序设置表
|
||||||
else if (SYSAPI == "SC855")
|
else if (SYSAPI == "SC855")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
MainWindowViewModel.dt_SysSet = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
MainWindowViewModel.dt_SysSet = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
||||||
|
}
|
||||||
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
}//系统设置表
|
}//系统设置表
|
||||||
else if (SYSAPI == "SC910")
|
else if (SYSAPI == "SC910")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
SQLiteHelpers.Open(); //打开数据库
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 109 } },
|
SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 109 } },
|
||||||
"WorkOrder ='" + DAT + "'", null);
|
"WorkOrder ='" + DAT + "'", null);
|
||||||
SQLiteHelpers.Close();
|
SQLiteHelpers.Close();
|
||||||
|
}
|
||||||
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
}//发布失败
|
}//发布失败
|
||||||
else if (SYSAPI == "SC911")
|
else if (SYSAPI == "SC911")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
SQLiteHelpers.Open(); //打开数据库
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 119 } },
|
SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 119 } },
|
||||||
"WorkOrder ='" + DAT + "'", null);
|
"WorkOrder ='" + DAT + "'", null);
|
||||||
SQLiteHelpers.Close();
|
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;
|
return EasyTask.CompletedTask;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
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 UserControls.info[] inf = new UserControls.info[999]; //定义总览信息卡
|
public static UserControls.info[] inf = new UserControls.info[999]; //定义总览信息卡
|
||||||
|
public static int ERR_c = 0;//错误计数器
|
||||||
public MainWindowViewModel()
|
public MainWindowViewModel()
|
||||||
{
|
{
|
||||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
|
|||||||
Reference in new issue
Block a user