aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Views/ProcedureRunnerExecutionView.xaml
blob: 5c87abec536c7a7e75ac22d61c48981ebe7f6d91 (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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<UserControl x:Class="Tango.FSE.Procedures.Views.ProcedureRunnerExecutionView"
             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:global="clr-namespace:Tango.FSE.Procedures"
             xmlns:vm="clr-namespace:Tango.FSE.Procedures.ViewModels"
             xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common"
             xmlns:graphs="clr-namespace:Tango.FSE.Common.Graphs;assembly=Tango.FSE.Common"
             xmlns:local="clr-namespace:Tango.FSE.Procedures.Views"
             mc:Ignorable="d" 
             d:DesignHeight="720" d:DesignWidth="1280" d:DesignStyle="{StaticResource FSE_User_Control_Designer}" d:DataContext="{d:DesignInstance Type=vm:ProcedureRunnerViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.ProcedureRunnerViewVM}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}">

    <Grid>
        <Ellipse Fill="{StaticResource FSE_PrimaryBackgroundDarkBrush}" Opacity="0.7" Width="2050" Margin="-1500 -500 0 -500" />
        <Grid Margin="10">
            <DockPanel>
                <Grid Margin="20 20 0 0" Height="100" VerticalAlignment="Top" DockPanel.Dock="Top">
                    <DockPanel>
                        <Grid>
                            <Image Margin="0 10 0 0" Source="../Images/project.png" Stretch="None" VerticalAlignment="Top" RenderOptions.BitmapScalingMode="Fant" />
                            <material:PackIcon Margin="0 0 -15 15" Kind="Play" Foreground="{StaticResource FSE_GreenBrush}" Width="48" Height="48" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
                        </Grid>
                        <StackPanel Margin="20 0 0 0">
                            <TextBlock FontSize="{StaticResource FSE_ModuleHeaderFontSize}" Foreground="{StaticResource FSE_PrimaryAccentBrush}" Text="{Binding RunningProcedureProject.Name}"></TextBlock>
                            <TextBlock Margin="0 5 0 0" Foreground="{StaticResource FSE_GrayBrush}" LineHeight="18" Text="{Binding RunningProcedureProject.Description}"></TextBlock>
                        </StackPanel>
                    </DockPanel>
                </Grid>
                <Grid Margin="105 0 0 0">
                    <ScrollViewer HorizontalScrollBarVisibility="Disabled">
                        <StackPanel>
                            <StackPanel>
                                <StackPanel IsEnabled="{Binding ProjectRunner.CanRun}" Margin="0 40 0 0" Visibility="{Binding HasProcedureInputs,Converter={StaticResource BooleanToVisibilityConverter},FallbackValue='Visible',TargetNullValue='Visible'}">
                                    <TextBlock FontSize="{StaticResource FSE_LargeFontSize}" FontWeight="SemiBold" Foreground="{StaticResource FSE_PrimaryAccentBrush}">Inputs</TextBlock>
                                    <!--<Rectangle Margin="0 2 0 0" Stroke="{StaticResource FSE_BorderBrush}" StrokeDashArray="5" />-->
                                    <TextBlock Margin="0 5 0 0" Foreground="{StaticResource FSE_GrayBrush}" Text="Please provide the necessary inputs or leave as defaults."></TextBlock>

                                    <ItemsControl Margin="0 10 0 0" ItemsSource="{Binding RunningProcedureProject.Inputs}">
                                        <ItemsControl.ItemTemplate>
                                            <DataTemplate>
                                                <DockPanel Margin="0 10 20 10">
                                                    <material:PackIcon VerticalAlignment="Center" Kind="Pen" Width="32" Height="32" />
                                                    <StackPanel Margin="10 0 0 0">
                                                        <TextBlock FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding DisplayName,FallbackValue='N/A'}"></TextBlock>
                                                        <StackPanel Orientation="Horizontal">
                                                            <ContentControl Content="{Binding}" HorizontalAlignment="Left" Width="250" Margin="0 2 0 0">
                                                                <ContentControl.Style>
                                                                    <Style TargetType="ContentControl">
                                                                        <Setter Property="ContentTemplate">
                                                                            <Setter.Value>
                                                                                <DataTemplate>
                                                                                    <TextBox Style="{StaticResource FSE_Rounded_Corners_TextBox}" Padding="5" Text="{Binding Value,UpdateSourceTrigger=PropertyChanged}"></TextBox>
                                                                                </DataTemplate>
                                                                            </Setter.Value>
                                                                        </Setter>
                                                                        <Style.Triggers>
                                                                            <DataTrigger Binding="{Binding Type}" Value="Selection">
                                                                                <Setter Property="ContentTemplate">
                                                                                    <Setter.Value>
                                                                                        <DataTemplate>
                                                                                            <controls:FSERoundedCornersComboBox Height="29" ItemsSource="{Binding SelectionInputs}" SelectedValue="{Binding Value}" SelectedValuePath="Value" DisplayMemberPath="Name"/>
                                                                                        </DataTemplate>
                                                                                    </Setter.Value>
                                                                                </Setter>
                                                                            </DataTrigger>
                                                                            <DataTrigger Binding="{Binding Type}" Value="Boolean">
                                                                                <Setter Property="ContentTemplate">
                                                                                    <Setter.Value>
                                                                                        <DataTemplate>
                                                                                            <DockPanel>
                                                                                                <ToggleButton x:Name="chkInput" Cursor="Hand" IsChecked="{Binding Value}" FocusVisualStyle="{x:Null}" HorizontalAlignment="Left" />
                                                                                                <Rectangle VerticalAlignment="Center" Margin="10 0 0 0">
                                                                                                    <Rectangle.Style>
                                                                                                        <Style TargetType="Rectangle">
                                                                                                            <Setter Property="Stroke" Value="{StaticResource FSE_BorderBrush}">
                                                                                                            </Setter>
                                                                                                            <Style.Triggers>
                                                                                                                <DataTrigger Binding="{Binding ElementName=chkInput,Path=IsChecked}" Value="True">
                                                                                                                    <Setter Property="Stroke" Value="{StaticResource FSE_PrimaryAccentBrush}"></Setter>
                                                                                                                </DataTrigger>
                                                                                                            </Style.Triggers>
                                                                                                        </Style>
                                                                                                    </Rectangle.Style>
                                                                                                </Rectangle>
                                                                                            </DockPanel>
                                                                                        </DataTemplate>
                                                                                    </Setter.Value>
                                                                                </Setter>
                                                                            </DataTrigger>
                                                                        </Style.Triggers>
                                                                    </Style>
                                                                </ContentControl.Style>
                                                            </ContentControl>
                                                            <material:PackIcon VerticalAlignment="Center" Margin="20 0 0 0" Foreground="{StaticResource FSE_GrayBrush}" Kind="InfoCircleOutline" />
                                                            <TextBlock Margin="5 0 0 0" FontSize="{StaticResource FSE_SmallFontSize}" VerticalAlignment="Center" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding Description,FallbackValue='No description provided'}"></TextBlock>
                                                        </StackPanel>
                                                    </StackPanel>
                                                </DockPanel>
                                            </DataTemplate>
                                        </ItemsControl.ItemTemplate>
                                    </ItemsControl>
                                </StackPanel>

                                <StackPanel HorizontalAlignment="Left" Width="1050" Margin="0 20 0 0">
                                    <DockPanel>
                                        <Grid Margin="20 0 0 0" DockPanel.Dock="Right" >
                                            <Button material:ButtonAssist.CornerRadius="25" Command="{Binding StartProjectCommand}" Visibility="{Binding ProjectRunner.IsRunning,Converter={StaticResource BooleanToVisibilityInverseConverter}}" IsEnabled="{Binding ProjectRunner.CanRun}" Style="{StaticResource FSE_RaisedButton_Dark_Hover}" Width="200" Height="50">
                                                <DockPanel>
                                                    <material:PackIcon Kind="Play" Foreground="{StaticResource FSE_GreenBrush}" Width="24" Height="24" />
                                                    <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">START</TextBlock>
                                                </DockPanel>
                                            </Button>
                                            <Button material:ButtonAssist.CornerRadius="25" Command="{Binding StopProjectCommand}" Visibility="{Binding ProjectRunner.IsRunning,Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource FSE_RaisedButton_Dark_Hover}" Width="200" Height="50">
                                                <DockPanel>
                                                    <material:PackIcon Kind="Stop" Foreground="{StaticResource FSE_RedBrush}" Width="24" Height="24" />
                                                    <TextBlock Margin="10 0 0 0" VerticalAlignment="Center">STOP</TextBlock>
                                                </DockPanel>
                                            </Button>
                                        </Grid>
                                        <StackPanel VerticalAlignment="Bottom">
                                            <TextBlock Text="{Binding Status}"></TextBlock>
                                            <ProgressBar Margin="0 5 0 0" Height="10" IsIndeterminate="{Binding ProcedureProgress.IsIndeterminate}" Minimum="0" Maximum="{Binding ProcedureProgress.Maximum}" Value="{Binding ProcedureProgress.Value}" />
                                            <TextBlock Margin="0 5 0 0" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding ProcedureProgress.Message}"></TextBlock>
                                        </StackPanel>
                                    </DockPanel>
                                </StackPanel>
                            </StackPanel>
                            <StackPanel Margin="0 100 0 0" HorizontalAlignment="Left" Visibility="{Binding ProjectRunner.State,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='Failed'}">
                                <TextBlock FontSize="{StaticResource FSE_LargeFontSize}" FontWeight="SemiBold" Foreground="{StaticResource FSE_RedBrush}">Procedure Failed</TextBlock>
                                <TextBlock Margin="0 20 0 0">The procedure has failed to complete with the following error:</TextBlock>
                                <TextBlock Text="{Binding FailedError}" Margin="0 5 0 0" FontSize="{StaticResource FSE_SmallFontSize}" Foreground="{StaticResource FSE_GrayBrush}" TextWrapping="Wrap"></TextBlock>
                            </StackPanel>
                            <StackPanel>
                                <StackPanel.Style>
                                    <Style TargetType="StackPanel">
                                        <Setter Property="Opacity" Value="0"></Setter>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding ProjectRunner.State}" Value="Completed">
                                                <DataTrigger.EnterActions>
                                                    <BeginStoryboard>
                                                        <Storyboard>
                                                            <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.5" />
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </DataTrigger.EnterActions>
                                                <DataTrigger.ExitActions>
                                                    <BeginStoryboard>
                                                        <Storyboard>
                                                            <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:0.5" />
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </DataTrigger.ExitActions>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </StackPanel.Style>
                                <StackPanel Margin="0 100 0 0" HorizontalAlignment="Left" Width="1050">
                                    <TextBlock FontSize="{StaticResource FSE_LargeFontSize}" FontWeight="SemiBold" Foreground="{StaticResource FSE_PrimaryAccentBrush}">Results</TextBlock>
                                    <!--<Rectangle Margin="0 2 0 0" Stroke="{StaticResource FSE_BorderBrush}" StrokeDashArray="5" />-->
                                </StackPanel>
                                <Grid HorizontalAlignment="Left" Margin="0 20 0 0">
                                    <local:ResultsView DataContext="{Binding ResultsViewVM}" />
                                </Grid>
                            </StackPanel>
                        </StackPanel>
                    </ScrollViewer>
                </Grid>
            </DockPanel>
        </Grid>
    </Grid>
</UserControl>