diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs | 64 |
1 files changed, 1 insertions, 63 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs index f4bbf6da3..20cfd6bf4 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs @@ -18,7 +18,6 @@ using Tango.Core.ExtensionMethods; using Tango.PPC.Common; using Tango.PPC.Common.Connection; using Tango.PPC.Common.ExternalBridge; -using Tango.PPC.Common.Lubrication; using Tango.PPC.Common.Messages; using Tango.PPC.Common.OS; using Tango.PPC.Common.UWF; @@ -36,36 +35,6 @@ namespace Tango.PPC.MachineSettings.ViewModels private TimeZoneInfo _previousTimeZone; private bool _previousEnableUWF; - #region Classes - - public class RmlLubricationLevelSettings : RmlLubricationLevel - { - public String Name { get; set; } - - public RmlLubricationLevelSettings() - { - - } - - public RmlLubricationLevelSettings(RmlLubricationLevel rmlLevel, String name) - { - RmlGuid = rmlLevel.RmlGuid; - LubricationLevel = rmlLevel.LubricationLevel; - Name = name; - } - - public RmlLubricationLevel ToRmlLubricationLevel() - { - return new RmlLubricationLevel() - { - RmlGuid = RmlGuid, - LubricationLevel = LubricationLevel, - }; - } - } - - #endregion - #region Properties [TangoInject] @@ -220,12 +189,6 @@ namespace Tango.PPC.MachineSettings.ViewModels set { _enableUWF = value; RaisePropertyChangedAuto(); } } - private List<RmlLubricationLevelSettings> _lubricationLevels; - public List<RmlLubricationLevelSettings> LubricationLevels - { - get { return _lubricationLevels; } - set { _lubricationLevels = value; RaisePropertyChangedAuto(); } - } #endregion @@ -250,7 +213,6 @@ namespace Tango.PPC.MachineSettings.ViewModels public MainViewVM() { - LubricationLevels = new List<RmlLubricationLevelSettings>(); SaveCommand = new RelayCommand(Save); DiscardCommand = new RelayCommand(Discard); SynchronizeCommand = new RelayCommand(Synchronize, () => !MachineDataSynchronizer.IsSynchronizing && IsFree); @@ -281,7 +243,6 @@ namespace Tango.PPC.MachineSettings.ViewModels Settings.SynchronizeJobs = SynchronizeJobs; Settings.SynchronizeDiagnostics = SynchronizeDiagnostics; Settings.AutoCheckForUpdates = AutoCheckForUpdates; - Settings.LubricationLevels = LubricationLevels.Where(x => x.LubricationLevel != LubricationLevel.Standard).Select(x => x.ToRmlLubricationLevel()).ToList(); MachineDataSynchronizer.IsEnabled = SynchronizeJobs || SynchronizeDiagnostics; @@ -407,7 +368,7 @@ namespace Tango.PPC.MachineSettings.ViewModels SelectedJobTypes = new SelectedObjectCollection<JobTypes>(Enum.GetValues(typeof(JobTypes)).Cast<JobTypes>().ToObservableCollection(), Settings.SupportedJobTypes.ToObservableCollection()); SelectedColorSpaces = new SelectedObjectCollection<ColorSpaces>(Enum.GetValues(typeof(ColorSpaces)).Cast<ColorSpaces>().Where(x => x.IsUserSpace()).ToObservableCollection(), Settings.SupportedColorSpaces.ToObservableCollection()); - DefaultRML = Rmls.SingleOrDefault(x => x.Guid == Settings.DefaultRmlGuid); + DefaultRML = Adapter.Rmls.SingleOrDefault(x => x.Guid == Settings.DefaultRmlGuid); DefaultSpoolType = Adapter.SpoolTypes.SingleOrDefault(x => x.Guid == Settings.DefaultSpoolTypeGuid); SynchronizeJobs = Settings.SynchronizeJobs; @@ -427,29 +388,6 @@ namespace Tango.PPC.MachineSettings.ViewModels { LogManager.Log(ex, "Error getting UWF status."); } - - try - { - List<RmlLubricationLevelSettings> levels = new List<RmlLubricationLevelSettings>(); - - foreach (var rml in Rmls) - { - RmlLubricationLevel userLevel = Settings.LubricationLevels.FirstOrDefault(x => x.RmlGuid == rml.Guid); - - RmlLubricationLevelSettings rmlLevel = new RmlLubricationLevelSettings(); - rmlLevel.RmlGuid = rml.Guid; - rmlLevel.Name = rml.Name; - rmlLevel.LubricationLevel = userLevel != null ? userLevel.LubricationLevel : LubricationLevel.Standard; - - levels.Add(rmlLevel); - } - - LubricationLevels = levels; - } - catch (Exception ex) - { - LogManager.Log(ex, "Error loading lubrication levels."); - } } private async void OnEnableRemoteAssistanceChanged() |
