ajustes no baud rate can
This commit is contained in:
parent
bde1ec5064
commit
96211aa734
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -561,6 +561,7 @@
|
||||||
<Compile Include="Services\BLD300RService.cs" />
|
<Compile Include="Services\BLD300RService.cs" />
|
||||||
<Compile Include="Services\CameraService.cs" />
|
<Compile Include="Services\CameraService.cs" />
|
||||||
<Compile Include="Services\CANService.cs" />
|
<Compile Include="Services\CANService.cs" />
|
||||||
|
<Compile Include="Services\CANServiceWaveshare.cs" />
|
||||||
<Compile Include="Services\CoulombCounterService.cs" />
|
<Compile Include="Services\CoulombCounterService.cs" />
|
||||||
<Compile Include="Services\DispositivosService.cs" />
|
<Compile Include="Services\DispositivosService.cs" />
|
||||||
<Compile Include="Forms\frmPrincipal.cs">
|
<Compile Include="Forms\frmPrincipal.cs">
|
||||||
|
|
@ -598,7 +599,7 @@
|
||||||
<Compile Include="Services\PZEMService.cs" />
|
<Compile Include="Services\PZEMService.cs" />
|
||||||
<Compile Include="Services\RedisService.cs" />
|
<Compile Include="Services\RedisService.cs" />
|
||||||
<Compile Include="Services\RTCMSniffer.cs" />
|
<Compile Include="Services\RTCMSniffer.cs" />
|
||||||
<Compile Include="Services\SerialCanService.cs" />
|
<Compile Include="Services\CANServiceSerial.cs" />
|
||||||
<Compile Include="Services\SerialService.cs" />
|
<Compile Include="Services\SerialService.cs" />
|
||||||
<Compile Include="Services\SonarService.cs" />
|
<Compile Include="Services\SonarService.cs" />
|
||||||
<Compile Include="Services\SyncDataService.cs" />
|
<Compile Include="Services\SyncDataService.cs" />
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ namespace AgroBase.Forms.Operacoes
|
||||||
lblTensao.Text = _Sensoriamento.Bateria.TensaoInstantanea.ToString("0.00") + " v";
|
lblTensao.Text = _Sensoriamento.Bateria.TensaoInstantanea.ToString("0.00") + " v";
|
||||||
lblCorrente.Text = _Sensoriamento.Bateria.CorrenteInstantanea.ToString("0.00") + " A";
|
lblCorrente.Text = _Sensoriamento.Bateria.CorrenteInstantanea.ToString("0.00") + " A";
|
||||||
lblRPM.Text = _Sensoriamento.Movimentacao.RPMMedio.ToString("0") + " rpm";
|
lblRPM.Text = _Sensoriamento.Movimentacao.RPMMedio.ToString("0") + " rpm";
|
||||||
lblVelocidade.Text = _Sensoriamento.Movimentacao.VelocidadeMedia.ToString("0.00");
|
lblVelocidade.Text = (_Sensoriamento.Movimentacao.VelocidadeMedia * 3.6).ToString("0.00");
|
||||||
|
|
||||||
bool atuadorAtivado = Variaveis.OperacaoEmAndamento.DispAtu.Dados.ConexaoAtiva || true;
|
bool atuadorAtivado = Variaveis.OperacaoEmAndamento.DispAtu.Dados.ConexaoAtiva || true;
|
||||||
chbPulverizador.Enabled = atuadorAtivado;
|
chbPulverizador.Enabled = atuadorAtivado;
|
||||||
|
|
@ -507,7 +507,7 @@ namespace AgroBase.Forms.Operacoes
|
||||||
|
|
||||||
gridDados.Rows[0].Cells[1].Value = _Sensoriamento.TempoDecorrido.ToString("HH:mm:ss");
|
gridDados.Rows[0].Cells[1].Value = _Sensoriamento.TempoDecorrido.ToString("HH:mm:ss");
|
||||||
gridDados.Rows[1].Cells[1].Value = _Sensoriamento.Movimentacao.TempoMovimento.ToString("HH:mm:ss");
|
gridDados.Rows[1].Cells[1].Value = _Sensoriamento.Movimentacao.TempoMovimento.ToString("HH:mm:ss");
|
||||||
gridDados.Rows[2].Cells[1].Value = _Sensoriamento.Movimentacao.VelocidadeMedia.ToString("0.00");
|
gridDados.Rows[2].Cells[1].Value = (_Sensoriamento.Movimentacao.VelocidadeMedia * 3.6).ToString("0.00");
|
||||||
gridDados.Rows[3].Cells[1].Value = _Sensoriamento.Trajetoria.DistanciaPercorrida.ToString("0.00");
|
gridDados.Rows[3].Cells[1].Value = _Sensoriamento.Trajetoria.DistanciaPercorrida.ToString("0.00");
|
||||||
gridDados.Rows[4].Cells[1].Value = (_Sensoriamento.Bateria.PorcentagemBateria.ToString("00.00"));
|
gridDados.Rows[4].Cells[1].Value = (_Sensoriamento.Bateria.PorcentagemBateria.ToString("00.00"));
|
||||||
gridDados.Rows[5].Cells[1].Value = (_Sensoriamento.Bateria.TensaoInstantanea.ToString("0.00"));
|
gridDados.Rows[5].Cells[1].Value = (_Sensoriamento.Bateria.TensaoInstantanea.ToString("0.00"));
|
||||||
|
|
|
||||||
|
|
@ -1089,7 +1089,7 @@ namespace AgroBase.Forms.Operacoes
|
||||||
txtErvasNoRadar.Text = Log.Atuador.ErvasNoRadar.ToString();
|
txtErvasNoRadar.Text = Log.Atuador.ErvasNoRadar.ToString();
|
||||||
txtErvasTerreno.Text = Log.Atuador.PercentualErvasTerreno.ToString("0.00");
|
txtErvasTerreno.Text = Log.Atuador.PercentualErvasTerreno.ToString("0.00");
|
||||||
txtTipoMovimento.Text = Log.Controle.TipoMovimento.ToString();
|
txtTipoMovimento.Text = Log.Controle.TipoMovimento.ToString();
|
||||||
txtVelocidade.Text = Log.Movimentacao.VelocidadeMedia.ToString("0.00") + " km/h (" + (Log.Movimentacao.VelocidadeMedia / 3.6).ToString("0.00") + " m/s)";
|
txtVelocidade.Text = (Log.Movimentacao.VelocidadeMedia * 3.6).ToString("0.00") + " km/h (" + Log.Movimentacao.VelocidadeMedia.ToString("0.00") + " m/s)";
|
||||||
txtDirecaoControle.Text = (Log.Controle?.Direcao ?? Enums.Direcao.Parado).ToString();
|
txtDirecaoControle.Text = (Log.Controle?.Direcao ?? Enums.Direcao.Parado).ToString();
|
||||||
txtVelocidadeControle.Text = ((Log.Controle?.PercentualVelocidadeSP ?? 0) / VariaveisEquipamento.RPM_Max_Roda * 100).ToString() + " rpm";
|
txtVelocidadeControle.Text = ((Log.Controle?.PercentualVelocidadeSP ?? 0) / VariaveisEquipamento.RPM_Max_Roda * 100).ToString() + " rpm";
|
||||||
txtErvasIdentificadas.Text = $"{totalAtuacoes}";
|
txtErvasIdentificadas.Text = $"{totalAtuacoes}";
|
||||||
|
|
@ -1349,8 +1349,8 @@ namespace AgroBase.Forms.Operacoes
|
||||||
|
|
||||||
private void AtualizarInformacoesAtuador()
|
private void AtualizarInformacoesAtuador()
|
||||||
{
|
{
|
||||||
graficoAtu.AtualizarDados(idxMomentoAtual);
|
graficoAtu?.AtualizarDados(idxMomentoAtual);
|
||||||
graficoErvas.AtualizarDados(idxMomentoAtual);
|
graficoErvas?.AtualizarDados(idxMomentoAtual);
|
||||||
|
|
||||||
pnlAtuadores.Invalidate();
|
pnlAtuadores.Invalidate();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2886,7 +2886,7 @@ namespace AgroBase.Models.Modules
|
||||||
{
|
{
|
||||||
bool Conectado = data[2] == 1;
|
bool Conectado = data[2] == 1;
|
||||||
bool Configurado = data[3] == 1;
|
bool Configurado = data[3] == 1;
|
||||||
Console.WriteLine($"[LRA] Resposta {ID_Num} recebida. Conectado={Conectado}, Configurado={Configurado}");
|
//Console.WriteLine($"[LRA] Resposta {ID_Num} recebida. Conectado={Conectado}, Configurado={Configurado}");
|
||||||
loraService.Conectado = Conectado;
|
loraService.Conectado = Conectado;
|
||||||
loraService.Configurado = Configurado;
|
loraService.Configurado = Configurado;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ namespace AgroBase.Models
|
||||||
Variaveis.OperacaoEmAndamento.TempoAguardando = DateTimeOffset.FromUnixTimeSeconds(tempoAguardando).UtcDateTime.AddSeconds(tempoAguardando % 1).ToLocalTime();
|
Variaveis.OperacaoEmAndamento.TempoAguardando = DateTimeOffset.FromUnixTimeSeconds(tempoAguardando).UtcDateTime.AddSeconds(tempoAguardando % 1).ToLocalTime();
|
||||||
HealthWorkerService.ModulosSaude = RedisService.GetField<ManagerWorkerMessageResponseModulosPendentesModel[]>(CtxKey.DadosOperacao, "status_modulos").ToList();
|
HealthWorkerService.ModulosSaude = RedisService.GetField<ManagerWorkerMessageResponseModulosPendentesModel[]>(CtxKey.DadosOperacao, "status_modulos").ToList();
|
||||||
Variaveis.OperacaoEmAndamento.ErroOperacaoLiberada = RedisService.GetField<string>(CtxKey.DadosOperacao, "motivo_nao_liberado");
|
Variaveis.OperacaoEmAndamento.ErroOperacaoLiberada = RedisService.GetField<string>(CtxKey.DadosOperacao, "motivo_nao_liberado");
|
||||||
GPSService.CorrecaoRTK_Ntrip = RedisService.GetField<bool>(RedisService.ModKey(T_Code.Gps), "correcao_ntrip", false);
|
//GPSService.CorrecaoRTK_Ntrip = RedisService.GetField<bool>(RedisService.ModKey(T_Code.Gps), "correcao_ntrip", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -602,7 +602,7 @@ namespace AgroBase.Models
|
||||||
AtualizarIndicesJanela();
|
AtualizarIndicesJanela();
|
||||||
AtualizarTrajetoriaJanela();
|
AtualizarTrajetoriaJanela();
|
||||||
|
|
||||||
VerificaFimCorredorSegmentacao();
|
//VerificaFimCorredorSegmentacao();
|
||||||
|
|
||||||
DefinirPontoAtual();
|
DefinirPontoAtual();
|
||||||
AtualizarCorredorAtual();
|
AtualizarCorredorAtual();
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,12 @@
|
||||||
using AgroBase.Models;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Collections.Concurrent;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO.Ports;
|
using System.IO.Ports;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static AgroBase.Models.Enums;
|
using static AgroBase.Models.Enums;
|
||||||
using static WaveshareCANFDService;
|
|
||||||
|
|
||||||
namespace AgroBase.Services
|
namespace AgroBase.Services
|
||||||
{
|
{
|
||||||
public class CanManager
|
public class CanManager
|
||||||
{
|
{
|
||||||
public static bool UseCanSerial = true;
|
public static bool UseCanSerial = false;
|
||||||
|
|
||||||
private static CanServiceWaveshare CanWaveshare = new CanServiceWaveshare();
|
private static CanServiceWaveshare CanWaveshare = new CanServiceWaveshare();
|
||||||
private static CanServiceSerial CanSerial = new CanServiceSerial();
|
private static CanServiceSerial CanSerial = new CanServiceSerial();
|
||||||
|
|
@ -32,7 +25,6 @@ namespace AgroBase.Services
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CanMessage
|
public class CanMessage
|
||||||
|
|
@ -159,377 +151,4 @@ namespace AgroBase.Services
|
||||||
bool IsConnected { get; }
|
bool IsConnected { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CanServiceWaveshare : ICanService
|
|
||||||
{
|
|
||||||
public WaveshareCANFDService Connector = new WaveshareCANFDService(0);
|
|
||||||
public string _portName { get; set; } = "CAN-FD";
|
|
||||||
public bool IsConnected { get; private set; }
|
|
||||||
public bool Iniciado
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return SerialService.DispositivosMapeados.Any(x => /*x.Status != StatusModulo.Desconectado &&*/ SerialService.DispositivosCan.Contains(x.Dispositivo));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private AsyncTaskTimerModel tmrEnviarCAN;
|
|
||||||
private AsyncTaskTimerModel tmrOuvirCAN;
|
|
||||||
private AsyncTaskTimerModel tmrProcessarCAN;
|
|
||||||
private StringBuilder SerialCANBuffer = new StringBuilder();
|
|
||||||
private ConcurrentQueue<(byte, byte[])> FramesRecebidos = new ConcurrentQueue<(byte, byte[])>();
|
|
||||||
private readonly ConcurrentDictionary<byte, ICanMessageHandler> _roteadores = new ConcurrentDictionary<byte, ICanMessageHandler>();
|
|
||||||
private byte? _ultimoIdEnviado = null;
|
|
||||||
private List<CanMessage> MensagensPendentes = new List<CanMessage>();
|
|
||||||
private readonly object _LockMensagens = new object();
|
|
||||||
private bool DebugMode = false;
|
|
||||||
|
|
||||||
private void MostrarLog(string message, byte id)
|
|
||||||
{
|
|
||||||
if (DebugMode && new List<byte>() { 0x01 }.Contains(id))
|
|
||||||
{
|
|
||||||
Console.WriteLine($"[CAN] {message}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RegistrarHandler(byte endereco_rx, ICanMessageHandler handler)
|
|
||||||
{
|
|
||||||
_roteadores[endereco_rx] = handler;
|
|
||||||
MostrarLog($"Roteador registrado: {endereco_rx.ToString("X")}", endereco_rx);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Inicializar(SerialPort Porta = null)
|
|
||||||
{
|
|
||||||
bool canIniciado = Connector.IsOpen;
|
|
||||||
|
|
||||||
if (!canIniciado)
|
|
||||||
{
|
|
||||||
canIniciado = Connector.Open((VCI_CAN_OBJ frame) =>
|
|
||||||
{
|
|
||||||
byte[] dataRx = new byte[frame.DataLen];
|
|
||||||
Array.Copy(frame.Data, dataRx, frame.DataLen);
|
|
||||||
FramesRecebidos.Enqueue(((byte)frame.ID, dataRx));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!canIniciado)
|
|
||||||
{
|
|
||||||
MostrarLog($"Erro ao iniciar o conversor CAN FD no canal {Connector.Canal}.", 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MostrarLog($"Conversor CAN FD iniciado com sucesso no canal {Connector.Canal}.", 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (canIniciado || !IsConnected)
|
|
||||||
{
|
|
||||||
tmrEnviarCAN?.Dispose();
|
|
||||||
tmrEnviarCAN = new AsyncTaskTimerModel("tmrEnviarCAN", EnviarCAN, 5);
|
|
||||||
tmrEnviarCAN.Start();
|
|
||||||
|
|
||||||
tmrProcessarCAN?.Dispose();
|
|
||||||
tmrProcessarCAN = new AsyncTaskTimerModel("tmrProcessarCAN", ProcessarCAN, 10);
|
|
||||||
tmrProcessarCAN.Start();
|
|
||||||
|
|
||||||
IsConnected = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return canIniciado;
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task ProcessarCAN()
|
|
||||||
{
|
|
||||||
int mensagensParaProcessar = Math.Min(FramesRecebidos.Count, 10);
|
|
||||||
|
|
||||||
for (int i = 0; i < mensagensParaProcessar; i++)
|
|
||||||
{
|
|
||||||
if (FramesRecebidos.TryDequeue(out (byte, byte[]) frame))
|
|
||||||
{
|
|
||||||
ProcessarFrameCAN(frame);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// A fila ficou vazia antes de atingir o limite
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LimparMensagensAntigas();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ProcessarFrameCAN((byte, byte[]) frame)
|
|
||||||
{
|
|
||||||
byte id = frame.Item1;
|
|
||||||
byte[] data = frame.Item2;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
MostrarLog($"Processando frame: {BitConverter.ToString(data)}", id);
|
|
||||||
|
|
||||||
if (_roteadores.TryGetValue(id, out ICanMessageHandler handler))
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
T_Code dispositivo = handler?.Dispositivo ?? T_Code.Vzo;
|
|
||||||
byte fCodeRx = data[0];
|
|
||||||
byte parametroRx = data[1];
|
|
||||||
string chave = GerarChaveMensagem(dispositivo, id, data);
|
|
||||||
|
|
||||||
CanMessage mensagem = null;
|
|
||||||
lock (_LockMensagens)
|
|
||||||
{
|
|
||||||
mensagem = MensagensPendentes.FirstOrDefault(x => x.Enviado && !x.Respondido && x.Dispositivo == x.Dispositivo && x.IdRx == id && x.DataTx[1] == data[1]);
|
|
||||||
}
|
|
||||||
if (mensagem == null)
|
|
||||||
{
|
|
||||||
mensagem = new CanMessage { Dispositivo = dispositivo, IdTx = id, IdRx = id, funcCodeRx = fCodeRx, DataRx = data, ChaveInterna = chave };
|
|
||||||
}
|
|
||||||
mensagem.DataRx = data;
|
|
||||||
mensagem.Respondido = true;
|
|
||||||
mensagem.RespondidoEm = DateTime.Now;
|
|
||||||
|
|
||||||
if ((handler?.Dispositivo ?? T_Code.Vzo) != T_Code.Vzo)
|
|
||||||
{
|
|
||||||
handler.ProcessarMensagem(mensagem);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MostrarLog($"Roteador não registrado! ID_Num não tratado: 0x{id:X2}, fCodeRx: 0x{fCodeRx:X2}, frame: {frame}", id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MostrarLog($"Erro ao processar frame! Frame: {frame}, Erro: {ex.Message}", id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AdicionarMensagemNaFila(T_Code Dispositivo, byte idTx, byte idRx, byte funcCodeTx, byte funcCodeRx, byte[] payload = null, bool get = true)
|
|
||||||
{
|
|
||||||
if (!Connector.IsOpen) return;
|
|
||||||
|
|
||||||
var dados = new List<byte>() { funcCodeTx };
|
|
||||||
|
|
||||||
if (payload != null)
|
|
||||||
dados.AddRange(payload);
|
|
||||||
|
|
||||||
if (Dispositivo == T_Code.Mks)
|
|
||||||
{
|
|
||||||
byte crc = CalcularChecksum(idTx, dados.ToArray());
|
|
||||||
dados.Add(crc);
|
|
||||||
}
|
|
||||||
|
|
||||||
var novaMensagem = new CanMessage
|
|
||||||
{
|
|
||||||
Momento = DateTime.Now,
|
|
||||||
Dispositivo = Dispositivo,
|
|
||||||
IdTx = idTx,
|
|
||||||
IdRx = idRx,
|
|
||||||
funcCodeTx = funcCodeTx,
|
|
||||||
funcCodeRx = funcCodeRx,
|
|
||||||
DataTx = dados.ToArray(),
|
|
||||||
ComResposta = get,
|
|
||||||
ChaveInterna = GerarChaveMensagem(Dispositivo, idRx, dados.ToArray())
|
|
||||||
};
|
|
||||||
|
|
||||||
bool mensagemNaFila = false;
|
|
||||||
|
|
||||||
lock (_LockMensagens)
|
|
||||||
{
|
|
||||||
mensagemNaFila = MensagensPendentes.Any(x => (!x.Enviado || (x.ComResposta && x.Enviado && !x.Respondido)) && x.IdTx == idTx && x.IdRx == idRx && x.DataTx.SequenceEqual(dados.ToArray()));
|
|
||||||
if (!mensagemNaFila)
|
|
||||||
{
|
|
||||||
MensagensPendentes.Add(novaMensagem);
|
|
||||||
MostrarLog($"Mensagem adicionada na fila. ID: {novaMensagem.IdTx}, Data: {FuncoesGlobais.ConverterComandoBytesParaTexto(novaMensagem.DataTx)}", idTx);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MostrarLog($"Mensagem já pendente e idêntica. ID: {novaMensagem.IdTx}, Data: {FuncoesGlobais.ConverterComandoBytesParaTexto(novaMensagem.DataTx)}", idTx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private CanMessage ObterProximaMensagem()
|
|
||||||
{
|
|
||||||
List<CanMessage> mensagensPendentes;
|
|
||||||
|
|
||||||
lock (_LockMensagens)
|
|
||||||
{
|
|
||||||
mensagensPendentes = MensagensPendentes
|
|
||||||
.Where(x => !x.Enviado)
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!mensagensPendentes.Any())
|
|
||||||
return null;
|
|
||||||
|
|
||||||
// Primeiro tenta pegar mensagens com Get == false
|
|
||||||
var mensagensPrioritarias = mensagensPendentes
|
|
||||||
.Where(x => !x.ComResposta)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
// Se não houver mensagens prioritárias, considera todas
|
|
||||||
var mensagensParaProcessar = mensagensPrioritarias.Any()
|
|
||||||
? mensagensPrioritarias
|
|
||||||
: mensagensPendentes;
|
|
||||||
|
|
||||||
// Agrupa por IdTx e ordena os grupos
|
|
||||||
var idsDisponiveis = mensagensParaProcessar
|
|
||||||
.Select(x => x.IdTx)
|
|
||||||
.Distinct()
|
|
||||||
.OrderBy(x => x)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
byte proximoId;
|
|
||||||
|
|
||||||
if (!_ultimoIdEnviado.HasValue || !idsDisponiveis.Contains(_ultimoIdEnviado.Value))
|
|
||||||
{
|
|
||||||
proximoId = idsDisponiveis.First();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var index = idsDisponiveis.IndexOf(_ultimoIdEnviado.Value);
|
|
||||||
proximoId = (index + 1 < idsDisponiveis.Count) ? idsDisponiveis[index + 1] : idsDisponiveis.First();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Seleciona a mensagem mais antiga com esse IdTx
|
|
||||||
var proximaMsg = mensagensParaProcessar
|
|
||||||
.Where(x => x.IdTx == proximoId)
|
|
||||||
.OrderBy(x => x.Momento)
|
|
||||||
.FirstOrDefault();
|
|
||||||
|
|
||||||
return proximaMsg;
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task EnviarCAN()
|
|
||||||
{
|
|
||||||
if (!Connector.IsOpen) return;
|
|
||||||
|
|
||||||
CanMessage msg = ObterProximaMensagem();
|
|
||||||
|
|
||||||
if (msg != null)
|
|
||||||
{
|
|
||||||
string frame = CriarFrame(msg);
|
|
||||||
|
|
||||||
if (_ultimoIdEnviado.HasValue && msg.IdTx == _ultimoIdEnviado.Value)
|
|
||||||
{
|
|
||||||
await Task.Delay(5);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msg.Dispositivo == T_Code.Mks)
|
|
||||||
{
|
|
||||||
await Task.Delay(10);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!EnviarComando(frame, msg))
|
|
||||||
{
|
|
||||||
MostrarLog("Erro ao enviar frame", msg.IdTx);
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.Enviado = true;
|
|
||||||
msg.EnviadoEm = DateTime.Now;
|
|
||||||
_ultimoIdEnviado = msg.IdTx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private string CriarFrame(CanMessage msg)
|
|
||||||
{
|
|
||||||
string frame = $"t{msg.IdTx:X3}{msg.DataTx.Length}";
|
|
||||||
foreach (byte b in msg.DataTx)
|
|
||||||
frame += b.ToString("X2");
|
|
||||||
|
|
||||||
frame += "\r";
|
|
||||||
|
|
||||||
return frame;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool EnviarComando(string comando, CanMessage msg = null)
|
|
||||||
{
|
|
||||||
if (Connector.IsOpen)
|
|
||||||
{
|
|
||||||
bool sucesso = Connector.Send(msg.IdTx, msg.DataTx);
|
|
||||||
|
|
||||||
if (sucesso)
|
|
||||||
{
|
|
||||||
MostrarLog($"Frame enviado: {comando}", msg.IdTx);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MostrarLog($"Erro ao enviar frame: {comando}", msg.IdTx);
|
|
||||||
}
|
|
||||||
return sucesso;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LimparMensagensAntigas()
|
|
||||||
{
|
|
||||||
var agora = DateTime.Now;
|
|
||||||
|
|
||||||
lock (_LockMensagens)
|
|
||||||
{
|
|
||||||
List<CanMessage> mensagens = MensagensPendentes
|
|
||||||
.Where(x =>
|
|
||||||
(!x.ComResposta && x.Enviado) ||
|
|
||||||
(x.ComResposta && x.Respondido) ||
|
|
||||||
(x.ComResposta && x.Enviado && !x.Respondido && x.EnviadoEm < agora.AddSeconds(-1)) ||
|
|
||||||
(x.Momento < agora.AddSeconds(-30))
|
|
||||||
)
|
|
||||||
.ToList();
|
|
||||||
foreach (var item in mensagens)
|
|
||||||
{
|
|
||||||
MensagensPendentes.Remove(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Fechar()
|
|
||||||
{
|
|
||||||
tmrOuvirCAN?.Dispose();
|
|
||||||
tmrEnviarCAN?.Dispose();
|
|
||||||
|
|
||||||
lock (_LockMensagens)
|
|
||||||
{
|
|
||||||
MensagensPendentes.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
SerialCANBuffer.Clear();
|
|
||||||
FramesRecebidos = new ConcurrentQueue<(byte, byte[])>();
|
|
||||||
_roteadores.Clear();
|
|
||||||
_ultimoIdEnviado = null;
|
|
||||||
|
|
||||||
Connector.Close();
|
|
||||||
|
|
||||||
IsConnected = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
Fechar();
|
|
||||||
}
|
|
||||||
|
|
||||||
private byte CalcularChecksum(byte id, byte[] data)
|
|
||||||
{
|
|
||||||
int soma = id;
|
|
||||||
foreach (var b in data)
|
|
||||||
soma += b;
|
|
||||||
return (byte)(soma & 0xFF);
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GerarChaveMensagem(T_Code Dispositivo, byte Id, byte[] data)
|
|
||||||
{
|
|
||||||
byte parametro = 0x00;
|
|
||||||
|
|
||||||
// Para dispositivos que não sejam MKS, usar DataTx[1] se existir
|
|
||||||
if (Dispositivo != T_Code.Mks && (data?.Length ?? 0) > 1)
|
|
||||||
{
|
|
||||||
parametro = data[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $"{Id}_{data[0]}_{parametro}";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -36,6 +36,9 @@ namespace AgroBase.Services
|
||||||
private List<CanMessage> Mensagens = new List<CanMessage>();
|
private List<CanMessage> Mensagens = new List<CanMessage>();
|
||||||
private readonly object _LockMensagens = new object();
|
private readonly object _LockMensagens = new object();
|
||||||
|
|
||||||
|
private DateTime UltimoTx = DateTime.MinValue;
|
||||||
|
private DateTime UltimoRx = DateTime.MinValue;
|
||||||
|
|
||||||
private bool DebugMode = false;
|
private bool DebugMode = false;
|
||||||
private void MostrarLog(string message, byte id)
|
private void MostrarLog(string message, byte id)
|
||||||
{
|
{
|
||||||
|
|
@ -69,13 +72,27 @@ namespace AgroBase.Services
|
||||||
_portName = Porta.PortName;
|
_portName = Porta.PortName;
|
||||||
_baudRate = 115200;
|
_baudRate = 115200;
|
||||||
|
|
||||||
_PortaCAN = new SerialPort(_portName, _baudRate, Parity.None, 8, StopBits.One);
|
_PortaCAN = new SerialPort(_portName, _baudRate, Parity.None, 8, StopBits.One)
|
||||||
|
{
|
||||||
|
NewLine = "\r",
|
||||||
|
ReadTimeout = 500,
|
||||||
|
WriteTimeout = 500,
|
||||||
|
DtrEnable = true, // alguns adaptadores pedem
|
||||||
|
RtsEnable = true
|
||||||
|
};
|
||||||
_PortaCAN.Open();
|
_PortaCAN.Open();
|
||||||
|
|
||||||
EnviarComando("S6\r"); // 500Kbps
|
EnviarComando("C\r"); // fecha CAN (estado conhecido)
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(50);
|
||||||
EnviarComando("O\r"); // Open CAN
|
EnviarComando("Z0\r"); // desabilita timestamp
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(50);
|
||||||
|
EnviarComando("S6\r"); // 500 kbps
|
||||||
|
Thread.Sleep(50);
|
||||||
|
EnviarComando("O\r"); // open
|
||||||
|
Thread.Sleep(50);
|
||||||
|
|
||||||
|
_PortaCAN.DiscardInBuffer();
|
||||||
|
_PortaCAN.DiscardOutBuffer();
|
||||||
|
|
||||||
tmrOuvirCAN?.Dispose();
|
tmrOuvirCAN?.Dispose();
|
||||||
tmrOuvirCAN = new AsyncTaskTimerModel("tmrOuvirCAN", OuvirCAN, 5);
|
tmrOuvirCAN = new AsyncTaskTimerModel("tmrOuvirCAN", OuvirCAN, 5);
|
||||||
|
|
@ -124,6 +141,7 @@ namespace AgroBase.Services
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LimparMensagensAntigas();
|
LimparMensagensAntigas();
|
||||||
|
VerificaSaudeConexao();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OuvirCAN()
|
private async Task OuvirCAN()
|
||||||
|
|
@ -151,6 +169,11 @@ namespace AgroBase.Services
|
||||||
SerialCANBuffer.Append(c);
|
SerialCANBuffer.Append(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tempBuffer.Length > 0)
|
||||||
|
{
|
||||||
|
UltimoRx = DateTime.Now;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -167,6 +190,9 @@ namespace AgroBase.Services
|
||||||
int len = int.Parse(frame.Substring(4, 1));
|
int len = int.Parse(frame.Substring(4, 1));
|
||||||
|
|
||||||
byte[] data = new byte[len];
|
byte[] data = new byte[len];
|
||||||
|
|
||||||
|
if (data == null || data.Length == 0) return;
|
||||||
|
|
||||||
for (int i = 0; i < len; i++)
|
for (int i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
data[i] = Convert.ToByte(frame.Substring(5 + i * 2, 2), 16);
|
data[i] = Convert.ToByte(frame.Substring(5 + i * 2, 2), 16);
|
||||||
|
|
@ -174,20 +200,17 @@ namespace AgroBase.Services
|
||||||
|
|
||||||
MostrarLog($"Processando frame: {frame}", (byte)id);
|
MostrarLog($"Processando frame: {frame}", (byte)id);
|
||||||
|
|
||||||
if (_roteadores.TryGetValue((byte)id, out ICanMessageHandler handler))
|
_roteadores.TryGetValue((byte)id, out ICanMessageHandler handler);
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
T_Code dispositivo = handler?.Dispositivo ?? T_Code.Vzo;
|
T_Code dispositivo = handler?.Dispositivo ?? T_Code.Vzo;
|
||||||
byte fCodeRx = data[0];
|
byte fCodeRx = data.Length > 0 ? data[0] : (byte)0x00;
|
||||||
byte parametroRx = data[1];
|
byte parametroRx = data.Length > 1 ? data[1] : (byte)0x00;
|
||||||
string chave = GerarChaveMensagem(dispositivo, (byte)id, data);
|
string chave = GerarChaveMensagem(dispositivo, (byte)id, data);
|
||||||
|
|
||||||
CanMessage mensagem = null;
|
CanMessage mensagem = null;
|
||||||
lock (_LockMensagens)
|
lock (_LockMensagens)
|
||||||
{
|
{
|
||||||
mensagem = Mensagens.FirstOrDefault(x => x.Enviado && !x.Respondido && x.Dispositivo == x.Dispositivo && x.IdRx == id && x.DataTx[1] == data[1]);
|
mensagem = Mensagens.FirstOrDefault(x => x.Enviado && !x.Respondido && x.Dispositivo == dispositivo && x.IdRx == id && x.DataTx[1] == data[1]);
|
||||||
}
|
}
|
||||||
if (mensagem == null)
|
if (mensagem == null)
|
||||||
{
|
{
|
||||||
|
|
@ -392,6 +415,7 @@ namespace AgroBase.Services
|
||||||
{
|
{
|
||||||
_PortaCAN.Write(comando);
|
_PortaCAN.Write(comando);
|
||||||
//Console.WriteLine($"[CAN] Frame enviado: {comando}");
|
//Console.WriteLine($"[CAN] Frame enviado: {comando}");
|
||||||
|
UltimoTx = DateTime.Now;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -418,6 +442,26 @@ namespace AgroBase.Services
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void VerificaSaudeConexao()
|
||||||
|
{
|
||||||
|
if (IsConnected && (UltimoTx - UltimoRx).TotalSeconds > 2)
|
||||||
|
{
|
||||||
|
MostrarLog("Muito tempo sem receber novos dados, reiniciando conexao CAN...", 0);
|
||||||
|
try { _PortaCAN?.Close(); } catch { }
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_PortaCAN?.Open();
|
||||||
|
EnviarComando("C\r"); Thread.Sleep(50);
|
||||||
|
EnviarComando("Z0\r"); Thread.Sleep(50);
|
||||||
|
EnviarComando("S6\r"); Thread.Sleep(50);
|
||||||
|
EnviarComando("O\r"); Thread.Sleep(50);
|
||||||
|
UltimoRx = DateTime.MinValue;
|
||||||
|
UltimoTx = DateTime.MinValue;
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Fechar()
|
public void Fechar()
|
||||||
{
|
{
|
||||||
tmrOuvirCAN?.Dispose();
|
tmrOuvirCAN?.Dispose();
|
||||||
|
|
@ -0,0 +1,409 @@
|
||||||
|
using AgroBase.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO.Ports;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using static AgroBase.Models.Enums;
|
||||||
|
using static WaveshareCANFDService;
|
||||||
|
|
||||||
|
namespace AgroBase.Services
|
||||||
|
{
|
||||||
|
internal class CanServiceWaveshare : ICanService
|
||||||
|
{
|
||||||
|
public WaveshareCANFDService Connector = new WaveshareCANFDService(0);
|
||||||
|
public string _portName { get; set; } = "CAN-FD";
|
||||||
|
public bool IsConnected { get; private set; }
|
||||||
|
public bool Iniciado
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return SerialService.DispositivosMapeados.Any(x => /*x.Status != StatusModulo.Desconectado &&*/ SerialService.DispositivosCan.Contains(x.Dispositivo));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private AsyncTaskTimerModel tmrEnviarCAN;
|
||||||
|
private AsyncTaskTimerModel tmrOuvirCAN;
|
||||||
|
private AsyncTaskTimerModel tmrProcessarCAN;
|
||||||
|
private StringBuilder SerialCANBuffer = new StringBuilder();
|
||||||
|
private ConcurrentQueue<(uint, byte[])> FramesRecebidos = new ConcurrentQueue<(uint, byte[])>();
|
||||||
|
private readonly ConcurrentDictionary<byte, ICanMessageHandler> _roteadores = new ConcurrentDictionary<byte, ICanMessageHandler>();
|
||||||
|
private byte? _ultimoIdEnviado = null;
|
||||||
|
private List<CanMessage> MensagensPendentes = new List<CanMessage>();
|
||||||
|
private readonly object _LockMensagens = new object();
|
||||||
|
private bool DebugMode = false;
|
||||||
|
private DateTime UltimoTx = DateTime.MinValue;
|
||||||
|
private DateTime UltimoRx = DateTime.MinValue;
|
||||||
|
|
||||||
|
private void MostrarLog(string message, byte id)
|
||||||
|
{
|
||||||
|
if (DebugMode/* && new List<byte>() { 0x01 }.Contains(id)*/)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"[CAN] {message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RegistrarHandler(byte endereco_rx, ICanMessageHandler handler)
|
||||||
|
{
|
||||||
|
_roteadores[endereco_rx] = handler;
|
||||||
|
MostrarLog($"Roteador registrado: {endereco_rx.ToString("X")}", endereco_rx);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Inicializar(SerialPort Porta = null)
|
||||||
|
{
|
||||||
|
bool canIniciado = Connector.IsOpen;
|
||||||
|
|
||||||
|
if (!canIniciado)
|
||||||
|
{
|
||||||
|
canIniciado = Connector.Open((VCI_CAN_OBJ frame) =>
|
||||||
|
{
|
||||||
|
byte[] dataRx = new byte[frame.DataLen];
|
||||||
|
Array.Copy(frame.Data, dataRx, frame.DataLen);
|
||||||
|
FramesRecebidos.Enqueue((frame.ID, dataRx));
|
||||||
|
UltimoRx = DateTime.Now;
|
||||||
|
}, samplePoint: 0.8, bitrateKbps: 250);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!canIniciado)
|
||||||
|
{
|
||||||
|
MostrarLog($"Erro ao iniciar o conversor CAN FD no canal {Connector.Canal}.", 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MostrarLog($"Conversor CAN FD iniciado com sucesso no canal {Connector.Canal}.", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canIniciado || !IsConnected)
|
||||||
|
{
|
||||||
|
tmrEnviarCAN?.Dispose();
|
||||||
|
tmrEnviarCAN = new AsyncTaskTimerModel("tmrEnviarCAN", EnviarCAN, 5);
|
||||||
|
tmrEnviarCAN.Start();
|
||||||
|
|
||||||
|
tmrProcessarCAN?.Dispose();
|
||||||
|
tmrProcessarCAN = new AsyncTaskTimerModel("tmrProcessarCAN", ProcessarCAN, 10);
|
||||||
|
tmrProcessarCAN.Start();
|
||||||
|
|
||||||
|
IsConnected = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return canIniciado;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task ProcessarCAN()
|
||||||
|
{
|
||||||
|
int mensagensParaProcessar = Math.Min(FramesRecebidos.Count, 10);
|
||||||
|
|
||||||
|
for (int i = 0; i < mensagensParaProcessar; i++)
|
||||||
|
{
|
||||||
|
if (FramesRecebidos.TryDequeue(out (uint, byte[]) frame))
|
||||||
|
{
|
||||||
|
ProcessarFrameCAN(frame);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// A fila ficou vazia antes de atingir o limite
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LimparMensagensAntigas();
|
||||||
|
VerificaSaudeConexao();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ProcessarFrameCAN((uint, byte[]) frame)
|
||||||
|
{
|
||||||
|
uint id = frame.Item1;
|
||||||
|
byte[] data = frame.Item2;
|
||||||
|
|
||||||
|
if (data == null || data.Length == 0) return;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
MostrarLog($"Processando frame: {BitConverter.ToString(data)}", (byte)id);
|
||||||
|
|
||||||
|
if (_roteadores.TryGetValue((byte)id, out ICanMessageHandler handler))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
T_Code dispositivo = handler?.Dispositivo ?? T_Code.Vzo;
|
||||||
|
byte fCodeRx = data[0];
|
||||||
|
byte parametroRx = data.Length > 1 ? data[1] : (byte)0x00;
|
||||||
|
string chave = GerarChaveMensagem(dispositivo, (byte)id, data);
|
||||||
|
|
||||||
|
CanMessage mensagem = null;
|
||||||
|
lock (_LockMensagens)
|
||||||
|
{
|
||||||
|
mensagem = MensagensPendentes.FirstOrDefault(x => x.Enviado && !x.Respondido && x.Dispositivo == dispositivo && x.IdRx == id && x.DataTx[1] == data[1]);
|
||||||
|
}
|
||||||
|
if (mensagem == null)
|
||||||
|
{
|
||||||
|
mensagem = new CanMessage { Dispositivo = dispositivo, IdTx = (byte)id, IdRx = (byte)id, funcCodeRx = fCodeRx, DataRx = data, ChaveInterna = chave };
|
||||||
|
}
|
||||||
|
mensagem.DataRx = data;
|
||||||
|
mensagem.Respondido = true;
|
||||||
|
mensagem.RespondidoEm = DateTime.Now;
|
||||||
|
|
||||||
|
if ((handler?.Dispositivo ?? T_Code.Vzo) != T_Code.Vzo)
|
||||||
|
{
|
||||||
|
handler.ProcessarMensagem(mensagem);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MostrarLog($"Roteador não registrado! ID_Num não tratado: 0x{id:X2}, fCodeRx: 0x{fCodeRx:X2}, frame: {frame}", (byte)id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MostrarLog($"Erro ao processar frame! Frame: {frame}, Erro: {ex.Message}", (byte)id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AdicionarMensagemNaFila(T_Code Dispositivo, byte idTx, byte idRx, byte funcCodeTx, byte funcCodeRx, byte[] payload = null, bool get = true)
|
||||||
|
{
|
||||||
|
if (!Connector.IsOpen) return;
|
||||||
|
|
||||||
|
var dados = new List<byte>() { funcCodeTx };
|
||||||
|
|
||||||
|
if (payload != null)
|
||||||
|
dados.AddRange(payload);
|
||||||
|
|
||||||
|
if (Dispositivo == T_Code.Mks)
|
||||||
|
{
|
||||||
|
byte crc = CalcularChecksum(idTx, dados.ToArray());
|
||||||
|
dados.Add(crc);
|
||||||
|
}
|
||||||
|
|
||||||
|
var novaMensagem = new CanMessage
|
||||||
|
{
|
||||||
|
Momento = DateTime.Now,
|
||||||
|
Dispositivo = Dispositivo,
|
||||||
|
IdTx = idTx,
|
||||||
|
IdRx = idRx,
|
||||||
|
funcCodeTx = funcCodeTx,
|
||||||
|
funcCodeRx = funcCodeRx,
|
||||||
|
DataTx = dados.ToArray(),
|
||||||
|
ComResposta = get,
|
||||||
|
ChaveInterna = GerarChaveMensagem(Dispositivo, idRx, dados.ToArray())
|
||||||
|
};
|
||||||
|
|
||||||
|
bool mensagemNaFila = false;
|
||||||
|
|
||||||
|
lock (_LockMensagens)
|
||||||
|
{
|
||||||
|
mensagemNaFila = MensagensPendentes.Any(x => (!x.Enviado || (x.ComResposta && x.Enviado && !x.Respondido)) && x.IdTx == idTx && x.IdRx == idRx && x.DataTx.SequenceEqual(dados.ToArray()));
|
||||||
|
if (!mensagemNaFila)
|
||||||
|
{
|
||||||
|
MensagensPendentes.Add(novaMensagem);
|
||||||
|
MostrarLog($"Mensagem adicionada na fila. ID: {novaMensagem.IdTx}, Data: {FuncoesGlobais.ConverterComandoBytesParaTexto(novaMensagem.DataTx)}", idTx);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MostrarLog($"Mensagem já pendente e idêntica. ID: {novaMensagem.IdTx}, Data: {FuncoesGlobais.ConverterComandoBytesParaTexto(novaMensagem.DataTx)}", idTx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private CanMessage ObterProximaMensagem()
|
||||||
|
{
|
||||||
|
List<CanMessage> mensagensPendentes;
|
||||||
|
|
||||||
|
lock (_LockMensagens)
|
||||||
|
{
|
||||||
|
mensagensPendentes = MensagensPendentes
|
||||||
|
.Where(x => !x.Enviado)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mensagensPendentes.Any())
|
||||||
|
return null;
|
||||||
|
|
||||||
|
// Primeiro tenta pegar mensagens com Get == false
|
||||||
|
var mensagensPrioritarias = mensagensPendentes
|
||||||
|
.Where(x => !x.ComResposta)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
// Se não houver mensagens prioritárias, considera todas
|
||||||
|
var mensagensParaProcessar = mensagensPrioritarias.Any()
|
||||||
|
? mensagensPrioritarias
|
||||||
|
: mensagensPendentes;
|
||||||
|
|
||||||
|
// Agrupa por IdTx e ordena os grupos
|
||||||
|
var idsDisponiveis = mensagensParaProcessar
|
||||||
|
.Select(x => x.IdTx)
|
||||||
|
.Distinct()
|
||||||
|
.OrderBy(x => x)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
byte proximoId;
|
||||||
|
|
||||||
|
if (!_ultimoIdEnviado.HasValue || !idsDisponiveis.Contains(_ultimoIdEnviado.Value))
|
||||||
|
{
|
||||||
|
proximoId = idsDisponiveis.First();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var index = idsDisponiveis.IndexOf(_ultimoIdEnviado.Value);
|
||||||
|
proximoId = (index + 1 < idsDisponiveis.Count) ? idsDisponiveis[index + 1] : idsDisponiveis.First();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Seleciona a mensagem mais antiga com esse IdTx
|
||||||
|
var proximaMsg = mensagensParaProcessar
|
||||||
|
.Where(x => x.IdTx == proximoId)
|
||||||
|
.OrderBy(x => x.Momento)
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
return proximaMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task EnviarCAN()
|
||||||
|
{
|
||||||
|
if (!Connector.IsOpen) return;
|
||||||
|
|
||||||
|
CanMessage msg = ObterProximaMensagem();
|
||||||
|
|
||||||
|
if (msg != null)
|
||||||
|
{
|
||||||
|
string frame = CriarFrame(msg);
|
||||||
|
|
||||||
|
if (_ultimoIdEnviado.HasValue && msg.IdTx == _ultimoIdEnviado.Value)
|
||||||
|
{
|
||||||
|
await Task.Delay(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (msg.Dispositivo == T_Code.Mks)
|
||||||
|
{
|
||||||
|
await Task.Delay(10);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EnviarComando(frame, msg))
|
||||||
|
{
|
||||||
|
MostrarLog("Erro ao enviar frame", msg.IdTx);
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.Enviado = true;
|
||||||
|
msg.EnviadoEm = DateTime.Now;
|
||||||
|
_ultimoIdEnviado = msg.IdTx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string CriarFrame(CanMessage msg)
|
||||||
|
{
|
||||||
|
string frame = $"t{msg.IdTx:X3}{msg.DataTx.Length}";
|
||||||
|
foreach (byte b in msg.DataTx)
|
||||||
|
frame += b.ToString("X2");
|
||||||
|
|
||||||
|
frame += "\r";
|
||||||
|
|
||||||
|
return frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool EnviarComando(string comando, CanMessage msg = null)
|
||||||
|
{
|
||||||
|
if (Connector.IsOpen)
|
||||||
|
{
|
||||||
|
bool sucesso = Connector.Send(msg.IdTx, msg.DataTx);
|
||||||
|
|
||||||
|
if (sucesso)
|
||||||
|
{
|
||||||
|
MostrarLog($"Frame enviado: {comando}", msg.IdTx);
|
||||||
|
UltimoTx = DateTime.Now;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MostrarLog($"Erro ao enviar frame: {comando}", msg.IdTx);
|
||||||
|
}
|
||||||
|
return sucesso;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LimparMensagensAntigas()
|
||||||
|
{
|
||||||
|
var agora = DateTime.Now;
|
||||||
|
|
||||||
|
lock (_LockMensagens)
|
||||||
|
{
|
||||||
|
List<CanMessage> mensagens = MensagensPendentes
|
||||||
|
.Where(x =>
|
||||||
|
(!x.ComResposta && x.Enviado) ||
|
||||||
|
(x.ComResposta && x.Respondido) ||
|
||||||
|
(x.ComResposta && x.Enviado && !x.Respondido && x.EnviadoEm < agora.AddSeconds(-1)) ||
|
||||||
|
(x.Momento < agora.AddSeconds(-30))
|
||||||
|
)
|
||||||
|
.ToList();
|
||||||
|
foreach (var item in mensagens)
|
||||||
|
{
|
||||||
|
MensagensPendentes.Remove(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void VerificaSaudeConexao()
|
||||||
|
{
|
||||||
|
if (IsConnected && (UltimoTx - UltimoRx).TotalSeconds > 10)
|
||||||
|
{
|
||||||
|
MostrarLog("Muito tempo sem receber novos dados, reiniciando conexao CAN...", 0);
|
||||||
|
try { Connector.Close(); } catch { }
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Inicializar();
|
||||||
|
UltimoRx = DateTime.MinValue;
|
||||||
|
UltimoTx = DateTime.MinValue;
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Fechar()
|
||||||
|
{
|
||||||
|
tmrOuvirCAN?.Dispose();
|
||||||
|
tmrEnviarCAN?.Dispose();
|
||||||
|
|
||||||
|
lock (_LockMensagens)
|
||||||
|
{
|
||||||
|
MensagensPendentes.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
SerialCANBuffer.Clear();
|
||||||
|
FramesRecebidos = new ConcurrentQueue<(uint, byte[])>();
|
||||||
|
_roteadores.Clear();
|
||||||
|
_ultimoIdEnviado = null;
|
||||||
|
|
||||||
|
Connector.Close();
|
||||||
|
|
||||||
|
IsConnected = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
Fechar();
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte CalcularChecksum(byte id, byte[] data)
|
||||||
|
{
|
||||||
|
int soma = id;
|
||||||
|
foreach (var b in data)
|
||||||
|
soma += b;
|
||||||
|
return (byte)(soma & 0xFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GerarChaveMensagem(T_Code Dispositivo, byte Id, byte[] data)
|
||||||
|
{
|
||||||
|
if (data == null || data.Length == 0) return $"{Id}_empty";
|
||||||
|
|
||||||
|
// MKS: chaveia por funcCode apenas
|
||||||
|
if (Dispositivo == T_Code.Mks)
|
||||||
|
return $"{Id}_{data[0]}";
|
||||||
|
|
||||||
|
// Outros: mantém param se houver
|
||||||
|
byte parametro = (data.Length > 1) ? data[1] : (byte)0x00;
|
||||||
|
return $"{Id}_{data[0]}_{parametro}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -44,7 +44,7 @@ namespace AgroBase.Services
|
||||||
private static int rtk_timeout = 60;
|
private static int rtk_timeout = 60;
|
||||||
private static int TempoMin_Ntrip = 10;
|
private static int TempoMin_Ntrip = 10;
|
||||||
private static bool LoopRTK_Ntrip = false;
|
private static bool LoopRTK_Ntrip = false;
|
||||||
public static bool CorrecaoRTK_Ntrip = false;
|
public static bool CorrecaoRTK_Ntrip = true;
|
||||||
public static DateTime UltimoEnvioCorrecaoRTK = DateTime.MinValue;
|
public static DateTime UltimoEnvioCorrecaoRTK = DateTime.MinValue;
|
||||||
|
|
||||||
public static void AtualizarPortaCOM(SerialPort Porta)
|
public static void AtualizarPortaCOM(SerialPort Porta)
|
||||||
|
|
@ -793,7 +793,7 @@ namespace AgroBase.Services
|
||||||
|
|
||||||
private static async Task AplicarCorrecaoRTK_Ntrip()
|
private static async Task AplicarCorrecaoRTK_Ntrip()
|
||||||
{
|
{
|
||||||
if (LoopRTK_Ntrip || !APIService.HasInternet || true)
|
if (!Iniciado || LoopRTK_Ntrip || !APIService.HasInternet)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LoopRTK_Ntrip = true;
|
LoopRTK_Ntrip = true;
|
||||||
|
|
|
||||||
|
|
@ -139,8 +139,8 @@ namespace AgroBase.Services.Operadores
|
||||||
),
|
),
|
||||||
("Gerais", new
|
("Gerais", new
|
||||||
{
|
{
|
||||||
velocidade_ms = _Sensoriamento.Movimentacao != null ? _Sensoriamento.Movimentacao.VelocidadeMedia : 0,
|
velocidade_ms = _Sensoriamento.Movimentacao?.VelocidadeMedia ?? 0,
|
||||||
ervas_no_radar = _Sensoriamento.Atuador != null ? _Sensoriamento.Atuador.ErvasNoRadar : false,
|
ervas_no_radar = _Sensoriamento.Atuador?.ErvasNoRadar ?? false,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ public class WaveshareCANFDService
|
||||||
private AsyncTaskTimerModel tmrLeitura;
|
private AsyncTaskTimerModel tmrLeitura;
|
||||||
private readonly int delayTickTimer = 1;
|
private readonly int delayTickTimer = 1;
|
||||||
private bool isOpen = false;
|
private bool isOpen = false;
|
||||||
VCI_CAN_OBJ[] buffer = new VCI_CAN_OBJ[100];
|
private bool _rxBusy = false;
|
||||||
|
|
||||||
public bool IsOpen => isOpen;
|
public bool IsOpen => isOpen;
|
||||||
public int Canal => ((int)channelIndex + 1);
|
public int Canal => ((int)channelIndex + 1);
|
||||||
|
|
@ -69,78 +69,118 @@ public class WaveshareCANFDService
|
||||||
[DllImport("ControlCANFD.dll", CallingConvention = CallingConvention.StdCall)]
|
[DllImport("ControlCANFD.dll", CallingConvention = CallingConvention.StdCall)]
|
||||||
public static extern uint VCI_Receive(uint DeviceType, uint DeviceInd, uint CANInd, [In, Out] VCI_CAN_OBJ[] pReceive, uint Len, int WaitTime);
|
public static extern uint VCI_Receive(uint DeviceType, uint DeviceInd, uint CANInd, [In, Out] VCI_CAN_OBJ[] pReceive, uint Len, int WaitTime);
|
||||||
|
|
||||||
public bool Open(Action<VCI_CAN_OBJ> onReceive)
|
[DllImport("ControlCANFD.dll", CallingConvention = CallingConvention.StdCall)]
|
||||||
|
public static extern uint VCI_SetReference(uint DeviceType, uint DeviceInd, uint CANInd, uint RefType, ref uint pData);
|
||||||
|
|
||||||
|
public bool Open(Action<VCI_CAN_OBJ> onReceive, int bitrateKbps = 500, double samplePoint = 0.875)
|
||||||
{
|
{
|
||||||
callback = onReceive;
|
callback = onReceive;
|
||||||
|
|
||||||
if (VCI_OpenDevice(DEVICE_TYPE, DEVICE_INDEX, 0) != 1)
|
if (VCI_OpenDevice(DEVICE_TYPE, DEVICE_INDEX, 0) != 1) return false;
|
||||||
|
|
||||||
|
if (VCI_OpenDevice(DEVICE_TYPE, DEVICE_INDEX, 0) != 1) return false;
|
||||||
|
|
||||||
|
// >>> SET BAUD PARA CAN-FD (ignora Timing0/1)
|
||||||
|
uint baudCode = MapToFdBaudCode(bitrateKbps);
|
||||||
|
if (VCI_SetReference(DEVICE_TYPE, DEVICE_INDEX, channelIndex, 0 /*RefType: baud*/, ref baudCode) != 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// o resto pode ficar igual; Timing0/1 serão ignorados pela DLL FD, então ponha 0 para clareza
|
||||||
var config = new VCI_INIT_CONFIG
|
var config = new VCI_INIT_CONFIG
|
||||||
{
|
{
|
||||||
AccCode = 0,
|
AccCode = 0x00000000,
|
||||||
AccMask = 0xFFFFFFFF,
|
AccMask = 0xFFFFFFFF, // FD: máscara é ignorada segundo manual; sem problemas
|
||||||
Reserved = 0,
|
Reserved = 0,
|
||||||
Filter = 0,
|
Filter = 0, // filtro padrão
|
||||||
Timing0 = 0x00,
|
Timing0 = 0, // ignorado em FD
|
||||||
Timing1 = 0x1C,
|
Timing1 = 0, // ignorado em FD
|
||||||
Mode = 0
|
Mode = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
if (VCI_InitCAN(DEVICE_TYPE, DEVICE_INDEX, channelIndex, ref config) != 1)
|
if (VCI_InitCAN(DEVICE_TYPE, DEVICE_INDEX, channelIndex, ref config) != 1) return false;
|
||||||
return false;
|
if (VCI_StartCAN(DEVICE_TYPE, DEVICE_INDEX, channelIndex) != 1) return false;
|
||||||
|
|
||||||
if (VCI_StartCAN(DEVICE_TYPE, DEVICE_INDEX, channelIndex) != 1)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
tmrLeitura?.Dispose();
|
tmrLeitura?.Dispose();
|
||||||
tmrLeitura = new AsyncTaskTimerModel($"tmrLeitura_CAN_{Canal}", tmrLeitura_Tick, delayTickTimer);
|
tmrLeitura = new AsyncTaskTimerModel($"tmrLeitura_CAN_{Canal}", tmrLeitura_Tick, delayTickTimer);
|
||||||
tmrLeitura.Start();
|
tmrLeitura.Start();
|
||||||
|
|
||||||
isOpen = true;
|
isOpen = true;
|
||||||
Console.WriteLine($"[CAN-FD] Canal {Canal} aberto");
|
Console.WriteLine($"[CAN-FD] Canal {Canal} aberto @ {bitrateKbps} kbps, SP≈{samplePoint * 100:0.#}%");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Send(uint id, byte[] data)
|
// Exemplos de mapeamento (SJA1000-like):
|
||||||
|
private static uint MapToFdBaudCode(int kbps)
|
||||||
{
|
{
|
||||||
if (!isOpen || data.Length > 8) return false;
|
switch (kbps)
|
||||||
|
{
|
||||||
|
case 1000: return 0x060003;
|
||||||
|
case 800: return 0x060004;
|
||||||
|
case 500: return 0x060007;
|
||||||
|
case 250: return 0x1C0008;
|
||||||
|
case 125: return 0x1C0011;
|
||||||
|
case 100: return 0x160023;
|
||||||
|
case 50: return 0x1C002C;
|
||||||
|
case 20: return 0x1600B3;
|
||||||
|
case 10: return 0x1C00E0;
|
||||||
|
case 5: return 0x1C01C1;
|
||||||
|
default: return 0x060007;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Send(uint id, byte[] data, bool isExtended = false, bool isRemote = false)
|
||||||
|
{
|
||||||
|
if (!isOpen || data == null || data.Length > 8) return false;
|
||||||
|
|
||||||
|
id &= 0x7FF; // <- garante Standard ID
|
||||||
|
|
||||||
var obj = new VCI_CAN_OBJ
|
var obj = new VCI_CAN_OBJ
|
||||||
{
|
{
|
||||||
ID = id,
|
ID = id,
|
||||||
SendType = 0,
|
SendType = 0,
|
||||||
RemoteFlag = 0,
|
RemoteFlag = (byte)(isRemote ? 1 : 0),
|
||||||
ExternFlag = 0,
|
ExternFlag = (byte)(isExtended ? 1 : 0),
|
||||||
DataLen = (byte)data.Length,
|
DataLen = (byte)data.Length,
|
||||||
Data = new byte[8],
|
Data = new byte[8],
|
||||||
Reserved = new byte[3]
|
Reserved = new byte[3]
|
||||||
};
|
};
|
||||||
Array.Copy(data, obj.Data, data.Length);
|
Array.Copy(data, obj.Data, data.Length);
|
||||||
|
return VCI_Transmit(DEVICE_TYPE, DEVICE_INDEX, channelIndex, ref obj, 1) > 0;
|
||||||
var result = VCI_Transmit(DEVICE_TYPE, DEVICE_INDEX, channelIndex, ref obj, 1);
|
|
||||||
//Console.WriteLine($"[CAN TX] ID: 0x{id:X3} Data: {BitConverter.ToString(data)} Result: {result}");
|
|
||||||
return result > 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task tmrLeitura_Tick()
|
private async Task tmrLeitura_Tick()
|
||||||
{
|
{
|
||||||
buffer = new VCI_CAN_OBJ[100];
|
if (_rxBusy) return;
|
||||||
for (int i = 0; i < buffer.Length; i++)
|
_rxBusy = true;
|
||||||
buffer[i].Data = new byte[8]; // limpa possíveis lixos
|
try
|
||||||
|
{
|
||||||
|
// (re)aloca buffer local por tick para evitar lixo compartilhado
|
||||||
|
var local = new VCI_CAN_OBJ[100];
|
||||||
|
for (int i = 0; i < local.Length; i++)
|
||||||
|
local[i].Data = new byte[8];
|
||||||
|
|
||||||
var count = VCI_Receive(DEVICE_TYPE, DEVICE_INDEX, channelIndex, buffer, 100, 100);
|
var count = VCI_Receive(DEVICE_TYPE, DEVICE_INDEX, channelIndex, local, 100, 100);
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
var frame = buffer[i];
|
var frame = local[i];
|
||||||
var data = new byte[frame.DataLen];
|
var data = new byte[frame.DataLen];
|
||||||
Array.Copy(frame.Data, data, frame.DataLen);
|
Array.Copy(frame.Data, data, frame.DataLen);
|
||||||
|
|
||||||
|
// 🔧 substitui o Data pelo array "desanexado" do buffer
|
||||||
|
frame.Data = data;
|
||||||
|
|
||||||
|
// entrega frame "isolado" ao callback
|
||||||
callback?.Invoke(frame);
|
callback?.Invoke(frame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_rxBusy = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -20,7 +20,14 @@
|
||||||
"padded_top_topics_start_index": 0,
|
"padded_top_topics_start_index": 0,
|
||||||
"taxonomy_version": 0,
|
"taxonomy_version": 0,
|
||||||
"top_topics_and_observing_domains": [ ]
|
"top_topics_and_observing_domains": [ ]
|
||||||
|
}, {
|
||||||
|
"calculation_time": "13400595140854297",
|
||||||
|
"config_version": 0,
|
||||||
|
"model_version": "0",
|
||||||
|
"padded_top_topics_start_index": 0,
|
||||||
|
"taxonomy_version": 0,
|
||||||
|
"top_topics_and_observing_domains": [ ]
|
||||||
} ],
|
} ],
|
||||||
"hex_encoded_hmac_key": "40F346D3248C3AFDF2BEE1FE496DBD32F7CED6E5AE98B881ABC421AA7E7B5642",
|
"hex_encoded_hmac_key": "40F346D3248C3AFDF2BEE1FE496DBD32F7CED6E5AE98B881ABC421AA7E7B5642",
|
||||||
"next_scheduled_calculation_time": "13400432611772238"
|
"next_scheduled_calculation_time": "13401199940855097"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,3 +1,3 @@
|
||||||
2025/08/22-10:57:48.747 3fc4 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001
|
2025/08/25-17:06:11.375 d6c Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001
|
||||||
2025/08/22-10:57:48.753 3fc4 Recovering log #3
|
2025/08/25-17:06:11.381 d6c Recovering log #3
|
||||||
2025/08/22-10:57:48.756 3fc4 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/000003.log
|
2025/08/25-17:06:11.384 d6c Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/000003.log
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
2025/08/22-10:47:37.338 2a88 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001
|
2025/08/25-17:05:24.176 da4 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001
|
||||||
2025/08/22-10:47:37.345 2a88 Recovering log #3
|
2025/08/25-17:05:24.181 da4 Recovering log #3
|
||||||
2025/08/22-10:47:37.349 2a88 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/000003.log
|
2025/08/25-17:05:24.184 da4 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/000003.log
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
{"net":{"http_server_properties":{"servers":[{"alternative_service":[{"advertised_alpns":["h3"],"expiration":"13400431527833615","port":443,"protocol_str":"quic"}],"anonymization":["DAAAAAcAAABmaWxlOi8vAA==",false,0],"network_stats":{"srtt":18302},"server":"https://tile.openstreetmap.org","supports_spdy":true}],"supports_quic":{"address":"2804:d78:60c:f100:c78:e04e:44f:8fe","used_quic":true},"version":5},"network_qualities":{"CAASABiAgICA+P////8B":"4G","CAESABiAgICA+P////8B":"4G","CAISABiAgICA+P////8B":"4G","CAYSABiAgICA+P////8B":"Offline"}}}
|
{"net":{"http_server_properties":{"servers":[{"alternative_service":[{"advertised_alpns":["h3"],"expiration":"13400712371911326","port":443,"protocol_str":"quic"}],"anonymization":["DAAAAAcAAABmaWxlOi8vAA==",false,0],"network_stats":{"srtt":42895},"server":"https://tile.openstreetmap.org","supports_spdy":true}],"supports_quic":{"address":"2804:d78:60c:f100:fd1a:acec:81f9:ab34","used_quic":true},"version":5},"network_qualities":{"CAASABiAgICA+P////8B":"4G","CAESABiAgICA+P////8B":"4G","CAISABiAgICA+P////8B":"4G","CAYSABiAgICA+P////8B":"Offline"}}}
|
||||||
|
|
@ -1 +1 @@
|
||||||
{"sts":[{"expiry":1787405309.402605,"host":"bWGAftl61rqoc0YzqPncsLvQQh/iC2Bdp3ejUeGC83w=","mode":"force-https","sts_include_subdomains":true,"sts_observed":1755869309.402614}],"version":2}
|
{"sts":[{"expiry":1787685962.878582,"host":"bWGAftl61rqoc0YzqPncsLvQQh/iC2Bdp3ejUeGC83w=","mode":"force-https","sts_include_subdomains":true,"sts_observed":1756149962.878585}],"version":2}
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,3 +1,3 @@
|
||||||
2025/08/22-13:45:28.240 3fc4 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/MANIFEST-000001
|
2025/08/25-17:07:32.655 d6c Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/MANIFEST-000001
|
||||||
2025/08/22-13:45:28.242 3fc4 Recovering log #3
|
2025/08/25-17:07:32.656 d6c Recovering log #3
|
||||||
2025/08/22-13:45:28.246 3fc4 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/000003.log
|
2025/08/25-17:07:32.661 d6c Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/000003.log
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
2025/08/22-10:49:31.955 2a88 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/MANIFEST-000001
|
2025/08/25-17:05:59.944 da4 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/MANIFEST-000001
|
||||||
2025/08/22-10:49:31.957 2a88 Recovering log #3
|
2025/08/25-17:05:59.945 da4 Recovering log #3
|
||||||
2025/08/22-10:49:31.960 2a88 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/000003.log
|
2025/08/25-17:05:59.949 da4 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/000003.log
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
2025/08/22-10:57:48.675 c54 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/MANIFEST-000001
|
2025/08/25-17:06:11.307 51e4 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/MANIFEST-000001
|
||||||
2025/08/22-10:57:48.676 c54 Recovering log #7
|
2025/08/25-17:06:11.309 51e4 Recovering log #7
|
||||||
2025/08/22-10:57:48.677 c54 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/000007.log
|
2025/08/25-17:06:11.309 51e4 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/000007.log
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
2025/08/22-10:47:37.263 3d50 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/MANIFEST-000001
|
2025/08/25-17:05:24.104 698c Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/MANIFEST-000001
|
||||||
2025/08/22-10:47:37.265 3d50 Recovering log #7
|
2025/08/25-17:05:24.106 698c Recovering log #7
|
||||||
2025/08/22-10:47:37.265 3d50 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/000007.log
|
2025/08/25-17:05:24.106 698c Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/000007.log
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
139.0.3405.102
|
139.0.3405.111
|
||||||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -1,27 +0,0 @@
|
||||||
// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without
|
|
||||||
// modification, are permitted provided that the following conditions are
|
|
||||||
// met:
|
|
||||||
//
|
|
||||||
// * Redistributions of source code must retain the above copyright
|
|
||||||
// notice, this list of conditions and the following disclaimer.
|
|
||||||
// * Redistributions in binary form must reproduce the above
|
|
||||||
// copyright notice, this list of conditions and the following disclaimer
|
|
||||||
// in the documentation and/or other materials provided with the
|
|
||||||
// distribution.
|
|
||||||
// * Neither the name of Google Inc. nor the names of its
|
|
||||||
// contributors may be used to endorse or promote products derived from
|
|
||||||
// this software without specific prior written permission.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
[{"description":"treehash per file","signed_content":{"payload":"eyJjb250ZW50X2hhc2hlcyI6W3siYmxvY2tfc2l6ZSI6NDA5NiwiZGlnZXN0Ijoic2hhMjU2IiwiZmlsZXMiOlt7InBhdGgiOiJMSUNFTlNFIiwicm9vdF9oYXNoIjoiUGIwc2tBVUxaUzFqWldTQnctV0hIRkltRlhVcExiZDlUcVkwR2ZHSHBWcyJ9LHsicGF0aCI6ImtleXMuanNvbiIsInJvb3RfaGFzaCI6IjV3THVRS29HUW81aXd3eHk1ZmZGT1UxN1hjajdkVFJWbGR4OWNuY1hHUUkifSx7InBhdGgiOiJtYW5pZmVzdC5qc29uIiwicm9vdF9oYXNoIjoiWnlLb1lNaFZ6NVNsVDlIXzNUZ0J4TWxKOWJaOWhnR3RNQUpra3hCWDhycyJ9XSwiZm9ybWF0IjoidHJlZWhhc2giLCJoYXNoX2Jsb2NrX3NpemUiOjQwOTZ9XSwiaXRlbV9pZCI6ImtpYWJoYWJqZGJramRwamJwaWdmb2RiZGptYmdsY29vIiwiaXRlbV92ZXJzaW9uIjoiMjAyNS41LjE1LjEiLCJwcm90b2NvbF92ZXJzaW9uIjoxfQ","signatures":[{"header":{"kid":"publisher"},"protected":"eyJhbGciOiJSUzI1NiJ9","signature":"m6wMQqXNEKw_3hSXaOa4IcPAsygDHnGDX7W71n87JsRUTJo8bjHaDJMgKVtlBHRHsY0M1ji95bvTgrG_o3Pi_GsJxZWTX_0GNzJhmnX7xqBZoEYJ78QZbB2RfpIN2siM88yz_QVR6n-kogfEGqQwg4qcD1Rev_lMFvGznQZ0MTN91m6xWkGueL9b3wGF8ish27aTUXUAZoFdhyveAJwwZx7TZ2SN_6m2Dh4Q7N5ObRXCj9KCOBpJafWEHMbaMxDoTbtZvVNWJh1TFdxJ_YnnXuSo08O0Ej5QKGeHXdMprOrELHq2eRHKhj-fgjCs9m94HwDgzzXMozH-WM81eZ_r5-dImeBwM-UISUc_OkkEvLT7MbbEQ8Pd5J0UU2uOplXp1nV9-0m6aed42CFHg4ImyrQY5QM7YewaQV-9IIzKwuFDDmTDxalq59CI4EVwNbS0vZZuShq_Nlrxa4AghW2zrK8-urLG2whCDibvQkNEGr0W5rKG0I2Eyevrdglk-6dZbWjsqPTA6MXM31nVG0P3Yg-jKtG8GFrIZt04Rzjacx4Kj6WZqeN1wU1HTNNx-iimLaZ7iqj8X3G_1-MifGB7CNYWrpF2CegDG8L-KCL-3dIs-Eztyp23dnTi_DBK4-8iIAwl9vIMmHT_bZlw3KaRyoawpjRufOthBWh2LbRyDVA"},{"header":{"kid":"webstore"},"protected":"eyJhbGciOiJSUzI1NiJ9","signature":"HqKxKOCUP0euVwbDphrmanZqx5aBhNifi3-JaQGkQtx7SBOHyWNY3JeUK0ubDTcHzG3eOOXIaJziMhylX8V6Cw95UvuFgsZmWEXXQvJp8QkHf6XnJzGp0PYTLvXEyQX8YP8Msu5gXp-FlgcRzlRmngCDNzYPsSYHRDMfBnYCfhGb8xPeVCGzpEbFYG3NIiLS9BCyZn_BpWwU1QhN7l3zqwVsrQxHdWmBJWR2w77cLd2sbFyAFfKA79naGoA2tRY22jiXGRRqYFGOgxWtl2AAPuj-PuhoJXFinDRkpmaueR9mn9RQ-HghJKoAcRNTcSvhaxEh3zgWEQdKNLQgmF70PA"}]}}]
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
||||||
1.6B1561D18D6D7D238C1FA4FB8AEF54E1F1E6B574D958BC0A41CA955F90AFD7DC
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"manifest_version": 2,
|
|
||||||
"name": "trustToken",
|
|
||||||
"version": "2025.5.15.1"
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
{"hashes":{"00AF3F07B5ABB71F6D30337E1EEF62FA280F06EF19485C0CF6B72171F92CCC0A":{"appid":"kpfehajjjbbcifeehjgfgnabifknmdad","fp":"1.00AF3F07B5ABB71F6D30337E1EEF62FA280F06EF19485C0CF6B72171F92CCC0A"},"1AB07E887ACCA305058EEAB9053C96DC531C2C5C067AB4F30AFA2B31F1EDD966":{"appid":"oankkpibpaokgecfckkdkgaoafllipag","fp":"1.1AB07E887ACCA305058EEAB9053C96DC531C2C5C067AB4F30AFA2B31F1EDD966"},"4B81B4DF3AD971287E1AE02C449344FCFA5D20431DE17B2BA8854CC9CDCE4089":{"appid":"ahmaebgpfccdhgidjaidaoojjcijckba","fp":"1.4B81B4DF3AD971287E1AE02C449344FCFA5D20431DE17B2BA8854CC9CDCE4089"},"6B1561D18D6D7D238C1FA4FB8AEF54E1F1E6B574D958BC0A41CA955F90AFD7DC":{"appid":"fgbafbciocncjfbbonhocjaohoknlaco","fp":"1.6B1561D18D6D7D238C1FA4FB8AEF54E1F1E6B574D958BC0A41CA955F90AFD7DC"},"89f43cb3df807293de2772d5f01ac2fc1482b38ccc8fdaee859b80642b7a0487":{"appid":"pghocgajpebopihickglahgebcmkcekh","fp":""},"95FD9D48E4FC245A3F3A99A3A16ECD1355050BA3F4AFC555F19A97C7F9B49677":{"appid":"ohckeflnhegojcjlcpbfpciadgikcohk","fp":"1.95FD9D48E4FC245A3F3A99A3A16ECD1355050BA3F4AFC555F19A97C7F9B49677"},"A81D1959892AE4180554347DF1B97834ABBA2E1A5E6B9AEBA000ECEA26EABECC":{"appid":"fppmbhmldokgmleojlplaaodlkibgikh","fp":"1.A81D1959892AE4180554347DF1B97834ABBA2E1A5E6B9AEBA000ECEA26EABECC"},"A99D66CFCE8CA170740CE0403956F4DFAF4683829A89F4B7AD9C95303871E284":{"appid":"eeobbhfgfagbclfofmgbdfoicabjdbkn","fp":"1.A99D66CFCE8CA170740CE0403956F4DFAF4683829A89F4B7AD9C95303871E284"},"b987bdc4f2ad2a409b964921d4a5db1cdbe07f9c98f868293b4cc32acdc42cec":{"appid":"alpjnmnfbgfkmmpcfpejmmoebdndedno","fp":""},"bcb93cba8636743d1fbd32be3bd8ce8ff602323895bf4d136c26b9bc64b0a6a4":{"appid":"ndikpojcjlepofdkaaldkinkjbeeebkl","fp":""}}}
|
{"hashes":{"00AF3F07B5ABB71F6D30337E1EEF62FA280F06EF19485C0CF6B72171F92CCC0A":{"appid":"kpfehajjjbbcifeehjgfgnabifknmdad","fp":"1.00AF3F07B5ABB71F6D30337E1EEF62FA280F06EF19485C0CF6B72171F92CCC0A"},"1AB07E887ACCA305058EEAB9053C96DC531C2C5C067AB4F30AFA2B31F1EDD966":{"appid":"oankkpibpaokgecfckkdkgaoafllipag","fp":"1.1AB07E887ACCA305058EEAB9053C96DC531C2C5C067AB4F30AFA2B31F1EDD966"},"452064dcff76e03e0e81b4bb3c48ab1c432e040094f7546c7261a90d4a1c1bbf":{"appid":"fgbafbciocncjfbbonhocjaohoknlaco","fp":""},"4B81B4DF3AD971287E1AE02C449344FCFA5D20431DE17B2BA8854CC9CDCE4089":{"appid":"ahmaebgpfccdhgidjaidaoojjcijckba","fp":"1.4B81B4DF3AD971287E1AE02C449344FCFA5D20431DE17B2BA8854CC9CDCE4089"},"89f43cb3df807293de2772d5f01ac2fc1482b38ccc8fdaee859b80642b7a0487":{"appid":"pghocgajpebopihickglahgebcmkcekh","fp":""},"95FD9D48E4FC245A3F3A99A3A16ECD1355050BA3F4AFC555F19A97C7F9B49677":{"appid":"ohckeflnhegojcjlcpbfpciadgikcohk","fp":"1.95FD9D48E4FC245A3F3A99A3A16ECD1355050BA3F4AFC555F19A97C7F9B49677"},"A81D1959892AE4180554347DF1B97834ABBA2E1A5E6B9AEBA000ECEA26EABECC":{"appid":"fppmbhmldokgmleojlplaaodlkibgikh","fp":"1.A81D1959892AE4180554347DF1B97834ABBA2E1A5E6B9AEBA000ECEA26EABECC"},"A99D66CFCE8CA170740CE0403956F4DFAF4683829A89F4B7AD9C95303871E284":{"appid":"eeobbhfgfagbclfofmgbdfoicabjdbkn","fp":"1.A99D66CFCE8CA170740CE0403956F4DFAF4683829A89F4B7AD9C95303871E284"},"b987bdc4f2ad2a409b964921d4a5db1cdbe07f9c98f868293b4cc32acdc42cec":{"appid":"alpjnmnfbgfkmmpcfpejmmoebdndedno","fp":""},"bcb93cba8636743d1fbd32be3bd8ce8ff602323895bf4d136c26b9bc64b0a6a4":{"appid":"ndikpojcjlepofdkaaldkinkjbeeebkl","fp":""}}}
|
||||||
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"Id":"1","Name":"22_08_2025_10_41_55_Manual","Length":29.677008111445875,"Dist1":0.0,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[-47.395256450666665,-22.172346369833335],[-47.3952565435,-22.172346308833333],[-47.395256576833333,-22.1723463895],[-47.395256607833332,-22.172346390833333],[-47.395256612,-22.172346383666667],[-47.3952566095,-22.172346395833333],[-47.395256603,-22.17234638],[-47.395256633333332,-22.172346400166667],[-47.39525668666667,-22.172346436166666],[-47.395256690333333,-22.172346315],[-47.395256662833333,-22.172346244833335],[-47.3952566795,-22.172346234166668],[-47.395256709166667,-22.172346255666668],[-47.395256872166669,-22.172346330833335],[-47.395256888,-22.172346301],[-47.3952568545,-22.172346285],[-47.395256829,-22.172346216166666],[-47.395256821666663,-22.172346155333333],[-47.395256853333336,-22.172346067333333],[-47.395256828333331,-22.172346081333334],[-47.395256798333335,-22.172346064166668],[-47.39525658783333,-22.1723460885],[-47.395256589166664,-22.172345992],[-47.395256726833331,-22.17234593],[-47.3952567375,-22.1723458955],[-47.395256776833335,-22.172345912166666],[-47.3952566485,-22.172345831166666],[-47.395256515833331,-22.172345763833334],[-47.395256549666669,-22.172345739333334],[-47.395256393,-22.172345694166665],[-47.395256296166664,-22.172345727166668],[-47.395256282166663,-22.172345670166667],[-47.395256309333334,-22.1723456805],[-47.39525658116667,-22.172347672333334],[-47.395256880833337,-22.172348807333332],[-47.395258087333332,-22.172352117833334],[-47.395258773666669,-22.1723537055],[-47.395258515,-22.172356928333333],[-47.395258686666665,-22.172358251333332],[-47.395259433666666,-22.1723619705],[-47.395259733333333,-22.172363576],[-47.395260085,-22.172365142166665],[-47.395261047666665,-22.172367679166666],[-47.395261088833337,-22.172368784333333],[-47.395261036333331,-22.172368743833335],[-47.395260981166665,-22.172368728166667],[-47.395260906333334,-22.172370990833333],[-47.395261183166667,-22.172372657666667],[-47.395261496166668,-22.172374629166665],[-47.395261777166667,-22.1723753845],[-47.395261561333335,-22.1723772325],[-47.3952616635,-22.172379212666666],[-47.395259892666665,-22.1723810495],[-47.395259789333331,-22.172383026333332],[-47.395258998833334,-22.172386347833335],[-47.3952587635,-22.172388393333332],[-47.3952582685,-22.1723898615],[-47.395258494833335,-22.172393639666666],[-47.395250912166667,-22.172404825833333],[-47.395250136666668,-22.172405724833332],[-47.395250509,-22.172405612],[-47.3952558565,-22.172405050666665],[-47.39525849333333,-22.172409069],[-47.395260315166666,-22.172416536166665],[-47.3952563085,-22.172417938],[-47.395253391,-22.172420802166666],[-47.395256822166665,-22.172420572833332],[-47.395256906833332,-22.172424407666668],[-47.3952563335,-22.172425210166665],[-47.395257268833333,-22.172427588],[-47.395257951666665,-22.172428887166667],[-47.395257650833337,-22.172429874833334],[-47.395260252833332,-22.172433116666667],[-47.395263901833331,-22.172437103],[-47.3952669375,-22.172439262833333],[-47.395269575833332,-22.172440730833333],[-47.395276767333335,-22.172442326666665],[-47.395280671833333,-22.1724421815],[-47.395281228166667,-22.172442044666667],[-47.3952777085,-22.172442249166668],[-47.395270072833334,-22.172444610833335],[-47.395266372,-22.172447167833333],[-47.395261905,-22.172453009333335],[-47.395260418,-22.172456977166668],[-47.395258931166666,-22.172460745166667],[-47.395256378333336,-22.172467218166666],[-47.395255179333333,-22.1724699915],[-47.395252460666669,-22.1724764045],[-47.395250798333336,-22.172480014833333],[-47.3952483145,-22.1724866155],[-47.395247748666669,-22.172488646166666],[-47.395247018166664,-22.172494215333334],[-47.395246894333333,-22.172498196],[-47.39524629466667,-22.172500856166668],[-47.395242381833334,-22.172506576833332],[-47.39523919483333,-22.172508991666668],[-47.395232237333332,-22.172512476666668],[-47.3952284705,-22.172514312666667],[-47.395221581833333,-22.172517214333332],[-47.395217751333334,-22.172518779333334],[-47.395214971,-22.172520573666667],[-47.395210067333331,-22.1725241545],[-47.3952079915,-22.172527879833332],[-47.395204200333332,-22.1725354175],[-47.395202777666668,-22.1725386405],[-47.395202796833331,-22.17254124],[-47.39520273116667,-22.172542654166666],[-47.3952026795,-22.172543427166666],[-47.3952027095,-22.17254343],[-47.395202701833334,-22.172543459333333],[-47.395202711,-22.172543445166667],[-47.395202679833332,-22.172543447166667],[-47.395202698333335,-22.172543444],[-47.395202698333335,-22.172543444]]}}]}
|
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"Id":"1","Name":"25_08_2025_16_29_49_MapaGPS","Length":45.0669749673391,"Dist1":0.0,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[-47.395187119333336,-22.172544759833333],[-47.3951871205,-22.172544750333333],[-47.395187123666666,-22.17254474],[-47.395187119333336,-22.172544773],[-47.39518710983333,-22.172544767666668],[-47.3951870925,-22.172544773333332],[-47.3951871135,-22.1725447695],[-47.395187109,-22.172544759],[-47.395187124333333,-22.172544775333332],[-47.395187104,-22.172544765333335],[-47.395187114,-22.17254478],[-47.395187119,-22.1725447645],[-47.395187111166663,-22.172544784],[-47.39518645,-22.172549661833333],[-47.39518665166667,-22.172551579833332],[-47.395191283666669,-22.172556917166666],[-47.395194691166665,-22.172557394166667],[-47.395197058166666,-22.1725579445],[-47.39520246033333,-22.172560708833334],[-47.395205430833336,-22.172563393833332],[-47.3952061165,-22.172569330666665],[-47.395204892333332,-22.172570874],[-47.395202153,-22.172576186166665],[-47.3952015505,-22.172579329333335],[-47.395201410666665,-22.172581696333335],[-47.395201276666668,-22.172586928833333],[-47.395200646,-22.172589796],[-47.395201421833335,-22.172594937166668],[-47.395201952333331,-22.172597846666665],[-47.3952035565,-22.172603020166665],[-47.395204372,-22.172605900833332],[-47.3952052305,-22.172607986333333],[-47.3952063055,-22.1726129495],[-47.395207043666666,-22.172615775833332],[-47.3952076955,-22.172621029],[-47.395208046166665,-22.17262326],[-47.395208260333334,-22.172629409],[-47.3952083685,-22.172631642666666],[-47.3952084535,-22.1726344725],[-47.3952091315,-22.172639615666668],[-47.39520933033333,-22.172642971166667],[-47.395209947833337,-22.172648214166667],[-47.395210410333334,-22.172650344333334],[-47.395210539166669,-22.1726554185],[-47.395211094833336,-22.1726582835],[-47.3952113955,-22.172663612],[-47.395211805333332,-22.172665979],[-47.395212764166665,-22.172671918666666],[-47.395213434666665,-22.172674605333334],[-47.3952138935,-22.172676825166668],[-47.395214831666664,-22.172681917166667],[-47.395215301166665,-22.172684613166666],[-47.395216344666665,-22.172689754166665],[-47.395216705333333,-22.172692151666666],[-47.3952172425,-22.172695494833334],[-47.395217986666665,-22.172701318666668],[-47.395218297333336,-22.1727032815],[-47.395218085,-22.1727083455],[-47.395217370666664,-22.172711332],[-47.395221153,-22.172715260166665],[-47.395222875166667,-22.172716722166665],[-47.3952262205,-22.172721511833334],[-47.395226792166667,-22.1727251945],[-47.3952264485,-22.172728077666665],[-47.395221607833335,-22.1727346585],[-47.395217703833332,-22.172736784333335],[-47.395209911666669,-22.172737078833332],[-47.395206829833334,-22.172735761166667],[-47.395201955833336,-22.172729872333335],[-47.395201161833334,-22.172725887666665],[-47.395202950666665,-22.172722859166665],[-47.395206459,-22.1727181785],[-47.395209633,-22.172715328833334],[-47.395214860166668,-22.172716129],[-47.395217123166667,-22.172716103333332],[-47.395223301166666,-22.172714955333333],[-47.395226070333337,-22.172712866333335],[-47.395227983666665,-22.172710646166667],[-47.395229317,-22.172702757833335],[-47.395227237833332,-22.172699078333334],[-47.3952201425,-22.172694863666667],[-47.395216778,-22.17269502],[-47.395211916166666,-22.172697834666668],[-47.3952096905,-22.172699738166667],[-47.395207431,-22.172700759833333],[-47.395201152333335,-22.1727031105],[-47.395196381333335,-22.172702974833335],[-47.39519378,-22.172702100166667],[-47.395188575333336,-22.172697375166667],[-47.395187179,-22.172693494333334],[-47.3951886055,-22.172686481833335],[-47.395190795666664,-22.1726839655],[-47.395197941333336,-22.1726811135],[-47.395201979333336,-22.172681057],[-47.395203451833332,-22.172682550166666],[-47.395207649166665,-22.172685885666667],[-47.3952109425,-22.17268669],[-47.3952134685,-22.1726865585],[-47.395219690666664,-22.172683575],[-47.395223081166669,-22.1726776265],[-47.3952225125,-22.172672815666665],[-47.395220510166666,-22.172669935333332],[-47.395214666666668,-22.172667577333332],[-47.395210875833335,-22.172667172],[-47.395205466,-22.172665870166668],[-47.3952020855,-22.172664815333334],[-47.395198556666664,-22.172663721],[-47.395193420333335,-22.1726622985],[-47.395193420333335,-22.1726622985]]}}]}
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
<meta name="viewport" content="width=device-width,
|
<meta name="viewport" content="width=device-width,
|
||||||
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||||
<style>
|
<style>
|
||||||
#map_7d7f70bc75999486401c90b97c0360ad {
|
#map_b2cfb7c0b8cd21733288866dbc6da89b {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100.0%;
|
width: 100.0%;
|
||||||
height: 100.0%;
|
height: 100.0%;
|
||||||
|
|
@ -54,14 +54,14 @@
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
||||||
<div class="folium-map" id="map_7d7f70bc75999486401c90b97c0360ad" ></div>
|
<div class="folium-map" id="map_b2cfb7c0b8cd21733288866dbc6da89b" ></div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
var map_7d7f70bc75999486401c90b97c0360ad = L.map(
|
var map_b2cfb7c0b8cd21733288866dbc6da89b = L.map(
|
||||||
"map_7d7f70bc75999486401c90b97c0360ad",
|
"map_b2cfb7c0b8cd21733288866dbc6da89b",
|
||||||
{
|
{
|
||||||
center: [0.0, 0.0],
|
center: [0.0, 0.0],
|
||||||
crs: L.CRS.EPSG3857,
|
crs: L.CRS.EPSG3857,
|
||||||
|
|
@ -77,6 +77,26 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var tile_layer_bab172d3f76c66b031f76d6ae9baaaaf = L.tileLayer(
|
||||||
|
"https://tile.openstreetmap.org/{z}/{x}/{y}.png",
|
||||||
|
{
|
||||||
|
"minZoom": 0,
|
||||||
|
"maxZoom": 19,
|
||||||
|
"maxNativeZoom": 19,
|
||||||
|
"noWrap": false,
|
||||||
|
"attribution": "\u0026copy; \u003ca href=\"https://www.openstreetmap.org/copyright\"\u003eOpenStreetMap\u003c/a\u003e contributors",
|
||||||
|
"subdomains": "abc",
|
||||||
|
"detectRetina": false,
|
||||||
|
"tms": false,
|
||||||
|
"opacity": 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
tile_layer_bab172d3f76c66b031f76d6ae9baaaaf.addTo(map_b2cfb7c0b8cd21733288866dbc6da89b);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -96,7 +116,7 @@
|
||||||
}
|
}
|
||||||
trajeto_json_add({"features": []});
|
trajeto_json_add({"features": []});
|
||||||
|
|
||||||
trajeto_json.addTo(map_7d7f70bc75999486401c90b97c0360ad);
|
trajeto_json.addTo(map_b2cfb7c0b8cd21733288866dbc6da89b);
|
||||||
|
|
||||||
function adicionarGeometria(novaGeometria) {
|
function adicionarGeometria(novaGeometria) {
|
||||||
trajeto_json.addData(novaGeometria);
|
trajeto_json.addData(novaGeometria);
|
||||||
|
|
@ -159,9 +179,9 @@
|
||||||
|
|
||||||
var marcadorEquipamento = L.marker([0, 0], {
|
var marcadorEquipamento = L.marker([0, 0], {
|
||||||
icon: customIcon
|
icon: customIcon
|
||||||
}).addTo(map_7d7f70bc75999486401c90b97c0360ad);
|
}).addTo(map_b2cfb7c0b8cd21733288866dbc6da89b);
|
||||||
|
|
||||||
var marcadorBase = L.marker([0, 0], {}).addTo(map_7d7f70bc75999486401c90b97c0360ad);
|
var marcadorBase = L.marker([0, 0], {}).addTo(map_b2cfb7c0b8cd21733288866dbc6da89b);
|
||||||
var icon = L.AwesomeMarkers.icon(
|
var icon = L.AwesomeMarkers.icon(
|
||||||
{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}
|
{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}
|
||||||
);
|
);
|
||||||
|
|
@ -226,7 +246,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (foco) {
|
if (foco) {
|
||||||
map_7d7f70bc75999486401c90b97c0360ad.setView(novaPosicao, map_7d7f70bc75999486401c90b97c0360ad.getZoom());
|
map_b2cfb7c0b8cd21733288866dbc6da89b.setView(novaPosicao, map_b2cfb7c0b8cd21733288866dbc6da89b.getZoom());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -248,7 +268,7 @@
|
||||||
marcadorDinamico.setRotationAngle(angulo);
|
marcadorDinamico.setRotationAngle(angulo);
|
||||||
|
|
||||||
adicionarCoordenada("Tj", [novaLongitude, novaLatitude]);
|
adicionarCoordenada("Tj", [novaLongitude, novaLatitude]);
|
||||||
map_7d7f70bc75999486401c90b97c0360ad.setView(novaPosicao, map_7d7f70bc75999486401c90b97c0360ad.getZoom());*/
|
map_b2cfb7c0b8cd21733288866dbc6da89b.setView(novaPosicao, map_b2cfb7c0b8cd21733288866dbc6da89b.getZoom());*/
|
||||||
});
|
});
|
||||||
|
|
||||||
function calcularOrientacao(P1latitude, P1longitude, P2latitude, P2longitude) {
|
function calcularOrientacao(P1latitude, P1longitude, P2latitude, P2longitude) {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
<meta name="viewport" content="width=device-width,
|
<meta name="viewport" content="width=device-width,
|
||||||
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||||
<style>
|
<style>
|
||||||
#map_353f6ba1c95182a48ae91b9a891f095d {
|
#map_b21baaed2057e8bbe47af17d68ecedd6 {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100.0%;
|
width: 100.0%;
|
||||||
height: 100.0%;
|
height: 100.0%;
|
||||||
|
|
@ -54,16 +54,16 @@
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
||||||
<div class="folium-map" id="map_353f6ba1c95182a48ae91b9a891f095d" ></div>
|
<div class="folium-map" id="map_b21baaed2057e8bbe47af17d68ecedd6" ></div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
var map_353f6ba1c95182a48ae91b9a891f095d = L.map(
|
var map_b21baaed2057e8bbe47af17d68ecedd6 = L.map(
|
||||||
"map_353f6ba1c95182a48ae91b9a891f095d",
|
"map_b21baaed2057e8bbe47af17d68ecedd6",
|
||||||
{
|
{
|
||||||
center: [-22.172444564750002, -47.395241953833334],
|
center: [-22.172640909416664, -47.3952078835],
|
||||||
crs: L.CRS.EPSG3857,
|
crs: L.CRS.EPSG3857,
|
||||||
...{
|
...{
|
||||||
"zoom": 12,
|
"zoom": 12,
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var tile_layer_8564e33b7369e4710f4819bd3c55e0bf = L.tileLayer(
|
var tile_layer_faa254f73950244990d85d26fa7337d6 = L.tileLayer(
|
||||||
"https://tile.openstreetmap.org/{z}/{x}/{y}.png",
|
"https://tile.openstreetmap.org/{z}/{x}/{y}.png",
|
||||||
{
|
{
|
||||||
"minZoom": 0,
|
"minZoom": 0,
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
tile_layer_8564e33b7369e4710f4819bd3c55e0bf.addTo(map_353f6ba1c95182a48ae91b9a891f095d);
|
tile_layer_faa254f73950244990d85d26fa7337d6.addTo(map_b21baaed2057e8bbe47af17d68ecedd6);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -111,7 +111,7 @@
|
||||||
}*/
|
}*/
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function geo_json_b417ccdd5de3860de9f9bb6e9ce890b6_onEachFeature(feature, layer) {
|
function geo_json_99cfc632ca5e92adc9931d372fcc1b88_onEachFeature(feature, layer) {
|
||||||
|
|
||||||
layer.on({
|
layer.on({
|
||||||
|
|
||||||
|
|
@ -148,23 +148,23 @@
|
||||||
}*/
|
}*/
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var geo_json_b417ccdd5de3860de9f9bb6e9ce890b6 = L.geoJson(null, {
|
var geo_json_99cfc632ca5e92adc9931d372fcc1b88 = L.geoJson(null, {
|
||||||
onEachFeature: geo_json_b417ccdd5de3860de9f9bb6e9ce890b6_onEachFeature,
|
onEachFeature: geo_json_99cfc632ca5e92adc9931d372fcc1b88_onEachFeature,
|
||||||
|
|
||||||
...{
|
...{
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function geo_json_b417ccdd5de3860de9f9bb6e9ce890b6_add (data) {
|
function geo_json_99cfc632ca5e92adc9931d372fcc1b88_add (data) {
|
||||||
geo_json_b417ccdd5de3860de9f9bb6e9ce890b6
|
geo_json_99cfc632ca5e92adc9931d372fcc1b88
|
||||||
.addData(data);
|
.addData(data);
|
||||||
}
|
}
|
||||||
geo_json_b417ccdd5de3860de9f9bb6e9ce890b6_add({"features": [{"geometry": {"coordinates": [[-47.395256450666665, -22.172346369833335], [-47.3952565435, -22.172346308833333], [-47.39525657683333, -22.1723463895], [-47.39525660783333, -22.172346390833333], [-47.395256612, -22.172346383666667], [-47.3952566095, -22.172346395833333], [-47.395256603, -22.17234638], [-47.39525663333333, -22.172346400166667], [-47.39525668666667, -22.172346436166666], [-47.39525669033333, -22.172346315], [-47.39525666283333, -22.172346244833335], [-47.3952566795, -22.172346234166668], [-47.39525670916667, -22.172346255666668], [-47.39525687216667, -22.172346330833335], [-47.395256888, -22.172346301], [-47.3952568545, -22.172346285], [-47.395256829, -22.172346216166666], [-47.39525682166666, -22.172346155333333], [-47.395256853333336, -22.172346067333333], [-47.39525682833333, -22.172346081333334], [-47.395256798333335, -22.172346064166668], [-47.39525658783333, -22.1723460885], [-47.395256589166664, -22.172345992], [-47.39525672683333, -22.17234593], [-47.3952567375, -22.1723458955], [-47.395256776833335, -22.172345912166666], [-47.3952566485, -22.172345831166666], [-47.39525651583333, -22.172345763833334], [-47.39525654966667, -22.172345739333334], [-47.395256393, -22.172345694166665], [-47.395256296166664, -22.172345727166668], [-47.39525628216666, -22.172345670166667], [-47.395256309333334, -22.1723456805], [-47.39525658116667, -22.172347672333334], [-47.39525688083334, -22.172348807333332], [-47.39525808733333, -22.172352117833334], [-47.39525877366667, -22.1723537055], [-47.395258515, -22.172356928333333], [-47.395258686666665, -22.172358251333332], [-47.395259433666666, -22.1723619705], [-47.39525973333333, -22.172363576], [-47.395260085, -22.172365142166665], [-47.395261047666665, -22.172367679166666], [-47.39526108883334, -22.172368784333333], [-47.39526103633333, -22.172368743833335], [-47.395260981166665, -22.172368728166667], [-47.395260906333334, -22.172370990833333], [-47.39526118316667, -22.172372657666667], [-47.39526149616667, -22.172374629166665], [-47.39526177716667, -22.1723753845], [-47.395261561333335, -22.1723772325], [-47.3952616635, -22.172379212666666], [-47.395259892666665, -22.1723810495], [-47.39525978933333, -22.172383026333332], [-47.395258998833334, -22.172386347833335], [-47.3952587635, -22.172388393333332], [-47.3952582685, -22.1723898615], [-47.395258494833335, -22.172393639666666], [-47.39525091216667, -22.172404825833333], [-47.39525013666667, -22.172405724833332], [-47.395250509, -22.172405612], [-47.3952558565, -22.172405050666665], [-47.39525849333333, -22.172409069], [-47.39526031516667, -22.172416536166665], [-47.3952563085, -22.172417938], [-47.395253391, -22.172420802166666], [-47.395256822166665, -22.17242057283333], [-47.39525690683333, -22.172424407666668], [-47.3952563335, -22.172425210166665], [-47.39525726883333, -22.172427588], [-47.395257951666665, -22.172428887166667], [-47.39525765083334, -22.172429874833334], [-47.39526025283333, -22.172433116666667], [-47.39526390183333, -22.172437103], [-47.3952669375, -22.172439262833333], [-47.39526957583333, -22.172440730833333], [-47.395276767333335, -22.172442326666665], [-47.39528067183333, -22.1724421815], [-47.39528122816667, -22.172442044666667], [-47.3952777085, -22.172442249166668], [-47.395270072833334, -22.172444610833335], [-47.395266372, -22.172447167833333], [-47.395261905, -22.172453009333335], [-47.395260418, -22.172456977166668], [-47.395258931166666, -22.172460745166667], [-47.395256378333336, -22.172467218166666], [-47.39525517933333, -22.1724699915], [-47.39525246066667, -22.1724764045], [-47.395250798333336, -22.172480014833333], [-47.3952483145, -22.1724866155], [-47.39524774866667, -22.172488646166666], [-47.395247018166664, -22.172494215333334], [-47.39524689433333, -22.172498196], [-47.39524629466667, -22.172500856166668], [-47.395242381833334, -22.17250657683333], [-47.39523919483333, -22.172508991666668], [-47.39523223733333, -22.172512476666668], [-47.3952284705, -22.172514312666667], [-47.39522158183333, -22.172517214333332], [-47.395217751333334, -22.172518779333334], [-47.395214971, -22.172520573666667], [-47.39521006733333, -22.1725241545], [-47.3952079915, -22.172527879833332], [-47.39520420033333, -22.1725354175], [-47.39520277766667, -22.1725386405], [-47.39520279683333, -22.17254124], [-47.39520273116667, -22.172542654166666], [-47.3952026795, -22.172543427166666], [-47.3952027095, -22.17254343], [-47.395202701833334, -22.172543459333333], [-47.395202711, -22.172543445166667], [-47.39520267983333, -22.172543447166667], [-47.395202698333335, -22.172543444], [-47.395202698333335, -22.172543444]], "id": null, "type": "LineString"}, "id": 0, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "1", "Length": 29.677008111445875, "Name": "22_08_2025_10_41_55_Manual"}, "type": "Feature"}], "type": "FeatureCollection"});
|
geo_json_99cfc632ca5e92adc9931d372fcc1b88_add({"features": [{"geometry": {"coordinates": [[-47.395187119333336, -22.172544759833333], [-47.3951871205, -22.172544750333333], [-47.395187123666666, -22.17254474], [-47.395187119333336, -22.172544773], [-47.39518710983333, -22.17254476766667], [-47.3951870925, -22.172544773333332], [-47.3951871135, -22.1725447695], [-47.395187109, -22.172544759], [-47.39518712433333, -22.172544775333332], [-47.395187104, -22.172544765333335], [-47.395187114, -22.17254478], [-47.395187119, -22.1725447645], [-47.39518711116666, -22.172544784], [-47.39518645, -22.172549661833333], [-47.39518665166667, -22.172551579833332], [-47.39519128366667, -22.172556917166666], [-47.395194691166665, -22.172557394166667], [-47.395197058166666, -22.1725579445], [-47.39520246033333, -22.172560708833334], [-47.395205430833336, -22.172563393833332], [-47.3952061165, -22.172569330666665], [-47.39520489233333, -22.172570874], [-47.395202153, -22.172576186166665], [-47.3952015505, -22.172579329333335], [-47.395201410666665, -22.172581696333335], [-47.39520127666667, -22.172586928833333], [-47.395200646, -22.172589796], [-47.395201421833335, -22.172594937166668], [-47.39520195233333, -22.172597846666665], [-47.3952035565, -22.172603020166665], [-47.395204372, -22.172605900833332], [-47.3952052305, -22.172607986333333], [-47.3952063055, -22.1726129495], [-47.395207043666666, -22.172615775833332], [-47.3952076955, -22.172621029], [-47.395208046166665, -22.17262326], [-47.395208260333334, -22.172629409], [-47.3952083685, -22.172631642666666], [-47.3952084535, -22.1726344725], [-47.3952091315, -22.172639615666668], [-47.39520933033333, -22.172642971166667], [-47.39520994783334, -22.172648214166667], [-47.395210410333334, -22.172650344333334], [-47.39521053916667, -22.1726554185], [-47.395211094833336, -22.1726582835], [-47.3952113955, -22.172663612], [-47.39521180533333, -22.172665979], [-47.395212764166665, -22.172671918666666], [-47.395213434666665, -22.172674605333334], [-47.3952138935, -22.17267682516667], [-47.395214831666664, -22.172681917166667], [-47.395215301166665, -22.172684613166666], [-47.395216344666665, -22.172689754166665], [-47.39521670533333, -22.172692151666666], [-47.3952172425, -22.172695494833334], [-47.395217986666665, -22.172701318666668], [-47.39521829733334, -22.1727032815], [-47.395218085, -22.1727083455], [-47.395217370666664, -22.172711332], [-47.395221153, -22.172715260166665], [-47.39522287516667, -22.172716722166665], [-47.3952262205, -22.172721511833334], [-47.39522679216667, -22.1727251945], [-47.3952264485, -22.172728077666665], [-47.395221607833335, -22.1727346585], [-47.39521770383333, -22.172736784333335], [-47.39520991166667, -22.172737078833332], [-47.395206829833334, -22.172735761166667], [-47.395201955833336, -22.172729872333335], [-47.395201161833334, -22.172725887666665], [-47.395202950666665, -22.172722859166665], [-47.395206459, -22.1727181785], [-47.395209633, -22.172715328833334], [-47.39521486016667, -22.172716129], [-47.39521712316667, -22.172716103333332], [-47.395223301166666, -22.172714955333333], [-47.39522607033334, -22.172712866333335], [-47.395227983666665, -22.172710646166667], [-47.395229317, -22.172702757833335], [-47.39522723783333, -22.172699078333334], [-47.3952201425, -22.172694863666667], [-47.395216778, -22.17269502], [-47.395211916166666, -22.172697834666668], [-47.3952096905, -22.172699738166667], [-47.395207431, -22.172700759833333], [-47.395201152333335, -22.1727031105], [-47.395196381333335, -22.172702974833335], [-47.39519378, -22.172702100166667], [-47.395188575333336, -22.172697375166667], [-47.395187179, -22.172693494333334], [-47.3951886055, -22.172686481833335], [-47.395190795666664, -22.1726839655], [-47.395197941333336, -22.1726811135], [-47.395201979333336, -22.172681057], [-47.39520345183333, -22.172682550166666], [-47.395207649166665, -22.172685885666667], [-47.3952109425, -22.17268669], [-47.3952134685, -22.1726865585], [-47.395219690666664, -22.172683575], [-47.39522308116667, -22.1726776265], [-47.3952225125, -22.172672815666665], [-47.395220510166666, -22.17266993533333], [-47.39521466666667, -22.172667577333332], [-47.395210875833335, -22.172667172], [-47.395205466, -22.172665870166668], [-47.3952020855, -22.172664815333334], [-47.395198556666664, -22.172663721], [-47.395193420333335, -22.1726622985], [-47.395193420333335, -22.1726622985]], "id": null, "type": "LineString"}, "id": 0, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "1", "Length": 45.0669749673391, "Name": "25_08_2025_16_29_49_MapaGPS"}, "type": "Feature"}], "type": "FeatureCollection"});
|
||||||
geo_json_b417ccdd5de3860de9f9bb6e9ce890b6.setStyle(function(feature) {return feature.properties.style;});
|
geo_json_99cfc632ca5e92adc9931d372fcc1b88.setStyle(function(feature) {return feature.properties.style;});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
geo_json_b417ccdd5de3860de9f9bb6e9ce890b6.addTo(map_353f6ba1c95182a48ae91b9a891f095d);
|
geo_json_99cfc632ca5e92adc9931d372fcc1b88.addTo(map_b21baaed2057e8bbe47af17d68ecedd6);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -185,7 +185,7 @@
|
||||||
}
|
}
|
||||||
trajeto_json_add({"features": []});
|
trajeto_json_add({"features": []});
|
||||||
|
|
||||||
trajeto_json.addTo(map_353f6ba1c95182a48ae91b9a891f095d);
|
trajeto_json.addTo(map_b21baaed2057e8bbe47af17d68ecedd6);
|
||||||
|
|
||||||
function adicionarGeometria(novaGeometria) {
|
function adicionarGeometria(novaGeometria) {
|
||||||
trajeto_json.addData(novaGeometria);
|
trajeto_json.addData(novaGeometria);
|
||||||
|
|
@ -243,7 +243,7 @@
|
||||||
}
|
}
|
||||||
trajeto_dinamico_json_add({"features": []});
|
trajeto_dinamico_json_add({"features": []});
|
||||||
|
|
||||||
trajeto_dinamico_json.addTo(map_353f6ba1c95182a48ae91b9a891f095d);
|
trajeto_dinamico_json.addTo(map_b21baaed2057e8bbe47af17d68ecedd6);
|
||||||
|
|
||||||
function adicionarGeometriaDinamica(novaGeometria) {
|
function adicionarGeometriaDinamica(novaGeometria) {
|
||||||
trajeto_dinamico_json.addData(novaGeometria);
|
trajeto_dinamico_json.addData(novaGeometria);
|
||||||
|
|
@ -296,9 +296,9 @@
|
||||||
|
|
||||||
var marcadorEquipamento = L.marker([0, 0], {
|
var marcadorEquipamento = L.marker([0, 0], {
|
||||||
icon: customIcon
|
icon: customIcon
|
||||||
}).addTo(map_353f6ba1c95182a48ae91b9a891f095d);
|
}).addTo(map_b21baaed2057e8bbe47af17d68ecedd6);
|
||||||
|
|
||||||
var marcadorBase = L.marker([0, 0], {}).addTo(map_353f6ba1c95182a48ae91b9a891f095d);
|
var marcadorBase = L.marker([0, 0], {}).addTo(map_b21baaed2057e8bbe47af17d68ecedd6);
|
||||||
var icon = L.AwesomeMarkers.icon(
|
var icon = L.AwesomeMarkers.icon(
|
||||||
{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}
|
{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}
|
||||||
);
|
);
|
||||||
|
|
@ -380,7 +380,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (foco) {
|
if (foco) {
|
||||||
map_353f6ba1c95182a48ae91b9a891f095d.setView(novaPosicao, map_353f6ba1c95182a48ae91b9a891f095d.getZoom());
|
map_b21baaed2057e8bbe47af17d68ecedd6.setView(novaPosicao, map_b21baaed2057e8bbe47af17d68ecedd6.getZoom());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -397,7 +397,7 @@
|
||||||
function atualizarSelecaoRuas(selecionadas) {
|
function atualizarSelecaoRuas(selecionadas) {
|
||||||
selecionadas = JSON.parse(selecionadas);
|
selecionadas = JSON.parse(selecionadas);
|
||||||
RuasSelecionadas = Array.isArray(selecionadas) ? [...selecionadas] : [];
|
RuasSelecionadas = Array.isArray(selecionadas) ? [...selecionadas] : [];
|
||||||
geo_json_b417ccdd5de3860de9f9bb6e9ce890b6.eachLayer(function (layer) {
|
geo_json_99cfc632ca5e92adc9931d372fcc1b88.eachLayer(function (layer) {
|
||||||
if (RuasSelecionadas.includes(parseInt(layer.feature.id))) {
|
if (RuasSelecionadas.includes(parseInt(layer.feature.id))) {
|
||||||
layer.setStyle({ color: 'blue' });
|
layer.setStyle({ color: 'blue' });
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -29,6 +29,8 @@ class CameraOak:
|
||||||
self.ultima_saude = {}
|
self.ultima_saude = {}
|
||||||
self.timestamp_ultimo_frame_rgb = None
|
self.timestamp_ultimo_frame_rgb = None
|
||||||
self.timestamp_ultimo_frame_depth = None
|
self.timestamp_ultimo_frame_depth = None
|
||||||
|
self.timestamp_ultima_deteccao = None
|
||||||
|
self.timestamp_ultima_segmentacao = None
|
||||||
self.tem_depth = False
|
self.tem_depth = False
|
||||||
self.tem_imu = False
|
self.tem_imu = False
|
||||||
self.imu = None
|
self.imu = None
|
||||||
|
|
@ -383,6 +385,9 @@ class CameraOak:
|
||||||
try:
|
try:
|
||||||
w, h = self.modelo_ia_seg["ia_resolution"]
|
w, h = self.modelo_ia_seg["ia_resolution"]
|
||||||
in_seg = self.q_seg.get()
|
in_seg = self.q_seg.get()
|
||||||
|
if in_seg is None:
|
||||||
|
dur = time.time() - start
|
||||||
|
return None, {"erro": None, "duracao": dur, "frame_valido": False}
|
||||||
out_raw = in_seg.getFirstLayerFp16()
|
out_raw = in_seg.getFirstLayerFp16()
|
||||||
arr16 = np.frombuffer(np.asarray(out_raw, dtype=np.float16), dtype=np.float16)
|
arr16 = np.frombuffer(np.asarray(out_raw, dtype=np.float16), dtype=np.float16)
|
||||||
arr16 = arr16.reshape(len(self.modelo_ia_seg["classes"]), h, w)
|
arr16 = arr16.reshape(len(self.modelo_ia_seg["classes"]), h, w)
|
||||||
|
|
@ -437,7 +442,10 @@ class CameraOak:
|
||||||
|
|
||||||
start = time.time()
|
start = time.time()
|
||||||
try:
|
try:
|
||||||
pkt = self.q_det.get() # ImgDetections
|
pkt = self.q_det.tryGet()
|
||||||
|
if pkt is None:
|
||||||
|
dur = time.time() - start
|
||||||
|
return [], {"erro": None, "duracao": dur, "frame_valido": False}
|
||||||
raw_dets = getattr(pkt, "detections", [])
|
raw_dets = getattr(pkt, "detections", [])
|
||||||
dets = []
|
dets = []
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -59,7 +59,7 @@ def definir_comando(pid: PIDAdaptativo):
|
||||||
"PassosAtraso": _gps_passos_travados
|
"PassosAtraso": _gps_passos_travados
|
||||||
},
|
},
|
||||||
"Carro": {
|
"Carro": {
|
||||||
"Velocidade": max(0.2, _contexto.get("Gerais", {}).get("velocidade_ms", 0.0)),
|
"Velocidade": max(0.01, _contexto.get("Gerais", {}).get("velocidade_ms", 0.0)),
|
||||||
"Status": _trajetoria.get("status", StatusCarroMapa.Parado.value),
|
"Status": _trajetoria.get("status", StatusCarroMapa.Parado.value),
|
||||||
"ManobrandoEntreRuas": _trajetoria.get("manobrando", False),
|
"ManobrandoEntreRuas": _trajetoria.get("manobrando", False),
|
||||||
"DentroCorredor": _trajetoria.get("CorredorAtual", {}).get("dentro", False),
|
"DentroCorredor": _trajetoria.get("CorredorAtual", {}).get("dentro", False),
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,11 @@ class ControladorMPC:
|
||||||
self.ultima_atualizacao = None
|
self.ultima_atualizacao = None
|
||||||
self.dt = 0
|
self.dt = 0
|
||||||
|
|
||||||
|
print(parametros_mpc)
|
||||||
self.angulo_max_graus = parametros_mpc.get("angulo_max_graus", 30.0)
|
self.angulo_max_graus = parametros_mpc.get("angulo_max_graus", 30.0)
|
||||||
self.velocidade_min = parametros_mpc.get("velocidade_min", 0.4)
|
self.velocidade_min = parametros_mpc.get("velocidade_min", 0.4)
|
||||||
self.velocidade_max = parametros_mpc.get("velocidade_max", 1.9)
|
self.velocidade_max = parametros_mpc.get("velocidade_max", 1.9)
|
||||||
self.horizonte = parametros_mpc.get("horizonte", 2.5)
|
self.horizonte = parametros_mpc.get("horizonte", 2.5)
|
||||||
self.horizonte_passos = 10
|
|
||||||
|
|
||||||
# otimizacoes
|
# otimizacoes
|
||||||
self._np_bool = np.bool_
|
self._np_bool = np.bool_
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -149,7 +149,7 @@ class CameraManager:
|
||||||
elif "X_LINK_ERROR" in res["erro"]:
|
elif "X_LINK_ERROR" in res["erro"]:
|
||||||
self.reiniciar_status()
|
self.reiniciar_status()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.mostrar_log("Erro ao requisitar rgb frame:", e)
|
self.mostrar_log(f"Erro ao requisitar rgb frame: {e}")
|
||||||
if "X_LINK_ERROR" in str(e):
|
if "X_LINK_ERROR" in str(e):
|
||||||
self.reiniciar_status()
|
self.reiniciar_status()
|
||||||
|
|
||||||
|
|
@ -167,7 +167,7 @@ class CameraManager:
|
||||||
elif "X_LINK_ERROR" in res["erro"]:
|
elif "X_LINK_ERROR" in res["erro"]:
|
||||||
self.reiniciar_status()
|
self.reiniciar_status()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.mostrar_log("Erro ao requisitar depth frame:", e)
|
self.mostrar_log(f"Erro ao requisitar depth frame: {e}")
|
||||||
if "X_LINK_ERROR" in str(e):
|
if "X_LINK_ERROR" in str(e):
|
||||||
self.reiniciar_status()
|
self.reiniciar_status()
|
||||||
|
|
||||||
|
|
@ -190,7 +190,7 @@ class CameraManager:
|
||||||
elif "X_LINK_ERROR" in res["erro"]:
|
elif "X_LINK_ERROR" in res["erro"]:
|
||||||
self.reiniciar_status()
|
self.reiniciar_status()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.mostrar_log("Erro ao requisitar predictions:", e)
|
self.mostrar_log(f"Erro ao requisitar predictions: {e}")
|
||||||
if "X_LINK_ERROR" in str(e):
|
if "X_LINK_ERROR" in str(e):
|
||||||
self.reiniciar_status()
|
self.reiniciar_status()
|
||||||
|
|
||||||
|
|
@ -207,7 +207,7 @@ class CameraManager:
|
||||||
elif "X_LINK_ERROR" in res["erro"]:
|
elif "X_LINK_ERROR" in res["erro"]:
|
||||||
self.reiniciar_status()
|
self.reiniciar_status()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.mostrar_log("Erro ao requisitar detections:", e)
|
self.mostrar_log(f"Erro ao requisitar detections: {e}")
|
||||||
if "X_LINK_ERROR" in str(e):
|
if "X_LINK_ERROR" in str(e):
|
||||||
self.reiniciar_status()
|
self.reiniciar_status()
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -92,7 +92,7 @@ class CameraManager:
|
||||||
elif "X_LINK_ERROR" in res["erro"]:
|
elif "X_LINK_ERROR" in res["erro"]:
|
||||||
self.reiniciar_status()
|
self.reiniciar_status()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.mostrar_log("Erro ao requisitar rgb frame:", e)
|
self.mostrar_log(f"Erro ao requisitar rgb frame: {e}")
|
||||||
if "X_LINK_ERROR" in str(e):
|
if "X_LINK_ERROR" in str(e):
|
||||||
self.reiniciar_status()
|
self.reiniciar_status()
|
||||||
|
|
||||||
|
|
@ -110,7 +110,7 @@ class CameraManager:
|
||||||
elif "X_LINK_ERROR" in res["erro"]:
|
elif "X_LINK_ERROR" in res["erro"]:
|
||||||
self.reiniciar_status()
|
self.reiniciar_status()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.mostrar_log("Erro ao requisitar predictions:", e)
|
self.mostrar_log(f"Erro ao requisitar predictions: {e}")
|
||||||
if "X_LINK_ERROR" in str(e):
|
if "X_LINK_ERROR" in str(e):
|
||||||
self.reiniciar_status()
|
self.reiniciar_status()
|
||||||
|
|
||||||
|
|
@ -162,7 +162,9 @@ class CameraManager:
|
||||||
threading.Thread(target=loop, daemon=True).start()
|
threading.Thread(target=loop, daemon=True).start()
|
||||||
|
|
||||||
def _realizar_analises(self):
|
def _realizar_analises(self):
|
||||||
status_operacao = StatusOperacao(ContextoGlobalRedis.get_operacao().get("status", StatusOperacao.NaoIniciado.value))
|
_operacao = ContextoGlobalRedis.get_operacao()
|
||||||
|
status_operacao = StatusOperacao(_operacao.get("status", StatusOperacao.NaoIniciado.value))
|
||||||
|
finalizando = _operacao.get("finalizando", False)
|
||||||
pulverizador_automatico = ContextoGlobalRedis.get_controle().get("pulverizador_automatico", False)
|
pulverizador_automatico = ContextoGlobalRedis.get_controle().get("pulverizador_automatico", False)
|
||||||
|
|
||||||
predictions, ts, res = self.get_segmentation_predictions()
|
predictions, ts, res = self.get_segmentation_predictions()
|
||||||
|
|
@ -184,7 +186,7 @@ class CameraManager:
|
||||||
analise=converter_valores_numpy(analise)
|
analise=converter_valores_numpy(analise)
|
||||||
)
|
)
|
||||||
|
|
||||||
if status_operacao == StatusOperacao.EmAndamento:
|
if status_operacao == StatusOperacao.EmAndamento and not finalizando:
|
||||||
atuacao_bicos = analise.get("controle")
|
atuacao_bicos = analise.get("controle")
|
||||||
else:
|
else:
|
||||||
atuacao_bicos = {i: False for i in analise.get("controle", {}).keys()}
|
atuacao_bicos = {i: False for i in analise.get("controle", {}).keys()}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ public:
|
||||||
uint8_t ID_Num_sTOD = 250;
|
uint8_t ID_Num_sTOD = 250;
|
||||||
uint8_t ID_Num_sLRA = 251;
|
uint8_t ID_Num_sLRA = 251;
|
||||||
|
|
||||||
CanService(uint8_t nodeId, uint32_t baudRate = 500000)
|
CanService(uint8_t nodeId, uint32_t baudRate = 250000)
|
||||||
: _nodeId(nodeId), _baudRate(baudRate) {}
|
: _nodeId(nodeId), _baudRate(baudRate) {}
|
||||||
|
|
||||||
void begin() {
|
void begin() {
|
||||||
|
|
@ -35,8 +35,12 @@ public:
|
||||||
g_config.rx_queue_len = 32;
|
g_config.rx_queue_len = 32;
|
||||||
// (alerts_enabled será reconfigurado depois de start)
|
// (alerts_enabled será reconfigurado depois de start)
|
||||||
|
|
||||||
|
twai_timing_config_t t_config;
|
||||||
// 500 kbit/s (ajuste se precisar)
|
// 500 kbit/s (ajuste se precisar)
|
||||||
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_500KBITS();
|
if (_baudRate == 250000)
|
||||||
|
t_config = TWAI_TIMING_CONFIG_250KBITS();
|
||||||
|
else if (_baudRate == 500000)
|
||||||
|
t_config = TWAI_TIMING_CONFIG_500KBITS();
|
||||||
|
|
||||||
// Começa aceitando tudo para depurar; depois afinamos a máscara
|
// Começa aceitando tudo para depurar; depois afinamos a máscara
|
||||||
twai_filter_config_t f_config = {
|
twai_filter_config_t f_config = {
|
||||||
|
|
@ -533,7 +537,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32_t _baudRate = 500000;
|
uint32_t _baudRate = 250000;
|
||||||
uint8_t _nodeId = 0;
|
uint8_t _nodeId = 0;
|
||||||
OnReceiveCallback _callback = nullptr;
|
OnReceiveCallback _callback = nullptr;
|
||||||
bool DebugMode = true;
|
bool DebugMode = true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue