diff --git a/MECF.Framework.Common/Aitex/Core/RT/SCCore/SC.cs b/MECF.Framework.Common/Aitex/Core/RT/SCCore/SC.cs index 277f9ac..8f92c97 100644 --- a/MECF.Framework.Common/Aitex/Core/RT/SCCore/SC.cs +++ b/MECF.Framework.Common/Aitex/Core/RT/SCCore/SC.cs @@ -11,29 +11,29 @@ namespace Aitex.Core.RT.SCCore private static Dictionary ModularManager { get; set; } = new Dictionary(); - public static void SetItemValue(string name, object value) + public static void SetItemValue(string name, object value, bool temporarily = false) { - Manager?.SetItemValue(name, value); + Manager?.SetItemValue(name, value, temporarily); } - public static void SetItemValue(string name, bool value) + public static void SetItemValue(string name, bool value, bool temporarily = false) { - Manager?.SetItemValue(name, value); + Manager?.SetItemValue(name, value, temporarily); } - public static void SetItemValue(string name, int value) + public static void SetItemValue(string name, int value, bool temporarily = false) { - Manager?.SetItemValue(name, value); + Manager?.SetItemValue(name, value, temporarily); } - public static void SetItemValue(string name, double value) + public static void SetItemValue(string name, double value, bool temporarily = false) { - Manager?.SetItemValue(name, value); + Manager?.SetItemValue(name, value, temporarily); } - public static void SetItemValue(string name, string value) + public static void SetItemValue(string name, string value, bool temporarily = false) { - Manager?.SetItemValue(name, value); + Manager?.SetItemValue(name, value, temporarily); } public static SCConfigItem GetConfigItem(string name) diff --git a/MECF.Framework.Common/MECF/Framework/Common/SCCore/ISCManager.cs b/MECF.Framework.Common/MECF/Framework/Common/SCCore/ISCManager.cs index 6705cdc..c0331ce 100644 --- a/MECF.Framework.Common/MECF/Framework/Common/SCCore/ISCManager.cs +++ b/MECF.Framework.Common/MECF/Framework/Common/SCCore/ISCManager.cs @@ -10,15 +10,15 @@ namespace MECF.Framework.Common.SCCore string GetStringValue(string name); - void SetItemValue(string name, object value); + void SetItemValue(string name, object value, bool temporarily = false); - void SetItemValue(string name, bool value); + void SetItemValue(string name, bool value, bool temporarily = false); - void SetItemValue(string name, int value); + void SetItemValue(string name, int value, bool temporarily = false); - void SetItemValue(string name, double value); + void SetItemValue(string name, double value, bool temporarily = false); - void SetItemValue(string name, string value); + void SetItemValue(string name, string value, bool temporarily = false); SCConfigItem GetConfigItem(string name); diff --git a/MECF.Framework.Common/MECF/Framework/Common/SCCore/SystemConfigManager.cs b/MECF.Framework.Common/MECF/Framework/Common/SCCore/SystemConfigManager.cs index 01987ad..87c6358 100644 --- a/MECF.Framework.Common/MECF/Framework/Common/SCCore/SystemConfigManager.cs +++ b/MECF.Framework.Common/MECF/Framework/Common/SCCore/SystemConfigManager.cs @@ -6,18 +6,13 @@ using System.IO; using System.Linq; using System.Text; using System.Xml; -using System.Xml.Linq; using Aitex.Common.Util; using Aitex.Core.RT.ConfigCenter; -using Aitex.Core.RT.DBCore; using Aitex.Core.RT.Event; using Aitex.Core.RT.Log; using Aitex.Core.RT.OperationCenter; using Aitex.Core.RT.SCCore; using Aitex.Core.Util; -using DocumentFormat.OpenXml.Vml.Spreadsheet; -using DocumentFormat.OpenXml.Wordprocessing; -using MECF.Framework.Common.Equipment; using MECF.Framework.Common.FAServices; using MECF.Framework.Common.MECF.Framework.Common.SCCore; @@ -564,57 +559,57 @@ namespace MECF.Framework.Common.SCCore return scItem?.SafeSetValue(value) ?? false; } - public void SetItemValue(string name, object value) + public void SetItemValue(string name, object value, bool temporarily) { Debug.Assert(_items.ContainsKey(name), "can not find sc name, " + name); if (!_items.ContainsKey(name)) return; - if (_items[name].SetValue(value)) + if (_items[name].SetValue(value) && !temporarily) { GenerateDataFile(); } } /// - public void SetItemValue(string name, bool value) + public void SetItemValue(string name, bool value, bool temporarily) { Debug.Assert(_items.ContainsKey(name), "can not find sc name, " + name); Debug.Assert(_items[name].Type == "Bool", "sc type not bool, defined as" + _items[name].Type); - if (_items[name].SetValue(value)) + if (_items[name].SetValue(value) && !temporarily) { GenerateDataFile(); } } /// - public void SetItemValue(string name, int value) + public void SetItemValue(string name, int value, bool temporarily) { Debug.Assert(_items.ContainsKey(name), "can not find sc name, " + name); Debug.Assert(_items[name].Type == "Integer", "sc type not bool, defined as" + _items[name].Type); - if (_items[name].SetValue(value)) + if (_items[name].SetValue(value) && !temporarily) { GenerateDataFile(); } } /// - public void SetItemValue(string name, double value) + public void SetItemValue(string name, double value, bool temporarily) { Debug.Assert(_items.ContainsKey(name), "can not find sc name, " + name); Debug.Assert(_items[name].Type == "Double", "sc type not bool, defined as" + _items[name].Type); - if (_items[name].SetValue(value)) + if (_items[name].SetValue(value) && !temporarily) { GenerateDataFile(); } } /// - public void SetItemValue(string name, string value) + public void SetItemValue(string name, string value, bool temporarily) { Debug.Assert(_items.ContainsKey(name), "can not find sc name, " + name); - if (_items[name].SetValue(value)) + if (_items[name].SetValue(value) && !temporarily) { GenerateDataFile(); }