otimizado timers
This commit is contained in:
parent
1c2eec141d
commit
69139dbb17
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -57,13 +57,13 @@ namespace AgroBase.Forms.Atuador
|
|||
grdSensoriamento.Rows.Add(new object[] { "Percentual", "0" });
|
||||
|
||||
|
||||
tmrLeitura = new AsyncTaskTimerModel(tmrLeitura_Tick, 1000, this);
|
||||
tmrLeitura = new AsyncTaskTimerModel("tmrLeitura", tmrLeitura_Tick, 1000, this);
|
||||
tmrLeitura.Start();
|
||||
}
|
||||
|
||||
private void frmAtuCalibragem_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
tmrLeitura.Stop();
|
||||
tmrLeitura.Dispose();
|
||||
}
|
||||
|
||||
private void PopularBicos()
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ namespace AgroBase.Forms
|
|||
cameraSolo.tmrProcesso
|
||||
);
|
||||
|
||||
tmrLeitura = new AsyncTaskTimerModel(tmrLeitura_Tick, 200);
|
||||
tmrLeitura = new AsyncTaskTimerModel("tmrLeitura", tmrLeitura_Tick, 200);
|
||||
tmrLeitura.Start();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -313,11 +313,9 @@ namespace AgroBase.Forms.IHM
|
|||
|
||||
private void cmbCentro_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (tmrKinect == null)
|
||||
{
|
||||
tmrKinect = new AsyncTaskTimerModel(tmrKinect_Tick, 100, this);
|
||||
tmrKinect.Start();
|
||||
}
|
||||
tmrKinect?.Dispose();
|
||||
tmrKinect = new AsyncTaskTimerModel("tmrKinect", tmrKinect_Tick, 100, this);
|
||||
tmrKinect.Start();
|
||||
}
|
||||
|
||||
private void cmbCameraSolo_SelectedIndexChanged(object sender, EventArgs e)
|
||||
|
|
|
|||
|
|
@ -56,13 +56,13 @@ namespace AgroBase.Forms.IHM
|
|||
|
||||
private void frmDialogoMapa_Load(object sender, EventArgs e)
|
||||
{
|
||||
tmrLeitura = new AsyncTaskTimerModel(tmrLeitura_Tick, 500, this);
|
||||
tmrLeitura = new AsyncTaskTimerModel("tmrLeitura", tmrLeitura_Tick, 500, this);
|
||||
tmrLeitura.Start();
|
||||
}
|
||||
|
||||
private void frmDialogoMapa_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
tmrLeitura.Stop();
|
||||
tmrLeitura.Dispose();
|
||||
Variaveis.OperacaoEmAndamento.DesligarCameras();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,10 +97,10 @@ namespace AgroBase.Forms.IHM
|
|||
private void frmIHM_Load(object sender, EventArgs e)
|
||||
{
|
||||
lblVersao.Text = "v " + Variaveis.Versao;
|
||||
tmrDispositivos = new AsyncTaskTimerModel(tmrDispositivos_Tick, 5000, this);
|
||||
tmrDispositivos = new AsyncTaskTimerModel("tmrDispositivos", tmrDispositivos_Tick, 5000, this);
|
||||
tmrDispositivos.Start();
|
||||
|
||||
tmrAtualizacaoArquivos = new AsyncTaskTimerModel(tmrAtualizacaoArquivos_Tick, 300, this);
|
||||
tmrAtualizacaoArquivos = new AsyncTaskTimerModel("tmrAtualizacaoArquivos", tmrAtualizacaoArquivos_Tick, 300, this);
|
||||
tmrAtualizacaoArquivos.Start();
|
||||
|
||||
lblCodigoFalha.Click += LblCodigoFalha_Click;
|
||||
|
|
|
|||
|
|
@ -49,13 +49,13 @@ namespace AgroBase.Forms.Operacoes
|
|||
PopularBicos();
|
||||
Variaveis.OperacaoEmAndamento.chartGraficos = chartGraficos;
|
||||
|
||||
tmrLeitura = new AsyncTaskTimerModel(tmrLeitura_Tick, 500, this);
|
||||
tmrLeitura = new AsyncTaskTimerModel("tmrLeitura", tmrLeitura_Tick, 500, this);
|
||||
tmrLeitura.Start();
|
||||
}
|
||||
|
||||
private void frmOperacaoManual_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
tmrLeitura.Stop();
|
||||
tmrLeitura.Dispose();
|
||||
Variaveis.OperacaoEmAndamento.FinalizarOperacao();
|
||||
Variaveis.OperacaoEmAndamento.DesligarCameras();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
|
||||
private void frmOperacaoMapaGPS_Load(object sender, EventArgs e)
|
||||
{
|
||||
tmrLeituras = new AsyncTaskTimerModel(tmrLeituras_Tick, 200, this);
|
||||
tmrLeituras = new AsyncTaskTimerModel("tmrLeitura", tmrLeituras_Tick, 200, this);
|
||||
tmrLeituras.Start();
|
||||
|
||||
AtualizarDispositivos();
|
||||
|
|
@ -46,7 +46,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
|
||||
private void frmOperacaoMapaGPS_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
tmrLeituras.Stop();
|
||||
tmrLeituras.Dispose();
|
||||
Variaveis.OperacaoEmAndamento.FinalizarOperacao();
|
||||
Variaveis.OperacaoEmAndamento.DesligarCameras();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
nudAnguloMaximo.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.Angulo_Max);
|
||||
nudAnguloMinimo.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.Angulo_Min);
|
||||
nudVelocidadeMP.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.VelocidadeMP);
|
||||
nudTemposalvarlog.Value = (decimal)OperacaoModel.tmrLogsInterval / 1000;
|
||||
nudTemposalvarlog.Value = (decimal)Variaveis.OperacaoEmAndamento.tmrLogsInterval / 1000;
|
||||
nudQtdBicos.Value = Variaveis.OperacaoEmAndamento.DispAtu.Dados.QuantidadeBicos;
|
||||
nudQtdCameras.Value = Variaveis.OperacaoEmAndamento.QuantidadeCamerasSolo;
|
||||
nudCapacidadereservatorio.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.CapacidadeReservatorio);
|
||||
|
|
@ -131,7 +131,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
Variaveis.OperacaoEmAndamento.Controle.Angulo_Max = (int)(nudAnguloMaximo.Value);
|
||||
Variaveis.OperacaoEmAndamento.Controle.Angulo_Min = (int)(nudAnguloMinimo.Value);
|
||||
Variaveis.OperacaoEmAndamento.Controle.VelocidadeMP = (int)(nudVelocidadeMP.Value);
|
||||
OperacaoModel.tmrLogsInterval = (double)(nudTemposalvarlog.Value * 1000);
|
||||
Variaveis.OperacaoEmAndamento.tmrLogsInterval = (double)(nudTemposalvarlog.Value * 1000);
|
||||
Variaveis.OperacaoEmAndamento.DispAtu.Dados.QuantidadeBicos = (int)nudQtdBicos.Value;
|
||||
Variaveis.OperacaoEmAndamento.QuantidadeCamerasSolo = (int)nudQtdCameras.Value;
|
||||
Variaveis.OperacaoEmAndamento.CapacidadeReservatorio = (double)nudCapacidadereservatorio.Value;
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
|
||||
private void frmResultadosOperacao_Load(object sender, EventArgs e)
|
||||
{
|
||||
tmrPlay = new AsyncTaskTimerModel(tmrPlay_Tick, 1000, this);
|
||||
tmrPlay = new AsyncTaskTimerModel("tmrPlay", tmrPlay_Tick, 1000, this);
|
||||
|
||||
picDIR_DF.Image = FuncoesGlobais.EspelharImagemHorizontalmente(Resources.roda_superior);
|
||||
picDIR_DT.Image = FuncoesGlobais.EspelharImagemHorizontalmente(Resources.roda_superior);
|
||||
|
|
|
|||
|
|
@ -29,13 +29,13 @@ namespace AgroBase.Forms
|
|||
picDF.Paint += pic_Paint;
|
||||
picDT.Paint += pic_Paint;
|
||||
|
||||
tmrAtualizacao = new AsyncTaskTimerModel(tmrAtualizacao_Tick, 500, this);
|
||||
tmrAtualizacao = new AsyncTaskTimerModel("tmrAtualizacao", tmrAtualizacao_Tick, 500, this);
|
||||
tmrAtualizacao.Start();
|
||||
}
|
||||
|
||||
private void frmAcompanhamento_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
tmrAtualizacao.Stop();
|
||||
tmrAtualizacao.Dispose();
|
||||
}
|
||||
|
||||
public async Task tmrAtualizacao_Tick()
|
||||
|
|
@ -86,7 +86,7 @@ namespace AgroBase.Forms
|
|||
d0 = sensor.Leituras?[0] ?? 0;
|
||||
d1 = sensor.Leituras?[1] ?? 0;
|
||||
}
|
||||
lbl.Text = "Barramento 3V: " + d0.ToString("0.00") + " V " + d1.ToString("0.00") + " mA";
|
||||
lbl.Text = id.Replace("AB", "Barramento ") + ": " + d1.ToString("0.00") + " V " + d0.ToString("0.00") + " mA";
|
||||
}
|
||||
|
||||
private void AtualzarDadosMovimentacao()
|
||||
|
|
|
|||
|
|
@ -30,13 +30,13 @@ namespace AgroBase.Forms
|
|||
private void frmGPS_Load(object sender, EventArgs e)
|
||||
{
|
||||
IniciarMapa();
|
||||
tmrLeitura = new AsyncTaskTimerModel(tmrLeitura_Tick, 1000, this);
|
||||
tmrLeitura = new AsyncTaskTimerModel("tmrLeitura", tmrLeitura_Tick, 1000, this);
|
||||
tmrLeitura.Start();
|
||||
}
|
||||
|
||||
private void frmGPS_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
tmrLeitura.Stop();
|
||||
tmrLeitura.Dispose();
|
||||
}
|
||||
|
||||
private async Task tmrLeitura_Tick()
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace AgroBase.Forms
|
|||
|
||||
private void frmLoraConfig_Load(object sender, EventArgs e)
|
||||
{
|
||||
tmrLeitura = new AsyncTaskTimerModel(tmrLeitura_Tick, 1000, this);
|
||||
tmrLeitura = new AsyncTaskTimerModel("tmrLeitura", tmrLeitura_Tick, 1000, this);
|
||||
tmrLeitura.Start();
|
||||
|
||||
//Parametros = loraService.CarregarParametros();
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ namespace AgroBase
|
|||
this.gpbControleDirecional = new System.Windows.Forms.GroupBox();
|
||||
this.gpbAtalhos = new System.Windows.Forms.GroupBox();
|
||||
this.pnlAtalhos = new System.Windows.Forms.Panel();
|
||||
this.btnEthernet = new System.Windows.Forms.Button();
|
||||
this.btnMKS = new System.Windows.Forms.Button();
|
||||
this.btnBLD300R = new System.Windows.Forms.Button();
|
||||
this.btnWT901C = new System.Windows.Forms.Button();
|
||||
|
|
@ -96,7 +97,8 @@ namespace AgroBase
|
|||
this.lblProgressoAtualizacao = new System.Windows.Forms.Label();
|
||||
this.pgbAtualizacaoArquivos = new System.Windows.Forms.ProgressBar();
|
||||
this.btnForcarAtualizacao = new System.Windows.Forms.Button();
|
||||
this.btnEthernet = new System.Windows.Forms.Button();
|
||||
this.clbRotinas = new System.Windows.Forms.CheckedListBox();
|
||||
this.btnAtualizarRotinas = new System.Windows.Forms.Button();
|
||||
this.gpbAcoes.SuspendLayout();
|
||||
this.erroStrip.SuspendLayout();
|
||||
this.pnlLateral.SuspendLayout();
|
||||
|
|
@ -634,6 +636,17 @@ namespace AgroBase
|
|||
this.pnlAtalhos.Size = new System.Drawing.Size(112, 286);
|
||||
this.pnlAtalhos.TabIndex = 0;
|
||||
//
|
||||
// btnEthernet
|
||||
//
|
||||
this.btnEthernet.Location = new System.Drawing.Point(5, 391);
|
||||
this.btnEthernet.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnEthernet.Name = "btnEthernet";
|
||||
this.btnEthernet.Size = new System.Drawing.Size(84, 20);
|
||||
this.btnEthernet.TabIndex = 30;
|
||||
this.btnEthernet.Text = "Ethernet";
|
||||
this.btnEthernet.UseVisualStyleBackColor = true;
|
||||
this.btnEthernet.Click += new System.EventHandler(this.btnEthernet_Click);
|
||||
//
|
||||
// btnMKS
|
||||
//
|
||||
this.btnMKS.Location = new System.Drawing.Point(5, 367);
|
||||
|
|
@ -858,6 +871,7 @@ namespace AgroBase
|
|||
//
|
||||
// btnForcarAtualizacao
|
||||
//
|
||||
this.btnForcarAtualizacao.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnForcarAtualizacao.Location = new System.Drawing.Point(293, 532);
|
||||
this.btnForcarAtualizacao.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnForcarAtualizacao.Name = "btnForcarAtualizacao";
|
||||
|
|
@ -867,22 +881,35 @@ namespace AgroBase
|
|||
this.btnForcarAtualizacao.UseVisualStyleBackColor = true;
|
||||
this.btnForcarAtualizacao.Click += new System.EventHandler(this.btnForcarAtualizacao_Click);
|
||||
//
|
||||
// btnEthernet
|
||||
// clbRotinas
|
||||
//
|
||||
this.btnEthernet.Location = new System.Drawing.Point(5, 391);
|
||||
this.btnEthernet.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnEthernet.Name = "btnEthernet";
|
||||
this.btnEthernet.Size = new System.Drawing.Size(84, 20);
|
||||
this.btnEthernet.TabIndex = 30;
|
||||
this.btnEthernet.Text = "Ethernet";
|
||||
this.btnEthernet.UseVisualStyleBackColor = true;
|
||||
this.btnEthernet.Click += new System.EventHandler(this.btnEthernet_Click);
|
||||
this.clbRotinas.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.clbRotinas.FormattingEnabled = true;
|
||||
this.clbRotinas.Location = new System.Drawing.Point(9, 417);
|
||||
this.clbRotinas.Name = "clbRotinas";
|
||||
this.clbRotinas.Size = new System.Drawing.Size(457, 94);
|
||||
this.clbRotinas.TabIndex = 49;
|
||||
//
|
||||
// btnAtualizarRotinas
|
||||
//
|
||||
this.btnAtualizarRotinas.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAtualizarRotinas.Location = new System.Drawing.Point(9, 516);
|
||||
this.btnAtualizarRotinas.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnAtualizarRotinas.Name = "btnAtualizarRotinas";
|
||||
this.btnAtualizarRotinas.Size = new System.Drawing.Size(109, 22);
|
||||
this.btnAtualizarRotinas.TabIndex = 50;
|
||||
this.btnAtualizarRotinas.Text = "Atualizar Rotinas";
|
||||
this.btnAtualizarRotinas.UseVisualStyleBackColor = true;
|
||||
this.btnAtualizarRotinas.Click += new System.EventHandler(this.btnAtualizarRotinas_Click);
|
||||
//
|
||||
// frmPrincipal
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1089, 609);
|
||||
this.Controls.Add(this.btnAtualizarRotinas);
|
||||
this.Controls.Add(this.clbRotinas);
|
||||
this.Controls.Add(this.btnForcarAtualizacao);
|
||||
this.Controls.Add(this.lblProgressoAtualizacao);
|
||||
this.Controls.Add(this.pgbAtualizacaoArquivos);
|
||||
|
|
@ -998,6 +1025,8 @@ namespace AgroBase
|
|||
private System.Windows.Forms.ProgressBar pgbAtualizacaoArquivos;
|
||||
private System.Windows.Forms.Button btnForcarAtualizacao;
|
||||
private System.Windows.Forms.Button btnEthernet;
|
||||
private System.Windows.Forms.CheckedListBox clbRotinas;
|
||||
private System.Windows.Forms.Button btnAtualizarRotinas;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ namespace AgroBase
|
|||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
tmrLoopDispositivos = new AsyncTaskTimerModel(tmrLoopDispositivos_Tick, SerialService.InteraloVerificacao, this);
|
||||
tmrLoopDispositivos = new AsyncTaskTimerModel("tmrLoopDispositivos", tmrLoopDispositivos_Tick, SerialService.InteraloVerificacao, this);
|
||||
tmrLoopDispositivos.Start();
|
||||
|
||||
tmrAtualizacaoArquivos = new AsyncTaskTimerModel(tmrAtualizacaoArquivos_Tick, 300, this);
|
||||
tmrAtualizacaoArquivos = new AsyncTaskTimerModel("tmrAtualizacaoArquivos", tmrAtualizacaoArquivos_Tick, 300, this);
|
||||
tmrAtualizacaoArquivos.Start();
|
||||
|
||||
btnJoyAtt_Click(new object(), new EventArgs());
|
||||
|
|
@ -48,6 +48,17 @@ namespace AgroBase
|
|||
}
|
||||
|
||||
|
||||
private void btnAtualizarRotinas_Click(object sender, EventArgs e)
|
||||
{
|
||||
AtualizarListaRotinas();
|
||||
}
|
||||
|
||||
private void AtualizarListaRotinas()
|
||||
{
|
||||
clbRotinas.Items.Clear();
|
||||
clbRotinas.Items.AddRange(AsyncTaskTimerModel.Timers.Select(x => $"{x.StackTrace} -> {x.Id} - Interval: {x.Interval} - Running: {x.IsRunning}").ToArray());
|
||||
}
|
||||
|
||||
#region DISPOSITIVOS
|
||||
|
||||
private void btnNovoDispositivo_Click(object sender, EventArgs e)
|
||||
|
|
@ -169,6 +180,8 @@ namespace AgroBase
|
|||
FuncoesGlobais.PreencheValorTrackBar(trkRPM, Variaveis.OperacaoEmAndamento.Controle.RPM_SP);
|
||||
int percentual = Convert.ToInt32((trkRPM.Value / (double)VariaveisEquipamento.RPM_Max_Roda) * 100.0);
|
||||
AtualizaRPM(percentual);
|
||||
|
||||
AtualizarListaRotinas();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
@ -438,8 +451,9 @@ namespace AgroBase
|
|||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,6 +120,9 @@
|
|||
<metadata name="erroStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>11, 10</value>
|
||||
</metadata>
|
||||
<metadata name="erroStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>11, 10</value>
|
||||
</metadata>
|
||||
<metadata name="generalStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>133, 16</value>
|
||||
</metadata>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ namespace AgroBase.Forms
|
|||
|
||||
private void frmSimulacaoMapaGPS_Load(object sender, EventArgs e)
|
||||
{
|
||||
tmrLeitura = new AsyncTaskTimerModel(tmrLeitura_Tick, 500, this);
|
||||
tmrLeitura = new AsyncTaskTimerModel("tmrLeitura", tmrLeitura_Tick, 500, this);
|
||||
tmrLeitura.Start();
|
||||
|
||||
Variaveis.OperacaoEmAndamento.Mapa = new MapasModel()
|
||||
|
|
@ -47,7 +47,7 @@ namespace AgroBase.Forms
|
|||
|
||||
private void frmSimulacaoMapaGPS_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
tmrLeitura.Stop();
|
||||
tmrLeitura.Dispose();
|
||||
Variaveis.OperacaoEmAndamento.Iniciado = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,13 +44,13 @@ namespace AgroBase.Forms
|
|||
{
|
||||
PopularDadosGrid();
|
||||
|
||||
tmrLeitura = new AsyncTaskTimerModel(tmrLeitura_Tick, 500, this);
|
||||
tmrLeitura = new AsyncTaskTimerModel("tmrLeitura", tmrLeitura_Tick, 500, this);
|
||||
tmrLeitura.Start();
|
||||
}
|
||||
|
||||
private void frmWT901C_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
tmrLeitura.Stop();
|
||||
tmrLeitura.Dispose();
|
||||
}
|
||||
|
||||
private async Task tmrLeitura_Tick()
|
||||
|
|
|
|||
|
|
@ -1,18 +1,24 @@
|
|||
using AgroBase.Services;
|
||||
using OpenTK.Platform.Windows;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AgroBase.Models
|
||||
{
|
||||
public class AsyncTaskTimerModel
|
||||
public class AsyncTaskTimerModel : IDisposable
|
||||
{
|
||||
public static List<AsyncTaskTimerModel> Timers { get; set; } = new List<AsyncTaskTimerModel>();
|
||||
|
||||
private CancellationTokenSource _cancellationTokenSource;
|
||||
private Func<Task> _taskToExecute;
|
||||
private int _interval; // Intervalo em milissegundos
|
||||
private string _id;
|
||||
public int Interval { get { return _interval; } }
|
||||
private string _stackTrace;
|
||||
public string StackTrace { get { return _stackTrace; } }
|
||||
private string _id;
|
||||
public string Id { get { return _id; } }
|
||||
private Control _uiControl;
|
||||
|
||||
private bool DebugMessages = true;
|
||||
|
|
@ -23,15 +29,19 @@ namespace AgroBase.Models
|
|||
/// <param name="taskToExecute">A tarefa assíncrona que será executada periodicamente.</param>
|
||||
/// <param name="interval">Intervalo em milissegundos entre as execuções.</param>
|
||||
/// <param name="uiControl">Controle para executar tarefas relacionadas à UI. Opcional.</param>
|
||||
public AsyncTaskTimerModel(Func<Task> taskToExecute, int interval, Control uiControl = null)
|
||||
public AsyncTaskTimerModel(string id, Func<Task> taskToExecute, int interval, Control uiControl = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(id)) throw new ArgumentNullException(nameof(id));
|
||||
if (taskToExecute == null) throw new ArgumentNullException(nameof(taskToExecute));
|
||||
if (interval <= 0) throw new ArgumentException("Interval must be greater than zero.", nameof(interval));
|
||||
|
||||
_id = ObterIdDoChamador();
|
||||
_id = id;
|
||||
_stackTrace = ObterIdDoChamador();
|
||||
_taskToExecute = taskToExecute;
|
||||
_interval = interval;
|
||||
_uiControl = uiControl;
|
||||
|
||||
Timers.Add(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -144,6 +154,26 @@ namespace AgroBase.Models
|
|||
ExibirConsole($"ENCERRADO");
|
||||
}
|
||||
|
||||
private bool _disposed = false;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_disposed) return;
|
||||
|
||||
// Cancela o token de cancelamento
|
||||
Stop();
|
||||
|
||||
// Remove o timer da lista estática
|
||||
Timers.Remove(this);
|
||||
|
||||
// Libera o CancellationTokenSource
|
||||
_cancellationTokenSource?.Dispose();
|
||||
|
||||
_disposed = true;
|
||||
|
||||
ExibirConsole($"DISPOSED");
|
||||
}
|
||||
|
||||
|
||||
private string ObterIdDoChamador()
|
||||
{
|
||||
|
|
@ -157,7 +187,7 @@ namespace AgroBase.Models
|
|||
{
|
||||
if (DebugMessages)
|
||||
{
|
||||
Console.WriteLine($"AsyncTaskTimer id = {_id} - {msg}");
|
||||
Console.WriteLine($"AsyncTaskTimer id = {_stackTrace} - {msg}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,31 +57,25 @@ namespace AgroBase.Models
|
|||
|
||||
public void InicializarCamera()
|
||||
{
|
||||
if (tmrProcesso == null)
|
||||
var timers = AsyncTaskTimerModel.Timers.Where(x => x.StackTrace.Contains("CameraCaminhoModel") && x.Id.Contains(ID)).ToList();
|
||||
foreach (var timer in timers)
|
||||
{
|
||||
tmrProcesso = new AsyncTaskTimerModel(tmrProcesso_Tick, 500);
|
||||
tmrProcesso.Start();
|
||||
timer.Dispose();
|
||||
}
|
||||
|
||||
if (tmrLeitura == null)
|
||||
{
|
||||
tmrLeitura = new AsyncTaskTimerModel(tmrLeitura_Tick, 100);
|
||||
tmrLeitura.Start();
|
||||
}
|
||||
tmrProcesso = new AsyncTaskTimerModel("tmrProcesso_" + ID, tmrProcesso_Tick, 500);
|
||||
tmrProcesso.Start();
|
||||
|
||||
tmrLeitura = new AsyncTaskTimerModel("tmrLeitura_" + ID, tmrLeitura_Tick, 100);
|
||||
tmrLeitura.Start();
|
||||
}
|
||||
|
||||
public void DesligarCamera()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (tmrLeitura != null)
|
||||
{
|
||||
tmrLeitura.Stop();
|
||||
}
|
||||
if (tmrProcesso != null)
|
||||
{
|
||||
tmrProcesso.Stop();
|
||||
}
|
||||
tmrLeitura?.Dispose();
|
||||
tmrProcesso?.Dispose();
|
||||
|
||||
Iniciada = false;
|
||||
Variaveis.MqttService.Topicos.Remove(camera._mqttTopico);
|
||||
|
|
@ -109,8 +103,6 @@ namespace AgroBase.Models
|
|||
var Mensagem = camera._mqttTopico.Mensagens.FirstOrDefault(y => y.Momento > camera.IniciadoEm && y.Mensagem == "OK");
|
||||
if (Mensagem != null)
|
||||
{
|
||||
tmrProcesso.Stop();
|
||||
|
||||
camera.ProntoEm = Mensagem.Momento;
|
||||
|
||||
if (browser == null)
|
||||
|
|
@ -125,6 +117,8 @@ namespace AgroBase.Models
|
|||
browser.Dock = DockStyle.Fill;*/
|
||||
}
|
||||
}
|
||||
|
||||
tmrProcesso.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,12 @@ namespace AgroBase.Models
|
|||
|
||||
public CameraSoloModel()
|
||||
{
|
||||
tmrProcesso = new AsyncTaskTimerModel(tmrProcesso_Tick, 500);
|
||||
|
||||
}
|
||||
|
||||
public void IniciarRotinaProcesso()
|
||||
{
|
||||
tmrProcesso = new AsyncTaskTimerModel("tmrProcesso", tmrProcesso_Tick, 500);
|
||||
tmrProcesso.Start();
|
||||
}
|
||||
|
||||
|
|
@ -24,8 +29,6 @@ namespace AgroBase.Models
|
|||
var Mensagem = camera._mqttTopico.Mensagens.FirstOrDefault(y => y.Momento > camera.IniciadoEm && y.Mensagem == "OK");
|
||||
if (Mensagem != null)
|
||||
{
|
||||
tmrProcesso.Stop();
|
||||
|
||||
camera.ProntoEm = Mensagem.Momento;
|
||||
|
||||
if (browser == null)
|
||||
|
|
@ -35,6 +38,8 @@ namespace AgroBase.Models
|
|||
panel.Controls.Add(browser);
|
||||
browser.Dock = DockStyle.Fill;
|
||||
}
|
||||
|
||||
tmrProcesso.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ namespace AgroBase
|
|||
|
||||
public static void IniciarRotinas()
|
||||
{
|
||||
tmrJoystick = new AsyncTaskTimerModel(tmrJoystick_Tick, 100);
|
||||
tmrJoystick = new AsyncTaskTimerModel("tmrJoystick", tmrJoystick_Tick, 100);
|
||||
}
|
||||
|
||||
public static void AtualizaDispositivo()
|
||||
|
|
|
|||
|
|
@ -537,7 +537,8 @@ namespace AgroBase.Models
|
|||
picLoading.Visible = true;
|
||||
pnlMapa.Controls.Add(picLoading);
|
||||
|
||||
tmrCarregamento = new AsyncTaskTimerModel(tmrCarregamento_Tick, 500, pnlMapa);
|
||||
tmrCarregamento?.Dispose();
|
||||
tmrCarregamento = new AsyncTaskTimerModel("tmrCarregamento", tmrCarregamento_Tick, 500, pnlMapa);
|
||||
tmrCarregamento.Start();
|
||||
}
|
||||
}
|
||||
|
|
@ -556,7 +557,8 @@ namespace AgroBase.Models
|
|||
}
|
||||
mapaService.CarregarMapaGPS(MapasVariaveisModel.NomeArquivoMapaGPS);
|
||||
|
||||
tmrCarregamento = new AsyncTaskTimerModel(tmrCarregamento_Tick, 500, pnlMapa);
|
||||
tmrCarregamento?.Dispose();
|
||||
tmrCarregamento = new AsyncTaskTimerModel("tmrCarregamento", tmrCarregamento_Tick, 500, pnlMapa);
|
||||
tmrCarregamento.Start();
|
||||
}
|
||||
|
||||
|
|
@ -600,13 +602,13 @@ namespace AgroBase.Models
|
|||
mapaService.pythonProcess = null;
|
||||
}
|
||||
|
||||
tmrCarregamento.Stop();
|
||||
tmrCarregamento.Dispose();
|
||||
}
|
||||
catch (InvalidOperationException ex)
|
||||
{
|
||||
Console.WriteLine($"Erro ao verificar o estado do processo: {ex.Message}");
|
||||
picLoading.Visible = false;
|
||||
tmrCarregamento.Stop();
|
||||
tmrCarregamento.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -296,7 +296,8 @@ namespace AgroBase.Models
|
|||
|
||||
public void IniciarRegistrador()
|
||||
{
|
||||
tmrRegistrador = new AsyncTaskTimerModel(tmrRegistrador_Tick, 1000);
|
||||
tmrRegistrador?.Dispose();
|
||||
tmrRegistrador = new AsyncTaskTimerModel("tmrRegistrador", tmrRegistrador_Tick, 1000);
|
||||
tmrRegistrador.Start();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,19 +27,24 @@ namespace AgroBase.Models
|
|||
{
|
||||
this.Modo = Modo;
|
||||
|
||||
tmrLogs = new AsyncTaskTimerModel(tmrLogs_Tick, 1000);
|
||||
tmrLogs.Start();
|
||||
if (Variaveis.OperacaoEmAndamento != null)
|
||||
{
|
||||
tmrLogs?.Dispose();
|
||||
tmrLogs = new AsyncTaskTimerModel("tmrLogs", tmrLogs_Tick, 1000);
|
||||
tmrLogs.Start();
|
||||
|
||||
tmrLeituras = new AsyncTaskTimerModel(tmrLeituras_Tick, 500, chartGraficos);
|
||||
tmrLeituras.Start();
|
||||
tmrLeituras?.Dispose();
|
||||
tmrLeituras = new AsyncTaskTimerModel("tmrLeitura", tmrLeituras_Tick, 500, chartGraficos);
|
||||
tmrLeituras.Start();
|
||||
}
|
||||
|
||||
if (computer == null)
|
||||
if (computer == null)
|
||||
{
|
||||
computer = new Computer()
|
||||
{
|
||||
CPUEnabled = true,
|
||||
GPUEnabled = true,
|
||||
RAMEnabled = true,
|
||||
RAMEnabled = true,
|
||||
HDDEnabled = true,
|
||||
};
|
||||
computer.Open();
|
||||
|
|
@ -274,7 +279,7 @@ namespace AgroBase.Models
|
|||
public CameraCaminhoModel CameraCaminhoKinect { get; set; }
|
||||
public int TempoIniciarOperacao { get; set; } = 25;
|
||||
public string ID { get; set; }
|
||||
public static double tmrLogsInterval
|
||||
public double tmrLogsInterval
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
@ -519,7 +524,7 @@ namespace AgroBase.Models
|
|||
var AtuConectado = (DispositivosService<AtuadorModel>)Variaveis.DispositivosConectados.FirstOrDefault(x => x.Dispositivo == T_Code.Atu);
|
||||
var MvdConectado = (DispositivosService<MovimentacaoUnificadaModel>)Variaveis.DispositivosConectados.FirstOrDefault(x => x.Dispositivo == T_Code.Mvd);
|
||||
|
||||
tmrLogs.Stop();
|
||||
tmrLogs?.Stop();
|
||||
|
||||
OperacaoModel OperacaoCarregar = new OperacaoModel(Modo)
|
||||
{
|
||||
|
|
@ -962,7 +967,7 @@ namespace AgroBase.Models
|
|||
for (int i = 0; i < QuantidadeCamerasSolo; i++)
|
||||
{
|
||||
string CamNome = "Cam_Solo_" + i.ToString();
|
||||
CameraSoloModel CameraSolo = CameraSolo = new CameraSoloModel()
|
||||
CameraSoloModel CameraSolo = new CameraSoloModel()
|
||||
{
|
||||
ID = "S" + i.ToString(),
|
||||
Nome = CamNome,
|
||||
|
|
@ -1017,6 +1022,8 @@ namespace AgroBase.Models
|
|||
{
|
||||
VersaoArquivoModel ArquivoVersao = VersionamentoService.ArquivoModeloWeedDetector;
|
||||
|
||||
CameraSolo.IniciarRotinaProcesso();
|
||||
|
||||
CameraSolo.camera.IniciarCamera(
|
||||
Variaveis.OperacaoEmAndamento.DispAtu.Dados.ScriptDeteccaoErvas,
|
||||
new string[] {
|
||||
|
|
|
|||
|
|
@ -189,10 +189,10 @@ namespace AgroBase.Services
|
|||
|
||||
public static void IniciarRotinas()
|
||||
{
|
||||
tmrLoopComandos = new AsyncTaskTimerModel(tmrLoopComandos_Tick, 100);
|
||||
tmrLoopComandos = new AsyncTaskTimerModel("tmrLoopComandos", tmrLoopComandos_Tick, 100);
|
||||
tmrLoopComandos.Start();
|
||||
|
||||
tmrReceberDados = new AsyncTaskTimerModel(tmrReceberDados_Tick, TaxaAmostragem);
|
||||
tmrReceberDados = new AsyncTaskTimerModel("tmrReceberDados", tmrReceberDados_Tick, TaxaAmostragem);
|
||||
tmrReceberDados.Start();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -473,7 +473,7 @@ namespace AgroBase.Comum
|
|||
Size = new System.Drawing.Size() { Height = 141, Width = 300 },
|
||||
ReadOnly = true
|
||||
};
|
||||
tmrLimpeza = new AsyncTaskTimerModel(tmrLimpeza_Tick, 1000, frmInstancial.frmPrincipal);
|
||||
tmrLimpeza = new AsyncTaskTimerModel("tmrLimpeza", tmrLimpeza_Tick, 1000, frmInstancial.frmPrincipal);
|
||||
|
||||
Button btnConfig = new Button()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ namespace AgroBase.Services
|
|||
public static void Inicializar()
|
||||
{
|
||||
MensagensFila = new List<MensagemFilaModel>();
|
||||
tmrFila = new AsyncTaskTimerModel(tmrFila_Tick, 10);
|
||||
tmrFila = new AsyncTaskTimerModel("tmrFila", tmrFila_Tick, 10);
|
||||
tmrFila.Start();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ namespace AgroBase.Services
|
|||
|
||||
public static void InicializarRotinas()
|
||||
{
|
||||
tmrLeitura = new AsyncTaskTimerModel(tmrLeitura_Tick, 200);
|
||||
tmrLeitura = new AsyncTaskTimerModel("tmrLeitura", tmrLeitura_Tick, 200);
|
||||
tmrLeitura.Start();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -202,13 +202,15 @@ namespace AgroBase.Services
|
|||
if (!RotinaEnvioIniciada)
|
||||
{
|
||||
RotinaEnvioIniciada = true;
|
||||
tmrEnvio = new AsyncTaskTimerModel(tmrEnvio_Tick, 500);
|
||||
tmrEnvio?.Dispose();
|
||||
tmrEnvio = new AsyncTaskTimerModel("tmrEnvio", tmrEnvio_Tick, 500);
|
||||
tmrEnvio.Start();
|
||||
}
|
||||
if (!RotinaPingsIniciada && !Variaveis.IsAgroMonitor)
|
||||
{
|
||||
RotinaPingsIniciada = true;
|
||||
tmrPing = new AsyncTaskTimerModel(tmrPing_Tick, VariaveisEquipamento.TempoEntrePingsConexao);
|
||||
tmrPing?.Dispose();
|
||||
tmrPing = new AsyncTaskTimerModel("tmrPing", tmrPing_Tick, VariaveisEquipamento.TempoEntrePingsConexao);
|
||||
tmrEnvio.Start();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,8 +42,10 @@ namespace AgroBase.Services
|
|||
|
||||
public static void IniciarRotinas()
|
||||
{
|
||||
tmrLoopComandos = new AsyncTaskTimerModel(tmrLoopComandos_Tick, 100);
|
||||
tmrReceberDados = new AsyncTaskTimerModel(tmrReceberDados_Tick, TaxaAmostragem);
|
||||
tmrLoopComandos = new AsyncTaskTimerModel("tmrLoopComandos", tmrLoopComandos_Tick, 100);
|
||||
tmrLoopComandos.Start();
|
||||
tmrReceberDados = new AsyncTaskTimerModel("tmrReceberDados", tmrReceberDados_Tick, TaxaAmostragem);
|
||||
tmrReceberDados.Start();
|
||||
}
|
||||
|
||||
// Inicializa o serviço Ethernet com IP e porta específicos
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ namespace AgroBase.Services
|
|||
|
||||
public static void IniciarRotinas()
|
||||
{
|
||||
tmrLoopComandos = new AsyncTaskTimerModel(tmrLoopComandos_Tick, 100);
|
||||
tmrLoopComandos = new AsyncTaskTimerModel("tmrLoopComandos", tmrLoopComandos_Tick, 100);
|
||||
tmrLoopComandos.Start();
|
||||
tmrReceberDados = new AsyncTaskTimerModel(tmrReceberDados_Tick, TaxaAmostragem);
|
||||
tmrReceberDados = new AsyncTaskTimerModel("tmrReceberDados", tmrReceberDados_Tick, TaxaAmostragem);
|
||||
tmrReceberDados.Start();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public class MqttService
|
|||
}
|
||||
});
|
||||
|
||||
tmrCheck = new AsyncTaskTimerModel(tmrCheck_Tick, 1000);
|
||||
tmrCheck = new AsyncTaskTimerModel("tmrCheck", tmrCheck_Tick, 1000);
|
||||
tmrCheck.Start();
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -92180,3 +92180,141 @@ Parameter name: values
|
|||
25/11/2024 14:09:31:506 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 14:09:32:020 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Direction, Valor=1
|
||||
25/11/2024 14:09:32:522 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:21:153 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:21:358 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:21:562 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:21:767 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:21:972 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:22:175 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:22:393 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:22:599 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:22:804 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:23:007 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:23:211 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:23:416 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:23:639 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:23:842 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:24:049 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:24:251 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:24:454 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:24:657 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:24:859 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:25:065 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:25:581 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Direction, Valor=1
|
||||
25/11/2024 16:13:26:083 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Direction, Valor=1
|
||||
25/11/2024 16:13:26:284 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:26:490 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:26:691 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:26:897 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:27:102 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:27:305 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:27:508 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:27:709 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:27:913 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:28:131 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:28:334 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:28:540 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:28:757 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:28:961 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:29:176 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:29:378 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:29:594 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:29:797 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:30:000 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:30:204 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:30:716 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Direction, Valor=1
|
||||
25/11/2024 16:13:31:230 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Direction, Valor=1
|
||||
25/11/2024 16:13:31:433 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:31:639 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:31:842 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:32:045 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:32:247 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:32:451 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:32:657 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:32:859 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:33:065 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:33:269 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:33:473 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:33:695 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:33:899 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:34:104 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:34:307 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:34:510 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:34:716 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:34:920 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:35:125 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:35:329 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:35:834 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Direction, Valor=1
|
||||
25/11/2024 16:13:36:352 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Direction, Valor=1
|
||||
25/11/2024 16:13:36:556 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:36:761 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:36:964 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:37:166 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:37:371 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:37:576 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:37:781 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:37:987 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:38:191 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:38:406 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:38:610 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:38:814 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:39:020 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:39:225 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:39:430 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:39:636 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:39:839 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:40:042 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:40:244 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:40:450 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:40:951 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Direction, Valor=1
|
||||
25/11/2024 16:13:41:466 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Direction, Valor=1
|
||||
25/11/2024 16:13:41:683 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:41:886 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:42:090 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:42:294 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:42:498 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:42:703 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:42:906 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:43:109 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:43:313 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:43:520 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:43:724 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:43:929 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:44:133 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:44:338 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:44:540 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:44:743 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:44:946 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:45:151 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:45:354 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:45:557 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:46:061 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Direction, Valor=1
|
||||
25/11/2024 16:13:46:564 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Direction, Valor=1
|
||||
25/11/2024 16:13:46:769 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:46:974 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:47:179 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:47:382 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:47:600 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:47:804 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:48:020 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:48:225 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:48:430 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:48:633 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:48:837 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:49:040 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:49:242 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:49:444 - Endereço 2 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:49:649 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:49:866 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:50:068 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
25/11/2024 16:13:50:270 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=RPM_Max, Valor=500
|
||||
25/11/2024 16:13:50:477 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:50:679 - Endereço 4 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:51:191 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Direction, Valor=1
|
||||
25/11/2024 16:13:51:695 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Direction, Valor=1
|
||||
25/11/2024 16:13:51:899 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Rampa, Valor=0
|
||||
25/11/2024 16:13:52:103 - Endereço 1 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=Enabled, Valor=0
|
||||
25/11/2024 16:13:52:306 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=ControleRS485, Valor=1
|
||||
25/11/2024 16:13:52:509 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=AlarmeCode, Valor=0
|
||||
25/11/2024 16:13:52:537 - Endereço 3 (192.168.105.10): Resposta inválida. C6
|
||||
25/11/2024 16:13:52:537 - Endereço 3 (192.168.105.10): Timeout ou erro ao receber resposta. GET=False, Parametro=NumPolos, Valor=10
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -25,7 +25,7 @@
|
|||
<meta name="viewport" content="width=device-width,
|
||||
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<style>
|
||||
#map_c0646fcc30e5ebc340aad57d9997eeaa {
|
||||
#map_de44fd37fbf21ae6dc8f3a06c1c22698 {
|
||||
position: relative;
|
||||
width: 100.0%;
|
||||
height: 100.0%;
|
||||
|
|
@ -39,14 +39,14 @@
|
|||
<body>
|
||||
|
||||
|
||||
<div class="folium-map" id="map_c0646fcc30e5ebc340aad57d9997eeaa" ></div>
|
||||
<div class="folium-map" id="map_de44fd37fbf21ae6dc8f3a06c1c22698" ></div>
|
||||
|
||||
</body>
|
||||
<script>
|
||||
|
||||
|
||||
var map_c0646fcc30e5ebc340aad57d9997eeaa = L.map(
|
||||
"map_c0646fcc30e5ebc340aad57d9997eeaa",
|
||||
var map_de44fd37fbf21ae6dc8f3a06c1c22698 = L.map(
|
||||
"map_de44fd37fbf21ae6dc8f3a06c1c22698",
|
||||
{
|
||||
center: [0.0, 0.0],
|
||||
crs: L.CRS.EPSG3857,
|
||||
|
|
@ -60,13 +60,13 @@
|
|||
|
||||
|
||||
|
||||
var tile_layer_a54cbd724f392a4729cd1021017950dd = L.tileLayer(
|
||||
var tile_layer_128bbe7678c39ac9692430482343ca46 = 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_a54cbd724f392a4729cd1021017950dd.addTo(map_c0646fcc30e5ebc340aad57d9997eeaa);
|
||||
tile_layer_128bbe7678c39ac9692430482343ca46.addTo(map_de44fd37fbf21ae6dc8f3a06c1c22698);
|
||||
|
||||
</script>
|
||||
|
||||
|
|
@ -87,7 +87,7 @@
|
|||
}
|
||||
trajeto_json_add({"features": []});
|
||||
|
||||
trajeto_json.addTo(map_c0646fcc30e5ebc340aad57d9997eeaa);
|
||||
trajeto_json.addTo(map_de44fd37fbf21ae6dc8f3a06c1c22698);
|
||||
|
||||
function adicionarGeometria(novaGeometria) {
|
||||
trajeto_json.addData(novaGeometria);
|
||||
|
|
@ -145,7 +145,7 @@
|
|||
|
||||
var marcadorDinamico = L.marker([0, 0], {
|
||||
icon: customIcon
|
||||
}).addTo(map_c0646fcc30e5ebc340aad57d9997eeaa);
|
||||
}).addTo(map_de44fd37fbf21ae6dc8f3a06c1c22698);
|
||||
|
||||
// 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_c0646fcc30e5ebc340aad57d9997eeaa.setView(novaPosicao, map_c0646fcc30e5ebc340aad57d9997eeaa.getZoom());
|
||||
map_de44fd37fbf21ae6dc8f3a06c1c22698.setView(novaPosicao, map_de44fd37fbf21ae6dc8f3a06c1c22698.getZoom());
|
||||
});
|
||||
|
||||
function calcularOrientacao(P1latitude, P1longitude, P2latitude, P2longitude) {
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -35,10 +35,7 @@ namespace AgroMonitor.Forms
|
|||
|
||||
private void frmAjustesOperacao_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (tmrDadosMapa != null)
|
||||
{
|
||||
tmrDadosMapa.Stop();
|
||||
}
|
||||
tmrDadosMapa?.Dispose();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -103,7 +100,7 @@ namespace AgroMonitor.Forms
|
|||
|
||||
if (tmrDadosMapa != null && !tmrDadosMapa.IsRunning)
|
||||
{
|
||||
tmrDadosMapa = new AsyncTaskTimerModel(tmrDadosMapa_Tick, 500, this);
|
||||
tmrDadosMapa = new AsyncTaskTimerModel("tmrDadosMapa", tmrDadosMapa_Tick, 500, this);
|
||||
tmrDadosMapa.Start();
|
||||
}
|
||||
}
|
||||
|
|
@ -167,7 +164,7 @@ namespace AgroMonitor.Forms
|
|||
|
||||
MessageBox.Show("Operação carregada com sucesso!", "Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
|
||||
tmrDadosMapa = new AsyncTaskTimerModel(tmrDadosMapa_Tick, 500, this);
|
||||
tmrDadosMapa = new AsyncTaskTimerModel("tmrDadosMapa", tmrDadosMapa_Tick, 500, this);
|
||||
tmrDadosMapa.Start();
|
||||
|
||||
await Task.Delay(1000);
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ namespace AgroMonitor
|
|||
|
||||
private void frmInicial_Load(object sender, EventArgs e)
|
||||
{
|
||||
tmrDispositivos = new AsyncTaskTimerModel(tmrDispositivos_Tick, 1000, this);
|
||||
tmrDispositivos = new AsyncTaskTimerModel("tmrDispositivos", tmrDispositivos_Tick, 1000, this);
|
||||
}
|
||||
|
||||
private void IniciarDependencias()
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace AgroMonitor.Forms
|
|||
|
||||
private void frmMonitoramento_Load(object sender, EventArgs e)
|
||||
{
|
||||
tmrLeituras = new AsyncTaskTimerModel(tmrLeituras_Tick, 1000, this);
|
||||
tmrLeituras = new AsyncTaskTimerModel("tmrLeituras", tmrLeituras_Tick, 1000, this);
|
||||
tmrLeituras.Start();
|
||||
|
||||
cmbTipoMovimento.Items.Clear();
|
||||
|
|
|
|||
Loading…
Reference in New Issue