aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-30 18:18:27 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-30 18:18:27 +0200
commit62abc03d76ecfd8ab16ffefe6a4f6a7b94f62203 (patch)
tree58a7ce6bc30d7e049bf2b4c1aa272306796350eb /Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings
parent80221695b6c6fd48f7a3e2e70850e68788560b31 (diff)
parent71e6a3ec2197eba8b5e1b295914653426064f745 (diff)
downloadTango-62abc03d76ecfd8ab16ffefe6a4f6a7b94f62203.tar.gz
Tango-62abc03d76ecfd8ab16ffefe6a4f6a7b94f62203.zip
BAD MERGE.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs64
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml48
2 files changed, 2 insertions, 110 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()
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml
index d105278e6..ba3516be4 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml
@@ -6,28 +6,17 @@
xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL"
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
xmlns:keyboard="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch"
- xmlns:sys="clr-namespace:System;assembly=mscorlib"
+ xmlns:sys="clr-namespace:System.Collections;assembly=mscorlib"
xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
xmlns:vm="clr-namespace:Tango.PPC.MachineSettings.ViewModels"
xmlns:connectivity="clr-namespace:Tango.PPC.Common.Connectivity;assembly=Tango.PPC.Common"
xmlns:adapters="clr-namespace:Tango.Transport.Adapters;assembly=Tango.Transport"
xmlns:global="clr-namespace:Tango.PPC.MachineSettings"
xmlns:integrationPMR="clr-namespace:Tango.PMR.Integration;assembly=Tango.PMR"
- xmlns:lubrication="clr-namespace:Tango.PPC.Common.Lubrication;assembly=Tango.PPC.Common"
xmlns:local="clr-namespace:Tango.PPC.MachineSettings.Views"
mc:Ignorable="d"
d:DesignHeight="4500" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
- <UserControl.Resources>
- <ObjectDataProvider x:Key="lubricationLevels" MethodName="GetValues"
- ObjectType="{x:Type sys:Enum}">
- <ObjectDataProvider.MethodParameters>
- <x:Type TypeName="lubrication:LubricationLevel"/>
- </ObjectDataProvider.MethodParameters>
- </ObjectDataProvider>
- </UserControl.Resources>
-
-
<Grid Background="{StaticResource TangoMidBackgroundBrush}" IsEnabled="{Binding IsFree}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
@@ -171,41 +160,6 @@
</StackPanel>
</touch:TouchExpander>
- <!--LUBRICATION-->
- <touch:TouchExpander Margin="0 20 0 0" Header="Lubrication Levels" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}">
- <StackPanel Margin="20 0 20 40">
- <StackPanel Margin="0 40 0 0">
- <TextBlock FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoGrayTextBrush}">Thread Type</TextBlock>
- <touch:TouchComboBox x:Name="lubricationCombo" Margin="0 5 0 0" ItemsSource="{Binding LubricationLevels}" DisplayMemberPath="Name"></touch:TouchComboBox>
- </StackPanel>
-
- <StackPanel Margin="0 20 0 0">
- <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center">Level</TextBlock>
- <ListBox Margin="0 10 0 0" FontSize="{StaticResource TangoSmallFontSize}" ItemsSource="{Binding Source={StaticResource lubricationLevels}}" SelectedItem="{Binding ElementName=lubricationCombo,Path=SelectedItem.LubricationLevel}" Style="{StaticResource BlankListBox}">
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Columns="5" />
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem" BasedOn="{StaticResource BlankListBoxItem}">
- <Setter Property="ContentTemplate">
- <Setter.Value>
- <DataTemplate>
- <StackPanel Background="Transparent">
- <touch:TouchRadioButton HorizontalAlignment="Center" Margin="0 0 -8 0" IsChecked="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}"></touch:TouchRadioButton>
- <TextBlock Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}" Margin="0 5 0 0" HorizontalAlignment="Center"></TextBlock>
- </StackPanel>
- </DataTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ListBox.ItemContainerStyle>
- </ListBox>
- </StackPanel>
- </StackPanel>
- </touch:TouchExpander>
-
<!--REMOTE ASSISTANCE-->
<touch:TouchExpander Margin="0 20 0 0" Header="Remote Assistance" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}">
<StackPanel>