aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2022-06-09 10:01:58 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2022-06-09 10:01:58 +0300
commitcb34af5399446fb3c7ac6f7597569d7da5485ffd (patch)
treef4273530a2f15af5b795cdc406773985287b9262 /Software/Visual_Studio/PPC/Modules
parentcec797266fbb4041495c939f9ece248591e0db41 (diff)
downloadTango-cb34af5399446fb3c7ac6f7597569d7da5485ffd.tar.gz
Tango-cb34af5399446fb3c7ac6f7597569d7da5485ffd.zip
PPC. Added setting Default Color Space
Related Work Items: #6349
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs35
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs19
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml8
3 files changed, 58 insertions, 4 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs
index 3aadb00e7..53fbafd1c 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs
@@ -21,6 +21,7 @@ using Tango.PPC.Jobs.Models;
using Tango.PPC.Jobs.MyColors;
using Tango.PPC.Jobs.NavigationObjects;
using Tango.PPC.Jobs.ViewContracts;
+using Tango.Settings;
using Tango.SharedUI;
using Tango.Touch.Components;
@@ -436,7 +437,9 @@ namespace Tango.PPC.Jobs.Dialogs
public ColorSelectionViewVM()
{
Libraries = MyColorsEngine.Default.GetAll().ToObservableCollection();
- SelectedColorTab = ColorTab.Volume;
+ var settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
+ InitColorTab(settings.DefaultTabColorSpace);
+
_volumeConversionTimer = new ActionTimer(TimeSpan.FromMilliseconds(50));
_converter = new DefaultColorConverter();
CollectionFilter = new DefaultCollectionFilter();
@@ -531,7 +534,8 @@ namespace Tango.PPC.Jobs.Dialogs
else
{
SelectedBrushStop = DialogEditObject.BrushStopForEdit;
- SelectedColorTab = ColorTab.Volume;
+ var settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
+ InitColorTab(settings.DefaultTabColorSpace);
SelectedCatalog = Catalogs.FirstOrDefault();
}
SelectedBrushStop.ColorCatalogsItemChanged -= OnColorSelectionItemChanged;
@@ -616,6 +620,33 @@ namespace Tango.PPC.Jobs.Dialogs
SelectedCatalog = Catalogs.FirstOrDefault();
}
+ void InitColorTab(ColorSpaces? colorSpace)
+ {
+ if (colorSpace == null)
+ SelectedColorTab = ColorTab.Volume;
+ else
+ {
+ switch (colorSpace)
+ {
+ case ColorSpaces.Catalog:
+ SelectedColorTab = ColorTab.Catalog;
+ break;
+ case ColorSpaces.RGB:
+ SelectedColorTab = ColorTab.RGB;
+ break;
+ case ColorSpaces.LAB:
+ SelectedColorTab = ColorTab.CIELab;
+ break;
+ case ColorSpaces.Volume:
+ case ColorSpaces.CMYK:
+ SelectedColorTab = ColorTab.Volume;
+ break;
+ case ColorSpaces.HSB:
+ SelectedColorTab = ColorTab.HSB;
+ break;
+ }
+ }
+ }
#endregion
#region Methods
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 f057f2e73..fbce06296 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
@@ -101,6 +101,13 @@ namespace Tango.PPC.MachineSettings.ViewModels
set { _selectedColorSpaces = value; RaisePropertyChangedAuto(); }
}
+ private ObservableCollection<ColorSpaces> _tabsColorSpaces;
+ public ObservableCollection<ColorSpaces> TabsColorSpaces
+ {
+ get { return _tabsColorSpaces; }
+ set { _tabsColorSpaces = value; RaisePropertyChangedAuto(); }
+ }
+
private ObservableCollection<Rml> _rmls;
public ObservableCollection<Rml> Rmls
{
@@ -185,6 +192,13 @@ namespace Tango.PPC.MachineSettings.ViewModels
set { _selectedSpoolType = value; RaisePropertyChangedAuto(); }
}
+ private ColorSpaces _defaultTabColorSpace;
+ public ColorSpaces DefaultTabColorSpace
+ {
+ get { return _defaultTabColorSpace; }
+ set { _defaultTabColorSpace = value; RaisePropertyChangedAuto(); }
+ }
+
private bool _synchronizeJobs;
public bool SynchronizeJobs
{
@@ -309,6 +323,7 @@ namespace Tango.PPC.MachineSettings.ViewModels
{
Settings.SupportedJobTypes = SelectedJobTypes.SynchedSource.ToList();
Settings.SupportedColorSpaces = SelectedColorSpaces.SynchedSource.ToList();
+
Machine.MapPropertiesTo(MachineProvider.Machine, MappingFlags.NoReferenceTypes);
Settings.EnableHotSpot = EnableHotSpot;
@@ -325,6 +340,7 @@ namespace Tango.PPC.MachineSettings.ViewModels
Settings.SynchronizeDiagnostics = SynchronizeDiagnostics;
Settings.AutoCheckForUpdates = AutoCheckForUpdates;
Settings.LubricationLevels = LubricationLevels.Where(x => x.LubricationLevel != LubricationLevel.Standard).Select(x => x.ToRmlLubricationLevel()).ToList();
+ Settings.DefaultTabColorSpace = DefaultTabColorSpace;
Settings.FineTuningTrialLengthMeters = FineTuningLength;
MachineDataSynchronizer.IsEnabled = SynchronizeJobs || SynchronizeDiagnostics;
@@ -533,6 +549,9 @@ 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());
+ TabsColorSpaces = new ObservableCollection<ColorSpaces>(Enum.GetValues(typeof(ColorSpaces)).Cast<ColorSpaces>().Where(x => x!= ColorSpaces.Volume && x!= ColorSpaces.HSB).ToObservableCollection());
+ DefaultTabColorSpace = Settings.DefaultTabColorSpace == null? ColorSpaces.CMYK : TabsColorSpaces.SingleOrDefault(x => x == Settings.DefaultTabColorSpace);
+
DefaultRML = Rmls.SingleOrDefault(x => x.Guid == Settings.DefaultRmlGuid);
SelectedSpoolType = SpoolTypes.SingleOrDefault(x => x.Guid == Settings.SpoolTypeGuid);
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 74b0ce7e1..b3b4bfeec 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
@@ -126,7 +126,7 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
- <TextBlock VerticalAlignment="Center">Supported Color Spaces/Catalogs</TextBlock>
+ <!--<TextBlock VerticalAlignment="Center">Supported Color Spaces/Catalogs</TextBlock>
<ItemsControl ItemsSource="{Binding SelectedColorSpaces}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
@@ -149,7 +149,7 @@
</touch:TouchToggleButton>
</DataTemplate>
</ItemsControl.ItemTemplate>
- </ItemsControl>
+ </ItemsControl>-->
<TextBlock VerticalAlignment="Bottom">Default Thread</TextBlock>
<touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding Rmls}" SelectedItem="{Binding DefaultRML}" DisplayMemberPath="FinalName"></touch:TouchComboBox>
@@ -159,6 +159,10 @@
<TextBlock VerticalAlignment="Bottom">Default Segment Length</TextBlock>
<touch:TouchNumericTextBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" Minimum="1" Maximum="1000" Value="{Binding Settings.DefaultSegmentLength}" HasDecimalPoint="True" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchNumericTextBox>
+
+ <TextBlock VerticalAlignment="Bottom">Default Color Space</TextBlock>
+ <touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding TabsColorSpaces}" SelectedItem="{Binding DefaultTabColorSpace}" DisplayMemberPath="FinalName"></touch:TouchComboBox>
+
<TextBlock VerticalAlignment="Bottom">Vector Fine Tuning Job Length</TextBlock>
<touch:TouchNumericTextBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" Minimum="100" Maximum="500" Value="{Binding FineTuningLength}" HasDecimalPoint="False" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchNumericTextBox>