ajustado versionamento e leitura dos tipos de ervas da operacao

This commit is contained in:
Diego Freitas 2024-10-25 17:11:32 -03:00
parent a589945fdf
commit 2f058c3b72
35 changed files with 731 additions and 302 deletions

Binary file not shown.

View File

@ -1,11 +1,12 @@
using System; using System;
using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using AgroBase.Models; using AgroBase.Models;
using AgroBase.Services; using AgroBase.Services;
using Newtonsoft.Json; using Newtonsoft.Json;
using static AgroBase.Models.Enums; using static MqttService;
namespace AgroBase.Forms namespace AgroBase.Forms
{ {
@ -127,8 +128,9 @@ namespace AgroBase.Forms
//var coordenadas = cameraService.AferirDadosCamera<CameraCoordenadasModel>(); //var coordenadas = cameraService.AferirDadosCamera<CameraCoordenadasModel>();
var MqttTopico = Variaveis.MqttService.Topicos.FirstOrDefault(x => x.Topico == cameraSolo.MqttTopico); var MqttTopico = Variaveis.MqttService.Topicos.FirstOrDefault(x => x.Topico == cameraSolo.MqttTopico);
CameraCoordenadasFrameModel leitura = null; CameraCoordenadasFrameModel leitura = null;
var Mensagem = MqttTopico.Mensagens.LastOrDefault(x => x.Momento > cameraSolo.camera.IniciadoEm); List<MqttTopicosMensagensModel> msgs = new List<MqttTopicosMensagensModel>(MqttTopico.Mensagens);
if (Mensagem != null) var Mensagem = msgs.LastOrDefault(x => x.Momento > cameraSolo.camera.IniciadoEm);
if (msgs.Count() > 1 && Mensagem != null)
{ {
try try
{ {
@ -161,7 +163,7 @@ namespace AgroBase.Forms
Label _lblDescricao = new Label() Label _lblDescricao = new Label()
{ {
Name = "lblLeitura" + i + "Descricao", Name = "lblLeitura" + i + "Descricao",
Size = new Size(100, 20), Size = new Size(120, 20),
Text = "Descrição: " + objeto.descricao, Text = "Descrição: " + objeto.descricao,
Location = new Point(6, 40) Location = new Point(6, 40)
}; };

View File

@ -547,7 +547,7 @@ namespace AgroBase.Forms.Operacoes
// Define a string que representa a atuacao do bico // Define a string que representa a atuacao do bico
string bicoAtuacao = "000"; // Variaveis.OperacaoEmAndamento.Sensoriamento.AtuacoesPorBico[i].ToString("000"); string bicoAtuacao = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico[i].Sum(x => x.Value).ToString("000");
// Define a fonte para o texto // Define a fonte para o texto
Font fontA = new Font("Arial", 8, FontStyle.Bold); Font fontA = new Font("Arial", 8, FontStyle.Bold);
// Mede o tamanho do texto // Mede o tamanho do texto

View File

@ -208,7 +208,7 @@ namespace AgroBase.Forms.Operacoes
// Define a string que representa a atuacao do bico // Define a string que representa a atuacao do bico
string bicoAtuacao = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico[i].ToString("000"); string bicoAtuacao = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico[i].Sum(x => x.Value).ToString("000");
// Define a fonte para o texto // Define a fonte para o texto
Font fontA = new Font("Arial", 8, FontStyle.Bold); Font fontA = new Font("Arial", 8, FontStyle.Bold);
// Mede o tamanho do texto // Mede o tamanho do texto

View File

@ -28,27 +28,30 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea9 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend9 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series9 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea10 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend10 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series10 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea11 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend11 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Legend legend3 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series11 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea12 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend12 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Legend legend4 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series12 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea5 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend5 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series5 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea6 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend6 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series6 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea7 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend7 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series7 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea8 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea8 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend8 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Legend legend8 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series8 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.Series series8 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea13 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend13 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series13 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea14 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend14 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series14 = new System.Windows.Forms.DataVisualization.Charting.Series();
this.trbMomento = new System.Windows.Forms.TrackBar(); this.trbMomento = new System.Windows.Forms.TrackBar();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.tabControl4 = new System.Windows.Forms.TabControl(); this.tabControl4 = new System.Windows.Forms.TabControl();
@ -141,7 +144,7 @@
this.label13 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label();
this.lblDIR_EF = new System.Windows.Forms.Label(); this.lblDIR_EF = new System.Windows.Forms.Label();
this.picDIR_EF = new System.Windows.Forms.PictureBox(); this.picDIR_EF = new System.Windows.Forms.PictureBox();
this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabMovimentacao = new System.Windows.Forms.TabPage();
this.tabControl2 = new System.Windows.Forms.TabControl(); this.tabControl2 = new System.Windows.Forms.TabControl();
this.tabMovVelocidade = new System.Windows.Forms.TabPage(); this.tabMovVelocidade = new System.Windows.Forms.TabPage();
this.chartMovVelocidade = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.chartMovVelocidade = new System.Windows.Forms.DataVisualization.Charting.Chart();
@ -263,11 +266,12 @@
this.label30 = new System.Windows.Forms.Label(); this.label30 = new System.Windows.Forms.Label();
this.chartMovGeral = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.chartMovGeral = new System.Windows.Forms.DataVisualization.Charting.Chart();
this.tabAtuador = new System.Windows.Forms.TabPage(); this.tabAtuador = new System.Windows.Forms.TabPage();
this.chbDesenharErvas = new System.Windows.Forms.CheckBox();
this.chartAtuador = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.chartAtuador = new System.Windows.Forms.DataVisualization.Charting.Chart();
this.pnlAtuadores = new System.Windows.Forms.Panel(); this.pnlAtuadores = new System.Windows.Forms.Panel();
this.picCameraSoloD = new System.Windows.Forms.PictureBox(); this.picCameraSoloD = new System.Windows.Forms.PictureBox();
this.picCameraSoloE = new System.Windows.Forms.PictureBox(); this.picCameraSoloE = new System.Windows.Forms.PictureBox();
this.tabPage4 = new System.Windows.Forms.TabPage(); this.tabSensoriamento = new System.Windows.Forms.TabPage();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtSen_Maximo = new System.Windows.Forms.TextBox(); this.txtSen_Maximo = new System.Windows.Forms.TextBox();
this.label68 = new System.Windows.Forms.Label(); this.label68 = new System.Windows.Forms.Label();
@ -398,7 +402,10 @@
this.label36 = new System.Windows.Forms.Label(); this.label36 = new System.Windows.Forms.Label();
this.txtMomento = new System.Windows.Forms.TextBox(); this.txtMomento = new System.Windows.Forms.TextBox();
this.btnPlay = new System.Windows.Forms.Button(); this.btnPlay = new System.Windows.Forms.Button();
this.chbDesenharErvas = new System.Windows.Forms.CheckBox(); this.tabErvas = new System.Windows.Forms.TabPage();
this.chartErvas = new System.Windows.Forms.DataVisualization.Charting.Chart();
this.txtErvasTerreno = new System.Windows.Forms.TextBox();
this.label116 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.trbMomento)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trbMomento)).BeginInit();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.tabControl4.SuspendLayout(); this.tabControl4.SuspendLayout();
@ -411,7 +418,7 @@
((System.ComponentModel.ISupportInitialize)(this.picDIR_DF)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picDIR_DF)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picDIR_ET)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picDIR_ET)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picDIR_EF)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picDIR_EF)).BeginInit();
this.tabPage2.SuspendLayout(); this.tabMovimentacao.SuspendLayout();
this.tabControl2.SuspendLayout(); this.tabControl2.SuspendLayout();
this.tabMovVelocidade.SuspendLayout(); this.tabMovVelocidade.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.chartMovVelocidade)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.chartMovVelocidade)).BeginInit();
@ -440,7 +447,7 @@
((System.ComponentModel.ISupportInitialize)(this.chartAtuador)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.chartAtuador)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picCameraSoloD)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picCameraSoloD)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picCameraSoloE)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picCameraSoloE)).BeginInit();
this.tabPage4.SuspendLayout(); this.tabSensoriamento.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.gpbSEN_Filtro.SuspendLayout(); this.gpbSEN_Filtro.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.chartSensoriamento)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.chartSensoriamento)).BeginInit();
@ -462,6 +469,8 @@
this.tabCodFalhas.SuspendLayout(); this.tabCodFalhas.SuspendLayout();
this.panel6.SuspendLayout(); this.panel6.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picCameraCaminho)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picCameraCaminho)).BeginInit();
this.tabErvas.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.chartErvas)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// trbMomento // trbMomento
@ -840,16 +849,17 @@
// //
// tabControl1 // tabControl1
// //
this.tabControl1.Controls.Add(this.tabCodFalhas);
this.tabControl1.Controls.Add(this.tabDirecional); this.tabControl1.Controls.Add(this.tabDirecional);
this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabMovimentacao);
this.tabControl1.Controls.Add(this.tabAtuador); this.tabControl1.Controls.Add(this.tabAtuador);
this.tabControl1.Controls.Add(this.tabPage4); this.tabControl1.Controls.Add(this.tabErvas);
this.tabControl1.Controls.Add(this.tabSensoriamento);
this.tabControl1.Controls.Add(this.tabSinaleiros); this.tabControl1.Controls.Add(this.tabSinaleiros);
this.tabControl1.Controls.Add(this.tabOrientacao); this.tabControl1.Controls.Add(this.tabOrientacao);
this.tabControl1.Controls.Add(this.tabSonar); this.tabControl1.Controls.Add(this.tabSonar);
this.tabControl1.Controls.Add(this.tabSegmentacao); this.tabControl1.Controls.Add(this.tabSegmentacao);
this.tabControl1.Controls.Add(this.tabCPU); this.tabControl1.Controls.Add(this.tabCPU);
this.tabControl1.Controls.Add(this.tabCodFalhas);
this.tabControl1.Location = new System.Drawing.Point(2, 2); this.tabControl1.Location = new System.Drawing.Point(2, 2);
this.tabControl1.Margin = new System.Windows.Forms.Padding(2); this.tabControl1.Margin = new System.Windows.Forms.Padding(2);
this.tabControl1.Name = "tabControl1"; this.tabControl1.Name = "tabControl1";
@ -1488,17 +1498,17 @@
this.picDIR_EF.TabIndex = 91; this.picDIR_EF.TabIndex = 91;
this.picDIR_EF.TabStop = false; this.picDIR_EF.TabStop = false;
// //
// tabPage2 // tabMovimentacao
// //
this.tabPage2.Controls.Add(this.tabControl2); this.tabMovimentacao.Controls.Add(this.tabControl2);
this.tabPage2.Location = new System.Drawing.Point(4, 22); this.tabMovimentacao.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Margin = new System.Windows.Forms.Padding(2); this.tabMovimentacao.Margin = new System.Windows.Forms.Padding(2);
this.tabPage2.Name = "tabPage2"; this.tabMovimentacao.Name = "tabMovimentacao";
this.tabPage2.Padding = new System.Windows.Forms.Padding(2); this.tabMovimentacao.Padding = new System.Windows.Forms.Padding(2);
this.tabPage2.Size = new System.Drawing.Size(496, 522); this.tabMovimentacao.Size = new System.Drawing.Size(496, 522);
this.tabPage2.TabIndex = 1; this.tabMovimentacao.TabIndex = 1;
this.tabPage2.Text = "Movimentação"; this.tabMovimentacao.Text = "Movimentação";
this.tabPage2.UseVisualStyleBackColor = true; this.tabMovimentacao.UseVisualStyleBackColor = true;
// //
// tabControl2 // tabControl2
// //
@ -1527,17 +1537,17 @@
// //
// chartMovVelocidade // chartMovVelocidade
// //
chartArea9.Name = "ChartArea1"; chartArea1.Name = "ChartArea1";
this.chartMovVelocidade.ChartAreas.Add(chartArea9); this.chartMovVelocidade.ChartAreas.Add(chartArea1);
legend9.Name = "Legend1"; legend1.Name = "Legend1";
this.chartMovVelocidade.Legends.Add(legend9); this.chartMovVelocidade.Legends.Add(legend1);
this.chartMovVelocidade.Location = new System.Drawing.Point(4, 4); this.chartMovVelocidade.Location = new System.Drawing.Point(4, 4);
this.chartMovVelocidade.Margin = new System.Windows.Forms.Padding(2); this.chartMovVelocidade.Margin = new System.Windows.Forms.Padding(2);
this.chartMovVelocidade.Name = "chartMovVelocidade"; this.chartMovVelocidade.Name = "chartMovVelocidade";
series9.ChartArea = "ChartArea1"; series1.ChartArea = "ChartArea1";
series9.Legend = "Legend1"; series1.Legend = "Legend1";
series9.Name = "Series1"; series1.Name = "Series1";
this.chartMovVelocidade.Series.Add(series9); this.chartMovVelocidade.Series.Add(series1);
this.chartMovVelocidade.Size = new System.Drawing.Size(474, 356); this.chartMovVelocidade.Size = new System.Drawing.Size(474, 356);
this.chartMovVelocidade.TabIndex = 96; this.chartMovVelocidade.TabIndex = 96;
this.chartMovVelocidade.Text = "chart1"; this.chartMovVelocidade.Text = "chart1";
@ -1946,17 +1956,17 @@
// //
// chartMovTemperatura // chartMovTemperatura
// //
chartArea10.Name = "ChartArea1"; chartArea2.Name = "ChartArea1";
this.chartMovTemperatura.ChartAreas.Add(chartArea10); this.chartMovTemperatura.ChartAreas.Add(chartArea2);
legend10.Name = "Legend1"; legend2.Name = "Legend1";
this.chartMovTemperatura.Legends.Add(legend10); this.chartMovTemperatura.Legends.Add(legend2);
this.chartMovTemperatura.Location = new System.Drawing.Point(4, 4); this.chartMovTemperatura.Location = new System.Drawing.Point(4, 4);
this.chartMovTemperatura.Margin = new System.Windows.Forms.Padding(2); this.chartMovTemperatura.Margin = new System.Windows.Forms.Padding(2);
this.chartMovTemperatura.Name = "chartMovTemperatura"; this.chartMovTemperatura.Name = "chartMovTemperatura";
series10.ChartArea = "ChartArea1"; series2.ChartArea = "ChartArea1";
series10.Legend = "Legend1"; series2.Legend = "Legend1";
series10.Name = "Series1"; series2.Name = "Series1";
this.chartMovTemperatura.Series.Add(series10); this.chartMovTemperatura.Series.Add(series2);
this.chartMovTemperatura.Size = new System.Drawing.Size(474, 336); this.chartMovTemperatura.Size = new System.Drawing.Size(474, 336);
this.chartMovTemperatura.TabIndex = 95; this.chartMovTemperatura.TabIndex = 95;
this.chartMovTemperatura.Text = "chart1"; this.chartMovTemperatura.Text = "chart1";
@ -2364,17 +2374,17 @@
// //
// chartMovTensao // chartMovTensao
// //
chartArea11.Name = "ChartArea1"; chartArea3.Name = "ChartArea1";
this.chartMovTensao.ChartAreas.Add(chartArea11); this.chartMovTensao.ChartAreas.Add(chartArea3);
legend11.Name = "Legend1"; legend3.Name = "Legend1";
this.chartMovTensao.Legends.Add(legend11); this.chartMovTensao.Legends.Add(legend3);
this.chartMovTensao.Location = new System.Drawing.Point(4, 4); this.chartMovTensao.Location = new System.Drawing.Point(4, 4);
this.chartMovTensao.Margin = new System.Windows.Forms.Padding(2); this.chartMovTensao.Margin = new System.Windows.Forms.Padding(2);
this.chartMovTensao.Name = "chartMovTensao"; this.chartMovTensao.Name = "chartMovTensao";
series11.ChartArea = "ChartArea1"; series3.ChartArea = "ChartArea1";
series11.Legend = "Legend1"; series3.Legend = "Legend1";
series11.Name = "Series1"; series3.Name = "Series1";
this.chartMovTensao.Series.Add(series11); this.chartMovTensao.Series.Add(series3);
this.chartMovTensao.Size = new System.Drawing.Size(474, 336); this.chartMovTensao.Size = new System.Drawing.Size(474, 336);
this.chartMovTensao.TabIndex = 131; this.chartMovTensao.TabIndex = 131;
this.chartMovTensao.Text = "chart1"; this.chartMovTensao.Text = "chart1";
@ -2873,17 +2883,17 @@
// //
// chartMovGeral // chartMovGeral
// //
chartArea12.Name = "ChartArea1"; chartArea4.Name = "ChartArea1";
this.chartMovGeral.ChartAreas.Add(chartArea12); this.chartMovGeral.ChartAreas.Add(chartArea4);
legend12.Name = "Legend1"; legend4.Name = "Legend1";
this.chartMovGeral.Legends.Add(legend12); this.chartMovGeral.Legends.Add(legend4);
this.chartMovGeral.Location = new System.Drawing.Point(4, 4); this.chartMovGeral.Location = new System.Drawing.Point(4, 4);
this.chartMovGeral.Margin = new System.Windows.Forms.Padding(2); this.chartMovGeral.Margin = new System.Windows.Forms.Padding(2);
this.chartMovGeral.Name = "chartMovGeral"; this.chartMovGeral.Name = "chartMovGeral";
series12.ChartArea = "ChartArea1"; series4.ChartArea = "ChartArea1";
series12.Legend = "Legend1"; series4.Legend = "Legend1";
series12.Name = "Series1"; series4.Name = "Series1";
this.chartMovGeral.Series.Add(series12); this.chartMovGeral.Series.Add(series4);
this.chartMovGeral.Size = new System.Drawing.Size(474, 311); this.chartMovGeral.Size = new System.Drawing.Size(474, 311);
this.chartMovGeral.TabIndex = 94; this.chartMovGeral.TabIndex = 94;
this.chartMovGeral.Text = "chart1"; this.chartMovGeral.Text = "chart1";
@ -2904,19 +2914,31 @@
this.tabAtuador.Text = "Atuador"; this.tabAtuador.Text = "Atuador";
this.tabAtuador.UseVisualStyleBackColor = true; this.tabAtuador.UseVisualStyleBackColor = true;
// //
// chbDesenharErvas
//
this.chbDesenharErvas.AutoSize = true;
this.chbDesenharErvas.BackColor = System.Drawing.Color.White;
this.chbDesenharErvas.Location = new System.Drawing.Point(375, 500);
this.chbDesenharErvas.Name = "chbDesenharErvas";
this.chbDesenharErvas.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.chbDesenharErvas.Size = new System.Drawing.Size(116, 17);
this.chbDesenharErvas.TabIndex = 0;
this.chbDesenharErvas.Text = "Mostrar Detecções";
this.chbDesenharErvas.UseVisualStyleBackColor = false;
//
// chartAtuador // chartAtuador
// //
chartArea8.Name = "ChartArea1"; chartArea5.Name = "ChartArea1";
this.chartAtuador.ChartAreas.Add(chartArea8); this.chartAtuador.ChartAreas.Add(chartArea5);
legend8.Name = "Legend1"; legend5.Name = "Legend1";
this.chartAtuador.Legends.Add(legend8); this.chartAtuador.Legends.Add(legend5);
this.chartAtuador.Location = new System.Drawing.Point(4, 276); this.chartAtuador.Location = new System.Drawing.Point(4, 276);
this.chartAtuador.Margin = new System.Windows.Forms.Padding(2); this.chartAtuador.Margin = new System.Windows.Forms.Padding(2);
this.chartAtuador.Name = "chartAtuador"; this.chartAtuador.Name = "chartAtuador";
series8.ChartArea = "ChartArea1"; series5.ChartArea = "ChartArea1";
series8.Legend = "Legend1"; series5.Legend = "Legend1";
series8.Name = "Series1"; series5.Name = "Series1";
this.chartAtuador.Series.Add(series8); this.chartAtuador.Series.Add(series5);
this.chartAtuador.Size = new System.Drawing.Size(489, 241); this.chartAtuador.Size = new System.Drawing.Size(489, 241);
this.chartAtuador.TabIndex = 95; this.chartAtuador.TabIndex = 95;
this.chartAtuador.Text = "chart1"; this.chartAtuador.Text = "chart1";
@ -2950,19 +2972,19 @@
this.picCameraSoloE.TabIndex = 1; this.picCameraSoloE.TabIndex = 1;
this.picCameraSoloE.TabStop = false; this.picCameraSoloE.TabStop = false;
// //
// tabPage4 // tabSensoriamento
// //
this.tabPage4.Controls.Add(this.groupBox1); this.tabSensoriamento.Controls.Add(this.groupBox1);
this.tabPage4.Controls.Add(this.gpbSEN_Filtro); this.tabSensoriamento.Controls.Add(this.gpbSEN_Filtro);
this.tabPage4.Controls.Add(this.chartSensoriamento); this.tabSensoriamento.Controls.Add(this.chartSensoriamento);
this.tabPage4.Location = new System.Drawing.Point(4, 22); this.tabSensoriamento.Location = new System.Drawing.Point(4, 22);
this.tabPage4.Margin = new System.Windows.Forms.Padding(2); this.tabSensoriamento.Margin = new System.Windows.Forms.Padding(2);
this.tabPage4.Name = "tabPage4"; this.tabSensoriamento.Name = "tabSensoriamento";
this.tabPage4.Padding = new System.Windows.Forms.Padding(2); this.tabSensoriamento.Padding = new System.Windows.Forms.Padding(2);
this.tabPage4.Size = new System.Drawing.Size(496, 522); this.tabSensoriamento.Size = new System.Drawing.Size(496, 522);
this.tabPage4.TabIndex = 3; this.tabSensoriamento.TabIndex = 3;
this.tabPage4.Text = "Sensoriamento"; this.tabSensoriamento.Text = "Sensoriamento";
this.tabPage4.UseVisualStyleBackColor = true; this.tabSensoriamento.UseVisualStyleBackColor = true;
// //
// groupBox1 // groupBox1
// //
@ -3208,17 +3230,17 @@
// //
// chartSensoriamento // chartSensoriamento
// //
chartArea13.Name = "ChartArea1"; chartArea6.Name = "ChartArea1";
this.chartSensoriamento.ChartAreas.Add(chartArea13); this.chartSensoriamento.ChartAreas.Add(chartArea6);
legend13.Name = "Legend1"; legend6.Name = "Legend1";
this.chartSensoriamento.Legends.Add(legend13); this.chartSensoriamento.Legends.Add(legend6);
this.chartSensoriamento.Location = new System.Drawing.Point(2, 4); this.chartSensoriamento.Location = new System.Drawing.Point(2, 4);
this.chartSensoriamento.Margin = new System.Windows.Forms.Padding(2); this.chartSensoriamento.Margin = new System.Windows.Forms.Padding(2);
this.chartSensoriamento.Name = "chartSensoriamento"; this.chartSensoriamento.Name = "chartSensoriamento";
series13.ChartArea = "ChartArea1"; series6.ChartArea = "ChartArea1";
series13.Legend = "Legend1"; series6.Legend = "Legend1";
series13.Name = "Series1"; series6.Name = "Series1";
this.chartSensoriamento.Series.Add(series13); this.chartSensoriamento.Series.Add(series6);
this.chartSensoriamento.Size = new System.Drawing.Size(491, 389); this.chartSensoriamento.Size = new System.Drawing.Size(491, 389);
this.chartSensoriamento.TabIndex = 95; this.chartSensoriamento.TabIndex = 95;
this.chartSensoriamento.Text = "chart1"; this.chartSensoriamento.Text = "chart1";
@ -3916,17 +3938,17 @@
// //
// chartCpu // chartCpu
// //
chartArea14.Name = "ChartArea1"; chartArea7.Name = "ChartArea1";
this.chartCpu.ChartAreas.Add(chartArea14); this.chartCpu.ChartAreas.Add(chartArea7);
legend14.Name = "Legend1"; legend7.Name = "Legend1";
this.chartCpu.Legends.Add(legend14); this.chartCpu.Legends.Add(legend7);
this.chartCpu.Location = new System.Drawing.Point(2, 3); this.chartCpu.Location = new System.Drawing.Point(2, 3);
this.chartCpu.Margin = new System.Windows.Forms.Padding(2); this.chartCpu.Margin = new System.Windows.Forms.Padding(2);
this.chartCpu.Name = "chartCpu"; this.chartCpu.Name = "chartCpu";
series14.ChartArea = "ChartArea1"; series7.ChartArea = "ChartArea1";
series14.Legend = "Legend1"; series7.Legend = "Legend1";
series14.Name = "Series1"; series7.Name = "Series1";
this.chartCpu.Series.Add(series14); this.chartCpu.Series.Add(series7);
this.chartCpu.Size = new System.Drawing.Size(491, 389); this.chartCpu.Size = new System.Drawing.Size(491, 389);
this.chartCpu.TabIndex = 134; this.chartCpu.TabIndex = 134;
this.chartCpu.Text = "chart1"; this.chartCpu.Text = "chart1";
@ -3954,6 +3976,8 @@
// //
// panel6 // panel6
// //
this.panel6.Controls.Add(this.txtErvasTerreno);
this.panel6.Controls.Add(this.label116);
this.panel6.Controls.Add(this.txtDuracaoOperacao); this.panel6.Controls.Add(this.txtDuracaoOperacao);
this.panel6.Controls.Add(this.label115); this.panel6.Controls.Add(this.label115);
this.panel6.Controls.Add(this.txtPressao); this.panel6.Controls.Add(this.txtPressao);
@ -4382,17 +4406,52 @@
this.btnPlay.UseVisualStyleBackColor = true; this.btnPlay.UseVisualStyleBackColor = true;
this.btnPlay.Click += new System.EventHandler(this.btnPlay_Click); this.btnPlay.Click += new System.EventHandler(this.btnPlay_Click);
// //
// chbDesenharErvas // tabErvas
// //
this.chbDesenharErvas.AutoSize = true; this.tabErvas.Controls.Add(this.chartErvas);
this.chbDesenharErvas.BackColor = System.Drawing.Color.White; this.tabErvas.Location = new System.Drawing.Point(4, 22);
this.chbDesenharErvas.Location = new System.Drawing.Point(375, 500); this.tabErvas.Name = "tabErvas";
this.chbDesenharErvas.Name = "chbDesenharErvas"; this.tabErvas.Padding = new System.Windows.Forms.Padding(3);
this.chbDesenharErvas.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.tabErvas.Size = new System.Drawing.Size(496, 522);
this.chbDesenharErvas.Size = new System.Drawing.Size(116, 17); this.tabErvas.TabIndex = 10;
this.chbDesenharErvas.TabIndex = 0; this.tabErvas.Text = "Ervas Identificadas";
this.chbDesenharErvas.Text = "Mostrar Detecções"; this.tabErvas.UseVisualStyleBackColor = true;
this.chbDesenharErvas.UseVisualStyleBackColor = false; //
// chartErvas
//
chartArea8.Name = "ChartArea1";
this.chartErvas.ChartAreas.Add(chartArea8);
legend8.Name = "Legend1";
this.chartErvas.Legends.Add(legend8);
this.chartErvas.Location = new System.Drawing.Point(6, 6);
this.chartErvas.Name = "chartErvas";
series8.ChartArea = "ChartArea1";
series8.Legend = "Legend1";
series8.Name = "Series1";
this.chartErvas.Series.Add(series8);
this.chartErvas.Size = new System.Drawing.Size(484, 510);
this.chartErvas.TabIndex = 0;
this.chartErvas.Text = "chart1";
//
// txtErvasTerreno
//
this.txtErvasTerreno.Location = new System.Drawing.Point(247, 459);
this.txtErvasTerreno.Margin = new System.Windows.Forms.Padding(2);
this.txtErvasTerreno.Name = "txtErvasTerreno";
this.txtErvasTerreno.ReadOnly = true;
this.txtErvasTerreno.Size = new System.Drawing.Size(117, 20);
this.txtErvasTerreno.TabIndex = 62;
this.txtErvasTerreno.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label116
//
this.label116.AutoSize = true;
this.label116.Location = new System.Drawing.Point(245, 443);
this.label116.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label116.Name = "label116";
this.label116.Size = new System.Drawing.Size(106, 13);
this.label116.TabIndex = 61;
this.label116.Text = "Ervas no Terreno (%)";
// //
// frmResultadosOperacao // frmResultadosOperacao
// //
@ -4426,7 +4485,7 @@
((System.ComponentModel.ISupportInitialize)(this.picDIR_DF)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.picDIR_DF)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picDIR_ET)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.picDIR_ET)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picDIR_EF)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.picDIR_EF)).EndInit();
this.tabPage2.ResumeLayout(false); this.tabMovimentacao.ResumeLayout(false);
this.tabControl2.ResumeLayout(false); this.tabControl2.ResumeLayout(false);
this.tabMovVelocidade.ResumeLayout(false); this.tabMovVelocidade.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.chartMovVelocidade)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.chartMovVelocidade)).EndInit();
@ -4471,7 +4530,7 @@
((System.ComponentModel.ISupportInitialize)(this.chartAtuador)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.chartAtuador)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picCameraSoloD)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.picCameraSoloD)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picCameraSoloE)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.picCameraSoloE)).EndInit();
this.tabPage4.ResumeLayout(false); this.tabSensoriamento.ResumeLayout(false);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout(); this.groupBox1.PerformLayout();
this.gpbSEN_Filtro.ResumeLayout(false); this.gpbSEN_Filtro.ResumeLayout(false);
@ -4501,6 +4560,8 @@
this.panel6.ResumeLayout(false); this.panel6.ResumeLayout(false);
this.panel6.PerformLayout(); this.panel6.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picCameraCaminho)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.picCameraCaminho)).EndInit();
this.tabErvas.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.chartErvas)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -4514,9 +4575,9 @@
private System.Windows.Forms.Panel pnlMapa; private System.Windows.Forms.Panel pnlMapa;
private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabDirecional; private System.Windows.Forms.TabPage tabDirecional;
private System.Windows.Forms.TabPage tabPage2; private System.Windows.Forms.TabPage tabMovimentacao;
private System.Windows.Forms.TabPage tabAtuador; private System.Windows.Forms.TabPage tabAtuador;
private System.Windows.Forms.TabPage tabPage4; private System.Windows.Forms.TabPage tabSensoriamento;
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label lblMagnetometro; private System.Windows.Forms.Label lblMagnetometro;
private System.Windows.Forms.Label lblGPS; private System.Windows.Forms.Label lblGPS;
@ -4858,5 +4919,9 @@
private System.Windows.Forms.TabPage tabCodFalhas; private System.Windows.Forms.TabPage tabCodFalhas;
private System.Windows.Forms.TreeView tvwFalhas; private System.Windows.Forms.TreeView tvwFalhas;
private System.Windows.Forms.CheckBox chbDesenharErvas; private System.Windows.Forms.CheckBox chbDesenharErvas;
private System.Windows.Forms.TabPage tabErvas;
private System.Windows.Forms.DataVisualization.Charting.Chart chartErvas;
private System.Windows.Forms.TextBox txtErvasTerreno;
private System.Windows.Forms.Label label116;
} }
} }

View File

@ -1,6 +1,7 @@
using AgroBase.Models; using AgroBase.Models;
using AgroBase.Properties; using AgroBase.Properties;
using AgroBase.Services; using AgroBase.Services;
using MQTTnet.Diagnostics.Logger;
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -57,6 +58,7 @@ namespace AgroBase.Forms.Operacoes
GraficoInterativoModel graficoAtu; GraficoInterativoModel graficoAtu;
GraficoInterativoModel graficoSen; GraficoInterativoModel graficoSen;
GraficoInterativoModel graficoCpu; GraficoInterativoModel graficoCpu;
GraficoInterativoModel graficoErvas;
public frmResultadosOperacao() public frmResultadosOperacao()
@ -490,6 +492,61 @@ namespace AgroBase.Forms.Operacoes
}, },
}); });
// Obtemos todos os tipos de ervas identificadas ao longo dos logs
var todasErvas = LogsOperacao
.SelectMany(log => log.ErvasIdentificadas)
.SelectMany(bico => bico.Keys)
.Distinct()
.ToList();
Dictionary<DateTime, Dictionary<string, int>> agrupamento = new Dictionary<DateTime, Dictionary<string, int>>();
foreach (var log in LogsOperacao)
{
agrupamento.Add(log.Momento, new Dictionary<string, int>());
foreach (var bico in log.ErvasIdentificadas)
{
if (bico.Any())
{
foreach (var erva in bico)
{
if (!agrupamento[log.Momento].ContainsKey(erva.Key))
{
agrupamento[log.Momento].Add(erva.Key, erva.Value);
}
else
{
agrupamento[log.Momento][erva.Key] += erva.Value;
}
}
}
}
}
graficoErvas = new GraficoInterativoModel(chartErvas, Momentos, new List<GraficoInterativoSerieModel>(
todasErvas
.Select(erva => new GraficoInterativoSerieModel
{
Titulo = erva,
Valores = LogsOperacao
.Select(log =>
{
if (agrupamento.ContainsKey(log.Momento) && agrupamento[log.Momento].ContainsKey(erva))
return (double)agrupamento[log.Momento][erva];
else
return 0.0; // Adiciona zero se a erva não foi detectada neste momento
})
.ToList(),
Visivel = true,
MostrarValor = true,
ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie
})
.ToList()
)
)
{
Titulo = "Ervas Identificadas"
};
} }
private void InicializarCombosBusca() private void InicializarCombosBusca()
@ -703,6 +760,7 @@ namespace AgroBase.Forms.Operacoes
txtDentroRua.Text = Log.DentroDaRua ? "Sim" : "Não"; txtDentroRua.Text = Log.DentroDaRua ? "Sim" : "Não";
txtDirecaoCarro.Text = Log.Direcao.ToString(); txtDirecaoCarro.Text = Log.Direcao.ToString();
txtErvasNoRadar.Text = Log.ErvasNoRadar.ToString(); txtErvasNoRadar.Text = Log.ErvasNoRadar.ToString();
txtErvasTerreno.Text = Log.PercentualErvasTerreno.ToString("0.00");
txtTipoMovimento.Text = Log.TipoMovimento.ToString(); txtTipoMovimento.Text = Log.TipoMovimento.ToString();
TimeSpan duracaoOperacao = LogsOperacao.First().Momento - Log.Momento; TimeSpan duracaoOperacao = LogsOperacao.First().Momento - Log.Momento;
@ -888,6 +946,7 @@ namespace AgroBase.Forms.Operacoes
private void AtualizarInformacoesAtuador() private void AtualizarInformacoesAtuador()
{ {
graficoAtu.AtualizarDados(idxMomentoAtual); graficoAtu.AtualizarDados(idxMomentoAtual);
graficoErvas.AtualizarDados(idxMomentoAtual);
FuncoesGlobais.PreencheValorProgressBar(pgbPercentualReservatorio, LogsAtuador[idxMomentoAtual].PercentualReservatorio); FuncoesGlobais.PreencheValorProgressBar(pgbPercentualReservatorio, LogsAtuador[idxMomentoAtual].PercentualReservatorio);

View File

@ -18,7 +18,7 @@ namespace AgroBase.Models
private void TmrProcesso_Elapsed(object sender, EventArgs e) private void TmrProcesso_Elapsed(object sender, EventArgs e)
{ {
if (camera._mqttTopico != null ) if (camera._mqttTopico != null)
{ {
var Mensagem = camera._mqttTopico.Mensagens.FirstOrDefault(y => y.Momento > camera.IniciadoEm && y.Mensagem == "OK"); var Mensagem = camera._mqttTopico.Mensagens.FirstOrDefault(y => y.Momento > camera.IniciadoEm && y.Mensagem == "OK");
if (Mensagem != null) if (Mensagem != null)

View File

@ -1,8 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting; using System.Windows.Forms.DataVisualization.Charting;
@ -32,7 +30,6 @@ namespace AgroBase.Models
public int Idx { get; set; } public int Idx { get; set; }
private int _idxMeio = 0; private int _idxMeio = 0;
private Chart Inicializar(Chart chart) private Chart Inicializar(Chart chart)
{ {
chart.Titles.Clear(); chart.Titles.Clear();
@ -66,11 +63,27 @@ namespace AgroBase.Models
if (hit.ChartElementType == ChartElementType.LegendItem) if (hit.ChartElementType == ChartElementType.LegendItem)
{ {
var seriesName = hit.Series.Name; if (hit.Series.ChartType == SeriesChartType.Line)
var series = chart.Series[seriesName]; {
int idxSerie = chart.Series.IndexOf(series); var seriesName = hit.Series.Name;
var series = chart.Series[seriesName];
int idxSerie = chart.Series.IndexOf(series);
Series[idxSerie].Visivel = !Series[idxSerie].Visivel;
}
else if (hit.Series.ChartType == SeriesChartType.Pie && false)
{
foreach (var ponto in hit.Series.Points)
{
if (((LegendItem)hit.Object).Name == ponto.AxisLabel)
{
var serie = Series.FirstOrDefault(x => ponto.AxisLabel.Contains(x.Titulo));
serie.Visivel = !serie.Visivel;
ponto.IsEmpty = !serie.Visivel;
}
}
}
Series[idxSerie].Visivel = !Series[idxSerie].Visivel;
AtualizarDados(Idx); AtualizarDados(Idx);
} }
} }
@ -111,19 +124,27 @@ namespace AgroBase.Models
foreach (var Serie in Series) foreach (var Serie in Series)
{ {
var _momentos = Momentos.GetRange(startIdx, endIdx - startIdx + 1).ToList(); if (Serie.ChartType == SeriesChartType.Pie)
var _valores = Serie.Valores.GetRange(startIdx, endIdx - startIdx + 1).ToList(); {
PopularSerieGrafico(chart, Serie.Titulo, _momentos, _valores); // Para gráfico de pizza, acumula valores até o índice atual
var acumuladoErvas = Series.ToDictionary(s => s.Titulo + (s.MostrarValor ? (" - " + s.Valores[Idx].ToString("0.00")) : ""), s => s.Valores[Idx]);
PopularSerieGraficoPizza(chart, acumuladoErvas);
}
else
{
// Para gráficos de linha
var _momentos = Momentos.GetRange(startIdx, endIdx - startIdx + 1).ToList();
var _valores = Serie.Valores.GetRange(startIdx, endIdx - startIdx + 1).ToList();
PopularSerieGraficoLinha(chart, Serie.Titulo, _momentos, _valores, Serie.Visivel, Serie.MostrarValor);
}
} }
} }
private (int, int) DefineInicioFimLogs(int idxLog, int total) private (int, int) DefineInicioFimLogs(int idxLog, int total)
{ {
// Determina os limites do intervalo
int startIdx = Math.Max(idxLog - (_qtdLogs / 2), 0); int startIdx = Math.Max(idxLog - (_qtdLogs / 2), 0);
int endIdx = Math.Min(idxLog + (_qtdLogs / 2), total - 1); int endIdx = Math.Min(idxLog + (_qtdLogs / 2), total - 1);
// Ajusta startIdx e endIdx para garantir que temos qtdLogs itens se possível
if (endIdx - startIdx + 1 < _qtdLogs) if (endIdx - startIdx + 1 < _qtdLogs)
{ {
if (startIdx == 0) if (startIdx == 0)
@ -139,28 +160,36 @@ namespace AgroBase.Models
return (startIdx, endIdx); return (startIdx, endIdx);
} }
private void PopularSerieGrafico(Chart chart, string Titulo, List<string> Momentos, List<double> Valores) private void PopularSerieGraficoLinha(Chart chart, string titulo, List<string> momentos, List<double> valores, bool visivel, bool mostrarValor)
{ {
bool Visivel = Series[chart.Series.Count].Visivel; var serie = new System.Windows.Forms.DataVisualization.Charting.Series(titulo + (mostrarValor ? (" - " + valores[_idxMeio].ToString("0.00")) : ""));
serie.Points.DataBindXY(momentos, valores);
Valores = Visivel ? Valores : Momentos.Select(x => 0.0).ToList();
var serie = new Series(Titulo + (Series[chart.Series.Count].MostrarValor ? (" - " + Valores[_idxMeio].ToString("0.00")) : ""));
serie.Points.DataBindXY(Momentos, Valores);
serie.ChartType = SeriesChartType.Line; serie.ChartType = SeriesChartType.Line;
serie.BorderWidth = Visivel ? 1 : 0; serie.BorderWidth = visivel ? 1 : 0;
serie.BorderDashStyle = Visivel ? ChartDashStyle.Solid : ChartDashStyle.Dot; serie.BorderDashStyle = visivel ? ChartDashStyle.Solid : ChartDashStyle.Dot;
chart.Series.Add(serie); chart.Series.Add(serie);
chart.Legends.Last().Docking = Docking.Right; Minimo = valores.Min() < Minimo ? valores.Min() : Minimo;
Maximo = valores.Max() > Maximo ? valores.Max() : Maximo;
Minimo = Valores.Min() < Minimo ? Valores.Min() : Minimo;
Maximo = Valores.Max() > Maximo ? Valores.Max() : Maximo;
chart.ChartAreas[0].AxisY.Minimum = Minimo - 5; chart.ChartAreas[0].AxisY.Minimum = Minimo - 5;
chart.ChartAreas[0].AxisY.Maximum = Maximo + 5; chart.ChartAreas[0].AxisY.Maximum = Maximo + 5;
} }
private void PopularSerieGraficoPizza(Chart chart, Dictionary<string, double> acumuladoErvas)
{
var seriePizza = new System.Windows.Forms.DataVisualization.Charting.Series(Titulo);
seriePizza.ChartType = SeriesChartType.Pie;
seriePizza["PieLabelStyle"] = "Outside";
seriePizza["PieStartAngle"] = "270";
// Define pontos com nomes das classes e valores acumulados
seriePizza.Points.DataBindXY(acumuladoErvas.Keys, acumuladoErvas.Values);
chart.Series.Clear();
chart.Series.Add(seriePizza);
chart.Legends.Last().Docking = Docking.Right;
}
} }
public class GraficoInterativoSerieModel public class GraficoInterativoSerieModel
@ -169,5 +198,6 @@ namespace AgroBase.Models
public List<double> Valores { get; set; } public List<double> Valores { get; set; }
public bool Visivel { get; set; } public bool Visivel { get; set; }
public bool MostrarValor { get; set; } public bool MostrarValor { get; set; }
public SeriesChartType ChartType { get; set; } = SeriesChartType.Line; // Tipo de gráfico padrão: Linha
} }
} }

View File

@ -431,10 +431,15 @@ namespace AgroBase.Models.Operacoes
{ {
get get
{ {
return AtuacoesPorBico.Sum(); int atuacoes = 0;
foreach (var bico in AtuacoesPorBico)
{
atuacoes += bico.Sum(x => x.Value);
}
return atuacoes;
} }
} }
public List<int> AtuacoesPorBico { get; set; } = new List<int>(); public List<Dictionary<string, int>> AtuacoesPorBico { get; set; } = new List<Dictionary<string, int>>();
public double ProgressoTrajeto { get; set; } = 0; public double ProgressoTrajeto { get; set; } = 0;
public double ProgressoRua { get; set; } = 0; public double ProgressoRua { get; set; } = 0;
public StatusCarroMapa Status { get; set; } = StatusCarroMapa.Parado; public StatusCarroMapa Status { get; set; } = StatusCarroMapa.Parado;

View File

@ -62,12 +62,12 @@ namespace AgroBase.Models
this.ControleAnterior = new OperacaoControleModel(); this.ControleAnterior = new OperacaoControleModel();
} }
this.OpMapaGPS.Sensoriamento.AtuacoesPorBico = new List<int>(); this.OpMapaGPS.Sensoriamento.AtuacoesPorBico = new List<Dictionary<string, int>>();
if (DispAtu != null) if (DispAtu != null)
{ {
for (int i = 0; i < DispAtu.Dados.QuantidadeBicos; i++) for (int i = 0; i < DispAtu.Dados.QuantidadeBicos; i++)
{ {
this.OpMapaGPS.Sensoriamento.AtuacoesPorBico.Add(0); this.OpMapaGPS.Sensoriamento.AtuacoesPorBico.Add(new Dictionary<string, int>());
} }
} }
@ -747,7 +747,7 @@ namespace AgroBase.Models
{ {
for (int i = 0; i < OperacaoCarregar.DispAtu.Dados.QuantidadeBicos; i++) for (int i = 0; i < OperacaoCarregar.DispAtu.Dados.QuantidadeBicos; i++)
{ {
OperacaoCarregar.OpMapaGPS.Sensoriamento.AtuacoesPorBico.Add(0); OperacaoCarregar.OpMapaGPS.Sensoriamento.AtuacoesPorBico.Add(new Dictionary<string, int>());
} }
} }
@ -834,7 +834,7 @@ namespace AgroBase.Models
DispAtu.Dados.BombaPressurizadora.BombaAtuada = false; DispAtu.Dados.BombaPressurizadora.BombaAtuada = false;
for (int i = 0; i < DispAtu.Dados.QuantidadeBicos; i++) for (int i = 0; i < DispAtu.Dados.QuantidadeBicos; i++)
{ {
OpMapaGPS.Sensoriamento.AtuacoesPorBico.Add(0); OpMapaGPS.Sensoriamento.AtuacoesPorBico.Add(new Dictionary<string, int>());
DispAtu.Dados.BicosPulverizadores[i].Atuado = false; DispAtu.Dados.BicosPulverizadores[i].Atuado = false;
} }
DispAtu.Dados.VolumeVazaoML = 0; DispAtu.Dados.VolumeVazaoML = 0;
@ -959,7 +959,7 @@ namespace AgroBase.Models
DispAtu.Dados.BombaPressurizadora.BombaAtuada = false; DispAtu.Dados.BombaPressurizadora.BombaAtuada = false;
for (int i = 0; i < DispAtu.Dados.QuantidadeBicos; i++) for (int i = 0; i < DispAtu.Dados.QuantidadeBicos; i++)
{ {
OpMapaGPS.Sensoriamento.AtuacoesPorBico.Add(0); OpMapaGPS.Sensoriamento.AtuacoesPorBico.Add(new Dictionary<string, int>());
DispAtu.Dados.BicosPulverizadores[i].Atuado = false; DispAtu.Dados.BicosPulverizadores[i].Atuado = false;
} }
DispAtu.Dados.VolumeVazaoML = 0; DispAtu.Dados.VolumeVazaoML = 0;
@ -1369,11 +1369,12 @@ namespace AgroBase.Models
private void AtualizaLeituraCameraSolo(CameraSoloModel CameraSolo) private void AtualizaLeituraCameraSolo(CameraSoloModel CameraSolo)
{ {
if (CameraSolo.camera._mqttTopico != null && CameraSolo.camera._mqttTopico.Mensagens.Any(x => x.Momento > CameraSolo.camera.IniciadoEm)) if (CameraSolo.camera._mqttTopico?.Mensagens?.Any(x => x.Momento > CameraSolo.camera.IniciadoEm) == true)
{ {
try try
{ {
var Mensagem = CameraSolo.camera._mqttTopico.Mensagens.LastOrDefault(x => x.Momento > CameraSolo.camera.IniciadoEm); var Mensagem = CameraSolo.camera._mqttTopico.Mensagens
.LastOrDefault(x => x.Momento > CameraSolo.camera.IniciadoEm);
if (Mensagem != null) if (Mensagem != null)
{ {
CameraSolo.Leitura = JsonConvert.DeserializeObject<CameraCoordenadasFrameModel>(Mensagem.Mensagem); CameraSolo.Leitura = JsonConvert.DeserializeObject<CameraCoordenadasFrameModel>(Mensagem.Mensagem);
@ -1381,43 +1382,38 @@ namespace AgroBase.Models
} }
catch catch
{ {
// Adicionar logging para falhas no parsing pode ajudar no diagnóstico
} }
var Atuador = Variaveis.OperacaoEmAndamento.DispAtu; if (CameraSolo.Leitura?.objetos == null) return;
var Atuador = Variaveis.OperacaoEmAndamento.DispAtu;
int BicosPorCamera = Atuador.Dados.QuantidadeBicos / Variaveis.OperacaoEmAndamento.CamerasSolo.Count(); int BicosPorCamera = Atuador.Dados.QuantidadeBicos / Variaveis.OperacaoEmAndamento.CamerasSolo.Count();
var Verdes = CameraSolo.Leitura.objetos.ToList();
int intervaloPorBico = Convert.ToInt32(CameraSolo.Leitura.x_max) / BicosPorCamera; int intervaloPorBico = Convert.ToInt32(CameraSolo.Leitura.x_max) / BicosPorCamera;
int inicioBarraPulverizadora = Convert.ToInt32(CameraSolo.Leitura.y_max * (1 - Variaveis.OperacaoEmAndamento.Controle.PercentualInicioPulverizacao)); int inicioBarraPulverizadora = Convert.ToInt32(CameraSolo.Leitura.y_max * (1 - Variaveis.OperacaoEmAndamento.Controle.PercentualInicioPulverizacao));
// Controle dos estados dos bicos
List<bool> BicosAnteriores = new List<bool>(); List<bool> BicosAnteriores = new List<bool>();
// Inicialize todos os bicos como inativos antes de verificar os objetos verdes
for (int i = 0; i < BicosPorCamera; i++) for (int i = 0; i < BicosPorCamera; i++)
{ {
int iBico = i + (CameraSolo.Posicao * BicosPorCamera); int iBico = i + (CameraSolo.Posicao * BicosPorCamera);
BicosAnteriores.Add(Atuador.Dados.BicosPulverizadores[iBico].Atuado ? true : false); BicosAnteriores.Add(Atuador.Dados.BicosPulverizadores[iBico].Atuado);
Atuador.Dados.BicosPulverizadores[iBico].Atuado = false; Atuador.Dados.BicosPulverizadores[iBico].Atuado = false; // Resetar o estado para recalcular
} }
foreach (var verde in Verdes) // Atualiza o estado dos bicos com base nos objetos verdes detectados
foreach (var verde in CameraSolo.Leitura.objetos)
{ {
// Calcule a posição final (y + altura) do objeto verde
int posicaoFinalVerdeY = verde.y + verde.altura; int posicaoFinalVerdeY = verde.y + verde.altura;
if (posicaoFinalVerdeY > inicioBarraPulverizadora) if (posicaoFinalVerdeY > inicioBarraPulverizadora)
{ {
// Calcule a posição final (x + largura) do objeto verde
int posicaoFinalVerdeX = verde.x + verde.largura; int posicaoFinalVerdeX = verde.x + verde.largura;
// Para cada objeto verde, verifique se ele está dentro do intervalo de algum bico e atue-o
for (int i = 0; i < BicosPorCamera; i++) for (int i = 0; i < BicosPorCamera; i++)
{ {
// Determina o intervalo no eixo x para o bico atual
int limiteInferior = intervaloPorBico * i; int limiteInferior = intervaloPorBico * i;
int limiteSuperior = limiteInferior + intervaloPorBico; int limiteSuperior = limiteInferior + intervaloPorBico;
// Verifica se o objeto 'verde' está dentro do intervalo deste bico
// A condição foi ajustada para verificar se qualquer parte do objeto verde cruza com o intervalo do bico
if (verde.x < limiteSuperior && posicaoFinalVerdeX > limiteInferior) if (verde.x < limiteSuperior && posicaoFinalVerdeX > limiteInferior)
{ {
int iBico = i + (CameraSolo.Posicao * BicosPorCamera); int iBico = i + (CameraSolo.Posicao * BicosPorCamera);
@ -1427,14 +1423,28 @@ namespace AgroBase.Models
} }
} }
CameraSolo.ErvasNoRadar = Verdes.Count(); CameraSolo.ErvasNoRadar = CameraSolo.Leitura.objetos.Count();
// Registra as atuações dos bicos para cada erva detectada
for (int i = 0; i < BicosPorCamera; i++) for (int i = 0; i < BicosPorCamera; i++)
{ {
int iBico = i + (CameraSolo.Posicao * BicosPorCamera); int iBico = i + (CameraSolo.Posicao * BicosPorCamera);
if (Atuador.Dados.BicosPulverizadores[iBico].Atuado && BicosAnteriores[i] != Atuador.Dados.BicosPulverizadores[iBico].Atuado) if (Atuador.Dados.BicosPulverizadores[iBico].Atuado && !BicosAnteriores[i])
{ {
Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico[iBico]++; var atuacao = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico[iBico];
// Registra ervas associadas apenas aos bicos que realmente atuaram
foreach (var erva in CameraSolo.Leitura.objetos)
{
if (!atuacao.ContainsKey(erva.descricao))
{
atuacao[erva.descricao] = 1;
}
else
{
atuacao[erva.descricao]++;
}
}
} }
} }
@ -1442,6 +1452,7 @@ namespace AgroBase.Models
} }
} }
private void AtualizaLeituraCameraCaminho() private void AtualizaLeituraCameraCaminho()
{ {
try try
@ -1790,7 +1801,8 @@ namespace AgroBase.Models
AnguloCarroBussola = Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarroBussola, AnguloCarroBussola = Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarroBussola,
TempoMovimento = Variaveis.OperacaoEmAndamento.DispMvd.Dados.TempoEmAtividade, TempoMovimento = Variaveis.OperacaoEmAndamento.DispMvd.Dados.TempoEmAtividade,
StatusCarro = Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.StatusAtual, StatusCarro = Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.StatusAtual,
ErvasIdentificadas = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico.Sum(), ErvasNoRadar = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ErvasNoRadar,
ErvasIdentificadas = new List<Dictionary<string, int>>(Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico),
HerbicidaConsumido = Variaveis.OperacaoEmAndamento.Sensoriamento.HerbicidaConsumido, HerbicidaConsumido = Variaveis.OperacaoEmAndamento.Sensoriamento.HerbicidaConsumido,
HerbicidaPorErva = Variaveis.OperacaoEmAndamento.Sensoriamento.HerbicidaPorErva, HerbicidaPorErva = Variaveis.OperacaoEmAndamento.Sensoriamento.HerbicidaPorErva,
ProgressoTrajeto = Variaveis.OperacaoEmAndamento.Sensoriamento.ProgressoTrajeto, ProgressoTrajeto = Variaveis.OperacaoEmAndamento.Sensoriamento.ProgressoTrajeto,
@ -1819,6 +1831,7 @@ namespace AgroBase.Models
Dir_Status = Variaveis.OperacaoEmAndamento.DispMvd.Dados.StatusModulosMKS(Variaveis.OperacaoEmAndamento.Controle.TipoMovimento), Dir_Status = Variaveis.OperacaoEmAndamento.DispMvd.Dados.StatusModulosMKS(Variaveis.OperacaoEmAndamento.Controle.TipoMovimento),
MovEsq_Status = Variaveis.OperacaoEmAndamento.DispMvd.Dados.StatusModulosBLD(Direcao.Esquerda), MovEsq_Status = Variaveis.OperacaoEmAndamento.DispMvd.Dados.StatusModulosBLD(Direcao.Esquerda),
MovDir_Status = Variaveis.OperacaoEmAndamento.DispMvd.Dados.StatusModulosBLD(Direcao.Direita), MovDir_Status = Variaveis.OperacaoEmAndamento.DispMvd.Dados.StatusModulosBLD(Direcao.Direita),
PercentualErvasTerreno = Variaveis.OperacaoEmAndamento.Sensoriamento.PercentualErvasTerrenoOperacao,
}; };
SalvarLog("operacao", logGeral, Fim); SalvarLog("operacao", logGeral, Fim);
@ -1900,7 +1913,7 @@ namespace AgroBase.Models
MediaNivelFluxo = Bico.MediaNivelFluxo, MediaNivelFluxo = Bico.MediaNivelFluxo,
Posicao = Bico.Posicao, Posicao = Bico.Posicao,
StatusBico = Bico.StatusBico, StatusBico = Bico.StatusBico,
Atuacoes = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico.Count > Bico.Posicao ? Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico[Bico.Posicao] : 0, Atuacoes = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico.Count > Bico.Posicao ? Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico[Bico.Posicao].Sum(x => x.Value) : 0,
}).ToList() }).ToList()
}; };
SalvarLog(T_Code.Atu.ToString(), logAtu, false); SalvarLog(T_Code.Atu.ToString(), logAtu, false);
@ -3012,16 +3025,10 @@ namespace AgroBase.Models
} }
} }
public StatusCarroMapa StatusCarro { get; set; } public StatusCarroMapa StatusCarro { get; set; }
public int ErvasNoRadar public int ErvasNoRadar { get; set; } = 0;
{
get
{
return Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ErvasNoRadar;
}
}
public double HerbicidaConsumido { get; set; } = 0; public double HerbicidaConsumido { get; set; } = 0;
public double HerbicidaPorErva { get; set; } = 0; public double HerbicidaPorErva { get; set; } = 0;
public int ErvasIdentificadas { get; set; } = 0; public List<Dictionary<string, int>> ErvasIdentificadas { get; set; } = new List<Dictionary<string, int>>();
public double ProgressoTrajeto { get; set; } = 0; public double ProgressoTrajeto { get; set; } = 0;
public double ProgressoRua { get; set; } = 0; public double ProgressoRua { get; set; } = 0;
public double AnguloRua { get; set; } = 0; public double AnguloRua { get; set; } = 0;
@ -3048,7 +3055,8 @@ namespace AgroBase.Models
public (bool, List<string>) MovEsq_Status { get; set; } public (bool, List<string>) MovEsq_Status { get; set; }
public (bool, List<string>) MovDir_Status { get; set; } public (bool, List<string>) MovDir_Status { get; set; }
public (bool, List<string>) Dir_Status { get; set; } public (bool, List<string>) Dir_Status { get; set; }
public double PercentualErvasTerreno public double PercentualErvasTerreno { get; set; }
public double PercentualErvasTerrenoOperacao
{ {
get get
{ {
@ -3056,7 +3064,7 @@ namespace AgroBase.Models
{ {
return 0; return 0;
} }
double p = Math.Round((Variaveis.OperacaoEmAndamento.DispAtu.Dados.TempoAtuado / Variaveis.OperacaoEmAndamento.Tempo.TotalMilliseconds) * 100, 2); double p = Math.Round((Variaveis.OperacaoEmAndamento.DispAtu.Dados.TempoAtuado / Variaveis.OperacaoEmAndamento.Tempo.TotalMilliseconds) * 100.0, 2);
return p; return p;
} }
} }

View File

@ -217,7 +217,7 @@ namespace AgroBase.Models
{ {
if (!Variaveis.IsAgroMonitor && Variaveis.OperacaoEmAndamento.DispAtu != null) if (!Variaveis.IsAgroMonitor && Variaveis.OperacaoEmAndamento.DispAtu != null)
{ {
return Variaveis.OperacaoEmAndamento.Sensoriamento.PercentualErvasTerreno / 100.0; return Variaveis.OperacaoEmAndamento.Sensoriamento.PercentualErvasTerrenoOperacao / 100.0;
} }
return 0.3; return 0.3;
} }
@ -228,7 +228,7 @@ namespace AgroBase.Models
{ {
if (!Variaveis.IsAgroMonitor && Variaveis.OperacaoEmAndamento.DispAtu != null) if (!Variaveis.IsAgroMonitor && Variaveis.OperacaoEmAndamento.DispAtu != null)
{ {
return (100.0 - Variaveis.OperacaoEmAndamento.Sensoriamento.PercentualErvasTerreno) / 100.0; return (100.0 - Variaveis.OperacaoEmAndamento.Sensoriamento.PercentualErvasTerrenoOperacao) / 100.0;
} }
return 0.7; return 0.7;
} }

View File

@ -9,6 +9,7 @@ namespace AgroBase.Models
public class VersaoArquivoModel public class VersaoArquivoModel
{ {
public int id { get; set; }
public string Diretorio { get; set; } public string Diretorio { get; set; }
public string Arquivo { get; set; } public string Arquivo { get; set; }
public string Extensao { get; set; } public string Extensao { get; set; }

View File

@ -33,7 +33,8 @@ namespace AgroBase.Services
{ {
Topico = MqttTopico, Topico = MqttTopico,
Mensagens = new List<MqttTopicosMensagensModel>(), Mensagens = new List<MqttTopicosMensagensModel>(),
Inscrever = true Inscrever = true,
MensagensManter = 10
}; };
} }
Variaveis.MqttService.Topicos.Add(_mqttTopico); Variaveis.MqttService.Topicos.Add(_mqttTopico);

View File

@ -29,7 +29,8 @@ public class MqttService
{ {
Topico = MapasVariaveisModel.TopicoSelecaoRuasMapa, Topico = MapasVariaveisModel.TopicoSelecaoRuasMapa,
Mensagens = new List < MqttTopicosMensagensModel>(), Mensagens = new List < MqttTopicosMensagensModel>(),
Inscrever = true Inscrever = true,
MensagensManter = 10
}, },
new MqttTopicosModel() new MqttTopicosModel()
{ {
@ -86,6 +87,12 @@ public class MqttService
Mensagem = message Mensagem = message
}); });
// Limitar o número de mensagens mantidas, removendo as mais antigas se necessário
while (topico.Mensagens.Count > topico.MensagensManter)
{
topico.Mensagens.RemoveAt(0); // Remove a mensagem mais antiga (index 0)
}
if (topico.Topico == MapasVariaveisModel.TopicoSelecaoRuasMapa) if (topico.Topico == MapasVariaveisModel.TopicoSelecaoRuasMapa)
{ {
Variaveis.OperacaoEmAndamento.OpMapaGPS.AtualizarRuasSelecionadas(); Variaveis.OperacaoEmAndamento.OpMapaGPS.AtualizarRuasSelecionadas();
@ -233,6 +240,7 @@ public class MqttService
public class MqttTopicosModel public class MqttTopicosModel
{ {
public string Topico { get; set; } public string Topico { get; set; }
public int MensagensManter { get; set; } = 30;
public List<MqttTopicosMensagensModel> Mensagens { get; set; } public List<MqttTopicosMensagensModel> Mensagens { get; set; }
public bool Inscrever { get; set; } public bool Inscrever { get; set; }
} }

View File

@ -96,6 +96,7 @@ namespace AgroBase.Services
{ {
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
id = 1,
Arquivo = "model", Arquivo = "model",
Atualizado = true, Atualizado = true,
Diretorio = Variaveis.CaminhoModelos + "Ervas\\", Diretorio = Variaveis.CaminhoModelos + "Ervas\\",
@ -106,6 +107,7 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
id = 2,
Arquivo = "model", Arquivo = "model",
Atualizado = true, Atualizado = true,
Diretorio = Variaveis.CaminhoModelos + "Ruas\\", Diretorio = Variaveis.CaminhoModelos + "Ruas\\",
@ -116,6 +118,7 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
id = 3,
Arquivo = "labelmap", Arquivo = "labelmap",
Atualizado = true, Atualizado = true,
Diretorio = Variaveis.CaminhoModelos + "Ruas\\", Diretorio = Variaveis.CaminhoModelos + "Ruas\\",
@ -126,6 +129,7 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
id = 4,
Arquivo = "parametersAtu", Arquivo = "parametersAtu",
Atualizado = true, Atualizado = true,
Diretorio = Variaveis.CaminhoParametros, Diretorio = Variaveis.CaminhoParametros,
@ -136,6 +140,7 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
id = 5,
Arquivo = "parametersMvd", Arquivo = "parametersMvd",
Atualizado = true, Atualizado = true,
Diretorio = Variaveis.CaminhoParametros, Diretorio = Variaveis.CaminhoParametros,
@ -146,6 +151,7 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
id = 6,
Arquivo = "parametersSen", Arquivo = "parametersSen",
Atualizado = true, Atualizado = true,
Diretorio = Variaveis.CaminhoParametros, Diretorio = Variaveis.CaminhoParametros,
@ -156,6 +162,7 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
id = 7,
Arquivo = "parametersKnt", Arquivo = "parametersKnt",
Atualizado = true, Atualizado = true,
Diretorio = Variaveis.CaminhoParametros, Diretorio = Variaveis.CaminhoParametros,
@ -166,6 +173,7 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
id = 8,
Arquivo = "pinoutAtu", Arquivo = "pinoutAtu",
Atualizado = true, Atualizado = true,
Diretorio = Variaveis.CaminhoParametros, Diretorio = Variaveis.CaminhoParametros,
@ -176,6 +184,7 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
id = 9,
Arquivo = "pinoutSen", Arquivo = "pinoutSen",
Atualizado = true, Atualizado = true,
Diretorio = Variaveis.CaminhoParametros, Diretorio = Variaveis.CaminhoParametros,
@ -186,6 +195,7 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
id = 10,
Arquivo = "weed_detector", Arquivo = "weed_detector",
Atualizado = true, Atualizado = true,
Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoScripts), Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoScripts),
@ -196,6 +206,7 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
id = 11,
Arquivo = "green_detector", Arquivo = "green_detector",
Atualizado = true, Atualizado = true,
Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoScripts), Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoScripts),
@ -206,6 +217,7 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
id = 12,
Arquivo = "street_detector", Arquivo = "street_detector",
Atualizado = true, Atualizado = true,
Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoScripts), Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoScripts),
@ -216,6 +228,7 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
id = 13,
Arquivo = "map_load", Arquivo = "map_load",
Atualizado = true, Atualizado = true,
Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoScripts), Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoScripts),
@ -226,6 +239,7 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
id = 14,
Arquivo = "map_follow", Arquivo = "map_follow",
Atualizado = true, Atualizado = true,
Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoScripts), Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoScripts),
@ -236,6 +250,7 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
id = 15,
Arquivo = "gps_viewer", Arquivo = "gps_viewer",
Atualizado = true, Atualizado = true,
Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoScripts), Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoScripts),
@ -246,7 +261,8 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
Arquivo = "modelo_3d-1_0", id = 16,
Arquivo = "modelo_3d",
Atualizado = true, Atualizado = true,
Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoLeitura), Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoLeitura),
Extensao = ".obj", Extensao = ".obj",
@ -256,7 +272,8 @@ namespace AgroBase.Services
}, },
new VersaoArquivoModel() new VersaoArquivoModel()
{ {
Arquivo = "modelo_3d-1_0", id = 17,
Arquivo = "modelo_3d",
Atualizado = true, Atualizado = true,
Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoLeitura), Diretorio = Path.Combine(PythonService.CaminhoGeral, PythonService.CaminhoLeitura),
Extensao = ".mtl", Extensao = ".mtl",
@ -287,12 +304,6 @@ namespace AgroBase.Services
return; return;
} }
// Nao executa a verificacao se estiver em ambiente de teste
if (frmInstancial.DebugMode && !frmInstancial.frmPrincipal.chbDebugMode.Checked)
{
return;
}
AtualizandoArquivos = true; AtualizandoArquivos = true;
ProgressoAtualizacao = 0.0; ProgressoAtualizacao = 0.0;
ResultadoAtualizacao = "Verificando atualizações..."; ResultadoAtualizacao = "Verificando atualizações...";
@ -308,6 +319,16 @@ namespace AgroBase.Services
await SalvarArquivoVersionamento(arquivos); await SalvarArquivoVersionamento(arquivos);
} }
await CarregarArquivoVersionamento(caminhoArquivo);
ResultadoAtualizacao = "Arquivos carregados!";
// Nao executa a verificacao se estiver em ambiente de teste
if (frmInstancial.DebugMode && !frmInstancial.frmPrincipal.chbDebugMode.Checked && false)
{
AtualizandoArquivos = false;
return;
}
if (APIService.HasInternet) if (APIService.HasInternet)
{ {
File.Copy(caminhoArquivo, caminhoArquivo + "_old", true); File.Copy(caminhoArquivo, caminhoArquivo + "_old", true);

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
[{"Diretorio":"C:\\AgroBaseModels\\Ervas\\","Arquivo":"model","Extensao":".pt","Versao":"1_0","ArquivoDownload":"weed_detector_model-1_0.pt","NomeArquivoLocal":"model-1_0.pt","CaminhoCompleto":"C:\\AgroBaseModels\\Ervas\\model-1_0.pt","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":1},{"Diretorio":"C:\\AgroBaseModels\\Ruas\\","Arquivo":"model","Extensao":".pth","Versao":"1_0","ArquivoDownload":"street_detector_model-1_0.pth","NomeArquivoLocal":"model-1_0.pth","CaminhoCompleto":"C:\\AgroBaseModels\\Ruas\\model-1_0.pth","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":0},{"Diretorio":"C:\\AgroBaseModels\\Ruas\\","Arquivo":"labelmap","Extensao":".txt","Versao":"1_0","ArquivoDownload":"street_detector_labelmap-1_0.txt","NomeArquivoLocal":"labelmap-1_0.txt","CaminhoCompleto":"C:\\AgroBaseModels\\Ruas\\labelmap-1_0.txt","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":0},{"Diretorio":"Parametros/","Arquivo":"parametersAtu","Extensao":".par","Versao":"1_0","ArquivoDownload":"parametersAtu-1_0.par","NomeArquivoLocal":"parametersAtu-1_0.par","CaminhoCompleto":"Parametros/parametersAtu-1_0.par","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":2},{"Diretorio":"Parametros/","Arquivo":"parametersMvd","Extensao":".par","Versao":"1_0","ArquivoDownload":"parametersMvd-1_0.par","NomeArquivoLocal":"parametersMvd-1_0.par","CaminhoCompleto":"Parametros/parametersMvd-1_0.par","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":3},{"Diretorio":"Parametros/","Arquivo":"parametersSen","Extensao":".par","Versao":"1_0","ArquivoDownload":"parametersSen-1_0.par","NomeArquivoLocal":"parametersSen-1_0.par","CaminhoCompleto":"Parametros/parametersSen-1_0.par","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":4},{"Diretorio":"Parametros/","Arquivo":"parametersKnt","Extensao":".par","Versao":"1_0","ArquivoDownload":"parametersKnt-1_0.par","NomeArquivoLocal":"parametersKnt-1_0.par","CaminhoCompleto":"Parametros/parametersKnt-1_0.par","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":5},{"Diretorio":"Parametros/","Arquivo":"pinoutAtu","Extensao":".pin","Versao":"1_0","ArquivoDownload":"pinoutAtu-1_0.pin","NomeArquivoLocal":"pinoutAtu-1_0.pin","CaminhoCompleto":"Parametros/pinoutAtu-1_0.pin","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":6},{"Diretorio":"Parametros/","Arquivo":"pinoutSen","Extensao":".pin","Versao":"1_0","ArquivoDownload":"pinoutSen-1_0.pin","NomeArquivoLocal":"pinoutSen-1_0.pin","CaminhoCompleto":"Parametros/pinoutSen-1_0.pin","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":7},{"Diretorio":"Python\\Scripts\\","Arquivo":"weed_detector","Extensao":".py","Versao":"1_0","ArquivoDownload":"weed_detector-1_0.py","NomeArquivoLocal":"weed_detector-1_0.py","CaminhoCompleto":"Python\\Scripts\\weed_detector-1_0.py","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":9},{"Diretorio":"Python\\Scripts\\","Arquivo":"green_detector","Extensao":".py","Versao":"1_0","ArquivoDownload":"green_detector-1_0.py","NomeArquivoLocal":"green_detector-1_0.py","CaminhoCompleto":"Python\\Scripts\\green_detector-1_0.py","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":10},{"Diretorio":"Python\\Scripts\\","Arquivo":"street_detector","Extensao":".py","Versao":"1_0","ArquivoDownload":"street_detector-1_0.py","NomeArquivoLocal":"street_detector-1_0.py","CaminhoCompleto":"Python\\Scripts\\street_detector-1_0.py","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":8},{"Diretorio":"Python\\Scripts\\","Arquivo":"map_load","Extensao":".py","Versao":"1_0","ArquivoDownload":"map_load-1_0.py","NomeArquivoLocal":"map_load-1_0.py","CaminhoCompleto":"Python\\Scripts\\map_load-1_0.py","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":11},{"Diretorio":"Python\\Scripts\\","Arquivo":"map_follow","Extensao":".py","Versao":"1_0","ArquivoDownload":"map_follow-1_0.py","NomeArquivoLocal":"map_follow-1_0.py","CaminhoCompleto":"Python\\Scripts\\map_follow-1_0.py","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":12},{"Diretorio":"Python\\Scripts\\","Arquivo":"gps_viewer","Extensao":".py","Versao":"1_0","ArquivoDownload":"gps_viewer-1_0.py","NomeArquivoLocal":"gps_viewer-1_0.py","CaminhoCompleto":"Python\\Scripts\\gps_viewer-1_0.py","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":13},{"Diretorio":"Python\\Output\\","Arquivo":"modelo_3d-1_0","Extensao":".obj","Versao":"1_0","ArquivoDownload":"modelo_3d-1_0.obj","NomeArquivoLocal":"modelo_3d-1_0-1_0.obj","CaminhoCompleto":"Python\\Output\\modelo_3d-1_0-1_0.obj","Atualizado":true,"ArquivoAtualizado":false,"TipoArquivo":14},{"Diretorio":"Python\\Output\\","Arquivo":"modelo_3d-1_0","Extensao":".mtl","Versao":"1_0","ArquivoDownload":"modelo_3d-1_0.mtl","NomeArquivoLocal":"modelo_3d-1_0-1_0.mtl","CaminhoCompleto":"Python\\Output\\modelo_3d-1_0-1_0.mtl","Atualizado":true,"ArquivoAtualizado":false,"TipoArquivo":14}] [{"id":1,"Arquivo":"model","Diretorio":"C:\\AgroBaseModels\\Ervas\\","Extensao":".pt","Versao":"2_1","TipoArquivo":"ModeloIA_WeedDetector","ArquivoDownload":"weed_detector_model-2_1.pt"},{"id":2,"Diretorio":"C:\\AgroBaseModels\\Ruas\\","Arquivo":"model","Extensao":".pth","Versao":"1_0","ArquivoDownload":"street_detector_model-1_0.pth","NomeArquivoLocal":"model-1_0.pth","CaminhoCompleto":"C:\\AgroBaseModels\\Ruas\\model-1_0.pth","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":0},{"id":3,"Diretorio":"C:\\AgroBaseModels\\Ruas\\","Arquivo":"labelmap","Extensao":".txt","Versao":"1_0","ArquivoDownload":"street_detector_labelmap-1_0.txt","NomeArquivoLocal":"labelmap-1_0.txt","CaminhoCompleto":"C:\\AgroBaseModels\\Ruas\\labelmap-1_0.txt","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":0},{"id":4,"Diretorio":"Parametros/","Arquivo":"parametersAtu","Extensao":".par","Versao":"1_0","ArquivoDownload":"parametersAtu-1_0.par","NomeArquivoLocal":"parametersAtu-1_0.par","CaminhoCompleto":"Parametros/parametersAtu-1_0.par","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":2},{"id":5,"Diretorio":"Parametros/","Arquivo":"parametersMvd","Extensao":".par","Versao":"1_0","ArquivoDownload":"parametersMvd-1_0.par","NomeArquivoLocal":"parametersMvd-1_0.par","CaminhoCompleto":"Parametros/parametersMvd-1_0.par","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":3},{"id":6,"Diretorio":"Parametros/","Arquivo":"parametersSen","Extensao":".par","Versao":"1_0","ArquivoDownload":"parametersSen-1_0.par","NomeArquivoLocal":"parametersSen-1_0.par","CaminhoCompleto":"Parametros/parametersSen-1_0.par","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":4},{"id":7,"Diretorio":"Parametros/","Arquivo":"parametersKnt","Extensao":".par","Versao":"1_0","ArquivoDownload":"parametersKnt-1_0.par","NomeArquivoLocal":"parametersKnt-1_0.par","CaminhoCompleto":"Parametros/parametersKnt-1_0.par","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":5},{"id":8,"Diretorio":"Parametros/","Arquivo":"pinoutAtu","Extensao":".pin","Versao":"1_0","ArquivoDownload":"pinoutAtu-1_0.pin","NomeArquivoLocal":"pinoutAtu-1_0.pin","CaminhoCompleto":"Parametros/pinoutAtu-1_0.pin","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":6},{"id":9,"Diretorio":"Parametros/","Arquivo":"pinoutSen","Extensao":".pin","Versao":"1_0","ArquivoDownload":"pinoutSen-1_0.pin","NomeArquivoLocal":"pinoutSen-1_0.pin","CaminhoCompleto":"Parametros/pinoutSen-1_0.pin","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":7},{"id":10,"Diretorio":"Python\\Scripts\\","Arquivo":"weed_detector","Extensao":".py","Versao":"1_0","ArquivoDownload":"weed_detector-1_0.py","NomeArquivoLocal":"weed_detector-1_0.py","CaminhoCompleto":"Python\\Scripts\\weed_detector-1_0.py","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":9},{"id":11,"Diretorio":"Python\\Scripts\\","Arquivo":"green_detector","Extensao":".py","Versao":"1_0","ArquivoDownload":"green_detector-1_0.py","NomeArquivoLocal":"green_detector-1_0.py","CaminhoCompleto":"Python\\Scripts\\green_detector-1_0.py","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":10},{"id":12,"Diretorio":"Python\\Scripts\\","Arquivo":"street_detector","Extensao":".py","Versao":"1_0","ArquivoDownload":"street_detector-1_0.py","NomeArquivoLocal":"street_detector-1_0.py","CaminhoCompleto":"Python\\Scripts\\street_detector-1_0.py","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":8},{"id":13,"Diretorio":"Python\\Scripts\\","Arquivo":"map_load","Extensao":".py","Versao":"1_0","ArquivoDownload":"map_load-1_0.py","NomeArquivoLocal":"map_load-1_0.py","CaminhoCompleto":"Python\\Scripts\\map_load-1_0.py","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":11},{"id":14,"Diretorio":"Python\\Scripts\\","Arquivo":"map_follow","Extensao":".py","Versao":"1_0","ArquivoDownload":"map_follow-1_0.py","NomeArquivoLocal":"map_follow-1_0.py","CaminhoCompleto":"Python\\Scripts\\map_follow-1_0.py","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":12},{"id":15,"Diretorio":"Python\\Scripts\\","Arquivo":"gps_viewer","Extensao":".py","Versao":"1_0","ArquivoDownload":"gps_viewer-1_0.py","NomeArquivoLocal":"gps_viewer-1_0.py","CaminhoCompleto":"Python\\Scripts\\gps_viewer-1_0.py","Atualizado":true,"ArquivoAtualizado":true,"TipoArquivo":13},{"id":17,"Arquivo":"modelo_3d","Diretorio":"Python\\Output\\","Extensao":".obj","Versao":"1_0","TipoArquivo":14,"ArquivoDownload":"modelo_3d-1_0.obj"},{"id":17,"Diretorio":"Python\\Output\\","Arquivo":"modelo_3d","Extensao":".mtl","Versao":"1_0","ArquivoDownload":"modelo_3d-1_0.mtl","NomeArquivoLocal":"modelo_3d-1_0.mtl","CaminhoCompleto":"Python\\Output\\modelo_3d-1_0.mtl","Atualizado":true,"ArquivoAtualizado":false,"TipoArquivo":14}]

View File

@ -1 +1 @@
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"Id":"1517","Name":"15_10_2024_09_38_53","Length":0.0,"Dist1":0.0,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0]]}}]} {"type":"FeatureCollection","features":[{"type":"Feature","properties":{"Id":"1517","Name":"25_10_2024_09_14_36","Length":0.0,"Dist1":0.0,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0],[0.0,0.0]]}}]}

View File

@ -1,121 +1,161 @@
[ [
{ {
"timestamp": 1728996757.5772817, "timestamp": 1729860640.9951098,
"x_max": 640.0, "x_max": 640.0,
"y_max": 480.0, "y_max": 480.0,
"objetos": [ "objetos": [
{ {
"id": 1, "id": 0,
"descricao": "crop", "descricao": "chenopodio",
"x": 406, "x": 186,
"y": 267, "y": 317,
"largura": 67, "largura": 78,
"altura": 87, "altura": 52,
"confianca": 0.35302734375 "confianca": 0.740234375
} }
] ]
}, },
{ {
"timestamp": 1728996757.6187596, "timestamp": 1729860641.0379987,
"x_max": 640.0, "x_max": 640.0,
"y_max": 480.0, "y_max": 480.0,
"objetos": [ "objetos": [
{ {
"id": 1, "id": 0,
"descricao": "crop", "descricao": "chenopodio",
"x": 407, "x": 185,
"y": 265, "y": 316,
"largura": 66, "largura": 79,
"altura": 89, "altura": 53,
"confianca": 0.2919921875 "confianca": 0.71728515625
} }
] ]
}, },
{ {
"timestamp": 1728996757.6567557, "timestamp": 1729860641.0754085,
"x_max": 640.0, "x_max": 640.0,
"y_max": 480.0, "y_max": 480.0,
"objetos": [ "objetos": [
{ {
"id": 1, "id": 0,
"descricao": "crop", "descricao": "chenopodio",
"x": 404, "x": 186,
"y": 265, "y": 316,
"largura": 70, "largura": 78,
"altura": 89, "altura": 53,
"confianca": 0.29443359375 "confianca": 0.73486328125
} }
] ]
}, },
{ {
"timestamp": 1728996757.6920755, "timestamp": 1729860641.1103146,
"x_max": 640.0, "x_max": 640.0,
"y_max": 480.0, "y_max": 480.0,
"objetos": [ "objetos": [
{ {
"id": 1, "id": 0,
"descricao": "crop", "descricao": "chenopodio",
"x": 407, "x": 185,
"y": 266, "y": 317,
"largura": 66, "largura": 79,
"altura": 88, "altura": 52,
"confianca": 0.326416015625 "confianca": 0.73974609375
} }
] ]
}, },
{ {
"timestamp": 1728996757.725627, "timestamp": 1729860641.1462216,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1728996757.7590864,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1728996757.7951005,
"x_max": 640.0, "x_max": 640.0,
"y_max": 480.0, "y_max": 480.0,
"objetos": [ "objetos": [
{ {
"id": 1, "id": 0,
"descricao": "crop", "descricao": "chenopodio",
"x": 406, "x": 186,
"y": 267, "y": 317,
"largura": 67, "largura": 77,
"altura": 88, "altura": 52,
"confianca": 0.35791015625 "confianca": 0.72216796875
} }
] ]
}, },
{ {
"timestamp": 1728996757.8295608, "timestamp": 1729860642.2513819,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1728996757.86254,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1728996757.898996,
"x_max": 640.0, "x_max": 640.0,
"y_max": 480.0, "y_max": 480.0,
"objetos": [ "objetos": [
{ {
"id": 1, "id": 0,
"descricao": "crop", "descricao": "chenopodio",
"x": 406, "x": 186,
"y": 267, "y": 316,
"largura": 68, "largura": 78,
"altura": 87, "altura": 53,
"confianca": 0.28466796875 "confianca": 0.74072265625
}
]
},
{
"timestamp": 1729860642.29327,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 0,
"descricao": "chenopodio",
"x": 186,
"y": 317,
"largura": 78,
"altura": 52,
"confianca": 0.72900390625
}
]
},
{
"timestamp": 1729860642.3371546,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 0,
"descricao": "chenopodio",
"x": 185,
"y": 316,
"largura": 80,
"altura": 53,
"confianca": 0.740234375
}
]
},
{
"timestamp": 1729860651.0805528,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 0,
"descricao": "chenopodio",
"x": 186,
"y": 317,
"largura": 78,
"altura": 52,
"confianca": 0.74951171875
}
]
},
{
"timestamp": 1729860651.710928,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 0,
"descricao": "chenopodio",
"x": 186,
"y": 317,
"largura": 78,
"altura": 51,
"confianca": 0.73291015625
} }
] ]
} }

View File

@ -0,0 +1,189 @@
[
{
"timestamp": 1729886836.5745094,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 0,
"descricao": "chenopodio",
"x": 220,
"y": 190,
"largura": 66,
"altura": 84,
"confianca": 0.3681640625
},
{
"id": 3,
"descricao": "erva-daninha",
"x": 219,
"y": 185,
"largura": 68,
"altura": 90,
"confianca": 0.405029296875
}
]
},
{
"timestamp": 1729886836.610576,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 3,
"descricao": "erva-daninha",
"x": 220,
"y": 183,
"largura": 67,
"altura": 92,
"confianca": 0.302001953125
},
{
"id": 0,
"descricao": "chenopodio",
"x": 220,
"y": 188,
"largura": 67,
"altura": 87,
"confianca": 0.363525390625
}
]
},
{
"timestamp": 1729886836.6466177,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 3,
"descricao": "erva-daninha",
"x": 220,
"y": 183,
"largura": 67,
"altura": 92,
"confianca": 0.302001953125
},
{
"id": 0,
"descricao": "chenopodio",
"x": 220,
"y": 188,
"largura": 67,
"altura": 87,
"confianca": 0.363525390625
}
]
},
{
"timestamp": 1729886836.683074,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 0,
"descricao": "chenopodio",
"x": 219,
"y": 185,
"largura": 68,
"altura": 89,
"confianca": 0.609375
}
]
},
{
"timestamp": 1729886836.719538,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 3,
"descricao": "erva-daninha",
"x": 220,
"y": 190,
"largura": 66,
"altura": 83,
"confianca": 0.480224609375
}
]
},
{
"timestamp": 1729886836.7556367,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 3,
"descricao": "erva-daninha",
"x": 220,
"y": 190,
"largura": 66,
"altura": 83,
"confianca": 0.480224609375
}
]
},
{
"timestamp": 1729886836.790095,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 0,
"descricao": "chenopodio",
"x": 220,
"y": 193,
"largura": 66,
"altura": 80,
"confianca": 0.796875
}
]
},
{
"timestamp": 1729886836.8265805,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 0,
"descricao": "chenopodio",
"x": 220,
"y": 193,
"largura": 66,
"altura": 80,
"confianca": 0.796875
}
]
},
{
"timestamp": 1729886836.8655539,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 0,
"descricao": "chenopodio",
"x": 221,
"y": 185,
"largura": 67,
"altura": 90,
"confianca": 0.57763671875
}
]
},
{
"timestamp": 1729886836.9010375,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 3,
"descricao": "erva-daninha",
"x": 220,
"y": 195,
"largura": 66,
"altura": 78,
"confianca": 0.471923828125
}
]
}
]

View File

@ -25,7 +25,7 @@
<meta name="viewport" content="width=device-width, <meta name="viewport" content="width=device-width,
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style> <style>
#map_99fa459a1b7fd5ea826fa26a08d2bd59 { #map_d86f01de6f5a4004d1767840aa065b3f {
position: relative; position: relative;
width: 100.0%; width: 100.0%;
height: 100.0%; height: 100.0%;
@ -39,14 +39,14 @@
<body> <body>
<div class="folium-map" id="map_99fa459a1b7fd5ea826fa26a08d2bd59" ></div> <div class="folium-map" id="map_d86f01de6f5a4004d1767840aa065b3f" ></div>
</body> </body>
<script> <script>
var map_99fa459a1b7fd5ea826fa26a08d2bd59 = L.map( var map_d86f01de6f5a4004d1767840aa065b3f = L.map(
"map_99fa459a1b7fd5ea826fa26a08d2bd59", "map_d86f01de6f5a4004d1767840aa065b3f",
{ {
center: [0.0, 0.0], center: [0.0, 0.0],
crs: L.CRS.EPSG3857, crs: L.CRS.EPSG3857,
@ -60,13 +60,13 @@
var tile_layer_96262b8e7ff9d35afc211b14806ca5fb = L.tileLayer( var tile_layer_108db742a9d491e8246a93e325c8595e = L.tileLayer(
"https://tile.openstreetmap.org/{z}/{x}/{y}.png", "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} {"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_96262b8e7ff9d35afc211b14806ca5fb.addTo(map_99fa459a1b7fd5ea826fa26a08d2bd59); tile_layer_108db742a9d491e8246a93e325c8595e.addTo(map_d86f01de6f5a4004d1767840aa065b3f);
</script> </script>
@ -87,7 +87,7 @@
} }
trajeto_json_add({"features": []}); trajeto_json_add({"features": []});
trajeto_json.addTo(map_99fa459a1b7fd5ea826fa26a08d2bd59); trajeto_json.addTo(map_d86f01de6f5a4004d1767840aa065b3f);
function adicionarGeometria(novaGeometria) { function adicionarGeometria(novaGeometria) {
trajeto_json.addData(novaGeometria); trajeto_json.addData(novaGeometria);
@ -145,7 +145,7 @@
var marcadorDinamico = L.marker([0, 0], { var marcadorDinamico = L.marker([0, 0], {
icon: customIcon icon: customIcon
}).addTo(map_99fa459a1b7fd5ea826fa26a08d2bd59); }).addTo(map_d86f01de6f5a4004d1767840aa065b3f);
// Conectar ao broker MQTT // Conectar ao broker MQTT
const client = mqtt.connect('ws://localhost:9001'); // Use wss para conexão segura const client = mqtt.connect('ws://localhost:9001'); // Use wss para conexão segura
@ -183,7 +183,7 @@
marcadorDinamico.setRotationAngle(angulo); marcadorDinamico.setRotationAngle(angulo);
adicionarCoordenada("Tj", [novaLongitude, novaLatitude]); adicionarCoordenada("Tj", [novaLongitude, novaLatitude]);
map_99fa459a1b7fd5ea826fa26a08d2bd59.setView(novaPosicao, map_99fa459a1b7fd5ea826fa26a08d2bd59.getZoom()); map_d86f01de6f5a4004d1767840aa065b3f.setView(novaPosicao, map_d86f01de6f5a4004d1767840aa065b3f.getZoom());
}); });
function calcularOrientacao(P1latitude, P1longitude, P2latitude, P2longitude) { function calcularOrientacao(P1latitude, P1longitude, P2latitude, P2longitude) {

View File

@ -25,7 +25,7 @@
<meta name="viewport" content="width=device-width, <meta name="viewport" content="width=device-width,
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style> <style>
#map_a63b1a825559a1e68c0e656007a42e97 { #map_3494d25655edc095e061ab985be49f2e {
position: relative; position: relative;
width: 100.0%; width: 100.0%;
height: 100.0%; height: 100.0%;
@ -39,14 +39,14 @@
<body> <body>
<div class="folium-map" id="map_a63b1a825559a1e68c0e656007a42e97" ></div> <div class="folium-map" id="map_3494d25655edc095e061ab985be49f2e" ></div>
</body> </body>
<script> <script>
var map_a63b1a825559a1e68c0e656007a42e97 = L.map( var map_3494d25655edc095e061ab985be49f2e = L.map(
"map_a63b1a825559a1e68c0e656007a42e97", "map_3494d25655edc095e061ab985be49f2e",
{ {
center: [0.0, 0.0], center: [0.0, 0.0],
crs: L.CRS.EPSG3857, crs: L.CRS.EPSG3857,
@ -60,13 +60,13 @@
var tile_layer_e51a9727707595b585df6b1d1690e12d = L.tileLayer( var tile_layer_22988b33f090311f42e1338f4ea84d69 = L.tileLayer(
"https://tile.openstreetmap.org/{z}/{x}/{y}.png", "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} {"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_e51a9727707595b585df6b1d1690e12d.addTo(map_a63b1a825559a1e68c0e656007a42e97); tile_layer_22988b33f090311f42e1338f4ea84d69.addTo(map_3494d25655edc095e061ab985be49f2e);
@ -82,7 +82,7 @@
}*/ }*/
}); });
} }
function geo_json_91a22c711d37ed4c0032ed851e07d510_onEachFeature(feature, layer) { function geo_json_c197bce6f52b4cdc33158111f7071200_onEachFeature(feature, layer) {
layer.on({ layer.on({
click: function(e) { click: function(e) {
@ -118,20 +118,20 @@
}*/ }*/
}); });
}; };
var geo_json_91a22c711d37ed4c0032ed851e07d510 = L.geoJson(null, { var geo_json_c197bce6f52b4cdc33158111f7071200 = L.geoJson(null, {
onEachFeature: geo_json_91a22c711d37ed4c0032ed851e07d510_onEachFeature, onEachFeature: geo_json_c197bce6f52b4cdc33158111f7071200_onEachFeature,
}); });
function geo_json_91a22c711d37ed4c0032ed851e07d510_add (data) { function geo_json_c197bce6f52b4cdc33158111f7071200_add (data) {
geo_json_91a22c711d37ed4c0032ed851e07d510 geo_json_c197bce6f52b4cdc33158111f7071200
.addData(data); .addData(data);
} }
geo_json_91a22c711d37ed4c0032ed851e07d510_add({"features": [{"geometry": {"coordinates": [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]], "id": null, "type": "LineString"}, "id": 0, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "1517", "Length": 0.0, "Name": "15_10_2024_09_38_53"}, "type": "Feature"}], "type": "FeatureCollection"}); geo_json_c197bce6f52b4cdc33158111f7071200_add({"features": [{"geometry": {"coordinates": [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]], "id": null, "type": "LineString"}, "id": 0, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "1517", "Length": 0.0, "Name": "25_10_2024_09_14_36"}, "type": "Feature"}], "type": "FeatureCollection"});
geo_json_91a22c711d37ed4c0032ed851e07d510.addTo(map_a63b1a825559a1e68c0e656007a42e97); geo_json_c197bce6f52b4cdc33158111f7071200.addTo(map_3494d25655edc095e061ab985be49f2e);
</script> </script>
@ -152,7 +152,7 @@
} }
trajeto_json_add({"features": []}); trajeto_json_add({"features": []});
trajeto_json.addTo(map_a63b1a825559a1e68c0e656007a42e97); trajeto_json.addTo(map_3494d25655edc095e061ab985be49f2e);
function adicionarGeometria(novaGeometria) { function adicionarGeometria(novaGeometria) {
trajeto_json.addData(novaGeometria); trajeto_json.addData(novaGeometria);
@ -210,7 +210,7 @@
} }
trajeto_dinamico_json_add({"features": []}); trajeto_dinamico_json_add({"features": []});
trajeto_dinamico_json.addTo(map_a63b1a825559a1e68c0e656007a42e97); trajeto_dinamico_json.addTo(map_3494d25655edc095e061ab985be49f2e);
function adicionarGeometriaDinamica(novaGeometria) { function adicionarGeometriaDinamica(novaGeometria) {
trajeto_dinamico_json.addData(novaGeometria); trajeto_dinamico_json.addData(novaGeometria);
@ -263,9 +263,9 @@
var marcadorEquipamento = L.marker([0, 0], { var marcadorEquipamento = L.marker([0, 0], {
icon: customIcon icon: customIcon
}).addTo(map_a63b1a825559a1e68c0e656007a42e97); }).addTo(map_3494d25655edc095e061ab985be49f2e);
var marcadorBase = L.marker([0, 0], {}).addTo(map_a63b1a825559a1e68c0e656007a42e97); var marcadorBase = L.marker([0, 0], {}).addTo(map_3494d25655edc095e061ab985be49f2e);
var icon = L.AwesomeMarkers.icon( var icon = L.AwesomeMarkers.icon(
{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"} {"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}
); );
@ -347,7 +347,7 @@
} }
if (foco) { if (foco) {
map_a63b1a825559a1e68c0e656007a42e97.setView(novaPosicao, map_a63b1a825559a1e68c0e656007a42e97.getZoom()); map_3494d25655edc095e061ab985be49f2e.setView(novaPosicao, map_3494d25655edc095e061ab985be49f2e.getZoom());
} }
} }
@ -364,7 +364,7 @@
function atualizarSelecaoRuas(selecionadas) { function atualizarSelecaoRuas(selecionadas) {
selecionadas = JSON.parse(selecionadas); selecionadas = JSON.parse(selecionadas);
RuasSelecionadas = Array.isArray(selecionadas) ? [...selecionadas] : []; RuasSelecionadas = Array.isArray(selecionadas) ? [...selecionadas] : [];
geo_json_91a22c711d37ed4c0032ed851e07d510.eachLayer(function (layer) { geo_json_c197bce6f52b4cdc33158111f7071200.eachLayer(function (layer) {
if (RuasSelecionadas.includes(parseInt(layer.feature.id))) { if (RuasSelecionadas.includes(parseInt(layer.feature.id))) {
layer.setStyle({ color: 'blue' }); layer.setStyle({ color: 'blue' });
} else { } else {