Advanced Distributed Systems module at HSLU
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

88 lines
4.8 KiB

<UserControl x:Class="RobotClientWpf.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:local="clr-namespace:RobotClientWpf.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" KeyDown="UserControl_KeyDown">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="200"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="150"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- RIGHT SIDE -->
<StackPanel Orientation="Vertical" Grid.Row="0" Grid.Column="1" Grid.RowSpan="2">
<GroupBox Header="Splitflap Display" Margin="10" HorizontalAlignment="Right" Width="180">
<TextBox x:Name="tbSplitflapText" Height="70" Width="150" FontSize="30" IsReadOnly="True" TextWrapping="NoWrap" HorizontalAlignment="Left"/>
</GroupBox>
<GroupBox Header="Robot battery" Margin="10" HorizontalAlignment="Right" Width="180">
<StackPanel Orientation="Horizontal">
<TextBox x:Name="tbRoboVoltage" Height="25" Width="100" FontSize="15" IsReadOnly="True" TextWrapping="NoWrap" HorizontalAlignment="Left">NaN</TextBox>
<Label Content="V" Margin="10 0"/>
</StackPanel>
</GroupBox>
</StackPanel>
<!-- LEFT SIDE -->
<DockPanel>
<GroupBox DockPanel.Dock="Left" Grid.Column="0" Header="Robot Control" Width="200">
<StackPanel Orientation="Vertical" Margin="5">
<Button x:Name="btnModeAuto" Height="25" Margin="0 5" Click="btnModeAuto_Click">Set Automatic Mode</Button>
<Button x:Name="btnModeManual" Height="25" Margin="0 5" Click="btnModeManual_Click">Set Manual Mode</Button>
</StackPanel>
</GroupBox>
<GroupBox DockPanel.Dock="Left" Grid.Column="0" Header="Robot Steering" Width="200">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
</Grid.RowDefinitions>
<Button Grid.Column="1" Grid.Row="0" Height="30" Width="30" x:Name="btnRoboFwd" Click="btnRoboFwd_Click">
<Image>
<Image.Source>
<BitmapImage UriSource="/Assets/arrow-down-bold.png" Rotation="Rotate180"/>
</Image.Source>
</Image>
</Button>
<Button Grid.Column="1" Grid.Row="1" Height="30" Width="30" x:Name="btnRoboBwd" Click="btnRoboBwd_Click">
<Image>
<Image.Source>
<BitmapImage UriSource="/Assets/arrow-down-bold.png"/>
</Image.Source>
</Image>
</Button>
<Button Grid.Column="0" Grid.Row="1" Height="30" Width="30" x:Name="btnRoboLeft" Click="btnRoboLeft_Click">
<Image>
<Image.Source>
<BitmapImage UriSource="/Assets/arrow-down-bold.png" Rotation="Rotate90"/>
</Image.Source>
</Image>
</Button>
<Button Grid.Column="2" Grid.Row="1" Height="30" Width="30" x:Name="btnRoboRight" Click="btnRoboRight_Click">
<Image>
<Image.Source>
<BitmapImage UriSource="/Assets/arrow-down-bold.png" Rotation="Rotate270"/>
</Image.Source>
</Image>
</Button>
<Label Grid.Row="2" Grid.ColumnSpan="3" FontWeight="Bold" FontSize="12" Margin="5 0">Control with Arrow keys</Label>
<Label Grid.Row="3" Grid.ColumnSpan="3" FontWeight="Bold" FontSize="12" Margin="5 0">Stop with End key</Label>
</Grid>
</GroupBox>
</DockPanel>
</Grid>
</UserControl>