aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs16
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs15
3 files changed, 26 insertions, 6 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs
new file mode 100644
index 000000000..73d979662
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Settings;
+
+namespace Tango.MachineStudio.Developer
+{
+ public class DeveloperModuleSettings : SettingsBase
+ {
+ public String LastSelectedMachineGuid { get; set; }
+
+ public String LastSelectedJobGuid { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj
index ddea73858..5a81c358f 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj
@@ -108,6 +108,7 @@
<Compile Include="Converters\SegmentToGradientStopsConverterMulti.cs" />
<Compile Include="Converters\SegmentToGradientStopsConverter.cs" />
<Compile Include="DeveloperModule.cs" />
+ <Compile Include="DeveloperModuleSettings.cs" />
<Compile Include="Navigation\DeveloperNavigationManager.cs" />
<Compile Include="Navigation\DeveloperNavigationView.cs" />
<Compile Include="ViewModelLocator.cs" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
index 739f0bcde..106848b7a 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
@@ -63,6 +63,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
private ISpeechProvider _speech;
private DataCapture.ViewModels.MainViewVM _dataCaptureVM;
private bool _isRecording;
+ private DeveloperModuleSettings _settings;
#region Properties
@@ -620,6 +621,8 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// <param name="notificationProvider">The notification provider.</param>
public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IDiagnosticsFrameProvider diagnosticsFrameProvider, IVideoCaptureProvider videoCaptureProvider, DeveloperNavigationManager navigation, IAuthenticationProvider authentication, IEventLogger eventLogger, ISpeechProvider speech)
{
+ _settings = SettingsManager.Default.GetOrCreate<DeveloperModuleSettings>();
+
SelectedJobs = new ObservableCollection<Job>();
JobEvents = new ObservableCollection<MachinesEvent>();
@@ -629,16 +632,16 @@ namespace Tango.MachineStudio.Developer.ViewModels
Machines = _machineDbContext.Machines.ToObservableCollection();
- if (SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedMachineGuid != null)
+ if (_settings.LastSelectedMachineGuid != null)
{
LogManager.Log("Setting last selected machine from settings...");
- SelectedMachine = _machineDbContext.Machines.SingleOrDefault(x => x.Guid == SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedMachineGuid);
+ SelectedMachine = _machineDbContext.Machines.SingleOrDefault(x => x.Guid == _settings.LastSelectedMachineGuid);
}
- if (SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedJobGuid != null && SelectedMachine != null)
+ if (_settings.LastSelectedJobGuid != null && SelectedMachine != null)
{
LogManager.Log("Setting last selected job from settings...");
- SelectedMachineJob = SelectedMachine.Jobs.SingleOrDefault(x => x.Guid == SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedJobGuid);
+ SelectedMachineJob = SelectedMachine.Jobs.SingleOrDefault(x => x.Guid == _settings.LastSelectedJobGuid);
}
_authentication = authentication;
@@ -1907,8 +1910,8 @@ namespace Tango.MachineStudio.Developer.ViewModels
public override void OnShuttingDown()
{
- SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedMachineGuid = SelectedMachine != null ? SelectedMachine.Guid : null;
- SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedJobGuid = SelectedMachineJob != null ? SelectedMachineJob.Guid : null;
+ _settings.LastSelectedMachineGuid = SelectedMachine != null ? SelectedMachine.Guid : null;
+ _settings.LastSelectedJobGuid = SelectedMachineJob != null ? SelectedMachineJob.Guid : null;
}
#endregion