aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Project/Widgets/Blower/BlowerWidgetView.xaml
blob: a23307bc29513b20aa99498be29125ba3f4afd75 (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
<UserControl x:Class="Tango.FSE.Diagnostics.Project.Widgets.Blower.BlowerWidgetView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:visuals="clr-namespace:Tango.Visuals;assembly=Tango.Visuals"
             xmlns:local="clr-namespace:Tango.FSE.Diagnostics.Project.Widgets.Blower"
             mc:Ignorable="d" 
             d:DesignHeight="150" d:DesignWidth="352" d:DataContext="{d:DesignInstance Type=local:BlowerWidget,IsDesignTimeCreatable=False}">
    <Grid>
        <Viewbox Stretch="Uniform">
            <Border Width="352" Height="148" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}" CornerRadius="5" BorderThickness="1" BorderBrush="#434343" Padding="5">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="1*"/>
                    </Grid.RowDefinitions>

                    <TextBlock Margin="10 5 0 0" FontFamily="{StaticResource digital-7}" Text="Blower Controller" FontSize="16" Foreground="#7CC924" HorizontalAlignment="Left" Width="123"></TextBlock>

                    <Grid Grid.Row="1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="19*"/>
                            <ColumnDefinition Width="39*"/>
                            <ColumnDefinition Width="27*"/>
                        </Grid.ColumnDefinitions>

                        <visuals:AnalogSwitch Margin="10" HorizontalAlignment="Left" Cursor="Hand" RenderTransformOrigin="0.5,0.5"  IsChecked="{Binding IsActive,Mode=TwoWay}">

                        </visuals:AnalogSwitch>

                        <Grid Grid.Column="1">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="66*"/>
                                <RowDefinition Height="47*"/>
                            </Grid.RowDefinitions>
                            <Border Background="{StaticResource FSE_PrimaryBackgroundMidBrush}" Margin="8" CornerRadius="3" Padding="5">
                                <Grid>
                                    <TextBlock Text="{Binding Voltage,StringFormat='0.0',FallbackValue='0.0'}"  VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="44" FontFamily="{StaticResource digital-7}" Foreground="#FF6F78" Margin="0 0 16 0"/>
                                    <TextBlock ToolTip="Setting Value" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="9" Foreground="Gainsboro">MV</TextBlock>
                                </Grid>
                            </Border>

                            <Border Background="{StaticResource FSE_PrimaryBackgroundMidBrush}" Margin="8 0 8 8" CornerRadius="3" Padding="5" Grid.Row="1">
                                <Grid >
                                    <mahapps:NumericUpDown Style="{x:Null}" InterceptMouseWheel="True" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HorizontalContentAlignment="Left" HideUpDownButtons="True" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" HasDecimals="True" Minimum="0" Maximum="10000" Padding="0" Value="{Binding SetPoint,FallbackValue='0.0',Mode=TwoWay}"  VerticalAlignment="Center" FontSize="30" FontFamily="{StaticResource digital-7}" Foreground="#FFD400" Margin="0 0 16 0">
                                        <mahapps:NumericUpDown.Resources>
                                            <Style TargetType="TextBox">
                                                <Setter Property="CaretBrush" Value="#FFD400"></Setter>
                                                <Setter Property="SelectionBrush" Value="#50FFD400"></Setter>
                                            </Style>
                                        </mahapps:NumericUpDown.Resources>
                                    </mahapps:NumericUpDown>
                                    <TextBlock ToolTip="Setting Value" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="9" Foreground="Gainsboro">SV</TextBlock>
                                </Grid>
                            </Border>
                        </Grid>


                        <Button FocusVisualStyle="{x:Null}" Grid.Column="2" Style="{x:Null}" Width="80" Height="80" HorizontalAlignment="Center" Cursor="Hand" Command="{Binding SetCommand}">
                            <Button.Template>
                                <ControlTemplate TargetType="Button">
                                    <Grid>
                                        <Ellipse Stroke="#7C7C7C" Fill="#383838"></Ellipse>
                                        <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Gainsboro" FontSize="16" FontWeight="SemiBold">SET</TextBlock>
                                    </Grid>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsPressed" Value="True">
                                            <Setter Property="Opacity" Value="0.7"></Setter>
                                        </Trigger>
                                        <Trigger Property="IsEnabled" Value="False">
                                            <Setter Property="Opacity" Value="0.5"></Setter>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Button.Template>
                        </Button>
                    </Grid>
                </Grid>
            </Border>
        </Viewbox>
    </Grid>
</UserControl>