Initial check-in

This commit is contained in:
Duc
2025-03-13 18:18:47 -07:00
parent bd3b2fc583
commit 6b3922ddb4
48 changed files with 2206 additions and 19 deletions

63
.gitattributes vendored Normal file
View File

@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

379
.gitignore vendored
View File

@@ -1,26 +1,367 @@
# ---> Windows
# Windows thumbnail cache files
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
GenericWpfApp/Nuget/cache/
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# Folder config file
[Dd]esktop.ini
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mono auto generated files
mono_crash.*
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Windows shortcuts
*.lnk
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
#*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd

18
GenericWpfApp/App.props Normal file
View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Year>$([System.DateTime]::get_now().ToString("yyyy"))</Year>
<Major>$(Year)</Major>
<Minor>$([System.DateTime]::get_now().ToString("MM"))</Minor>
<Build>$([System.DateTime]::get_now().ToString("dd"))</Build>
<Revision>$([MSBuild]::Divide($([System.DateTime]::get_Now().get_TimeOfDay().get_TotalMinutes()), 2).ToString('F0'))</Revision>
<Version>$(Major).$(Minor).$(Build).$(Revision)</Version>
<Suffix></Suffix>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34408.163
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenericWpfApp", "GenericWpfApp\GenericWpfApp.csproj", "{0E2C774F-B33F-4EB4-9430-B8C3A92CC82E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Deploy|Any CPU = Deploy|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0E2C774F-B33F-4EB4-9430-B8C3A92CC82E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0E2C774F-B33F-4EB4-9430-B8C3A92CC82E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E2C774F-B33F-4EB4-9430-B8C3A92CC82E}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU
{0E2C774F-B33F-4EB4-9430-B8C3A92CC82E}.Deploy|Any CPU.Build.0 = Deploy|Any CPU
{0E2C774F-B33F-4EB4-9430-B8C3A92CC82E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0E2C774F-B33F-4EB4-9430-B8C3A92CC82E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {61A9DDD9-0827-4D70-8391-8E6C4CC1F17C}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

@@ -0,0 +1,9 @@
<Application x:Class="GenericWpfApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GenericWpfApp"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace GenericWpfApp
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true">
<!--
See http://nlog-project.org/wiki/Configuration_file
for information on customizing logging rules and outputs.
-->
<!-- add your targets here -->
<targets>
<default-wrapper xsi:type="AsyncWrapper" batchSize="1000" overflowAction="Grow" timeToSleepBetweenBatches="1"/>
<target type="FallbackGroup" name="FusionLogging" returnToFirstOnSuccess="true">
<target type="File" name="FileBackup" fileName="${specialFolder:CommonApplicationData}/Raytheon/logs/${shortdate}/${logger}.log" layout="${longdate} | ${logger} | ${message} ${exception}"/>
<target type="File" name="LocalFileBackup" fileName="${basedir}/logs/${shortdate}/${logger}.log" layout="${longdate} | ${logger} | ${message} ${exception}"/>
</target>
<target name="logDashboard" type="Chainsaw" address="udp://127.0.0.1:7777" />
<target xsi:type="File" name="logFiles" fileName="${specialfolder:folder=CommonApplicationData}/Raytheon/logs/${shortdate}/${logger:fsNormalize=true}.log" layout="${log4jxmlevent}" />
<target xsi:type="File" name="RunFile" filename="${specialfolder:folder=CommonApplicationData}/Raytheon/logs/${shortdate}/_All.log" layout="${log4jxmlevent}" />
<target name="console" type="ColoredConsole" layout="${longdate} | ${logger} | ${message} ${exception}"/>
<target name="blackHole" xsi:type="Null" />
</targets>
<!-- add your logging rules here
Log level (lowest to highest):
1. TRACE
2. DEBUG
3. INFO
4. WARN
5. ERROR
6. FATAL
-->
<rules>
<!-- Enable/Disable log level here
To Disable a log level, set "enable" attribute to true
To Enable a log level, set "enable" attribute to false -->
<logger levels="Trace" name="*" writeTo="blackHole" final="true" enabled="false" />
<logger levels="Info" name="*" writeTo="blackHole" final="true" enabled="false" />
<logger levels="Debug" name="*" writeTo="blackHole" final="true" enabled="false" />
<!-- ======================================= -->
<logger name="*" minlevel="Trace" writeTo="RunFile,console,LogDashboard" />
</rules>
</nlog>

Binary file not shown.

View File

@@ -0,0 +1,85 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(SolutionDir)App.props" />
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<OutputType>Winexe</OutputType>
<AssemblyName>GenericWpfApp</AssemblyName>
<UseWPF>true</UseWPF>
<Description>---</Description>
<Company>Raytheonn Technologies</Company>
<Product>Generic WPF App</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>2.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\green-check-mark.png" />
<None Remove="Resources\Images\red-cross-mark.png" />
<None Remove="Resources\Images\Title_Bar_Buttons\Thumbs.db" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
<PackageReference Include="NLog" Version="5.0.0" />
</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="CommonLib">
<HintPath>Dependencies\CommonLib.dll</HintPath>
</Reference>
<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\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" />
</ItemGroup>
<Target Name="CopyFiles" AfterTargets="AfterBuild">
<ItemGroup>
<FILES_1 Include="Dependencies\*.*" />
<FILES_2 Include="Config\*.*" />
</ItemGroup>
<Copy SourceFiles="@(FILES_1)" DestinationFolder="$(OutDir)" />
<Copy SourceFiles="@(FILES_2)" DestinationFolder="$(OutDir)" />
</Target>
<Target Name="ProjClean" AfterTargets="AfterClean">
<RemoveDir Directories="$(OutDir)Resources" />
<Delete Files="$(OutDir)config.ini" />
<Delete Files="$(OutDir)NLog.config" />
<Delete Files="$(OutDir)NLogWrapper.Part.dll" />
</Target>
</Project>

View File

@@ -0,0 +1,642 @@
<Window x:Class="GenericWpfApp.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:GenericWpfApp"
mc:Ignorable="d"
Title="Missile Test Set"
WindowStyle="None"
ResizeMode="CanResizeWithGrip"
MouseLeftButtonDown="Window_MouseLeftButtonDown"
Height="572"
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="/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="/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="/Resources/Images/missile.png" Width="20" Height="20" Margin="10,0,10,0" MouseDown="imgAppIcon_MouseDown"/>
<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="/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="/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="/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="Scripting" Background="Transparent" Height="22">
<MenuItem Header="Run Script"/>
<MenuItem Header="Run Single Action"/>
<MenuItem Header="Create Script"/>
</MenuItem>
<MenuItem 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="3*" />
<RowDefinition Height="7*" />
</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="*" />
</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="*" />
<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>
<Button Grid.Row="3" Grid.ColumnSpan="4" Name="btnPower" Width="80" Height="25" Click="btnPower_Click">Power On</Button>
</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="*" />
</Grid.RowDefinitions>
<Label Grid.ColumnSpan="2" FontSize="14" FontWeight="Bold" Foreground="White" Content="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="/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="/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>
<!-- 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" 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>

View File

@@ -0,0 +1,91 @@
using GenericWpfApp.Model;
using GenericWpfApp.View;
using GenericWpfApp.ViewModel;
using NLog;
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;
namespace GenericWpfApp
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private ILogger _logger;
public MainWindowViewModel _mainWindowViewModel;
public ImpedanceCheckWindow _impedanceCheckWindow;
public MainWindow()
{
InitializeComponent();
_logger = LogManager.GetCurrentClassLogger();
string version = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion; //0.1.0
this.txtBlockAppTitle.Text += $" [Version: {version}]";
_mainWindowViewModel = new MainWindowViewModel();
DataContext = _mainWindowViewModel;
PassthroughData._s_datagridColumnCount = datagridPassthroughData.Columns.Count;
WinProc.Instance(this);
}
private void btnClose_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
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();
}
private void imgAppIcon_MouseDown(object sender, MouseButtonEventArgs e)
{
// simulate ALT+SPACE press
CommonLib.Runtime.InteropServices.Win32Helpers.Simulate_2_Key_Press(CommonLib.Runtime.InteropServices.Win32Helpers.VK.MENU, (char)CommonLib.Runtime.InteropServices.Win32Helpers.VK.SPACE);
}
private void btnPower_Click(object sender, RoutedEventArgs e)
{
_impedanceCheckWindow = new ImpedanceCheckWindow();
_impedanceCheckWindow.ShowDialog();
WinProc.Instance().StartPowerSupplyReadTask();
}
}
}

View File

@@ -0,0 +1,13 @@
using CommunityToolkit.Mvvm.ComponentModel;
namespace GenericWpfApp.Model
{
public partial class ImpedanceDataModel : ObservableObject
{
[ObservableProperty]
private string passFailImagePath;
[ObservableProperty]
private string description;
}
}

View File

@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GenericWpfApp.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" },
};
}
}

View File

@@ -0,0 +1,64 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GenericWpfApp.Model
{
public partial class PassthroughData
{
public static int _s_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()
{
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 == _s_datagridColumnCount)
{
dictIndex++;
_rowNumberToPassthroughDataDict[dictIndex] = new ObservableCollection<string>(new string[_s_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)
{
App.Current.Dispatcher.Invoke((Action)delegate
{
_rowNumberToPassthroughDataDict[_variableEnumToVariableInfoDict[variableName].passthroughDataModelDictIndex][_variableEnumToVariableInfoDict[variableName].passthroughDataModelItemIndex] = _variableEnumToDescriptionDict[variableName];
_rowNumberToPassthroughDataDict[_variableEnumToVariableInfoDict[variableName].passthroughDataModelDictIndex][_variableEnumToVariableInfoDict[variableName].passthroughDataModelItemIndex + 1] = val;
});
}
}
}

View File

@@ -0,0 +1,17 @@
using CommunityToolkit.Mvvm.ComponentModel;
namespace GenericWpfApp.Model
{
public partial class PowerModuleDataModel : ObservableObject
{
[ObservableProperty]
private string expectedVoltage;
[ObservableProperty]
private string actualVoltage;
[ObservableProperty]
private string expectedCurrent;
[ObservableProperty]
private string actualCurrent;
}
}

View 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 GenericWpfApp.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;
}
}
}
}

View 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>

View 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 GenericWpfApp.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;
}
}
}
}

View 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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,83 @@
<Window x:Class="GenericWpfApp.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:GenericWpfApp.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="/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="/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 Style="{StaticResource TitleBarCloseButtonStyle}" x:Name="btnClose" Width="44" Background="Transparent" BorderBrush="Transparent" Click="btnClose_Click">
<Image Source="/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>

View File

@@ -0,0 +1,58 @@
using GenericWpfApp.ViewModel;
using System;
using System.Collections.Specialized;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace GenericWpfApp.View
{
/// <summary>
/// Interaction logic for ImpedanceCheckWindow.xaml
/// </summary>
public partial class ImpedanceCheckWindow : Window
{
private ImpedanceCheckWindowViewModel _viewModel;
public ImpedanceCheckWindow()
{
InitializeComponent();
WindowStartupLocation = WindowStartupLocation.CenterOwner;
Owner = Application.Current.MainWindow;
btnClose.Visibility = Visibility.Hidden;
((INotifyCollectionChanged)lvImpedanceCheck.Items).CollectionChanged += ListView_CollectionChanged;
_viewModel = new ImpedanceCheckWindowViewModel();
DataContext = _viewModel;
}
protected override void OnContentRendered(EventArgs e)
{
base.OnContentRendered(e);
WinProc.Instance().PerformStto(_viewModel);
}
private void Window_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
DragMove();
}
private void btnClose_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void ListView_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Add)
{
// scroll the new item into view
lvImpedanceCheck.ScrollIntoView(e.NewItems[0]);
}
}
}
}

View File

@@ -0,0 +1,41 @@
using CommunityToolkit.Mvvm.ComponentModel;
using GenericWpfApp.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace GenericWpfApp.ViewModel
{
public class ImpedanceCheckWindowViewModel : ObservableObject
{
public enum Images
{
PASS_CHECK,
FAIL_CHECK
}
public Dictionary<Images, string> _imageToResourcePathDict = new Dictionary<Images, string>()
{
{Images.PASS_CHECK, @"/Resources/Images/green-check-mark.png" },
{Images.FAIL_CHECK, @"/Resources/Images/red-cross-mark.png" }
};
#region Data Bindings
public ObservableCollection<ImpedanceDataModel> _listviewImpedanceDatatems { get; set; }
#endregion Data Bindings
public ImpedanceCheckWindowViewModel()
{
_listviewImpedanceDatatems = new ObservableCollection<ImpedanceDataModel>();
}
public void AddData(ImpedanceDataModel item)
{
App.Current.Dispatcher.Invoke((Action)delegate
{
_listviewImpedanceDatatems.Add(item);
});
}
}
}

View File

@@ -0,0 +1,67 @@
using CommunityToolkit.Mvvm.ComponentModel;
using GenericWpfApp.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GenericWpfApp.ViewModel
{
public partial class MainWindowViewModel : ObservableObject
{
public enum Images
{
LED_ON,
LED_OFF
}
public Dictionary<Images, string> _imageToResourcePathDict = new Dictionary<Images, string>()
{
{Images.LED_ON, @"/Resources/Images/green-led.png" },
{Images.LED_OFF, @"/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()
{
_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)
{
foreach (var item in rowNumberToPassthroughDataDict)
{
_dataGridPassthroughDatatems.Add(item.Value);
}
}
}
}

View File

@@ -0,0 +1,175 @@
using GenericWpfApp.Model;
using GenericWpfApp.View;
using GenericWpfApp.ViewModel;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
namespace GenericWpfApp
{
class WinProc
{
private static WinProc _proc = null;
MainWindow _mainWindow;
private ImpedanceCheckWindowViewModel _impedanceCheckWindowViewModel;
private PassthroughData _passthroughData = new PassthroughData();
private Dictionary<string, PowerModuleDataModel> _powerModuleToPowerDataModelDict = new Dictionary<string, PowerModuleDataModel>();
public static WinProc Instance(MainWindow mainWindow = null)
{
if (_proc == null)
_proc = new WinProc(mainWindow);
return _proc;
}
private WinProc(MainWindow mainWindow)
{
_mainWindow = mainWindow;
_powerModuleToPowerDataModelDict["UUT_P20V"] = new PowerModuleDataModel();
_powerModuleToPowerDataModelDict["UUT_N20V"] = new PowerModuleDataModel();
_mainWindow._mainWindowViewModel.AddPowerData(_powerModuleToPowerDataModelDict);
_mainWindow._mainWindowViewModel.AddPassthroughData(_passthroughData.GetPassthroughDataModelDict());
}
public void PerformStto(ImpedanceCheckWindowViewModel impedanceCheckWindowViewModel)
{
_impedanceCheckWindowViewModel = impedanceCheckWindowViewModel;
Task.Factory.StartNew(() => PerformSttoTask());
}
private async void PerformSttoTask()
{
bool forceFail = false;
ImpedanceDataModel impedanceDataModel;
ImpedanceCheckWindowViewModel.Images passFailImage = ImpedanceCheckWindowViewModel.Images.PASS_CHECK;
int MAX_ITERATION = 15;
for (int i = 1; i <= MAX_ITERATION; i++)
{
impedanceDataModel = new ImpedanceDataModel();
if (i == MAX_ITERATION && forceFail)
passFailImage = ImpedanceCheckWindowViewModel.Images.FAIL_CHECK;
impedanceDataModel.PassFailImagePath = _impedanceCheckWindowViewModel._imageToResourcePathDict[passFailImage];
impedanceDataModel.Description = "J17_P5_J17_P7 Measured 5 Range [0,10]";
_impedanceCheckWindowViewModel.AddData(impedanceDataModel);
await Task.Delay(300);
}
if (forceFail)
{
App.Current.Dispatcher.Invoke((Action)delegate
{
_mainWindow._impedanceCheckWindow.btnClose.Visibility = Visibility.Visible;
});
}
else
{
App.Current.Dispatcher.Invoke((Action)delegate
{
_mainWindow._impedanceCheckWindow.Close();
});
}
}
public void StartPowerSupplyReadTask()
{
Task.Factory.StartNew(() => PowerSupplyReadTask());
}
private async void PowerSupplyReadTask()
{
//Debug.Write($"{System.Environment.CurrentManagedThreadId}");
Random rnd = new Random();
while (true)
{
rnd = new Random();
float num = 20.0f + GenerateRandomFraction();
_powerModuleToPowerDataModelDict["UUT_P20V"].ActualVoltage = num.ToString("0.00");
_powerModuleToPowerDataModelDict["UUT_P20V"].ExpectedVoltage = "20.0";
//Thread.Sleep(100);
await Task.Delay(100);
//Debug.WriteLine($"{System.Environment.CurrentManagedThreadId}");
num = 1.0f + GenerateRandomFraction();
_powerModuleToPowerDataModelDict["UUT_P20V"].ActualCurrent = num.ToString("0.00");
_powerModuleToPowerDataModelDict["UUT_P20V"].ExpectedCurrent = "1.0";
//Thread.Sleep(100);
await Task.Delay(100);
//Debug.WriteLine($"{System.Environment.CurrentManagedThreadId}");
num = 20.0f + GenerateRandomFraction();
_powerModuleToPowerDataModelDict["UUT_N20V"].ActualVoltage = num.ToString("0.00");
_powerModuleToPowerDataModelDict["UUT_N20V"].ExpectedVoltage = "20.0";
//Thread.Sleep(200);
await Task.Delay(200);
//Debug.WriteLine($"{System.Environment.CurrentManagedThreadId}");
_mainWindow._mainWindowViewModel.UutPowerLedImagePath = _mainWindow._mainWindowViewModel._imageToResourcePathDict[MainWindowViewModel.Images.LED_ON];
num = 5.0f + GenerateRandomFraction();
_powerModuleToPowerDataModelDict["UUT_N20V"].ActualCurrent = num.ToString("0.00");
_powerModuleToPowerDataModelDict["UUT_N20V"].ExpectedCurrent = "1.0";
//Thread.Sleep(100);
await Task.Delay(100);
//Debug.WriteLine($"{System.Environment.CurrentManagedThreadId}");
num = 70.0f + GenerateRandomFraction();
_passthroughData.SetValue(PassthroughData.Variables.VAR1, num.ToString("0.00"));
//Thread.Sleep(100);
await Task.Delay(100);
//Debug.WriteLine($"{System.Environment.CurrentManagedThreadId}");
num = 30.0f + GenerateRandomFraction();
_passthroughData.SetValue(PassthroughData.Variables.VAR2, num.ToString("0.00"));
//Thread.Sleep(200);
await Task.Delay(200);
//Debug.WriteLine($"{System.Environment.CurrentManagedThreadId}");
_mainWindow._mainWindowViewModel.UutPowerLedImagePath = _mainWindow._mainWindowViewModel._imageToResourcePathDict[MainWindowViewModel.Images.LED_OFF];
num = 40.0f + GenerateRandomFraction();
_passthroughData.SetValue(PassthroughData.Variables.VAR3, num.ToString("0.00"));
//Thread.Sleep(100);
await Task.Delay(100);
num = 50.0f + GenerateRandomFraction();
_passthroughData.SetValue(PassthroughData.Variables.VAR4, num.ToString("0.00"));
//Thread.Sleep(100);
await Task.Delay(100);
num = 60.0f + GenerateRandomFraction();
_passthroughData.SetValue(PassthroughData.Variables.VAR5, num.ToString("0.00"));
//Thread.Sleep(200);
await Task.Delay(200);
_mainWindow._mainWindowViewModel.UutPowerLedImagePath = _mainWindow._mainWindowViewModel._imageToResourcePathDict[MainWindowViewModel.Images.LED_ON];
num = 10.0f + GenerateRandomFraction();
_passthroughData.SetValue(PassthroughData.Variables.VAR6, num.ToString("0.00"));
//Thread.Sleep(1000);
await Task.Delay(1000);
_mainWindow._mainWindowViewModel.UutPowerLedImagePath = _mainWindow._mainWindowViewModel._imageToResourcePathDict[MainWindowViewModel.Images.LED_OFF];
}
}
static float GenerateRandomFraction()
{
Random rnd = new Random();
int randNum = 0;
const int minimum = 1;
randNum = rnd.Next(20);
if (randNum <= minimum)
{
randNum += minimum;
}
return (float)(1.0 / (float)randNum);
}
}
}

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<clear />
<!-- Add nuget source under here -->
<!-- A place to publish our packages locally within the solution for testing purposes -->
<!-- This source should at the top of all other sources, if there are conflicts with other sources, nuget packages will be pulled from the local source -->
<!-- <add key="SolutionLocalSource" value=".\Nuget\SolutionPackages" /> -->
<!--<add key="Nuget.org" value="https://api.nuget.org/v3/index.json" /> -->
<add key="NugetOrgLocalSource" value=".\Nuget\NugetOrg" />
<add key="TSRealNugetLocalSource" value=".\Nuget\TSRealPackages" />
<!--<add key="TSRealNuget_Dev" value="https://tfs.rms.ray.com/CommonProducts/TSReal/_packaging/TSRealNuget_Dev/nuget/v3/index.json" />-->
</packageSources>
<config>
<!-- cached nuget packages and DLL will be saved in this solution rather than in C:\Users\[username]\.nuget\packages -->
<add key="globalPackagesFolder" value=".\Nuget\cache" />
</config>
</configuration>