diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-09-04 22:43:27 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-09-04 22:43:27 +0300 |
| commit | c7043303d96ec48af6af105a93d80dca2aed627b (patch) | |
| tree | 91d0279bb75b1c084857a1ef544c293c31fa31cc /Software/Visual_Studio | |
| parent | 916d7f42b72eef37b590663b5964dcdec7065e5d (diff) | |
| download | Tango-c7043303d96ec48af6af105a93d80dca2aed627b.tar.gz Tango-c7043303d96ec48af6af105a93d80dca2aed627b.zip | |
Fixed issue with insights settings persistence.
ObjectCreationHandling.
Diffstat (limited to 'Software/Visual_Studio')
6 files changed, 13 insertions, 9 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Config/AnnotationsConfiguration.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Config/AnnotationsConfiguration.cs index fc7b5259c..5d38f8a3b 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Config/AnnotationsConfiguration.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Config/AnnotationsConfiguration.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; @@ -54,6 +55,7 @@ namespace Tango.FSE.Insights.Config } private ObservableCollection<EventTypeCategories> _eventsCategories; + [JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace)] public ObservableCollection<EventTypeCategories> EventsCategories { get { return _eventsCategories; } @@ -61,6 +63,7 @@ namespace Tango.FSE.Insights.Config } private ObservableCollection<EventTypeGroups> _eventsGroups; + [JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace)] public ObservableCollection<EventTypeGroups> EventsGroups { get { return _eventsGroups; } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/InsightsSettings.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/InsightsSettings.cs index e96167b30..a34796b6a 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/InsightsSettings.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/InsightsSettings.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -15,12 +16,13 @@ namespace Tango.FSE.Insights public List<TechMonitors> VisibleMonitors { get; set; } public bool DisplayAnnotations { get; set; } public int DefaultDiffDays { get; set; } + public AnnotationsConfiguration AnnotationsConfiguration { get; set; } public InsightsSettings() { - VisibleMonitors = new List<TechMonitors>(); DefaultDiffDays = 7; + VisibleMonitors = new List<TechMonitors>(); AnnotationsConfiguration = AnnotationsConfiguration.CreateDefault(); } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Tango.FSE.Insights.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Tango.FSE.Insights.csproj index 8d8d2b9fb..1599d484a 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Tango.FSE.Insights.csproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/Tango.FSE.Insights.csproj @@ -85,9 +85,8 @@ <Reference Include="Microsoft.ML.Transforms, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <HintPath>..\..\..\packages\Microsoft.ML.1.5.1\lib\netstandard2.0\Microsoft.ML.Transforms.dll</HintPath> </Reference> - <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> - <HintPath>..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> - <Private>False</Private> + <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> </Reference> <Reference Include="SciChart.Charting, Version=6.2.1.13304, Culture=neutral, PublicKeyToken=b55dd9efe817e823, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/ViewModels/InsightsViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/ViewModels/InsightsViewVM.cs index e200ba409..cb41974e1 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/ViewModels/InsightsViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/ViewModels/InsightsViewVM.cs @@ -236,7 +236,6 @@ namespace Tango.FSE.Insights.ViewModels VisibleCharts = new ObservableCollection<InsightsChart>(); Annotations = new AnnotationCollection(); AnnotationsConfiguration = AnnotationsConfiguration.CreateDefault(); - InitEventsSelection(); GetInsightsCommand = new RelayCommand(GetInsights, () => IsFree); PeekApplicationLogsCommand = new RelayCommand<InsightReadyBase>(PeekAnnotationApplicationLogs); @@ -267,6 +266,7 @@ namespace Tango.FSE.Insights.ViewModels DisplayAnnotations = ModuleSettings.DisplayAnnotations; AnnotationsConfiguration = ModuleSettings.AnnotationsConfiguration; + InitEventsSelection(); MachineProvider.MachineConnected += MachineProvider_MachineConnected; } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/packages.config b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/packages.config index e06be2064..3bd90bbb3 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/packages.config +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Insights/packages.config @@ -11,7 +11,7 @@ <package id="Microsoft.ML.DataView" version="1.5.1" targetFramework="net461" /> <package id="Microsoft.ML.Mkl.Redist" version="1.5.1" targetFramework="net461" /> <package id="Microsoft.ML.TimeSeries" version="1.5.1" targetFramework="net461" /> - <package id="Newtonsoft.Json" version="12.0.3" targetFramework="net461" /> + <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" /> <package id="System.Buffers" version="4.5.1" targetFramework="net461" /> <package id="System.CodeDom" version="4.7.0" targetFramework="net461" /> <package id="System.Collections.Immutable" version="1.7.1" targetFramework="net461" /> diff --git a/Software/Visual_Studio/Tango.Settings/SettingsManager.cs b/Software/Visual_Studio/Tango.Settings/SettingsManager.cs index d106ebaca..350bdf790 100644 --- a/Software/Visual_Studio/Tango.Settings/SettingsManager.cs +++ b/Software/Visual_Studio/Tango.Settings/SettingsManager.cs @@ -69,7 +69,7 @@ namespace Tango.Settings Error = (sender, args) => { args.ErrorContext.Handled = true; - Logging.LogManager.Default.Log(args.ErrorContext.Error.Message); + LogManager.Default.Log(args.ErrorContext.Error.Message, LogCategory.Error); } }; |
