adicionado codigo de falhas

This commit is contained in:
Diego Freitas 2024-10-03 15:21:30 -03:00
parent 5210a065c7
commit a24c16ca67
643 changed files with 157912 additions and 41802 deletions

4
.gitignore vendored
View File

@ -48,3 +48,7 @@ Thumbs.db
*.mov
*.wmv
# Ignorar a pasta Operacoes dentro da hierarquia completa
AgroBase/AgroBase/bin/Debug/Operacoes/
AgroBase/AgroBase/bin/Debug/Logs/
AgroBase/AgroBase/bin/Debug/Mapas/

Binary file not shown.

View File

@ -12,7 +12,7 @@
<OutputType>WinExe</OutputType>
<RootNamespace>AgroBase</RootNamespace>
<AssemblyName>AgroBase</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetPlatformVersion>10.0</TargetPlatformVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
@ -112,6 +112,10 @@
<Reference Include="OpenCvSharp.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<HintPath>..\packages\OpenCvSharp4.Extensions.4.10.0.20240616\lib\netstandard2.0\OpenCvSharp.Extensions.dll</HintPath>
</Reference>
<Reference Include="OpenHardwareMonitorLib, Version=0.9.6.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\OpenHardwareMonitorLib.dll</HintPath>
</Reference>
<Reference Include="OpenTK, Version=1.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\packages\OpenTK.1.1.2225.0\lib\net20\OpenTK.dll</HintPath>
</Reference>
@ -429,7 +433,6 @@
<Compile Include="Models\Variaveis.cs" />
<Compile Include="Models\Visualizador3DModel.cs" />
<Compile Include="Models\WT901CModel.cs" />
<Compile Include="Services\APIService.cs" />
<Compile Include="Services\BLD300RService.cs" />
<Compile Include="Services\CameraService.cs" />
<Compile Include="Services\CoulombCounterService.cs" />
@ -455,9 +458,7 @@
<Compile Include="Services\MqttService.cs" />
<Compile Include="Services\PythonService.cs" />
<Compile Include="Services\PZEMService.cs" />
<Compile Include="Services\RS485Service.cs" />
<Compile Include="Services\SerialService.cs" />
<Compile Include="Services\SocketService.cs" />
<Compile Include="Services\UltrasonicA05Service.cs" />
<Compile Include="Services\Visualizador3DService.cs" />
<Compile Include="Services\WT901CService.cs" />

View File

@ -1,25 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

View File

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;

View File

@ -50,6 +50,8 @@
this.picDiagnosticarTudo = new System.Windows.Forms.PictureBox();
this.picIniciarDiagnostico = new System.Windows.Forms.PictureBox();
this.picLoading = new System.Windows.Forms.PictureBox();
this.tabFalhas = new System.Windows.Forms.TabPage();
this.tvwFalhas = new System.Windows.Forms.TreeView();
this.tabControl1.SuspendLayout();
this.tabPulverizador.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgPulverizador)).BeginInit();
@ -72,6 +74,7 @@
((System.ComponentModel.ISupportInitialize)(this.picDiagnosticarTudo)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picIniciarDiagnostico)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picLoading)).BeginInit();
this.tabFalhas.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
@ -84,6 +87,7 @@
this.tabControl1.Controls.Add(this.tabCameras);
this.tabControl1.Controls.Add(this.tabSinaleiros);
this.tabControl1.Controls.Add(this.tabResultados);
this.tabControl1.Controls.Add(this.tabFalhas);
this.tabControl1.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabControl1.Location = new System.Drawing.Point(100, 12);
this.tabControl1.Name = "tabControl1";
@ -94,10 +98,10 @@
// tabPulverizador
//
this.tabPulverizador.Controls.Add(this.dgPulverizador);
this.tabPulverizador.Location = new System.Drawing.Point(4, 40);
this.tabPulverizador.Location = new System.Drawing.Point(4, 38);
this.tabPulverizador.Name = "tabPulverizador";
this.tabPulverizador.Padding = new System.Windows.Forms.Padding(3);
this.tabPulverizador.Size = new System.Drawing.Size(904, 532);
this.tabPulverizador.Size = new System.Drawing.Size(904, 534);
this.tabPulverizador.TabIndex = 0;
this.tabPulverizador.Text = "Pulverizador";
this.tabPulverizador.UseVisualStyleBackColor = true;
@ -117,10 +121,10 @@
// tabMovimentacao
//
this.tabMovimentacao.Controls.Add(this.dgMovimentacao);
this.tabMovimentacao.Location = new System.Drawing.Point(4, 34);
this.tabMovimentacao.Location = new System.Drawing.Point(4, 38);
this.tabMovimentacao.Name = "tabMovimentacao";
this.tabMovimentacao.Padding = new System.Windows.Forms.Padding(3);
this.tabMovimentacao.Size = new System.Drawing.Size(680, 418);
this.tabMovimentacao.Size = new System.Drawing.Size(904, 534);
this.tabMovimentacao.TabIndex = 1;
this.tabMovimentacao.Text = "Movimentação";
this.tabMovimentacao.UseVisualStyleBackColor = true;
@ -163,10 +167,10 @@
// tabSensoriamento
//
this.tabSensoriamento.Controls.Add(this.dgSensoriamento);
this.tabSensoriamento.Location = new System.Drawing.Point(4, 34);
this.tabSensoriamento.Location = new System.Drawing.Point(4, 38);
this.tabSensoriamento.Name = "tabSensoriamento";
this.tabSensoriamento.Padding = new System.Windows.Forms.Padding(3);
this.tabSensoriamento.Size = new System.Drawing.Size(680, 418);
this.tabSensoriamento.Size = new System.Drawing.Size(904, 534);
this.tabSensoriamento.TabIndex = 3;
this.tabSensoriamento.Text = "Sensoriamento";
this.tabSensoriamento.UseVisualStyleBackColor = true;
@ -186,10 +190,10 @@
// tabComunicacao
//
this.tabComunicacao.Controls.Add(this.dgComunicacao);
this.tabComunicacao.Location = new System.Drawing.Point(4, 34);
this.tabComunicacao.Location = new System.Drawing.Point(4, 38);
this.tabComunicacao.Name = "tabComunicacao";
this.tabComunicacao.Padding = new System.Windows.Forms.Padding(3);
this.tabComunicacao.Size = new System.Drawing.Size(680, 418);
this.tabComunicacao.Size = new System.Drawing.Size(904, 534);
this.tabComunicacao.TabIndex = 4;
this.tabComunicacao.Text = "Comunicação";
this.tabComunicacao.UseVisualStyleBackColor = true;
@ -210,10 +214,10 @@
//
this.tabCameras.Controls.Add(this.picCamera);
this.tabCameras.Controls.Add(this.dgCameras);
this.tabCameras.Location = new System.Drawing.Point(4, 34);
this.tabCameras.Location = new System.Drawing.Point(4, 38);
this.tabCameras.Name = "tabCameras";
this.tabCameras.Padding = new System.Windows.Forms.Padding(3);
this.tabCameras.Size = new System.Drawing.Size(680, 418);
this.tabCameras.Size = new System.Drawing.Size(904, 534);
this.tabCameras.TabIndex = 5;
this.tabCameras.Text = "Câmeras";
this.tabCameras.UseVisualStyleBackColor = true;
@ -242,10 +246,10 @@
// tabSinaleiros
//
this.tabSinaleiros.Controls.Add(this.dgSinaleiros);
this.tabSinaleiros.Location = new System.Drawing.Point(4, 34);
this.tabSinaleiros.Location = new System.Drawing.Point(4, 38);
this.tabSinaleiros.Name = "tabSinaleiros";
this.tabSinaleiros.Padding = new System.Windows.Forms.Padding(3);
this.tabSinaleiros.Size = new System.Drawing.Size(680, 418);
this.tabSinaleiros.Size = new System.Drawing.Size(904, 534);
this.tabSinaleiros.TabIndex = 6;
this.tabSinaleiros.Text = "Sinaleiros";
this.tabSinaleiros.UseVisualStyleBackColor = true;
@ -265,10 +269,10 @@
// tabResultados
//
this.tabResultados.Controls.Add(this.dgResultados);
this.tabResultados.Location = new System.Drawing.Point(4, 34);
this.tabResultados.Location = new System.Drawing.Point(4, 38);
this.tabResultados.Name = "tabResultados";
this.tabResultados.Padding = new System.Windows.Forms.Padding(3);
this.tabResultados.Size = new System.Drawing.Size(680, 418);
this.tabResultados.Size = new System.Drawing.Size(904, 534);
this.tabResultados.TabIndex = 7;
this.tabResultados.Text = "Resultados";
this.tabResultados.UseVisualStyleBackColor = true;
@ -327,6 +331,27 @@
this.picLoading.TabIndex = 15;
this.picLoading.TabStop = false;
//
// tabFalhas
//
this.tabFalhas.Controls.Add(this.tvwFalhas);
this.tabFalhas.Location = new System.Drawing.Point(4, 38);
this.tabFalhas.Name = "tabFalhas";
this.tabFalhas.Padding = new System.Windows.Forms.Padding(3);
this.tabFalhas.Size = new System.Drawing.Size(904, 534);
this.tabFalhas.TabIndex = 8;
this.tabFalhas.Text = "Cód. Falhas";
this.tabFalhas.UseVisualStyleBackColor = true;
//
// tvwFalhas
//
this.tvwFalhas.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tvwFalhas.Location = new System.Drawing.Point(6, 6);
this.tvwFalhas.Name = "tvwFalhas";
this.tvwFalhas.Size = new System.Drawing.Size(892, 522);
this.tvwFalhas.TabIndex = 0;
//
// frmDiagnosticos
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -365,6 +390,7 @@
((System.ComponentModel.ISupportInitialize)(this.picDiagnosticarTudo)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picIniciarDiagnostico)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picLoading)).EndInit();
this.tabFalhas.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -393,5 +419,7 @@
private System.Windows.Forms.DataGridView dgResultados;
private System.Windows.Forms.PictureBox picCamera;
private System.Windows.Forms.PictureBox picLoading;
private System.Windows.Forms.TabPage tabFalhas;
private System.Windows.Forms.TreeView tvwFalhas;
}
}

View File

@ -6,16 +6,10 @@ using AgroBase.Models.Modules;
using AgroBase.Services;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using static AgroBase.Models.Enums;
namespace AgroBase.Forms.IHM
@ -72,6 +66,8 @@ namespace AgroBase.Forms.IHM
await IniciarDiagnostico(tabControl1.SelectedIndex);
tabControl1.SelectedIndex = 6;
await IniciarDiagnostico(tabControl1.SelectedIndex);
tabControl1.SelectedIndex = 8;
await IniciarDiagnostico(tabControl1.SelectedIndex);
FinalizarDiagnostico();
picLoading.Image = null;
@ -183,11 +179,20 @@ namespace AgroBase.Forms.IHM
PreencherDadosDiagnosticoCameras(Diagnosticos.FirstOrDefault(x => x.Modulo == T_Code.Cam));
PreencherDadosDiagnosticoSinaleiros(Diagnosticos.FirstOrDefault(x => x.Modulo == T_Code.Sen));
PreencherDadosTabelaResultado(dgResultados);
OperacaoModel.PopularTreeView(tvwFalhas, Variaveis.OperacaoEmAndamento.RetornaCodigoFalha());
}
private async Task<bool> IniciarDiagnostico(int idx)
{
bool Sucesso = false;
if (idx == 8)
{
OperacaoModel.PopularTreeView(tvwFalhas, Variaveis.OperacaoEmAndamento.RetornaCodigoFalha());
return true;
}
var Diagnostico = Diagnosticos[idx];
Diagnostico.Testes.ForEach(x =>
{
@ -523,8 +528,8 @@ namespace AgroBase.Forms.IHM
{
Componente = x.Modulo_ID,
Teste = "Temperatura",
ValorPadrao = 85,
ComplementoValorPadrao = "<"
ValorPadrao = 10,
ComplementoValorPadrao = ">"
},
new ColunasDiagnosticoModel()
{
@ -598,10 +603,10 @@ namespace AgroBase.Forms.IHM
var Testes = Diagnostico.Testes;
TipoMovimentoDirecional _oldTipoMovimento = Variaveis.OperacaoEmAndamento.Controle.TipoMovimento;
int _oldRPM = Variaveis.OperacaoEmAndamento.Controle.RPM_SP;
double _oldPercentualVelocidade = Variaveis.OperacaoEmAndamento.Controle.PercentualVelocidadeSP;
Variaveis.OperacaoEmAndamento.Controle.TipoMovimento = TipoMovimentoDirecional.Diagnostico;
Variaveis.OperacaoEmAndamento.Controle.RPM_SP = 20;
Variaveis.OperacaoEmAndamento.Controle.PercentualVelocidadeSP = 20;
DispositivosService<MovimentacaoUnificadaModel> Dispositivo = (DispositivosService<MovimentacaoUnificadaModel>)Variaveis.DispositivosConectados.FirstOrDefault(x => x.Dispositivo == Enums.T_Code.Mvd);
@ -666,7 +671,7 @@ namespace AgroBase.Forms.IHM
}
Variaveis.OperacaoEmAndamento.Controle.TipoMovimento = _oldTipoMovimento;
Variaveis.OperacaoEmAndamento.Controle.RPM_SP = _oldRPM;
Variaveis.OperacaoEmAndamento.Controle.PercentualVelocidadeSP = _oldPercentualVelocidade;
return true;
}

View File

@ -61,6 +61,10 @@
this.lblModoOperacao = new System.Windows.Forms.Label();
this.txtModoOperacao = new System.Windows.Forms.TextBox();
this.pnlSensores = new System.Windows.Forms.Panel();
this.lblOperacaoLiberada = new System.Windows.Forms.Label();
this.txtOperacaoLiberada = new System.Windows.Forms.TextBox();
this.pnlOrientacao = new System.Windows.Forms.Panel();
this.pnlInclinacao = new System.Windows.Forms.Panel();
this.lblModoControle = new System.Windows.Forms.Label();
this.cmbModoControle = new System.Windows.Forms.ComboBox();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
@ -71,13 +75,14 @@
this.tabSensores = new System.Windows.Forms.TabPage();
this.tabControle = new System.Windows.Forms.TabPage();
this.pnlControle = new System.Windows.Forms.Panel();
this.tkbVelocidade = new System.Windows.Forms.TrackBar();
this.lblVelocidade = new System.Windows.Forms.Label();
this.pnlFreio = new System.Windows.Forms.Panel();
this.lblAnguloDirecional = new System.Windows.Forms.Label();
this.tkbAnguloDirecional = new System.Windows.Forms.TrackBar();
this.lblVelocidade = new System.Windows.Forms.Label();
this.tkbVelocidade = new System.Windows.Forms.TrackBar();
this.picFechar = new System.Windows.Forms.PictureBox();
this.pnlOrientacao = new System.Windows.Forms.Panel();
this.pnlInclinacao = new System.Windows.Forms.Panel();
this.lblCodFalha = new System.Windows.Forms.Label();
this.btnCodFalha = new System.Windows.Forms.Button();
this.pnlMapa.SuspendLayout();
this.pnlSensores.SuspendLayout();
this.statusStrip1.SuspendLayout();
@ -85,8 +90,8 @@
this.tabSensores.SuspendLayout();
this.tabControle.SuspendLayout();
this.pnlControle.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tkbVelocidade)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tkbAnguloDirecional)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tkbVelocidade)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picFechar)).BeginInit();
this.SuspendLayout();
//
@ -139,7 +144,7 @@
// txtStatusAtual
//
this.txtStatusAtual.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtStatusAtual.Location = new System.Drawing.Point(164, 37);
this.txtStatusAtual.Location = new System.Drawing.Point(164, 101);
this.txtStatusAtual.Name = "txtStatusAtual";
this.txtStatusAtual.ReadOnly = true;
this.txtStatusAtual.Size = new System.Drawing.Size(120, 26);
@ -149,7 +154,7 @@
// lblStatusAtual
//
this.lblStatusAtual.AutoSize = true;
this.lblStatusAtual.Location = new System.Drawing.Point(3, 40);
this.lblStatusAtual.Location = new System.Drawing.Point(3, 104);
this.lblStatusAtual.Name = "lblStatusAtual";
this.lblStatusAtual.Size = new System.Drawing.Size(97, 20);
this.lblStatusAtual.TabIndex = 5;
@ -158,7 +163,7 @@
// txtIniciadoEm
//
this.txtIniciadoEm.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtIniciadoEm.Location = new System.Drawing.Point(164, 69);
this.txtIniciadoEm.Location = new System.Drawing.Point(164, 133);
this.txtIniciadoEm.Name = "txtIniciadoEm";
this.txtIniciadoEm.ReadOnly = true;
this.txtIniciadoEm.Size = new System.Drawing.Size(120, 26);
@ -168,7 +173,7 @@
// lblIniciadoEm
//
this.lblIniciadoEm.AutoSize = true;
this.lblIniciadoEm.Location = new System.Drawing.Point(3, 72);
this.lblIniciadoEm.Location = new System.Drawing.Point(3, 136);
this.lblIniciadoEm.Name = "lblIniciadoEm";
this.lblIniciadoEm.Size = new System.Drawing.Size(92, 20);
this.lblIniciadoEm.TabIndex = 7;
@ -177,7 +182,7 @@
// txtConcluidoEm
//
this.txtConcluidoEm.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtConcluidoEm.Location = new System.Drawing.Point(164, 101);
this.txtConcluidoEm.Location = new System.Drawing.Point(164, 165);
this.txtConcluidoEm.Name = "txtConcluidoEm";
this.txtConcluidoEm.ReadOnly = true;
this.txtConcluidoEm.Size = new System.Drawing.Size(120, 26);
@ -187,7 +192,7 @@
// lblConcluidoEm
//
this.lblConcluidoEm.AutoSize = true;
this.lblConcluidoEm.Location = new System.Drawing.Point(3, 104);
this.lblConcluidoEm.Location = new System.Drawing.Point(3, 168);
this.lblConcluidoEm.Name = "lblConcluidoEm";
this.lblConcluidoEm.Size = new System.Drawing.Size(107, 20);
this.lblConcluidoEm.TabIndex = 9;
@ -196,7 +201,7 @@
// txtDistanciaPercorrida
//
this.txtDistanciaPercorrida.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtDistanciaPercorrida.Location = new System.Drawing.Point(164, 133);
this.txtDistanciaPercorrida.Location = new System.Drawing.Point(164, 197);
this.txtDistanciaPercorrida.Name = "txtDistanciaPercorrida";
this.txtDistanciaPercorrida.ReadOnly = true;
this.txtDistanciaPercorrida.Size = new System.Drawing.Size(120, 26);
@ -206,7 +211,7 @@
// lblDistanciaPercorrida
//
this.lblDistanciaPercorrida.AutoSize = true;
this.lblDistanciaPercorrida.Location = new System.Drawing.Point(3, 136);
this.lblDistanciaPercorrida.Location = new System.Drawing.Point(3, 200);
this.lblDistanciaPercorrida.Name = "lblDistanciaPercorrida";
this.lblDistanciaPercorrida.Size = new System.Drawing.Size(151, 20);
this.lblDistanciaPercorrida.TabIndex = 11;
@ -215,7 +220,7 @@
// txtTempoOperacao
//
this.txtTempoOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtTempoOperacao.Location = new System.Drawing.Point(164, 165);
this.txtTempoOperacao.Location = new System.Drawing.Point(164, 229);
this.txtTempoOperacao.Name = "txtTempoOperacao";
this.txtTempoOperacao.ReadOnly = true;
this.txtTempoOperacao.Size = new System.Drawing.Size(120, 26);
@ -225,7 +230,7 @@
// lblTempoOperacao
//
this.lblTempoOperacao.AutoSize = true;
this.lblTempoOperacao.Location = new System.Drawing.Point(3, 168);
this.lblTempoOperacao.Location = new System.Drawing.Point(3, 232);
this.lblTempoOperacao.Name = "lblTempoOperacao";
this.lblTempoOperacao.Size = new System.Drawing.Size(154, 20);
this.lblTempoOperacao.TabIndex = 13;
@ -234,7 +239,7 @@
// txtErvasIdentificadas
//
this.txtErvasIdentificadas.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtErvasIdentificadas.Location = new System.Drawing.Point(164, 197);
this.txtErvasIdentificadas.Location = new System.Drawing.Point(164, 261);
this.txtErvasIdentificadas.Name = "txtErvasIdentificadas";
this.txtErvasIdentificadas.ReadOnly = true;
this.txtErvasIdentificadas.Size = new System.Drawing.Size(120, 26);
@ -244,7 +249,7 @@
// lblErvasIdentificadas
//
this.lblErvasIdentificadas.AutoSize = true;
this.lblErvasIdentificadas.Location = new System.Drawing.Point(3, 200);
this.lblErvasIdentificadas.Location = new System.Drawing.Point(3, 264);
this.lblErvasIdentificadas.Name = "lblErvasIdentificadas";
this.lblErvasIdentificadas.Size = new System.Drawing.Size(144, 20);
this.lblErvasIdentificadas.TabIndex = 15;
@ -253,7 +258,7 @@
// txtHerbicidaAplicado
//
this.txtHerbicidaAplicado.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtHerbicidaAplicado.Location = new System.Drawing.Point(164, 229);
this.txtHerbicidaAplicado.Location = new System.Drawing.Point(164, 293);
this.txtHerbicidaAplicado.Name = "txtHerbicidaAplicado";
this.txtHerbicidaAplicado.ReadOnly = true;
this.txtHerbicidaAplicado.Size = new System.Drawing.Size(120, 26);
@ -263,7 +268,7 @@
// lblHerbicidaAplicado
//
this.lblHerbicidaAplicado.AutoSize = true;
this.lblHerbicidaAplicado.Location = new System.Drawing.Point(3, 232);
this.lblHerbicidaAplicado.Location = new System.Drawing.Point(3, 296);
this.lblHerbicidaAplicado.Name = "lblHerbicidaAplicado";
this.lblHerbicidaAplicado.Size = new System.Drawing.Size(141, 20);
this.lblHerbicidaAplicado.TabIndex = 17;
@ -272,7 +277,7 @@
// txtBateriaConsumida
//
this.txtBateriaConsumida.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtBateriaConsumida.Location = new System.Drawing.Point(164, 261);
this.txtBateriaConsumida.Location = new System.Drawing.Point(164, 325);
this.txtBateriaConsumida.Name = "txtBateriaConsumida";
this.txtBateriaConsumida.ReadOnly = true;
this.txtBateriaConsumida.Size = new System.Drawing.Size(120, 26);
@ -282,7 +287,7 @@
// lblBateriaConsumida
//
this.lblBateriaConsumida.AutoSize = true;
this.lblBateriaConsumida.Location = new System.Drawing.Point(3, 264);
this.lblBateriaConsumida.Location = new System.Drawing.Point(3, 328);
this.lblBateriaConsumida.Name = "lblBateriaConsumida";
this.lblBateriaConsumida.Size = new System.Drawing.Size(144, 20);
this.lblBateriaConsumida.TabIndex = 19;
@ -290,7 +295,7 @@
//
// pgbReservatorio
//
this.pgbReservatorio.Location = new System.Drawing.Point(164, 293);
this.pgbReservatorio.Location = new System.Drawing.Point(164, 357);
this.pgbReservatorio.Name = "pgbReservatorio";
this.pgbReservatorio.Size = new System.Drawing.Size(120, 26);
this.pgbReservatorio.TabIndex = 21;
@ -298,7 +303,7 @@
// lblReservatorio
//
this.lblReservatorio.AutoSize = true;
this.lblReservatorio.Location = new System.Drawing.Point(3, 299);
this.lblReservatorio.Location = new System.Drawing.Point(3, 363);
this.lblReservatorio.Name = "lblReservatorio";
this.lblReservatorio.Size = new System.Drawing.Size(127, 20);
this.lblReservatorio.TabIndex = 23;
@ -307,7 +312,7 @@
// lblBateria
//
this.lblBateria.AutoSize = true;
this.lblBateria.Location = new System.Drawing.Point(3, 331);
this.lblBateria.Location = new System.Drawing.Point(3, 395);
this.lblBateria.Name = "lblBateria";
this.lblBateria.Size = new System.Drawing.Size(88, 20);
this.lblBateria.TabIndex = 25;
@ -315,7 +320,7 @@
//
// pgbBateria
//
this.pgbBateria.Location = new System.Drawing.Point(164, 325);
this.pgbBateria.Location = new System.Drawing.Point(164, 389);
this.pgbBateria.Name = "pgbBateria";
this.pgbBateria.Size = new System.Drawing.Size(120, 26);
this.pgbBateria.TabIndex = 24;
@ -323,7 +328,7 @@
// lblOperacao
//
this.lblOperacao.AutoSize = true;
this.lblOperacao.Location = new System.Drawing.Point(3, 363);
this.lblOperacao.Location = new System.Drawing.Point(3, 427);
this.lblOperacao.Name = "lblOperacao";
this.lblOperacao.Size = new System.Drawing.Size(107, 20);
this.lblOperacao.TabIndex = 27;
@ -331,7 +336,7 @@
//
// pgbOperacao
//
this.pgbOperacao.Location = new System.Drawing.Point(164, 357);
this.pgbOperacao.Location = new System.Drawing.Point(164, 421);
this.pgbOperacao.Name = "pgbOperacao";
this.pgbOperacao.Size = new System.Drawing.Size(120, 26);
this.pgbOperacao.TabIndex = 26;
@ -339,7 +344,7 @@
// lblRuaAtual
//
this.lblRuaAtual.AutoSize = true;
this.lblRuaAtual.Location = new System.Drawing.Point(3, 395);
this.lblRuaAtual.Location = new System.Drawing.Point(3, 459);
this.lblRuaAtual.Name = "lblRuaAtual";
this.lblRuaAtual.Size = new System.Drawing.Size(108, 20);
this.lblRuaAtual.TabIndex = 29;
@ -347,7 +352,7 @@
//
// pgbRuaAtual
//
this.pgbRuaAtual.Location = new System.Drawing.Point(164, 389);
this.pgbRuaAtual.Location = new System.Drawing.Point(164, 453);
this.pgbRuaAtual.Name = "pgbRuaAtual";
this.pgbRuaAtual.Size = new System.Drawing.Size(120, 26);
this.pgbRuaAtual.TabIndex = 28;
@ -374,6 +379,10 @@
// pnlSensores
//
this.pnlSensores.AutoScroll = true;
this.pnlSensores.Controls.Add(this.btnCodFalha);
this.pnlSensores.Controls.Add(this.lblCodFalha);
this.pnlSensores.Controls.Add(this.lblOperacaoLiberada);
this.pnlSensores.Controls.Add(this.txtOperacaoLiberada);
this.pnlSensores.Controls.Add(this.pnlOrientacao);
this.pnlSensores.Controls.Add(this.pnlInclinacao);
this.pnlSensores.Controls.Add(this.lblModoOperacao);
@ -409,6 +418,49 @@
this.pnlSensores.Size = new System.Drawing.Size(307, 497);
this.pnlSensores.TabIndex = 32;
//
// lblOperacaoLiberada
//
this.lblOperacaoLiberada.AutoSize = true;
this.lblOperacaoLiberada.Location = new System.Drawing.Point(3, 40);
this.lblOperacaoLiberada.Name = "lblOperacaoLiberada";
this.lblOperacaoLiberada.Size = new System.Drawing.Size(145, 20);
this.lblOperacaoLiberada.TabIndex = 30;
this.lblOperacaoLiberada.Text = "Operação Liberada";
//
// txtOperacaoLiberada
//
this.txtOperacaoLiberada.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtOperacaoLiberada.Location = new System.Drawing.Point(164, 37);
this.txtOperacaoLiberada.Name = "txtOperacaoLiberada";
this.txtOperacaoLiberada.ReadOnly = true;
this.txtOperacaoLiberada.Size = new System.Drawing.Size(120, 26);
this.txtOperacaoLiberada.TabIndex = 31;
this.txtOperacaoLiberada.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// pnlOrientacao
//
this.pnlOrientacao.BackColor = System.Drawing.Color.White;
this.pnlOrientacao.BackgroundImage = global::AgroBase.Properties.Resources.rosa_dos_ventos;
this.pnlOrientacao.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pnlOrientacao.Location = new System.Drawing.Point(184, 502);
this.pnlOrientacao.Margin = new System.Windows.Forms.Padding(2);
this.pnlOrientacao.Name = "pnlOrientacao";
this.pnlOrientacao.Size = new System.Drawing.Size(100, 100);
this.pnlOrientacao.TabIndex = 12;
this.pnlOrientacao.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlOrientacao_Paint);
//
// pnlInclinacao
//
this.pnlInclinacao.BackColor = System.Drawing.Color.White;
this.pnlInclinacao.BackgroundImage = global::AgroBase.Properties.Resources.transferidor;
this.pnlInclinacao.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pnlInclinacao.Location = new System.Drawing.Point(7, 502);
this.pnlInclinacao.Margin = new System.Windows.Forms.Padding(2);
this.pnlInclinacao.Name = "pnlInclinacao";
this.pnlInclinacao.Size = new System.Drawing.Size(100, 100);
this.pnlInclinacao.TabIndex = 16;
this.pnlInclinacao.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlInclinacao_Paint);
//
// lblModoControle
//
this.lblModoControle.AutoSize = true;
@ -428,7 +480,6 @@
this.cmbModoControle.Name = "cmbModoControle";
this.cmbModoControle.Size = new System.Drawing.Size(120, 28);
this.cmbModoControle.TabIndex = 30;
this.cmbModoControle.SelectedIndexChanged += new System.EventHandler(this.cmbModoControle_SelectedIndexChanged_1);
//
// statusStrip1
//
@ -496,6 +547,7 @@
// pnlControle
//
this.pnlControle.AutoScroll = true;
this.pnlControle.Controls.Add(this.pnlFreio);
this.pnlControle.Controls.Add(this.lblAnguloDirecional);
this.pnlControle.Controls.Add(this.tkbAnguloDirecional);
this.pnlControle.Controls.Add(this.lblVelocidade);
@ -509,26 +561,13 @@
this.pnlControle.Size = new System.Drawing.Size(307, 497);
this.pnlControle.TabIndex = 0;
//
// tkbVelocidade
// pnlFreio
//
this.tkbVelocidade.Enabled = false;
this.tkbVelocidade.Location = new System.Drawing.Point(7, 98);
this.tkbVelocidade.Maximum = 100;
this.tkbVelocidade.Name = "tkbVelocidade";
this.tkbVelocidade.Size = new System.Drawing.Size(277, 45);
this.tkbVelocidade.TabIndex = 32;
this.tkbVelocidade.TickFrequency = 10;
this.tkbVelocidade.Value = 30;
this.tkbVelocidade.Scroll += new System.EventHandler(this.tkbVelocidade_Scroll);
//
// lblVelocidade
//
this.lblVelocidade.AutoSize = true;
this.lblVelocidade.Location = new System.Drawing.Point(3, 75);
this.lblVelocidade.Name = "lblVelocidade";
this.lblVelocidade.Size = new System.Drawing.Size(179, 20);
this.lblVelocidade.TabIndex = 33;
this.lblVelocidade.Text = "Velocidade: 30% 5 km/h";
this.pnlFreio.Location = new System.Drawing.Point(134, 272);
this.pnlFreio.Name = "pnlFreio";
this.pnlFreio.Size = new System.Drawing.Size(150, 150);
this.pnlFreio.TabIndex = 36;
this.pnlFreio.Visible = false;
//
// lblAnguloDirecional
//
@ -551,6 +590,27 @@
this.tkbAnguloDirecional.Value = 20;
this.tkbAnguloDirecional.Scroll += new System.EventHandler(this.tkbAnguloDirecional_Scroll);
//
// lblVelocidade
//
this.lblVelocidade.AutoSize = true;
this.lblVelocidade.Location = new System.Drawing.Point(3, 75);
this.lblVelocidade.Name = "lblVelocidade";
this.lblVelocidade.Size = new System.Drawing.Size(179, 20);
this.lblVelocidade.TabIndex = 33;
this.lblVelocidade.Text = "Velocidade: 30% 5 km/h";
//
// tkbVelocidade
//
this.tkbVelocidade.Enabled = false;
this.tkbVelocidade.Location = new System.Drawing.Point(7, 98);
this.tkbVelocidade.Maximum = 100;
this.tkbVelocidade.Name = "tkbVelocidade";
this.tkbVelocidade.Size = new System.Drawing.Size(277, 45);
this.tkbVelocidade.TabIndex = 32;
this.tkbVelocidade.TickFrequency = 10;
this.tkbVelocidade.Value = 30;
this.tkbVelocidade.Scroll += new System.EventHandler(this.tkbVelocidade_Scroll);
//
// picFechar
//
this.picFechar.Image = global::AgroBase.Properties.Resources.fechar;
@ -561,29 +621,24 @@
this.picFechar.TabIndex = 1;
this.picFechar.TabStop = false;
//
// pnlOrientacao
// lblCodFalha
//
this.pnlOrientacao.BackColor = System.Drawing.Color.White;
this.pnlOrientacao.BackgroundImage = global::AgroBase.Properties.Resources.rosa_dos_ventos;
this.pnlOrientacao.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pnlOrientacao.Location = new System.Drawing.Point(184, 438);
this.pnlOrientacao.Margin = new System.Windows.Forms.Padding(2);
this.pnlOrientacao.Name = "pnlOrientacao";
this.pnlOrientacao.Size = new System.Drawing.Size(100, 100);
this.pnlOrientacao.TabIndex = 12;
this.pnlOrientacao.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlOrientacao_Paint);
this.lblCodFalha.AutoSize = true;
this.lblCodFalha.Location = new System.Drawing.Point(3, 72);
this.lblCodFalha.Name = "lblCodFalha";
this.lblCodFalha.Size = new System.Drawing.Size(125, 20);
this.lblCodFalha.TabIndex = 32;
this.lblCodFalha.Text = "Código de Falha";
//
// pnlInclinacao
// btnCodFalha
//
this.pnlInclinacao.BackColor = System.Drawing.Color.White;
this.pnlInclinacao.BackgroundImage = global::AgroBase.Properties.Resources.transferidor;
this.pnlInclinacao.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pnlInclinacao.Location = new System.Drawing.Point(7, 438);
this.pnlInclinacao.Margin = new System.Windows.Forms.Padding(2);
this.pnlInclinacao.Name = "pnlInclinacao";
this.pnlInclinacao.Size = new System.Drawing.Size(100, 100);
this.pnlInclinacao.TabIndex = 16;
this.pnlInclinacao.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlInclinacao_Paint);
this.btnCodFalha.Location = new System.Drawing.Point(164, 69);
this.btnCodFalha.Name = "btnCodFalha";
this.btnCodFalha.Size = new System.Drawing.Size(120, 26);
this.btnCodFalha.TabIndex = 33;
this.btnCodFalha.Text = "0";
this.btnCodFalha.UseVisualStyleBackColor = true;
this.btnCodFalha.Click += new System.EventHandler(this.btnCodFalha_Click);
//
// frmDialogoMapa
//
@ -604,6 +659,8 @@
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "frmDialogoMapa";
this.TopMost = true;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmDialogoMapa_FormClosing);
this.Load += new System.EventHandler(this.frmDialogoMapa_Load);
this.pnlMapa.ResumeLayout(false);
this.pnlSensores.ResumeLayout(false);
this.pnlSensores.PerformLayout();
@ -614,8 +671,8 @@
this.tabControle.ResumeLayout(false);
this.pnlControle.ResumeLayout(false);
this.pnlControle.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.tkbVelocidade)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tkbAnguloDirecional)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tkbVelocidade)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picFechar)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -674,5 +731,10 @@
private System.Windows.Forms.TrackBar tkbVelocidade;
private System.Windows.Forms.Label lblAnguloDirecional;
private System.Windows.Forms.TrackBar tkbAnguloDirecional;
private System.Windows.Forms.Panel pnlFreio;
private System.Windows.Forms.Label lblOperacaoLiberada;
private System.Windows.Forms.TextBox txtOperacaoLiberada;
private System.Windows.Forms.Button btnCodFalha;
private System.Windows.Forms.Label lblCodFalha;
}
}

View File

@ -1,15 +1,10 @@
using AgroBase.Models;
using AgroBase.Models.Modules;
using AgroBase.Services;
using CefSharp.DevTools.CSS;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@ -17,7 +12,8 @@ namespace AgroBase.Forms.IHM
{
public partial class frmDialogoMapa : Form
{
Timer tmrLeitura = new Timer() { Interval = 500 };
System.Timers.Timer tmrLeitura = new System.Timers.Timer() { Interval = 500 };
private ulong CodigoFalha = 0;
public frmDialogoMapa()
{
@ -30,9 +26,9 @@ namespace AgroBase.Forms.IHM
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
pnlJoystick.GetType().GetMethod("SetStyle", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).Invoke(pnlJoystick, new object[] { ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true });
pnlFreio.GetType().GetMethod("SetStyle", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).Invoke(pnlFreio, new object[] { ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true });
tmrLeitura.Tick += tmrLeitura_Tick;
tmrLeitura.Start();
tmrLeitura.Elapsed += tmrLeitura_Elapsed;
cmbModoControle.Items.Clear();
cmbModoControle.Items.AddRange(Enum.GetNames(typeof(Enums.TipoMovimentoDirecional)));
@ -60,6 +56,18 @@ namespace AgroBase.Forms.IHM
});
}
private void frmDialogoMapa_Load(object sender, EventArgs e)
{
tmrLeitura.Start();
}
private void frmDialogoMapa_FormClosing(object sender, FormClosingEventArgs e)
{
tmrLeitura.Stop();
tmrLeitura.Elapsed -= tmrLeitura_Elapsed;
tmrLeitura.Dispose();
}
public async Task AtualizarRuasSelecionadas(List<string> ruasSelecionadas)
{
Variaveis.OperacaoEmAndamento.AtualizaListaCameras(pnlCameraCaminho, new List<Panel>(){ pnlCameraSoloE, pnlCameraSoloD }, true);
@ -70,58 +78,68 @@ namespace AgroBase.Forms.IHM
public void IniciarOperacao()
{
Variaveis.OperacaoEmAndamento.IniciarOperacao();
Task.Run(async () => {
await Variaveis.OperacaoEmAndamento.IniciarOperacao();
InicializarModoManual();
//InicializarModoManual();
});
}
private void tmrLeitura_Tick(object sender, EventArgs e)
private void tmrLeitura_Elapsed(object sender, EventArgs e)
{
pnlOrientacao.Invalidate();
pnlInclinacao.Invalidate();
pnlOrientacao.Invoke((MethodInvoker)delegate {
pnlOrientacao.Invalidate();
pnlInclinacao.Invalidate();
var ultimaLeitura = Variaveis.OperacaoEmAndamento.CamerasSolo.OrderByDescending(x => x.Leitura.timestamp).FirstOrDefault();
if (ultimaLeitura != null)
{
lblUltimaLeituraSolo.Text = "Última Leitura Solo: " + FuncoesGlobais.TimestampToDate(ultimaLeitura.Leitura.timestamp);
}
if (Variaveis.OperacaoEmAndamento.CameraCaminhoKinect != null)
{
lblUltimaLeituraCaminho.Text = "Última Leitura Caminho: " + FuncoesGlobais.TimestampToDate(Variaveis.OperacaoEmAndamento.CameraCaminhoKinect.Leitura.timestamp);
}
lblPerformance.Text = Variaveis.OperacaoEmAndamento.PerformanceStr;
var ultimaLeitura = Variaveis.OperacaoEmAndamento.CamerasSolo.OrderByDescending(x => x.Leitura.timestamp).FirstOrDefault();
if (ultimaLeitura != null)
{
lblUltimaLeituraSolo.Text = "Última Leitura Solo: " + FuncoesGlobais.TimestampToDate(ultimaLeitura.Leitura.timestamp);
}
if (Variaveis.OperacaoEmAndamento.CameraCaminhoKinect != null)
{
lblUltimaLeituraCaminho.Text = "Última Leitura Caminho: " + FuncoesGlobais.TimestampToDate(Variaveis.OperacaoEmAndamento.CameraCaminhoKinect.Leitura.timestamp);
}
lblPerformance.Text = Variaveis.OperacaoEmAndamento.PerformanceStr;
txtModoOperacao.Text = Variaveis.OperacaoEmAndamento.Modo.ToString();
txtStatusAtual.Text = Variaveis.OperacaoEmAndamento.StatusAtual.ToString();
txtIniciadoEm.Text = new DateTime(Variaveis.OperacaoEmAndamento.TimestampInicio).ToString("dd/MM HH:mm:ss");
txtConcluidoEm.Text = new DateTime(Variaveis.OperacaoEmAndamento.TimestampFim).ToString("dd/MM HH:mm:ss");
txtDistanciaPercorrida.Text = Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaPercorrida.Sum().ToString("0.00") + " m";
txtTempoOperacao.Text = Variaveis.OperacaoEmAndamento.Tempo.Hours.ToString("00") + ":" + Variaveis.OperacaoEmAndamento.Tempo.Minutes.ToString("00") + ":" + Variaveis.OperacaoEmAndamento.Tempo.Seconds.ToString("00");
txtErvasIdentificadas.Text = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ErvasIdentificadas.ToString("000");
txtHerbicidaAplicado.Text = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.HerbicidaConsumido.ToString("0.000") + " L";
txtBateriaConsumida.Text = Variaveis.OperacaoEmAndamento.Sensoriamento.BateriaConsumida.ToString("0.00") + "%";
lblMapaCarregado.Text = "Operação: " + Variaveis.OperacaoEmAndamento.Descricao;
FuncoesGlobais.PreencheValorProgressBar(pgbReservatorio, Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio);
lblReservatorio.Text = "Reservatório: " + (Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio < 0 ? 0 : Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio).ToString("0.00") + "%";
txtModoOperacao.Text = Variaveis.OperacaoEmAndamento.Modo.ToString();
bool opLiberada = Variaveis.OperacaoEmAndamento.OperacaoLiberada;
txtOperacaoLiberada.Text = opLiberada ? "Sim" : "Não";
txtOperacaoLiberada.ForeColor = opLiberada ? Color.Black : Color.Red;
CodigoFalha = Variaveis.OperacaoEmAndamento.RetornaCodigoFalha();
btnCodFalha.Text = CodigoFalha.ToString();
txtStatusAtual.Text = Variaveis.OperacaoEmAndamento.StatusAtual.ToString();
txtIniciadoEm.Text = Variaveis.OperacaoEmAndamento.TimestampInicio == 0 ? "Aguardando" : new DateTime(Variaveis.OperacaoEmAndamento.TimestampInicio).ToString("dd/MM HH:mm:ss");
txtConcluidoEm.Text = Variaveis.OperacaoEmAndamento.TimestampFim == 0 ? "Aguardando" : new DateTime(Variaveis.OperacaoEmAndamento.TimestampFim).ToString("dd/MM HH:mm:ss");
txtDistanciaPercorrida.Text = Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaPercorrida.Sum().ToString("0.00") + " m";
txtTempoOperacao.Text = Variaveis.OperacaoEmAndamento.Tempo.Hours.ToString("00") + ":" + Variaveis.OperacaoEmAndamento.Tempo.Minutes.ToString("00") + ":" + Variaveis.OperacaoEmAndamento.Tempo.Seconds.ToString("00");
txtErvasIdentificadas.Text = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ErvasIdentificadas.ToString();
txtHerbicidaAplicado.Text = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.HerbicidaConsumido.ToString("0.000") + " L";
txtBateriaConsumida.Text = Variaveis.OperacaoEmAndamento.Sensoriamento.BateriaConsumida.ToString("0.00") + " %";
FuncoesGlobais.PreencheValorProgressBar(pgbBateria, Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria);
lblBateria.Text = "Bateria: " + (PZEMService.Iniciado && PZEMService.UltimaLeitura != null ? PZEMService.UltimaLeitura.Tensao.ToString("0.00") + "v " + PZEMService.UltimaLeitura.Corrente.ToString("0.00") + "A " : "") + (Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria < 0 ? 0 : Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria).ToString("0.00") + "%";
FuncoesGlobais.PreencheValorProgressBar(pgbReservatorio, Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio);
lblReservatorio.Text = "Reservatório: " + (Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio < 0 ? 0 : Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio).ToString("0.00") + "%";
FuncoesGlobais.PreencheValorProgressBar(pgbOperacao, Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoTrajeto);
lblOperacao.Text = "Operação: " + (Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoTrajeto < 0 ? 0 : Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoTrajeto).ToString("0.00") + "%";
FuncoesGlobais.PreencheValorProgressBar(pgbRuaAtual, Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoRua);
lblRuaAtual.Text = "Rua Atual: " + (Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoRua < 0 ? 0 : Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoRua).ToString("0.00") + "%";
FuncoesGlobais.PreencheValorProgressBar(pgbBateria, Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria);
lblBateria.Text = "Bateria: " + (PZEMService.Iniciado && PZEMService.UltimaLeitura != null ? PZEMService.UltimaLeitura.Tensao.ToString("0.00") + "v " + PZEMService.UltimaLeitura.Corrente.ToString("0.00") + "A " : "") + (Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria < 0 ? 0 : Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria).ToString("0.00") + "%";
if (Variaveis.OperacaoEmAndamento.Modo != Enums.ModoOperacao.Manual)
{
cmbModoControle.SelectedIndex = (int)Variaveis.OperacaoEmAndamento.Controle.TipoMovimento;
FuncoesGlobais.PreencheValorProgressBar(pgbOperacao, Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoTrajeto);
lblOperacao.Text = "Operação: " + (Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoTrajeto < 0 ? 0 : Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoTrajeto).ToString("0.00") + "%";
FuncoesGlobais.PreencheValorProgressBar(pgbRuaAtual, Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoRua);
lblRuaAtual.Text = "Rua Atual: " + (Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoRua < 0 ? 0 : Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoRua).ToString("0.00") + "%";
double Percentual = (Variaveis.OperacaoEmAndamento.Controle.RPM_SP / (Variaveis.OperacaoEmAndamento.Controle.RPM_Max / VariaveisEquipamento.RelacaoRPM)) * 100.0;
tkbVelocidade.Value = Convert.ToInt32(Percentual);
if (Variaveis.OperacaoEmAndamento.Modo != Enums.ModoOperacao.Manual)
{
cmbModoControle.SelectedIndex = (int)Variaveis.OperacaoEmAndamento.Controle.TipoMovimento;
tkbAnguloDirecional.Value = Math.Abs(Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.Angulo));
}
double Percentual = (Variaveis.OperacaoEmAndamento.Controle.RPM_SP / VariaveisEquipamento.RPM_Max_Roda) * 100.0;
tkbVelocidade.Value = Convert.ToInt32(Percentual);
tkbAnguloDirecional.Value = Math.Abs(Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.Angulo));
}
});
}
private void pnlOrientacao_Paint(object sender, PaintEventArgs e)
@ -154,6 +172,11 @@ namespace AgroBase.Forms.IHM
private int joystickRadius;
private Point joystickPosition;
private Point freioPosition;
private Point freioStartPosition;
private bool isDraggingFreio = false;
private bool isBrakeLocked = false;
private void AtualizarElementosModoManual()
{
cmbModoControle.Enabled = false;
@ -161,18 +184,19 @@ namespace AgroBase.Forms.IHM
tkbVelocidade.Enabled = false;
pnlJoystick.Visible = false;
cmbModoControle.SelectedIndex = (int)Variaveis.OperacaoEmAndamento.Controle.TipoMovimento;
tkbAnguloDirecional.Minimum = 0;
tkbAnguloDirecional.Maximum = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.Angulo_Max);
tkbAnguloDirecional.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.Angulo);
FuncoesGlobais.PreencheValorTrackBar(tkbAnguloDirecional, Variaveis.OperacaoEmAndamento.Controle.Angulo);
double Percentual = (Variaveis.OperacaoEmAndamento.Controle.RPM_SP / (Variaveis.OperacaoEmAndamento.Controle.RPM_Max / VariaveisEquipamento.RelacaoRPM)) * 100.0;
tkbVelocidade.Value = Convert.ToInt32(Percentual);
FuncoesGlobais.PreencheValorTrackBar(tkbVelocidade, Variaveis.OperacaoEmAndamento.Controle.PercentualVelocidadeSP);
tkbVelocidade_Scroll(null, null);
tkbAnguloDirecional_Scroll(null, null);
}
private void InicializarModoManual()
public void InicializarModoManual()
{
AtualizarElementosModoManual();
@ -190,9 +214,10 @@ namespace AgroBase.Forms.IHM
tkbAnguloDirecional.Enabled = true;
pnlJoystick.Visible = true;
pnlFreio.Visible = true;
// Configurar o painel do joystick
pnlJoystick.BackColor = Color.FromArgb(128, 0, 0, 0); // Fundo semitransparente
pnlJoystick.BackColor = Color.LightGray; // Fundo semitransparente
// Definir região circular para o painel
System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
@ -214,12 +239,26 @@ namespace AgroBase.Forms.IHM
pnlJoystick.MouseMove += PanelJoystickBack_MouseMove;
pnlJoystick.MouseUp += PanelJoystickBack_MouseUp;
pnlFreio.BackColor = Color.LightGray;
pnlFreio.BorderStyle = BorderStyle.FixedSingle;
// Eventos de toque/pressão
pnlFreio.Paint += BrakePanel_Paint;
pnlFreio.MouseDown += BrakePanel_MouseDown;
pnlFreio.MouseMove += BrakePanel_MouseMove;
pnlFreio.MouseUp += BrakePanel_MouseUp;
// Configuração inicial do freio
freioStartPosition = new Point(pnlFreio.Width / 2 - 20, 10);
freioPosition = freioStartPosition;
Variaveis.OperacaoEmAndamento.AtualizaListaCameras(pnlCameraCaminho, new List<Panel>() { pnlCameraSoloE, pnlCameraSoloD }, true);
IniciarOperacao();
}
}
#region JOYSTICK
private void PanelJoystickBack_Paint(object sender, PaintEventArgs e)
{
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
@ -300,22 +339,104 @@ namespace AgroBase.Forms.IHM
}
}
private void CmbModoControle_SelectedIndexChanged(object sender, EventArgs e)
#endregion
#region FREIO
// Desenho do trilho e trava no painel do freio
private void BrakePanel_Paint(object sender, PaintEventArgs e)
{
Variaveis.OperacaoEmAndamento.Controle.TipoMovimento = (Enums.TipoMovimentoDirecional)cmbModoControle.SelectedIndex;
Panel panel = sender as Panel;
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
// Desenhar trilha do freio (trajetória vertical)
e.Graphics.DrawLine(new Pen(Color.Black, 5), panel.Width / 2, 10, panel.Width / 2, panel.Height - 50);
// Desenhar a área de trava (na lateral direita)
e.Graphics.DrawRectangle(new Pen(Color.Blue, 3), panel.Width - 30, panel.Height - 60, 20, 40);
// Desenhar o botão de freio atual
e.Graphics.FillEllipse(Brushes.Red, freioPosition.X, freioPosition.Y, 40, 40);
}
private void cmbModoControle_SelectedIndexChanged_1(object sender, EventArgs e)
// Iniciar o arraste
private void BrakePanel_MouseDown(object sender, MouseEventArgs e)
{
if (new Rectangle(freioPosition.X, freioPosition.Y, 40, 40).Contains(e.Location))
{
isDraggingFreio = true;
}
}
// Movimentar o botão de freio
private void BrakePanel_MouseMove(object sender, MouseEventArgs e)
{
if (isDraggingFreio)
{
// Calcula a posição ao arrastar
int deltaY = e.Y - freioPosition.Y;
int newPosX = freioPosition.X;
int newPosY = freioPosition.Y + deltaY;
// Limitar o movimento do freio ao trilho e destravar se o usuário mover para fora da trava
if (!isBrakeLocked || (isBrakeLocked && e.X < pnlFreio.Width - 30))
{
isBrakeLocked = false; // Destrava o freio se mover para fora
// Restringe o movimento vertical dentro da área do trilho
if (newPosY >= 10 && newPosY <= pnlFreio.Height - 50)
{
freioPosition = new Point(newPosX, newPosY);
pnlFreio.Invalidate(); // Redesenha o painel
// Enviar comando de freio
GeneralJoystick.EnviaComandoMotor(Keys.Space, Enums.T_Code.Mov);
}
}
// Verifica se o usuário está na área de trava
if (freioPosition.Y >= pnlFreio.Height - 90 && e.X >= pnlFreio.Width - 30)
{
isBrakeLocked = true; // Freio travado
freioPosition = new Point(pnlFreio.Width - 40, pnlFreio.Height - 60); // Posiciona o freio na trava
pnlFreio.Invalidate();
}
}
}
// Soltar o botão de freio
private void BrakePanel_MouseUp(object sender, MouseEventArgs e)
{
isDraggingFreio = false;
if (!isBrakeLocked)
{
// Se o freio não estiver travado, retorna à posição inicial
freioPosition = freioStartPosition;
pnlFreio.Invalidate(); // Redesenha o painel
// Enviar comando para desativar o freio
GeneralJoystick.EnviaComandoMotor(Keys.Escape, Enums.T_Code.Mov);
}
else
{
// Freio travado, mantém travado
GeneralJoystick.EnviaComandoMotor(Keys.Space, Enums.T_Code.Mov);
}
}
#endregion
private void CmbModoControle_SelectedIndexChanged(object sender, EventArgs e)
{
Variaveis.OperacaoEmAndamento.Controle.TipoMovimento = (Enums.TipoMovimentoDirecional)cmbModoControle.SelectedIndex;
}
private void tkbVelocidade_Scroll(object sender, EventArgs e)
{
double RPM = (tkbVelocidade.Value / 100.0) * Variaveis.OperacaoEmAndamento.Controle.RPM_Max / VariaveisEquipamento.RelacaoRPM;
double RPM = (tkbVelocidade.Value / 100.0) * VariaveisEquipamento.RPM_Max_Roda;
double Velocidade = MovimentacaoModel.CalculaVelocidadeRPM(RPM);
Variaveis.OperacaoEmAndamento.Controle.RPM_SP = Convert.ToInt32(RPM);
Variaveis.OperacaoEmAndamento.Controle.PercentualVelocidadeSP = tkbVelocidade.Value;
lblVelocidade.Text = $"Velocidade: {tkbVelocidade.Value}% {Velocidade.ToString("0.00")} km/h";
}
@ -330,6 +451,11 @@ namespace AgroBase.Forms.IHM
#endregion
private void btnCodFalha_Click(object sender, EventArgs e)
{
string DescricaoFalha = OperacaoModel.DescricaoCodigoFalha(CodigoFalha);
MessageBox.Show($"{DescricaoFalha}", "Código de Falha", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}

View File

@ -60,6 +60,8 @@
this.lblD_A05 = new System.Windows.Forms.Label();
this.lblStatus = new System.Windows.Forms.Label();
this.lblVersao = new System.Windows.Forms.Label();
this.lblOperacaoLiberada = new System.Windows.Forms.Label();
this.lblCodigoFalha = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.picManual)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picDiagnosticos)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picOperacao)).BeginInit();
@ -120,7 +122,7 @@
this.lblMqtt.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.lblMqtt.AutoSize = true;
this.lblMqtt.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblMqtt.Location = new System.Drawing.Point(473, 578);
this.lblMqtt.Location = new System.Drawing.Point(473, 508);
this.lblMqtt.Name = "lblMqtt";
this.lblMqtt.Size = new System.Drawing.Size(114, 13);
this.lblMqtt.TabIndex = 13;
@ -318,7 +320,7 @@
this.lblDesligar.AutoSize = true;
this.lblDesligar.BackColor = System.Drawing.Color.Transparent;
this.lblDesligar.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblDesligar.Location = new System.Drawing.Point(850, 517);
this.lblDesligar.Location = new System.Drawing.Point(850, 383);
this.lblDesligar.Name = "lblDesligar";
this.lblDesligar.Size = new System.Drawing.Size(102, 24);
this.lblDesligar.TabIndex = 36;
@ -329,7 +331,7 @@
this.lblModoManual.AutoSize = true;
this.lblModoManual.BackColor = System.Drawing.Color.Transparent;
this.lblModoManual.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblModoManual.Location = new System.Drawing.Point(489, 517);
this.lblModoManual.Location = new System.Drawing.Point(489, 383);
this.lblModoManual.Name = "lblModoManual";
this.lblModoManual.Size = new System.Drawing.Size(153, 24);
this.lblModoManual.TabIndex = 38;
@ -339,7 +341,7 @@
//
this.picManual.Cursor = System.Windows.Forms.Cursors.Default;
this.picManual.Image = global::AgroBase.Properties.Resources.joystick;
this.picManual.Location = new System.Drawing.Point(491, 364);
this.picManual.Location = new System.Drawing.Point(491, 230);
this.picManual.Name = "picManual";
this.picManual.Size = new System.Drawing.Size(150, 150);
this.picManual.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
@ -383,7 +385,7 @@
//
this.picDesligar.Cursor = System.Windows.Forms.Cursors.Default;
this.picDesligar.Image = global::AgroBase.Properties.Resources.desligar;
this.picDesligar.Location = new System.Drawing.Point(827, 364);
this.picDesligar.Location = new System.Drawing.Point(827, 230);
this.picDesligar.Name = "picDesligar";
this.picDesligar.Size = new System.Drawing.Size(150, 150);
this.picDesligar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
@ -416,11 +418,11 @@
this.lblStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.lblStatus.AutoSize = true;
this.lblStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblStatus.Location = new System.Drawing.Point(933, 578);
this.lblStatus.Location = new System.Drawing.Point(473, 558);
this.lblStatus.Name = "lblStatus";
this.lblStatus.Size = new System.Drawing.Size(44, 13);
this.lblStatus.Size = new System.Drawing.Size(84, 13);
this.lblStatus.TabIndex = 40;
this.lblStatus.Text = "Iniciado";
this.lblStatus.Text = "Sistema Iniciado";
//
// lblVersao
//
@ -433,12 +435,37 @@
this.lblVersao.TabIndex = 41;
this.lblVersao.Text = "v 0";
//
// lblOperacaoLiberada
//
this.lblOperacaoLiberada.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.lblOperacaoLiberada.AutoSize = true;
this.lblOperacaoLiberada.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblOperacaoLiberada.Location = new System.Drawing.Point(473, 481);
this.lblOperacaoLiberada.Name = "lblOperacaoLiberada";
this.lblOperacaoLiberada.Size = new System.Drawing.Size(124, 13);
this.lblOperacaoLiberada.TabIndex = 42;
this.lblOperacaoLiberada.Text = "Operação Liberada: Não";
//
// lblCodigoFalha
//
this.lblCodigoFalha.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.lblCodigoFalha.AutoSize = true;
this.lblCodigoFalha.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblCodigoFalha.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblCodigoFalha.Location = new System.Drawing.Point(473, 534);
this.lblCodigoFalha.Name = "lblCodigoFalha";
this.lblCodigoFalha.Size = new System.Drawing.Size(96, 13);
this.lblCodigoFalha.TabIndex = 43;
this.lblCodigoFalha.Text = "Código de Falha: 0";
//
// frmIHM
//
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1024, 600);
this.Controls.Add(this.lblCodigoFalha);
this.Controls.Add(this.lblOperacaoLiberada);
this.Controls.Add(this.lblVersao);
this.Controls.Add(this.lblStatus);
this.Controls.Add(this.lblD_A05);
@ -523,5 +550,7 @@
private System.Windows.Forms.Label lblD_A05;
public System.Windows.Forms.Label lblStatus;
public System.Windows.Forms.Label lblVersao;
private System.Windows.Forms.Label lblOperacaoLiberada;
private System.Windows.Forms.Label lblCodigoFalha;
}
}

View File

@ -1,17 +1,11 @@
using AgroBase.Comum;
using AgroBase.Forms.Operacoes;
using AgroBase.Forms.Operacoes;
using AgroBase.Models;
using AgroBase.Services;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using System.Windows.Forms;
using static AgroBase.Models.Enums;
@ -21,6 +15,7 @@ namespace AgroBase.Forms.IHM
public partial class frmIHM : Form
{
System.Timers.Timer tmrDispositivos = new System.Timers.Timer() { Interval = 1000, Enabled = false };
public ulong CodFalha = 0;
public frmIHM()
{
@ -47,8 +42,8 @@ namespace AgroBase.Forms.IHM
if (Variaveis.OperacaoEmAndamento.OperacaoLiberada)
{
frmDialogoMapa frm = new frmDialogoMapa();
frm.ShowDialog();
frm.IniciarOperacao();
frm.Show();
frm.InicializarModoManual();
}
else
{
@ -76,10 +71,22 @@ namespace AgroBase.Forms.IHM
lblVersao.Text = "v " + Variaveis.Versao;
tmrDispositivos.Elapsed += TmrDispositivos_Elapsed;
tmrDispositivos.Start();
lblCodigoFalha.Click += LblCodigoFalha_Click;
}
private void TmrDispositivos_Elapsed(object sender, ElapsedEventArgs e)
private void LblCodigoFalha_Click(object sender, EventArgs e)
{
string DescricaoFalha = OperacaoModel.DescricaoCodigoFalha(CodFalha);
MessageBox.Show($"{DescricaoFalha}", "Código de Falha", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private async void TmrDispositivos_Elapsed(object sender, ElapsedEventArgs e)
{
((System.Timers.Timer)sender).Stop();
CodFalha = Variaveis.OperacaoEmAndamento.RetornaCodigoFalha();
Func<bool> funcao = new Func<bool>(() =>
{
var Labels = this.Controls.OfType<Label>().Where(y => y.Name.Contains("lblD_")).ToList();
@ -125,15 +132,22 @@ namespace AgroBase.Forms.IHM
Variaveis.DispositivosConectados.Where(x => x.Dados.GetStatusConexao()).ToList().ForEach(x => x.AcaoDesconectar());
}
lblMqtt.Text = "MQTT: " + (Variaveis.MqttService.StatusConexao() ? "Conectado" : "Desconectado");
lblMqtt.ForeColor = Variaveis.MqttService.StatusConexao() ? Color.Green : Color.Red;
bool mqttConectado = Variaveis.MqttService.StatusConexao();
lblMqtt.Text = "MQTT: " + (mqttConectado ? "Conectado" : "Desconectado");
lblMqtt.ForeColor = mqttConectado ? Color.Green : Color.Red;
bool opLiberada = Variaveis.OperacaoEmAndamento.OperacaoLiberada;
lblOperacaoLiberada.Text = "Operação Liberada: " + (opLiberada ? "Sim" : "Não");
lblOperacaoLiberada.ForeColor = opLiberada ? Color.Green : Color.Red;
lblCodigoFalha.Text = $"Código de Falha: {CodFalha}";
return true;
});
FuncoesGlobais.ExecutarMetodoComVerificacaoCrossThread(this, funcao);
Task.Run(async () => await SerialService.RealizarVarreduraPortasUSB(tmrDispositivos));
await SerialService.RealizarVarreduraPortasUSB(tmrDispositivos);
((System.Timers.Timer)sender).Start();
}
private void lblModulo_Click(object sender, EventArgs e)

View File

@ -2,13 +2,10 @@
using AgroBase.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static AgroBase.Models.Enums;

View File

@ -34,7 +34,6 @@ namespace AgroBase.Forms.Movimentacao
private int MaxLeituras = 1;
private string VideoPorta = VariaveisPortas.CameraCaminho.ToString();
private string VideoUrl = "street_detector";
private string SocketPorta = VariaveisPortas.SocketCaminho.ToString();
private bool MostrarDebug = true;
private string ArquivoLeitura = "leitura_solo.json";

View File

@ -30,6 +30,8 @@ namespace AgroBase.Forms.Movimentacao
private void InitializeComponent()
{
this.gpbSentido = new System.Windows.Forms.GroupBox();
this.cmbTipoMovimento = new System.Windows.Forms.ComboBox();
this.lblTipoMovimento = new System.Windows.Forms.Label();
this.gpbDF = new System.Windows.Forms.GroupBox();
this.lblDFEndereco = new System.Windows.Forms.Label();
this.txtDFEndereco = new System.Windows.Forms.TextBox();
@ -38,21 +40,21 @@ namespace AgroBase.Forms.Movimentacao
this.lblDFTras = new System.Windows.Forms.Label();
this.lblDFFrente = new System.Windows.Forms.Label();
this.gpbEF = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.lblEFEndereco = new System.Windows.Forms.Label();
this.txtEFEndereco = new System.Windows.Forms.TextBox();
this.cmbEFFrente = new System.Windows.Forms.ComboBox();
this.cmbEFTras = new System.Windows.Forms.ComboBox();
this.lblEFTras = new System.Windows.Forms.Label();
this.lblEFFrente = new System.Windows.Forms.Label();
this.gpbDT = new System.Windows.Forms.GroupBox();
this.label3 = new System.Windows.Forms.Label();
this.lblDTEndereco = new System.Windows.Forms.Label();
this.txtDTEndereco = new System.Windows.Forms.TextBox();
this.cmbDTFrente = new System.Windows.Forms.ComboBox();
this.cmbDTTras = new System.Windows.Forms.ComboBox();
this.lblDTTras = new System.Windows.Forms.Label();
this.lblDTFrente = new System.Windows.Forms.Label();
this.gpbET = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.lblETEndereco = new System.Windows.Forms.Label();
this.txtETEndereco = new System.Windows.Forms.TextBox();
this.cmbETFrente = new System.Windows.Forms.ComboBox();
this.cmbETTras = new System.Windows.Forms.ComboBox();
@ -70,8 +72,8 @@ namespace AgroBase.Forms.Movimentacao
this.nudNumPolos = new System.Windows.Forms.NumericUpDown();
this.lblRampa = new System.Windows.Forms.Label();
this.nudRampa = new System.Windows.Forms.NumericUpDown();
this.lblTipoMovimento = new System.Windows.Forms.Label();
this.cmbTipoMovimento = new System.Windows.Forms.ComboBox();
this.lblOffsetLeitura = new System.Windows.Forms.Label();
this.txtOffsetLeitura = new System.Windows.Forms.TextBox();
this.gpbSentido.SuspendLayout();
this.gpbDF.SuspendLayout();
this.gpbEF.SuspendLayout();
@ -102,6 +104,25 @@ namespace AgroBase.Forms.Movimentacao
this.gpbSentido.TabStop = false;
this.gpbSentido.Text = "Sentido de giro";
//
// cmbTipoMovimento
//
this.cmbTipoMovimento.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbTipoMovimento.FormattingEnabled = true;
this.cmbTipoMovimento.Location = new System.Drawing.Point(195, 18);
this.cmbTipoMovimento.Name = "cmbTipoMovimento";
this.cmbTipoMovimento.Size = new System.Drawing.Size(168, 21);
this.cmbTipoMovimento.TabIndex = 11;
this.cmbTipoMovimento.SelectedIndexChanged += new System.EventHandler(this.cmbTipoMovimento_SelectedIndexChanged);
//
// lblTipoMovimento
//
this.lblTipoMovimento.AutoSize = true;
this.lblTipoMovimento.Location = new System.Drawing.Point(15, 21);
this.lblTipoMovimento.Name = "lblTipoMovimento";
this.lblTipoMovimento.Size = new System.Drawing.Size(98, 13);
this.lblTipoMovimento.TabIndex = 10;
this.lblTipoMovimento.Text = "Tipo de Movimento";
//
// gpbDF
//
this.gpbDF.Controls.Add(this.lblDFEndereco);
@ -178,7 +199,7 @@ namespace AgroBase.Forms.Movimentacao
//
// gpbEF
//
this.gpbEF.Controls.Add(this.label1);
this.gpbEF.Controls.Add(this.lblEFEndereco);
this.gpbEF.Controls.Add(this.txtEFEndereco);
this.gpbEF.Controls.Add(this.cmbEFFrente);
this.gpbEF.Controls.Add(this.cmbEFTras);
@ -193,15 +214,15 @@ namespace AgroBase.Forms.Movimentacao
this.gpbEF.TabStop = false;
this.gpbEF.Text = "M2 - Esquerdo Frente (EF)";
//
// label1
// lblEFEndereco
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(10, 78);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(53, 13);
this.label1.TabIndex = 11;
this.label1.Text = "Endereço";
this.lblEFEndereco.AutoSize = true;
this.lblEFEndereco.Location = new System.Drawing.Point(10, 78);
this.lblEFEndereco.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblEFEndereco.Name = "lblEFEndereco";
this.lblEFEndereco.Size = new System.Drawing.Size(53, 13);
this.lblEFEndereco.TabIndex = 11;
this.lblEFEndereco.Text = "Endereço";
//
// txtEFEndereco
//
@ -252,7 +273,7 @@ namespace AgroBase.Forms.Movimentacao
//
// gpbDT
//
this.gpbDT.Controls.Add(this.label3);
this.gpbDT.Controls.Add(this.lblDTEndereco);
this.gpbDT.Controls.Add(this.txtDTEndereco);
this.gpbDT.Controls.Add(this.cmbDTFrente);
this.gpbDT.Controls.Add(this.cmbDTTras);
@ -267,15 +288,15 @@ namespace AgroBase.Forms.Movimentacao
this.gpbDT.TabStop = false;
this.gpbDT.Text = "M3 - Direito Trás (DT)";
//
// label3
// lblDTEndereco
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(10, 78);
this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(53, 13);
this.label3.TabIndex = 11;
this.label3.Text = "Endereço";
this.lblDTEndereco.AutoSize = true;
this.lblDTEndereco.Location = new System.Drawing.Point(10, 78);
this.lblDTEndereco.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblDTEndereco.Name = "lblDTEndereco";
this.lblDTEndereco.Size = new System.Drawing.Size(53, 13);
this.lblDTEndereco.TabIndex = 11;
this.lblDTEndereco.Text = "Endereço";
//
// txtDTEndereco
//
@ -326,7 +347,7 @@ namespace AgroBase.Forms.Movimentacao
//
// gpbET
//
this.gpbET.Controls.Add(this.label2);
this.gpbET.Controls.Add(this.lblETEndereco);
this.gpbET.Controls.Add(this.txtETEndereco);
this.gpbET.Controls.Add(this.cmbETFrente);
this.gpbET.Controls.Add(this.cmbETTras);
@ -341,15 +362,15 @@ namespace AgroBase.Forms.Movimentacao
this.gpbET.TabStop = false;
this.gpbET.Text = "M1 - Esquerdo Trás (ET)";
//
// label2
// lblETEndereco
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(10, 78);
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(53, 13);
this.label2.TabIndex = 11;
this.label2.Text = "Endereço";
this.lblETEndereco.AutoSize = true;
this.lblETEndereco.Location = new System.Drawing.Point(10, 78);
this.lblETEndereco.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblETEndereco.Name = "lblETEndereco";
this.lblETEndereco.Size = new System.Drawing.Size(53, 13);
this.lblETEndereco.TabIndex = 11;
this.lblETEndereco.Text = "Endereço";
//
// txtETEndereco
//
@ -400,6 +421,8 @@ namespace AgroBase.Forms.Movimentacao
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtOffsetLeitura);
this.groupBox1.Controls.Add(this.lblOffsetLeitura);
this.groupBox1.Controls.Add(this.lblReducao);
this.groupBox1.Controls.Add(this.nudReducao);
this.groupBox1.Controls.Add(this.btnSalvar);
@ -572,24 +595,25 @@ namespace AgroBase.Forms.Movimentacao
this.nudRampa.TabIndex = 31;
this.nudRampa.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblTipoMovimento
// lblOffsetLeitura
//
this.lblTipoMovimento.AutoSize = true;
this.lblTipoMovimento.Location = new System.Drawing.Point(15, 21);
this.lblTipoMovimento.Name = "lblTipoMovimento";
this.lblTipoMovimento.Size = new System.Drawing.Size(98, 13);
this.lblTipoMovimento.TabIndex = 10;
this.lblTipoMovimento.Text = "Tipo de Movimento";
this.lblOffsetLeitura.AutoSize = true;
this.lblOffsetLeitura.Location = new System.Drawing.Point(188, 67);
this.lblOffsetLeitura.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblOffsetLeitura.Name = "lblOffsetLeitura";
this.lblOffsetLeitura.Size = new System.Drawing.Size(87, 13);
this.lblOffsetLeitura.TabIndex = 140;
this.lblOffsetLeitura.Text = "Offset Leitura (%)";
//
// cmbTipoMovimento
// txtOffsetLeitura
//
this.cmbTipoMovimento.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbTipoMovimento.FormattingEnabled = true;
this.cmbTipoMovimento.Location = new System.Drawing.Point(195, 18);
this.cmbTipoMovimento.Name = "cmbTipoMovimento";
this.cmbTipoMovimento.Size = new System.Drawing.Size(168, 21);
this.cmbTipoMovimento.TabIndex = 11;
this.cmbTipoMovimento.SelectedIndexChanged += new System.EventHandler(this.cmbTipoMovimento_SelectedIndexChanged);
this.txtOffsetLeitura.Location = new System.Drawing.Point(191, 84);
this.txtOffsetLeitura.Margin = new System.Windows.Forms.Padding(2);
this.txtOffsetLeitura.Name = "txtOffsetLeitura";
this.txtOffsetLeitura.Size = new System.Drawing.Size(85, 20);
this.txtOffsetLeitura.TabIndex = 12;
this.txtOffsetLeitura.Text = "0,74";
this.txtOffsetLeitura.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// frmMovConfig
//
@ -660,16 +684,18 @@ namespace AgroBase.Forms.Movimentacao
private System.Windows.Forms.NumericUpDown nudDiametroRoda;
private System.Windows.Forms.Label lblDFEndereco;
private System.Windows.Forms.TextBox txtDFEndereco;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lblEFEndereco;
private System.Windows.Forms.TextBox txtEFEndereco;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label lblDTEndereco;
private System.Windows.Forms.TextBox txtDTEndereco;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label lblETEndereco;
private System.Windows.Forms.TextBox txtETEndereco;
private System.Windows.Forms.Label lblReducao;
private System.Windows.Forms.NumericUpDown nudReducao;
private System.Windows.Forms.NumericUpDown nudNumPolos;
private System.Windows.Forms.ComboBox cmbTipoMovimento;
private System.Windows.Forms.Label lblTipoMovimento;
private System.Windows.Forms.TextBox txtOffsetLeitura;
private System.Windows.Forms.Label lblOffsetLeitura;
}
}

View File

@ -2,8 +2,6 @@
using AgroBase.Models;
using AgroBase.Models.Modules;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Windows.Forms;
using static AgroBase.Models.Enums;
@ -71,6 +69,7 @@ namespace AgroBase.Forms.Movimentacao
nudRampa.Value = Modulo.MovMotor.Rampa;
nudRPMMax.Value = Modulo.MovMotor.RPM_Max;
nudReducao.Value = Modulo.MovMotor.Reducao;
txtOffsetLeitura.Text = Modulo.MovMotor.OffsetLeitura.ToString();
TextBox txtEndereco = FuncoesGlobais.FindControlRecursive<TextBox>(gpbSentido, "txt" + Modulo.Modulo_ID + "Endereco");
txtEndereco.Text = Modulo.MovMotor.Endereco;
@ -114,6 +113,7 @@ namespace AgroBase.Forms.Movimentacao
Modulo.MovMotor.Rampa = Convert.ToInt32(nudRampa.Value);
Modulo.MovMotor.RPM_Max = Convert.ToInt32(nudRPMMax.Value);
Modulo.MovMotor.Reducao = Convert.ToInt32(nudReducao.Value);
Modulo.MovMotor.OffsetLeitura = Convert.ToDouble(txtOffsetLeitura.Text);
VariaveisEquipamento.DiametroRoda = Convert.ToDouble(nudDiametroRoda.Value / 1000);

View File

@ -29,173 +29,50 @@ namespace AgroBase.Forms
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMovDiagnosticos));
this.picRobo = new System.Windows.Forms.PictureBox();
this.dgvET = new System.Windows.Forms.DataGridView();
this.dgvEF = new System.Windows.Forms.DataGridView();
this.dgvDT = new System.Windows.Forms.DataGridView();
this.dgvDF = new System.Windows.Forms.DataGridView();
this.lblM1 = new System.Windows.Forms.Label();
this.lblM2 = new System.Windows.Forms.Label();
this.lblM3 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.btnIniciar = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.picRobo)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgvET)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgvEF)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgvDT)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgvDF)).BeginInit();
this.tvwFalhas = new System.Windows.Forms.TreeView();
this.btnAtualizar = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// picRobo
// tvwFalhas
//
this.picRobo.Image = ((System.Drawing.Image)(resources.GetObject("picRobo.Image")));
this.picRobo.Location = new System.Drawing.Point(424, 66);
this.picRobo.Name = "picRobo";
this.picRobo.Size = new System.Drawing.Size(353, 486);
this.picRobo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picRobo.TabIndex = 0;
this.picRobo.TabStop = false;
//
// dgvET
//
this.dgvET.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.tvwFalhas.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvET.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvET.Location = new System.Drawing.Point(12, 365);
this.dgvET.Name = "dgvET";
this.dgvET.RowHeadersWidth = 51;
this.dgvET.RowTemplate.Height = 24;
this.dgvET.Size = new System.Drawing.Size(406, 187);
this.dgvET.TabIndex = 1;
this.tvwFalhas.Location = new System.Drawing.Point(12, 12);
this.tvwFalhas.Name = "tvwFalhas";
this.tvwFalhas.Size = new System.Drawing.Size(877, 449);
this.tvwFalhas.TabIndex = 0;
//
// dgvEF
// btnAtualizar
//
this.dgvEF.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvEF.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvEF.Location = new System.Drawing.Point(12, 66);
this.dgvEF.Name = "dgvEF";
this.dgvEF.RowHeadersWidth = 51;
this.dgvEF.RowTemplate.Height = 24;
this.dgvEF.Size = new System.Drawing.Size(406, 187);
this.dgvEF.TabIndex = 2;
//
// dgvDT
//
this.dgvDT.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvDT.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvDT.Location = new System.Drawing.Point(783, 365);
this.dgvDT.Name = "dgvDT";
this.dgvDT.RowHeadersWidth = 51;
this.dgvDT.RowTemplate.Height = 24;
this.dgvDT.Size = new System.Drawing.Size(406, 187);
this.dgvDT.TabIndex = 3;
//
// dgvDF
//
this.dgvDF.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvDF.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvDF.Location = new System.Drawing.Point(783, 66);
this.dgvDF.Name = "dgvDF";
this.dgvDF.RowHeadersWidth = 51;
this.dgvDF.RowTemplate.Height = 24;
this.dgvDF.Size = new System.Drawing.Size(406, 187);
this.dgvDF.TabIndex = 4;
//
// lblM1
//
this.lblM1.AutoSize = true;
this.lblM1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblM1.Location = new System.Drawing.Point(7, 337);
this.lblM1.Name = "lblM1";
this.lblM1.Size = new System.Drawing.Size(231, 25);
this.lblM1.TabIndex = 5;
this.lblM1.Text = "M1 - Esquerdo Trás (ET)";
//
// lblM2
//
this.lblM2.AutoSize = true;
this.lblM2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblM2.Location = new System.Drawing.Point(12, 38);
this.lblM2.Name = "lblM2";
this.lblM2.Size = new System.Drawing.Size(246, 25);
this.lblM2.TabIndex = 6;
this.lblM2.Text = "M2 - Esquerdo Frente (EF)";
//
// lblM3
//
this.lblM3.AutoSize = true;
this.lblM3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblM3.Location = new System.Drawing.Point(778, 337);
this.lblM3.Name = "lblM3";
this.lblM3.Size = new System.Drawing.Size(203, 25);
this.lblM3.TabIndex = 7;
this.lblM3.Text = "M3 - Direito Trás (DT)";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(778, 38);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(218, 25);
this.label1.TabIndex = 8;
this.label1.Text = "M4 - Direito Frente (DF)";
//
// btnIniciar
//
this.btnIniciar.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnIniciar.Location = new System.Drawing.Point(424, 558);
this.btnIniciar.Name = "btnIniciar";
this.btnIniciar.Size = new System.Drawing.Size(353, 48);
this.btnIniciar.TabIndex = 9;
this.btnIniciar.Text = "Iniciar Diagnósticos";
this.btnIniciar.UseVisualStyleBackColor = true;
this.btnIniciar.Click += new System.EventHandler(this.btnIniciar_Click);
this.btnAtualizar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnAtualizar.Location = new System.Drawing.Point(814, 467);
this.btnAtualizar.Name = "btnAtualizar";
this.btnAtualizar.Size = new System.Drawing.Size(75, 23);
this.btnAtualizar.TabIndex = 1;
this.btnAtualizar.Text = "Atualizar";
this.btnAtualizar.UseVisualStyleBackColor = true;
this.btnAtualizar.Click += new System.EventHandler(this.btnAtualizar_Click);
//
// frmMovDiagnosticos
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1201, 618);
this.Controls.Add(this.btnIniciar);
this.Controls.Add(this.label1);
this.Controls.Add(this.lblM3);
this.Controls.Add(this.lblM2);
this.Controls.Add(this.lblM1);
this.Controls.Add(this.dgvDF);
this.Controls.Add(this.dgvDT);
this.Controls.Add(this.dgvEF);
this.Controls.Add(this.dgvET);
this.Controls.Add(this.picRobo);
this.ClientSize = new System.Drawing.Size(901, 502);
this.Controls.Add(this.btnAtualizar);
this.Controls.Add(this.tvwFalhas);
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Name = "frmMovDiagnosticos";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Diagnósticos";
this.Load += new System.EventHandler(this.frmDiagnosticos_Load);
((System.ComponentModel.ISupportInitialize)(this.picRobo)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgvET)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgvEF)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgvDT)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgvDF)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.PictureBox picRobo;
private System.Windows.Forms.DataGridView dgvET;
private System.Windows.Forms.DataGridView dgvEF;
private System.Windows.Forms.DataGridView dgvDT;
private System.Windows.Forms.DataGridView dgvDF;
private System.Windows.Forms.Label lblM1;
private System.Windows.Forms.Label lblM2;
private System.Windows.Forms.Label lblM3;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnIniciar;
private System.Windows.Forms.TreeView tvwFalhas;
private System.Windows.Forms.Button btnAtualizar;
}
}

View File

@ -1,32 +1,11 @@
using AgroBase.Comum;
using AgroBase.Models;
using AgroBase.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static AgroBase.Models.Enums;
namespace AgroBase.Forms
{
public partial class frmMovDiagnosticos : Form
{
public static Timer tmrLeitura = new Timer() { Enabled = false, Interval = 500 };
public List<DataGridView> Tabelas = new List<DataGridView>();
public static DispositivosService<MovimentacaoModel> DispMov;
List<string> ListaPinosDiagnosticar = new List<string>()
{
"DIR",
"BRK",
"STP",
"PWM",
"Sensor"
};
public frmMovDiagnosticos()
{
InitializeComponent();
@ -34,68 +13,12 @@ namespace AgroBase.Forms
private void frmDiagnosticos_Load(object sender, EventArgs e)
{
Tabelas = new List<DataGridView>() { dgvET, dgvEF, dgvDF, dgvDT };
tmrLeitura.Tick += tmrLeitura_Tick;
PopularGrids();
btnAtualizar_Click(sender, e);
}
private void PopularGrids()
private void btnAtualizar_Click(object sender, EventArgs e)
{
foreach (var dgv in Tabelas)
{
dgv.RowHeadersVisible = false;
dgv.Columns.Clear();
dgv.Rows.Clear();
dgv.Columns.Add("cl_Pino", "Pino");
for (int i = 1; i < 10; i++)
{
dgv.Columns.Add("cl_Teste" + i, "Teste " + i);
}
foreach (var pino in ListaPinosDiagnosticar)
{
dgv.Rows.Add(new string[] { pino });
}
}
}
private void PreencherDadosGrid(MovSensoriamentoMotor Motor)
{
DataGridView dgv = Tabelas.FirstOrDefault(x => x.Name == "dgv" + Motor.ID);
if (dgv != null)
{
SensoriamentoMotorTestes Log = Motor.LogTestes.OrderByDescending(x => x.Momento).FirstOrDefault();
int indexColuna = Motor.LogTestes.Count(x => x.Componente == Log.Componente);
int indexLinha = ListaPinosDiagnosticar.IndexOf(Log.Componente);
dgv.Rows[indexLinha].Cells[indexColuna].Value = Log.Resultado + " - " + Log.Comando + " - " + Log.Leitura;
}
}
private void btnIniciar_Click(object sender, EventArgs e)
{
DispMov = (DispositivosService<MovimentacaoModel>)Variaveis.DispositivosConectados.FirstOrDefault(x => x._Porta.IsOpen && x.Dispositivo == T_Code.Mov);
if (DispMov == null)
{
return;
}
foreach (var Motor in DispMov.Dados.Motores)
{
string ProtocoloMotor = Motor.ProtocoloTeste();
DispMov.AdicionarMensagemFila(DispMov.Dados.Modulo_ID, ProtocoloMotor, true, true);
System.Threading.Thread.Sleep(10);
}
tmrLeitura.Enabled = true;
}
private void tmrLeitura_Tick(object sender, EventArgs e)
{
MovSensoriamentoMotor Motor = DispMov.Dados.Motores.FirstOrDefault(x => x.Comandar && x.Testando);
if (Motor != null)
{
PreencherDadosGrid(Motor);
}
tmrLeitura.Enabled = DispMov.Dados.Motores.Any(x => x.Testando);
OperacaoModel.PopularTreeView(tvwFalhas, Variaveis.OperacaoEmAndamento.RetornaCodigoFalha());
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -59,26 +59,63 @@ namespace AgroBase.Forms.Operacoes
Variaveis.OperacaoEmAndamento.FinalizarOperacao();
}
private void btnIniciarOperacao_Click(object sender, EventArgs e)
private async void btnIniciarOperacao_Click(object sender, EventArgs e)
{
if (btnIniciarOperacao.Text == "Finalizar Operação")
{
// Atualiza a UI na thread principal
btnIniciarOperacao.Invoke((MethodInvoker)delegate
{
btnIniciarOperacao.Text = "Finalizando...";
btnIniciarOperacao.Enabled = false;
});
// Executa a finalização da operação
Variaveis.OperacaoEmAndamento.FinalizarOperacao();
// Atualiza a UI novamente na thread principal
btnIniciarOperacao.Invoke((MethodInvoker)delegate
{
btnIniciarOperacao.Text = "Iniciar Operação";
btnIniciarOperacao.Enabled = true;
});
}
else
{
// Atualiza a UI na thread principal
btnIniciarOperacao.Invoke((MethodInvoker)delegate
{
btnIniciarOperacao.Text = "Iniciando...";
btnIniciarOperacao.Enabled = false;
});
// Verifica se a operação está liberada
if (Variaveis.OperacaoEmAndamento.OperacaoLiberada)
{
Variaveis.OperacaoEmAndamento.IniciarOperacao(null, false);
// Inicia a operação de forma assíncrona
await Variaveis.OperacaoEmAndamento.IniciarOperacao(null, false);
// Atualiza a UI após o início da operação
btnIniciarOperacao.Invoke((MethodInvoker)delegate
{
btnIniciarOperacao.Text = "Finalizar Operação";
btnIniciarOperacao.Enabled = true;
});
}
else
{
MessageBox.Show("Finalize a parametrização corretamente para iniciar a operação!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
// Mostra a mensagem de erro na thread principal
btnIniciarOperacao.Invoke((MethodInvoker)delegate
{
MessageBox.Show("Finalize a parametrização corretamente para iniciar a operação!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
btnIniciarOperacao.Text = "Iniciar Operação";
btnIniciarOperacao.Enabled = true;
});
}
}
btnIniciarOperacao.Text = !Variaveis.OperacaoEmAndamento.Iniciado ? "Iniciar Operação" : "Finalizar Operação";
}
private void tmrLeitura_Tick(object sender, EventArgs e)
{
AtualizarDados();

View File

@ -143,29 +143,32 @@ namespace AgroBase.Forms.Operacoes
private void btnIniciarOperacao_Click(object sender, EventArgs e)
{
if (!Variaveis.OperacaoEmAndamento.Mapa.RuasPercorrer.Any())
Task.Run(async () =>
{
MessageBox.Show("Selecione as ruas para realizar a operação!");
return;
}
if (btnIniciarOperacao.Text == "Finalizar Operação")
{
Variaveis.OperacaoEmAndamento.FinalizarOperacao();
}
else
{
if (Variaveis.OperacaoEmAndamento.OperacaoLiberada && Variaveis.OperacaoEmAndamento.Mapa.DistanciaTotal > 0 && Variaveis.OperacaoEmAndamento.Mapa.RuasPercorrer.Any())
if (!Variaveis.OperacaoEmAndamento.Mapa.RuasPercorrer.Any())
{
//Variaveis.OperacaoEmAndamento.DispAtu.Dados.BombaPressurizadora.PressaoSP = Convert.ToDouble(nudPressaoSP.Value);
Variaveis.OperacaoEmAndamento.IniciarOperacao(null, false);
MessageBox.Show("Selecione as ruas para realizar a operação!");
return;
}
if (btnIniciarOperacao.Text == "Finalizar Operação")
{
Variaveis.OperacaoEmAndamento.FinalizarOperacao();
}
else
{
MessageBox.Show("Finalize a parametrização corretamente para iniciar a operação!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
if (Variaveis.OperacaoEmAndamento.OperacaoLiberada && Variaveis.OperacaoEmAndamento.Mapa.DistanciaTotal > 0 && Variaveis.OperacaoEmAndamento.Mapa.RuasPercorrer.Any())
{
//Variaveis.OperacaoEmAndamento.DispAtu.Dados.BombaPressurizadora.PressaoSP = Convert.ToDouble(nudPressaoSP.Value);
await Variaveis.OperacaoEmAndamento.IniciarOperacao(null, false);
}
else
{
MessageBox.Show("Finalize a parametrização corretamente para iniciar a operação!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
AtualizaComponentesOperacao();
AtualizaComponentesOperacao();
});
}
private void AtualizaComponentesOperacao()

View File

@ -669,7 +669,7 @@ namespace AgroBase.Forms.Operacoes
//
this.lblPerformance.AutoSize = true;
this.lblPerformance.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblPerformance.Location = new System.Drawing.Point(812, 684);
this.lblPerformance.Location = new System.Drawing.Point(615, 687);
this.lblPerformance.Name = "lblPerformance";
this.lblPerformance.Size = new System.Drawing.Size(158, 12);
this.lblPerformance.TabIndex = 16;

View File

@ -60,7 +60,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 = Variaveis.OperacaoEmAndamento.tmrLogs.Interval / 1000;
nudTemposalvarlog.Value = (decimal)OperacaoModel.tmrLogsInterval / 1000;
nudQtdBicos.Value = Variaveis.OperacaoEmAndamento.DispAtu.Dados.QuantidadeBicos;
nudQtdCameras.Value = Variaveis.OperacaoEmAndamento.QuantidadeCamerasSolo;
nudCapacidadereservatorio.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.CapacidadeReservatorio);
@ -127,7 +127,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);
Variaveis.OperacaoEmAndamento.tmrLogs.Interval = (int)(nudTemposalvarlog.Value * 1000);
OperacaoModel.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;

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +1,15 @@
using AgroBase.Models;
using AgroBase.Properties;
using AgroBase.Services;
using CefSharp.DevTools.Page;
using Emgu.CV;
using Newtonsoft.Json;
using OpenTK;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using OpenTK.Graphics.OpenGL;
namespace AgroBase.Forms.Operacoes
{
@ -65,6 +56,7 @@ namespace AgroBase.Forms.Operacoes
GraficoInterativoModel graficoMovVelocidade;
GraficoInterativoModel graficoAtu;
GraficoInterativoModel graficoSen;
GraficoInterativoModel graficoCpu;
public frmResultadosOperacao()
@ -125,7 +117,7 @@ namespace AgroBase.Forms.Operacoes
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Arquivos de Operação|*.lgop";
ofd.InitialDirectory = Application.StartupPath + Variaveis.CaminhoOperacoes;
ofd.InitialDirectory = Application.StartupPath + "\\" + Variaveis.CaminhoOperacoes;
if (ofd.ShowDialog() == DialogResult.OK)
{
OperacaoDadosModel data = JsonConvert.DeserializeObject<OperacaoDadosModel>(File.ReadAllText(ofd.FileName));
@ -188,30 +180,58 @@ namespace AgroBase.Forms.Operacoes
},
new GraficoInterativoSerieModel()
{
Titulo = "EF",
Titulo = "EF Roda",
Valores = LogsMovimentacao.Where(x => x.Modulo_ID == "EF").Select(x => x.RPM_Roda).ToList(),
Visivel = true,
MostrarValor = true
},
new GraficoInterativoSerieModel()
{
Titulo = "EF Motor",
Valores = LogsMovimentacao.Where(x => x.Modulo_ID == "EF").Select(x => x.RPM_Motor).ToList(),
Visivel = false,
MostrarValor = true
},
new GraficoInterativoSerieModel()
{
Titulo = "ET Roda",
Valores = LogsMovimentacao.Where(x => x.Modulo_ID == "ET").Select(x => x.RPM_Roda).ToList(),
Visivel = true,
MostrarValor = true
},
new GraficoInterativoSerieModel()
{
Titulo = "ET",
Titulo = "ET Motor",
Valores = LogsMovimentacao.Where(x => x.Modulo_ID == "ET").Select(x => x.RPM_Motor).ToList(),
Visivel = false,
MostrarValor = true
},
new GraficoInterativoSerieModel()
{
Titulo = "DT Roda",
Valores = LogsMovimentacao.Where(x => x.Modulo_ID == "DT").Select(x => x.RPM_Roda).ToList(),
Visivel = true,
MostrarValor = true
},
new GraficoInterativoSerieModel()
{
Titulo = "DT",
Titulo = "DT Motor",
Valores = LogsMovimentacao.Where(x => x.Modulo_ID == "DT").Select(x => x.RPM_Motor).ToList(),
Visivel = false,
MostrarValor = true
},
new GraficoInterativoSerieModel()
{
Titulo = "DF Roda",
Valores = LogsMovimentacao.Where(x => x.Modulo_ID == "DF").Select(x => x.RPM_Roda).ToList(),
Visivel = true,
MostrarValor = true
},
new GraficoInterativoSerieModel()
{
Titulo = "DF",
Titulo = "DF Motor",
Valores = LogsMovimentacao.Where(x => x.Modulo_ID == "DF").Select(x => x.RPM_Motor).ToList(),
Visivel = true,
Visivel = false,
MostrarValor = true
},
});
@ -427,12 +447,54 @@ namespace AgroBase.Forms.Operacoes
Visivel = true,
}
});
graficoCpu = new GraficoInterativoModel(chartCpu, Momentos, new List<GraficoInterativoSerieModel>()
{
new GraficoInterativoSerieModel()
{
Titulo = "CPU %",
Valores = LogsOperacao.Select(x => (double)(x?.CPU_load ?? 0)).ToList(),
Visivel = true,
},
new GraficoInterativoSerieModel()
{
Titulo = "GPU %",
Valores = LogsOperacao.Select(x => (double)(x?.GPU_load ?? 0)).ToList(),
Visivel = true,
},
new GraficoInterativoSerieModel()
{
Titulo = "HDD %",
Valores = LogsOperacao.Select(x => (double)(x?.HDD_load ?? 0)).ToList(),
Visivel = true,
},
new GraficoInterativoSerieModel()
{
Titulo = "RAM %",
Valores = LogsOperacao.Select(x => (double)(x?.RAM_usage ?? 0)).ToList(),
Visivel = true,
},
new GraficoInterativoSerieModel()
{
Titulo = "CPU Temp",
Valores = LogsOperacao.Select(x => (double)(x?.CPU_temp ?? 0)).ToList(),
Visivel = true,
},
new GraficoInterativoSerieModel()
{
Titulo = "GPU Temp",
Valores = LogsOperacao.Select(x => (double)(x?.GPU_temp ?? 0)).ToList(),
Visivel = true,
},
});
}
private void InicializarCombosBusca()
{
CarregarInformacoesBusca(gpbMOV_Geral_Filtro, graficoMovGeral.Series.Select(x => x.Titulo).ToArray());
CarregarInformacoesBusca(gpbSEN_Filtro, graficoSen.Series.Select(x => x.Titulo).ToArray());
CarregarInformacoesBusca(gpbCpu_Filtro, graficoCpu.Series.Select(x => x.Titulo).ToArray());
}
private void CarregarInformacoesBusca(GroupBox gpb, string[] Componentes)
@ -516,6 +578,10 @@ namespace AgroBase.Forms.Operacoes
{
grafico = graficoMovGeral;
}
if (gpb.Name.Contains("Cpu"))
{
grafico = graficoCpu;
}
if (grafico != null)
{
var Dados = grafico.Series.FirstOrDefault(x => x.Titulo == cmbComponente.Text).Valores.Select((x, i) => new { valor = x, idx = i }).ToList();
@ -583,6 +649,8 @@ namespace AgroBase.Forms.Operacoes
AtualizarInformacoesSensoriamento();
AtualizarInformacoesKinect();
AtualizarInformacoesCPU();
}
private void AtualizarInformacoesOperacao()
@ -601,8 +669,13 @@ namespace AgroBase.Forms.Operacoes
txtErvasNoRadar.Text = Log.ErvasNoRadar.ToString();
txtTipoMovimento.Text = Log.TipoMovimento.ToString();
TimeSpan duracaoOperacao = LogsOperacao.First().Momento - Log.Momento;
txtDuracaoOperacao.Text = duracaoOperacao.ToString(@"hh\:mm\:ss");
pnlOrientacaoCaminho.Invalidate();
pnlOrientacaoDif.Invalidate();
OperacaoModel.PopularTreeView(tvwFalhas, Log.CodigoFalha);
}
private void AtualizarInformacoesCameras()
@ -854,6 +927,22 @@ namespace AgroBase.Forms.Operacoes
pnlCaminho.Invalidate();
}
private void AtualizarInformacoesCPU()
{
graficoCpu.AtualizarDados(idxMomentoAtual);
if (cmbCpu_Componente.SelectedIndex > -1)
{
var Valores = graficoCpu.Series.FirstOrDefault(x => x.Titulo == cmbCpu_Componente.Text).Valores.Take(idxMomentoAtual + 1).ToList();
txtCpu_Atual.Text = Valores[idxMomentoAtual].ToString("0.00");
txtCpu_Media.Text = Valores.Average().ToString("0.00");
txtCpu_Mediana.Text = FuncoesMatematicas.CalcularMediana(Valores).ToString("0.00");
txtCpu_Moda.Text = FuncoesMatematicas.CalcularModa(Valores).ToString("0.00");
txtCpu_Minimo.Text = Valores.Min().ToString("0.00");
txtCpu_Maximo.Text = Valores.Max().ToString("0.00");
}
}
private void pnlOrientacaoDirecional_Paint(object sender, PaintEventArgs e)
{
@ -1029,9 +1118,9 @@ namespace AgroBase.Forms.Operacoes
private void pnlCaminho_Paint(object sender, PaintEventArgs e)
{
var Log = LogsCam_Caminho.FirstOrDefault(x => x.Momento == MomentoAtual);
if (Log == null || Log.Leitura == null) return;
Panel pnlContornos = (Panel)sender;
if (Log.Leitura == null) return;
Graphics graphics = e.Graphics;
graphics.Clear(pnlContornos.BackColor); // Limpa o fundo

View File

@ -3,13 +3,7 @@ using AgroBase.Services;
using CefSharp.WinForms;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AgroBase.Forms.Sensoriamento
@ -23,7 +17,6 @@ namespace AgroBase.Forms.Sensoriamento
private int MaxLeituras = 10;
private string VideoPorta = VariaveisPortas.CameraCaminho.ToString();
private string VideoUrl = "line_angle";
private string SocketPorta = VariaveisPortas.SocketCaminho.ToString();
private bool MostrarDebug = true;
private string ArquivoLeitura = "leitura_angulo";

View File

@ -1,16 +1,11 @@
using AgroBase.Comum;
using AgroBase.Models;
using AgroBase.Models;
using AgroBase.Models.Modules;
using AgroBase.Services;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using static AgroBase.Models.Enums;
@ -75,14 +70,14 @@ namespace AgroBase.Forms
lblTempoEmMovimento.Text = "Tempo em movimento: " + TimeSpan.FromSeconds(DispMvd.Dados.TempoEmAtividade).ToString(@"hh\:mm\:ss") + " hrs";
lblDistanciaTotal.Text = "Distancia percorrida total: " + DispMvd.Dados.DistanciaPercorridaTotal.ToString("0.00") + " m";
lblDistanciaParcial.Text = "Distancia percorrida parcial: " + DispMvd.Dados.DistanciaPercorridaParcial.ToString("0.00") + " m";
foreach (var Modulo in DispMvd.Dados.Modulos)
{
Label lblTitulo = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lblM_" + Modulo.Modulo_ID);
lblTitulo.ForeColor = Modulo.MovMotor.Comandar ? Modulo.MovMotor.BLD_Inicializado ? Color.Green : Color.Red : Color.Black;
lblTitulo.Text = lblTitulo.Text.Split(' ')[0] + " (" + Modulo.Modulo_ID + ") - Alm: " + Modulo.MovMotor.CodigoAlarme;
Label lblM_RPMSP = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lbl" + Modulo.Modulo_ID + "M_RPMSP");
lblM_RPMSP.Text = "RPM SP: " + Variaveis.OperacaoEmAndamento.Controle.RPM_SP.ToString("0.00");
lblM_RPMSP.Text = "RPM SP: " + Modulo.MovMotor.RPM_SP_Leitura.ToString("0.00");
Label lblM_RPM = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lbl" + Modulo.Modulo_ID + "M_RPM");
lblM_RPM.Text = "RPM Roda: " + Modulo.MovMotor.RPM_Roda.ToString("0.00");
Label lblM_Velocidade = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lbl" + Modulo.Modulo_ID + "M_Velocidade");
@ -132,10 +127,17 @@ namespace AgroBase.Forms
Minimo = Logs.Any() && Logs.Min(x => x.RPM_SP) < Minimo ? Logs.Min(x => x.RPM_SP) : Minimo;
Maximo = Logs.Any() && Logs.Min(x => x.RPM_SP) > Maximo ? Logs.Min(x => x.RPM_SP) : Maximo;
var serieRPMRoda = new Series("RPM Roda: " + (Log != null ? Log.RPM_Motor : 0));
serieRPMRoda.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM_Motor).ToList());
var serieRPMRoda = new Series("RPM Roda: " + (Log != null ? Log.RPM_Roda : 0));
serieRPMRoda.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM_Roda).ToList());
serieRPMRoda.ChartType = SeriesChartType.Spline;
chart.Series.Add(serieRPMRoda);
Minimo = Logs.Any() && Logs.Min(x => x.RPM_Roda) < Minimo ? Logs.Min(x => x.RPM_Roda) : Minimo;
Maximo = Logs.Any() && Logs.Max(x => x.RPM_Roda) > Maximo ? Logs.Max(x => x.RPM_Roda) : Maximo;
var serieRPMMotor = new Series("RPM Motor: " + (Log != null ? Log.RPM_Motor : 0));
serieRPMMotor.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM_Motor).ToList());
serieRPMMotor.ChartType = SeriesChartType.Spline;
chart.Series.Add(serieRPMMotor);
Minimo = Logs.Any() && Logs.Min(x => x.RPM_Motor) < Minimo ? Logs.Min(x => x.RPM_Motor) : Minimo;
Maximo = Logs.Any() && Logs.Max(x => x.RPM_Motor) > Maximo ? Logs.Max(x => x.RPM_Motor) : Maximo;

View File

@ -50,7 +50,7 @@ namespace AgroBase
this.generalStrip = new System.Windows.Forms.StatusStrip();
this.lblStripJoystick = new System.Windows.Forms.ToolStripStatusLabel();
this.lblStripJoystickComando = new System.Windows.Forms.ToolStripStatusLabel();
this.lblStripOperacao = new System.Windows.Forms.ToolStripStatusLabel();
this.lblStripOperacaoLiberada = new System.Windows.Forms.ToolStripStatusLabel();
this.lblStripOperacaoStatus = new System.Windows.Forms.ToolStripStatusLabel();
this.lblStripMqtt = new System.Windows.Forms.ToolStripStatusLabel();
this.gpbMovimentacao = new System.Windows.Forms.GroupBox();
@ -319,7 +319,7 @@ namespace AgroBase
this.generalStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.lblStripJoystick,
this.lblStripJoystickComando,
this.lblStripOperacao,
this.lblStripOperacaoLiberada,
this.lblStripOperacaoStatus,
this.lblStripMqtt});
this.generalStrip.Location = new System.Drawing.Point(0, 587);
@ -341,11 +341,11 @@ namespace AgroBase
this.lblStripJoystickComando.Size = new System.Drawing.Size(16, 17);
this.lblStripJoystickComando.Text = "...";
//
// lblStripOperacao
// lblStripOperacaoLiberada
//
this.lblStripOperacao.Name = "lblStripOperacao";
this.lblStripOperacao.Size = new System.Drawing.Size(104, 17);
this.lblStripOperacao.Text = "Operação: Manual";
this.lblStripOperacaoLiberada.Name = "lblStripOperacaoLiberada";
this.lblStripOperacaoLiberada.Size = new System.Drawing.Size(134, 17);
this.lblStripOperacaoLiberada.Text = "Operação Liberada: Não";
//
// lblStripOperacaoStatus
//
@ -380,23 +380,25 @@ namespace AgroBase
this.lblKmh.Location = new System.Drawing.Point(166, 20);
this.lblKmh.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblKmh.Name = "lblKmh";
this.lblKmh.Size = new System.Drawing.Size(100, 13);
this.lblKmh.Size = new System.Drawing.Size(132, 13);
this.lblKmh.TabIndex = 23;
this.lblKmh.Text = "Velocidade: 3 km/h";
this.lblKmh.Text = "Velocidade: 0% 0,00 km/h";
//
// trkKmh
//
this.trkKmh.Location = new System.Drawing.Point(168, 37);
this.trkKmh.Margin = new System.Windows.Forms.Padding(2);
this.trkKmh.Maximum = 34;
this.trkKmh.Maximum = 100;
this.trkKmh.Name = "trkKmh";
this.trkKmh.Size = new System.Drawing.Size(158, 45);
this.trkKmh.TabIndex = 22;
this.trkKmh.TickFrequency = 10;
this.trkKmh.Value = 3;
this.trkKmh.ValueChanged += new System.EventHandler(this.trkKmh_ValueChanged);
//
// trkRPM
//
this.trkRPM.Enabled = false;
this.trkRPM.Location = new System.Drawing.Point(4, 37);
this.trkRPM.Margin = new System.Windows.Forms.Padding(2);
this.trkRPM.Maximum = 100;
@ -922,7 +924,7 @@ namespace AgroBase
private System.Windows.Forms.Button btnIniciarOperacao;
private System.Windows.Forms.Label lblKmh;
public System.Windows.Forms.TrackBar trkKmh;
private System.Windows.Forms.ToolStripStatusLabel lblStripOperacao;
private System.Windows.Forms.ToolStripStatusLabel lblStripOperacaoLiberada;
private System.Windows.Forms.ToolStripStatusLabel lblStripOperacaoStatus;
private System.Windows.Forms.Button btnGPS;
private System.Windows.Forms.Button btnConfigurarOperacao;

View File

@ -1,26 +1,16 @@
using AgroBase.Comum;
using AgroBase.Forms;
using AgroBase.Forms;
using AgroBase.Forms.Atuador;
using AgroBase.Forms.IHM;
using AgroBase.Forms.Movimentacao;
using AgroBase.Forms.Operacoes;
using AgroBase.Forms.Sensoriamento;
using AgroBase.Models;
using AgroBase.Models.Modules;
using AgroBase.Services;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using static AgroBase.Models.Enums;
using System.Timers;
@ -42,6 +32,12 @@ namespace AgroBase
tmrDispositivos.Start();
AtualizaDadosGerais();
btnJoyAtt_Click(new object(), new EventArgs());
cmbModoOperacao.Items.Clear();
cmbModoOperacao.Items.AddRange(Enum.GetNames(typeof(ModoOperacao)));
cmbModoOperacao.SelectedIndex = (int)Variaveis.OperacaoEmAndamento.Modo;
}
private void frmPrincipal_FormClosing(object sender, FormClosingEventArgs e)
@ -52,26 +48,41 @@ namespace AgroBase
public void AtualizaDadosGerais()
{
btnJoyAtt_Click(new object(), new EventArgs());
Func<bool> funcVel = new Func<bool>(() =>
{
tkbVelocidade.Minimum = 0;
tkbVelocidade.Maximum = 100;
FuncoesGlobais.PreencheValorTrackBar(tkbVelocidade, Variaveis.OperacaoEmAndamento.Controle.VelocidadeMP);
return true;
});
FuncoesGlobais.ExecutarMetodoComVerificacaoCrossThread(tkbVelocidade, funcVel);
Func<bool> funcAng = new Func<bool>(() =>
{
tkbAngulo.Minimum = 0;
tkbAngulo.Maximum = 90;
FuncoesGlobais.PreencheValorTrackBar(tkbAngulo, Variaveis.OperacaoEmAndamento.Controle.Angulo);
return true;
});
FuncoesGlobais.ExecutarMetodoComVerificacaoCrossThread(tkbAngulo, funcAng);
tkbVelocidade.Minimum = 0;
tkbVelocidade.Maximum = 100;
tkbVelocidade.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.VelocidadeMP);
Func<bool> funcKmh = new Func<bool>(() =>
{
trkKmh.Minimum = 0;
trkKmh.Maximum = 100;
return true;
});
FuncoesGlobais.ExecutarMetodoComVerificacaoCrossThread(trkKmh, funcKmh);
tkbAngulo.Minimum = 0;
tkbAngulo.Maximum = 90;
tkbAngulo.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.Angulo);
trkRPM.Minimum = Variaveis.OperacaoEmAndamento.Controle.RPM_Min;
trkRPM.Maximum = VariaveisEquipamento.RPM_Max_Roda;
trkRPM.Value = Variaveis.OperacaoEmAndamento.Controle.RPM_SP;
trkKmh.Minimum = 0;
trkKmh.Maximum = Convert.ToInt32(MovimentacaoModel.CalculaVelocidadeRPM(trkRPM.Maximum));
cmbModoOperacao.Items.Clear();
cmbModoOperacao.Items.AddRange(Enum.GetNames(typeof(ModoOperacao)));
cmbModoOperacao.SelectedIndex = (int)Variaveis.OperacaoEmAndamento.Modo;
Func<bool> funcRpm = new Func<bool>(() =>
{
trkRPM.Minimum = Variaveis.OperacaoEmAndamento.Controle.RPM_Min;
trkRPM.Maximum = VariaveisEquipamento.RPM_Max_Roda;
FuncoesGlobais.PreencheValorTrackBar(trkRPM, Variaveis.OperacaoEmAndamento.Controle.RPM_SP);
AtualizaRPM(trkRPM.Value);
return true;
});
FuncoesGlobais.ExecutarMetodoComVerificacaoCrossThread(trkRPM, funcRpm);
}
@ -124,8 +135,10 @@ namespace AgroBase
}
}
private void TmrDispositivos_Elapsed(object sender, ElapsedEventArgs e)
private async void TmrDispositivos_Elapsed(object sender, ElapsedEventArgs e)
{
((System.Timers.Timer)sender).Stop();
Func<bool> funcao = new Func<bool>(() =>
{
lstDisponiveis.Items.Clear();
@ -153,6 +166,10 @@ namespace AgroBase
x.AcaoConexao();
});
bool opLiberada = Variaveis.OperacaoEmAndamento.OperacaoLiberada;
lblStripOperacaoLiberada.Text = "Operação Liberada: " + (opLiberada ? "Sim" : "Não");
lblStripOperacaoLiberada.ForeColor = opLiberada ? Color.Green : Color.Red;
return true;
});
@ -160,8 +177,12 @@ namespace AgroBase
if (chbConexaoautomatica.Checked)
{
Task.Run(async () => await SerialService.RealizarVarreduraPortasUSB((System.Timers.Timer)sender));
await SerialService.RealizarVarreduraPortasUSB((System.Timers.Timer)sender);
AtualizaDadosGerais();
}
((System.Timers.Timer)sender).Start();
}
private void cmbDispositivos_SelectedIndexChanged(object sender, EventArgs e)
@ -193,7 +214,6 @@ namespace AgroBase
Variaveis.OperacaoEmAndamento.AbrirForm();
}
lblStripOperacao.Text = "Operação: " + Enum.GetName(typeof(ModoOperacao), Variaveis.OperacaoEmAndamento.Modo);
lblStripOperacaoStatus.Text = Variaveis.OperacaoEmAndamento.Iniciado ? "Iniciado" : "Não iniciado";
}
@ -223,18 +243,17 @@ namespace AgroBase
frmInstancial.frmJoystick.Show();
}
public void AtualizaRPM(int valor)
public void AtualizaRPM(int Percentual)
{
if (valor >= trkRPM.Minimum && valor <= trkRPM.Maximum)
{
double Velocidade = MovimentacaoModel.CalculaVelocidadeRPM(valor);
trkRPM.Value = valor;
trkKmh.Value = Convert.ToInt32(Velocidade);
int RPM = Convert.ToInt32((Percentual / 100.0) * VariaveisEquipamento.RPM_Max_Roda);
double Velocidade = MovimentacaoModel.CalculaVelocidadeRPM(RPM);
Variaveis.OperacaoEmAndamento.Controle.RPM_SP = trkRPM.Value;
lblRPM.Text = "RPM: " + Variaveis.OperacaoEmAndamento.Controle.RPM_SP;
lblKmh.Text = "Velocidade: " + Velocidade.ToString("0.00") + " km/h";
}
FuncoesGlobais.PreencheValorTrackBar(trkRPM, RPM);
FuncoesGlobais.PreencheValorTrackBar(trkKmh, Percentual);
Variaveis.OperacaoEmAndamento.Controle.PercentualVelocidadeSP = Percentual;
lblRPM.Text = $"RPM: {RPM}";
lblKmh.Text = $"Velocidade: {Percentual.ToString("0")}% {Velocidade.ToString("0.00")} km/h";
}
private void tkbVelocidadeMP_ValueChanged(object sender, EventArgs e)
@ -251,7 +270,7 @@ namespace AgroBase
private void trkRPM_Scroll(object sender, EventArgs e)
{
try
/*try
{
int RPM = ((TrackBar)sender).Value;
AtualizaRPM(RPM);
@ -259,15 +278,15 @@ namespace AgroBase
catch (Exception ex)
{
}
}*/
}
private void trkKmh_ValueChanged(object sender, EventArgs e)
{
try
{
int RPM = Convert.ToInt32(MovimentacaoModel.CalculaRPMVelocidade(((TrackBar)sender).Value));
AtualizaRPM(RPM);
int Percentual = trkKmh.Value;
AtualizaRPM(Percentual);
}
catch (Exception ex)
{

View File

@ -1,14 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System;
using AgroBase.Comum;
using static AgroBase.Models.Enums;
using AgroBase.Forms;
using AgroBase.Models;
using System.Threading.Tasks;
using Windows.Gaming.Input;
using AgroBase.Models.Modules;
using SharpDX.DirectInput;
using AgroBase.Services;
@ -464,10 +461,10 @@ namespace AgroBase
});
}
public static void EnviaComandoMotor(Keys Tecla, T_Code Disp = T_Code.Vzo, bool MensagemBase = false)
public static void EnviaComandoMotor(Keys Tecla, T_Code Disp = T_Code.Vzo, bool ForcarComando = false)
{
if (
!frmDiagnosticos.Diagnosticando &&
!frmDiagnosticos.Diagnosticando && !ForcarComando &&
(!Variaveis.OperacaoEmAndamento.OperacaoLiberada ||
!Variaveis.OperacaoEmAndamento.Iniciado ||
Variaveis.OperacaoEmAndamento.Modo != ModoOperacao.Manual ||

View File

@ -3,7 +3,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static AgroBase.Models.Enums;
namespace AgroBase.Models
@ -165,6 +164,7 @@ namespace AgroBase.Models
{
public DateTime Momento { get; set; }
public byte EnderecoCarro { get; set; }
public ulong CodigoFalha { get; set; }
public LoRaProtocoloTransmissaoCoordenadasModel Coordenadas { get; set; }
public LoRaProtocoloTransmissaoSensoresModel Sensores { get; set; }
public LoRaProtocoloTransmissaoOperacaoModel Operacao { get; set; }

View File

@ -38,7 +38,7 @@ namespace AgroBase.Models
{
double distancia = 0.0;
foreach (var trecho in TrajetoriaProjetada)
foreach (var trecho in TrajetoriaMapa)
{
distancia += GPSService.DistanciaDoTrecho(trecho);
}

View File

@ -1,14 +1,8 @@
using AgroBase.Services;
using Emgu.CV.Ocl;
using Emgu.CV.Structure;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static AgroBase.Models.Enums;
namespace AgroBase.Models.Modules
@ -632,6 +626,45 @@ namespace AgroBase.Models.Modules
}
public (bool, List<string>) StatusModulosATU()
{
var Bicos = BicosPulverizadores.Where(x => x.Comandar).ToList();
var BicosComFalha = Bicos.Where(x => !x.Inicializado).ToList();
bool _bicosOperantes = !BicosComFalha.Any();
bool _bombaOperante = BombaPressurizadora.Inicializado;
var _sensorFluxo = Sensores.FirstOrDefault(x => x.Componente == S_Code.sFLX);
bool _sensorFluxoOperante = (!_sensorFluxo?.Aferir ?? false) || ((_sensorFluxo?.Aferir ?? false) && (_sensorFluxo?.Inicializado ?? false));
var _sensorMassa = Sensores.FirstOrDefault(x => x.Componente == S_Code.sMAS);
bool _sensorMassaOperante = (!_sensorMassa?.Aferir ?? false) || ((_sensorMassa?.Aferir ?? false) && (_sensorMassa?.Inicializado ?? false));
var _sensorPressao = Sensores.FirstOrDefault(x => x.Componente == S_Code.sPRS);
bool _sensorPressaoOperante = (!_sensorPressao?.Aferir ?? false) || ((_sensorPressao?.Aferir ?? false) && (_sensorPressao?.Inicializado ?? false));
List<string> ModsComFalha = BicosComFalha.Select(x => x.ID).ToList();
if (!_bombaOperante)
{
ModsComFalha.Add(BombaPressurizadora.ID);
}
if (!_sensorFluxoOperante)
{
ModsComFalha.Add(_sensorFluxo.ID);
}
if (!_sensorMassaOperante)
{
ModsComFalha.Add(_sensorMassa.ID);
}
if (!_sensorPressaoOperante)
{
ModsComFalha.Add(_sensorPressao.ID);
}
bool _atuadorOperante = _bombaOperante && _bicosOperantes && _sensorPressaoOperante;
return (_atuadorOperante, ModsComFalha);
}
}
public class AtuadorBicoModel

View File

@ -1,14 +1,9 @@
using AgroBase.Comum;
using AgroBase.Forms;
using AgroBase.Forms;
using AgroBase.Services;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static AgroBase.Models.Enums;
namespace AgroBase.Models.Modules
@ -36,7 +31,41 @@ namespace AgroBase.Models.Modules
public int TempoEmAtividade { get; set; } = 0;
public double DistanciaPercorridaTotal { get; set; } = 0;
public double DistanciaPercorridaParcial { get; set; } = 0;
public (bool, List<string>) StatusModulosBLD(Direcao Lado)
{
string Prefixo = Lado == Direcao.Esquerda ? "E" : Lado == Direcao.Direita ? "D" : "";
var Mods = Modulos.Where(Mod => Mod.Modulo_ID.Contains(Prefixo) && Mod.MovMotor.Comandar).ToList();
var ModsComFalha = Mods
.Where(Mod =>
!Mod.MovMotor.BLD_Inicializado ||
Mod.MovMotor.CodigoAlarme != 0 ||
Mod.MovMotor.Alarme
)
.ToList();
bool _operante = ModsComFalha.Count() < Mods.Count();
List<string> ModsInoperantes = ModsComFalha.Select(x => x.Modulo_ID).ToList();
return (_operante, ModsInoperantes);
}
public (bool, List<string>) StatusModulosMKS(TipoMovimentoDirecional TipoMovimento)
{
var Mods = Modulos.Where(Mod => Mod.DirMotor.Comandar).ToList();
var ModsComFalha = Mods
.Where(Mod =>
!Mod.DirMotor.MKS_Inicializado && (
Mod.DirMotor.ConfigSentidos[TipoMovimento].Esquerda != Sentido.Parado &&
Mod.DirMotor.ConfigSentidos[TipoMovimento].Direita != Sentido.Parado
)
);
bool _operante = !ModsComFalha.Any();
List<string> ModsInoperantes = ModsComFalha.Select(x => x.Modulo_ID).ToList();
return (_operante, ModsInoperantes);
}
public static MovimentacaoUnificadaModel CarregarParametrosIniciais()
@ -88,9 +117,10 @@ namespace AgroBase.Models.Modules
x.MovMotor.LogGrafico = new List<MvdMotorMOVSensorimanetoGrafico>();
x.MovMotor.TemperaturaDriver = 0;
x.MovMotor.Temperatura = 0;
x.MovMotor.RPM_Motor = 0;
//x.MovMotor.RPM_Motor = 0;
x.MovMotor.RPM_Roda = 0;
x.MovMotor.RPM_SP = 0;
x.MovMotor.RPM_SP_C = 0;
x.MovMotor.RPM_SP_Controle = 0;
x.MovMotor.Corrente_Max = 0;
x.MovMotor.Sentido = Sentido.Parado;
x.MovMotor.CodigoAlarme = 0;
@ -149,7 +179,8 @@ namespace AgroBase.Models.Modules
Modulo.MovMotor.Inicializado = Dados[2] == "1";
double rpm = 0;
double.TryParse(Dados[3].Replace(".", ","), out rpm);
Modulo.MovMotor.RPM_Motor = rpm;
//Modulo.MovMotor.RPM_Motor = rpm;
Modulo.MovMotor.RPM_Roda = rpm;
double temperatura = 0;
double.TryParse(Dados[4].Replace(".", ","), out temperatura);
temperatura = FuncoesMatematicas.CalcularTemperatura(temperatura, 0.0);
@ -208,7 +239,8 @@ namespace AgroBase.Models.Modules
Modulo.MovMotor.Inicializado = Dados[2] == "1";
double rpm = 0;
double.TryParse(Dados[3].Replace(".", ","), out rpm);
Modulo.MovMotor.RPM_Motor = rpm;
//Modulo.MovMotor.RPM_Motor = rpm;
Modulo.MovMotor.RPM_Roda = rpm;
double temperatura = 0;
double.TryParse(Dados[4].Replace(".", ","), out temperatura);
temperatura = FuncoesMatematicas.CalcularTemperatura(temperatura, 0.0);
@ -278,7 +310,7 @@ namespace AgroBase.Models.Modules
{
Momento = DateTime.Now,
Modulo_ID = Modulo.Modulo_ID,
RPM_SP = Modulo.MovMotor.RPM_SP,
RPM_SP = Modulo.MovMotor.RPM_SP_Leitura,
RPM_Motor = Modulo.MovMotor.RPM_Motor,
RPM_Roda = Modulo.MovMotor.RPM_Roda,
Corrente = Modulo.MovMotor.Corrente,
@ -417,7 +449,7 @@ namespace AgroBase.Models.Modules
if (Sucesso && DirecaoAtual != Direcao.Parado)
{
Variaveis.OperacaoEmAndamento.Controle.RPM_SP = 20;
Variaveis.OperacaoEmAndamento.Controle.PercentualVelocidadeSP = 20;
foreach (var Modulo in Modulos)
{
Modulo.MovMotor.ProtocoloComando(
@ -589,7 +621,7 @@ namespace AgroBase.Models.Modules
if (MovMotor.BLD_Inicializado && (!AlarmeAnterior || Adicionado) && AlarmeAtual) // Motor iniciado, Não estava em alarme anteriormente ou foi adicionado agora, alarme atual
{
//Variaveis.OperacaoEmAndamento.DispMov.AdicionarMensagemFila(Variaveis.OperacaoEmAndamento.DispMov.Dados.Modulo_ID, ProtocoloComando(Direcao.Frente, true), true, false);
Variaveis.OperacaoEmAndamento.DispMvd.AdicionarMensagemFila(Modulo_ID, MovMotor.ProtocoloComando(Direcao.Parado, true), true, false);
}
Alm.Valor = _Alarme.Valor;
@ -611,27 +643,37 @@ namespace AgroBase.Models.Modules
public bool Freio { get; set; } = false;
public int CodigoAlarme { get; set; } = 0;
public int RPM_SP { get; set; } = 0;
public int RPM_SP_C { get; set; } = 0;
public int RPM_SP_Controle { get; set; } = 0;
public int RPM_SP_Leitura
{
get
{
return RPM_SP / Reducao;
}
}
public Sentido Sentido_SP { get; set; } = Sentido.Parado;
public int NumeroPolos { get; set; } = 16;
public int NumeroPolos { get; set; } = 10;
public int Rampa { get; set; } = 0;
public int RPM_Max { get; set; } = 600;
public int Reducao { get; set; } = 27;
public int RPM_Max { get; set; } = 500;
public int Reducao { get; set; } = 5;
public double OffsetLeitura { get; set; } = 1.0;
// GETs
public double RPM_Motor { get; set; } = 0;
public double RPM_Roda { get; set; } = 0;
public Sentido Sentido { get; set; } = Sentido.Parado;
public double Temperatura { get; set; } = 0;
public double TemperaturaDriver { get; set; } = 0;
public double Tensao { get; set; } = 0;
public double Corrente_Max { get; set; } = 0;
public double Corrente { get; set; } = 0;
public double RPM_Roda
public double RPM_Motor
{
get
{
return Convert.ToInt32(RPM_Motor / VariaveisEquipamento.RelacaoRPM);
//return Convert.ToInt32(RPM_Motor / VariaveisEquipamento.RelacaoRPM);
return RPM_Roda * VariaveisEquipamento.RelacaoRPM;
//return RPM_Roda * 0.74;
}
}
public double VelocidadeInstantanea
@ -783,17 +825,17 @@ namespace AgroBase.Models.Modules
AcaoFreio AcaoDoFreio = AcaoFreio.SemAcao;
if (Comandar && (!Alarme || CmdAlarme))
if (Comandar && ((!Alarme && CodigoAlarme == 0) || CmdAlarme))
{
if (!CmdAlarme)
{
MovimentacaoUnificadaModel.UltimaDirecao = DirecaoAtual;
}
RPM_SP_C = Variaveis.OperacaoEmAndamento.Controle.RPM_Motor;
RPM_SP_Controle = Variaveis.OperacaoEmAndamento.Controle.RPM_Motor;
RPM_SP =
DirecaoAtual == Direcao.Parado || CmdAlarme ? 0 :
Variaveis.OperacaoEmAndamento.Controle.RPM_Motor;
RPM_SP_Controle;
Ligado = RPM_SP > 0;
@ -827,7 +869,7 @@ namespace AgroBase.Models.Modules
TimeoutResposta = 500,
});
}
if (Ligado && (Leitura == null || Leitura.RPM_SP != RPM_SP_C))
if (Ligado && (Leitura == null || Leitura.RPM_SP != RPM_SP_Controle))
{
BLD300RService.AdicionarComandoNaFila(new BLD300RService.BLDComandoModel()
{

View File

@ -1,15 +1,8 @@
using AgroBase.Forms;
using AgroBase.Services;
using CefSharp;
using Emgu.CV.ML;
using Emgu.CV.Structure;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static AgroBase.Models.Enums;
@ -657,10 +650,10 @@ namespace AgroBase.Models.Modules
if (Sensor.Descricao.ToLower().Contains("bateria"))
{
frmInstancial.frmAcompanhamento.AtualizarSensores("Tensão atual: " + realVoltage.ToString("0.00") + "V - Mín: " + Sensor.ValorMinimo.ToString("0.00") + "V - Máx: " + Sensor.ValorMaximo.ToString("0.00") + "V");
Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria = (realVoltage / Sensor.LimiteMaximo) * 100;
//Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria = (realVoltage / Sensor.LimiteMaximo) * 100;
if (Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria < 0)
{
Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria = 0;
//Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria = 0;
}
}
@ -939,6 +932,37 @@ namespace AgroBase.Models.Modules
Variaveis.OperacaoEmAndamento.DispSen.AdicionarMensagemFila(Modulo_ID, ProtocoloAquisicao, true, false);
}
public (bool, List<string>) StatusModulosSEN()
{
var _Sensores = Sensores.Where(x => x.Aferir).ToList();
var _SensoresComFalha = _Sensores.Where(x => !x.Inicializado).ToList();
bool _sensoresOperantes = _SensoresComFalha.Count() < _Sensores.Count();
var _Sinaleiros = Sinaleiros.ToList();
var _SinaleirosComFalha = _Sinaleiros.Where(x => !x.Inicializado).ToList();
bool _sinaleirosOperantes = !_SinaleirosComFalha.Any();
var _Reles = Reles.Where(x => x.Controlar).ToList();
var _RelesComFalha = _Reles.Where(x => !x.Inicializado).ToList();
bool _relesOperantes = !_RelesComFalha.Any();
var _Servos = Servos.Where(x => x.Controlar).ToList();
var _ServosComFalha = _Servos.Where(x => !x.Inicializado).ToList();
bool _servosOperantes = !_ServosComFalha.Any();
bool _sensoriamentoOperante = _sensoresOperantes && _relesOperantes && _servosOperantes;
List<string> ModsComFalha =
_SensoresComFalha.Select(x => x.ID)
.Union(_SinaleirosComFalha.Select(x => x.ID))
.Union(_RelesComFalha.Select(x => x.ID))
.Union(_ServosComFalha.Select(x => x.ID))
.ToList();
return (_sensoriamentoOperante, ModsComFalha);
}
}
public class SensorModel

View File

@ -162,7 +162,7 @@ namespace AgroBase.Models.Operacoes
var BicosNaoAtuados = new List<AtuadorBicoModel>(Variaveis.OperacaoEmAndamento.DispAtu.Dados.BicosPulverizadores);
BicosNaoAtuados.ForEach(x => x.Atuado = false);
Controle.BicosAtuados = BicosNaoAtuados.ToList();
Controle.RPM_SP = 0;
Controle.PercentualVelocidadeSP = 0;
Controle.Angulo = 0;
}
else if (statusAtual == StatusCarroMapa.Direcionando)
@ -172,41 +172,41 @@ namespace AgroBase.Models.Operacoes
bool DesvioSonar = (KinectService.Iniciado && Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal_Kinect.DesvioNecessario);
if (Manobrando || DesvioSonar)
{
Controle.RPM_SP = Controle.RPM_Min;
Controle.PercentualVelocidadeSP = Controle.PercentualVelocidadeMin;
}
else
{
Controle.RPM_SP = Controle.RPM_Max;
Controle.PercentualVelocidadeSP = Controle.PercentualVelocidadeMax;
}
}
else if (statusAtual == StatusCarroMapa.EntrandoRua)
{
Controle.RPM_SP = Controle.RPM_Min;
Controle.PercentualVelocidadeSP = Controle.PercentualVelocidadeMin;
}
else if (statusAtual == StatusCarroMapa.SaindoRua)
{
Controle.RPM_SP = Controle.RPM_Min;
Controle.PercentualVelocidadeSP = Controle.PercentualVelocidadeMin;
}
else if (statusAtual == StatusCarroMapa.CaminhandoRua)
{
if (Sensoriamento.ErvasNoRadar == 0)
{
Controle.RPM_SP = Controle.RPM_Max;
Controle.PercentualVelocidadeSP = Controle.PercentualVelocidadeMax;
}
else
{
Controle.RPM_SP = Convert.ToInt32(Controle.RPM_Max * 0.85);
Controle.PercentualVelocidadeSP = Controle.PercentualVelocidadeMax * 0.85;
}
double margemAngulo = 5;
if (Controle.Angulo > margemAngulo || Controle.Angulo < (margemAngulo * -1))
{
Controle.RPM_SP = Controle.RPM_Min;
Controle.PercentualVelocidadeSP = Controle.PercentualVelocidadeMin;
}
}
else if (statusAtual == StatusCarroMapa.Manobrando)
{
Controle.RPM_SP = Controle.RPM_Max / 2;
Controle.PercentualVelocidadeSP = Controle.PercentualVelocidadeMax / 2.0;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +1,18 @@
using AgroBase.Comum;
using AgroBase.Models.Modules;
using AgroBase.Models.Modules;
using AgroBase.Services;
using System;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static AgroBase.Models.Enums;
using System.Drawing.Drawing2D;
using Microsoft.Win32;
using System.Reflection;
using AgroBase.Forms.Operacoes;
using CefSharp.WinForms;
using System.IO;
using CefSharp.DevTools.Memory;
using CefSharp.DevTools.Page;
using OpenCvSharp.Internal.Vectors;
namespace AgroBase.Models
{
@ -63,11 +57,8 @@ namespace AgroBase.Models
public static class VariaveisPortas
{
public static int GPS { get; } = 6512;
public static int CameraSolo { get; } = 6522;
public static int CameraCaminho { get; } = 6544;
public static int SocketSolo { get; } = 6568;
public static int SocketCaminho { get; } = 6588;
}
public static class VariaveisEquipamento
@ -82,14 +73,29 @@ namespace AgroBase.Models
}
}
public static double DiametroRoda { get; set; } = 0.3556;
public static double BateriaMax { get; set; } = 20;
public static double PercentualTensaoBateriaMin { get; set; } = 25.0;
public static double PercentualReservatorioMin { get; set; } = 5.0;
public static double PercentualToleranciaPressaoLinha { get; set; } = 0.15;
public static double ReducaoDirecional { get; set; } = 20.0;
public static int RPM_Max_Roda { get; set; } = 100;
public static int RPM_Max_Roda
{
get
{
double RpmMax =
Variaveis.OperacaoEmAndamento.DispMvd != null ?
Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.Average(x => x.MovMotor.RPM_Max) / RelacaoRPM :
100;
return (int)RpmMax;
}
}
public static double RelacaoRPM
{
get
{
double RelacaoRPM = Variaveis.OperacaoEmAndamento.DispMvd != null ? Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.Average(x => x.MovMotor.RPM_Max) / VariaveisEquipamento.RPM_Max_Roda : 1;
double RelacaoRPM =
Variaveis.OperacaoEmAndamento.DispMvd != null ?
Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.Average(x => x.MovMotor.Reducao) :
1;
return RelacaoRPM;
}
}
@ -255,6 +261,15 @@ namespace AgroBase.Models
pgb.Minimum;
}
public static void PreencheValorTrackBar(TrackBar tkb, double Valor)
{
tkb.Value =
Valor >= tkb.Minimum && Valor <= tkb.Maximum ? tkb.Value = Convert.ToInt32(Valor) :
Valor < tkb.Minimum ? tkb.Value = tkb.Minimum :
Valor > tkb.Maximum ? tkb.Value = tkb.Maximum :
tkb.Minimum;
}
// Método para salvar o frame atual em JPEG
public static void SalvarFrameJPEG(Bitmap frame, string caminhoArquivo)
@ -621,6 +636,15 @@ namespace AgroBase.Models
}
public static string MontarStringPerformance(float? gpuLoad, float? cpuLoad, float? ramUsage, float? cpuTemp, float? gpuTemp)
{
return $"GPU: {gpuLoad?.ToString("0.0") ?? "N/A"}% " +
$"CPU: {cpuLoad?.ToString("0.0") ?? "N/A"}% " +
$"RAM: {ramUsage?.ToString("0.0") ?? "N/A"}% " +
$"Temp CPU: {cpuTemp?.ToString("0.0") ?? "N/A"}°C " +
$"Temp GPU: {gpuTemp?.ToString("0.0") ?? "N/A"}°C";
}
}
public static class FuncoesMatematicas

Binary file not shown.

View File

@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// O código foi gerado por uma ferramenta.
// Versão de Tempo de Execução:4.0.30319.42000
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// As alterações ao arquivo poderão causar comportamento incorreto e serão perdidas se
// o código for gerado novamente.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ -12,7 +12,7 @@ namespace AgroBase.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

View File

@ -1,120 +0,0 @@
using AgroBase.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Text;
namespace AgroBase.Services
{
public static class APIService
{
public static Process pythonProcess = null;
public static string API_Base { get; set; } = "http://localhost";
public static string API_Porta { get; set; } = "5001";
public static string GPS_setCoordenadasEndpoint { get; set; } = "/receber-coordenadas";
public static string GPS_getCoordenadasEndpoint { get; set; } = "/servir-coordenadas/<id>";
public static string Mapa_setRuasSelecionadasEndpoint { get; set; } = "/receber-ruas-selecionadas";
public static string Mapa_getRuasSelecionadasEndpoint { get; set; } = "/servir-ruas-selecionadas";
public static int GPS_IDcoordenadasRobo { get; set; } = 1;
public static string ApiBase()
{
return API_Base + ":" + API_Porta.ToString();
}
public static void Inicializar()
{
if (pythonProcess == null)
{
pythonProcess = PythonService.RunScript(PythonService.ScriptAPI, new string[] {
API_Porta.ToString(),
GPS_getCoordenadasEndpoint,
GPS_setCoordenadasEndpoint,
Mapa_getRuasSelecionadasEndpoint,
Mapa_setRuasSelecionadasEndpoint
});
}
}
public static void Parar()
{
if (pythonProcess != null && !pythonProcess.HasExited)
{
pythonProcess.Kill();
pythonProcess = null;
}
}
public static async void AtualizarCoordenadasGPS(GPSModel Leitura, int ID)
{
var url = ApiBase() + GPS_setCoordenadasEndpoint;
var localizacao = new
{
id = ID.ToString(),
latitude = Leitura.Latitude,
longitude = Leitura.Longitude
};
var json = JsonConvert.SerializeObject(localizacao);
var data = new StringContent(json, Encoding.UTF8, "application/json");
try
{
using (var client = new HttpClient())
{
var response = await client.PostAsync(url, data);
string result = await response.Content.ReadAsStringAsync();
}
}
catch (Exception e)
{
Console.WriteLine("Erro ao atualizar coordenadas GPS: " + e.Message);
if (pythonProcess == null || pythonProcess.HasExited)
{
Inicializar();
}
}
}
public static async void AtualizarRuasSelecionadas()
{
try
{
var url = ApiBase() + Mapa_getRuasSelecionadasEndpoint;
using (var client = new HttpClient())
{
var response = await client.GetAsync(url);
List<string> ids = new List<string>();
string result = await response.Content.ReadAsStringAsync();
if (!result.Contains("[]"))
{
result = result.Replace("\n", "");
result = result.Replace("\"", "");
ids = JsonConvert.DeserializeObject<int[]>(result).Select(x => x.ToString()).ToList();
}
if (ids.Count != Variaveis.OperacaoEmAndamento.Mapa.RuasPercorrer.Count)
{
Variaveis.OperacaoEmAndamento.Mapa.RuasPercorrer = ids;
Variaveis.OperacaoEmAndamento.Mapa.PopularTrajetoriaMapa();
}
}
}
catch (Exception e)
{
Console.WriteLine("Erro ao atualizar ruas selecionadas: " + e.Message);
if (pythonProcess == null || pythonProcess.HasExited)
{
Inicializar();
}
}
}
}
}

View File

@ -1,19 +1,11 @@
using AgroBase.Forms;
using AgroBase.Models;
using AgroBase.Models;
using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static AgroBase.Models.Enums;
using System.Windows.Forms;
using Emgu.CV.Structure;
using System.Drawing.Printing;
using System.Threading;
using System.IO;
using Newtonsoft.Json;
using System.Collections;
namespace AgroBase.Services
{
@ -37,6 +29,7 @@ namespace AgroBase.Services
{
RegisrarErrosComunicacao(0, $"Erro ao abrir porta {_PortaBLD.PortName}. Erro={ex.Message}");
//_PortaBLD = null;
AtualizarPortaCOM(new SerialPort() { PortName = _PortaBLD.PortName, BaudRate = _PortaBLD.BaudRate });
}
}
return _PortaBLD != null && _PortaBLD.IsOpen && DadosLeitura.Any(x => x.Iniciado);
@ -208,6 +201,7 @@ namespace AgroBase.Services
private static readonly object FilaLock = new object();
private static System.Timers.Timer tmrLoopComandos = new System.Timers.Timer() { Interval = 100, Enabled = false };
private static System.Timers.Timer tmrReceberDados = new System.Timers.Timer() { Interval = TaxaAmostragem, Enabled = false };
private static bool EnvioLiberado { get; set; } = true;
@ -221,11 +215,6 @@ namespace AgroBase.Services
AtualizarPortaCOM(porta);
}
if (Iniciado)
{
return true;
}
EnvioLiberado = false;
var Parametro = Parametros.First(x => x.Chave == "Versao");
@ -340,7 +329,12 @@ namespace AgroBase.Services
public static void IniciarRotinas()
{
//Task.Run(() => LoopEnvioComandos()); // Inicia o loop de comandos em segundo plano
Task.Run(() => ReceberDados()); // Inicia a recepção de dados em segundo plano
//Task.Run(() => ReceberDados()); // Inicia a recepção de dados em segundo plano
if (!tmrReceberDados.Enabled)
{
tmrReceberDados.Elapsed += TmrReceberDados_Elapsed; ;
tmrReceberDados.Start();
}
if (!tmrLoopComandos.Enabled)
{
tmrLoopComandos.Elapsed += TmrLoopComandos_Elapsed;
@ -352,7 +346,7 @@ namespace AgroBase.Services
{
((System.Timers.Timer)sender).Stop();
if (Iniciado && EnvioLiberado)
if (EnvioLiberado)
{
await LoopEnvioComandos();
}
@ -385,65 +379,82 @@ namespace AgroBase.Services
}
}
private static async Task ReceberDados()
private static void TmrReceberDados_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
while (true)
{
await Task.Delay(TaxaAmostragem);
((System.Timers.Timer)sender).Stop();
if (!Iniciado)
if (!Iniciado)
{
foreach (var Leitura in DadosLeitura.Where(x => x.UltimoComandoRecebido.AddSeconds(10) < DateTime.Now))
{
continue;
AdicionarComandoNaFila(new BLDComandoModel()
{
Endereco = Leitura.Endereco,
Parametro = Parametros.First(x => x.Chave == "Versao"),
Get = true,
AguardaResposta = true
});
}
foreach (var Leitura in DadosLeitura.Where(x => x.Iniciado).OrderBy(x => x.Endereco))
TaxaAmostragem = 3000;
ReconectarPortaCOM();
((System.Timers.Timer)sender).Start();
return;
}
foreach (var Leitura in DadosLeitura.Where(x => x.Iniciado).OrderBy(x => x.Endereco))
{
foreach (var Parametro in Parametros.Where(x => x.LeituraLoop))
{
foreach (var Parametro in Parametros.Where(x => x.LeituraLoop))
var Comando = new BLDComandoModel()
{
var Comando = new BLDComandoModel()
Endereco = Leitura.Endereco,
AguardaResposta = true,
Parametro = Parametro,
Get = true,
TimeoutResposta = 300
};
AdicionarComandoNaFila(Comando);
}
var Modulo = Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.FirstOrDefault(x => Convert.ToByte(x.MovMotor.Endereco.Replace("0x", ""), 16) == Leitura.Endereco);
if (Modulo != null)
{
//Modulo.MovMotor.RPM_Motor = Leitura.RPM;
Modulo.MovMotor.RPM_Roda = Leitura.RPM * Modulo.MovMotor.OffsetLeitura;
Modulo.MovMotor.TemperaturaDriver = Math.Round(Leitura.Temperatura, 2);
Modulo.MovMotor.Corrente_Max = Math.Round(Leitura.CorrenteMax, 2);
Modulo.MovMotor.Tensao = Math.Round(Leitura.Tensao, 2);
Modulo.MovMotor.Ligado = Leitura.Ativado;
Modulo.MovMotor.Freio = Leitura.Freado;
Modulo.MovMotor.Sentido = Leitura.Direcao;
Modulo.MovMotor.CodigoAlarme = Leitura.CodigoAlarme;
Variaveis.OperacaoEmAndamento.DispMvd.Dados.RegistrarLogMov(Modulo);
// Tenta reiniciar o alarme dos modulos se a operacao nao estiver liberada
if (Modulo.MovMotor.CodigoAlarme > 0 && Modulo.MovMotor.CodigoAlarme <= 99 && !Variaveis.OperacaoEmAndamento.OperacaoLiberada)
{
RegisrarErrosComunicacao(Leitura.Endereco, $"Módulo com código de alarme {Modulo.MovMotor.CodigoAlarme}, reiniciando o módulo...");
AdicionarComandoNaFila(new BLDComandoModel()
{
Endereco = Leitura.Endereco,
AguardaResposta = true,
Parametro = Parametro,
Get = true,
TimeoutResposta = 300
};
AdicionarComandoNaFila(Comando);
TimeoutResposta = 200,
Get = false,
Parametro = Parametros.First(x => x.Chave == "AlarmeCode"),
Valor = 0
});
}
var Modulo = Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.FirstOrDefault(x => Convert.ToByte(x.MovMotor.Endereco.Replace("0x", ""), 16) == Leitura.Endereco);
if (Modulo != null)
{
Modulo.MovMotor.RPM_Motor = Leitura.RPM;
Modulo.MovMotor.TemperaturaDriver = Math.Round(Leitura.Temperatura, 2);
Modulo.MovMotor.Corrente_Max = Math.Round(Leitura.CorrenteMax, 2);
Modulo.MovMotor.Tensao = Math.Round(Leitura.Tensao, 2);
Modulo.MovMotor.Ligado = Leitura.Ativado;
Modulo.MovMotor.Freio = Leitura.Freado;
Modulo.MovMotor.Sentido = Leitura.Direcao;
Modulo.MovMotor.CodigoAlarme = Leitura.CodigoAlarme;
Variaveis.OperacaoEmAndamento.DispMvd.Dados.RegistrarLogMov(Modulo);
if (Modulo.MovMotor.CodigoAlarme > 0 && Modulo.MovMotor.CodigoAlarme <= 99)
{
RegisrarErrosComunicacao(Leitura.Endereco, $"Módulo com código de alarme {Modulo.MovMotor.CodigoAlarme}, reiniciando o módulo...");
AdicionarComandoNaFila(new BLDComandoModel()
{
Endereco = Leitura.Endereco,
AguardaResposta = true,
TimeoutResposta = 200,
Get = false,
Parametro = Parametros.First(x => x.Chave == "AlarmeCode"),
Valor = 0
});
}
var Controle = Variaveis.OperacaoEmAndamento.Controle.TiposControle.FirstOrDefault(x => x.Tipo == T_Code.Mov);
Modulo.MovMotor.ProtocoloComando(Controle.UltimaDirecao);
}
var Controle = Variaveis.OperacaoEmAndamento.Controle.TiposControle.FirstOrDefault(x => x.Tipo == T_Code.Mov);
Modulo.MovMotor.ProtocoloComando(Controle.UltimaDirecao);
}
}
((System.Timers.Timer)sender).Start();
}
private static bool DecifrarResposta(byte[] resposta, ModbusParametrosModel Parametro, byte Addr)
@ -695,24 +706,31 @@ namespace AgroBase.Services
private static void RegisrarErrosComunicacao(byte addr, string mensagem)
{
var Caminho = Variaveis.CaminhoLogsDispositivos;
if (!Directory.Exists(Caminho))
try
{
Directory.CreateDirectory(Caminho);
var Caminho = Variaveis.CaminhoLogsDispositivos;
if (!Directory.Exists(Caminho))
{
Directory.CreateDirectory(Caminho);
}
var Arquivo = T_Code.Bld.ToString() + "_err.txt";
Caminho += "/" + Arquivo;
mensagem = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss:fff") + " - Porta " + _PortaBLD.PortName + " - " + addr + ": " + mensagem + Environment.NewLine;
if (!File.Exists(Caminho))
{
File.WriteAllText(Caminho, mensagem);
}
else
{
File.AppendAllText(Caminho, mensagem);
}
}
var Arquivo = T_Code.Bld.ToString() + "_err.txt";
Caminho += "/" + Arquivo;
mensagem = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss:fff") + " - Porta " + _PortaBLD.PortName + " - " + addr + ": " + mensagem + Environment.NewLine;
if (!File.Exists(Caminho))
catch
{
File.WriteAllText(Caminho, mensagem);
}
else
{
File.AppendAllText(Caminho, mensagem);
Console.WriteLine("Erro ao salvar log de erro BLD");
}
}

View File

@ -1,11 +1,7 @@
using AgroBase.Models;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static AgroBase.Models.Enums;
@ -23,6 +19,9 @@ namespace AgroBase.Services
// Serializar EnderecoCarro (byte)
bytes.Add(model.EnderecoCarro);
// Serializar CodigoFalha (ulong)
bytes.AddRange(BitConverter.GetBytes(model.CodigoFalha));
// Serializar Coordenadas (LoRaProtocoloTransmissaoCoordenadasModel)
bytes.AddRange(BitConverter.GetBytes(model.Coordenadas.Latitude));
bytes.AddRange(BitConverter.GetBytes(model.Coordenadas.Longitude));
@ -70,6 +69,10 @@ namespace AgroBase.Services
model.EnderecoCarro = bytes[index];
index += sizeof(byte);
// Desserializar CodigoFalha (ulong)
model.CodigoFalha = BitConverter.ToUInt64(bytes, index);
index += sizeof(ulong);
// Desserializar Coordenadas (LoRaProtocoloTransmissaoCoordenadasModel)
model.Coordenadas = new LoRaProtocoloTransmissaoCoordenadasModel
{
@ -116,7 +119,6 @@ namespace AgroBase.Services
return model;
}
public static byte[] SerializeGPSModel(byte Endereco, GPSModel model)
{
List<byte> bytes = new List<byte>();
@ -170,7 +172,7 @@ namespace AgroBase.Services
bytes.AddRange(BitConverter.GetBytes((int)model.Dispositivo));
// Serializar RPM
bytes.AddRange(BitConverter.GetBytes(model.RPM));
bytes.AddRange(BitConverter.GetBytes(model.PercentualVelocidadeSP));
// Serializar AnguloMP
bytes.AddRange(BitConverter.GetBytes(model.AnguloMP));
@ -205,8 +207,8 @@ namespace AgroBase.Services
index += sizeof(int);
// Desserializar RPM
model.RPM = BitConverter.ToInt32(bytes, index);
index += sizeof(int);
model.PercentualVelocidadeSP = BitConverter.ToDouble(bytes, index);
index += sizeof(double);
// Desserializar AnguloMP
model.AnguloMP = BitConverter.ToDouble(bytes, index);

View File

@ -1,23 +1,12 @@
using AgroBase.Models;
using Emgu.CV;
using Emgu.CV.Features2D;
using Emgu.CV.Structure;
using Microsoft.DirectX.DirectInput;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Runtime.Remoting.Channels;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using static AgroBase.Models.Enums;
using static Emgu.CV.ML.KNearest;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
namespace AgroBase.Services
{
@ -769,10 +758,15 @@ namespace AgroBase.Services
double velocidadeMin = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.Controle.RPM_Min);
double TemperaturaCampo = WT901CService.Iniciado ? WT901CService.DadosLeitura.Temperatura : 0;
(bool dirOperante, List<string> dirModsFalha) = Variaveis.OperacaoEmAndamento.DispMvd.Dados.StatusModulosMKS(Variaveis.OperacaoEmAndamento.Controle.TipoMovimento);
(bool movEsqOperante, List<string> movEsqModsFalha) = Variaveis.OperacaoEmAndamento.DispMvd.Dados.StatusModulosBLD(Direcao.Esquerda);
(bool movDirOperante, List<string> movDirModsFalha) = Variaveis.OperacaoEmAndamento.DispMvd.Dados.StatusModulosBLD(Direcao.Direita);
LoRaProtocoloTransmissaoModel dados = new LoRaProtocoloTransmissaoModel()
{
Momento = DateTime.Now,
EnderecoCarro = Variaveis.ConexaoLoRa.parametros.address,
CodigoFalha = Variaveis.OperacaoEmAndamento.RetornaCodigoFalha(),
Operacao = new LoRaProtocoloTransmissaoOperacaoModel()
{
idxRuaAtual = Variaveis.OperacaoEmAndamento.Sensoriamento.IdxRuaAtual,

View File

@ -1,16 +1,10 @@
using AgroBase.Forms;
using AgroBase.Forms.IHM;
using AgroBase.Models;
using CefSharp.DevTools.Page;
using OpenTK.Audio.OpenAL;
using SharpDX.DirectInput;
using AgroBase.Models;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static AgroBase.Models.Enums;
@ -44,6 +38,7 @@ namespace AgroBase.Services
}
public static int TaxaAmostragem { get; set; } = 1000;
public static SerialPort _PortaMKS = new SerialPort();
private static System.Timers.Timer tmrReceberDados = new System.Timers.Timer() { Interval = TaxaAmostragem, Enabled = false };
public static async Task<bool> VerificaPortaMKS(SerialPort porta)
{
@ -55,9 +50,6 @@ namespace AgroBase.Services
AtualizarPortaCOM(porta);
}
string oldHV = "";
string oldFV = "";
List<string> Mod_IDs = new List<string>();
foreach (var Modulo in Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.Where(x => !x.DirMotor.MKS_Inicializado))
@ -128,7 +120,12 @@ namespace AgroBase.Services
public static void IniciarRotinas()
{
//Task.Run(() => LoopEnvioComandos()); // Inicia o loop de comandos em segundo plano
Task.Run(() => ReceberDados()); // Inicia a recepção de dados em segundo plano
//Task.Run(() => ReceberDados()); // Inicia a recepção de dados em segundo plano
if (!tmrReceberDados.Enabled)
{
tmrReceberDados.Elapsed += TmrReceberDados_Elapsed;
tmrReceberDados.Start();
}
if (!tmrLoopComandos.Enabled)
{
tmrLoopComandos.Elapsed += TmrLoopComandos_Elapsed;
@ -136,6 +133,43 @@ namespace AgroBase.Services
}
}
private static void TmrReceberDados_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
((System.Timers.Timer)sender).Stop();
if (!Iniciado)
{
foreach (var Leitura in DadosLeitura.Where(x => x.UltimoComandoRecebido.AddSeconds(10) < DateTime.Now))
{
AdicionarComandoNaFila(MontarComandoRequisicaoPulsos(Leitura.Endereco));
}
TaxaAmostragem = 3000;
ReconectarPortaCOM();
((System.Timers.Timer)sender).Start();
return;
}
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)));
}
}
((System.Timers.Timer)sender).Start();
}
private static async void TmrLoopComandos_Elapsed(object sender, EventArgs e)
{
((System.Timers.Timer)sender).Stop();
@ -224,24 +258,31 @@ namespace AgroBase.Services
private static void RegisrarErrosComunicacao(byte addr, string mensagem)
{
var Caminho = Variaveis.CaminhoLogsDispositivos;
if (!Directory.Exists(Caminho))
try
{
Directory.CreateDirectory(Caminho);
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);
}
}
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))
catch
{
File.WriteAllText(Caminho, mensagem);
}
else
{
File.AppendAllText(Caminho, mensagem);
Console.WriteLine("Erro ao salvar log de erro MKS");
}
}
@ -568,44 +609,6 @@ namespace AgroBase.Services
}
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;

View File

@ -44,11 +44,16 @@ namespace AgroBase.Services
public static List<ModbusComandoModel> FilaComandos = new List<ModbusComandoModel>();
private static readonly object FilaLock = new object();
private static System.Timers.Timer tmrLoopComandos = new System.Timers.Timer() { Interval = 100, Enabled = false };
private static System.Timers.Timer tmrReceberDados = new System.Timers.Timer() { Interval = 1000, Enabled = false };
public static void IniciarRotinas()
{
Task.Run(() => ReceberDados());
if (!tmrReceberDados.Enabled)
{
tmrReceberDados.Elapsed += TmrReceberDados_Elapsed;
tmrReceberDados.Start();
}
if (!tmrLoopComandos.Enabled)
{
tmrLoopComandos.Elapsed += TmrLoopComandos_Elapsed;
@ -94,23 +99,18 @@ namespace AgroBase.Services
}
}
private static async Task<bool> ReceberDados()
private static void TmrReceberDados_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
while (true)
((System.Timers.Timer)sender).Stop();
if (Iniciado)
{
await Task.Delay(TaxaAmostragem);
if (!Iniciado)
{
continue;
}
if (PZEMService.Iniciado && !PZEMService.ModoLeitura)
{
AdicionarComandoNaFila(new ModbusComandoModel()
{
Dispositivo = T_Code.Pzm,
Endereco = PZEMService.slaveAddress,
Dispositivo = T_Code.Pzm,
Endereco = PZEMService.slaveAddress,
Comando = PZEMService.ComandoAquisicaoDados(),
Verificacao = false,
TamanhoEsperado = 16,
@ -124,7 +124,7 @@ namespace AgroBase.Services
Dispositivo = T_Code.Wit,
Endereco = WT901CService.slaveAddress,
Comando = WT901CService.ComandoAquisicaoDados(),
Verificacao = false,
Verificacao = false,
TamanhoEsperado = 101,
TimeoutResposta = 1000,
});
@ -142,6 +142,9 @@ namespace AgroBase.Services
});
}
}
((System.Timers.Timer)sender).Interval = TaxaAmostragem;
((System.Timers.Timer)sender).Start();
}
private static async void TmrLoopComandos_Elapsed(object sender, EventArgs e)
@ -150,39 +153,36 @@ namespace AgroBase.Services
if (EnvioLiberado && !Verificando && !frmInstancial.Fechando)
{
await LoopEnvioComandos();
EnvioLiberado = false;
try
{
List<ModbusComandoModel> comandosParaEnviar;
lock (FilaLock)
{
comandosParaEnviar = FilaComandos.Where(x => !x.Enviado).OrderByDescending(x => x.Verificacao).ThenBy(x => x.Momento).ToList();
}
foreach (var Comando in comandosParaEnviar)
{
await EnviarComando(Comando);
}
}
catch (Exception ex)
{
RegisrarErrosComunicacao(T_Code.Mbs, 0, $"Erro ao processar fila de comandos. Erro={ex.Message}");
}
finally
{
EnvioLiberado = true;
}
}
((System.Timers.Timer)sender).Start();
}
private static async Task LoopEnvioComandos()
{
EnvioLiberado = false;
try
{
List<ModbusComandoModel> comandosParaEnviar;
lock (FilaLock)
{
comandosParaEnviar = FilaComandos.Where(x => !x.Enviado).OrderByDescending(x => x.Verificacao).ThenBy(x => x.Momento).ToList();
}
foreach (var Comando in comandosParaEnviar)
{
await EnviarComando(Comando);
}
}
catch (Exception ex)
{
RegisrarErrosComunicacao(T_Code.Mbs, 0, $"Erro ao processar fila de comandos. Erro={ex.Message}");
}
finally
{
EnvioLiberado = true;
}
}
private static void RegisrarErrosComunicacao(T_Code dispositivo, byte addr, string mensagem)
{

View File

@ -1,17 +1,10 @@
using AgroBase.Models;
using CefSharp.WinForms;
using CefSharp;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO.Ports;
using System.Linq;
using System.Windows.Forms;
using Newtonsoft.Json;
using Emgu.CV.CvEnum;
using Emgu.CV.Aruco;
using System.Threading.Tasks;
using AgroBase.Forms;
using static AgroBase.Models.Enums;
namespace AgroBase.Services
@ -24,8 +17,9 @@ namespace AgroBase.Services
public static PZEMModel UltimaLeitura = new PZEMModel();
public static PZEMModel PenultimaLeitura = new PZEMModel();
public static double TensaoMinima { get; set; } = 30;
public static double TensaoMaxima { get; set; } = 42;
public static double TensaoMinima { get; set; } = 36.0;
public static double TensaoMaxima { get; set; } = 42.0;
public static double CorrenteMax { get; set; } = 20.0;
public static bool ModoLeitura = false;
@ -46,7 +40,7 @@ namespace AgroBase.Services
{ "EnderecoRTU", 0x0002 },
{ "EscalaCorrenteAtual", 0x0003 },
};
public static CoulombCounterService ContadorCarga = new CoulombCounterService(VariaveisEquipamento.BateriaMax);
public static CoulombCounterService ContadorCarga = new CoulombCounterService(CorrenteMax);
public static async Task<bool> VerificaPortaPZEM(SerialPort porta)
@ -196,8 +190,6 @@ namespace AgroBase.Services
ContadorCarga.AtualizarConsumo();
double percent = FuncoesMatematicas.Map(UltimaLeitura.Tensao, TensaoMinima, TensaoMaxima, 0, 100);
Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria = percent;
Variaveis.OperacaoEmAndamento.Sensoriamento.BateriaConsumida = ContadorCarga.PercentualConsumido;
return Sucesso;

View File

@ -1,87 +0,0 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AgroBase.Services
{
public class RS485Service
{
public static SerialPort _serialPort;
private static ConcurrentDictionary<int, TaskCompletionSource<byte[]>> _pendingRequests;
private static List<byte> _receiveBuffer = new List<byte>();
public RS485Service(string portName)
{
}
public static void Inicializar(string portName)
{
_serialPort = new SerialPort(portName, 9600, Parity.None, 8, StopBits.Two);
_serialPort.DataReceived += OnDataReceived;
_serialPort.Open();
_pendingRequests = new ConcurrentDictionary<int, TaskCompletionSource<byte[]>>();
}
public static async Task<byte[]> SendRequestAsync(int address, byte[] request)
{
var tcs = new TaskCompletionSource<byte[]>();
_pendingRequests[address] = tcs;
_serialPort.Write(request, 0, request.Length);
// Timeout após 2 segundos
var timeoutTask = Task.Delay(2000).ContinueWith(t => tcs.TrySetCanceled());
var completedTask = await Task.WhenAny(tcs.Task, timeoutTask);
// Verifica se a tarefa concluída foi a de timeout
if (completedTask == timeoutTask)
{
_receiveBuffer.Clear();
throw new TimeoutException("O dispositivo não respondeu dentro do tempo esperado.");
}
// Retorna o resultado da tarefa que não foi de timeout
return await tcs.Task;
}
private static void OnDataReceived(object sender, SerialDataReceivedEventArgs e)
{
while (_serialPort.BytesToRead > 0)
{
byte[] buffer = new byte[_serialPort.BytesToRead];
int bytesRead = _serialPort.Read(buffer, 0, buffer.Length);
_receiveBuffer.AddRange(buffer);
if (_receiveBuffer.Count > 20)
{
_receiveBuffer.Clear();
_serialPort.DiscardInBuffer();
}
// Verifica se a mensagem completa foi recebida
else if (_receiveBuffer.Count >= 4) // Tamanho mínimo de uma mensagem MODBUS RTU (endereço + função + CRC)
{
// Verifica o CRC
if (ModbusService.VerifyChecksum(_receiveBuffer.ToArray()))
{
byte[] response = _receiveBuffer.ToArray();
_receiveBuffer.Clear();
// Processar a resposta e identificar o dispositivo
int address = 0x02;
if (_pendingRequests.TryRemove(address, out var tcs))
{
tcs.SetResult(response);
}
}
}
}
}
}
}

View File

@ -1,12 +1,9 @@
using AgroBase.Forms;
using AgroBase.Models;
using CefSharp.DevTools.Network;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO.Ports;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@ -113,8 +110,6 @@ namespace AgroBase.Services
return;
}
tmr.Stop();
VarreduraEmAndamento = true;
try
@ -263,8 +258,6 @@ namespace AgroBase.Services
finally
{
VarreduraEmAndamento = false;
tmr.Start();
}
}
@ -682,7 +675,7 @@ namespace AgroBase.Services
while (buffer.Count < tamanhoEsperado && inicio.AddMilliseconds(Timeout) > DateTime.Now)
{
await Task.Delay(50);
if (porta == null)
if (porta == null || !porta.IsOpen)
{
break;
}
@ -710,11 +703,14 @@ namespace AgroBase.Services
private static void AtualizarConsole(string msg)
{
Console.WriteLine(msg);
frmInstancial.frmPrincipal.Invoke((MethodInvoker)(() =>
if (!Variaveis.IsAgroMonitor)
{
frmInstancial.frmPrincipal.lblStatusConexao.Text = msg;
frmInstancial.frmIHM.lblStatus.Text = msg;
}));
frmInstancial.frmPrincipal.Invoke((MethodInvoker)(() =>
{
frmInstancial.frmPrincipal.lblStatusConexao.Text = msg;
frmInstancial.frmIHM.lblStatus.Text = msg;
}));
}
}
}

View File

@ -1,100 +0,0 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace AgroBase.Services
{
public class SocketService<T>
{
private int DadosRegistrar;
private TcpClient client;
private NetworkStream stream;
private byte[] buffer = new byte[1024];
public List<T> DadosRecebidos = new List<T>();
public void Connect(string host, int port, int _Registrar = 50, int Tentativa = 0)
{
DadosRegistrar = _Registrar;
try
{
client = new TcpClient(host, port);
stream = client.GetStream();
stream.BeginRead(buffer, 0, buffer.Length, OnRead, null);
}
catch
{
if (Tentativa < 3)
{
Tentativa++;
Connect(host, port, Tentativa);
}
}
}
private void OnRead(IAsyncResult ar)
{
string dado = "";
try
{
int bytesRead = stream.EndRead(ar);
if (bytesRead > 0)
{
string result = Encoding.UTF8.GetString(buffer, 0, bytesRead);
// Aqui você processaria a mensagem recebida
//Console.WriteLine(result);
if (result != "" && result != null && !result.Contains("null"))
{
var dados = result.Replace("}{", "}¬{").Split('¬');
for (int i = 0; i < (dados.Length > 1 ? dados.Length - 1 : dados.Length); i++)
{
dado = dados[i];
if (dado != "")
{
var _Dados = JsonConvert.DeserializeObject<T>(dado);
if (_Dados != null)
{
DadosRecebidos.Add(_Dados);
if (DadosRecebidos.Count() > DadosRegistrar)
{
DadosRecebidos.RemoveAt(0);
}
}
}
}
}
}
// Continue lendo do stream
stream.BeginRead(buffer, 0, buffer.Length, OnRead, null);
}
catch (Exception ex)
{
//Console.WriteLine(dado + " - " + ex.Message);
try
{
stream.BeginRead(buffer, 0, buffer.Length, OnRead, null);
}
catch
{
}
}
}
public void Disconnect()
{
if (client != null)
{
client.Close();
}
}
}
}

View File

@ -1,16 +1,12 @@
using AgroBase.Forms;
using OpenTK;
using OpenTK;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using OpenTK;
using OpenTK.Graphics.OpenGL;
using AgroBase.Models;
using System.Threading.Tasks;
namespace AgroBase.Services
{
@ -36,85 +32,16 @@ namespace AgroBase.Services
private double AnguloZ { get; set; }
private string Path3D { get; set; }
// Este método agora será chamado na thread separada
public void InicializarEExecutarServico()
public void AtualizarAngulos(double X, double Y, double Z, double Tolerance = 1.0)
{
// Para garantir que o código roda na thread da UI:
if (glControl.InvokeRequired)
if (Math.Abs(AnguloX - X) > Tolerance || Math.Abs(AnguloY - Y) > Tolerance || Math.Abs(AnguloZ - Z) > Tolerance)
{
glControl.Invoke(new Action(() => InicializarServico()));
AnguloX = X;
AnguloY = Y;
AnguloZ = Z;
glControl.Invalidate();
glControl.SwapBuffers();
}
else
{
InicializarServico();
}
Task.Run(() =>
{
while (true)
{
// Invalida o controle na thread da UI
glControl.Invoke((MethodInvoker)delegate
{
glControl.Invalidate();
});
Task.Delay(16).Wait(); // Limitar a atualização a ~60fps
}
});
}
// Inicialização do GLControl e carregamento de modelos 3D
private void InicializarServico()
{
GL.Enable(EnableCap.DepthTest);
List<float> Vertices = new List<float>();
if (Path3D.Contains(".obj"))
{
objLoader = new OBJLoader();
objLoader.Load(Path3D, 2.0f);
Vertices = objLoader.Vertices;
}
else if (Path3D.Contains(".stl"))
{
stlLoader = new STLLoader();
stlLoader.ScaleFactor = 0.005f;
stlLoader.Load(Path3D);
Vertices = stlLoader.Vertices;
}
else if (Path3D.Contains(".wrl"))
{
wrlLoader = new WRLLoader();
wrlLoader.Load(Path3D);
Vertices = wrlLoader.Vertices;
}
else if (Path3D.Contains(".ply"))
{
plyLoader = new PLYLoader();
plyLoader.Load(Path3D);
Vertices = plyLoader.Vertices;
}
// Calcular o centro do modelo e ajustar a posição
var (centerX, centerY, centerZ) = Visualizador3DModel.CalculateCenter(Vertices);
for (int i = 0; i < Vertices.Count; i += 3)
{
Vertices[i] -= centerX;
Vertices[i + 1] -= (centerY + 0.0f);
Vertices[i + 2] -= centerZ;
}
}
public void AtualizarAngulos(double X, double Y, double Z)
{
AnguloX = X;
AnguloY = Y;
AnguloZ = Z;
glControl.Invalidate();
}
public void InitializeGLControl(Control controlePai, string path)

View File

@ -1,25 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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_d8b0eac8006286063c46977a5850eb3b {
#map_f7cf9b1d703905dc42af2562c43228c7 {
position: relative;
width: 100.0%;
height: 100.0%;
@ -39,14 +39,14 @@
<body>
<div class="folium-map" id="map_d8b0eac8006286063c46977a5850eb3b" ></div>
<div class="folium-map" id="map_f7cf9b1d703905dc42af2562c43228c7" ></div>
</body>
<script>
var map_d8b0eac8006286063c46977a5850eb3b = L.map(
"map_d8b0eac8006286063c46977a5850eb3b",
var map_f7cf9b1d703905dc42af2562c43228c7 = L.map(
"map_f7cf9b1d703905dc42af2562c43228c7",
{
center: [0.0, 0.0],
crs: L.CRS.EPSG3857,
@ -60,13 +60,13 @@
var tile_layer_07b13c18ca6f11b92f3c0b6f3ad1ed3d = L.tileLayer(
var tile_layer_bd1db720aa858e8b1a4444ca4570e080 = 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_07b13c18ca6f11b92f3c0b6f3ad1ed3d.addTo(map_d8b0eac8006286063c46977a5850eb3b);
tile_layer_bd1db720aa858e8b1a4444ca4570e080.addTo(map_f7cf9b1d703905dc42af2562c43228c7);
</script>
@ -87,7 +87,7 @@
}
trajeto_json_add({"features": []});
trajeto_json.addTo(map_d8b0eac8006286063c46977a5850eb3b);
trajeto_json.addTo(map_f7cf9b1d703905dc42af2562c43228c7);
function adicionarGeometria(novaGeometria) {
trajeto_json.addData(novaGeometria);
@ -145,7 +145,7 @@
var marcadorDinamico = L.marker([0, 0], {
icon: customIcon
}).addTo(map_d8b0eac8006286063c46977a5850eb3b);
}).addTo(map_f7cf9b1d703905dc42af2562c43228c7);
// 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_d8b0eac8006286063c46977a5850eb3b.setView(novaPosicao, map_d8b0eac8006286063c46977a5850eb3b.getZoom());
map_f7cf9b1d703905dc42af2562c43228c7.setView(novaPosicao, map_f7cf9b1d703905dc42af2562c43228c7.getZoom());
});
function calcularOrientacao(P1latitude, P1longitude, P2latitude, P2longitude) {

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

View File

@ -1 +1 @@
bdd21f50cc3e3f4237dd3630823d3cc1c1429ce566681ea51064cbffb36b69e2
65382a232ce56ae18acc2e54ffd7c49c619f9806a116c6b57342b59d47ad9dbd

View File

@ -492,3 +492,4 @@ C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\Emgu.CV.Platform.NetStand
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\MathNet.Numerics.dll
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\MathNet.Numerics.xml
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\Python\Scripts\street-detector-mqtt.py
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\OpenHardwareMonitorLib.dll

View File

@ -11,13 +11,13 @@
<package id="Emgu.CV" version="4.4.0.4099" targetFramework="net472" />
<package id="Emgu.CV.Bitmap" version="4.4.0.4099" targetFramework="net472" />
<package id="Emgu.CV.runtime.windows" version="4.4.0.4099" targetFramework="net472" />
<package id="MathNet.Numerics" version="5.0.0" targetFramework="net472" />
<package id="MathNet.Numerics" version="5.0.0" targetFramework="net472" requireReinstallation="true" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net472" />
<package id="MQTTnet" version="3.1.1" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
<package id="OpenCvSharp4" version="4.10.0.20240616" targetFramework="net472" />
<package id="OpenCvSharp4.Extensions" version="4.10.0.20240616" targetFramework="net472" />
<package id="OpenCvSharp4.runtime.win" version="4.10.0.20240616" targetFramework="net472" />
<package id="OpenCvSharp4" version="4.10.0.20240616" targetFramework="net472" requireReinstallation="true" />
<package id="OpenCvSharp4.Extensions" version="4.10.0.20240616" targetFramework="net472" requireReinstallation="true" />
<package id="OpenCvSharp4.runtime.win" version="4.10.0.20240616" targetFramework="net472" requireReinstallation="true" />
<package id="OpenTK" version="1.1.2225.0" targetFramework="net472" />
<package id="OpenTK.GLControl" version="1.1.2225.0" targetFramework="net472" />
<package id="SharpDX" version="4.2.0" targetFramework="net472" />

View File

@ -8,10 +8,11 @@
<OutputType>WinExe</OutputType>
<RootNamespace>AgroMonitor</RootNamespace>
<AssemblyName>AgroMonitor</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>

View File

@ -1,26 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
</configuration>

View File

@ -30,6 +30,10 @@
{
this.gpbModulos = new System.Windows.Forms.GroupBox();
this.pnlModulos = new System.Windows.Forms.Panel();
this.rtbA05 = new System.Windows.Forms.RichTextBox();
this.chbA05 = new System.Windows.Forms.CheckBox();
this.rtbKnt = new System.Windows.Forms.RichTextBox();
this.chbKnt = new System.Windows.Forms.CheckBox();
this.rtbLRA = new System.Windows.Forms.RichTextBox();
this.chbLra = new System.Windows.Forms.CheckBox();
this.rtbATU = new System.Windows.Forms.RichTextBox();
@ -90,10 +94,6 @@
this.btnCarregar = new System.Windows.Forms.Button();
this.txtDescricao = new System.Windows.Forms.TextBox();
this.lblDescricao = new System.Windows.Forms.Label();
this.rtbKnt = new System.Windows.Forms.RichTextBox();
this.chbKnt = new System.Windows.Forms.CheckBox();
this.rtbA05 = new System.Windows.Forms.RichTextBox();
this.chbA05 = new System.Windows.Forms.CheckBox();
this.gpbModulos.SuspendLayout();
this.pnlModulos.SuspendLayout();
this.tabControl1.SuspendLayout();
@ -147,6 +147,51 @@
this.pnlModulos.Size = new System.Drawing.Size(204, 475);
this.pnlModulos.TabIndex = 6;
//
// rtbA05
//
this.rtbA05.BackColor = System.Drawing.SystemColors.Control;
this.rtbA05.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbA05.Location = new System.Drawing.Point(3, 666);
this.rtbA05.Name = "rtbA05";
this.rtbA05.ReadOnly = true;
this.rtbA05.Size = new System.Drawing.Size(174, 42);
this.rtbA05.TabIndex = 18;
this.rtbA05.Text = "Responsável por monitorar obstáculos absolutos nas posições extremas dos quatro c" +
"antos do equipamento";
//
// chbA05
//
this.chbA05.AutoSize = true;
this.chbA05.BackColor = System.Drawing.SystemColors.Control;
this.chbA05.Location = new System.Drawing.Point(3, 643);
this.chbA05.Name = "chbA05";
this.chbA05.Size = new System.Drawing.Size(45, 17);
this.chbA05.TabIndex = 19;
this.chbA05.Text = "A05";
this.chbA05.UseVisualStyleBackColor = false;
//
// rtbKnt
//
this.rtbKnt.BackColor = System.Drawing.SystemColors.Control;
this.rtbKnt.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbKnt.Location = new System.Drawing.Point(3, 595);
this.rtbKnt.Name = "rtbKnt";
this.rtbKnt.ReadOnly = true;
this.rtbKnt.Size = new System.Drawing.Size(174, 42);
this.rtbKnt.TabIndex = 16;
this.rtbKnt.Text = "Responsável pelo monitoramento e detecção de obstáculos à frente do equipamento";
//
// chbKnt
//
this.chbKnt.AutoSize = true;
this.chbKnt.BackColor = System.Drawing.SystemColors.Control;
this.chbKnt.Location = new System.Drawing.Point(3, 572);
this.chbKnt.Name = "chbKnt";
this.chbKnt.Size = new System.Drawing.Size(48, 17);
this.chbKnt.TabIndex = 17;
this.chbKnt.Text = "KNT";
this.chbKnt.UseVisualStyleBackColor = false;
//
// rtbLRA
//
this.rtbLRA.BackColor = System.Drawing.SystemColors.Control;
@ -460,9 +505,9 @@
this.lblPressaoLinha.AutoSize = true;
this.lblPressaoLinha.Location = new System.Drawing.Point(6, 94);
this.lblPressaoLinha.Name = "lblPressaoLinha";
this.lblPressaoLinha.Size = new System.Drawing.Size(188, 13);
this.lblPressaoLinha.Size = new System.Drawing.Size(133, 13);
this.lblPressaoLinha.TabIndex = 7;
this.lblPressaoLinha.Text = "Pressão de setpoint da linha hidráulica";
this.lblPressaoLinha.Text = "Pressão da linha hidráulica";
//
// lblPercentualAtuacao2
//
@ -776,51 +821,6 @@
this.lblDescricao.TabIndex = 7;
this.lblDescricao.Text = "Descrição";
//
// rtbKnt
//
this.rtbKnt.BackColor = System.Drawing.SystemColors.Control;
this.rtbKnt.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbKnt.Location = new System.Drawing.Point(3, 595);
this.rtbKnt.Name = "rtbKnt";
this.rtbKnt.ReadOnly = true;
this.rtbKnt.Size = new System.Drawing.Size(174, 42);
this.rtbKnt.TabIndex = 16;
this.rtbKnt.Text = "Responsável pelo monitoramento e detecção de obstáculos à frente do equipamento";
//
// chbKnt
//
this.chbKnt.AutoSize = true;
this.chbKnt.BackColor = System.Drawing.SystemColors.Control;
this.chbKnt.Location = new System.Drawing.Point(3, 572);
this.chbKnt.Name = "chbKnt";
this.chbKnt.Size = new System.Drawing.Size(48, 17);
this.chbKnt.TabIndex = 17;
this.chbKnt.Text = "KNT";
this.chbKnt.UseVisualStyleBackColor = false;
//
// rtbA05
//
this.rtbA05.BackColor = System.Drawing.SystemColors.Control;
this.rtbA05.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbA05.Location = new System.Drawing.Point(3, 666);
this.rtbA05.Name = "rtbA05";
this.rtbA05.ReadOnly = true;
this.rtbA05.Size = new System.Drawing.Size(174, 42);
this.rtbA05.TabIndex = 18;
this.rtbA05.Text = "Responsável por monitorar obstáculos absolutos nas posições extremas dos quatro c" +
"antos do equipamento";
//
// chbA05
//
this.chbA05.AutoSize = true;
this.chbA05.BackColor = System.Drawing.SystemColors.Control;
this.chbA05.Location = new System.Drawing.Point(3, 643);
this.chbA05.Name = "chbA05";
this.chbA05.Size = new System.Drawing.Size(45, 17);
this.chbA05.TabIndex = 19;
this.chbA05.Text = "A05";
this.chbA05.UseVisualStyleBackColor = false;
//
// frmAjustesOperacao
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -1,15 +1,9 @@
using AgroBase.Models;
using AgroBase.Models.Operacoes;
using AgroBase.Services;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static AgroBase.Models.Enums;
@ -18,7 +12,6 @@ namespace AgroMonitor.Forms
{
public partial class frmAjustesOperacao : Form
{
OperacaoParametrosModel Parametros = new OperacaoParametrosModel();
Timer tmrDadosMapa = new Timer();
string path = Variaveis.CaminhoSistema + Variaveis.CaminhoOperacoes + "\\" + MapasVariaveisModel.NomeArquivoMapaInterativoSaida;
@ -141,9 +134,9 @@ namespace AgroMonitor.Forms
}
}
private void btnCarregar_Click(object sender, EventArgs e)
private async void btnCarregar_Click(object sender, EventArgs e)
{
CarregarOperacao().ConfigureAwait(false);
await CarregarOperacao();
}
private async Task CarregarOperacao()

View File

@ -28,7 +28,6 @@
/// </summary>
private void InitializeComponent()
{
this.lblEquipamento = new System.Windows.Forms.Label();
this.cmbEquipamento = new System.Windows.Forms.ComboBox();
this.lblLatitude = new System.Windows.Forms.Label();
this.lblLongitude = new System.Windows.Forms.Label();
@ -36,13 +35,11 @@
this.txtLongitude = new System.Windows.Forms.TextBox();
this.pnlDados = new System.Windows.Forms.Panel();
this.pnlControle = new System.Windows.Forms.Panel();
this.lblTipoMovimento = new System.Windows.Forms.Label();
this.cmbTipoMovimento = new System.Windows.Forms.ComboBox();
this.btnParar = new System.Windows.Forms.Button();
this.lblVelocidadeMP = new System.Windows.Forms.Label();
this.lblAngulo = new System.Windows.Forms.Label();
this.lblRPM = new System.Windows.Forms.Label();
this.nudVelocidadeMP = new System.Windows.Forms.NumericUpDown();
this.nudAngulo = new System.Windows.Forms.NumericUpDown();
this.nudRPM = new System.Windows.Forms.NumericUpDown();
this.lblVelocidadeSP = new System.Windows.Forms.Label();
this.btnControle = new System.Windows.Forms.Button();
this.lblControle = new System.Windows.Forms.Label();
this.chbFoco = new System.Windows.Forms.CheckBox();
@ -87,33 +84,27 @@
this.pnlMapa = new System.Windows.Forms.Panel();
this.lblMapa = new System.Windows.Forms.Label();
this.btnCarregar = new System.Windows.Forms.Button();
this.cmbTipoMovimento = new System.Windows.Forms.ComboBox();
this.lblTipoMovimento = new System.Windows.Forms.Label();
this.btnVerFalha = new System.Windows.Forms.Button();
this.lblCodigoFalha = new System.Windows.Forms.Label();
this.txtCodigoFalha = new System.Windows.Forms.TextBox();
this.tkbVelocidadeSP = new System.Windows.Forms.TrackBar();
this.tkbAnguloMP = new System.Windows.Forms.TrackBar();
this.tvwFalhas = new System.Windows.Forms.TreeView();
this.pnlDados.SuspendLayout();
this.pnlControle.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudVelocidadeMP)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudAngulo)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudRPM)).BeginInit();
this.pnlMapa.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tkbVelocidadeSP)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tkbAnguloMP)).BeginInit();
this.SuspendLayout();
//
// lblEquipamento
//
this.lblEquipamento.AutoSize = true;
this.lblEquipamento.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblEquipamento.Location = new System.Drawing.Point(6, 11);
this.lblEquipamento.Name = "lblEquipamento";
this.lblEquipamento.Size = new System.Drawing.Size(91, 17);
this.lblEquipamento.TabIndex = 0;
this.lblEquipamento.Text = "Equipamento";
//
// cmbEquipamento
//
this.cmbEquipamento.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbEquipamento.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.cmbEquipamento.FormattingEnabled = true;
this.cmbEquipamento.Location = new System.Drawing.Point(113, 8);
this.cmbEquipamento.Location = new System.Drawing.Point(166, 8);
this.cmbEquipamento.Name = "cmbEquipamento";
this.cmbEquipamento.Size = new System.Drawing.Size(100, 25);
this.cmbEquipamento.Size = new System.Drawing.Size(88, 25);
this.cmbEquipamento.TabIndex = 1;
this.cmbEquipamento.SelectedIndexChanged += new System.EventHandler(this.cmbEquipamento_SelectedIndexChanged);
//
@ -121,7 +112,7 @@
//
this.lblLatitude.AutoSize = true;
this.lblLatitude.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblLatitude.Location = new System.Drawing.Point(6, 113);
this.lblLatitude.Location = new System.Drawing.Point(12, 128);
this.lblLatitude.Name = "lblLatitude";
this.lblLatitude.Size = new System.Drawing.Size(59, 17);
this.lblLatitude.TabIndex = 2;
@ -131,7 +122,7 @@
//
this.lblLongitude.AutoSize = true;
this.lblLongitude.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblLongitude.Location = new System.Drawing.Point(111, 113);
this.lblLongitude.Location = new System.Drawing.Point(117, 128);
this.lblLongitude.Name = "lblLongitude";
this.lblLongitude.Size = new System.Drawing.Size(71, 17);
this.lblLongitude.TabIndex = 3;
@ -139,7 +130,7 @@
//
// txtLatitude
//
this.txtLatitude.Location = new System.Drawing.Point(5, 133);
this.txtLatitude.Location = new System.Drawing.Point(11, 148);
this.txtLatitude.Name = "txtLatitude";
this.txtLatitude.ReadOnly = true;
this.txtLatitude.Size = new System.Drawing.Size(100, 20);
@ -148,7 +139,7 @@
//
// txtLongitude
//
this.txtLongitude.Location = new System.Drawing.Point(113, 133);
this.txtLongitude.Location = new System.Drawing.Point(119, 148);
this.txtLongitude.Name = "txtLongitude";
this.txtLongitude.ReadOnly = true;
this.txtLongitude.Size = new System.Drawing.Size(100, 20);
@ -158,9 +149,12 @@
// pnlDados
//
this.pnlDados.AutoScroll = true;
this.pnlDados.Controls.Add(this.chbFoco);
this.pnlDados.Controls.Add(this.txtCodigoFalha);
this.pnlDados.Controls.Add(this.lblCodigoFalha);
this.pnlDados.Controls.Add(this.btnVerFalha);
this.pnlDados.Controls.Add(this.pnlControle);
this.pnlDados.Controls.Add(this.lblControle);
this.pnlDados.Controls.Add(this.chbFoco);
this.pnlDados.Controls.Add(this.txtTempoEstimado);
this.pnlDados.Controls.Add(this.lblTempoEstimado);
this.pnlDados.Controls.Add(this.lblTempoDecorrido);
@ -200,111 +194,83 @@
this.pnlDados.Controls.Add(this.lblLeitura);
this.pnlDados.Controls.Add(this.txtLeitura);
this.pnlDados.Controls.Add(this.cmbEquipamento);
this.pnlDados.Controls.Add(this.lblEquipamento);
this.pnlDados.Controls.Add(this.txtLatitude);
this.pnlDados.Controls.Add(this.lblLongitude);
this.pnlDados.Controls.Add(this.lblLatitude);
this.pnlDados.Controls.Add(this.txtLongitude);
this.pnlDados.Dock = System.Windows.Forms.DockStyle.Right;
this.pnlDados.Location = new System.Drawing.Point(787, 0);
this.pnlDados.Location = new System.Drawing.Point(802, 0);
this.pnlDados.Name = "pnlDados";
this.pnlDados.Size = new System.Drawing.Size(239, 594);
this.pnlDados.Size = new System.Drawing.Size(274, 594);
this.pnlDados.TabIndex = 6;
//
// pnlControle
//
this.pnlControle.Controls.Add(this.tkbAnguloMP);
this.pnlControle.Controls.Add(this.tkbVelocidadeSP);
this.pnlControle.Controls.Add(this.lblAngulo);
this.pnlControle.Controls.Add(this.lblVelocidadeSP);
this.pnlControle.Controls.Add(this.lblTipoMovimento);
this.pnlControle.Controls.Add(this.cmbTipoMovimento);
this.pnlControle.Controls.Add(this.btnParar);
this.pnlControle.Controls.Add(this.lblVelocidadeMP);
this.pnlControle.Controls.Add(this.lblAngulo);
this.pnlControle.Controls.Add(this.lblRPM);
this.pnlControle.Controls.Add(this.nudVelocidadeMP);
this.pnlControle.Controls.Add(this.nudAngulo);
this.pnlControle.Controls.Add(this.nudRPM);
this.pnlControle.Controls.Add(this.btnControle);
this.pnlControle.Location = new System.Drawing.Point(5, 623);
this.pnlControle.Location = new System.Drawing.Point(11, 638);
this.pnlControle.Name = "pnlControle";
this.pnlControle.Size = new System.Drawing.Size(208, 232);
this.pnlControle.Size = new System.Drawing.Size(233, 276);
this.pnlControle.TabIndex = 49;
//
// lblTipoMovimento
//
this.lblTipoMovimento.AutoSize = true;
this.lblTipoMovimento.Location = new System.Drawing.Point(5, 6);
this.lblTipoMovimento.Name = "lblTipoMovimento";
this.lblTipoMovimento.Size = new System.Drawing.Size(83, 13);
this.lblTipoMovimento.TabIndex = 17;
this.lblTipoMovimento.Text = "Tipo Movimento";
//
// cmbTipoMovimento
//
this.cmbTipoMovimento.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbTipoMovimento.FormattingEnabled = true;
this.cmbTipoMovimento.Location = new System.Drawing.Point(109, 3);
this.cmbTipoMovimento.Name = "cmbTipoMovimento";
this.cmbTipoMovimento.Size = new System.Drawing.Size(114, 21);
this.cmbTipoMovimento.TabIndex = 16;
//
// btnParar
//
this.btnParar.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.btnParar.Location = new System.Drawing.Point(6, 191);
this.btnParar.Location = new System.Drawing.Point(8, 235);
this.btnParar.Name = "btnParar";
this.btnParar.Size = new System.Drawing.Size(195, 38);
this.btnParar.Size = new System.Drawing.Size(215, 38);
this.btnParar.TabIndex = 15;
this.btnParar.Text = "Parar";
this.btnParar.UseVisualStyleBackColor = true;
this.btnParar.Click += new System.EventHandler(this.btnParar_Click);
//
// lblVelocidadeMP
//
this.lblVelocidadeMP.AutoSize = true;
this.lblVelocidadeMP.Location = new System.Drawing.Point(137, 140);
this.lblVelocidadeMP.Name = "lblVelocidadeMP";
this.lblVelocidadeMP.Size = new System.Drawing.Size(31, 13);
this.lblVelocidadeMP.TabIndex = 14;
this.lblVelocidadeMP.Text = "% Dir";
//
// lblAngulo
//
this.lblAngulo.AutoSize = true;
this.lblAngulo.Location = new System.Drawing.Point(69, 140);
this.lblAngulo.Location = new System.Drawing.Point(5, 163);
this.lblAngulo.Name = "lblAngulo";
this.lblAngulo.Size = new System.Drawing.Size(40, 13);
this.lblAngulo.Size = new System.Drawing.Size(56, 13);
this.lblAngulo.TabIndex = 13;
this.lblAngulo.Text = "Angulo";
this.lblAngulo.Text = "Angulo: 0°";
//
// lblRPM
// lblVelocidadeSP
//
this.lblRPM.AutoSize = true;
this.lblRPM.Location = new System.Drawing.Point(3, 140);
this.lblRPM.Name = "lblRPM";
this.lblRPM.Size = new System.Drawing.Size(31, 13);
this.lblRPM.TabIndex = 12;
this.lblRPM.Text = "RPM";
//
// nudVelocidadeMP
//
this.nudVelocidadeMP.Location = new System.Drawing.Point(140, 156);
this.nudVelocidadeMP.Name = "nudVelocidadeMP";
this.nudVelocidadeMP.Size = new System.Drawing.Size(62, 20);
this.nudVelocidadeMP.TabIndex = 11;
this.nudVelocidadeMP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// nudAngulo
//
this.nudAngulo.Location = new System.Drawing.Point(72, 156);
this.nudAngulo.Maximum = new decimal(new int[] {
90,
0,
0,
0});
this.nudAngulo.Name = "nudAngulo";
this.nudAngulo.Size = new System.Drawing.Size(62, 20);
this.nudAngulo.TabIndex = 10;
this.nudAngulo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// nudRPM
//
this.nudRPM.Location = new System.Drawing.Point(4, 156);
this.nudRPM.Maximum = new decimal(new int[] {
600,
0,
0,
0});
this.nudRPM.Name = "nudRPM";
this.nudRPM.Size = new System.Drawing.Size(62, 20);
this.nudRPM.TabIndex = 9;
this.nudRPM.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.lblVelocidadeSP.AutoSize = true;
this.lblVelocidadeSP.Location = new System.Drawing.Point(5, 99);
this.lblVelocidadeSP.Name = "lblVelocidadeSP";
this.lblVelocidadeSP.Size = new System.Drawing.Size(132, 13);
this.lblVelocidadeSP.TabIndex = 12;
this.lblVelocidadeSP.Text = "Velocidade: 0% 0,00 km/h";
//
// btnControle
//
this.btnControle.Location = new System.Drawing.Point(52, 54);
this.btnControle.Location = new System.Drawing.Point(8, 33);
this.btnControle.Name = "btnControle";
this.btnControle.Size = new System.Drawing.Size(94, 57);
this.btnControle.Size = new System.Drawing.Size(215, 57);
this.btnControle.TabIndex = 8;
this.btnControle.UseVisualStyleBackColor = true;
this.btnControle.KeyDown += new System.Windows.Forms.KeyEventHandler(this.btnControle_KeyDown);
@ -314,7 +280,7 @@
//
this.lblControle.AutoSize = true;
this.lblControle.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblControle.Location = new System.Drawing.Point(6, 603);
this.lblControle.Location = new System.Drawing.Point(12, 618);
this.lblControle.Name = "lblControle";
this.lblControle.Size = new System.Drawing.Size(61, 17);
this.lblControle.TabIndex = 48;
@ -323,16 +289,16 @@
// chbFoco
//
this.chbFoco.AutoSize = true;
this.chbFoco.Location = new System.Drawing.Point(9, 41);
this.chbFoco.Location = new System.Drawing.Point(9, 13);
this.chbFoco.Name = "chbFoco";
this.chbFoco.Size = new System.Drawing.Size(86, 17);
this.chbFoco.Size = new System.Drawing.Size(151, 17);
this.chbFoco.TabIndex = 7;
this.chbFoco.Text = "Acompanhar";
this.chbFoco.Text = "Acompanhar Equipamento";
this.chbFoco.UseVisualStyleBackColor = true;
//
// txtTempoEstimado
//
this.txtTempoEstimado.Location = new System.Drawing.Point(113, 219);
this.txtTempoEstimado.Location = new System.Drawing.Point(119, 234);
this.txtTempoEstimado.Name = "txtTempoEstimado";
this.txtTempoEstimado.ReadOnly = true;
this.txtTempoEstimado.Size = new System.Drawing.Size(100, 20);
@ -343,7 +309,7 @@
//
this.lblTempoEstimado.AutoSize = true;
this.lblTempoEstimado.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblTempoEstimado.Location = new System.Drawing.Point(111, 199);
this.lblTempoEstimado.Location = new System.Drawing.Point(117, 214);
this.lblTempoEstimado.Name = "lblTempoEstimado";
this.lblTempoEstimado.Size = new System.Drawing.Size(66, 17);
this.lblTempoEstimado.TabIndex = 45;
@ -353,7 +319,7 @@
//
this.lblTempoDecorrido.AutoSize = true;
this.lblTempoDecorrido.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblTempoDecorrido.Location = new System.Drawing.Point(6, 199);
this.lblTempoDecorrido.Location = new System.Drawing.Point(12, 214);
this.lblTempoDecorrido.Name = "lblTempoDecorrido";
this.lblTempoDecorrido.Size = new System.Drawing.Size(70, 17);
this.lblTempoDecorrido.TabIndex = 44;
@ -361,7 +327,7 @@
//
// txtTempoDecorrido
//
this.txtTempoDecorrido.Location = new System.Drawing.Point(5, 219);
this.txtTempoDecorrido.Location = new System.Drawing.Point(11, 234);
this.txtTempoDecorrido.Name = "txtTempoDecorrido";
this.txtTempoDecorrido.ReadOnly = true;
this.txtTempoDecorrido.Size = new System.Drawing.Size(100, 20);
@ -372,7 +338,7 @@
//
this.lblProgressoRua.AutoSize = true;
this.lblProgressoRua.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblProgressoRua.Location = new System.Drawing.Point(112, 242);
this.lblProgressoRua.Location = new System.Drawing.Point(118, 257);
this.lblProgressoRua.Name = "lblProgressoRua";
this.lblProgressoRua.Size = new System.Drawing.Size(50, 17);
this.lblProgressoRua.TabIndex = 42;
@ -380,7 +346,7 @@
//
// pgbProgressoRua
//
this.pgbProgressoRua.Location = new System.Drawing.Point(111, 262);
this.pgbProgressoRua.Location = new System.Drawing.Point(117, 277);
this.pgbProgressoRua.Name = "pgbProgressoRua";
this.pgbProgressoRua.Size = new System.Drawing.Size(100, 20);
this.pgbProgressoRua.TabIndex = 41;
@ -389,7 +355,7 @@
//
this.lblProgressoOperacao.AutoSize = true;
this.lblProgressoOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblProgressoOperacao.Location = new System.Drawing.Point(6, 242);
this.lblProgressoOperacao.Location = new System.Drawing.Point(12, 257);
this.lblProgressoOperacao.Name = "lblProgressoOperacao";
this.lblProgressoOperacao.Size = new System.Drawing.Size(87, 17);
this.lblProgressoOperacao.TabIndex = 40;
@ -397,14 +363,14 @@
//
// pgbProgressoOperacao
//
this.pgbProgressoOperacao.Location = new System.Drawing.Point(5, 262);
this.pgbProgressoOperacao.Location = new System.Drawing.Point(11, 277);
this.pgbProgressoOperacao.Name = "pgbProgressoOperacao";
this.pgbProgressoOperacao.Size = new System.Drawing.Size(100, 20);
this.pgbProgressoOperacao.TabIndex = 39;
//
// txtStatusCarro
//
this.txtStatusCarro.Location = new System.Drawing.Point(113, 176);
this.txtStatusCarro.Location = new System.Drawing.Point(119, 191);
this.txtStatusCarro.Name = "txtStatusCarro";
this.txtStatusCarro.ReadOnly = true;
this.txtStatusCarro.Size = new System.Drawing.Size(100, 20);
@ -415,7 +381,7 @@
//
this.lblStatusCarro.AutoSize = true;
this.lblStatusCarro.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblStatusCarro.Location = new System.Drawing.Point(111, 156);
this.lblStatusCarro.Location = new System.Drawing.Point(117, 171);
this.lblStatusCarro.Name = "lblStatusCarro";
this.lblStatusCarro.Size = new System.Drawing.Size(43, 17);
this.lblStatusCarro.TabIndex = 37;
@ -425,7 +391,7 @@
//
this.lblStatusOperacao.AutoSize = true;
this.lblStatusOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblStatusOperacao.Location = new System.Drawing.Point(6, 156);
this.lblStatusOperacao.Location = new System.Drawing.Point(12, 171);
this.lblStatusOperacao.Name = "lblStatusOperacao";
this.lblStatusOperacao.Size = new System.Drawing.Size(71, 17);
this.lblStatusOperacao.TabIndex = 36;
@ -433,7 +399,7 @@
//
// txtStatusOperacao
//
this.txtStatusOperacao.Location = new System.Drawing.Point(5, 176);
this.txtStatusOperacao.Location = new System.Drawing.Point(11, 191);
this.txtStatusOperacao.Name = "txtStatusOperacao";
this.txtStatusOperacao.ReadOnly = true;
this.txtStatusOperacao.Size = new System.Drawing.Size(100, 20);
@ -444,7 +410,7 @@
//
this.lblErvasIdentificadas.AutoSize = true;
this.lblErvasIdentificadas.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblErvasIdentificadas.Location = new System.Drawing.Point(152, 381);
this.lblErvasIdentificadas.Location = new System.Drawing.Point(158, 396);
this.lblErvasIdentificadas.Name = "lblErvasIdentificadas";
this.lblErvasIdentificadas.Size = new System.Drawing.Size(54, 13);
this.lblErvasIdentificadas.TabIndex = 34;
@ -454,7 +420,7 @@
//
this.lblVelocidadeDados.AutoSize = true;
this.lblVelocidadeDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblVelocidadeDados.Location = new System.Drawing.Point(111, 566);
this.lblVelocidadeDados.Location = new System.Drawing.Point(117, 581);
this.lblVelocidadeDados.Name = "lblVelocidadeDados";
this.lblVelocidadeDados.Size = new System.Drawing.Size(82, 13);
this.lblVelocidadeDados.TabIndex = 33;
@ -464,7 +430,7 @@
//
this.lblVelocidade.AutoSize = true;
this.lblVelocidade.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblVelocidade.Location = new System.Drawing.Point(6, 543);
this.lblVelocidade.Location = new System.Drawing.Point(12, 558);
this.lblVelocidade.Name = "lblVelocidade";
this.lblVelocidade.Size = new System.Drawing.Size(78, 17);
this.lblVelocidade.TabIndex = 32;
@ -472,7 +438,7 @@
//
// pgbVelocidade
//
this.pgbVelocidade.Location = new System.Drawing.Point(5, 563);
this.pgbVelocidade.Location = new System.Drawing.Point(11, 578);
this.pgbVelocidade.Maximum = 20;
this.pgbVelocidade.Name = "pgbVelocidade";
this.pgbVelocidade.Size = new System.Drawing.Size(100, 20);
@ -482,7 +448,7 @@
//
this.lblHerbicidaDados.AutoSize = true;
this.lblHerbicidaDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblHerbicidaDados.Location = new System.Drawing.Point(111, 394);
this.lblHerbicidaDados.Location = new System.Drawing.Point(117, 409);
this.lblHerbicidaDados.Name = "lblHerbicidaDados";
this.lblHerbicidaDados.Size = new System.Drawing.Size(100, 13);
this.lblHerbicidaDados.TabIndex = 30;
@ -492,7 +458,7 @@
//
this.lblHerbicida.AutoSize = true;
this.lblHerbicida.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblHerbicida.Location = new System.Drawing.Point(6, 371);
this.lblHerbicida.Location = new System.Drawing.Point(12, 386);
this.lblHerbicida.Name = "lblHerbicida";
this.lblHerbicida.Size = new System.Drawing.Size(126, 17);
this.lblHerbicida.TabIndex = 29;
@ -500,7 +466,7 @@
//
// pgbHerbicidaAplicado
//
this.pgbHerbicidaAplicado.Location = new System.Drawing.Point(5, 391);
this.pgbHerbicidaAplicado.Location = new System.Drawing.Point(11, 406);
this.pgbHerbicidaAplicado.Maximum = 35;
this.pgbHerbicidaAplicado.Name = "pgbHerbicidaAplicado";
this.pgbHerbicidaAplicado.Size = new System.Drawing.Size(100, 20);
@ -510,7 +476,7 @@
//
this.lblPressaoDados.AutoSize = true;
this.lblPressaoDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblPressaoDados.Location = new System.Drawing.Point(111, 437);
this.lblPressaoDados.Location = new System.Drawing.Point(117, 452);
this.lblPressaoDados.Name = "lblPressaoDados";
this.lblPressaoDados.Size = new System.Drawing.Size(44, 13);
this.lblPressaoDados.TabIndex = 27;
@ -520,7 +486,7 @@
//
this.lblPressao.AutoSize = true;
this.lblPressao.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblPressao.Location = new System.Drawing.Point(6, 414);
this.lblPressao.Location = new System.Drawing.Point(12, 429);
this.lblPressao.Name = "lblPressao";
this.lblPressao.Size = new System.Drawing.Size(119, 17);
this.lblPressao.TabIndex = 26;
@ -528,7 +494,7 @@
//
// pgbPressao
//
this.pgbPressao.Location = new System.Drawing.Point(5, 434);
this.pgbPressao.Location = new System.Drawing.Point(11, 449);
this.pgbPressao.Maximum = 150;
this.pgbPressao.Name = "pgbPressao";
this.pgbPressao.Size = new System.Drawing.Size(100, 20);
@ -538,7 +504,7 @@
//
this.lblTemperaturaCampoDados.AutoSize = true;
this.lblTemperaturaCampoDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblTemperaturaCampoDados.Location = new System.Drawing.Point(111, 523);
this.lblTemperaturaCampoDados.Location = new System.Drawing.Point(117, 538);
this.lblTemperaturaCampoDados.Name = "lblTemperaturaCampoDados";
this.lblTemperaturaCampoDados.Size = new System.Drawing.Size(42, 13);
this.lblTemperaturaCampoDados.TabIndex = 24;
@ -548,7 +514,7 @@
//
this.lblTemperaturaCampo.AutoSize = true;
this.lblTemperaturaCampo.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblTemperaturaCampo.Location = new System.Drawing.Point(6, 500);
this.lblTemperaturaCampo.Location = new System.Drawing.Point(8, 515);
this.lblTemperaturaCampo.Name = "lblTemperaturaCampo";
this.lblTemperaturaCampo.Size = new System.Drawing.Size(138, 17);
this.lblTemperaturaCampo.TabIndex = 23;
@ -556,7 +522,7 @@
//
// pgbTemperaturaCampo
//
this.pgbTemperaturaCampo.Location = new System.Drawing.Point(5, 520);
this.pgbTemperaturaCampo.Location = new System.Drawing.Point(11, 535);
this.pgbTemperaturaCampo.Name = "pgbTemperaturaCampo";
this.pgbTemperaturaCampo.Size = new System.Drawing.Size(100, 20);
this.pgbTemperaturaCampo.TabIndex = 22;
@ -565,7 +531,7 @@
//
this.lblTemperaturaMotoresDados.AutoSize = true;
this.lblTemperaturaMotoresDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblTemperaturaMotoresDados.Location = new System.Drawing.Point(111, 480);
this.lblTemperaturaMotoresDados.Location = new System.Drawing.Point(117, 495);
this.lblTemperaturaMotoresDados.Name = "lblTemperaturaMotoresDados";
this.lblTemperaturaMotoresDados.Size = new System.Drawing.Size(42, 13);
this.lblTemperaturaMotoresDados.TabIndex = 21;
@ -575,7 +541,7 @@
//
this.lblTemperaturaMotores.AutoSize = true;
this.lblTemperaturaMotores.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblTemperaturaMotores.Location = new System.Drawing.Point(6, 457);
this.lblTemperaturaMotores.Location = new System.Drawing.Point(12, 472);
this.lblTemperaturaMotores.Name = "lblTemperaturaMotores";
this.lblTemperaturaMotores.Size = new System.Drawing.Size(145, 17);
this.lblTemperaturaMotores.TabIndex = 20;
@ -583,7 +549,7 @@
//
// pgbTemperaturaMotores
//
this.pgbTemperaturaMotores.Location = new System.Drawing.Point(5, 477);
this.pgbTemperaturaMotores.Location = new System.Drawing.Point(11, 492);
this.pgbTemperaturaMotores.Maximum = 200;
this.pgbTemperaturaMotores.Name = "pgbTemperaturaMotores";
this.pgbTemperaturaMotores.Size = new System.Drawing.Size(100, 20);
@ -593,7 +559,7 @@
//
this.lblReservatorioDados.AutoSize = true;
this.lblReservatorioDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblReservatorioDados.Location = new System.Drawing.Point(111, 351);
this.lblReservatorioDados.Location = new System.Drawing.Point(117, 366);
this.lblReservatorioDados.Name = "lblReservatorioDados";
this.lblReservatorioDados.Size = new System.Drawing.Size(75, 13);
this.lblReservatorioDados.TabIndex = 15;
@ -603,7 +569,7 @@
//
this.lblBateriaDados.AutoSize = true;
this.lblBateriaDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblBateriaDados.Location = new System.Drawing.Point(111, 308);
this.lblBateriaDados.Location = new System.Drawing.Point(117, 323);
this.lblBateriaDados.Name = "lblBateriaDados";
this.lblBateriaDados.Size = new System.Drawing.Size(98, 13);
this.lblBateriaDados.TabIndex = 14;
@ -613,7 +579,7 @@
//
this.lblReservatorio.AutoSize = true;
this.lblReservatorio.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblReservatorio.Location = new System.Drawing.Point(6, 328);
this.lblReservatorio.Location = new System.Drawing.Point(12, 343);
this.lblReservatorio.Name = "lblReservatorio";
this.lblReservatorio.Size = new System.Drawing.Size(153, 17);
this.lblReservatorio.TabIndex = 13;
@ -621,7 +587,7 @@
//
// pgbReservatorio
//
this.pgbReservatorio.Location = new System.Drawing.Point(5, 348);
this.pgbReservatorio.Location = new System.Drawing.Point(11, 363);
this.pgbReservatorio.Maximum = 35;
this.pgbReservatorio.Name = "pgbReservatorio";
this.pgbReservatorio.Size = new System.Drawing.Size(100, 20);
@ -631,7 +597,7 @@
//
this.lblBateria.AutoSize = true;
this.lblBateria.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblBateria.Location = new System.Drawing.Point(6, 285);
this.lblBateria.Location = new System.Drawing.Point(12, 300);
this.lblBateria.Name = "lblBateria";
this.lblBateria.Size = new System.Drawing.Size(53, 17);
this.lblBateria.TabIndex = 11;
@ -639,14 +605,14 @@
//
// pgbBateria
//
this.pgbBateria.Location = new System.Drawing.Point(5, 305);
this.pgbBateria.Location = new System.Drawing.Point(11, 320);
this.pgbBateria.Name = "pgbBateria";
this.pgbBateria.Size = new System.Drawing.Size(100, 20);
this.pgbBateria.TabIndex = 10;
//
// txtOrientacao
//
this.txtOrientacao.Location = new System.Drawing.Point(113, 90);
this.txtOrientacao.Location = new System.Drawing.Point(119, 105);
this.txtOrientacao.Name = "txtOrientacao";
this.txtOrientacao.ReadOnly = true;
this.txtOrientacao.Size = new System.Drawing.Size(100, 20);
@ -657,7 +623,7 @@
//
this.lblOrientacao.AutoSize = true;
this.lblOrientacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblOrientacao.Location = new System.Drawing.Point(111, 70);
this.lblOrientacao.Location = new System.Drawing.Point(117, 85);
this.lblOrientacao.Name = "lblOrientacao";
this.lblOrientacao.Size = new System.Drawing.Size(78, 17);
this.lblOrientacao.TabIndex = 8;
@ -667,7 +633,7 @@
//
this.lblLeitura.AutoSize = true;
this.lblLeitura.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblLeitura.Location = new System.Drawing.Point(6, 70);
this.lblLeitura.Location = new System.Drawing.Point(12, 85);
this.lblLeitura.Name = "lblLeitura";
this.lblLeitura.Size = new System.Drawing.Size(52, 17);
this.lblLeitura.TabIndex = 7;
@ -675,7 +641,7 @@
//
// txtLeitura
//
this.txtLeitura.Location = new System.Drawing.Point(5, 90);
this.txtLeitura.Location = new System.Drawing.Point(11, 105);
this.txtLeitura.Name = "txtLeitura";
this.txtLeitura.ReadOnly = true;
this.txtLeitura.Size = new System.Drawing.Size(100, 20);
@ -687,10 +653,11 @@
this.pnlMapa.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnlMapa.Controls.Add(this.tvwFalhas);
this.pnlMapa.Location = new System.Drawing.Point(11, 11);
this.pnlMapa.Margin = new System.Windows.Forms.Padding(2);
this.pnlMapa.Name = "pnlMapa";
this.pnlMapa.Size = new System.Drawing.Size(771, 542);
this.pnlMapa.Size = new System.Drawing.Size(786, 542);
this.pnlMapa.TabIndex = 7;
//
// lblMapa
@ -716,29 +683,68 @@
this.btnCarregar.UseVisualStyleBackColor = true;
this.btnCarregar.Click += new System.EventHandler(this.btnCarregar_Click);
//
// cmbTipoMovimento
// btnVerFalha
//
this.cmbTipoMovimento.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbTipoMovimento.FormattingEnabled = true;
this.cmbTipoMovimento.Location = new System.Drawing.Point(92, 3);
this.cmbTipoMovimento.Name = "cmbTipoMovimento";
this.cmbTipoMovimento.Size = new System.Drawing.Size(110, 21);
this.cmbTipoMovimento.TabIndex = 16;
this.btnVerFalha.Location = new System.Drawing.Point(219, 46);
this.btnVerFalha.Name = "btnVerFalha";
this.btnVerFalha.Size = new System.Drawing.Size(35, 23);
this.btnVerFalha.TabIndex = 50;
this.btnVerFalha.Text = "Ver";
this.btnVerFalha.UseVisualStyleBackColor = true;
this.btnVerFalha.Click += new System.EventHandler(this.btnVerFalha_Click);
//
// lblTipoMovimento
// lblCodigoFalha
//
this.lblTipoMovimento.AutoSize = true;
this.lblTipoMovimento.Location = new System.Drawing.Point(3, 6);
this.lblTipoMovimento.Name = "lblTipoMovimento";
this.lblTipoMovimento.Size = new System.Drawing.Size(83, 13);
this.lblTipoMovimento.TabIndex = 17;
this.lblTipoMovimento.Text = "Tipo Movimento";
this.lblCodigoFalha.AutoSize = true;
this.lblCodigoFalha.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblCodigoFalha.Location = new System.Drawing.Point(6, 49);
this.lblCodigoFalha.Name = "lblCodigoFalha";
this.lblCodigoFalha.Size = new System.Drawing.Size(91, 17);
this.lblCodigoFalha.TabIndex = 51;
this.lblCodigoFalha.Text = "Código Falha";
//
// txtCodigoFalha
//
this.txtCodigoFalha.Location = new System.Drawing.Point(113, 49);
this.txtCodigoFalha.Name = "txtCodigoFalha";
this.txtCodigoFalha.ReadOnly = true;
this.txtCodigoFalha.Size = new System.Drawing.Size(100, 20);
this.txtCodigoFalha.TabIndex = 52;
this.txtCodigoFalha.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// tkbVelocidadeSP
//
this.tkbVelocidadeSP.Location = new System.Drawing.Point(8, 115);
this.tkbVelocidadeSP.Maximum = 100;
this.tkbVelocidadeSP.Name = "tkbVelocidadeSP";
this.tkbVelocidadeSP.Size = new System.Drawing.Size(215, 45);
this.tkbVelocidadeSP.TabIndex = 18;
this.tkbVelocidadeSP.TickFrequency = 10;
//
// tkbAnguloMP
//
this.tkbAnguloMP.Location = new System.Drawing.Point(8, 179);
this.tkbAnguloMP.Maximum = 100;
this.tkbAnguloMP.Name = "tkbAnguloMP";
this.tkbAnguloMP.Size = new System.Drawing.Size(215, 45);
this.tkbAnguloMP.TabIndex = 19;
this.tkbAnguloMP.TickFrequency = 10;
//
// tvwFalhas
//
this.tvwFalhas.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.tvwFalhas.Location = new System.Drawing.Point(421, 3);
this.tvwFalhas.Name = "tvwFalhas";
this.tvwFalhas.Size = new System.Drawing.Size(362, 536);
this.tvwFalhas.TabIndex = 0;
this.tvwFalhas.Visible = false;
//
// frmMonitoramento
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1026, 594);
this.ClientSize = new System.Drawing.Size(1076, 594);
this.Controls.Add(this.btnCarregar);
this.Controls.Add(this.lblMapa);
this.Controls.Add(this.pnlMapa);
@ -751,16 +757,15 @@
this.pnlDados.PerformLayout();
this.pnlControle.ResumeLayout(false);
this.pnlControle.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudVelocidadeMP)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudAngulo)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudRPM)).EndInit();
this.pnlMapa.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.tkbVelocidadeSP)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tkbAnguloMP)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblEquipamento;
private System.Windows.Forms.ComboBox cmbEquipamento;
private System.Windows.Forms.Label lblLatitude;
private System.Windows.Forms.Label lblLongitude;
@ -812,14 +817,16 @@
private System.Windows.Forms.Panel pnlControle;
private System.Windows.Forms.Label lblControle;
private System.Windows.Forms.Button btnControle;
private System.Windows.Forms.Label lblVelocidadeMP;
private System.Windows.Forms.Label lblAngulo;
private System.Windows.Forms.Label lblRPM;
private System.Windows.Forms.NumericUpDown nudVelocidadeMP;
private System.Windows.Forms.NumericUpDown nudAngulo;
private System.Windows.Forms.NumericUpDown nudRPM;
private System.Windows.Forms.Label lblVelocidadeSP;
private System.Windows.Forms.Button btnParar;
private System.Windows.Forms.ComboBox cmbTipoMovimento;
private System.Windows.Forms.Label lblTipoMovimento;
private System.Windows.Forms.Label lblCodigoFalha;
private System.Windows.Forms.Button btnVerFalha;
private System.Windows.Forms.TextBox txtCodigoFalha;
private System.Windows.Forms.TrackBar tkbVelocidadeSP;
private System.Windows.Forms.TrackBar tkbAnguloMP;
private System.Windows.Forms.TreeView tvwFalhas;
}
}

View File

@ -2,12 +2,8 @@
using AgroBase.Services;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static AgroBase.Models.Enums;
@ -126,6 +122,7 @@ namespace AgroMonitor.Forms
txtLatitude.Text = GPSService.UltimaLeitura.Latitude.ToString();
txtLongitude.Text = GPSService.UltimaLeitura.Longitude.ToString();
txtCodigoFalha.Text = "";
txtStatusOperacao.Text = "";
txtStatusCarro.Text = "";
txtTempoDecorrido.Text = "";
@ -161,6 +158,8 @@ namespace AgroMonitor.Forms
txtLatitude.Text = Equipamento.Coordenadas.Latitude.ToString();
txtLongitude.Text = Equipamento.Coordenadas.Longitude.ToString();
txtCodigoFalha.Text = Equipamento.CodigoFalha.ToString();
txtStatusOperacao.Text = Equipamento.Operacao.statusOperacao.ToString();
txtStatusCarro.Text = Equipamento.Operacao.statusCarro.ToString();
txtTempoDecorrido.Text = TimeSpan.FromSeconds(Equipamento.Operacao.TempoOperacao).ToString(@"hh\:mm\:ss");
@ -227,11 +226,11 @@ namespace AgroMonitor.Forms
{
Momento = DateTime.Now,
Tecla = DeParaTeclas[Tecla],
TipoMovimento = (TipoMovimentoDirecional)cmbTipoMovimento.SelectedIndex,
RPM = Convert.ToInt32(nudRPM.Value),
AnguloMP = Convert.ToInt32(nudAngulo.Value),
VelocidadeMP = Convert.ToInt32(nudVelocidadeMP.Value),
Dispositivo = Disp,
TipoMovimento = (TipoMovimentoDirecional)cmbTipoMovimento.SelectedIndex,
PercentualVelocidadeSP = tkbVelocidadeSP.Value,
AnguloMP = tkbAnguloMP.Value,
VelocidadeMP = 50,
Dispositivo = Disp,
Emergencia = btnParar.Text == "Retomar"
};
@ -267,6 +266,29 @@ namespace AgroMonitor.Forms
EnviarComandoControleEquipamento(Keys.Escape);
}
}
private void btnVerFalha_Click(object sender, EventArgs e)
{
tvwFalhas.Visible = !tvwFalhas.Visible;
if (!tvwFalhas.Visible)
{
return;
}
byte Endereco = Convert.ToByte(cmbEquipamento.Text);
if (Endereco > 0x00 && VariaveisMonitoramento.EquipamentosConectados.Any(x => x.Key == Endereco))
{
var Equipamento = VariaveisMonitoramento.EquipamentosConectados[Endereco];
OperacaoModel.PopularTreeView(tvwFalhas, Equipamento.CodigoFalha);
}
else
{
MessageBox.Show("Selecione um equipamento para ver o código de falhas", "Equipamento não selecionado", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}

View File

@ -8,21 +8,17 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace AgroMonitor.Properties
{
namespace AgroMonitor.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
public static Settings Default {
get {
return defaultInstance;
}
}

View File

@ -1,25 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

View File

@ -1,26 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
</configuration>

Some files were not shown because too many files have changed in this diff Show More