Initial check-in
773
Source/ProgramGUI/MainWindow.xaml
Normal file
@@ -0,0 +1,773 @@
|
||||
<Window x:Class="ProgramGui.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:ProgramGui"
|
||||
mc:Ignorable="d"
|
||||
Title="Missile Test Set"
|
||||
WindowStyle="None"
|
||||
ResizeMode="CanResizeWithGrip"
|
||||
MouseLeftButtonDown="Window_MouseLeftButtonDown"
|
||||
Height="650"
|
||||
Width="1000">
|
||||
<WindowChrome.WindowChrome>
|
||||
<WindowChrome GlassFrameThickness="0" CornerRadius="0" CaptionHeight="0"/>
|
||||
</WindowChrome.WindowChrome>
|
||||
<Window.Resources>
|
||||
|
||||
<!-- Style for the close button -->
|
||||
<Style x:Key="TitleBarCloseButtonStyle" TargetType="{x:Type Button}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<Border x:Name="bdr_main" BorderThickness="1" BorderBrush="Transparent" Background="Transparent">
|
||||
<ContentPresenter x:Name="bdr_main2" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Content"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bdr_main" Property="Background" Value="#e94856"/>
|
||||
<Setter TargetName="bdr_main" Property="BorderBrush" Value="#ba1245"/>
|
||||
<Setter TargetName="bdr_main2" Property="Content">
|
||||
<Setter.Value>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/Title_Bar_Buttons/close_white.png" Width="20" Height="20" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="bdr_main" Property="Background" Value="#ff829a"/>
|
||||
<Setter TargetName="bdr_main" Property="BorderBrush" Value="#e94856"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Style for minimize and maximize buttons -->
|
||||
<Style x:Key="TitleBarButtonStyle" TargetType="{x:Type Button}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<Border x:Name="bdr_main" BorderThickness="1" BorderBrush="Transparent" Background="Transparent">
|
||||
<ContentPresenter x:Name="bdr_main2" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Content"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bdr_main" Property="Background" Value="#bee6fd"/>
|
||||
<Setter TargetName="bdr_main" Property="BorderBrush" Value="#7fb1cd"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="bdr_main" Property="Background" Value="#a1bfd0"/>
|
||||
<Setter TargetName="bdr_main" Property="BorderBrush" Value="#4c778f"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Define all image paths here for images that are binded to data model -->
|
||||
<!-- Images that are binded to data models are not displayed at design time -->
|
||||
<!-- So we use these images to display at design time -->
|
||||
<BitmapImage x:Key="DesignSourceBlackLed" UriSource="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png"/>
|
||||
|
||||
<!-- Style for the Menu control -->
|
||||
<!-- There are multiple styles for the Menu control which are generated from built-in Menu style templte -->
|
||||
<!-- Only thing that was changed in the Menu template is the line below, to change the color of "Menu.Static.Background"-->
|
||||
<SolidColorBrush x:Key="Menu.Static.Background" Color="#f4f6fd"/>
|
||||
<SolidColorBrush x:Key="Menu.Static.Border" Color="#FF999999"/>
|
||||
<SolidColorBrush x:Key="Menu.Static.Foreground" Color="#FF212121"/>
|
||||
<SolidColorBrush x:Key="Menu.Static.Separator" Color="#FFD7D7D7"/>
|
||||
<SolidColorBrush x:Key="Menu.Disabled.Foreground" Color="#FF707070"/>
|
||||
<SolidColorBrush x:Key="MenuItem.Selected.Background" Color="#3D26A0DA"/>
|
||||
<SolidColorBrush x:Key="MenuItem.Selected.Border" Color="#FF26A0DA"/>
|
||||
<SolidColorBrush x:Key="MenuItem.Highlight.Background" Color="#3D26A0DA"/>
|
||||
<SolidColorBrush x:Key="MenuItem.Highlight.Border" Color="#FF26A0DA"/>
|
||||
<SolidColorBrush x:Key="MenuItem.Highlight.Disabled.Background" Color="#0A000000"/>
|
||||
<SolidColorBrush x:Key="MenuItem.Highlight.Disabled.Border" Color="#21000000"/>
|
||||
<MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter"/>
|
||||
<Geometry x:Key="DownArrow">M 0,0 L 3.5,4 L 7,0 Z</Geometry>
|
||||
<Geometry x:Key="UpArrow">M 0,4 L 3.5,0 L 7,4 Z</Geometry>
|
||||
<Geometry x:Key="RightArrow">M 0,0 L 4,3.5 L 0,7 Z</Geometry>
|
||||
<Geometry x:Key="Checkmark">F1 M 10.0,1.2 L 4.7,9.1 L 4.5,9.1 L 0,5.2 L 1.3,3.5 L 4.3,6.1L 8.3,0 L 10.0,1.2 Z</Geometry>
|
||||
<!-- Built-in style for the Menu control continued... -->
|
||||
<Style x:Key="MenuScrollButton" BasedOn="{x:Null}" TargetType="{x:Type RepeatButton}">
|
||||
<Setter Property="ClickMode" Value="Hover"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
||||
<Border x:Name="templateRoot" Background="Transparent" BorderBrush="Transparent" BorderThickness="1" SnapsToDevicePixels="true">
|
||||
<ContentPresenter HorizontalAlignment="Center" Margin="6" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<!-- Built-in style for the Menu control continued... -->
|
||||
<Style x:Key="{ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}" BasedOn="{x:Null}" TargetType="{x:Type ScrollViewer}">
|
||||
<Setter Property="HorizontalScrollBarVisibility" Value="Hidden"/>
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ScrollViewer}">
|
||||
<Grid SnapsToDevicePixels="true">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Column="0" Grid.Row="1">
|
||||
<ScrollContentPresenter CanContentScroll="{TemplateBinding CanContentScroll}" Margin="{TemplateBinding Padding}"/>
|
||||
</Border>
|
||||
<RepeatButton Command="{x:Static ScrollBar.LineUpCommand}" CommandTarget="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}}" Grid.Column="0" Focusable="false" Grid.Row="0" Style="{StaticResource MenuScrollButton}">
|
||||
<RepeatButton.Visibility>
|
||||
<MultiBinding ConverterParameter="0" Converter="{StaticResource MenuScrollingVisibilityConverter}" FallbackValue="Visibility.Collapsed">
|
||||
<Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
<Binding Path="VerticalOffset" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
<Binding Path="ExtentHeight" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
<Binding Path="ViewportHeight" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
</MultiBinding>
|
||||
</RepeatButton.Visibility>
|
||||
<Path Data="{StaticResource UpArrow}" Fill="{StaticResource Menu.Static.Foreground}"/>
|
||||
</RepeatButton>
|
||||
<RepeatButton Command="{x:Static ScrollBar.LineDownCommand}" CommandTarget="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}}" Grid.Column="0" Focusable="false" Grid.Row="2" Style="{StaticResource MenuScrollButton}">
|
||||
<RepeatButton.Visibility>
|
||||
<MultiBinding ConverterParameter="100" Converter="{StaticResource MenuScrollingVisibilityConverter}" FallbackValue="Visibility.Collapsed">
|
||||
<Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
<Binding Path="VerticalOffset" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
<Binding Path="ExtentHeight" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
<Binding Path="ViewportHeight" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
</MultiBinding>
|
||||
</RepeatButton.Visibility>
|
||||
<Path Data="{StaticResource DownArrow}" Fill="{StaticResource Menu.Static.Foreground}"/>
|
||||
</RepeatButton>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<!-- Built-in ControlTemplate for the Menu control continued... -->
|
||||
<ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
|
||||
<Border x:Name="templateRoot" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
|
||||
<Grid VerticalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentPresenter x:Name="Icon" ContentSource="Icon" HorizontalAlignment="Center" Height="16" Margin="3" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" Width="16"/>
|
||||
<Path x:Name="GlyphPanel" Data="{StaticResource Checkmark}" FlowDirection="LeftToRight" Fill="{StaticResource Menu.Static.Foreground}" Margin="3" VerticalAlignment="Center" Visibility="Collapsed"/>
|
||||
<ContentPresenter ContentSource="Header" Grid.Column="1" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="true">
|
||||
<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
<Setter Property="Fill" TargetName="GlyphPanel" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsHighlighted" Value="True"/>
|
||||
<Condition Property="IsEnabled" Value="False"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Disabled.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Disabled.Border}"/>
|
||||
</MultiTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
<!-- Built-in ControlTemplate for the Menu control continued... -->
|
||||
<ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
|
||||
<Border x:Name="templateRoot" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
|
||||
<Grid VerticalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentPresenter x:Name="Icon" ContentSource="Icon" HorizontalAlignment="Center" Height="16" Margin="3" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" Width="16"/>
|
||||
<Path x:Name="GlyphPanel" Data="{StaticResource Checkmark}" FlowDirection="LeftToRight" Fill="{TemplateBinding Foreground}" Margin="3" VerticalAlignment="Center" Visibility="Collapsed"/>
|
||||
<ContentPresenter ContentSource="Header" Grid.Column="1" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
<Popup x:Name="PART_Popup" AllowsTransparency="true" Focusable="false" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource Mode=TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" PlacementTarget="{Binding ElementName=templateRoot}">
|
||||
<Border x:Name="SubMenuBorder" Background="{StaticResource Menu.Static.Background}" BorderBrush="{StaticResource Menu.Static.Border}" BorderThickness="1" Padding="2">
|
||||
<ScrollViewer x:Name="SubMenuScrollViewer" Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}">
|
||||
<Grid RenderOptions.ClearTypeHint="Enabled">
|
||||
<Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
|
||||
<Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=SubMenuBorder}" Height="{Binding ActualHeight, ElementName=SubMenuBorder}" Width="{Binding ActualWidth, ElementName=SubMenuBorder}"/>
|
||||
</Canvas>
|
||||
<Rectangle Fill="{StaticResource Menu.Static.Separator}" HorizontalAlignment="Left" Margin="29,2,0,2" Width="1"/>
|
||||
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" Grid.IsSharedSizeScope="true" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle"/>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSuspendingPopupAnimation" Value="true">
|
||||
<Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="true">
|
||||
<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
<Setter Property="Fill" TargetName="GlyphPanel" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ScrollViewer.CanContentScroll" SourceName="SubMenuScrollViewer" Value="false">
|
||||
<Setter Property="Canvas.Top" TargetName="OpaqueRect" Value="{Binding VerticalOffset, ElementName=SubMenuScrollViewer}"/>
|
||||
<Setter Property="Canvas.Left" TargetName="OpaqueRect" Value="{Binding HorizontalOffset, ElementName=SubMenuScrollViewer}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
<!-- Built-in ControlTemplate for the Menu control continued... -->
|
||||
<ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
|
||||
<Border x:Name="templateRoot" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Height="22" SnapsToDevicePixels="true">
|
||||
<Grid Margin="-1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MinWidth="22" SharedSizeGroup="MenuItemIconColumnGroup" Width="Auto"/>
|
||||
<ColumnDefinition Width="13"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
<ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto"/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentPresenter x:Name="Icon" ContentSource="Icon" HorizontalAlignment="Center" Height="16" Margin="3" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" Width="16"/>
|
||||
<Border x:Name="GlyphPanel" Background="{StaticResource MenuItem.Selected.Background}" BorderBrush="{StaticResource MenuItem.Selected.Border}" BorderThickness="1" ClipToBounds="False" HorizontalAlignment="Center" Height="22" Margin="-1,0,0,0" VerticalAlignment="Center" Visibility="Hidden" Width="22">
|
||||
<Path x:Name="Glyph" Data="{StaticResource Checkmark}" FlowDirection="LeftToRight" Fill="{StaticResource Menu.Static.Foreground}" Height="11" Width="10"/>
|
||||
</Border>
|
||||
<ContentPresenter x:Name="menuHeaderContainer" ContentSource="Header" Grid.Column="2" HorizontalAlignment="Left" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
|
||||
<TextBlock x:Name="menuGestureText" Grid.Column="4" Margin="{TemplateBinding Padding}" Opacity="0.7" Text="{TemplateBinding InputGestureText}" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
<Setter Property="Fill" TargetName="Glyph" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsHighlighted" Value="True"/>
|
||||
<Condition Property="IsEnabled" Value="False"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Disabled.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Disabled.Border}"/>
|
||||
</MultiTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
<!-- Built-in ControlTemplate for the Menu control continued... -->
|
||||
<ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
|
||||
<Border x:Name="templateRoot" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Height="22" SnapsToDevicePixels="true">
|
||||
<Grid Margin="-1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MinWidth="22" SharedSizeGroup="MenuItemIconColumnGroup" Width="Auto"/>
|
||||
<ColumnDefinition Width="13"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
<ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto"/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentPresenter x:Name="Icon" ContentSource="Icon" HorizontalAlignment="Center" Height="16" Margin="3" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" Width="16"/>
|
||||
<Border x:Name="GlyphPanel" Background="{StaticResource MenuItem.Highlight.Background}" BorderBrush="{StaticResource MenuItem.Highlight.Border}" BorderThickness="1" Height="22" Margin="-1,0,0,0" VerticalAlignment="Center" Visibility="Hidden" Width="22">
|
||||
<Path x:Name="Glyph" Data="{DynamicResource Checkmark}" FlowDirection="LeftToRight" Fill="{StaticResource Menu.Static.Foreground}" Height="11" Width="9"/>
|
||||
</Border>
|
||||
<ContentPresenter ContentSource="Header" Grid.Column="2" HorizontalAlignment="Left" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="4" Margin="{TemplateBinding Padding}" Opacity="0.7" Text="{TemplateBinding InputGestureText}" VerticalAlignment="Center"/>
|
||||
<Path x:Name="RightArrow" Grid.Column="5" Data="{StaticResource RightArrow}" Fill="{StaticResource Menu.Static.Foreground}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center"/>
|
||||
<Popup x:Name="PART_Popup" AllowsTransparency="true" Focusable="false" HorizontalOffset="-2" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource Mode=TemplatedParent}}" Placement="Right" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" VerticalOffset="-3">
|
||||
<Border x:Name="SubMenuBorder" Background="{StaticResource Menu.Static.Background}" BorderBrush="{StaticResource Menu.Static.Border}" BorderThickness="1" Padding="2">
|
||||
<ScrollViewer x:Name="SubMenuScrollViewer" Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}">
|
||||
<Grid RenderOptions.ClearTypeHint="Enabled">
|
||||
<Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
|
||||
<Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=SubMenuBorder}" Height="{Binding ActualHeight, ElementName=SubMenuBorder}" Width="{Binding ActualWidth, ElementName=SubMenuBorder}"/>
|
||||
</Canvas>
|
||||
<Rectangle Fill="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" HorizontalAlignment="Left" Margin="29,2,0,2" Width="1"/>
|
||||
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" Grid.IsSharedSizeScope="true" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle"/>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSuspendingPopupAnimation" Value="true">
|
||||
<Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter Property="Background" TargetName="templateRoot" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
<Setter Property="Fill" TargetName="Glyph" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
<Setter Property="Fill" TargetName="RightArrow" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ScrollViewer.CanContentScroll" SourceName="SubMenuScrollViewer" Value="false">
|
||||
<Setter Property="Canvas.Top" TargetName="OpaqueRect" Value="{Binding VerticalOffset, ElementName=SubMenuScrollViewer}"/>
|
||||
<Setter Property="Canvas.Left" TargetName="OpaqueRect" Value="{Binding HorizontalOffset, ElementName=SubMenuScrollViewer}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
<!-- Built-in style for the Menu control continued... -->
|
||||
<Style x:Key="MenuItemStyle" TargetType="{x:Type MenuItem}">
|
||||
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
||||
<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="Role" Value="TopLevelHeader">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource Menu.Static.Foreground}"/>
|
||||
<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
|
||||
<Setter Property="Padding" Value="6,0"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Role" Value="TopLevelItem">
|
||||
<Setter Property="Background" Value="{StaticResource Menu.Static.Background}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Menu.Static.Border}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource Menu.Static.Foreground}"/>
|
||||
<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
|
||||
<Setter Property="Padding" Value="6,0"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Role" Value="SubmenuHeader">
|
||||
<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</Window.Resources>
|
||||
|
||||
<!-- Main Grid that contains everything -->
|
||||
<Grid Background="#f4f6fd">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30px"/>
|
||||
<RowDefinition Height="30px"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="28px"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Title bar which has the app icon, app title, minimize button, maximize button and close button -->
|
||||
<Grid>
|
||||
<WrapPanel HorizontalAlignment="left" VerticalAlignment="Center">
|
||||
<Image x:Name="imgAppIcon" Source="pack://application:,,,/ProgramGui;component/Resources/Images/missile.png" Width="20" Height="20" Margin="10,0,10,0"/>
|
||||
<TextBlock x:Name="txtBlockAppTitle">[App Title Here]</TextBlock>
|
||||
</WrapPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="0">
|
||||
<Button Style="{StaticResource TitleBarButtonStyle}" x:Name="btnMin" Width="44" Background="Transparent" BorderBrush="Transparent" Click="btnMin_Click">
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/Title_Bar_Buttons/minimize.png" Width="12" Height="12"/>
|
||||
</Button>
|
||||
<Button Style="{StaticResource TitleBarButtonStyle}" x:Name="btnMax" Width="44" Background="Transparent" BorderBrush="Transparent" Click="btnMax_Click">
|
||||
<Image x:Name="imgMax" Source="pack://application:,,,/ProgramGui;component/Resources/Images/Title_Bar_Buttons/maximize.png" Width="13" Height="13"/>
|
||||
</Button>
|
||||
<Button Style="{StaticResource TitleBarCloseButtonStyle}" x:Name="btnClose" Width="44" Background="Transparent" BorderBrush="Transparent" Click="btnClose_Click">
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/Title_Bar_Buttons/close_black.png" Width="20" Height="20"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Menu bar -->
|
||||
<DockPanel Grid.Row="1" HorizontalAlignment="left" VerticalAlignment="Center">
|
||||
<Menu DockPanel.Dock="Top" Background="#f4f6fd">
|
||||
<MenuItem Style="{DynamicResource MenuItemStyle}" Header="Help" Background="Transparent">
|
||||
<MenuItem Header="Data Location"/>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</DockPanel>
|
||||
|
||||
<!-- Body -->
|
||||
<Grid Grid.Row="2" Background="#f0f0f0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="6*" />
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="4*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="4.1*" />
|
||||
<RowDefinition Height="5.9*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Contains headers and datagrid for the power data -->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="70" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25" />
|
||||
<RowDefinition Height="4*" />
|
||||
<RowDefinition Height="6*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.ColumnSpan="2" FontSize="14" Foreground="White" FontWeight="Bold" Content="UUT Power Supply Monitor" Padding="5,0,0,2" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd">
|
||||
<Label.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#1959b1" Offset="0.31" />
|
||||
<GradientStop Color="#1959b1" Offset="0.09" />
|
||||
<GradientStop Color="white" Offset="1.1" />
|
||||
</LinearGradientBrush>
|
||||
</Label.Background>
|
||||
</Label>
|
||||
|
||||
<StackPanel Grid.Row="1">
|
||||
<Label FontSize="13" FontWeight="Bold" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Height="42" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd">PS</Label>
|
||||
<Label Height="19" FontSize="10" FontWeight="Bold" Content="UMB +20V" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,0,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Height="19" FontSize="10" FontWeight="Bold" Content="-20V" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,0,1,1" BorderBrush="#bdbcbd"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Grid.Row="1" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="22" />
|
||||
<RowDefinition Height="20" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.ColumnSpan="2" FontSize="10" FontWeight="Bold" Content="Voltage (V)" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Column="2" Grid.ColumnSpan="2" FontSize="10" FontWeight="Bold" Content="Current (A)" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" FontSize="10" FontWeight="Bold" Content="Expected" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,0,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" Grid.Column="1" FontSize="10" FontWeight="Bold" Content="Actual" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,0,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" Grid.Column="2" FontSize="10" FontWeight="Bold" Content="Expected" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,0,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" Grid.Column="3" FontSize="10" FontWeight="Bold" Content="Actual" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,0,1,1" BorderBrush="#bdbcbd"/>
|
||||
|
||||
<!-- DataGrid for Power Data-->
|
||||
<DataGrid Grid.Row="2" Grid.ColumnSpan="4" Name="datagridPowerData" AutoGenerateColumns="False" CanUserAddRows="False" IsReadOnly="True" SelectionMode="Extended" SelectionUnit="FullRow" ItemsSource="{Binding _dataGridPowerDatatems}" Width="auto" HorizontalGridLinesBrush="#e9e9e9" VerticalGridLinesBrush="#e9e9e9" HeadersVisibility="None" BorderThickness="0">
|
||||
<DataGrid.Resources>
|
||||
<Style x:Key="CellStyle" TargetType="DataGridCell">
|
||||
<Setter Property="TextBlock.TextAlignment" Value="Center" />
|
||||
<Setter Property="Foreground" Value="Black" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Background" Value="{x:Null}" />
|
||||
<Setter Property="BorderBrush" Value="{x:Null}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="expectedVoltage" Width="1*" Binding="{Binding ExpectedVoltage}"/>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="actualVoltage" Width="1*" Binding="{Binding ActualVoltage}"/>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="expectCurrent" Width="1*" Binding="{Binding ExpectedCurrent}"/>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="actualCurrent" Width="1*" Binding="{Binding ActualCurrent}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="2" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="4*" />
|
||||
<ColumnDefinition Width="6*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.ColumnSpan="2" FontSize="14" FontWeight="Bold" Foreground="White" Content="Temperature Monitor" Padding="5,0,0,2" Margin="0,5,0,0" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd">
|
||||
<Label.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#1959b1" Offset="0.31" />
|
||||
<GradientStop Color="#1959b1" Offset="0.09" />
|
||||
<GradientStop Color="white" Offset="1.1" />
|
||||
</LinearGradientBrush>
|
||||
</Label.Background>
|
||||
</Label>
|
||||
|
||||
<Border Grid.Row="1" Grid.ColumnSpan="2" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd" Margin="0,0,0,5">
|
||||
<StackPanel Margin="5,5,0,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Margin="0,0,35,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="IDA" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,35,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="50" Content="SIC ADC" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/green-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,35,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="50" Content="VIP Versal" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="80" Content="VIP I2C Board" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="VIP PolarFire FPGA" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/yellow-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="50" Content="MCC DSP" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="80" Content="MCC Board" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,20,0,0">
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="CAS ACU DSP" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/red-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,35,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="50" Content="CAS ACU" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/green-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<!-- Contains indicators -->
|
||||
<Grid Grid.Column="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="4*" />
|
||||
<ColumnDefinition Width="6*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25" />
|
||||
<RowDefinition Height="5*" />
|
||||
<RowDefinition Height="5*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.ColumnSpan="2" FontSize="14" FontWeight="Bold" Foreground="White" Content="Key Indicators" Padding="5,0,0,2" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd">
|
||||
<Label.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#1959b1" Offset="0.31" />
|
||||
<GradientStop Color="#1959b1" Offset="0.09" />
|
||||
<GradientStop Color="white" Offset="1.1" />
|
||||
</LinearGradientBrush>
|
||||
</Label.Background>
|
||||
</Label>
|
||||
|
||||
<Border Grid.Row="1" BorderThickness="1,0,0,1" BorderBrush="#bdbcbd" Margin="0,0,0,5">
|
||||
<StackPanel Margin="5,0,0,0">
|
||||
<StackPanel Orientation="Horizontal" Margin="0,5,0,10">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="TE Power" HorizontalAlignment="Left" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="{Binding TePowerLedImagePath, FallbackValue={StaticResource DesignSourceBlackLed}}" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="UUT Power" HorizontalAlignment="Left" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="{Binding UutPowerLedImagePath, FallbackValue={StaticResource DesignSourceBlackLed}}" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="Indicator 2" HorizontalAlignment="Left" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="Indicator 3" HorizontalAlignment="Left" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Grid.Column="1" BorderThickness="0,0,0,1" BorderBrush="#bdbcbd" Margin="0,0,0,5">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,5,0,10">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="Test Time" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="---" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd" Background="White"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="Coolant Flow" HorizontalAlignment="Left" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="---" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd" Background="White"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="Indicator 4" HorizontalAlignment="Left" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="---" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd" Background="White"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="Indicator 5" HorizontalAlignment="Left" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="---" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd" Background="White"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Grid Grid.Row="2" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="4*" />
|
||||
<ColumnDefinition Width="6*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.ColumnSpan="2" FontSize="14" FontWeight="Bold" Foreground="White" Content="Connectors" Padding="5,0,0,2" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd">
|
||||
<Label.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#1959b1" Offset="0.31" />
|
||||
<GradientStop Color="#1959b1" Offset="0.09" />
|
||||
<GradientStop Color="white" Offset="1.1" />
|
||||
</LinearGradientBrush>
|
||||
</Label.Background>
|
||||
</Label>
|
||||
|
||||
<Border Grid.Row="1" Grid.ColumnSpan="2" BorderThickness="1,0,0,1" BorderBrush="#bdbcbd" Margin="0,5,0,5">
|
||||
<StackPanel Margin="5,0,0,0" Orientation="Horizontal">
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J1" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/green-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J2" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J3" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J4" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J5" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J6" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J7" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/green-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J8" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J9" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J10" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J11" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<!-- Contains headers and datagrid for the passthrough data -->
|
||||
<Grid Grid.Row="1" Grid.ColumnSpan="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25" />
|
||||
<RowDefinition Height="25" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.ColumnSpan="6" FontSize="14" FontWeight="Bold" Foreground="White" Content="Passthrough" Padding="5,0,0,2" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd">
|
||||
<Label.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#1959b1" Offset="0.31" />
|
||||
<GradientStop Color="#1959b1" Offset="0.09" />
|
||||
<GradientStop Color="white" Offset="1.1" />
|
||||
</LinearGradientBrush>
|
||||
</Label.Background>
|
||||
</Label>
|
||||
<Label Grid.Row="1" FontSize="10" FontWeight="Bold" Content="Variable" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" Grid.Column="1" FontSize="10" FontWeight="Bold" Content="Value" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" Grid.Column="2" FontSize="10" FontWeight="Bold" Content="Variable" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" Grid.Column="3" FontSize="10" FontWeight="Bold" Content="Value" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" Grid.Column="4" FontSize="10" FontWeight="Bold" Content="Variable" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" Grid.Column="5" FontSize="10" FontWeight="Bold" Content="Value" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,0,1" BorderBrush="#bdbcbd"/>
|
||||
|
||||
<!-- DataGrid for Passthrough Data -->
|
||||
<DataGrid Grid.Row="2" Grid.ColumnSpan="6" x:FieldModifier="public" Name="datagridPassthroughData" ItemsSource="{Binding _dataGridPassthroughDatatems}" AutoGenerateColumns="False" CanUserAddRows="False" IsReadOnly="True" SelectionMode="Extended" SelectionUnit="FullRow" Width="auto" HorizontalGridLinesBrush="#e9e9e9" VerticalGridLinesBrush="#e9e9e9" HeadersVisibility="None" BorderThickness="1,0,0,0" BorderBrush="#e9e9e9">
|
||||
<DataGrid.Resources>
|
||||
<Style x:Key="CellStyle" TargetType="DataGridCell">
|
||||
<Setter Property="TextBlock.TextAlignment" Value="Center" />
|
||||
<Setter Property="Foreground" Value="Black" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Background" Value="{x:Null}" />
|
||||
<Setter Property="BorderBrush" Value="{x:Null}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="item1Name" Width="1*" Binding="{Binding [0]}"/>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="item1Value" Width="1*" Binding="{Binding [1]}"/>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="item2Name" Width="1*" Binding="{Binding [2]}"/>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="item2Value" Width="1*" Binding="{Binding [3]}"/>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="item3Name" Width="1*" Binding="{Binding [4]}"/>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="item3Value" Width="1*" Binding="{Binding [5]}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<StatusBar Grid.Row="3" BorderThickness="0,1,0,0" BorderBrush="#bdbcbd">
|
||||
<StatusBarItem FontSize="16">Placeholder</StatusBarItem>
|
||||
<StatusBarItem>
|
||||
<TextBlock FontSize="16">Placeholder</TextBlock>
|
||||
</StatusBarItem>
|
||||
</StatusBar>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
</Window>
|
||||
69
Source/ProgramGUI/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using ProgramGui.Model;
|
||||
using ProgramGui.View;
|
||||
using ProgramGui.ViewModel;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace ProgramGui
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindowViewModel _mainWindowViewModel;
|
||||
|
||||
public ImpedanceCheckWindow _impedanceCheckWindow;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Uri iconUri = new Uri("pack://application:,,,/ProgramGui;component/Resources/Icons/app.ico");
|
||||
this.Icon = BitmapFrame.Create(iconUri);
|
||||
|
||||
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
|
||||
|
||||
_mainWindowViewModel = new MainWindowViewModel(this);
|
||||
DataContext = _mainWindowViewModel;
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
private void btnMax_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.WindowState == WindowState.Maximized)
|
||||
{
|
||||
this.WindowState = WindowState.Normal;
|
||||
imgMax.Source = new BitmapImage(new System.Uri("pack://application:,,,/Resources/Images/Title_Bar_Buttons/maximize.png"));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.WindowState = WindowState.Maximized;
|
||||
imgMax.Source = new BitmapImage(new System.Uri("pack://application:,,,/Resources/Images/Title_Bar_Buttons/restore.png"));
|
||||
}
|
||||
}
|
||||
|
||||
private void btnMin_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.WindowState = WindowState.Minimized;
|
||||
}
|
||||
|
||||
private void Window_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
{
|
||||
DragMove();
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Source/ProgramGUI/Model/ImpedanceDataModel.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace ProgramGui.Model
|
||||
{
|
||||
public partial class ImpedanceDataModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private string passFailImagePath;
|
||||
|
||||
[ObservableProperty]
|
||||
private string description;
|
||||
}
|
||||
}
|
||||
76
Source/ProgramGUI/Model/PassthroughData.Types.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProgramGui.Model
|
||||
{
|
||||
public partial class PassthroughData
|
||||
{
|
||||
private struct VariableInfo
|
||||
{
|
||||
// index into where the item is located in the dictionary
|
||||
public int passthroughDataModelDictIndex { get; set; }
|
||||
// index into where the item is located in the data model
|
||||
// the data model contains more than one item
|
||||
public int passthroughDataModelItemIndex { get; set; }
|
||||
}
|
||||
public enum Variables
|
||||
{
|
||||
VAR1,
|
||||
VAR2,
|
||||
VAR3,
|
||||
VAR4,
|
||||
VAR5,
|
||||
VAR6,
|
||||
VAR7,
|
||||
VAR8,
|
||||
VAR9,
|
||||
VAR10,
|
||||
VAR11,
|
||||
VAR12,
|
||||
VAR13,
|
||||
VAR14,
|
||||
VAR15,
|
||||
VAR16,
|
||||
VAR17,
|
||||
VAR18,
|
||||
VAR19,
|
||||
VAR20,
|
||||
VAR21,
|
||||
VAR22,
|
||||
VAR23,
|
||||
VAR24,
|
||||
VAR25,
|
||||
VAR26,
|
||||
VAR27,
|
||||
VAR28,
|
||||
VAR29,
|
||||
VAR30,
|
||||
VAR31,
|
||||
VAR32,
|
||||
VAR33,
|
||||
VAR34,
|
||||
VAR35,
|
||||
VAR36,
|
||||
VAR37,
|
||||
VAR38,
|
||||
VAR39,
|
||||
VAR40,
|
||||
VAR41,
|
||||
VAR42,
|
||||
};
|
||||
|
||||
private Dictionary<Variables, string> _variableEnumToDescriptionDict = new Dictionary<Variables, string>
|
||||
{
|
||||
{ Variables.VAR1, "IDA Temp" },
|
||||
{ Variables.VAR2, "FPGA Temp" },
|
||||
{ Variables.VAR3, "IDA Bias" },
|
||||
{ Variables.VAR4, "TINT" },
|
||||
{ Variables.VAR5, "Pitch" },
|
||||
{ Variables.VAR6, "Yaw" },
|
||||
{ Variables.VAR7, "Roll" },
|
||||
};
|
||||
}
|
||||
}
|
||||
63
Source/ProgramGUI/Model/PassthroughData.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProgramGui.Model
|
||||
{
|
||||
public partial class PassthroughData
|
||||
{
|
||||
private int _datagridColumnCount = 0;
|
||||
// this dictionary stores variable and the info needed to locate it in the passthroughdatamodel dictionary which contains a 2-d array
|
||||
private Dictionary<Variables, VariableInfo> _variableEnumToVariableInfoDict = new Dictionary<Variables, VariableInfo>();
|
||||
|
||||
// this dictionary stores variable and its corresponding data model
|
||||
private Dictionary<int, ObservableCollection<string>> _rowNumberToPassthroughDataDict = new Dictionary<int, ObservableCollection<string>>();
|
||||
|
||||
public PassthroughData(int datagridColumnCount)
|
||||
{
|
||||
_datagridColumnCount = datagridColumnCount;
|
||||
VariableInfo variableInfo = new VariableInfo();
|
||||
|
||||
int dictIndex = 0;
|
||||
int colIndex = 0;
|
||||
// contruct a 2-d array of strings based on the list of Variables
|
||||
foreach (Variables enumVar in Enum.GetValues(typeof(Variables)))
|
||||
{
|
||||
if (_rowNumberToPassthroughDataDict.Count == 0 || colIndex == _datagridColumnCount)
|
||||
{
|
||||
dictIndex++;
|
||||
_rowNumberToPassthroughDataDict[dictIndex] = new ObservableCollection<string>(new string[_datagridColumnCount]);
|
||||
colIndex = 0;
|
||||
}
|
||||
|
||||
// name of the variable
|
||||
_rowNumberToPassthroughDataDict[dictIndex][colIndex] = String.Empty;
|
||||
variableInfo.passthroughDataModelItemIndex = colIndex++;
|
||||
|
||||
// value of the variable
|
||||
_rowNumberToPassthroughDataDict[dictIndex][colIndex++] = String.Empty;
|
||||
|
||||
// save the row index so we can refer to this item
|
||||
variableInfo.passthroughDataModelDictIndex = dictIndex;
|
||||
|
||||
// save the column index of this item so we can refer to this item
|
||||
_variableEnumToVariableInfoDict[enumVar] = variableInfo;
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<int, ObservableCollection<string>> GetPassthroughDataModelDict()
|
||||
{
|
||||
return _rowNumberToPassthroughDataDict;
|
||||
}
|
||||
|
||||
public void SetValue(Variables variableName, string val)
|
||||
{
|
||||
_rowNumberToPassthroughDataDict[_variableEnumToVariableInfoDict[variableName].passthroughDataModelDictIndex][_variableEnumToVariableInfoDict[variableName].passthroughDataModelItemIndex] = _variableEnumToDescriptionDict[variableName];
|
||||
_rowNumberToPassthroughDataDict[_variableEnumToVariableInfoDict[variableName].passthroughDataModelDictIndex][_variableEnumToVariableInfoDict[variableName].passthroughDataModelItemIndex + 1] = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
17
Source/ProgramGUI/Model/PowerModuleDataModel.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace ProgramGui.Model
|
||||
{
|
||||
public partial class PowerModuleDataModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private string expectedVoltage;
|
||||
[ObservableProperty]
|
||||
private string actualVoltage;
|
||||
[ObservableProperty]
|
||||
private string expectedCurrent;
|
||||
[ObservableProperty]
|
||||
private string actualCurrent;
|
||||
|
||||
}
|
||||
}
|
||||
68
Source/ProgramGUI/ProgramGui.csproj
Normal file
@@ -0,0 +1,68 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)Program.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<AssemblyName>ProgramGui</AssemblyName>
|
||||
<UseWPF>true</UseWPF>
|
||||
<Description>NGSRI Program GUI</Description>
|
||||
<Company>Raytheonn Technologies</Company>
|
||||
<Product>NGSRI Program GUI</Product>
|
||||
<Authors>TEEC</Authors>
|
||||
<Copyright>Copyright © Raytheon Technologies $([System.DateTime]::get_now().ToString("yyyy"))</Copyright>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
|
||||
<!-- Prevent Git Commit Hash to be appended to Version information -->
|
||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||
<!-- Dynamic Versioning -->
|
||||
<!--<Version>$(Version)$(Suffix)</Version>-->
|
||||
|
||||
<!-- Static Versioning -->
|
||||
<Version>1.0.0</Version>
|
||||
<Configurations>Debug;Release;Deploy</Configurations>
|
||||
<ApplicationIcon>Resources\Icons\app.ico</ApplicationIcon>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Resources\Icons\Thumbs.db" />
|
||||
<None Remove="Resources\Images\red-led.png" />
|
||||
<None Remove="Resources\Images\Title_Bar_Buttons\Thumbs.db" />
|
||||
<None Remove="Resources\Images\yellow-led.png" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NLog" Version="5.0.0" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Copy pdb files for DLLs in nuget packages to output directory-->
|
||||
<Target Name="IncludeSymbolFiles" AfterTargets="ResolveAssemblyReferences" Condition="@(ReferenceCopyLocalPaths) != ''">
|
||||
<ItemGroup>
|
||||
<ReferenceCopyLocalPaths Include="%(ReferenceCopyLocalPaths.RelativeDir)%(ReferenceCopyLocalPaths.Filename).pdb" />
|
||||
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="!Exists('%(FullPath)')" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Windows" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\Icons\app.ico" />
|
||||
<Resource Include="Resources\Images\black-led.png" />
|
||||
<Resource Include="Resources\Images\green-check-mark.png" />
|
||||
<Resource Include="Resources\Images\green-led.png" />
|
||||
<Resource Include="Resources\Images\missile.png" />
|
||||
<Resource Include="Resources\Images\red-cross-mark.png" />
|
||||
<Resource Include="Resources\Images\red-led.png" />
|
||||
<Resource Include="Resources\Images\Title_Bar_Buttons\close_black.png" />
|
||||
<Resource Include="Resources\Images\Title_Bar_Buttons\close_white.png" />
|
||||
<Resource Include="Resources\Images\Title_Bar_Buttons\maximize.png" />
|
||||
<Resource Include="Resources\Images\Title_Bar_Buttons\minimize.png" />
|
||||
<Resource Include="Resources\Images\Title_Bar_Buttons\restore.png" />
|
||||
<Resource Include="Resources\Images\yellow-led.png" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
114
Source/ProgramGUI/ProgramGuiManager.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using NLog;
|
||||
using ProgramGui.View;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace ProgramGui
|
||||
{
|
||||
public class ProgramGuiManager : IDisposable
|
||||
{
|
||||
#region Private Members
|
||||
private Thread _guiManagerThread;
|
||||
private static NLog.ILogger _logger;
|
||||
private Dictionary<WINDOWS, Window> _windowDict = new Dictionary<WINDOWS, Window>();
|
||||
private ManualResetEvent _allGuiInitializedEvent = new ManualResetEvent(false);
|
||||
private bool _isDisposed = false;
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
public enum WINDOWS
|
||||
{
|
||||
MAIN,
|
||||
IMPEDANCE_CHECK
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// constructor
|
||||
/// </summary>
|
||||
public ProgramGuiManager()
|
||||
{
|
||||
_logger = LogManager.GetCurrentClassLogger();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Finalizer
|
||||
/// Do not call Dispose() in here
|
||||
/// </summary>
|
||||
~ProgramGuiManager()
|
||||
{
|
||||
_logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ...");
|
||||
}
|
||||
|
||||
public Window this[WINDOWS window]
|
||||
{
|
||||
get { return _windowDict[window]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize all the GUIs
|
||||
/// </summary>
|
||||
public void Initialize()
|
||||
{
|
||||
_guiManagerThread = new Thread(new ThreadStart(GuiManagerThread));
|
||||
_guiManagerThread.SetApartmentState(ApartmentState.STA);
|
||||
_guiManagerThread.Start();
|
||||
|
||||
_allGuiInitializedEvent.WaitOne();
|
||||
}
|
||||
|
||||
private void GuiManagerThread()
|
||||
{
|
||||
_logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is running...");
|
||||
|
||||
// instantiate all the windows here
|
||||
_windowDict[WINDOWS.MAIN] = new MainWindow();
|
||||
_windowDict[WINDOWS.IMPEDANCE_CHECK] = new ImpedanceCheckWindow();
|
||||
|
||||
_allGuiInitializedEvent.Set();
|
||||
|
||||
// Enter the event queue
|
||||
Dispatcher.Run();
|
||||
|
||||
_logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is exiting...");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose of this object.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
_logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ...");
|
||||
|
||||
try
|
||||
{
|
||||
if (!_isDisposed)
|
||||
{
|
||||
_logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() disposing");
|
||||
|
||||
_windowDict?.First().Value.Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
// shut down all windows
|
||||
foreach (var entry in _windowDict)
|
||||
{
|
||||
entry.Value.Close();
|
||||
}
|
||||
// kill the GuiManagerthread
|
||||
Dispatcher.CurrentDispatcher.InvokeShutdown();
|
||||
});
|
||||
|
||||
_isDisposed = true;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
63
Source/ProgramGUI/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ProgramGui.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DataGrid.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
Source/ProgramGUI/Properties/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
26
Source/ProgramGUI/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ProgramGui.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
Source/ProgramGUI/Properties/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
BIN
Source/ProgramGUI/Resources/Icons/app.ico
Normal file
|
After Width: | Height: | Size: 155 KiB |
|
After Width: | Height: | Size: 371 B |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 125 B |
|
After Width: | Height: | Size: 100 B |
BIN
Source/ProgramGUI/Resources/Images/Title_Bar_Buttons/restore.png
Normal file
|
After Width: | Height: | Size: 176 B |
BIN
Source/ProgramGUI/Resources/Images/black-led.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
Source/ProgramGUI/Resources/Images/green-check-mark.png
Normal file
|
After Width: | Height: | Size: 934 B |
BIN
Source/ProgramGUI/Resources/Images/green-led.png
Normal file
|
After Width: | Height: | Size: 90 KiB |
BIN
Source/ProgramGUI/Resources/Images/missile.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
Source/ProgramGUI/Resources/Images/red-cross-mark.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Source/ProgramGUI/Resources/Images/red-led.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
Source/ProgramGUI/Resources/Images/yellow-led.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
83
Source/ProgramGUI/View/ImpedanceCheckWindow.xaml
Normal file
@@ -0,0 +1,83 @@
|
||||
<Window x:Class="ProgramGui.View.ImpedanceCheckWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:ProgramGui.View"
|
||||
mc:Ignorable="d"
|
||||
Title="Impedance Check"
|
||||
WindowStyle="None"
|
||||
MouseLeftButtonDown="Window_MouseLeftButtonDown"
|
||||
Height="300"
|
||||
Width="400">
|
||||
<WindowChrome.WindowChrome>
|
||||
<WindowChrome GlassFrameThickness="0" CornerRadius="0" CaptionHeight="0"/>
|
||||
</WindowChrome.WindowChrome>
|
||||
<Window.Resources>
|
||||
<!-- Style for the close button -->
|
||||
<Style x:Key="TitleBarCloseButtonStyle" TargetType="{x:Type Button}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<Border x:Name="bdr_main" BorderThickness="1" BorderBrush="Transparent" Background="Transparent">
|
||||
<ContentPresenter x:Name="bdr_main2" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Content"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bdr_main" Property="Background" Value="#e94856"/>
|
||||
<Setter TargetName="bdr_main" Property="BorderBrush" Value="#ba1245"/>
|
||||
<Setter TargetName="bdr_main2" Property="Content">
|
||||
<Setter.Value>
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/Title_Bar_Buttons/close_white.png" Width="20" Height="20" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="bdr_main" Property="Background" Value="#ff829a"/>
|
||||
<Setter TargetName="bdr_main" Property="BorderBrush" Value="#e94856"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<!-- Main Grid that contains everything -->
|
||||
<Grid Background="#f4f6fd">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30px"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Title bar which has the app icon, app title, minimize button, maximize button and close button -->
|
||||
<Grid>
|
||||
<WrapPanel HorizontalAlignment="left" VerticalAlignment="Center">
|
||||
<Image x:Name="imgAppIcon" Source="pack://application:,,,/ProgramGui;component/Resources/Images/missile.png" Width="20" Height="20" Margin="10,0,10,0"/>
|
||||
<TextBlock x:Name="txtBlockAppTitle">Impedance Check</TextBlock>
|
||||
</WrapPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="0">
|
||||
<Button x:FieldModifier="public" Style="{StaticResource TitleBarCloseButtonStyle}" x:Name="btnClose" Width="44" Background="Transparent" BorderBrush="Transparent" Click="btnClose_Click">
|
||||
<Image Source="pack://application:,,,/ProgramGui;component/Resources/Images/Title_Bar_Buttons/close_black.png" Width="20" Height="20"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<ListView Grid.Row="1" x:Name="lvImpedanceCheck" ItemsSource="{Binding _listviewImpedanceDatatems}" Margin="15,5,15,15">
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="Focusable" Value="false"/>
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="{Binding PassFailImagePath}" Width="15" Height="15" />
|
||||
<TextBlock Text="{Binding Description}" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
62
Source/ProgramGUI/View/ImpedanceCheckWindow.xaml.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using ProgramGui.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace ProgramGui.View
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ImpedanceCheckWindow.xaml
|
||||
/// </summary>
|
||||
public partial class ImpedanceCheckWindow : Window
|
||||
{
|
||||
public ImpedanceCheckWindowViewModel _viewModel;
|
||||
|
||||
public ImpedanceCheckWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Uri iconUri = new Uri("pack://application:,,,/ProgramGui;component/Resources/Icons/app.ico");
|
||||
this.Icon = BitmapFrame.Create(iconUri);
|
||||
|
||||
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
|
||||
|
||||
btnClose.Visibility = Visibility.Hidden;
|
||||
|
||||
((INotifyCollectionChanged)lvImpedanceCheck.Items).CollectionChanged += ListView_CollectionChanged;
|
||||
|
||||
_viewModel = new ImpedanceCheckWindowViewModel(this);
|
||||
DataContext = _viewModel;
|
||||
}
|
||||
|
||||
protected override void OnContentRendered(EventArgs e)
|
||||
{
|
||||
base.OnContentRendered(e);
|
||||
|
||||
// call the delegate to perform STTO
|
||||
}
|
||||
|
||||
private void Window_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
{
|
||||
DragMove();
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
private void ListView_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
if (e.Action == NotifyCollectionChangedAction.Add)
|
||||
{
|
||||
// scroll the new item into view
|
||||
lvImpedanceCheck.ScrollIntoView(e.NewItems[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
53
Source/ProgramGUI/ViewModel/ImpedanceCheckWindowViewModel.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using ProgramGui.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace ProgramGui.ViewModel
|
||||
{
|
||||
public class ImpedanceCheckWindowViewModel : ObservableObject
|
||||
{
|
||||
private Window _window;
|
||||
public enum Images
|
||||
{
|
||||
PASS_CHECK,
|
||||
FAIL_CHECK
|
||||
}
|
||||
|
||||
public Dictionary<Images, string> _imageToResourcePathDict = new Dictionary<Images, string>()
|
||||
{
|
||||
{Images.PASS_CHECK, @"pack://application:,,,/ProgramGui;component/Resources/Images/green-check-mark.png" },
|
||||
{Images.FAIL_CHECK, @"pack://application:,,,/ProgramGui;component/Resources/Images/red-cross-mark.png" }
|
||||
};
|
||||
|
||||
#region Data Bindings
|
||||
public ObservableCollection<ImpedanceDataModel> _listviewImpedanceDatatems { get; set; }
|
||||
|
||||
#endregion Data Bindings
|
||||
|
||||
public ImpedanceCheckWindowViewModel(Window window)
|
||||
{
|
||||
_window = window;
|
||||
_listviewImpedanceDatatems = new ObservableCollection<ImpedanceDataModel>();
|
||||
}
|
||||
|
||||
public void AddData(ImpedanceDataModel item)
|
||||
{
|
||||
_window.Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
_listviewImpedanceDatatems.Add(item);
|
||||
});
|
||||
}
|
||||
|
||||
public void ClearData()
|
||||
{
|
||||
_window.Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
_listviewImpedanceDatatems.Clear();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
74
Source/ProgramGUI/ViewModel/MainWindowViewModel.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using ProgramGui.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProgramGui.ViewModel
|
||||
{
|
||||
public partial class MainWindowViewModel : ObservableObject
|
||||
{
|
||||
public enum Images
|
||||
{
|
||||
LED_ON,
|
||||
LED_OFF
|
||||
}
|
||||
|
||||
private Window _window;
|
||||
|
||||
public Dictionary<Images, string> _imageToResourcePathDict = new Dictionary<Images, string>()
|
||||
{
|
||||
{Images.LED_ON, @"pack://application:,,,/ProgramGui;component/Resources/Images/green-led.png" },
|
||||
{Images.LED_OFF, @"pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" }
|
||||
};
|
||||
|
||||
#region Data Bindings
|
||||
public ObservableCollection<PowerModuleDataModel> _dataGridPowerDatatems { get; set; }
|
||||
|
||||
// 2-dimensional data array
|
||||
// inner ObservableCollection<> is the columns
|
||||
// outer ObservableCollection is the row
|
||||
public ObservableCollection<ObservableCollection<string>> _dataGridPassthroughDatatems { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string uutPowerLedImagePath;
|
||||
|
||||
[ObservableProperty]
|
||||
private string tePowerLedImagePath;
|
||||
|
||||
#endregion Data Bindings
|
||||
|
||||
public MainWindowViewModel(Window window)
|
||||
{
|
||||
_window = window;
|
||||
_dataGridPowerDatatems = new ObservableCollection<PowerModuleDataModel>();
|
||||
_dataGridPassthroughDatatems = new ObservableCollection<ObservableCollection<string>>();
|
||||
|
||||
UutPowerLedImagePath = _imageToResourcePathDict[Images.LED_OFF];
|
||||
TePowerLedImagePath = _imageToResourcePathDict[Images.LED_ON];
|
||||
}
|
||||
|
||||
public void AddPowerData(Dictionary<string, PowerModuleDataModel> powerModuleToPowerDataModelDict)
|
||||
{
|
||||
foreach (var item in powerModuleToPowerDataModelDict)
|
||||
{
|
||||
_dataGridPowerDatatems.Add(item.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddPassthroughData(Dictionary<int, ObservableCollection<string>> rowNumberToPassthroughDataDict)
|
||||
{
|
||||
_window.Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
foreach (var item in rowNumberToPassthroughDataDict)
|
||||
{
|
||||
_dataGridPassthroughDatatems.Add(item.Value);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||