210 lines
17 KiB
XML
210 lines
17 KiB
XML
<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:sys="clr-namespace:System;assembly=mscorlib"
|
|
xmlns:local="clr-namespace:OperationControl.Views.Operacao"
|
|
xmlns:enums="clr-namespace:AgroBase.Models;assembly=AgroBase"
|
|
mc:Ignorable="d" >
|
|
<UserControl.Resources>
|
|
<BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
|
|
<ObjectDataProvider x:Key="ModoOperacaoValues" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
|
|
<ObjectDataProvider.MethodParameters>
|
|
<x:Type TypeName="enums:Enums+ModoOperacao"/>
|
|
</ObjectDataProvider.MethodParameters>
|
|
</ObjectDataProvider>
|
|
<ObjectDataProvider x:Key="ModoAgitadorCaldaValues" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
|
|
<ObjectDataProvider.MethodParameters>
|
|
<x:Type TypeName="enums:Enums+ModoAgitadorCalda"/>
|
|
</ObjectDataProvider.MethodParameters>
|
|
</ObjectDataProvider>
|
|
</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 Source={StaticResource ModoOperacaoValues}}" SelectedItem="{Binding Parametros.Modo, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 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="Controle Automático" ToolTip="Define automaticamente a velocidade de movimentação do robô conforme as regras de operação." IsChecked="{Binding Parametros.Controle.MovimentoAutomatico}" Style="{StaticResource ParamCheckBoxStyle}"/>
|
|
<CheckBox Content="Assistido por Sonar" ToolTip="Usa os dados do sonar para auxiliar a decisão de velocidade, considerando obstáculos e matriz de custo." IsChecked="{Binding Parametros.Controle.MovAuxilioSonar}" Style="{StaticResource ParamCheckBoxStyle}" />
|
|
<CheckBox Content="Parada por Obstáculo (OAK)" ToolTip="Permite que as regras táticas parem o robô quando houver obstáculo detectado." IsChecked="{Binding Parametros.Controle.OakParadaPorObstaculo}" Style="{StaticResource ParamCheckBoxStyle}"/>
|
|
<CheckBox Content="Assistido por IMU" ToolTip="Usa os dados da IMU para ajustar a velocidade conforme inclinação, estabilidade e segurança do robô." IsChecked="{Binding Parametros.Controle.ImuAuxilioMovimento}" Style="{StaticResource ParamCheckBoxStyle}"/>
|
|
<CheckBox Content="Parada por Inclinação (IMU)" ToolTip="Permite que as regras táticas parem o robô quando a inclinação indicar risco operacional." IsChecked="{Binding Parametros.Controle.ImuParadaPorInclinacao}" Style="{StaticResource ParamCheckBoxStyle}"/>
|
|
<CheckBox Content="Frenagem Automática ao Parar" ToolTip="Quando ativado, aciona o freio ao parar. Quando desativado, apenas corta a alimentação dos motores." IsChecked="{Binding Parametros.Controle.FrenagemAutomaticaAoParar}" Style="{StaticResource ParamCheckBoxStyle}"/>
|
|
|
|
<TextBlock Text="Velocidade sem Ervas (%)" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="Velocidade usada quando não há ervas no radar, permitindo deslocamento mais rápido." Text="{Binding Parametros.Controle.MovVelocidadeSErvasPercent, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
|
|
|
|
<TextBlock Text="Velocidade com Ervas (%)" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="Velocidade usada quando há ervas no radar, reduzindo o avanço para melhorar a qualidade da aplicação." Text="{Binding Parametros.Controle.MovVelocidadeCErvasPercent, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
|
|
|
|
<TextBlock Text="RPM Máx Calculado" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="RPM máximo calculado automaticamente a partir das velocidades configuradas." Text="{Binding Parametros.Controle.MovRpmMax, Mode=OneWay}" IsReadOnly="True" Style="{StaticResource ParamTextBoxStyle}"/>
|
|
|
|
<TextBlock Text="RPM Mín Calculado" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="RPM mínimo calculado automaticamente a partir das velocidades configuradas." 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="Controle Automático" ToolTip="Controla automaticamente o direcional por MPC, PID ou dados de segmentação, conforme o modo configurado." IsChecked="{Binding Parametros.Controle.DirecionalAutomatico}" Style="{StaticResource ParamCheckBoxStyle}"/>
|
|
<CheckBox Content="Assistido por Sonar" ToolTip="Usa a matriz de custo do sonar para auxiliar o direcional e evitar candidatos ruins em regiões com obstáculo." IsChecked="{Binding Parametros.Controle.DirAuxilioSonar}" Style="{StaticResource ParamCheckBoxStyle}" />
|
|
<CheckBox Content="Assistido por IMU" ToolTip="Usa a IMU para limitar ou ajustar decisões do direcional quando houver inclinação com risco operacional." IsChecked="{Binding Parametros.Controle.ImuAuxilioDirecional}" Style="{StaticResource ParamCheckBoxStyle}" />
|
|
<CheckBox Content="Assistente IMU preferir controle arco" ToolTip="Quando a IMU auxiliar o direcional, prefere controle em arco com as quatro rodas para melhorar a correção de estabilidade." IsChecked="{Binding Parametros.Controle.ImuDirecionalPreferirArco}" Style="{StaticResource ParamCheckBoxStyle}" />
|
|
|
|
<TextBlock Text="Ângulo Máximo (°)" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="Ângulo máximo permitido para esterçamento das rodas. Normalmente usado em torno de 30 graus." Text="{Binding Parametros.Controle.DirAnguloMaximo, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
|
|
|
|
<TextBlock Text="Velocidade Movimento" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="Percentual de velocidade usado no acionamento do motor de passo do direcional." Text="{Binding Parametros.Controle.DirVelocidadeMovimento, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
|
|
|
|
<TextBlock Text="Tipo de Controle" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="Método direcional usado para definir o controle do módulo." 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" ToolTip="Aciona automaticamente os bicos de pulverização conforme a detecção de ervas pela câmera." IsChecked="{Binding Parametros.Controle.PulverizadorAutomatico}" Style="{StaticResource ParamCheckBoxStyle}"/>
|
|
|
|
<TextBlock Text="Agitador Calda Modo" Style="{StaticResource ParamLabelStyle}"/>
|
|
<ComboBox ToolTip="Define o modo de trabalho do agitador de calda durante a operação." ItemsSource="{Binding Source={StaticResource ModoAgitadorCaldaValues}}" SelectedItem="{Binding Parametros.Controle.AtuAgitadorModo, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
<TextBlock Text="Quantidade de Bicos" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="Quantidade de bicos conectados e utilizados durante a pulverização." Text="{Binding Parametros.QtdBicos, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
|
|
|
|
<TextBlock Text="Capacidade do Reservatório (L)" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="Capacidade total do reservatório cheio, em litros." Text="{Binding Parametros.CapacidadeReservatorio, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
|
|
|
|
<TextBlock Text="Pressão Linha" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="Pressão de trabalho que a bomba pressurizadora deve manter na linha, em PSI." Text="{Binding Parametros.Controle.AtuPressaoLinha, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
|
|
|
|
<TextBlock Text="Duração Atuação (ms)" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="Tempo adicional que o bico permanece ligado após sair da região com erva detectada." Text="{Binding Parametros.Controle.AtuDuracaoAtuacao, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
|
|
|
|
<TextBlock Text="Início Pulverização (%)" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="Percentual vertical da imagem onde começa a área de pulverização. Valores menores ficam mais acima na imagem." Text="{Binding Parametros.Controle.AtuPercentualInicioPulverizacao, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
|
|
|
|
<TextBlock Text="Altura Área Pulverização" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="Altura da área útil de pulverização na imagem, em percentual, a partir do início configurado." Text="{Binding Parametros.Controle.AtuAlturaAreaPulverizacao, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
|
|
|
|
<TextBlock Text="Ervas Bico On (%)" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="Percentual mínimo de erva detectada na área do bico para ligar a pulverização." Text="{Binding Parametros.Controle.AtuPercentualErvasBicoOn, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ParamTextBoxStyle}"/>
|
|
|
|
<TextBlock Text="Ervas Bico Off (%)" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="Percentual mínimo de erva para manter o bico ligado. Abaixo desse valor, o bico é desligado." 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"/>
|
|
|
|
<TextBlock Text="Horizonte (m)" Style="{StaticResource ParamLabelStyle}"/>
|
|
<TextBox ToolTip="Distância, em metros, que o MPC usa como horizonte de previsão para escolher a melhor trajetória." 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 ToolTip="Distância final do corredor em que o sistema pode antecipar a manobra quando a segmentação não vê mais o corredor, mas o mapa ainda indica que está dentro da rua." 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>
|