metodo para fixação da base e aplicação de offset global
This commit is contained in:
parent
f3476d6773
commit
a6d9a7271a
|
|
@ -9,8 +9,7 @@ using AgroBase.Models;
|
||||||
using static AgroBase.Models.Enums;
|
using static AgroBase.Models.Enums;
|
||||||
using OperationControl.Models;
|
using OperationControl.Models;
|
||||||
using Application = System.Windows.Application;
|
using Application = System.Windows.Application;
|
||||||
using Mapsui.Animations;
|
using static OperationControl.Services.BaseFixService;
|
||||||
using OperationControl.ViewModels;
|
|
||||||
|
|
||||||
namespace OperationControl.Services
|
namespace OperationControl.Services
|
||||||
{
|
{
|
||||||
|
|
@ -233,7 +232,7 @@ namespace OperationControl.Services
|
||||||
private int rtk_timeout = 60;
|
private int rtk_timeout = 60;
|
||||||
public GPSModel UltimaLeitura = new GPSModel();
|
public GPSModel UltimaLeitura = new GPSModel();
|
||||||
public BaseFixService BaseFix;
|
public BaseFixService BaseFix;
|
||||||
private GeoLeverArm LeverArm;
|
public GeoLeverArm LeverArm = new GeoLeverArm();
|
||||||
|
|
||||||
private readonly StringBuilder _nmeaBuffer = new();
|
private readonly StringBuilder _nmeaBuffer = new();
|
||||||
private bool _nmeaInSentence = false;
|
private bool _nmeaInSentence = false;
|
||||||
|
|
@ -242,13 +241,14 @@ namespace OperationControl.Services
|
||||||
private List<byte> _rtcmMsg = new();
|
private List<byte> _rtcmMsg = new();
|
||||||
private int _rtcmTotalBytes = -1;
|
private int _rtcmTotalBytes = -1;
|
||||||
|
|
||||||
public async Task ConfigurarModulo(bool fixar, MetodoFixacaoBase metodo = MetodoFixacaoBase.Ntrip, double? lat = null, double? lon = null, double? alt = null)
|
public async Task ConfigurarModulo(bool fixar, MetodoFixacaoBase metodo = MetodoFixacaoBase.Ntrip, double? lat = null, double? lon = null, double? alt = null, bool? offset = false)
|
||||||
{
|
{
|
||||||
Models.Variaveis.MostrarLog("Iniciando configuração do módulo GPS...");
|
Models.Variaveis.MostrarLog("Iniciando configuração do módulo GPS...");
|
||||||
|
|
||||||
LeverArm = new GeoLeverArm(VariaveisControleOperacao.LeverArmFrontal, VariaveisControleOperacao.LeverArmLateral);
|
if (!(offset ?? false))
|
||||||
|
{
|
||||||
BaseFix = new BaseFixService(PortaGps, this);
|
BaseFix = new BaseFixService(PortaGps, this);
|
||||||
|
}
|
||||||
BaseFix.FixLiberado = fixar;
|
BaseFix.FixLiberado = fixar;
|
||||||
|
|
||||||
string portaUsb = "com3";
|
string portaUsb = "com3";
|
||||||
|
|
@ -268,101 +268,73 @@ namespace OperationControl.Services
|
||||||
bool sucesso = false;
|
bool sucesso = false;
|
||||||
string mensagem = "";
|
string mensagem = "";
|
||||||
|
|
||||||
|
|
||||||
|
BaseFix.fimProcesso = null;
|
||||||
|
BaseFix.inicioProcesso = DateTime.UtcNow;
|
||||||
|
BaseFix.inicioFix = DateTime.UtcNow;
|
||||||
|
|
||||||
|
Models.Variaveis.MostrarLog($"Aplicando posição fixa da base com o método {metodo}...");
|
||||||
|
|
||||||
switch (metodo)
|
switch (metodo)
|
||||||
{
|
{
|
||||||
case MetodoFixacaoBase.Ntrip:
|
case MetodoFixacaoBase.Ntrip:
|
||||||
{
|
sucesso = await BaseFix.FixarBaseViaNtripAsync(
|
||||||
Models.Variaveis.MostrarLog("Tentando fixação da base via NTRIP...");
|
portaUsb: portaUsb,
|
||||||
|
portaSaida: portaSaida,
|
||||||
sucesso = await BaseFix.FixarBaseViaNtripAsync(
|
portaEntrada: portaEntrada,
|
||||||
portaUsb: portaUsb,
|
startNtrip: () =>
|
||||||
portaSaida: portaSaida,
|
|
||||||
portaEntrada: portaEntrada,
|
|
||||||
startNtrip: () =>
|
|
||||||
{
|
|
||||||
Models.Variaveis.MostrarLog("Iniciando correção NTRIP...");
|
|
||||||
CorrecaoRTK_Ntrip = true;
|
|
||||||
_ = Task.Run(async () => await AplicarCorrecaoRTK_Ntrip());
|
|
||||||
return Task.CompletedTask;
|
|
||||||
},
|
|
||||||
stopNtrip: () =>
|
|
||||||
{
|
|
||||||
Models.Variaveis.MostrarLog("Parando correção NTRIP...");
|
|
||||||
CorrecaoRTK_Ntrip = false;
|
|
||||||
return Task.CompletedTask;
|
|
||||||
},
|
|
||||||
segsFixEstavel: TempoSurveryIn
|
|
||||||
);
|
|
||||||
|
|
||||||
if (sucesso)
|
|
||||||
{
|
{
|
||||||
mensagem = "Posição fixada utilizando NTRIP com sucesso!";
|
Models.Variaveis.MostrarLog("Iniciando correção NTRIP...");
|
||||||
}
|
CorrecaoRTK_Ntrip = true;
|
||||||
else
|
_ = Task.Run(async () => await AplicarCorrecaoRTK_Ntrip());
|
||||||
|
return Task.CompletedTask;
|
||||||
|
},
|
||||||
|
stopNtrip: () =>
|
||||||
{
|
{
|
||||||
Models.Variaveis.MostrarLog("Falha na fixação via NTRIP. Iniciando Survey-In...");
|
Models.Variaveis.MostrarLog("Parando correção NTRIP...");
|
||||||
|
CorrecaoRTK_Ntrip = false;
|
||||||
BaseFix.fimProcesso = null;
|
return Task.CompletedTask;
|
||||||
BaseFix.inicioProcesso = DateTime.UtcNow;
|
},
|
||||||
BaseFix.inicioFix = DateTime.UtcNow;
|
segsFixEstavel: TempoSurveryIn
|
||||||
|
);
|
||||||
await ConfigurarModuloBase(
|
break;
|
||||||
tempo_fixacao: TempoSurveryIn,
|
|
||||||
porta_usb: portaUsb,
|
|
||||||
porta_saida: portaSaida);
|
|
||||||
|
|
||||||
BaseFix.fimProcesso = DateTime.UtcNow;
|
|
||||||
|
|
||||||
sucesso = true;
|
|
||||||
mensagem = "Posição survery in da base aplicada com sucesso.";
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case MetodoFixacaoBase.SurveyIn:
|
case MetodoFixacaoBase.SurveyIn:
|
||||||
{
|
await ConfigurarModuloBase(tempo_fixacao: TempoSurveryIn, porta_usb: portaUsb, porta_saida: portaSaida);
|
||||||
Models.Variaveis.MostrarLog("Configurando módulo como base em Survey-In...");
|
break;
|
||||||
|
|
||||||
BaseFix.fimProcesso = null;
|
|
||||||
BaseFix.inicioProcesso = DateTime.UtcNow;
|
|
||||||
BaseFix.inicioFix = DateTime.UtcNow;
|
|
||||||
|
|
||||||
await ConfigurarModuloBase(
|
|
||||||
tempo_fixacao: TempoSurveryIn,
|
|
||||||
porta_usb: portaUsb,
|
|
||||||
porta_saida: portaSaida);
|
|
||||||
|
|
||||||
BaseFix.fimProcesso = DateTime.UtcNow;
|
|
||||||
|
|
||||||
sucesso = true;
|
|
||||||
mensagem = "Posição survery in da base aplicada com sucesso.";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case MetodoFixacaoBase.Manual:
|
case MetodoFixacaoBase.Manual:
|
||||||
{
|
if (lat.HasValue && lon.HasValue && alt.HasValue)
|
||||||
if (!lat.HasValue || !lon.HasValue || !alt.HasValue)
|
await BaseFix.AplicarBaseFixAsync(portaUsb, portaSaida, baseId, lat.Value, lon.Value, alt.Value);
|
||||||
throw new ArgumentException("Latitude, longitude e altitude elipsoidal são obrigatórias no modo manual.");
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
Models.Variaveis.MostrarLog("Aplicando posição manual fixa da base...");
|
// Aguarda 10 segundos para ver se o UM982 pegou o BaseFix
|
||||||
|
while (sucesso && UltimaLeitura.QualidadeFix != TiposCorrecaoGPS.BaseFix && BaseFix.inicioFix != null && (DateTime.UtcNow - BaseFix.inicioFix).Value.TotalSeconds < 10)
|
||||||
|
{
|
||||||
|
await Task.Delay(1000);
|
||||||
|
}
|
||||||
|
|
||||||
UltimaLeitura.Latitude = lat.Value;
|
BaseFix.fimProcesso = DateTime.UtcNow;
|
||||||
UltimaLeitura.Longitude = lon.Value;
|
BaseFix.FixLiberado = false;
|
||||||
AtualizarCoordenadasGPS();
|
|
||||||
|
|
||||||
await BaseFix.AplicarBaseFixAsync(
|
sucesso = UltimaLeitura.QualidadeFix == TiposCorrecaoGPS.BaseFix;
|
||||||
portaUsb,
|
mensagem = sucesso ? $"Posição da base aplicada com sucesso com o método {metodo}." : $"Falha ao aplicar posição da base com o método {metodo}.";
|
||||||
portaSaida,
|
|
||||||
baseId,
|
|
||||||
lat.Value,
|
|
||||||
lon.Value,
|
|
||||||
alt.Value);
|
|
||||||
|
|
||||||
sucesso = true;
|
if (sucesso && !(offset ?? false))
|
||||||
mensagem = "Posição manual da base aplicada com sucesso.";
|
{
|
||||||
break;
|
BaseFix.LatitudeFix = UltimaLeitura.Latitude;
|
||||||
}
|
BaseFix.LongitudeFix = UltimaLeitura.Longitude;
|
||||||
|
BaseFix.AltitudeElpsoidalFix = UltimaLeitura.AltitudeElipsoidal;
|
||||||
|
BaseFix.OrientacaoFix = UltimaLeitura.OrientacaoReal;
|
||||||
|
|
||||||
|
if (AppShell.Mock)
|
||||||
|
{
|
||||||
|
UltimaLeitura.Latitude = lat.Value;
|
||||||
|
UltimaLeitura.Longitude = lon.Value;
|
||||||
|
UltimaLeitura.AltitudeElipsoidal = alt.Value;
|
||||||
|
AtualizarCoordenadasGPS();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Models.Variaveis.MostrarLog(mensagem);
|
Models.Variaveis.MostrarLog(mensagem);
|
||||||
|
|
@ -1304,6 +1276,10 @@ namespace OperationControl.Services
|
||||||
public bool CorrecaoAbsoluta = false;
|
public bool CorrecaoAbsoluta = false;
|
||||||
public bool CorrecaoEmAndamento = false;
|
public bool CorrecaoEmAndamento = false;
|
||||||
public bool FixLiberado = false;
|
public bool FixLiberado = false;
|
||||||
|
public double LatitudeFix { get; set; }
|
||||||
|
public double LongitudeFix { get; set; }
|
||||||
|
public double AltitudeElpsoidalFix { get; set; }
|
||||||
|
public double OrientacaoFix { get; set; }
|
||||||
|
|
||||||
public void ReiniciarFix()
|
public void ReiniciarFix()
|
||||||
{
|
{
|
||||||
|
|
@ -1321,7 +1297,6 @@ namespace OperationControl.Services
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
CorrecaoEmAndamento = true;
|
CorrecaoEmAndamento = true;
|
||||||
fimProcesso = null;
|
|
||||||
|
|
||||||
segundosFixEstavel = segsFixEstavel;
|
segundosFixEstavel = segsFixEstavel;
|
||||||
maxJanelaSegundos = maxJanelaSegs;
|
maxJanelaSegundos = maxJanelaSegs;
|
||||||
|
|
@ -1349,26 +1324,22 @@ namespace OperationControl.Services
|
||||||
{
|
{
|
||||||
Models.Variaveis.MostrarLog("Poucas amostras de RTK FIX coletadas. Tente aumentar o tempo ou verificar sinais.");
|
Models.Variaveis.MostrarLog("Poucas amostras de RTK FIX coletadas. Tente aumentar o tempo ou verificar sinais.");
|
||||||
CorrecaoAbsoluta = false;
|
CorrecaoAbsoluta = false;
|
||||||
FixLiberado = false;
|
|
||||||
return CorrecaoAbsoluta;
|
return CorrecaoAbsoluta;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3) Filtro robusto (MAD) + média final
|
// 3) Filtro robusto (MAD) + média final
|
||||||
var (lat, lon, h, nAmostras) = FiltrarEAgrupar(amostras, madK);
|
var (lat, lon, h, heading, nAmostras) = FiltrarEAgrupar(amostras, madK);
|
||||||
|
|
||||||
// 4) Alternar para base FIX + perfil RTCM
|
// 4) Alternar para base FIX + perfil RTCM
|
||||||
await AplicarBaseFixAsync(portaUsb, portaSaida, baseId, lat, lon, h);
|
await AplicarBaseFixAsync(portaUsb, portaSaida, baseId, lat, lon, h);
|
||||||
|
|
||||||
Models.Variaveis.MostrarLog($"[BASE/FIX] Coordenadas aplicadas (n={nAmostras}):");
|
Models.Variaveis.MostrarLog($"[BASE/FIX] Coordenadas aplicadas (n={nAmostras}): lat = {lat:0.000000000}, lon = {lon:0.000000000}, h = {h:0.000}");
|
||||||
Models.Variaveis.MostrarLog($" lat = {lat:0.000000000}, lon = {lon:0.000000000}, h = {h:0.000}");
|
|
||||||
CorrecaoAbsoluta = true;
|
CorrecaoAbsoluta = true;
|
||||||
FixLiberado = false;
|
|
||||||
return CorrecaoAbsoluta;
|
return CorrecaoAbsoluta;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
if (stopNtrip != null) await stopNtrip();
|
if (stopNtrip != null) await stopNtrip();
|
||||||
fimProcesso = DateTime.UtcNow;
|
|
||||||
CorrecaoEmAndamento = false;
|
CorrecaoEmAndamento = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1499,6 +1470,7 @@ namespace OperationControl.Services
|
||||||
double lat = ultimaLeitura.Latitude;
|
double lat = ultimaLeitura.Latitude;
|
||||||
double lon = ultimaLeitura.Longitude;
|
double lon = ultimaLeitura.Longitude;
|
||||||
double altElips = ultimaLeitura.AltitudeElipsoidal; // garanta que já é elipsoidal no parser
|
double altElips = ultimaLeitura.AltitudeElipsoidal; // garanta que já é elipsoidal no parser
|
||||||
|
double heading = ultimaLeitura.OrientacaoReal;
|
||||||
var fixQual = ultimaLeitura.QualidadeFix; // enum? ok.
|
var fixQual = ultimaLeitura.QualidadeFix; // enum? ok.
|
||||||
|
|
||||||
int hbAfter = ultimaLeitura.Heartbeat;
|
int hbAfter = ultimaLeitura.Heartbeat;
|
||||||
|
|
@ -1515,6 +1487,7 @@ namespace OperationControl.Services
|
||||||
latDeg: lat,
|
latDeg: lat,
|
||||||
lonDeg: lon,
|
lonDeg: lon,
|
||||||
altElipsoidalM: altElips,
|
altElipsoidalM: altElips,
|
||||||
|
headingDeg: heading,
|
||||||
fixQuality: fixQual
|
fixQuality: fixQual
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -1525,40 +1498,46 @@ namespace OperationControl.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===== 3) Filtro robusto (MAD) + média =====
|
// ===== 3) Filtro robusto (MAD) + média =====
|
||||||
private (double lat, double lon, double h, int n) FiltrarEAgrupar(List<GgaFix> amostras, double madK = 3.5)
|
private (double lat, double lon, double h, double hdg, int n) FiltrarEAgrupar(List<GgaFix> amostras, double madK = 3.5)
|
||||||
{
|
{
|
||||||
Models.Variaveis.MostrarLog("Filtrando dados aferidos...");
|
Models.Variaveis.MostrarLog("Filtrando dados aferidos...");
|
||||||
// Medianas
|
// Medianas
|
||||||
var lats = amostras.Select(a => a.LatDeg).OrderBy(x => x).ToArray();
|
var lats = amostras.Select(a => a.LatDeg).OrderBy(x => x).ToArray();
|
||||||
var lons = amostras.Select(a => a.LonDeg).OrderBy(x => x).ToArray();
|
var lons = amostras.Select(a => a.LonDeg).OrderBy(x => x).ToArray();
|
||||||
var hs = amostras.Select(a => a.AltElipsoidalM).OrderBy(x => x).ToArray();
|
var hs = amostras.Select(a => a.AltElipsoidalM).OrderBy(x => x).ToArray();
|
||||||
|
var hdgs = amostras.Select(a => a.HeadingDeg).OrderBy(x => x).ToArray();
|
||||||
|
|
||||||
double medLat = Mediana(lats);
|
double medLat = Mediana(lats);
|
||||||
double medLon = Mediana(lons);
|
double medLon = Mediana(lons);
|
||||||
double medH = Mediana(hs);
|
double medH = Mediana(hs);
|
||||||
|
double medHdg = Mediana(hdgs);
|
||||||
|
|
||||||
// Desvios absolutos da mediana (MAD)
|
// Desvios absolutos da mediana (MAD)
|
||||||
var dLat = amostras.Select(a => Math.Abs(a.LatDeg - medLat)).OrderBy(x => x).ToArray();
|
var dLat = amostras.Select(a => Math.Abs(a.LatDeg - medLat)).OrderBy(x => x).ToArray();
|
||||||
var dLon = amostras.Select(a => Math.Abs(a.LonDeg - medLon)).OrderBy(x => x).ToArray();
|
var dLon = amostras.Select(a => Math.Abs(a.LonDeg - medLon)).OrderBy(x => x).ToArray();
|
||||||
var dH = amostras.Select(a => Math.Abs(a.AltElipsoidalM - medH)).OrderBy(x => x).ToArray();
|
var dH = amostras.Select(a => Math.Abs(a.AltElipsoidalM - medH)).OrderBy(x => x).ToArray();
|
||||||
|
var dHdg = amostras.Select(a => Math.Abs(a.HeadingDeg - medH)).OrderBy(x => x).ToArray();
|
||||||
|
|
||||||
double madLat = Mediana(dLat) + 1e-12;
|
double madLat = Mediana(dLat) + 1e-12;
|
||||||
double madLon = Mediana(dLon) + 1e-12;
|
double madLon = Mediana(dLon) + 1e-12;
|
||||||
double madHgt = Mediana(dH) + 1e-12;
|
double madHgt = Mediana(dH) + 1e-12;
|
||||||
|
double madHdg = Mediana(dHdg) + 1e-12;
|
||||||
|
|
||||||
// Filtra outliers (|x - med| / MAD <= madK)
|
// Filtra outliers (|x - med| / MAD <= madK)
|
||||||
var filtradas = amostras.Where(a =>
|
var filtradas = amostras.Where(a =>
|
||||||
(Math.Abs(a.LatDeg - medLat) / madLat) <= madK &&
|
(Math.Abs(a.LatDeg - medLat) / madLat) <= madK &&
|
||||||
(Math.Abs(a.LonDeg - medLon) / madLon) <= madK &&
|
(Math.Abs(a.LonDeg - medLon) / madLon) <= madK &&
|
||||||
(Math.Abs(a.AltElipsoidalM - medH) / madHgt) <= madK
|
(Math.Abs(a.AltElipsoidalM - medH) / madHgt) <= madK &&
|
||||||
|
(Math.Abs(a.HeadingDeg - medHdg) / madHdg) <= madK
|
||||||
).ToList();
|
).ToList();
|
||||||
|
|
||||||
// Média final
|
// Média final
|
||||||
double lat = filtradas.Average(a => a.LatDeg);
|
double lat = filtradas.Average(a => a.LatDeg);
|
||||||
double lon = filtradas.Average(a => a.LonDeg);
|
double lon = filtradas.Average(a => a.LonDeg);
|
||||||
double h = filtradas.Average(a => a.AltElipsoidalM);
|
double h = filtradas.Average(a => a.AltElipsoidalM);
|
||||||
|
double hdg = filtradas.Average(a => a.HeadingDeg);
|
||||||
|
|
||||||
return (lat, lon, h, filtradas.Count);
|
return (lat, lon, h, hdg, filtradas.Count);
|
||||||
|
|
||||||
double Mediana(double[] arr)
|
double Mediana(double[] arr)
|
||||||
{
|
{
|
||||||
|
|
@ -1618,10 +1597,9 @@ namespace OperationControl.Services
|
||||||
|
|
||||||
public enum MetodoFixacaoBase
|
public enum MetodoFixacaoBase
|
||||||
{
|
{
|
||||||
Automatico = 0,
|
Ntrip = 0,
|
||||||
Ntrip = 1,
|
SurveyIn = 1,
|
||||||
SurveyIn = 2,
|
Manual = 2
|
||||||
Manual = 3
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,12 @@
|
||||||
using Microsoft.Win32;
|
using OperationControl.Helpers;
|
||||||
using OperationControl.Helpers;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using static OperationControl.Services.BaseFixService;
|
||||||
|
|
||||||
namespace OperationControl.ViewModels
|
namespace OperationControl.ViewModels
|
||||||
{
|
{
|
||||||
public enum MetodoFixacaoBase
|
|
||||||
{
|
|
||||||
Ntrip = 0,
|
|
||||||
SurveyIn = 1,
|
|
||||||
Manual = 2
|
|
||||||
}
|
|
||||||
|
|
||||||
public class MetodoFixacaoItem
|
public class MetodoFixacaoItem
|
||||||
{
|
{
|
||||||
|
|
@ -29,7 +21,9 @@ namespace OperationControl.ViewModels
|
||||||
public event Action<string>? CarregarMapaSolicitado;
|
public event Action<string>? CarregarMapaSolicitado;
|
||||||
|
|
||||||
// Método, latitude, longitude, altitude, offset frontal cm, offset lateral cm
|
// Método, latitude, longitude, altitude, offset frontal cm, offset lateral cm
|
||||||
public event Action<MetodoFixacaoBase, double?, double?, double?, double?, double?>? FixarBaseSolicitado;
|
public event Action<MetodoFixacaoBase, double?, double?, double?>? FixarBaseSolicitado;
|
||||||
|
// Offset frontal cm, offset lateral cm
|
||||||
|
public event Action<double?, double?>? AplicarOffsetSolicitado;
|
||||||
|
|
||||||
public List<MetodoFixacaoItem> MetodosFixacaoDisponiveis { get; } = new()
|
public List<MetodoFixacaoItem> MetodosFixacaoDisponiveis { get; } = new()
|
||||||
{
|
{
|
||||||
|
|
@ -40,11 +34,13 @@ namespace OperationControl.ViewModels
|
||||||
|
|
||||||
public ICommand CarregarMapaCommand { get; }
|
public ICommand CarregarMapaCommand { get; }
|
||||||
public ICommand FixarBaseCommand { get; }
|
public ICommand FixarBaseCommand { get; }
|
||||||
|
public ICommand AplicarOffsetCommand { get; }
|
||||||
|
|
||||||
public PreparacaoMapaBottomViewModel()
|
public PreparacaoMapaBottomViewModel()
|
||||||
{
|
{
|
||||||
CarregarMapaCommand = new RelayCommand(_ => ExecutarCarregarMapa(), _ => PodeCarregarMapa);
|
CarregarMapaCommand = new RelayCommand(_ => ExecutarCarregarMapa(), _ => PodeCarregarMapa);
|
||||||
FixarBaseCommand = new RelayCommand(_ => ExecutarFixarBase(), _ => PodeFixarBase);
|
FixarBaseCommand = new RelayCommand(_ => ExecutarFixarBase(), _ => PodeFixarBase);
|
||||||
|
AplicarOffsetCommand = new RelayCommand(_ => ExecutarAplicarOffset(), _ => PodeEditarOffsetBase);
|
||||||
|
|
||||||
MetodoFixacaoSelecionado = MetodoFixacaoBase.Ntrip;
|
MetodoFixacaoSelecionado = MetodoFixacaoBase.Ntrip;
|
||||||
OffsetFrontalBaseTexto = "0";
|
OffsetFrontalBaseTexto = "0";
|
||||||
|
|
@ -121,6 +117,17 @@ namespace OperationControl.ViewModels
|
||||||
|
|
||||||
public bool ExibirProgresso => MetodoFixacaoSelecionado != MetodoFixacaoBase.Manual;
|
public bool ExibirProgresso => MetodoFixacaoSelecionado != MetodoFixacaoBase.Manual;
|
||||||
|
|
||||||
|
private bool _exibirOffsets;
|
||||||
|
public bool ExibirOffsets
|
||||||
|
{
|
||||||
|
get { return _exibirOffsets; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_exibirOffsets = value;
|
||||||
|
OnPropertyChanged(nameof(ExibirOffsets));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool PodeFixarBase
|
public bool PodeFixarBase
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -356,13 +363,7 @@ namespace OperationControl.ViewModels
|
||||||
{
|
{
|
||||||
if (FixacaoEmAndamento)
|
if (FixacaoEmAndamento)
|
||||||
{
|
{
|
||||||
FixarBaseSolicitado?.Invoke(
|
FixarBaseSolicitado?.Invoke(MetodoFixacaoSelecionado, LatitudeManual, LongitudeManual, AltitudeManual);
|
||||||
MetodoFixacaoSelecionado,
|
|
||||||
LatitudeManual,
|
|
||||||
LongitudeManual,
|
|
||||||
AltitudeManual,
|
|
||||||
OffsetFrontalBaseCm,
|
|
||||||
OffsetLateralBaseCm);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -381,13 +382,12 @@ namespace OperationControl.ViewModels
|
||||||
StatusTexto = "Pronto para aplicar a posição manual da base.";
|
StatusTexto = "Pronto para aplicar a posição manual da base.";
|
||||||
}
|
}
|
||||||
|
|
||||||
FixarBaseSolicitado?.Invoke(
|
FixarBaseSolicitado?.Invoke(MetodoFixacaoSelecionado, LatitudeManual, LongitudeManual, AltitudeManual);
|
||||||
MetodoFixacaoSelecionado,
|
}
|
||||||
LatitudeManual,
|
|
||||||
LongitudeManual,
|
private void ExecutarAplicarOffset()
|
||||||
AltitudeManual,
|
{
|
||||||
OffsetFrontalBaseCm,
|
AplicarOffsetSolicitado?.Invoke(OffsetFrontalBaseCm, OffsetLateralBaseCm);
|
||||||
OffsetLateralBaseCm);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void IniciarFixacao()
|
public void IniciarFixacao()
|
||||||
|
|
@ -412,10 +412,9 @@ namespace OperationControl.ViewModels
|
||||||
|
|
||||||
public void FinalizarFixacao(bool sucesso, string? mensagem = null)
|
public void FinalizarFixacao(bool sucesso, string? mensagem = null)
|
||||||
{
|
{
|
||||||
|
ExibirOffsets = sucesso;
|
||||||
FixacaoEmAndamento = false;
|
FixacaoEmAndamento = false;
|
||||||
|
if (sucesso) ProgressoFixacao = 100;
|
||||||
if (MetodoFixacaoSelecionado != MetodoFixacaoBase.Manual && sucesso)
|
|
||||||
ProgressoFixacao = 100;
|
|
||||||
|
|
||||||
StatusTexto = !string.IsNullOrWhiteSpace(mensagem)
|
StatusTexto = !string.IsNullOrWhiteSpace(mensagem)
|
||||||
? mensagem
|
? mensagem
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
using System.ComponentModel;
|
using AgroBase.Models.Operacoes;
|
||||||
using System.Windows.Input;
|
using AgroBase.Services;
|
||||||
using OperationControl.Views;
|
using Microsoft.VisualBasic.Logging;
|
||||||
using OperationControl.Helpers;
|
|
||||||
using System.Windows;
|
|
||||||
using OperationControl.Models;
|
|
||||||
using OperationControl.Views.Operacao;
|
|
||||||
using AgroBase.Models.Operacoes;
|
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using OperationControl.ViewModels.Views.Operacao;
|
using OpenTK.Windowing.Common.Input;
|
||||||
using OperationControl.Controls;
|
using OperationControl.Controls;
|
||||||
|
using OperationControl.Helpers;
|
||||||
|
using OperationControl.Models;
|
||||||
|
using OperationControl.ViewModels.Views.Operacao;
|
||||||
|
using OperationControl.Views;
|
||||||
|
using OperationControl.Views.Operacao;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Input;
|
||||||
using static AgroBase.Models.Enums;
|
using static AgroBase.Models.Enums;
|
||||||
|
using static OperationControl.Services.BaseFixService;
|
||||||
|
|
||||||
namespace OperationControl.ViewModels
|
namespace OperationControl.ViewModels
|
||||||
{
|
{
|
||||||
|
|
@ -44,6 +48,7 @@ namespace OperationControl.ViewModels
|
||||||
_viewPreparacaoMapaBottom = new PreparacaoMapaBottomView();
|
_viewPreparacaoMapaBottom = new PreparacaoMapaBottomView();
|
||||||
_viewPreparacaoMapaBottom._vm.CarregarMapaSolicitado += OnCarregarMapaSolicitado;
|
_viewPreparacaoMapaBottom._vm.CarregarMapaSolicitado += OnCarregarMapaSolicitado;
|
||||||
_viewPreparacaoMapaBottom._vm.FixarBaseSolicitado += OnFixarBaseSolicitado;
|
_viewPreparacaoMapaBottom._vm.FixarBaseSolicitado += OnFixarBaseSolicitado;
|
||||||
|
_viewPreparacaoMapaBottom._vm.AplicarOffsetSolicitado += OnAplicarOffsetSolicitado;
|
||||||
|
|
||||||
_viewOperacaoTop = new OperacaoTopView();
|
_viewOperacaoTop = new OperacaoTopView();
|
||||||
|
|
||||||
|
|
@ -683,8 +688,6 @@ namespace OperationControl.ViewModels
|
||||||
if (string.IsNullOrWhiteSpace(linha2))
|
if (string.IsNullOrWhiteSpace(linha2))
|
||||||
linha2 = "Sem detalhes adicionais.";
|
linha2 = "Sem detalhes adicionais.";
|
||||||
|
|
||||||
Models.Variaveis.MostrarLog($"LINHA 1: {linha1}");
|
|
||||||
|
|
||||||
// ============================
|
// ============================
|
||||||
// 8) Atualiza UI
|
// 8) Atualiza UI
|
||||||
// ============================
|
// ============================
|
||||||
|
|
@ -776,7 +779,7 @@ namespace OperationControl.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void OnFixarBaseSolicitado(MetodoFixacaoBase metodoFix, double? lat, double? lon, double? alt, double? offsetFrontalCm, double? offsetLateralCm)
|
private async void OnFixarBaseSolicitado(MetodoFixacaoBase metodoFix, double? lat, double? lon, double? alt)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -803,14 +806,13 @@ namespace OperationControl.ViewModels
|
||||||
if (fixar)
|
if (fixar)
|
||||||
{
|
{
|
||||||
_viewPreparacaoMapaBottom?._vm.IniciarFixacao();
|
_viewPreparacaoMapaBottom?._vm.IniciarFixacao();
|
||||||
await Task.Run(async () => await Variaveis.GpsService.ConfigurarModulo(true, metodoFix, lat, lon, alt));
|
await Variaveis.GpsService.ConfigurarModulo(true, metodoFix, lat, lon, alt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Variaveis.GpsService.BaseFix.ReiniciarFix();
|
Variaveis.GpsService.BaseFix.ReiniciarFix();
|
||||||
BaseFixada = false;
|
BaseFixada = false;
|
||||||
_viewPreparacaoMapaBottom?._vm.CancelarFixacao("Fixação da base interrompida pelo operador.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
@ -845,6 +847,17 @@ namespace OperationControl.ViewModels
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void OnAplicarOffsetSolicitado(double? offsetFrontalCm, double? offsetLateralCm)
|
||||||
|
{
|
||||||
|
if (offsetFrontalCm == null || offsetLateralCm == null) return;
|
||||||
|
|
||||||
|
_viewPreparacaoMapaBottom?._vm.IniciarFixacao();
|
||||||
|
var gps = Variaveis.GpsService;
|
||||||
|
gps.LeverArm = new GeoLeverArm(offsetCampoFrontalCm: offsetFrontalCm.Value, offsetCampoLateralCm: offsetLateralCm.Value);
|
||||||
|
(double lat, double lon) = gps.LeverArm.FixLeverArmLatLon_Fast(gps.BaseFix.LatitudeFix, gps.BaseFix.LongitudeFix, gps.BaseFix.OrientacaoFix);
|
||||||
|
await Variaveis.GpsService.ConfigurarModulo(true, MetodoFixacaoBase.Manual, lat, lon, gps.BaseFix.AltitudeElpsoidalFix, offset: true);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region TELA 3
|
#region TELA 3
|
||||||
|
|
|
||||||
|
|
@ -36,90 +36,39 @@
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="240"/>
|
<ColumnDefinition Width="240"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="12"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- Botão carregar mapa -->
|
<!-- Botão carregar mapa -->
|
||||||
<Button Grid.Column="0"
|
<Button Grid.Column="0" Content="Carregar mapa" Margin="12,12,8,6" Padding="18,10" MinWidth="150" Command="{Binding CarregarMapaCommand}" IsEnabled="{Binding PodeCarregarMapa}"/>
|
||||||
Content="Carregar mapa"
|
|
||||||
Margin="12,12,8,6"
|
|
||||||
Padding="18,10"
|
|
||||||
MinWidth="150"
|
|
||||||
Command="{Binding CarregarMapaCommand}"
|
|
||||||
IsEnabled="{Binding PodeCarregarMapa}"/>
|
|
||||||
|
|
||||||
<!-- Combo método -->
|
<!-- Combo método -->
|
||||||
<ComboBox Grid.Column="1"
|
<ComboBox Grid.Column="1" Margin="8,12,8,6" VerticalContentAlignment="Center" ItemsSource="{Binding MetodosFixacaoDisponiveis}" DisplayMemberPath="Nome" SelectedValuePath="Valor" SelectedValue="{Binding MetodoFixacaoSelecionado, Mode=TwoWay}" IsEnabled="{Binding PodeEditarMetodoFixacao}"/>
|
||||||
Margin="8,12,8,6"
|
|
||||||
VerticalContentAlignment="Center"
|
|
||||||
ItemsSource="{Binding MetodosFixacaoDisponiveis}"
|
|
||||||
DisplayMemberPath="Nome"
|
|
||||||
SelectedValuePath="Valor"
|
|
||||||
SelectedValue="{Binding MetodoFixacaoSelecionado, Mode=TwoWay}"
|
|
||||||
IsEnabled="{Binding PodeEditarMetodoFixacao}"/>
|
|
||||||
|
|
||||||
<!-- Botão fixar -->
|
<!-- Botão fixar -->
|
||||||
<Button Grid.Column="2"
|
<Button Grid.Column="2" Content="{Binding TextoBotaoFixarBase}" Margin="8,12,12,6" Padding="18,10" MinWidth="180" Command="{Binding FixarBaseCommand}" IsEnabled="{Binding PodeFixarBase}"/>
|
||||||
Content="{Binding TextoBotaoFixarBase}"
|
|
||||||
Margin="8,12,12,6"
|
|
||||||
Padding="18,10"
|
|
||||||
MinWidth="180"
|
|
||||||
Command="{Binding FixarBaseCommand}"
|
|
||||||
IsEnabled="{Binding PodeFixarBase}"/>
|
|
||||||
|
|
||||||
<!-- ÁREA DINÂMICA -->
|
<!-- ÁREA DINÂMICA -->
|
||||||
<Grid Grid.Column="4" Margin="0,12,12,6">
|
<Grid Grid.Column="3" Margin="0,12,12,6">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- Progresso normal + offsets -->
|
<!-- Progresso normal -->
|
||||||
<Grid Visibility="{Binding ExibirProgresso, Converter={StaticResource BoolToVisibilityConverter}}">
|
<Grid Grid.Column="0" Visibility="{Binding ExibirProgresso, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="320"/>
|
<ColumnDefinition Width="320"/>
|
||||||
<ColumnDefinition Width="70"/>
|
<ColumnDefinition Width="50"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="90"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="90"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<ProgressBar Grid.Column="0"
|
<ProgressBar Grid.Column="0" Margin="0,8,8,0" Height="22" Minimum="0" Maximum="100" Value="{Binding ProgressoFixacao}"/>
|
||||||
Margin="0,8,8,0"
|
|
||||||
Height="22"
|
|
||||||
Minimum="0"
|
|
||||||
Maximum="100"
|
|
||||||
Value="{Binding ProgressoFixacao}"/>
|
|
||||||
|
|
||||||
<TextBlock Grid.Column="1"
|
<TextBlock Grid.Column="1" Text="{Binding ProgressoFixacaoTexto}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontWeight="SemiBold" FontSize="14" Margin="0,0,8,0"/>
|
||||||
Text="{Binding ProgressoFixacaoTexto}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Foreground="White"
|
|
||||||
FontWeight="SemiBold"
|
|
||||||
FontSize="14"
|
|
||||||
Margin="0,0,8,0"/>
|
|
||||||
|
|
||||||
<TextBlock Grid.Column="2"
|
|
||||||
Text="Offset frontal (cm):"
|
|
||||||
Style="{StaticResource BottomLabelStyle}"/>
|
|
||||||
|
|
||||||
<TextBox Grid.Column="3"
|
|
||||||
Text="{Binding OffsetFrontalBaseTexto, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
||||||
Style="{StaticResource BottomTextBoxStyle}"
|
|
||||||
IsEnabled="{Binding PodeEditarOffsetBase}"/>
|
|
||||||
|
|
||||||
<TextBlock Grid.Column="4"
|
|
||||||
Text="Offset lateral (cm):"
|
|
||||||
Style="{StaticResource BottomLabelStyle}"/>
|
|
||||||
|
|
||||||
<TextBox Grid.Column="5"
|
|
||||||
Text="{Binding OffsetLateralBaseTexto, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
||||||
Style="{StaticResource BottomTextBoxStyle}"
|
|
||||||
IsEnabled="{Binding PodeEditarOffsetBase}"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!-- Campos manuais + offsets -->
|
<!-- Campos manuais -->
|
||||||
<Grid Visibility="{Binding ExibirCamposManuais, Converter={StaticResource BoolToVisibilityConverter}}">
|
<Grid Grid.Column="0" Visibility="{Binding ExibirCamposManuais, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="125"/>
|
<ColumnDefinition Width="125"/>
|
||||||
|
|
@ -127,108 +76,57 @@
|
||||||
<ColumnDefinition Width="125"/>
|
<ColumnDefinition Width="125"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="110"/>
|
<ColumnDefinition Width="110"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="90"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="90"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBlock Grid.Column="0"
|
<TextBlock Grid.Column="0" Text="Latitude (º):" Style="{StaticResource BottomLabelStyle}"/>
|
||||||
Text="Latitude (º):"
|
|
||||||
Style="{StaticResource BottomLabelStyle}"/>
|
|
||||||
|
|
||||||
<TextBox Grid.Column="1"
|
<TextBox Grid.Column="1" Text="{Binding LatitudeManualTexto, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource BottomTextBoxStyle}" IsEnabled="{Binding PodeEditarCoordenadasManuais}"/>
|
||||||
Text="{Binding LatitudeManualTexto, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
||||||
Style="{StaticResource BottomTextBoxStyle}"
|
|
||||||
IsEnabled="{Binding PodeEditarCoordenadasManuais}"/>
|
|
||||||
|
|
||||||
<TextBlock Grid.Column="2"
|
<TextBlock Grid.Column="2" Text="Longitude (º):" Style="{StaticResource BottomLabelStyle}"/>
|
||||||
Text="Longitude (º):"
|
|
||||||
Style="{StaticResource BottomLabelStyle}"/>
|
|
||||||
|
|
||||||
<TextBox Grid.Column="3"
|
<TextBox Grid.Column="3" Text="{Binding LongitudeManualTexto, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource BottomTextBoxStyle}" IsEnabled="{Binding PodeEditarCoordenadasManuais}"/>
|
||||||
Text="{Binding LongitudeManualTexto, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
||||||
Style="{StaticResource BottomTextBoxStyle}"
|
|
||||||
IsEnabled="{Binding PodeEditarCoordenadasManuais}"/>
|
|
||||||
|
|
||||||
<TextBlock Grid.Column="4"
|
<TextBlock Grid.Column="4" Text="Altitude elipsoidal (m):" Style="{StaticResource BottomLabelStyle}"/>
|
||||||
Text="Altitude elipsoidal (m):"
|
|
||||||
Style="{StaticResource BottomLabelStyle}"/>
|
|
||||||
|
|
||||||
<TextBox Grid.Column="5"
|
<TextBox Grid.Column="5" Text="{Binding AltitudeManualTexto, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource BottomTextBoxStyle}" IsEnabled="{Binding PodeEditarCoordenadasManuais}"/>
|
||||||
Text="{Binding AltitudeManualTexto, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
||||||
Style="{StaticResource BottomTextBoxStyle}"
|
|
||||||
IsEnabled="{Binding PodeEditarCoordenadasManuais}"/>
|
|
||||||
|
|
||||||
<TextBlock Grid.Column="6"
|
|
||||||
Text="Offset frontal (cm):"
|
|
||||||
Style="{StaticResource BottomLabelStyle}"/>
|
|
||||||
|
|
||||||
<TextBox Grid.Column="7"
|
|
||||||
Text="{Binding OffsetFrontalBaseTexto, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
||||||
Style="{StaticResource BottomTextBoxStyle}"
|
|
||||||
IsEnabled="{Binding PodeEditarOffsetBase}"/>
|
|
||||||
|
|
||||||
<TextBlock Grid.Column="8"
|
|
||||||
Text="Offset lateral (cm):"
|
|
||||||
Style="{StaticResource BottomLabelStyle}"/>
|
|
||||||
|
|
||||||
<TextBox Grid.Column="9"
|
|
||||||
Text="{Binding OffsetLateralBaseTexto, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
||||||
Style="{StaticResource BottomTextBoxStyle}"
|
|
||||||
IsEnabled="{Binding PodeEditarOffsetBase}"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
<!-- offsets -->
|
||||||
|
<Grid Grid.Column="1" Visibility="{Binding ExibirOffsets, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="90"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="90"/>
|
||||||
|
<ColumnDefinition Width="150"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Grid.Column="0" Text="Offset frontal (cm):" Style="{StaticResource BottomLabelStyle}"/>
|
||||||
|
|
||||||
|
<TextBox Grid.Column="1" Text="{Binding OffsetFrontalBaseTexto, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource BottomTextBoxStyle}" IsEnabled="{Binding PodeEditarOffsetBase}"/>
|
||||||
|
|
||||||
|
<TextBlock Grid.Column="2" Text="Offset lateral (cm):" Style="{StaticResource BottomLabelStyle}"/>
|
||||||
|
|
||||||
|
<TextBox Grid.Column="3" Text="{Binding OffsetLateralBaseTexto, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource BottomTextBoxStyle}" IsEnabled="{Binding PodeEditarOffsetBase}"/>
|
||||||
|
|
||||||
|
<Button Grid.Column="4" Content="Aplicar Offset" Margin="12,0,12,0" Padding="5,5" MinWidth="120" Command="{Binding AplicarOffsetCommand}" />
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!-- LINHA 2 -->
|
<!-- LINHA 2 -->
|
||||||
<Grid Grid.Row="1" Margin="12,4,12,10">
|
<Grid Grid.Row="1" Margin="12,4,12,10">
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<Border Grid.Row="0"
|
<Border Grid.Row="0" Padding="2" Background="#222" CornerRadius="6">
|
||||||
Padding="8"
|
|
||||||
Background="#222"
|
|
||||||
CornerRadius="6">
|
|
||||||
|
|
||||||
<Grid>
|
<StackPanel Grid.Column="0" Visibility="{Binding ExibirStatusNormal, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||||
<!-- Status normal -->
|
<TextBlock Text="{Binding StatusTexto}" Foreground="White" FontSize="14" TextWrapping="Wrap"/>
|
||||||
<StackPanel Visibility="{Binding ExibirStatusNormal, Converter={StaticResource BoolToVisibilityConverter}}">
|
</StackPanel>
|
||||||
<TextBlock Text="Status da operação"
|
|
||||||
Foreground="#AAAAAA"
|
|
||||||
FontSize="11"/>
|
|
||||||
<TextBlock Text="{Binding StatusTexto}"
|
|
||||||
Foreground="White"
|
|
||||||
FontSize="14"
|
|
||||||
TextWrapping="Wrap"/>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<!-- Texto orientativo manual -->
|
|
||||||
<StackPanel Visibility="{Binding ExibirCamposManuais, Converter={StaticResource BoolToVisibilityConverter}}">
|
|
||||||
<TextBlock Text="Preenchimento manual da base"
|
|
||||||
Foreground="#AAAAAA"
|
|
||||||
FontSize="11"/>
|
|
||||||
<TextBlock Text="Informe latitude, longitude e altitude elipsoidal conhecidas da base para aplicar a posição fixa manualmente."
|
|
||||||
Foreground="White"
|
|
||||||
FontSize="13"
|
|
||||||
TextWrapping="Wrap"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Status complementar no manual -->
|
|
||||||
<Border Grid.Row="1"
|
|
||||||
Padding="8,6,8,0"
|
|
||||||
Background="Transparent"
|
|
||||||
Visibility="{Binding ExibirCamposManuais, Converter={StaticResource BoolToVisibilityConverter}}">
|
|
||||||
<TextBlock Text="{Binding StatusTexto}"
|
|
||||||
Foreground="#D8D8D8"
|
|
||||||
FontSize="12"
|
|
||||||
TextWrapping="Wrap"/>
|
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|
@ -16,6 +16,7 @@ using AgroBase.Models.Operadores;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
|
using static OperationControl.Services.BaseFixService;
|
||||||
|
|
||||||
namespace OperationControl.Windows
|
namespace OperationControl.Windows
|
||||||
{
|
{
|
||||||
|
|
@ -1725,7 +1726,7 @@ namespace OperationControl.Windows
|
||||||
if (fixar)
|
if (fixar)
|
||||||
{
|
{
|
||||||
btnGNSS_FixarBase.Content = "Parar";
|
btnGNSS_FixarBase.Content = "Parar";
|
||||||
Task.Run(async () => await Variaveis.GpsService.ConfigurarModulo(true, ViewModels.MetodoFixacaoBase.Ntrip));
|
Task.Run(async () => await Variaveis.GpsService.ConfigurarModulo(true, MetodoFixacaoBase.Ntrip));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue