aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.DispenserAnalyzer.UI/MainWindow.xaml
blob: 1d4b2e431f17c195b0fd6038ebc978551c9dd77e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<Window x:Class="Tango.DispenserAnalyzer.UI.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:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
        xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
        xmlns:local="clr-namespace:Tango.DispenserAnalyzer.UI"
        xmlns:vm ="clr-namespace:Tango.DispenserAnalyzer.UI.ViewModels"
        mc:Ignorable="d"
        Title="Dispenser Analyser" Height="1000" Width="800" WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow" ResizeMode="NoResize" Foreground="#202020" 
        d:DataContext="{d:DesignInstance Type=vm:MainWindowVM, IsDesignTimeCreatable=False}">
    <Window.Resources>
        <converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" />
        <converters:IsNullToVisibilityConverter x:Key="IsNullToVisibilityConverter"/>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="80"/>
            <RowDefinition Height="60"/>
            <RowDefinition Height="2*"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>
        <Grid  Grid.Row="0" Margin="20 20 20 20">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="100"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <TextBox x:Name="tbPath" BorderThickness="1" FontSize="16" VerticalContentAlignment="Center" IsReadOnly="False" Grid.Column="0" Margin="0 0 20 0" Text="{Binding OpenFilePath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" AllowDrop="True" PreviewDrop="TextBlock_PreviewDrop" PreviewDragOver="TextBox_PreviewDragOver" BorderBrush="Silver"></TextBox>
            <Button  Grid.Column="1"  Command="{Binding OpenCSVFileCommand}">Browse</Button>
        </Grid>
        <Button Grid.Row="1" Margin="20 0 20 20" Command="{Binding GenerateCommand}">GENERATE</Button>
        <Grid Grid.Row="2">
            <Border BorderBrush="Silver" Padding="5" BorderThickness="1" CornerRadius="5" Margin="10" Background="#202020">
                <DockPanel>
                    <TextBlock DockPanel.Dock="Top" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" Padding="10" Foreground="Silver" Text="{Binding TestName}"></TextBlock>
                    <lvc:CartesianChart Series="{Binding PressedValuesCollection}" LegendLocation="Bottom" DisableAnimations="True" DataTooltip="{x:Null}" Hoverable="False" >
                        <!--<lvc:CartesianChart.DataTooltip>
                            <lvc:DefaultTooltip BulletSize="20" Background="#7EFFFFFF" Foreground="green"/>
                        </lvc:CartesianChart.DataTooltip>-->
                        <lvc:CartesianChart.AxisX>
                            <lvc:Axis Title="TIME" Foreground="Silver"   Labels="{Binding Labels}">
                                <lvc:Axis.Separator>
                                    <lvc:Separator Stroke="#A5A5A5" Step="{Binding XStep}"/>
                                </lvc:Axis.Separator>
                            </lvc:Axis>
                        </lvc:CartesianChart.AxisX>
                        <lvc:CartesianChart.AxisY>
                            <lvc:Axis Title="PRESSURE" LabelFormatter="{Binding YFormatter}"  MinValue="{Binding From, Mode=TwoWay}" MaxValue="{Binding To, Mode=TwoWay}" Foreground="Silver" FontSize="16" >
                                <lvc:Axis.Separator>
                                    <lvc:Separator Stroke="#B0B0B0" />
                                </lvc:Axis.Separator>
                            </lvc:Axis>
                        </lvc:CartesianChart.AxisY>
                    </lvc:CartesianChart>
                </DockPanel>
            </Border>
        </Grid>
    <Grid Grid.Row="3">
            <Border Visibility="Visible" BorderThickness="1" BorderBrush="Silver" CornerRadius="5" Margin="10">
                <StackPanel Margin="3">
                    <Label  Height="30" Content="RESULT" Background="LightSkyBlue" />
                    <Separator Height="5"/>
                    <!--<Border BorderThickness="1" BorderBrush="Silver" VerticalAlignment="Stretch">-->
                    <Grid Margin="10 0 20 0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1*"></ColumnDefinition>
                            <ColumnDefinition Width="200"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <ItemsControl  Grid.Column="0" ItemsSource="{Binding AnalyzerResult.Properties}">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal" Margin="5">
                                        <TextBlock Margin="5 0 0 0" FontSize="16"><Run Text="{Binding Name}"></Run> <Run Text=" : "></Run><Run Text="{Binding Value,StringFormat=0}"></Run></TextBlock>
                                    </StackPanel>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                        <Border Grid.Column="1" HorizontalAlignment="Stretch" Margin="10 0 0 0" VerticalAlignment="Stretch" Visibility="{Binding AnalyzerResult, Converter={StaticResource IsNullToVisibilityConverter}}">
                            <materialDesign:PackIcon  Kind="{Binding AnalyzerResult.Result, Converter= {StaticResource EnumToDescriptionConverter}}" Width="Auto" Height="Auto"  Foreground="Green" HorizontalContentAlignment="Center" />
                        </Border>
                    </Grid>
                    <!--</Border>-->
                </StackPanel>
            </Border>
        </Grid>

    </Grid>
</Window>