diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-08-06 13:03:05 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-08-06 13:03:05 +0300 |
| commit | 88407c1927faeabcec2b9c2699d657eb5723bc81 (patch) | |
| tree | 210f0877e20b401017b5f460e7f2f72dea8e91f8 /Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels | |
| parent | f9e3fb301b8b94529f14c8c3291d430cad5d71db (diff) | |
| download | Tango-88407c1927faeabcec2b9c2699d657eb5723bc81.tar.gz Tango-88407c1927faeabcec2b9c2699d657eb5723bc81.zip | |
Refactored data store to use DataStoreMessageType.
Diffstat (limited to 'Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs index 16fe59f61..a90d5aa26 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs @@ -17,6 +17,7 @@ using Tango.FSE.Common.Notifications; using Tango.FSE.MachineConfiguration.Dialogs; using Tango.FSE.MachineConfiguration.Messages; using Tango.FSE.MachineConfiguration.Models; +using Tango.PMR.DataStore; using static Tango.FSE.BL.Services.MachineConfigurationService; using static Tango.SharedUI.Controls.NavigationControl; @@ -209,7 +210,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels Date = DateTime.UtcNow, Guid = Guid.NewGuid().ToString(), Key = result.Input, - Type = DataType.Int32, + Type = Tango.DataStore.DataType.Int32, Value = 10 }); } @@ -332,6 +333,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels } catch (Exception ex) { + IsFree = true; DataStore = null; LogManager.Log(ex, "Error loading data store."); if (await NotificationProvider.ShowWarningQuestion($"Error occurred while trying to load the data store.\n{ex.FlattenMessage()}", "RETRY", "CANCEL")) @@ -392,14 +394,14 @@ namespace Tango.FSE.MachineConfiguration.ViewModels itemModel.Date = DateTime.Parse(item.Date); itemModel.IsSelected = true; - DataType type = (DataType)Enum.Parse(typeof(DataType), item.Type); + DataStore.DataType type = (DataStore.DataType)Enum.Parse(typeof(DataStore.DataType), item.Type); itemModel.OriginalType = type; itemModel.Type = type; - PMR.Common.MessageType? messageType = null; - if (type == DataType.Proto && item.MessageType.IsNotNullOrEmpty()) + DataStoreMessageType? messageType = null; + if (type == Tango.DataStore.DataType.Proto && item.MessageType.IsNotNullOrEmpty()) { - messageType = (PMR.Common.MessageType)Enum.Parse(typeof(PMR.Common.MessageType), item.MessageType); + messageType = (DataStoreMessageType)Enum.Parse(typeof(DataStoreMessageType), item.MessageType); } itemModel.OriginalValue = DataStoreHelper.ParseDataStoreValue(type, item.Value, messageType); @@ -500,9 +502,9 @@ namespace Tango.FSE.MachineConfiguration.ViewModels { foreach (var item in collection.Items.Where(x => x.IsSelected && !x.IsGlobal && x.Value != null)) { - PMR.Common.MessageType? messageType = null; + DataStoreMessageType? messageType = null; - if (item.Type == DataType.Proto) + if (item.Type == Tango.DataStore.DataType.Proto) { messageType = (item.Value as DataStoreProtoObject).MessageType; } |
