aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml
blob: 9794404b963f5d81e818f9cb23c5f37eb0447ba9 (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
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.hi
<UserControl x:Class="Tango.MachineStudio.UI.Views.MachineConnectionView"
             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:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:integration="clr-namespace:Tango.Integration.ExternalBridge;assembly=Tango.Integration"
             xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             xmlns:emulations="clr-namespace:Tango.Emulations.ExternalBridge;assembly=Tango.Emulations"
             xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" Width="630" Height="400" Background="White" DataContext="{Binding MachineConnectionViewVM, Source={StaticResource Locator}}">

    <UserControl.Resources>
        <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></converters:BooleanToVisibilityConverter>
        <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter"></converters:BooleanToVisibilityInverseConverter>
        <converters:BooleanInverseConverter x:Key="BooleanInverseConverter"></converters:BooleanInverseConverter>
    </UserControl.Resources>

    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="80"/>
                <RowDefinition Height="1*"/>
            </Grid.RowDefinitions>

            <Grid>
                <StackPanel Orientation="Horizontal" Margin="10">
                    <Image Source="/Images/machine-trans.png" RenderOptions.BitmapScalingMode="Fant"></Image>
                    <TextBlock Text="Machine Connection" VerticalAlignment="Center" Margin="10 0 0 0" FontSize="20"></TextBlock>
                </StackPanel>
            </Grid>

            <Grid Grid.Row="1" Margin="10 0 10 10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="1*"/>
                    <RowDefinition Height="50"/>
                </Grid.RowDefinitions>

                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="223*"/>
                    </Grid.RowDefinitions>

                    <Grid>
                        <TextBlock VerticalAlignment="Center" Margin="0 0 0 0" Text="Scanning for machines on your local environment..."></TextBlock>

                        <!--<Button Command="{Binding ScanCommand}" HorizontalAlignment="Right" Width="40" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" Foreground="Black" ToolTip="Scan">
                            <materialDesign:PackIcon Kind="Refresh" Width="24" Height="24"></materialDesign:PackIcon>
                        </Button>-->
                    </Grid>

                    <Grid Grid.Row="1">
                        <ListBox ItemsSource="{Binding Scanner.AvailableMachines}" SelectedItem="{Binding SelectedMachine}" Margin="0 0 0 7" BorderThickness="1" BorderBrush="Gainsboro" HorizontalContentAlignment="Stretch">
                            <ListBox.Resources>
                                <DataTemplate DataType="{x:Type integration:ExternalBridgeTcpClient}">
                                    <DockPanel>
                                        <StackPanel Orientation="Horizontal">
                                            <Image Source="/Images/external-bridge-tcp.png" Width="38" Height="38" RenderOptions.BitmapScalingMode="Fant"></Image>
                                            <StackPanel Margin="10 0 0 0">
                                                <TextBlock FontSize="11">
                                            <Run FontWeight="Bold">S/N:</Run> <Run Text="{Binding SerialNumber,Mode=OneWay}"></Run>
                                                </TextBlock>
                                                <TextBlock FontSize="11">
                                            <Run FontWeight="Bold">IP Address:</Run> <Run Text="{Binding IPAddress,Mode=OneWay}"></Run>
                                                </TextBlock>
                                                <TextBlock FontSize="11">
                                            <Run FontWeight="Bold">Organization:</Run> <Run Text="{Binding Machine.Organization.Name,Mode=OneWay}"></Run>
                                                </TextBlock>
                                            </StackPanel>
                                        </StackPanel>
                                    </DockPanel>
                                </DataTemplate>
                                <DataTemplate DataType="{x:Type integration:ExternalBridgeUsbClient}">
                                    <DockPanel>
                                        <StackPanel Orientation="Horizontal">
                                            <Image Source="/Images/external-bridge-usb.png" Width="38" Height="38" RenderOptions.BitmapScalingMode="Fant"></Image>
                                            <StackPanel Margin="10 0 0 0">
                                                <TextBlock FontSize="11">
                                            <Run FontWeight="Bold">Port:</Run> <Run Text="{Binding ComPort,Mode=OneWay}"></Run>
                                                </TextBlock>
                                                <TextBlock FontSize="11">
                                            <Run FontWeight="Bold">Device:</Run> <Run Text="{Binding Device,Mode=OneWay}"></Run>
                                                </TextBlock>
                                            </StackPanel>
                                        </StackPanel>
                                    </DockPanel>
                                </DataTemplate>
                                <DataTemplate DataType="{x:Type emulations:EmulatorExternalBridge}">
                                    <DockPanel>
                                        <StackPanel Orientation="Horizontal">
                                            <Image Source="/Images/external-bridge-emulator.png" Width="38" Height="38" RenderOptions.BitmapScalingMode="Fant"></Image>
                                            <StackPanel Margin="10 0 0 0">
                                                <TextBlock FontSize="11">
                                                <Run Text="External Bridge Emulator"></Run>
                                                </TextBlock>
                                                <TextBlock FontSize="11">
                                            <Run FontWeight="Bold">Address:</Run> <Run Text="{Binding Adapter.Address,Mode=OneWay}"></Run>
                                                </TextBlock>
                                            </StackPanel>
                                        </StackPanel>
                                    </DockPanel>
                                </DataTemplate>
                            </ListBox.Resources>
                        </ListBox>

                        <mahapps:MetroProgressBar VerticalAlignment="Bottom" Height="1" IsIndeterminate="True"></mahapps:MetroProgressBar>
                    </Grid>
                </Grid>

                <Grid Grid.Row="1">

                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                            <ToggleButton IsChecked="{Binding EnableDiagnostics}" VerticalAlignment="Center" ToolTip="Allow incoming diagnostics data, debug logs and hardware events"></ToggleButton>
                            <TextBlock VerticalAlignment="Center" FontSize="10" Margin="5 0 0 0">Diagnostics, Debug &amp; Events</TextBlock>
                        </StackPanel>

                        <StackPanel Margin="20 0 0 0" Orientation="Horizontal" VerticalAlignment="Center">
                            <ToggleButton IsChecked="{Binding UploadHardwareConfiguration}" VerticalAlignment="Center" ToolTip="Upload hardware configuration after connection is successful"></ToggleButton>
                            <TextBlock VerticalAlignment="Center" FontSize="10" Margin="5 0 0 0">Upload HW Configuration</TextBlock>
                        </StackPanel>

                        <StackPanel Margin="20 0 0 0" Orientation="Horizontal" VerticalAlignment="Center">
                            <ToggleButton IsChecked="{Binding EnableKeepAlive}" VerticalAlignment="Center" ToolTip="Upload hardware configuration after connection is successful"></ToggleButton>
                            <TextBlock VerticalAlignment="Center" FontSize="10" Margin="5 0 0 0">Keep Alive</TextBlock>
                        </StackPanel>
                    </StackPanel>

                    <Button HorizontalAlignment="Right" Width="140" Command="{Binding ConnectCommand}">CONNECT</Button>
                </Grid>
            </Grid>
        </Grid>
    </Grid>
</UserControl>