diff options
| author | Avi Levkovich <avi@twine-s.com> | 2018-07-12 09:46:44 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2018-07-12 09:46:44 +0300 |
| commit | dec3cd03aec51dca67150e2f6ba76c7eda7f11a4 (patch) | |
| tree | 97f8ee8efd166ab9578f1a4baf1b73c45961abb1 /Software/Visual_Studio/MachineStudio | |
| parent | 86b7dbca112046dea1d3dd7d2904440afc2acb7d (diff) | |
| parent | 1fe6f6b50598fff4d52273138936031f3dee7866 (diff) | |
| download | Tango-dec3cd03aec51dca67150e2f6ba76c7eda7f11a4.tar.gz Tango-dec3cd03aec51dca67150e2f6ba76c7eda7f11a4.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio')
3 files changed, 88 insertions, 28 deletions
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 48d16104a..0e9109b28 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 @@ -13,6 +13,7 @@ using System.Windows.Media; using Tango.BL; using Tango.BL.ColorConversion; using Tango.BL.Entities; +using Tango.BL.Enumerations; using Tango.Core.Commands; using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Controls; @@ -32,6 +33,33 @@ namespace Tango.MachineStudio.ColorLab.ViewModels #region Properties + private bool _isVolumesOutOfRange; + /// <summary> + /// Gets or sets a value indicating whether the liquid volumes are out of range. + /// </summary> + public bool IsVolumesOutOfRange + { + get { return _isVolumesOutOfRange; } + set + { + if (_isVolumesOutOfRange != value) + { + _isVolumesOutOfRange = value; + RaisePropertyChangedAuto(); + } + } + } + + private bool _isOutOfGamut; + /// <summary> + /// Gets or sets a value indicating whether the source color is out of gamut. + /// </summary> + public bool IsOutOfGamut + { + get { return _isOutOfGamut; } + set { _isOutOfGamut = value; RaisePropertyChangedAuto(); } + } + private ObservableCollection<Machine> _machines; /// <summary> /// Gets or sets the machines. @@ -280,6 +308,8 @@ namespace Tango.MachineStudio.ColorLab.ViewModels var output = TangoColorConverter.GetSuggestions(input); + IsOutOfGamut = output.OutOfGamut; + HiveSuggestions = TangoColorConverter.CreateHiveSuggestions(output); }); } @@ -396,6 +426,17 @@ namespace Tango.MachineStudio.ColorLab.ViewModels try { if (LiquidsCalibrationData == null) return; + + //TODO: This is temporary because of out of range volumes. + if (LiquidVolumes.Where(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.StandardColor.ToInt32()).Sum(x => x.Volume) > 200) + { + IsVolumesOutOfRange = true; + return; + } + else + { + IsVolumesOutOfRange = false; + } ConversionInput input = new ConversionInput(); input.ColorSpace = PMR.ColorLab.ColorSpace.Volume; 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 8b62604d6..d8ef015be 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 @@ -26,6 +26,7 @@ <converters:ColorToComponentsConverter x:Key="ColorToComponentsConverter" /> <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter" /> <converters:ObjectToObjectTypeConverter x:Key="ObjectToObjectTypeConverter" /> + <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> </UserControl.Resources> <Grid> @@ -163,6 +164,12 @@ </Grid.RowDefinitions> <StackPanel VerticalAlignment="Center" Grid.Row="1"> + <StackPanel Height="20"> + <StackPanel Orientation="Horizontal" Margin="0 0 0 5" Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}"> + <materialDesign:PackIcon Kind="Alert" Foreground="#FF6D6D" /> + <TextBlock Margin="5 0 0 0" Foreground="#FF6D6D">Color is out of gamut</TextBlock> + </StackPanel> + </StackPanel> <Border BorderThickness="1" BorderBrush="#545454" Margin="0" Padding="2 2 2 0"> <brushPicker:BrushPicker x:Name="picker" Color="{Binding SourceColor.Color,Mode=TwoWay}" Background="Transparent" BorderThickness="0" Height="150" BrushTypeVisibility="Collapsed"></brushPicker:BrushPicker> </Border> @@ -254,30 +261,39 @@ </Grid> - <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center" MinWidth="420" Grid.Column="4" Grid.Row="3"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <StackPanel> - <TextBlock HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Name}" FontSize="10" Margin="0 0 0 5"></TextBlock> - <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0"> - <ContentControl.Foreground> - <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> - </ContentControl.Foreground> - <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.00" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> - <!--<mahapps:NumericUpDown.Resources> + <StackPanel Grid.Column="4" Grid.Row="3"> + <StackPanel Height="25" Margin="25 0 0 0"> + <StackPanel Orientation="Horizontal" Margin="0 0 0 0" Visibility="{Binding IsVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}"> + <materialDesign:PackIcon Kind="Alert" Foreground="#FF6D6D" /> + <TextBlock Margin="5 0 0 0" Foreground="#FF6D6D">Liquid volumes exceeds the maximum range</TextBlock> + </StackPanel> + </StackPanel> + + <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center" MinWidth="420"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Name}" FontSize="10" Margin="0 0 0 5"></TextBlock> + <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl.Foreground> + <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </ContentControl.Foreground> + <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.00" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <!--<mahapps:NumericUpDown.Resources> <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> </mahapps:NumericUpDown.Resources>--> - </mahapps:NumericUpDown> - </ContentControl> - </StackPanel> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> + </mahapps:NumericUpDown> + </ContentControl> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> <Image Source="../Images/arrow-long-Left.png" Grid.Column="2" Grid.Row="3" Width="140" Opacity="0.8"></Image> @@ -286,11 +302,14 @@ <Grid> <DockPanel Width="80" HorizontalAlignment="Left"> <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">COMPOSITE</TextBlock> - <Ellipse Height="70" Margin="0 5 0 0" Stroke="#202020"> - <Ellipse.Fill> - <SolidColorBrush Color="{Binding TargetColor.Color}"></SolidColorBrush> - </Ellipse.Fill> - </Ellipse> + <Grid> + <Ellipse Height="70" Margin="0 5 0 0" Stroke="#202020"> + <Ellipse.Fill> + <SolidColorBrush Color="{Binding TargetColor.Color}"></SolidColorBrush> + </Ellipse.Fill> + </Ellipse> + <materialDesign:PackIcon Visibility="{Binding IsVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}" Kind="Alert" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" Width="24" Height="24" /> + </Grid> </DockPanel> <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Height="60"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt index 00990166f..60d433d99 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt @@ -1 +1 @@ -Tue 07/10/2018 16:54:33.30 +Wed 07/11/2018 16:02:40.40 |
