From 6463e83ca519892c94827d112bf4531272c1b55f Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 6 Mar 2019 17:45:17 +0200 Subject: Implemented Color Calibration on Machine Designer! --- .../Tango.MachineStudio.MachineDesigner.csproj | 13 +++++++++- .../ViewModels/MainViewVM.cs | 11 +++++++++ .../Views/ColorCalibrationView.xaml | 20 ++++++++++++++++ .../Views/ColorCalibrationView.xaml.cs | 28 ++++++++++++++++++++++ .../Views/MachineDetailsView.xaml | 6 +++++ 5 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ColorCalibrationView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ColorCalibrationView.xaml.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj index 6ae893e72..d5ad86e2a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj @@ -81,6 +81,9 @@ + + ColorCalibrationView.xaml + MachineCreationDialog.xaml @@ -109,6 +112,10 @@ SpoolsView.xaml + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -230,6 +237,10 @@ {cb0b0aa2-bb24-4bca-a720-45e397684e12} Tango.MachineStudio.Common + + {4d183aca-552b-4135-ae81-7c5a8e5fc3b1} + Tango.MachineStudio.ColorLab + @@ -276,7 +287,7 @@ - + \ No newline at end of file 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 22bf03148..044217c62 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 @@ -112,6 +112,12 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels set { _selectedSpool = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } } + private ColorLab.ViewModels.MainViewVM _colorLabVM; + public ColorLab.ViewModels.MainViewVM ColorLabVM + { + get { return _colorLabVM; } + set { _colorLabVM = value; RaisePropertyChangedAuto(); } + } #endregion @@ -201,6 +207,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels public override async void OnApplicationReady() { MachinesAdapter.MachineVersions = (await MachinesAdapter.Context.MachineVersions.ToListAsync()).ToObservableCollection(); + ColorLabVM = new ColorLab.ViewModels.MainViewVM(_notification) { IsHosted = true }; } #endregion @@ -419,6 +426,8 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels } } + ColorLabVM.InitHost(ActiveMachineAdapter.Context, ActiveMachine, ActiveMachineAdapter.Rmls, ActiveMachineAdapter.Rmls.FirstOrDefault()); + View.NavigateTo(MachineDesignerNavigationView.MachineDetailsView); } catch (Exception ex) @@ -561,6 +570,8 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels ActiveMachine.ProductionDate = DateTime.UtcNow; await ActiveMachineAdapter.Context.SaveChangesAsync(); + await ColorLabVM.SaveChanges(); + if (SelectedMachine != null) { await SelectedMachine.Reload(MachinesAdapter.Context); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ColorCalibrationView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ColorCalibrationView.xaml new file mode 100644 index 000000000..e73c9661f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ColorCalibrationView.xaml @@ -0,0 +1,20 @@ + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ColorCalibrationView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ColorCalibrationView.xaml.cs new file mode 100644 index 000000000..d617df37f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ColorCalibrationView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.MachineDesigner.Views +{ + /// + /// Interaction logic for ColorCalibrationView.xaml + /// + public partial class ColorCalibrationView : UserControl + { + public ColorCalibrationView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml index 31e7f535b..ce60ebf02 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineDetailsView.xaml @@ -42,6 +42,9 @@ + @@ -52,6 +55,9 @@ + + + -- cgit v1.3.1