aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
blob: 0879fcaab22f12d6cdcd74f9cbfdcb1af5fa8afa (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<UserControl x:Class="Tango.PPC.UI.Views.MachineStatusView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
             xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels"
             xmlns:locaControls="clr-namespace:Tango.PPC.UI.Controls"
             xmlns:global="clr-namespace:Tango.PPC.UI"
             xmlns:local="clr-namespace:Tango.PPC.UI.Views"
             mc:Ignorable="d" 
             d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MachineStatusViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineStatusViewVM}">
    <Grid Background="{StaticResource TangoMidBackgroundBrush}">
        <DockPanel>
            <Grid Panel.ZIndex="100" DockPanel.Dock="Top" Height="117" Background="{StaticResource TangoPrimaryBackgroundBrush}">
                <Grid.Effect>
                    <DropShadowEffect Color="Silver" ShadowDepth="0"  BlurRadius="20" Opacity="1" />
                </Grid.Effect>

                <Grid HorizontalAlignment="Right" Margin="0 0 20 0">
                    <StackPanel Orientation="Horizontal">
                        <Grid>
                            <StackPanel x:Name="techPressElement" VerticalAlignment="Center" Background="Transparent">
                                <locaControls:MachineStatusControl HorizontalAlignment="Center" DataContext="{Binding MachineProvider.MachineOperator}" />
                                <TextBlock Margin="0 10 0 0" FontSize="{StaticResource TangoSmallFontSize}" Text="{Binding MachineProvider.MachineOperator.Status,Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>
                            </StackPanel>

                            <Grid IsHitTestVisible="False" HorizontalAlignment="Center">
                                <Grid.Style>
                                    <Style TargetType="Grid">
                                        <Setter Property="Visibility" Value="Hidden"></Setter>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding MachineProvider.MachineOperator.MachineStatus.AutoInkFillingEnabled}" Value="True">
                                                <Setter Property="Visibility" Value="Visible"></Setter>
                                            </DataTrigger>
                                            <DataTrigger Binding="{Binding MachineProvider.MachineOperator.IsConnected}" Value="False">
                                                <Setter Property="Visibility" Value="Hidden"></Setter>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Grid.Style>
                            </Grid>
                        </Grid>
                    </StackPanel>
                </Grid>
            </Grid>

            <Grid Background="{StaticResource TangoMidBackgroundBrush}">
                <StackPanel VerticalAlignment="Center">
                    <Grid>

                        <touch:TouchRingProgress Width="364" Height="364" RingThickness="10">
                            <touch:TouchRingProgress.Style>
                                <Style TargetType="touch:TouchRingProgress">
                                    <Setter Property="Visibility" Value="Visible"></Setter>
                                    <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
                                    <Setter Property="Maximum" Value="{Binding RunningJobStatus.TotalProgressMinusSettingUp}"></Setter>
                                    <Setter Property="Value" Value="{Binding RunningJobStatus.ProgressMinusSettingUp}"></Setter>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding RunningJobStatus.IsSettingUp}" Value="False">
                                            <Setter Property="Visibility" Value="Visible"></Setter>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding RunningJobStatus.IsCompleted}" Value="True">
                                            <Setter Property="Maximum" Value="100"></Setter>
                                            <Setter Property="Value" Value="99.9999999"></Setter>
                                            <Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"></Setter>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding RunningJobStatus.IsCanceled}" Value="True">
                                            <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding RunningJobStatus.IsFailed}" Value="True">
                                            <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </touch:TouchRingProgress.Style>
                        </touch:TouchRingProgress>

                        <touch:TouchBusyIndicator Width="360" Height="360" StrokeThickness="10" Maximum="100" Visibility="{Binding RunningJobStatus.IsSettingUp,Converter={StaticResource BooleanToVisibilityConverter}}">
                            <touch:TouchBusyIndicator.Style>
                                <Style TargetType="touch:TouchBusyIndicator">
                                    <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
                                    <Setter Property="Value" Value="0"></Setter>
                                    <Setter Property="IsIndeterminate" Value="False"></Setter>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding RunningJobStatus.IsSettingUp}" Value="True">
                                            <Setter Property="Visibility" Value="Visible"></Setter>
                                            <Setter Property="Value" Value="0"></Setter>
                                            <Setter Property="IsIndeterminate" Value="True"></Setter>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding RunningJobStatus.IsCompleted}" Value="True">
                                            <Setter Property="IsIndeterminate" Value="False"></Setter>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding RunningJobStatus.IsCanceled}" Value="True">
                                            <Setter Property="Value" Value="99.9999999"></Setter>
                                            <Setter Property="IsIndeterminate" Value="False"></Setter>
                                            <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding RunningJobStatus.IsFailed}" Value="True">
                                            <Setter Property="Value" Value="99.9999999"></Setter>
                                            <Setter Property="IsIndeterminate" Value="False"></Setter>
                                            <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </touch:TouchBusyIndicator.Style>
                        </touch:TouchBusyIndicator>

                        <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">

                            <StackPanel Visibility="{Binding RunningJobStatus.IsSettingUp,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                    <Image Source="../Images/JobProgressView/drop.png" Stretch="None" />
                                    <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Completed</TextBlock>
                                </StackPanel>

                                <TextBlock FontWeight="Light" FontSize="{StaticResource TangoLargeFontSize}" Margin="0 10 0 0" HorizontalAlignment="Center">
                                            <Run Text="{Binding RunningJobStatus.ProgressMinusSettingUp,StringFormat=0,FallbackValue=0}"></Run><Run Text="/" /><Run Text="{Binding RunningJobStatus.TotalProgressMinusSettingUp,StringFormat=0,FallbackValue=0}"/>
                                            <Run FontSize="16">m</Run>
                                </TextBlock>
                            </StackPanel>

                            <StackPanel Height="90" Visibility="{Binding RunningJobStatus.IsSettingUp,Converter={StaticResource BooleanToVisibilityConverter}}">
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                    <Image Source="../Images/JobProgressView/drop.png" Stretch="None" />
                                    <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Getting Ready...</TextBlock>
                                </StackPanel>
                            </StackPanel>

                            <Rectangle Margin="0 10 0 0" Width="250" Stroke="{StaticResource TangoDividerBrush}" />

                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 15 0 0">
                                <Image Source="../Images/JobProgressView/clock.png" Stretch="None" />
                                <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Time Left</TextBlock>
                            </StackPanel>

                            <TextBlock FontWeight="Light" FontSize="{StaticResource TangoLargeFontSize}" Margin="0 10 0 0" HorizontalAlignment="Center">
                        <Run Text="{Binding RunningJobStatus.RemainingTime,Converter={StaticResource TimeSpanToTwoDigitsTimeConverter},FallbackValue=5}"></Run>
                        <Run FontSize="16" Text="{Binding RunningJobStatus.RemainingTime,Converter={StaticResource TimeSpanToLabelConverter},FallbackValue=min}"></Run>
                            </TextBlock>
                        </StackPanel>
                    </Grid>

                    <touch:TouchButton Content="STOP" Margin="0 20 0 0" Height="60" Width="160" CornerRadius="30" BlurRadius="20" Command="{Binding StopCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.IsPrinting}"></touch:TouchButton>
                </StackPanel>
            </Grid>
        </DockPanel>
    </Grid>
</UserControl>