aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorCalibrationViewVM.cs4
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs26
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs6
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml6
4 files changed, 29 insertions, 13 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorCalibrationViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorCalibrationViewVM.cs
index 2144d05f5..01c3b2d4f 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorCalibrationViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorCalibrationViewVM.cs
@@ -223,7 +223,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
/// <summary>
/// Applies calibration points to RML.
/// </summary>
- private void ApplyToRML(object obj)
+ private async void ApplyToRML(object obj)
{
if(SelectedTab != null && ActiveRML != null)
{
@@ -232,7 +232,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
{
IsFree = false;
DateTime lastUpdated = DateTime.UtcNow;
- var rml = new RmlBuilder(_active_context).Set(ActiveRML.Guid).WithLiquidFactors().Build();
+ var rml = await new RmlBuilder(_active_context).Set(ActiveRML.Guid).WithLiquidFactors().BuildAsync();
if (rml != null)
{
var liquidTypesRmls = rml.LiquidTypesRmls;
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs
index 2ab1f81f1..d784c69a9 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs
@@ -209,7 +209,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
OnRMLExtensionGUIDChanged();
}
}
-
+
protected string _selectedMachineGuid;
/// <summary>
/// Gets or sets the selected machine.
@@ -431,8 +431,8 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
_active_context = ObservablesContext.CreateDefault();
- await Task.Factory.StartNew(() =>
- {
+ await Task.Run(async () =>
+ {
using (_notification.PushTaskItem("Loading Color Process Parameters ..."))
{
@@ -441,6 +441,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
{
SelectedColorProcessParameter = new ColorProcessParametersBuilder(_active_context).Set(currentcolorProcessParameter.Guid).WithColorProcessData().WithColorProcessFactor().WithColorProcessInkUptake().Build();
}
+
if (SelectedColorProcessParameter == null)
{
@@ -448,6 +449,8 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
SelectedColorProcessParameter.WhitePointL = 0.0;
SelectedColorProcessParameter.WhitePointA = 0.0;
SelectedColorProcessParameter.WhitePointB = 0.0;
+
+
SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.CYAN, FactorPercent = 100, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid });
SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.MAGENTA, FactorPercent = 100, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid });
SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.YELLOW, FactorPercent = 100, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid });
@@ -461,7 +464,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MININKUPTAKEZONE2, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid });
SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MAXINKUPTAKEZONE2, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid });
_active_context.ColorProcessParameters.Add(SelectedColorProcessParameter);
- _active_context.SaveChangesAsync();
+ await _active_context.SaveChangesAsync();
}
else if(SelectedColorProcessParameter.ColorProcessInkUptake.Count == 0)
{
@@ -470,7 +473,13 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MININKUPTAKEZONE2, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid });
SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MAXINKUPTAKEZONE2, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid });
}
-
+ var rml = await new RmlBuilder(_active_context).Set(RMLGUID).BuildAsync();
+ if (rml != null && SelectedColorProcessParameter != null)
+ {
+ SelectedColorProcessParameter.WhitePointL = rml.WhitePointL;
+ SelectedColorProcessParameter.WhitePointA = rml.WhitePointA;
+ SelectedColorProcessParameter.WhitePointB = rml.WhitePointB;
+ }
}
});
@@ -775,6 +784,13 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
IsFree = false;
SelectedColorProcessParameter.LastUpdated = DateTime.UtcNow;
+ var rml = await new RmlBuilder(_active_context).Set(RMLGUID).BuildAsync();
+ if (rml != null)
+ {
+ rml.WhitePointL = SelectedColorProcessParameter.WhitePointL;
+ rml.WhitePointA = SelectedColorProcessParameter.WhitePointA;
+ rml.WhitePointB = SelectedColorProcessParameter.WhitePointB;
+ }
foreach (var item in RemovedColorProcessDataBeforeSave)
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs
index b2f3d99cf..458bc913a 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs
@@ -1069,11 +1069,11 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels
- ActiveRML = new RmlBuilder(_active_context).Set(SelectedRMLExtension.RMLGuid).WithLiquidFactors().Build();
+ ActiveRML = await new RmlBuilder(_active_context).Set(SelectedRMLExtension.RMLGuid).WithLiquidFactors().BuildAsync();
- ActiveRMLExtension = new RmlExtensionsBuilder(_active_context)
+ ActiveRMLExtension = await new RmlExtensionsBuilder(_active_context)
.Set(guid)
- .Build();
+ .BuildAsync();
if (!String.IsNullOrEmpty(ActiveRML.Manufacturer) && false == Manufacturers.Any(x => x == ActiveRML.Manufacturer))
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml
index 504bf0610..376392d89 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml
@@ -335,13 +335,13 @@
<TextBlock FontSize="12" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10 0 0 0" Foreground="{StaticResource GrayBrush200}">White point</TextBlock>
</Border>
<Border BorderThickness="1 1 0 0" Background="Transparent" BorderBrush="{StaticResource BorderBrushGainsboro}">
- <mahapps:NumericUpDown Minimum="-500" Maximum="500" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Path=DataContext.ActiveRML.WhitePointL, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" FontSize="14" Margin="10 0 0 0"></mahapps:NumericUpDown>
+ <mahapps:NumericUpDown Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Path= WhitePointL, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="14" Margin="10 0 0 0"></mahapps:NumericUpDown>
</Border>
<Border BorderThickness="1 1 0 0" Background="Transparent" BorderBrush="{StaticResource BorderBrushGainsboro}">
- <mahapps:NumericUpDown Minimum="-500" Maximum="500" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Path=DataContext.ActiveRML.WhitePointA,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" FontSize="14" Margin="10 0 0 0"></mahapps:NumericUpDown>
+ <mahapps:NumericUpDown Minimum="-128" Maximum="127" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Path= WhitePointA,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="14" Margin="10 0 0 0"></mahapps:NumericUpDown>
</Border>
<Border BorderThickness="1 1 0 0" Background="Transparent" BorderBrush="{StaticResource BorderBrushGainsboro}">
- <mahapps:NumericUpDown Minimum="-500" Maximum="500" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Path=DataContext.ActiveRML.WhitePointB,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" FontSize="14" Margin="10 0 0 0"></mahapps:NumericUpDown>
+ <mahapps:NumericUpDown Minimum="-128" Maximum="127" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Path=WhitePointB,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="14" Margin="10 0 0 0"></mahapps:NumericUpDown>
</Border>
</UniformGrid>
</Border>