diff --git a/ConvertMoels/StatexmlConvert.cs b/ConvertMoels/StatexmlConvert.cs
index 345634e..3318486 100644
--- a/ConvertMoels/StatexmlConvert.cs
+++ b/ConvertMoels/StatexmlConvert.cs
@@ -29,7 +29,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ConvertMoels
else if (i == "800") Staten = "LinkOff";//未连接
else if (i == "801") Staten = "Link";//连接成功
else if (i == "899") Staten = "LinkOff";//关闭连接
- else if (i == "TRUE") Staten = "Lock";//锁
+ else if (i == "True") Staten = "Lock";//锁
return Staten;
}
diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs
index ed6bcfb..7ca5bfa 100644
--- a/Properties/Resources.Designer.cs
+++ b/Properties/Resources.Designer.cs
@@ -2688,6 +2688,24 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
+ ///
+ /// 查找类似 user_lock 的本地化字符串。
+ ///
+ public static string user_lock {
+ get {
+ return ResourceManager.GetString("user_lock", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 user_unlock 的本地化字符串。
+ ///
+ public static string user_unlock {
+ get {
+ return ResourceManager.GetString("user_unlock", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Valid time 的本地化字符串。
///
diff --git a/Properties/Resources.en-US.resx b/Properties/Resources.en-US.resx
index 3e2a764..86bf1c9 100644
--- a/Properties/Resources.en-US.resx
+++ b/Properties/Resources.en-US.resx
@@ -1050,4 +1050,10 @@
The machine is not ready
+
+ LOCK
+
+
+ UNLOCK
+
\ No newline at end of file
diff --git a/Properties/Resources.resx b/Properties/Resources.resx
index 90b5c33..3c4fb23 100644
--- a/Properties/Resources.resx
+++ b/Properties/Resources.resx
@@ -1050,4 +1050,10 @@
The machine is not ready
+
+ user_lock
+
+
+ user_unlock
+
\ No newline at end of file
diff --git a/Properties/Resources.zh-CN.resx b/Properties/Resources.zh-CN.resx
index 840cbb8..3c2bf15 100644
--- a/Properties/Resources.zh-CN.resx
+++ b/Properties/Resources.zh-CN.resx
@@ -1050,4 +1050,10 @@
机台未就绪
+
+ 锁定
+
+
+ 解锁
+
\ No newline at end of file
diff --git a/Properties/Resources.zh-TW.resx b/Properties/Resources.zh-TW.resx
index 4adedbd..684eccd 100644
--- a/Properties/Resources.zh-TW.resx
+++ b/Properties/Resources.zh-TW.resx
@@ -1050,4 +1050,10 @@
機台未就緒
+
+
+
+
+
+
\ No newline at end of file
diff --git a/UserClass/AsyncTcpClient.cs b/UserClass/AsyncTcpClient.cs
index 6d2c3e4..5437742 100644
--- a/UserClass/AsyncTcpClient.cs
+++ b/UserClass/AsyncTcpClient.cs
@@ -74,6 +74,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
drEmployee["Process"] = "";
drEmployee["Step"] = "";
drEmployee["Message"] = "";
+ drEmployee["SYSKEY"] = "";
drEmployee.EndEdit();
drEmployee.AcceptChanges();
LogGing.LogGingDATA("[IP='" + client.IP + "' AND port='" + client.Port + "']=Link_STOP");
@@ -98,6 +99,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
drEmployee["Process"] = "";
drEmployee["Step"] = "";
drEmployee["Message"] = "";
+ drEmployee["SYSKEY"] = "";
drEmployee.EndEdit();
drEmployee.AcceptChanges();
LogGing.LogGingDATA("[IP='" + client.IP + "' AND port='" + client.Port + "']=Link_INTERRUPT");
@@ -133,7 +135,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
{
LogGing.ERRDATA(ex); MainWindowViewModel.ERR_c++;
}
-
}
else if (SYSAPI == "SC810")
{
@@ -174,6 +175,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
_new = JsonConvert.DeserializeObject>(DAT);//反序列化
DataRow drEmployee = MainWindowViewModel.Machines.Select("IP='" + client.IP + "'").First();
drEmployee.BeginEdit();
+ drEmployee["LOCK"] = _new.GetValue("LOCK");
drEmployee["Message"] = _new.GetValue("Status");
drEmployee["WorkOrder"] = _new.GetValue("WorkNumder");
drEmployee["Temperature"] = _new.GetValue("MTT");
@@ -209,7 +211,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
}
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
- }
+ }//当前信息
else if (SYSAPI == "SC831")
{
try
diff --git a/View/MachinesView.xaml.cs b/View/MachinesView.xaml.cs
index a2a3425..ea4be47 100644
--- a/View/MachinesView.xaml.cs
+++ b/View/MachinesView.xaml.cs
@@ -460,50 +460,54 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
}
public ObservableCollection ToObservableCollection(DataTable dt) where T : class, new()
{
- Type t = typeof(T);
- PropertyInfo[] propertys = t.GetProperties();
- ObservableCollection lst = new ObservableCollection();
- string typeName = string.Empty;
- foreach (DataRow dr in dt.Rows)
+ try
{
- T entity = new T();
- foreach (PropertyInfo pi in propertys)
+ Type t = typeof(T);
+ PropertyInfo[] propertys = t.GetProperties();
+ ObservableCollection lst = new ObservableCollection();
+ string typeName = string.Empty;
+ foreach (DataRow dr in dt.Rows)
{
- typeName = pi.Name;
- if (dt.Columns.Contains(typeName))
+ T entity = new T();
+ foreach (PropertyInfo pi in propertys)
{
- if (!pi.CanWrite) continue;
- object value = dr[typeName];
- if (value == DBNull.Value) continue;
- if (pi.PropertyType == typeof(string))
+ typeName = pi.Name;
+ if (dt.Columns.Contains(typeName))
{
- pi.SetValue(entity, value.ToString(), null);
- }
- else if (pi.PropertyType == typeof(int) || pi.PropertyType == typeof(int?))
- {
- pi.SetValue(entity, int.Parse(value.ToString()), null);
- }
- else if (pi.PropertyType == typeof(DateTime?) || pi.PropertyType == typeof(DateTime))
- {
- pi.SetValue(entity, DateTime.Parse(value.ToString()), null);
- }
- else if (pi.PropertyType == typeof(float))
- {
- pi.SetValue(entity, float.Parse(value.ToString()), null);
- }
- else if (pi.PropertyType == typeof(double))
- {
- pi.SetValue(entity, double.Parse(value.ToString()), null);
- }
- else
- {
- pi.SetValue(entity, value, null);
+ if (!pi.CanWrite) continue;
+ object value = dr[typeName];
+ if (value == DBNull.Value) continue;
+ if (pi.PropertyType == typeof(string))
+ {
+ pi.SetValue(entity, value.ToString(), null);
+ }
+ else if (pi.PropertyType == typeof(int) || pi.PropertyType == typeof(int?))
+ {
+ pi.SetValue(entity, int.Parse(value.ToString()), null);
+ }
+ else if (pi.PropertyType == typeof(DateTime?) || pi.PropertyType == typeof(DateTime))
+ {
+ pi.SetValue(entity, DateTime.Parse(value.ToString()), null);
+ }
+ else if (pi.PropertyType == typeof(float))
+ {
+ pi.SetValue(entity, float.Parse(value.ToString()), null);
+ }
+ else if (pi.PropertyType == typeof(double))
+ {
+ pi.SetValue(entity, double.Parse(value.ToString()), null);
+ }
+ else
+ {
+ pi.SetValue(entity, value, null);
+ }
}
}
+ lst.Add(entity);
}
- lst.Add(entity);
+ return lst;
}
- return lst;
- }
+ catch (Exception) { return null; }
+ }
}
}
diff --git a/View/MonitorView.xaml.cs b/View/MonitorView.xaml.cs
index fdb3991..05b1bdf 100644
--- a/View/MonitorView.xaml.cs
+++ b/View/MonitorView.xaml.cs
@@ -119,7 +119,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
else
{
MessageBox.Show(Properties.Resources.TMNR, "800", MessageBoxButton.OK, MessageBoxImage.Information); //
-
}
}
@@ -226,15 +225,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
Dictionary dat_821 = new Dictionary();
dat_821.Clear();
- if (mode != "TRUE")
+ if (mode != "True")
{
- dat_821.Add("LOCK", "TRUE");
- MainWindowViewModel.Updata_Machines(MainWindowViewModel.Machines, "LOCK", "Name='" + machine + "'", "TRUE");
- }
+ dat_821.Add("LOCK", "True");
+ MainWindowViewModel.Updata_Machines(MainWindowViewModel.Machines, "LOCK", "Name='" + machine + "'", "True");
+ }
else
{
dat_821.Add("LOCK", "FALSE");
- MainWindowViewModel.Updata_Machines(MainWindowViewModel.Machines, "LOCK", "Name='" + machine + "'", "FALSE");
+ MainWindowViewModel.Updata_Machines(MainWindowViewModel.Machines, "LOCK", "Name='" + machine + "'", "False");
}
DataRow drEmployee = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First();
@@ -245,6 +244,10 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
DAT = "SC829" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", "ID='" + index + "'") + dat_821.ToJsonString()
});
+ if (mode != "True") { MessageBox.Show(machine + Properties.Resources.user_lock, "800", MessageBoxButton.OK, MessageBoxImage.Information);
+ } else {
+ MessageBox.Show(machine + Properties.Resources.user_unlock, "800", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
}//锁定
private void ListViewItem_Curve(object sender, MouseButtonEventArgs e)
{
@@ -599,7 +602,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
catch (Exception) { }
try
{
- if (MainWindowViewModel.dt_TP.Rows.Count >= 0)
+ if (MainWindowViewModel.dt_TP.Rows.Count > 0)
{
if (TechnologicalProcess_bool)
{
@@ -665,50 +668,54 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
public ObservableCollection ToObservableCollection(DataTable dt) where T : class, new()
{
- Type t = typeof(T);
- PropertyInfo[] propertys = t.GetProperties();
- ObservableCollection lst = new ObservableCollection();
- string typeName = string.Empty;
- foreach (DataRow dr in dt.Rows)
+ try
{
- T entity = new T();
- foreach (PropertyInfo pi in propertys)
+ Type t = typeof(T);
+ PropertyInfo[] propertys = t.GetProperties();
+ ObservableCollection lst = new ObservableCollection();
+ string typeName = string.Empty;
+ foreach (DataRow dr in dt.Rows)
{
- typeName = pi.Name;
- if (dt.Columns.Contains(typeName))
+ T entity = new T();
+ foreach (PropertyInfo pi in propertys)
{
- if (!pi.CanWrite) continue;
- object value = dr[typeName];
- if (value == DBNull.Value) continue;
- if (pi.PropertyType == typeof(string))
- {
- pi.SetValue(entity, value.ToString(), null);
- }
- else if (pi.PropertyType == typeof(int) || pi.PropertyType == typeof(int?))
- {
- pi.SetValue(entity, int.Parse(value.ToString()), null);
- }
- else if (pi.PropertyType == typeof(DateTime?) || pi.PropertyType == typeof(DateTime))
- {
- pi.SetValue(entity, DateTime.Parse(value.ToString()), null);
- }
- else if (pi.PropertyType == typeof(float))
+ typeName = pi.Name;
+ if (dt.Columns.Contains(typeName))
{
- pi.SetValue(entity, float.Parse(value.ToString()), null);
- }
- else if (pi.PropertyType == typeof(double))
- {
- pi.SetValue(entity, double.Parse(value.ToString()), null);
- }
- else
- {
- pi.SetValue(entity, value, null);
+ if (!pi.CanWrite) continue;
+ object value = dr[typeName];
+ if (value == DBNull.Value) continue;
+ if (pi.PropertyType == typeof(string))
+ {
+ pi.SetValue(entity, value.ToString(), null);
+ }
+ else if (pi.PropertyType == typeof(int) || pi.PropertyType == typeof(int?))
+ {
+ pi.SetValue(entity, int.Parse(value.ToString()), null);
+ }
+ else if (pi.PropertyType == typeof(DateTime?) || pi.PropertyType == typeof(DateTime))
+ {
+ pi.SetValue(entity, DateTime.Parse(value.ToString()), null);
+ }
+ else if (pi.PropertyType == typeof(float))
+ {
+ pi.SetValue(entity, float.Parse(value.ToString()), null);
+ }
+ else if (pi.PropertyType == typeof(double))
+ {
+ pi.SetValue(entity, double.Parse(value.ToString()), null);
+ }
+ else
+ {
+ pi.SetValue(entity, value, null);
+ }
}
}
+ lst.Add(entity);
}
- lst.Add(entity);
+ return lst;
}
- return lst;
+ catch (Exception) { return null; }
}
}
diff --git a/ViewModel/MainWindowViewModel.cs b/ViewModel/MainWindowViewModel.cs
index efc7a30..090cd69 100644
--- a/ViewModel/MainWindowViewModel.cs
+++ b/ViewModel/MainWindowViewModel.cs
@@ -177,7 +177,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
void Tick_Main_1S(object sender, EventArgs e)//Tick_Event周期执行事件1S
{
- DATA_view();
//下传工单信息
SQLiteHelper WorkOrderSQL = new SQLiteHelper(DBAddress); //数据库连接路径
WorkOrderSQL.Open(); //打开数据库
@@ -239,11 +238,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
});//信息插入队列
string mode = Machines.Select("ID='" + i + "'").First().Field("LOCK");//发送锁定状态
- if (mode == "TRUE")
+ if (mode == "True")
{
Dictionary dat_821 = new Dictionary();
dat_821.Clear();
- dat_821.Add("LOCK", "TRUE");
+ dat_821.Add("LOCK", "True");
DataRow drEmployee = Machines.Select("ID='" + i + "'").First();
int index = Convert.ToInt16(drEmployee.Field