aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/MainView.xaml
blob: aa3623f4b14bb98e58cccbb2c337791c3f7f6396 (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
<UserControl x:Class="Tango.AzureUtils.UI.Views.MainView"
             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:helpers="clr-namespace:Tango.SharedUI.Helpers;assembly=Tango.SharedUI"
             xmlns:vm="clr-namespace:Tango.AzureUtils.UI.ViewModels"
             xmlns:global="clr-namespace:Tango.AzureUtils.UI"
             xmlns:views="clr-namespace:Tango.AzureUtils.UI.Views"
             xmlns:local="clr-namespace:Tango.AzureUtils.UI.Views"
             mc:Ignorable="d" 
             d:DesignHeight="900" 
             d:DesignWidth="1280" 
             d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" 
             DataContext="{x:Static global:ViewModelLocator.MainViewVM}" 
             Background="{StaticResource PrimaryBackgroundBrush}" 
             Foreground="{StaticResource PrimaryForegroundBrush}"
             IsEnabled="{Binding IsFree}">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="100"/>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="70"/>
        </Grid.RowDefinitions>

        <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10 0 0 0" FontSize="50">Azure Utils</TextBlock>

        <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" IsEnabled="{Binding IsInitialized,Converter={StaticResource BooleanInverseConverter}}">

            <StackPanel>
                <StackPanel VerticalAlignment="Center" Width="150">
                    <TextBlock FontSize="10" Margin="0 10 0 0">Email</TextBlock>
                    <TextBox Margin="0 2 0 0" Text="{Binding Email}"></TextBox>
                </StackPanel>

                <StackPanel VerticalAlignment="Center" Width="150">
                    <TextBlock Margin="0 5 0 0" FontSize="10">Password</TextBlock>
                    <PasswordBox Margin="0 2 0 0" helpers:PasswordHelper.Attach="True" helpers:PasswordHelper.Password="{Binding Password,Mode=TwoWay}"></PasswordBox>
                </StackPanel>
            </StackPanel>
            <Button Command="{Binding InitCommand}" VerticalAlignment="Center" Padding="30 19" Margin="20 14 10 10" IsDefault="True">Authenticate</Button>
        </StackPanel>

        <Grid Grid.Row="1" IsEnabled="{Binding IsInitialized}">
            <TabControl Margin="10">
                <TabItem Header="Environment Upgrade" Padding="5">
                    <views:EnvironmentUpgradeView/>
                </TabItem>
                <TabItem Header="Environment Creation" Padding="5">
                    <views:EnvironmentCreationView/>
                </TabItem>
                <TabItem Header="Environment Removal" Padding="5">
                    <views:EnvironmentRemovalView/>
                </TabItem>
                <TabItem Header="Environment Firmware Injection" Padding="5">
                    <views:EnvironmentFirmwareUpgradeView/>
                </TabItem>
                <TabItem Header="Environment Rollback" Padding="5">
                    <views:EnvironmentRollbackView/>
                </TabItem>
                <TabItem Header="Environment Log Stream" Padding="5">
                    <views:EnvironmentLogStreamView/>
                </TabItem>
            </TabControl>
        </Grid>

        <Border Grid.Row="2" BorderBrush="{StaticResource LightBorderBrush}" BorderThickness="0 1 0 0">
            <Border.Style>
                <Style TargetType="Border">
                    <Setter Property="Background" Value="{StaticResource SecondaryBackgroundBrush}"></Setter>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ElementName=state,Path=Text}" Value="Error">
                            <Setter Property="Background" Value="#FCA4A4"></Setter>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Border.Style>
            <DockPanel Margin="10 0">
                <TextBlock x:Name="state" DockPanel.Dock="Top" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" Text="{Binding Progress.Stage,Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>

                <StackPanel DockPanel.Dock="Top" VerticalAlignment="Bottom" Margin="0 0 0 5">
                    <TextBlock VerticalAlignment="Bottom" Text="{Binding Progress.Message}"></TextBlock>
                    <ProgressBar Foreground="{StaticResource PrimaryForegroundBrush}" Height="15" VerticalAlignment="Bottom" Margin="0 2 0 0" IsIndeterminate="{Binding Progress.IsIndeterminate}" Maximum="{Binding Progress.Maximum}" Value="{Binding Progress.Progress}"></ProgressBar>
                </StackPanel>
            </DockPanel>
        </Border>
    </Grid>
</UserControl>
int8_t *out) { assert(message->base.descriptor == &hardware_configuration__descriptor); return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); } size_t hardware_configuration__pack_to_buffer (const HardwareConfiguration *message, ProtobufCBuffer *buffer) { assert(message->base.descriptor == &hardware_configuration__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } HardwareConfiguration * hardware_configuration__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (HardwareConfiguration *) protobuf_c_message_unpack (&hardware_configuration__descriptor, allocator, len, data); } void hardware_configuration__free_unpacked (HardwareConfiguration *message, ProtobufCAllocator *allocator) { if(!message) return; assert(message->base.descriptor == &hardware_configuration__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } static const ProtobufCFieldDescriptor hardware_configuration__field_descriptors[8] = { { "", 1, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, offsetof(HardwareConfiguration, n_dancers), offsetof(HardwareConfiguration, dancers), &hardware_dancer__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "", 2, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, offsetof(HardwareConfiguration, n_dispensers), offsetof(HardwareConfiguration, dispensers), &hardware_dispenser__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "", 3, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, offsetof(HardwareConfiguration, n_motors), offsetof(HardwareConfiguration, motors), &hardware_motor__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "", 4, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, offsetof(HardwareConfiguration, n_pidcontrols), offsetof(HardwareConfiguration, pidcontrols), &hardware_pid_control__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "", 5, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, offsetof(HardwareConfiguration, n_winders), offsetof(HardwareConfiguration, winders), &hardware_winder__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "", 6, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, offsetof(HardwareConfiguration, n_speedsensors), offsetof(HardwareConfiguration, speedsensors), &hardware_speed_sensor__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "", 7, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, offsetof(HardwareConfiguration, n_blowers), offsetof(HardwareConfiguration, blowers), &hardware_blower__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "", 8, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, offsetof(HardwareConfiguration, n_breaksensors), offsetof(HardwareConfiguration, breaksensors), &hardware_break_sensor__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; static const unsigned hardware_configuration__field_indices_by_name[] = { 6, /* field[6] = Blowers */ 7, /* field[7] = BreakSensors */ 0, /* field[0] = Dancers */ 1, /* field[1] = Dispensers */ 2, /* field[2] = Motors */ 3, /* field[3] = PidControls */ 5, /* field[5] = SpeedSensors */ 4, /* field[4] = Winders */ }; static const ProtobufCIntRange hardware_configuration__number_ranges[1 + 1] = { { 1, 0 }, { 0, 8 } }; const ProtobufCMessageDescriptor hardware_configuration__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, "", "", "", "", sizeof(HardwareConfiguration), 8, hardware_configuration__field_descriptors, hardware_configuration__field_indices_by_name, 1, hardware_configuration__number_ranges, (ProtobufCMessageInit) hardware_configuration__init, NULL,NULL,NULL /* reserved[123] */ };