Criado tela para acompanhamento do pulverizador
This commit is contained in:
parent
c57393e8e2
commit
93c9aa248e
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
<Line x:Name="CenterLine" Stroke="{StaticResource SprayBrush}" StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" Visibility="Collapsed"/>
|
||||
|
||||
<Rectangle x:Name="SolenoidRect" Width="14" Height="14" RadiusX="2" RadiusY="2" Fill="{StaticResource TextPrimary}" Stroke="{StaticResource CommandOffBrush}" StrokeThickness="3"/>
|
||||
<Rectangle x:Name="SolenoidRect" Width="14" Height="14" RadiusX="2" RadiusY="2" Fill="{StaticResource TextPrimary}" Stroke="{StaticResource CommandOffBrush}" StrokeThickness="3" MouseLeftButtonUp="SolenoidRect_Click" Cursor="Hand"/>
|
||||
</Canvas>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ namespace OperationControl.Controls.Pulverizador
|
|||
SizeChanged += (_, __) => UpdateGeometry();
|
||||
}
|
||||
|
||||
public event Action<int> OnBicoClicked;
|
||||
|
||||
public bool IsCommandOn
|
||||
{
|
||||
get => (bool)GetValue(IsCommandOnProperty);
|
||||
|
|
@ -162,6 +164,16 @@ namespace OperationControl.Controls.Pulverizador
|
|||
|
||||
UpdateVisualState();
|
||||
}
|
||||
|
||||
|
||||
private void SolenoidRect_Click(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
{
|
||||
if (DataContext is BicoModel bico)
|
||||
{
|
||||
OnBicoClicked?.Invoke(bico.Index);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class BicoModel : INotifyPropertyChanged
|
||||
|
|
|
|||
|
|
@ -144,7 +144,8 @@
|
|||
IsSpraying="{Binding IsSpraying}"
|
||||
Vazao="{Binding Vazao}"
|
||||
TempoAtuado="{Binding TempoAtuado}"
|
||||
Atuacoes="{Binding Atuacoes}" />
|
||||
Atuacoes="{Binding Atuacoes}"
|
||||
Loaded="BicoLequeIndicator_Loaded" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using AgroBase.Models;
|
||||
using OperationControl.Controls.Pulverizador;
|
||||
using OperationControl.Models;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
|
||||
|
|
@ -15,6 +16,29 @@ namespace OperationControl.Controls
|
|||
RebuildBicos();
|
||||
}
|
||||
|
||||
private void BicoLequeIndicator_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is BicoLequeIndicator bicoCtrl)
|
||||
{
|
||||
bicoCtrl.OnBicoClicked -= BicoCtrl_OnBicoClicked;
|
||||
bicoCtrl.OnBicoClicked += BicoCtrl_OnBicoClicked;
|
||||
}
|
||||
}
|
||||
|
||||
private void BicoCtrl_OnBicoClicked(int index)
|
||||
{
|
||||
if (!(VariaveisControleOperacao.RoverEmFoco?.Controle?.PulverizadorAutomatico ?? false))
|
||||
{
|
||||
System.Windows.MessageBox.Show("Para acionar os bicos manualmente, é necessário que o Pulverizador Automático esteja desligado", "Pulverizador automático", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
return;
|
||||
}
|
||||
var bico = VariaveisControleOperacao.RoverEmFoco?.DadosLeitura?.Atuador?.Bicos?.FirstOrDefault(x => x.Posicao == (index + 1));
|
||||
if (bico != null)
|
||||
{
|
||||
VariaveisControleOperacao.EnviarComandoAtuador(bico.ID, !bico.ComandoEstado);
|
||||
}
|
||||
}
|
||||
|
||||
public double DistanciaEntreBicosCm
|
||||
{
|
||||
get => (double)GetValue(DistanciaEntreBicosCmProperty);
|
||||
|
|
|
|||
|
|
@ -60,11 +60,25 @@ namespace OperationControl.Models
|
|||
{
|
||||
ComandoEstado = true,
|
||||
LeituraEstado = true,
|
||||
ID = "BOMBA",
|
||||
ID = "BMBLN",
|
||||
ID_Num = 10,
|
||||
Inicializado = true,
|
||||
Potencia = 50,
|
||||
TempoAtuado = 3000
|
||||
ComandoPotencia = 50,
|
||||
LeituraPotencia = 50,
|
||||
TempoAtuado = 3000,
|
||||
ComandoPressao = 85,
|
||||
LeituraPressao = 80,
|
||||
},
|
||||
new AgroBase.Models.Operacoes.OperacaoParametrosDadosBombaModel()
|
||||
{
|
||||
ID = "BMBAGT",
|
||||
ID_Num = 11,
|
||||
ComandoEstado = true,
|
||||
LeituraEstado = false,
|
||||
Inicializado = true,
|
||||
ComandoPotencia = 80,
|
||||
LeituraPotencia = 0,
|
||||
TempoAtuado = 100,
|
||||
}
|
||||
},
|
||||
Bicos = new List<AgroBase.Models.Operacoes.OperacaoParametrosDadosBicoModel>()
|
||||
|
|
@ -96,7 +110,7 @@ namespace OperationControl.Models
|
|||
Inicializado = true,
|
||||
LeituraAngulo = 0,
|
||||
LeituraEstado = false,
|
||||
Posicao = 1,
|
||||
Posicao = 2,
|
||||
QtdAtuacoes = 5,
|
||||
TempoAtuado = 300,
|
||||
VazaoInstantaneaMLs = 15,
|
||||
|
|
@ -113,21 +127,40 @@ namespace OperationControl.Models
|
|||
Inicializado = true,
|
||||
LeituraAngulo = 0,
|
||||
LeituraEstado = true,
|
||||
Posicao = 2,
|
||||
Posicao = 3,
|
||||
QtdAtuacoes = 5,
|
||||
TempoAtuado = 300,
|
||||
VazaoInstantaneaMLs = 15,
|
||||
VazaoMediaMLs = 30,
|
||||
VolumeVazadoML = 325
|
||||
},
|
||||
}
|
||||
},
|
||||
CapacidadeReservatorio = 60,
|
||||
DistanciaEstimadaRestanteMetros = 254.5,
|
||||
ErvasNoRadar = true,
|
||||
HerbicidaConsumidoMl = 1541.32,
|
||||
HerbicidaPorAtuacaoMl = 235.1,
|
||||
Iniciado = true,
|
||||
LPorMetro = 0.36,
|
||||
LPorMinuto = 1.2,
|
||||
MassaReservatorioKg = 25,
|
||||
PercentualErvasNoRadar = 3.4,
|
||||
PercentualErvasTerreno = 36.7,
|
||||
PercentualReservatorio = 47,
|
||||
PressaoLinhaPsi = 84.3,
|
||||
QtdCamerasSolo = 1,
|
||||
TempoEstimadoRestanteMinutos = 60,
|
||||
VazaoInstantaneaMLs = 19.3,
|
||||
VazaoMediaMLs = 15.8,
|
||||
VolumeReservatorioL = 26,
|
||||
VolumeVazaoMl = 1.39,
|
||||
},
|
||||
Controle = new AgroBase.Models.Operacoes.OperacaoParametrosDadosControleModel()
|
||||
{
|
||||
AlturaBarra = 50,
|
||||
Angulo = 0,
|
||||
PercentualVelocidadeSPKmh = 0,
|
||||
TipoMovimento = TipoMovimentoDirecional.RodasDianteiras
|
||||
TipoMovimento = TipoMovimentoDirecional.RodasDianteiras,
|
||||
},
|
||||
Gnss = new AgroBase.Models.Operacoes.OperacaoParametrosDadosGNSSModel()
|
||||
{
|
||||
|
|
@ -153,6 +186,7 @@ namespace OperationControl.Models
|
|||
};
|
||||
r.Controle = new AgroBase.Models.Operacoes.OperacaoParametrosControleModel()
|
||||
{
|
||||
AtuAgitadorModo = ModoAgitadorCalda.Continuo,
|
||||
AtuAlturaAreaPulverizacao = 10,
|
||||
AtuDuracaoAtuacao = 200,
|
||||
AtuPercentualErvasBicoOff = 1,
|
||||
|
|
@ -192,6 +226,14 @@ namespace OperationControl.Models
|
|||
}
|
||||
VariaveisControleOperacao.EnviarDadosHeartbeat();
|
||||
VariaveisControleOperacao.AtualizarListaRoversNaRede();
|
||||
|
||||
if (Mock && AddRover)
|
||||
{
|
||||
System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
Variaveis.Dock?._vm?.AtualizarDadosTela(VariaveisControleOperacao.RoverEmFoco);
|
||||
}));
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,10 +5,11 @@ using System.Windows.Media.Imaging;
|
|||
|
||||
namespace OperationControl.Models
|
||||
{
|
||||
internal class TcpVideoReceiver
|
||||
public class TcpVideoReceiver
|
||||
{
|
||||
private readonly int _port;
|
||||
private readonly System.Windows.Controls.Image _imageControl;
|
||||
public readonly string imageName;
|
||||
|
||||
private volatile bool _rodando;
|
||||
private Thread _thread;
|
||||
|
|
@ -18,6 +19,7 @@ namespace OperationControl.Models
|
|||
{
|
||||
_port = port;
|
||||
_imageControl = imageControl;
|
||||
imageName = imageControl.Name;
|
||||
}
|
||||
|
||||
public void Iniciar()
|
||||
|
|
|
|||
|
|
@ -340,6 +340,8 @@ namespace OperationControl.Models
|
|||
|
||||
public static void EnviarComandoTransmissaoVideo(AgroBase.Models.Enums.T_Code disp, bool ligar, AgroBase.Models.Enums.TipoFrameCamera tipoFrame)
|
||||
{
|
||||
if (string.IsNullOrEmpty(SelectedRoverId) || SelectedRoverId == BaseMarkerID) return;
|
||||
|
||||
EnviarDadosControle(SelectedRoverId, new OperacaoComandoBaseModel()
|
||||
{
|
||||
Momento = DateTime.Now,
|
||||
|
|
|
|||
|
|
@ -58,6 +58,9 @@
|
|||
<Compile Update="Views\Operacao\Monitoramento\MonitoramentoView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\Operacao\Monitoramento\PulverizadorView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\Operacao\Monitoramento\ResumoView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,351 @@
|
|||
using OperationControl.Models;
|
||||
using ScottPlot.Colormaps;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using static AgroBase.Models.Enums;
|
||||
|
||||
namespace OperationControl.ViewModels.Views.Operacao.Monitoramento
|
||||
{
|
||||
public class PulverizadorViewModel : INotifyPropertyChanged
|
||||
{
|
||||
public ObservableCollection<FrameTipoItem> CameraErvasFrameTipos { get; set; }
|
||||
private FrameTipoItem _cameraErvasFrameTipoSelecionado;
|
||||
public FrameTipoItem CameraErvasFrameTipoSelecionado
|
||||
{
|
||||
get => _cameraErvasFrameTipoSelecionado;
|
||||
set
|
||||
{
|
||||
if (_cameraErvasFrameTipoSelecionado != value)
|
||||
{
|
||||
_cameraErvasFrameTipoSelecionado = value;
|
||||
OnPropertyChanged();
|
||||
VariaveisControleOperacao.EnviarComandoTransmissaoVideo(AgroBase.Models.Enums.T_Code.Cam, true, value.Valor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public PulverizadorViewModel()
|
||||
{
|
||||
var itens = Enum.GetValues(typeof(TipoFrameCamera))
|
||||
.Cast<TipoFrameCamera>()
|
||||
.Select(x => new FrameTipoItem
|
||||
{
|
||||
Valor = x,
|
||||
Nome = x.ToString()
|
||||
})
|
||||
.ToList();
|
||||
|
||||
CameraErvasFrameTipos = new ObservableCollection<FrameTipoItem>(itens);
|
||||
CameraErvasFrameTipoSelecionado = CameraErvasFrameTipos.FirstOrDefault();
|
||||
}
|
||||
|
||||
public ObservableCollection<string> EventosPulverizador { get; set; } = new();
|
||||
|
||||
private string _statusGeralPulverizador = "Operando";
|
||||
public string StatusGeralPulverizador
|
||||
{
|
||||
get => _statusGeralPulverizador;
|
||||
set => SetProperty(ref _statusGeralPulverizador, value);
|
||||
}
|
||||
|
||||
private string _cameraErvasTitulo = "Câmera de Ervas";
|
||||
public string CameraErvasTitulo
|
||||
{
|
||||
get => _cameraErvasTitulo;
|
||||
set => SetProperty(ref _cameraErvasTitulo, value);
|
||||
}
|
||||
|
||||
private string _cameraErvasStatus = "Streaming OK";
|
||||
public string CameraErvasStatus
|
||||
{
|
||||
get => _cameraErvasStatus;
|
||||
set => SetProperty(ref _cameraErvasStatus, value);
|
||||
}
|
||||
|
||||
private string _modoPulverizacaoTexto = "Automático";
|
||||
public string ModoPulverizacaoTexto
|
||||
{
|
||||
get => _modoPulverizacaoTexto;
|
||||
set => SetProperty(ref _modoPulverizacaoTexto, value);
|
||||
}
|
||||
|
||||
private string _pulverizacaoLiberadaTexto = "Liberada";
|
||||
public string PulverizacaoLiberadaTexto
|
||||
{
|
||||
get => _pulverizacaoLiberadaTexto;
|
||||
set => SetProperty(ref _pulverizacaoLiberadaTexto, value);
|
||||
}
|
||||
|
||||
private string _statusBombaTexto = "Ligado";
|
||||
public string StatusBombaTexto
|
||||
{
|
||||
get => _statusBombaTexto;
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _statusBombaTexto, value))
|
||||
OnPropertyChanged(nameof(StatusBombaTextoGeral));
|
||||
}
|
||||
}
|
||||
|
||||
private string _statusBombaTextoLido = "Desligado";
|
||||
public string StatusBombaTextoLido
|
||||
{
|
||||
get => _statusBombaTextoLido;
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _statusBombaTextoLido, value))
|
||||
OnPropertyChanged(nameof(StatusBombaTextoGeral));
|
||||
}
|
||||
}
|
||||
|
||||
private string _potenciaBombaValor = "78 %";
|
||||
public string PotenciaBombaValor
|
||||
{
|
||||
get => _potenciaBombaValor;
|
||||
set => SetProperty(ref _potenciaBombaValor, value);
|
||||
}
|
||||
|
||||
private string _potenciaBombaValorLido = "78 %";
|
||||
public string PotenciaBombaValorLido
|
||||
{
|
||||
get => _potenciaBombaValorLido;
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _potenciaBombaValorLido, value))
|
||||
OnPropertyChanged(nameof(StatusBombaTextoGeral));
|
||||
}
|
||||
}
|
||||
|
||||
public string StatusBombaTextoGeral => $"{StatusBombaTexto} ({StatusBombaTextoLido} {PotenciaBombaValorLido})";
|
||||
|
||||
private string _potenciaAgitadorValor = "60 %";
|
||||
public string PotenciaAgitadorValor
|
||||
{
|
||||
get => _potenciaAgitadorValor;
|
||||
set => SetProperty(ref _potenciaAgitadorValor, value);
|
||||
}
|
||||
|
||||
private string _potenciaAgitadorValorLido = "55 %";
|
||||
public string PotenciaAgitadorValorLido
|
||||
{
|
||||
get => _potenciaAgitadorValorLido;
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _potenciaAgitadorValorLido, value))
|
||||
OnPropertyChanged(nameof(ModoAgitadorTextoGeral));
|
||||
}
|
||||
}
|
||||
|
||||
private string _modoAgitadorTexto = "Contínuo";
|
||||
public string ModoAgitadorTexto
|
||||
{
|
||||
get => _modoAgitadorTexto;
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _modoAgitadorTexto, value))
|
||||
OnPropertyChanged(nameof(ModoAgitadorTextoGeral));
|
||||
}
|
||||
}
|
||||
|
||||
public string ModoAgitadorTextoGeral => $"{ModoAgitadorTexto} ({PotenciaAgitadorValorLido})";
|
||||
|
||||
private string _nivelTanqueValor = "63 %";
|
||||
public string NivelTanqueValor
|
||||
{
|
||||
get => _nivelTanqueValor;
|
||||
set => SetProperty(ref _nivelTanqueValor, value);
|
||||
}
|
||||
|
||||
private string _nivelTanqueLitrosValor = "34,3 L";
|
||||
public string NivelTanqueLitrosValor
|
||||
{
|
||||
get => _nivelTanqueLitrosValor;
|
||||
set => SetProperty(ref _nivelTanqueLitrosValor, value);
|
||||
}
|
||||
|
||||
private string _pressaoLinhaValor = "2,8 bar";
|
||||
public string PressaoLinhaValor
|
||||
{
|
||||
get => _pressaoLinhaValor;
|
||||
set => SetProperty(ref _pressaoLinhaValor, value);
|
||||
}
|
||||
|
||||
private string _pressaoLinhaPsiValor = "84,8 psi";
|
||||
public string PressaoLinhaPsiValor
|
||||
{
|
||||
get => _pressaoLinhaPsiValor;
|
||||
set => SetProperty(ref _pressaoLinhaPsiValor, value);
|
||||
}
|
||||
|
||||
private string _vazaoInstantaneaValor = "0,23 L/min";
|
||||
public string VazaoInstantaneaValor
|
||||
{
|
||||
get => _vazaoInstantaneaValor;
|
||||
set => SetProperty(ref _vazaoInstantaneaValor, value);
|
||||
}
|
||||
|
||||
private string _vazaoMediaValor = "média: 0,19 L/min";
|
||||
public string VazaoMediaValor
|
||||
{
|
||||
get => _vazaoMediaValor;
|
||||
set => SetProperty(ref _vazaoMediaValor, value);
|
||||
}
|
||||
|
||||
private string _autonomiaDistanciaValor = "721,2 m";
|
||||
public string AutonomiaDistanciaValor
|
||||
{
|
||||
get => _autonomiaDistanciaValor;
|
||||
set => SetProperty(ref _autonomiaDistanciaValor, value);
|
||||
}
|
||||
|
||||
private string _autonomiaTempoValor = "02:14:10";
|
||||
public string AutonomiaTempoValor
|
||||
{
|
||||
get => _autonomiaTempoValor;
|
||||
set => SetProperty(ref _autonomiaTempoValor, value);
|
||||
}
|
||||
|
||||
private string _volumeVazadoValor = "1,36 L";
|
||||
public string VolumeVazadoValor
|
||||
{
|
||||
get => _volumeVazadoValor;
|
||||
set => SetProperty(ref _volumeVazadoValor, value);
|
||||
}
|
||||
|
||||
private string _tempoLigadoPulverizacaoValor = "00:02:32 ligado";
|
||||
public string TempoLigadoPulverizacaoValor
|
||||
{
|
||||
get => _tempoLigadoPulverizacaoValor;
|
||||
set => SetProperty(ref _tempoLigadoPulverizacaoValor, value);
|
||||
}
|
||||
|
||||
private string _bicosAtivosValor = "7 / 12";
|
||||
public string BicosAtivosValor
|
||||
{
|
||||
get => _bicosAtivosValor;
|
||||
set => SetProperty(ref _bicosAtivosValor, value);
|
||||
}
|
||||
|
||||
private string _infoComplementarBicosValor = "Vazão média: 0,2 mL/s";
|
||||
public string InfoComplementarBicosValor
|
||||
{
|
||||
get => _infoComplementarBicosValor;
|
||||
set => SetProperty(ref _infoComplementarBicosValor, value);
|
||||
}
|
||||
|
||||
private string _percentualErvasRadar = "Radar: 2,5 %";
|
||||
public string PercentualErvasRadar
|
||||
{
|
||||
get => _percentualErvasRadar;
|
||||
set => SetProperty(ref _percentualErvasRadar, value);
|
||||
}
|
||||
|
||||
private string _percentualErvasTerreno = "Terreno: 25,4 %";
|
||||
public string PercentualErvasTerreno
|
||||
{
|
||||
get => _percentualErvasTerreno;
|
||||
set => SetProperty(ref _percentualErvasTerreno, value);
|
||||
}
|
||||
|
||||
public void AtualizarParametrosTela(PulverizadorSnapshot dados)
|
||||
{
|
||||
if (dados == null) return;
|
||||
|
||||
if (dados.StatusGeralPulverizador != null) StatusGeralPulverizador = dados.StatusGeralPulverizador;
|
||||
|
||||
if (dados.CameraErvasStatus != null) CameraErvasStatus = dados.CameraErvasStatus;
|
||||
|
||||
if (dados.ModoPulverizacaoTexto != null) ModoPulverizacaoTexto = dados.ModoPulverizacaoTexto;
|
||||
if (dados.PulverizacaoLiberadaTexto != null) PulverizacaoLiberadaTexto = dados.PulverizacaoLiberadaTexto;
|
||||
|
||||
if (dados.StatusBombaTexto != null) StatusBombaTexto = dados.StatusBombaTexto;
|
||||
if (dados.StatusBombaTextoLido != null) StatusBombaTextoLido = dados.StatusBombaTextoLido;
|
||||
if (dados.PotenciaBombaValor != null) PotenciaBombaValor = dados.PotenciaBombaValor;
|
||||
if (dados.PotenciaBombaValorLido != null) PotenciaBombaValorLido = dados.PotenciaBombaValorLido;
|
||||
|
||||
if (dados.PotenciaAgitadorValor != null) PotenciaAgitadorValor = dados.PotenciaAgitadorValor;
|
||||
if (dados.PotenciaAgitadorValorLido != null) PotenciaAgitadorValorLido = dados.PotenciaAgitadorValorLido;
|
||||
if (dados.ModoAgitadorTexto != null) ModoAgitadorTexto = dados.ModoAgitadorTexto;
|
||||
|
||||
if (dados.NivelTanqueValor != null) NivelTanqueValor = dados.NivelTanqueValor;
|
||||
if (dados.NivelTanqueLitrosValor != null) NivelTanqueLitrosValor = dados.NivelTanqueLitrosValor;
|
||||
|
||||
if (dados.PressaoLinhaValor != null) PressaoLinhaValor = dados.PressaoLinhaValor;
|
||||
if (dados.PressaoLinhaPsiValor != null) PressaoLinhaPsiValor = dados.PressaoLinhaPsiValor;
|
||||
|
||||
if (dados.VazaoInstantaneaValor != null) VazaoInstantaneaValor = dados.VazaoInstantaneaValor;
|
||||
if (dados.VazaoMediaValor != null) VazaoMediaValor = dados.VazaoMediaValor;
|
||||
|
||||
if (dados.AutonomiaDistanciaValor != null) AutonomiaDistanciaValor = dados.AutonomiaDistanciaValor;
|
||||
if (dados.AutonomiaTempoValor != null) AutonomiaTempoValor = dados.AutonomiaTempoValor;
|
||||
|
||||
if (dados.VolumeVazadoValor != null) VolumeVazadoValor = dados.VolumeVazadoValor;
|
||||
if (dados.TempoLigadoPulverizacaoValor != null) TempoLigadoPulverizacaoValor = dados.TempoLigadoPulverizacaoValor;
|
||||
|
||||
if (dados.BicosAtivosValor != null) BicosAtivosValor = dados.BicosAtivosValor;
|
||||
if (dados.InfoComplementarBicosValor != null) InfoComplementarBicosValor = dados.InfoComplementarBicosValor;
|
||||
|
||||
if (dados.PercentualErvasRadar != null) PercentualErvasRadar = dados.PercentualErvasRadar;
|
||||
if (dados.PercentualErvasTerreno != null) PercentualErvasTerreno = dados.PercentualErvasTerreno;
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
|
||||
protected void OnPropertyChanged([CallerMemberName] string? propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
protected bool SetProperty<T>(ref T field, T value, [CallerMemberName] string? propertyName = null)
|
||||
{
|
||||
if (EqualityComparer<T>.Default.Equals(field, value))
|
||||
return false;
|
||||
|
||||
field = value;
|
||||
OnPropertyChanged(propertyName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class PulverizadorSnapshot
|
||||
{
|
||||
public string? StatusGeralPulverizador { get; set; }
|
||||
|
||||
public string? CameraErvasStatus { get; set; }
|
||||
|
||||
public string? ModoPulverizacaoTexto { get; set; }
|
||||
public string? PulverizacaoLiberadaTexto { get; set; }
|
||||
|
||||
public string? StatusBombaTexto { get; set; }
|
||||
public string? StatusBombaTextoLido { get; set; }
|
||||
public string? PotenciaBombaValor { get; set; }
|
||||
public string? PotenciaBombaValorLido { get; set; }
|
||||
|
||||
public string? PotenciaAgitadorValor { get; set; }
|
||||
public string? PotenciaAgitadorValorLido { get; set; }
|
||||
public string? ModoAgitadorTexto { get; set; }
|
||||
|
||||
public string? NivelTanqueValor { get; set; }
|
||||
public string? NivelTanqueLitrosValor { get; set; }
|
||||
|
||||
public string? PressaoLinhaValor { get; set; }
|
||||
public string? PressaoLinhaPsiValor { get; set; }
|
||||
|
||||
public string? VazaoInstantaneaValor { get; set; }
|
||||
public string? VazaoMediaValor { get; set; }
|
||||
|
||||
public string? AutonomiaDistanciaValor { get; set; }
|
||||
public string? AutonomiaTempoValor { get; set; }
|
||||
|
||||
public string? VolumeVazadoValor { get; set; }
|
||||
public string? TempoLigadoPulverizacaoValor { get; set; }
|
||||
|
||||
public string? BicosAtivosValor { get; set; }
|
||||
public string? InfoComplementarBicosValor { get; set; }
|
||||
|
||||
public string? PercentualErvasRadar { get; set; }
|
||||
public string? PercentualErvasTerreno { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -42,6 +42,7 @@ namespace OperationControl.ViewModels.Views.Operacao
|
|||
OnPropertyChanged(nameof(ExibirDiagnostico));
|
||||
OnPropertyChanged(nameof(ExibirMonitoramento));
|
||||
OnPropertyChanged(nameof(ExibirHistorico));
|
||||
OnPropertyChanged(nameof(ExibirPulverizador));
|
||||
OnPropertyChanged(nameof(TituloCentro));
|
||||
OnPropertyChanged(nameof(SubtituloCentro));
|
||||
}
|
||||
|
|
@ -51,6 +52,7 @@ namespace OperationControl.ViewModels.Views.Operacao
|
|||
public bool ExibirDiagnostico => ConteudoAtual == OperacaoCenterConteudo.Diagnostico;
|
||||
public bool ExibirMonitoramento => ConteudoAtual == OperacaoCenterConteudo.Monitoramento;
|
||||
public bool ExibirHistorico => ConteudoAtual == OperacaoCenterConteudo.Historico;
|
||||
public bool ExibirPulverizador => ConteudoAtual == OperacaoCenterConteudo.Pulverizador;
|
||||
|
||||
public string TituloCentro
|
||||
{
|
||||
|
|
@ -104,6 +106,7 @@ namespace OperationControl.ViewModels.Views.Operacao
|
|||
SecaoRightBar.Parametrizacao => OperacaoCenterConteudo.Mapa,
|
||||
SecaoRightBar.Menu => OperacaoCenterConteudo.Monitoramento,
|
||||
SecaoRightBar.Historico => OperacaoCenterConteudo.Historico,
|
||||
SecaoRightBar.Pulverizador => OperacaoCenterConteudo.Pulverizador,
|
||||
|
||||
_ => OperacaoCenterConteudo.Mapa
|
||||
};
|
||||
|
|
@ -147,5 +150,6 @@ namespace OperationControl.ViewModels.Views.Operacao
|
|||
Diagnostico = 2,
|
||||
Monitoramento = 3,
|
||||
Historico = 4,
|
||||
Pulverizador = 5,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,10 +99,10 @@ namespace OperationControl.ViewModels.Views.Operacao
|
|||
}
|
||||
}
|
||||
|
||||
public bool EmMenu => new List<SecaoRightBar>() { SecaoRightBar.Menu, SecaoRightBar.Diagnostico, SecaoRightBar.Historico }.Contains(SecaoAtual);
|
||||
public bool EmResumo => SecaoAtual == SecaoRightBar.Resumo;
|
||||
public bool EmParametrizacao => SecaoAtual == SecaoRightBar.Parametrizacao;
|
||||
public bool EmControle => SecaoAtual == SecaoRightBar.Controle;
|
||||
public bool EmMenu => !EmResumo && !EmControle && !EmParametrizacao;
|
||||
|
||||
public bool BotaoTopoEhVoltar => EmResumo || EmControle || EmParametrizacao;
|
||||
|
||||
|
|
@ -266,6 +266,7 @@ namespace OperationControl.ViewModels.Views.Operacao
|
|||
Parametrizacao = 4,
|
||||
Controle = 5,
|
||||
Historico = 6,
|
||||
Pulverizador = 7,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -958,9 +958,59 @@ namespace OperationControl.ViewModels
|
|||
// DIAGNOSTICO
|
||||
AtualizarDadosDiagnostico(rover);
|
||||
|
||||
// CAMERAS
|
||||
var snr = obj?.Cameras?.FirstOrDefault(x => x.dispositivo == AgroBase.Models.Enums.T_Code.Snr);
|
||||
var cam = obj?.Cameras?.FirstOrDefault(x => x.dispositivo == AgroBase.Models.Enums.T_Code.Cam);
|
||||
|
||||
_viewOperacaoCenter?.Monitoramento?._vm?.AtualizarDadosCameras(snr, cam, obj?.OperadorVisual?.StatusCarro, obj?.Atuador?.PercentualErvasNoRadar);
|
||||
|
||||
// PULVERIZADOR
|
||||
var bomba = obj.Atuador?.Bombas?.FirstOrDefault();
|
||||
var ATU = _viewOperacaoCenter.Monitoramento.Pulverizador;
|
||||
bool telaPulverizador = _viewOperacaoCenter?._vm?.ConteudoAtual == OperacaoCenterConteudo.Pulverizador;
|
||||
var bomba = obj.Atuador?.Bombas?.FirstOrDefault(x => x.ID == "BMBLN");
|
||||
var agitador = obj.Atuador?.Bombas?.FirstOrDefault(x => x.ID == "BMBAGT");
|
||||
if (telaPulverizador)
|
||||
{
|
||||
_viewOperacaoCenter?.Pulverizador?._vm?.AtualizarParametrosTela(new Views.Operacao.Monitoramento.PulverizadorSnapshot()
|
||||
{
|
||||
StatusGeralPulverizador = (obj?.ModulosSaude?.FirstOrDefault(x => x.modulo == T_Code.Atu)?.status ?? StatusModulo.Desconectado).ToString(),
|
||||
|
||||
CameraErvasStatus = _viewOperacaoCenter?.Monitoramento?._vm?.CameraErvasStatus ?? "",
|
||||
|
||||
ModoPulverizacaoTexto = (rover?.Controle?.PulverizadorAutomatico ?? false) ? "Automático" : "Manual",
|
||||
PulverizacaoLiberadaTexto = (obj?.ModulosSaude?.FirstOrDefault(x => x.modulo == T_Code.Atu)?.motivos?.Any() ?? false) ? "Liberado" : "Bloqueado",
|
||||
|
||||
StatusBombaTexto = (bomba?.ComandoEstado ?? false) ? "Ligado": "Desligado",
|
||||
StatusBombaTextoLido = (bomba?.LeituraEstado ?? false) ? "Ligado": "Desligado",
|
||||
PotenciaBombaValor = $"{(bomba?.ComandoPotencia ?? 0):F2} %",
|
||||
PotenciaBombaValorLido = $"{(bomba?.ComandoPotencia ?? 0):F2} %",
|
||||
|
||||
ModoAgitadorTexto = (rover?.Controle?.AtuAgitadorModo ?? ModoAgitadorCalda.SemAgitacao).ToString(),
|
||||
PotenciaAgitadorValor = $"{agitador?.ComandoPotencia ?? 0} %",
|
||||
PotenciaAgitadorValorLido = $"{agitador?.LeituraPotencia ?? 0} %",
|
||||
|
||||
NivelTanqueValor = $"{(obj?.Atuador?.PercentualReservatorio ?? 0):F2} %",
|
||||
NivelTanqueLitrosValor = $"{(obj?.Atuador?.VolumeReservatorioL ?? 0):F2} L",
|
||||
|
||||
PressaoLinhaValor = $"{(rover?.Controle?.AtuPressaoLinha ?? 0):F2} psi",
|
||||
PressaoLinhaPsiValor = $"{(obj?.Atuador?.PressaoLinhaPsi ?? 0):F2} psi",
|
||||
|
||||
VazaoInstantaneaValor = $"{(obj?.Atuador?.VazaoInstantaneaMLs ?? 0):F2} mL/s",
|
||||
VazaoMediaValor = $"média {(obj?.Atuador?.VazaoMediaMLs ?? 0):F2} mL/s",
|
||||
|
||||
AutonomiaDistanciaValor = $"{(obj?.Atuador?.DistanciaEstimadaRestanteMetros ?? 0):F2} m",
|
||||
AutonomiaTempoValor = $"{FuncoesGlobais.ConverterSegundosParaHHmmss((int)(obj?.Atuador?.TempoEstimadoRestanteMinutos ?? 0) * 60)}",
|
||||
|
||||
VolumeVazadoValor = $"{(obj?.Atuador?.VolumeVazaoMl ?? 0):F2} mL",
|
||||
TempoLigadoPulverizacaoValor = $"{FuncoesGlobais.ConverterSegundosParaHHmmss((int)(bomba?.TempoAtuado ?? 0) / 1000)}",
|
||||
|
||||
BicosAtivosValor = $"{(obj?.Atuador?.Bicos?.Count(x => x.ComandoEstado == true) ?? 0)} / {obj?.Atuador?.Bicos?.Count ?? 0}",
|
||||
InfoComplementarBicosValor = $"vazão média: {(obj?.Atuador?.Bicos?.Where(x => x.ComandoEstado == true)?.Average(x => x.VazaoInstantaneaMLs) ?? 0)} mL/s",
|
||||
|
||||
PercentualErvasRadar = $"radar: {(obj?.Atuador?.PercentualErvasNoRadar ?? 0)} %",
|
||||
PercentualErvasTerreno = $"terreno: {(obj?.Atuador?.PercentualErvasTerreno ?? 0)} %",
|
||||
});
|
||||
}
|
||||
var ATU = telaPulverizador ? _viewOperacaoCenter.Pulverizador.areaPulverizador : _viewOperacaoCenter.Monitoramento.Pulverizador;
|
||||
ATU.ComprimentoBarraCm = AgroBase.Models.VariaveisEquipamento.ComprimentoBarraPulverizadoraCm;
|
||||
ATU.DistanciaEntreBicosCm = AgroBase.Models.VariaveisEquipamento.DistanciaEntreBicosCm;
|
||||
//ATU.AlturaBarra = obj?.Controle?.AlturaBarra ?? AgroBase.Models.VariaveisEquipamento.AlturaBarraPulverizadoraCm;
|
||||
|
|
@ -968,16 +1018,13 @@ namespace OperationControl.ViewModels
|
|||
ATU.PressaoLinha = obj?.Atuador?.PressaoLinhaPsi ?? 0;
|
||||
ATU.VazaoInstantanea = obj?.Atuador?.VazaoInstantaneaMLs ?? 0;
|
||||
ATU.TempoAtuado = (bomba?.TempoAtuado ?? 0) / 1000.0;
|
||||
|
||||
double erroLateral = ((obj?.Trajetoria?.DistanciaEsquerda ?? 0) - (obj?.Trajetoria?.DistanciaDireita ?? 0)) / 2.0 * 100.0;
|
||||
ATU.LarguraRuaCm = 100.0;
|
||||
ATU.ErroLateralCm = erroLateral;
|
||||
|
||||
if (ATU.QtdBicos != obj?.Atuador?.Bicos?.Count)
|
||||
{
|
||||
ATU.QtdBicos = obj?.Atuador?.Bicos?.Count ?? AgroBase.Models.VariaveisEquipamento.QuantidadeBicosPulverizadores;
|
||||
}
|
||||
|
||||
foreach (var bico in ATU.Bicos)
|
||||
{
|
||||
var _bc = obj?.Atuador?.Bicos?.FirstOrDefault(x => (x.Posicao - 1) == bico.Index);
|
||||
|
|
@ -1003,11 +1050,7 @@ namespace OperationControl.ViewModels
|
|||
if (obj?.Imu?.InclinacaoLateral != null) IMU.RollDeg = (double)obj.Imu.InclinacaoLateral;
|
||||
IMU.LateralError = erroLateral;
|
||||
|
||||
// CAMERAS
|
||||
var snr = obj?.Cameras?.FirstOrDefault(x => x.dispositivo == AgroBase.Models.Enums.T_Code.Snr);
|
||||
var cam = obj?.Cameras?.FirstOrDefault(x => x.dispositivo == AgroBase.Models.Enums.T_Code.Cam);
|
||||
|
||||
_viewOperacaoCenter?.Monitoramento?._vm?.AtualizarDadosCameras(snr, cam, obj?.OperadorVisual?.StatusCarro, obj?.Atuador?.PercentualErvasNoRadar);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1085,8 +1128,29 @@ namespace OperationControl.ViewModels
|
|||
}
|
||||
private void OnSecaoSelecionadaChanged(SecaoRightBar secao)
|
||||
{
|
||||
if (secao == SecaoRightBar.Parametrizacao)
|
||||
VariaveisControleOperacao.RequisitarParametrosOperacao();
|
||||
switch (secao)
|
||||
{
|
||||
case SecaoRightBar.Parametrizacao:
|
||||
VariaveisControleOperacao.RequisitarParametrosOperacao();
|
||||
break;
|
||||
case SecaoRightBar.Pulverizador:
|
||||
if (_viewOperacaoCenter.Monitoramento.videoWeed.imageName != _viewOperacaoCenter.Pulverizador.imgVideo.Name)
|
||||
{
|
||||
_viewOperacaoCenter.Monitoramento.videoWeed.Parar();
|
||||
_viewOperacaoCenter.Monitoramento.videoWeed = new TcpVideoReceiver(5002, _viewOperacaoCenter.Pulverizador.imgVideo);
|
||||
_viewOperacaoCenter.Monitoramento.videoWeed.Iniciar();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (_viewOperacaoCenter.Monitoramento.videoWeed.imageName != _viewOperacaoCenter.Monitoramento.imgVideoWeed.Name)
|
||||
{
|
||||
_viewOperacaoCenter.Monitoramento.videoWeed.Parar();
|
||||
_viewOperacaoCenter.Monitoramento.videoWeed = new TcpVideoReceiver(5002, _viewOperacaoCenter.Monitoramento.imgVideoWeed);
|
||||
_viewOperacaoCenter.Monitoramento.videoWeed.Iniciar();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
_viewOperacaoCenter?._vm?.DefinirSecao(secao);
|
||||
AtualizarDadosMapa(VariaveisControleOperacao.RoverEmFoco);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace OperationControl.Views.Operacao.Monitoramento
|
|||
public MonitoramentoViewModel _vm;
|
||||
|
||||
private TcpVideoReceiver videoFront;
|
||||
private TcpVideoReceiver videoWeed;
|
||||
public TcpVideoReceiver videoWeed;
|
||||
public PulverizadorIndicator Pulverizador => areaPulverizador;
|
||||
public HeadingIndicator Heading => areaHeading;
|
||||
public AttitudeIndicator Attitude => areaAttitude;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,345 @@
|
|||
<UserControl x:Class="OperationControl.Views.Operacao.Monitoramento.PulverizadorView"
|
||||
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:controls="clr-namespace:OperationControl.Controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="900" d:DesignWidth="1600">
|
||||
|
||||
<UserControl.Resources>
|
||||
<SolidColorBrush x:Key="BgPage" Color="#141414"/>
|
||||
<SolidColorBrush x:Key="BgPanel" Color="#202020"/>
|
||||
<SolidColorBrush x:Key="BgPanelSoft" Color="#262626"/>
|
||||
<SolidColorBrush x:Key="BorderPanel" Color="#353535"/>
|
||||
<SolidColorBrush x:Key="TextMain" Color="#F0F0F0"/>
|
||||
<SolidColorBrush x:Key="TextSoft" Color="#BDBDBD"/>
|
||||
<SolidColorBrush x:Key="TextMuted" Color="#8E8E8E"/>
|
||||
<SolidColorBrush x:Key="AccentBlue" Color="#44B3FF"/>
|
||||
<SolidColorBrush x:Key="AccentGreen" Color="#47D16C"/>
|
||||
<SolidColorBrush x:Key="AccentOrange" Color="#FFB347"/>
|
||||
<SolidColorBrush x:Key="AccentPurple" Color="#B07CFF"/>
|
||||
|
||||
<Style x:Key="PanelBorderStyle" TargetType="Border">
|
||||
<Setter Property="Background" Value="{StaticResource BgPanel}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource BorderPanel}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CornerRadius" Value="12"/>
|
||||
<Setter Property="Padding" Value="10"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CardBorderStyle" TargetType="Border">
|
||||
<Setter Property="Background" Value="{StaticResource BgPanelSoft}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource BorderPanel}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CornerRadius" Value="12"/>
|
||||
<Setter Property="Padding" Value="12"/>
|
||||
<Setter Property="Margin" Value="4"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CardTitleStyle" TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{StaticResource TextSoft}"/>
|
||||
<Setter Property="FontSize" Value="11"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CardValueStyle" TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{StaticResource TextMain}"/>
|
||||
<Setter Property="FontSize" Value="24"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="Margin" Value="0,6,0,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CardSubValueStyle" TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{StaticResource TextMuted}"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Margin" Value="0,2,0,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="IconStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontFamily" Value="Segoe MDL2 Assets"/>
|
||||
<Setter Property="FontSize" Value="16"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Margin" Value="0,0,8,0"/>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Margin="12" Background="{StaticResource BgPage}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.9*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- ESQUERDA -->
|
||||
<Grid Grid.Column="0" Margin="0,0,8,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="4*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- VIDEO -->
|
||||
<Border Grid.Row="0" Margin="0,0,0,8" Style="{StaticResource PanelBorderStyle}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<DockPanel Grid.Row="0" Margin="0,0,0,8" LastChildFill="False">
|
||||
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
|
||||
<TextBlock Text="" Style="{StaticResource IconStyle}" Foreground="{StaticResource AccentBlue}"/>
|
||||
<TextBlock Text="{Binding CameraErvasTitulo}"
|
||||
FontSize="13"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="{StaticResource TextMain}"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="{Binding CameraErvasStatus}"
|
||||
DockPanel.Dock="Right"
|
||||
Margin="12,0,8,0"
|
||||
Foreground="{StaticResource TextMuted}"
|
||||
FontSize="11"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<ComboBox DockPanel.Dock="Right"
|
||||
Width="140"
|
||||
Height="28"
|
||||
ItemsSource="{Binding CameraErvasFrameTipos}"
|
||||
SelectedItem="{Binding CameraErvasFrameTipoSelecionado, Mode=TwoWay}"
|
||||
DisplayMemberPath="Nome"/>
|
||||
</DockPanel>
|
||||
|
||||
<Border Grid.Row="1"
|
||||
Background="#111111"
|
||||
CornerRadius="8"
|
||||
BorderBrush="#2E2E2E"
|
||||
BorderThickness="1">
|
||||
<Grid>
|
||||
<Image x:Name="imgVideo" Stretch="Uniform" RenderOptions.BitmapScalingMode="LowQuality"/>
|
||||
<TextBlock Text="SEM SINAL"
|
||||
Foreground="#666666"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- PULVERIZADOR -->
|
||||
<Border Grid.Row="1" Style="{StaticResource PanelBorderStyle}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,8">
|
||||
<TextBlock Text="" Style="{StaticResource IconStyle}" Foreground="{StaticResource AccentGreen}"/>
|
||||
<TextBlock Text="Pulverizador"
|
||||
FontSize="13"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="{StaticResource TextMain}"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<controls:PulverizadorIndicator Grid.Row="1"
|
||||
x:Name="areaPulverizador"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- DIREITA -->
|
||||
<Grid Grid.Column="1" Margin="8,0,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- RESUMO -->
|
||||
<Border Grid.Row="0" Margin="0,0,0,8" Style="{StaticResource PanelBorderStyle}">
|
||||
<StackPanel>
|
||||
<TextBlock Text="Resumo operacional"
|
||||
Margin="0,0,0,10"
|
||||
FontSize="12"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="{StaticResource TextMain}"/>
|
||||
|
||||
<Grid Margin="0,0,0,6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Modo" Foreground="{StaticResource TextSoft}"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding ModoPulverizacaoTexto}" Foreground="{StaticResource TextMain}" FontWeight="SemiBold"/>
|
||||
</Grid>
|
||||
|
||||
<Grid Margin="0,0,0,6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Pulverização" Foreground="{StaticResource TextSoft}"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding PulverizacaoLiberadaTexto}" Foreground="{StaticResource AccentGreen}" FontWeight="SemiBold"/>
|
||||
</Grid>
|
||||
|
||||
<Grid Margin="0,0,0,6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Bomba" Foreground="{StaticResource TextSoft}"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding StatusBombaTexto}" Foreground="{StaticResource TextMain}" FontWeight="SemiBold"/>
|
||||
</Grid>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Agitador" Foreground="{StaticResource TextSoft}"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding ModoAgitadorTexto}" Foreground="{StaticResource AccentPurple}" FontWeight="SemiBold"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- CARDS -->
|
||||
<UniformGrid Grid.Row="1" Columns="2" Margin="0,0,0,8">
|
||||
|
||||
<Border Style="{StaticResource CardBorderStyle}">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" Style="{StaticResource IconStyle}" Foreground="{StaticResource AccentGreen}"/>
|
||||
<TextBlock Text="Nível do tanque" Style="{StaticResource CardTitleStyle}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding NivelTanqueValor}" Style="{StaticResource CardValueStyle}"/>
|
||||
<TextBlock Text="{Binding NivelTanqueLitrosValor}" Style="{StaticResource CardSubValueStyle}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Border Style="{StaticResource CardBorderStyle}">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" Style="{StaticResource IconStyle}" Foreground="{StaticResource AccentOrange}"/>
|
||||
<TextBlock Text="Pressão" Style="{StaticResource CardTitleStyle}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding PressaoLinhaValor}" Style="{StaticResource CardValueStyle}"/>
|
||||
<TextBlock Text="{Binding PressaoLinhaPsiValor}" Style="{StaticResource CardSubValueStyle}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Border Style="{StaticResource CardBorderStyle}">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" Style="{StaticResource IconStyle}" Foreground="{StaticResource AccentBlue}"/>
|
||||
<TextBlock Text="Vazão" Style="{StaticResource CardTitleStyle}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding VazaoInstantaneaValor}" Style="{StaticResource CardValueStyle}"/>
|
||||
<TextBlock Text="{Binding VazaoMediaValor}" Style="{StaticResource CardSubValueStyle}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Border Style="{StaticResource CardBorderStyle}">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" Style="{StaticResource IconStyle}" Foreground="{StaticResource AccentGreen}"/>
|
||||
<TextBlock Text="Bomba" Style="{StaticResource CardTitleStyle}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding PotenciaBombaValor}" Style="{StaticResource CardValueStyle}"/>
|
||||
<TextBlock Text="{Binding StatusBombaTextoGeral}" Style="{StaticResource CardSubValueStyle}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Border Style="{StaticResource CardBorderStyle}">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" Style="{StaticResource IconStyle}" Foreground="{StaticResource AccentPurple}"/>
|
||||
<TextBlock Text="Agitador" Style="{StaticResource CardTitleStyle}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding PotenciaAgitadorValor}" Style="{StaticResource CardValueStyle}"/>
|
||||
<TextBlock Text="{Binding ModoAgitadorTextoGeral}" Style="{StaticResource CardSubValueStyle}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Border Style="{StaticResource CardBorderStyle}">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" Style="{StaticResource IconStyle}" Foreground="{StaticResource AccentBlue}"/>
|
||||
<TextBlock Text="Autonomia" Style="{StaticResource CardTitleStyle}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding AutonomiaDistanciaValor}" Style="{StaticResource CardValueStyle}"/>
|
||||
<TextBlock Text="{Binding AutonomiaTempoValor}" Style="{StaticResource CardSubValueStyle}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Border Style="{StaticResource CardBorderStyle}">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" Style="{StaticResource IconStyle}" Foreground="{StaticResource AccentBlue}"/>
|
||||
<TextBlock Text="Volume aplicado" Style="{StaticResource CardTitleStyle}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding VolumeVazadoValor}" Style="{StaticResource CardValueStyle}"/>
|
||||
<TextBlock Text="{Binding TempoLigadoPulverizacaoValor}" Style="{StaticResource CardSubValueStyle}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Border Style="{StaticResource CardBorderStyle}">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" Style="{StaticResource IconStyle}" Foreground="{StaticResource AccentOrange}"/>
|
||||
<TextBlock Text="Bicos ativos" Style="{StaticResource CardTitleStyle}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding BicosAtivosValor}" Style="{StaticResource CardValueStyle}"/>
|
||||
<TextBlock Text="{Binding InfoComplementarBicosValor}" Style="{StaticResource CardSubValueStyle}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Border Style="{StaticResource CardBorderStyle}">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" Style="{StaticResource IconStyle}" Foreground="{StaticResource AccentGreen}"/>
|
||||
<TextBlock Text="Detecção de Ervas" Style="{StaticResource CardTitleStyle}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding PercentualErvasRadar}" Style="{StaticResource CardValueStyle}"/>
|
||||
<TextBlock Text="{Binding PercentualErvasTerreno}" Style="{StaticResource CardSubValueStyle}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
</UniformGrid>
|
||||
|
||||
<!-- EVENTOS -->
|
||||
<Border Grid.Row="2" Style="{StaticResource PanelBorderStyle}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="0" Margin="0,0,0,8">
|
||||
<TextBlock Text="" Style="{StaticResource IconStyle}" Foreground="{StaticResource AccentOrange}"/>
|
||||
<TextBlock Text="Eventos e diagnósticos"
|
||||
FontSize="12"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="{StaticResource TextMain}"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<ListBox Grid.Row="1"
|
||||
ItemsSource="{Binding EventosPulverizador}"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Foreground="{StaticResource TextMain}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
using OperationControl.Models;
|
||||
using OperationControl.ViewModels.Views.Operacao.Monitoramento;
|
||||
|
||||
namespace OperationControl.Views.Operacao.Monitoramento
|
||||
{
|
||||
/// <summary>
|
||||
/// Interação lógica para PulverizadorView.xam
|
||||
/// </summary>
|
||||
public partial class PulverizadorView : System.Windows.Controls. UserControl
|
||||
{
|
||||
public PulverizadorViewModel _vm;
|
||||
|
||||
private TcpVideoReceiver video;
|
||||
|
||||
public PulverizadorView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_vm = new PulverizadorViewModel();
|
||||
DataContext = _vm;
|
||||
|
||||
video = new TcpVideoReceiver(5002, imgVideo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -38,5 +38,10 @@
|
|||
<views:HistoricoView x:Name="areaHistorico"/>
|
||||
</Grid>
|
||||
|
||||
<!-- PULVERIZADOR -->
|
||||
<Grid Visibility="{Binding ExibirPulverizador, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<views:PulverizadorView x:Name="areaPulverizador"/>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
|
@ -14,6 +14,7 @@ namespace OperationControl.Views.Operacao
|
|||
public MonitoramentoView Monitoramento => areaMonitor;
|
||||
public DiagnosticoView Diagnostico => areaDiagnostico;
|
||||
public HistoricoView Historico => areaHistorico;
|
||||
public PulverizadorView Pulverizador => areaPulverizador;
|
||||
|
||||
public OperacaoCenterView()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -22,13 +22,8 @@
|
|||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="10"
|
||||
Padding="12">
|
||||
<ContentPresenter HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="10" Padding="12">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
|
|
@ -54,8 +49,7 @@
|
|||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
|
@ -211,6 +205,8 @@
|
|||
|
||||
<Button Content="Resumo ▶" Style="{StaticResource MenuButtonStyle}" Command="{Binding SelecionarSecaoCommand}" CommandParameter="Resumo"/>
|
||||
|
||||
<Button Content="Pulverizador" Style="{StaticResource MenuButtonStyle}" Command="{Binding SelecionarSecaoCommand}" CommandParameter="Pulverizador"/>
|
||||
|
||||
<Button Content="Histórico" Style="{StaticResource MenuButtonStyle}" Command="{Binding SelecionarSecaoCommand}" CommandParameter="Historico"/>
|
||||
</StackPanel>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue