ajustes no fluxo do direcional e diagnosticos

This commit is contained in:
Diego Freitas 2024-08-20 14:38:23 -03:00
parent 8464ac33f2
commit c9583d532c
34 changed files with 17128 additions and 246 deletions

Binary file not shown.

View File

@ -597,6 +597,12 @@ namespace AgroBase.Forms.IHM
var grid = Diagnostico.grid;
var Testes = Diagnostico.Testes;
TipoMovimentoDirecional _oldTipoMovimento = Variaveis.OperacaoEmAndamento.Controle.TipoMovimento;
int _oldRPM = Variaveis.OperacaoEmAndamento.Controle.RPM_SP;
Variaveis.OperacaoEmAndamento.Controle.TipoMovimento = TipoMovimentoDirecional.Diagnostico;
Variaveis.OperacaoEmAndamento.Controle.RPM_SP = 20;
DispositivosService<MovimentacaoUnificadaModel> Dispositivo = (DispositivosService<MovimentacaoUnificadaModel>)Variaveis.DispositivosConectados.FirstOrDefault(x => x.Dispositivo == Enums.T_Code.Mvd);
if (Dispositivo == null)
@ -652,20 +658,21 @@ namespace AgroBase.Forms.IHM
var ServoFreio = Modulo_Sen.Servos.FirstOrDefault(x => x.ID.Contains(Modulo.Modulo_ID) && x.Inicializado);
bool AtivarFreio = SenIniciado && ServoFreio != null ? await EnviarComandoMovFreio(Variaveis.OperacaoEmAndamento.DispSen, ServoFreio, AcaoFreio.Ativar, Testes[idx], 2000) : false;
idx = PreencheDadosLinha(grid, Testes, idx, Inicializado ? Testes[idx].ValorAferido : -1);
idx = PreencheDadosLinha(grid, Testes, idx, ServoFreio != null ? Testes[idx].ValorAferido : -1);
bool DesativarFreio = SenIniciado && ServoFreio != null ? await EnviarComandoMovFreio(Variaveis.OperacaoEmAndamento.DispSen, ServoFreio, AcaoFreio.Desativar, Testes[idx], 2000) : false;
idx = PreencheDadosLinha(grid, Testes, idx, Inicializado ? Testes[idx].ValorAferido : -1);
idx = PreencheDadosLinha(grid, Testes, idx, ServoFreio != null ? Testes[idx].ValorAferido : -1);
}
Variaveis.OperacaoEmAndamento.Controle.TipoMovimento = _oldTipoMovimento;
Variaveis.OperacaoEmAndamento.Controle.RPM_SP = _oldRPM;
return true;
}
private async Task<bool> EnviarComandoMov(ModuloMvdModel Modulo, Direcao Sentido, ColunasDiagnosticoModel Teste, int Timeout)
{
Variaveis.OperacaoEmAndamento.Controle.RPM_SP = 20;
Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.ForEach(x => x.MovMotor.Comandar = false);
Modulo.MovMotor.Comandar = true;
@ -785,6 +792,12 @@ namespace AgroBase.Forms.IHM
var grid = Diagnostico.grid;
var Testes = Diagnostico.Testes;
TipoMovimentoDirecional _oldTipoMovimento = Variaveis.OperacaoEmAndamento.Controle.TipoMovimento;
double _oldAngulo = Variaveis.OperacaoEmAndamento.Controle.Angulo;
Variaveis.OperacaoEmAndamento.Controle.TipoMovimento = TipoMovimentoDirecional.Diagnostico;
Variaveis.OperacaoEmAndamento.Controle.Angulo = 25;
DispositivosService<MovimentacaoUnificadaModel> Dispositivo = (DispositivosService<MovimentacaoUnificadaModel>)Variaveis.DispositivosConectados.FirstOrDefault(x => x.Dispositivo == Enums.T_Code.Mvd);
if (Dispositivo == null)
@ -805,28 +818,39 @@ namespace AgroBase.Forms.IHM
int.TryParse(Leitura?.Mensagem ?? "", out int CodigoErro);
idx = PreencheDadosLinha(grid, Testes, idx, Inicializado ? CodigoErro : -1);
bool ParaEsquerda = Inicializado ? await EnviarComandoDir(Modulo, Enums.Direcao.Esquerda, Testes[idx], 5000) : false;
idx = PreencheDadosLinha(grid, Testes, idx, ParaEsquerda ? 1 : 0);
//MKS057DService.AddrRef = Convert.ToByte(Modulo.DirMotor.Endereco, 16);
bool ParaDireita = Inicializado ? await EnviarComandoDir(Modulo, Enums.Direcao.Direita, Testes[idx], 5000) : false;
idx = PreencheDadosLinha(grid, Testes, idx, ParaDireita ? 1 : 0);
if (Inicializado)
{
await EnviarComandoDir(Modulo, Enums.Direcao.Esquerda, Testes[idx], 5000);
}
idx = PreencheDadosLinha(grid, Testes, idx, Testes[idx].ValorAferido);
bool Parado = Inicializado ? await EnviarComandoDir(Modulo, Enums.Direcao.Parado, Testes[idx], 5000) : true;
idx = PreencheDadosLinha(grid, Testes, idx, Parado ? 0 : 1);
if (Inicializado)
{
await EnviarComandoDir(Modulo, Enums.Direcao.Direita, Testes[idx], 5000);
}
idx = PreencheDadosLinha(grid, Testes, idx, Testes[idx].ValorAferido);
if (Inicializado)
{
await EnviarComandoDir(Modulo, Enums.Direcao.Parado, Testes[idx], 5000);
}
idx = PreencheDadosLinha(grid, Testes, idx, Testes[idx].ValorAferido);
//MKS057DService.AddrRef = 0x00;
}
Variaveis.OperacaoEmAndamento.Controle.TipoMovimento = _oldTipoMovimento;
Variaveis.OperacaoEmAndamento.Controle.Angulo = _oldAngulo;
return true;
}
private async Task<bool> EnviarComandoDir(ModuloMvdModel Modulo, Enums.Direcao Sentido, ColunasDiagnosticoModel Teste, int Timeout)
private async Task EnviarComandoDir(ModuloMvdModel Modulo, Enums.Direcao Sentido, ColunasDiagnosticoModel Teste, int Timeout)
{
Variaveis.OperacaoEmAndamento.Controle.Angulo = 25;
bool oldCmd = Modulo.DirMotor.Comandar;
Modulo.DirMotor.Comandar = true;
GeneralJoystick.EnviaComandoMotor(Sentido == Direcao.Esquerda ? Keys.Left : Sentido == Direcao.Direita ? Keys.Right : Keys.Escape, T_Code.Dir);
await Modulo.DirMotor.EnviarComandoControle(Sentido);
DateTime Inicio = DateTime.Now;
bool Sucesso = false;
@ -834,22 +858,20 @@ namespace AgroBase.Forms.IHM
{
await Task.Delay(200);
bool sentidoCorreto = Modulo.DirMotor.Sentido ==
/*bool sentidoCorreto = Modulo.DirMotor.Sentido ==
(Sentido == Enums.Direcao.Esquerda ? Modulo.DirMotor.ConfigSentidos[Variaveis.OperacaoEmAndamento.Controle.TipoMovimento].Esquerda :
Sentido == Enums.Direcao.Direita ? Modulo.DirMotor.ConfigSentidos[Variaveis.OperacaoEmAndamento.Controle.TipoMovimento].Direita :
Enums.Sentido.Parado);
Enums.Sentido.Parado);*/
bool anguloCorreto =
Teste.ComplementoValorPadrao == "<" ? Modulo.DirMotor.Angulo < Teste.ValorPadrao :
Teste.ComplementoValorPadrao == ">" ? Modulo.DirMotor.Angulo > Teste.ValorPadrao :
Modulo.DirMotor.Angulo == Teste.ValorPadrao;
Sucesso = sentidoCorreto && anguloCorreto;
Sucesso = anguloCorreto;
}
Modulo.DirMotor.Comandar = oldCmd;
return Sucesso;
Teste.ValorAferido = Modulo.DirMotor.Angulo;
}

View File

@ -37,6 +37,8 @@
this.lblEndereco = new System.Windows.Forms.Label();
this.cmbEndereco = new System.Windows.Forms.ComboBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnPararTodos = new System.Windows.Forms.Button();
this.btnIniciarTodos = new System.Windows.Forms.Button();
this.txtValor = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.cmbModo = new System.Windows.Forms.ComboBox();
@ -123,8 +125,7 @@
this.label23 = new System.Windows.Forms.Label();
this.txtDirecao = new System.Windows.Forms.TextBox();
this.label22 = new System.Windows.Forms.Label();
this.btnIniciarTodos = new System.Windows.Forms.Button();
this.btnPararTodos = new System.Windows.Forms.Button();
this.btnGoHome = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
@ -230,6 +231,26 @@
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Controlar posição do motor";
//
// btnPararTodos
//
this.btnPararTodos.Location = new System.Drawing.Point(132, 234);
this.btnPararTodos.Name = "btnPararTodos";
this.btnPararTodos.Size = new System.Drawing.Size(84, 23);
this.btnPararTodos.TabIndex = 24;
this.btnPararTodos.Text = "Parar Todos";
this.btnPararTodos.UseVisualStyleBackColor = true;
this.btnPararTodos.Click += new System.EventHandler(this.btnPararTodos_Click);
//
// btnIniciarTodos
//
this.btnIniciarTodos.Location = new System.Drawing.Point(21, 234);
this.btnIniciarTodos.Name = "btnIniciarTodos";
this.btnIniciarTodos.Size = new System.Drawing.Size(84, 23);
this.btnIniciarTodos.TabIndex = 23;
this.btnIniciarTodos.Text = "Iniciar Todos";
this.btnIniciarTodos.UseVisualStyleBackColor = true;
this.btnIniciarTodos.Click += new System.EventHandler(this.btnIniciarTodos_Click);
//
// txtValor
//
this.txtValor.Location = new System.Drawing.Point(89, 111);
@ -649,6 +670,7 @@
//
// groupBox4
//
this.groupBox4.Controls.Add(this.btnGoHome);
this.groupBox4.Controls.Add(this.btnGravarRetorno);
this.groupBox4.Controls.Add(this.btnIrParaZero);
this.groupBox4.Controls.Add(this.btnZero);
@ -1083,25 +1105,15 @@
this.label22.TabIndex = 10;
this.label22.Text = "Direção";
//
// btnIniciarTodos
// btnGoHome
//
this.btnIniciarTodos.Location = new System.Drawing.Point(21, 234);
this.btnIniciarTodos.Name = "btnIniciarTodos";
this.btnIniciarTodos.Size = new System.Drawing.Size(84, 23);
this.btnIniciarTodos.TabIndex = 23;
this.btnIniciarTodos.Text = "Iniciar Todos";
this.btnIniciarTodos.UseVisualStyleBackColor = true;
this.btnIniciarTodos.Click += new System.EventHandler(this.btnIniciarTodos_Click);
//
// btnPararTodos
//
this.btnPararTodos.Location = new System.Drawing.Point(132, 234);
this.btnPararTodos.Name = "btnPararTodos";
this.btnPararTodos.Size = new System.Drawing.Size(84, 23);
this.btnPararTodos.TabIndex = 24;
this.btnPararTodos.Text = "Parar Todos";
this.btnPararTodos.UseVisualStyleBackColor = true;
this.btnPararTodos.Click += new System.EventHandler(this.btnPararTodos_Click);
this.btnGoHome.Location = new System.Drawing.Point(279, 103);
this.btnGoHome.Name = "btnGoHome";
this.btnGoHome.Size = new System.Drawing.Size(84, 23);
this.btnGoHome.TabIndex = 29;
this.btnGoHome.Text = "Go Home";
this.btnGoHome.UseVisualStyleBackColor = true;
this.btnGoHome.Click += new System.EventHandler(this.btnGoHome_Click);
//
// frmMKS
//
@ -1232,5 +1244,6 @@
private System.Windows.Forms.Button btnGravarRetorno;
private System.Windows.Forms.Button btnPararTodos;
private System.Windows.Forms.Button btnIniciarTodos;
private System.Windows.Forms.Button btnGoHome;
}
}

View File

@ -225,6 +225,8 @@ namespace AgroBase.Forms
cmbDirecaoLimite.Items.AddRange(LimiteDirecoes);
cmbVelocidadePosicao.Items.AddRange(VelocidadesPosicao);
cmbLimiteRetorno.Items.AddRange(LimiteRetornos);
btnAtualizar_Click(sender, e);
}
private void btnAtualizar_Click(object sender, EventArgs e)
@ -272,6 +274,8 @@ namespace AgroBase.Forms
cmbPorta.Enabled = false;
cmbBaud.Enabled = false;
btnConectar.Text = "Desconectar";
btnSobre_Click(btnSobre, e);
}
catch
{
@ -282,12 +286,20 @@ namespace AgroBase.Forms
#region Acoes Botoes
private void btnGoHome_Click(object sender, EventArgs e)
{
Button MyButton = (Button)sender;
MyButton.Tag = "32";
DataSended = Convert.ToByte(MyButton.Tag);
SendRelevantData(QueryCommand[DataSended]).ConfigureAwait(false);
}
private void btnCalibrar_Click(object sender, EventArgs e)
{
Button MyButton = (Button)sender;
MyButton.Tag = "13";
MyButton.Tag = "14";
DataSended = Convert.ToByte(MyButton.Tag);
SendRelevantData(QueryCommand[DataSended]);
SendRelevantData(QueryCommand[DataSended]).ConfigureAwait(false);
}
private void btnRestaurar_Click(object sender, EventArgs e)
@ -521,11 +533,11 @@ namespace AgroBase.Forms
await SendRelevantData(QueryCommand[DataSended]);
await Task.Delay(100);*/
await MKS057DService.EnviarComandoControle(new Models.MKS057ComandoModel()
MKS057DService.AdicionarComandoNaFila(new Models.MKS057ComandoModel()
{
Comando = data,
Endereco = addr,
Angulo = int.Parse(txtValor.Text),
Comando = data,
Endereco = Convert.ToByte(addr, 16),
Angulo = int.Parse(txtValor.Text),
Velocidade = int.Parse(cmbVelocidadePosicao.Text),
});
}
@ -1510,6 +1522,14 @@ namespace AgroBase.Forms
}
}
if (DataSended == 91) //(91 Go Home)
{
tCHK = 0xFA + Addr + data;
Buffer = new byte[] { 0xFA, Addr, (byte)data, (byte)tCHK };
WriteByteToSerialPort(Buffer, 0, 4);
}
}
else
MessageBox.Show("Endereço selecionado é inválido");
@ -2139,7 +2159,8 @@ namespace AgroBase.Forms
case 0x40:// 43 Informação de Versão
try
{
HV = HardVersion[SerialBuffer_RX[3]];
int idx = SerialBuffer_RX[3] < 9 ? SerialBuffer_RX[3] : 22 - SerialBuffer_RX[3];
HV = HardVersion[idx];
FV = "V" + SerialBuffer_RX[4] + "." + SerialBuffer_RX[5] + "." + SerialBuffer_RX[6];
for (int a = 0; a < 3; a++)
{

View File

@ -147,7 +147,11 @@ namespace AgroBase
{
Variaveis.DispositivosConectados.Where(x => x.Dados.GetStatusConexao()).ToList().ForEach(x => x.AcaoDesconectar());
}
SerialService.RealizarVarreduraPortasUSB().ConfigureAwait(false);
if (chbConexaoautomatica.Checked)
{
SerialService.RealizarVarreduraPortasUSB().ConfigureAwait(false);
}
if (
Variaveis.OperacaoEmAndamento.DispAtu == null && Variaveis.DispositivosConectados.Any(x => x.Dispositivo == T_Code.Atu) ||

View File

@ -28,7 +28,8 @@ namespace AgroBase.Models
EsquerdaCima,
DireitaBaixo,
DireitaCima,
EmFreio
EmFreio,
Referenciar
}
public enum Sentido
@ -204,6 +205,7 @@ namespace AgroBase.Models
MovimentoArco = 3,
MovimentoLateral = 4,
MovimentoDiagonal = 5,
Diagnostico = 6,
}
public enum TipoObstaculo

View File

@ -30,6 +30,7 @@ namespace AgroBase
new DeParaComandos() { key = Keys.Left, Dispositivo = T_Code.Dir, botaoJoy = BotoesJoystick.AEEsquerda, PararAoSoltar = true },
new DeParaComandos() { key = Keys.Right, Dispositivo = T_Code.Dir, botaoJoy = BotoesJoystick.SDireita, PararAoSoltar = true },
new DeParaComandos() { key = Keys.Right, Dispositivo = T_Code.Dir, botaoJoy = BotoesJoystick.AEDireita, PararAoSoltar = true },
new DeParaComandos() { key = Keys.R, Dispositivo = T_Code.Dir, botaoJoy = BotoesJoystick.R3, PararAoSoltar = false },
new DeParaComandos() { key = Keys.Up, Dispositivo = T_Code.Mov, botaoJoy = BotoesJoystick.A, PararAoSoltar = true },
new DeParaComandos() { key = Keys.Down, Dispositivo = T_Code.Mov, botaoJoy = BotoesJoystick.X, PararAoSoltar = true },
new DeParaComandos() { key = Keys.Space, Dispositivo = T_Code.Mov, botaoJoy = BotoesJoystick.B, PararAoSoltar = true },
@ -550,6 +551,12 @@ namespace AgroBase
DirecaoAtual = Direcao.Direita;
Pressionado = true;
}
else if (Comando.Comando == Keys.R)
{
Comando.Dispositivo = T_Code.Dir;
DirecaoAtual = Direcao.Referenciar;
Pressionado = true;
}
// Controle dos Bicos Pulverizadores (ATU)
else if ((Comando.Comando == Keys.D1 || Comando.Comando == Keys.D2 || Comando.Comando == Keys.D3 || Comando.Comando == Keys.D4) && Variaveis.OperacaoEmAndamento.DispAtu.Dados.BicosPulverizadores.Any(x => x.ID == Comando.IDcontrolar && !x.Atuado))
{
@ -605,8 +612,13 @@ namespace AgroBase
}
else
{
Protocolos = Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.ToDictionary(x => x.Modulo_ID, x => x.DirMotor.ProtocoloComando(DirecaoAtual));
Dispositivo = Variaveis.OperacaoEmAndamento.DispMvd;
Task.Run(async () =>
{
foreach (var Modulo in Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos)
{
await Modulo.DirMotor.EnviarComandoControle(DirecaoAtual);
}
});
}
break;
}

View File

@ -742,7 +742,7 @@ namespace AgroBase.Models
public int toleranciaDeteccaoSuperior { get; set; }
public int subdivisoesX { get; set; }
public int subdivisoesY { get; set; }
public List<Subdivisao> Subdivisoes { get; set; }
public List<Subdivisao> Subdivisoes { get; set; } = new List<Subdivisao>();
public List<Subdivisao> SubdivisoesTrajetoria
{
get

View File

@ -41,19 +41,23 @@ namespace AgroBase.Models
public string Mensagem { get; set; }
public string HV { get; set; }
public string FV { get; set; }
public List<bool> Entradas { get; set; }
public List<bool> Saidas { get; set; }
}
public class MKS057ComandoModel
{
public DateTime Momento { get; set; } = DateTime.Now;
public bool Get { get; set; }
public byte Comando { get; set; }
public string Endereco { get; set; }
public byte Endereco { get; set; }
public double Angulo { get; set; }
public double Velocidade { get; set; }
public ModosControle ModoControle { get; set; } = ModosControle.AnguloAbsoluto;
public Sentido _Sentido { get; set; } = Sentido.Parado;
public bool AguardaResposta { get; set; } = false;
public int TimeoutResposta { get; set; } = 1000;
public bool Enviado { get; set; } = false;
}
public enum ModosOperacao

View File

@ -10,7 +10,6 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static AgroBase.Models.Enums;
using static AgroBase.Services.BLD300RService;
namespace AgroBase.Models.Modules
{
@ -388,26 +387,37 @@ namespace AgroBase.Models.Modules
public async Task ExecutarMovimentoDirecionalCombinado(Direcao DirecaoAtual)
{
if (DirecaoAtual == Direcao.Parado)
{
foreach (var Modulo in Modulos)
{
Modulo.MovMotor.ProtocoloComando(Direcao.Parado);
}
await Task.Delay(1000);
}
switch (Variaveis.OperacaoEmAndamento.Controle.TipoMovimento)
{
case TipoMovimentoDirecional.RotacionarNoEixo:
case TipoMovimentoDirecional.MovimentoLateral:
foreach (var Modulo in Modulos.Where(x => !x.DirMotor.PosicaoTipoMovimentoConcluido))
foreach (var Modulo in Modulos.Where(x => x.DirMotor.MKS_Inicializado && !x.DirMotor.PosicaoTipoMovimentoConcluido(DirecaoAtual)))
{
Modulo.DirMotor.ProtocoloComando(DirecaoAtual);
await Modulo.DirMotor.EnviarComandoControle(DirecaoAtual);
}
DateTime Agora = DateTime.Now;
bool Sucesso = Modulos.All(x => x.DirMotor.PosicaoTipoMovimentoConcluido);
bool Sucesso = Modulos.All(x => x.DirMotor.PosicaoTipoMovimentoConcluido(DirecaoAtual));
while (Agora.AddMilliseconds(5000) > DateTime.Now && !Sucesso)
{
await Task.Delay(100);
Sucesso = Modulos.All(x => x.DirMotor.PosicaoTipoMovimentoConcluido);
Sucesso = Modulos.All(x => x.DirMotor.PosicaoTipoMovimentoConcluido(DirecaoAtual));
}
if (Sucesso)
if (Sucesso && DirecaoAtual != Direcao.Parado)
{
Variaveis.OperacaoEmAndamento.Controle.RPM_SP = 20;
foreach (var Modulo in Modulos)
{
Modulo.MovMotor.ProtocoloComando(
@ -422,6 +432,7 @@ namespace AgroBase.Models.Modules
}
}
}
public class ModuloMvdModel
@ -728,6 +739,16 @@ namespace AgroBase.Models.Modules
Tras = Mod_ID.Contains("T") ? Sentido.Horario : Sentido.Antihorario
}
},
{
TipoMovimentoDirecional.Diagnostico,
new ConfiguracaoSentidoMotor()
{
Direita = Sentido.Parado,
Esquerda = Sentido.Parado,
Frente = Mod_ID.Contains("E") ? Sentido.Antihorario : Sentido.Horario,
Tras = Mod_ID.Contains("E") ? Sentido.Horario : Sentido.Antihorario
}
},
},
};
}
@ -796,7 +817,7 @@ namespace AgroBase.Models.Modules
if (Leitura == null || Leitura.Direcao != Sentido_SP)
{
BLD300RService.AdicionarComandoNaFila(new BLDComandoModel()
BLD300RService.AdicionarComandoNaFila(new BLD300RService.BLDComandoModel()
{
Endereco = Addr,
Parametro = BLD300RService.Parametros.First(x => x.Chave == "Direction"),
@ -808,7 +829,7 @@ namespace AgroBase.Models.Modules
}
if (Ligado && (Leitura == null || Leitura.RPM_SP != RPM_SP_C))
{
BLD300RService.AdicionarComandoNaFila(new BLDComandoModel()
BLD300RService.AdicionarComandoNaFila(new BLD300RService.BLDComandoModel()
{
Endereco = Addr,
Parametro = BLD300RService.Parametros.First(x => x.Chave == "RPM_SP"),
@ -820,7 +841,7 @@ namespace AgroBase.Models.Modules
}
if (Leitura == null || Leitura.Freado != Freio)
{
BLD300RService.AdicionarComandoNaFila(new BLDComandoModel()
BLD300RService.AdicionarComandoNaFila(new BLD300RService.BLDComandoModel()
{
Endereco = Addr,
Parametro = BLD300RService.Parametros.First(x => x.Chave == "Breaked"),
@ -834,7 +855,7 @@ namespace AgroBase.Models.Modules
}
if (Leitura == null || Leitura.Ativado != Ligado)
{
BLD300RService.AdicionarComandoNaFila(new BLDComandoModel()
BLD300RService.AdicionarComandoNaFila(new BLD300RService.BLDComandoModel()
{
Endereco = Addr,
Parametro = BLD300RService.Parametros.First(x => x.Chave == "Enabled"),
@ -856,6 +877,9 @@ namespace AgroBase.Models.Modules
}
}
// Linha duvidosa kkk
AcaoDoFreio = Freio ? AcaoFreio.Ativar : AcaoFreio.Desativar;
if (AcaoDoFreio != AcaoFreio.SemAcao)
{
string Mod_ID = Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.FirstOrDefault(x => x.MovMotor.Endereco == Endereco)?.Modulo_ID ?? "";
@ -881,6 +905,7 @@ namespace AgroBase.Models.Modules
public Sentido Sentido_SP { get; set; } = Sentido.Parado;
public double Angulo_SP { get; set; } = 0;
public double Angulo_Offset { get; set; } = 0;
public double Velocidade_Max { get; set; } = 600;
// GETs
public Sentido Sentido { get; set; } = Sentido.Parado;
@ -896,19 +921,30 @@ namespace AgroBase.Models.Modules
return MKS057DService.DadosLeitura.Any(x => x.Iniciado && Convert.ToByte(Endereco.Replace("0x", ""), 16) == x.Endereco);
}
}
public bool PosicaoTipoMovimentoConcluido
public bool PosicaoTipoMovimentoConcluido(Direcao DirecaoAtual)
{
get
var TipoMovimento = Variaveis.OperacaoEmAndamento.Controle.TipoMovimento;
switch (TipoMovimento)
{
var TipoMovimento = Variaveis.OperacaoEmAndamento.Controle.TipoMovimento;
switch (TipoMovimento)
{
case TipoMovimentoDirecional.RotacionarNoEixo:
case TipoMovimentoDirecional.MovimentoLateral:
return !Comandar || VariaveisEquipamento.AnguloMovimento[TipoMovimento] == Angulo;
default:
return !Comandar || Angulo_SP == Angulo;
}
case TipoMovimentoDirecional.RotacionarNoEixo:
case TipoMovimentoDirecional.MovimentoLateral:
int agSP = DirecaoAtual != Direcao.Parado ? VariaveisEquipamento.AnguloMovimento[TipoMovimento] : 0;
bool anguloCorreto = agSP == Angulo;
if (!anguloCorreto && agSP != 0)
{
if (agSP > 0)
{
anguloCorreto = Angulo >= agSP;
}
else
{
anguloCorreto = Angulo <= agSP;
}
}
return !Comandar || anguloCorreto;
default:
return !Comandar || Angulo_SP == Angulo;
}
}
@ -936,8 +972,8 @@ namespace AgroBase.Models.Modules
TipoMovimentoDirecional.RodasDianteiras,
new ConfiguracaoSentidoMotor()
{
Direita = Mod_ID.Contains("F") ? Sentido.Horario : Sentido.Antihorario,
Esquerda = Mod_ID.Contains("F") ? Sentido.Antihorario : Sentido.Horario,
Direita = Mod_ID.Contains("E") ? Sentido.Horario : Sentido.Antihorario,
Esquerda = Mod_ID.Contains("E") ? Sentido.Antihorario : Sentido.Horario,
Frente = Sentido.Parado,
Tras = Sentido.Parado
}
@ -946,8 +982,8 @@ namespace AgroBase.Models.Modules
TipoMovimentoDirecional.RodasTraseiras,
new ConfiguracaoSentidoMotor()
{
Direita = Mod_ID.Contains("F") ? Sentido.Horario : Sentido.Antihorario,
Esquerda = Mod_ID.Contains("F") ? Sentido.Antihorario : Sentido.Horario,
Direita = Mod_ID.Contains("E") ? Sentido.Horario : Sentido.Antihorario,
Esquerda = Mod_ID.Contains("E") ? Sentido.Antihorario : Sentido.Horario,
Frente = Sentido.Parado,
Tras = Sentido.Parado
}
@ -956,8 +992,8 @@ namespace AgroBase.Models.Modules
TipoMovimentoDirecional.MovimentoDiagonal,
new ConfiguracaoSentidoMotor()
{
Direita = Sentido.Horario,
Esquerda = Sentido.Antihorario,
Direita = Mod_ID == "EF" || Mod_ID == "DT" ? Sentido.Horario : Sentido.Antihorario,
Esquerda = Mod_ID == "EF" || Mod_ID == "DT" ? Sentido.Antihorario : Sentido.Horario,
Frente = Sentido.Parado,
Tras = Sentido.Parado
}
@ -966,8 +1002,8 @@ namespace AgroBase.Models.Modules
TipoMovimentoDirecional.MovimentoArco,
new ConfiguracaoSentidoMotor()
{
Direita = Mod_ID.Contains("F") ? Sentido.Horario : Sentido.Antihorario,
Esquerda = Mod_ID.Contains("F") ? Sentido.Antihorario : Sentido.Horario,
Direita = Mod_ID.Contains("E") ? Sentido.Horario : Sentido.Antihorario,
Esquerda = Mod_ID.Contains("E") ? Sentido.Antihorario : Sentido.Horario,
Frente = Sentido.Parado,
Tras = Sentido.Parado
}
@ -976,8 +1012,8 @@ namespace AgroBase.Models.Modules
TipoMovimentoDirecional.RotacionarNoEixo,
new ConfiguracaoSentidoMotor()
{
Direita = Mod_ID == "EF" || Mod_ID == "DT" ? Sentido.Horario : Sentido.Antihorario,
Esquerda = Mod_ID == "EF" || Mod_ID == "DT" ? Sentido.Antihorario : Sentido.Horario,
Direita = Sentido.Horario,
Esquerda = Sentido.Horario,
Frente = Sentido.Parado,
Tras = Sentido.Parado
}
@ -992,6 +1028,16 @@ namespace AgroBase.Models.Modules
Tras = Sentido.Parado
}
},
{
TipoMovimentoDirecional.Diagnostico,
new ConfiguracaoSentidoMotor()
{
Direita = Sentido.Horario,
Esquerda = Sentido.Antihorario,
Frente = Sentido.Parado,
Tras = Sentido.Parado
}
},
}
};
}
@ -1040,21 +1086,28 @@ namespace AgroBase.Models.Modules
if (MKS_Inicializado)
{
int mx = Sentido_SP == Sentido.Antihorario ? -1 : 1;
int vel = Convert.ToInt32((Variaveis.OperacaoEmAndamento.Controle.VelocidadeMP / 100.0) * (MKS057DService.DadosLeitura.FirstOrDefault(x => x.Endereco == Convert.ToByte(Endereco.Replace("0x", ""), 16))?.Velocidade ?? 600));
MKS057DService.EnviarComandoControle(new MKS057ComandoModel()
if (Direcao == Direcao.Referenciar)
{
Get = false,
Comando = Convert.ToByte("13"),
Endereco = Endereco,
Angulo = Angulo_SP * mx,
Velocidade = vel,
_Sentido = Sentido_SP,
ModoControle = ModosControle.AnguloAbsoluto,
AguardaResposta = false,
}).ConfigureAwait(false);
ReferenciaMotor().ConfigureAwait(false);
}
else
{
int mx = Sentido_SP == Sentido.Antihorario ? -1 : 1;
int vel = Convert.ToInt32((Variaveis.OperacaoEmAndamento.Controle.VelocidadeMP / 100.0) * Velocidade_Max);
MKS057DService.AdicionarComandoNaFila(new MKS057ComandoModel()
{
Get = false,
Comando = Convert.ToByte("13"),
Endereco = Convert.ToByte(Endereco, 16),
Angulo = Angulo_SP * mx,
Velocidade = vel,
_Sentido = Sentido_SP,
ModoControle = ModosControle.AnguloAbsoluto,
AguardaResposta = false,
});
}
}
else if (Inicializado)
{
@ -1070,6 +1123,103 @@ namespace AgroBase.Models.Modules
return ProtocoloMotor;
}
public async Task EnviarComandoControle(Direcao Direcao)
{
if (Comandar)
{
int AnguloTipoMovimento = VariaveisEquipamento.AnguloMovimento[Variaveis.OperacaoEmAndamento.Controle.TipoMovimento];
Sentido_SP =
Direcao == Direcao.Direita ? ConfigSentidos[Variaveis.OperacaoEmAndamento.Controle.TipoMovimento].Direita :
Direcao == Direcao.Esquerda ? ConfigSentidos[Variaveis.OperacaoEmAndamento.Controle.TipoMovimento].Esquerda :
Sentido_SP == Sentido.Horario ? Sentido.Antihorario :
Sentido_SP == Sentido.Antihorario ? Sentido.Horario :
Sentido.Parado;
Angulo_SP =
(Direcao != Direcao.Esquerda && Direcao != Direcao.Direita) ? 0 :
AnguloTipoMovimento != -1 ? AnguloTipoMovimento :
Variaveis.OperacaoEmAndamento.Controle.Angulo;
int mx = Sentido_SP == Sentido.Antihorario ? -1 : 1;
Angulo_SP = Math.Abs(Angulo_SP) * mx;
if (MKS_Inicializado)
{
if (Direcao == Direcao.Referenciar)
{
await ReferenciaMotor();
}
else
{
int vel = Convert.ToInt32((Variaveis.OperacaoEmAndamento.Controle.VelocidadeMP / 100.0) * Velocidade_Max);
MKS057DService.AdicionarComandoNaFila(MKS057DService.MontarComandoMovimento(Convert.ToByte(Endereco.Replace("0x", ""), 16), Angulo_SP, vel, Sentido_SP));
}
}
}
}
private async Task ReferenciaMotor()
{
byte Addr = Convert.ToByte(Endereco, 16);
MKS057DService.AdicionarComandoNaFila(MKS057DService.MontarComandoRequisicaoIO(Addr));
MKS057DService.AdicionarComandoNaFila(MKS057DService.MontarComandoSetZero(Addr));
MKS057DService.AdicionarComandoNaFila(MKS057DService.MontarComandoRequisicaoPulsos(Addr));
await Task.Delay(500);
var Leitura = MKS057DService.DadosLeitura.FirstOrDefault(x => x.Endereco == Addr);
bool Sucesso = Leitura != null && Leitura.Entradas != null && Leitura.Entradas[0] == true;
int _angulo = 45;
if (!Sucesso)
{
MKS057DService.AdicionarComandoNaFila(MKS057DService.MontarComandoMovimento(Addr, _angulo, 18, Sentido.Horario));
MKS057DService.AddrRef = Addr;
DateTime Inicio = DateTime.Now;
while (!Sucesso && Inicio.AddSeconds(30) > DateTime.Now)
{
Leitura = MKS057DService.DadosLeitura.FirstOrDefault(x => x.Endereco == Addr);
Sucesso = Leitura != null && Leitura.Entradas != null && Leitura.Entradas[0] == true;
if (Sucesso)
{
MKS057DService.AdicionarComandoNaFila(MKS057DService.MontarComandoMovimento(Addr, Angulo, 1, Sentido.Horario));
MKS057DService.AddrRef = 0x00;
MKS057DService.AdicionarComandoNaFila(MKS057DService.MontarComandoSetZero(Addr));
await Task.Delay(500);
MKS057DService.AdicionarComandoNaFila(MKS057DService.MontarComandoMovimento(Addr, 0, 1, Sentido.Parado));
break;
}
if (Angulo >= 45 || Angulo <= -45)
{
_angulo = Angulo >= 45 ? -45 : 45;
MKS057DService.AdicionarComandoNaFila(MKS057DService.MontarComandoMovimento(Addr, _angulo, 18, Sentido.Horario));
}
await Task.Delay(500);
}
}
if (!Sucesso)
{
MKS057DService.AddrRef = 0x00;
MKS057DService.AdicionarComandoNaFila(MKS057DService.MontarComandoMovimento(Addr, 0, 18, Sentido.Parado));
}
}
}
public class MvdMotorMOVSensorimanetoGrafico

View File

@ -88,6 +88,7 @@ namespace AgroBase.Models
{ TipoMovimentoDirecional.MovimentoArco, -1 },
{ TipoMovimentoDirecional.RotacionarNoEixo, 45 },
{ TipoMovimentoDirecional.MovimentoLateral, 90 },
{ TipoMovimentoDirecional.Diagnostico, 25 },
};
public static SensorSinaleiroComportamentoModel ComportamentoPorStatus(StatusOperacao? _status = null)

View File

@ -1,10 +1,13 @@
using AgroBase.Forms;
using AgroBase.Forms.IHM;
using AgroBase.Models;
using CefSharp.DevTools.Page;
using OpenTK.Audio.OpenAL;
using SharpDX.DirectInput;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Text;
@ -30,9 +33,10 @@ namespace AgroBase.Services
{
_PortaMKS.Open();
}
catch
catch (Exception ex)
{
_PortaMKS = null;
RegisrarErrosComunicacao(0, $"Erro ao abrir porta {_PortaMKS.PortName}. Erro={ex.Message}");
//_PortaMKS = null;
}
}
return _PortaMKS != null && _PortaMKS.IsOpen && DadosLeitura.Any(x => x.Iniciado);
@ -50,7 +54,7 @@ namespace AgroBase.Services
AtualizarPortaCOM(porta);
}
string oldHV = "";
string oldFV = "";
@ -58,14 +62,7 @@ namespace AgroBase.Services
foreach (var Modulo in Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.Where(x => !x.DirMotor.MKS_Inicializado))
{
try
{
Addr = Convert.ToByte(Modulo.DirMotor.Endereco, 16);
}
catch
{
Console.WriteLine("Erro ao definir endereco");
}
Addr = Convert.ToByte(Modulo.DirMotor.Endereco, 16);
DataSended = Convert.ToByte("43");
@ -78,7 +75,7 @@ namespace AgroBase.Services
}
}
if (Iniciado)
if (Mod_IDs.Any() || Iniciado)
{
DefinirDispositivo(Mod_IDs);
}
@ -105,22 +102,22 @@ namespace AgroBase.Services
private static void DefinirDispositivo(List<string> Mod_IDs)
{
if (Iniciado)
foreach (var Mod_ID in Mod_IDs)
{
foreach (var Mod_ID in Mod_IDs)
{
var Modulo = Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.FirstOrDefault(x => x.Modulo_ID == Mod_ID);
byte Addr = Convert.ToByte(Modulo.DirMotor.Endereco.Replace("0x", ""), 16);
var Modulo = Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.FirstOrDefault(x => x.Modulo_ID == Mod_ID);
byte Addr = Convert.ToByte(Modulo.DirMotor.Endereco.Replace("0x", ""), 16);
if (!SerialService.DispositivosMapeados.Any(x => x.Dispositivo == T_Code.Mks && x.Mod_ID == Mod_ID))
if (!SerialService.DispositivosMapeados.Any(x => x.Dispositivo == T_Code.Mks && x.Mod_ID == Mod_ID))
{
var Leitura = DadosLeitura.FirstOrDefault(x => x.Endereco == Addr);
if (Leitura != null)
{
var Leitura = DadosLeitura.FirstOrDefault(x => x.Endereco == Addr);
SerialService.DispositivosMapeados.Add(new SerialService.DispositivoDetalhesModel()
{
PortaCOM = _PortaMKS.PortName,
Dispositivo = T_Code.Mks,
Erro = Leitura.Mensagem != "",
Versao = Leitura.FV.ToString(),
Erro = (Leitura.Mensagem ?? "") != "",
Versao = (Leitura.FV ?? "").ToString(),
Mod_ID = Mod_ID,
});
}
@ -130,23 +127,139 @@ namespace AgroBase.Services
public static void IniciarRotinas()
{
ReceberDados().ConfigureAwait(false);
//Task.Run(() => LoopEnvioComandos()); // Inicia o loop de comandos em segundo plano
Task.Run(() => ReceberDados()); // Inicia a recepção de dados em segundo plano
if (!tmrLoopComandos.Enabled)
{
tmrLoopComandos.Tick += TmrLoopComandos_Tick;
tmrLoopComandos.Start();
}
}
public static void EnviarComando(SerialPort _Porta, byte[] Comando)
private static void TmrLoopComandos_Tick(object sender, EventArgs e)
{
if (_Porta != null)
if (EnvioLiberado)
{
if (!_Porta.IsOpen)
Task.Run(() => LoopEnvioComandos());
}
}
private static bool EnderecoValido(byte addr)
{
return Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.Any(x => Convert.ToByte(x.DirMotor.Endereco.Replace("0x", ""), 16) == addr);
}
public static void AdicionarComandoNaFila(MKS057ComandoModel Comando)
{
if (!EnderecoValido(Comando.Endereco))
{
return;
}
lock (FilaLock)
{
if (!FilaComandos.Any(x => x.Endereco == Comando.Endereco && x.Comando == Comando.Comando && x.Get == Comando.Get && !x.Enviado))
{
_Porta.Open();
FilaComandos.Add(Comando);
}
if (_Porta.IsOpen)
}
}
private static async Task LoopEnvioComandos()
{
EnvioLiberado = false;
try
{
await ProcessarFilaPrioridade();
List<MKS057ComandoModel> comandosParaEnviar;
lock (FilaLock)
{
_Porta.Write(Comando, 0, Comando.Length);
txDisplay();
comandosParaEnviar = FilaComandos.Where(x => !x.Enviado && x.Get).OrderBy(x => x.Momento).ToList();
}
foreach (var Comando in comandosParaEnviar)
{
await EnviarComandoControle(Comando);
await ProcessarFilaPrioridade();
}
}
catch (Exception ex)
{
RegisrarErrosComunicacao(0, $"Erro ao processar fila de comandos. Erro={ex.Message}");
}
finally
{
EnvioLiberado = true;
}
}
private static async Task ProcessarFilaPrioridade()
{
var FilaPrioridade = new List<MKS057ComandoModel>();
lock (FilaLock)
{
FilaPrioridade = FilaComandos.Where(x => !x.Enviado && !x.Get).OrderBy(x => x.Momento).ToList();
}
while (FilaPrioridade.Count > 0)
{
foreach (var Comando in FilaPrioridade)
{
await EnviarComandoControle(Comando);
}
lock (FilaLock)
{
FilaPrioridade = FilaComandos.Where(x => !x.Enviado && !x.Get).OrderBy(x => x.Momento).ToList();
}
}
}
private static void RegisrarErrosComunicacao(byte addr, string mensagem)
{
var Caminho = Variaveis.CaminhoLogsDispositivos;
if (!Directory.Exists(Caminho))
{
Directory.CreateDirectory(Caminho);
}
var Arquivo = T_Code.Mks.ToString() + "_err.txt";
Caminho += "/" + Arquivo;
mensagem = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss:fff") + " - Porta " + (_PortaMKS?.PortName ?? "COM") + " - " + addr + ": " + mensagem + Environment.NewLine;
if (!File.Exists(Caminho))
{
File.WriteAllText(Caminho, mensagem);
}
else
{
File.AppendAllText(Caminho, mensagem);
}
}
private static void ReconectarPortaCOM()
{
RegisrarErrosComunicacao(0, $"Reiniciando conexão com a porta {_PortaMKS.PortName}...");
try
{
_PortaMKS.Close();
}
catch (Exception ex)
{
RegisrarErrosComunicacao(0, $"Erro ao reiniciar conexão. Erro={ex.Message}");
}
if (Iniciado)
{
RegisrarErrosComunicacao(0, $"Reconexão com a porta {_PortaMKS.PortName} reestabelecida");
}
else
{
RegisrarErrosComunicacao(0, $"Erro ao reestabelecer conexão com a porta {_PortaMKS.PortName}");
}
}
@ -275,10 +388,8 @@ namespace AgroBase.Services
public static string _addressSlave { get; set; } = "0x01";
public static string _RampaPartida { get; set; } = "16";
public static string _RampaParada { get; set; } = "16";
public static Estado _RetornoOrigem { get; set; } = Estado.Desligado;
public static Estado _RetornoOrigem { get; set; } = Estado.Ligado;
public static ModosRetornoOrigem _ModoRetornoOrigem { get; set; } = ModosRetornoOrigem.Desativado;
public static Sentido _SentidoRetornoOrigem { get; set; } = Sentido.Parado;
public static string _VelocidadeRetornoOrigem { get; set; } = "2";
public static string _TipoLimiteZero { get; set; } = "Definir";
public static Dictionary<byte, string> _Velocidade { get; set; } = new Dictionary<byte, string>();
@ -288,47 +399,80 @@ namespace AgroBase.Services
#endregion
private static List<MKS057ComandoModel> FilaComandos = new List<MKS057ComandoModel>();
private static readonly object FilaLock = new object();
private static System.Windows.Forms.Timer tmrLoopComandos = new System.Windows.Forms.Timer() { Interval = 100 };
private static bool EnvioLiberado { get; set; } = true;
public static List<MKS057DModel> DadosLeitura = new List<MKS057DModel>();
public static bool EnvioLiberado = true;
public static bool FilaEmEspera = false;
public static bool Respondido = false;
public static async Task EnviarComandoRequisicao(string Endereco)
public static byte AddrRef = 0x00;
public static bool Referenciando
{
await EnviarComandoControle(
new MKS057ComandoModel()
{
Get = true,
Comando = Convert.ToByte("1"),
Endereco = Endereco,
Angulo = -1,
AguardaResposta = true,
}
);
get
{
return AddrRef > 0x00;
}
}
public static MKS057ComandoModel MontarComandoRequisicaoPulsos(byte Endereco)
{
return new MKS057ComandoModel()
{
Get = true,
Comando = Convert.ToByte("1"),
Endereco = Endereco,
AguardaResposta = true,
};
}
public static MKS057ComandoModel MontarComandoRequisicaoIO(byte Endereco)
{
return new MKS057ComandoModel()
{
Get = true,
Comando = Convert.ToByte("46"),
Endereco = Endereco,
AguardaResposta = true,
};
}
public static MKS057ComandoModel MontarComandoSetZero(byte Endereco)
{
return new MKS057ComandoModel()
{
Get = false,
Comando = Convert.ToByte("33"),
Endereco = Endereco,
AguardaResposta = true,
Angulo = 0,
_Sentido = Sentido.Parado,
Velocidade = 1,
ModoControle = ModosControle.AnguloAbsoluto
};
}
public static MKS057ComandoModel MontarComandoMovimento(byte Endereco, double Angulo_SP, int Velocidade, Sentido Sentido_SP, ModosControle Controle = ModosControle.AnguloAbsoluto)
{
return new MKS057ComandoModel()
{
Get = false,
Comando = Convert.ToByte("13"),
Endereco = Endereco,
Angulo = Angulo_SP,
Velocidade = Velocidade,
_Sentido = Sentido_SP,
ModoControle = Controle,
AguardaResposta = false,
};
}
public static async Task EnviarComandoControle(MKS057ComandoModel Comando)
{
while (!EnvioLiberado)
{
await Task.Delay(FilaEmEspera ? 200 : 100);
FilaEmEspera = true;
}
EnvioLiberado = false;
FilaEmEspera = false;
Respondido = false;
try
{
Addr = Convert.ToByte(Comando.Endereco, 16);
}
catch
{
Console.WriteLine("Erro ao definir endereco");
}
Addr = Comando.Endereco;
if (!Comando.Get)
{
@ -359,22 +503,109 @@ namespace AgroBase.Services
await SendRelevantData(QueryCommand[DataSended]);
Comando.Enviado = true;
Respondido = !Comando.AguardaResposta;
DateTime Inicio = DateTime.Now;
await Task.Delay(100);
while (Comando.AguardaResposta && !Respondido && Inicio.AddMilliseconds(Comando.TimeoutResposta) > DateTime.Now)
{
await Task.Delay(100);
}
EnvioLiberado = true;
if (!Respondido)
{
RegisrarErrosComunicacao(Addr, $"Timeout ao receber resposta. GET={Comando.Get}, Parametro={Comando.Comando}");
Comando.Enviado = false;
Comando.Momento = DateTime.Now.AddMilliseconds(500);
//ReconectarPortaCOM();
}
}
public static void AdicionaComandosGoHomeFila(byte Endereco)
{
// Configura o GoHome
AdicionarComandoNaFila(new MKS057ComandoModel()
{
Get = false,
Comando = Convert.ToByte("46"),
Endereco = Endereco,
Angulo = 0,
Velocidade = 1, // 0 ~ 4
_Sentido = Sentido.Horario,
ModoControle = ModosControle.AnguloAbsoluto,
AguardaResposta = false,
});
// Inicia o GoHome
AdicionarComandoNaFila(new MKS057ComandoModel()
{
Get = false,
Comando = Convert.ToByte("32"),
Endereco = Endereco,
Angulo = 0,
Velocidade = 1,
_Sentido = Sentido.Horario,
ModoControle = ModosControle.AnguloAbsoluto,
AguardaResposta = false,
});
}
private static void DefinirDadosModulo(MKS057DModel leitura)
{
if (Variaveis.OperacaoEmAndamento.DispMvd != null)
{
var Modulo = Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.FirstOrDefault(x => Convert.ToByte(x.DirMotor.Endereco, 16) == Addr);
if (Modulo != null)
{
Modulo.DirMotor.Angulo = PulsosParaAngulo(leitura.NumeroPulsos);
Modulo.DirMotor.Sentido = leitura.Direcao;
}
}
}
private static async Task<bool> ReceberDados()
{
while (true)
{
await Task.Delay(TaxaAmostragem);
if (!Iniciado)
{
foreach (var Leitura in DadosLeitura.Where(x => x.UltimoComandoRecebido.AddSeconds(10) < DateTime.Now))
{
AdicionarComandoNaFila(MontarComandoRequisicaoPulsos(Leitura.Endereco));
}
TaxaAmostragem = 3000;
ReconectarPortaCOM();
continue;
}
TaxaAmostragem = Referenciando ? 200 : 1000;
if (Referenciando)
{
AdicionarComandoNaFila(MontarComandoRequisicaoPulsos(AddrRef));
AdicionarComandoNaFila(MontarComandoRequisicaoIO(AddrRef));
}
else
{
foreach (var Modulo in Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.Where(x => x.DirMotor.MKS_Inicializado))
{
AdicionarComandoNaFila(MontarComandoRequisicaoPulsos(Convert.ToByte(Modulo.DirMotor.Endereco, 16)));
}
}
}
}
public static int ConverterAnguloParaValor(double _angulo)
{
int val = 0;
if (_ModoControle[Addr] == ModosControle.Pulsos)
{
@ -391,52 +622,28 @@ namespace AgroBase.Services
return val;
}
private static double ConverterPulsosParaAngulo(int pulsos)
public static double PulsosParaAngulo(int valor)
{
double relacao = (pulsos * VariaveisEquipamento.ReducaoDirecional) / 360.0;
double angulo = pulsos * relacao;
double reducao = VariaveisEquipamento.ReducaoDirecional;
int mstep = 16;
double pulsos = mstep * 200.0;
double relacao = (pulsos * reducao) / 360.0;
double angulo = valor / relacao;
return angulo;
}
private static void DefinirDadosModulo(MKS057DModel leitura)
{
if (Variaveis.OperacaoEmAndamento.DispMvd != null)
{
var Modulo = Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.FirstOrDefault(x => Convert.ToByte(x.DirMotor.Endereco, 16) == Addr);
if (Modulo != null)
{
Modulo.DirMotor.Angulo = ConverterPulsosParaAngulo(leitura.NumeroPulsos);
Modulo.DirMotor.Sentido = leitura.Direcao;
}
}
}
private static async Task<bool> ReceberDados()
{
while (true)
{
await Task.Delay(TaxaAmostragem);
if (!Iniciado)
{
continue;
}
foreach (var Modulo in Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.Where(x => x.DirMotor.MKS_Inicializado))
{
await EnviarComandoRequisicao(Modulo.DirMotor.Endereco);
}
}
}
#region METODOS PRINCIPAIS
private static void WriteByteToSerialPort(byte[] data, byte start, byte length)
{
if (_PortaMKS.IsOpen)
if (_PortaMKS == null)
{
RegisrarErrosComunicacao(Addr, "Porta serial não está definida");
}
else if (_PortaMKS.IsOpen)
{
try
{
@ -445,11 +652,13 @@ namespace AgroBase.Services
}
catch
{
Console.WriteLine("Erro ao enviar dados para a porta serial");
RegisrarErrosComunicacao(Addr, "Erro ao enviar dados para a porta serial");
}
}
else
MessageBox.Show("Porta serial não está aberta");
{
RegisrarErrosComunicacao(Addr, "Porta serial não está aberta");
}
}
private static void port_DataReceived(object sender, SerialDataReceivedEventArgs e) // Evento de recebimento de dados da porta serial
@ -459,7 +668,7 @@ namespace AgroBase.Services
private static void ProcessarDadosRecebidos()
{
if (Iniciado)
if (_PortaMKS.IsOpen)
{
SerialBuffer_RX = new byte[11] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // SerialBuffer_RX[0] Cabeçalho do quadro [1] Endereço do escravo [2] Número da instrução
Data_Number = _PortaMKS.BytesToRead; // Número de bytes recebidos
@ -1159,11 +1368,11 @@ namespace AgroBase.Services
}
//Direção de retorno à origem
if (_SentidoRetornoOrigem == Sentido.Antihorario)
if (_Sentido[Addr] == Sentido.Antihorario)
{
HomeDir = 0x00;
}
else if (_SentidoRetornoOrigem == Sentido.Horario)
else if (_Sentido[Addr] == Sentido.Horario)
{
HomeDir = 0x01;
}
@ -1179,7 +1388,7 @@ namespace AgroBase.Services
}
//Velocidade de retorno à origem
SpeedText = Convert.ToUInt16(_VelocidadeRetornoOrigem, 10);
SpeedText = Convert.ToUInt16(_Velocidade[Addr], 10);
Speed_1 = BitConverter.GetBytes(SpeedText);
if (FV1[2] == 0x03)
@ -1383,17 +1592,17 @@ namespace AgroBase.Services
}
//Direção de retorno à origem
if (_SentidoRetornoOrigem == Sentido.Antihorario)
if (_Sentido[Addr] == Sentido.Antihorario)
{
Dir_0 = 0x00;
}
else if (_SentidoRetornoOrigem == Sentido.Horario)
else if (_Sentido[Addr] == Sentido.Horario)
{
Dir_0 = 0x01;
}
//Velocidade de retorno à origem
Speed_0 = Convert.ToByte(_VelocidadeRetornoOrigem, 10);
Speed_0 = Convert.ToByte(_Velocidade[Addr], 10);
tCHK = 0xFA + Addr + data + Mode_0 + Set_0 + Speed_0 + Dir_0;
Buffer = new byte[] { 0xFA, Addr, (byte)data, Mode_0, Set_0, Speed_0, Dir_0, (byte)tCHK };
@ -1406,6 +1615,13 @@ namespace AgroBase.Services
}
}
if (DataSended == 91) //(91 Go Home)
{
tCHK = 0xFA + Addr + data;
Buffer = new byte[] { 0xFA, Addr, (byte)data, (byte)tCHK };
WriteByteToSerialPort(Buffer, 0, 4);
}
}
else
MessageBox.Show("Endereço selecionado é inválido");
@ -1416,6 +1632,13 @@ namespace AgroBase.Services
rxDisplay(); //计算rCHK
byte addr = SerialBuffer_RX[1];
if (!EnderecoValido(addr))
{
RegisrarErrosComunicacao(addr, "Dados recebidos de um endereço inválido: [" + string.Join(" ", SerialBuffer_RX) + "]");
return;
}
MKS057DModel leitura = DadosLeitura.FirstOrDefault(x => x.Endereco == addr);
if (leitura == null)
{
@ -1982,7 +2205,8 @@ namespace AgroBase.Services
case 0x40:// 43 Informação de Versão
try
{
leitura.HV = HardVersion[SerialBuffer_RX[3]];
int idx = SerialBuffer_RX[3] < 9 ? SerialBuffer_RX[3] : 22 - SerialBuffer_RX[3];
leitura.HV = HardVersion[idx];
leitura.FV = "V" + SerialBuffer_RX[4] + "." + SerialBuffer_RX[5] + "." + SerialBuffer_RX[6];
for (int a = 0; a < 3; a++)
{
@ -2015,31 +2239,26 @@ namespace AgroBase.Services
}
break;
/*case 0x34:// 46 Estado do Portão IO
GB5_textBox_IN1.Clear();
GB5_textBox_IN2.Clear();
GB5_textBox_OUT1.Clear();
GB5_textBox_OUT2.Clear();
case 0x34:// 46 Estado do Portão IO
leitura.Entradas = new List<bool>() { false, false };
leitura.Saidas = new List<bool>() { false, false };
byte[] IO = new byte[1];
IO[0] = SerialBuffer_RX[3];
BitArray LimitIO = new BitArray(IO);
if (HV == HardVersion[3] || HV == HardVersion[4])
if (leitura.HV == HardVersion[3] || leitura.HV == HardVersion[4])
{
GB5_textBox_IN1.AppendText(LimitIO.Get(0) ? "H" : "L");
GB5_textBox_IN2.AppendText(LimitIO.Get(1) ? "H" : "L");
GB5_textBox_OUT1.AppendText(LimitIO.Get(2) ? "H" : "L");
GB5_textBox_OUT2.AppendText(LimitIO.Get(3) ? "H" : "L");
leitura.Entradas[0] = LimitIO.Get(0) ? false : true;
leitura.Entradas[1] = LimitIO.Get(1) ? false : true;
leitura.Saidas[0] = LimitIO.Get(2) ? false : true;
leitura.Saidas[1] = LimitIO.Get(3) ? false : true;
}
else if (HV == HardVersion[1] || HV == HardVersion[2])
else if (leitura.HV == HardVersion[1] || leitura.HV == HardVersion[2])
{
GB5_textBox_IN1.AppendText(LimitIO.Get(0) ? "H" : "L");
GB5_textBox_IN2.AppendText("NC");
GB5_textBox_OUT1.AppendText("NC");
GB5_textBox_OUT2.AppendText("NC");
leitura.Entradas[0] = LimitIO.Get(0) ? false : true;
}
break;*/
break;
default:
MessageBox.Show("Erro ao decodificar resposta");

View File

@ -548,7 +548,7 @@ namespace AgroBase.Services
return false;
}
if (!MKS057DService.Iniciado || MKS057DService.DadosLeitura.Any(x => !x.Iniciado))
if (!MKS057DService.Referenciando && (!MKS057DService.Iniciado || MKS057DService.DadosLeitura.Any(x => !x.Iniciado)))
{
AtualizarConsole("Procurando dispositivos MKS");
bool Encontrado = await MKS057DService.VerificaPortaMKS(porta);

View File

@ -8773,3 +8773,393 @@
01/08/2024 16:48:43:886 - Porta COM3 - 4: Resposta inválida ou código de função incorreto. 02-E1-49-FD-94-84-04-E2-A0-FF
01/08/2024 16:48:44:389 - Porta COM3 - 2: Resposta inválida. 01-FF
01/08/2024 16:48:44:390 - Porta COM3 - 2: Timeout ao receber resposta. GET=False, Parametro=Direction, Valor=1
16/08/2024 13:53:23:621 - Porta COM29 - 1: Resposta inválida.
16/08/2024 13:53:24:665 - Porta COM29 - 3: Resposta inválida.
16/08/2024 13:53:25:724 - Porta COM29 - 2: Resposta inválida.
16/08/2024 13:53:26:774 - Porta COM29 - 4: Resposta inválida.
16/08/2024 13:53:38:550 - Porta COM29 - 1: Resposta inválida.
16/08/2024 13:53:39:581 - Porta COM29 - 3: Resposta inválida.
16/08/2024 13:53:40:614 - Porta COM29 - 2: Resposta inválida.
16/08/2024 13:53:41:674 - Porta COM29 - 4: Resposta inválida.
16/08/2024 13:53:53:593 - Porta COM29 - 1: Resposta inválida.
16/08/2024 13:53:54:649 - Porta COM29 - 3: Resposta inválida.
16/08/2024 13:53:55:663 - Porta COM29 - 2: Resposta inválida.
16/08/2024 13:53:56:682 - Porta COM29 - 4: Resposta inválida.
16/08/2024 13:54:08:597 - Porta COM29 - 1: Resposta inválida.
16/08/2024 13:54:09:599 - Porta COM29 - 3: Resposta inválida.
16/08/2024 13:54:10:635 - Porta COM29 - 2: Resposta inválida.
16/08/2024 13:54:11:648 - Porta COM29 - 4: Resposta inválida.
16/08/2024 13:54:23:547 - Porta COM29 - 1: Resposta inválida.
16/08/2024 13:54:24:608 - Porta COM29 - 3: Resposta inválida.
16/08/2024 13:54:25:642 - Porta COM29 - 2: Resposta inválida.
16/08/2024 13:54:26:644 - Porta COM29 - 4: Resposta inválida.
16/08/2024 13:54:38:569 - Porta COM29 - 1: Resposta inválida.
16/08/2024 13:54:39:631 - Porta COM29 - 3: Resposta inválida.
16/08/2024 13:54:40:691 - Porta COM29 - 2: Resposta inválida.
16/08/2024 13:54:41:752 - Porta COM29 - 4: Resposta inválida.
16/08/2024 13:54:53:556 - Porta COM29 - 1: Resposta inválida.
16/08/2024 13:54:54:570 - Porta COM29 - 3: Resposta inválida.
16/08/2024 13:54:55:630 - Porta COM29 - 2: Resposta inválida.
16/08/2024 13:54:56:692 - Porta COM29 - 4: Resposta inválida.
16/08/2024 13:55:08:505 - Porta COM29 - 1: Resposta inválida.
16/08/2024 13:55:09:562 - Porta COM29 - 3: Resposta inválida.
16/08/2024 13:55:10:596 - Porta COM29 - 2: Resposta inválida.
16/08/2024 13:55:11:655 - Porta COM29 - 4: Resposta inválida.
16/08/2024 13:55:23:586 - Porta COM29 - 1: Resposta inválida.
16/08/2024 13:55:24:617 - Porta COM29 - 3: Resposta inválida.
16/08/2024 13:55:25:678 - Porta COM29 - 2: Resposta inválida.
16/08/2024 13:55:26:695 - Porta COM29 - 4: Resposta inválida.
16/08/2024 13:55:38:586 - Porta COM29 - 1: Resposta inválida.
16/08/2024 13:55:39:644 - Porta COM29 - 3: Resposta inválida.
16/08/2024 13:55:40:683 - Porta COM29 - 2: Resposta inválida.
16/08/2024 13:55:41:744 - Porta COM29 - 4: Resposta inválida.
16/08/2024 13:55:53:607 - Porta COM29 - 1: Resposta inválida.
16/08/2024 13:55:54:665 - Porta COM29 - 3: Resposta inválida.
16/08/2024 13:55:55:691 - Porta COM29 - 2: Resposta inválida.
16/08/2024 13:55:56:752 - Porta COM29 - 4: Resposta inválida.
16/08/2024 13:58:23:425 - Porta COM29 - 1: Resposta inválida.
16/08/2024 13:58:24:480 - Porta COM29 - 3: Resposta inválida.
16/08/2024 13:58:25:519 - Porta COM29 - 2: Resposta inválida.
16/08/2024 13:58:26:525 - Porta COM29 - 4: Resposta inválida.
16/08/2024 13:59:28:676 - Porta COM29 - 1: Resposta inválida.
16/08/2024 13:59:29:724 - Porta COM29 - 3: Resposta inválida.
16/08/2024 13:59:30:768 - Porta COM29 - 2: Resposta inválida.
16/08/2024 13:59:31:824 - Porta COM29 - 4: Resposta inválida.
16/08/2024 14:01:22:136 - Porta COM29 - 1: Resposta inválida.
16/08/2024 14:01:23:148 - Porta COM29 - 3: Resposta inválida.
16/08/2024 14:01:24:184 - Porta COM29 - 2: Resposta inválida.
16/08/2024 14:01:25:187 - Porta COM29 - 4: Resposta inválida.
16/08/2024 14:04:06:788 - Porta COM29 - 1: Resposta inválida.
16/08/2024 14:04:07:844 - Porta COM29 - 3: Resposta inválida.
16/08/2024 14:04:08:907 - Porta COM29 - 2: Resposta inválida.
16/08/2024 14:04:09:963 - Porta COM29 - 4: Resposta inválida.
16/08/2024 14:10:23:011 - Porta COM29 - 1: Resposta inválida.
16/08/2024 14:10:24:073 - Porta COM29 - 3: Resposta inválida.
16/08/2024 14:10:25:087 - Porta COM29 - 2: Resposta inválida.
16/08/2024 14:10:26:147 - Porta COM29 - 4: Resposta inválida.
16/08/2024 14:26:49:374 - Porta COM29 - 1: Resposta inválida.
16/08/2024 14:26:50:411 - Porta COM29 - 3: Resposta inválida.
16/08/2024 14:26:51:437 - Porta COM29 - 2: Resposta inválida.
16/08/2024 14:26:52:469 - Porta COM29 - 4: Resposta inválida.
16/08/2024 14:30:27:587 - Porta COM29 - 1: Resposta inválida.
16/08/2024 14:30:28:641 - Porta COM29 - 3: Resposta inválida.
16/08/2024 14:30:29:650 - Porta COM29 - 2: Resposta inválida.
16/08/2024 14:30:30:681 - Porta COM29 - 4: Resposta inválida.
16/08/2024 14:35:29:764 - Porta COM29 - 1: Resposta inválida.
16/08/2024 14:35:30:789 - Porta COM29 - 3: Resposta inválida.
16/08/2024 14:35:31:836 - Porta COM29 - 2: Resposta inválida.
16/08/2024 14:35:32:865 - Porta COM29 - 4: Resposta inválida.
16/08/2024 14:49:32:984 - Porta COM29 - 1: Resposta inválida.
16/08/2024 14:49:34:018 - Porta COM29 - 3: Resposta inválida.
16/08/2024 14:49:35:075 - Porta COM29 - 2: Resposta inválida.
16/08/2024 14:49:36:102 - Porta COM29 - 4: Resposta inválida.
16/08/2024 14:55:39:500 - Porta COM29 - 1: Resposta inválida.
16/08/2024 14:55:40:511 - Porta COM29 - 3: Resposta inválida.
16/08/2024 14:55:41:571 - Porta COM29 - 2: Resposta inválida.
16/08/2024 14:55:42:600 - Porta COM29 - 4: Resposta inválida.
16/08/2024 16:34:56:370 - Porta COM29 - 1: Resposta inválida.
16/08/2024 16:34:57:430 - Porta COM29 - 3: Resposta inválida.
16/08/2024 16:34:58:492 - Porta COM29 - 2: Resposta inválida.
16/08/2024 16:34:59:509 - Porta COM29 - 4: Resposta inválida.
16/08/2024 16:56:45:798 - Porta COM29 - 1: Resposta inválida.
16/08/2024 16:56:46:804 - Porta COM29 - 3: Resposta inválida.
16/08/2024 16:56:47:820 - Porta COM29 - 2: Resposta inválida.
16/08/2024 16:56:48:882 - Porta COM29 - 4: Resposta inválida.
16/08/2024 17:00:04:631 - Porta COM29 - 1: Resposta inválida.
16/08/2024 17:00:05:675 - Porta COM29 - 3: Resposta inválida.
16/08/2024 17:00:06:723 - Porta COM29 - 2: Resposta inválida.
16/08/2024 17:00:07:725 - Porta COM29 - 4: Resposta inválida.
19/08/2024 08:58:12:112 - Porta COM29 - 1: Resposta inválida.
19/08/2024 08:58:13:121 - Porta COM29 - 3: Resposta inválida.
19/08/2024 08:58:14:149 - Porta COM29 - 2: Resposta inválida.
19/08/2024 08:58:15:163 - Porta COM29 - 4: Resposta inválida.
19/08/2024 09:12:29:522 - Porta COM29 - 1: Resposta inválida.
19/08/2024 09:12:30:529 - Porta COM29 - 3: Resposta inválida.
19/08/2024 09:12:31:545 - Porta COM29 - 2: Resposta inválida.
19/08/2024 09:12:32:575 - Porta COM29 - 4: Resposta inválida.
19/08/2024 13:51:57:021 - Porta COM29 - 1: Resposta inválida.
19/08/2024 13:51:58:081 - Porta COM29 - 3: Resposta inválida.
19/08/2024 13:51:59:091 - Porta COM29 - 2: Resposta inválida.
19/08/2024 13:52:00:117 - Porta COM29 - 4: Resposta inválida.
19/08/2024 14:09:20:841 - Porta COM29 - 1: Resposta inválida.
19/08/2024 14:09:21:931 - Porta COM29 - 3: Resposta inválida.
19/08/2024 14:09:22:935 - Porta COM29 - 2: Resposta inválida.
19/08/2024 14:09:23:969 - Porta COM29 - 4: Resposta inválida.
19/08/2024 14:21:12:899 - Porta COM29 - 1: Resposta inválida.
19/08/2024 14:21:13:967 - Porta COM29 - 3: Resposta inválida.
19/08/2024 14:21:14:971 - Porta COM29 - 2: Resposta inválida.
19/08/2024 14:21:15:991 - Porta COM29 - 4: Resposta inválida.
19/08/2024 14:27:14:539 - Porta COM29 - 1: Resposta inválida.
19/08/2024 14:27:15:606 - Porta COM29 - 3: Resposta inválida.
19/08/2024 14:27:16:608 - Porta COM29 - 2: Resposta inválida.
19/08/2024 14:27:17:613 - Porta COM29 - 4: Resposta inválida.
19/08/2024 14:28:37:764 - Porta COM29 - 1: Resposta inválida.
19/08/2024 14:28:38:791 - Porta COM29 - 3: Resposta inválida.
19/08/2024 14:28:39:814 - Porta COM29 - 2: Resposta inválida.
19/08/2024 14:28:40:851 - Porta COM29 - 4: Resposta inválida.
19/08/2024 14:43:37:156 - Porta COM29 - 1: Resposta inválida.
19/08/2024 14:43:38:217 - Porta COM29 - 3: Resposta inválida.
19/08/2024 14:43:39:223 - Porta COM29 - 2: Resposta inválida.
19/08/2024 14:43:40:242 - Porta COM29 - 4: Resposta inválida.
19/08/2024 14:46:04:922 - Porta COM29 - 1: Resposta inválida.
19/08/2024 14:46:05:982 - Porta COM29 - 3: Resposta inválida.
19/08/2024 14:46:06:986 - Porta COM29 - 2: Resposta inválida.
19/08/2024 14:46:08:025 - Porta COM29 - 4: Resposta inválida.
19/08/2024 14:47:53:732 - Porta COM29 - 1: Resposta inválida.
19/08/2024 14:47:54:739 - Porta COM29 - 3: Resposta inválida.
19/08/2024 14:47:55:779 - Porta COM29 - 2: Resposta inválida.
19/08/2024 14:47:56:798 - Porta COM29 - 4: Resposta inválida.
19/08/2024 14:49:02:220 - Porta COM29 - 1: Resposta inválida.
19/08/2024 14:49:03:226 - Porta COM29 - 3: Resposta inválida.
19/08/2024 14:49:04:247 - Porta COM29 - 2: Resposta inválida.
19/08/2024 14:49:05:280 - Porta COM29 - 4: Resposta inválida.
19/08/2024 14:58:29:147 - Porta COM29 - 1: Resposta inválida.
19/08/2024 14:58:30:158 - Porta COM29 - 3: Resposta inválida.
19/08/2024 14:58:31:181 - Porta COM29 - 2: Resposta inválida.
19/08/2024 14:58:32:187 - Porta COM29 - 4: Resposta inválida.
19/08/2024 15:01:58:418 - Porta COM29 - 1: Resposta inválida.
19/08/2024 15:01:59:423 - Porta COM29 - 3: Resposta inválida.
19/08/2024 15:02:00:440 - Porta COM29 - 2: Resposta inválida.
19/08/2024 15:02:01:480 - Porta COM29 - 4: Resposta inválida.
19/08/2024 15:18:39:883 - Porta COM29 - 1: Resposta inválida.
19/08/2024 15:18:40:914 - Porta COM29 - 3: Resposta inválida.
19/08/2024 15:18:41:938 - Porta COM29 - 2: Resposta inválida.
19/08/2024 15:18:42:963 - Porta COM29 - 4: Resposta inválida.
19/08/2024 15:21:21:386 - Porta COM29 - 1: Resposta inválida.
19/08/2024 15:21:22:450 - Porta COM29 - 3: Resposta inválida.
19/08/2024 15:21:23:459 - Porta COM29 - 2: Resposta inválida.
19/08/2024 15:21:24:508 - Porta COM29 - 4: Resposta inválida.
19/08/2024 15:22:29:946 - Porta COM29 - 1: Resposta inválida.
19/08/2024 15:22:30:950 - Porta COM29 - 3: Resposta inválida.
19/08/2024 15:22:31:958 - Porta COM29 - 2: Resposta inválida.
19/08/2024 15:22:32:964 - Porta COM29 - 4: Resposta inválida.
19/08/2024 15:23:58:266 - Porta COM29 - 1: Resposta inválida.
19/08/2024 15:23:59:283 - Porta COM29 - 3: Resposta inválida.
19/08/2024 15:24:00:292 - Porta COM29 - 2: Resposta inválida.
19/08/2024 15:24:01:328 - Porta COM29 - 4: Resposta inválida.
19/08/2024 15:26:55:503 - Porta COM29 - 1: Resposta inválida.
19/08/2024 15:26:56:564 - Porta COM29 - 3: Resposta inválida.
19/08/2024 15:26:57:571 - Porta COM29 - 2: Resposta inválida.
19/08/2024 15:26:58:579 - Porta COM29 - 4: Resposta inválida.
19/08/2024 15:39:32:272 - Porta COM29 - 1: Resposta inválida.
19/08/2024 15:39:33:334 - Porta COM29 - 3: Resposta inválida.
19/08/2024 15:39:34:341 - Porta COM29 - 2: Resposta inválida.
19/08/2024 15:39:35:375 - Porta COM29 - 4: Resposta inválida.
19/08/2024 15:43:09:600 - Porta COM29 - 1: Resposta inválida.
19/08/2024 15:43:10:657 - Porta COM29 - 3: Resposta inválida.
19/08/2024 15:43:11:664 - Porta COM29 - 2: Resposta inválida.
19/08/2024 15:43:12:670 - Porta COM29 - 4: Resposta inválida.
19/08/2024 16:02:11:194 - Porta COM29 - 1: Resposta inválida.
19/08/2024 16:02:12:227 - Porta COM29 - 3: Resposta inválida.
19/08/2024 16:02:13:288 - Porta COM29 - 2: Resposta inválida.
19/08/2024 16:02:14:333 - Porta COM29 - 4: Resposta inválida.
19/08/2024 16:37:04:931 - Porta COM29 - 1: Resposta inválida.
19/08/2024 16:37:05:998 - Porta COM29 - 3: Resposta inválida.
19/08/2024 16:37:07:001 - Porta COM29 - 2: Resposta inválida.
19/08/2024 16:37:08:042 - Porta COM29 - 4: Resposta inválida.
19/08/2024 16:41:17:190 - Porta COM29 - 1: Resposta inválida.
19/08/2024 16:41:18:226 - Porta COM29 - 3: Resposta inválida.
19/08/2024 16:41:19:250 - Porta COM29 - 2: Resposta inválida.
19/08/2024 16:41:20:257 - Porta COM29 - 4: Resposta inválida.
19/08/2024 17:03:37:409 - Porta COM29 - 1: Resposta inválida.
19/08/2024 17:03:38:417 - Porta COM29 - 3: Resposta inválida.
19/08/2024 17:03:39:432 - Porta COM29 - 2: Resposta inválida.
19/08/2024 17:03:40:436 - Porta COM29 - 4: Resposta inválida.
19/08/2024 17:06:30:383 - Porta COM29 - 1: Resposta inválida.
19/08/2024 17:06:31:466 - Porta COM29 - 3: Resposta inválida.
19/08/2024 17:06:32:528 - Porta COM29 - 2: Resposta inválida.
19/08/2024 17:06:33:571 - Porta COM29 - 4: Resposta inválida.
19/08/2024 17:18:12:094 - Porta COM29 - 1: Resposta inválida.
19/08/2024 17:18:13:155 - Porta COM29 - 3: Resposta inválida.
19/08/2024 17:18:14:219 - Porta COM29 - 2: Resposta inválida.
19/08/2024 17:18:15:275 - Porta COM29 - 4: Resposta inválida.
20/08/2024 07:17:04:339 - Porta COM29 - 1: Resposta inválida.
20/08/2024 07:17:05:394 - Porta COM29 - 3: Resposta inválida.
20/08/2024 07:17:06:439 - Porta COM29 - 2: Resposta inválida.
20/08/2024 07:17:07:456 - Porta COM29 - 4: Resposta inválida.
20/08/2024 07:36:37:214 - Porta COM29 - 1: Resposta inválida.
20/08/2024 07:36:38:268 - Porta COM29 - 3: Resposta inválida.
20/08/2024 07:36:39:331 - Porta COM29 - 2: Resposta inválida.
20/08/2024 07:36:40:334 - Porta COM29 - 4: Resposta inválida.
20/08/2024 07:53:33:735 - Porta COM29 - 1: Resposta inválida.
20/08/2024 07:53:34:737 - Porta COM29 - 3: Resposta inválida.
20/08/2024 07:53:35:749 - Porta COM29 - 2: Resposta inválida.
20/08/2024 07:53:36:753 - Porta COM29 - 4: Resposta inválida.
20/08/2024 08:14:14:852 - Porta COM29 - 1: Resposta inválida.
20/08/2024 08:14:15:888 - Porta COM29 - 3: Resposta inválida.
20/08/2024 08:14:16:898 - Porta COM29 - 2: Resposta inválida.
20/08/2024 08:14:17:918 - Porta COM29 - 4: Resposta inválida.
20/08/2024 08:30:33:642 - Porta COM29 - 1: Resposta inválida.
20/08/2024 08:30:34:661 - Porta COM29 - 3: Resposta inválida.
20/08/2024 08:30:35:667 - Porta COM29 - 2: Resposta inválida.
20/08/2024 08:30:36:688 - Porta COM29 - 4: Resposta inválida.
20/08/2024 09:22:03:209 - Porta COM3 - 1: Resposta inválida ou código de função incorreto. 52-01-FE-91-FD-FA-F8-F2-FF
20/08/2024 09:22:04:268 - Porta COM3 - 3: Resposta inválida ou código de função incorreto. 01-01-01-F8
20/08/2024 09:22:05:247 - Porta COM3 - 2: Resposta inválida ou código de função incorreto. 51-41-24-FE-C9-FD-A9
20/08/2024 09:22:06:004 - Porta COM3 - 4: Resposta inválida ou código de função incorreto. A5-FF-A9-A4-FE-02-81-FE
20/08/2024 09:22:06:587 - Porta COM3 - 2: Resposta inválida. 11-FF-29
20/08/2024 09:22:06:589 - Porta COM3 - 2: Timeout ao receber resposta. GET=False, Parametro=Direction, Valor=1
20/08/2024 09:22:06:838 - Porta COM3 - 1: Resposta inválida ou código de função incorreto. D5-41-FF-01-FF-B1
20/08/2024 09:22:07:090 - Porta COM3 - 1: Resposta inválida.
20/08/2024 09:22:07:092 - Porta COM3 - 1: Timeout ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
20/08/2024 09:22:07:343 - Porta COM3 - 1: Resposta inválida.
20/08/2024 09:22:07:343 - Porta COM3 - 1: Timeout ao receber resposta. GET=False, Parametro=NumPolos, Valor=16
20/08/2024 09:22:07:595 - Porta COM3 - 1: Resposta inválida ou código de função incorreto. 0A-42-FF-81-81-FF
20/08/2024 09:22:07:844 - Porta COM3 - 1: Resposta inválida.
20/08/2024 09:22:07:845 - Porta COM3 - 1: Timeout ao receber resposta. GET=False, Parametro=Rampa, Valor=0
20/08/2024 09:22:08:096 - Porta COM3 - 1: Resposta inválida. 49-FD
20/08/2024 09:22:08:097 - Porta COM3 - 1: Timeout ao receber resposta. GET=False, Parametro=Enabled, Valor=0
20/08/2024 09:22:08:348 - Porta COM3 - 3: Resposta inválida. 91-E9-65
20/08/2024 09:22:08:349 - Porta COM3 - 3: Timeout ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
20/08/2024 09:22:08:600 - Porta COM3 - 3: Resposta inválida.
20/08/2024 09:22:08:601 - Porta COM3 - 3: Timeout ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
20/08/2024 09:22:08:804 - Porta COM3 - 3: Resposta inválida. C0
20/08/2024 09:22:08:804 - Porta COM3 - 3: Timeout ao receber resposta. GET=False, Parametro=NumPolos, Valor=16
20/08/2024 09:22:09:053 - Porta COM3 - 3: Resposta inválida ou código de função incorreto. 4B-FA-C2-D1
20/08/2024 09:22:09:290 - Porta COM3 - 3: Resposta inválida.
20/08/2024 09:22:09:291 - Porta COM3 - 3: Timeout ao receber resposta. GET=False, Parametro=Rampa, Valor=0
20/08/2024 09:22:09:544 - Porta COM3 - 3: Resposta inválida. 80
20/08/2024 09:22:09:545 - Porta COM3 - 3: Timeout ao receber resposta. GET=False, Parametro=Enabled, Valor=0
20/08/2024 09:22:09:793 - Porta COM3 - 2: Resposta inválida ou código de função incorreto. 81-A9-42-FF
20/08/2024 09:22:10:044 - Porta COM3 - 2: Resposta inválida.
20/08/2024 09:22:10:044 - Porta COM3 - 2: Timeout ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
20/08/2024 09:22:10:293 - Porta COM3 - 2: Resposta inválida. A9-E5
20/08/2024 09:22:10:293 - Porta COM3 - 2: Timeout ao receber resposta. GET=False, Parametro=NumPolos, Valor=16
20/08/2024 09:22:10:543 - Porta COM3 - 2: Resposta inválida ou código de função incorreto. A5-FF-02-FF
20/08/2024 09:22:10:792 - Porta COM3 - 2: Resposta inválida.
20/08/2024 09:22:10:794 - Porta COM3 - 2: Timeout ao receber resposta. GET=False, Parametro=Rampa, Valor=0
20/08/2024 09:22:11:042 - Porta COM3 - 2: Resposta inválida ou código de função incorreto. D5-82-FE-01-FF
20/08/2024 09:22:11:292 - Porta COM3 - 4: Resposta inválida. 81-FF
20/08/2024 09:22:11:293 - Porta COM3 - 4: Timeout ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
20/08/2024 09:22:11:542 - Porta COM3 - 4: Resposta inválida.
20/08/2024 09:22:11:542 - Porta COM3 - 4: Timeout ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
20/08/2024 09:22:11:793 - Porta COM3 - 4: Resposta inválida ou código de função incorreto. A9-D5-49-FC-A9
20/08/2024 09:22:12:045 - Porta COM3 - 4: Resposta inválida.
20/08/2024 09:22:12:047 - Porta COM3 - 4: Timeout ao receber resposta. GET=False, Parametro=RPM_Max, Valor=600
20/08/2024 09:22:12:297 - Porta COM3 - 4: Resposta inválida.
20/08/2024 09:22:12:298 - Porta COM3 - 4: Timeout ao receber resposta. GET=False, Parametro=Rampa, Valor=0
20/08/2024 09:22:12:532 - Porta COM3 - 4: Resposta inválida ou código de função incorreto. C0-89-FF-A9-A1
20/08/2024 09:22:13:036 - Porta COM3 - 2: Resposta inválida.
20/08/2024 09:22:13:036 - Porta COM3 - 2: Timeout ao receber resposta. GET=False, Parametro=Direction, Valor=1
20/08/2024 09:22:13:222 - Porta COM3 - 4: Resposta inválida ou código de função incorreto. 49-FC-80-01-FF-A5-FF
20/08/2024 09:22:13:725 - Porta COM3 - 2: Resposta inválida.
20/08/2024 09:22:13:726 - Porta COM3 - 2: Timeout ao receber resposta. GET=False, Parametro=Direction, Valor=1
20/08/2024 09:22:13:975 - Porta COM3 - 1: Resposta inválida ou código de função incorreto. 82-65-D1-01-FF
20/08/2024 09:22:14:228 - Porta COM3 - 1: Resposta inválida.
20/08/2024 09:22:14:229 - Porta COM3 - 1: Timeout ao receber resposta. GET=False, Parametro=NumPolos, Valor=16
20/08/2024 09:22:14:479 - Porta COM3 - 1: Resposta inválida.
20/08/2024 09:22:14:480 - Porta COM3 - 1: Timeout ao receber resposta. GET=False, Parametro=Rampa, Valor=0
20/08/2024 09:22:14:730 - Porta COM3 - 1: Resposta inválida ou código de função incorreto. E9-A5-FF-02-C9-FF
20/08/2024 09:22:14:983 - Porta COM3 - 3: Resposta inválida.
20/08/2024 09:22:14:984 - Porta COM3 - 3: Timeout ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
20/08/2024 09:22:15:234 - Porta COM3 - 3: Resposta inválida. 02
20/08/2024 09:22:15:234 - Porta COM3 - 3: Timeout ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
20/08/2024 09:22:15:487 - Porta COM3 - 3: Resposta inválida ou código de função incorreto. E5-FF-01-FF-40
20/08/2024 09:22:15:738 - Porta COM3 - 3: Resposta inválida.
20/08/2024 09:22:15:738 - Porta COM3 - 3: Timeout ao receber resposta. GET=False, Parametro=Rampa, Valor=0
20/08/2024 09:22:15:991 - Porta COM3 - 3: Resposta inválida. 24-FE
20/08/2024 09:22:15:991 - Porta COM3 - 3: Timeout ao receber resposta. GET=False, Parametro=Enabled, Valor=0
20/08/2024 09:22:16:237 - Porta COM3 - 2: Resposta inválida ou código de função incorreto. 22-A9-04-FE
20/08/2024 09:22:16:489 - Porta COM3 - 2: Resposta inválida.
20/08/2024 09:22:16:490 - Porta COM3 - 2: Timeout ao receber resposta. GET=False, Parametro=NumPolos, Valor=16
20/08/2024 09:22:16:723 - Porta COM3 - 2: Resposta inválida. 81-89
20/08/2024 09:22:16:724 - Porta COM3 - 2: Timeout ao receber resposta. GET=False, Parametro=Rampa, Valor=0
20/08/2024 09:22:16:975 - Porta COM3 - 4: Resposta inválida. A5-FF-C1
20/08/2024 09:22:16:975 - Porta COM3 - 4: Timeout ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
20/08/2024 09:22:17:211 - Porta COM3 - 4: Resposta inválida.
20/08/2024 09:22:17:211 - Porta COM3 - 4: Timeout ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
20/08/2024 09:22:17:459 - Porta COM3 - 4: Resposta inválida ou código de função incorreto. 81-49-FA-81
20/08/2024 09:22:17:711 - Porta COM3 - 4: Resposta inválida. 81-FF
20/08/2024 09:22:17:711 - Porta COM3 - 4: Timeout ao receber resposta. GET=False, Parametro=Rampa, Valor=0
20/08/2024 09:22:18:274 - Porta COM3 - 4: Resposta inválida ou código de função incorreto. E9-49-FF-D1-A1
20/08/2024 09:22:18:777 - Porta COM3 - 2: Resposta inválida.
20/08/2024 09:22:18:777 - Porta COM3 - 2: Timeout ao receber resposta. GET=False, Parametro=Direction, Valor=1
20/08/2024 09:22:19:278 - Porta COM3 - 2: Resposta inválida ou código de função incorreto. E9-D5-80-00-FF
20/08/2024 09:22:19:515 - Porta COM3 - 1: Resposta inválida. C0
20/08/2024 09:22:19:517 - Porta COM3 - 1: Timeout ao receber resposta. GET=False, Parametro=NumPolos, Valor=16
20/08/2024 09:22:19:766 - Porta COM3 - 1: Resposta inválida. E1-C0-B0
20/08/2024 09:22:19:766 - Porta COM3 - 1: Timeout ao receber resposta. GET=False, Parametro=Rampa, Valor=0
20/08/2024 09:22:20:017 - Porta COM3 - 3: Resposta inválida.
20/08/2024 09:22:20:017 - Porta COM3 - 3: Timeout ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
20/08/2024 09:22:20:267 - Porta COM3 - 3: Resposta inválida. 01
20/08/2024 09:22:20:267 - Porta COM3 - 3: Timeout ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
20/08/2024 09:22:20:518 - Porta COM3 - 3: Resposta inválida ou código de função incorreto. 49-FF-A1-29
20/08/2024 09:22:20:768 - Porta COM3 - 3: Resposta inválida.
20/08/2024 09:22:20:768 - Porta COM3 - 3: Timeout ao receber resposta. GET=False, Parametro=Enabled, Valor=0
20/08/2024 09:22:21:017 - Porta COM3 - 2: Resposta inválida. 49-FC-42
20/08/2024 09:22:21:018 - Porta COM3 - 2: Timeout ao receber resposta. GET=False, Parametro=NumPolos, Valor=16
20/08/2024 09:22:21:267 - Porta COM3 - 2: Resposta inválida. E9-29
20/08/2024 09:22:21:267 - Porta COM3 - 2: Timeout ao receber resposta. GET=False, Parametro=Rampa, Valor=0
20/08/2024 09:22:21:516 - Porta COM3 - 4: Resposta inválida.
20/08/2024 09:22:21:516 - Porta COM3 - 4: Timeout ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
20/08/2024 09:22:21:767 - Porta COM3 - 4: Resposta inválida ou código de função incorreto. 49-FC-02-FF-C0-80-FF
20/08/2024 09:22:22:017 - Porta COM3 - 4: Resposta inválida.
20/08/2024 09:22:22:018 - Porta COM3 - 4: Timeout ao receber resposta. GET=False, Parametro=Rampa, Valor=0
20/08/2024 09:22:22:523 - Porta COM3 - 4: Resposta inválida ou código de função incorreto. 02-41-FF-0A-B1
20/08/2024 09:22:23:025 - Porta COM3 - 2: Resposta inválida.
20/08/2024 09:22:23:026 - Porta COM3 - 2: Timeout ao receber resposta. GET=False, Parametro=Direction, Valor=1
20/08/2024 09:22:23:276 - Porta COM3 - 1: Resposta inválida ou código de função incorreto. C0-09-01-CB-FC
20/08/2024 09:22:23:526 - Porta COM3 - 1: Resposta inválida.
20/08/2024 09:22:23:527 - Porta COM3 - 1: Timeout ao receber resposta. GET=False, Parametro=Rampa, Valor=0
20/08/2024 09:22:23:777 - Porta COM3 - 3: Resposta inválida.
20/08/2024 09:22:23:778 - Porta COM3 - 3: Timeout ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
20/08/2024 09:22:24:027 - Porta COM3 - 3: Resposta inválida ou código de função incorreto. A1-02-FF-51-71
20/08/2024 09:22:24:278 - Porta COM3 - 3: Resposta inválida.
20/08/2024 09:22:24:279 - Porta COM3 - 3: Timeout ao receber resposta. GET=False, Parametro=Enabled, Valor=0
20/08/2024 09:22:24:530 - Porta COM3 - 2: Resposta inválida. C0
20/08/2024 09:22:24:531 - Porta COM3 - 2: Timeout ao receber resposta. GET=False, Parametro=NumPolos, Valor=16
20/08/2024 09:22:24:777 - Porta COM3 - 2: Resposta inválida. 82-C0-09
20/08/2024 09:22:24:778 - Porta COM3 - 2: Timeout ao receber resposta. GET=False, Parametro=Rampa, Valor=0
20/08/2024 09:22:25:026 - Porta COM3 - 4: Resposta inválida.
20/08/2024 09:22:25:026 - Porta COM3 - 4: Timeout ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
20/08/2024 09:22:25:277 - Porta COM3 - 4: Resposta inválida. 25-FE
20/08/2024 09:22:25:277 - Porta COM3 - 4: Timeout ao receber resposta. GET=False, Parametro=Rampa, Valor=0
20/08/2024 09:22:25:839 - Porta COM3 - 2: Resposta inválida ou código de função incorreto. 24-FF-A9-A5-FF
20/08/2024 12:23:05:063 - Porta COM29 - 1: Resposta inválida.
20/08/2024 12:23:06:082 - Porta COM29 - 3: Resposta inválida.
20/08/2024 12:23:07:100 - Porta COM29 - 2: Resposta inválida.
20/08/2024 12:23:08:120 - Porta COM29 - 4: Resposta inválida.
20/08/2024 12:34:00:496 - Porta COM29 - 1: Resposta inválida.
20/08/2024 12:34:01:554 - Porta COM29 - 3: Resposta inválida.
20/08/2024 12:34:02:608 - Porta COM29 - 2: Resposta inválida.
20/08/2024 12:34:03:644 - Porta COM29 - 4: Resposta inválida.
20/08/2024 12:56:37:437 - Porta COM29 - 1: Resposta inválida.
20/08/2024 12:56:38:456 - Porta COM29 - 3: Resposta inválida.
20/08/2024 12:56:39:497 - Porta COM29 - 2: Resposta inválida.
20/08/2024 12:56:40:519 - Porta COM29 - 4: Resposta inválida.
20/08/2024 12:57:58:909 - Porta COM29 - 1: Resposta inválida.
20/08/2024 12:57:59:972 - Porta COM29 - 3: Resposta inválida.
20/08/2024 12:58:00:980 - Porta COM29 - 2: Resposta inválida.
20/08/2024 12:58:01:986 - Porta COM29 - 4: Resposta inválida.
20/08/2024 13:00:51:799 - Porta COM29 - 1: Resposta inválida.
20/08/2024 13:00:52:803 - Porta COM29 - 3: Resposta inválida.
20/08/2024 13:00:53:821 - Porta COM29 - 2: Resposta inválida.
20/08/2024 13:00:54:841 - Porta COM29 - 4: Resposta inválida.
20/08/2024 13:04:24:681 - Porta COM29 - 1: Resposta inválida.
20/08/2024 13:04:25:733 - Porta COM29 - 3: Resposta inválida.
20/08/2024 13:04:26:767 - Porta COM29 - 2: Resposta inválida.
20/08/2024 13:04:27:773 - Porta COM29 - 4: Resposta inválida.
20/08/2024 13:18:28:068 - Porta COM29 - 1: Resposta inválida.
20/08/2024 13:18:29:131 - Porta COM29 - 3: Resposta inválida.
20/08/2024 13:18:30:165 - Porta COM29 - 2: Resposta inválida.
20/08/2024 13:18:31:171 - Porta COM29 - 4: Resposta inválida.
20/08/2024 13:45:49:710 - Porta COM29 - 1: Resposta inválida.
20/08/2024 13:45:50:713 - Porta COM29 - 3: Resposta inválida.
20/08/2024 13:45:51:720 - Porta COM29 - 2: Resposta inválida.
20/08/2024 13:45:52:773 - Porta COM29 - 4: Resposta inválida.
20/08/2024 13:52:23:935 - Porta COM29 - 1: Resposta inválida.
20/08/2024 13:52:24:997 - Porta COM29 - 3: Resposta inválida.
20/08/2024 13:52:26:061 - Porta COM29 - 2: Resposta inválida.
20/08/2024 13:52:27:064 - Porta COM29 - 4: Resposta inválida.
20/08/2024 14:08:01:825 - Porta COM29 - 1: Resposta inválida.
20/08/2024 14:08:02:839 - Porta COM29 - 3: Resposta inválida.
20/08/2024 14:08:03:844 - Porta COM29 - 2: Resposta inválida.
20/08/2024 14:08:04:848 - Porta COM29 - 4: Resposta inválida.
20/08/2024 14:16:25:034 - Porta COM29 - 1: Resposta inválida.
20/08/2024 14:16:26:093 - Porta COM29 - 3: Resposta inválida.
20/08/2024 14:16:27:095 - Porta COM29 - 2: Resposta inválida.
20/08/2024 14:16:28:099 - Porta COM29 - 4: Resposta inválida.
20/08/2024 14:17:47:473 - Porta COM29 - 1: Resposta inválida.
20/08/2024 14:17:48:506 - Porta COM29 - 3: Resposta inválida.
20/08/2024 14:17:49:526 - Porta COM29 - 2: Resposta inválida.
20/08/2024 14:17:50:564 - Porta COM29 - 4: Resposta inválida.

File diff suppressed because it is too large Load Diff

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -25,7 +25,7 @@
<meta name="viewport" content="width=device-width,
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
#map_c9d0fd7197a4c32a12787b6a06e6f1c6 {
#map_377c0681438bc9097c7f5a08b73bcaf5 {
position: relative;
width: 100.0%;
height: 100.0%;
@ -39,14 +39,14 @@
<body>
<div class="folium-map" id="map_c9d0fd7197a4c32a12787b6a06e6f1c6" ></div>
<div class="folium-map" id="map_377c0681438bc9097c7f5a08b73bcaf5" ></div>
</body>
<script>
var map_c9d0fd7197a4c32a12787b6a06e6f1c6 = L.map(
"map_c9d0fd7197a4c32a12787b6a06e6f1c6",
var map_377c0681438bc9097c7f5a08b73bcaf5 = L.map(
"map_377c0681438bc9097c7f5a08b73bcaf5",
{
center: [0.0, 0.0],
crs: L.CRS.EPSG3857,
@ -60,13 +60,13 @@
var tile_layer_7962aca42735f8f05503d8eaebb7febe = L.tileLayer(
var tile_layer_25f1a7ee55115fda5c11dfb6faec2e0c = L.tileLayer(
"https://tile.openstreetmap.org/{z}/{x}/{y}.png",
{"attribution": "\u0026copy; \u003ca href=\"https://www.openstreetmap.org/copyright\"\u003eOpenStreetMap\u003c/a\u003e contributors", "detectRetina": false, "maxNativeZoom": 19, "maxZoom": 19, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}
);
tile_layer_7962aca42735f8f05503d8eaebb7febe.addTo(map_c9d0fd7197a4c32a12787b6a06e6f1c6);
tile_layer_25f1a7ee55115fda5c11dfb6faec2e0c.addTo(map_377c0681438bc9097c7f5a08b73bcaf5);
</script>
@ -87,7 +87,7 @@
}
trajeto_json_add({"features": []});
trajeto_json.addTo(map_c9d0fd7197a4c32a12787b6a06e6f1c6);
trajeto_json.addTo(map_377c0681438bc9097c7f5a08b73bcaf5);
function adicionarGeometria(novaGeometria) {
trajeto_json.addData(novaGeometria);
@ -145,7 +145,7 @@
var marcadorDinamico = L.marker([0, 0], {
icon: customIcon
}).addTo(map_c9d0fd7197a4c32a12787b6a06e6f1c6);
}).addTo(map_377c0681438bc9097c7f5a08b73bcaf5);
// Conectar ao broker MQTT
const client = mqtt.connect('ws://localhost:9001'); // Use wss para conexão segura
@ -183,7 +183,7 @@
marcadorDinamico.setRotationAngle(angulo);
adicionarCoordenada("Tj", [novaLongitude, novaLatitude]);
map_c9d0fd7197a4c32a12787b6a06e6f1c6.setView(novaPosicao, map_c9d0fd7197a4c32a12787b6a06e6f1c6.getZoom());
map_377c0681438bc9097c7f5a08b73bcaf5.setView(novaPosicao, map_377c0681438bc9097c7f5a08b73bcaf5.getZoom());
});
function calcularOrientacao(P1latitude, P1longitude, P2latitude, P2longitude) {

Binary file not shown.