agrobot_base/AgroBase/OperationControl/Views/Operacao/Monitoramento/ControleManualView.xaml

330 lines
16 KiB
XML

<UserControl x:Class="OperationControl.Views.Operacao.Monitoramento.ControleManualView"
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"
mc:Ignorable="d"
Focusable="True">
<Grid>
<Grid.Resources>
<Style x:Key="ControlSectionCardStyle" TargetType="Border">
<Setter Property="Background" Value="#262626"/>
<Setter Property="BorderBrush" Value="#3E3E3E"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="10"/>
<Setter Property="Padding" Value="12"/>
<Setter Property="Margin" Value="0,0,0,12"/>
</Style>
<Style x:Key="ControlLabelStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="#D0D0D0"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Margin" Value="0,0,0,6"/>
</Style>
<Style x:Key="ControlValueStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
</Style>
<Style x:Key="ControlButtonKeyStyle" TargetType="Border">
<Setter Property="Width" Value="50"/>
<Setter Property="Height" Value="50"/>
<Setter Property="CornerRadius" Value="10"/>
<Setter Property="Background" Value="#2D2D2D"/>
<Setter Property="BorderBrush" Value="#555555"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="4"/>
</Style>
<Style x:Key="ControlActionButtonStyle" TargetType="Button">
<Setter Property="Height" Value="42"/>
<Setter Property="Margin" Value="0,0,0,10"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="8">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<StackPanel Margin="0,0,2,0">
<TextBlock Text="Controle Manual"
Foreground="White"
FontSize="18"
FontWeight="Bold"
Margin="0,0,0,4"/>
<TextBlock Text="Use o teclado ou os comandos abaixo para operar o rover."
Foreground="#A8A8A8"
FontSize="12"
Margin="0,0,0,14"
TextWrapping="Wrap"/>
<!-- STATUS -->
<Border Style="{StaticResource ControlSectionCardStyle}">
<StackPanel>
<TextBlock Text="Status do Controle"
Foreground="White"
FontSize="15"
FontWeight="SemiBold"
Margin="0,0,0,12"/>
<CheckBox Content="Habilitar controle por teclado"
IsChecked="{Binding Habilitado}"
Foreground="White"
Margin="0,0,0,10"/>
<Grid Margin="0,0,0,8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Ellipse Width="10"
Height="10"
Fill="{Binding StatusBrush}"
VerticalAlignment="Center"/>
<TextBlock Grid.Column="1"
Text="{Binding StatusTexto}"
Foreground="White"
FontWeight="SemiBold"
Margin="8,0,0,0"
VerticalAlignment="Center"/>
</Grid>
<TextBlock Text="{Binding TextoAjuda}"
Foreground="#B8B8B8"
FontSize="12"
TextWrapping="Wrap"/>
</StackPanel>
</Border>
<!-- TECLAS -->
<Border Style="{StaticResource ControlSectionCardStyle}">
<StackPanel>
<TextBlock Text="Comandos Diretos"
Foreground="White"
FontSize="15"
FontWeight="SemiBold"
Margin="0,0,0,12"/>
<Grid HorizontalAlignment="Center" Margin="0,0,0,10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- W -->
<Border Grid.Row="0" Grid.Column="1"
Style="{StaticResource ControlButtonKeyStyle}"
Background="{Binding TeclaWBackground}"
BorderBrush="{Binding TeclaWBorder}">
<TextBlock Text="W"
Foreground="White"
FontSize="22"
FontWeight="Bold"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<!-- A -->
<Border Grid.Row="1" Grid.Column="0"
Style="{StaticResource ControlButtonKeyStyle}"
Background="{Binding TeclaABackground}"
BorderBrush="{Binding TeclaABorder}">
<TextBlock Text="A"
Foreground="White"
FontSize="22"
FontWeight="Bold"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<!-- S -->
<Border Grid.Row="1" Grid.Column="1"
Style="{StaticResource ControlButtonKeyStyle}"
Background="{Binding TeclaSBackground}"
BorderBrush="{Binding TeclaSBorder}">
<TextBlock Text="S"
Foreground="White"
FontSize="22"
FontWeight="Bold"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<!-- D -->
<Border Grid.Row="1" Grid.Column="2"
Style="{StaticResource ControlButtonKeyStyle}"
Background="{Binding TeclaDBackground}"
BorderBrush="{Binding TeclaDBorder}">
<TextBlock Text="D"
Foreground="White"
FontSize="22"
FontWeight="Bold"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<!-- F -->
<Border Grid.Row="1" Grid.Column="3"
Style="{StaticResource ControlButtonKeyStyle}"
Background="{Binding TeclaFBackground}"
BorderBrush="{Binding TeclaFBorder}">
<TextBlock Text="F"
Foreground="White"
FontSize="22"
FontWeight="Bold"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</Grid>
<TextBlock Text="W: Frente | S: Ré | A: Esquerda | D: Direita | F: Freio"
Foreground="#B8B8B8"
FontSize="12"
TextWrapping="Wrap"
Margin="0,0,0,8"/>
<Border Background="{Binding FreioCardBackground}"
BorderBrush="{Binding FreioCardBorder}"
BorderThickness="1"
CornerRadius="8"
Padding="10">
<StackPanel Orientation="Horizontal">
<TextBlock Text="⛔"
FontSize="16"
Margin="0,0,8,0"
VerticalAlignment="Center"/>
<TextBlock Text="{Binding FreioAtivoTexto}"
Foreground="White"
FontWeight="SemiBold"
VerticalAlignment="Center"/>
</StackPanel>
</Border>
</StackPanel>
</Border>
<!-- AJUSTES -->
<Border Style="{StaticResource ControlSectionCardStyle}">
<StackPanel>
<TextBlock Text="Ajustes de Movimento"
Foreground="White"
FontSize="15"
FontWeight="SemiBold"
Margin="0,0,0,12"/>
<Grid Margin="0,0,0,6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Velocidade (%)"
Style="{StaticResource ControlLabelStyle}"
Margin="0"/>
<TextBlock Grid.Column="1"
Text="{Binding VelocidadePercentualTexto}"
Style="{StaticResource ControlValueStyle}"/>
</Grid>
<Slider Minimum="0"
Maximum="100"
Value="{Binding VelocidadePercentual, Mode=TwoWay}"
Margin="0,0,0,12"/>
<Grid Margin="0,0,0,6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Ângulo Direcional (°)"
Style="{StaticResource ControlLabelStyle}"
Margin="0"/>
<TextBlock Grid.Column="1"
Text="{Binding AnguloTexto}"
Style="{StaticResource ControlValueStyle}"/>
</Grid>
<Slider Minimum="-30"
Maximum="30"
Value="{Binding AnguloDirecional, Mode=TwoWay}"
Margin="0,0,0,12"/>
<TextBlock Text="Tipo de Movimento" Style="{StaticResource ControlLabelStyle}"/>
<ComboBox ItemsSource="{Binding TiposMovimento}"
SelectedItem="{Binding TipoMovimentoSelecionado, Mode=TwoWay}"/>
</StackPanel>
</Border>
<!-- ESTADO -->
<Border Style="{StaticResource ControlSectionCardStyle}">
<StackPanel>
<TextBlock Text="Estado Atual"
Foreground="White"
FontSize="15"
FontWeight="SemiBold"
Margin="0,0,0,12"/>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="110"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="Movimento" Foreground="#CFCFCF" Margin="0,0,0,8"/>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding MovimentoAtualTexto}" Foreground="White" Margin="10,0,0,8"/>
<TextBlock Grid.Row="1" Grid.Column="0" Text="Direção" Foreground="#CFCFCF" Margin="0,0,0,8"/>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding DirecaoAtualTexto}" Foreground="White" Margin="10,0,0,8"/>
<TextBlock Grid.Row="2" Grid.Column="0" Text="Freio" Foreground="#CFCFCF" Margin="0,0,0,8"/>
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding FreioAtivoTexto}" Foreground="White" Margin="10,0,0,8"/>
<TextBlock Grid.Row="3" Grid.Column="0" Text="Velocidade" Foreground="#CFCFCF" Margin="0,0,0,8"/>
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding VelocidadePercentualTexto}" Foreground="White" Margin="10,0,0,8"/>
<TextBlock Grid.Row="4" Grid.Column="0" Text="Ângulo" Foreground="#CFCFCF" Margin="0,0,0,8"/>
<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding AnguloTexto}" Foreground="White" Margin="10,0,0,8"/>
<TextBlock Grid.Row="5" Grid.Column="0" Text="Modo" Foreground="#CFCFCF" Margin="0,0,0,0"/>
<TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding TipoMovimentoSelecionado}" Foreground="White" Margin="10,0,0,0"/>
</Grid>
</StackPanel>
</Border>
</StackPanel>
</Grid>
</UserControl>