added stop button in UI

main
Jonas Arnold 4 years ago
parent 9cbe5bb9b9
commit 77b3fd7ae6
  1. 8
      ADIS_Csharp/RobotClientWpf/Views/MainView.xaml
  2. 5
      ADIS_Csharp/RobotClientWpf/Views/MainView.xaml.cs

@ -12,7 +12,7 @@
<ColumnDefinition Width="200"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="150"/>
<RowDefinition Height="200"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
@ -45,6 +45,7 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="25"/>
@ -79,8 +80,9 @@
</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>
<Button Grid.Row="2" Grid.ColumnSpan="3" x:Name="btnStopMove" Content="Stop" Margin="5" Click="btnStopMove_Click"/>
<Label Grid.Row="3" Grid.ColumnSpan="3" FontWeight="Bold" FontSize="12" Margin="5 0">Control with Arrow keys</Label>
<Label Grid.Row="4" Grid.ColumnSpan="3" FontWeight="Bold" FontSize="12" Margin="5 0">Stop with End key</Label>
</Grid>
</GroupBox>
</DockPanel>

@ -68,6 +68,11 @@ namespace RobotClientWpf.Views
this.challenge?.RobotMobile.Movement.Turn(-TURN_ANGLE_PER_CLICK);
}
private void btnStopMove_Click(object sender, System.Windows.RoutedEventArgs e)
{
this.challenge?.RobotMobile.Movement.Stop();
}
public void HandleKeyDownEvent(object sender, KeyEventArgs e)
{
if (e.Key == Key.Up)

Loading…
Cancel
Save