From 2433051636406054c69b6de42806aab50e076e01 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 19 May 2019 12:37:00 +0300 Subject: 2. Update PPC DB Schema and Liquid Types. *** 3. Test preferred index on PPC. *** 3.1. Add Has_Pigment to Liquid Type. *** 4. Add "Use Preferred Index to Machine Studio. *** 4. Enable KeepAlive by default. *** 4. Disable upload HW for TCP by default. *** --- .../DeveloperModuleSettings.cs | 10 ++++ .../Views/JobView.xaml | 54 ++++++++++++++++------ 2 files changed, 51 insertions(+), 13 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs index 2099b12d9..3d0ee2461 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs @@ -34,6 +34,16 @@ namespace Tango.MachineStudio.Developer /// public int GradientResolutionCM { get; set; } + private bool _usePreferredLiquidVolumeIndex; + /// + /// Gets or sets a value indicating whether to use the preferred liquid volume index. + /// + public bool UsePreferredLiquidVolumeIndex + { + get { return _usePreferredLiquidVolumeIndex; } + set { _usePreferredLiquidVolumeIndex = value; RaisePropertyChangedAuto(); } + } + public DeveloperModuleSettings() { ProcessParametersIndices = new List(); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index 8a5ec94fa..95f88d1ea 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -28,7 +28,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" mc:Ignorable="d" - d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}" x:Name="control"> @@ -249,7 +249,17 @@ - + + + + @@ -785,16 +795,16 @@ - + - SUPPORTED MEDIA LIQUID ( Max Nanolitter/CM ) + SUPPORTED MEDIA LIQUID ( Max Nanolitter/CM ) - + - + @@ -821,12 +831,20 @@ - + + @@ -1030,7 +1048,17 @@ - + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs index f3af53352..18dc795bd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs @@ -312,5 +312,10 @@ namespace Tango.MachineStudio.Developer.Views _vm.OnBrushStopFieldValueChanged(stop); } } + + private void OnBrushStopMouseDown(object sender, MouseButtonEventArgs e) + { + listStops.SelectedItem = (sender as ListBoxItem).DataContext; + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionViewVM.cs index d9b9a438a..887e62dd7 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/AdvancedColorCorrectionViewVM.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Tango.BL.ColorConversion; using Tango.PMR.ColorLab; using Tango.SharedUI; diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionViewVM.cs index 3cfedd3f0..a6ffb57c3 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionViewVM.cs @@ -3,8 +3,8 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Tango.BL.ColorConversion; using Tango.BL.Entities; +using Tango.ColorConversion; using Tango.Core.Commands; using Tango.SharedUI; diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/FineTuningPaletteViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/FineTuningPaletteViewVM.cs index 919cd94b2..e9ef45ab5 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/FineTuningPaletteViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/FineTuningPaletteViewVM.cs @@ -3,8 +3,8 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Tango.BL.ColorConversion; using Tango.BL.Entities; +using Tango.ColorConversion; using Tango.PPC.Common.Models; using Tango.SharedUI; @@ -18,6 +18,7 @@ namespace Tango.PPC.Jobs.Dialogs { private Job _job; private bool _prevent_change; + private IColorConverter _converter; private List _suggestions; /// @@ -66,6 +67,8 @@ namespace Tango.PPC.Jobs.Dialogs { Suggestions = new List(); HiveSuggestions = new List(); + + _converter = new DefaultColorConverter(); } /// @@ -75,8 +78,8 @@ namespace Tango.PPC.Jobs.Dialogs { if (!_prevent_change) { - Suggestions = TangoColorConverter.CreateTrippletSuggestions(TangoColorConverter.GetSuggestions(_job, SelectedHiveSuggestion.Color)); - SelectedSuggestion = Suggestions[Suggestions.Count / 2]; + Suggestions = _converter.Convert(_job, SelectedHiveSuggestion.Color).CreateTrippletSuggestions(); + SelectedSuggestion = Suggestions.GetCenterSuggestion(); } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj index 4adb1bfb6..74fbc1bdb 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj @@ -290,6 +290,10 @@ {f441feee-322a-4943-b566-110e12fd3b72} Tango.BL + + {b4fe6485-4161-4b36-bc08-67e0b53d01b7} + Tango.ColorConversion + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core @@ -475,7 +479,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs index b413758c8..847edb52f 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using Tango.BL; using Tango.BL.Builders; using Tango.BL.Entities; +using Tango.ColorConversion; using Tango.Core.Commands; using Tango.PPC.Common; using Tango.PPC.Common.Messages; @@ -114,12 +115,15 @@ namespace Tango.PPC.Jobs.ViewModels .WithBrushStops() .BuildAsync(); - - try + await Task.Factory.StartNew(() => { - EstimatedDuration = await Job.GetEstimatedDuration(); - } - catch { } + try + { + IColorConverter _converter = new DefaultColorConverter(); + EstimatedDuration = Job.GetEstimatedDuration(_converter.GetRecommendedProcessParameters(Job)); + } + catch { } + }); } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs index 0d1d2f3cb..fb1f240c5 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs @@ -20,7 +20,6 @@ using Tango.PPC.Jobs.Views; using Tango.BL.Catalogs; using System.Runtime.InteropServices; using System.Threading; -using Tango.BL.ColorConversion; using Tango.SharedUI.Helpers; using Tango.PPC.Common.Navigation; using Tango.PPC.Jobs.NavigationObjects; @@ -37,6 +36,7 @@ using System.Runtime.ExceptionServices; using Tango.Explorer; using Tango.PPC.Storage; using System.IO; +using Tango.ColorConversion; namespace Tango.PPC.Jobs.ViewModels { @@ -54,6 +54,7 @@ namespace Tango.PPC.Jobs.ViewModels private static Dictionary> _jobs_fine_tune_items; private StartPrintingButton _start_printing_btn; private ActionTimer _volumeConversionTimer; + private IColorConverter _converter; #region Properties @@ -351,6 +352,8 @@ namespace Tango.PPC.Jobs.ViewModels /// public JobViewVM() { + _converter = new DefaultColorConverter(); + _volumeConversionTimer = new ActionTimer(TimeSpan.FromMilliseconds(50)); RegisterForMessage(HandleJobSelectedMessage); @@ -857,14 +860,14 @@ namespace Tango.PPC.Jobs.ViewModels LogManager.Log($"Invoking triplet color adjustment dialog for brush stop {brushStop.StopIndex} at segment {brushStop.Segment.SegmentIndex}."); LogManager.Log("Retrieving color conversion suggestions for brush stop..."); - var conversionOutput = TangoColorConverter.GetSuggestions(brushStop); + var conversionOutput = _converter.Convert(brushStop); BasicColorCorrectionViewVM vm = null; vm = await NotificationProvider.ShowDialog(new BasicColorCorrectionViewVM() { InvalidBrushStop = brushStop, - Suggestions = TangoColorConverter.CreateTrippletSuggestions(conversionOutput), + Suggestions = conversionOutput.CreateTrippletSuggestions(), }); if (vm.Result == BasicColorCorrectionViewVM.ColorCorrectionDialogResult.MoreOptions) @@ -873,7 +876,7 @@ namespace Tango.PPC.Jobs.ViewModels vm = await NotificationProvider.ShowDialog(new AdvancedColorCorrectionViewVM() { InvalidBrushStop = brushStop, - Suggestions = TangoColorConverter.CreateHiveSuggestions(conversionOutput), + Suggestions = conversionOutput.CreateHiveSuggestions(), }); } @@ -911,7 +914,7 @@ namespace Tango.PPC.Jobs.ViewModels { try { - var output = TangoColorConverter.GetSuggestions(stop); + var output = _converter.Convert(stop); stop.Red = output.SingleCoordinates.Red; stop.Green = output.SingleCoordinates.Green; @@ -1068,7 +1071,7 @@ namespace Tango.PPC.Jobs.ViewModels foreach (var stop in Job.Segments.SelectMany(x => x.BrushStops).DistinctBy(x => x.Color)) { - FineTuneItem item = new FineTuneItem(TangoColorConverter.GetSuggestions(stop)); + FineTuneItem item = new FineTuneItem(_converter.Convert(stop)); item.BrushStops = Job.Segments.SelectMany(x => x.BrushStops).Where(x => x.Color == stop.Color).ToList(); item.SelectedSuggestion = item.Suggestions[item.Suggestions.Count / 2]; item.SelectedChanged += () => StartFineTuningCommand.RaiseCanExecuteChanged(); @@ -1212,7 +1215,7 @@ namespace Tango.PPC.Jobs.ViewModels { try { - stop.IsOutOfGamut = TangoColorConverter.IsOutOfGamut(stop); + stop.IsOutOfGamut = _converter.IsOutOfGamut(stop); stop.OutOfGamutChecked = true; } catch diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Models/FineTuneItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Models/FineTuneItem.cs index 7e29d41d2..2eea5c3ce 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Models/FineTuneItem.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Models/FineTuneItem.cs @@ -3,8 +3,8 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Tango.BL.ColorConversion; using Tango.BL.Entities; +using Tango.ColorConversion; using Tango.Core; using Tango.PMR.ColorLab; @@ -88,8 +88,8 @@ namespace Tango.PPC.Common.Models /// The conversion output. public FineTuneItem(ConversionOutput conversionOutput) : this() { - Suggestions = TangoColorConverter.CreateTrippletSuggestions(conversionOutput); - HiveSuggestions = TangoColorConverter.CreateHiveSuggestions(conversionOutput); + Suggestions = conversionOutput.CreateTrippletSuggestions(); + HiveSuggestions = conversionOutput.CreateHiveSuggestions(); } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj index a84faf68d..66ddb53bd 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj @@ -302,6 +302,10 @@ {f441feee-322a-4943-b566-110e12fd3b72} Tango.BL + + {b4fe6485-4161-4b36-bc08-67e0b53d01b7} + Tango.ColorConversion + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core @@ -380,7 +384,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index 71fa82504..9b3b58c67 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -323,6 +323,10 @@ {f441feee-322a-4943-b566-110e12fd3b72} Tango.BL + + {b4fe6485-4161-4b36-bc08-67e0b53d01b7} + Tango.ColorConversion + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core @@ -534,7 +538,7 @@ del "$(TargetDir)firmware_package.tfp" - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.BL/ColorConversion/ColorConversionSuggestion.cs b/Software/Visual_Studio/Tango.BL/ColorConversion/ColorConversionSuggestion.cs deleted file mode 100644 index 9f58003ce..000000000 --- a/Software/Visual_Studio/Tango.BL/ColorConversion/ColorConversionSuggestion.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media; -using Tango.Core; -using Tango.PMR.ColorLab; - -namespace Tango.BL.ColorConversion -{ - public class ColorConversionSuggestion : ExtendedObject - { - public Color Color - { - get - { - return Color.FromRgb((byte)Coordinates.Red, (byte)Coordinates.Green, (byte)Coordinates.Blue); - } - } - - public SolidColorBrush Brush - { - get { return new SolidColorBrush(Color); } - } - - private OutputCoordinates _coordinates; - public OutputCoordinates Coordinates - { - get { return _coordinates; } - set { _coordinates = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(Color)); RaisePropertyChanged(nameof(Brush)); } - } - - public int ProcessParametersTableIndex { get; set; } - - public int Column { get; set; } - - public int Row { get; set; } - - public bool DisplayIndices { get; set; } - - public ColorConversionSuggestion() - { - DisplayIndices = false; - } - - public ColorConversionSuggestion(OutputCoordinates coordinates, int row, int column) - { - Coordinates = coordinates; - Row = row; - Column = column; - ProcessParametersTableIndex = coordinates.ProcessParametersTableIndex; - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs b/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs deleted file mode 100644 index e6a305677..000000000 --- a/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs +++ /dev/null @@ -1,425 +0,0 @@ -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media; -using Tango.BL.Entities; -using Tango.BL.Enumerations; -using Tango.Core.ExtensionMethods; -using Tango.Logging; -using Tango.PMR; -using Tango.PMR.ColorLab; - -namespace Tango.BL.ColorConversion -{ - public static class TangoColorConverter - { - static class NativeMethods - { - [DllImport("kernel32.dll")] - public static extern IntPtr LoadLibrary(string dllToLoad); - - [DllImport("kernel32.dll")] - public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName); - - [DllImport("kernel32.dll")] - public static extern bool FreeLibrary(IntPtr hModule); - } - - private static ConversionOutput Convert(ConversionInput conversionInput) - { - IntPtr pDll = NativeMethods.LoadLibrary(@"Tango.ColorLib.dll"); - IntPtr pAddressOfFunctionToCall = NativeMethods.GetProcAddress(pDll, "Convert"); - NativeMethodDelegate convert = (NativeMethodDelegate)Marshal.GetDelegateForFunctionPointer( - pAddressOfFunctionToCall, - typeof(NativeMethodDelegate)); - - NativePMR nativePMR = new NativePMR(convert); - ConversionOutput output = nativePMR.Invoke(conversionInput); - - bool result = NativeMethods.FreeLibrary(pDll); - - if (output.HasError) - { - throw new ExternalException($"Color Conversion Error: {output.ErrorMessage}!"); - } - - return output; - } - - public static ConversionOutput GetSuggestions(BrushStop brushStop) - { - ConversionInput conversionInput = CreateConversionInput(brushStop); - ConversionOutput output = Convert(conversionInput); - return output; - } - - public static ConversionOutput GetSuggestions(ConversionInput conversionInput) - { - ConversionOutput output = Convert(conversionInput); - return output; - } - - public static ConversionOutput GetSuggestions(Job job, Color color, bool singleMode = false) - { - ConversionInput conversionInput = new ConversionInput(); - - conversionInput.ColorSpace = PMR.ColorLab.ColorSpace.Rgb; - conversionInput.InputCoordinates = new InputCoordinates(); - - conversionInput.InputCoordinates.Red = Math.Max((int)color.R, 0); - conversionInput.InputCoordinates.Green = Math.Max((int)color.G, 0); - conversionInput.InputCoordinates.Blue = Math.Max((int)color.B, 0); - - conversionInput.ThreadL = 92.1815;//brushStop.Segment.Job.Rml.WhitePoint.L; - conversionInput.ThreadA = 2.2555;//brushStop.Segment.Job.Rml.WhitePoint.A; - conversionInput.ThreadB = -10.9325;//brushStop.Segment.Job.Rml.WhitePoint.B; - - conversionInput.SingleMode = singleMode; - - conversionInput.ForwardData = ByteString.CopyFrom(job.Rml.Ccts.FirstOrDefault().ForwardData); - - foreach (var processTable in job.Rml.ProcessParametersTablesGroups.First(x => x.Active).ProcessParametersTables) - { - conversionInput.ProcessRanges.Add(new ProcessRange() - { - MinInkUptake = processTable.MinInkUptake, - MaxInkUptake = processTable.MaxInkUptake, - }); - } - - foreach (var ids_pack in job.Machine.Configuration.GetSupportedIdsPacks(job.Rml)) - { - CalibrationData calibrationData = Cat.CreateDemoCalibrationData((PMR.ColorLab.LiquidType)ids_pack.LiquidType.Code); - - //TODO: Enable Machine Calibration Also.. - - //var machine_cat = ids_pack.LiquidType.Cats.SingleOrDefault(x => x.MachineGuid == machine.Guid && x.RmlGuid == job.RmlGuid); - - //if (machine_cat != null) - //{ - // calibrationData = machine_cat.GetCalibrationData(); - //} - //else - //{ - var rml_cat = job.Rml.LiquidTypesRmls.SingleOrDefault(x => x.LiquidType.Code == ids_pack.LiquidType.Code); - - if (rml_cat != null) - { - calibrationData = rml_cat.GetCalibrationData(); - } - //} - - conversionInput.InputCoordinates.InputLiquids.Add(new InputLiquid() - { - LiquidType = (PMR.ColorLab.LiquidType)ids_pack.LiquidType.Code, - MaxNanoliterPerCentimeter = ids_pack.LiquidType.LiquidTypesRmls.Single(x => x.Rml == job.Rml).MaxNlPerCm, - CalibrationData = calibrationData, - }); - } - - ConversionOutput output = Convert(conversionInput); - - return output; - } - - public static List CreateHiveSuggestions(ConversionOutput conversionOutput) - { - List suggestions = new List(); - - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[1], 0, 1)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[2], 0, 2)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[3], 0, 3)); - - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[5], 1, 0)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[6], 1, 1)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[7], 1, 2)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[8], 1, 3)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[9], 1, 4)); - - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[10], 2, 0)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[11], 2, 1)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[12], 2, 2)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[13], 2, 3)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[14], 2, 4)); - - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[15], 3, 0)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[16], 3, 1)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[17], 3, 2)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[18], 3, 3)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[19], 3, 4)); - - suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[22], 4, 2)); - - return suggestions; - } - - public static List CreateTrippletSuggestions(ConversionOutput conversionOutput) - { - List suggestions = new List(); - - suggestions.Add(new ColorConversionSuggestion(conversionOutput.TripleCoordinates[0], 0, 0)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.TripleCoordinates[1], 0, 0)); - suggestions.Add(new ColorConversionSuggestion(conversionOutput.TripleCoordinates[2], 0, 0)); - - return suggestions; - } - - public static ColorConversionSuggestion CreateSingleSuggestion(ConversionOutput conversionOutput) - { - return new ColorConversionSuggestion(conversionOutput.SingleCoordinates, 0, 0); - } - - public static bool IsOutOfGamut(BrushStop brushStop) - { - return GetSuggestions(brushStop).OutOfGamut; - } - - public static int GetLeastCommonProcessParametersTableIndex(IEnumerable stops) - { - var standard_stops = stops.Where(x => x.BrushColorSpace == Enumerations.ColorSpaces.RGB || x.BrushColorSpace == Enumerations.ColorSpaces.LAB || x.BrushColorSpace == Enumerations.ColorSpaces.CMYK || x.BrushColorSpace == Enumerations.ColorSpaces.Volume); - var color_catalog_stops = stops.Where(x => x.BrushColorSpace != Enumerations.ColorSpaces.RGB && x.BrushColorSpace != Enumerations.ColorSpaces.LAB && x.BrushColorSpace != Enumerations.ColorSpaces.CMYK && x.BrushColorSpace != Enumerations.ColorSpaces.Volume); - - var max_standard = 1; - var max_catalog = 1; - - if (standard_stops.Count() > 0) - { - max_standard = standard_stops.Select(x => GetSuggestions(x)).Select(x => x.SingleCoordinates).Max(x => x.ProcessParametersTableIndex); - } - - if (color_catalog_stops.Where(x => x.ColorCatalog != null).Count() > 0) - { - max_catalog = color_catalog_stops.Where(x => x.ColorCatalog != null).Max(x => x.ColorCatalog.ProcessParametersTableIndex); - } - - if (standard_stops.Count() == 0) - { - return max_catalog; - } - else if (color_catalog_stops.Count() == 0) - { - return max_standard; - } - else - { - return Math.Max(max_standard, max_catalog); - } - } - - private static ConversionInput CreateConversionInput(BrushStop brushStop) - { - ConversionInput conversionInput = new ConversionInput(); - - conversionInput.ColorSpace = (PMR.ColorLab.ColorSpace)brushStop.ColorSpace.Code; - - if (conversionInput.ColorSpace == PMR.ColorLab.ColorSpace.Twine || conversionInput.ColorSpace == PMR.ColorLab.ColorSpace.Coats) - { - conversionInput.ColorSpace = PMR.ColorLab.ColorSpace.Volume; - - if (brushStop.ColorCatalog != null) - { - brushStop.SetVolume(Enumerations.LiquidTypes.Cyan, brushStop.ColorCatalog.Cyan); - brushStop.SetVolume(Enumerations.LiquidTypes.Magenta, brushStop.ColorCatalog.Magenta); - brushStop.SetVolume(Enumerations.LiquidTypes.Yellow, brushStop.ColorCatalog.Yellow); - brushStop.SetVolume(Enumerations.LiquidTypes.Black, brushStop.ColorCatalog.Black); - } - } - - conversionInput.InputCoordinates = new InputCoordinates(); - - conversionInput.SegmentLength = brushStop.Segment.Length; //TODO: for gradient ? - - conversionInput.InputCoordinates.Red = Math.Max(brushStop.Red, 1); - conversionInput.InputCoordinates.Green = Math.Max(brushStop.Green, 1); - conversionInput.InputCoordinates.Blue = Math.Max(brushStop.Blue, 1); - - conversionInput.InputCoordinates.L = brushStop.L; - conversionInput.InputCoordinates.A = brushStop.A; - conversionInput.InputCoordinates.B = brushStop.B; - - conversionInput.InputCoordinates.Cyan = brushStop.Cyan; - conversionInput.InputCoordinates.Magenta = brushStop.Magenta; - conversionInput.InputCoordinates.Yellow = brushStop.Yellow; - conversionInput.InputCoordinates.Key = brushStop.Black; - - conversionInput.ThreadL = 92.1815;//brushStop.Segment.Job.Rml.MediaColor.L; - conversionInput.ThreadA = 2.2555;//brushStop.Segment.Job.Rml.MediaColor.A; - conversionInput.ThreadB = -10.9325;//brushStop.Segment.Job.Rml.MediaColor.B; - - if (brushStop.Segment.Job.Rml.Ccts.Count == 0) - { - throw new InvalidOperationException($"No CCT found for RML {brushStop.Segment.Job.Rml.Name}. Could not create a conversion input."); - } - - conversionInput.ForwardData = ByteString.CopyFrom(brushStop.Segment.Job.Rml.Ccts.FirstOrDefault().ForwardData); - - var machine = brushStop.Segment.Job.Machine; - var job = brushStop.Segment.Job; - - foreach (var processTable in job.Rml.ProcessParametersTablesGroups.First(x => x.Active).ProcessParametersTables) - { - conversionInput.ProcessRanges.Add(new ProcessRange() - { - MinInkUptake = processTable.MinInkUptake, - MaxInkUptake = processTable.MaxInkUptake, - }); - } - - foreach (var ids_pack in machine.Configuration.GetSupportedIdsPacks(job.Rml)) - { - CalibrationData calibrationData = Cat.CreateDemoCalibrationData((PMR.ColorLab.LiquidType)ids_pack.LiquidType.Code); - - //TODO: Enable Machine Calibration Also.. - - //var machine_cat = ids_pack.LiquidType.Cats.SingleOrDefault(x => x.MachineGuid == machine.Guid && x.RmlGuid == job.RmlGuid); - - //if (machine_cat != null) - //{ - // calibrationData = machine_cat.GetCalibrationData(); - //} - //else - //{ - var rml_cat = job.Rml.LiquidTypesRmls.SingleOrDefault(x => x.LiquidType.Code == ids_pack.LiquidType.Code); - - if (rml_cat != null) - { - calibrationData = rml_cat.GetCalibrationData(); - } - //} - - conversionInput.InputCoordinates.InputLiquids.Add(new InputLiquid() - { - LiquidType = (PMR.ColorLab.LiquidType)ids_pack.LiquidType.Code, - MaxNanoliterPerCentimeter = ids_pack.LiquidType.LiquidTypesRmls.Single(x => x.Rml == brushStop.Segment.Job.Rml).MaxNlPerCm, - Volume = brushStop.GetVolume(ids_pack.PackIndex), - CalibrationData = calibrationData, - }); - } - - return conversionInput; - } - - public static void ApplyBrushStopCorrection(BrushStop stop, ProcessParametersTable processTable, ConversionOutput conversionOutput) - { - var output = conversionOutput; - - stop.SetLiquidVolumes(stop.Segment.Job.Machine.Configuration, stop.Segment.Job.Rml, processTable); - - foreach (var outputLiquid in output.SingleCoordinates.OutputLiquids) - { - var liquidVolume = stop.LiquidVolumes.SingleOrDefault(x => x.IdsPack.LiquidType.Code == outputLiquid.LiquidType.ToInt32()); - - if (liquidVolume == null) - { - throw new NullReferenceException("Liquid volume not found for color conversion output liquid '" + outputLiquid.LiquidType + "'."); - } - - liquidVolume.Volume = outputLiquid.Volume; - } - } - - public static List CreateSegmentLinearGradient(Segment segment, ProcessParametersTable processTable, int resolutionCM) - { - List stops = new List(); - - int stopIndex = 1; - - for (double cm = 0; cm < segment.Length; cm += (resolutionCM / 100d)) - { - double offset = (double)cm / segment.Length; - - var color = GetRelativeColor(segment.BrushStops.ToList(), offset); - - BrushStop s = new BrushStop(); - s.Segment = segment; - s.ColorSpace = new Entities.ColorSpace(); - s.ColorSpace.Code = ColorSpaces.RGB.ToInt32(); - s.Corrected = true; - s.OffsetPercent = offset * 100d; - s.OffsetMeters = segment.Length * offset; - s.Red = color.R; - s.Green = color.G; - s.Blue = color.B; - s.StopIndex = stopIndex++; - - stops.Add(s); - } - - var input = CreateConversionInput(stops.First()); - - GradientConversionInput conversionInput = new GradientConversionInput(); - conversionInput.Colors.AddRange(stops.Select(x => new InputRGB() { Red = x.Red, Green = x.Green, Blue = x.Blue })); - conversionInput.DeltaChroma = input.DeltaChroma; - conversionInput.DeltaL = input.DeltaL; - conversionInput.ForwardData = input.ForwardData; - conversionInput.InputLiquids.AddRange(input.InputCoordinates.InputLiquids); - conversionInput.ProcessRanges.AddRange(input.ProcessRanges); - conversionInput.SegmentLength = input.SegmentLength; - conversionInput.ThreadL = input.ThreadL; - conversionInput.ThreadA = input.ThreadA; - conversionInput.ThreadB = input.ThreadB; - - - IntPtr pDll = NativeMethods.LoadLibrary(@"Tango.ColorLib.dll"); - IntPtr pAddressOfFunctionToCall = NativeMethods.GetProcAddress(pDll, "ConvertGradient"); - NativeMethodDelegate convert = (NativeMethodDelegate)Marshal.GetDelegateForFunctionPointer( - pAddressOfFunctionToCall, - typeof(NativeMethodDelegate)); - NativePMR nativePMR = new NativePMR(convert); - GradientConversionOutput output = nativePMR.Invoke(conversionInput); - - bool result = NativeMethods.FreeLibrary(pDll); - - for (int i = 0; i < output.Coordinates.Count; i++) - { - var coords = output.Coordinates[i]; - var stop = stops[i]; - - ConversionOutput o = new ConversionOutput(); - o.SingleCoordinates = coords; - ApplyBrushStopCorrection(stop, processTable, o); - } - - return stops; - } - - private static Color GetRelativeColor(List brushStopsCollection, double offset) - { - brushStopsCollection = brushStopsCollection.Select(x => x.ShallowClone()).ToList(); - brushStopsCollection.ForEach(x => x.OffsetPercent = x.OffsetPercent / 100d); - - var point = brushStopsCollection.SingleOrDefault(f => f.OffsetPercent == offset); - if (point != null) return point.Color; - - BrushStop before = brushStopsCollection.Where(w => w.OffsetPercent == brushStopsCollection.Min(m => m.OffsetPercent)).First(); - BrushStop after = brushStopsCollection.Where(w => w.OffsetPercent == brushStopsCollection.Max(m => m.OffsetPercent)).First(); - - foreach (var gs in brushStopsCollection) - { - if (gs.OffsetPercent < offset && gs.OffsetPercent > before.OffsetPercent) - { - before = gs; - } - if (gs.OffsetPercent > offset && gs.OffsetPercent < after.OffsetPercent) - { - after = gs; - } - } - - var color = new Color(); - - color.ScA = (float)((offset - before.OffsetPercent) * (after.Color.ScA - before.Color.ScA) / (after.OffsetPercent - before.OffsetPercent) + before.Color.ScA); - color.ScR = (float)((offset - before.OffsetPercent) * (after.Color.ScR - before.Color.ScR) / (after.OffsetPercent - before.OffsetPercent) + before.Color.ScR); - color.ScG = (float)((offset - before.OffsetPercent) * (after.Color.ScG - before.Color.ScG) / (after.OffsetPercent - before.OffsetPercent) + before.Color.ScG); - color.ScB = (float)((offset - before.OffsetPercent) * (after.Color.ScB - before.Color.ScB) / (after.OffsetPercent - before.OffsetPercent) + before.Color.ScB); - - return color; - } - } -} diff --git a/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs b/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs index 8d2db9bb5..7bda5a5e0 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs @@ -17,7 +17,6 @@ using Google.Protobuf; using System.Runtime.InteropServices; using Tango.PMR; using System.Diagnostics; -using Tango.BL.ColorConversion; using System.Windows.Threading; using System.Timers; using Tango.Core.Threading; diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index 6e6ffcf48..29f9bf439 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -491,18 +491,18 @@ namespace Tango.BL.Entities return TimeSpan.FromSeconds((LengthIncludingNumberOfUnits + processParameters.DryerBufferLength) / (processParameters.DyeingSpeed / 100d)); } - /// - /// Gets the duration estimation for this job. - /// - /// - public Task GetEstimatedDuration() - { - return Task.Factory.StartNew(() => - { - var process = GetRecommendedProcessParameters().Result; - return GetEstimatedDuration(process); - }); - } + ///// + ///// Gets the duration estimation for this job. + ///// + ///// + //public Task GetEstimatedDuration() + //{ + // return Task.Factory.StartNew(() => + // { + // var process = GetRecommendedProcessParameters().Result; + // return GetEstimatedDuration(process); + // }); + //} /// /// Translates the job progress to time. @@ -538,28 +538,28 @@ namespace Tango.BL.Entities }; } - public Task GetRecommendedProcessParameters() - { - return Task.Factory.StartNew(() => - { - try - { - int index = ColorConversion.TangoColorConverter.GetLeastCommonProcessParametersTableIndex(Segments.SelectMany(x => x.BrushStops)); - if (index < Rml.GetActiveProcessGroup().ProcessParametersTables.Count) - { - return Rml.GetActiveProcessGroup().ProcessParametersTables[index]; - } - else - { - return Rml.GetActiveProcessGroup().ProcessParametersTables[0]; - } - } - catch (Exception ex) - { - throw new InvalidOperationException("Could not calculate the recommended process parameters for the job.", ex); - } - }); - } + //public Task GetRecommendedProcessParameters() + //{ + // return Task.Factory.StartNew(() => + // { + // try + // { + // int index = ColorConversion.TangoColorConverter.GetLeastCommonProcessParametersTableIndex(Segments.SelectMany(x => x.BrushStops)); + // if (index < Rml.GetActiveProcessGroup().ProcessParametersTables.Count) + // { + // return Rml.GetActiveProcessGroup().ProcessParametersTables[index]; + // } + // else + // { + // return Rml.GetActiveProcessGroup().ProcessParametersTables[0]; + // } + // } + // catch (Exception ex) + // { + // throw new InvalidOperationException("Could not calculate the recommended process parameters for the job.", ex); + // } + // }); + //} public Task ToJobFile() { diff --git a/Software/Visual_Studio/Tango.BL/ExtensionMethods/ColorConversionSuggestionExtensions.cs b/Software/Visual_Studio/Tango.BL/ExtensionMethods/ColorConversionSuggestionExtensions.cs deleted file mode 100644 index 807cfa5dd..000000000 --- a/Software/Visual_Studio/Tango.BL/ExtensionMethods/ColorConversionSuggestionExtensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.ColorConversion; - -public static class ColorConversionSuggestionExtensions -{ - /// - /// Gets the hive center suggestion. - /// - /// The suggestions. - /// - public static ColorConversionSuggestion GetCenterSuggestion(this IEnumerable suggestions) - { - if (suggestions.Count() == 3) - { - return suggestions.ElementAt(1); - } - else - { - return suggestions.ElementAt(10); - } - } -} - diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj index bf6e415e1..be88ab930 100644 --- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj +++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj @@ -106,8 +106,6 @@ - - @@ -380,7 +378,6 @@ - diff --git a/Software/Visual_Studio/Tango.BL/Utils/BrushStopUtils.cs b/Software/Visual_Studio/Tango.BL/Utils/BrushStopUtils.cs index 76f928bf3..59dba8ac7 100644 --- a/Software/Visual_Studio/Tango.BL/Utils/BrushStopUtils.cs +++ b/Software/Visual_Studio/Tango.BL/Utils/BrushStopUtils.cs @@ -4,7 +4,6 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; -using Tango.BL.ColorConversion; using Tango.BL.Entities; using Tango.PMR.ColorLab; @@ -12,49 +11,49 @@ namespace Tango.BL.Utils { public class BrushStopUtils { - public static void ApplyConversionOutputLiquids(BrushStop stop, List outputLiquids) - { - foreach (var liquid in outputLiquids) - { - var liquidVolume = stop.LiquidVolumes.SingleOrDefault(x => x.IdsPack.LiquidType.Code == liquid.LiquidType.ToInt32()); - - if (liquidVolume != null) - { - liquidVolume.Volume = liquid.Volume; - } - } - } - - public static void ApplyConversionCoordinates(BrushStop stop, OutputCoordinates coordinates) - { - ApplyConversionOutputLiquids(stop, coordinates.OutputLiquids.ToList()); - - stop.Color = Color.FromRgb((byte)coordinates.Red, (byte)coordinates.Green, (byte)coordinates.Blue); - - stop.IsOutOfGamut = false; - stop.Corrected = true; - } - - public static void ApplyConversionSuggestion(BrushStop stop, ColorConversionSuggestion suggestion) - { - ApplyConversionCoordinates(stop, suggestion.Coordinates); - } - - public static void ApplyColorConversion(BrushStop stop) - { - var conversionOutput = TangoColorConverter.GetSuggestions(stop); - - if (stop.BrushColorSpace == Enumerations.ColorSpaces.RGB || stop.BrushColorSpace == Enumerations.ColorSpaces.LAB) - { - ApplyConversionCoordinates(stop, conversionOutput.SingleCoordinates); - stop.IsOutOfGamut = conversionOutput.OutOfGamut; - } - else if (stop.BrushColorSpace == Enumerations.ColorSpaces.Volume) - { - stop.Color = Color.FromRgb((byte)conversionOutput.SingleCoordinates.Red, (byte)conversionOutput.SingleCoordinates.Green, (byte)conversionOutput.SingleCoordinates.Blue); - stop.IsOutOfGamut = false; - stop.Corrected = true; - } - } + //public static void ApplyConversionOutputLiquids(BrushStop stop, List outputLiquids) + //{ + // foreach (var liquid in outputLiquids) + // { + // var liquidVolume = stop.LiquidVolumes.SingleOrDefault(x => x.IdsPack.LiquidType.Code == liquid.LiquidType.ToInt32()); + + // if (liquidVolume != null) + // { + // liquidVolume.Volume = liquid.Volume; + // } + // } + //} + + //public static void ApplyConversionCoordinates(BrushStop stop, OutputCoordinates coordinates) + //{ + // ApplyConversionOutputLiquids(stop, coordinates.OutputLiquids.ToList()); + + // stop.Color = Color.FromRgb((byte)coordinates.Red, (byte)coordinates.Green, (byte)coordinates.Blue); + + // stop.IsOutOfGamut = false; + // stop.Corrected = true; + //} + + //public static void ApplyConversionSuggestion(BrushStop stop, ColorConversionSuggestion suggestion) + //{ + // ApplyConversionCoordinates(stop, suggestion.Coordinates); + //} + + //public static void ApplyColorConversion(BrushStop stop) + //{ + // var conversionOutput = TangoColorConverter.GetSuggestions(stop); + + // if (stop.BrushColorSpace == Enumerations.ColorSpaces.RGB || stop.BrushColorSpace == Enumerations.ColorSpaces.LAB) + // { + // ApplyConversionCoordinates(stop, conversionOutput.SingleCoordinates); + // stop.IsOutOfGamut = conversionOutput.OutOfGamut; + // } + // else if (stop.BrushColorSpace == Enumerations.ColorSpaces.Volume) + // { + // stop.Color = Color.FromRgb((byte)conversionOutput.SingleCoordinates.Red, (byte)conversionOutput.SingleCoordinates.Green, (byte)conversionOutput.SingleCoordinates.Blue); + // stop.IsOutOfGamut = false; + // stop.Corrected = true; + // } + //} } } diff --git a/Software/Visual_Studio/Tango.ColorConversion/Class1.cs b/Software/Visual_Studio/Tango.ColorConversion/Class1.cs deleted file mode 100644 index b420411b6..000000000 --- a/Software/Visual_Studio/Tango.ColorConversion/Class1.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.ColorConversion -{ - public class Class1 - { - } -} diff --git a/Software/Visual_Studio/Tango.ColorConversion/ColorConversionSuggestion.cs b/Software/Visual_Studio/Tango.ColorConversion/ColorConversionSuggestion.cs new file mode 100644 index 000000000..f6dc62785 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorConversion/ColorConversionSuggestion.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; +using Tango.Core; +using Tango.PMR.ColorLab; + +namespace Tango.ColorConversion +{ + public class ColorConversionSuggestion : ExtendedObject + { + public Color Color + { + get + { + return Color.FromRgb((byte)Coordinates.Red, (byte)Coordinates.Green, (byte)Coordinates.Blue); + } + } + + public SolidColorBrush Brush + { + get { return new SolidColorBrush(Color); } + } + + private OutputCoordinates _coordinates; + public OutputCoordinates Coordinates + { + get { return _coordinates; } + set { _coordinates = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(Color)); RaisePropertyChanged(nameof(Brush)); } + } + + public int ProcessParametersTableIndex { get; set; } + + public int Column { get; set; } + + public int Row { get; set; } + + public bool DisplayIndices { get; set; } + + public ColorConversionSuggestion() + { + DisplayIndices = false; + } + + public ColorConversionSuggestion(OutputCoordinates coordinates, int row, int column) + { + Coordinates = coordinates; + Row = row; + Column = column; + ProcessParametersTableIndex = coordinates.ProcessParametersTableIndex; + } + } +} diff --git a/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs b/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs new file mode 100644 index 000000000..0ea0d901f --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorConversion/DefaultColorConverter.cs @@ -0,0 +1,259 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; +using Tango.BL.Entities; +using Tango.BL; +using Tango.PMR; +using Tango.PMR.ColorLab; +using Tango.BL.Enumerations; +using Google.Protobuf; +using System.Diagnostics; +using Tango.Logging; + +namespace Tango.ColorConversion +{ + public class DefaultColorConverter : IColorConverter + { + static class NativeMethods + { + [DllImport("kernel32.dll")] + public static extern IntPtr LoadLibrary(string dllToLoad); + + [DllImport("kernel32.dll")] + public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName); + + [DllImport("kernel32.dll")] + public static extern bool FreeLibrary(IntPtr hModule); + } + + public ConversionOutput Convert(ConversionInput conversionInput) + { + IntPtr pDll = NativeMethods.LoadLibrary(@"Tango.ColorLib.dll"); + IntPtr pAddressOfFunctionToCall = NativeMethods.GetProcAddress(pDll, "Convert"); + NativeMethodDelegate convert = (NativeMethodDelegate)Marshal.GetDelegateForFunctionPointer( + pAddressOfFunctionToCall, + typeof(NativeMethodDelegate)); + + NativePMR nativePMR = new NativePMR(convert); + ConversionOutput output = nativePMR.Invoke(conversionInput); + + bool result = NativeMethods.FreeLibrary(pDll); + + if (output.HasError) + { + throw new ExternalException($"Color Conversion Error: {output.ErrorMessage}!"); + } + + return output; + } + + public ConversionOutput Convert(BrushStop stop, Configuration configuration, Rml rml) + { + if (stop == null) + { + throw new ArgumentNullException("Specified brush stop is a null reference."); + } + + if (configuration == null) + { + throw new ArgumentNullException("Specified configuration is a null reference."); + } + + if (rml == null) + { + throw new ArgumentNullException("Specified RML is a null reference."); + } + + if (rml.Ccts == null || rml.Ccts.Count == 0) + { + throw new InvalidOperationException($"No CCT found for RML {rml.Name}. Could not create a conversion input."); + } + + if (rml.ProcessParametersTablesGroups.Count == 0) + { + throw new InvalidOperationException($"No process parameters group for RML {rml.Name}. Could not create a conversion input."); + } + + ConversionInput conversionInput = new ConversionInput(); + + conversionInput.ColorSpace = (PMR.ColorLab.ColorSpace)stop.ColorSpace.Code; + + if (stop.ColorSpace.IsCatalog) + { + conversionInput.ColorSpace = PMR.ColorLab.ColorSpace.Volume; + + if (stop.ColorCatalog != null) + { + stop.SetVolume(LiquidTypes.Cyan, stop.ColorCatalog.Cyan); + stop.SetVolume(LiquidTypes.Magenta, stop.ColorCatalog.Magenta); + stop.SetVolume(LiquidTypes.Yellow, stop.ColorCatalog.Yellow); + stop.SetVolume(LiquidTypes.Black, stop.ColorCatalog.Black); + } + } + + conversionInput.InputCoordinates = new InputCoordinates(); + + conversionInput.InputCoordinates.Red = Math.Max(stop.Red, 1); + conversionInput.InputCoordinates.Green = Math.Max(stop.Green, 1); + conversionInput.InputCoordinates.Blue = Math.Max(stop.Blue, 1); + + conversionInput.InputCoordinates.L = stop.L; + conversionInput.InputCoordinates.A = stop.A; + conversionInput.InputCoordinates.B = stop.B; + + conversionInput.InputCoordinates.Cyan = stop.Cyan; + conversionInput.InputCoordinates.Magenta = stop.Magenta; + conversionInput.InputCoordinates.Yellow = stop.Yellow; + conversionInput.InputCoordinates.Key = stop.Black; + + conversionInput.ThreadL = rml.WhitePointL; + conversionInput.ThreadA = rml.WhitePointA; + conversionInput.ThreadB = rml.WhitePointB; + + conversionInput.ForwardData = ByteString.CopyFrom(rml.Ccts.FirstOrDefault().ForwardData); + + foreach (var processTable in rml.ProcessParametersTablesGroups.First(x => x.Active).ProcessParametersTables) + { + conversionInput.ProcessRanges.Add(new ProcessRange() + { + MinInkUptake = processTable.MinInkUptake, + MaxInkUptake = processTable.MaxInkUptake, + }); + } + + foreach (var ids_pack in configuration.GetSupportedIdsPacks(rml)) + { + CalibrationData calibrationData = Cat.CreateDemoCalibrationData((PMR.ColorLab.LiquidType)ids_pack.LiquidType.Code); + + //TODO: Enable Machine Calibration Also.. + + //var machine_cat = ids_pack.LiquidType.Cats.SingleOrDefault(x => x.MachineGuid == machine.Guid && x.RmlGuid == job.RmlGuid); + + //if (machine_cat != null) + //{ + // calibrationData = machine_cat.GetCalibrationData(); + //} + //else + //{ + var rml_cat = rml.LiquidTypesRmls.SingleOrDefault(x => x.LiquidType.Code == ids_pack.LiquidType.Code); + + if (rml_cat != null) + { + calibrationData = rml_cat.GetCalibrationData(); + } + //} + + conversionInput.InputCoordinates.InputLiquids.Add(new InputLiquid() + { + LiquidType = (PMR.ColorLab.LiquidType)ids_pack.LiquidType.Code, + MaxNanoliterPerCentimeter = ids_pack.LiquidType.LiquidTypesRmls.Single(x => x.Rml == rml).MaxNlPerCm, + Volume = stop.GetVolume(ids_pack.PackIndex), + CalibrationData = calibrationData, + }); + } + + return Convert(conversionInput); + } + + public ConversionOutput Convert(BrushStop stop) + { + if (stop == null) + { + throw new ArgumentNullException("Specified brush stop is a null reference."); + } + + if (stop.Segment == null || stop.Segment.Job == null) + { + throw new ArgumentNullException("The specified brush stop must be a part of a job segment."); + } + + if (stop.Segment.Job.Machine == null || stop.Segment.Job.Machine.Configuration == null) + { + throw new ArgumentNullException("The specified brush stop is associated with a job that is not a part of any machine or the machine does not have any configuration."); + } + + return Convert(stop, stop.Segment.Job.Machine.Configuration, stop.Segment.Job.Rml); + } + + public ConversionOutput Convert(Job job, Color color) + { + if (job == null) + { + throw new ArgumentNullException("Specified job is a null reference."); + } + + if (job.Machine == null) + { + throw new ArgumentNullException("Specified job machine is a null reference."); + } + + if (job.Rml == null) + { + throw new ArgumentNullException("Specified job RML is a null reference."); + } + + BrushStop stop = new BrushStop(); + stop.ColorSpace = new BL.Entities.ColorSpace() + { + Code = ColorSpaces.RGB.ToInt32(), + }; + stop.Color = color; + + return Convert(stop, job.Machine.Configuration, job.Rml); + } + + public bool IsOutOfGamut(BrushStop stop) + { + return Convert(stop).OutOfGamut; + } + + public ProcessParametersTable GetRecommendedProcessParameters(Job job) + { + var stops = job.Segments.SelectMany(x => x.BrushStops).ToList(); + + var standard_stops = stops.Where(x => x.BrushColorSpace == ColorSpaces.RGB || x.BrushColorSpace == ColorSpaces.LAB || x.BrushColorSpace == ColorSpaces.CMYK || x.BrushColorSpace == ColorSpaces.Volume); + var color_catalog_stops = stops.Where(x => x.BrushColorSpace != ColorSpaces.RGB && x.BrushColorSpace != ColorSpaces.LAB && x.BrushColorSpace != ColorSpaces.CMYK && x.BrushColorSpace != ColorSpaces.Volume); + + var max_standard = 1; + var max_catalog = 1; + + if (standard_stops.Count() > 0) + { + max_standard = standard_stops.Select(x => Convert(x)).Select(x => x.SingleCoordinates).Max(x => x.ProcessParametersTableIndex); + } + + if (color_catalog_stops.Where(x => x.ColorCatalog != null).Count() > 0) + { + max_catalog = color_catalog_stops.Where(x => x.ColorCatalog != null).Max(x => x.ColorCatalog.ProcessParametersTableIndex); + } + + int index = 0; + + if (standard_stops.Count() == 0) + { + index = max_catalog; + } + else if (color_catalog_stops.Count() == 0) + { + index = max_standard; + } + else + { + index = Math.Max(max_standard, max_catalog); + } + + var processParameters = job.Rml.GetActiveProcessGroup().ProcessParametersTables.FirstOrDefault(x => x.TableIndex == index); + + if (processParameters == null) + { + processParameters = job.Rml.GetActiveProcessGroup().ProcessParametersTables.FirstOrDefault(); + } + + return processParameters; + } + } +} diff --git a/Software/Visual_Studio/Tango.ColorConversion/ExtensionMethods/ColorConversionSuggestionExtensions.cs b/Software/Visual_Studio/Tango.ColorConversion/ExtensionMethods/ColorConversionSuggestionExtensions.cs new file mode 100644 index 000000000..076890230 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorConversion/ExtensionMethods/ColorConversionSuggestionExtensions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.ColorConversion; + +public static class ColorConversionSuggestionExtensions +{ + /// + /// Gets the hive center suggestion. + /// + /// The suggestions. + /// + public static ColorConversionSuggestion GetCenterSuggestion(this IEnumerable suggestions) + { + if (suggestions.Count() == 3) + { + return suggestions.ElementAt(1); + } + else + { + return suggestions.ElementAt(10); + } + } +} + diff --git a/Software/Visual_Studio/Tango.ColorConversion/ExtensionMethods/ConversionOutputExtensions.cs b/Software/Visual_Studio/Tango.ColorConversion/ExtensionMethods/ConversionOutputExtensions.cs new file mode 100644 index 000000000..8d96ce777 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorConversion/ExtensionMethods/ConversionOutputExtensions.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.ColorConversion; +using Tango.PMR.ColorLab; + +public static class ConversionOutputExtensions +{ + public static List CreateHiveSuggestions(this ConversionOutput conversionOutput) + { + List suggestions = new List(); + + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[1], 0, 1)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[2], 0, 2)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[3], 0, 3)); + + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[5], 1, 0)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[6], 1, 1)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[7], 1, 2)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[8], 1, 3)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[9], 1, 4)); + + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[10], 2, 0)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[11], 2, 1)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[12], 2, 2)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[13], 2, 3)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[14], 2, 4)); + + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[15], 3, 0)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[16], 3, 1)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[17], 3, 2)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[18], 3, 3)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[19], 3, 4)); + + suggestions.Add(new ColorConversionSuggestion(conversionOutput.HiveCoordinates[22], 4, 2)); + + return suggestions; + } + + public static List CreateTrippletSuggestions(this ConversionOutput conversionOutput) + { + List suggestions = new List(); + + suggestions.Add(new ColorConversionSuggestion(conversionOutput.TripleCoordinates[0], 0, 0)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.TripleCoordinates[1], 0, 0)); + suggestions.Add(new ColorConversionSuggestion(conversionOutput.TripleCoordinates[2], 0, 0)); + + return suggestions; + } + + public static ColorConversionSuggestion CreateSingleSuggestion(this ConversionOutput conversionOutput) + { + return new ColorConversionSuggestion(conversionOutput.SingleCoordinates, 0, 0); + } + + public static void ApplyOnBrushStop(this ConversionOutput conversionOutput, BrushStop stop, ProcessParametersTable processTable) + { + var output = conversionOutput; + + if (stop.LiquidVolumes == null || stop.LiquidVolumes.Count == 0) + { + stop.SetLiquidVolumes(stop.Segment.Job.Machine.Configuration, stop.Segment.Job.Rml, processTable); + } + + stop.Red = conversionOutput.SingleCoordinates.Red; + stop.Green = conversionOutput.SingleCoordinates.Green; + stop.Blue = conversionOutput.SingleCoordinates.Blue; + stop.IsOutOfGamut = conversionOutput.OutOfGamut; + + foreach (var outputLiquid in output.SingleCoordinates.OutputLiquids) + { + var liquidVolume = stop.LiquidVolumes.SingleOrDefault(x => x.IdsPack.LiquidType.Code == outputLiquid.LiquidType.ToInt32()); + + if (liquidVolume == null) + { + throw new NullReferenceException("Liquid volume not found for color conversion output liquid '" + outputLiquid.LiquidType + "'."); + } + + liquidVolume.Volume = outputLiquid.Volume; + } + } +} + diff --git a/Software/Visual_Studio/Tango.ColorConversion/IColorConverter.cs b/Software/Visual_Studio/Tango.ColorConversion/IColorConverter.cs new file mode 100644 index 000000000..00cd79b46 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorConversion/IColorConverter.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; +using Tango.BL.Entities; +using Tango.PMR.ColorLab; + +namespace Tango.ColorConversion +{ + /// + /// Represents an RGB/LAB to and from liquid volumes conversion engine. + /// + public interface IColorConverter + { + ConversionOutput Convert(ConversionInput conversionInput); + ConversionOutput Convert(BrushStop stop, Configuration configuration, Rml rml); + ConversionOutput Convert(BrushStop stop); + ConversionOutput Convert(Job job, Color color); + bool IsOutOfGamut(BrushStop stop); + ProcessParametersTable GetRecommendedProcessParameters(Job job); + } +} diff --git a/Software/Visual_Studio/Tango.ColorConversion/Tango.ColorConversion.csproj b/Software/Visual_Studio/Tango.ColorConversion/Tango.ColorConversion.csproj index 2846ca99a..182de5d30 100644 --- a/Software/Visual_Studio/Tango.ColorConversion/Tango.ColorConversion.csproj +++ b/Software/Visual_Studio/Tango.ColorConversion/Tango.ColorConversion.csproj @@ -34,6 +34,7 @@ ..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll + @@ -47,7 +48,11 @@ GlobalVersionInfo.cs - + + + + + @@ -62,6 +67,10 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core + + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} + Tango.Logging + {e4927038-348d-4295-aaf4-861c58cb3943} Tango.PMR diff --git a/Software/Visual_Studio/Tango.Integration/Operation/DefaultGradientGenerationConfiguration.cs b/Software/Visual_Studio/Tango.Integration/Operation/DefaultGradientGenerationConfiguration.cs index 59c6441d3..62ac43b40 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/DefaultGradientGenerationConfiguration.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/DefaultGradientGenerationConfiguration.cs @@ -4,9 +4,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; -using Tango.BL.ColorConversion; using Tango.BL.Entities; using Tango.BL.Enumerations; +using Tango.ColorConversion; using Tango.Core; using Tango.Core.ExtensionMethods; @@ -91,6 +91,8 @@ namespace Tango.Integration.Operation var refStop = segment.BrushStops.First().Clone(segment); + IColorConverter converter = new DefaultColorConverter(); + for (double cm = 0; cm <= segment.Length; cm += (ResolutionCM / 100d)) { if (aborted) return stops; @@ -100,7 +102,7 @@ namespace Tango.Integration.Operation if (colorSpace == ColorSpaces.RGB || colorSpace == ColorSpaces.LAB || colorSpace == ColorSpaces.CMYK) { var color = GetRelativeRGB(segment.BrushStops.ToList(), offset); - var output = TangoColorConverter.GetSuggestions(segment.Job, color, true); + var output = converter.Convert(segment.Job, color); BrushStop s = new BrushStop(); s.Segment = segment; @@ -114,7 +116,7 @@ namespace Tango.Integration.Operation s.Blue = color.B; s.StopIndex = stopIndex++; - TangoColorConverter.ApplyBrushStopCorrection(s, processParameters, output); + output.ApplyOnBrushStop(s, processParameters); stops.Add(s); } diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 766448bcc..75a85bc4c 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -22,7 +22,6 @@ using Tango.PMR.Hardware; using Google.Protobuf; using Tango.PMR.Connection; using Tango.BL.Enumerations; -using Tango.BL.ColorConversion; using Tango.PMR.Stubs; using System.Threading; using Tango.Integration.Storage; @@ -36,6 +35,7 @@ using Tango.Integration.JobRuns; using Tango.FirmwareUpdateLib.WPF; using Tango.FirmwareUpdateLib; using Tango.Core.ExtensionMethods; +using Tango.ColorConversion; namespace Tango.Integration.Operation { @@ -1159,6 +1159,8 @@ namespace Tango.Integration.Operation /// public Task Print(Job job) { + IColorConverter converter = new DefaultColorConverter(); + var jobSegments = job.OrderedSegments; //Check not brush stop has color space 'Volume'. @@ -1167,9 +1169,6 @@ namespace Tango.Integration.Operation throw new InvalidOperationException("Cannot print a brush stop with volume color space when process parameters table has not been specified."); } - //Get least common process parameters table index. - int processParametersTableIndex = TangoColorConverter.GetLeastCommonProcessParametersTableIndex(jobSegments.SelectMany(x => x.BrushStops)); - if (job.Rml == null) { throw new NullReferenceException("Job RML is null"); @@ -1182,11 +1181,11 @@ namespace Tango.Integration.Operation throw new NullReferenceException("Could not locate an active process parameters tables group for RML " + job.Rml.Name); } - var processParameters = processGroup.ProcessParametersTables.FirstOrDefault(x => x.TableIndex == processParametersTableIndex); + var processParameters = converter.GetRecommendedProcessParameters(job); if (processParameters == null) { - throw new NullReferenceException("Could not locate process parameters table index " + processParametersTableIndex + " in group " + processGroup.Name + " for RML " + job.Rml.Name); + throw new NullReferenceException("Could not locate any process parameters table in group " + processGroup.Name + " for RML " + job.Rml.Name); } //Perform color correction @@ -1196,7 +1195,7 @@ namespace Tango.Integration.Operation { if (stop.BrushColorSpace == ColorSpaces.RGB || stop.BrushColorSpace == ColorSpaces.LAB) { - var output = TangoColorConverter.GetSuggestions(stop); + var output = converter.Convert(stop); //TODO: Restore this when Mirta conversion is working as expected. //if (suggestions.OutOfGamut) diff --git a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj index b536b1281..994a0ef2e 100644 --- a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj +++ b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj @@ -147,6 +147,10 @@ {f441feee-322a-4943-b566-110e12fd3b72} Tango.BL + + {b4fe6485-4161-4b36-bc08-67e0b53d01b7} + Tango.ColorConversion + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core @@ -184,7 +188,7 @@ - + \ No newline at end of file -- cgit v1.3.1 From 0849ec4aadd206d711c8ed0c833be5ef6bc1d8a7 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 11 Jul 2019 12:31:52 +0300 Subject: Working MS on bugs and improvement. --- Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 53673984 -> 53673984 bytes .../ViewModels/MainViewVM.cs | 2 +- .../Views/MainView.xaml | 2 +- .../Views/MachineJobSelectionView.xaml | 6 ---- .../ViewModels/MainViewVM.cs | 3 ++ .../Tango.MachineStudio.RML/Images/data-table.png | Bin 0 -> 1238 bytes .../Tango.MachineStudio.RML.csproj | 3 ++ .../Tango.MachineStudio.RML/Views/RmlView.xaml | 37 +++++++++++++++++++++ .../Tango.BL/Entities/Configuration.cs | 2 +- 10 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/data-table.png (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer') diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf index 1fcb444d4..de93111bb 100644 Binary files a/Software/DB/PPC/Tango.mdf and b/Software/DB/PPC/Tango.mdf differ diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf index 3aef11f9e..3d7256880 100644 Binary files a/Software/DB/PPC/Tango_log.ldf and b/Software/DB/PPC/Tango_log.ldf differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs index c33ef1f86..a106ea184 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs @@ -628,7 +628,7 @@ namespace Tango.MachineStudio.ColorLab.ViewModels #region RML - private async void InvalidateLiquidFactorsCalibrationData() + public async void InvalidateLiquidFactorsCalibrationData() { if (SelectedRML != null && SelectedMachine != null) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml index fe4edcb8b..d78424d4e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml @@ -141,7 +141,7 @@ - COLOR ADJUSTMENT DATA + COLOR CONVERSION TABLE (CCT) diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml index ab97d7858..0ba2e39d4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml @@ -55,12 +55,6 @@ - diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs index 15033e295..935cfe5ee 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs @@ -239,6 +239,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels public void DropIdsPack(IdsPack idsPack1, IdsPack idsPack2) { ActiveMachine.Configuration.IdsPacks.Swap(idsPack1, idsPack2); + ColorLabVM.InvalidateLiquidFactorsCalibrationData(); } /// @@ -333,6 +334,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { idsPack.LiquidType = liquidType; idsPack.LiquidTypeGuid = liquidType.Guid; + ColorLabVM.InvalidateLiquidFactorsCalibrationData(); } /// @@ -358,6 +360,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { ActiveMachineAdapter.Context.IdsPacks.Remove(SelectedIds); SelectedIds = null; + ColorLabVM.InvalidateLiquidFactorsCalibrationData(); } /// diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/data-table.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/data-table.png new file mode 100644 index 000000000..0d5e5eaa6 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Images/data-table.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj index b1c8f580d..6b113be5f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj @@ -186,6 +186,9 @@ + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml index 8f2c5d187..e43c20c3d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml @@ -132,6 +132,43 @@ + + + + + + COLOR CONVERSION TABLE (CCT) + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.BL/Entities/Configuration.cs b/Software/Visual_Studio/Tango.BL/Entities/Configuration.cs index 0ff26d450..c6b823385 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Configuration.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Configuration.cs @@ -36,7 +36,7 @@ namespace Tango.BL.Entities throw new NullReferenceException("The specified RML cannot be null."); } - return NoneEmptyIdsPacks.Where(x => rml.LiquidTypesRmls.ToList().Exists(y => y.LiquidType.Guid == x.LiquidType.Guid)).OrderBy(x => x.PackIndex).ToList(); + return NoneEmptyIdsPacks.Where(x => rml.LiquidTypesRmls.ToList().Exists(y => x.LiquidType != null && y.LiquidType.Guid == x.LiquidType.Guid)).OrderBy(x => x.PackIndex).ToList(); } /// -- cgit v1.3.1 From b2e41ba5213c6a7f08cf8bcb2e4e2654aa6a6224 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 11 Jul 2019 14:01:43 +0300 Subject: Refactored CCT to single CCT per RML. --- .../ViewModels/MainViewVM.cs | 45 +--- .../Views/MainView.xaml | 2 +- .../ViewModels/CctsViewVM.cs | 8 +- .../ViewModels/MainViewVM.cs | 4 +- .../ViewModels/MainViewVM.cs | 70 ++++++- .../Tango.MachineStudio.RML/Views/RmlView.xaml | 2 +- .../Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs | 2 +- .../Printing/DefaultPrintingManager.cs | 2 +- .../Visual_Studio/Tango.BL/Builders/RmlBuilder.cs | 16 +- .../Tango.BL/Builders/RmlsCollectionBuilder.cs | 19 +- Software/Visual_Studio/Tango.BL/DTO/CctDTOBase.cs | 28 +-- Software/Visual_Studio/Tango.BL/DTO/RmlDTOBase.cs | 8 + .../Visual_Studio/Tango.BL/Entities/CctBase.cs | 226 ++++----------------- .../Visual_Studio/Tango.BL/Entities/RmlBase.cs | 59 ++++-- .../Tango.BL/Enumerations/ColorCatalogsItems.cs | 6 + .../Tango.BL/ObservablesContextAdapter.cs | 10 - .../Tango.ColorConversion/DefaultColorConverter.cs | 4 +- Software/Visual_Studio/Tango.DAL.Remote/DB/CCT.cs | 17 +- Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs | 5 +- .../Tango.DAL.Remote/DB/RemoteADO.edmx | 83 ++++---- .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 148 +++++++------- .../DefaultGradientGenerationConfiguration.cs | 2 +- .../Tango.Integration/Operation/MachineOperator.cs | 10 +- 23 files changed, 336 insertions(+), 440 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs index a106ea184..94fa36e57 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs @@ -248,12 +248,8 @@ namespace Tango.MachineStudio.ColorLab.ViewModels public RelayCommand ImportForwardDataCommand { get; set; } - public RelayCommand ImportInverseDataCommand { get; set; } - public RelayCommand ExportForwardDataCommand { get; set; } - public RelayCommand ExportInverseDataCommand { get; set; } - public RelayCommand SaveCommand { get; set; } #endregion @@ -274,10 +270,8 @@ namespace Tango.MachineStudio.ColorLab.ViewModels SourceColor.ColorChanged += SourceColor_ColorChanged; ImportForwardDataCommand = new RelayCommand(ImportForwardData, () => SelectedRML != null && IsFree); - ImportInverseDataCommand = new RelayCommand(ImportInverseData, () => SelectedRML != null && IsFree); - ExportForwardDataCommand = new RelayCommand(ExportForwardData, () => SelectedRML != null && CCT != null && CCT.ForwardFileName != null && IsFree); - ExportInverseDataCommand = new RelayCommand(ExportInverseData, () => SelectedRML != null && CCT != null && CCT.InverseFileName != null && IsFree); + ExportForwardDataCommand = new RelayCommand(ExportForwardData, () => SelectedRML != null && CCT != null && CCT.FileName != null && IsFree); SaveCommand = new RelayCommand(Save, () => SelectedRML != null && IsFree); } @@ -336,13 +330,13 @@ namespace Tango.MachineStudio.ColorLab.ViewModels { try { - if (LiquidsCalibrationData == null || CCT.ForwardData == null) return; + if (LiquidsCalibrationData == null || CCT.Data == null) return; ConversionInput input = new ConversionInput(); input.ColorSpace = SourceColor.IsLab ? PMR.ColorLab.ColorSpace.Lab : PMR.ColorLab.ColorSpace.Rgb; input.DeltaChroma = DeltaChroma; input.DeltaL = DeltaL; - input.ForwardData = ByteString.CopyFrom(CCT.ForwardData); + input.ForwardData = ByteString.CopyFrom(CCT.Data); input.InputCoordinates = new InputCoordinates(); input.InputCoordinates.Red = (int)SourceColor.Red; @@ -455,36 +449,17 @@ namespace Tango.MachineStudio.ColorLab.ViewModels String file = GetCCTFileOpen(); if (file != null) { - CCT.ForwardFileName = Path.GetFileName(file); - CCT.ForwardData = File.ReadAllBytes(file); - } - } - - private void ImportInverseData() - { - String file = GetCCTFileOpen(); - if (file != null) - { - CCT.InverseFileName = Path.GetFileName(file); - CCT.InverseData = File.ReadAllBytes(file); + CCT.FileName = Path.GetFileName(file); + CCT.Data = File.ReadAllBytes(file); } } private void ExportForwardData() { - String file = GetCCTFileSave(CCT.ForwardFileName); - if (file != null) - { - File.WriteAllBytes(file, CCT.ForwardData); - } - } - - private void ExportInverseData() - { - String file = GetCCTFileSave(CCT.InverseFileName); + String file = GetCCTFileSave(CCT.FileName); if (file != null) { - File.WriteAllBytes(file, CCT.InverseData); + File.WriteAllBytes(file, CCT.Data); } } @@ -573,7 +548,7 @@ namespace Tango.MachineStudio.ColorLab.ViewModels input.ColorSpace = PMR.ColorLab.ColorSpace.Volume; input.DeltaChroma = DeltaChroma; input.DeltaL = DeltaL; - input.ForwardData = ByteString.CopyFrom(CCT.ForwardData); + input.ForwardData = ByteString.CopyFrom(CCT.Data); input.InputCoordinates = new InputCoordinates(); input.ThreadL = 92.1815; //SelectedRML.MediaColor.L; @@ -695,12 +670,12 @@ namespace Tango.MachineStudio.ColorLab.ViewModels } _isNewCCT = false; - CCT = SelectedRML.Ccts.FirstOrDefault(); + CCT = SelectedRML.Cct; if (CCT == null) { CCT = new Cct(); - CCT.Rml = SelectedRML; + SelectedRML.Cct = CCT; _isNewCCT = true; } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml index d78424d4e..888945579 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml @@ -148,7 +148,7 @@ - + public RelayCommand RemoveRmlCommand { get; set; } + public RelayCommand ImportForwardDataCommand { get; set; } + + public RelayCommand ExportForwardDataCommand { get; set; } + public RelayCommand AddProcessParametersTableCommand { get; set; } public RelayCommand RemoveProcessParametersTableCommand { get; set; } @@ -165,6 +169,10 @@ namespace Tango.MachineStudio.RML.ViewModels RemoveLiquidFactorCommand = new RelayCommand(RemoveLiquidFactor, () => IsFree); CreateCalibrationDataExcelTemplateCommand = new RelayCommand(CreateCalibrationDataExcelTemplate); SaveCommand = new RelayCommand(Save, () => IsFree); + + ImportForwardDataCommand = new RelayCommand(ImportForwardData, () => ActiveRML != null && IsFree); + + ExportForwardDataCommand = new RelayCommand(ExportForwardData, () => ActiveRML != null && ActiveRML.Cct != null && IsFree); } public override void OnApplicationReady() @@ -199,6 +207,7 @@ namespace Tango.MachineStudio.RML.ViewModels .Set(guid) .WithActiveParametersGroup() .WithLiquidFactors() + .WithCCT() .BuildAsync(); if (ActiveRML.ProcessParametersTablesGroups.ToList().Count == 0) @@ -251,6 +260,8 @@ namespace Tango.MachineStudio.RML.ViewModels View.NavigateTo(RmlNavigationView.RmlView); + InvalidateRelayCommands(); + IsFree = true; } } @@ -491,5 +502,62 @@ namespace Tango.MachineStudio.RML.ViewModels View.NavigateTo(RmlNavigationView.RmlsView); LoadRmls(); } + + #region Import / Export Color Conversion Data + + private void ImportForwardData() + { + String file = GetCCTFileOpen(); + if (file != null) + { + if (ActiveRML.Cct == null) + { + Cct cct = new Cct(); + ActiveRML.Cct = cct; + } + + ActiveRML.Cct.FileName = Path.GetFileName(file); + ActiveRML.Cct.Data = File.ReadAllBytes(file); + } + } + + private void ExportForwardData() + { + String file = GetCCTFileSave(ActiveRML.Cct.FileName); + if (file != null) + { + File.WriteAllBytes(file, ActiveRML.Cct.Data); + } + } + + private String GetCCTFileOpen() + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Title = "Select color adjustment file"; + dlg.Filter = "Color Conversion Table|*.cct"; + if (dlg.ShowDialogCenter()) + { + return dlg.FileName; + } + + return null; + } + + private String GetCCTFileSave(String fileName) + { + SaveFileDialog dlg = new SaveFileDialog(); + dlg.Title = "Select color adjustment file"; + dlg.Filter = "Color Conversion Table|*.cct"; + dlg.FileName = fileName; + dlg.DefaultExt = ".cct"; + if (dlg.ShowDialogCenter()) + { + return dlg.FileName; + } + + return null; + } + + #endregion } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml index e43c20c3d..962e59291 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml @@ -148,7 +148,7 @@ - + - @@ -94,19 +94,19 @@ - - - @@ -495,7 +495,7 @@ - + @@ -512,7 +512,7 @@ @@ -553,7 +553,7 @@ - + @@ -563,7 +563,7 @@ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml index d0f0c2af6..3073d0b62 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml @@ -84,7 +84,7 @@ - + @@ -110,7 +110,7 @@ - + @@ -174,11 +174,11 @@ - + - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml index 121e6e45c..71ce6f173 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml @@ -420,7 +420,7 @@ - - + @@ -303,7 +303,7 @@ - + @@ -318,7 +318,7 @@ - diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml index bac93bff3..e6a18ddde 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml @@ -9,7 +9,7 @@ xmlns:local="clr-namespace:Tango.MachineStudio.Stubs.Views" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="#202020" Foreground="Gainsboro" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource DarkGrayBrush}" Foreground="Gainsboro" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/BlowerElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/BlowerElementEditor.xaml index 228424e80..524dd79c5 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/BlowerElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/BlowerElementEditor.xaml @@ -56,7 +56,7 @@ - + @@ -72,7 +72,7 @@ @@ -102,7 +102,7 @@ - + @@ -170,10 +170,10 @@ - - + + - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml index 4b7e2ea2c..190b4d3c8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/HeaterElementEditor.xaml @@ -48,7 +48,7 @@ - + @@ -75,7 +75,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml index 76a6a16a7..5165e9819 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml @@ -43,9 +43,9 @@ - + - + @@ -74,7 +74,7 @@ - + / m @@ -135,7 +135,7 @@ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorRecorderElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorRecorderElementEditor.xaml index 65f25f131..645f98331 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorRecorderElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorRecorderElementEditor.xaml @@ -38,7 +38,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml index ecfea2f28..7c3728d1e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml @@ -24,7 +24,7 @@ @@ -86,9 +86,9 @@ - + - + @@ -154,10 +154,10 @@ - - + + - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml index ac07f1390..a209270e7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml @@ -24,7 +24,7 @@ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml index f057521e0..3c4373097 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml @@ -38,7 +38,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -68,10 +68,10 @@ - - + + - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ValveElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ValveElementEditor.xaml index 2304469e0..59b9fa2af 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ValveElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ValveElementEditor.xaml @@ -46,7 +46,7 @@ - + @@ -90,7 +90,7 @@ - - diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveComboControl.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveComboControl.xaml index 692b3f818..7f135efbc 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveComboControl.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveComboControl.xaml @@ -33,19 +33,19 @@ - - + - diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml index d90d03545..03c6649d6 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml @@ -57,9 +57,11 @@ + + - - + + + @@ -206,13 +208,13 @@ 12 9 - + + --> - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/SharedResourceDictionary.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/SharedResourceDictionary.cs new file mode 100644 index 000000000..6b1a86741 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/SharedResourceDictionary.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace Tango.MachineStudio.Common.Resources +{ +/// +/// The shared resource dictionary is a specialized resource dictionary +/// that loads it content only once. If a second instance with the same source +/// is created, it only merges the resources from the cache. +/// + public class SharedResourceDictionary : ResourceDictionary + { + /// + /// Internal cache of loaded dictionaries + /// + public static Dictionary _sharedDictionaries = + new Dictionary(); + + /// + /// Local member of the source uri + /// + private Uri _sourceUri; + + /// + /// Gets or sets the uniform resource identifier (URI) to load resources from. + /// + public new Uri Source + { + get { return _sourceUri; } + set + { + _sourceUri = value; + + if (!_sharedDictionaries.ContainsKey(value)) + { + // If the dictionary is not yet loaded, load it by setting + // the source of the base class + base.Source = value; + + // add it to the cache + _sharedDictionaries.Add(value, this); + } + else + { + // If the dictionary is already loaded, get it from the cache + MergedDictionaries.Add(_sharedDictionaries[value]); + } + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index 897c4f72d..c368a499c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -93,6 +93,7 @@ + @@ -189,6 +190,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/Generic.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/Generic.xaml index 79245745e..6f7cd0e32 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/Generic.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/Generic.xaml @@ -63,7 +63,7 @@ - - + + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml index 6c55f6c5e..810114144 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml @@ -8,7 +8,8 @@ xmlns:views="clr-namespace:Tango.MachineStudio.UI.Views" xmlns:sharedControls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" mc:Ignorable="d" - Title="Tango" Height="800" Width="1280" Foreground="#494949" BorderThickness="1" BorderBrush="{StaticResource AccentColorBrush}"> + Title="Tango" Height="800" Width="1280" Foreground="{StaticResource MainWindow.Foreground}" + BorderThickness="1" BorderBrush="{StaticResource AccentColorBrush}" Background="{DynamicResource MainWindow.Background}"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml index 338cb2d22..6c0a42ed1 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml @@ -225,8 +225,8 @@ - - + + @@ -103,8 +103,8 @@ Firmware Upgrade Failed - - + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml index f66e247a9..57b8335c5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -248,11 +248,11 @@ - + @@ -517,7 +518,7 @@ - + @@ -525,7 +526,7 @@ - + @@ -576,11 +577,11 @@ - + - + @@ -605,7 +606,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml index 5f5e1042b..a209df34a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml @@ -140,12 +140,12 @@ - + - * + * diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ResolvedIssuesView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ResolvedIssuesView.xaml index 97c42d58d..d1ff75fc7 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ResolvedIssuesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ResolvedIssuesView.xaml @@ -42,7 +42,7 @@ - - diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ModuleWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ModuleWindow.xaml index 8721cfd6a..d53cb934e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ModuleWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Windows/ModuleWindow.xaml @@ -51,6 +51,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml index a16b6b4d2..f4fa039dc 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml @@ -50,7 +50,7 @@ + @@ -294,7 +300,7 @@ - + , @@ -453,7 +459,7 @@ - + COMPOSITE @@ -510,7 +516,7 @@ - + @@ -518,7 +524,7 @@ - + @@ -526,7 +532,7 @@ - + @@ -537,7 +543,7 @@ - + CALIBRATION DATA diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml index e338f3c0f..402740f82 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/AddressesView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.AddressesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.AddressesViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml index 704f5f5e2..bc1e948b0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationDisplayPanelVersionsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ApplicationDisplayPanelVersionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.ApplicationDisplayPanelVersionsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml index a216f4a1f..8fb4976c7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationFirmwareVersionsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ApplicationFirmwareVersionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.ApplicationFirmwareVersionsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml index f53c182c3..fdbcdabc4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ApplicationOsVersionsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ApplicationOsVersionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.ApplicationOsVersionsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml index d17f79c8d..b77c31aed 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CartridgeTypesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.CartridgeTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.CartridgeTypesViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml index 6eb693780..1a4cf673a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml @@ -9,7 +9,7 @@ xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.CatsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.CatsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctsView.xaml index 09962447c..6b80b94fe 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CctsView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.MachineStudio.DB.Converters" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.CctsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.CctsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml index 819dbd1c7..45bb2e776 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ConfigurationsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ConfigurationsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.ConfigurationsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactsView.xaml index e05808d83..e54a72a4c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ContactsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ContactsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.ContactsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml index 040ac5799..12bc16f1e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.DispenserTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.DispenserTypesViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml index 219230d32..0ff1f8a6b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/EmbeddedFirmwareVersionsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.EmbeddedFirmwareVersionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.EmbeddedFirmwareVersionsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapesView.xaml index f46b5894e..2a22bf929 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberShapesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.FiberShapesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.FiberShapesViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthsView.xaml index bec19add1..28b7a7b1b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/FiberSynthsView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.FiberSynthsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.FiberSynthsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareDancerTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareDancerTypesView.xaml index 93859e74d..c4b8026c6 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareDancerTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareDancerTypesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.HardwareDancerTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.HardwareDancerTypesViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareMotorTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareMotorTypesView.xaml index 49f7c9232..52af91e8a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareMotorTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareMotorTypesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.HardwareMotorTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.HardwareMotorTypesViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwarePidControlTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwarePidControlTypesView.xaml index 16ae138dc..01f9a444c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwarePidControlTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwarePidControlTypesView.xaml @@ -9,7 +9,7 @@ xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" d:DataContext="{d:DesignInstance Type=observables:HardwarePidControlType, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.HardwarePidControlTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" d:DataContext="{d:DesignInstance Type=observables:HardwarePidControlType, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.HardwarePidControlTypesViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml index 4a60ffcaa..ea6f97171 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/HardwareVersionsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.HardwareVersionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.HardwareVersionsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml index 81c9124f3..cc9889d6e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.IdsPackFormulasViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.IdsPackFormulasViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml index 03ab1d7d4..2ba826a12 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.IdsPacksViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.IdsPacksViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitsView.xaml index 41d719dad..d25f4eace 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LinearMassDensityUnitsView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.LinearMassDensityUnitsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.LinearMassDensityUnitsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml index 11f781e5b..2bfa395c8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesRmlsView.xaml @@ -8,7 +8,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.LiquidTypesRmlViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.LiquidTypesRmlViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesView.xaml index 4da0a8b59..90040469e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/LiquidTypesView.xaml @@ -9,7 +9,7 @@ xmlns:localConverters="clr-namespace:Tango.MachineStudio.DB.Converters" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.LiquidTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.LiquidTypesViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml index be917634a..370171855 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachineVersionsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MachineVersionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.MachineVersionsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml index c6febd63c..90b24af9a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MachinesView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MachinesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.MachinesViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionsView.xaml index 08f144710..36d441b0e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaConditionsView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MediaConditionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.MediaConditionsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialsView.xaml index 7530cf9df..7eae23499 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaMaterialsView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MediaMaterialsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.MediaMaterialsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposesView.xaml index ee4903f69..ab1c844ea 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MediaPurposesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MediaPurposesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.MediaPurposesViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MidTankTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MidTankTypesView.xaml index a808b8438..ba027b8ba 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MidTankTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MidTankTypesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MidTankTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.MidTankTypesViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/OrganizationsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/OrganizationsView.xaml index ff5e7df4a..4ec9f43c9 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/OrganizationsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/OrganizationsView.xaml @@ -8,7 +8,7 @@ xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.OrganizationsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.OrganizationsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml index 9455fd519..ad8815eeb 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PermissionsView.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.PermissionsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.PermissionsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml index 0eee2aa77..68f641e44 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesGroupsView.xaml @@ -9,7 +9,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ProcessParametersTablesGroupsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.ProcessParametersTablesGroupsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml index 0e20ce5af..dedf23a54 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTablesView.xaml @@ -9,7 +9,7 @@ xmlns:localConverters="clr-namespace:Tango.MachineStudio.DB.Converters" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.ProcessParametersTablesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.ProcessParametersTablesViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml index 8cd51ccac..bffe4e3c1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml @@ -8,7 +8,7 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.RmlsViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.RmlsViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml index 858cfd37b..77da90df7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RolesView.xaml @@ -7,7 +7,7 @@ xmlns:converters="clr-namespace:Tango.MachineStudio.DB.Converters" xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.RolesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.RolesViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.xaml index 4ed13cb11..438e80e03 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.xaml @@ -8,7 +8,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.SpoolTypesViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.SpoolTypesViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml index ad3814185..6d4cf4d23 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/UsersView.xaml @@ -8,7 +8,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.UsersViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource MainWindow.Background}" Foreground="{StaticResource MainWindow.Foreground}" DataContext="{x:Static global:ViewModelLocator.UsersViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml index 7fc9034cd..de4acd68f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml @@ -14,7 +14,7 @@ xmlns:global="clr-namespace:Tango.MachineStudio.DataCapture" xmlns:local="clr-namespace:Tango.MachineStudio.DataCapture.Views" mc:Ignorable="d" - d:DesignHeight="1080" d:DesignWidth="1920" Background="White" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + d:DesignHeight="1080" d:DesignWidth="1920" Background="{StaticResource MainWindow.Background}" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> @@ -36,10 +36,10 @@ - RECORDINGS + RECORDINGS - + @@ -69,7 +69,7 @@ - + @@ -177,7 +177,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index b90aa62b8..54a3b72a9 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -85,7 +85,7 @@ - + @@ -188,7 +188,7 @@ - + @@ -519,24 +519,13 @@ + @@ -617,7 +611,7 @@ Name - + @@ -649,8 +643,8 @@ - - + + @@ -700,7 +694,7 @@ Description - + @@ -818,7 +812,7 @@ - + @@ -835,7 +829,7 @@ @@ -850,19 +844,19 @@ @@ -896,6 +890,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - + + + + + + - + - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml index 97eceaa7d..b13ffb87b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml @@ -109,7 +109,7 @@ - Hardware Version + Hardware Version @@ -284,7 +284,7 @@ - + @@ -337,7 +337,7 @@ - + @@ -346,7 +346,7 @@ - + @@ -354,7 +354,7 @@ - + @@ -367,9 +367,9 @@ - IDS PACKS + IDS PACKS - + @@ -404,7 +404,7 @@ - + @@ -442,7 +442,7 @@ - + @@ -465,11 +465,11 @@ - + - + @@ -495,7 +495,7 @@ - + @@ -517,8 +517,8 @@ - - v + + v @@ -527,7 +527,7 @@ - + @@ -549,11 +549,11 @@ - + - + @@ -575,12 +575,12 @@ - - v + + v - + @@ -602,12 +602,12 @@ - - v + + v - + @@ -629,12 +629,12 @@ - - v + + v - + @@ -656,12 +656,12 @@ - - v + + v - + @@ -683,12 +683,12 @@ - - v + + v - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml index 8c9fe7179..6a8b7c9b0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml @@ -27,7 +27,7 @@ - + @@ -42,19 +42,19 @@ Machine Version - + Organization - + Default RML - + Loaded RML - + Default Color Space - + Default Segment Length @@ -68,7 +68,7 @@ Device COM Port - + Auto Login diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml index 41dc0554c..466e6f458 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml @@ -60,7 +60,7 @@ - + + @@ -67,24 +76,32 @@ - + - + + + + - + - + - + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml index e6a18ddde..a8daa4540 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml @@ -9,7 +9,7 @@ xmlns:local="clr-namespace:Tango.MachineStudio.Stubs.Views" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource DarkGrayBrush}" Foreground="Gainsboro" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource DarkGrayBrush}" Foreground="{StaticResource BorderBrushGainsboro}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/JobRunnerTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/JobRunnerTemplate.xaml index b6bfefd8c..1936a90d2 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/JobRunnerTemplate.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/JobRunnerTemplate.xaml @@ -52,7 +52,7 @@ Length - + Winding Method @@ -64,10 +64,10 @@ Inter Segment Length - + Number of Units - + Enable Lubrication diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml index 7da979a00..82052f02f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml @@ -49,11 +49,11 @@ Minimum - + Maximum - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml index 3830ecc3e..037ae0693 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml @@ -49,11 +49,11 @@ Minimum - + Maximum - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml index 1cb7876cf..5eb72e65b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml @@ -26,7 +26,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml index 2d180a8a2..63d22d365 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml @@ -77,40 +77,40 @@ - + - + - + - + - + - + - + - + @@ -140,105 +140,105 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -464,11 +464,11 @@ Left - + Top - + @@ -476,11 +476,11 @@ Width - + Height - + @@ -491,7 +491,7 @@ Angle - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml index f8045d7a6..d5a5d41d7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml @@ -28,7 +28,7 @@ - + @@ -39,7 +39,7 @@ ADDRESS - + @@ -51,7 +51,7 @@ CONTACT - + @@ -107,7 +107,7 @@ - + - - - - - - @@ -162,7 +156,7 @@ - + @@ -175,14 +169,18 @@ - + - + - + @@ -190,13 +188,7 @@ - - - - - - - + @@ -205,8 +197,11 @@ - - + + @@ -217,13 +212,7 @@ - - - - - - - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveComboControl.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveComboControl.xaml index 7f135efbc..cd218f663 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveComboControl.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveComboControl.xaml @@ -39,7 +39,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MachineView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MachineView.xaml index 6f352f35c..013dca6ce 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MachineView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MachineView.xaml @@ -39,7 +39,7 @@ - + @@ -174,7 +174,7 @@ - NO IDS PACKS + NO IDS PACKS @@ -195,7 +195,7 @@ - + @@ -238,7 +238,7 @@ - + @@ -247,7 +247,7 @@ - + @@ -255,7 +255,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs index 0433ff7be..2920c8dd9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs @@ -135,6 +135,11 @@ namespace Tango.MachineStudio.Common return DeploymentSlot.ToAddress(); } + /// + /// Gets or sets the working theme. + /// + public MachineStudioTheme Theme { get; set; } + /// /// Initializes a new instance of the class. /// @@ -149,6 +154,7 @@ namespace Tango.MachineStudio.Common JobUploadStrategy = JobUploadStrategy.JobDescriptionFile; MaximumCacheTime = TimeSpan.FromMinutes(5); CachingMode = ObservablesContextInMemoryCachingMode.None; + Theme = MachineStudioTheme.Light; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioTheme.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioTheme.cs new file mode 100644 index 000000000..16dda143b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioTheme.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Common +{ + public enum MachineStudioTheme + { + Light, + Dark + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml index 03c6649d6..0bf472a2e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml @@ -24,11 +24,12 @@ - - - - + + @@ -139,9 +140,9 @@ AllowsTransparency="True" PopupAnimation="Slide" Focusable="False"> - @@ -286,7 +287,7 @@ - + @@ -477,7 +478,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/SharedResourceDictionary.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/SharedResourceDictionary.cs index 6b1a86741..d422df26c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/SharedResourceDictionary.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/SharedResourceDictionary.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; +using Tango.Settings; namespace Tango.MachineStudio.Common.Resources { @@ -34,6 +35,11 @@ namespace Tango.MachineStudio.Common.Resources set { _sourceUri = value; + var settings = SettingsManager.Default.GetOrCreate(); + //add current theme + MachineStudioTheme wTheme = settings.Theme; + if ((wTheme == MachineStudioTheme.Dark && value.LocalPath.Contains("Light")) || (wTheme == MachineStudioTheme.Light && value.LocalPath.Contains("Dark"))) + return; if (!_sharedDictionaries.ContainsKey(value)) { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index c368a499c..62f2dc984 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -93,6 +93,7 @@ + @@ -186,6 +187,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/DarkThemeColors.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/DarkThemeColors.xaml new file mode 100644 index 000000000..ad8f0f09b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/DarkThemeColors.xaml @@ -0,0 +1,301 @@ + + + + + + + + + 0.7 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #5C5C5C + #5C5C5C + #5C5C5C + #FF03A9F4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/LightThemeColors.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/LightThemeColors.xaml index 90b3b0829..25f72f8d4 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/LightThemeColors.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/LightThemeColors.xaml @@ -1,9 +1,14 @@  + xmlns:local="clr-namespace:Tango.MachineStudio.Common.Themes" + xmlns:system="clr-namespace:System;assembly=mscorlib"> + + + - + 1 + @@ -44,9 +49,7 @@ - - - + @@ -73,6 +76,13 @@ + + + + + + + @@ -87,26 +97,49 @@ - - + - + + + + - + - + + + - - - + + + + + + + + + + + + + + + - + + + + + + + + @@ -153,6 +186,34 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml index 11ab79afd..618035112 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml @@ -12,6 +12,7 @@ + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs index 2e2b1a014..edcc4ba39 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs @@ -64,12 +64,14 @@ namespace Tango.MachineStudio.UI LogManager.Log("Application Started..."); LogManager.LogReferencedAssemblies(); + var settings = SettingsManager.Default.GetOrCreate(); + //add current theme + MachineStudioTheme wTheme = settings.Theme; base.OnStartup(e); LogManager.Categories.Clear(); - var settings = SettingsManager.Default.GetOrCreate(); if (settings.LoggingCategories.Count == 0) { @@ -104,7 +106,9 @@ namespace Tango.MachineStudio.UI { LogManager.Log("EF Caching is disabled"); } + } + #region Global Exception Trapping diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml index 810114144..eecbcf8ad 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml @@ -9,7 +9,7 @@ xmlns:sharedControls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" mc:Ignorable="d" Title="Tango" Height="800" Width="1280" Foreground="{StaticResource MainWindow.Foreground}" - BorderThickness="1" BorderBrush="{StaticResource AccentColorBrush}" Background="{DynamicResource MainWindow.Background}"> + BorderThickness="1" BorderBrush="{StaticResource AccentColorBrush}" Background="{DynamicResource MainWindow.Background}" WindowTitleBrush="{StaticResource MainWindow.WindowTitleColorBrush}"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml index 2eb1080cb..41405f7fb 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml @@ -10,7 +10,7 @@ Title="Machine Studio" MinHeight="220" SizeToContent="WidthAndHeight" MinWidth="600" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterOwner" Background="Transparent" ShowInTaskbar="False"> - + @@ -18,7 +18,7 @@ - diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml index 8f9512236..e037e3630 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml @@ -15,7 +15,7 @@ - + @@ -30,8 +30,8 @@ - - + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml index 5e27071ec..5cc3d719b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml @@ -15,7 +15,7 @@ - + @@ -32,10 +32,10 @@ - + - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index b2faf346e..31ba4e57d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Reflection; using System.Text; +using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using System.Windows; @@ -174,6 +175,11 @@ namespace Tango.MachineStudio.UI.ViewModels /// public RelayCommand AboutCommand { get; set; } + /// + /// Gets or sets the about command. + /// + public RelayCommand ChangeAppThemeCommand { get; set; } + private IAuthenticationProvider _authenticationProvider; /// /// Gets or sets the authentication provider. @@ -336,6 +342,8 @@ namespace Tango.MachineStudio.UI.ViewModels TangoMessenger.Default.Register((x) => DisableCheckForUpdates = true); AboutCommand = new RelayCommand(ShowAboutDialog); + + ChangeAppThemeCommand = new RelayCommand(ChangeTheme); } private void MachineEventsStateProvider_EventsResolved(object sender, IEnumerable e) @@ -926,5 +934,15 @@ namespace Tango.MachineStudio.UI.ViewModels IsApplicationReady = true; } } + + private void ChangeTheme(MachineStudioTheme theme) + { + var settings = SettingsManager.Default.GetOrCreate(); + //add current theme + settings.Theme = theme; + settings.Save(); + + _notificationProvider.ShowInfo("Changes will be applies after application restart."); + } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml index bf9a52b98..a5ffe9964 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml @@ -10,7 +10,7 @@ xmlns:bl="clr-namespace:Tango.BL;assembly=Tango.BL" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" - d:DesignHeight="300" d:DesignWidth="300" Width="600" Height="700" Background="White" d:DataContext="{d:DesignInstance Type=vm:AboutViewVM, IsDesignTimeCreatable=False}" DataContext="{Binding AboutViewVM, Source={StaticResource Locator}}"> + d:DesignHeight="300" d:DesignWidth="300" Width="600" Height="700" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:AboutViewVM, IsDesignTimeCreatable=False}" DataContext="{Binding AboutViewVM, Source={StaticResource Locator}}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -61,23 +61,23 @@ Data Source: - () + () Caching Mode: - (Requires restart) + (Requires restart) Job Upload Strategy: - (Requires restart) + (Requires restart) Change Log: - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml index 8dfb04f1f..1734a9c94 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml @@ -12,7 +12,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" - d:DesignHeight="300" d:DesignWidth="300" Width="640" Height="500" Background="White" DataContext="{Binding ConnectedMachineViewVM, Source={StaticResource Locator}}"> + d:DesignHeight="300" d:DesignWidth="300" Width="640" Height="500" Background="{StaticResource Dialog.Background}" DataContext="{Binding ConnectedMachineViewVM, Source={StaticResource Locator}}" Foreground="{StaticResource MainWindow.Foreground}"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml index ded02ab47..b2fa2b3e3 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml @@ -7,7 +7,7 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" - Width="559" Height="266" Background="White" d:DataContext="{d:DesignInstance Type=vm:ConnectionLostViewVM, IsDesignTimeCreatable=False}"> + Width="559" Height="266" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:ConnectionLostViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -43,7 +43,7 @@ Reason: - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/FirmwareUpgradeView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/FirmwareUpgradeView.xaml index 9af5c6b06..233f8e4cb 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/FirmwareUpgradeView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/FirmwareUpgradeView.xaml @@ -9,7 +9,7 @@ xmlns:vm="clr-namespace:Tango.MachineStudio.UI.ViewModels" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" mc:Ignorable="d" - d:DesignHeight="300" d:DesignWidth="300" Width="800" Height="400" Background="White" d:DataContext="{d:DesignInstance Type=vm:FirmwareUpgradeViewVM, IsDesignTimeCreatable=False}"> + d:DesignHeight="300" d:DesignWidth="300" Width="800" Height="400" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:FirmwareUpgradeViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -39,7 +39,7 @@ FIRMWARE UPGRADE - + @@ -61,7 +61,7 @@ - + @@ -86,7 +86,7 @@ Upgrading Machine Firmware - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml index 6e804c61d..df1c1b831 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml @@ -27,7 +27,7 @@ - + v diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml index d39b1226c..69ce4c855 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml @@ -10,7 +10,7 @@ xmlns:emulations="clr-namespace:Tango.Emulations.ExternalBridge;assembly=Tango.Emulations" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" - d:DesignHeight="300" d:DesignWidth="300" Width="630" Height="400" Background="White" DataContext="{Binding MachineConnectionViewVM, Source={StaticResource Locator}}"> + d:DesignHeight="300" d:DesignWidth="300" Width="630" Height="400" Background="{StaticResource Dialog.Background}" DataContext="{Binding MachineConnectionViewVM, Source={StaticResource Locator}}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -53,7 +53,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml index 14967686f..7d0b2e25c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml @@ -9,7 +9,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" - d:DesignHeight="200" d:DesignWidth="550" Background="White" DataContext="{Binding MachineLoginViewVM, Source={StaticResource Locator}}"> + d:DesignHeight="200" d:DesignWidth="550" Background="{StaticResource MainWindow.Background}" DataContext="{Binding MachineLoginViewVM, Source={StaticResource Locator}}" Foreground="{StaticResource MainWindow.Foreground}"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml index b988d0a76..eea90c7b9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml @@ -8,7 +8,7 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:vm="clr-namespace:Tango.MachineStudio.UI.ViewModels" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" - mc:Ignorable="d" Width="559" Height="266" Background="White" d:DataContext="{d:DesignInstance Type=vm:MachineSerialViewVM, IsDesignTimeCreatable=False}"> + mc:Ignorable="d" Width="559" Height="266" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:MachineSerialViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -54,7 +54,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml index 57b8335c5..5513b65ac 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -9,6 +9,7 @@ xmlns:dragablz="clr-namespace:Dragablz;assembly=Dragablz" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:common="clr-namespace:Tango.MachineStudio.Common;assembly=Tango.MachineStudio.Common" xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" @@ -43,7 +44,7 @@ - + - MODULES - + MODULES + @@ -125,7 +126,7 @@ - + @@ -142,11 +143,11 @@ + Mode="PrimaryMid" DockPanel.Dock="Top" Background="{StaticResource MainWindow.Header}"> - + + + + + + + - + - - + + @@ -470,7 +480,7 @@ @@ -132,7 +132,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ResolvedIssuesView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ResolvedIssuesView.xaml index d1ff75fc7..92317a5d5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ResolvedIssuesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ResolvedIssuesView.xaml @@ -12,7 +12,7 @@ xmlns:tfs="clr-namespace:Tango.TFS;assembly=Tango.TFS" xmlns:tfss="clr-namespace:Tango.MachineStudio.UI.TFS" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" - mc:Ignorable="d" Width="530" Height="580" Background="White" d:DataContext="{d:DesignInstance Type=vm:ResolvedIssuesViewVM, IsDesignTimeCreatable=False}"> + mc:Ignorable="d" Width="530" Height="580" Background="{StaticResource MainWindow.Background}" d:DataContext="{d:DesignInstance Type=vm:ResolvedIssuesViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -39,7 +39,7 @@ - + -- cgit v1.3.1