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

194 lines
13 KiB
Plaintext
Raw Normal View History

<UserControl x:Class="OperationControl.Views.Operacao.Monitoramento.ParametrizacaoView"
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:OperationControl.Views.Operacao"
mc:Ignorable="d" >
<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
</UserControl.Resources>
<Grid>
<Grid.Resources>
<Style x:Key="ParamLabelStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="#D0D0D0"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,0,0,6"/>
</Style>
<Style x:Key="ParamTextBoxStyle" TargetType="TextBox">
<Setter Property="Height" Value="34"/>
<Setter Property="Margin" Value="0,0,0,12"/>
<Setter Property="Padding" Value="8,4"/>
<Setter Property="Background" Value="#2B2B2B"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="#5A5A5A"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style x:Key="SectionCardStyle" 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="ActionButtonStyle" TargetType="Button">
<Setter Property="Height" Value="40"/>
<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>
<Style x:Key="ParamCheckBoxStyle" TargetType="CheckBox">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Margin" Value="0,0,0,10"/>
</Style>
</Grid.Resources>
<StackPanel Margin="0,0,2,0">
<TextBlock Text="Parametrização" Foreground="White" FontSize="18" FontWeight="Bold" Margin="0,0,0,4"/>
<TextBlock Text="Configure os parâmetros operacionais do rover." Foreground="#A8A8A8" FontSize="12" Margin="0,0,0,14"/>
<!-- OPERACAO -->
<Border Style="{StaticResource SectionCardStyle}">
<StackPanel>
<TextBlock Text="Operação" Foreground="White" FontSize="15" FontWeight="SemiBold" Margin="0,0,0,12"/>
<TextBlock Text="Modo" Style="{StaticResource ParamLabelStyle}"/>
<ComboBox ItemsSource="{Binding ModosOperacaoDisponiveis}" SelectedItem="{Binding Parametros.Modo, Mode=TwoWay}" SelectionChanged="cmbModoOperacao_SelectionChanged" />
<TextBlock Text="Descrição" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Descricao}" Style="{StaticResource ParamTextBoxStyle}" Margin="0,0,0,0"/>
<Button Content="Reiniciar Operação" Command="{Binding ReiniciarOperacaoCommand}" Visibility="{Binding OperacaoConcluida, Converter={StaticResource BoolToVisibilityConverter}}" Margin="0,10,0,0" Height="36"/>
</StackPanel>
</Border>
<!-- AUTOMAÇÃO GERAL -->
<Border Style="{StaticResource SectionCardStyle}">
<StackPanel>
<TextBlock Text="Automação Geral" Foreground="White" FontSize="15" FontWeight="SemiBold" Margin="0,0,0,12"/>
<CheckBox Content="Registrar Dados Pós-Processamento" IsChecked="{Binding Parametros.Controle.RegistrarDadosPosProcessamento}" Style="{StaticResource ParamCheckBoxStyle}" Margin="0,0,0,0"/>
</StackPanel>
</Border>
<!-- MOVIMENTO -->
<Border Style="{StaticResource SectionCardStyle}">
<StackPanel>
<TextBlock Text="Movimento" Foreground="White" FontSize="15" FontWeight="SemiBold" Margin="0,0,0,12"/>
<CheckBox Content="Automático" IsChecked="{Binding Parametros.Controle.MovimentoAutomatico}" Style="{StaticResource ParamCheckBoxStyle}"/>
<CheckBox Content="Parada por Obstáculo (OAK)" IsChecked="{Binding Parametros.Controle.OakParadaPorObstaculo}" Style="{StaticResource ParamCheckBoxStyle}"/>
<CheckBox Content="Parada por Inclinação (IMU)" IsChecked="{Binding Parametros.Controle.ImuParadaPorInclinacao}" Style="{StaticResource ParamCheckBoxStyle}"/>
<CheckBox Content="Frenagem Automática ao Parar" IsChecked="{Binding Parametros.Controle.FrenagemAutomaticaAoParar}" Style="{StaticResource ParamCheckBoxStyle}"/>
<CheckBox Content="Assistido por Sonar" IsChecked="{Binding Parametros.Controle.MovAuxilioSonar}" Style="{StaticResource ParamCheckBoxStyle}" />
<TextBlock Text="Velocidade sem Ervas (%)" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Controle.MovVelocidadeSErvasPercent, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
<TextBlock Text="Velocidade com Ervas (%)" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Controle.MovVelocidadeCErvasPercent, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
<TextBlock Text="RPM Máx Calculado" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Controle.MovRpmMax, Mode=OneWay}" IsReadOnly="True" Style="{StaticResource ParamTextBoxStyle}"/>
<TextBlock Text="RPM Mín Calculado" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Controle.MovRpmMin, Mode=OneWay}" IsReadOnly="True" Style="{StaticResource ParamTextBoxStyle}" Margin="0,0,0,0"/>
</StackPanel>
</Border>
<!-- DIRECIONAL -->
<Border Style="{StaticResource SectionCardStyle}">
<StackPanel>
<TextBlock Text="Direcional" Foreground="White" FontSize="15" FontWeight="SemiBold" Margin="0,0,0,12"/>
<CheckBox Content="Direcional Automático" IsChecked="{Binding Parametros.Controle.DirecionalAutomatico}" Style="{StaticResource ParamCheckBoxStyle}"/>
<CheckBox Content="Assistido por Sonar" IsChecked="{Binding Parametros.Controle.DirAuxilioSonar}" Style="{StaticResource ParamCheckBoxStyle}" />
<TextBlock Text="Ângulo Máximo (°)" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Controle.DirAnguloMaximo, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
<TextBlock Text="Velocidade Movimento" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Controle.DirVelocidadeMovimento, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
<TextBlock Text="Tipo de Movimento" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Controle.DirTipoMovimento, Mode=OneWay}" IsReadOnly="True" Style="{StaticResource ParamTextBoxStyle}" Margin="0,0,0,0"/>
</StackPanel>
</Border>
<!-- PULVERIZAÇÃO -->
<Border Style="{StaticResource SectionCardStyle}">
<StackPanel>
<TextBlock Text="Pulverização" Foreground="White" FontSize="15" FontWeight="SemiBold" Margin="0,0,0,12"/>
<CheckBox Content="Automático" IsChecked="{Binding Parametros.Controle.PulverizadorAutomatico}" Style="{StaticResource ParamCheckBoxStyle}"/>
<TextBlock Text="Quantidade de Bicos" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.QtdBicos, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
<TextBlock Text="Capacidade do Reservatório (L)" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.CapacidadeReservatorio, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
<TextBlock Text="Pressão Linha" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Controle.AtuPressaoLinha, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
<TextBlock Text="Duração Atuação (ms)" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Controle.AtuDuracaoAtuacao, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
<TextBlock Text="Início Pulverização (%)" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Controle.AtuPercentualInicioPulverizacao, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
<TextBlock Text="Altura Área Pulverização" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Controle.AtuAlturaAreaPulverizacao, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
<TextBlock Text="Ervas Bico On (%)" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Controle.AtuPercentualErvasBicoOn, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
<TextBlock Text="Ervas Bico Off (%)" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Controle.AtuPercentualErvasBicoOff, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}" Margin="0,0,0,0"/>
</StackPanel>
</Border>
<!-- MPC -->
<Border Style="{StaticResource SectionCardStyle}">
<StackPanel>
<TextBlock Text="MPC" Foreground="White" FontSize="15" FontWeight="SemiBold" Margin="0,0,0,12"/>
<CheckBox Content="Matriz de Custo" IsChecked="{Binding Parametros.Controle.MpcMatrizCusto}" Style="{StaticResource ParamCheckBoxStyle}"/>
<TextBlock Text="Horizonte (m)" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Controle.MpcHorizonte, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}" Margin="0,0,0,0"/>
<TextBlock Text="Antecipar Fim do Corredor (m)" Style="{StaticResource ParamLabelStyle}"/>
<TextBox Text="{Binding Parametros.Controle.AnteciparManobraCorredorM, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}" Margin="0,0,0,0"/>
</StackPanel>
</Border>
<!-- AÇÕES -->
<Border Style="{StaticResource SectionCardStyle}">
<StackPanel>
<TextBlock Text="Ações" Foreground="White" FontSize="15" FontWeight="SemiBold" Margin="0,0,0,12"/>
<Button Content="↻ Ler do Rover" Command="{Binding LerParametrosCommand}" Background="#2E2E2E" BorderBrush="#5C5C5C" Style="{StaticResource ActionButtonStyle}"/>
<Button Content="💾 Salvar no Rover" Command="{Binding SalvarParametrosCommand}" Background="#2F5D3A" BorderBrush="#4A8A5B" Style="{StaticResource ActionButtonStyle}" Margin="0,0,0,0"/>
</StackPanel>
</Border>
</StackPanel>
</Grid>
</UserControl>