pequenos ajustes pos operacoes

This commit is contained in:
Diego Freitas 2026-03-05 17:01:58 -03:00
parent 2b4505d98a
commit 77bffe5667
3 changed files with 22 additions and 4 deletions

View File

@ -702,6 +702,20 @@ namespace AgroBase.Forms.Operacoes
Visivel = true, Visivel = true,
MostrarValor = true MostrarValor = true
}, },
new GraficoInterativoSerieModel()
{
Titulo = "V Bat",
Valores = LogsOperacao.Select(x => (double?)(x?.Bateria?.TensaoInstantanea) ?? 0).ToList(),
Visivel = true,
MostrarValor = true
},
new GraficoInterativoSerieModel()
{
Titulo = "A Bat",
Valores = LogsOperacao.Select(x => (double?)(x?.Bateria?.CorrenteInstantanea) ?? 0).ToList(),
Visivel = true,
MostrarValor = true
},
}); });
graficoCpu = new GraficoInterativoModel(chartCpu, Momentos, new List<GraficoInterativoSerieModel>() graficoCpu = new GraficoInterativoModel(chartCpu, Momentos, new List<GraficoInterativoSerieModel>()
@ -1135,7 +1149,7 @@ namespace AgroBase.Forms.Operacoes
FuncoesGlobais.PreencheValorProgressBar(pgbBateriaConsumida, Log.Bateria.PercentualBateriaConsumida); FuncoesGlobais.PreencheValorProgressBar(pgbBateriaConsumida, Log.Bateria.PercentualBateriaConsumida);
txtTempoMovimento.Text = FuncoesGlobais.ConverterSegundosParaHHmmss((int)Log.Movimentacao.TempoMovimentoSegs); txtTempoMovimento.Text = FuncoesGlobais.ConverterSegundosParaHHmmss((int)Log.Movimentacao.TempoMovimentoSegs);
txtStatusOperacao.Text = Log.StatusOperacao.ToString(); txtStatusOperacao.Text = Log.StatusOperacao.ToString();
txtStatusCarro.Text = Log.Trajetoria.StatusCarro.ToString(); txtStatusCarro.Text = $"{Log.Trajetoria.StatusCarro}";
txtHerbicidaPorErva.Text = herbicidaPorErva.ToString("0.00") + " ml"; txtHerbicidaPorErva.Text = herbicidaPorErva.ToString("0.00") + " ml";
txtDentroRua.Text = Log.Trajetoria.CorredorAtual.Dentro ? "Sim" : "Não"; txtDentroRua.Text = Log.Trajetoria.CorredorAtual.Dentro ? "Sim" : "Não";
txtDirecaoCarro.Text = Log.Trajetoria.DirecaoCaminho.ToString() + " (" + Log.Trajetoria.CorredorAtual.Idx + " - " + Log.Trajetoria.ProximoPonto.idxPonto + " - " + Log.Trajetoria.ProximoPonto.idxPontoCorredor + ")"; txtDirecaoCarro.Text = Log.Trajetoria.DirecaoCaminho.ToString() + " (" + Log.Trajetoria.CorredorAtual.Idx + " - " + Log.Trajetoria.ProximoPonto.idxPonto + " - " + Log.Trajetoria.ProximoPonto.idxPontoCorredor + ")";
@ -1170,6 +1184,9 @@ namespace AgroBase.Forms.Operacoes
OperacaoModel.PopularTreeView(tvwFalhas, Log.ModulosSaude); OperacaoModel.PopularTreeView(tvwFalhas, Log.ModulosSaude);
tvwFalhas.ExpandAll(); tvwFalhas.ExpandAll();
label117.Text = $"Impedimento: {Log.ErroOperacaoLiberada}";
//label117.Text = $"Bat {Log.Bateria?.TensaoInstantanea} A, {Log.Bateria?.CorrenteInstantanea} A, {Log.Bateria?.PercentualBateria} %";
} }
private void AtualizarInformacoesCameras() private void AtualizarInformacoesCameras()

View File

@ -2357,7 +2357,8 @@ namespace AgroBase.Models
_Trajetoria?.AtualizarDadosAutonomiaCorredor(); _Trajetoria?.AtualizarDadosAutonomiaCorredor();
//var sIMU = LivoxManagerProcess.DadosLeitura.imu; //var sIMU = LivoxManagerProcess.DadosLeitura.imu;
var sIMU = JsonConvert.DeserializeObject<OAKImuModel>(RedisService.Get(RedisService.ModKey(T_Code.Imu))); string imu = RedisService.Get(RedisService.ModKey(T_Code.Imu)) ?? "";
var sIMU = JsonConvert.DeserializeObject<OAKImuModel>(imu);
var dadosIMU = sIMU != null ? new OperacaoSensoriamentoLogImuModel() var dadosIMU = sIMU != null ? new OperacaoSensoriamentoLogImuModel()
{ {
Iniciado = sIMU.timestamp > 0 && HealthWorkerService.ModulosSaude.FirstOrDefault(x => x.modulo == T_Code.Imu)?.status != StatusModulo.Desconectado, Iniciado = sIMU.timestamp > 0 && HealthWorkerService.ModulosSaude.FirstOrDefault(x => x.modulo == T_Code.Imu)?.status != StatusModulo.Desconectado,
@ -2547,7 +2548,7 @@ namespace AgroBase.Models
UltimoComandoRespondido = VariaveisOperacao.PosicaoBase.Momento, UltimoComandoRespondido = VariaveisOperacao.PosicaoBase.Momento,
}; };
var dadosLivox = LivoxManagerProcess.DadosLeitura.Clone(); var dadosLivox = LivoxManagerProcess.DadosLeitura?.Clone();
var dadosCooler = _Cooler?.GetResumo(); var dadosCooler = _Cooler?.GetResumo();

View File

@ -131,7 +131,7 @@ public sealed class LivoxManagerProcess
{ {
try try
{ {
string json = RedisService.Get(RedisService.ModKey(Enums.T_Code.Lvx)); string json = RedisService.Get(RedisService.ModKey(Enums.T_Code.Lvx)) ?? "";
DadosLeitura = JsonConvert.DeserializeObject<LivoxModel>(json); DadosLeitura = JsonConvert.DeserializeObject<LivoxModel>(json);
} }
catch (Exception ex) catch (Exception ex)