ajustado fixacao da posicao da base
This commit is contained in:
parent
025d71b48d
commit
e6417d4b8a
|
|
@ -225,7 +225,7 @@ namespace OperationControl.Services
|
|||
|
||||
private bool InverterHeading = false;
|
||||
private bool LoopRTK_Ntrip = false;
|
||||
private bool Ntrip_Conectado = false;
|
||||
public bool Ntrip_Conectado = false;
|
||||
private bool CorrecaoRTK_Ntrip = false;
|
||||
private int TempoSurveryIn = 120;
|
||||
public int TaxaAmostragemHz = 5;
|
||||
|
|
@ -266,8 +266,9 @@ namespace OperationControl.Services
|
|||
if (!sucesso)
|
||||
{
|
||||
Models.Variaveis.MostrarLog("Configurando módulo como base survery in...");
|
||||
BaseFix.inicioProcesso = DateTime.UtcNow;
|
||||
await ConfigurarModuloBase(tempo_fixacao: TempoSurveryIn, porta_usb: "com3", porta_saida: "com3");
|
||||
BaseFix.PosicaoBaseFixada = true;
|
||||
BaseFix.inicioFix = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1107,8 +1108,7 @@ namespace OperationControl.Services
|
|||
{
|
||||
try
|
||||
{
|
||||
((App)Application.Current).Shell.Main.AtualizarDadosTela_GNSS(UltimaLeitura.ToGnssModel(), marker_id: VariaveisControleOperacao.BaseMarkerID, progresso: BaseFix.Progresso);
|
||||
((App)Application.Current).Shell.Main.AtualizarDadosTela_Heading(UltimaLeitura.AnguloCarroDefinido);
|
||||
((App)Application.Current).Shell.Main?.AtualizarDadosTela_Telemetria(VariaveisControleOperacao.BaseMarkerID);
|
||||
}
|
||||
catch (Exception exUi)
|
||||
{
|
||||
|
|
@ -1133,9 +1133,9 @@ namespace OperationControl.Services
|
|||
private readonly GpsService gpsService;
|
||||
private int _lastReadHeartbeat = -1;
|
||||
public List<GgaFix> amostras_pos = new List<GgaFix>(1000);
|
||||
private DateTime? inicioProcesso = null;
|
||||
private DateTime? inicioFix = null;
|
||||
private DateTime? fimProcesso = null;
|
||||
public DateTime? inicioProcesso = null;
|
||||
public DateTime? inicioFix = null;
|
||||
public DateTime? fimProcesso = null;
|
||||
private int segundosFixEstavel = 120;
|
||||
private int maxJanelaSegundos = 120;
|
||||
public double Progresso
|
||||
|
|
@ -1143,6 +1143,10 @@ namespace OperationControl.Services
|
|||
get
|
||||
{
|
||||
double progresso = inicioFix is null ? 0 : fimProcesso != null ? 100 : (DateTime.UtcNow - inicioFix.Value).TotalSeconds / segundosFixEstavel * 100.0;
|
||||
if (fimProcesso == null && progresso >= 100)
|
||||
{
|
||||
fimProcesso = DateTime.UtcNow;
|
||||
}
|
||||
return progresso;
|
||||
}
|
||||
}
|
||||
|
|
@ -1182,7 +1186,7 @@ namespace OperationControl.Services
|
|||
return progresso;
|
||||
}
|
||||
}
|
||||
public bool PosicaoBaseFixada = false;
|
||||
public bool PosicaoBaseFixada => gpsService.UltimaLeitura.QualidadeFix == TiposCorrecaoGPS.BaseFix;
|
||||
public bool CorrecaoAbsoluta = false;
|
||||
public bool CorrecaoEmAndamento = false;
|
||||
public bool FixLiberado = false;
|
||||
|
|
@ -1207,6 +1211,14 @@ namespace OperationControl.Services
|
|||
|
||||
try
|
||||
{
|
||||
if (!gpsService.Ntrip_Conectado)
|
||||
{
|
||||
Models.Variaveis.MostrarLog("Ntrip não conectado.");
|
||||
CorrecaoAbsoluta = false;
|
||||
FixLiberado = false;
|
||||
return CorrecaoAbsoluta;
|
||||
}
|
||||
|
||||
// 2) Esperar FIX sustentado e coletar GNGGA
|
||||
var amostras = await EsperarFixEAmostrarAsync();
|
||||
|
||||
|
|
@ -1215,7 +1227,6 @@ namespace OperationControl.Services
|
|||
Models.Variaveis.MostrarLog("Poucas amostras de RTK FIX coletadas. Tente aumentar o tempo ou verificar sinais.");
|
||||
CorrecaoAbsoluta = false;
|
||||
FixLiberado = false;
|
||||
PosicaoBaseFixada = false;
|
||||
return CorrecaoAbsoluta;
|
||||
}
|
||||
|
||||
|
|
@ -1229,7 +1240,6 @@ namespace OperationControl.Services
|
|||
Models.Variaveis.MostrarLog($" lat = {lat:0.000000000}, lon = {lon:0.000000000}, h = {h:0.000}");
|
||||
CorrecaoAbsoluta = true;
|
||||
FixLiberado = false;
|
||||
PosicaoBaseFixada = true;
|
||||
return CorrecaoAbsoluta;
|
||||
}
|
||||
finally
|
||||
|
|
|
|||
Loading…
Reference in New Issue