aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/CustomAttributes/DBViewAttribute.cs
blob: d512ae460c20e9a607d2281163714f14bcc383b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.MachineStudio.DB.CustomAttributes
{
    /// <summary>
    /// Represents a database view attribute. This will tell the module to treat the view as a data table view.
    /// </summary>
    /// <seealso cref="System.Attribute" />
    public class DBViewAttribute : Attribute
    {
    }
}
#fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<UserControl x:Class="Tango.MachineStudio.UI.Views.FirmwareUpgradeView"
             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:local="clr-namespace:Tango.MachineStudio.UI.Views"
             xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:vm="clr-namespace:Tango.MachineStudio.UI.ViewModels"
             xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" Width="800" Height="400" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:FirmwareUpgradeViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}">

    <UserControl.Resources>
        <converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" />
    </UserControl.Resources>

    <UserControl.Style>
        <Style TargetType="UserControl">
            <Setter Property="Cursor" Value="Arrow"></Setter>
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsFree}" Value="False">
                    <Setter Property="Cursor" Value="Wait"></Setter>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </UserControl.Style>

    <Grid>
        <Grid Margin="10">
            <Grid.RowDefinitions>
                <RowDefinition Height="121"/>
                <RowDefinition Height="1*"/>
            </Grid.RowDefinitions>

            <Grid>
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/Images/firmware_upgrade.png" Height="100" />
                        <TextBlock VerticalAlignment="Center" FontSize="30" FontWeight="SemiBold" Margin="20 0 0 0">FIRMWARE UPGRADE</TextBlock>
                    </StackPanel>
                    <Rectangle Stroke="{StaticResource BorderBrushGainsboro}"  StrokeDashArray="5 5 5 5" Margin="20 10" />
                </StackPanel>
            </Grid>

            <Grid Grid.Row="1">
                <controls:NavigationControl TransitionType="Zoom" SelectedIndex="{Binding CurrentPage}" TransitionDuration="00:00:0.3">

                    <Grid>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="174*"/>
                                <RowDefinition Height="85*"/>
                            </Grid.RowDefinitions>
                            <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
                                <TextBlock TextAlignment="Center">
                        <Run>This upgrade wizard will help you upgrade the connected machine firmware version.</Run>
                        <LineBreak/>
                        <Run>Press 'SELECT' to browse for an .tfp file (Tango Firmware Package).</Run>
                                </TextBlock>
                                <StackPanel>
                                    <DockPanel Margin="0 30 0 0" Width="600" HorizontalAlignment="Left">
                                        <Button DockPanel.Dock="Right" Margin="10 0 0 0" Command="{Binding SelectCommand}">SELECT</Button>
                                        <TextBox Style="{x:Null}" VerticalContentAlignment="Center" BorderBrush="{StaticResource AccentColorBrush}" Padding="5 0" Foreground="{StaticResource DimGrayBrush}" IsReadOnly="True" Text="{Binding SelectedFile,Mode=OneWay}"></TextBox>
                                    </DockPanel>

                                    <StackPanel Orientation="Horizontal" Margin="0 5 0 0">
                                        <RadioButton IsChecked="{Binding DFU,Mode=TwoWay}">DFU</RadioButton>
                                        <RadioButton IsChecked="{Binding UploadTFP,Mode=TwoWay}" Margin="25 0 0 0">TFP Package</RadioButton>
                                        <RadioButton IsChecked="{Binding DFUAndTFP,Mode=TwoWay}" Margin="10 0 0 0">DFU &amp; Package</RadioButton>
                                    </StackPanel>
                                </StackPanel>
                            </StackPanel>

                            <Grid Height="60" Grid.Row="1">
                                <Button Height="50" Width="200" VerticalAlignment="Top" Command="{Binding UpgradeCommand}">
                                    <StackPanel Orientation="Horizontal">
                                        <materialDesign:PackIcon Kind="Flash" Width="32" Height="32" />
                                        <TextBlock VerticalAlignment="Center" Margin="5 0 0 0">UPGRADE</TextBlock>
                                    </StackPanel>
                                </Button>
                            </Grid>
                        </Grid>
                    </Grid>

                    <Grid>
                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                            <TextBlock HorizontalAlignment="Center" FontSize="18" FontWeight="SemiBold">Upgrading Machine Firmware</TextBlock>
                            <TextBlock Margin="0 40 0 0" HorizontalAlignment="Center" Foreground="{StaticResource GrayBrush}" Text="{Binding Handler.Message,Converter={StaticResource EnumToDescriptionConverter},Mode=OneWay}"></TextBlock>
                            <ProgressBar Height="15" Width="600" Margin="0 5 0 0" Maximum="{Binding Handler.Total,Mode=OneWay}" Value="{Binding Handler.Current,Mode=OneWay}" ></ProgressBar>
                            <Button Width="150" Background="{StaticResource RedBrush100}" BorderBrush="{StaticResource RedBrush100}" Margin="0 40 0 0" Height="35" Command="{Binding AbortCommand}">ABORT</Button>
                        </StackPanel>
                    </Grid>

                    <Grid>
                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                            <TextBlock HorizontalAlignment="Center" FontSize="18" FontWeight="SemiBold">Firmware Upgrade Completed</TextBlock>
                            <materialDesign:PackIcon HorizontalAlignment="Center" Width="100" Margin="0 10 0 0" Height="100" Kind="Check" Foreground="#2DCB2D" />
                            <Button Width="150" Margin="0 10 0 0" Height="35" Command="{Binding CloseCommand}">CLOSE</Button>
                        </StackPanel>
                    </Grid>

                    <Grid>
                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                            <TextBlock HorizontalAlignment="Center" FontSize="18" FontWeight="SemiBold">Firmware Upgrade Failed</TextBlock>
                            <materialDesign:PackIcon HorizontalAlignment="Center" Width="100" Margin="0 10 0 0" Height="100" Kind="AlertOutline" Foreground="{StaticResource RedBrush100}" />
                            <TextBlock HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" Text="{Binding UpgradeError}" Foreground="{StaticResource RedBrush100}" FontWeight="SemiBold"></TextBlock>
                            <Button Width="150" Margin="0 15 0 0" Height="35" Command="{Binding CloseCommand}">CLOSE</Button>
                        </StackPanel>
                    </Grid>
                </controls:NavigationControl>
            </Grid>

        </Grid>
    </Grid>
</UserControl>