diff options
| author | Roy <Roy.mail.net@gmail.com> | 2022-10-03 15:40:25 +0300 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2022-10-03 15:40:25 +0300 |
| commit | da69184480df7e69c353199c4feb765f4cce6d86 (patch) | |
| tree | fa12be01675a6b921f83cdb7eceed1d643ca96a6 /Software/Visual_Studio/MachineStudio | |
| parent | 34cb4b4ffeebb27c579c58a81320fb974f366aed (diff) | |
| parent | acbe283b6f2a2cad3ffab65be9a1892a1290769a (diff) | |
| download | Tango-da69184480df7e69c353199c4feb765f4cce6d86.tar.gz Tango-da69184480df7e69c353199c4feb765f4cce6d86.zip | |
GBD Merge !
Diffstat (limited to 'Software/Visual_Studio/MachineStudio')
9 files changed, 415 insertions, 45 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj index 3853e6763..b7a254a03 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj @@ -393,7 +393,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index f13794c35..cb16c99e7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -1639,7 +1639,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { LogManager.Log("Invalidating liquid factors, process parameters and process group history..."); - _selectedRML = new RmlBuilder(_activeJobDbContext).Set(SelectedRML).WithAllParametersGroup().WithCAT(SelectedMachine.Guid).WithCctCache(_cctCache).WithCCT().WithLiquidFactors().WithSpools().Build(); + _selectedRML = new RmlBuilder(_activeJobDbContext).Set(SelectedRML).WithAllParametersGroup().WithCAT(SelectedMachine.Guid).WithCctCache(_cctCache).WithCCT().WithGbdAndLub().WithLiquidFactors().WithSpools().Build(); _selectedRMLBeforeLiquidFactorsSaves = RmlDTO.FromObservable(_selectedRML); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/ColorCalibrationViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/ColorCalibrationViewVM.cs index feee2637a..edfc77274 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/ColorCalibrationViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/ColorCalibrationViewVM.cs @@ -122,6 +122,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels .WithActiveParametersGroup() .WithCAT(Machine.Guid) .WithCCT() + .WithGbdAndLub() .WithLiquidFactors().Build(); LiquidTypesRmls = SelectedRML.LiquidTypesRmls; @@ -165,7 +166,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels ColorConversionViewVM = new ColorConversionViewVM(_notification) { RML = SelectedRML, - CCT = new CctModel() + CCT = new DataFileModel() { Data = SelectedRML.Cct?.Data, }, diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Models/CctModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Models/DataFileModel.cs index 9079b8fc6..8f8eb58d9 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Models/CctModel.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Models/DataFileModel.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace Tango.MachineStudio.RML.Models { - public class CctModel + public class DataFileModel { public String Guid { get; set; } public String FileName { get; set; } 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 c8b778cc7..4ba97e35b 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 @@ -82,7 +82,7 @@ <Compile Include="Models\BatchConversionCsvModelIn.cs" /> <Compile Include="Models\BatchConversionCsvModelOut.cs" /> <Compile Include="Models\CalibrationMeasurementModel.cs" /> - <Compile Include="Models\CctModel.cs" /> + <Compile Include="Models\DataFileModel.cs" /> <Compile Include="Models\ColorLinearizationModel.cs" /> <Compile Include="Models\RmlModel.cs" /> <Compile Include="RMLModule.cs" /> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs index 92d9056bb..ca3c3e322 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorConversionViewVM.cs @@ -135,8 +135,8 @@ namespace Tango.MachineStudio.RML.ViewModels set { _liquidsCalibrationData = value; RaisePropertyChangedAuto(); } } - private CctModel _cct; - public CctModel CCT + private DataFileModel _cct; + public DataFileModel CCT { get { return _cct; } set @@ -147,6 +147,30 @@ namespace Tango.MachineStudio.RML.ViewModels } } + private DataFileModel _gbd; + public DataFileModel GBD + { + get { return _gbd; } + set + { + _gbd = value; + RaisePropertyChangedAuto(); + InvalidateRelayCommands(); + } + } + + private DataFileModel _lub; + public DataFileModel LUB + { + get { return _lub; } + set + { + _lub = value; + RaisePropertyChangedAuto(); + InvalidateRelayCommands(); + } + } + private RgbVM _sourceColor; /// <summary> /// Gets or sets the color of the source. @@ -204,6 +228,9 @@ namespace Tango.MachineStudio.RML.ViewModels //input.DeltaL = DeltaL; input.ForwardData = ByteString.CopyFrom(CCT.Data); + if (GBD != null) input.GbdData = ByteString.CopyFrom(GBD.Data); + if (LUB != null) input.LubData = ByteString.CopyFrom(LUB.Data); + input.InputCoordinates = new InputCoordinates(); input.InputCoordinates.Red = (int)SourceColor.Red; input.InputCoordinates.Green = (int)SourceColor.Green; @@ -218,6 +245,7 @@ namespace Tango.MachineStudio.RML.ViewModels input.ThreadB = RML.WhitePointB; input.UseLightInks = RML.UseLightInks; + input.UseLubricantTransform = RML.UseLubricantTransform; input.VMax = RML.VMax; //Validate calibration data @@ -346,6 +374,8 @@ namespace Tango.MachineStudio.RML.ViewModels ConversionInput input = new ConversionInput(); input.ColorSpace = PMR.ColorLab.ColorSpace.Volume; input.ForwardData = ByteString.CopyFrom(CCT.Data); + if (GBD != null) input.GbdData = ByteString.CopyFrom(GBD.Data); + if (LUB != null) input.LubData = ByteString.CopyFrom(LUB.Data); input.GenerateHive = false; input.InputCoordinates = new InputCoordinates(); @@ -354,6 +384,7 @@ namespace Tango.MachineStudio.RML.ViewModels input.ThreadB = RML.WhitePointB; input.UseLightInks = RML.UseLightInks; + input.UseLubricantTransform = RML.UseLubricantTransform; input.VMax = RML.VMax; foreach (var vm in LiquidsCalibrationData.Where(x => x.LiquidType.HasPigment)) diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs index deb162687..6da1cf64b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs @@ -152,20 +152,49 @@ namespace Tango.MachineStudio.RML.ViewModels set { _activeProcessParametersTableView = value; RaisePropertyChangedAuto(); } } - private ObservableCollection<CctModel> _ccts; - public ObservableCollection<CctModel> CCTS + private ObservableCollection<DataFileModel> _ccts; + public ObservableCollection<DataFileModel> CCTS { get { return _ccts; } set { _ccts = value; RaisePropertyChangedAuto(); } } - private CctModel _selectedCCT; - public CctModel SelectedCCT + private DataFileModel _selectedCCT; + public DataFileModel SelectedCCT { get { return _selectedCCT; } set { _selectedCCT = value; RaisePropertyChangedAuto(); OnSelectedCCTChanged(); InvalidateRelayCommands(); } } + private ObservableCollection<DataFileModel> _gbds; + public ObservableCollection<DataFileModel> GBDS + { + get { return _gbds; } + set { _gbds = value; RaisePropertyChangedAuto(); } + } + + private DataFileModel _selectedGBD; + public DataFileModel SelectedGBD + { + get { return _selectedGBD; } + set { _selectedGBD = value; RaisePropertyChangedAuto(); OnSelectedGBDChanged(); InvalidateRelayCommands(); } + } + + + private ObservableCollection<DataFileModel> _lubs; + public ObservableCollection<DataFileModel> LUBS + { + get { return _lubs; } + set { _lubs = value; RaisePropertyChangedAuto(); } + } + + private DataFileModel _selectedLUB; + public DataFileModel SelectedLUB + { + get { return _selectedLUB; } + set { _selectedLUB = value; RaisePropertyChangedAuto(); OnSelectedLUBChanged(); InvalidateRelayCommands(); } + } + private ColorConversionViewVM _colorConversionViewVM; public ColorConversionViewVM ColorConversionViewVM { @@ -227,6 +256,14 @@ namespace Tango.MachineStudio.RML.ViewModels public RelayCommand ExportForwardDataCommand { get; set; } + public RelayCommand ImportGBDCommand { get; set; } + + public RelayCommand ExportGBDCommand { get; set; } + + public RelayCommand ImportLUBCommand { get; set; } + + public RelayCommand ExportLUBCommand { get; set; } + public RelayCommand AddProcessParametersTableCommand { get; set; } public RelayCommand<ProcessParametersTable> RemoveProcessParametersTableCommand { get; set; } @@ -283,6 +320,14 @@ namespace Tango.MachineStudio.RML.ViewModels ExportForwardDataCommand = new RelayCommand(ExportCCTData, () => ActiveRML != null && SelectedCCT != null && IsFree); + ImportGBDCommand = new RelayCommand(ImportGBDData, () => ActiveRML != null && IsFree); + + ExportGBDCommand = new RelayCommand(ExportGBDData, () => ActiveRML != null && SelectedGBD != null && IsFree); + + ImportLUBCommand = new RelayCommand(ImportLUBData, () => ActiveRML != null && IsFree); + + ExportLUBCommand = new RelayCommand(ExportLUBData, () => ActiveRML != null && SelectedLUB != null && IsFree); + ExportRMLFileCommand = new RelayCommand(ExportRmlFile, () => SelectedRML != null && IsFree); ImportRMLFileCommand = new RelayCommand(ImportRmlFile, () => IsFree); @@ -363,7 +408,7 @@ namespace Tango.MachineStudio.RML.ViewModels _active_context = ObservablesContext.CreateDefault(); CCTS = _active_context.Ccts - .Select(x => new CctModel() + .Select(x => new DataFileModel() { Guid = x.Guid, FileName = x.FileName, @@ -372,6 +417,22 @@ namespace Tango.MachineStudio.RML.ViewModels CCTS.Where(x => String.IsNullOrWhiteSpace(x.FileName)).ToList().ForEach(x => x.FileName = x.Guid); + GBDS = _active_context.Gbds + .Select(x => new DataFileModel() + { + Guid = x.Guid, + FileName = x.FileName, + + }).ToObservableCollection(); + + LUBS = _active_context.Lubs + .Select(x => new DataFileModel() + { + Guid = x.Guid, + FileName = x.FileName, + + }).ToObservableCollection(); + LoadRmlProperties(); ActiveRML = await new RmlBuilder(_active_context) @@ -379,13 +440,11 @@ namespace Tango.MachineStudio.RML.ViewModels .WithActiveParametersGroup() .WithLiquidFactors() .WithCCT() + .WithGbdAndLub() .WithSpools() .BuildAsync(); - if (ActiveRML.Cct != null) - { - SelectedCCT = CCTS.SingleOrDefault(x => x.Guid == ActiveRML.Cct.Guid); - } + InvalidateRelayCommands(); if (ActiveRML.ProcessParametersTablesGroups.ToList().Count == 0) { @@ -445,10 +504,33 @@ namespace Tango.MachineStudio.RML.ViewModels { RML = ActiveRML, CCT = SelectedCCT, + GBD = SelectedGBD, + LUB = SelectedLUB, LiquidsCalibrationData = CalibrationDataViewVM.LiquidsCalibrationData, LiquidTypesRmls = LiquidTypesRmls, }; + if (ActiveRML.Cct != null) + { + _selectedCCT = CCTS.SingleOrDefault(x => x.Guid == ActiveRML.Cct.Guid); + await OnSelectedCCTChanged(); + RaisePropertyChanged(nameof(SelectedCCT)); + } + + if (ActiveRML.Gbd != null) + { + _selectedGBD = GBDS.SingleOrDefault(x => x.Guid == ActiveRML.Gbd.Guid); + await OnSelectedGBDChanged(); + RaisePropertyChanged(nameof(SelectedGBD)); + } + + if (ActiveRML.Lub != null) + { + _selectedLUB = LUBS.SingleOrDefault(x => x.Guid == ActiveRML.Lub.Guid); + await OnSelectedLUBChanged(); + RaisePropertyChanged(nameof(SelectedLUB)); + } + ColorCalibrationVM = new ColorCalibrationViewVM(_notification) { RML = ActiveRML, @@ -475,9 +557,9 @@ namespace Tango.MachineStudio.RML.ViewModels } } - private async void OnSelectedCCTChanged() + private async Task OnSelectedCCTChanged() { - if (SelectedCCT != null && !SelectedCCT.IsNew) + if (ColorConversionViewVM != null && SelectedCCT != null && !SelectedCCT.IsNew) { using (_notification.PushTaskItem("Loading CCT data...")) { @@ -496,6 +578,48 @@ namespace Tango.MachineStudio.RML.ViewModels } } + private async Task OnSelectedGBDChanged() + { + if (ColorConversionViewVM != null && SelectedGBD != null && !SelectedGBD.IsNew) + { + using (_notification.PushTaskItem("Loading GBD data...")) + { + IsFree = false; + + var gbd = await _active_context.Gbds.SingleOrDefaultAsync(x => x.Guid == SelectedGBD.Guid); + + if (gbd != null) + { + SelectedGBD.Data = gbd.Data; + ColorConversionViewVM.GBD = SelectedGBD; + } + + IsFree = true; + } + } + } + + private async Task OnSelectedLUBChanged() + { + if (ColorConversionViewVM != null && SelectedLUB != null && !SelectedLUB.IsNew) + { + using (_notification.PushTaskItem("Loading LUB data...")) + { + IsFree = false; + + var lub = await _active_context.Lubs.SingleOrDefaultAsync(x => x.Guid == SelectedLUB.Guid); + + if (lub != null) + { + SelectedLUB.Data = lub.Data; + ColorConversionViewVM.LUB = SelectedLUB; + } + + IsFree = true; + } + } + } + private void LoadRmlProperties() { Materials = _active_context.MediaMaterials.ToObservableCollection(); @@ -895,6 +1019,40 @@ namespace Tango.MachineStudio.RML.ViewModels } } + if (SelectedGBD != null) + { + if (SelectedGBD.IsNew) + { + Gbd gbd = new Gbd(); + gbd.Guid = SelectedGBD.Guid; + gbd.FileName = SelectedGBD.FileName; + gbd.Data = SelectedGBD.Data; + ActiveRML.Gbd = gbd; + SelectedGBD.IsNew = false; + } + else + { + ActiveRML.GbdGuid = SelectedGBD.Guid; + } + } + + if (SelectedLUB != null) + { + if (SelectedLUB.IsNew) + { + Lub lub = new Lub(); + lub.Guid = SelectedLUB.Guid; + lub.FileName = SelectedLUB.FileName; + lub.Data = SelectedLUB.Data; + ActiveRML.Lub = lub; + SelectedLUB.IsNew = false; + } + else + { + ActiveRML.LubGuid = SelectedLUB.Guid; + } + } + var rmlAfter = RmlDTO.FromObservable(ActiveRML); await _active_context.SaveChangesAsync(); @@ -1016,7 +1174,7 @@ namespace Tango.MachineStudio.RML.ViewModels input.InputCoordinates.B = lab.B; input.ColorSpace = PMR.ColorLab.ColorSpace.Lab; var output = converter.Convert(input, ActiveRML.ColorConversionVersion); - + BatchConversionCsvModelOut result = new BatchConversionCsvModelOut(); result.Index = lab.Index; @@ -1100,7 +1258,7 @@ namespace Tango.MachineStudio.RML.ViewModels item.Volume = result.LightCyan; break; case PMR.ColorLab.LiquidType.LightMagenta: - item.Volume= result.LightMagenta; + item.Volume = result.LightMagenta; break; case PMR.ColorLab.LiquidType.LightYellow: item.Volume = result.LightYellow; @@ -1156,7 +1314,7 @@ namespace Tango.MachineStudio.RML.ViewModels private void ImportCCTData() { - String file = GetCCTFileOpen(); + String file = GetDataFileOpen("Select color adjustment file", "Color Conversion Table|*.cct"); if (file != null) { if (CCTS.ToList().Exists(x => x.FileName == Path.GetFileName(file))) @@ -1165,7 +1323,7 @@ namespace Tango.MachineStudio.RML.ViewModels return; } - CctModel cctModel = new CctModel(); + DataFileModel cctModel = new DataFileModel(); cctModel.Guid = Guid.NewGuid().ToString(); cctModel.IsNew = true; @@ -1183,7 +1341,7 @@ namespace Tango.MachineStudio.RML.ViewModels { if (SelectedCCT != null) { - String file = GetCCTFileSave(ActiveRML.Cct.FileName); + String file = GetDataFileSave("Select color adjustment file", "Color Conversion Table|*.cct", ActiveRML.Cct.FileName); if (file != null) { using (_notification.PushTaskItem("Exporting CCT file...")) @@ -1220,11 +1378,143 @@ namespace Tango.MachineStudio.RML.ViewModels } } - private String GetCCTFileOpen() + private void ExportLUBData() + { + if (SelectedLUB != null) + { + String file = GetDataFileSave("Select lubrication transformation file", "Lubrication Transformation File|*.lub", ActiveRML.Lub.FileName); + if (file != null) + { + using (_notification.PushTaskItem("Exporting LUB file...")) + { + try + { + IsFree = false; + + if (SelectedLUB.IsNew) + { + File.WriteAllBytes(file, SelectedLUB.Data); + } + else + { + var lub = _active_context.Lubs.SingleOrDefault(x => x.Guid == SelectedLUB.Guid); + + if (lub != null) + { + File.WriteAllBytes(file, lub.Data); + } + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error exporting LUB file."); + _notification.ShowError($"An error occurred while trying to export the LUB file.\n{ex.Message}"); + } + finally + { + IsFree = true; + } + } + } + } + } + + private void ImportLUBData() + { + String file = GetDataFileOpen("Select lubrication transformation file", "Lubrication Transformation File|*.lub"); + if (file != null) + { + if (LUBS.ToList().Exists(x => x.FileName == Path.GetFileName(file))) + { + _notification.ShowError("The selected LUB file already exists on the database. Please select the LUB file from the dropdown box."); + return; + } + + DataFileModel lubModel = new DataFileModel(); + lubModel.Guid = Guid.NewGuid().ToString(); + lubModel.IsNew = true; + + lubModel.FileName = Path.GetFileName(file); + lubModel.Data = File.ReadAllBytes(file); + + LUBS.Insert(0, lubModel); + SelectedLUB = lubModel; + + ColorConversionViewVM.LUB = SelectedLUB; + } + } + + private void ExportGBDData() + { + if (SelectedGBD != null) + { + String file = GetDataFileSave("Select gamut boundary descriptor file", "Gamut Boundary Descriptor File|*.gbd", ActiveRML.Gbd.FileName); + if (file != null) + { + using (_notification.PushTaskItem("Exporting GBD file...")) + { + try + { + IsFree = false; + + if (SelectedGBD.IsNew) + { + File.WriteAllBytes(file, SelectedGBD.Data); + } + else + { + var gbd = _active_context.Gbds.SingleOrDefault(x => x.Guid == SelectedGBD.Guid); + + if (gbd != null) + { + File.WriteAllBytes(file, gbd.Data); + } + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error exporting GBD file."); + _notification.ShowError($"An error occurred while trying to export the GBD file.\n{ex.Message}"); + } + finally + { + IsFree = true; + } + } + } + } + } + + private void ImportGBDData() + { + String file = GetDataFileOpen("Select gamut boundary description file", "Gamut Boundary Description File|*.gbd"); + if (file != null) + { + if (GBDS.ToList().Exists(x => x.FileName == Path.GetFileName(file))) + { + _notification.ShowError("The selected GBD file already exists on the database. Please select the GBD file from the dropdown box."); + return; + } + + DataFileModel gbdModel = new DataFileModel(); + gbdModel.Guid = Guid.NewGuid().ToString(); + gbdModel.IsNew = true; + + gbdModel.FileName = Path.GetFileName(file); + gbdModel.Data = File.ReadAllBytes(file); + + GBDS.Insert(0, gbdModel); + SelectedGBD = gbdModel; + + ColorConversionViewVM.GBD = SelectedGBD; + } + } + + private String GetDataFileOpen(String title, String filter) { OpenFileDialog dlg = new OpenFileDialog(); - dlg.Title = "Select color adjustment file"; - dlg.Filter = "Color Conversion Table|*.cct"; + dlg.Title = title; + dlg.Filter = filter; if (dlg.ShowDialogCenter()) { return dlg.FileName; @@ -1233,11 +1523,11 @@ namespace Tango.MachineStudio.RML.ViewModels return null; } - private String GetCCTFileSave(String fileName) + private String GetDataFileSave(String title, String filter, String fileName) { SaveFileDialog dlg = new SaveFileDialog(); - dlg.Title = "Select color adjustment file"; - dlg.Filter = "Color Conversion Table|*.cct"; + dlg.Title = title; + dlg.Filter = filter; dlg.FileName = fileName; dlg.DefaultExt = ".cct"; if (dlg.ShowDialogCenter()) 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 a9b943525..08af47ef4 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 @@ -206,27 +206,68 @@ <Image Source="../Images/data-table.png" Height="80" Opacity="0.8" ></Image> <StackPanel VerticalAlignment="Center" Width="200" Margin="5 20 5 10"> - <ComboBox materialDesign:HintAssist.Hint="No CCT Defined" Margin="0 5 0 0" HorizontalContentAlignment="Center" ItemsSource="{Binding CCTS}" SelectedItem="{Binding SelectedCCT}" DisplayMemberPath="FileName" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox> - <UniformGrid Columns="2" Margin="0 5 0 0" HorizontalAlignment="Center"> - <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ImportForwardDataCommand}"> - <StackPanel Orientation="Horizontal" Margin="0 0 20 0"> - <materialDesign:PackIcon Kind="Upload" VerticalAlignment="Center" /> - <TextBlock Margin="5 0 0 0">IMPORT</TextBlock> - </StackPanel> - </Button> - <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ExportForwardDataCommand}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Kind="Download" VerticalAlignment="Center" /> - <TextBlock Margin="5 0 0 0">EXPORT</TextBlock> - </StackPanel> - </Button> - </UniformGrid> + <StackPanel> + <StackPanel> + <ComboBox materialDesign:HintAssist.Hint="No CCT Defined" Margin="0 5 0 0" HorizontalContentAlignment="Center" ItemsSource="{Binding CCTS}" SelectedItem="{Binding SelectedCCT}" DisplayMemberPath="FileName" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox> + <UniformGrid Columns="2" Margin="0 5 0 0" HorizontalAlignment="Center"> + <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ImportForwardDataCommand}"> + <StackPanel Orientation="Horizontal" Margin="0 0 20 0"> + <materialDesign:PackIcon Kind="Upload" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0">IMPORT</TextBlock> + </StackPanel> + </Button> + <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ExportForwardDataCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Download" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0">EXPORT</TextBlock> + </StackPanel> + </Button> + </UniformGrid> + </StackPanel> + + <StackPanel> + <ComboBox materialDesign:HintAssist.Hint="No GBD Defined" Margin="0 5 0 0" HorizontalContentAlignment="Center" ItemsSource="{Binding GBDS}" SelectedItem="{Binding SelectedGBD}" DisplayMemberPath="FileName" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox> + <UniformGrid Columns="2" Margin="0 5 0 0" HorizontalAlignment="Center"> + <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ImportGBDCommand}"> + <StackPanel Orientation="Horizontal" Margin="0 0 20 0"> + <materialDesign:PackIcon Kind="Upload" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0">IMPORT</TextBlock> + </StackPanel> + </Button> + <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ExportGBDCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Download" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0">EXPORT</TextBlock> + </StackPanel> + </Button> + </UniformGrid> + </StackPanel> + + <StackPanel> + <ComboBox materialDesign:HintAssist.Hint="No LUB Defined" Margin="0 5 0 0" HorizontalContentAlignment="Center" ItemsSource="{Binding LUBS}" SelectedItem="{Binding SelectedLUB}" DisplayMemberPath="FileName" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox> + <UniformGrid Columns="2" Margin="0 5 0 0" HorizontalAlignment="Center"> + <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ImportLUBCommand}"> + <StackPanel Orientation="Horizontal" Margin="0 0 20 0"> + <materialDesign:PackIcon Kind="Upload" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0">IMPORT</TextBlock> + </StackPanel> + </Button> + <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Command="{Binding ExportLUBCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="Download" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0">EXPORT</TextBlock> + </StackPanel> + </Button> + </UniformGrid> + </StackPanel> + </StackPanel> <TextBlock Margin="0 40 0 0" Text="Color Conversion Version:" HorizontalAlignment="Center"></TextBlock> - <mahapps:NumericUpDown Minimum="1" Maximum="5" Value="{Binding ActiveRML.ColorConversionVersion}" HorizontalContentAlignment="Center" Background="Transparent" BorderBrush="{StaticResource DimGrayBrush}" HasDecimals="False" Margin="0 5 0 0" /> + <mahapps:NumericUpDown Minimum="1" Maximum="6" Value="{Binding ActiveRML.ColorConversionVersion}" HorizontalContentAlignment="Center" Background="Transparent" BorderBrush="{StaticResource DimGrayBrush}" HasDecimals="False" Margin="0 5 0 0" /> <CheckBox ToolTip="Use the color conversion engine to generate gradients" IsChecked="{Binding ActiveRML.UseColorLibGradients}" HorizontalAlignment="Left" Margin="0 20 0 0">Enable Gradient Generation</CheckBox> <CheckBox ToolTip="Use light inks when converting colors to liquid volumes" IsChecked="{Binding ActiveRML.UseLightInks}" HorizontalAlignment="Left" Margin="0 10 0 0">Use Light Inks</CheckBox> + <CheckBox ToolTip="Use lubricant transformation when converting to liquid volumes" IsChecked="{Binding ActiveRML.UseLubricantTransform}" HorizontalAlignment="Left" Margin="0 10 0 0">Use Lubricant Transform</CheckBox> <DockPanel Margin="0 10 0 0"> <TextBlock VerticalAlignment="Center" Text="V-Max:" ></TextBlock> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj index ac52d55c5..eca12dfef 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj @@ -544,6 +544,13 @@ <Name>Tango.MachineStudio.Common</Name> </ProjectReference> <!--ColorLib--> + <ProjectReference Include="..\..\ColorLib\Tango.ColorLib_v6\Tango.ColorLib_v6.vcxproj"> + <Project>{D74E49AA-4C6B-4427-BEFF-D7CE2690D059}</Project> + <Name>Tango.ColorLib_v6</Name> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + <OutputItemType>Content</OutputItemType> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </ProjectReference> <ProjectReference Include="..\..\ColorLib\Tango.ColorLib_v5\Tango.ColorLib_v5.vcxproj"> <Project>{0F87D32E-B65F-4AE8-862C-29F4CCC38240}</Project> <Name>Tango.ColorLib_v5</Name> |
