diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2020-01-08 13:53:48 +0200 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2020-01-08 13:53:48 +0200 |
| commit | 5a06b997b7ef29c566bad2bc65f927e9443c3888 (patch) | |
| tree | 7c332325fc01f82b68855bf31636830085ba6954 /Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance | |
| parent | 7f05564656644b9af0500657a689c12805aee732 (diff) | |
| download | Tango-5a06b997b7ef29c566bad2bc65f927e9443c3888.tar.gz Tango-5a06b997b7ef29c566bad2bc65f927e9443c3888.zip | |
Implemented maintenance mid-tank graphics.
Implemented session file logger.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToBrushConverter.cs | 52 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs | 6 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cl-full.png | bin | 0 -> 3454 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.png | bin | 0 -> 2174 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.png | bin | 0 -> 1752 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/l-full.png | bin | 0 -> 19717 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/lubricant2.png | bin | 0 -> 194234 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj | 12 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml | 113 |
9 files changed, 125 insertions, 58 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToBrushConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToBrushConverter.cs new file mode 100644 index 000000000..c7e828148 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToBrushConverter.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using Tango.BL.Entities; +using Tango.SharedUI.Helpers; + +namespace Tango.PPC.Maintenance.Converters +{ + public class LiquidTypeToBrushConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is LiquidType) + { + LiquidType type = value as LiquidType; + if (type.Type == BL.Enumerations.LiquidTypes.Lubricant) + { + ImageBrush lubricantBrush = new ImageBrush() { Stretch = Stretch.None, TileMode = TileMode.Tile, ViewportUnits = BrushMappingMode.Absolute }; + lubricantBrush.ImageSource = ResourceHelper.GetImageFromResources(@"Images/lubricant2.png"); + lubricantBrush.Viewport = new System.Windows.Rect(lubricantBrush.ImageSource.Width/3, lubricantBrush.ImageSource.Height/3, lubricantBrush.ImageSource.Width, lubricantBrush.ImageSource.Height); + return lubricantBrush; + } + if (type.Type == BL.Enumerations.LiquidTypes.Cleaner) + { + ImageBrush cleanerBrush = new ImageBrush(){ Stretch = Stretch.None, TileMode = TileMode.Tile, ViewportUnits = BrushMappingMode.Absolute }; + cleanerBrush.ImageSource = ResourceHelper.GetImageFromResources(@"Images/cl-full.png"); + cleanerBrush.Viewport = new System.Windows.Rect(5, 5, cleanerBrush.ImageSource.Width, cleanerBrush.ImageSource.Height); + return cleanerBrush; + } + else + { + return new SolidColorBrush(type.LiquidTypeColor); ; + } + } + return null; + + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + + } +} + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs index 5cf3f535c..94d1ed8b8 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs @@ -16,9 +16,9 @@ namespace Tango.PPC.Maintenance.Converters try { double parentActualHeight = (double)values[0]; - double midTankLevel = (double)values[1]; - - return (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * parentActualHeight; + double midTankLevel = Math.Min((double)values[1], MachineOperator.MAX_MIDTANK_LITERS); + //var test = (parentActualHeight - (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * parentActualHeight); + return (parentActualHeight - (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * parentActualHeight); } catch { diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cl-full.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cl-full.png Binary files differnew file mode 100644 index 000000000..5aaea8e6c --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cl-full.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.png Binary files differnew file mode 100644 index 000000000..d65b8f793 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.png Binary files differnew file mode 100644 index 000000000..c42abf56e --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/l-full.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/l-full.png Binary files differnew file mode 100644 index 000000000..2607f4a26 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/l-full.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/lubricant2.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/lubricant2.png Binary files differnew file mode 100644 index 000000000..554c16305 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/lubricant2.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj index a43fc2dc3..3f9f7c7b9 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj @@ -102,6 +102,7 @@ <Compile Include="..\..\..\Versioning\GlobalVersionInfo.cs"> <Link>GlobalVersionInfo.cs</Link> </Compile> + <Compile Include="Converters\LiquidTypeToBrushConverter.cs" /> <Compile Include="Converters\MidTankLevelToElementHeightConverter.cs" /> <Compile Include="Converters\StringToFirstLetterConverter.cs" /> <Compile Include="GuideBase.cs" /> @@ -255,10 +256,19 @@ <Resource Include="Images\temperature-red.png" /> <Resource Include="Images\temperature-yellow.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\lubricant2.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\cl-full.png" /> + <Resource Include="Images\cone-empty.png" /> + <Resource Include="Images\cone-full.png" /> + <Resource Include="Images\l-full.png" /> + </ItemGroup> <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/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml index c843daffc..e71a1827e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml @@ -15,6 +15,7 @@ <localConverters:StringToFirstLetterConverter x:Key="StringToFirstLetterConverter" /> <localConverters:MidTankLevelToElementHeightConverter x:Key="MidTankLevelToElementHeightConverter" /> + <localConverters:LiquidTypeToBrushConverter x:Key="LiquidTypeToBrushConverter" /> <Style TargetType="FrameworkElement" x:Key="Level1Container"> <Setter Property="Margin" Value="20 15 60 15"></Setter> @@ -25,6 +26,61 @@ <Style TargetType="FrameworkElement" x:Key="Level2ContainerExtraMargin"> <Setter Property="Margin" Value="80 40 60 0"></Setter> </Style> + + <DataTemplate x:Key="LiquidBox"> + <DockPanel> + <TextBlock DockPanel.Dock="Top" Text="{Binding IDSPack.LiquidType.Name,Converter={StaticResource StringToFirstLetterConverter}}" HorizontalAlignment="Center"></TextBlock> + <Grid MaxWidth="30" Margin="5 0"> + <touch:TouchIcon Icon="MapMarkerSolid" Width="20" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 0 0 10" Foreground ="{Binding Path=IDSPack.LiquidType, Converter={StaticResource LiquidTypeToBrushConverter}}"> + <touch:TouchIcon.Style> + <Style TargetType="touch:TouchIcon"> + <Setter Property="Visibility" Value="Hidden"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsLow}" Value="True"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding IsEmpty}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard Name="blinkDrop"> + <Storyboard> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Duration="00:00:01" RepeatBehavior="Forever"> + <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" /> + <DiscreteDoubleKeyFrame KeyTime="00:00:0.5" Value="0" /> + </DoubleAnimationUsingKeyFrames> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <RemoveStoryboard BeginStoryboardName="blinkDrop" /> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </touch:TouchIcon.Style> + </touch:TouchIcon> + <Border BorderThickness="1" BorderBrush="{StaticResource TangoLightBorderBrush}" CornerRadius="3" ClipToBounds="True" x:Name="pathBorder"> + <Canvas Width="30" > + <Path Panel.ZIndex="1" VerticalAlignment="Bottom" ClipToBounds="True" MinHeight="2" Data="M0,0 C2,0 8.9,-1.1705073 11.3,-4.6 14.5,-7.7 15.5,-8 18.7,-10.8 21.7,-13.16 23.3,-14.5 28,-15.6 28,-13.7 28,80 28,100 L0,100 z" Height="90" Width="29" Stretch="Fill" + Canvas.Left="0" Fill="{Binding Path=IDSPack.LiquidType, Converter={StaticResource LiquidTypeToBrushConverter}}" Margin="0 -14 0 0" > + + <Path.Style> + <Style> + <Setter Property="Canvas.Top" > + <Setter.Value> + <MultiBinding Converter="{StaticResource MidTankLevelToElementHeightConverter}"> + <Binding ElementName="pathBorder" Path="ActualHeight" /> + <Binding Path="Level" /> + </MultiBinding> + </Setter.Value> + </Setter> + </Style> + </Path.Style> + </Path> + </Canvas> + </Border> + </Grid> + </DockPanel> + </DataTemplate> </UserControl.Resources> <Grid Background="{StaticResource TangoMidBackgroundBrush}" IsEnabled="{Binding IsFree}"> @@ -88,67 +144,16 @@ </StackPanel> <Grid Grid.Column="1" Margin="0 0 0 10"> - <ItemsControl ItemsSource="{Binding MidTankLevels}"> + <ItemsControl ItemsSource="{Binding MidTankLevels}" ItemTemplate="{StaticResource LiquidBox}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <UniformGrid Rows="1" IsItemsHost="True"></UniformGrid> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <DockPanel> - <TextBlock DockPanel.Dock="Top" Text="{Binding IDSPack.LiquidType.Name,Converter={StaticResource StringToFirstLetterConverter}}" HorizontalAlignment="Center"></TextBlock> - - <Grid MaxWidth="30" Margin="5 0"> - <touch:TouchIcon Icon="MapMarkerSolid" Width="20" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 0 0 10"> - <touch:TouchIcon.Foreground> - <SolidColorBrush Color="{Binding IDSPack.LiquidType.LiquidTypeColor}" /> - </touch:TouchIcon.Foreground> - <touch:TouchIcon.Style> - <Style TargetType="touch:TouchIcon"> - <Setter Property="Visibility" Value="Hidden"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsLow}" Value="True"> - <Setter Property="Visibility" Value="Visible"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsEmpty}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard Name="blinkDrop"> - <Storyboard> - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Duration="00:00:01" RepeatBehavior="Forever"> - <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" /> - <DiscreteDoubleKeyFrame KeyTime="00:00:0.5" Value="0" /> - </DoubleAnimationUsingKeyFrames> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <RemoveStoryboard BeginStoryboardName="blinkDrop" /> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </touch:TouchIcon.Style> - </touch:TouchIcon> - <Border BorderThickness="1" BorderBrush="{StaticResource TangoLightBorderBrush}" CornerRadius="3"> - <Border CornerRadius="3" VerticalAlignment="Bottom" MinHeight="2"> - <Border.Background> - <SolidColorBrush Color="{Binding IDSPack.LiquidType.LiquidTypeColor}" /> - </Border.Background> - <Border.Height> - <MultiBinding Converter="{StaticResource MidTankLevelToElementHeightConverter}"> - <Binding RelativeSource="{RelativeSource AncestorType=Border}" Path="ActualHeight" /> - <Binding Path="Level" /> - </MultiBinding> - </Border.Height> - </Border> - </Border> - </Grid> - </DockPanel> - </DataTemplate> - </ItemsControl.ItemTemplate> </ItemsControl> </Grid> + + <Image Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" Source="../Images/cone-full.png" Margin="30"></Image> <TextBlock Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Temperature</TextBlock> <TextBlock Grid.Column="1" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Inks</TextBlock> |
