diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-04-02 22:00:15 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-04-02 22:00:15 +0300 |
| commit | 37f64f8193684ebe99b29bf0ccef2863b69722d1 (patch) | |
| tree | 3631177a59902f78d3863b68dcd811687f13b772 /Software/Visual_Studio/PPC/Tango.PPC.UI | |
| parent | 3dcf3242705a7522617d4b5f7ca4d9b918e48ca5 (diff) | |
| download | Tango-37f64f8193684ebe99b29bf0ccef2863b69722d1.tar.gz Tango-37f64f8193684ebe99b29bf0ccef2863b69722d1.zip | |
Eureka PPC. Input brush stop content control. Weight in gram.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
3 files changed, 188 insertions, 32 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs index d7e70b881..910a5238b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/LengthToWeightConverter.cs @@ -17,11 +17,11 @@ namespace Tango.PPC.UI.Converters { double length = System.Convert.ToDouble(values[0]); double coef = System.Convert.ToDouble(values[1]); - double spools = System.Convert.ToDouble(values[3]); - var weight = ((double)length * spools * coef) / (1000 * 1000);//(kg) + int spools = System.Convert.ToInt32(values[2]); + var weight = ((double)length * spools * coef) / (1000 );//(g) return weight; } - catch + catch (Exception ex) { return 0d; } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs index 77b883150..866a6ddfe 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -26,7 +26,10 @@ namespace Tango.PPC.UI.ViewModels public Job Job { get { return _job; } - set { _job = value; RaisePropertyChangedAuto(); } + set { _job = value; + if(_job == null) + IsDyeingProcess = false; + RaisePropertyChangedAuto(); } } private RunningJobStatus _runningJobStatus; @@ -36,7 +39,15 @@ namespace Tango.PPC.UI.ViewModels public RunningJobStatus RunningJobStatus { get { return _runningJobStatus; } - set { _runningJobStatus = value; RaisePropertyChangedAuto(); } + set { + _runningJobStatus = value; + IsDyeingProcess = (_runningJobStatus != null && _runningJobStatus.CurrentSegment != null); + if(_runningJobStatus != null && _runningJobStatus.CurrentSegment != null) + { + CurrentBrushStop = _runningJobStatus.CurrentSegment.FirstBrushStop; + } + RaisePropertyChangedAuto(); + } } private bool _isJobStatusViewEnable; @@ -67,7 +78,35 @@ namespace Tango.PPC.UI.ViewModels set { _isSpoolView = value; RaisePropertyChangedAuto(); } } - + private bool _isDyeingProcess; + + public bool IsDyeingProcess + { + get { return _isDyeingProcess; } + set { + if(_isDyeingProcess != value) + { + _isDyeingProcess = value; + RaisePropertyChangedAuto(); + } + } + } + + private BrushStop _currentBrushStop; + + public BrushStop CurrentBrushStop + { + get { return _currentBrushStop; } + set { + if(_currentBrushStop != value) + { + _currentBrushStop = value; + RaisePropertyChangedAuto(); + } + } + } + + #endregion #region Commands diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index bbb6127e5..559d81dbe 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -5,6 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels" + xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:locaControls="clr-namespace:Tango.PPC.UI.Controls" xmlns:locaConverters="clr-namespace:Tango.PPC.UI.Converters" xmlns:global="clr-namespace:Tango.PPC.UI" @@ -24,7 +25,95 @@ <Setter Property="Height" Value="46"/> <Setter Property="RenderOptions.EdgeMode" Value="Unspecified"/> </Style> - + + <Style x:Key="SliderGreyTextStyle" TargetType="TextBlock"> + <Setter Property="FontSize" Value="{StaticResource TangoDefaultFontSize}"></Setter> + <Setter Property="VerticalAlignment" Value="Center"></Setter> + <Setter Property="HorizontalAlignment" Value="Center"></Setter> + </Style> + + <DataTemplate x:Key="CMYK_Template" DataType="{x:Type entities:BrushStop}"> + <UniformGrid Rows="1" Columns="4" Height="Auto" MinWidth="180"> + <StackPanel Orientation="Vertical"> + <Border Width="50" Height="50" Background="Cyan" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0" Text="C" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Center"/> + <TextBlock Margin="0 10 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Cyan, StringFormat=0.##}" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Margin="0 0 0 0"> + <Border Width="50" Height="50" Background="Magenta" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0" Text="M" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Center"/> + <TextBlock Margin="0 10 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Magenta, StringFormat=0.##}" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Margin="10 0 0 0"> + <Border Width="50" Height="50" Background="Yellow" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0" Text="Y" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Center"/> + <TextBlock Margin="0 10 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Yellow, StringFormat=0.##}" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Margin="10 0 0 0"> + <Border Width="50" Height="50" Background="Black" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0" Text="K" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Center"/> + <TextBlock Margin="0 10 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Black, StringFormat=0.##}"></TextBlock> + </StackPanel> + </UniformGrid> + </DataTemplate> + + <DataTemplate x:Key="RGB_Template" DataType="{x:Type entities:BrushStop}"> + <UniformGrid Rows="1" Columns="3" Height="Auto" > + <StackPanel Orientation="Vertical"> + <Border Width="50" Height="50" Background="Red" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0" Text="R" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center" HorizontalAlignment="Center"/> + <TextBlock Margin="0 10 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Red}" ></TextBlock> + + </StackPanel> + <StackPanel Orientation="Vertical" Margin="4 0 0 0"> + <Border Width="50" Height="50" Background="Green" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0" Text="G" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center" HorizontalAlignment="Center"/> + <TextBlock Margin="0 10 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Green}" ></TextBlock> + + </StackPanel> + <StackPanel Orientation="Vertical" Margin="4 0 0 0"> + <Border Width="50" Height="50" Background="Blue" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0" Text="B" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center" HorizontalAlignment="Center"/> + <TextBlock Margin="0 10 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding Blue}" ></TextBlock> + </StackPanel> + </UniformGrid> + </DataTemplate> + + <DataTemplate x:Key="LAB_Template" DataType="{x:Type entities:BrushStop}"> + <UniformGrid Rows="1" Columns="3" Height="Auto" MinWidth="180" HorizontalAlignment="Left"> + <StackPanel Orientation="Vertical"> + <Border Width="50" Height="50" Background="Gray" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0 " Text="L" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Center"/> + <TextBlock Margin="0 10 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding L, StringFormat=0.##}" ></TextBlock> + + </StackPanel> + <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left" Margin="5 0 0 0"> + <Border Width="50" Height="50" Background="red" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0 " Text="a" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Center"/> + <TextBlock Margin="0 10 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding A, StringFormat=0.##}" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Margin="10 0 0 0" Width="50"> + <Border Width="50" Height="50" Background="Blue" CornerRadius="16" HorizontalAlignment="Left"></Border> + <TextBlock Margin="0 10 0 0 " Text="b" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Center"/> + <TextBlock Margin="0 10 0 0" HorizontalAlignment="Center" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding B, StringFormat=0.##}" ></TextBlock> + </StackPanel> + </UniformGrid> + </DataTemplate> + + <DataTemplate x:Key="CATALOG_Template" DataType="{x:Type entities:BrushStop}"> + <UniformGrid Rows="1" Columns="2" Height="Auto" MinWidth="180"> + <StackPanel Orientation="Vertical" Margin="0 0 0 0"> + <TextBlock Text="Catalog:" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center"/> + <TextBlock Margin="0 10 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding ColorCatalog.Name}" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Left"></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Margin="10 0 0 0"> + <TextBlock Text="Color:" FontSize="{StaticResource TangoDefaultFontSize}" VerticalAlignment="Center"/> + <TextBlock Margin="0 10 0 0" Style="{StaticResource SliderGreyTextStyle}" Text="{Binding ColorCatalogsItem.Name}" FontSize="{StaticResource TangoDefaultFontSize}" HorizontalAlignment="Left" ></TextBlock> + </StackPanel> + </UniformGrid> + </DataTemplate> + + </UserControl.Resources> <Grid Width="960" Height="1280"> <Grid.ColumnDefinitions> @@ -173,10 +262,10 @@ <TextBlock FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"> <TextBlock.Style> <Style TargetType="{x:Type TextBlock}"> - <Setter Property="Text" Value="{Binding Job.WeightIncludingNumberOfUnitsAndSpools, TargetNullValue='-', FallbackValue='-', StringFormat=0.#####}" /> + <Setter Property="Text" Value="{Binding Job.WeightIncludingNumberOfUnitsAndSpools, TargetNullValue='-', FallbackValue='-', StringFormat=0.##}" /> <Style.Triggers> <DataTrigger Binding="{Binding IsSpoolView}" Value="True"> - <Setter Property="Text" Value="{Binding Job.WeightIncludingNumberOfUnits, TargetNullValue='-', FallbackValue='-', StringFormat=0.#####}" /> + <Setter Property="Text" Value="{Binding Job.WeightIncludingNumberOfUnits, TargetNullValue='-', FallbackValue='-', StringFormat=0.##}" /> </DataTrigger> </Style.Triggers> </Style> @@ -380,7 +469,7 @@ <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoDefaultFontSize}">Job Weight</TextBlock> <TextBlock FontWeight="DemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}"> <TextBlock.Text> - <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="0.#####" TargetNullValue='-' FallbackValue='-' Mode="OneWay"> + <MultiBinding Converter="{StaticResource LengthToWeightConverter}" StringFormat="0.##" TargetNullValue='-' FallbackValue='-' Mode="OneWay"> <Binding Path="RunningJobStatus.ProgressMinusSettingUp" Mode="OneWay"/> <Binding Path="Job.GramPerLength" Mode="OneWay"/> <Binding Path="Job.Spools" Mode="OneWay"/> @@ -411,7 +500,7 @@ </UniformGrid> </StackPanel> - <Grid Grid.Row="3" Margin="0 30 0 0"> + <Grid Grid.Row="3" Margin="0 30 0 0" > <Rectangle Fill="{StaticResource TangoLightBorderBrush}" Height="2" VerticalAlignment="Top"></Rectangle> <Grid Margin="0 40 0 0"> @@ -424,24 +513,52 @@ <Image Source="../Images/Job Issues/input.png" Stretch="None" VerticalAlignment="Top" HorizontalAlignment="Left"/> <TextBlock VerticalAlignment="Center" Margin="15 0 0 0" FontSize="{StaticResource TangoDefaultFontSize}">Input</TextBlock> </StackPanel> - <UniformGrid Columns="3" Rows="1" Margin="0 30 0 0" Width="180" HorizontalAlignment="Left"> - <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> - <Border Width="50" Height="50" Background="Gray" CornerRadius="16" HorizontalAlignment="Left"></Border> - <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">L</TextBlock> - <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">86</TextBlock> - </StackPanel> - <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> - <Border Width="50" Height="50" Background="red" CornerRadius="16" HorizontalAlignment="Left"></Border> - <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">A</TextBlock> - <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">86</TextBlock> - </StackPanel> - <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left"> - <Border Width="50" Height="50" Background="Blue" CornerRadius="16" HorizontalAlignment="Left"></Border> - <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">B</TextBlock> - <TextBlock Margin="0 10 0 0 " HorizontalAlignment="Center">86</TextBlock> - </StackPanel> - </UniformGrid> - </StackPanel> + <UniformGrid Margin="0 35 0 0" Rows="1" Columns="3" Height="Auto" MinWidth="180" HorizontalAlignment="Left" Visibility="{Binding IsDyeingProcess,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <StackPanel Orientation="Vertical"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"></Border> + <TextBlock Margin="0 10 0 0 " Text="L" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center"/> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="-" ></TextBlock> + + </StackPanel> + <StackPanel Orientation="Vertical" Width="50" HorizontalAlignment="Left" Margin="5 0 0 0"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"></Border> + <TextBlock Margin="0 10 0 0 " Text="a" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center"/> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="-" ></TextBlock> + </StackPanel> + <StackPanel Orientation="Vertical" Margin="10 0 0 0" Width="50"> + <Border Width="50" Height="50" Background="Transparent" CornerRadius="16" HorizontalAlignment="Left" BorderBrush="{StaticResource TangoDisabledForegroundBrush}" BorderThickness="1"></Border> + <TextBlock Margin="0 10 0 0 " Text="b" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center"/> + <TextBlock Margin="0 10 0 0 " Style="{StaticResource SliderGreyTextStyle}" Text="-" ></TextBlock> + </StackPanel> + </UniformGrid> + <Grid Visibility="{Binding IsDyeingProcess,Converter={StaticResource BooleanToVisibilityConverter}}"> + <ContentControl x:Name="leftBrushValues" HorizontalAlignment="Left" Content="{Binding CurrentBrushStop}" Width="Auto" Height="Auto" Background="Aqua" Margin="0 30 0 0"> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate/> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding CurrentBrushStop.ColorSpace.Name, Converter={StaticResource EnumToDescriptionConverter}}" Value="RGB"> + <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding CurrentBrushStop.ColorSpace.Name, Converter={StaticResource EnumToDescriptionConverter}}" Value="Volume"> + <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding CurrentBrushStop.ColorSpace.Name}" Value="LAB"> + <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding CurrentBrushStop.ColorSpace.Name, Converter={StaticResource EnumToDescriptionConverter}}" Value="Catalog"> + <Setter Property="ContentTemplate" Value="{StaticResource CATALOG_Template}" /> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </Grid> + </StackPanel> <StackPanel Orientation="Vertical" Grid.Column="1" Margin="60 0 0 0"> <StackPanel Orientation="Horizontal"> <Image Source="../Images/Job Issues/output.png" Stretch="None" VerticalAlignment="Top" HorizontalAlignment="Left" Height="Auto"/> @@ -503,9 +620,9 @@ </touch:TouchButton> <StackPanel DockPanel.Dock="Left" Orientation="Horizontal" VerticalAlignment="Center" > - <!--<Image Source="../Images/JobView/job-summary.png" Width="39" />--> - <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" >Notifications</TextBlock> - <TextBlock Margin="20 0 0 0" VerticalAlignment="Center" FontWeight="Normal" Visibility="{Binding NotificationProvider.HasNotificationItems, Converter={StaticResource BooleanToVisibilityConverter}}"> + <Image Source="../Images/Job Issues/Events.png" MaxWidth="33" Stretch="Fill" Height="36"/> + <TextBlock VerticalAlignment="Center" Margin="20 4 0 0" FontWeight="SemiBold" FontSize="{StaticResource TangoComboBoxItemFontSize}">Notifications</TextBlock> + <TextBlock Margin="1000 0 0 0" VerticalAlignment="Center" FontWeight="Normal" FontSize="{StaticResource TangoComboBoxItemFontSize}" Visibility="{Binding NotificationProvider.HasNotificationItems, Converter={StaticResource BooleanToVisibilityConverter}}"> <Run Text="(" ></Run> <Run Text="7(TEST)"></Run> <Run Text=" new Events)" ></Run> |
