diff --git a/MECF.Framework.Common/Aitex/Core/RT/DataCenter/DATA.cs b/MECF.Framework.Common/Aitex/Core/RT/DataCenter/DATA.cs index f7ccf7b..4f22f47 100644 --- a/MECF.Framework.Common/Aitex/Core/RT/DataCenter/DATA.cs +++ b/MECF.Framework.Common/Aitex/Core/RT/DataCenter/DATA.cs @@ -53,7 +53,15 @@ namespace Aitex.Core.RT.DataCenter } } - public static object Poll(string paramName) + public static void CancelSubscribe(string moduleKey) + { + if (InnerDataManager != null) + { + InnerDataManager.CancelSubscribe(moduleKey); + } + } + + public static object Poll(string paramName) { return (InnerDataManager == null) ? null : InnerDataManager.Poll(paramName); } diff --git a/MECF.Framework.Common/Aitex/Core/RT/DataCenter/DataManager.cs b/MECF.Framework.Common/Aitex/Core/RT/DataCenter/DataManager.cs index a700478..a0b98bc 100644 --- a/MECF.Framework.Common/Aitex/Core/RT/DataCenter/DataManager.cs +++ b/MECF.Framework.Common/Aitex/Core/RT/DataCenter/DataManager.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Threading.Tasks; +using System.Windows; using Aitex.Core.RT.ConfigCenter; using Aitex.Core.RT.DBCore; using Aitex.Core.RT.Log; @@ -193,7 +194,24 @@ namespace Aitex.Core.RT.DataCenter } } - public void Subscribe(string key, DataItem dataItem, SubscriptionAttribute.FLAG flag) + public void CancelSubscribe(string key) + { + if (_keyValueMap.ContainsKey(key)) + { + var value = new DataItem(() => ""); + _keyValueMap.TryRemove(key, out value); + } + if (_dbRecorderList.ContainsKey(key)) + { + lock (_locker) + { + _dbRecorderList.Remove(key); + } + } + + } + + public void Subscribe(string key, DataItem dataItem, SubscriptionAttribute.FLAG flag) { if (string.IsNullOrWhiteSpace(key)) { diff --git a/MECF.Framework.Common/Aitex/Core/RT/DataCenter/ICommonData.cs b/MECF.Framework.Common/Aitex/Core/RT/DataCenter/ICommonData.cs index 858bd66..746961f 100644 --- a/MECF.Framework.Common/Aitex/Core/RT/DataCenter/ICommonData.cs +++ b/MECF.Framework.Common/Aitex/Core/RT/DataCenter/ICommonData.cs @@ -12,7 +12,9 @@ namespace Aitex.Core.RT.DataCenter void Subscribe(string moduleKey, DataItem dataItem, SubscriptionAttribute.FLAG flag); - object Poll(string key); + void CancelSubscribe(string moduleKey); + + object Poll(string key); Dictionary PollData(IEnumerable keys); diff --git a/MECF.Framework.Common/MECF/Framework/Common/DBCore/RuntimeDataRecorder.cs b/MECF.Framework.Common/MECF/Framework/Common/DBCore/RuntimeDataRecorder.cs index ada7276..eee3e35 100644 --- a/MECF.Framework.Common/MECF/Framework/Common/DBCore/RuntimeDataRecorder.cs +++ b/MECF.Framework.Common/MECF/Framework/Common/DBCore/RuntimeDataRecorder.cs @@ -1,6 +1,7 @@ using System; using System.Data; using Aitex.Core.RT.DBCore; +using DocumentFormat.OpenXml.Office.Word; namespace MECF.Framework.Common.DBCore { @@ -26,29 +27,28 @@ namespace MECF.Framework.Common.DBCore } } - public static void UpdateElapseTimePM(string pmName, int minutes) + public static void UpdateElapseTimePM(string pmName, int second) { - string cmdText = $"Select \"guid\",\"elapse_minutes\" from \"runtime_data\" where \"ispm\"='true' and \"device_name\"='{pmName}';"; + string cmdText = $"Select \"Process_Seconds\" from \"runtime_data\" where \"Module\"='{pmName}';"; DataSet dataSet = DB.ExecuteDataSet(cmdText); - if (dataSet != null && dataSet.Tables != null && dataSet.Tables[0].Rows.Count > 0) + if (dataSet != null && dataSet.Tables != null && dataSet.Tables.Count == 1 && dataSet.Tables[0].Rows.Count == 1) { - cmdText = ""; - for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++) - { - long num = Convert.ToInt64(dataSet.Tables[0].Rows[i]["elapse_minutes"].ToString()) + minutes; - string arg = dataSet.Tables[0].Rows[i]["guid"].ToString(); - cmdText += $"Update \"runtime_data\" set \"elapse_minutes\"='{num}' where \"guid\"='{arg}';"; - } - if (!string.IsNullOrEmpty(cmdText)) - { - DB.InsertSql(cmdText); - } - } + long num = Convert.ToInt64(dataSet.Tables[0].Rows[0]["Process_Seconds"].ToString()) + second; + cmdText = $"Update \"runtime_data\" set \"Process_Seconds\"='{num}' where \"Module\"='{pmName}';"; + DB.ExecuteNonQuery(cmdText); + } else { - cmdText = $"INSERT INTO \"runtime_data\" (\"guid\", \"device_name\", \"set_minutes\" , \"elapse_minutes\", \"ispm\" )VALUES ('{Guid.NewGuid()}', '{pmName}', {0}, {minutes}, 'true');"; - DB.InsertSql(cmdText); - } + cmdText = $"INSERT INTO \"runtime_data\" ( \"Module\", \"Process_Seconds\")VALUES ('{pmName}',{second});"; + DB.ExecuteNonQuery(cmdText); + } } - } + + public static void ResetElapseTimePM(string pmName) + { + string cmdText = $"Update \"runtime_data\" set \"Process_Seconds\"='{0}' where \"Module\"='{pmName}';"; + DB.ExecuteNonQuery(cmdText); + } + + } } diff --git a/MECF.Framework.Common/MECF/Framework/Common/DBCore/ThinknessDataRecorder.cs b/MECF.Framework.Common/MECF/Framework/Common/DBCore/ThinknessDataRecorder.cs index e10ef84..cb949d3 100644 --- a/MECF.Framework.Common/MECF/Framework/Common/DBCore/ThinknessDataRecorder.cs +++ b/MECF.Framework.Common/MECF/Framework/Common/DBCore/ThinknessDataRecorder.cs @@ -11,11 +11,11 @@ namespace MECF.Framework.Common.DBCore DB.InsertSql(sql); } - public static void InsertPMThinkness(string pmName, int coating1, int max1, int coating2, int max2) + public static void InsertPMThinkness(string startdate, string pmName, double thickness) { - string text = Guid.NewGuid().ToString(); - string sql = $"INSERT INTO \"pm_thickness_data\"(\"guid\", \"pm_name\", \"coating1\", \"max1\", \"coating2\", \"max2\") VALUES ('{text}', '{pmName}', '{coating1}', '{max1}', '{coating2}', '{max2}');"; - DB.InsertSql(sql); - } + string sql = $"INSERT INTO \"pm_thickness_data\"(\"startdate\", \"pm_name\", \"thickness\") VALUES ('{startdate}', '{pmName}', '{thickness}');"; + DB.ExecuteNonQuery(sql); + + } } } diff --git a/MECF.Framework.UI.Client/Resources/Images/add.png b/MECF.Framework.UI.Client/Resources/Images/add.png new file mode 100644 index 0000000..cff0ccd Binary files /dev/null and b/MECF.Framework.UI.Client/Resources/Images/add.png differ diff --git a/MECF.Framework.UI.Client/Resources/Images/delete.png b/MECF.Framework.UI.Client/Resources/Images/delete.png new file mode 100644 index 0000000..af041f8 Binary files /dev/null and b/MECF.Framework.UI.Client/Resources/Images/delete.png differ diff --git a/MECF.Framework.UI.Client/Resources/Images/done.png b/MECF.Framework.UI.Client/Resources/Images/done.png new file mode 100644 index 0000000..d3bf239 Binary files /dev/null and b/MECF.Framework.UI.Client/Resources/Images/done.png differ diff --git a/MECF.Framework.UI.Client/Resources/Images/down.png b/MECF.Framework.UI.Client/Resources/Images/down.png new file mode 100644 index 0000000..ae5cbeb Binary files /dev/null and b/MECF.Framework.UI.Client/Resources/Images/down.png differ diff --git a/MECF.Framework.UI.Client/Resources/Images/file.png b/MECF.Framework.UI.Client/Resources/Images/file.png new file mode 100644 index 0000000..eacb8af Binary files /dev/null and b/MECF.Framework.UI.Client/Resources/Images/file.png differ diff --git a/MECF.Framework.UI.Client/Resources/Images/undone.png b/MECF.Framework.UI.Client/Resources/Images/undone.png new file mode 100644 index 0000000..3e9dc4a Binary files /dev/null and b/MECF.Framework.UI.Client/Resources/Images/undone.png differ diff --git a/MECF.Framework.UI.Client/Resources/Images/undonered.png b/MECF.Framework.UI.Client/Resources/Images/undonered.png new file mode 100644 index 0000000..8533862 Binary files /dev/null and b/MECF.Framework.UI.Client/Resources/Images/undonered.png differ diff --git a/MECF.Framework.UI.Client/Resources/Images/up.png b/MECF.Framework.UI.Client/Resources/Images/up.png new file mode 100644 index 0000000..37b4748 Binary files /dev/null and b/MECF.Framework.UI.Client/Resources/Images/up.png differ