inclusao do sensor ultrassom
This commit is contained in:
parent
6524a77429
commit
ffc9ed8af5
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -223,6 +223,12 @@
|
||||||
<Compile Include="Forms\Direcional\frmDirPlot.Designer.cs">
|
<Compile Include="Forms\Direcional\frmDirPlot.Designer.cs">
|
||||||
<DependentUpon>frmDirPlot.cs</DependentUpon>
|
<DependentUpon>frmDirPlot.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Forms\frmA05Config.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Forms\frmA05Config.Designer.cs">
|
||||||
|
<DependentUpon>frmA05Config.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Forms\frmAcompanhamento.cs">
|
<Compile Include="Forms\frmAcompanhamento.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
@ -645,6 +651,9 @@
|
||||||
<EmbeddedResource Include="Forms\Direcional\frmDirPlot.resx">
|
<EmbeddedResource Include="Forms\Direcional\frmDirPlot.resx">
|
||||||
<DependentUpon>frmDirPlot.cs</DependentUpon>
|
<DependentUpon>frmDirPlot.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Forms\frmA05Config.resx">
|
||||||
|
<DependentUpon>frmA05Config.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Forms\frmAcompanhamento.resx">
|
<EmbeddedResource Include="Forms\frmAcompanhamento.resx">
|
||||||
<DependentUpon>frmAcompanhamento.cs</DependentUpon>
|
<DependentUpon>frmAcompanhamento.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,9 @@
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = 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 legend2 = 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 series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||||
this.pnlCamerasSolo = new System.Windows.Forms.Panel();
|
this.pnlCamerasSolo = new System.Windows.Forms.Panel();
|
||||||
this.pnlCameraSoloE = new System.Windows.Forms.Panel();
|
this.pnlCameraSoloE = new System.Windows.Forms.Panel();
|
||||||
this.pnlCameraSoloD = new System.Windows.Forms.Panel();
|
this.pnlCameraSoloD = new System.Windows.Forms.Panel();
|
||||||
|
|
@ -149,17 +149,17 @@
|
||||||
//
|
//
|
||||||
this.chartGraficos.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
this.chartGraficos.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
chartArea2.Name = "ChartArea1";
|
chartArea3.Name = "ChartArea1";
|
||||||
this.chartGraficos.ChartAreas.Add(chartArea2);
|
this.chartGraficos.ChartAreas.Add(chartArea3);
|
||||||
legend2.Name = "Legend1";
|
legend3.Name = "Legend1";
|
||||||
this.chartGraficos.Legends.Add(legend2);
|
this.chartGraficos.Legends.Add(legend3);
|
||||||
this.chartGraficos.Location = new System.Drawing.Point(640, 7);
|
this.chartGraficos.Location = new System.Drawing.Point(640, 7);
|
||||||
this.chartGraficos.Margin = new System.Windows.Forms.Padding(2);
|
this.chartGraficos.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.chartGraficos.Name = "chartGraficos";
|
this.chartGraficos.Name = "chartGraficos";
|
||||||
series2.ChartArea = "ChartArea1";
|
series3.ChartArea = "ChartArea1";
|
||||||
series2.Legend = "Legend1";
|
series3.Legend = "Legend1";
|
||||||
series2.Name = "Series1";
|
series3.Name = "Series1";
|
||||||
this.chartGraficos.Series.Add(series2);
|
this.chartGraficos.Series.Add(series3);
|
||||||
this.chartGraficos.Size = new System.Drawing.Size(591, 318);
|
this.chartGraficos.Size = new System.Drawing.Size(591, 318);
|
||||||
this.chartGraficos.TabIndex = 2;
|
this.chartGraficos.TabIndex = 2;
|
||||||
this.chartGraficos.Text = "chart1";
|
this.chartGraficos.Text = "chart1";
|
||||||
|
|
@ -532,6 +532,7 @@
|
||||||
//
|
//
|
||||||
// lblTensao
|
// lblTensao
|
||||||
//
|
//
|
||||||
|
this.lblTensao.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.lblTensao.AutoSize = true;
|
this.lblTensao.AutoSize = true;
|
||||||
this.lblTensao.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblTensao.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblTensao.Location = new System.Drawing.Point(1111, 351);
|
this.lblTensao.Location = new System.Drawing.Point(1111, 351);
|
||||||
|
|
@ -543,6 +544,7 @@
|
||||||
//
|
//
|
||||||
// lblCorrente
|
// lblCorrente
|
||||||
//
|
//
|
||||||
|
this.lblCorrente.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.lblCorrente.AutoSize = true;
|
this.lblCorrente.AutoSize = true;
|
||||||
this.lblCorrente.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblCorrente.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblCorrente.Location = new System.Drawing.Point(1111, 388);
|
this.lblCorrente.Location = new System.Drawing.Point(1111, 388);
|
||||||
|
|
@ -554,6 +556,7 @@
|
||||||
//
|
//
|
||||||
// lblRPM
|
// lblRPM
|
||||||
//
|
//
|
||||||
|
this.lblRPM.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.lblRPM.AutoSize = true;
|
this.lblRPM.AutoSize = true;
|
||||||
this.lblRPM.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblRPM.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblRPM.Location = new System.Drawing.Point(1111, 426);
|
this.lblRPM.Location = new System.Drawing.Point(1111, 426);
|
||||||
|
|
@ -565,6 +568,7 @@
|
||||||
//
|
//
|
||||||
// lblVelocidade
|
// lblVelocidade
|
||||||
//
|
//
|
||||||
|
this.lblVelocidade.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.lblVelocidade.AutoSize = true;
|
this.lblVelocidade.AutoSize = true;
|
||||||
this.lblVelocidade.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblVelocidade.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblVelocidade.Location = new System.Drawing.Point(1111, 463);
|
this.lblVelocidade.Location = new System.Drawing.Point(1111, 463);
|
||||||
|
|
@ -576,6 +580,7 @@
|
||||||
//
|
//
|
||||||
// lblKmh
|
// lblKmh
|
||||||
//
|
//
|
||||||
|
this.lblKmh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.lblKmh.AutoSize = true;
|
this.lblKmh.AutoSize = true;
|
||||||
this.lblKmh.Location = new System.Drawing.Point(1208, 480);
|
this.lblKmh.Location = new System.Drawing.Point(1208, 480);
|
||||||
this.lblKmh.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
this.lblKmh.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||||
|
|
@ -586,6 +591,7 @@
|
||||||
//
|
//
|
||||||
// cmbTipoMovimento
|
// cmbTipoMovimento
|
||||||
//
|
//
|
||||||
|
this.cmbTipoMovimento.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.cmbTipoMovimento.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbTipoMovimento.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbTipoMovimento.FormattingEnabled = true;
|
this.cmbTipoMovimento.FormattingEnabled = true;
|
||||||
this.cmbTipoMovimento.Location = new System.Drawing.Point(1119, 556);
|
this.cmbTipoMovimento.Location = new System.Drawing.Point(1119, 556);
|
||||||
|
|
@ -596,6 +602,7 @@
|
||||||
//
|
//
|
||||||
// lblTipoMovimento
|
// lblTipoMovimento
|
||||||
//
|
//
|
||||||
|
this.lblTipoMovimento.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.lblTipoMovimento.AutoSize = true;
|
this.lblTipoMovimento.AutoSize = true;
|
||||||
this.lblTipoMovimento.Location = new System.Drawing.Point(1116, 540);
|
this.lblTipoMovimento.Location = new System.Drawing.Point(1116, 540);
|
||||||
this.lblTipoMovimento.Name = "lblTipoMovimento";
|
this.lblTipoMovimento.Name = "lblTipoMovimento";
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ using System.Linq;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using static AgroBase.Models.Enums;
|
using static AgroBase.Models.Enums;
|
||||||
using AgroBase.Services;
|
using AgroBase.Services;
|
||||||
|
using AgroBase.Models.Modules;
|
||||||
|
|
||||||
namespace AgroBase.Forms.Operacoes
|
namespace AgroBase.Forms.Operacoes
|
||||||
{
|
{
|
||||||
|
|
@ -130,7 +131,6 @@ namespace AgroBase.Forms.Operacoes
|
||||||
pnlDir_DT.Invalidate();
|
pnlDir_DT.Invalidate();
|
||||||
pnlDir_EF.Invalidate();
|
pnlDir_EF.Invalidate();
|
||||||
pnlDir_ET.Invalidate();
|
pnlDir_ET.Invalidate();
|
||||||
|
|
||||||
pnlAtuadores.Invalidate();
|
pnlAtuadores.Invalidate();
|
||||||
pnlAnguloGPS.Invalidate();
|
pnlAnguloGPS.Invalidate();
|
||||||
pnlAnguloMagnetometro.Invalidate();
|
pnlAnguloMagnetometro.Invalidate();
|
||||||
|
|
@ -467,7 +467,7 @@ namespace AgroBase.Forms.Operacoes
|
||||||
Label lblCmd = new Label()
|
Label lblCmd = new Label()
|
||||||
{
|
{
|
||||||
Name = "lblCmd_" + bicoNumero,
|
Name = "lblCmd_" + bicoNumero,
|
||||||
Size = new Size(110, 20),
|
Size = new Size(110, 15),
|
||||||
Location = new Point(xPosition + (circleDiameter - 110) / 2, 0),
|
Location = new Point(xPosition + (circleDiameter - 110) / 2, 0),
|
||||||
Text = "Comando: Desligado"
|
Text = "Comando: Desligado"
|
||||||
};
|
};
|
||||||
|
|
@ -510,74 +510,20 @@ namespace AgroBase.Forms.Operacoes
|
||||||
|
|
||||||
private void pnlAtuadores_Paint(object sender, PaintEventArgs e)
|
private void pnlAtuadores_Paint(object sender, PaintEventArgs e)
|
||||||
{
|
{
|
||||||
var Atuador = Variaveis.OperacaoEmAndamento.DispAtu;
|
var Atuador = Variaveis.OperacaoEmAndamento.DispAtu.Dados;
|
||||||
|
|
||||||
Graphics g = e.Graphics;
|
AtuadorFuncoesGerais.DesenharAtuadores(pnlAtuadores, e, Atuador.BicosPulverizadores.Select(x => new AtuBicoSensoriamentoLogModel()
|
||||||
Panel myPanel = (Panel)sender;
|
|
||||||
int panelWidth = myPanel.Width;
|
|
||||||
int circleDiameter = 40; // Diâmetro dos círculos grandes
|
|
||||||
int smallCircleDiameter = circleDiameter / 2; // Diâmetro dos círculos pequenos
|
|
||||||
int spaceBetweenCircles = (panelWidth - (circleDiameter * Atuador.Dados.QuantidadeBicos)) / (Atuador.Dados.QuantidadeBicos + 1);
|
|
||||||
int yPosition = (myPanel.Height - circleDiameter) / 3; // Centralizado verticalmente
|
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < Atuador.Dados.QuantidadeBicos; i++)
|
|
||||||
{
|
{
|
||||||
// Calcula a posição x do círculo
|
ID = x.ID,
|
||||||
int xPosition = spaceBetweenCircles + (i * (circleDiameter + spaceBetweenCircles));
|
Atuacoes = x.Atuacoes,
|
||||||
// Desenha o contorno do círculo
|
Atuado = x.Atuado,
|
||||||
g.DrawEllipse(Pens.Red, xPosition, yPosition, circleDiameter, circleDiameter);
|
Comandar = x.Comandar,
|
||||||
// Se o bico estiver aceso, preenche o círculo
|
Inicializado = x.Inicializado,
|
||||||
if (Atuador.Dados.BicosPulverizadores[i].Atuado)
|
MediaNivelFluxo = x.MediaNivelFluxo,
|
||||||
{
|
Posicao = x.Posicao,
|
||||||
g.FillEllipse(Brushes.Red, xPosition, yPosition, circleDiameter, circleDiameter);
|
StatusBico = x.StatusBico,
|
||||||
}
|
TempoAtuado = x.TempoAtuado,
|
||||||
|
}).ToList(), Atuador.BombaPressurizadora.BombaAtuada, Atuador.PressaoLinha, Atuador.TempoAtuado);
|
||||||
// Define a string que representa o número do bico
|
|
||||||
string bicoNumero = Atuador.Dados.BicosPulverizadores[i].ID;
|
|
||||||
// Define a fonte para o texto
|
|
||||||
Font font = new Font("Arial", 10, FontStyle.Bold);
|
|
||||||
// Mede o tamanho do texto
|
|
||||||
SizeF stringSize = g.MeasureString(bicoNumero, font);
|
|
||||||
// Calcula as posições x e y para centralizar o texto no círculo
|
|
||||||
float textXPosition = xPosition + (circleDiameter - stringSize.Width) / 2;
|
|
||||||
float textYPosition = yPosition + (circleDiameter - stringSize.Height) / 2;
|
|
||||||
// Desenha o número do bico
|
|
||||||
g.DrawString(bicoNumero, font, Brushes.Black, textXPosition, textYPosition);
|
|
||||||
|
|
||||||
|
|
||||||
// Define a string que representa a atuacao do bico
|
|
||||||
string bicoAtuacao = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico[i].Sum(x => x.Value).ToString("000");
|
|
||||||
// Define a fonte para o texto
|
|
||||||
Font fontA = new Font("Arial", 8, FontStyle.Bold);
|
|
||||||
// Mede o tamanho do texto
|
|
||||||
SizeF stringSizeA = g.MeasureString(bicoAtuacao, fontA);
|
|
||||||
// Calcula as posições x e y para centralizar o texto no círculo
|
|
||||||
float textXPositionA = xPosition + (circleDiameter - stringSizeA.Width) / 2;
|
|
||||||
float textYPositionA = circleDiameter + yPosition + 5;
|
|
||||||
// Desenha as atuacoes do bico
|
|
||||||
g.DrawString(bicoAtuacao, fontA, Brushes.Black, textXPositionA, textYPositionA);
|
|
||||||
|
|
||||||
|
|
||||||
// Calcula a posição x e y do círculo pequeno
|
|
||||||
int smallCircleXPosition = Convert.ToInt32(xPosition + circleDiameter - smallCircleDiameter / 1.3);
|
|
||||||
int smallCircleYPosition = Convert.ToInt32(yPosition + circleDiameter - smallCircleDiameter / 1.3);
|
|
||||||
|
|
||||||
// Define a cor de contorno e preenchimento para o círculo pequeno
|
|
||||||
Pen smallCirclePen = Pens.Blue; // Cor do contorno
|
|
||||||
Brush smallCircleBrush = Brushes.Transparent; // Cor de preenchimento padrão
|
|
||||||
|
|
||||||
// Se o status do bico for true, altera a cor de preenchimento para azul
|
|
||||||
if (Atuador.Dados.BicosPulverizadores[i].StatusBico)
|
|
||||||
{
|
|
||||||
smallCircleBrush = Brushes.Blue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Desenha o contorno do círculo pequeno
|
|
||||||
g.DrawEllipse(smallCirclePen, smallCircleXPosition, smallCircleYPosition, smallCircleDiameter, smallCircleDiameter);
|
|
||||||
// Preenche o círculo pequeno se o status do bico for true
|
|
||||||
g.FillEllipse(smallCircleBrush, smallCircleXPosition, smallCircleYPosition, smallCircleDiameter, smallCircleDiameter);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using AgroBase.Models;
|
using AgroBase.Models;
|
||||||
|
using AgroBase.Models.Modules;
|
||||||
using AgroBase.Services;
|
using AgroBase.Services;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
@ -94,8 +95,6 @@ namespace AgroBase.Forms.Operacoes
|
||||||
lblHerbicidaPorErva.Text = "Herbicida por Erva: " + Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.HerbicidaPorErva.ToString("0.000") + " mL";
|
lblHerbicidaPorErva.Text = "Herbicida por Erva: " + Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.HerbicidaPorErva.ToString("0.000") + " mL";
|
||||||
lblBateriaConsumida.Text = "Bateria Consumida: " + Variaveis.OperacaoEmAndamento.Sensoriamento.BateriaConsumida.ToString("0.00") + "%";
|
lblBateriaConsumida.Text = "Bateria Consumida: " + Variaveis.OperacaoEmAndamento.Sensoriamento.BateriaConsumida.ToString("0.00") + "%";
|
||||||
|
|
||||||
lblPressao.Text = "P: " + Variaveis.OperacaoEmAndamento.DispAtu.Dados.PressaoLinha.ToString("0.00") + " psi";
|
|
||||||
|
|
||||||
FuncoesGlobais.PreencheValorProgressBar(pgbReservatorio, Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio);
|
FuncoesGlobais.PreencheValorProgressBar(pgbReservatorio, Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio);
|
||||||
lblPorcentagemReservatorio.Text = Variaveis.OperacaoEmAndamento.DispAtu.Dados.VolumeReservatorio.ToString("0.000") + " L " + (Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio < 0 ? 0 : Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio).ToString("00.00") + "%";
|
lblPorcentagemReservatorio.Text = Variaveis.OperacaoEmAndamento.DispAtu.Dados.VolumeReservatorio.ToString("0.000") + " L " + (Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio < 0 ? 0 : Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio).ToString("00.00") + "%";
|
||||||
|
|
||||||
|
|
@ -171,74 +170,19 @@ namespace AgroBase.Forms.Operacoes
|
||||||
|
|
||||||
private void pnlAtuadores_Paint(object sender, PaintEventArgs e)
|
private void pnlAtuadores_Paint(object sender, PaintEventArgs e)
|
||||||
{
|
{
|
||||||
var Atuador = Variaveis.OperacaoEmAndamento.DispAtu;
|
var Atuador = Variaveis.OperacaoEmAndamento.DispAtu.Dados;
|
||||||
|
AtuadorFuncoesGerais.DesenharAtuadores(pnlAtuadores, e, Atuador.BicosPulverizadores.Select(x => new AtuBicoSensoriamentoLogModel()
|
||||||
Graphics g = e.Graphics;
|
|
||||||
Panel myPanel = (Panel)sender;
|
|
||||||
int panelWidth = myPanel.Width;
|
|
||||||
int circleDiameter = 40; // Diâmetro dos círculos grandes
|
|
||||||
int smallCircleDiameter = circleDiameter / 2; // Diâmetro dos círculos pequenos
|
|
||||||
int spaceBetweenCircles = (panelWidth - (circleDiameter * Atuador.Dados.QuantidadeBicos)) / (Atuador.Dados.QuantidadeBicos + 1);
|
|
||||||
int yPosition = (myPanel.Height - circleDiameter) / 3; // Centralizado verticalmente
|
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < Atuador.Dados.QuantidadeBicos; i++)
|
|
||||||
{
|
{
|
||||||
// Calcula a posição x do círculo
|
ID = x.ID,
|
||||||
int xPosition = spaceBetweenCircles + (i * (circleDiameter + spaceBetweenCircles));
|
Atuacoes = x.Atuacoes,
|
||||||
// Desenha o contorno do círculo
|
Atuado = x.Atuado,
|
||||||
g.DrawEllipse(Pens.Red, xPosition, yPosition, circleDiameter, circleDiameter);
|
Comandar = x.Comandar,
|
||||||
// Se o bico estiver aceso, preenche o círculo
|
Inicializado = x.Inicializado,
|
||||||
if (Atuador.Dados.BicosPulverizadores[i].Atuado)
|
MediaNivelFluxo = x.MediaNivelFluxo,
|
||||||
{
|
Posicao = x.Posicao,
|
||||||
g.FillEllipse(Brushes.Red, xPosition, yPosition, circleDiameter, circleDiameter);
|
StatusBico = x.StatusBico,
|
||||||
}
|
TempoAtuado = x.TempoAtuado,
|
||||||
|
}).ToList(), Atuador.BombaPressurizadora.BombaAtuada, Atuador.PressaoLinha, Atuador.TempoAtuado);
|
||||||
// Define a string que representa o número do bico
|
|
||||||
string bicoNumero = Atuador.Dados.BicosPulverizadores[i].ID;
|
|
||||||
// Define a fonte para o texto
|
|
||||||
Font font = new Font("Arial", 10, FontStyle.Bold);
|
|
||||||
// Mede o tamanho do texto
|
|
||||||
SizeF stringSize = g.MeasureString(bicoNumero, font);
|
|
||||||
// Calcula as posições x e y para centralizar o texto no círculo
|
|
||||||
float textXPosition = xPosition + (circleDiameter - stringSize.Width) / 2;
|
|
||||||
float textYPosition = yPosition + (circleDiameter - stringSize.Height) / 2;
|
|
||||||
// Desenha o número do bico
|
|
||||||
g.DrawString(bicoNumero, font, Brushes.Black, textXPosition, textYPosition);
|
|
||||||
|
|
||||||
|
|
||||||
// Define a string que representa a atuacao do bico
|
|
||||||
string bicoAtuacao = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico[i].Sum(x => x.Value).ToString("000");
|
|
||||||
// Define a fonte para o texto
|
|
||||||
Font fontA = new Font("Arial", 8, FontStyle.Bold);
|
|
||||||
// Mede o tamanho do texto
|
|
||||||
SizeF stringSizeA = g.MeasureString(bicoAtuacao, fontA);
|
|
||||||
// Calcula as posições x e y para centralizar o texto no círculo
|
|
||||||
float textXPositionA = xPosition + (circleDiameter - stringSizeA.Width) / 2;
|
|
||||||
float textYPositionA = circleDiameter + yPosition + 5;
|
|
||||||
// Desenha as atuacoes do bico
|
|
||||||
g.DrawString(bicoAtuacao, fontA, Brushes.Black, textXPositionA, textYPositionA);
|
|
||||||
|
|
||||||
|
|
||||||
// Calcula a posição x e y do círculo pequeno
|
|
||||||
int smallCircleXPosition = Convert.ToInt32(xPosition + circleDiameter - smallCircleDiameter / 1.3);
|
|
||||||
int smallCircleYPosition = Convert.ToInt32(yPosition + circleDiameter - smallCircleDiameter / 1.3);
|
|
||||||
|
|
||||||
// Define a cor de contorno e preenchimento para o círculo pequeno
|
|
||||||
Pen smallCirclePen = Pens.Blue; // Cor do contorno
|
|
||||||
Brush smallCircleBrush = Brushes.Transparent; // Cor de preenchimento padrão
|
|
||||||
|
|
||||||
// Se o status do bico for true, altera a cor de preenchimento para azul
|
|
||||||
if (Atuador.Dados.BicosPulverizadores[i].StatusBico)
|
|
||||||
{
|
|
||||||
smallCircleBrush = Brushes.Blue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Desenha o contorno do círculo pequeno
|
|
||||||
g.DrawEllipse(smallCirclePen, smallCircleXPosition, smallCircleYPosition, smallCircleDiameter, smallCircleDiameter);
|
|
||||||
// Preenche o círculo pequeno se o status do bico for true
|
|
||||||
g.FillEllipse(smallCircleBrush, smallCircleXPosition, smallCircleYPosition, smallCircleDiameter, smallCircleDiameter);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pnlCaminho_Paint(object sender, PaintEventArgs e)
|
private void pnlCaminho_Paint(object sender, PaintEventArgs e)
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ namespace AgroBase.Forms.Operacoes
|
||||||
this.pnlCameraSoloE = new System.Windows.Forms.Panel();
|
this.pnlCameraSoloE = new System.Windows.Forms.Panel();
|
||||||
this.pnlCameraCaminho = new System.Windows.Forms.Panel();
|
this.pnlCameraCaminho = new System.Windows.Forms.Panel();
|
||||||
this.pnlAtuadores = new System.Windows.Forms.Panel();
|
this.pnlAtuadores = new System.Windows.Forms.Panel();
|
||||||
this.lblPressao = new System.Windows.Forms.Label();
|
|
||||||
this.pnlCaminho = new System.Windows.Forms.Panel();
|
this.pnlCaminho = new System.Windows.Forms.Panel();
|
||||||
this.pnlGraficos = new System.Windows.Forms.Panel();
|
this.pnlGraficos = new System.Windows.Forms.Panel();
|
||||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||||
|
|
@ -86,7 +85,6 @@ namespace AgroBase.Forms.Operacoes
|
||||||
this.pnlAnguloCamera = new System.Windows.Forms.Panel();
|
this.pnlAnguloCamera = new System.Windows.Forms.Panel();
|
||||||
this.lblPerformance = new System.Windows.Forms.Label();
|
this.lblPerformance = new System.Windows.Forms.Label();
|
||||||
this.pnlCameraSolo.SuspendLayout();
|
this.pnlCameraSolo.SuspendLayout();
|
||||||
this.pnlAtuadores.SuspendLayout();
|
|
||||||
this.pnlGraficos.SuspendLayout();
|
this.pnlGraficos.SuspendLayout();
|
||||||
this.tabControl1.SuspendLayout();
|
this.tabControl1.SuspendLayout();
|
||||||
this.tabGrafico.SuspendLayout();
|
this.tabGrafico.SuspendLayout();
|
||||||
|
|
@ -139,7 +137,6 @@ namespace AgroBase.Forms.Operacoes
|
||||||
//
|
//
|
||||||
this.pnlAtuadores.BackColor = System.Drawing.SystemColors.Control;
|
this.pnlAtuadores.BackColor = System.Drawing.SystemColors.Control;
|
||||||
this.pnlAtuadores.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
this.pnlAtuadores.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||||
this.pnlAtuadores.Controls.Add(this.lblPressao);
|
|
||||||
this.pnlAtuadores.Location = new System.Drawing.Point(9, 491);
|
this.pnlAtuadores.Location = new System.Drawing.Point(9, 491);
|
||||||
this.pnlAtuadores.Margin = new System.Windows.Forms.Padding(2);
|
this.pnlAtuadores.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.pnlAtuadores.Name = "pnlAtuadores";
|
this.pnlAtuadores.Name = "pnlAtuadores";
|
||||||
|
|
@ -147,15 +144,6 @@ namespace AgroBase.Forms.Operacoes
|
||||||
this.pnlAtuadores.TabIndex = 2;
|
this.pnlAtuadores.TabIndex = 2;
|
||||||
this.pnlAtuadores.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlAtuadores_Paint);
|
this.pnlAtuadores.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlAtuadores_Paint);
|
||||||
//
|
//
|
||||||
// lblPressao
|
|
||||||
//
|
|
||||||
this.lblPressao.AutoSize = true;
|
|
||||||
this.lblPressao.Location = new System.Drawing.Point(-2, 0);
|
|
||||||
this.lblPressao.Name = "lblPressao";
|
|
||||||
this.lblPressao.Size = new System.Drawing.Size(57, 13);
|
|
||||||
this.lblPressao.TabIndex = 0;
|
|
||||||
this.lblPressao.Text = "P: 0.00 psi";
|
|
||||||
//
|
|
||||||
// pnlCaminho
|
// pnlCaminho
|
||||||
//
|
//
|
||||||
this.pnlCaminho.BackColor = System.Drawing.Color.White;
|
this.pnlCaminho.BackColor = System.Drawing.Color.White;
|
||||||
|
|
@ -702,8 +690,6 @@ namespace AgroBase.Forms.Operacoes
|
||||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmOperacaoMapaGPS_FormClosing);
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmOperacaoMapaGPS_FormClosing);
|
||||||
this.Load += new System.EventHandler(this.frmOperacaoMapaGPS_Load);
|
this.Load += new System.EventHandler(this.frmOperacaoMapaGPS_Load);
|
||||||
this.pnlCameraSolo.ResumeLayout(false);
|
this.pnlCameraSolo.ResumeLayout(false);
|
||||||
this.pnlAtuadores.ResumeLayout(false);
|
|
||||||
this.pnlAtuadores.PerformLayout();
|
|
||||||
this.pnlGraficos.ResumeLayout(false);
|
this.pnlGraficos.ResumeLayout(false);
|
||||||
this.tabControl1.ResumeLayout(false);
|
this.tabControl1.ResumeLayout(false);
|
||||||
this.tabGrafico.ResumeLayout(false);
|
this.tabGrafico.ResumeLayout(false);
|
||||||
|
|
@ -759,7 +745,6 @@ namespace AgroBase.Forms.Operacoes
|
||||||
private System.Windows.Forms.CheckBox chbATUativo;
|
private System.Windows.Forms.CheckBox chbATUativo;
|
||||||
private System.Windows.Forms.CheckBox chbDIRativo;
|
private System.Windows.Forms.CheckBox chbDIRativo;
|
||||||
private System.Windows.Forms.CheckBox chbMOVativo;
|
private System.Windows.Forms.CheckBox chbMOVativo;
|
||||||
private System.Windows.Forms.Label lblPressao;
|
|
||||||
private System.Windows.Forms.Label lblMapaCarregado;
|
private System.Windows.Forms.Label lblMapaCarregado;
|
||||||
private System.Windows.Forms.Panel pnlOrientacao;
|
private System.Windows.Forms.Panel pnlOrientacao;
|
||||||
private System.Windows.Forms.Label lblBateriaT;
|
private System.Windows.Forms.Label lblBateriaT;
|
||||||
|
|
|
||||||
|
|
@ -44,13 +44,14 @@
|
||||||
this.lblQtdCameras = new System.Windows.Forms.Label();
|
this.lblQtdCameras = new System.Windows.Forms.Label();
|
||||||
this.nudQtdBicos = new System.Windows.Forms.NumericUpDown();
|
this.nudQtdBicos = new System.Windows.Forms.NumericUpDown();
|
||||||
this.lblQtdBicos = new System.Windows.Forms.Label();
|
this.lblQtdBicos = new System.Windows.Forms.Label();
|
||||||
this.gpbP_Dir = new System.Windows.Forms.GroupBox();
|
this.gpbP_Mks = new System.Windows.Forms.GroupBox();
|
||||||
|
this.lblAngulomax = new System.Windows.Forms.Label();
|
||||||
this.nudAnguloMinimo = new System.Windows.Forms.NumericUpDown();
|
this.nudAnguloMinimo = new System.Windows.Forms.NumericUpDown();
|
||||||
this.nudVelocidadeMP = new System.Windows.Forms.NumericUpDown();
|
this.nudVelocidadeMP = new System.Windows.Forms.NumericUpDown();
|
||||||
this.lblVelocidadeMP = new System.Windows.Forms.Label();
|
this.lblVelocidadeMP = new System.Windows.Forms.Label();
|
||||||
this.nudAnguloMaximo = new System.Windows.Forms.NumericUpDown();
|
this.nudAnguloMaximo = new System.Windows.Forms.NumericUpDown();
|
||||||
this.lblAngulomin = new System.Windows.Forms.Label();
|
this.lblAngulomin = new System.Windows.Forms.Label();
|
||||||
this.gpbP_Mov = new System.Windows.Forms.GroupBox();
|
this.gpbP_Bld = new System.Windows.Forms.GroupBox();
|
||||||
this.nudVelocidadeComErvas = new System.Windows.Forms.NumericUpDown();
|
this.nudVelocidadeComErvas = new System.Windows.Forms.NumericUpDown();
|
||||||
this.lblKmhCErvas = new System.Windows.Forms.Label();
|
this.lblKmhCErvas = new System.Windows.Forms.Label();
|
||||||
this.lblVelocidadeComErvas = new System.Windows.Forms.Label();
|
this.lblVelocidadeComErvas = new System.Windows.Forms.Label();
|
||||||
|
|
@ -60,13 +61,13 @@
|
||||||
this.chbO_Gps = new System.Windows.Forms.CheckBox();
|
this.chbO_Gps = new System.Windows.Forms.CheckBox();
|
||||||
this.chbO_Sen = new System.Windows.Forms.CheckBox();
|
this.chbO_Sen = new System.Windows.Forms.CheckBox();
|
||||||
this.chbO_Atu = new System.Windows.Forms.CheckBox();
|
this.chbO_Atu = new System.Windows.Forms.CheckBox();
|
||||||
this.chbO_Dir = new System.Windows.Forms.CheckBox();
|
this.chbO_Mks = new System.Windows.Forms.CheckBox();
|
||||||
this.chbO_Mov = new System.Windows.Forms.CheckBox();
|
this.chbO_Bld = new System.Windows.Forms.CheckBox();
|
||||||
this.chbD_Gps = new System.Windows.Forms.CheckBox();
|
this.chbD_Gps = new System.Windows.Forms.CheckBox();
|
||||||
this.chbD_Sen = new System.Windows.Forms.CheckBox();
|
this.chbD_Sen = new System.Windows.Forms.CheckBox();
|
||||||
this.chbD_Mov = new System.Windows.Forms.CheckBox();
|
this.chbD_Bld = new System.Windows.Forms.CheckBox();
|
||||||
this.chbD_Atu = new System.Windows.Forms.CheckBox();
|
this.chbD_Atu = new System.Windows.Forms.CheckBox();
|
||||||
this.chbD_Dir = new System.Windows.Forms.CheckBox();
|
this.chbD_Mks = new System.Windows.Forms.CheckBox();
|
||||||
this.btnCarregar = new System.Windows.Forms.Button();
|
this.btnCarregar = new System.Windows.Forms.Button();
|
||||||
this.btnSalvar = new System.Windows.Forms.Button();
|
this.btnSalvar = new System.Windows.Forms.Button();
|
||||||
this.chbSalvar = new System.Windows.Forms.CheckBox();
|
this.chbSalvar = new System.Windows.Forms.CheckBox();
|
||||||
|
|
@ -77,7 +78,7 @@
|
||||||
this.nudCapacidadereservatorio = new System.Windows.Forms.NumericUpDown();
|
this.nudCapacidadereservatorio = new System.Windows.Forms.NumericUpDown();
|
||||||
this.lblUnCapcaidadereservatorio = new System.Windows.Forms.Label();
|
this.lblUnCapcaidadereservatorio = new System.Windows.Forms.Label();
|
||||||
this.lblCapacidadereservatorio = new System.Windows.Forms.Label();
|
this.lblCapacidadereservatorio = new System.Windows.Forms.Label();
|
||||||
this.lblAngulomax = new System.Windows.Forms.Label();
|
this.btnA05 = new System.Windows.Forms.Button();
|
||||||
this.gpbModulos.SuspendLayout();
|
this.gpbModulos.SuspendLayout();
|
||||||
this.gpbP_Sen.SuspendLayout();
|
this.gpbP_Sen.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudTemposalvarlog)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudTemposalvarlog)).BeginInit();
|
||||||
|
|
@ -85,11 +86,11 @@
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudAtuarem)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudAtuarem)).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudQtdCameras)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudQtdCameras)).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudQtdBicos)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudQtdBicos)).BeginInit();
|
||||||
this.gpbP_Dir.SuspendLayout();
|
this.gpbP_Mks.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudAnguloMinimo)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudAnguloMinimo)).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudVelocidadeMP)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudVelocidadeMP)).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudAnguloMaximo)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudAnguloMaximo)).BeginInit();
|
||||||
this.gpbP_Mov.SuspendLayout();
|
this.gpbP_Bld.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudVelocidadeComErvas)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudVelocidadeComErvas)).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudVelocidadeSemErvas)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudVelocidadeSemErvas)).BeginInit();
|
||||||
this.gpbConfiguracoesgerais.SuspendLayout();
|
this.gpbConfiguracoesgerais.SuspendLayout();
|
||||||
|
|
@ -105,7 +106,7 @@
|
||||||
this.cmbOperacao.Location = new System.Drawing.Point(15, 39);
|
this.cmbOperacao.Location = new System.Drawing.Point(15, 39);
|
||||||
this.cmbOperacao.Margin = new System.Windows.Forms.Padding(6);
|
this.cmbOperacao.Margin = new System.Windows.Forms.Padding(6);
|
||||||
this.cmbOperacao.Name = "cmbOperacao";
|
this.cmbOperacao.Name = "cmbOperacao";
|
||||||
this.cmbOperacao.Size = new System.Drawing.Size(417, 37);
|
this.cmbOperacao.Size = new System.Drawing.Size(417, 32);
|
||||||
this.cmbOperacao.TabIndex = 0;
|
this.cmbOperacao.TabIndex = 0;
|
||||||
//
|
//
|
||||||
// lblOperacao
|
// lblOperacao
|
||||||
|
|
@ -115,7 +116,7 @@
|
||||||
this.lblOperacao.Location = new System.Drawing.Point(15, 9);
|
this.lblOperacao.Location = new System.Drawing.Point(15, 9);
|
||||||
this.lblOperacao.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
|
this.lblOperacao.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
|
||||||
this.lblOperacao.Name = "lblOperacao";
|
this.lblOperacao.Name = "lblOperacao";
|
||||||
this.lblOperacao.Size = new System.Drawing.Size(222, 29);
|
this.lblOperacao.Size = new System.Drawing.Size(175, 24);
|
||||||
this.lblOperacao.TabIndex = 1;
|
this.lblOperacao.TabIndex = 1;
|
||||||
this.lblOperacao.Text = "Modo de Operação";
|
this.lblOperacao.Text = "Modo de Operação";
|
||||||
//
|
//
|
||||||
|
|
@ -124,18 +125,18 @@
|
||||||
this.gpbModulos.Controls.Add(this.gpbP_Gps);
|
this.gpbModulos.Controls.Add(this.gpbP_Gps);
|
||||||
this.gpbModulos.Controls.Add(this.gpbP_Sen);
|
this.gpbModulos.Controls.Add(this.gpbP_Sen);
|
||||||
this.gpbModulos.Controls.Add(this.gpbP_Atu);
|
this.gpbModulos.Controls.Add(this.gpbP_Atu);
|
||||||
this.gpbModulos.Controls.Add(this.gpbP_Dir);
|
this.gpbModulos.Controls.Add(this.gpbP_Mks);
|
||||||
this.gpbModulos.Controls.Add(this.gpbP_Mov);
|
this.gpbModulos.Controls.Add(this.gpbP_Bld);
|
||||||
this.gpbModulos.Controls.Add(this.chbO_Gps);
|
this.gpbModulos.Controls.Add(this.chbO_Gps);
|
||||||
this.gpbModulos.Controls.Add(this.chbO_Sen);
|
this.gpbModulos.Controls.Add(this.chbO_Sen);
|
||||||
this.gpbModulos.Controls.Add(this.chbO_Atu);
|
this.gpbModulos.Controls.Add(this.chbO_Atu);
|
||||||
this.gpbModulos.Controls.Add(this.chbO_Dir);
|
this.gpbModulos.Controls.Add(this.chbO_Mks);
|
||||||
this.gpbModulos.Controls.Add(this.chbO_Mov);
|
this.gpbModulos.Controls.Add(this.chbO_Bld);
|
||||||
this.gpbModulos.Controls.Add(this.chbD_Gps);
|
this.gpbModulos.Controls.Add(this.chbD_Gps);
|
||||||
this.gpbModulos.Controls.Add(this.chbD_Sen);
|
this.gpbModulos.Controls.Add(this.chbD_Sen);
|
||||||
this.gpbModulos.Controls.Add(this.chbD_Mov);
|
this.gpbModulos.Controls.Add(this.chbD_Bld);
|
||||||
this.gpbModulos.Controls.Add(this.chbD_Atu);
|
this.gpbModulos.Controls.Add(this.chbD_Atu);
|
||||||
this.gpbModulos.Controls.Add(this.chbD_Dir);
|
this.gpbModulos.Controls.Add(this.chbD_Mks);
|
||||||
this.gpbModulos.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.gpbModulos.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.gpbModulos.Location = new System.Drawing.Point(15, 83);
|
this.gpbModulos.Location = new System.Drawing.Point(15, 83);
|
||||||
this.gpbModulos.Margin = new System.Windows.Forms.Padding(6);
|
this.gpbModulos.Margin = new System.Windows.Forms.Padding(6);
|
||||||
|
|
@ -158,6 +159,7 @@
|
||||||
//
|
//
|
||||||
// gpbP_Sen
|
// gpbP_Sen
|
||||||
//
|
//
|
||||||
|
this.gpbP_Sen.Controls.Add(this.btnA05);
|
||||||
this.gpbP_Sen.Controls.Add(this.lblTemposalvarlogU);
|
this.gpbP_Sen.Controls.Add(this.lblTemposalvarlogU);
|
||||||
this.gpbP_Sen.Controls.Add(this.nudTemposalvarlog);
|
this.gpbP_Sen.Controls.Add(this.nudTemposalvarlog);
|
||||||
this.gpbP_Sen.Controls.Add(this.lblTemposalvarlog);
|
this.gpbP_Sen.Controls.Add(this.lblTemposalvarlog);
|
||||||
|
|
@ -175,7 +177,7 @@
|
||||||
this.lblTemposalvarlogU.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblTemposalvarlogU.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblTemposalvarlogU.Location = new System.Drawing.Point(136, 61);
|
this.lblTemposalvarlogU.Location = new System.Drawing.Point(136, 61);
|
||||||
this.lblTemposalvarlogU.Name = "lblTemposalvarlogU";
|
this.lblTemposalvarlogU.Name = "lblTemposalvarlogU";
|
||||||
this.lblTemposalvarlogU.Size = new System.Drawing.Size(39, 22);
|
this.lblTemposalvarlogU.Size = new System.Drawing.Size(32, 18);
|
||||||
this.lblTemposalvarlogU.TabIndex = 13;
|
this.lblTemposalvarlogU.TabIndex = 13;
|
||||||
this.lblTemposalvarlogU.Text = "seg";
|
this.lblTemposalvarlogU.Text = "seg";
|
||||||
//
|
//
|
||||||
|
|
@ -188,7 +190,7 @@
|
||||||
0,
|
0,
|
||||||
0});
|
0});
|
||||||
this.nudTemposalvarlog.Name = "nudTemposalvarlog";
|
this.nudTemposalvarlog.Name = "nudTemposalvarlog";
|
||||||
this.nudTemposalvarlog.Size = new System.Drawing.Size(120, 30);
|
this.nudTemposalvarlog.Size = new System.Drawing.Size(120, 26);
|
||||||
this.nudTemposalvarlog.TabIndex = 10;
|
this.nudTemposalvarlog.TabIndex = 10;
|
||||||
this.nudTemposalvarlog.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.nudTemposalvarlog.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
this.nudTemposalvarlog.Value = new decimal(new int[] {
|
this.nudTemposalvarlog.Value = new decimal(new int[] {
|
||||||
|
|
@ -203,7 +205,7 @@
|
||||||
this.lblTemposalvarlog.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblTemposalvarlog.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblTemposalvarlog.Location = new System.Drawing.Point(7, 26);
|
this.lblTemposalvarlog.Location = new System.Drawing.Point(7, 26);
|
||||||
this.lblTemposalvarlog.Name = "lblTemposalvarlog";
|
this.lblTemposalvarlog.Name = "lblTemposalvarlog";
|
||||||
this.lblTemposalvarlog.Size = new System.Drawing.Size(157, 22);
|
this.lblTemposalvarlog.Size = new System.Drawing.Size(129, 18);
|
||||||
this.lblTemposalvarlog.TabIndex = 9;
|
this.lblTemposalvarlog.TabIndex = 9;
|
||||||
this.lblTemposalvarlog.Text = "Tempo Salvar Log";
|
this.lblTemposalvarlog.Text = "Tempo Salvar Log";
|
||||||
//
|
//
|
||||||
|
|
@ -230,14 +232,14 @@
|
||||||
this.cmbScriptErvas.FormattingEnabled = true;
|
this.cmbScriptErvas.FormattingEnabled = true;
|
||||||
this.cmbScriptErvas.Location = new System.Drawing.Point(6, 129);
|
this.cmbScriptErvas.Location = new System.Drawing.Point(6, 129);
|
||||||
this.cmbScriptErvas.Name = "cmbScriptErvas";
|
this.cmbScriptErvas.Name = "cmbScriptErvas";
|
||||||
this.cmbScriptErvas.Size = new System.Drawing.Size(178, 33);
|
this.cmbScriptErvas.Size = new System.Drawing.Size(178, 28);
|
||||||
this.cmbScriptErvas.TabIndex = 15;
|
this.cmbScriptErvas.TabIndex = 15;
|
||||||
//
|
//
|
||||||
// nudAtuarem
|
// nudAtuarem
|
||||||
//
|
//
|
||||||
this.nudAtuarem.Location = new System.Drawing.Point(130, 97);
|
this.nudAtuarem.Location = new System.Drawing.Point(130, 97);
|
||||||
this.nudAtuarem.Name = "nudAtuarem";
|
this.nudAtuarem.Name = "nudAtuarem";
|
||||||
this.nudAtuarem.Size = new System.Drawing.Size(54, 30);
|
this.nudAtuarem.Size = new System.Drawing.Size(54, 26);
|
||||||
this.nudAtuarem.TabIndex = 13;
|
this.nudAtuarem.TabIndex = 13;
|
||||||
this.nudAtuarem.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.nudAtuarem.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
//
|
//
|
||||||
|
|
@ -247,7 +249,7 @@
|
||||||
this.lblAtuarem.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblAtuarem.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblAtuarem.Location = new System.Drawing.Point(6, 101);
|
this.lblAtuarem.Location = new System.Drawing.Point(6, 101);
|
||||||
this.lblAtuarem.Name = "lblAtuarem";
|
this.lblAtuarem.Name = "lblAtuarem";
|
||||||
this.lblAtuarem.Size = new System.Drawing.Size(115, 22);
|
this.lblAtuarem.Size = new System.Drawing.Size(94, 18);
|
||||||
this.lblAtuarem.TabIndex = 12;
|
this.lblAtuarem.TabIndex = 12;
|
||||||
this.lblAtuarem.Text = "Atuar em (%)";
|
this.lblAtuarem.Text = "Atuar em (%)";
|
||||||
//
|
//
|
||||||
|
|
@ -255,7 +257,7 @@
|
||||||
//
|
//
|
||||||
this.nudQtdCameras.Location = new System.Drawing.Point(130, 61);
|
this.nudQtdCameras.Location = new System.Drawing.Point(130, 61);
|
||||||
this.nudQtdCameras.Name = "nudQtdCameras";
|
this.nudQtdCameras.Name = "nudQtdCameras";
|
||||||
this.nudQtdCameras.Size = new System.Drawing.Size(54, 30);
|
this.nudQtdCameras.Size = new System.Drawing.Size(54, 26);
|
||||||
this.nudQtdCameras.TabIndex = 11;
|
this.nudQtdCameras.TabIndex = 11;
|
||||||
this.nudQtdCameras.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.nudQtdCameras.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
//
|
//
|
||||||
|
|
@ -265,7 +267,7 @@
|
||||||
this.lblQtdCameras.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblQtdCameras.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblQtdCameras.Location = new System.Drawing.Point(6, 65);
|
this.lblQtdCameras.Location = new System.Drawing.Point(6, 65);
|
||||||
this.lblQtdCameras.Name = "lblQtdCameras";
|
this.lblQtdCameras.Name = "lblQtdCameras";
|
||||||
this.lblQtdCameras.Size = new System.Drawing.Size(82, 22);
|
this.lblQtdCameras.Size = new System.Drawing.Size(69, 18);
|
||||||
this.lblQtdCameras.TabIndex = 9;
|
this.lblQtdCameras.TabIndex = 9;
|
||||||
this.lblQtdCameras.Text = "Câmeras";
|
this.lblQtdCameras.Text = "Câmeras";
|
||||||
//
|
//
|
||||||
|
|
@ -273,7 +275,7 @@
|
||||||
//
|
//
|
||||||
this.nudQtdBicos.Location = new System.Drawing.Point(130, 25);
|
this.nudQtdBicos.Location = new System.Drawing.Point(130, 25);
|
||||||
this.nudQtdBicos.Name = "nudQtdBicos";
|
this.nudQtdBicos.Name = "nudQtdBicos";
|
||||||
this.nudQtdBicos.Size = new System.Drawing.Size(54, 30);
|
this.nudQtdBicos.Size = new System.Drawing.Size(54, 26);
|
||||||
this.nudQtdBicos.TabIndex = 8;
|
this.nudQtdBicos.TabIndex = 8;
|
||||||
this.nudQtdBicos.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.nudQtdBicos.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
//
|
//
|
||||||
|
|
@ -283,25 +285,35 @@
|
||||||
this.lblQtdBicos.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblQtdBicos.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblQtdBicos.Location = new System.Drawing.Point(6, 29);
|
this.lblQtdBicos.Location = new System.Drawing.Point(6, 29);
|
||||||
this.lblQtdBicos.Name = "lblQtdBicos";
|
this.lblQtdBicos.Name = "lblQtdBicos";
|
||||||
this.lblQtdBicos.Size = new System.Drawing.Size(54, 22);
|
this.lblQtdBicos.Size = new System.Drawing.Size(46, 18);
|
||||||
this.lblQtdBicos.TabIndex = 6;
|
this.lblQtdBicos.TabIndex = 6;
|
||||||
this.lblQtdBicos.Text = "Bicos";
|
this.lblQtdBicos.Text = "Bicos";
|
||||||
//
|
//
|
||||||
// gpbP_Dir
|
// gpbP_Mks
|
||||||
//
|
//
|
||||||
this.gpbP_Dir.Controls.Add(this.lblAngulomax);
|
this.gpbP_Mks.Controls.Add(this.lblAngulomax);
|
||||||
this.gpbP_Dir.Controls.Add(this.nudAnguloMinimo);
|
this.gpbP_Mks.Controls.Add(this.nudAnguloMinimo);
|
||||||
this.gpbP_Dir.Controls.Add(this.nudVelocidadeMP);
|
this.gpbP_Mks.Controls.Add(this.nudVelocidadeMP);
|
||||||
this.gpbP_Dir.Controls.Add(this.lblVelocidadeMP);
|
this.gpbP_Mks.Controls.Add(this.lblVelocidadeMP);
|
||||||
this.gpbP_Dir.Controls.Add(this.nudAnguloMaximo);
|
this.gpbP_Mks.Controls.Add(this.nudAnguloMaximo);
|
||||||
this.gpbP_Dir.Controls.Add(this.lblAngulomin);
|
this.gpbP_Mks.Controls.Add(this.lblAngulomin);
|
||||||
this.gpbP_Dir.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.gpbP_Mks.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.gpbP_Dir.Location = new System.Drawing.Point(204, 105);
|
this.gpbP_Mks.Location = new System.Drawing.Point(204, 105);
|
||||||
this.gpbP_Dir.Name = "gpbP_Dir";
|
this.gpbP_Mks.Name = "gpbP_Mks";
|
||||||
this.gpbP_Dir.Size = new System.Drawing.Size(190, 168);
|
this.gpbP_Mks.Size = new System.Drawing.Size(190, 168);
|
||||||
this.gpbP_Dir.TabIndex = 12;
|
this.gpbP_Mks.TabIndex = 12;
|
||||||
this.gpbP_Dir.TabStop = false;
|
this.gpbP_Mks.TabStop = false;
|
||||||
this.gpbP_Dir.Text = "Ajustes";
|
this.gpbP_Mks.Text = "Ajustes";
|
||||||
|
//
|
||||||
|
// lblAngulomax
|
||||||
|
//
|
||||||
|
this.lblAngulomax.AutoSize = true;
|
||||||
|
this.lblAngulomax.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.lblAngulomax.Location = new System.Drawing.Point(6, 67);
|
||||||
|
this.lblAngulomax.Name = "lblAngulomax";
|
||||||
|
this.lblAngulomax.Size = new System.Drawing.Size(85, 18);
|
||||||
|
this.lblAngulomax.TabIndex = 13;
|
||||||
|
this.lblAngulomax.Text = "Angulo Máx";
|
||||||
//
|
//
|
||||||
// nudAnguloMinimo
|
// nudAnguloMinimo
|
||||||
//
|
//
|
||||||
|
|
@ -317,7 +329,7 @@
|
||||||
0,
|
0,
|
||||||
-2147483648});
|
-2147483648});
|
||||||
this.nudAnguloMinimo.Name = "nudAnguloMinimo";
|
this.nudAnguloMinimo.Name = "nudAnguloMinimo";
|
||||||
this.nudAnguloMinimo.Size = new System.Drawing.Size(72, 30);
|
this.nudAnguloMinimo.Size = new System.Drawing.Size(72, 26);
|
||||||
this.nudAnguloMinimo.TabIndex = 12;
|
this.nudAnguloMinimo.TabIndex = 12;
|
||||||
this.nudAnguloMinimo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.nudAnguloMinimo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
//
|
//
|
||||||
|
|
@ -325,7 +337,7 @@
|
||||||
//
|
//
|
||||||
this.nudVelocidadeMP.Location = new System.Drawing.Point(111, 100);
|
this.nudVelocidadeMP.Location = new System.Drawing.Point(111, 100);
|
||||||
this.nudVelocidadeMP.Name = "nudVelocidadeMP";
|
this.nudVelocidadeMP.Name = "nudVelocidadeMP";
|
||||||
this.nudVelocidadeMP.Size = new System.Drawing.Size(73, 30);
|
this.nudVelocidadeMP.Size = new System.Drawing.Size(73, 26);
|
||||||
this.nudVelocidadeMP.TabIndex = 11;
|
this.nudVelocidadeMP.TabIndex = 11;
|
||||||
this.nudVelocidadeMP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.nudVelocidadeMP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
//
|
//
|
||||||
|
|
@ -335,7 +347,7 @@
|
||||||
this.lblVelocidadeMP.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblVelocidadeMP.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblVelocidadeMP.Location = new System.Drawing.Point(6, 104);
|
this.lblVelocidadeMP.Location = new System.Drawing.Point(6, 104);
|
||||||
this.lblVelocidadeMP.Name = "lblVelocidadeMP";
|
this.lblVelocidadeMP.Name = "lblVelocidadeMP";
|
||||||
this.lblVelocidadeMP.Size = new System.Drawing.Size(99, 22);
|
this.lblVelocidadeMP.Size = new System.Drawing.Size(80, 18);
|
||||||
this.lblVelocidadeMP.TabIndex = 9;
|
this.lblVelocidadeMP.TabIndex = 9;
|
||||||
this.lblVelocidadeMP.Text = "Velocidade";
|
this.lblVelocidadeMP.Text = "Velocidade";
|
||||||
//
|
//
|
||||||
|
|
@ -353,7 +365,7 @@
|
||||||
0,
|
0,
|
||||||
-2147483648});
|
-2147483648});
|
||||||
this.nudAnguloMaximo.Name = "nudAnguloMaximo";
|
this.nudAnguloMaximo.Name = "nudAnguloMaximo";
|
||||||
this.nudAnguloMaximo.Size = new System.Drawing.Size(72, 30);
|
this.nudAnguloMaximo.Size = new System.Drawing.Size(72, 26);
|
||||||
this.nudAnguloMaximo.TabIndex = 8;
|
this.nudAnguloMaximo.TabIndex = 8;
|
||||||
this.nudAnguloMaximo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.nudAnguloMaximo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
//
|
//
|
||||||
|
|
@ -363,31 +375,31 @@
|
||||||
this.lblAngulomin.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblAngulomin.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblAngulomin.Location = new System.Drawing.Point(6, 32);
|
this.lblAngulomin.Location = new System.Drawing.Point(6, 32);
|
||||||
this.lblAngulomin.Name = "lblAngulomin";
|
this.lblAngulomin.Name = "lblAngulomin";
|
||||||
this.lblAngulomin.Size = new System.Drawing.Size(99, 22);
|
this.lblAngulomin.Size = new System.Drawing.Size(81, 18);
|
||||||
this.lblAngulomin.TabIndex = 6;
|
this.lblAngulomin.TabIndex = 6;
|
||||||
this.lblAngulomin.Text = "Angulo Mín";
|
this.lblAngulomin.Text = "Angulo Mín";
|
||||||
//
|
//
|
||||||
// gpbP_Mov
|
// gpbP_Bld
|
||||||
//
|
//
|
||||||
this.gpbP_Mov.Controls.Add(this.nudVelocidadeComErvas);
|
this.gpbP_Bld.Controls.Add(this.nudVelocidadeComErvas);
|
||||||
this.gpbP_Mov.Controls.Add(this.lblKmhCErvas);
|
this.gpbP_Bld.Controls.Add(this.lblKmhCErvas);
|
||||||
this.gpbP_Mov.Controls.Add(this.lblVelocidadeComErvas);
|
this.gpbP_Bld.Controls.Add(this.lblVelocidadeComErvas);
|
||||||
this.gpbP_Mov.Controls.Add(this.nudVelocidadeSemErvas);
|
this.gpbP_Bld.Controls.Add(this.nudVelocidadeSemErvas);
|
||||||
this.gpbP_Mov.Controls.Add(this.lblKmhSErvas);
|
this.gpbP_Bld.Controls.Add(this.lblKmhSErvas);
|
||||||
this.gpbP_Mov.Controls.Add(this.lblVelocidadeSemErvas);
|
this.gpbP_Bld.Controls.Add(this.lblVelocidadeSemErvas);
|
||||||
this.gpbP_Mov.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.gpbP_Bld.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.gpbP_Mov.Location = new System.Drawing.Point(8, 105);
|
this.gpbP_Bld.Location = new System.Drawing.Point(8, 105);
|
||||||
this.gpbP_Mov.Name = "gpbP_Mov";
|
this.gpbP_Bld.Name = "gpbP_Bld";
|
||||||
this.gpbP_Mov.Size = new System.Drawing.Size(190, 168);
|
this.gpbP_Bld.Size = new System.Drawing.Size(190, 168);
|
||||||
this.gpbP_Mov.TabIndex = 10;
|
this.gpbP_Bld.TabIndex = 10;
|
||||||
this.gpbP_Mov.TabStop = false;
|
this.gpbP_Bld.TabStop = false;
|
||||||
this.gpbP_Mov.Text = "Ajustes";
|
this.gpbP_Bld.Text = "Ajustes";
|
||||||
//
|
//
|
||||||
// nudVelocidadeComErvas
|
// nudVelocidadeComErvas
|
||||||
//
|
//
|
||||||
this.nudVelocidadeComErvas.Location = new System.Drawing.Point(10, 120);
|
this.nudVelocidadeComErvas.Location = new System.Drawing.Point(10, 120);
|
||||||
this.nudVelocidadeComErvas.Name = "nudVelocidadeComErvas";
|
this.nudVelocidadeComErvas.Name = "nudVelocidadeComErvas";
|
||||||
this.nudVelocidadeComErvas.Size = new System.Drawing.Size(73, 30);
|
this.nudVelocidadeComErvas.Size = new System.Drawing.Size(73, 26);
|
||||||
this.nudVelocidadeComErvas.TabIndex = 11;
|
this.nudVelocidadeComErvas.TabIndex = 11;
|
||||||
this.nudVelocidadeComErvas.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.nudVelocidadeComErvas.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
this.nudVelocidadeComErvas.ValueChanged += new System.EventHandler(this.nudVelocidadeComErvas_ValueChanged);
|
this.nudVelocidadeComErvas.ValueChanged += new System.EventHandler(this.nudVelocidadeComErvas_ValueChanged);
|
||||||
|
|
@ -398,7 +410,7 @@
|
||||||
this.lblKmhCErvas.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblKmhCErvas.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblKmhCErvas.Location = new System.Drawing.Point(89, 124);
|
this.lblKmhCErvas.Location = new System.Drawing.Point(89, 124);
|
||||||
this.lblKmhCErvas.Name = "lblKmhCErvas";
|
this.lblKmhCErvas.Name = "lblKmhCErvas";
|
||||||
this.lblKmhCErvas.Size = new System.Drawing.Size(91, 22);
|
this.lblKmhCErvas.Size = new System.Drawing.Size(75, 18);
|
||||||
this.lblKmhCErvas.TabIndex = 10;
|
this.lblKmhCErvas.TabIndex = 10;
|
||||||
this.lblKmhCErvas.Text = "0,00 Km/h";
|
this.lblKmhCErvas.Text = "0,00 Km/h";
|
||||||
//
|
//
|
||||||
|
|
@ -408,7 +420,7 @@
|
||||||
this.lblVelocidadeComErvas.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblVelocidadeComErvas.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblVelocidadeComErvas.Location = new System.Drawing.Point(3, 94);
|
this.lblVelocidadeComErvas.Location = new System.Drawing.Point(3, 94);
|
||||||
this.lblVelocidadeComErvas.Name = "lblVelocidadeComErvas";
|
this.lblVelocidadeComErvas.Name = "lblVelocidadeComErvas";
|
||||||
this.lblVelocidadeComErvas.Size = new System.Drawing.Size(186, 22);
|
this.lblVelocidadeComErvas.Size = new System.Drawing.Size(154, 18);
|
||||||
this.lblVelocidadeComErvas.TabIndex = 9;
|
this.lblVelocidadeComErvas.TabIndex = 9;
|
||||||
this.lblVelocidadeComErvas.Text = "Velocidade com ervas";
|
this.lblVelocidadeComErvas.Text = "Velocidade com ervas";
|
||||||
//
|
//
|
||||||
|
|
@ -416,7 +428,7 @@
|
||||||
//
|
//
|
||||||
this.nudVelocidadeSemErvas.Location = new System.Drawing.Point(10, 57);
|
this.nudVelocidadeSemErvas.Location = new System.Drawing.Point(10, 57);
|
||||||
this.nudVelocidadeSemErvas.Name = "nudVelocidadeSemErvas";
|
this.nudVelocidadeSemErvas.Name = "nudVelocidadeSemErvas";
|
||||||
this.nudVelocidadeSemErvas.Size = new System.Drawing.Size(73, 30);
|
this.nudVelocidadeSemErvas.Size = new System.Drawing.Size(73, 26);
|
||||||
this.nudVelocidadeSemErvas.TabIndex = 8;
|
this.nudVelocidadeSemErvas.TabIndex = 8;
|
||||||
this.nudVelocidadeSemErvas.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.nudVelocidadeSemErvas.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
this.nudVelocidadeSemErvas.ValueChanged += new System.EventHandler(this.nudVelocidadeSemErvas_ValueChanged);
|
this.nudVelocidadeSemErvas.ValueChanged += new System.EventHandler(this.nudVelocidadeSemErvas_ValueChanged);
|
||||||
|
|
@ -427,7 +439,7 @@
|
||||||
this.lblKmhSErvas.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblKmhSErvas.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblKmhSErvas.Location = new System.Drawing.Point(89, 61);
|
this.lblKmhSErvas.Location = new System.Drawing.Point(89, 61);
|
||||||
this.lblKmhSErvas.Name = "lblKmhSErvas";
|
this.lblKmhSErvas.Name = "lblKmhSErvas";
|
||||||
this.lblKmhSErvas.Size = new System.Drawing.Size(91, 22);
|
this.lblKmhSErvas.Size = new System.Drawing.Size(75, 18);
|
||||||
this.lblKmhSErvas.TabIndex = 7;
|
this.lblKmhSErvas.TabIndex = 7;
|
||||||
this.lblKmhSErvas.Text = "0,00 Km/h";
|
this.lblKmhSErvas.Text = "0,00 Km/h";
|
||||||
//
|
//
|
||||||
|
|
@ -437,7 +449,7 @@
|
||||||
this.lblVelocidadeSemErvas.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblVelocidadeSemErvas.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblVelocidadeSemErvas.Location = new System.Drawing.Point(3, 32);
|
this.lblVelocidadeSemErvas.Location = new System.Drawing.Point(3, 32);
|
||||||
this.lblVelocidadeSemErvas.Name = "lblVelocidadeSemErvas";
|
this.lblVelocidadeSemErvas.Name = "lblVelocidadeSemErvas";
|
||||||
this.lblVelocidadeSemErvas.Size = new System.Drawing.Size(186, 22);
|
this.lblVelocidadeSemErvas.Size = new System.Drawing.Size(153, 18);
|
||||||
this.lblVelocidadeSemErvas.TabIndex = 6;
|
this.lblVelocidadeSemErvas.TabIndex = 6;
|
||||||
this.lblVelocidadeSemErvas.Text = "Velocidade sem ervas";
|
this.lblVelocidadeSemErvas.Text = "Velocidade sem ervas";
|
||||||
//
|
//
|
||||||
|
|
@ -448,7 +460,7 @@
|
||||||
this.chbO_Gps.Location = new System.Drawing.Point(802, 74);
|
this.chbO_Gps.Location = new System.Drawing.Point(802, 74);
|
||||||
this.chbO_Gps.Margin = new System.Windows.Forms.Padding(6);
|
this.chbO_Gps.Margin = new System.Windows.Forms.Padding(6);
|
||||||
this.chbO_Gps.Name = "chbO_Gps";
|
this.chbO_Gps.Name = "chbO_Gps";
|
||||||
this.chbO_Gps.Size = new System.Drawing.Size(108, 28);
|
this.chbO_Gps.Size = new System.Drawing.Size(86, 22);
|
||||||
this.chbO_Gps.TabIndex = 9;
|
this.chbO_Gps.TabIndex = 9;
|
||||||
this.chbO_Gps.Text = "Opcional";
|
this.chbO_Gps.Text = "Opcional";
|
||||||
this.chbO_Gps.UseVisualStyleBackColor = true;
|
this.chbO_Gps.UseVisualStyleBackColor = true;
|
||||||
|
|
@ -461,7 +473,7 @@
|
||||||
this.chbO_Sen.Location = new System.Drawing.Point(606, 74);
|
this.chbO_Sen.Location = new System.Drawing.Point(606, 74);
|
||||||
this.chbO_Sen.Margin = new System.Windows.Forms.Padding(6);
|
this.chbO_Sen.Margin = new System.Windows.Forms.Padding(6);
|
||||||
this.chbO_Sen.Name = "chbO_Sen";
|
this.chbO_Sen.Name = "chbO_Sen";
|
||||||
this.chbO_Sen.Size = new System.Drawing.Size(108, 28);
|
this.chbO_Sen.Size = new System.Drawing.Size(86, 22);
|
||||||
this.chbO_Sen.TabIndex = 8;
|
this.chbO_Sen.TabIndex = 8;
|
||||||
this.chbO_Sen.Text = "Opcional";
|
this.chbO_Sen.Text = "Opcional";
|
||||||
this.chbO_Sen.UseVisualStyleBackColor = true;
|
this.chbO_Sen.UseVisualStyleBackColor = true;
|
||||||
|
|
@ -474,37 +486,37 @@
|
||||||
this.chbO_Atu.Location = new System.Drawing.Point(410, 74);
|
this.chbO_Atu.Location = new System.Drawing.Point(410, 74);
|
||||||
this.chbO_Atu.Margin = new System.Windows.Forms.Padding(6);
|
this.chbO_Atu.Margin = new System.Windows.Forms.Padding(6);
|
||||||
this.chbO_Atu.Name = "chbO_Atu";
|
this.chbO_Atu.Name = "chbO_Atu";
|
||||||
this.chbO_Atu.Size = new System.Drawing.Size(108, 28);
|
this.chbO_Atu.Size = new System.Drawing.Size(86, 22);
|
||||||
this.chbO_Atu.TabIndex = 7;
|
this.chbO_Atu.TabIndex = 7;
|
||||||
this.chbO_Atu.Text = "Opcional";
|
this.chbO_Atu.Text = "Opcional";
|
||||||
this.chbO_Atu.UseVisualStyleBackColor = true;
|
this.chbO_Atu.UseVisualStyleBackColor = true;
|
||||||
this.chbO_Atu.CheckedChanged += new System.EventHandler(this.chbO_CheckedChanged);
|
this.chbO_Atu.CheckedChanged += new System.EventHandler(this.chbO_CheckedChanged);
|
||||||
//
|
//
|
||||||
// chbO_Dir
|
// chbO_Mks
|
||||||
//
|
//
|
||||||
this.chbO_Dir.AutoSize = true;
|
this.chbO_Mks.AutoSize = true;
|
||||||
this.chbO_Dir.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.chbO_Mks.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.chbO_Dir.Location = new System.Drawing.Point(214, 74);
|
this.chbO_Mks.Location = new System.Drawing.Point(214, 74);
|
||||||
this.chbO_Dir.Margin = new System.Windows.Forms.Padding(6);
|
this.chbO_Mks.Margin = new System.Windows.Forms.Padding(6);
|
||||||
this.chbO_Dir.Name = "chbO_Dir";
|
this.chbO_Mks.Name = "chbO_Mks";
|
||||||
this.chbO_Dir.Size = new System.Drawing.Size(108, 28);
|
this.chbO_Mks.Size = new System.Drawing.Size(86, 22);
|
||||||
this.chbO_Dir.TabIndex = 6;
|
this.chbO_Mks.TabIndex = 6;
|
||||||
this.chbO_Dir.Text = "Opcional";
|
this.chbO_Mks.Text = "Opcional";
|
||||||
this.chbO_Dir.UseVisualStyleBackColor = true;
|
this.chbO_Mks.UseVisualStyleBackColor = true;
|
||||||
this.chbO_Dir.CheckedChanged += new System.EventHandler(this.chbO_CheckedChanged);
|
this.chbO_Mks.CheckedChanged += new System.EventHandler(this.chbO_CheckedChanged);
|
||||||
//
|
//
|
||||||
// chbO_Mov
|
// chbO_Bld
|
||||||
//
|
//
|
||||||
this.chbO_Mov.AutoSize = true;
|
this.chbO_Bld.AutoSize = true;
|
||||||
this.chbO_Mov.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.chbO_Bld.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.chbO_Mov.Location = new System.Drawing.Point(18, 74);
|
this.chbO_Bld.Location = new System.Drawing.Point(18, 74);
|
||||||
this.chbO_Mov.Margin = new System.Windows.Forms.Padding(6);
|
this.chbO_Bld.Margin = new System.Windows.Forms.Padding(6);
|
||||||
this.chbO_Mov.Name = "chbO_Mov";
|
this.chbO_Bld.Name = "chbO_Bld";
|
||||||
this.chbO_Mov.Size = new System.Drawing.Size(108, 28);
|
this.chbO_Bld.Size = new System.Drawing.Size(86, 22);
|
||||||
this.chbO_Mov.TabIndex = 5;
|
this.chbO_Bld.TabIndex = 5;
|
||||||
this.chbO_Mov.Text = "Opcional";
|
this.chbO_Bld.Text = "Opcional";
|
||||||
this.chbO_Mov.UseVisualStyleBackColor = true;
|
this.chbO_Bld.UseVisualStyleBackColor = true;
|
||||||
this.chbO_Mov.CheckedChanged += new System.EventHandler(this.chbO_CheckedChanged);
|
this.chbO_Bld.CheckedChanged += new System.EventHandler(this.chbO_CheckedChanged);
|
||||||
//
|
//
|
||||||
// chbD_Gps
|
// chbD_Gps
|
||||||
//
|
//
|
||||||
|
|
@ -512,7 +524,7 @@
|
||||||
this.chbD_Gps.Location = new System.Drawing.Point(802, 34);
|
this.chbD_Gps.Location = new System.Drawing.Point(802, 34);
|
||||||
this.chbD_Gps.Margin = new System.Windows.Forms.Padding(6);
|
this.chbD_Gps.Margin = new System.Windows.Forms.Padding(6);
|
||||||
this.chbD_Gps.Name = "chbD_Gps";
|
this.chbD_Gps.Name = "chbD_Gps";
|
||||||
this.chbD_Gps.Size = new System.Drawing.Size(85, 33);
|
this.chbD_Gps.Size = new System.Drawing.Size(67, 28);
|
||||||
this.chbD_Gps.TabIndex = 4;
|
this.chbD_Gps.TabIndex = 4;
|
||||||
this.chbD_Gps.Text = "GPS";
|
this.chbD_Gps.Text = "GPS";
|
||||||
this.chbD_Gps.UseVisualStyleBackColor = true;
|
this.chbD_Gps.UseVisualStyleBackColor = true;
|
||||||
|
|
@ -524,23 +536,23 @@
|
||||||
this.chbD_Sen.Location = new System.Drawing.Point(606, 34);
|
this.chbD_Sen.Location = new System.Drawing.Point(606, 34);
|
||||||
this.chbD_Sen.Margin = new System.Windows.Forms.Padding(6);
|
this.chbD_Sen.Margin = new System.Windows.Forms.Padding(6);
|
||||||
this.chbD_Sen.Name = "chbD_Sen";
|
this.chbD_Sen.Name = "chbD_Sen";
|
||||||
this.chbD_Sen.Size = new System.Drawing.Size(198, 33);
|
this.chbD_Sen.Size = new System.Drawing.Size(156, 28);
|
||||||
this.chbD_Sen.TabIndex = 3;
|
this.chbD_Sen.TabIndex = 3;
|
||||||
this.chbD_Sen.Text = "Sensoriamento";
|
this.chbD_Sen.Text = "Sensoriamento";
|
||||||
this.chbD_Sen.UseVisualStyleBackColor = true;
|
this.chbD_Sen.UseVisualStyleBackColor = true;
|
||||||
this.chbD_Sen.CheckedChanged += new System.EventHandler(this.chbD_CheckedChanged);
|
this.chbD_Sen.CheckedChanged += new System.EventHandler(this.chbD_CheckedChanged);
|
||||||
//
|
//
|
||||||
// chbD_Mov
|
// chbD_Bld
|
||||||
//
|
//
|
||||||
this.chbD_Mov.AutoSize = true;
|
this.chbD_Bld.AutoSize = true;
|
||||||
this.chbD_Mov.Location = new System.Drawing.Point(18, 34);
|
this.chbD_Bld.Location = new System.Drawing.Point(18, 34);
|
||||||
this.chbD_Mov.Margin = new System.Windows.Forms.Padding(6);
|
this.chbD_Bld.Margin = new System.Windows.Forms.Padding(6);
|
||||||
this.chbD_Mov.Name = "chbD_Mov";
|
this.chbD_Bld.Name = "chbD_Bld";
|
||||||
this.chbD_Mov.Size = new System.Drawing.Size(191, 33);
|
this.chbD_Bld.Size = new System.Drawing.Size(152, 28);
|
||||||
this.chbD_Mov.TabIndex = 0;
|
this.chbD_Bld.TabIndex = 0;
|
||||||
this.chbD_Mov.Text = "Movimentação";
|
this.chbD_Bld.Text = "Movimentação";
|
||||||
this.chbD_Mov.UseVisualStyleBackColor = true;
|
this.chbD_Bld.UseVisualStyleBackColor = true;
|
||||||
this.chbD_Mov.CheckedChanged += new System.EventHandler(this.chbD_CheckedChanged);
|
this.chbD_Bld.CheckedChanged += new System.EventHandler(this.chbD_CheckedChanged);
|
||||||
//
|
//
|
||||||
// chbD_Atu
|
// chbD_Atu
|
||||||
//
|
//
|
||||||
|
|
@ -548,23 +560,23 @@
|
||||||
this.chbD_Atu.Location = new System.Drawing.Point(410, 34);
|
this.chbD_Atu.Location = new System.Drawing.Point(410, 34);
|
||||||
this.chbD_Atu.Margin = new System.Windows.Forms.Padding(6);
|
this.chbD_Atu.Margin = new System.Windows.Forms.Padding(6);
|
||||||
this.chbD_Atu.Name = "chbD_Atu";
|
this.chbD_Atu.Name = "chbD_Atu";
|
||||||
this.chbD_Atu.Size = new System.Drawing.Size(118, 33);
|
this.chbD_Atu.Size = new System.Drawing.Size(95, 28);
|
||||||
this.chbD_Atu.TabIndex = 2;
|
this.chbD_Atu.TabIndex = 2;
|
||||||
this.chbD_Atu.Text = "Atuador";
|
this.chbD_Atu.Text = "Atuador";
|
||||||
this.chbD_Atu.UseVisualStyleBackColor = true;
|
this.chbD_Atu.UseVisualStyleBackColor = true;
|
||||||
this.chbD_Atu.CheckedChanged += new System.EventHandler(this.chbD_CheckedChanged);
|
this.chbD_Atu.CheckedChanged += new System.EventHandler(this.chbD_CheckedChanged);
|
||||||
//
|
//
|
||||||
// chbD_Dir
|
// chbD_Mks
|
||||||
//
|
//
|
||||||
this.chbD_Dir.AutoSize = true;
|
this.chbD_Mks.AutoSize = true;
|
||||||
this.chbD_Dir.Location = new System.Drawing.Point(214, 34);
|
this.chbD_Mks.Location = new System.Drawing.Point(214, 34);
|
||||||
this.chbD_Dir.Margin = new System.Windows.Forms.Padding(6);
|
this.chbD_Mks.Margin = new System.Windows.Forms.Padding(6);
|
||||||
this.chbD_Dir.Name = "chbD_Dir";
|
this.chbD_Mks.Name = "chbD_Mks";
|
||||||
this.chbD_Dir.Size = new System.Drawing.Size(144, 33);
|
this.chbD_Mks.Size = new System.Drawing.Size(113, 28);
|
||||||
this.chbD_Dir.TabIndex = 1;
|
this.chbD_Mks.TabIndex = 1;
|
||||||
this.chbD_Dir.Text = "Direcional";
|
this.chbD_Mks.Text = "Direcional";
|
||||||
this.chbD_Dir.UseVisualStyleBackColor = true;
|
this.chbD_Mks.UseVisualStyleBackColor = true;
|
||||||
this.chbD_Dir.CheckedChanged += new System.EventHandler(this.chbD_CheckedChanged);
|
this.chbD_Mks.CheckedChanged += new System.EventHandler(this.chbD_CheckedChanged);
|
||||||
//
|
//
|
||||||
// btnCarregar
|
// btnCarregar
|
||||||
//
|
//
|
||||||
|
|
@ -594,7 +606,7 @@
|
||||||
this.chbSalvar.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.chbSalvar.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.chbSalvar.Location = new System.Drawing.Point(700, 45);
|
this.chbSalvar.Location = new System.Drawing.Point(700, 45);
|
||||||
this.chbSalvar.Name = "chbSalvar";
|
this.chbSalvar.Name = "chbSalvar";
|
||||||
this.chbSalvar.Size = new System.Drawing.Size(158, 29);
|
this.chbSalvar.Size = new System.Drawing.Size(128, 24);
|
||||||
this.chbSalvar.TabIndex = 7;
|
this.chbSalvar.TabIndex = 7;
|
||||||
this.chbSalvar.Text = "Personalizado";
|
this.chbSalvar.Text = "Personalizado";
|
||||||
this.chbSalvar.UseVisualStyleBackColor = true;
|
this.chbSalvar.UseVisualStyleBackColor = true;
|
||||||
|
|
@ -618,7 +630,7 @@
|
||||||
//
|
//
|
||||||
this.txtDensidadeherbicida.Location = new System.Drawing.Point(18, 118);
|
this.txtDensidadeherbicida.Location = new System.Drawing.Point(18, 118);
|
||||||
this.txtDensidadeherbicida.Name = "txtDensidadeherbicida";
|
this.txtDensidadeherbicida.Name = "txtDensidadeherbicida";
|
||||||
this.txtDensidadeherbicida.Size = new System.Drawing.Size(73, 34);
|
this.txtDensidadeherbicida.Size = new System.Drawing.Size(73, 29);
|
||||||
this.txtDensidadeherbicida.TabIndex = 15;
|
this.txtDensidadeherbicida.TabIndex = 15;
|
||||||
this.txtDensidadeherbicida.Text = "1,1";
|
this.txtDensidadeherbicida.Text = "1,1";
|
||||||
this.txtDensidadeherbicida.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.txtDensidadeherbicida.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
|
|
@ -629,7 +641,7 @@
|
||||||
this.lblUnDensidadeherbicida.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblUnDensidadeherbicida.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblUnDensidadeherbicida.Location = new System.Drawing.Point(97, 121);
|
this.lblUnDensidadeherbicida.Location = new System.Drawing.Point(97, 121);
|
||||||
this.lblUnDensidadeherbicida.Name = "lblUnDensidadeherbicida";
|
this.lblUnDensidadeherbicida.Name = "lblUnDensidadeherbicida";
|
||||||
this.lblUnDensidadeherbicida.Size = new System.Drawing.Size(62, 25);
|
this.lblUnDensidadeherbicida.Size = new System.Drawing.Size(48, 20);
|
||||||
this.lblUnDensidadeherbicida.TabIndex = 13;
|
this.lblUnDensidadeherbicida.TabIndex = 13;
|
||||||
this.lblUnDensidadeherbicida.Text = "g/cm³";
|
this.lblUnDensidadeherbicida.Text = "g/cm³";
|
||||||
//
|
//
|
||||||
|
|
@ -639,7 +651,7 @@
|
||||||
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.label2.Location = new System.Drawing.Point(14, 92);
|
this.label2.Location = new System.Drawing.Point(14, 92);
|
||||||
this.label2.Name = "label2";
|
this.label2.Name = "label2";
|
||||||
this.label2.Size = new System.Drawing.Size(190, 25);
|
this.label2.Size = new System.Drawing.Size(154, 20);
|
||||||
this.label2.TabIndex = 12;
|
this.label2.TabIndex = 12;
|
||||||
this.label2.Text = "Densidade herbicida";
|
this.label2.Text = "Densidade herbicida";
|
||||||
//
|
//
|
||||||
|
|
@ -647,7 +659,7 @@
|
||||||
//
|
//
|
||||||
this.nudCapacidadereservatorio.Location = new System.Drawing.Point(18, 55);
|
this.nudCapacidadereservatorio.Location = new System.Drawing.Point(18, 55);
|
||||||
this.nudCapacidadereservatorio.Name = "nudCapacidadereservatorio";
|
this.nudCapacidadereservatorio.Name = "nudCapacidadereservatorio";
|
||||||
this.nudCapacidadereservatorio.Size = new System.Drawing.Size(73, 34);
|
this.nudCapacidadereservatorio.Size = new System.Drawing.Size(73, 29);
|
||||||
this.nudCapacidadereservatorio.TabIndex = 11;
|
this.nudCapacidadereservatorio.TabIndex = 11;
|
||||||
this.nudCapacidadereservatorio.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.nudCapacidadereservatorio.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
//
|
//
|
||||||
|
|
@ -657,7 +669,7 @@
|
||||||
this.lblUnCapcaidadereservatorio.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblUnCapcaidadereservatorio.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblUnCapcaidadereservatorio.Location = new System.Drawing.Point(97, 57);
|
this.lblUnCapcaidadereservatorio.Location = new System.Drawing.Point(97, 57);
|
||||||
this.lblUnCapcaidadereservatorio.Name = "lblUnCapcaidadereservatorio";
|
this.lblUnCapcaidadereservatorio.Name = "lblUnCapcaidadereservatorio";
|
||||||
this.lblUnCapcaidadereservatorio.Size = new System.Drawing.Size(52, 25);
|
this.lblUnCapcaidadereservatorio.Size = new System.Drawing.Size(42, 20);
|
||||||
this.lblUnCapcaidadereservatorio.TabIndex = 10;
|
this.lblUnCapcaidadereservatorio.TabIndex = 10;
|
||||||
this.lblUnCapcaidadereservatorio.Text = "litros";
|
this.lblUnCapcaidadereservatorio.Text = "litros";
|
||||||
//
|
//
|
||||||
|
|
@ -667,23 +679,24 @@
|
||||||
this.lblCapacidadereservatorio.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblCapacidadereservatorio.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblCapacidadereservatorio.Location = new System.Drawing.Point(14, 28);
|
this.lblCapacidadereservatorio.Location = new System.Drawing.Point(14, 28);
|
||||||
this.lblCapacidadereservatorio.Name = "lblCapacidadereservatorio";
|
this.lblCapacidadereservatorio.Name = "lblCapacidadereservatorio";
|
||||||
this.lblCapacidadereservatorio.Size = new System.Drawing.Size(225, 25);
|
this.lblCapacidadereservatorio.Size = new System.Drawing.Size(181, 20);
|
||||||
this.lblCapacidadereservatorio.TabIndex = 9;
|
this.lblCapacidadereservatorio.TabIndex = 9;
|
||||||
this.lblCapacidadereservatorio.Text = "Capacidade reservatório";
|
this.lblCapacidadereservatorio.Text = "Capacidade reservatório";
|
||||||
//
|
//
|
||||||
// lblAngulomax
|
// btnA05
|
||||||
//
|
//
|
||||||
this.lblAngulomax.AutoSize = true;
|
this.btnA05.Location = new System.Drawing.Point(10, 94);
|
||||||
this.lblAngulomax.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.btnA05.Margin = new System.Windows.Forms.Padding(6);
|
||||||
this.lblAngulomax.Location = new System.Drawing.Point(6, 67);
|
this.btnA05.Name = "btnA05";
|
||||||
this.lblAngulomax.Name = "lblAngulomax";
|
this.btnA05.Size = new System.Drawing.Size(171, 28);
|
||||||
this.lblAngulomax.Size = new System.Drawing.Size(104, 22);
|
this.btnA05.TabIndex = 9;
|
||||||
this.lblAngulomax.TabIndex = 13;
|
this.btnA05.Text = "Ultrassom A05";
|
||||||
this.lblAngulomax.Text = "Angulo Máx";
|
this.btnA05.UseVisualStyleBackColor = true;
|
||||||
|
this.btnA05.Click += new System.EventHandler(this.btnA05_Click);
|
||||||
//
|
//
|
||||||
// frmParametrizacaoOperacao
|
// frmParametrizacaoOperacao
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(14F, 29F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(1022, 683);
|
this.ClientSize = new System.Drawing.Size(1022, 683);
|
||||||
this.Controls.Add(this.gpbConfiguracoesgerais);
|
this.Controls.Add(this.gpbConfiguracoesgerais);
|
||||||
|
|
@ -709,13 +722,13 @@
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudAtuarem)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudAtuarem)).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudQtdCameras)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudQtdCameras)).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudQtdBicos)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudQtdBicos)).EndInit();
|
||||||
this.gpbP_Dir.ResumeLayout(false);
|
this.gpbP_Mks.ResumeLayout(false);
|
||||||
this.gpbP_Dir.PerformLayout();
|
this.gpbP_Mks.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudAnguloMinimo)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudAnguloMinimo)).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudVelocidadeMP)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudVelocidadeMP)).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudAnguloMaximo)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudAnguloMaximo)).EndInit();
|
||||||
this.gpbP_Mov.ResumeLayout(false);
|
this.gpbP_Bld.ResumeLayout(false);
|
||||||
this.gpbP_Mov.PerformLayout();
|
this.gpbP_Bld.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudVelocidadeComErvas)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudVelocidadeComErvas)).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.nudVelocidadeSemErvas)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.nudVelocidadeSemErvas)).EndInit();
|
||||||
this.gpbConfiguracoesgerais.ResumeLayout(false);
|
this.gpbConfiguracoesgerais.ResumeLayout(false);
|
||||||
|
|
@ -734,16 +747,16 @@
|
||||||
private System.Windows.Forms.CheckBox chbD_Gps;
|
private System.Windows.Forms.CheckBox chbD_Gps;
|
||||||
private System.Windows.Forms.CheckBox chbD_Sen;
|
private System.Windows.Forms.CheckBox chbD_Sen;
|
||||||
private System.Windows.Forms.CheckBox chbD_Atu;
|
private System.Windows.Forms.CheckBox chbD_Atu;
|
||||||
private System.Windows.Forms.CheckBox chbD_Dir;
|
private System.Windows.Forms.CheckBox chbD_Mks;
|
||||||
private System.Windows.Forms.CheckBox chbD_Mov;
|
private System.Windows.Forms.CheckBox chbD_Bld;
|
||||||
private System.Windows.Forms.Button btnCarregar;
|
private System.Windows.Forms.Button btnCarregar;
|
||||||
private System.Windows.Forms.Button btnSalvar;
|
private System.Windows.Forms.Button btnSalvar;
|
||||||
private System.Windows.Forms.CheckBox chbO_Gps;
|
private System.Windows.Forms.CheckBox chbO_Gps;
|
||||||
private System.Windows.Forms.CheckBox chbO_Sen;
|
private System.Windows.Forms.CheckBox chbO_Sen;
|
||||||
private System.Windows.Forms.CheckBox chbO_Atu;
|
private System.Windows.Forms.CheckBox chbO_Atu;
|
||||||
private System.Windows.Forms.CheckBox chbO_Dir;
|
private System.Windows.Forms.CheckBox chbO_Mks;
|
||||||
private System.Windows.Forms.CheckBox chbO_Mov;
|
private System.Windows.Forms.CheckBox chbO_Bld;
|
||||||
private System.Windows.Forms.GroupBox gpbP_Mov;
|
private System.Windows.Forms.GroupBox gpbP_Bld;
|
||||||
private System.Windows.Forms.NumericUpDown nudVelocidadeComErvas;
|
private System.Windows.Forms.NumericUpDown nudVelocidadeComErvas;
|
||||||
private System.Windows.Forms.Label lblKmhCErvas;
|
private System.Windows.Forms.Label lblKmhCErvas;
|
||||||
private System.Windows.Forms.Label lblVelocidadeComErvas;
|
private System.Windows.Forms.Label lblVelocidadeComErvas;
|
||||||
|
|
@ -757,7 +770,7 @@
|
||||||
private System.Windows.Forms.Label lblQtdCameras;
|
private System.Windows.Forms.Label lblQtdCameras;
|
||||||
private System.Windows.Forms.NumericUpDown nudQtdBicos;
|
private System.Windows.Forms.NumericUpDown nudQtdBicos;
|
||||||
private System.Windows.Forms.Label lblQtdBicos;
|
private System.Windows.Forms.Label lblQtdBicos;
|
||||||
private System.Windows.Forms.GroupBox gpbP_Dir;
|
private System.Windows.Forms.GroupBox gpbP_Mks;
|
||||||
private System.Windows.Forms.NumericUpDown nudVelocidadeMP;
|
private System.Windows.Forms.NumericUpDown nudVelocidadeMP;
|
||||||
private System.Windows.Forms.Label lblVelocidadeMP;
|
private System.Windows.Forms.Label lblVelocidadeMP;
|
||||||
private System.Windows.Forms.NumericUpDown nudAnguloMaximo;
|
private System.Windows.Forms.NumericUpDown nudAnguloMaximo;
|
||||||
|
|
@ -778,5 +791,6 @@
|
||||||
private System.Windows.Forms.Label lblAtuarem;
|
private System.Windows.Forms.Label lblAtuarem;
|
||||||
private System.Windows.Forms.ComboBox cmbScriptErvas;
|
private System.Windows.Forms.ComboBox cmbScriptErvas;
|
||||||
private System.Windows.Forms.Label lblAngulomax;
|
private System.Windows.Forms.Label lblAngulomax;
|
||||||
|
private System.Windows.Forms.Button btnA05;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -160,5 +160,13 @@ namespace AgroBase.Forms.Operacoes
|
||||||
CarregarParametros();
|
CarregarParametros();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void btnA05_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var DispSen = Variaveis.OperacaoEmAndamento.DispSen;
|
||||||
|
frmA05Config frm = new frmA05Config(DispSen.Dados.ConfiguracaoSensorUltrassom);
|
||||||
|
frm.ShowDialog();
|
||||||
|
DispSen.Dados.ConfiguracaoSensorUltrassom = frm.ConfiguracaoSensores;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,30 +28,30 @@
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea10 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||||
System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
System.Windows.Forms.DataVisualization.Charting.Legend legend10 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||||
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
System.Windows.Forms.DataVisualization.Charting.Series series10 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea11 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||||
System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
System.Windows.Forms.DataVisualization.Charting.Legend legend11 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||||
System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
System.Windows.Forms.DataVisualization.Charting.Series series11 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea12 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||||
System.Windows.Forms.DataVisualization.Charting.Legend legend3 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
System.Windows.Forms.DataVisualization.Charting.Legend legend12 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||||
System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
System.Windows.Forms.DataVisualization.Charting.Series series12 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea13 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||||
System.Windows.Forms.DataVisualization.Charting.Legend legend4 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
System.Windows.Forms.DataVisualization.Charting.Legend legend13 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||||
System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
System.Windows.Forms.DataVisualization.Charting.Series series13 = 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.ChartArea chartArea9 = 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.Legend legend9 = 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.Series series9 = 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.ChartArea chartArea14 = 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.Legend legend14 = 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.Series series14 = 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.ChartArea chartArea15 = 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.Legend legend15 = 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.Series series15 = 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 chartArea16 = 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 legend16 = 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 series16 = 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();
|
||||||
|
|
@ -87,6 +87,8 @@
|
||||||
this.pnlOrientacaoGPS = new System.Windows.Forms.Panel();
|
this.pnlOrientacaoGPS = new System.Windows.Forms.Panel();
|
||||||
this.panel2 = new System.Windows.Forms.Panel();
|
this.panel2 = new System.Windows.Forms.Panel();
|
||||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||||
|
this.tabCodFalhas = new System.Windows.Forms.TabPage();
|
||||||
|
this.tvwFalhas = new System.Windows.Forms.TreeView();
|
||||||
this.tabDirecional = new System.Windows.Forms.TabPage();
|
this.tabDirecional = new System.Windows.Forms.TabPage();
|
||||||
this.txtDIR_Controlar_ET = new System.Windows.Forms.TextBox();
|
this.txtDIR_Controlar_ET = new System.Windows.Forms.TextBox();
|
||||||
this.label39 = new System.Windows.Forms.Label();
|
this.label39 = new System.Windows.Forms.Label();
|
||||||
|
|
@ -271,6 +273,8 @@
|
||||||
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.tabErvas = new System.Windows.Forms.TabPage();
|
||||||
|
this.chartErvas = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
||||||
this.tabSensoriamento = 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();
|
||||||
|
|
@ -360,9 +364,9 @@
|
||||||
this.cmbCpu_Filtro = new System.Windows.Forms.ComboBox();
|
this.cmbCpu_Filtro = new System.Windows.Forms.ComboBox();
|
||||||
this.label114 = new System.Windows.Forms.Label();
|
this.label114 = new System.Windows.Forms.Label();
|
||||||
this.chartCpu = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
this.chartCpu = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
||||||
this.tabCodFalhas = new System.Windows.Forms.TabPage();
|
|
||||||
this.tvwFalhas = new System.Windows.Forms.TreeView();
|
|
||||||
this.panel6 = new System.Windows.Forms.Panel();
|
this.panel6 = new System.Windows.Forms.Panel();
|
||||||
|
this.txtErvasTerreno = new System.Windows.Forms.TextBox();
|
||||||
|
this.label116 = new System.Windows.Forms.Label();
|
||||||
this.txtDuracaoOperacao = new System.Windows.Forms.TextBox();
|
this.txtDuracaoOperacao = new System.Windows.Forms.TextBox();
|
||||||
this.label115 = new System.Windows.Forms.Label();
|
this.label115 = new System.Windows.Forms.Label();
|
||||||
this.txtPressao = new System.Windows.Forms.TextBox();
|
this.txtPressao = new System.Windows.Forms.TextBox();
|
||||||
|
|
@ -402,10 +406,6 @@
|
||||||
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.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();
|
||||||
|
|
@ -413,6 +413,7 @@
|
||||||
this.tabMapaDinamico.SuspendLayout();
|
this.tabMapaDinamico.SuspendLayout();
|
||||||
this.panel2.SuspendLayout();
|
this.panel2.SuspendLayout();
|
||||||
this.tabControl1.SuspendLayout();
|
this.tabControl1.SuspendLayout();
|
||||||
|
this.tabCodFalhas.SuspendLayout();
|
||||||
this.tabDirecional.SuspendLayout();
|
this.tabDirecional.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.picDIR_DT)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.picDIR_DT)).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.picDIR_DF)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.picDIR_DF)).BeginInit();
|
||||||
|
|
@ -447,6 +448,8 @@
|
||||||
((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.tabErvas.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.chartErvas)).BeginInit();
|
||||||
this.tabSensoriamento.SuspendLayout();
|
this.tabSensoriamento.SuspendLayout();
|
||||||
this.groupBox1.SuspendLayout();
|
this.groupBox1.SuspendLayout();
|
||||||
this.gpbSEN_Filtro.SuspendLayout();
|
this.gpbSEN_Filtro.SuspendLayout();
|
||||||
|
|
@ -466,11 +469,8 @@
|
||||||
this.groupBox2.SuspendLayout();
|
this.groupBox2.SuspendLayout();
|
||||||
this.gpbCpu_Filtro.SuspendLayout();
|
this.gpbCpu_Filtro.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.chartCpu)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.chartCpu)).BeginInit();
|
||||||
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
|
||||||
|
|
@ -867,6 +867,27 @@
|
||||||
this.tabControl1.Size = new System.Drawing.Size(504, 548);
|
this.tabControl1.Size = new System.Drawing.Size(504, 548);
|
||||||
this.tabControl1.TabIndex = 0;
|
this.tabControl1.TabIndex = 0;
|
||||||
//
|
//
|
||||||
|
// tabCodFalhas
|
||||||
|
//
|
||||||
|
this.tabCodFalhas.Controls.Add(this.tvwFalhas);
|
||||||
|
this.tabCodFalhas.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.tabCodFalhas.Name = "tabCodFalhas";
|
||||||
|
this.tabCodFalhas.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
this.tabCodFalhas.Size = new System.Drawing.Size(496, 522);
|
||||||
|
this.tabCodFalhas.TabIndex = 9;
|
||||||
|
this.tabCodFalhas.Text = "Código de Falhas";
|
||||||
|
this.tabCodFalhas.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// tvwFalhas
|
||||||
|
//
|
||||||
|
this.tvwFalhas.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.tvwFalhas.Location = new System.Drawing.Point(6, 6);
|
||||||
|
this.tvwFalhas.Name = "tvwFalhas";
|
||||||
|
this.tvwFalhas.Size = new System.Drawing.Size(484, 510);
|
||||||
|
this.tvwFalhas.TabIndex = 0;
|
||||||
|
//
|
||||||
// tabDirecional
|
// tabDirecional
|
||||||
//
|
//
|
||||||
this.tabDirecional.Controls.Add(this.txtDIR_Controlar_ET);
|
this.tabDirecional.Controls.Add(this.txtDIR_Controlar_ET);
|
||||||
|
|
@ -1537,17 +1558,17 @@
|
||||||
//
|
//
|
||||||
// chartMovVelocidade
|
// chartMovVelocidade
|
||||||
//
|
//
|
||||||
chartArea1.Name = "ChartArea1";
|
chartArea10.Name = "ChartArea1";
|
||||||
this.chartMovVelocidade.ChartAreas.Add(chartArea1);
|
this.chartMovVelocidade.ChartAreas.Add(chartArea10);
|
||||||
legend1.Name = "Legend1";
|
legend10.Name = "Legend1";
|
||||||
this.chartMovVelocidade.Legends.Add(legend1);
|
this.chartMovVelocidade.Legends.Add(legend10);
|
||||||
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";
|
||||||
series1.ChartArea = "ChartArea1";
|
series10.ChartArea = "ChartArea1";
|
||||||
series1.Legend = "Legend1";
|
series10.Legend = "Legend1";
|
||||||
series1.Name = "Series1";
|
series10.Name = "Series1";
|
||||||
this.chartMovVelocidade.Series.Add(series1);
|
this.chartMovVelocidade.Series.Add(series10);
|
||||||
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";
|
||||||
|
|
@ -1956,17 +1977,17 @@
|
||||||
//
|
//
|
||||||
// chartMovTemperatura
|
// chartMovTemperatura
|
||||||
//
|
//
|
||||||
chartArea2.Name = "ChartArea1";
|
chartArea11.Name = "ChartArea1";
|
||||||
this.chartMovTemperatura.ChartAreas.Add(chartArea2);
|
this.chartMovTemperatura.ChartAreas.Add(chartArea11);
|
||||||
legend2.Name = "Legend1";
|
legend11.Name = "Legend1";
|
||||||
this.chartMovTemperatura.Legends.Add(legend2);
|
this.chartMovTemperatura.Legends.Add(legend11);
|
||||||
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";
|
||||||
series2.ChartArea = "ChartArea1";
|
series11.ChartArea = "ChartArea1";
|
||||||
series2.Legend = "Legend1";
|
series11.Legend = "Legend1";
|
||||||
series2.Name = "Series1";
|
series11.Name = "Series1";
|
||||||
this.chartMovTemperatura.Series.Add(series2);
|
this.chartMovTemperatura.Series.Add(series11);
|
||||||
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";
|
||||||
|
|
@ -2374,17 +2395,17 @@
|
||||||
//
|
//
|
||||||
// chartMovTensao
|
// chartMovTensao
|
||||||
//
|
//
|
||||||
chartArea3.Name = "ChartArea1";
|
chartArea12.Name = "ChartArea1";
|
||||||
this.chartMovTensao.ChartAreas.Add(chartArea3);
|
this.chartMovTensao.ChartAreas.Add(chartArea12);
|
||||||
legend3.Name = "Legend1";
|
legend12.Name = "Legend1";
|
||||||
this.chartMovTensao.Legends.Add(legend3);
|
this.chartMovTensao.Legends.Add(legend12);
|
||||||
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";
|
||||||
series3.ChartArea = "ChartArea1";
|
series12.ChartArea = "ChartArea1";
|
||||||
series3.Legend = "Legend1";
|
series12.Legend = "Legend1";
|
||||||
series3.Name = "Series1";
|
series12.Name = "Series1";
|
||||||
this.chartMovTensao.Series.Add(series3);
|
this.chartMovTensao.Series.Add(series12);
|
||||||
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";
|
||||||
|
|
@ -2883,17 +2904,17 @@
|
||||||
//
|
//
|
||||||
// chartMovGeral
|
// chartMovGeral
|
||||||
//
|
//
|
||||||
chartArea4.Name = "ChartArea1";
|
chartArea13.Name = "ChartArea1";
|
||||||
this.chartMovGeral.ChartAreas.Add(chartArea4);
|
this.chartMovGeral.ChartAreas.Add(chartArea13);
|
||||||
legend4.Name = "Legend1";
|
legend13.Name = "Legend1";
|
||||||
this.chartMovGeral.Legends.Add(legend4);
|
this.chartMovGeral.Legends.Add(legend13);
|
||||||
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";
|
||||||
series4.ChartArea = "ChartArea1";
|
series13.ChartArea = "ChartArea1";
|
||||||
series4.Legend = "Legend1";
|
series13.Legend = "Legend1";
|
||||||
series4.Name = "Series1";
|
series13.Name = "Series1";
|
||||||
this.chartMovGeral.Series.Add(series4);
|
this.chartMovGeral.Series.Add(series13);
|
||||||
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";
|
||||||
|
|
@ -2928,17 +2949,17 @@
|
||||||
//
|
//
|
||||||
// chartAtuador
|
// chartAtuador
|
||||||
//
|
//
|
||||||
chartArea5.Name = "ChartArea1";
|
chartArea9.Name = "ChartArea1";
|
||||||
this.chartAtuador.ChartAreas.Add(chartArea5);
|
this.chartAtuador.ChartAreas.Add(chartArea9);
|
||||||
legend5.Name = "Legend1";
|
legend9.Name = "Legend1";
|
||||||
this.chartAtuador.Legends.Add(legend5);
|
this.chartAtuador.Legends.Add(legend9);
|
||||||
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";
|
||||||
series5.ChartArea = "ChartArea1";
|
series9.ChartArea = "ChartArea1";
|
||||||
series5.Legend = "Legend1";
|
series9.Legend = "Legend1";
|
||||||
series5.Name = "Series1";
|
series9.Name = "Series1";
|
||||||
this.chartAtuador.Series.Add(series5);
|
this.chartAtuador.Series.Add(series9);
|
||||||
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";
|
||||||
|
|
@ -2972,6 +2993,33 @@
|
||||||
this.picCameraSoloE.TabIndex = 1;
|
this.picCameraSoloE.TabIndex = 1;
|
||||||
this.picCameraSoloE.TabStop = false;
|
this.picCameraSoloE.TabStop = false;
|
||||||
//
|
//
|
||||||
|
// tabErvas
|
||||||
|
//
|
||||||
|
this.tabErvas.Controls.Add(this.chartErvas);
|
||||||
|
this.tabErvas.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.tabErvas.Name = "tabErvas";
|
||||||
|
this.tabErvas.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
this.tabErvas.Size = new System.Drawing.Size(496, 522);
|
||||||
|
this.tabErvas.TabIndex = 10;
|
||||||
|
this.tabErvas.Text = "Ervas Identificadas";
|
||||||
|
this.tabErvas.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// chartErvas
|
||||||
|
//
|
||||||
|
chartArea14.Name = "ChartArea1";
|
||||||
|
this.chartErvas.ChartAreas.Add(chartArea14);
|
||||||
|
legend14.Name = "Legend1";
|
||||||
|
this.chartErvas.Legends.Add(legend14);
|
||||||
|
this.chartErvas.Location = new System.Drawing.Point(6, 6);
|
||||||
|
this.chartErvas.Name = "chartErvas";
|
||||||
|
series14.ChartArea = "ChartArea1";
|
||||||
|
series14.Legend = "Legend1";
|
||||||
|
series14.Name = "Series1";
|
||||||
|
this.chartErvas.Series.Add(series14);
|
||||||
|
this.chartErvas.Size = new System.Drawing.Size(484, 510);
|
||||||
|
this.chartErvas.TabIndex = 0;
|
||||||
|
this.chartErvas.Text = "chart1";
|
||||||
|
//
|
||||||
// tabSensoriamento
|
// tabSensoriamento
|
||||||
//
|
//
|
||||||
this.tabSensoriamento.Controls.Add(this.groupBox1);
|
this.tabSensoriamento.Controls.Add(this.groupBox1);
|
||||||
|
|
@ -3230,17 +3278,17 @@
|
||||||
//
|
//
|
||||||
// chartSensoriamento
|
// chartSensoriamento
|
||||||
//
|
//
|
||||||
chartArea6.Name = "ChartArea1";
|
chartArea15.Name = "ChartArea1";
|
||||||
this.chartSensoriamento.ChartAreas.Add(chartArea6);
|
this.chartSensoriamento.ChartAreas.Add(chartArea15);
|
||||||
legend6.Name = "Legend1";
|
legend15.Name = "Legend1";
|
||||||
this.chartSensoriamento.Legends.Add(legend6);
|
this.chartSensoriamento.Legends.Add(legend15);
|
||||||
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";
|
||||||
series6.ChartArea = "ChartArea1";
|
series15.ChartArea = "ChartArea1";
|
||||||
series6.Legend = "Legend1";
|
series15.Legend = "Legend1";
|
||||||
series6.Name = "Series1";
|
series15.Name = "Series1";
|
||||||
this.chartSensoriamento.Series.Add(series6);
|
this.chartSensoriamento.Series.Add(series15);
|
||||||
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";
|
||||||
|
|
@ -3938,42 +3986,21 @@
|
||||||
//
|
//
|
||||||
// chartCpu
|
// chartCpu
|
||||||
//
|
//
|
||||||
chartArea7.Name = "ChartArea1";
|
chartArea16.Name = "ChartArea1";
|
||||||
this.chartCpu.ChartAreas.Add(chartArea7);
|
this.chartCpu.ChartAreas.Add(chartArea16);
|
||||||
legend7.Name = "Legend1";
|
legend16.Name = "Legend1";
|
||||||
this.chartCpu.Legends.Add(legend7);
|
this.chartCpu.Legends.Add(legend16);
|
||||||
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";
|
||||||
series7.ChartArea = "ChartArea1";
|
series16.ChartArea = "ChartArea1";
|
||||||
series7.Legend = "Legend1";
|
series16.Legend = "Legend1";
|
||||||
series7.Name = "Series1";
|
series16.Name = "Series1";
|
||||||
this.chartCpu.Series.Add(series7);
|
this.chartCpu.Series.Add(series16);
|
||||||
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";
|
||||||
//
|
//
|
||||||
// tabCodFalhas
|
|
||||||
//
|
|
||||||
this.tabCodFalhas.Controls.Add(this.tvwFalhas);
|
|
||||||
this.tabCodFalhas.Location = new System.Drawing.Point(4, 22);
|
|
||||||
this.tabCodFalhas.Name = "tabCodFalhas";
|
|
||||||
this.tabCodFalhas.Padding = new System.Windows.Forms.Padding(3);
|
|
||||||
this.tabCodFalhas.Size = new System.Drawing.Size(496, 522);
|
|
||||||
this.tabCodFalhas.TabIndex = 9;
|
|
||||||
this.tabCodFalhas.Text = "Código de Falhas";
|
|
||||||
this.tabCodFalhas.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// tvwFalhas
|
|
||||||
//
|
|
||||||
this.tvwFalhas.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
|
||||||
| System.Windows.Forms.AnchorStyles.Left)
|
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
|
||||||
this.tvwFalhas.Location = new System.Drawing.Point(6, 6);
|
|
||||||
this.tvwFalhas.Name = "tvwFalhas";
|
|
||||||
this.tvwFalhas.Size = new System.Drawing.Size(484, 510);
|
|
||||||
this.tvwFalhas.TabIndex = 0;
|
|
||||||
//
|
|
||||||
// panel6
|
// panel6
|
||||||
//
|
//
|
||||||
this.panel6.Controls.Add(this.txtErvasTerreno);
|
this.panel6.Controls.Add(this.txtErvasTerreno);
|
||||||
|
|
@ -4019,6 +4046,26 @@
|
||||||
this.panel6.Size = new System.Drawing.Size(368, 554);
|
this.panel6.Size = new System.Drawing.Size(368, 554);
|
||||||
this.panel6.TabIndex = 3;
|
this.panel6.TabIndex = 3;
|
||||||
//
|
//
|
||||||
|
// 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 (%)";
|
||||||
|
//
|
||||||
// txtDuracaoOperacao
|
// txtDuracaoOperacao
|
||||||
//
|
//
|
||||||
this.txtDuracaoOperacao.Location = new System.Drawing.Point(126, 459);
|
this.txtDuracaoOperacao.Location = new System.Drawing.Point(126, 459);
|
||||||
|
|
@ -4406,53 +4453,6 @@
|
||||||
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);
|
||||||
//
|
//
|
||||||
// tabErvas
|
|
||||||
//
|
|
||||||
this.tabErvas.Controls.Add(this.chartErvas);
|
|
||||||
this.tabErvas.Location = new System.Drawing.Point(4, 22);
|
|
||||||
this.tabErvas.Name = "tabErvas";
|
|
||||||
this.tabErvas.Padding = new System.Windows.Forms.Padding(3);
|
|
||||||
this.tabErvas.Size = new System.Drawing.Size(496, 522);
|
|
||||||
this.tabErvas.TabIndex = 10;
|
|
||||||
this.tabErvas.Text = "Ervas Identificadas";
|
|
||||||
this.tabErvas.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// 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
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
|
@ -4479,6 +4479,7 @@
|
||||||
this.tabMapaDinamico.ResumeLayout(false);
|
this.tabMapaDinamico.ResumeLayout(false);
|
||||||
this.panel2.ResumeLayout(false);
|
this.panel2.ResumeLayout(false);
|
||||||
this.tabControl1.ResumeLayout(false);
|
this.tabControl1.ResumeLayout(false);
|
||||||
|
this.tabCodFalhas.ResumeLayout(false);
|
||||||
this.tabDirecional.ResumeLayout(false);
|
this.tabDirecional.ResumeLayout(false);
|
||||||
this.tabDirecional.PerformLayout();
|
this.tabDirecional.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.picDIR_DT)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.picDIR_DT)).EndInit();
|
||||||
|
|
@ -4530,6 +4531,8 @@
|
||||||
((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.tabErvas.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.chartErvas)).EndInit();
|
||||||
this.tabSensoriamento.ResumeLayout(false);
|
this.tabSensoriamento.ResumeLayout(false);
|
||||||
this.groupBox1.ResumeLayout(false);
|
this.groupBox1.ResumeLayout(false);
|
||||||
this.groupBox1.PerformLayout();
|
this.groupBox1.PerformLayout();
|
||||||
|
|
@ -4556,12 +4559,9 @@
|
||||||
this.gpbCpu_Filtro.ResumeLayout(false);
|
this.gpbCpu_Filtro.ResumeLayout(false);
|
||||||
this.gpbCpu_Filtro.PerformLayout();
|
this.gpbCpu_Filtro.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.chartCpu)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.chartCpu)).EndInit();
|
||||||
this.tabCodFalhas.ResumeLayout(false);
|
|
||||||
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();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
using AgroBase.Models;
|
using AgroBase.Models;
|
||||||
|
using AgroBase.Models.Modules;
|
||||||
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;
|
||||||
|
|
@ -948,14 +948,9 @@ namespace AgroBase.Forms.Operacoes
|
||||||
graficoAtu.AtualizarDados(idxMomentoAtual);
|
graficoAtu.AtualizarDados(idxMomentoAtual);
|
||||||
graficoErvas.AtualizarDados(idxMomentoAtual);
|
graficoErvas.AtualizarDados(idxMomentoAtual);
|
||||||
|
|
||||||
FuncoesGlobais.PreencheValorProgressBar(pgbPercentualReservatorio, LogsAtuador[idxMomentoAtual].PercentualReservatorio);
|
|
||||||
|
|
||||||
pnlAtuadores.Invalidate();
|
pnlAtuadores.Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void AtualizarInformacoesSensoriamento()
|
private void AtualizarInformacoesSensoriamento()
|
||||||
{
|
{
|
||||||
graficoSen.AtualizarDados(idxMomentoAtual);
|
graficoSen.AtualizarDados(idxMomentoAtual);
|
||||||
|
|
@ -1115,72 +1110,7 @@ namespace AgroBase.Forms.Operacoes
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Graphics g = e.Graphics;
|
AtuadorFuncoesGerais.DesenharAtuadores(pnlAtuadores, e, Log.Bicos, Log.BombaLigada, Log.PressaoLinha, Log.TempoPulverizadorAtuado);
|
||||||
Panel myPanel = (Panel)sender;
|
|
||||||
int panelWidth = myPanel.Width;
|
|
||||||
int circleDiameter = 40; // Diâmetro dos círculos grandes
|
|
||||||
int smallCircleDiameter = circleDiameter / 2; // Diâmetro dos círculos pequenos
|
|
||||||
int spaceBetweenCircles = (panelWidth - (circleDiameter * Log.QuantidadeBicos)) / (Log.QuantidadeBicos + 1);
|
|
||||||
int yPosition = (myPanel.Height - circleDiameter) / 3; // Centralizado verticalmente
|
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < Log.QuantidadeBicos; i++)
|
|
||||||
{
|
|
||||||
// Calcula a posição x do círculo
|
|
||||||
int xPosition = spaceBetweenCircles + (i * (circleDiameter + spaceBetweenCircles));
|
|
||||||
// Desenha o contorno do círculo
|
|
||||||
g.DrawEllipse(Pens.Red, xPosition, yPosition, circleDiameter, circleDiameter);
|
|
||||||
// Se o bico estiver aceso, preenche o círculo
|
|
||||||
if (Log.Bicos[i].Atuado)
|
|
||||||
{
|
|
||||||
g.FillEllipse(Brushes.Red, xPosition, yPosition, circleDiameter, circleDiameter);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define a string que representa o número do bico
|
|
||||||
string bicoNumero = Log.Bicos[i].ID;
|
|
||||||
// Define a fonte para o texto
|
|
||||||
Font font = new Font("Arial", 10, FontStyle.Bold);
|
|
||||||
// Mede o tamanho do texto
|
|
||||||
SizeF stringSize = g.MeasureString(bicoNumero, font);
|
|
||||||
// Calcula as posições x e y para centralizar o texto no círculo
|
|
||||||
float textXPosition = xPosition + (circleDiameter - stringSize.Width) / 2;
|
|
||||||
float textYPosition = yPosition + (circleDiameter - stringSize.Height) / 2;
|
|
||||||
// Desenha o número do bico
|
|
||||||
g.DrawString(bicoNumero, font, Brushes.Black, textXPosition, textYPosition);
|
|
||||||
|
|
||||||
|
|
||||||
// Define a string que representa a atuacao do bico
|
|
||||||
string bicoAtuacao = Log.Bicos[i].Atuacoes.ToString("000");
|
|
||||||
// Define a fonte para o texto
|
|
||||||
Font fontA = new Font("Arial", 8, FontStyle.Bold);
|
|
||||||
// Mede o tamanho do texto
|
|
||||||
SizeF stringSizeA = g.MeasureString(bicoAtuacao, fontA);
|
|
||||||
// Calcula as posições x e y para centralizar o texto no círculo
|
|
||||||
float textXPositionA = xPosition + (circleDiameter - stringSizeA.Width) / 2;
|
|
||||||
float textYPositionA = circleDiameter + yPosition + 5;
|
|
||||||
// Desenha as atuacoes do bico
|
|
||||||
g.DrawString(bicoAtuacao, fontA, Brushes.Black, textXPositionA, textYPositionA);
|
|
||||||
|
|
||||||
|
|
||||||
// Calcula a posição x e y do círculo pequeno
|
|
||||||
int smallCircleXPosition = Convert.ToInt32(xPosition + circleDiameter - smallCircleDiameter / 1.3);
|
|
||||||
int smallCircleYPosition = Convert.ToInt32(yPosition + circleDiameter - smallCircleDiameter / 1.3);
|
|
||||||
|
|
||||||
// Define a cor de contorno e preenchimento para o círculo pequeno
|
|
||||||
Pen smallCirclePen = Pens.Blue; // Cor do contorno
|
|
||||||
Brush smallCircleBrush = Brushes.Transparent; // Cor de preenchimento padrão
|
|
||||||
|
|
||||||
// Se o status do bico for true, altera a cor de preenchimento para azul
|
|
||||||
if (Log.Bicos[i].StatusBico)
|
|
||||||
{
|
|
||||||
smallCircleBrush = Brushes.Blue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Desenha o contorno do círculo pequeno
|
|
||||||
g.DrawEllipse(smallCirclePen, smallCircleXPosition, smallCircleYPosition, smallCircleDiameter, smallCircleDiameter);
|
|
||||||
// Preenche o círculo pequeno se o status do bico for true
|
|
||||||
g.FillEllipse(smallCircleBrush, smallCircleXPosition, smallCircleYPosition, smallCircleDiameter, smallCircleDiameter);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pnlInclinacao_Paint(object sender, PaintEventArgs e)
|
private void pnlInclinacao_Paint(object sender, PaintEventArgs e)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,488 @@
|
||||||
|
namespace AgroBase.Forms
|
||||||
|
{
|
||||||
|
partial class frmA05Config
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.picRobo = new System.Windows.Forms.PictureBox();
|
||||||
|
this.cmbConfiguracao = new System.Windows.Forms.ComboBox();
|
||||||
|
this.lblConfiguracao = new System.Windows.Forms.Label();
|
||||||
|
this.gpbParametros = new System.Windows.Forms.GroupBox();
|
||||||
|
this.btnSalvarSensor = new System.Windows.Forms.Button();
|
||||||
|
this.lblPosicao = new System.Windows.Forms.Label();
|
||||||
|
this.pnlParametros = new System.Windows.Forms.Panel();
|
||||||
|
this.lblMargemMaximo = new System.Windows.Forms.Label();
|
||||||
|
this.txtMargemMaximo = new System.Windows.Forms.TextBox();
|
||||||
|
this.lblMargemMinimo = new System.Windows.Forms.Label();
|
||||||
|
this.txtMargemMinimo = new System.Windows.Forms.TextBox();
|
||||||
|
this.gpbAcoes = new System.Windows.Forms.GroupBox();
|
||||||
|
this.rdbSemAcao = new System.Windows.Forms.RadioButton();
|
||||||
|
this.rdbParada = new System.Windows.Forms.RadioButton();
|
||||||
|
this.rdbDesvio = new System.Windows.Forms.RadioButton();
|
||||||
|
this.chbLimiteMinimo = new System.Windows.Forms.CheckBox();
|
||||||
|
this.txtLimiteMinimo = new System.Windows.Forms.TextBox();
|
||||||
|
this.txtLimiteMaximo = new System.Windows.Forms.TextBox();
|
||||||
|
this.chbLimiteMaximo = new System.Windows.Forms.CheckBox();
|
||||||
|
this.cmbPosicao = new System.Windows.Forms.ComboBox();
|
||||||
|
this.cmbSensor = new System.Windows.Forms.ComboBox();
|
||||||
|
this.rtbDescricao = new System.Windows.Forms.RichTextBox();
|
||||||
|
this.pnlImagem = new System.Windows.Forms.Panel();
|
||||||
|
this.pnlP_10 = new System.Windows.Forms.Panel();
|
||||||
|
this.pnlP_11 = new System.Windows.Forms.Panel();
|
||||||
|
this.pnlP_7 = new System.Windows.Forms.Panel();
|
||||||
|
this.pnlP_12 = new System.Windows.Forms.Panel();
|
||||||
|
this.pnlP_8 = new System.Windows.Forms.Panel();
|
||||||
|
this.pnlP_9 = new System.Windows.Forms.Panel();
|
||||||
|
this.pnlP_6 = new System.Windows.Forms.Panel();
|
||||||
|
this.pnlP_3 = new System.Windows.Forms.Panel();
|
||||||
|
this.pnlP_5 = new System.Windows.Forms.Panel();
|
||||||
|
this.pnlP_2 = new System.Windows.Forms.Panel();
|
||||||
|
this.pnlP_4 = new System.Windows.Forms.Panel();
|
||||||
|
this.pnlP_1 = new System.Windows.Forms.Panel();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.picRobo)).BeginInit();
|
||||||
|
this.gpbParametros.SuspendLayout();
|
||||||
|
this.pnlParametros.SuspendLayout();
|
||||||
|
this.gpbAcoes.SuspendLayout();
|
||||||
|
this.pnlImagem.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// picRobo
|
||||||
|
//
|
||||||
|
this.picRobo.Image = global::AgroBase.Properties.Resources.robo_superior;
|
||||||
|
this.picRobo.Location = new System.Drawing.Point(3, 3);
|
||||||
|
this.picRobo.Name = "picRobo";
|
||||||
|
this.picRobo.Size = new System.Drawing.Size(483, 606);
|
||||||
|
this.picRobo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||||
|
this.picRobo.TabIndex = 0;
|
||||||
|
this.picRobo.TabStop = false;
|
||||||
|
//
|
||||||
|
// cmbConfiguracao
|
||||||
|
//
|
||||||
|
this.cmbConfiguracao.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cmbConfiguracao.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.cmbConfiguracao.FormattingEnabled = true;
|
||||||
|
this.cmbConfiguracao.Location = new System.Drawing.Point(85, 12);
|
||||||
|
this.cmbConfiguracao.Name = "cmbConfiguracao";
|
||||||
|
this.cmbConfiguracao.Size = new System.Drawing.Size(154, 26);
|
||||||
|
this.cmbConfiguracao.TabIndex = 1;
|
||||||
|
this.cmbConfiguracao.SelectedIndexChanged += new System.EventHandler(this.cmbConfiguracao_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// lblConfiguracao
|
||||||
|
//
|
||||||
|
this.lblConfiguracao.AutoSize = true;
|
||||||
|
this.lblConfiguracao.Location = new System.Drawing.Point(9, 19);
|
||||||
|
this.lblConfiguracao.Name = "lblConfiguracao";
|
||||||
|
this.lblConfiguracao.Size = new System.Drawing.Size(70, 13);
|
||||||
|
this.lblConfiguracao.TabIndex = 2;
|
||||||
|
this.lblConfiguracao.Text = "Configuração";
|
||||||
|
//
|
||||||
|
// gpbParametros
|
||||||
|
//
|
||||||
|
this.gpbParametros.Controls.Add(this.btnSalvarSensor);
|
||||||
|
this.gpbParametros.Controls.Add(this.lblPosicao);
|
||||||
|
this.gpbParametros.Controls.Add(this.pnlParametros);
|
||||||
|
this.gpbParametros.Controls.Add(this.cmbPosicao);
|
||||||
|
this.gpbParametros.Controls.Add(this.cmbSensor);
|
||||||
|
this.gpbParametros.Location = new System.Drawing.Point(12, 242);
|
||||||
|
this.gpbParametros.Name = "gpbParametros";
|
||||||
|
this.gpbParametros.Size = new System.Drawing.Size(227, 259);
|
||||||
|
this.gpbParametros.TabIndex = 2;
|
||||||
|
this.gpbParametros.TabStop = false;
|
||||||
|
this.gpbParametros.Text = "Parametrização";
|
||||||
|
//
|
||||||
|
// btnSalvarSensor
|
||||||
|
//
|
||||||
|
this.btnSalvarSensor.Location = new System.Drawing.Point(146, 17);
|
||||||
|
this.btnSalvarSensor.Name = "btnSalvarSensor";
|
||||||
|
this.btnSalvarSensor.Size = new System.Drawing.Size(75, 32);
|
||||||
|
this.btnSalvarSensor.TabIndex = 19;
|
||||||
|
this.btnSalvarSensor.Text = "Salvar";
|
||||||
|
this.btnSalvarSensor.UseVisualStyleBackColor = true;
|
||||||
|
this.btnSalvarSensor.Click += new System.EventHandler(this.btnSalvarSensor_Click);
|
||||||
|
//
|
||||||
|
// lblPosicao
|
||||||
|
//
|
||||||
|
this.lblPosicao.AutoSize = true;
|
||||||
|
this.lblPosicao.Location = new System.Drawing.Point(11, 62);
|
||||||
|
this.lblPosicao.Name = "lblPosicao";
|
||||||
|
this.lblPosicao.Size = new System.Drawing.Size(45, 13);
|
||||||
|
this.lblPosicao.TabIndex = 19;
|
||||||
|
this.lblPosicao.Text = "Posição";
|
||||||
|
//
|
||||||
|
// pnlParametros
|
||||||
|
//
|
||||||
|
this.pnlParametros.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.pnlParametros.AutoScroll = true;
|
||||||
|
this.pnlParametros.Controls.Add(this.lblMargemMaximo);
|
||||||
|
this.pnlParametros.Controls.Add(this.txtMargemMaximo);
|
||||||
|
this.pnlParametros.Controls.Add(this.lblMargemMinimo);
|
||||||
|
this.pnlParametros.Controls.Add(this.txtMargemMinimo);
|
||||||
|
this.pnlParametros.Controls.Add(this.gpbAcoes);
|
||||||
|
this.pnlParametros.Controls.Add(this.chbLimiteMinimo);
|
||||||
|
this.pnlParametros.Controls.Add(this.txtLimiteMinimo);
|
||||||
|
this.pnlParametros.Controls.Add(this.txtLimiteMaximo);
|
||||||
|
this.pnlParametros.Controls.Add(this.chbLimiteMaximo);
|
||||||
|
this.pnlParametros.Location = new System.Drawing.Point(6, 87);
|
||||||
|
this.pnlParametros.Name = "pnlParametros";
|
||||||
|
this.pnlParametros.Size = new System.Drawing.Size(215, 166);
|
||||||
|
this.pnlParametros.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// lblMargemMaximo
|
||||||
|
//
|
||||||
|
this.lblMargemMaximo.AutoSize = true;
|
||||||
|
this.lblMargemMaximo.Location = new System.Drawing.Point(5, 88);
|
||||||
|
this.lblMargemMaximo.Name = "lblMargemMaximo";
|
||||||
|
this.lblMargemMaximo.Size = new System.Drawing.Size(98, 13);
|
||||||
|
this.lblMargemMaximo.TabIndex = 11;
|
||||||
|
this.lblMargemMaximo.Text = "Margem de máximo";
|
||||||
|
//
|
||||||
|
// txtMargemMaximo
|
||||||
|
//
|
||||||
|
this.txtMargemMaximo.Enabled = false;
|
||||||
|
this.txtMargemMaximo.Location = new System.Drawing.Point(126, 85);
|
||||||
|
this.txtMargemMaximo.Name = "txtMargemMaximo";
|
||||||
|
this.txtMargemMaximo.Size = new System.Drawing.Size(80, 20);
|
||||||
|
this.txtMargemMaximo.TabIndex = 12;
|
||||||
|
this.txtMargemMaximo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
|
//
|
||||||
|
// lblMargemMinimo
|
||||||
|
//
|
||||||
|
this.lblMargemMinimo.AutoSize = true;
|
||||||
|
this.lblMargemMinimo.Location = new System.Drawing.Point(5, 36);
|
||||||
|
this.lblMargemMinimo.Name = "lblMargemMinimo";
|
||||||
|
this.lblMargemMinimo.Size = new System.Drawing.Size(97, 13);
|
||||||
|
this.lblMargemMinimo.TabIndex = 7;
|
||||||
|
this.lblMargemMinimo.Text = "Margem de mínimo";
|
||||||
|
//
|
||||||
|
// txtMargemMinimo
|
||||||
|
//
|
||||||
|
this.txtMargemMinimo.Enabled = false;
|
||||||
|
this.txtMargemMinimo.Location = new System.Drawing.Point(126, 33);
|
||||||
|
this.txtMargemMinimo.Name = "txtMargemMinimo";
|
||||||
|
this.txtMargemMinimo.Size = new System.Drawing.Size(80, 20);
|
||||||
|
this.txtMargemMinimo.TabIndex = 8;
|
||||||
|
this.txtMargemMinimo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
|
//
|
||||||
|
// gpbAcoes
|
||||||
|
//
|
||||||
|
this.gpbAcoes.Controls.Add(this.rdbSemAcao);
|
||||||
|
this.gpbAcoes.Controls.Add(this.rdbParada);
|
||||||
|
this.gpbAcoes.Controls.Add(this.rdbDesvio);
|
||||||
|
this.gpbAcoes.Location = new System.Drawing.Point(8, 111);
|
||||||
|
this.gpbAcoes.Name = "gpbAcoes";
|
||||||
|
this.gpbAcoes.Size = new System.Drawing.Size(198, 46);
|
||||||
|
this.gpbAcoes.TabIndex = 13;
|
||||||
|
this.gpbAcoes.TabStop = false;
|
||||||
|
this.gpbAcoes.Text = "Ação";
|
||||||
|
//
|
||||||
|
// rdbSemAcao
|
||||||
|
//
|
||||||
|
this.rdbSemAcao.AutoSize = true;
|
||||||
|
this.rdbSemAcao.Checked = true;
|
||||||
|
this.rdbSemAcao.Location = new System.Drawing.Point(124, 19);
|
||||||
|
this.rdbSemAcao.Name = "rdbSemAcao";
|
||||||
|
this.rdbSemAcao.Size = new System.Drawing.Size(73, 17);
|
||||||
|
this.rdbSemAcao.TabIndex = 16;
|
||||||
|
this.rdbSemAcao.TabStop = true;
|
||||||
|
this.rdbSemAcao.Text = "Sem ação";
|
||||||
|
this.rdbSemAcao.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// rdbParada
|
||||||
|
//
|
||||||
|
this.rdbParada.AutoSize = true;
|
||||||
|
this.rdbParada.Location = new System.Drawing.Point(63, 19);
|
||||||
|
this.rdbParada.Name = "rdbParada";
|
||||||
|
this.rdbParada.Size = new System.Drawing.Size(59, 17);
|
||||||
|
this.rdbParada.TabIndex = 15;
|
||||||
|
this.rdbParada.Text = "Parada";
|
||||||
|
this.rdbParada.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// rdbDesvio
|
||||||
|
//
|
||||||
|
this.rdbDesvio.AutoSize = true;
|
||||||
|
this.rdbDesvio.Location = new System.Drawing.Point(5, 19);
|
||||||
|
this.rdbDesvio.Name = "rdbDesvio";
|
||||||
|
this.rdbDesvio.Size = new System.Drawing.Size(58, 17);
|
||||||
|
this.rdbDesvio.TabIndex = 14;
|
||||||
|
this.rdbDesvio.Text = "Desvio";
|
||||||
|
this.rdbDesvio.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// chbLimiteMinimo
|
||||||
|
//
|
||||||
|
this.chbLimiteMinimo.AutoSize = true;
|
||||||
|
this.chbLimiteMinimo.Location = new System.Drawing.Point(8, 9);
|
||||||
|
this.chbLimiteMinimo.Name = "chbLimiteMinimo";
|
||||||
|
this.chbLimiteMinimo.Size = new System.Drawing.Size(105, 17);
|
||||||
|
this.chbLimiteMinimo.TabIndex = 5;
|
||||||
|
this.chbLimiteMinimo.Text = "Limite de mínimo";
|
||||||
|
this.chbLimiteMinimo.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// txtLimiteMinimo
|
||||||
|
//
|
||||||
|
this.txtLimiteMinimo.Enabled = false;
|
||||||
|
this.txtLimiteMinimo.Location = new System.Drawing.Point(126, 7);
|
||||||
|
this.txtLimiteMinimo.Name = "txtLimiteMinimo";
|
||||||
|
this.txtLimiteMinimo.Size = new System.Drawing.Size(80, 20);
|
||||||
|
this.txtLimiteMinimo.TabIndex = 6;
|
||||||
|
this.txtLimiteMinimo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
|
//
|
||||||
|
// txtLimiteMaximo
|
||||||
|
//
|
||||||
|
this.txtLimiteMaximo.Enabled = false;
|
||||||
|
this.txtLimiteMaximo.Location = new System.Drawing.Point(125, 59);
|
||||||
|
this.txtLimiteMaximo.Name = "txtLimiteMaximo";
|
||||||
|
this.txtLimiteMaximo.Size = new System.Drawing.Size(80, 20);
|
||||||
|
this.txtLimiteMaximo.TabIndex = 10;
|
||||||
|
this.txtLimiteMaximo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
|
//
|
||||||
|
// chbLimiteMaximo
|
||||||
|
//
|
||||||
|
this.chbLimiteMaximo.AutoSize = true;
|
||||||
|
this.chbLimiteMaximo.Location = new System.Drawing.Point(8, 61);
|
||||||
|
this.chbLimiteMaximo.Name = "chbLimiteMaximo";
|
||||||
|
this.chbLimiteMaximo.Size = new System.Drawing.Size(106, 17);
|
||||||
|
this.chbLimiteMaximo.TabIndex = 9;
|
||||||
|
this.chbLimiteMaximo.Text = "Limite de máximo";
|
||||||
|
this.chbLimiteMaximo.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// cmbPosicao
|
||||||
|
//
|
||||||
|
this.cmbPosicao.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cmbPosicao.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.cmbPosicao.FormattingEnabled = true;
|
||||||
|
this.cmbPosicao.Location = new System.Drawing.Point(67, 55);
|
||||||
|
this.cmbPosicao.Name = "cmbPosicao";
|
||||||
|
this.cmbPosicao.Size = new System.Drawing.Size(154, 26);
|
||||||
|
this.cmbPosicao.TabIndex = 4;
|
||||||
|
this.cmbPosicao.SelectedIndexChanged += new System.EventHandler(this.cmbPosicao_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// cmbSensor
|
||||||
|
//
|
||||||
|
this.cmbSensor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cmbSensor.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.cmbSensor.FormattingEnabled = true;
|
||||||
|
this.cmbSensor.Location = new System.Drawing.Point(6, 17);
|
||||||
|
this.cmbSensor.Name = "cmbSensor";
|
||||||
|
this.cmbSensor.Size = new System.Drawing.Size(134, 32);
|
||||||
|
this.cmbSensor.TabIndex = 3;
|
||||||
|
this.cmbSensor.SelectedIndexChanged += new System.EventHandler(this.cmbSensor_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// rtbDescricao
|
||||||
|
//
|
||||||
|
this.rtbDescricao.BackColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.rtbDescricao.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||||
|
this.rtbDescricao.Location = new System.Drawing.Point(12, 44);
|
||||||
|
this.rtbDescricao.Name = "rtbDescricao";
|
||||||
|
this.rtbDescricao.ReadOnly = true;
|
||||||
|
this.rtbDescricao.Size = new System.Drawing.Size(227, 192);
|
||||||
|
this.rtbDescricao.TabIndex = 5;
|
||||||
|
this.rtbDescricao.Text = "";
|
||||||
|
//
|
||||||
|
// pnlImagem
|
||||||
|
//
|
||||||
|
this.pnlImagem.Controls.Add(this.pnlP_10);
|
||||||
|
this.pnlImagem.Controls.Add(this.pnlP_11);
|
||||||
|
this.pnlImagem.Controls.Add(this.pnlP_7);
|
||||||
|
this.pnlImagem.Controls.Add(this.pnlP_12);
|
||||||
|
this.pnlImagem.Controls.Add(this.pnlP_8);
|
||||||
|
this.pnlImagem.Controls.Add(this.pnlP_9);
|
||||||
|
this.pnlImagem.Controls.Add(this.pnlP_6);
|
||||||
|
this.pnlImagem.Controls.Add(this.pnlP_3);
|
||||||
|
this.pnlImagem.Controls.Add(this.pnlP_5);
|
||||||
|
this.pnlImagem.Controls.Add(this.pnlP_2);
|
||||||
|
this.pnlImagem.Controls.Add(this.pnlP_4);
|
||||||
|
this.pnlImagem.Controls.Add(this.pnlP_1);
|
||||||
|
this.pnlImagem.Controls.Add(this.picRobo);
|
||||||
|
this.pnlImagem.Location = new System.Drawing.Point(245, 12);
|
||||||
|
this.pnlImagem.Name = "pnlImagem";
|
||||||
|
this.pnlImagem.Size = new System.Drawing.Size(489, 612);
|
||||||
|
this.pnlImagem.TabIndex = 18;
|
||||||
|
//
|
||||||
|
// pnlP_10
|
||||||
|
//
|
||||||
|
this.pnlP_10.BackColor = System.Drawing.Color.Red;
|
||||||
|
this.pnlP_10.Location = new System.Drawing.Point(368, 95);
|
||||||
|
this.pnlP_10.Name = "pnlP_10";
|
||||||
|
this.pnlP_10.Size = new System.Drawing.Size(30, 30);
|
||||||
|
this.pnlP_10.TabIndex = 6;
|
||||||
|
//
|
||||||
|
// pnlP_11
|
||||||
|
//
|
||||||
|
this.pnlP_11.BackColor = System.Drawing.Color.Red;
|
||||||
|
this.pnlP_11.Location = new System.Drawing.Point(368, 232);
|
||||||
|
this.pnlP_11.Name = "pnlP_11";
|
||||||
|
this.pnlP_11.Size = new System.Drawing.Size(30, 30);
|
||||||
|
this.pnlP_11.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// pnlP_7
|
||||||
|
//
|
||||||
|
this.pnlP_7.BackColor = System.Drawing.Color.Red;
|
||||||
|
this.pnlP_7.Location = new System.Drawing.Point(80, 95);
|
||||||
|
this.pnlP_7.Name = "pnlP_7";
|
||||||
|
this.pnlP_7.Size = new System.Drawing.Size(30, 30);
|
||||||
|
this.pnlP_7.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// pnlP_12
|
||||||
|
//
|
||||||
|
this.pnlP_12.BackColor = System.Drawing.Color.Red;
|
||||||
|
this.pnlP_12.Location = new System.Drawing.Point(368, 368);
|
||||||
|
this.pnlP_12.Name = "pnlP_12";
|
||||||
|
this.pnlP_12.Size = new System.Drawing.Size(30, 30);
|
||||||
|
this.pnlP_12.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// pnlP_8
|
||||||
|
//
|
||||||
|
this.pnlP_8.BackColor = System.Drawing.Color.Red;
|
||||||
|
this.pnlP_8.Location = new System.Drawing.Point(80, 232);
|
||||||
|
this.pnlP_8.Name = "pnlP_8";
|
||||||
|
this.pnlP_8.Size = new System.Drawing.Size(30, 30);
|
||||||
|
this.pnlP_8.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// pnlP_9
|
||||||
|
//
|
||||||
|
this.pnlP_9.BackColor = System.Drawing.Color.Red;
|
||||||
|
this.pnlP_9.Location = new System.Drawing.Point(80, 368);
|
||||||
|
this.pnlP_9.Name = "pnlP_9";
|
||||||
|
this.pnlP_9.Size = new System.Drawing.Size(30, 30);
|
||||||
|
this.pnlP_9.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// pnlP_6
|
||||||
|
//
|
||||||
|
this.pnlP_6.BackColor = System.Drawing.Color.Red;
|
||||||
|
this.pnlP_6.Location = new System.Drawing.Point(301, 57);
|
||||||
|
this.pnlP_6.Name = "pnlP_6";
|
||||||
|
this.pnlP_6.Size = new System.Drawing.Size(30, 30);
|
||||||
|
this.pnlP_6.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// pnlP_3
|
||||||
|
//
|
||||||
|
this.pnlP_3.BackColor = System.Drawing.Color.Red;
|
||||||
|
this.pnlP_3.Location = new System.Drawing.Point(301, 409);
|
||||||
|
this.pnlP_3.Name = "pnlP_3";
|
||||||
|
this.pnlP_3.Size = new System.Drawing.Size(30, 30);
|
||||||
|
this.pnlP_3.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// pnlP_5
|
||||||
|
//
|
||||||
|
this.pnlP_5.BackColor = System.Drawing.Color.Red;
|
||||||
|
this.pnlP_5.Location = new System.Drawing.Point(224, 57);
|
||||||
|
this.pnlP_5.Name = "pnlP_5";
|
||||||
|
this.pnlP_5.Size = new System.Drawing.Size(30, 30);
|
||||||
|
this.pnlP_5.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// pnlP_2
|
||||||
|
//
|
||||||
|
this.pnlP_2.BackColor = System.Drawing.Color.Red;
|
||||||
|
this.pnlP_2.Location = new System.Drawing.Point(224, 409);
|
||||||
|
this.pnlP_2.Name = "pnlP_2";
|
||||||
|
this.pnlP_2.Size = new System.Drawing.Size(30, 30);
|
||||||
|
this.pnlP_2.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// pnlP_4
|
||||||
|
//
|
||||||
|
this.pnlP_4.BackColor = System.Drawing.Color.Red;
|
||||||
|
this.pnlP_4.Location = new System.Drawing.Point(150, 57);
|
||||||
|
this.pnlP_4.Name = "pnlP_4";
|
||||||
|
this.pnlP_4.Size = new System.Drawing.Size(30, 30);
|
||||||
|
this.pnlP_4.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// pnlP_1
|
||||||
|
//
|
||||||
|
this.pnlP_1.BackColor = System.Drawing.Color.Red;
|
||||||
|
this.pnlP_1.Location = new System.Drawing.Point(150, 409);
|
||||||
|
this.pnlP_1.Name = "pnlP_1";
|
||||||
|
this.pnlP_1.Size = new System.Drawing.Size(30, 30);
|
||||||
|
this.pnlP_1.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// frmA05Config
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(746, 636);
|
||||||
|
this.Controls.Add(this.pnlImagem);
|
||||||
|
this.Controls.Add(this.rtbDescricao);
|
||||||
|
this.Controls.Add(this.gpbParametros);
|
||||||
|
this.Controls.Add(this.lblConfiguracao);
|
||||||
|
this.Controls.Add(this.cmbConfiguracao);
|
||||||
|
this.Name = "frmA05Config";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "Parametrização do sensor ultrassonico";
|
||||||
|
this.Load += new System.EventHandler(this.frmA05Config_Load);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.picRobo)).EndInit();
|
||||||
|
this.gpbParametros.ResumeLayout(false);
|
||||||
|
this.gpbParametros.PerformLayout();
|
||||||
|
this.pnlParametros.ResumeLayout(false);
|
||||||
|
this.pnlParametros.PerformLayout();
|
||||||
|
this.gpbAcoes.ResumeLayout(false);
|
||||||
|
this.gpbAcoes.PerformLayout();
|
||||||
|
this.pnlImagem.ResumeLayout(false);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.PictureBox picRobo;
|
||||||
|
private System.Windows.Forms.ComboBox cmbConfiguracao;
|
||||||
|
private System.Windows.Forms.Label lblConfiguracao;
|
||||||
|
private System.Windows.Forms.GroupBox gpbParametros;
|
||||||
|
private System.Windows.Forms.CheckBox chbLimiteMaximo;
|
||||||
|
private System.Windows.Forms.CheckBox chbLimiteMinimo;
|
||||||
|
private System.Windows.Forms.TextBox txtLimiteMaximo;
|
||||||
|
private System.Windows.Forms.TextBox txtLimiteMinimo;
|
||||||
|
private System.Windows.Forms.Panel pnlParametros;
|
||||||
|
private System.Windows.Forms.GroupBox gpbAcoes;
|
||||||
|
private System.Windows.Forms.RadioButton rdbSemAcao;
|
||||||
|
private System.Windows.Forms.RadioButton rdbParada;
|
||||||
|
private System.Windows.Forms.RadioButton rdbDesvio;
|
||||||
|
private System.Windows.Forms.ComboBox cmbSensor;
|
||||||
|
private System.Windows.Forms.RichTextBox rtbDescricao;
|
||||||
|
private System.Windows.Forms.Label lblMargemMaximo;
|
||||||
|
private System.Windows.Forms.TextBox txtMargemMaximo;
|
||||||
|
private System.Windows.Forms.Label lblMargemMinimo;
|
||||||
|
private System.Windows.Forms.TextBox txtMargemMinimo;
|
||||||
|
private System.Windows.Forms.Label lblPosicao;
|
||||||
|
private System.Windows.Forms.ComboBox cmbPosicao;
|
||||||
|
private System.Windows.Forms.Panel pnlImagem;
|
||||||
|
private System.Windows.Forms.Panel pnlP_1;
|
||||||
|
private System.Windows.Forms.Panel pnlP_10;
|
||||||
|
private System.Windows.Forms.Panel pnlP_11;
|
||||||
|
private System.Windows.Forms.Panel pnlP_7;
|
||||||
|
private System.Windows.Forms.Panel pnlP_12;
|
||||||
|
private System.Windows.Forms.Panel pnlP_8;
|
||||||
|
private System.Windows.Forms.Panel pnlP_9;
|
||||||
|
private System.Windows.Forms.Panel pnlP_6;
|
||||||
|
private System.Windows.Forms.Panel pnlP_3;
|
||||||
|
private System.Windows.Forms.Panel pnlP_5;
|
||||||
|
private System.Windows.Forms.Panel pnlP_2;
|
||||||
|
private System.Windows.Forms.Panel pnlP_4;
|
||||||
|
private System.Windows.Forms.Button btnSalvarSensor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,141 @@
|
||||||
|
using AgroBase.Comum;
|
||||||
|
using AgroBase.Models;
|
||||||
|
using AgroBase.Models.Modules;
|
||||||
|
using System;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace AgroBase.Forms
|
||||||
|
{
|
||||||
|
public partial class frmA05Config : Form
|
||||||
|
{
|
||||||
|
public UltrasonicA05Configuracoes ConfiguracaoSensores = null;
|
||||||
|
|
||||||
|
public frmA05Config(UltrasonicA05Configuracoes config)
|
||||||
|
{
|
||||||
|
ConfiguracaoSensores = config;
|
||||||
|
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void frmA05Config_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
cmbPosicao.Items.Clear();
|
||||||
|
cmbPosicao.Items.AddRange(Enum.GetNames(typeof(PosicaoSensorUltrassonico)));
|
||||||
|
|
||||||
|
cmbConfiguracao.Items.Clear();
|
||||||
|
cmbConfiguracao.Items.AddRange(Enum.GetNames(typeof(ConfiguracaoSensorUltrassonico)));
|
||||||
|
cmbConfiguracao.SelectedIndex = ConfiguracaoSensores != null ? (int)ConfiguracaoSensores.Configuracao : 0;
|
||||||
|
|
||||||
|
CarregarDadosConfiguracao();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CarregarDadosConfiguracao()
|
||||||
|
{
|
||||||
|
if (ConfiguracaoSensores == null)
|
||||||
|
{
|
||||||
|
ConfiguracaoSensorUltrassonico Config = (ConfiguracaoSensorUltrassonico)cmbConfiguracao.SelectedIndex;
|
||||||
|
ConfiguracaoSensores = UltrasonicA05Helper.CarregarConfiguracaoPadrao(Config);
|
||||||
|
}
|
||||||
|
|
||||||
|
rtbDescricao.Text = UltrasonicA05Helper.DescricaoConfiguracoes[ConfiguracaoSensores.Configuracao];
|
||||||
|
|
||||||
|
cmbSensor.Items.Clear();
|
||||||
|
cmbSensor.Items.AddRange(ConfiguracaoSensores.Sensores.Select(x => "Sensor " + x.ID.ToString("00")).ToArray());
|
||||||
|
cmbSensor.SelectedIndex = 0;
|
||||||
|
|
||||||
|
cmbSensor_SelectedIndexChanged(cmbSensor, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cmbConfiguracao_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
CarregarDadosConfiguracao();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cmbSensor_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
UltrasonicA05ConfiguracoesSensor Sensor = ConfiguracaoSensores.Sensores[cmbSensor.SelectedIndex];
|
||||||
|
cmbPosicao.SelectedIndex = (int)Sensor.Posicao;
|
||||||
|
chbLimiteMinimo.Checked = Sensor.LimiteMinimo;
|
||||||
|
txtLimiteMinimo.Text = Sensor.LimiteMinimoVal.ToString();
|
||||||
|
txtLimiteMinimo.Enabled = Sensor.LimiteMinimo;
|
||||||
|
txtMargemMinimo.Text = Sensor.MargemMinimo.ToString();
|
||||||
|
txtMargemMinimo.Enabled = Sensor.LimiteMinimo;
|
||||||
|
chbLimiteMaximo.Checked = Sensor.LimiteMinimo;
|
||||||
|
txtLimiteMaximo.Text = Sensor.LimiteMaximoVal.ToString();
|
||||||
|
txtLimiteMaximo.Enabled = Sensor.LimiteMaximo;
|
||||||
|
txtMargemMaximo.Text = Sensor.MargemMaximo.ToString();
|
||||||
|
txtMargemMaximo.Enabled = Sensor.LimiteMaximo;
|
||||||
|
rdbDesvio.Checked = Sensor.Desvio;
|
||||||
|
rdbParada.Checked = Sensor.Parada;
|
||||||
|
rdbSemAcao.Checked = !Sensor.Desvio && !Sensor.Parada;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSalvar_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cmbPosicao_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
UltrasonicA05ConfiguracoesSensor Sensor = ConfiguracaoSensores.Sensores[cmbSensor.SelectedIndex];
|
||||||
|
UltrasonicA05ConfiguracoesSensor SensorPosicao = ConfiguracaoSensores.Sensores.FirstOrDefault(x => x.Posicao != PosicaoSensorUltrassonico.NaoConectado && (int)x.Posicao == cmbPosicao.SelectedIndex);
|
||||||
|
if (SensorPosicao != null && Sensor.ID != SensorPosicao.ID)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"O sensor {SensorPosicao.ID.ToString("00")} já está configurado na posição {SensorPosicao.Posicao.ToString()}!");
|
||||||
|
cmbPosicao.SelectedIndex = (int)Sensor.Posicao;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (var pnl in pnlImagem.Controls.OfType<Panel>().OrderBy(x => x.Name))
|
||||||
|
{
|
||||||
|
int id = int.Parse(pnl.Name.Replace("pnlP_", ""));
|
||||||
|
var _Sensor = ConfiguracaoSensores.Sensores.FirstOrDefault(x => (int)x.Posicao == id);
|
||||||
|
|
||||||
|
pnl.BackColor = _Sensor == null ? Color.Gray : Color.Red;
|
||||||
|
pnl.Tag = _Sensor?.ID.ToString("00"); // Armazena o ID no Tag do Panel
|
||||||
|
pnl.Paint += (s, _e) =>
|
||||||
|
{
|
||||||
|
// Pega o ID armazenado no Tag, se houver
|
||||||
|
string sensorID = pnl.Tag?.ToString();
|
||||||
|
if (!string.IsNullOrEmpty(sensorID))
|
||||||
|
{
|
||||||
|
using (Font font = new Font("Arial", 8, FontStyle.Bold))
|
||||||
|
{
|
||||||
|
SizeF textSize = _e.Graphics.MeasureString(sensorID, font);
|
||||||
|
float textX = (pnl.Width - textSize.Width) / 2;
|
||||||
|
float textY = (pnl.Height - textSize.Height) / 2;
|
||||||
|
|
||||||
|
_e.Graphics.DrawString(sensorID, font, Brushes.White, textX, textY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pnl.Invalidate(); // Redesenha o Panel para aplicar as mudanças
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSalvarSensor_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
UltrasonicA05ConfiguracoesSensor Sensor = ConfiguracaoSensores.Sensores[cmbSensor.SelectedIndex];
|
||||||
|
Sensor.Posicao = (PosicaoSensorUltrassonico)cmbPosicao.SelectedIndex;
|
||||||
|
Sensor.LimiteMinimo = chbLimiteMinimo.Checked;
|
||||||
|
Sensor.LimiteMinimoVal = double.Parse(txtLimiteMinimo.Text);
|
||||||
|
Sensor.LimiteMinimo = txtLimiteMinimo.Enabled;
|
||||||
|
Sensor.MargemMinimo = double.Parse(txtMargemMinimo.Text);
|
||||||
|
Sensor.LimiteMinimo = txtMargemMinimo.Enabled;
|
||||||
|
Sensor.LimiteMinimo = chbLimiteMaximo.Checked;
|
||||||
|
Sensor.LimiteMaximoVal = double.Parse(txtLimiteMaximo.Text);
|
||||||
|
Sensor.LimiteMaximo = txtLimiteMaximo.Enabled;
|
||||||
|
Sensor.MargemMaximo = double.Parse(txtMargemMaximo.Text);
|
||||||
|
Sensor.LimiteMaximo = txtMargemMaximo.Enabled;
|
||||||
|
Sensor.Desvio = rdbDesvio.Checked;
|
||||||
|
Sensor.Parada = rdbParada.Checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,120 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
|
|
@ -657,6 +657,11 @@ namespace AgroBase
|
||||||
|
|
||||||
public static void EnviarComandoAtuador(S_Code Componente, bool Status, string ID = "")
|
public static void EnviarComandoAtuador(S_Code Componente, bool Status, string ID = "")
|
||||||
{
|
{
|
||||||
|
if (!Variaveis.OperacaoEmAndamento.Iniciado)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var DispAtu = Variaveis.OperacaoEmAndamento.DispAtu;
|
var DispAtu = Variaveis.OperacaoEmAndamento.DispAtu;
|
||||||
|
|
||||||
switch (Componente)
|
switch (Componente)
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
using AgroBase.Services;
|
using AgroBase.Services;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
using static AgroBase.Models.Enums;
|
using static AgroBase.Models.Enums;
|
||||||
|
|
||||||
namespace AgroBase.Models.Modules
|
namespace AgroBase.Models.Modules
|
||||||
|
|
@ -110,30 +112,46 @@ namespace AgroBase.Models.Modules
|
||||||
}
|
}
|
||||||
public double VolumeVazaoML { get; set; }
|
public double VolumeVazaoML { get; set; }
|
||||||
public DateTime InicioAtuacao { get; set; } = DateTime.MinValue;
|
public DateTime InicioAtuacao { get; set; } = DateTime.MinValue;
|
||||||
public DateTime FimAtuacao { get; set; } = DateTime.MinValue;
|
|
||||||
public double TempoAtuado { get; set; } = 0;
|
public double TempoAtuado { get; set; } = 0;
|
||||||
public void InicializaTempoAtuado()
|
public void AtualizaTempoAtuadoGeral()
|
||||||
{
|
{
|
||||||
bool atuadoAnteriormente = BicosPulverizadores.Any(x => x.Atuado);
|
bool algumBicoAtivo = BicosPulverizadores.Any(x => x.Atuado);
|
||||||
if (!atuadoAnteriormente && InicioAtuacao == DateTime.MinValue)
|
|
||||||
|
if (algumBicoAtivo)
|
||||||
{
|
{
|
||||||
InicioAtuacao = DateTime.Now;
|
if (InicioAtuacao == DateTime.MinValue)
|
||||||
FimAtuacao = DateTime.MinValue;
|
{
|
||||||
|
InicioAtuacao = DateTime.Now;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TempoAtuado += (DateTime.Now - InicioAtuacao).TotalMilliseconds;
|
||||||
|
InicioAtuacao = DateTime.Now;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
else if (InicioAtuacao != DateTime.MinValue)
|
||||||
public void AtualizaTempoAtuado()
|
|
||||||
{
|
|
||||||
bool atuadoAnteriormente = BicosPulverizadores.Any(x => x.Atuado);
|
|
||||||
if (atuadoAnteriormente && FimAtuacao == DateTime.MinValue)
|
|
||||||
{
|
{
|
||||||
FimAtuacao = DateTime.Now;
|
TempoAtuado += (DateTime.Now - InicioAtuacao).TotalMilliseconds;
|
||||||
|
|
||||||
TimeSpan duracao = FimAtuacao - InicioAtuacao;
|
|
||||||
TempoAtuado += duracao.TotalMilliseconds;
|
|
||||||
|
|
||||||
InicioAtuacao = DateTime.MinValue;
|
InicioAtuacao = DateTime.MinValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AtualizaPercentualErvas();
|
||||||
}
|
}
|
||||||
|
public void AtualizaPercentualErvas()
|
||||||
|
{
|
||||||
|
double tempoTotalOperacao = Variaveis.OperacaoEmAndamento.Tempo.TotalMilliseconds;
|
||||||
|
|
||||||
|
if (tempoTotalOperacao > 0)
|
||||||
|
{
|
||||||
|
var percentual = Math.Round((TempoAtuado / tempoTotalOperacao) * 100.0, 2);
|
||||||
|
Variaveis.OperacaoEmAndamento.Sensoriamento.PercentualErvasTerreno = percentual;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Variaveis.OperacaoEmAndamento.Sensoriamento.PercentualErvasTerreno = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region PRESSAO
|
#region PRESSAO
|
||||||
|
|
@ -264,22 +282,42 @@ namespace AgroBase.Models.Modules
|
||||||
public static void LimparDados(AtuadorModel Dados)
|
public static void LimparDados(AtuadorModel Dados)
|
||||||
{
|
{
|
||||||
Dados.Conectado = false;
|
Dados.Conectado = false;
|
||||||
Dados.PressaoLinha = 0;
|
|
||||||
|
|
||||||
Dados.BicosPulverizadores.ForEach(x =>
|
Dados.BicosPulverizadores.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.Inicializado = false;
|
x.Inicializado = false;
|
||||||
x.Atuado = false;
|
|
||||||
x.StatusBico = false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Dados.Sensores.ForEach(x =>
|
Dados.Sensores.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.Inicializado = false;
|
x.Inicializado = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
Dados.BombaPressurizadora.Inicializado = false;
|
||||||
|
|
||||||
|
ReiniciarLeituras(Dados);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ReiniciarLeituras(AtuadorModel Dados)
|
||||||
|
{
|
||||||
|
Dados.PressaoLinha = 0;
|
||||||
|
|
||||||
|
Dados.BicosPulverizadores.ForEach(x =>
|
||||||
|
{
|
||||||
|
x.Atuado = false;
|
||||||
|
x.StatusBico = false;
|
||||||
|
x.Atuacoes = 0;
|
||||||
|
x.TempoAtuado = 0;
|
||||||
|
x.InicioAtuacao = DateTime.MinValue;
|
||||||
|
});
|
||||||
|
|
||||||
|
Dados.Sensores.ForEach(x =>
|
||||||
|
{
|
||||||
x.Leituras = new List<double>();
|
x.Leituras = new List<double>();
|
||||||
x.ValorMinimo = 0;
|
x.ValorMinimo = 0;
|
||||||
x.ValorMaximo = 0;
|
x.ValorMaximo = 0;
|
||||||
});
|
});
|
||||||
Dados.BombaPressurizadora.Inicializado = false;
|
|
||||||
Dados.BombaPressurizadora.Pressao = 0;
|
Dados.BombaPressurizadora.Pressao = 0;
|
||||||
Dados.BombaPressurizadora.BombaAtuada = false;
|
Dados.BombaPressurizadora.BombaAtuada = false;
|
||||||
Dados.BombaPressurizadora.Ligado = false;
|
Dados.BombaPressurizadora.Ligado = false;
|
||||||
|
|
@ -288,7 +326,6 @@ namespace AgroBase.Models.Modules
|
||||||
Dados.VolumeVazaoML = 0;
|
Dados.VolumeVazaoML = 0;
|
||||||
Dados.TempoAtuado = 0;
|
Dados.TempoAtuado = 0;
|
||||||
Dados.InicioAtuacao = DateTime.MinValue;
|
Dados.InicioAtuacao = DateTime.MinValue;
|
||||||
Dados.FimAtuacao = DateTime.MinValue;
|
|
||||||
Dados._LeituraPeriodo = 0;
|
Dados._LeituraPeriodo = 0;
|
||||||
Dados._LeituraPressao = 0;
|
Dados._LeituraPressao = 0;
|
||||||
Dados._LeituraPulsos = 0;
|
Dados._LeituraPulsos = 0;
|
||||||
|
|
@ -699,7 +736,20 @@ namespace AgroBase.Models.Modules
|
||||||
{
|
{
|
||||||
public string ID { get; set; }
|
public string ID { get; set; }
|
||||||
public int Posicao { get; set; }
|
public int Posicao { get; set; }
|
||||||
public bool Atuado { get; set; }
|
private bool _atuado;
|
||||||
|
public bool Atuado
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _atuado;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_atuado = value;
|
||||||
|
|
||||||
|
AtualizaTempoAtuado();
|
||||||
|
}
|
||||||
|
}
|
||||||
public bool Comandar { get; set; }
|
public bool Comandar { get; set; }
|
||||||
public bool Inicializado { get; set; }
|
public bool Inicializado { get; set; }
|
||||||
public bool Testando { get; set; }
|
public bool Testando { get; set; }
|
||||||
|
|
@ -736,15 +786,6 @@ namespace AgroBase.Models.Modules
|
||||||
ID + SerialService.SplitParams +
|
ID + SerialService.SplitParams +
|
||||||
(Atuado ? "1" : "0");
|
(Atuado ? "1" : "0");
|
||||||
|
|
||||||
if (Atuado)
|
|
||||||
{
|
|
||||||
Variaveis.OperacaoEmAndamento.DispAtu.Dados.InicializaTempoAtuado();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Variaveis.OperacaoEmAndamento.DispAtu.Dados.AtualizaTempoAtuado();
|
|
||||||
}
|
|
||||||
|
|
||||||
return ProtocoloBico;
|
return ProtocoloBico;
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
|
|
@ -763,6 +804,36 @@ namespace AgroBase.Models.Modules
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int Atuacoes { get; set; } = 0;
|
||||||
|
public DateTime InicioAtuacao { get; set; } = DateTime.MinValue;
|
||||||
|
public double TempoAtuado { get; set; } = 0;
|
||||||
|
private void AtualizaTempoAtuado()
|
||||||
|
{
|
||||||
|
if (_atuado)
|
||||||
|
{
|
||||||
|
if (InicioAtuacao == DateTime.MinValue)
|
||||||
|
{
|
||||||
|
InicioAtuacao = DateTime.Now;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TempoAtuado += (DateTime.Now - InicioAtuacao).TotalMilliseconds;
|
||||||
|
InicioAtuacao = DateTime.Now;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (InicioAtuacao != DateTime.MinValue)
|
||||||
|
{
|
||||||
|
TempoAtuado += (DateTime.Now - InicioAtuacao).TotalMilliseconds;
|
||||||
|
InicioAtuacao = DateTime.MinValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Variaveis.OperacaoEmAndamento.DispAtu != null)
|
||||||
|
{
|
||||||
|
Variaveis.OperacaoEmAndamento.DispAtu.Dados.AtualizaTempoAtuadoGeral();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public AtuadorBicoModel Clone()
|
public AtuadorBicoModel Clone()
|
||||||
{
|
{
|
||||||
AtuadorBicoModel clone = new AtuadorBicoModel()
|
AtuadorBicoModel clone = new AtuadorBicoModel()
|
||||||
|
|
@ -918,4 +989,116 @@ namespace AgroBase.Models.Modules
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class AtuadorFuncoesGerais
|
||||||
|
{
|
||||||
|
|
||||||
|
public static void DesenharAtuadores(object sender, PaintEventArgs e, List<AtuBicoSensoriamentoLogModel> Bicos, bool BombaLigada, double PressaoLinha, double TempoBombaAtuada)
|
||||||
|
{
|
||||||
|
Panel myPanel = (Panel)sender;
|
||||||
|
|
||||||
|
// Habilita o double buffering temporariamente
|
||||||
|
myPanel.GetType().GetProperty("DoubleBuffered",
|
||||||
|
System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)
|
||||||
|
?.SetValue(myPanel, true, null);
|
||||||
|
|
||||||
|
Graphics g = e.Graphics;
|
||||||
|
|
||||||
|
int QuantidadeBicos = Bicos.Count;
|
||||||
|
int panelWidth = myPanel.Width;
|
||||||
|
int circleDiameter = 40; // Diâmetro dos círculos grandes
|
||||||
|
int smallCircleDiameter = circleDiameter / 2; // Diâmetro dos círculos pequenos
|
||||||
|
int spaceBetweenCircles = (panelWidth - (circleDiameter * QuantidadeBicos)) / (QuantidadeBicos + 1);
|
||||||
|
int yPosition = (myPanel.Height - circleDiameter) / 3; // Centralizado verticalmente
|
||||||
|
|
||||||
|
for (int i = 0; i < QuantidadeBicos; i++)
|
||||||
|
{
|
||||||
|
int xPosition = spaceBetweenCircles + (i * (circleDiameter + spaceBetweenCircles));
|
||||||
|
|
||||||
|
// Desenha o contorno do círculo
|
||||||
|
g.DrawEllipse(Pens.Red, xPosition, yPosition, circleDiameter, circleDiameter);
|
||||||
|
|
||||||
|
// Preenche o círculo se o bico estiver aceso
|
||||||
|
if (Bicos[i].Atuado)
|
||||||
|
{
|
||||||
|
g.FillEllipse(Brushes.Red, xPosition, yPosition, circleDiameter, circleDiameter);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Número do bico
|
||||||
|
string bicoNumero = Bicos[i].ID;
|
||||||
|
Font font = new Font("Arial", 10, FontStyle.Bold);
|
||||||
|
SizeF stringSize = g.MeasureString(bicoNumero, font);
|
||||||
|
float textXPosition = xPosition + (circleDiameter - stringSize.Width) / 2;
|
||||||
|
float textYPosition = yPosition + (circleDiameter - stringSize.Height) / 2;
|
||||||
|
g.DrawString(bicoNumero, font, Brushes.Black, textXPosition, textYPosition);
|
||||||
|
|
||||||
|
// Quantidade de atuações (abaixo do círculo)
|
||||||
|
string bicoAtuacao = Bicos[i].Atuacoes.ToString("000");
|
||||||
|
Font fontA = new Font("Arial", 8, FontStyle.Bold);
|
||||||
|
SizeF stringSizeA = g.MeasureString(bicoAtuacao, fontA);
|
||||||
|
float textXPositionA = xPosition + (circleDiameter - stringSizeA.Width) / 2;
|
||||||
|
float textYPositionA = circleDiameter + yPosition + 5;
|
||||||
|
g.DrawString(bicoAtuacao, fontA, Brushes.Black, textXPositionA, textYPositionA);
|
||||||
|
|
||||||
|
// Tempo atuado em segundos (acima do círculo)
|
||||||
|
string tempoAtuadoSegundos = $"{(Bicos[i].TempoAtuado / 1000.0):0.0}s";
|
||||||
|
Font fontTempo = new Font("Arial", 7, FontStyle.Regular);
|
||||||
|
SizeF stringSizeTempo = g.MeasureString(tempoAtuadoSegundos, fontTempo);
|
||||||
|
float textXPositionTempo = xPosition + (circleDiameter - stringSizeTempo.Width) / 2;
|
||||||
|
float textYPositionTempo = yPosition - stringSizeTempo.Height - 3;
|
||||||
|
g.DrawString(tempoAtuadoSegundos, fontTempo, Brushes.Gray, textXPositionTempo, textYPositionTempo);
|
||||||
|
|
||||||
|
// Círculo pequeno de status
|
||||||
|
int smallCircleXPosition = Convert.ToInt32(xPosition + circleDiameter - smallCircleDiameter / 1.3);
|
||||||
|
int smallCircleYPosition = Convert.ToInt32(yPosition + circleDiameter - smallCircleDiameter / 1.3);
|
||||||
|
Pen smallCirclePen = Pens.Blue;
|
||||||
|
Brush smallCircleBrush = Bicos[i].StatusBico ? Brushes.Blue : Brushes.Transparent;
|
||||||
|
g.DrawEllipse(smallCirclePen, smallCircleXPosition, smallCircleYPosition, smallCircleDiameter, smallCircleDiameter);
|
||||||
|
g.FillEllipse(smallCircleBrush, smallCircleXPosition, smallCircleYPosition, smallCircleDiameter, smallCircleDiameter);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Representação da bomba hidráulica no canto inferior direito
|
||||||
|
int bombaSize = 20; // Tamanho do círculo principal da bomba
|
||||||
|
int bombaXPosition = myPanel.Width - bombaSize - 20; // 20px de margem do canto direito
|
||||||
|
int bombaYPosition = myPanel.Height - bombaSize - 20; // 20px de margem do canto inferior
|
||||||
|
|
||||||
|
// Desenha o corpo da bomba (um círculo)
|
||||||
|
g.DrawEllipse(Pens.Black, bombaXPosition, bombaYPosition, bombaSize, bombaSize);
|
||||||
|
g.FillEllipse(BombaLigada ? Brushes.Green : Brushes.Gray, bombaXPosition, bombaYPosition, bombaSize, bombaSize);
|
||||||
|
|
||||||
|
// Define o centro do círculo para ajudar no desenho das hélices
|
||||||
|
int centerX = bombaXPosition + bombaSize / 2;
|
||||||
|
int centerY = bombaYPosition + bombaSize / 2;
|
||||||
|
int heliceSize = bombaSize - 6; // Ajuste para manter as hélices dentro do círculo
|
||||||
|
|
||||||
|
// Desenha hélices no formato de arcos ou semi-círculos dentro do círculo
|
||||||
|
Pen helicePen = new Pen(Color.Black, 1);
|
||||||
|
g.DrawArc(helicePen, centerX - heliceSize / 2, centerY - heliceSize / 2, heliceSize, heliceSize, 45, 180);
|
||||||
|
g.DrawArc(helicePen, centerX - heliceSize / 2, centerY - heliceSize / 2, heliceSize, heliceSize, 225, 180);
|
||||||
|
|
||||||
|
// Desenha o "cano" da bomba (retângulo)
|
||||||
|
int tuboLargura = 5;
|
||||||
|
int tuboAltura = 15;
|
||||||
|
int tuboXPosition = bombaXPosition + bombaSize / 2 - tuboLargura / 2;
|
||||||
|
int tuboYPosition = bombaYPosition - tuboAltura;
|
||||||
|
g.FillRectangle(Brushes.Black, tuboXPosition, tuboYPosition, tuboLargura, tuboAltura);
|
||||||
|
|
||||||
|
// Texto para o tempo de atuação acima da bomba
|
||||||
|
string tempoAtuacaoTexto = $"{(TempoBombaAtuada / 1000.0):0.0}s";
|
||||||
|
Font fontTempoAtuacao = new Font("Arial", 6, FontStyle.Regular);
|
||||||
|
SizeF stringSizeTempoAtuacao = g.MeasureString(tempoAtuacaoTexto, fontTempoAtuacao);
|
||||||
|
float textXPositionTempoAtuacao = bombaXPosition + bombaSize / 2 - stringSizeTempoAtuacao.Width / 2;
|
||||||
|
float textYPositionTempoAtuacao = bombaYPosition - stringSizeTempoAtuacao.Height - 16; // 2px acima do círculo
|
||||||
|
g.DrawString(tempoAtuacaoTexto, fontTempoAtuacao, Brushes.Gray, textXPositionTempoAtuacao, textYPositionTempoAtuacao);
|
||||||
|
|
||||||
|
// Texto pequeno para a pressão ao lado da bomba
|
||||||
|
string pressaoTexto = $"{PressaoLinha:0.0} psi";
|
||||||
|
Font fontPressao = new Font("Arial", 6, FontStyle.Regular);
|
||||||
|
SizeF stringSizePressao = g.MeasureString(pressaoTexto, fontPressao);
|
||||||
|
float textXPositionPressao = bombaXPosition + bombaSize / 2 - stringSizePressao.Width / 2;
|
||||||
|
float textYPositionPressao = bombaYPosition + bombaSize + 2; // 2px abaixo do círculo
|
||||||
|
g.DrawString(pressaoTexto, fontPressao, Brushes.Black, textXPositionPressao, textYPositionPressao);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,19 @@ namespace AgroBase.Models.Modules
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void LimparDados(MovimentacaoUnificadaModel Dados)
|
public static void LimparDados(MovimentacaoUnificadaModel Dados)
|
||||||
|
{
|
||||||
|
Dados.Modulos.ForEach(x =>
|
||||||
|
{
|
||||||
|
x.MovMotor.Inicializado = false;
|
||||||
|
x.DirMotor.Inicializado = false;
|
||||||
|
|
||||||
|
x.UltimoProtocoloRecebido = DateTime.MaxValue.AddDays(-1);
|
||||||
|
});
|
||||||
|
|
||||||
|
ReiniciarLeituras(Dados);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ReiniciarLeituras(MovimentacaoUnificadaModel Dados)
|
||||||
{
|
{
|
||||||
Dados.DistanciaPercorridaParcial = 0;
|
Dados.DistanciaPercorridaParcial = 0;
|
||||||
Dados.DistanciaPercorridaTotal = 0;
|
Dados.DistanciaPercorridaTotal = 0;
|
||||||
|
|
@ -110,7 +123,6 @@ namespace AgroBase.Models.Modules
|
||||||
Dados.TempoEmAtividade = 0;
|
Dados.TempoEmAtividade = 0;
|
||||||
Dados.Modulos.ForEach(x =>
|
Dados.Modulos.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.MovMotor.Inicializado = false;
|
|
||||||
x.MovMotor.Alarme = false;
|
x.MovMotor.Alarme = false;
|
||||||
x.MovMotor.Freio = false;
|
x.MovMotor.Freio = false;
|
||||||
x.MovMotor.Ligado = false;
|
x.MovMotor.Ligado = false;
|
||||||
|
|
@ -126,9 +138,7 @@ namespace AgroBase.Models.Modules
|
||||||
x.MovMotor.CodigoAlarme = 0;
|
x.MovMotor.CodigoAlarme = 0;
|
||||||
x.MovMotor.Corrente = 0;
|
x.MovMotor.Corrente = 0;
|
||||||
x.MovMotor.Tensao = 0;
|
x.MovMotor.Tensao = 0;
|
||||||
x.UltimoProtocoloRecebido = DateTime.MaxValue.AddDays(-1);
|
|
||||||
|
|
||||||
x.DirMotor.Inicializado = false;
|
|
||||||
x.DirMotor.Angulo = 0;
|
x.DirMotor.Angulo = 0;
|
||||||
x.DirMotor.Angulo_SP = 0;
|
x.DirMotor.Angulo_SP = 0;
|
||||||
x.DirMotor.Sentido = Sentido.Parado;
|
x.DirMotor.Sentido = Sentido.Parado;
|
||||||
|
|
@ -376,10 +386,11 @@ namespace AgroBase.Models.Modules
|
||||||
if (UltimaDirecao != Direcao.Parado)
|
if (UltimaDirecao != Direcao.Parado)
|
||||||
{
|
{
|
||||||
TempoEmAtividade++;
|
TempoEmAtividade++;
|
||||||
double VelocidadeMedia = Modulos.Where(x => x.Conectado).Average(x => x.MovMotor.VelocidadeInstantanea * _TaxaAmostragem / 3600);
|
double VelocidadeMedia = Modulos.Where(x => x.Conectado).Average(x => x.MovMotor.VelocidadeInstantanea * _TaxaAmostragem / 3600.0);
|
||||||
DistanciaPercorridaTotal += 1 * VelocidadeMedia;
|
DistanciaPercorridaTotal += 1 * VelocidadeMedia;
|
||||||
DistanciaPercorridaParcial += (UltimaDirecao == Direcao.Frente ? 1 : UltimaDirecao == Direcao.Tras ? -1 : 0) * VelocidadeMedia;
|
DistanciaPercorridaParcial += (UltimaDirecao == Direcao.Frente ? 1 : UltimaDirecao == Direcao.Tras ? -1 : 0) * VelocidadeMedia;
|
||||||
DistanciaPercorridaOperacao += 1 * VelocidadeMedia;
|
DistanciaPercorridaOperacao += 1 * VelocidadeMedia;
|
||||||
|
Variaveis.OperacaoEmAndamento.Sensoriamento.VelocidadeMedia = VelocidadeMedia;
|
||||||
}
|
}
|
||||||
|
|
||||||
DateTime Agora = DateTime.Now;
|
DateTime Agora = DateTime.Now;
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ namespace AgroBase.Models.Modules
|
||||||
public List<SensorServoModel> Servos { get; set; }
|
public List<SensorServoModel> Servos { get; set; }
|
||||||
public string CameraID_Caminho { get; set; } = "";
|
public string CameraID_Caminho { get; set; } = "";
|
||||||
public List<string> CameraID_Solo { get; set; } = new List<string>();
|
public List<string> CameraID_Solo { get; set; } = new List<string>();
|
||||||
|
public UltrasonicA05Configuracoes ConfiguracaoSensorUltrassom { get; set; }
|
||||||
public double BateriaCargaConsumida { get; set; }
|
public double BateriaCargaConsumida { get; set; }
|
||||||
public LoRaParametrosModel LoRaParametrosBase { get; set; } = new LoRaParametrosModel()
|
public LoRaParametrosModel LoRaParametrosBase { get; set; } = new LoRaParametrosModel()
|
||||||
{
|
{
|
||||||
|
|
@ -438,28 +439,46 @@ namespace AgroBase.Models.Modules
|
||||||
public static void LimparDados(SensoriamentoModel Dados)
|
public static void LimparDados(SensoriamentoModel Dados)
|
||||||
{
|
{
|
||||||
Dados.Conectado = false;
|
Dados.Conectado = false;
|
||||||
Dados.BateriaCargaConsumida = 0;
|
|
||||||
Dados.Reles.ForEach(x =>
|
Dados.Reles.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.Inicializado = false;
|
x.Inicializado = false;
|
||||||
|
});
|
||||||
|
Dados.Sinaleiros.ForEach(x =>
|
||||||
|
{
|
||||||
|
x.Inicializado = false;
|
||||||
|
});
|
||||||
|
Dados.Sensores.ForEach(x =>
|
||||||
|
{
|
||||||
|
x.Inicializado = false;
|
||||||
|
});
|
||||||
|
Dados.Servos.ForEach(x =>
|
||||||
|
{
|
||||||
|
x.Inicializado = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
ReiniciarLeituras(Dados);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ReiniciarLeituras(SensoriamentoModel Dados)
|
||||||
|
{
|
||||||
|
Dados.BateriaCargaConsumida = 0;
|
||||||
|
Dados.Reles.ForEach(x =>
|
||||||
|
{
|
||||||
x.StatusLeitura = Estado.Desligado;
|
x.StatusLeitura = Estado.Desligado;
|
||||||
x.StatusControle = Estado.Desligado;
|
x.StatusControle = Estado.Desligado;
|
||||||
});
|
});
|
||||||
Dados.Sinaleiros.ForEach(x =>
|
Dados.Sinaleiros.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.Inicializado = false;
|
|
||||||
x.StatusLED = StatusLED.Apagado;
|
x.StatusLED = StatusLED.Apagado;
|
||||||
});
|
});
|
||||||
Dados.Sensores.ForEach(x =>
|
Dados.Sensores.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.Inicializado = false;
|
|
||||||
x.Leituras = new List<double>();
|
x.Leituras = new List<double>();
|
||||||
x.ValorMinimo = 0;
|
x.ValorMinimo = 0;
|
||||||
x.ValorMaximo = 0;
|
x.ValorMaximo = 0;
|
||||||
});
|
});
|
||||||
Dados.Servos.ForEach(x =>
|
Dados.Servos.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.Inicializado = false;
|
|
||||||
x._AnguloLeitura = 0;
|
x._AnguloLeitura = 0;
|
||||||
x._AnguloControle = 0;
|
x._AnguloControle = 0;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -46,12 +46,12 @@ namespace AgroBase.Models.Operacoes
|
||||||
Sensoriamento.AnguloDif = erroOrientacao;
|
Sensoriamento.AnguloDif = erroOrientacao;
|
||||||
|
|
||||||
|
|
||||||
// Calcule o erro lateral baseado nas distâncias
|
// Calcule o erro lateral baseado nas distâncias entre as ruas do mapa atraves do GPS
|
||||||
double erroLateral = statusCarroRua == StatusCarroMapa.CaminhandoRua ? Variaveis.OperacaoEmAndamento.Mapa.DistanciaEsquerda - Variaveis.OperacaoEmAndamento.Mapa.DistanciaDireita : 0;
|
double erroLateral = statusCarroRua == StatusCarroMapa.CaminhandoRua ? Variaveis.OperacaoEmAndamento.Mapa.DistanciaEsquerda - Variaveis.OperacaoEmAndamento.Mapa.DistanciaDireita : 0;
|
||||||
|
|
||||||
|
|
||||||
|
double erroUltrassom = UltrasonicA05Helper.CalcularErroUltrassons();
|
||||||
|
|
||||||
double erroCombinado = CalcularErroCombinado(erroLateral, erroOrientacao, anguloCarro, statusCarroRua);
|
double erroCombinado = CalcularErroCombinado(erroLateral, erroOrientacao, erroUltrassom, anguloCarro, statusCarroRua);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -75,7 +75,7 @@ namespace AgroBase.Models.Operacoes
|
||||||
Variaveis.OperacaoEmAndamento.Controle.Angulo = correcaoAngulo;
|
Variaveis.OperacaoEmAndamento.Controle.Angulo = correcaoAngulo;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double CalcularErroCombinado(double erroLateral, double erroOrientacao, double anguloCarro, StatusCarroMapa statusCarroRua)
|
private double CalcularErroCombinado_bkp(double erroLateral, double erroOrientacao, double anguloCarro, StatusCarroMapa statusCarroRua)
|
||||||
{
|
{
|
||||||
bool carroDentroRua = StatusDentroRua.Contains(statusCarroRua);
|
bool carroDentroRua = StatusDentroRua.Contains(statusCarroRua);
|
||||||
|
|
||||||
|
|
@ -130,6 +130,47 @@ namespace AgroBase.Models.Operacoes
|
||||||
return erroCombinado;
|
return erroCombinado;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private double CalcularErroCombinado(double erroLateral, double erroOrientacao, double erroUltrassons, double anguloCarro, StatusCarroMapa statusCarroRua)
|
||||||
|
{
|
||||||
|
bool carroDentroRua = StatusDentroRua.Contains(statusCarroRua);
|
||||||
|
|
||||||
|
// Mantém o erro lateral sempre com duas casas decimais e ajusta o multiplicador
|
||||||
|
double multiplicadorErroLateral = erroLateral < 1 ? 10 : erroLateral > 10 && erroLateral < 100 ? 0 : erroLateral > 100 ? 0.1 : 1;
|
||||||
|
double erroPosicaoLateral =
|
||||||
|
Variaveis.OperacaoEmAndamento.Mapa.TrajetoriaMapa.Count() == 1 ? 0 :
|
||||||
|
(erroLateral * (carroDentroRua ? multiplicadorErroLateral : 1));
|
||||||
|
|
||||||
|
double PesoLateralDentroRua = erroPosicaoLateral / 10;
|
||||||
|
PesoLateralDentroRua = FuncoesMatematicas.Clamp(PesoLateralDentroRua, 0, 1);
|
||||||
|
double PesoOrientacaoDentroRua = (1 - PesoLateralDentroRua) * 0.7; // 70% para a orientação principal
|
||||||
|
double PesoUltrassons = 1 - PesoOrientacaoDentroRua - PesoLateralDentroRua; // Peso restante para o ultrassom
|
||||||
|
|
||||||
|
// Calcula o erro combinado, ponderando os três erros
|
||||||
|
double erroCombinado =
|
||||||
|
(erroOrientacao * PesoOrientacaoDentroRua) +
|
||||||
|
(erroPosicaoLateral * PesoLateralDentroRua) +
|
||||||
|
(erroUltrassons * PesoUltrassons);
|
||||||
|
|
||||||
|
Direcao direcaoVirar = erroCombinado < anguloCarro ? Direcao.Esquerda : Direcao.Direita;
|
||||||
|
double erroComparar = erroCombinado < 0 ? -erroCombinado : erroCombinado;
|
||||||
|
|
||||||
|
// Aplica correções extras quando o erro é significativo e comparável com a distância à borda da rua
|
||||||
|
if (erroCombinado > 30)
|
||||||
|
{
|
||||||
|
if (direcaoVirar == Direcao.Esquerda && Variaveis.OperacaoEmAndamento.Mapa.DistanciaEsquerda > Variaveis.OperacaoEmAndamento.Mapa.DistanciaDireita)
|
||||||
|
{
|
||||||
|
erroCombinado -= 360;
|
||||||
|
}
|
||||||
|
else if (direcaoVirar == Direcao.Direita && Variaveis.OperacaoEmAndamento.Mapa.DistanciaDireita > Variaveis.OperacaoEmAndamento.Mapa.DistanciaEsquerda)
|
||||||
|
{
|
||||||
|
erroCombinado -= 360;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return erroCombinado;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void DefinirTipoMovimento(StatusCarroMapa statusCarro)
|
private void DefinirTipoMovimento(StatusCarroMapa statusCarro)
|
||||||
{
|
{
|
||||||
Variaveis.OperacaoEmAndamento.Controle.TipoMovimento = statusCarro == StatusCarroMapa.Manobrando ? TipoMovimentoDirecional.MovimentoArco : TipoMovimentoDirecional.RodasDianteiras;
|
Variaveis.OperacaoEmAndamento.Controle.TipoMovimento = statusCarro == StatusCarroMapa.Manobrando ? TipoMovimentoDirecional.MovimentoArco : TipoMovimentoDirecional.RodasDianteiras;
|
||||||
|
|
@ -248,8 +289,6 @@ namespace AgroBase.Models.Operacoes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class OperacaoRefRuaGPS
|
public class OperacaoRefRuaGPS
|
||||||
|
|
@ -451,6 +490,33 @@ namespace AgroBase.Models.Operacoes
|
||||||
public bool DentroDaRua { get; set; } = false;
|
public bool DentroDaRua { get; set; } = false;
|
||||||
public int IdxPontoAproximadoRua { get; set; } = 0;
|
public int IdxPontoAproximadoRua { get; set; } = 0;
|
||||||
public int IdxRuaAtual { get; set; } = 0;
|
public int IdxRuaAtual { get; set; } = 0;
|
||||||
|
|
||||||
|
public void ReiniciarLeituras()
|
||||||
|
{
|
||||||
|
ErvasNoRadar = 0;
|
||||||
|
HerbicidaConsumido = 0;
|
||||||
|
HerbicidaPorErva = 0;
|
||||||
|
ProgressoTrajeto = 0;
|
||||||
|
ProgressoRua = 0;
|
||||||
|
Status = StatusCarroMapa.Parado;
|
||||||
|
AnguloCarro = 0;
|
||||||
|
AnguloRua = 0;
|
||||||
|
AnguloRuaCamera = 0;
|
||||||
|
AnguloDif = 0;
|
||||||
|
Direcao = DirecaoCarroRua.Parado;
|
||||||
|
DentroDaRua = false;
|
||||||
|
IdxPontoAproximadoRua = 0;
|
||||||
|
IdxRuaAtual = 0;
|
||||||
|
|
||||||
|
AtuacoesPorBico = new List<Dictionary<string, int>>();
|
||||||
|
if (Variaveis.OperacaoEmAndamento.DispAtu != null)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < Variaveis.OperacaoEmAndamento.DispAtu.Dados.QuantidadeBicos; i++)
|
||||||
|
{
|
||||||
|
AtuacoesPorBico.Add(new Dictionary<string, int>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,54 +23,10 @@ namespace AgroBase.Models
|
||||||
public class OperacaoModel
|
public class OperacaoModel
|
||||||
{
|
{
|
||||||
|
|
||||||
public OperacaoModel(ModoOperacao Modo, DispositivosService<AtuadorModel> Atu = null)
|
public OperacaoModel(ModoOperacao Modo)
|
||||||
{
|
{
|
||||||
this.Modo = Modo;
|
this.Modo = Modo;
|
||||||
|
|
||||||
this.DispAtu = Atu;
|
|
||||||
|
|
||||||
if (Modo == ModoOperacao.MapaGPS)
|
|
||||||
{
|
|
||||||
this.Controle = new OperacaoControleModel()
|
|
||||||
{
|
|
||||||
PIDdirecional = new PIDModel(),
|
|
||||||
TiposControle = new List<OperacaoControleTipoModel>()
|
|
||||||
{
|
|
||||||
new OperacaoControleTipoModel()
|
|
||||||
{
|
|
||||||
Tipo = T_Code.Mov,
|
|
||||||
DelayEnvioComando = 500,
|
|
||||||
Comandos = new List<string>(),
|
|
||||||
UltimoComando = DateTime.Now
|
|
||||||
},
|
|
||||||
new OperacaoControleTipoModel()
|
|
||||||
{
|
|
||||||
Tipo = T_Code.Dir,
|
|
||||||
DelayEnvioComando = 1000,
|
|
||||||
Comandos = new List<string>(),
|
|
||||||
UltimoComando = DateTime.Now
|
|
||||||
},
|
|
||||||
new OperacaoControleTipoModel()
|
|
||||||
{
|
|
||||||
Tipo = T_Code.Atu,
|
|
||||||
DelayEnvioComando = 100,
|
|
||||||
Comandos = new List<string>(),
|
|
||||||
UltimoComando = DateTime.Now
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
this.ControleAnterior = new OperacaoControleModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.OpMapaGPS.Sensoriamento.AtuacoesPorBico = new List<Dictionary<string, int>>();
|
|
||||||
if (DispAtu != null)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < DispAtu.Dados.QuantidadeBicos; i++)
|
|
||||||
{
|
|
||||||
this.OpMapaGPS.Sensoriamento.AtuacoesPorBico.Add(new Dictionary<string, int>());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tmrLogs == null)
|
if (tmrLogs == null)
|
||||||
{
|
{
|
||||||
tmrLogs = new System.Timers.Timer() { Interval = 1000, Enabled = false };
|
tmrLogs = new System.Timers.Timer() { Interval = 1000, Enabled = false };
|
||||||
|
|
@ -192,6 +148,7 @@ namespace AgroBase.Models
|
||||||
_EtapaAtual = etapaAtual;
|
_EtapaAtual = etapaAtual;
|
||||||
|
|
||||||
//_EtapaAtual = StatusOperacao.EmAndamento;
|
//_EtapaAtual = StatusOperacao.EmAndamento;
|
||||||
|
Variaveis.OperacaoEmAndamento.Sensoriamento.StatusOperacao = _EtapaAtual;
|
||||||
|
|
||||||
return _EtapaAtual;
|
return _EtapaAtual;
|
||||||
}
|
}
|
||||||
|
|
@ -359,7 +316,7 @@ namespace AgroBase.Models
|
||||||
|
|
||||||
#region PARAMETRIZACAO
|
#region PARAMETRIZACAO
|
||||||
|
|
||||||
public bool SalvarParametrizacaoOperacao(string descricao, string capacidade, string pressao, string duracao, string percentual, string angulo, string velocidadeMp, string velocidadeServas, string velocidadeCervas)
|
public bool SalvarParametrizacaoOperacao(string descricao, string capacidade, string pressao, string duracao, string percentual, string angulo, string velocidadeMp, int velocidadeServasPercent, int velocidadeCervasPercent, UltrasonicA05Configuracoes ConfigUltrassom)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(descricao))
|
if (string.IsNullOrEmpty(descricao))
|
||||||
{
|
{
|
||||||
|
|
@ -373,8 +330,6 @@ namespace AgroBase.Models
|
||||||
int.TryParse(percentual, out int percentualAtuacao);
|
int.TryParse(percentual, out int percentualAtuacao);
|
||||||
int.TryParse(angulo, out int anguloMaximo);
|
int.TryParse(angulo, out int anguloMaximo);
|
||||||
int.TryParse(velocidadeMp, out int velocidadeMovimento);
|
int.TryParse(velocidadeMp, out int velocidadeMovimento);
|
||||||
double.TryParse(velocidadeServas, out double velocidadeSemErvas);
|
|
||||||
double.TryParse(velocidadeCervas, out double velocidadeComErvas);
|
|
||||||
|
|
||||||
OperacaoParametrosModel Parametros = new OperacaoParametrosModel()
|
OperacaoParametrosModel Parametros = new OperacaoParametrosModel()
|
||||||
{
|
{
|
||||||
|
|
@ -386,10 +341,11 @@ namespace AgroBase.Models
|
||||||
AtuPressaoLinha = pressaoLinha,
|
AtuPressaoLinha = pressaoLinha,
|
||||||
DirAnguloMaximo = anguloMaximo,
|
DirAnguloMaximo = anguloMaximo,
|
||||||
DirVelocidadeMovimento = velocidadeMovimento,
|
DirVelocidadeMovimento = velocidadeMovimento,
|
||||||
MovVelocidadeCErvas = velocidadeComErvas,
|
MovVelocidadeCErvasPercent = velocidadeCervasPercent,
|
||||||
MovVelocidadeSErvas = velocidadeSemErvas,
|
MovVelocidadeSErvasPercent = velocidadeServasPercent,
|
||||||
ModulosMandatorios = Variaveis.OperacaoEmAndamento.ModulosMandatorios,
|
ModulosMandatorios = Variaveis.OperacaoEmAndamento.ModulosMandatorios,
|
||||||
Mapa = Variaveis.OperacaoEmAndamento.Mapa
|
Mapa = Variaveis.OperacaoEmAndamento.Mapa,
|
||||||
|
ConfiguracaoUltrassom = ConfigUltrassom,
|
||||||
};
|
};
|
||||||
Parametros.Mapa.lblMapa = null;
|
Parametros.Mapa.lblMapa = null;
|
||||||
Parametros.Mapa.pnlMapa = null;
|
Parametros.Mapa.pnlMapa = null;
|
||||||
|
|
@ -435,8 +391,8 @@ namespace AgroBase.Models
|
||||||
|
|
||||||
OperacaoControleModel controle = new OperacaoControleModel()
|
OperacaoControleModel controle = new OperacaoControleModel()
|
||||||
{
|
{
|
||||||
RPM_Max = Convert.ToInt32(MovimentacaoModel.CalculaRPMVelocidade(Parametros.MovVelocidadeSErvas)),
|
RPM_Max = (int)(VariaveisEquipamento.RPM_Max_Roda * (Parametros.MovVelocidadeSErvasPercent / 100.0)),
|
||||||
RPM_Min = Convert.ToInt32(MovimentacaoModel.CalculaRPMVelocidade(Parametros.MovVelocidadeCErvas)),
|
RPM_Min = (int)(VariaveisEquipamento.RPM_Max_Roda * (Parametros.MovVelocidadeCErvasPercent / 100.0)),
|
||||||
Angulo_Max = Parametros.DirAnguloMaximo,
|
Angulo_Max = Parametros.DirAnguloMaximo,
|
||||||
Angulo_Min = Parametros.DirAnguloMaximo * -1,
|
Angulo_Min = Parametros.DirAnguloMaximo * -1,
|
||||||
VelocidadeMP = Parametros.DirVelocidadeMovimento,
|
VelocidadeMP = Parametros.DirVelocidadeMovimento,
|
||||||
|
|
@ -447,13 +403,18 @@ namespace AgroBase.Models
|
||||||
Direcao = Direcao.Parado,
|
Direcao = Direcao.Parado,
|
||||||
PercentualVelocidadeSP = 0,
|
PercentualVelocidadeSP = 0,
|
||||||
PIDdirecional = new PIDModel(),
|
PIDdirecional = new PIDModel(),
|
||||||
TiposControle = Variaveis.OperacaoEmAndamento.Controle.TiposControle.ToList()
|
TiposControle = Variaveis.OperacaoEmAndamento.Controle.TiposControle.ToList(),
|
||||||
};
|
};
|
||||||
|
|
||||||
Variaveis.OperacaoEmAndamento.ModulosMandatorios = Parametros.ModulosMandatorios.ToList();
|
Variaveis.OperacaoEmAndamento.ModulosMandatorios = Parametros.ModulosMandatorios.ToList();
|
||||||
Variaveis.OperacaoEmAndamento.CapacidadeReservatorio = Parametros.AtuCapacidadeReservatorio;
|
Variaveis.OperacaoEmAndamento.CapacidadeReservatorio = Parametros.AtuCapacidadeReservatorio;
|
||||||
Variaveis.OperacaoEmAndamento.Controle = controle;
|
Variaveis.OperacaoEmAndamento.Controle = controle;
|
||||||
Variaveis.OperacaoEmAndamento.Descricao = Parametros.Descricao;
|
Variaveis.OperacaoEmAndamento.Descricao = Parametros.Descricao;
|
||||||
|
if (Variaveis.OperacaoEmAndamento.DispSen == null)
|
||||||
|
{
|
||||||
|
Variaveis.OperacaoEmAndamento.DispSen = new DispositivosService<SensoriamentoModel>();
|
||||||
|
}
|
||||||
|
Variaveis.OperacaoEmAndamento.DispSen.Dados.ConfiguracaoSensorUltrassom = Parametros.ConfiguracaoUltrassom;
|
||||||
|
|
||||||
List<string> ruasSelecionadas = new List<string>();
|
List<string> ruasSelecionadas = new List<string>();
|
||||||
if (Parametros.Mapa.mapaService.DadosMapa != null)
|
if (Parametros.Mapa.mapaService.DadosMapa != null)
|
||||||
|
|
@ -494,9 +455,9 @@ namespace AgroBase.Models
|
||||||
double distanciaTrajetoria = Variaveis.OperacaoEmAndamento.Mapa.DistanciaExtraTrajetoria;
|
double distanciaTrajetoria = Variaveis.OperacaoEmAndamento.Mapa.DistanciaExtraTrajetoria;
|
||||||
|
|
||||||
// Tempo em segundos para cada parte do percurso
|
// Tempo em segundos para cada parte do percurso
|
||||||
double tempoSemErvas = distanciaSemErvas / velocidadeSemErvasMs;
|
double tempoSemErvas = velocidadeSemErvasMs > 0 ? distanciaSemErvas / velocidadeSemErvasMs : 0;
|
||||||
double tempoComErvas = distanciaComErvas / velocidadeComErvasMs;
|
double tempoComErvas = velocidadeComErvasMs > 0 ? distanciaComErvas / velocidadeComErvasMs : 0;
|
||||||
double tempoDirecionamento = distanciaTrajetoria / velocidadeTrajetoriaMs;
|
double tempoDirecionamento = velocidadeTrajetoriaMs > 0 ? distanciaTrajetoria / velocidadeTrajetoriaMs : 0;
|
||||||
|
|
||||||
double tempoManobras = Variaveis.OperacaoEmAndamento.Mapa.RuasPercorrer.Count() * VariaveisOperacao.TempoManobra;
|
double tempoManobras = Variaveis.OperacaoEmAndamento.Mapa.RuasPercorrer.Count() * VariaveisOperacao.TempoManobra;
|
||||||
|
|
||||||
|
|
@ -743,13 +704,7 @@ namespace AgroBase.Models
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OperacaoCarregar.DispAtu != null)
|
OperacaoCarregar.OpMapaGPS.Sensoriamento.ReiniciarLeituras();
|
||||||
{
|
|
||||||
for (int i = 0; i < OperacaoCarregar.DispAtu.Dados.QuantidadeBicos; i++)
|
|
||||||
{
|
|
||||||
OperacaoCarregar.OpMapaGPS.Sensoriamento.AtuacoesPorBico.Add(new Dictionary<string, int>());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
OperacaoCarregar.AtualizaListaCameras(null, new List<Panel>(), false);
|
OperacaoCarregar.AtualizaListaCameras(null, new List<Panel>(), false);
|
||||||
|
|
||||||
|
|
@ -759,7 +714,7 @@ namespace AgroBase.Models
|
||||||
|
|
||||||
OperacaoCarregar.DispSen.Dados.Sinaleiros.First(x => x.ID == (Modo == ModoOperacao.Manual ? "LEDMN" : "LEDAT")).Comportamento.statusLED = StatusLED.Aceso;
|
OperacaoCarregar.DispSen.Dados.Sinaleiros.First(x => x.ID == (Modo == ModoOperacao.Manual ? "LEDMN" : "LEDAT")).Comportamento.statusLED = StatusLED.Aceso;
|
||||||
OperacaoCarregar.DispSen.Dados.Sinaleiros.First(x => x.ID == "LEDOP").Comportamento = VariaveisEquipamento.ComportamentoPorStatus();
|
OperacaoCarregar.DispSen.Dados.Sinaleiros.First(x => x.ID == "LEDOP").Comportamento = VariaveisEquipamento.ComportamentoPorStatus();
|
||||||
|
OperacaoCarregar.DispSen.Dados.ConfiguracaoSensorUltrassom = UltrasonicA05Helper.CarregarConfiguracaoPadrao(ConfiguracaoSensorUltrassonico.NaoUtilizado);
|
||||||
|
|
||||||
//OperacaoCarregar.DispSen.Dados.Sinaleiros.ForEach(x => OperacaoCarregar.DispSen.AdicionarMensagemFila(OperacaoCarregar.DispSen.Dados.Modulo_ID, x.ProtocoloComando(), true, false));
|
//OperacaoCarregar.DispSen.Dados.Sinaleiros.ForEach(x => OperacaoCarregar.DispSen.AdicionarMensagemFila(OperacaoCarregar.DispSen.Dados.Modulo_ID, x.ProtocoloComando(), true, false));
|
||||||
foreach (var Sinaleiro in OperacaoCarregar.DispSen.Dados.Sinaleiros)
|
foreach (var Sinaleiro in OperacaoCarregar.DispSen.Dados.Sinaleiros)
|
||||||
|
|
@ -824,25 +779,25 @@ namespace AgroBase.Models
|
||||||
TempoAguardando = DateTime.Now;
|
TempoAguardando = DateTime.Now;
|
||||||
TimestampFim = 0;
|
TimestampFim = 0;
|
||||||
Mapa.IdxRuaAtual = 0;
|
Mapa.IdxRuaAtual = 0;
|
||||||
|
|
||||||
if (DispMvd != null)
|
if (DispMvd != null)
|
||||||
{
|
{
|
||||||
DispMvd.Dados.DistanciaPercorridaOperacao = 0;
|
MovimentacaoUnificadaModel.ReiniciarLeituras(DispMvd.Dados);
|
||||||
DispMvd.Dados.TempoEmAtividade = 0;
|
|
||||||
}
|
}
|
||||||
if (DispAtu != null)
|
if (DispAtu != null)
|
||||||
{
|
{
|
||||||
DispAtu.Dados.BombaPressurizadora.BombaAtuada = false;
|
AtuadorModel.ReiniciarLeituras(DispAtu.Dados);
|
||||||
for (int i = 0; i < DispAtu.Dados.QuantidadeBicos; i++)
|
|
||||||
{
|
|
||||||
OpMapaGPS.Sensoriamento.AtuacoesPorBico.Add(new Dictionary<string, int>());
|
|
||||||
DispAtu.Dados.BicosPulverizadores[i].Atuado = false;
|
|
||||||
}
|
|
||||||
DispAtu.Dados.VolumeVazaoML = 0;
|
|
||||||
}
|
}
|
||||||
Sensoriamento.DistanciaPercorrida = new List<double>();
|
if (DispSen != null)
|
||||||
|
{
|
||||||
|
SensoriamentoModel.ReiniciarLeituras(DispSen.Dados);
|
||||||
|
}
|
||||||
|
|
||||||
|
Sensoriamento.ReiniciarLeituras();
|
||||||
|
OpMapaGPS.Sensoriamento.ReiniciarLeituras();
|
||||||
|
|
||||||
if (Modo == ModoOperacao.MapaGPS)
|
if (Modo == ModoOperacao.MapaGPS)
|
||||||
{
|
{
|
||||||
OpMapaGPS.Sensoriamento = new OperacaoMapaGPSSensoriamentoModel();
|
|
||||||
Controle.PIDdirecional = new PIDModel()
|
Controle.PIDdirecional = new PIDModel()
|
||||||
{
|
{
|
||||||
LimiteSaida = Controle.Angulo_Max,
|
LimiteSaida = Controle.Angulo_Max,
|
||||||
|
|
@ -856,6 +811,7 @@ namespace AgroBase.Models
|
||||||
Controle = controle;
|
Controle = controle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GPSTrajetoria = new List<GPSModel>();
|
GPSTrajetoria = new List<GPSModel>();
|
||||||
ID = (new DateTime(TimestampInicio)).ToString("dd_MM_yyyy_HH_mm_ss");
|
ID = (new DateTime(TimestampInicio)).ToString("dd_MM_yyyy_HH_mm_ss");
|
||||||
idxLog = 0;
|
idxLog = 0;
|
||||||
|
|
@ -945,25 +901,25 @@ namespace AgroBase.Models
|
||||||
TempoAguardando = DateTime.Now;
|
TempoAguardando = DateTime.Now;
|
||||||
TimestampFim = 0;
|
TimestampFim = 0;
|
||||||
Mapa.IdxRuaAtual = 0;
|
Mapa.IdxRuaAtual = 0;
|
||||||
|
|
||||||
if (DispMvd != null)
|
if (DispMvd != null)
|
||||||
{
|
{
|
||||||
DispMvd.Dados.DistanciaPercorridaOperacao = 0;
|
MovimentacaoUnificadaModel.ReiniciarLeituras(DispMvd.Dados);
|
||||||
DispMvd.Dados.TempoEmAtividade = 0;
|
|
||||||
}
|
}
|
||||||
Sensoriamento.DistanciaPercorrida = new List<double>();
|
if (DispAtu != null)
|
||||||
|
{
|
||||||
|
AtuadorModel.ReiniciarLeituras(DispAtu.Dados);
|
||||||
|
}
|
||||||
|
if (DispSen != null)
|
||||||
|
{
|
||||||
|
SensoriamentoModel.ReiniciarLeituras(DispSen.Dados);
|
||||||
|
}
|
||||||
|
|
||||||
|
Sensoriamento.ReiniciarLeituras();
|
||||||
|
OpMapaGPS.Sensoriamento.ReiniciarLeituras();
|
||||||
|
|
||||||
if (Modo == ModoOperacao.MapaGPS)
|
if (Modo == ModoOperacao.MapaGPS)
|
||||||
{
|
{
|
||||||
OpMapaGPS.Sensoriamento = new OperacaoMapaGPSSensoriamentoModel();
|
|
||||||
if (DispAtu != null)
|
|
||||||
{
|
|
||||||
DispAtu.Dados.BombaPressurizadora.BombaAtuada = false;
|
|
||||||
for (int i = 0; i < DispAtu.Dados.QuantidadeBicos; i++)
|
|
||||||
{
|
|
||||||
OpMapaGPS.Sensoriamento.AtuacoesPorBico.Add(new Dictionary<string, int>());
|
|
||||||
DispAtu.Dados.BicosPulverizadores[i].Atuado = false;
|
|
||||||
}
|
|
||||||
DispAtu.Dados.VolumeVazaoML = 0;
|
|
||||||
}
|
|
||||||
Controle.PIDdirecional = new PIDModel()
|
Controle.PIDdirecional = new PIDModel()
|
||||||
{
|
{
|
||||||
LimiteSaida = Controle.Angulo_Max,
|
LimiteSaida = Controle.Angulo_Max,
|
||||||
|
|
@ -973,6 +929,7 @@ namespace AgroBase.Models
|
||||||
Kd = 0.01,
|
Kd = 0.01,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
GPSTrajetoria = new List<GPSModel>();
|
GPSTrajetoria = new List<GPSModel>();
|
||||||
|
|
||||||
Mapa.ReiniciarTrajetoriaDinamica();
|
Mapa.ReiniciarTrajetoriaDinamica();
|
||||||
|
|
@ -1180,61 +1137,90 @@ namespace AgroBase.Models
|
||||||
return new List<string>();
|
return new List<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<string> Protocolos = new List<string>();
|
||||||
|
|
||||||
var _Controle = Variaveis.OperacaoEmAndamento.Controle;
|
var _Controle = Variaveis.OperacaoEmAndamento.Controle;
|
||||||
var _ControleAnterior = Variaveis.OperacaoEmAndamento.ControleAnterior;
|
var _ControleAnterior = Variaveis.OperacaoEmAndamento.ControleAnterior;
|
||||||
|
|
||||||
if (Tipo == T_Code.Mov)
|
// Comando dos motores
|
||||||
|
if (Tipo == T_Code.Mov || Tipo == T_Code.Dir)
|
||||||
{
|
{
|
||||||
if (_Controle.RPM_SP == 0)
|
if (Tipo == T_Code.Mov)
|
||||||
{
|
{
|
||||||
_Controle.Direcao = Direcao.Parado;
|
if (_Controle.RPM_SP == 0)
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (_Controle.RPM_SP < 0)
|
|
||||||
{
|
{
|
||||||
_Controle.PercentualVelocidadeSP *= -1;
|
_Controle.Direcao = Direcao.Parado;
|
||||||
_Controle.Direcao = Direcao.Tras;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_Controle.Direcao = Direcao.Frente;
|
if (_Controle.RPM_SP < 0)
|
||||||
|
{
|
||||||
|
_Controle.PercentualVelocidadeSP *= -1;
|
||||||
|
_Controle.Direcao = Direcao.Tras;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_Controle.Direcao = Direcao.Frente;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (Tipo == T_Code.Dir)
|
||||||
|
{
|
||||||
|
if (_Controle.Angulo < 0)
|
||||||
|
{
|
||||||
|
_Controle.Angulo *= -1;
|
||||||
|
if (_ControleAnterior.Angulo < _Controle.Angulo)
|
||||||
|
{
|
||||||
|
_Controle.Direcao = Direcao.Parado;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_Controle.Direcao = Direcao.Esquerda;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (_ControleAnterior.Angulo > _Controle.Angulo)
|
||||||
|
{
|
||||||
|
_Controle.Direcao = Direcao.Parado;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_Controle.Direcao = Direcao.Direita;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GeneralJoystick.EnviaComandoMotor(
|
||||||
|
_Controle.Direcao == Direcao.Frente ? Keys.Up :
|
||||||
|
_Controle.Direcao == Direcao.Tras ? Keys.Down :
|
||||||
|
_Controle.Direcao == Direcao.Esquerda ? Keys.Left :
|
||||||
|
_Controle.Direcao == Direcao.Direita ? Keys.Right :
|
||||||
|
Keys.Escape, Tipo, ForcarEnvio);
|
||||||
|
|
||||||
|
Protocolos = new List<string>()
|
||||||
|
{
|
||||||
|
Tipo.ToString() + ";" + _Controle.Direcao.ToString() + ";" + _Controle.RPM_SP.ToString() + ";" + _Controle.Angulo.ToString()
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (Tipo == T_Code.Dir)
|
// Comando dos atuadores
|
||||||
|
else if (Tipo == T_Code.Atu)
|
||||||
{
|
{
|
||||||
if (_Controle.Angulo < 0)
|
for (int i = 0; i < _Controle.BicosAtuados.Count; i++)
|
||||||
{
|
{
|
||||||
_Controle.Angulo *= -1;
|
if (_Controle.BicosAtuados[i].Atuado != _ControleAnterior.BicosAtuados[i].Atuado)
|
||||||
if (_ControleAnterior.Angulo < _Controle.Angulo)
|
|
||||||
{
|
{
|
||||||
_Controle.Direcao = Direcao.Parado;
|
GeneralJoystick.EnviarComandoAtuador(S_Code.sBIC, _Controle.BicosAtuados[i].Atuado, _Controle.BicosAtuados[i].ID);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_Controle.Direcao = Direcao.Esquerda;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
Protocolos = new List<string>()
|
||||||
{
|
{
|
||||||
if (_ControleAnterior.Angulo > _Controle.Angulo)
|
Tipo.ToString() + ";" + string.Join(";", _Controle.BicosAtuados.Select(x => x.Atuado ? "1" : "0"))
|
||||||
{
|
};
|
||||||
_Controle.Direcao = Direcao.Parado;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_Controle.Direcao = Direcao.Direita;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GeneralJoystick.EnviaComandoMotor(
|
|
||||||
_Controle.Direcao == Direcao.Frente ? Keys.Up :
|
|
||||||
_Controle.Direcao == Direcao.Tras ? Keys.Down :
|
|
||||||
_Controle.Direcao == Direcao.Esquerda ? Keys.Left :
|
|
||||||
_Controle.Direcao == Direcao.Direita ? Keys.Right :
|
|
||||||
Keys.Escape, Tipo, ForcarEnvio);
|
|
||||||
|
|
||||||
/*var Protocolos =
|
/*var Protocolos =
|
||||||
Tipo == T_Code.Mov ? ((MovimentacaoUnificadaModel)Dispositivo.Dados).Modulos.Select(x => new { Mod_ID = x.Modulo_ID, Protocolo = x.MovMotor.ProtocoloComando(Controle.Direcao) }) :
|
Tipo == T_Code.Mov ? ((MovimentacaoUnificadaModel)Dispositivo.Dados).Modulos.Select(x => new { Mod_ID = x.Modulo_ID, Protocolo = x.MovMotor.ProtocoloComando(Controle.Direcao) }) :
|
||||||
|
|
@ -1248,11 +1234,6 @@ namespace AgroBase.Models
|
||||||
return Protocolos.Select(x => x.Protocolo).ToList();
|
return Protocolos.Select(x => x.Protocolo).ToList();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Protocolos = new List<string>()
|
|
||||||
{
|
|
||||||
Tipo.ToString() + ";" + _Controle.Direcao.ToString() + ";" + _Controle.RPM_SP.ToString() + ";" + _Controle.Angulo.ToString()
|
|
||||||
};
|
|
||||||
|
|
||||||
return Protocolos;
|
return Protocolos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1298,7 +1279,7 @@ namespace AgroBase.Models
|
||||||
|
|
||||||
public void AtualizarControleAtuadores()
|
public void AtualizarControleAtuadores()
|
||||||
{
|
{
|
||||||
Controle.BicosAtuados = Variaveis.OperacaoEmAndamento.DispAtu.Dados.BicosPulverizadores;
|
Controle.BicosAtuados = new List<AtuadorBicoModel>(Variaveis.OperacaoEmAndamento.DispAtu.Dados.BicosPulverizadores);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TmrLeituras_Elapsed(object sender, EventArgs e)
|
private void TmrLeituras_Elapsed(object sender, EventArgs e)
|
||||||
|
|
@ -1323,7 +1304,7 @@ namespace AgroBase.Models
|
||||||
|
|
||||||
if (Variaveis.OperacaoEmAndamento.Iniciado)
|
if (Variaveis.OperacaoEmAndamento.Iniciado)
|
||||||
{
|
{
|
||||||
Variaveis.OperacaoEmAndamento.CamerasSolo.Where(x => x.Iniciada).ToList().ForEach(CameraSolo =>
|
foreach (var CameraSolo in Variaveis.OperacaoEmAndamento.CamerasSolo.Where(x => x.Iniciada))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -1333,7 +1314,8 @@ namespace AgroBase.Models
|
||||||
{
|
{
|
||||||
Console.WriteLine("Erro ao ler dados da câmera do solo (" + CameraSolo.Nome + "): " + ex.Message);
|
Console.WriteLine("Erro ao ler dados da câmera do solo (" + CameraSolo.Nome + "): " + ex.Message);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ErvasNoRadar = Variaveis.OperacaoEmAndamento.CamerasSolo.Sum(x => x.ErvasNoRadar);
|
Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ErvasNoRadar = Variaveis.OperacaoEmAndamento.CamerasSolo.Sum(x => x.ErvasNoRadar);
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
@ -1369,12 +1351,11 @@ namespace AgroBase.Models
|
||||||
|
|
||||||
private void AtualizaLeituraCameraSolo(CameraSoloModel CameraSolo)
|
private void AtualizaLeituraCameraSolo(CameraSoloModel CameraSolo)
|
||||||
{
|
{
|
||||||
if (CameraSolo.camera._mqttTopico?.Mensagens?.Any(x => x.Momento > CameraSolo.camera.IniciadoEm) == true)
|
if (CameraSolo.camera._mqttTopico != null && CameraSolo.camera._mqttTopico.Mensagens.Any(x => x.Momento > CameraSolo.camera.IniciadoEm))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var Mensagem = CameraSolo.camera._mqttTopico.Mensagens
|
var Mensagem = CameraSolo.camera._mqttTopico.Mensagens.LastOrDefault(x => x.Momento > CameraSolo.camera.IniciadoEm);
|
||||||
.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);
|
||||||
|
|
@ -1382,54 +1363,62 @@ namespace AgroBase.Models
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
// Adicionar logging para falhas no parsing pode ajudar no diagnóstico
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CameraSolo.Leitura?.objetos == null) return;
|
|
||||||
|
|
||||||
var Atuador = Variaveis.OperacaoEmAndamento.DispAtu;
|
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<string> BicosJaAtuados = Atuador.Dados.BicosPulverizadores.Where(x => x.Atuado).Select(x => x.ID).ToList();
|
||||||
List<bool> BicosAnteriores = new List<bool>();
|
if (Variaveis.OperacaoEmAndamento.Modo != ModoOperacao.Manual)
|
||||||
for (int i = 0; i < BicosPorCamera; i++)
|
|
||||||
{
|
{
|
||||||
int iBico = i + (CameraSolo.Posicao * BicosPorCamera);
|
// Inicialize todos os bicos como inativos antes de verificar os objetos verdes
|
||||||
BicosAnteriores.Add(Atuador.Dados.BicosPulverizadores[iBico].Atuado);
|
Atuador.Dados.BicosPulverizadores.ForEach(x => x.Atuado = false);
|
||||||
Atuador.Dados.BicosPulverizadores[iBico].Atuado = false; // Resetar o estado para recalcular
|
|
||||||
}
|
|
||||||
|
|
||||||
// Atualiza o estado dos bicos com base nos objetos verdes detectados
|
foreach (var verde in Verdes)
|
||||||
foreach (var verde in CameraSolo.Leitura.objetos)
|
|
||||||
{
|
|
||||||
int posicaoFinalVerdeY = verde.y + verde.altura;
|
|
||||||
if (posicaoFinalVerdeY > inicioBarraPulverizadora)
|
|
||||||
{
|
{
|
||||||
int posicaoFinalVerdeX = verde.x + verde.largura;
|
// Calcule a posição final (y + altura) do objeto verde
|
||||||
|
int posicaoFinalVerdeY = verde.y + verde.altura;
|
||||||
for (int i = 0; i < BicosPorCamera; i++)
|
if (posicaoFinalVerdeY > inicioBarraPulverizadora)
|
||||||
{
|
{
|
||||||
int limiteInferior = intervaloPorBico * i;
|
// Calcule a posição final (x + largura) do objeto verde
|
||||||
int limiteSuperior = limiteInferior + intervaloPorBico;
|
int posicaoFinalVerdeX = verde.x + verde.largura;
|
||||||
|
|
||||||
if (verde.x < limiteSuperior && posicaoFinalVerdeX > limiteInferior)
|
// Para cada objeto verde, verifique se ele está dentro do intervalo de algum bico e atue-o
|
||||||
|
for (int i = 0; i < BicosPorCamera; i++)
|
||||||
{
|
{
|
||||||
|
// Determina o intervalo no eixo x para o bico atual
|
||||||
|
int limiteInferior = intervaloPorBico * i;
|
||||||
|
int limiteSuperior = limiteInferior + intervaloPorBico;
|
||||||
|
|
||||||
|
|
||||||
int iBico = i + (CameraSolo.Posicao * BicosPorCamera);
|
int iBico = i + (CameraSolo.Posicao * BicosPorCamera);
|
||||||
Atuador.Dados.BicosPulverizadores[iBico].Atuado = true;
|
// 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 (Variaveis.OperacaoEmAndamento.Sensoriamento.StatusOperacao == StatusOperacao.EmAndamento)
|
||||||
|
{
|
||||||
|
Atuador.Dados.BicosPulverizadores[iBico].Atuado = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CameraSolo.ErvasNoRadar = CameraSolo.Leitura.objetos.Count();
|
CameraSolo.ErvasNoRadar = Verdes.Count();
|
||||||
|
|
||||||
// Registra as atuações dos bicos para cada erva detectada
|
// 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])
|
var Bico = Atuador.Dados.BicosPulverizadores[iBico];
|
||||||
|
if (Bico.Atuado && !BicosJaAtuados.Contains(Bico.ID))
|
||||||
{
|
{
|
||||||
var atuacao = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico[iBico];
|
var atuacao = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico[iBico];
|
||||||
|
|
||||||
|
|
@ -1444,6 +1433,7 @@ namespace AgroBase.Models
|
||||||
{
|
{
|
||||||
atuacao[erva.descricao]++;
|
atuacao[erva.descricao]++;
|
||||||
}
|
}
|
||||||
|
Bico.Atuacoes = atuacao.Sum(x => x.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1452,6 +1442,8 @@ namespace AgroBase.Models
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void AtualizaLeituraCameraCaminho()
|
private void AtualizaLeituraCameraCaminho()
|
||||||
{
|
{
|
||||||
|
|
@ -1794,11 +1786,18 @@ namespace AgroBase.Models
|
||||||
OperacaoSensoriamentoLogModel logGeral = new OperacaoSensoriamentoLogModel()
|
OperacaoSensoriamentoLogModel logGeral = new OperacaoSensoriamentoLogModel()
|
||||||
{
|
{
|
||||||
Momento = Agora,
|
Momento = Agora,
|
||||||
|
CodigoFalha = Variaveis.OperacaoEmAndamento.RetornaCodigoFalha(),
|
||||||
|
VelocidadeMedia = Variaveis.OperacaoEmAndamento.Sensoriamento.VelocidadeMedia,
|
||||||
|
PorcentagemBateria = Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria,
|
||||||
BateriaConsumida = Variaveis.OperacaoEmAndamento.Sensoriamento.BateriaConsumida,
|
BateriaConsumida = Variaveis.OperacaoEmAndamento.Sensoriamento.BateriaConsumida,
|
||||||
DistanciaDireita = Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaDireita,
|
DistanciaDireita = Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaDireita,
|
||||||
DistanciaEsquerda = Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaEsquerda,
|
DistanciaEsquerda = Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaEsquerda,
|
||||||
DistanciaPercorrida = new List<double>(Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaPercorrida),
|
DistanciaPercorrida = new List<double>(Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaPercorrida),
|
||||||
|
AnguloCarroGPS = Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarroGPS,
|
||||||
AnguloCarroBussola = Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarroBussola,
|
AnguloCarroBussola = Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarroBussola,
|
||||||
|
AnguloCarro = Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarro,
|
||||||
|
SonarFrontal_Kinect = Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal_Kinect,
|
||||||
|
StatusOperacao = Variaveis.OperacaoEmAndamento.Sensoriamento.StatusOperacao,
|
||||||
TempoMovimento = Variaveis.OperacaoEmAndamento.DispMvd.Dados.TempoEmAtividade,
|
TempoMovimento = Variaveis.OperacaoEmAndamento.DispMvd.Dados.TempoEmAtividade,
|
||||||
StatusCarro = Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.StatusAtual,
|
StatusCarro = Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.StatusAtual,
|
||||||
ErvasNoRadar = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ErvasNoRadar,
|
ErvasNoRadar = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ErvasNoRadar,
|
||||||
|
|
@ -1831,7 +1830,8 @@ 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,
|
PercentualErvasTerreno = Variaveis.OperacaoEmAndamento.Sensoriamento.PercentualErvasTerreno,
|
||||||
|
SonarFrontal_old = null
|
||||||
};
|
};
|
||||||
SalvarLog("operacao", logGeral, Fim);
|
SalvarLog("operacao", logGeral, Fim);
|
||||||
|
|
||||||
|
|
@ -1901,9 +1901,11 @@ namespace AgroBase.Models
|
||||||
PressaoLinha_SP = Variaveis.OperacaoEmAndamento.Controle.PressaoLinha,
|
PressaoLinha_SP = Variaveis.OperacaoEmAndamento.Controle.PressaoLinha,
|
||||||
PressaoLinha = Variaveis.OperacaoEmAndamento.DispAtu.Dados.PressaoLinha,
|
PressaoLinha = Variaveis.OperacaoEmAndamento.DispAtu.Dados.PressaoLinha,
|
||||||
PotenciaBomba = Variaveis.OperacaoEmAndamento.DispAtu.Dados.BombaPressurizadora.Potencia,
|
PotenciaBomba = Variaveis.OperacaoEmAndamento.DispAtu.Dados.BombaPressurizadora.Potencia,
|
||||||
|
BombaLigada = Variaveis.OperacaoEmAndamento.DispAtu.Dados.BombaPressurizadora.BombaAtuada,
|
||||||
VazaoFluxoMLpS = Variaveis.OperacaoEmAndamento.DispAtu.Dados.VazaoFluxoMLpS,
|
VazaoFluxoMLpS = Variaveis.OperacaoEmAndamento.DispAtu.Dados.VazaoFluxoMLpS,
|
||||||
VolumeVazaoML = Variaveis.OperacaoEmAndamento.DispAtu.Dados.VolumeVazaoML,
|
VolumeVazaoML = Variaveis.OperacaoEmAndamento.DispAtu.Dados.VolumeVazaoML,
|
||||||
QuantidadeBicos = Variaveis.OperacaoEmAndamento.DispAtu.Dados.QuantidadeBicos,
|
QuantidadeBicos = Variaveis.OperacaoEmAndamento.DispAtu.Dados.QuantidadeBicos,
|
||||||
|
TempoPulverizadorAtuado = Variaveis.OperacaoEmAndamento.DispAtu.Dados.TempoAtuado,
|
||||||
Bicos = Variaveis.OperacaoEmAndamento.DispAtu.Dados.BicosPulverizadores.Select(Bico => new AtuBicoSensoriamentoLogModel()
|
Bicos = Variaveis.OperacaoEmAndamento.DispAtu.Dados.BicosPulverizadores.Select(Bico => new AtuBicoSensoriamentoLogModel()
|
||||||
{
|
{
|
||||||
ID = Bico.ID,
|
ID = Bico.ID,
|
||||||
|
|
@ -1913,7 +1915,8 @@ 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].Sum(x => x.Value) : 0,
|
Atuacoes = Bico.Atuacoes,
|
||||||
|
TempoAtuado = Bico.TempoAtuado,
|
||||||
}).ToList()
|
}).ToList()
|
||||||
};
|
};
|
||||||
SalvarLog(T_Code.Atu.ToString(), logAtu, false);
|
SalvarLog(T_Code.Atu.ToString(), logAtu, false);
|
||||||
|
|
@ -2918,112 +2921,20 @@ namespace AgroBase.Models
|
||||||
public class OperacaoSensoriamentoLogModel
|
public class OperacaoSensoriamentoLogModel
|
||||||
{
|
{
|
||||||
public DateTime Momento { get; set; }
|
public DateTime Momento { get; set; }
|
||||||
public ulong CodigoFalha
|
public ulong CodigoFalha { get; set; }
|
||||||
{
|
public double VelocidadeMedia { get; set; } = 0.0;
|
||||||
get
|
public double PorcentagemBateria { get; set; } = 0.0;
|
||||||
{
|
|
||||||
return Variaveis.OperacaoEmAndamento.RetornaCodigoFalha();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public double VelocidadeMedia
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.Average(x => x.MovMotor.VelocidadeInstantanea);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public double PorcentagemBateria
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (PZEMService.Iniciado)
|
|
||||||
{
|
|
||||||
return FuncoesMatematicas.Map(PZEMService.UltimaLeitura.Tensao, PZEMService.TensaoMinima, PZEMService.TensaoMaxima, 0.0, 100.0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public double BateriaConsumida { get; set; } = 0;
|
public double BateriaConsumida { get; set; } = 0;
|
||||||
public List<double> DistanciaPercorrida { get; set; } = new List<double>();
|
public List<double> DistanciaPercorrida { get; set; } = new List<double>();
|
||||||
public double DistanciaEsquerda { get; set; } = 0;
|
public double DistanciaEsquerda { get; set; } = 0;
|
||||||
public double DistanciaDireita { get; set; } = 0;
|
public double DistanciaDireita { get; set; } = 0;
|
||||||
public double AnguloCarroGPS
|
public double AnguloCarroGPS { get; set; } = 0.0;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
int PontosConsiderarAngulo = 2;
|
|
||||||
double Angulo = 0;
|
|
||||||
|
|
||||||
int Indice = Variaveis.OperacaoEmAndamento.Mapa.mapaService.MapaUrl != "" ? Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual : 0;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
double somaAngulo = 0;
|
|
||||||
var Pontos = !Variaveis.OperacaoEmAndamento.GPSTrajetoriaRua.Any() || Indice >= Variaveis.OperacaoEmAndamento.GPSTrajetoriaRua.Count() ? new List<GPSModel>() :
|
|
||||||
Variaveis.OperacaoEmAndamento.GPSTrajetoriaRua[Indice].Count > PontosConsiderarAngulo ?
|
|
||||||
Variaveis.OperacaoEmAndamento.GPSTrajetoriaRua[Indice].OrderByDescending(x => x.DataHora).Take(PontosConsiderarAngulo).ToList() :
|
|
||||||
Variaveis.OperacaoEmAndamento.GPSTrajetoriaRua[Indice].OrderByDescending(x => x.DataHora).ToList();
|
|
||||||
Pontos = Pontos.OrderBy(x => x.DataHora).ToList();
|
|
||||||
for (int i = 0; i < Pontos.Count() - 1; i++)
|
|
||||||
{
|
|
||||||
somaAngulo += GPSService.CalcularOrientacao(Pontos[i], Pontos[i + 1]);
|
|
||||||
}
|
|
||||||
double mediaAngulo = somaAngulo / (Pontos.Count() - 1);
|
|
||||||
|
|
||||||
Angulo = (!(mediaAngulo >= 0 || mediaAngulo <= 0)) ? 0 : mediaAngulo;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
Angulo = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Angulo;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public double AnguloCarroBussola { get; set; } = 0;
|
public double AnguloCarroBussola { get; set; } = 0;
|
||||||
public double AnguloCarro
|
public double AnguloCarro { get; set; } = 0.0;
|
||||||
{
|
public KinectModel SonarFrontal_Kinect { get; set; } = null;
|
||||||
get
|
|
||||||
{
|
|
||||||
if (
|
|
||||||
WT901CService.Iniciado ||
|
|
||||||
(Variaveis.OperacaoEmAndamento.DispSen._Porta.IsOpen && Variaveis.OperacaoEmAndamento.DispSen.Dados.Sensores.Any(x => x.Componente == S_Code.sMAG && x.Inicializado))
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return AnguloCarroBussola;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return AnguloCarroGPS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public KinectModel SonarFrontal_Kinect
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (KinectService.Iniciado)
|
|
||||||
{
|
|
||||||
return KinectService.Leitura;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public SonarModel SonarFrontal_old { get; set; }
|
public SonarModel SonarFrontal_old { get; set; }
|
||||||
public double TempoMovimento { get;set; }
|
public double TempoMovimento { get;set; }
|
||||||
public StatusOperacao StatusOperacao
|
public StatusOperacao StatusOperacao { get; set; } = StatusOperacao.Parado;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Variaveis.OperacaoEmAndamento.StatusAtual;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public StatusCarroMapa StatusCarro { get; set; }
|
public StatusCarroMapa StatusCarro { get; set; }
|
||||||
public int ErvasNoRadar { get; set; } = 0;
|
public int ErvasNoRadar { get; set; } = 0;
|
||||||
public double HerbicidaConsumido { get; set; } = 0;
|
public double HerbicidaConsumido { get; set; } = 0;
|
||||||
|
|
@ -3056,17 +2967,55 @@ namespace AgroBase.Models
|
||||||
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 { get; set; }
|
public double PercentualErvasTerreno { get; set; }
|
||||||
public double PercentualErvasTerrenoOperacao
|
|
||||||
|
public void ReiniciarLeituras()
|
||||||
{
|
{
|
||||||
get
|
Momento = DateTime.Now;
|
||||||
{
|
CodigoFalha = 0;
|
||||||
if (Variaveis.OperacaoEmAndamento.Tempo.TotalMilliseconds == 0)
|
VelocidadeMedia = 0.0;
|
||||||
{
|
PorcentagemBateria = 0.0;
|
||||||
return 0;
|
BateriaConsumida = 0;
|
||||||
}
|
DistanciaPercorrida = new List<double>();
|
||||||
double p = Math.Round((Variaveis.OperacaoEmAndamento.DispAtu.Dados.TempoAtuado / Variaveis.OperacaoEmAndamento.Tempo.TotalMilliseconds) * 100.0, 2);
|
DistanciaEsquerda = 0;
|
||||||
return p;
|
DistanciaDireita = 0;
|
||||||
}
|
AnguloCarroGPS = 0.0;
|
||||||
|
AnguloCarroBussola = 0;
|
||||||
|
AnguloCarro = 0.0;
|
||||||
|
SonarFrontal_Kinect = null;
|
||||||
|
SonarFrontal_old = null;
|
||||||
|
TempoMovimento = 0;
|
||||||
|
StatusOperacao = StatusOperacao.NaoIniciado;
|
||||||
|
StatusCarro = StatusCarroMapa.Parado;
|
||||||
|
ErvasNoRadar = 0;
|
||||||
|
HerbicidaConsumido = 0;
|
||||||
|
HerbicidaPorErva = 0;
|
||||||
|
ErvasIdentificadas = new List<Dictionary<string, int>>();
|
||||||
|
ProgressoTrajeto = 0;
|
||||||
|
ProgressoRua = 0;
|
||||||
|
AnguloRua = 0;
|
||||||
|
AnguloRuaCamera = 0;
|
||||||
|
AnguloDif = 0;
|
||||||
|
Direcao = DirecaoCarroRua.Parado;
|
||||||
|
DentroDaRua = false;
|
||||||
|
IdxPontoAproximadoRua = 0;
|
||||||
|
IdxRuaAtual = 0;
|
||||||
|
InclinacaoX = 0;
|
||||||
|
InclinacaoY = 0;
|
||||||
|
InclinacaoZ = 0;
|
||||||
|
Temperatura = 0;
|
||||||
|
Pressao = 0;
|
||||||
|
Altitude = 0;
|
||||||
|
CPU_load = null;
|
||||||
|
GPU_load = null;
|
||||||
|
HDD_load = null;
|
||||||
|
RAM_usage = null;
|
||||||
|
CPU_temp = null;
|
||||||
|
GPU_temp = null;
|
||||||
|
OperacaoLiberada = false;
|
||||||
|
MovEsq_Status = (false, new List<string>());
|
||||||
|
MovDir_Status = (false, new List<string>());
|
||||||
|
Dir_Status = (false, new List<string>());
|
||||||
|
PercentualErvasTerreno = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3142,9 +3091,11 @@ namespace AgroBase.Models
|
||||||
public double VolumeReservatorio { get; set; }
|
public double VolumeReservatorio { get; set; }
|
||||||
public double PercentualReservatorio { get; set; }
|
public double PercentualReservatorio { get; set; }
|
||||||
public double PotenciaBomba { get; set; }
|
public double PotenciaBomba { get; set; }
|
||||||
|
public bool BombaLigada { get; set; }
|
||||||
public double VazaoFluxoMLpS { get; set; }
|
public double VazaoFluxoMLpS { get; set; }
|
||||||
public double VolumeVazaoML { get; set; }
|
public double VolumeVazaoML { get; set; }
|
||||||
public int QuantidadeBicos { get; set; }
|
public int QuantidadeBicos { get; set; }
|
||||||
|
public double TempoPulverizadorAtuado { get; set; }
|
||||||
public List<AtuBicoSensoriamentoLogModel> Bicos { get; set; }
|
public List<AtuBicoSensoriamentoLogModel> Bicos { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3158,6 +3109,7 @@ namespace AgroBase.Models
|
||||||
public bool StatusBico { get; set; }
|
public bool StatusBico { get; set; }
|
||||||
public double MediaNivelFluxo { get; set; }
|
public double MediaNivelFluxo { get; set; }
|
||||||
public int Atuacoes { get; set; }
|
public int Atuacoes { get; set; }
|
||||||
|
public double TempoAtuado { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SenSensoriamentoLogModel
|
public class SenSensoriamentoLogModel
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,4 @@
|
||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static AgroBase.Models.Enums;
|
using static AgroBase.Models.Enums;
|
||||||
|
|
||||||
namespace AgroBase.Models.Operacoes
|
namespace AgroBase.Models.Operacoes
|
||||||
|
|
@ -12,8 +8,8 @@ namespace AgroBase.Models.Operacoes
|
||||||
public ModoOperacao Modo { get; set; }
|
public ModoOperacao Modo { get; set; }
|
||||||
public string Descricao { get; set; }
|
public string Descricao { get; set; }
|
||||||
public List<OperacaoModulosMandatoriosModel> ModulosMandatorios { get; set; }
|
public List<OperacaoModulosMandatoriosModel> ModulosMandatorios { get; set; }
|
||||||
public double MovVelocidadeSErvas { get; set; }
|
public int MovVelocidadeSErvasPercent { get; set; }
|
||||||
public double MovVelocidadeCErvas { get; set; }
|
public int MovVelocidadeCErvasPercent { get; set; }
|
||||||
public int DirAnguloMaximo { get; set; }
|
public int DirAnguloMaximo { get; set; }
|
||||||
public int DirVelocidadeMovimento { get; set; }
|
public int DirVelocidadeMovimento { get; set; }
|
||||||
public int AtuPercentualDeteccaoVertical { get; set; }
|
public int AtuPercentualDeteccaoVertical { get; set; }
|
||||||
|
|
@ -21,5 +17,6 @@ namespace AgroBase.Models.Operacoes
|
||||||
public double AtuPressaoLinha { get; set; }
|
public double AtuPressaoLinha { get; set; }
|
||||||
public int AtuDuracaoAtuacao { get; set; }
|
public int AtuDuracaoAtuacao { get; set; }
|
||||||
public MapasModel Mapa { get; set; }
|
public MapasModel Mapa { get; set; }
|
||||||
|
public UltrasonicA05Configuracoes ConfiguracaoUltrassom { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,215 @@
|
||||||
using System;
|
using AgroBase.Services;
|
||||||
|
using OpenHardwareMonitor.Hardware;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace AgroBase.Models
|
namespace AgroBase.Models
|
||||||
{
|
{
|
||||||
|
public enum ConfiguracaoSensorUltrassonico
|
||||||
|
{
|
||||||
|
NaoUtilizado,
|
||||||
|
AlinhamentoLateral,
|
||||||
|
DeteccaoObstaculosFrenteETras,
|
||||||
|
DeteccaoSulcosEBuracos,
|
||||||
|
NavegacaoAmbienteEstreito,
|
||||||
|
SupervisaoAreaComObstaculos
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum PosicaoSensorUltrassonico
|
||||||
|
{
|
||||||
|
NaoConectado,
|
||||||
|
TraseiroEsquerdo,
|
||||||
|
TraseiroCentro,
|
||||||
|
TraseiroDireito,
|
||||||
|
FrontalEsquerdo,
|
||||||
|
FrontalCentro,
|
||||||
|
FrontalDireito,
|
||||||
|
LateralEsquerdaFrontal,
|
||||||
|
LateralEsquerdaCentral,
|
||||||
|
LateralEsquerdaTraseiro,
|
||||||
|
LateralDireitaFrontal,
|
||||||
|
LateralDireitaCentral,
|
||||||
|
LateralDireitaTraseiro
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UltrasonicA05Helper
|
||||||
|
{
|
||||||
|
public static Dictionary<ConfiguracaoSensorUltrassonico, string> DescricaoConfiguracoes = new Dictionary<ConfiguracaoSensorUltrassonico, string>
|
||||||
|
{
|
||||||
|
{ ConfiguracaoSensorUltrassonico.NaoUtilizado, "Não ultiliza os sensores ultrassonicos durante a execução da operação." },
|
||||||
|
|
||||||
|
{ ConfiguracaoSensorUltrassonico.AlinhamentoLateral, "Usa sensores nas laterais para manter o robô centralizado na entrelinha da plantação, garantindo alinhamento constante." },
|
||||||
|
|
||||||
|
{ ConfiguracaoSensorUltrassonico.DeteccaoObstaculosFrenteETras, "Configuração para detectar obstáculos na frente e atrás do robô, permitindo desvio de objetos inesperados no caminho." },
|
||||||
|
|
||||||
|
{ ConfiguracaoSensorUltrassonico.DeteccaoSulcosEBuracos, "Sensores na frente inclinados para baixo, ideais para identificar buracos ou sulcos no solo e evitar áreas acidentadas." },
|
||||||
|
|
||||||
|
{ ConfiguracaoSensorUltrassonico.NavegacaoAmbienteEstreito, "Sensores laterais nas extremidades para navegação em áreas estreitas, mantendo uma distância segura das fileiras e evitando colisões." },
|
||||||
|
|
||||||
|
{ ConfiguracaoSensorUltrassonico.SupervisaoAreaComObstaculos, "Configuração que monitora objetos ao redor do robô, oferecendo uma visão de 360 graus para navegação em áreas com alta densidade de obstáculos." }
|
||||||
|
};
|
||||||
|
|
||||||
|
public static UltrasonicA05Configuracoes CarregarConfiguracaoPadrao(ConfiguracaoSensorUltrassonico Config)
|
||||||
|
{
|
||||||
|
UltrasonicA05Configuracoes ConfigPadrao = new UltrasonicA05Configuracoes()
|
||||||
|
{
|
||||||
|
Configuracao = Config,
|
||||||
|
Sensores = new List<UltrasonicA05ConfiguracoesSensor>()
|
||||||
|
};
|
||||||
|
|
||||||
|
switch (Config)
|
||||||
|
{
|
||||||
|
case ConfiguracaoSensorUltrassonico.NaoUtilizado:
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(1));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(2));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(3));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(4));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ConfiguracaoSensorUltrassonico.AlinhamentoLateral:
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(1, PosicaoSensorUltrassonico.LateralEsquerdaTraseiro, true, true, 25.0, 45.0, 5.0, 5.0, true, false));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(2, PosicaoSensorUltrassonico.LateralDireitaTraseiro, true, true, 25.0, 45.0, 5.0, 5.0, true, false));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(3, PosicaoSensorUltrassonico.LateralEsquerdaFrontal, true, true, 25.0, 45.0, 5.0, 5.0, true, false));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(4, PosicaoSensorUltrassonico.LateralDireitaFrontal, true, true, 25.0, 45.0, 5.0, 5.0, true, false));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ConfiguracaoSensorUltrassonico.DeteccaoObstaculosFrenteETras:
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(1, PosicaoSensorUltrassonico.FrontalEsquerdo, true, true, 10.0, 30.0, 2.0, 2.0, true, true));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(2, PosicaoSensorUltrassonico.FrontalDireito, true, true, 10.0, 30.0, 2.0, 2.0, true, true));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(3, PosicaoSensorUltrassonico.TraseiroEsquerdo, true, true, 10.0, 30.0, 2.0, 2.0, true, true));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(4, PosicaoSensorUltrassonico.TraseiroDireito, true, true, 10.0, 30.0, 2.0, 2.0, true, true));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ConfiguracaoSensorUltrassonico.DeteccaoSulcosEBuracos:
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(1, PosicaoSensorUltrassonico.FrontalCentro, true, true, 5.0, 20.0, 1.0, 1.0, false, true));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(2, PosicaoSensorUltrassonico.FrontalEsquerdo, true, true, 5.0, 20.0, 1.0, 1.0, false, false));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(3, PosicaoSensorUltrassonico.FrontalDireito, true, true, 5.0, 20.0, 1.0, 1.0, false, false));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ConfiguracaoSensorUltrassonico.NavegacaoAmbienteEstreito:
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(1, PosicaoSensorUltrassonico.LateralEsquerdaFrontal, true, true, 15.0, 30.0, 3.0, 3.0, true, false));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(2, PosicaoSensorUltrassonico.LateralDireitaFrontal, true, true, 15.0, 30.0, 3.0, 3.0, true, false));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(3, PosicaoSensorUltrassonico.LateralEsquerdaTraseiro, true, true, 15.0, 30.0, 3.0, 3.0, true, false));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(4, PosicaoSensorUltrassonico.LateralDireitaTraseiro, true, true, 15.0, 30.0, 3.0, 3.0, true, false));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ConfiguracaoSensorUltrassonico.SupervisaoAreaComObstaculos:
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(1, PosicaoSensorUltrassonico.FrontalCentro, true, true, 20.0, 50.0, 4.0, 4.0, true, true));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(2, PosicaoSensorUltrassonico.LateralEsquerdaCentral, true, true, 20.0, 50.0, 4.0, 4.0, true, false));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(3, PosicaoSensorUltrassonico.LateralDireitaCentral, true, true, 20.0, 50.0, 4.0, 4.0, true, false));
|
||||||
|
ConfigPadrao.Sensores.Add(DefineDadosSensor(4, PosicaoSensorUltrassonico.TraseiroCentro, true, true, 20.0, 50.0, 4.0, 4.0, true, true));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ConfigPadrao;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static UltrasonicA05ConfiguracoesSensor DefineDadosSensor(int _id, PosicaoSensorUltrassonico _posicao = PosicaoSensorUltrassonico.NaoConectado, bool _limiteMin = false, bool _limiteMax = false, double _limiteMinVal = 0, double _limiteMaxVal = 0, double _margemMin = 0, double _margemMax = 0, bool _desvio = false, bool _parada = false)
|
||||||
|
{
|
||||||
|
return new UltrasonicA05ConfiguracoesSensor()
|
||||||
|
{
|
||||||
|
ID = _id,
|
||||||
|
Posicao = _posicao,
|
||||||
|
LimiteMinimo = _limiteMin,
|
||||||
|
LimiteMaximo = _limiteMax,
|
||||||
|
LimiteMinimoVal = _limiteMinVal,
|
||||||
|
LimiteMaximoVal = _limiteMaxVal,
|
||||||
|
MargemMinimo = _margemMin,
|
||||||
|
MargemMaximo = _margemMax,
|
||||||
|
Desvio = _desvio,
|
||||||
|
Parada = _parada
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static double CalcularErroUltrassons()
|
||||||
|
{
|
||||||
|
double erroUltrassons = 0.0;
|
||||||
|
double pesoTotal = 0.0;
|
||||||
|
double erroAlinhamento = 0.0;
|
||||||
|
bool paradaNecessaria = false;
|
||||||
|
bool desvioEsquerdaNecessario = false;
|
||||||
|
bool desvioDireitaNecessario = false;
|
||||||
|
|
||||||
|
var Config = Variaveis.OperacaoEmAndamento.DispSen.Dados.ConfiguracaoSensorUltrassom;
|
||||||
|
|
||||||
|
if (!UltrasonicA05Service.Iniciado || Config == null || Config.Configuracao == ConfiguracaoSensorUltrassonico.NaoUtilizado || Config.Sensores.All(x => x.Posicao == PosicaoSensorUltrassonico.NaoConectado))
|
||||||
|
{
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Processa alinhamento lateral
|
||||||
|
if (Config.Configuracao == ConfiguracaoSensorUltrassonico.AlinhamentoLateral)
|
||||||
|
{
|
||||||
|
var sensorEsquerdoFrente = Config.Sensores.FirstOrDefault(s => s.Posicao == PosicaoSensorUltrassonico.LateralEsquerdaFrontal);
|
||||||
|
var sensorEsquerdoTras = Config.Sensores.FirstOrDefault(s => s.Posicao == PosicaoSensorUltrassonico.LateralEsquerdaTraseiro);
|
||||||
|
var sensorDireitoFrente = Config.Sensores.FirstOrDefault(s => s.Posicao == PosicaoSensorUltrassonico.LateralDireitaFrontal);
|
||||||
|
var sensorDireitoTras = Config.Sensores.FirstOrDefault(s => s.Posicao == PosicaoSensorUltrassonico.LateralDireitaTraseiro);
|
||||||
|
|
||||||
|
if (sensorEsquerdoFrente != null && sensorEsquerdoTras != null)
|
||||||
|
{
|
||||||
|
erroAlinhamento += (sensorEsquerdoFrente.Leitura - sensorEsquerdoTras.Leitura) * -1;
|
||||||
|
pesoTotal += 0.5; // Peso para o lado esquerdo
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sensorDireitoFrente != null && sensorDireitoTras != null)
|
||||||
|
{
|
||||||
|
erroAlinhamento += (sensorDireitoFrente.Leitura - sensorDireitoTras.Leitura);
|
||||||
|
pesoTotal += 0.5; // Peso para o lado direito
|
||||||
|
}
|
||||||
|
|
||||||
|
erroUltrassons += erroAlinhamento * (pesoTotal > 0 ? 0.5 : 1.0);
|
||||||
|
pesoTotal += 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verifica condições de parada e desvio
|
||||||
|
foreach (var sensor in Config.Sensores)
|
||||||
|
{
|
||||||
|
if (sensor.Posicao == PosicaoSensorUltrassonico.NaoConectado) continue;
|
||||||
|
|
||||||
|
if (sensor.Parada && sensor.SensorAtuado)
|
||||||
|
{
|
||||||
|
paradaNecessaria = true;
|
||||||
|
break; // Parada imediata, não precisa de mais verificações
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sensor.Desvio && sensor.SensorAtuado)
|
||||||
|
{
|
||||||
|
if (sensor.Posicao == PosicaoSensorUltrassonico.LateralEsquerdaFrontal || sensor.Posicao == PosicaoSensorUltrassonico.LateralEsquerdaTraseiro)
|
||||||
|
{
|
||||||
|
desvioEsquerdaNecessario = true;
|
||||||
|
}
|
||||||
|
else if (sensor.Posicao == PosicaoSensorUltrassonico.LateralDireitaFrontal || sensor.Posicao == PosicaoSensorUltrassonico.LateralDireitaTraseiro)
|
||||||
|
{
|
||||||
|
desvioDireitaNecessario = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Decisões de parada e desvio
|
||||||
|
if (paradaNecessaria || (desvioEsquerdaNecessario && desvioDireitaNecessario))
|
||||||
|
{
|
||||||
|
Variaveis.OperacaoEmAndamento.Controle.PercentualVelocidadeSP = 0; // Parada imediata
|
||||||
|
return double.MaxValue;
|
||||||
|
}
|
||||||
|
else if (desvioEsquerdaNecessario)
|
||||||
|
{
|
||||||
|
erroUltrassons = -1.0; // Desvio para a direita
|
||||||
|
pesoTotal = 0.3; // Peso maior para desvio
|
||||||
|
}
|
||||||
|
else if (desvioDireitaNecessario)
|
||||||
|
{
|
||||||
|
erroUltrassons = 1.0; // Desvio para a esquerda
|
||||||
|
pesoTotal = 0.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
return pesoTotal > 0 ? erroUltrassons / pesoTotal : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public class UltrasonicA05Model
|
public class UltrasonicA05Model
|
||||||
{
|
{
|
||||||
public DateTime Momento { get; set; }
|
public DateTime Momento { get; set; }
|
||||||
|
|
@ -14,5 +218,66 @@ namespace AgroBase.Models
|
||||||
public int U2 { get; set; }
|
public int U2 { get; set; }
|
||||||
public int U3 { get; set; }
|
public int U3 { get; set; }
|
||||||
public int U4 { get; set; }
|
public int U4 { get; set; }
|
||||||
|
public UltrasonicA05Configuracoes Configuracao { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class UltrasonicA05Configuracoes
|
||||||
|
{
|
||||||
|
public ConfiguracaoSensorUltrassonico Configuracao { get; set; } = ConfiguracaoSensorUltrassonico.NaoUtilizado;
|
||||||
|
public List<UltrasonicA05ConfiguracoesSensor> Sensores { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UltrasonicA05ConfiguracoesSensor
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
public PosicaoSensorUltrassonico Posicao { get; set; }
|
||||||
|
public bool LimiteMinimo { get; set; }
|
||||||
|
public double LimiteMinimoVal { get; set; }
|
||||||
|
public double MargemMinimo { get; set; }
|
||||||
|
public bool LimiteMaximo { get; set; }
|
||||||
|
public double LimiteMaximoVal { get; set; }
|
||||||
|
public double MargemMaximo { get; set; }
|
||||||
|
public bool Desvio { get; set; }
|
||||||
|
public bool Parada { get; set; }
|
||||||
|
public double DistanciaIdeal
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
// Calcula o ponto médio entre os limites, ou usa o limite ativo como valor ideal
|
||||||
|
return
|
||||||
|
LimiteMaximo && LimiteMinimo ? (LimiteMaximoVal + LimiteMinimoVal) / 2.0
|
||||||
|
: LimiteMinimo ? LimiteMinimoVal
|
||||||
|
: LimiteMaximo ? LimiteMaximoVal
|
||||||
|
: 0.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public bool EmUso => LimiteMaximo || LimiteMinimo;
|
||||||
|
public double Leitura { get; set; }
|
||||||
|
public bool SensorAtuado
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
// Caso LimiteMinimo e LimiteMaximo estejam configurados
|
||||||
|
if (LimiteMinimo && LimiteMaximo)
|
||||||
|
{
|
||||||
|
return Leitura < (LimiteMinimoVal - MargemMinimo) || Leitura > (LimiteMaximoVal + MargemMaximo);
|
||||||
|
}
|
||||||
|
// Caso apenas LimiteMinimo esteja configurado
|
||||||
|
else if (LimiteMinimo)
|
||||||
|
{
|
||||||
|
return Leitura < (LimiteMinimoVal - MargemMinimo);
|
||||||
|
}
|
||||||
|
// Caso apenas LimiteMaximo esteja configurado
|
||||||
|
else if (LimiteMaximo)
|
||||||
|
{
|
||||||
|
return Leitura > (LimiteMaximoVal + MargemMaximo);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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.PercentualErvasTerrenoOperacao / 100.0;
|
return Variaveis.OperacaoEmAndamento.Sensoriamento.PercentualErvasTerreno / 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.PercentualErvasTerrenoOperacao) / 100.0;
|
return (100.0 - Variaveis.OperacaoEmAndamento.Sensoriamento.PercentualErvasTerreno) / 100.0;
|
||||||
}
|
}
|
||||||
return 0.7;
|
return 0.7;
|
||||||
}
|
}
|
||||||
|
|
@ -876,6 +876,14 @@ namespace AgroBase.Models
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Função personalizada Clamp
|
||||||
|
public static double Clamp(double valor, double minimo, double maximo)
|
||||||
|
{
|
||||||
|
if (valor < minimo) return minimo;
|
||||||
|
if (valor > maximo) return maximo;
|
||||||
|
return valor;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -592,6 +592,8 @@ namespace AgroBase.Services
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DefinirAnguloCarroGPS();
|
||||||
|
|
||||||
frmInstancial.frmAcompanhamento.AtualizarOrientacao();
|
frmInstancial.frmAcompanhamento.AtualizarOrientacao();
|
||||||
|
|
||||||
int ID = Convert.ToInt32(Variaveis.ConexaoLoRa.parametros.address);
|
int ID = Convert.ToInt32(Variaveis.ConexaoLoRa.parametros.address);
|
||||||
|
|
@ -727,6 +729,58 @@ namespace AgroBase.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static void DefinirAnguloCarroGPS()
|
||||||
|
{
|
||||||
|
int PontosConsiderarAngulo = 2;
|
||||||
|
double Angulo = 0.0;
|
||||||
|
|
||||||
|
int Indice = Variaveis.OperacaoEmAndamento.Mapa.mapaService.MapaUrl != "" ? Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual : 0;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
double somaAngulo = 0;
|
||||||
|
var Pontos = !Variaveis.OperacaoEmAndamento.GPSTrajetoriaRua.Any() || Indice >= Variaveis.OperacaoEmAndamento.GPSTrajetoriaRua.Count() ? new List<GPSModel>() :
|
||||||
|
Variaveis.OperacaoEmAndamento.GPSTrajetoriaRua[Indice].Count > PontosConsiderarAngulo ?
|
||||||
|
Variaveis.OperacaoEmAndamento.GPSTrajetoriaRua[Indice].OrderByDescending(x => x.DataHora).Take(PontosConsiderarAngulo).ToList() :
|
||||||
|
Variaveis.OperacaoEmAndamento.GPSTrajetoriaRua[Indice].OrderByDescending(x => x.DataHora).ToList();
|
||||||
|
Pontos = Pontos.OrderBy(x => x.DataHora).ToList();
|
||||||
|
for (int i = 0; i < Pontos.Count() - 1; i++)
|
||||||
|
{
|
||||||
|
somaAngulo += CalcularOrientacao(Pontos[i], Pontos[i + 1]);
|
||||||
|
}
|
||||||
|
double mediaAngulo = somaAngulo / (Pontos.Count() - 1);
|
||||||
|
|
||||||
|
Angulo = (!(mediaAngulo >= 0 || mediaAngulo <= 0)) ? 0 : mediaAngulo;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Angulo = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarroGPS = Angulo;
|
||||||
|
|
||||||
|
DefinirAnguloCarro();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DefinirAnguloCarro()
|
||||||
|
{
|
||||||
|
double Angulo = 0.0;
|
||||||
|
|
||||||
|
if (
|
||||||
|
WT901CService.Iniciado ||
|
||||||
|
(Variaveis.OperacaoEmAndamento.DispSen._Porta.IsOpen && Variaveis.OperacaoEmAndamento.DispSen.Dados.Sensores.Any(x => x.Componente == S_Code.sMAG && x.Inicializado))
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Angulo = Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarroBussola;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Angulo = Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarroGPS;
|
||||||
|
}
|
||||||
|
|
||||||
|
Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarro = Angulo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -247,6 +247,8 @@ namespace AgroBase.Services
|
||||||
Leitura.VelY = velocidade[1];
|
Leitura.VelY = velocidade[1];
|
||||||
Leitura.VelZ = velocidade[2];
|
Leitura.VelZ = velocidade[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal_Kinect = Leitura;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static KinectParametrosModel CarregarParametros()
|
private static KinectParametrosModel CarregarParametros()
|
||||||
|
|
|
||||||
|
|
@ -257,25 +257,34 @@ namespace AgroBase.Services
|
||||||
case T_Code.Pzm:
|
case T_Code.Pzm:
|
||||||
{
|
{
|
||||||
sucesso = PZEMService.ProcessarResposta(Comando.Resposta);
|
sucesso = PZEMService.ProcessarResposta(Comando.Resposta);
|
||||||
frmInstancial.frmAcompanhamento.AtualizarSensores("Ultima Leitura PZM: " + PZEMService.UltimaLeitura.DataHora.ToString("HH:mm:ss"));
|
if (frmInstancial.DebugMode)
|
||||||
frmInstancial.frmAcompanhamento.AtualizarSensores("Bateria: " + PZEMService.UltimaLeitura.Tensao.ToString("0.00") + " V - " + PZEMService.UltimaLeitura.Corrente.ToString("0.00") + " A - " + PZEMService.UltimaLeitura.Potencia.ToString("0.00") + " W");
|
{
|
||||||
|
frmInstancial.frmAcompanhamento.AtualizarSensores("Ultima Leitura PZM: " + PZEMService.UltimaLeitura.DataHora.ToString("HH:mm:ss"));
|
||||||
|
frmInstancial.frmAcompanhamento.AtualizarSensores("Bateria: " + PZEMService.UltimaLeitura.Tensao.ToString("0.00") + " V - " + PZEMService.UltimaLeitura.Corrente.ToString("0.00") + " A - " + PZEMService.UltimaLeitura.Potencia.ToString("0.00") + " W");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case T_Code.Wit:
|
case T_Code.Wit:
|
||||||
{
|
{
|
||||||
sucesso = WT901CService.ProcessarResposta(Comando.Resposta, Comando.Comando);
|
sucesso = WT901CService.ProcessarResposta(Comando.Resposta, Comando.Comando);
|
||||||
frmInstancial.frmAcompanhamento.AtualizarSensores("Ultima Leitura WIT: " + WT901CService.DadosLeitura.Momento.ToString("HH:mm:ss"));
|
if (frmInstancial.DebugMode)
|
||||||
frmInstancial.frmAcompanhamento.AtualizarOrientacao();
|
{
|
||||||
|
frmInstancial.frmAcompanhamento.AtualizarSensores("Ultima Leitura WIT: " + WT901CService.DadosLeitura.Momento.ToString("HH:mm:ss"));
|
||||||
|
frmInstancial.frmAcompanhamento.AtualizarOrientacao();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case T_Code.A05:
|
case T_Code.A05:
|
||||||
{
|
{
|
||||||
sucesso = UltrasonicA05Service.DecifrarRespostaAquisicao(Comando.Resposta);
|
sucesso = UltrasonicA05Service.DecifrarRespostaAquisicao(Comando.Resposta);
|
||||||
frmInstancial.frmAcompanhamento.AtualizarSensores("Ultima Leitura A05: " + UltrasonicA05Service.DadosLeitura.Momento.ToString("HH:mm:ss"));
|
if (frmInstancial.DebugMode)
|
||||||
frmInstancial.frmAcompanhamento.AtualizarSensores("U1: " + UltrasonicA05Service.DadosLeitura.U1.ToString("") + " mm");
|
{
|
||||||
frmInstancial.frmAcompanhamento.AtualizarSensores("U2: " + UltrasonicA05Service.DadosLeitura.U2.ToString("") + " mm");
|
frmInstancial.frmAcompanhamento.AtualizarSensores("Ultima Leitura A05: " + UltrasonicA05Service.DadosLeitura.Momento.ToString("HH:mm:ss"));
|
||||||
frmInstancial.frmAcompanhamento.AtualizarSensores("U3: " + UltrasonicA05Service.DadosLeitura.U3.ToString("") + " mm");
|
frmInstancial.frmAcompanhamento.AtualizarSensores("U1: " + UltrasonicA05Service.DadosLeitura.U1.ToString("") + " mm");
|
||||||
frmInstancial.frmAcompanhamento.AtualizarSensores("U4: " + UltrasonicA05Service.DadosLeitura.U4.ToString("") + " mm");
|
frmInstancial.frmAcompanhamento.AtualizarSensores("U2: " + UltrasonicA05Service.DadosLeitura.U2.ToString("") + " mm");
|
||||||
|
frmInstancial.frmAcompanhamento.AtualizarSensores("U3: " + UltrasonicA05Service.DadosLeitura.U3.ToString("") + " mm");
|
||||||
|
frmInstancial.frmAcompanhamento.AtualizarSensores("U4: " + UltrasonicA05Service.DadosLeitura.U4.ToString("") + " mm");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,7 @@ namespace AgroBase.Services
|
||||||
ContadorCarga.AtualizarConsumo();
|
ContadorCarga.AtualizarConsumo();
|
||||||
|
|
||||||
Variaveis.OperacaoEmAndamento.Sensoriamento.BateriaConsumida = ContadorCarga.PercentualConsumido;
|
Variaveis.OperacaoEmAndamento.Sensoriamento.BateriaConsumida = ContadorCarga.PercentualConsumido;
|
||||||
|
Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria = Math.Round(FuncoesMatematicas.Map(UltimaLeitura.Tensao, TensaoMinima, TensaoMaxima, 0.0, 100.0), 2);
|
||||||
|
|
||||||
return Sucesso;
|
return Sucesso;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,7 @@ namespace AgroBase.Services
|
||||||
int u2 = (resposta[5] << 8) + resposta[6];
|
int u2 = (resposta[5] << 8) + resposta[6];
|
||||||
int u3 = (resposta[7] << 8) + resposta[8];
|
int u3 = (resposta[7] << 8) + resposta[8];
|
||||||
int u4 = (resposta[9] << 8) + resposta[10];
|
int u4 = (resposta[9] << 8) + resposta[10];
|
||||||
|
List<int> leituras = new List<int>() { u1, u2, u3, u4 };
|
||||||
|
|
||||||
UltrasonicA05Model modelo = new UltrasonicA05Model()
|
UltrasonicA05Model modelo = new UltrasonicA05Model()
|
||||||
{
|
{
|
||||||
|
|
@ -114,11 +115,21 @@ namespace AgroBase.Services
|
||||||
U1 = u1,
|
U1 = u1,
|
||||||
U2 = u2,
|
U2 = u2,
|
||||||
U3 = u3,
|
U3 = u3,
|
||||||
U4 = u4
|
U4 = u4,
|
||||||
};
|
};
|
||||||
|
|
||||||
DadosLeitura = modelo;
|
DadosLeitura = modelo;
|
||||||
|
|
||||||
|
if (Variaveis.OperacaoEmAndamento.DispSen != null && Variaveis.OperacaoEmAndamento.DispSen.Dados.ConfiguracaoSensorUltrassom != null)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < Variaveis.OperacaoEmAndamento.DispSen.Dados.ConfiguracaoSensorUltrassom.Sensores.Count(); i++)
|
||||||
|
{
|
||||||
|
var sensor = Variaveis.OperacaoEmAndamento.DispSen.Dados.ConfiguracaoSensorUltrassom.Sensores[i];
|
||||||
|
sensor.Leitura = leituras[i];
|
||||||
|
}
|
||||||
|
DadosLeitura.Configuracao = Variaveis.OperacaoEmAndamento.DispSen.Dados.ConfiguracaoSensorUltrassom;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using AgroBase.Forms;
|
using AgroBase.Models;
|
||||||
using AgroBase.Models;
|
|
||||||
using Microsoft.Win32;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO.Ports;
|
using System.IO.Ports;
|
||||||
|
|
@ -122,6 +120,7 @@ namespace AgroBase.Services
|
||||||
Variaveis.OperacaoEmAndamento.Sensoriamento.InclinacaoY = DadosLeitura.AngleY * -1;
|
Variaveis.OperacaoEmAndamento.Sensoriamento.InclinacaoY = DadosLeitura.AngleY * -1;
|
||||||
Variaveis.OperacaoEmAndamento.Sensoriamento.InclinacaoZ = DadosLeitura.AngleZ;
|
Variaveis.OperacaoEmAndamento.Sensoriamento.InclinacaoZ = DadosLeitura.AngleZ;
|
||||||
Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarroBussola = DadosLeitura.AngleZ * -1;
|
Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarroBussola = DadosLeitura.AngleZ * -1;
|
||||||
|
GPSService.DefinirAnguloCarro();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Sucesso;
|
return Sucesso;
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
{"Modulo_ID":"Atu","RequisitarDados":false,"Conectado":false,"QuantidadeBicos":4,"DensidadeHerbicida":1.05,"AtuacaoNivelAlto":true,"BicosPulverizadores":[{"ID":"B01","Posicao":1,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B02","Posicao":2,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B03","Posicao":3,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B04","Posicao":4,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0}],"BombaPressurizadora":{"ID":"BOMBA","BombaAtuada":false,"Ligado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[14,35,36,37,5],"Pressao":0.0,"Potencia":0.0},"Sensores":[{"LogGrafico":[],"ID":"FLXLN","Prioridade":23,"Descricao":"Fluxo na linha principal","Componente":198,"Aferir":true,"DelayAmostragem":300,"Inicializado":false,"Testando":false,"Funcoes":[25],"Parametros":[],"UnidadeMedida":"mL/s","Leituras":[],"ValorMinimo":0.0,"ValorMaximo":0.0,"LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"MASRS","Prioridade":3,"Descricao":"Massa do reservatório de herbicida","Componente":532,"Aferir":true,"DelayAmostragem":1000,"Inicializado":false,"Testando":false,"Funcoes":[22,23],"Parametros":[],"UnidadeMedida":"Kg","Leituras":[],"ValorMinimo":0.0,"ValorMaximo":0.0,"LimiteMaximo":50.0,"LimiteMinimo":5.0},{"LogGrafico":[],"ID":"PRSLN","Prioridade":3,"Descricao":"Pressão na linha principal","Componente":333,"Aferir":true,"DelayAmostragem":1000,"Inicializado":false,"Testando":false,"Funcoes":[24],"Parametros":[["Vmin","000.00"],["Vmax","004.50"],["Pmax","174.04"]],"UnidadeMedida":"psi","Leituras":[],"ValorMinimo":0.0,"ValorMaximo":0.0,"LimiteMaximo":120.0,"LimiteMinimo":60.0}],"ScriptDeteccaoErvas":"weed_detector-1_0.py","_MassaRef":0.8,"_MassaLeituraRef":40876.37,"_MassaLeituraExtra":1895800.0,"_MassaLeitura":1895800.0,"MassaReservatorio":0.0,"VolumeReservatorio":0.0,"PercentualReservatorio":0.0,"VolumeVazaoAferido":0.0,"_FluxoMlRef":102.0,"_FluxoPulsoRef":80.0,"_LeituraPulsos":0,"_LeituraPeriodo":0,"VazaoFluxoMLpS":0.0,"VolumeVazaoML":0.0,"InicioAtuacao":"0001-01-01T00:00:00","FimAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0,"_PressaoVmin":0.0,"_PressaoVmax":4.5,"_PressaoMax":174.045,"_LeituraPressao":0.0,"PressaoLinha":0.0,"PressaoLinhaCalc":0.0}
|
{"Modulo_ID":"Atu","RequisitarDados":false,"Conectado":false,"QuantidadeBicos":4,"DensidadeHerbicida":1.05,"AtuacaoNivelAlto":true,"BicosPulverizadores":[{"ID":"B01","Posicao":1,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0,"Atuacoes":0,"InicioAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0},{"ID":"B02","Posicao":2,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0,"Atuacoes":0,"InicioAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0},{"ID":"B03","Posicao":3,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0,"Atuacoes":0,"InicioAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0},{"ID":"B04","Posicao":4,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0,"Atuacoes":0,"InicioAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0}],"BombaPressurizadora":{"ID":"BOMBA","BombaAtuada":false,"Ligado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[14,35,36,37,5],"Pressao":0.0,"Potencia":0.0},"Sensores":[{"LogGrafico":[],"ID":"FLXLN","Prioridade":23,"Descricao":"Fluxo na linha principal","Componente":198,"Aferir":true,"DelayAmostragem":300,"Inicializado":false,"Testando":false,"Funcoes":[25],"Parametros":[],"UnidadeMedida":"mL/s","Leituras":[],"ValorMinimo":0.0,"ValorMaximo":0.0,"LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"MASRS","Prioridade":3,"Descricao":"Massa do reservatório de herbicida","Componente":532,"Aferir":true,"DelayAmostragem":1000,"Inicializado":false,"Testando":false,"Funcoes":[22,23],"Parametros":[],"UnidadeMedida":"Kg","Leituras":[],"ValorMinimo":0.0,"ValorMaximo":0.0,"LimiteMaximo":50.0,"LimiteMinimo":5.0},{"LogGrafico":[],"ID":"PRSLN","Prioridade":3,"Descricao":"Pressão na linha principal","Componente":333,"Aferir":true,"DelayAmostragem":1000,"Inicializado":false,"Testando":false,"Funcoes":[24],"Parametros":[["Vmin","000.00"],["Vmax","004.50"],["Pmax","174.04"]],"UnidadeMedida":"psi","Leituras":[],"ValorMinimo":0.0,"ValorMaximo":0.0,"LimiteMaximo":120.0,"LimiteMinimo":60.0}],"ScriptDeteccaoErvas":"weed_detector-1_0.py","_MassaRef":0.8,"_MassaLeituraRef":40876.37,"_MassaLeituraExtra":1895800.0,"_MassaLeitura":1895800.0,"MassaReservatorio":0.0,"VolumeReservatorio":0.0,"PercentualReservatorio":0.0,"VolumeVazaoAferido":0.0,"_FluxoMlRef":102.0,"_FluxoPulsoRef":80.0,"_LeituraPulsos":0,"_LeituraPeriodo":0,"VazaoFluxoMLpS":0.0,"VolumeVazaoML":0.0,"InicioAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0,"_PressaoVmin":0.0,"_PressaoVmax":4.5,"_PressaoMax":174.045,"_LeituraPressao":0.0,"PressaoLinha":0.0,"PressaoLinhaCalc":0.0}
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
[{"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}]
|
[{"id":1,"Arquivo":"model","Diretorio":"C:\\AgroBaseModels\\Ervas\\","Extensao":".pt","Versao":"2_1","TipoArquivo":1,"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,"Arquivo":"parametersSen","Diretorio":"Parametros/","Extensao":".par","Versao":"1_1","TipoArquivo":4,"ArquivoDownload":"parametersSen-1_1.par"},{"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}]
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,162 +1,62 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"timestamp": 1729860640.9951098,
|
"timestamp": 1730223063.4357438,
|
||||||
"x_max": 640.0,
|
"x_max": 640.0,
|
||||||
"y_max": 480.0,
|
"y_max": 480.0,
|
||||||
"objetos": [
|
"objetos": []
|
||||||
{
|
|
||||||
"id": 0,
|
|
||||||
"descricao": "chenopodio",
|
|
||||||
"x": 186,
|
|
||||||
"y": 317,
|
|
||||||
"largura": 78,
|
|
||||||
"altura": 52,
|
|
||||||
"confianca": 0.740234375
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1729860641.0379987,
|
"timestamp": 1730223063.4682589,
|
||||||
"x_max": 640.0,
|
"x_max": 640.0,
|
||||||
"y_max": 480.0,
|
"y_max": 480.0,
|
||||||
"objetos": [
|
"objetos": []
|
||||||
{
|
|
||||||
"id": 0,
|
|
||||||
"descricao": "chenopodio",
|
|
||||||
"x": 185,
|
|
||||||
"y": 316,
|
|
||||||
"largura": 79,
|
|
||||||
"altura": 53,
|
|
||||||
"confianca": 0.71728515625
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1729860641.0754085,
|
"timestamp": 1730223063.4987152,
|
||||||
"x_max": 640.0,
|
"x_max": 640.0,
|
||||||
"y_max": 480.0,
|
"y_max": 480.0,
|
||||||
"objetos": [
|
"objetos": []
|
||||||
{
|
|
||||||
"id": 0,
|
|
||||||
"descricao": "chenopodio",
|
|
||||||
"x": 186,
|
|
||||||
"y": 316,
|
|
||||||
"largura": 78,
|
|
||||||
"altura": 53,
|
|
||||||
"confianca": 0.73486328125
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1729860641.1103146,
|
"timestamp": 1730223063.5311768,
|
||||||
"x_max": 640.0,
|
"x_max": 640.0,
|
||||||
"y_max": 480.0,
|
"y_max": 480.0,
|
||||||
"objetos": [
|
"objetos": []
|
||||||
{
|
|
||||||
"id": 0,
|
|
||||||
"descricao": "chenopodio",
|
|
||||||
"x": 185,
|
|
||||||
"y": 317,
|
|
||||||
"largura": 79,
|
|
||||||
"altura": 52,
|
|
||||||
"confianca": 0.73974609375
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1729860641.1462216,
|
"timestamp": 1730223063.5636268,
|
||||||
"x_max": 640.0,
|
"x_max": 640.0,
|
||||||
"y_max": 480.0,
|
"y_max": 480.0,
|
||||||
"objetos": [
|
"objetos": []
|
||||||
{
|
|
||||||
"id": 0,
|
|
||||||
"descricao": "chenopodio",
|
|
||||||
"x": 186,
|
|
||||||
"y": 317,
|
|
||||||
"largura": 77,
|
|
||||||
"altura": 52,
|
|
||||||
"confianca": 0.72216796875
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1729860642.2513819,
|
"timestamp": 1730223063.5956206,
|
||||||
"x_max": 640.0,
|
"x_max": 640.0,
|
||||||
"y_max": 480.0,
|
"y_max": 480.0,
|
||||||
"objetos": [
|
"objetos": []
|
||||||
{
|
|
||||||
"id": 0,
|
|
||||||
"descricao": "chenopodio",
|
|
||||||
"x": 186,
|
|
||||||
"y": 316,
|
|
||||||
"largura": 78,
|
|
||||||
"altura": 53,
|
|
||||||
"confianca": 0.74072265625
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1729860642.29327,
|
"timestamp": 1730223063.6291697,
|
||||||
"x_max": 640.0,
|
"x_max": 640.0,
|
||||||
"y_max": 480.0,
|
"y_max": 480.0,
|
||||||
"objetos": [
|
"objetos": []
|
||||||
{
|
|
||||||
"id": 0,
|
|
||||||
"descricao": "chenopodio",
|
|
||||||
"x": 186,
|
|
||||||
"y": 317,
|
|
||||||
"largura": 78,
|
|
||||||
"altura": 52,
|
|
||||||
"confianca": 0.72900390625
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1729860642.3371546,
|
"timestamp": 1730223063.6596236,
|
||||||
"x_max": 640.0,
|
"x_max": 640.0,
|
||||||
"y_max": 480.0,
|
"y_max": 480.0,
|
||||||
"objetos": [
|
"objetos": []
|
||||||
{
|
|
||||||
"id": 0,
|
|
||||||
"descricao": "chenopodio",
|
|
||||||
"x": 185,
|
|
||||||
"y": 316,
|
|
||||||
"largura": 80,
|
|
||||||
"altura": 53,
|
|
||||||
"confianca": 0.740234375
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1729860651.0805528,
|
"timestamp": 1730223063.6940958,
|
||||||
"x_max": 640.0,
|
"x_max": 640.0,
|
||||||
"y_max": 480.0,
|
"y_max": 480.0,
|
||||||
"objetos": [
|
"objetos": []
|
||||||
{
|
|
||||||
"id": 0,
|
|
||||||
"descricao": "chenopodio",
|
|
||||||
"x": 186,
|
|
||||||
"y": 317,
|
|
||||||
"largura": 78,
|
|
||||||
"altura": 52,
|
|
||||||
"confianca": 0.74951171875
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1729860651.710928,
|
"timestamp": 1730223063.7330477,
|
||||||
"x_max": 640.0,
|
"x_max": 640.0,
|
||||||
"y_max": 480.0,
|
"y_max": 480.0,
|
||||||
"objetos": [
|
"objetos": []
|
||||||
{
|
|
||||||
"id": 0,
|
|
||||||
"descricao": "chenopodio",
|
|
||||||
"x": 186,
|
|
||||||
"y": 317,
|
|
||||||
"largura": 78,
|
|
||||||
"altura": 51,
|
|
||||||
"confianca": 0.73291015625
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -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_d86f01de6f5a4004d1767840aa065b3f {
|
#map_f874e23c9f6634fbbbee12e7268299a5 {
|
||||||
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_d86f01de6f5a4004d1767840aa065b3f" ></div>
|
<div class="folium-map" id="map_f874e23c9f6634fbbbee12e7268299a5" ></div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
var map_d86f01de6f5a4004d1767840aa065b3f = L.map(
|
var map_f874e23c9f6634fbbbee12e7268299a5 = L.map(
|
||||||
"map_d86f01de6f5a4004d1767840aa065b3f",
|
"map_f874e23c9f6634fbbbee12e7268299a5",
|
||||||
{
|
{
|
||||||
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_108db742a9d491e8246a93e325c8595e = L.tileLayer(
|
var tile_layer_e5ecc91c27eadae77cb4743fe8d836e5 = 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_108db742a9d491e8246a93e325c8595e.addTo(map_d86f01de6f5a4004d1767840aa065b3f);
|
tile_layer_e5ecc91c27eadae77cb4743fe8d836e5.addTo(map_f874e23c9f6634fbbbee12e7268299a5);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -87,7 +87,7 @@
|
||||||
}
|
}
|
||||||
trajeto_json_add({"features": []});
|
trajeto_json_add({"features": []});
|
||||||
|
|
||||||
trajeto_json.addTo(map_d86f01de6f5a4004d1767840aa065b3f);
|
trajeto_json.addTo(map_f874e23c9f6634fbbbee12e7268299a5);
|
||||||
|
|
||||||
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_d86f01de6f5a4004d1767840aa065b3f);
|
}).addTo(map_f874e23c9f6634fbbbee12e7268299a5);
|
||||||
|
|
||||||
// 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_d86f01de6f5a4004d1767840aa065b3f.setView(novaPosicao, map_d86f01de6f5a4004d1767840aa065b3f.getZoom());
|
map_f874e23c9f6634fbbbee12e7268299a5.setView(novaPosicao, map_f874e23c9f6634fbbbee12e7268299a5.getZoom());
|
||||||
});
|
});
|
||||||
|
|
||||||
function calcularOrientacao(P1latitude, P1longitude, P2latitude, P2longitude) {
|
function calcularOrientacao(P1latitude, P1longitude, P2latitude, P2longitude) {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
1a2affdeacf7d81849a0589e1a4cd61e99ea63f1436a07c49b5dd94f1d929193
|
5875a1a9c926bc3d1db863aa7762494af9ca53385f091eb1d7da78431a6d9acf
|
||||||
|
|
|
||||||
|
|
@ -479,3 +479,4 @@ C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\Emgu.CV.Platform.NetStand
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\MathNet.Numerics.dll
|
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\MathNet.Numerics.dll
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\MathNet.Numerics.xml
|
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\MathNet.Numerics.xml
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\OpenHardwareMonitorLib.dll
|
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\OpenHardwareMonitorLib.dll
|
||||||
|
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmA05Config.resources
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -94,6 +94,14 @@
|
||||||
this.btnCarregar = new System.Windows.Forms.Button();
|
this.btnCarregar = new System.Windows.Forms.Button();
|
||||||
this.txtDescricao = new System.Windows.Forms.TextBox();
|
this.txtDescricao = new System.Windows.Forms.TextBox();
|
||||||
this.lblDescricao = new System.Windows.Forms.Label();
|
this.lblDescricao = new System.Windows.Forms.Label();
|
||||||
|
this.pnlParametros = new System.Windows.Forms.Panel();
|
||||||
|
this.gpbSensoriamento = new System.Windows.Forms.GroupBox();
|
||||||
|
this.btnConfigurar = new System.Windows.Forms.Button();
|
||||||
|
this.cmbConfiguracaoUltrassom = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.rtbDescricao = new System.Windows.Forms.RichTextBox();
|
||||||
|
this.nudVelMax = new System.Windows.Forms.NumericUpDown();
|
||||||
|
this.nudVelMin = new System.Windows.Forms.NumericUpDown();
|
||||||
this.gpbModulos.SuspendLayout();
|
this.gpbModulos.SuspendLayout();
|
||||||
this.pnlModulos.SuspendLayout();
|
this.pnlModulos.SuspendLayout();
|
||||||
this.tabControl1.SuspendLayout();
|
this.tabControl1.SuspendLayout();
|
||||||
|
|
@ -102,6 +110,10 @@
|
||||||
this.gpbDirecional.SuspendLayout();
|
this.gpbDirecional.SuspendLayout();
|
||||||
this.gpbLocomocao.SuspendLayout();
|
this.gpbLocomocao.SuspendLayout();
|
||||||
this.tabMapa.SuspendLayout();
|
this.tabMapa.SuspendLayout();
|
||||||
|
this.pnlParametros.SuspendLayout();
|
||||||
|
this.gpbSensoriamento.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.nudVelMax)).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.nudVelMin)).BeginInit();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// gpbModulos
|
// gpbModulos
|
||||||
|
|
@ -169,6 +181,7 @@
|
||||||
this.chbA05.TabIndex = 19;
|
this.chbA05.TabIndex = 19;
|
||||||
this.chbA05.Text = "A05";
|
this.chbA05.Text = "A05";
|
||||||
this.chbA05.UseVisualStyleBackColor = false;
|
this.chbA05.UseVisualStyleBackColor = false;
|
||||||
|
this.chbA05.CheckedChanged += new System.EventHandler(this.chbModulo_CheckedChanged);
|
||||||
//
|
//
|
||||||
// rtbKnt
|
// rtbKnt
|
||||||
//
|
//
|
||||||
|
|
@ -191,6 +204,7 @@
|
||||||
this.chbKnt.TabIndex = 17;
|
this.chbKnt.TabIndex = 17;
|
||||||
this.chbKnt.Text = "KNT";
|
this.chbKnt.Text = "KNT";
|
||||||
this.chbKnt.UseVisualStyleBackColor = false;
|
this.chbKnt.UseVisualStyleBackColor = false;
|
||||||
|
this.chbKnt.CheckedChanged += new System.EventHandler(this.chbModulo_CheckedChanged);
|
||||||
//
|
//
|
||||||
// rtbLRA
|
// rtbLRA
|
||||||
//
|
//
|
||||||
|
|
@ -412,9 +426,7 @@
|
||||||
// tabParametros
|
// tabParametros
|
||||||
//
|
//
|
||||||
this.tabParametros.Controls.Add(this.btnProximo);
|
this.tabParametros.Controls.Add(this.btnProximo);
|
||||||
this.tabParametros.Controls.Add(this.gpbAtuador);
|
this.tabParametros.Controls.Add(this.pnlParametros);
|
||||||
this.tabParametros.Controls.Add(this.gpbDirecional);
|
|
||||||
this.tabParametros.Controls.Add(this.gpbLocomocao);
|
|
||||||
this.tabParametros.Location = new System.Drawing.Point(4, 22);
|
this.tabParametros.Location = new System.Drawing.Point(4, 22);
|
||||||
this.tabParametros.Name = "tabParametros";
|
this.tabParametros.Name = "tabParametros";
|
||||||
this.tabParametros.Padding = new System.Windows.Forms.Padding(3);
|
this.tabParametros.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
|
@ -425,10 +437,10 @@
|
||||||
//
|
//
|
||||||
// btnProximo
|
// btnProximo
|
||||||
//
|
//
|
||||||
this.btnProximo.Location = new System.Drawing.Point(481, 388);
|
this.btnProximo.Location = new System.Drawing.Point(483, 388);
|
||||||
this.btnProximo.Name = "btnProximo";
|
this.btnProximo.Name = "btnProximo";
|
||||||
this.btnProximo.Size = new System.Drawing.Size(75, 23);
|
this.btnProximo.Size = new System.Drawing.Size(75, 23);
|
||||||
this.btnProximo.TabIndex = 10;
|
this.btnProximo.TabIndex = 12;
|
||||||
this.btnProximo.Text = "Próximo";
|
this.btnProximo.Text = "Próximo";
|
||||||
this.btnProximo.UseVisualStyleBackColor = true;
|
this.btnProximo.UseVisualStyleBackColor = true;
|
||||||
this.btnProximo.Click += new System.EventHandler(this.btnProximo_Click);
|
this.btnProximo.Click += new System.EventHandler(this.btnProximo_Click);
|
||||||
|
|
@ -448,9 +460,9 @@
|
||||||
this.gpbAtuador.Controls.Add(this.txtPercentualAtuacao);
|
this.gpbAtuador.Controls.Add(this.txtPercentualAtuacao);
|
||||||
this.gpbAtuador.Controls.Add(this.lblCapacidadeReservatorio);
|
this.gpbAtuador.Controls.Add(this.lblCapacidadeReservatorio);
|
||||||
this.gpbAtuador.Controls.Add(this.lblPercentualAtuacao1);
|
this.gpbAtuador.Controls.Add(this.lblPercentualAtuacao1);
|
||||||
this.gpbAtuador.Location = new System.Drawing.Point(6, 194);
|
this.gpbAtuador.Location = new System.Drawing.Point(3, 197);
|
||||||
this.gpbAtuador.Name = "gpbAtuador";
|
this.gpbAtuador.Name = "gpbAtuador";
|
||||||
this.gpbAtuador.Size = new System.Drawing.Size(550, 166);
|
this.gpbAtuador.Size = new System.Drawing.Size(529, 166);
|
||||||
this.gpbAtuador.TabIndex = 7;
|
this.gpbAtuador.TabIndex = 7;
|
||||||
this.gpbAtuador.TabStop = false;
|
this.gpbAtuador.TabStop = false;
|
||||||
this.gpbAtuador.Text = "Atuador";
|
this.gpbAtuador.Text = "Atuador";
|
||||||
|
|
@ -580,9 +592,9 @@
|
||||||
this.gpbDirecional.Controls.Add(this.txtAnguloMaximo);
|
this.gpbDirecional.Controls.Add(this.txtAnguloMaximo);
|
||||||
this.gpbDirecional.Controls.Add(this.lblVelocidadeDirecional);
|
this.gpbDirecional.Controls.Add(this.lblVelocidadeDirecional);
|
||||||
this.gpbDirecional.Controls.Add(this.lblAnguloMaximo);
|
this.gpbDirecional.Controls.Add(this.lblAnguloMaximo);
|
||||||
this.gpbDirecional.Location = new System.Drawing.Point(6, 100);
|
this.gpbDirecional.Location = new System.Drawing.Point(3, 103);
|
||||||
this.gpbDirecional.Name = "gpbDirecional";
|
this.gpbDirecional.Name = "gpbDirecional";
|
||||||
this.gpbDirecional.Size = new System.Drawing.Size(550, 88);
|
this.gpbDirecional.Size = new System.Drawing.Size(529, 88);
|
||||||
this.gpbDirecional.TabIndex = 6;
|
this.gpbDirecional.TabIndex = 6;
|
||||||
this.gpbDirecional.TabStop = false;
|
this.gpbDirecional.TabStop = false;
|
||||||
this.gpbDirecional.Text = "Direcional";
|
this.gpbDirecional.Text = "Direcional";
|
||||||
|
|
@ -643,15 +655,17 @@
|
||||||
//
|
//
|
||||||
// gpbLocomocao
|
// gpbLocomocao
|
||||||
//
|
//
|
||||||
|
this.gpbLocomocao.Controls.Add(this.nudVelMin);
|
||||||
|
this.gpbLocomocao.Controls.Add(this.nudVelMax);
|
||||||
this.gpbLocomocao.Controls.Add(this.lblKmh2);
|
this.gpbLocomocao.Controls.Add(this.lblKmh2);
|
||||||
this.gpbLocomocao.Controls.Add(this.lblKmh1);
|
this.gpbLocomocao.Controls.Add(this.lblKmh1);
|
||||||
this.gpbLocomocao.Controls.Add(this.txtVelocidadeComErvas);
|
this.gpbLocomocao.Controls.Add(this.txtVelocidadeComErvas);
|
||||||
this.gpbLocomocao.Controls.Add(this.txtVelocidadeSemErvas);
|
this.gpbLocomocao.Controls.Add(this.txtVelocidadeSemErvas);
|
||||||
this.gpbLocomocao.Controls.Add(this.lblVelocidadeComErvas);
|
this.gpbLocomocao.Controls.Add(this.lblVelocidadeComErvas);
|
||||||
this.gpbLocomocao.Controls.Add(this.lblVelocidadeSemErvas);
|
this.gpbLocomocao.Controls.Add(this.lblVelocidadeSemErvas);
|
||||||
this.gpbLocomocao.Location = new System.Drawing.Point(6, 6);
|
this.gpbLocomocao.Location = new System.Drawing.Point(3, 9);
|
||||||
this.gpbLocomocao.Name = "gpbLocomocao";
|
this.gpbLocomocao.Name = "gpbLocomocao";
|
||||||
this.gpbLocomocao.Size = new System.Drawing.Size(550, 88);
|
this.gpbLocomocao.Size = new System.Drawing.Size(529, 88);
|
||||||
this.gpbLocomocao.TabIndex = 0;
|
this.gpbLocomocao.TabIndex = 0;
|
||||||
this.gpbLocomocao.TabStop = false;
|
this.gpbLocomocao.TabStop = false;
|
||||||
this.gpbLocomocao.Text = "Locomoção";
|
this.gpbLocomocao.Text = "Locomoção";
|
||||||
|
|
@ -676,18 +690,20 @@
|
||||||
//
|
//
|
||||||
// txtVelocidadeComErvas
|
// txtVelocidadeComErvas
|
||||||
//
|
//
|
||||||
this.txtVelocidadeComErvas.Location = new System.Drawing.Point(358, 55);
|
this.txtVelocidadeComErvas.Location = new System.Drawing.Point(416, 55);
|
||||||
this.txtVelocidadeComErvas.Name = "txtVelocidadeComErvas";
|
this.txtVelocidadeComErvas.Name = "txtVelocidadeComErvas";
|
||||||
this.txtVelocidadeComErvas.Size = new System.Drawing.Size(100, 20);
|
this.txtVelocidadeComErvas.ReadOnly = true;
|
||||||
|
this.txtVelocidadeComErvas.Size = new System.Drawing.Size(42, 20);
|
||||||
this.txtVelocidadeComErvas.TabIndex = 3;
|
this.txtVelocidadeComErvas.TabIndex = 3;
|
||||||
this.txtVelocidadeComErvas.Text = "3";
|
this.txtVelocidadeComErvas.Text = "3";
|
||||||
this.txtVelocidadeComErvas.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.txtVelocidadeComErvas.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
//
|
//
|
||||||
// txtVelocidadeSemErvas
|
// txtVelocidadeSemErvas
|
||||||
//
|
//
|
||||||
this.txtVelocidadeSemErvas.Location = new System.Drawing.Point(358, 18);
|
this.txtVelocidadeSemErvas.Location = new System.Drawing.Point(416, 18);
|
||||||
this.txtVelocidadeSemErvas.Name = "txtVelocidadeSemErvas";
|
this.txtVelocidadeSemErvas.Name = "txtVelocidadeSemErvas";
|
||||||
this.txtVelocidadeSemErvas.Size = new System.Drawing.Size(100, 20);
|
this.txtVelocidadeSemErvas.ReadOnly = true;
|
||||||
|
this.txtVelocidadeSemErvas.Size = new System.Drawing.Size(42, 20);
|
||||||
this.txtVelocidadeSemErvas.TabIndex = 2;
|
this.txtVelocidadeSemErvas.TabIndex = 2;
|
||||||
this.txtVelocidadeSemErvas.Text = "5";
|
this.txtVelocidadeSemErvas.Text = "5";
|
||||||
this.txtVelocidadeSemErvas.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.txtVelocidadeSemErvas.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
|
|
@ -821,6 +837,90 @@
|
||||||
this.lblDescricao.TabIndex = 7;
|
this.lblDescricao.TabIndex = 7;
|
||||||
this.lblDescricao.Text = "Descrição";
|
this.lblDescricao.Text = "Descrição";
|
||||||
//
|
//
|
||||||
|
// pnlParametros
|
||||||
|
//
|
||||||
|
this.pnlParametros.AutoScroll = true;
|
||||||
|
this.pnlParametros.Controls.Add(this.gpbSensoriamento);
|
||||||
|
this.pnlParametros.Controls.Add(this.gpbLocomocao);
|
||||||
|
this.pnlParametros.Controls.Add(this.gpbAtuador);
|
||||||
|
this.pnlParametros.Controls.Add(this.gpbDirecional);
|
||||||
|
this.pnlParametros.Location = new System.Drawing.Point(6, 6);
|
||||||
|
this.pnlParametros.Name = "pnlParametros";
|
||||||
|
this.pnlParametros.Size = new System.Drawing.Size(552, 378);
|
||||||
|
this.pnlParametros.TabIndex = 8;
|
||||||
|
//
|
||||||
|
// gpbSensoriamento
|
||||||
|
//
|
||||||
|
this.gpbSensoriamento.Controls.Add(this.rtbDescricao);
|
||||||
|
this.gpbSensoriamento.Controls.Add(this.label1);
|
||||||
|
this.gpbSensoriamento.Controls.Add(this.cmbConfiguracaoUltrassom);
|
||||||
|
this.gpbSensoriamento.Controls.Add(this.btnConfigurar);
|
||||||
|
this.gpbSensoriamento.Enabled = false;
|
||||||
|
this.gpbSensoriamento.Location = new System.Drawing.Point(3, 369);
|
||||||
|
this.gpbSensoriamento.Name = "gpbSensoriamento";
|
||||||
|
this.gpbSensoriamento.Size = new System.Drawing.Size(529, 88);
|
||||||
|
this.gpbSensoriamento.TabIndex = 6;
|
||||||
|
this.gpbSensoriamento.TabStop = false;
|
||||||
|
this.gpbSensoriamento.Text = "Sensoriamento";
|
||||||
|
//
|
||||||
|
// btnConfigurar
|
||||||
|
//
|
||||||
|
this.btnConfigurar.Location = new System.Drawing.Point(405, 50);
|
||||||
|
this.btnConfigurar.Name = "btnConfigurar";
|
||||||
|
this.btnConfigurar.Size = new System.Drawing.Size(100, 23);
|
||||||
|
this.btnConfigurar.TabIndex = 11;
|
||||||
|
this.btnConfigurar.Text = "Configurar";
|
||||||
|
this.btnConfigurar.UseVisualStyleBackColor = true;
|
||||||
|
this.btnConfigurar.Click += new System.EventHandler(this.btnConfigurar_Click);
|
||||||
|
//
|
||||||
|
// cmbConfiguracaoUltrassom
|
||||||
|
//
|
||||||
|
this.cmbConfiguracaoUltrassom.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cmbConfiguracaoUltrassom.FormattingEnabled = true;
|
||||||
|
this.cmbConfiguracaoUltrassom.Location = new System.Drawing.Point(358, 19);
|
||||||
|
this.cmbConfiguracaoUltrassom.Name = "cmbConfiguracaoUltrassom";
|
||||||
|
this.cmbConfiguracaoUltrassom.Size = new System.Drawing.Size(146, 21);
|
||||||
|
this.cmbConfiguracaoUltrassom.TabIndex = 10;
|
||||||
|
this.cmbConfiguracaoUltrassom.SelectedIndexChanged += new System.EventHandler(this.cmbConfiguracaoUltrassom_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(6, 22);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(178, 13);
|
||||||
|
this.label1.TabIndex = 6;
|
||||||
|
this.label1.Text = "Configuração do sensor ultrassonico";
|
||||||
|
//
|
||||||
|
// rtbDescricao
|
||||||
|
//
|
||||||
|
this.rtbDescricao.BackColor = System.Drawing.SystemColors.Window;
|
||||||
|
this.rtbDescricao.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||||
|
this.rtbDescricao.Location = new System.Drawing.Point(9, 38);
|
||||||
|
this.rtbDescricao.Name = "rtbDescricao";
|
||||||
|
this.rtbDescricao.ReadOnly = true;
|
||||||
|
this.rtbDescricao.Size = new System.Drawing.Size(343, 44);
|
||||||
|
this.rtbDescricao.TabIndex = 12;
|
||||||
|
this.rtbDescricao.Text = "";
|
||||||
|
//
|
||||||
|
// nudVelMax
|
||||||
|
//
|
||||||
|
this.nudVelMax.Location = new System.Drawing.Point(358, 19);
|
||||||
|
this.nudVelMax.Name = "nudVelMax";
|
||||||
|
this.nudVelMax.Size = new System.Drawing.Size(52, 20);
|
||||||
|
this.nudVelMax.TabIndex = 6;
|
||||||
|
this.nudVelMax.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
|
this.nudVelMax.ValueChanged += new System.EventHandler(this.nudVelMax_ValueChanged);
|
||||||
|
//
|
||||||
|
// nudVelMin
|
||||||
|
//
|
||||||
|
this.nudVelMin.Location = new System.Drawing.Point(358, 55);
|
||||||
|
this.nudVelMin.Name = "nudVelMin";
|
||||||
|
this.nudVelMin.Size = new System.Drawing.Size(52, 20);
|
||||||
|
this.nudVelMin.TabIndex = 7;
|
||||||
|
this.nudVelMin.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
|
this.nudVelMin.ValueChanged += new System.EventHandler(this.nudVelMin_ValueChanged);
|
||||||
|
//
|
||||||
// frmAjustesOperacao
|
// frmAjustesOperacao
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
|
@ -852,6 +952,11 @@
|
||||||
this.gpbLocomocao.PerformLayout();
|
this.gpbLocomocao.PerformLayout();
|
||||||
this.tabMapa.ResumeLayout(false);
|
this.tabMapa.ResumeLayout(false);
|
||||||
this.tabMapa.PerformLayout();
|
this.tabMapa.PerformLayout();
|
||||||
|
this.pnlParametros.ResumeLayout(false);
|
||||||
|
this.gpbSensoriamento.ResumeLayout(false);
|
||||||
|
this.gpbSensoriamento.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.nudVelMax)).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.nudVelMin)).EndInit();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
|
|
||||||
|
|
@ -925,5 +1030,13 @@
|
||||||
private System.Windows.Forms.CheckBox chbA05;
|
private System.Windows.Forms.CheckBox chbA05;
|
||||||
private System.Windows.Forms.RichTextBox rtbKnt;
|
private System.Windows.Forms.RichTextBox rtbKnt;
|
||||||
private System.Windows.Forms.CheckBox chbKnt;
|
private System.Windows.Forms.CheckBox chbKnt;
|
||||||
|
private System.Windows.Forms.Panel pnlParametros;
|
||||||
|
private System.Windows.Forms.GroupBox gpbSensoriamento;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.ComboBox cmbConfiguracaoUltrassom;
|
||||||
|
private System.Windows.Forms.Button btnConfigurar;
|
||||||
|
private System.Windows.Forms.RichTextBox rtbDescricao;
|
||||||
|
private System.Windows.Forms.NumericUpDown nudVelMin;
|
||||||
|
private System.Windows.Forms.NumericUpDown nudVelMax;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using AgroBase.Models;
|
using AgroBase.Forms;
|
||||||
|
using AgroBase.Models;
|
||||||
using AgroBase.Services;
|
using AgroBase.Services;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
@ -14,6 +15,7 @@ namespace AgroMonitor.Forms
|
||||||
{
|
{
|
||||||
Timer tmrDadosMapa = new Timer();
|
Timer tmrDadosMapa = new Timer();
|
||||||
string path = Variaveis.CaminhoSistema + Variaveis.CaminhoOperacoes + "\\" + MapasVariaveisModel.NomeArquivoMapaInterativoSaida;
|
string path = Variaveis.CaminhoSistema + Variaveis.CaminhoOperacoes + "\\" + MapasVariaveisModel.NomeArquivoMapaInterativoSaida;
|
||||||
|
UltrasonicA05Configuracoes ConfigUltrassom = UltrasonicA05Helper.CarregarConfiguracaoPadrao(ConfiguracaoSensorUltrassonico.NaoUtilizado);
|
||||||
|
|
||||||
public frmAjustesOperacao()
|
public frmAjustesOperacao()
|
||||||
{
|
{
|
||||||
|
|
@ -22,6 +24,10 @@ namespace AgroMonitor.Forms
|
||||||
|
|
||||||
private void frmAjustesOperacao_Load(object sender, EventArgs e)
|
private void frmAjustesOperacao_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
cmbConfiguracaoUltrassom.Items.Clear();
|
||||||
|
cmbConfiguracaoUltrassom.Items.AddRange(Enum.GetNames(typeof(ConfiguracaoSensorUltrassonico)));
|
||||||
|
cmbConfiguracaoUltrassom.SelectedIndex = 0;
|
||||||
|
|
||||||
cmbModosOperacao.Items.Clear();
|
cmbModosOperacao.Items.Clear();
|
||||||
cmbModosOperacao.Items.AddRange(Enum.GetNames(typeof(ModoOperacao)));
|
cmbModosOperacao.Items.AddRange(Enum.GetNames(typeof(ModoOperacao)));
|
||||||
cmbModosOperacao.SelectedIndex = 0;
|
cmbModosOperacao.SelectedIndex = 0;
|
||||||
|
|
@ -53,18 +59,26 @@ namespace AgroMonitor.Forms
|
||||||
chb.Checked = Variaveis.OperacaoEmAndamento.ModulosMandatorios.Any(x => x.Dispositivo == Dispositivo);
|
chb.Checked = Variaveis.OperacaoEmAndamento.ModulosMandatorios.Any(x => x.Dispositivo == Dispositivo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double velMaxRoda = MovimentacaoModel.CalculaVelocidadeRPM(VariaveisEquipamento.RPM_Max_Roda);
|
||||||
double velocidadeMax = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.Controle.RPM_Max);
|
double velocidadeMax = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.Controle.RPM_Max);
|
||||||
|
int percentMax = (int)FuncoesMatematicas.Map(velocidadeMax, 0.0, velMaxRoda, 0, 100.0);
|
||||||
double velocidadeMin = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.Controle.RPM_Min);
|
double velocidadeMin = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.Controle.RPM_Min);
|
||||||
|
int percentMin = (int)FuncoesMatematicas.Map(velocidadeMin, 0.0, velMaxRoda, 0, 100.0);
|
||||||
|
|
||||||
txtDescricao.Text = Variaveis.OperacaoEmAndamento.Descricao;
|
txtDescricao.Text = Variaveis.OperacaoEmAndamento.Descricao;
|
||||||
txtVelocidadeSemErvas.Text = velocidadeMax.ToString("0.00");
|
nudVelMax.Value = percentMax;
|
||||||
txtVelocidadeComErvas.Text = velocidadeMin.ToString("0.00");
|
nudVelMin.Value = percentMin;
|
||||||
txtAnguloMaximo.Text = Variaveis.OperacaoEmAndamento.Controle.Angulo_Max.ToString("0");
|
txtAnguloMaximo.Text = Variaveis.OperacaoEmAndamento.Controle.Angulo_Max.ToString("0");
|
||||||
txtVelocidadeDirecional.Text = Variaveis.OperacaoEmAndamento.Controle.VelocidadeMP.ToString("0");
|
txtVelocidadeDirecional.Text = Variaveis.OperacaoEmAndamento.Controle.VelocidadeMP.ToString("0");
|
||||||
txtPercentualAtuacao.Text = (Variaveis.OperacaoEmAndamento.Controle.PercentualInicioPulverizacao * 100).ToString("0");
|
txtPercentualAtuacao.Text = (Variaveis.OperacaoEmAndamento.Controle.PercentualInicioPulverizacao * 100).ToString("0");
|
||||||
txtCapacidadeReservatorio.Text = Variaveis.OperacaoEmAndamento.CapacidadeReservatorio.ToString("0");
|
txtCapacidadeReservatorio.Text = Variaveis.OperacaoEmAndamento.CapacidadeReservatorio.ToString("0");
|
||||||
txtPressaoLinha.Text = Variaveis.OperacaoEmAndamento.Controle.PressaoLinha.ToString("0");
|
txtPressaoLinha.Text = Variaveis.OperacaoEmAndamento.Controle.PressaoLinha.ToString("0");
|
||||||
txtDuracaoAtuacao.Text = Variaveis.OperacaoEmAndamento.Controle.TempoAtuacao.ToString("0");
|
txtDuracaoAtuacao.Text = Variaveis.OperacaoEmAndamento.Controle.TempoAtuacao.ToString("0");
|
||||||
|
if (Variaveis.OperacaoEmAndamento.DispSen != null)
|
||||||
|
{
|
||||||
|
ConfigUltrassom = Variaveis.OperacaoEmAndamento.DispSen.Dados.ConfiguracaoSensorUltrassom;
|
||||||
|
cmbConfiguracaoUltrassom.SelectedIndex = (int)ConfigUltrassom.Configuracao;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnProximo_Click(object sender, EventArgs e)
|
private void btnProximo_Click(object sender, EventArgs e)
|
||||||
|
|
@ -125,8 +139,9 @@ namespace AgroMonitor.Forms
|
||||||
txtPercentualAtuacao.Text,
|
txtPercentualAtuacao.Text,
|
||||||
txtAnguloMaximo.Text,
|
txtAnguloMaximo.Text,
|
||||||
txtVelocidadeDirecional.Text,
|
txtVelocidadeDirecional.Text,
|
||||||
txtVelocidadeSemErvas.Text,
|
(int)nudVelMax.Value,
|
||||||
txtVelocidadeComErvas.Text
|
(int)nudVelMin.Value,
|
||||||
|
ConfigUltrassom
|
||||||
);
|
);
|
||||||
if (!sucesso)
|
if (!sucesso)
|
||||||
{
|
{
|
||||||
|
|
@ -185,8 +200,44 @@ namespace AgroMonitor.Forms
|
||||||
Utilizar = chb.Checked,
|
Utilizar = chb.Checked,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Dispositivo == T_Code.A05)
|
||||||
|
{
|
||||||
|
gpbSensoriamento.Enabled = chb.Checked;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void btnConfigurar_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
frmA05Config frm = new frmA05Config(ConfigUltrassom);
|
||||||
|
frm.ShowDialog();
|
||||||
|
ConfigUltrassom = frm.ConfiguracaoSensores;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cmbConfiguracaoUltrassom_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ConfiguracaoSensorUltrassonico Config = (ConfiguracaoSensorUltrassonico)cmbConfiguracaoUltrassom.SelectedIndex;
|
||||||
|
rtbDescricao.Text = UltrasonicA05Helper.DescricaoConfiguracoes[Config];
|
||||||
|
if (Config != ConfigUltrassom.Configuracao)
|
||||||
|
{
|
||||||
|
ConfigUltrassom = UltrasonicA05Helper.CarregarConfiguracaoPadrao(Config);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void nudVelMax_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
int Percentual = (int)((NumericUpDown)sender).Value;
|
||||||
|
int RPM = Convert.ToInt32((Percentual / 100.0) * VariaveisEquipamento.RPM_Max_Roda);
|
||||||
|
double Velocidade = MovimentacaoModel.CalculaVelocidadeRPM(RPM);
|
||||||
|
txtVelocidadeSemErvas.Text = Velocidade.ToString("0.00");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void nudVelMin_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
int Percentual = (int)((NumericUpDown)sender).Value;
|
||||||
|
int RPM = Convert.ToInt32((Percentual / 100.0) * VariaveisEquipamento.RPM_Max_Roda);
|
||||||
|
double Velocidade = MovimentacaoModel.CalculaVelocidadeRPM(RPM);
|
||||||
|
txtVelocidadeComErvas.Text = Velocidade.ToString("0.00");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,25 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||||
</startup>
|
</startup>
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
|
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
|
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1"/>
|
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
|
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
|
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
|
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
|
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,25 +1,25 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||||
</startup>
|
</startup>
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
|
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1"/>
|
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
|
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
|
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
|
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
|
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
|
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,49 +0,0 @@
|
||||||
from flask import Flask, request, jsonify
|
|
||||||
from flask_cors import CORS
|
|
||||||
import sys
|
|
||||||
|
|
||||||
apiPort = sys.argv[1]
|
|
||||||
getCordenadasEndpoint = sys.argv[2]
|
|
||||||
setCordenadasEndpoint = sys.argv[3]
|
|
||||||
getRuasSelecionadasEndpoint = sys.argv[4]
|
|
||||||
setRuasSelecionadasEndpoint = sys.argv[5]
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
|
||||||
CORS(app) # Isso habilita o CORS para todas as rotas e origens
|
|
||||||
|
|
||||||
coordenadas = {}
|
|
||||||
ruas_selecionadas = []
|
|
||||||
|
|
||||||
@app.route(setCordenadasEndpoint, methods=['POST'])
|
|
||||||
def receber_coordenadas():
|
|
||||||
dados = request.json
|
|
||||||
id = dados.get('id')
|
|
||||||
lat = dados.get('latitude')
|
|
||||||
lon = dados.get('longitude')
|
|
||||||
|
|
||||||
coordenadas[id] = {'latitude': lat, 'longitude': lon}
|
|
||||||
|
|
||||||
return jsonify({'status': 'Coordenadas recebidas com sucesso!'})
|
|
||||||
|
|
||||||
@app.route(getCordenadasEndpoint, methods=['GET'])
|
|
||||||
def servir_coordenadas(id):
|
|
||||||
if id in coordenadas:
|
|
||||||
return jsonify(coordenadas[id])
|
|
||||||
else:
|
|
||||||
return jsonify({'error': 'Coordenadas não encontradas!'}), 404
|
|
||||||
|
|
||||||
@app.route(setRuasSelecionadasEndpoint, methods=['POST'])
|
|
||||||
def receber_ruas_selecionadas():
|
|
||||||
dados = request.json
|
|
||||||
ids = dados.get('ids')
|
|
||||||
global ruas_selecionadas
|
|
||||||
ruas_selecionadas = ids
|
|
||||||
|
|
||||||
return jsonify({'status': 'Ruas selecionadas recebidas com sucesso!'})
|
|
||||||
|
|
||||||
@app.route(getRuasSelecionadasEndpoint, methods=['GET'])
|
|
||||||
def servir_ruas_selecionadas():
|
|
||||||
return jsonify(ruas_selecionadas)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
app.run(host='0.0.0.0', port=apiPort, debug=True)
|
|
||||||
|
|
@ -1,209 +0,0 @@
|
||||||
import geopandas as gpd
|
|
||||||
import json
|
|
||||||
import sys
|
|
||||||
import folium
|
|
||||||
import requests
|
|
||||||
import re
|
|
||||||
|
|
||||||
def internet_disponivel():
|
|
||||||
"""Verifica se há conexão com a internet."""
|
|
||||||
url = 'http://www.google.com/'
|
|
||||||
timeout = 5
|
|
||||||
try:
|
|
||||||
_ = requests.get(url, timeout=timeout)
|
|
||||||
return True
|
|
||||||
except requests.ConnectionError:
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Argumentos e configurações iniciais
|
|
||||||
pathFiles = sys.argv[1]
|
|
||||||
fileName = sys.argv[2]
|
|
||||||
outputName = sys.argv[3]
|
|
||||||
outputMapName = sys.argv[4]
|
|
||||||
topico_gps = sys.argv[5]
|
|
||||||
pastaSaida = 'Python/Output/'
|
|
||||||
|
|
||||||
center = [0, 0]
|
|
||||||
|
|
||||||
# Verificar se há conexão com a internet
|
|
||||||
if internet_disponivel():
|
|
||||||
m = folium.Map(location=center, zoom_start=12)
|
|
||||||
else:
|
|
||||||
m = folium.Map(location=center, zoom_start=12, tiles=None)
|
|
||||||
|
|
||||||
# Salvar o mapa interativo em um arquivo HTML
|
|
||||||
m.save(pastaSaida + outputMapName)
|
|
||||||
|
|
||||||
|
|
||||||
# Caminho completo para o arquivo HTML gerado
|
|
||||||
caminho_completo_html = pastaSaida + outputMapName
|
|
||||||
|
|
||||||
# Abrir o arquivo HTML para leitura e escrita
|
|
||||||
with open(caminho_completo_html, 'r+') as arquivo_html:
|
|
||||||
# Ler o conteúdo do arquivo
|
|
||||||
conteudo_html = arquivo_html.read()
|
|
||||||
|
|
||||||
# Usar expressão regular para encontrar o ID do mapa
|
|
||||||
padrao_id_mapa = re.compile(r'id="map_(.*?)"')
|
|
||||||
resultado_busca = padrao_id_mapa.search(conteudo_html)
|
|
||||||
|
|
||||||
# Verificar se encontrou um ID de mapa
|
|
||||||
if resultado_busca:
|
|
||||||
id_mapa = 'map_' + resultado_busca.group(1)
|
|
||||||
else:
|
|
||||||
raise ValueError("Não foi possível encontrar o ID do mapa no arquivo HTML.")
|
|
||||||
|
|
||||||
# Script JavaScript para adicionar ao HTML, com o ID do mapa substituído
|
|
||||||
script_desenha_trajeotria = f"""
|
|
||||||
<script>
|
|
||||||
function trajeto_json_onEachFeature(feature, layer) {{
|
|
||||||
layer.on({{
|
|
||||||
}});
|
|
||||||
}};
|
|
||||||
var trajeto_json = L.geoJson(null, {{
|
|
||||||
onEachFeature: trajeto_json_onEachFeature,
|
|
||||||
style: function(feature) {{
|
|
||||||
return {{color: 'red'}};
|
|
||||||
}}
|
|
||||||
}}
|
|
||||||
);
|
|
||||||
function trajeto_json_add (data) {{
|
|
||||||
trajeto_json.addData(data);
|
|
||||||
}}
|
|
||||||
trajeto_json_add({{"features": []}});
|
|
||||||
|
|
||||||
trajeto_json.addTo({id_mapa});
|
|
||||||
|
|
||||||
function adicionarGeometria(novaGeometria) {{
|
|
||||||
trajeto_json.addData(novaGeometria);
|
|
||||||
}}
|
|
||||||
|
|
||||||
function saoCoordenadasIguais(coord1, coord2, tolerancia) {{
|
|
||||||
return Math.abs(coord1[0] - coord2[0]) < tolerancia && Math.abs(coord1[1] - coord2[1]) < tolerancia;
|
|
||||||
}}
|
|
||||||
|
|
||||||
function adicionarCoordenada(idGeometria, novaCoordenada) {{
|
|
||||||
var feature = trajeto_json.toGeoJSON().features.find(f => f.id === idGeometria);
|
|
||||||
if (feature) {{
|
|
||||||
var ultima = [0.0,0.0];
|
|
||||||
if (feature.geometry.coordinates.length > 0) {{
|
|
||||||
ultima = feature.geometry.coordinates[feature.geometry.coordinates.length - 1];
|
|
||||||
}}
|
|
||||||
if (!saoCoordenadasIguais(ultima, novaCoordenada, 0.000001)) {{
|
|
||||||
feature.geometry.coordinates.push(novaCoordenada);
|
|
||||||
var ft = feature;
|
|
||||||
trajeto_json.clearLayers();
|
|
||||||
trajeto_json.addData(ft);
|
|
||||||
}}
|
|
||||||
|
|
||||||
}} else {{
|
|
||||||
console.log("Feature com ID " + idGeometria + " não encontrada.");
|
|
||||||
}}
|
|
||||||
}}
|
|
||||||
|
|
||||||
adicionarGeometria({{
|
|
||||||
"type": "Feature",
|
|
||||||
"geometry": {{
|
|
||||||
"type": "LineString",
|
|
||||||
"coordinates": []
|
|
||||||
}},
|
|
||||||
"properties": {{"Dist1": 0.0, "Dist2": 0.0, "Id": 1517, "Length": 21.724783283, "Name": "Projeto"}},
|
|
||||||
"id": "Tj"
|
|
||||||
}});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Script JavaScript para adicionar ao HTML, com o ID do mapa substituído
|
|
||||||
script_atualizacao_marcador = f"""
|
|
||||||
<script src="folium/mqtt.min.js"></script>
|
|
||||||
<script src="folium/leaflet.rotatedMarker.js"></script>
|
|
||||||
<script>
|
|
||||||
let posicaoAtual = {{
|
|
||||||
lat: 0,
|
|
||||||
long: 0
|
|
||||||
}};
|
|
||||||
|
|
||||||
var customIcon = L.icon({{
|
|
||||||
iconUrl: 'folium/images/position_marker.png',
|
|
||||||
iconSize: [32, 32],
|
|
||||||
iconAnchor: [16, 16],
|
|
||||||
popupAnchor: [0, -16]
|
|
||||||
}});
|
|
||||||
|
|
||||||
var marcadorDinamico = L.marker([0, 0], {{
|
|
||||||
icon: customIcon
|
|
||||||
}}).addTo({id_mapa});
|
|
||||||
|
|
||||||
// Conectar ao broker MQTT
|
|
||||||
const client = mqtt.connect('ws://localhost:9001'); // Use wss para conexão segura
|
|
||||||
|
|
||||||
// Quando conectado, inscreva-se no tópico desejado
|
|
||||||
client.on('connect', function () {{
|
|
||||||
console.log('Conectado ao broker MQTT');
|
|
||||||
|
|
||||||
// Inscrever-se no tópico
|
|
||||||
client.subscribe('{topico_gps}', function (err) {{
|
|
||||||
if (!err) {{
|
|
||||||
console.log("Inscrição bem-sucedida no tópico");
|
|
||||||
}} else {{
|
|
||||||
console.error("Falha na inscrição do tópico", err);
|
|
||||||
}}
|
|
||||||
}});
|
|
||||||
}});
|
|
||||||
|
|
||||||
// Lidar com mensagens recebidas para o tópico inscrito
|
|
||||||
client.on('message', function (topic, message) {{
|
|
||||||
// A mensagem é um Buffer, converta para string ou objeto conforme necessário
|
|
||||||
//console.log(`Mensagem recebida no tópico '${{topic}}': ${{message.toString()}}`);
|
|
||||||
var dados = JSON.parse(message);
|
|
||||||
var novaLatitude = dados.latitude;
|
|
||||||
var novaLongitude = dados.longitude;
|
|
||||||
var novaPosicao = [novaLatitude, novaLongitude];
|
|
||||||
marcadorDinamico.setLatLng(novaPosicao);
|
|
||||||
|
|
||||||
var angulo = dados.orientacao;
|
|
||||||
|
|
||||||
posicaoAtual.lat = novaPosicao[0];
|
|
||||||
posicaoAtual.long = novaPosicao[1];
|
|
||||||
|
|
||||||
// Rotacionar o marcador para o angulo calculado
|
|
||||||
marcadorDinamico.setRotationAngle(angulo);
|
|
||||||
|
|
||||||
adicionarCoordenada("Tj", [novaLongitude, novaLatitude]);
|
|
||||||
{id_mapa}.setView(novaPosicao, {id_mapa}.getZoom());
|
|
||||||
}});
|
|
||||||
|
|
||||||
function calcularOrientacao(P1latitude, P1longitude, P2latitude, P2longitude) {{
|
|
||||||
// Converter latitudes e longitudes de graus para radianos
|
|
||||||
const latA = P1latitude * (Math.PI / 180.0);
|
|
||||||
const lonA = P1longitude * (Math.PI / 180.0);
|
|
||||||
const latB = P2latitude * (Math.PI / 180.0);
|
|
||||||
const lonB = P2longitude * (Math.PI / 180.0);
|
|
||||||
|
|
||||||
// Calcular a diferença de longitude
|
|
||||||
const deltaLon = lonB - lonA;
|
|
||||||
|
|
||||||
// Calcular a direção
|
|
||||||
const y = Math.sin(deltaLon) * Math.cos(latB);
|
|
||||||
const x = Math.cos(latA) * Math.sin(latB) - Math.sin(latA) * Math.cos(latB) * Math.cos(deltaLon);
|
|
||||||
const direcaoRadianos = Math.atan2(y, x);
|
|
||||||
|
|
||||||
// Converter a direção de radianos para graus
|
|
||||||
let direcaoGraus = direcaoRadianos * (180.0 / Math.PI);
|
|
||||||
|
|
||||||
// Normalizar a direção para que esteja no intervalo de 0 a 360 graus
|
|
||||||
direcaoGraus = (direcaoGraus + 360) % 360;
|
|
||||||
|
|
||||||
return direcaoGraus;
|
|
||||||
}}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Inserir o script no conteúdo HTML
|
|
||||||
conteudo_atualizado = conteudo_html.replace('</html>', script_desenha_trajeotria + script_atualizacao_marcador + '</html>')
|
|
||||||
|
|
||||||
# Agora, reabrir o arquivo para escrita e sobrescrever o conteúdo com a versão atualizada
|
|
||||||
with open(caminho_completo_html, 'w') as arquivo_html:
|
|
||||||
arquivo_html.write(conteudo_atualizado)
|
|
||||||
|
|
@ -1,123 +0,0 @@
|
||||||
import cv2
|
|
||||||
import numpy as np
|
|
||||||
from flask import Flask, Response, request
|
|
||||||
import json
|
|
||||||
import time
|
|
||||||
import threading
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
|
|
||||||
import uuid
|
|
||||||
import paho.mqtt.client as mqtt
|
|
||||||
mqtt_client = mqtt.Client(f"client_weed_detector_{uuid.uuid4()}")
|
|
||||||
mqtt_client.connect("localhost", port=1883)
|
|
||||||
|
|
||||||
|
|
||||||
max_readings = int(sys.argv[1])
|
|
||||||
porta = sys.argv[2]
|
|
||||||
url = sys.argv[3]
|
|
||||||
arquivoSaida = sys.argv[4]
|
|
||||||
mostrar_linhas = sys.argv[5] == "1"
|
|
||||||
mqtt_topic = sys.argv[6]
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
|
||||||
|
|
||||||
json_data = None
|
|
||||||
output_folder = 'Python/Output/'
|
|
||||||
|
|
||||||
# Função para detecção de objetos usando YOLO e salvar as coordenadas em um arquivo JSON
|
|
||||||
def detect_objects(conf_threshold, nms_threshold, _camera_index):
|
|
||||||
# Definir intervalos de cor verde no espaço HSV
|
|
||||||
lower_green = np.array([35, 50, 100]) # Valores de limite inferior (Hue, Saturation, Value)
|
|
||||||
upper_green = np.array([90, 255, 255]) # Valores de limite superior (Hue, Saturation, Value)
|
|
||||||
|
|
||||||
#cap = cv2.VideoCapture(_camera_index, cv2.CAP_DSHOW)
|
|
||||||
cap = cv2.VideoCapture(_camera_index, cv2.CAP_MSMF)
|
|
||||||
width = cap.get(cv2.CAP_PROP_FRAME_WIDTH)
|
|
||||||
height = cap.get(cv2.CAP_PROP_FRAME_HEIGHT)
|
|
||||||
readings = []
|
|
||||||
|
|
||||||
while True:
|
|
||||||
ret, frame = cap.read()
|
|
||||||
if not ret:
|
|
||||||
break
|
|
||||||
|
|
||||||
# Converter a imagem de BGR para HSV
|
|
||||||
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
|
|
||||||
|
|
||||||
# Criar uma máscara para os pixels verdes na faixa especificada
|
|
||||||
mask = cv2.inRange(hsv, lower_green, upper_green)
|
|
||||||
|
|
||||||
# Encontrar os contornos na máscara
|
|
||||||
contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
|
|
||||||
current_readings = []
|
|
||||||
idx = 0 # Índice de detecção
|
|
||||||
for contour in contours:
|
|
||||||
area = cv2.contourArea(contour)
|
|
||||||
if area > 1000: # Filtrar áreas menores que um valor específico (ajuste conforme necessário)
|
|
||||||
x, y, w, h = cv2.boundingRect(contour)
|
|
||||||
cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)
|
|
||||||
cv2.putText(frame, f'Verde {idx}', (x, y - 5), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2)
|
|
||||||
|
|
||||||
# Salvar as informações da detecção
|
|
||||||
detection_info = {
|
|
||||||
'id': int(idx),
|
|
||||||
'descricao': 'Green',
|
|
||||||
'x': int(x),
|
|
||||||
'y': int(y),
|
|
||||||
'largura': int(w),
|
|
||||||
'altura': int(h),
|
|
||||||
'confianca': 1.0 # Neste caso, confiança fixa para detecções baseadas em cores
|
|
||||||
}
|
|
||||||
current_readings.append(detection_info)
|
|
||||||
idx += 1
|
|
||||||
|
|
||||||
global json_data
|
|
||||||
|
|
||||||
# Atualizar os resultados
|
|
||||||
timestamp = time.time()
|
|
||||||
json_data = {'timestamp': timestamp, 'x_max': width, 'y_max': height, 'objetos': current_readings}
|
|
||||||
readings.append(json_data)
|
|
||||||
|
|
||||||
mqtt_client.publish(mqtt_topic, json.dumps(json_data).encode('utf-8'))
|
|
||||||
|
|
||||||
if not os.path.exists(output_folder):
|
|
||||||
os.makedirs(output_folder)
|
|
||||||
|
|
||||||
if len(readings) > max_readings:
|
|
||||||
readings.pop(0)
|
|
||||||
|
|
||||||
with open(output_folder + arquivoSaida, 'w') as file:
|
|
||||||
json.dump(readings, file, indent=4)
|
|
||||||
|
|
||||||
|
|
||||||
# Convertendo frame para JPEG e enviando via Flask
|
|
||||||
ret, buffer = cv2.imencode('.jpg', frame)
|
|
||||||
frame = buffer.tobytes()
|
|
||||||
yield (b'--frame\r\n'
|
|
||||||
b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n')
|
|
||||||
|
|
||||||
# Esta função é para confirmar que script está pronto para execução
|
|
||||||
def send_script_ready():
|
|
||||||
mqtt_client.publish(mqtt_topic, "OK")
|
|
||||||
|
|
||||||
# Iniciar o servidor Flask em uma thread separada
|
|
||||||
def run_flask_server():
|
|
||||||
app.run(host='0.0.0.0', port=porta, threaded=True, debug=False)
|
|
||||||
|
|
||||||
@app.route('/' + url, methods=['GET'])
|
|
||||||
def video_feed():
|
|
||||||
conf_threshold = float(request.args.get('conf_threshold'))
|
|
||||||
nms_threshold = float(request.args.get('nms_threshold'))
|
|
||||||
camera_index = int(request.args.get('camera_index'))
|
|
||||||
return Response(detect_objects(conf_threshold, nms_threshold, camera_index), mimetype='multipart/x-mixed-replace; boundary=frame')
|
|
||||||
|
|
||||||
|
|
||||||
# Iniciar o servidor
|
|
||||||
if __name__ == '__main__':
|
|
||||||
# Cria trhead separada para informar que o script iniciou com sucesso
|
|
||||||
mqtt_thread = threading.Thread(target=send_script_ready)
|
|
||||||
mqtt_thread.start()
|
|
||||||
|
|
||||||
# Inicia o servidor Flask na thread principal
|
|
||||||
run_flask_server()
|
|
||||||
|
|
@ -1,94 +0,0 @@
|
||||||
import cv2
|
|
||||||
import numpy as np
|
|
||||||
from flask import Flask, Response, request
|
|
||||||
import json
|
|
||||||
import time
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
max_readings = int(sys.argv[1])
|
|
||||||
porta = sys.argv[2]
|
|
||||||
url = sys.argv[3]
|
|
||||||
arquivoSaida = sys.argv[4]
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
|
||||||
|
|
||||||
def calculate_angle(reference_line, width):
|
|
||||||
[vx, vy, _, _] = cv2.fitLine(reference_line, cv2.DIST_L2, 0, 0.01, 0.01)
|
|
||||||
slope_reference = vy / vx
|
|
||||||
|
|
||||||
vertical_line = np.array([[width // 2, 0], [width // 2, 100]], dtype=np.float32)
|
|
||||||
[vx, vy, _, _] = cv2.fitLine(vertical_line, cv2.DIST_L2, 0, 0.01, 0.01)
|
|
||||||
slope_vertical = vy / vx
|
|
||||||
|
|
||||||
angle_radians = np.arctan((slope_reference - slope_vertical) / (1 + slope_reference * slope_vertical))
|
|
||||||
angle_degrees = np.degrees(angle_radians)
|
|
||||||
|
|
||||||
return angle_degrees
|
|
||||||
|
|
||||||
|
|
||||||
def detect_lines(_camera_index):
|
|
||||||
cap = cv2.VideoCapture(_camera_index)
|
|
||||||
|
|
||||||
readings = []
|
|
||||||
output_folder = 'Python/Output/'
|
|
||||||
|
|
||||||
while True:
|
|
||||||
ret, frame = cap.read()
|
|
||||||
if not ret:
|
|
||||||
break
|
|
||||||
|
|
||||||
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
|
|
||||||
|
|
||||||
# Defina o limite de intensidade desejado
|
|
||||||
_, thresh = cv2.threshold(gray, 50, 255, cv2.THRESH_BINARY) # Ajuste o valor do limite conforme necessário
|
|
||||||
|
|
||||||
contours, _ = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
|
|
||||||
|
|
||||||
if contours:
|
|
||||||
reference_line = max(contours, key=cv2.contourArea)
|
|
||||||
angle = calculate_angle(reference_line.squeeze(), frame.shape[1])[0]
|
|
||||||
|
|
||||||
#print(angle)
|
|
||||||
|
|
||||||
# Adicionando o ângulo atual à lista de dados
|
|
||||||
timestamp = time.time()
|
|
||||||
readings.append({"timestamp": timestamp, "angle": float(angle)})
|
|
||||||
|
|
||||||
# Mantendo apenas as últimas 10 leituras
|
|
||||||
if len(readings) > max_readings:
|
|
||||||
readings.pop(0)
|
|
||||||
|
|
||||||
# Salvando os dados em formato JSON no arquivo
|
|
||||||
if not os.path.exists(output_folder):
|
|
||||||
os.makedirs(output_folder)
|
|
||||||
|
|
||||||
if len(readings) == max_readings:
|
|
||||||
try:
|
|
||||||
with open(output_folder + arquivoSaida, 'w') as file:
|
|
||||||
json.dump({'frames': readings}, file)
|
|
||||||
except Exception as e:
|
|
||||||
print(f"Erro ao escrever no arquivo: {e}")
|
|
||||||
|
|
||||||
cv2.drawContours(frame, [reference_line], -1, (0, 255, 0), 2)
|
|
||||||
cv2.line(frame, (frame.shape[1] // 2, 0), (frame.shape[1] // 2, 100), (255, 0, 0), 2)
|
|
||||||
|
|
||||||
cv2.imshow('Video', frame)
|
|
||||||
if cv2.waitKey(1) & 0xFF == ord('q'):
|
|
||||||
break
|
|
||||||
|
|
||||||
# Convertendo frame para JPEG e enviando via Flask
|
|
||||||
ret, buffer = cv2.imencode('.jpg', frame)
|
|
||||||
frame = buffer.tobytes()
|
|
||||||
yield (b'--frame\r\n'
|
|
||||||
b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n')
|
|
||||||
|
|
||||||
|
|
||||||
@app.route('/' + url, methods=['GET'])
|
|
||||||
def video_feed():
|
|
||||||
camera_index = int(request.args.get('camera_index'))
|
|
||||||
return Response(detect_lines(camera_index), mimetype='multipart/x-mixed-replace; boundary=frame')
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
app.run(host='0.0.0.0', port=porta)
|
|
||||||
|
|
@ -1,218 +0,0 @@
|
||||||
import cv2
|
|
||||||
import numpy as np
|
|
||||||
from flask import Flask, Response, request
|
|
||||||
import json
|
|
||||||
import time
|
|
||||||
import socket
|
|
||||||
import threading
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
import math
|
|
||||||
|
|
||||||
# Variável para mostrar as linhas (True = mostrar, False = não mostrar)
|
|
||||||
max_readings = int(sys.argv[1])
|
|
||||||
porta = sys.argv[2]
|
|
||||||
url = sys.argv[3]
|
|
||||||
arquivoSaida = sys.argv[4]
|
|
||||||
mostrar_linhas = sys.argv[5] == "1"
|
|
||||||
socket_porta = int(sys.argv[6])
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
|
||||||
|
|
||||||
# Função para calcular o ângulo entre duas linhas
|
|
||||||
def calcular_angulo(linha1, linha2):
|
|
||||||
# Extraia os elementos individuais dos arrays NumPy
|
|
||||||
try:
|
|
||||||
angulo1 = math.atan2(float(linha1[1]) - float(linha1[3]), float(linha1[0]) - float(linha1[2]))
|
|
||||||
except:
|
|
||||||
angulo1 = math.atan2(float(linha1[1][0]) - float(linha1[3][0]), float(linha1[0][0]) - float(linha1[2][0]))
|
|
||||||
|
|
||||||
try:
|
|
||||||
angulo2 = math.atan2(float(linha2[1]) - float(linha2[3]), float(linha2[0]) - float(linha2[2]))
|
|
||||||
except:
|
|
||||||
angulo2 = math.atan2(float(linha2[1][0]) - float(linha2[3][0]), float(linha2[0][0]) - float(linha2[2][0]))
|
|
||||||
|
|
||||||
angulo = math.degrees(angulo1 - angulo2)
|
|
||||||
angulo = (angulo + 360) % 360
|
|
||||||
if angulo > 180:
|
|
||||||
angulo -= 360
|
|
||||||
return angulo
|
|
||||||
|
|
||||||
# Função para desenhar as linhas na imagem
|
|
||||||
def desenhar_linhas(frame, altura, largura, esquerda_x, direita_x, mostrar_linhas):
|
|
||||||
if mostrar_linhas:
|
|
||||||
meio = largura // 2
|
|
||||||
cv2.line(frame, (meio, 0), (meio, altura), (255, 0, 0), 2)
|
|
||||||
cv2.line(frame, (int(esquerda_x), 0), (int(direita_x), altura), (0, 255, 0), 2)
|
|
||||||
cv2.line(frame, (int(esquerda_x), 0), (int(esquerda_x), altura), (0, 255, 255), 2)
|
|
||||||
cv2.line(frame, (int(direita_x), 0), (int(direita_x), altura), (0, 255, 255), 2)
|
|
||||||
|
|
||||||
# Função para processar cada frame do vídeo e calcular as distâncias
|
|
||||||
def processar_frame(frame, largura, altura):
|
|
||||||
# Convertendo para escala de cinza
|
|
||||||
cinza = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
|
|
||||||
|
|
||||||
# Limiarização para criar uma imagem binária
|
|
||||||
_, binarizada = cv2.threshold(cinza, 128, 255, cv2.THRESH_BINARY_INV)
|
|
||||||
|
|
||||||
# Encontrar os contornos
|
|
||||||
contornos, _ = cv2.findContours(binarizada, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
|
|
||||||
|
|
||||||
# Se houver contornos, assumir que o maior é a linha preta
|
|
||||||
if contornos:
|
|
||||||
maior_contorno = max(contornos, key=cv2.contourArea)
|
|
||||||
|
|
||||||
# Ajustar uma linha ao maior contorno (linha preta)
|
|
||||||
[vx, vy, x0, y0] = cv2.fitLine(maior_contorno, cv2.DIST_L2, 0, 0.01, 0.01)
|
|
||||||
|
|
||||||
# Verificar se vy é zero para evitar divisão por zero
|
|
||||||
if vy == 0:
|
|
||||||
esquerda_x = x0
|
|
||||||
direita_x = x0
|
|
||||||
else:
|
|
||||||
# Determinar os pontos extremos da linha preta
|
|
||||||
esquerda_x = int(x0 + (-y0 * vx / vy))
|
|
||||||
direita_x = int(x0 + ((altura - y0) * vx / vy))
|
|
||||||
|
|
||||||
# Calcular distâncias das bordas
|
|
||||||
distancia_esquerda = max(0, esquerda_x)
|
|
||||||
distancia_direita = max(0, largura - direita_x)
|
|
||||||
|
|
||||||
# Calcular o ângulo entre a linha central e a linha ajustada
|
|
||||||
linha_central = [largura // 2, 0, largura // 2, altura]
|
|
||||||
linha_ajustada = [esquerda_x, 0, direita_x, altura]
|
|
||||||
angulo = calcular_angulo(linha_central, linha_ajustada)
|
|
||||||
|
|
||||||
# Desenhar linhas, se necessário
|
|
||||||
desenhar_linhas(frame, altura, largura, esquerda_x, direita_x, mostrar_linhas)
|
|
||||||
|
|
||||||
return (angulo, distancia_esquerda, distancia_direita, frame)
|
|
||||||
|
|
||||||
return (None, None, None, frame)
|
|
||||||
|
|
||||||
# Caminho do arquivo JSON para salvar os dados
|
|
||||||
output_folder = 'Python/Output/'
|
|
||||||
json_path = arquivoSaida
|
|
||||||
json_data = None
|
|
||||||
|
|
||||||
# Função para salvar os dados em formato JSON
|
|
||||||
def salvar_json(leituras, angulo, distancia_esquerda, distancia_direita, timestamp, json_path):
|
|
||||||
global json_data # Indica que queremos usar a variável global json_data
|
|
||||||
|
|
||||||
# Assegure-se que todos os dados são tipos primitivos antes de salvar em JSON
|
|
||||||
json_data = {
|
|
||||||
'timestamp': timestamp,
|
|
||||||
'angulo': angulo,
|
|
||||||
'distancia_esquerda': distancia_esquerda,
|
|
||||||
'distancia_direita': distancia_direita
|
|
||||||
}
|
|
||||||
|
|
||||||
if not os.path.exists(output_folder):
|
|
||||||
os.makedirs(output_folder)
|
|
||||||
|
|
||||||
leituras.append(json_data)
|
|
||||||
if len(leituras) > max_readings:
|
|
||||||
leituras.pop(0)
|
|
||||||
|
|
||||||
with open(output_folder + json_path, 'w') as file:
|
|
||||||
json.dump(leituras, file, indent=4)
|
|
||||||
|
|
||||||
def detect_lines(camera_index):
|
|
||||||
# Inicializando a captura de vídeo
|
|
||||||
cap = cv2.VideoCapture(camera_index)
|
|
||||||
if not cap.isOpened():
|
|
||||||
print("Erro: A câmera não pôde ser aberta.")
|
|
||||||
return
|
|
||||||
|
|
||||||
altura, largura = None, None
|
|
||||||
leituras = []
|
|
||||||
|
|
||||||
try:
|
|
||||||
while True:
|
|
||||||
ret, frame = cap.read()
|
|
||||||
if not ret:
|
|
||||||
print("Falha ao capturar imagem da câmera.")
|
|
||||||
break
|
|
||||||
|
|
||||||
if altura is None or largura is None:
|
|
||||||
altura, largura = frame.shape[:2]
|
|
||||||
|
|
||||||
# Processar o frame atual
|
|
||||||
angulo, distancia_esquerda, distancia_direita, frame_processado = processar_frame(frame, largura, altura)
|
|
||||||
|
|
||||||
if angulo is not None and distancia_esquerda is not None and distancia_direita is not None:
|
|
||||||
timestamp = time.time()
|
|
||||||
salvar_json(leituras, angulo, distancia_esquerda, distancia_direita, timestamp, json_path)
|
|
||||||
|
|
||||||
# Codificar o frame processado para JPEG
|
|
||||||
ret, buffer = cv2.imencode('.jpg', frame_processado)
|
|
||||||
if not ret:
|
|
||||||
continue
|
|
||||||
|
|
||||||
frame_bytes = buffer.tobytes()
|
|
||||||
yield (b'--frame\r\n'
|
|
||||||
b'Content-Type: image/jpeg\r\n\r\n' + frame_bytes + b'\r\n')
|
|
||||||
|
|
||||||
finally:
|
|
||||||
# Quando tudo estiver feito, liberar a captura
|
|
||||||
cap.release()
|
|
||||||
|
|
||||||
# Função para lidar com a conexão de cada cliente
|
|
||||||
def handle_client_connection(client_socket):
|
|
||||||
try:
|
|
||||||
while True:
|
|
||||||
# Tente enviar o dicionário serializado em JSON
|
|
||||||
try:
|
|
||||||
client_socket.send(json.dumps(json_data).encode('utf-8'))
|
|
||||||
except TypeError as e:
|
|
||||||
print(f"Erro ao enviar dados: {e}")
|
|
||||||
# Aguardar um pouco antes de enviar os próximos dados
|
|
||||||
time.sleep(0.2)
|
|
||||||
except socket.error as e:
|
|
||||||
print(f"Cliente desconectado com erro: {e}")
|
|
||||||
finally:
|
|
||||||
# Fechar a conexão do socket ao sair do loop
|
|
||||||
client_socket.close()
|
|
||||||
|
|
||||||
# Configuração inicial do servidor de socket
|
|
||||||
def start_server(address='localhost', port=socket_porta):
|
|
||||||
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
||||||
server.bind((address, port))
|
|
||||||
server.listen()
|
|
||||||
print(f"Servidor iniciado. Aguardando conexões em {address}:{port}...")
|
|
||||||
|
|
||||||
try:
|
|
||||||
while True:
|
|
||||||
client_sock, address = server.accept()
|
|
||||||
print(f"Aceitando conexão de {address[0]}:{address[1]}")
|
|
||||||
client_handler = threading.Thread(
|
|
||||||
target=handle_client_connection,
|
|
||||||
args=(client_sock,)
|
|
||||||
)
|
|
||||||
client_handler.start()
|
|
||||||
finally:
|
|
||||||
server.close()
|
|
||||||
|
|
||||||
|
|
||||||
# Esta função é para iniciar o servidor de socket em uma thread separada
|
|
||||||
def run_socket_server():
|
|
||||||
start_server()
|
|
||||||
|
|
||||||
# Iniciar o servidor Flask em uma thread separada
|
|
||||||
def run_flask_server():
|
|
||||||
app.run(host='0.0.0.0', port=porta, threaded=True, debug=False)
|
|
||||||
|
|
||||||
@app.route('/' + url, methods=['GET'])
|
|
||||||
def video_feed():
|
|
||||||
camera_index = int(request.args.get('camera_index'))
|
|
||||||
return Response(detect_lines(camera_index), mimetype='multipart/x-mixed-replace; boundary=frame')
|
|
||||||
|
|
||||||
|
|
||||||
# Iniciar o servidor
|
|
||||||
if __name__ == '__main__':
|
|
||||||
# Inicia o servidor de socket em uma thread separada
|
|
||||||
socket_server_thread = threading.Thread(target=run_socket_server)
|
|
||||||
socket_server_thread.start()
|
|
||||||
|
|
||||||
# Inicia o servidor Flask na thread principal
|
|
||||||
run_flask_server()
|
|
||||||
|
|
@ -1,235 +0,0 @@
|
||||||
import geopandas as gpd
|
|
||||||
import json
|
|
||||||
import sys
|
|
||||||
import folium
|
|
||||||
import requests
|
|
||||||
import re
|
|
||||||
import shutil
|
|
||||||
|
|
||||||
def internet_disponivel():
|
|
||||||
"""Verifica se há conexão com a internet."""
|
|
||||||
url = 'http://www.google.com/'
|
|
||||||
timeout = 5
|
|
||||||
try:
|
|
||||||
_ = requests.get(url, timeout=timeout)
|
|
||||||
return True
|
|
||||||
except requests.ConnectionError:
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Argumentos e configurações iniciais
|
|
||||||
pathFiles = sys.argv[1]
|
|
||||||
fileName = sys.argv[2]
|
|
||||||
outputName = sys.argv[3]
|
|
||||||
outputMapName = sys.argv[4]
|
|
||||||
topico_gps = sys.argv[5]
|
|
||||||
topico_ruas = sys.argv[6]
|
|
||||||
topico_trajeto_dinamico = sys.argv[7]
|
|
||||||
mapa_dados_json = sys.argv[8]
|
|
||||||
pastaSaida = 'Python/Output/'
|
|
||||||
|
|
||||||
|
|
||||||
if mapa_dados_json == "0":
|
|
||||||
# Carregar o arquivo shapefile contendo a geometria
|
|
||||||
input_shapefile = pathFiles + fileName + '.shp'
|
|
||||||
data_geometry = gpd.read_file(input_shapefile)
|
|
||||||
|
|
||||||
# Converter o GeoDataFrame para GeoJSON e adicionar ao mapa
|
|
||||||
geojson_data = data_geometry.to_json()
|
|
||||||
# Calcular os limites (bounds) da geometria
|
|
||||||
minx, miny, maxx, maxy = data_geometry.total_bounds
|
|
||||||
center = [(miny + maxy) / 2, (minx + maxx) / 2]
|
|
||||||
|
|
||||||
# Salvar GEOJson
|
|
||||||
data_geometry.to_file(pastaSaida + outputName, driver='GeoJSON')
|
|
||||||
else:
|
|
||||||
# Lendo os dados JSON
|
|
||||||
with open(pathFiles + fileName + '.json', 'r', encoding='utf-8-sig') as f:
|
|
||||||
geojson_data = json.load(f)
|
|
||||||
# Obter os limites (bounds) dos dados GeoJSON
|
|
||||||
bounds = folium.GeoJson(geojson_data).get_bounds()
|
|
||||||
center = [(bounds[0][0] + bounds[1][0]) / 2, (bounds[0][1] + bounds[1][1]) / 2]
|
|
||||||
|
|
||||||
# Adicionando um ID sequencial a cada Feature
|
|
||||||
for idx, feature in enumerate(geojson_data["features"]):
|
|
||||||
# Adicionar uma propriedade 'id' para cada Feature começando do índice zero
|
|
||||||
feature['id'] = idx
|
|
||||||
|
|
||||||
# Copiando o arquivo JSON para a pasta de saída
|
|
||||||
shutil.copy(pathFiles + fileName + '.json', pastaSaida + outputName)
|
|
||||||
|
|
||||||
# Verificar se há conexão com a internet
|
|
||||||
if internet_disponivel():
|
|
||||||
m = folium.Map(location=center, zoom_start=12)
|
|
||||||
else:
|
|
||||||
m = folium.Map(location=center, zoom_start=12, tiles=None)
|
|
||||||
|
|
||||||
|
|
||||||
folium.GeoJson(geojson_data).add_to(m)
|
|
||||||
|
|
||||||
# Salvar o mapa interativo em um arquivo HTML
|
|
||||||
m.save(pastaSaida + outputMapName)
|
|
||||||
|
|
||||||
|
|
||||||
# Caminho completo para o arquivo HTML gerado
|
|
||||||
caminho_completo_html = pastaSaida + outputMapName
|
|
||||||
|
|
||||||
# Abrir o arquivo HTML para leitura e escrita
|
|
||||||
with open(caminho_completo_html, 'r+') as arquivo_html:
|
|
||||||
# Ler o conteúdo do arquivo
|
|
||||||
conteudo_html = arquivo_html.read()
|
|
||||||
|
|
||||||
# Usar expressão regular para encontrar o ID do mapa
|
|
||||||
padrao_id_mapa = re.compile(r'id="map_(.*?)"')
|
|
||||||
resultado_busca = padrao_id_mapa.search(conteudo_html)
|
|
||||||
|
|
||||||
# Verificar se encontrou um ID de mapa
|
|
||||||
if resultado_busca:
|
|
||||||
id_mapa = 'map_' + resultado_busca.group(1)
|
|
||||||
else:
|
|
||||||
raise ValueError("Não foi possível encontrar o ID do mapa no arquivo HTML.")
|
|
||||||
|
|
||||||
# Script para desenhar o trajo percorrido no mapa
|
|
||||||
script_marcadores_dinamicos = f"""
|
|
||||||
<script src="folium/mqtt.min.js"></script>
|
|
||||||
<script src="folium/leaflet.rotatedMarker.js"></script>
|
|
||||||
<script>
|
|
||||||
var marcadores = {{}};
|
|
||||||
var trajetos = {{}};
|
|
||||||
|
|
||||||
function criarMarcador(id, coordenadas, orientacao) {{
|
|
||||||
var marcador;
|
|
||||||
|
|
||||||
if (id == 1) {{
|
|
||||||
marcador = L.marker(coordenadas, {{}}).addTo({id_mapa});
|
|
||||||
var icon = L.AwesomeMarkers.icon(
|
|
||||||
{{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}}
|
|
||||||
);
|
|
||||||
marcador.setIcon(icon);
|
|
||||||
}}
|
|
||||||
else {{
|
|
||||||
var customIcon = L.icon({{
|
|
||||||
iconUrl: 'folium/images/position_marker.png',
|
|
||||||
iconSize: [32, 32],
|
|
||||||
iconAnchor: [16, 16],
|
|
||||||
popupAnchor: [0, -16]
|
|
||||||
}});
|
|
||||||
marcador = L.marker(coordenadas, {{ icon: customIcon }}).addTo({id_mapa});
|
|
||||||
marcador.setRotationAngle(orientacao);
|
|
||||||
}}
|
|
||||||
|
|
||||||
var popup = L.popup({{"maxWidth": "100%"}});
|
|
||||||
var html = $(`<div id="html_${{id}}" style="width: 100.0%; height: 100.0%;">Endereco: ${{id}}</div>`)[0];
|
|
||||||
popup.setContent(html);
|
|
||||||
marcador.bindPopup(popup)
|
|
||||||
|
|
||||||
marcadores[id] = marcador;
|
|
||||||
}}
|
|
||||||
|
|
||||||
function criarTrajeto(id) {{
|
|
||||||
trajetos[id] = L.geoJson(null, {{
|
|
||||||
style: function(feature) {{
|
|
||||||
return {{ color: 'red' }};
|
|
||||||
}}
|
|
||||||
}}).addTo({id_mapa});
|
|
||||||
}}
|
|
||||||
|
|
||||||
function atualizarMarcador(id, coordenadas, orientacao) {{
|
|
||||||
var marcador = marcadores[id];
|
|
||||||
if (marcador) {{
|
|
||||||
marcador.setLatLng(coordenadas);
|
|
||||||
marcador.setRotationAngle(orientacao);
|
|
||||||
}}
|
|
||||||
}}
|
|
||||||
|
|
||||||
function atualizarTrajeto(id, coordenadas) {{
|
|
||||||
var trajeto = trajetos[id];
|
|
||||||
if (trajeto) {{
|
|
||||||
var feature = trajeto.toGeoJSON().features.find(f => f.id === id);
|
|
||||||
if (feature) {{
|
|
||||||
var ultima = [0.0, 0.0];
|
|
||||||
if (feature.geometry.coordinates.length > 0) {{
|
|
||||||
ultima = feature.geometry.coordinates[feature.geometry.coordinates.length - 1];
|
|
||||||
}}
|
|
||||||
if (!saoCoordenadasIguais(ultima, coordenadas, 0.000001)) {{
|
|
||||||
feature.geometry.coordinates.push(coordenadas);
|
|
||||||
trajeto.clearLayers();
|
|
||||||
trajeto.addData(feature);
|
|
||||||
}}
|
|
||||||
}}
|
|
||||||
}}
|
|
||||||
}}
|
|
||||||
|
|
||||||
function saoCoordenadasIguais(coord1, coord2, tolerancia) {{
|
|
||||||
return Math.abs(coord1[0] - coord2[0]) < tolerancia && Math.abs(coord1[1] - coord2[1]) < tolerancia;
|
|
||||||
}}
|
|
||||||
|
|
||||||
function adicionarDados(id, coordenadas, orientacao, foco) {{
|
|
||||||
if (!marcadores[id]) {{
|
|
||||||
criarMarcador(id, coordenadas, orientacao);
|
|
||||||
criarTrajeto(id);
|
|
||||||
trajetos[id].addData({{
|
|
||||||
"type": "Feature",
|
|
||||||
"geometry": {{
|
|
||||||
"type": "LineString",
|
|
||||||
"coordinates": []
|
|
||||||
}},
|
|
||||||
"properties": {{"Dist1": 0.0, "Dist2": 0.0, "Id": id, "Length": 0.0, "Name": "Trajeto"}},
|
|
||||||
"id": id
|
|
||||||
}});
|
|
||||||
}} else {{
|
|
||||||
atualizarMarcador(id, coordenadas, orientacao);
|
|
||||||
atualizarTrajeto(id, [coordenadas[1], coordenadas[0]]);
|
|
||||||
}}
|
|
||||||
if (foco) {{
|
|
||||||
{id_mapa}.setView(coordenadas, {id_mapa}.getZoom());
|
|
||||||
}}
|
|
||||||
}}
|
|
||||||
|
|
||||||
const client = mqtt.connect('ws://localhost:9001'); // Use wss para conexao segura
|
|
||||||
|
|
||||||
client.on('connect', function () {{
|
|
||||||
console.log('Conectado ao broker MQTT');
|
|
||||||
client.subscribe('{topico_gps}', function (err) {{
|
|
||||||
if (!err) {{
|
|
||||||
console.log("Inscricao bem-sucedida no topico");
|
|
||||||
}} else {{
|
|
||||||
console.error("Falha na inscricao do topico", err);
|
|
||||||
}}
|
|
||||||
}});
|
|
||||||
}});
|
|
||||||
|
|
||||||
client.on('message', function (topic, message) {{
|
|
||||||
var dados = JSON.parse(message);
|
|
||||||
if (topic === '{topico_gps}') {{
|
|
||||||
var id = dados.id;
|
|
||||||
var novaLatitude = dados.latitude;
|
|
||||||
var novaLongitude = dados.longitude;
|
|
||||||
var novaPosicao = [novaLatitude, novaLongitude];
|
|
||||||
var orientacao = dados.orientacao;
|
|
||||||
var foco = dados.foco;
|
|
||||||
|
|
||||||
adicionarDados(id, novaPosicao, orientacao, foco);
|
|
||||||
}}
|
|
||||||
}});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Importar arquivos localmente
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://code.jquery.com/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.0/css/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/', 'folium/')
|
|
||||||
|
|
||||||
# Inserir o script no conteúdo HTML
|
|
||||||
conteudo_atualizado = conteudo_html.replace('</html>', script_marcadores_dinamicos + '</html>')
|
|
||||||
|
|
||||||
# Agora, reabrir o arquivo para escrita e sobrescrever o conteúdo com a versão atualizada
|
|
||||||
with open(caminho_completo_html, 'w') as arquivo_html:
|
|
||||||
arquivo_html.write(conteudo_atualizado)
|
|
||||||
|
|
@ -1,456 +0,0 @@
|
||||||
import geopandas as gpd
|
|
||||||
import json
|
|
||||||
import sys
|
|
||||||
import folium
|
|
||||||
import requests
|
|
||||||
import re
|
|
||||||
import shutil
|
|
||||||
|
|
||||||
def internet_disponivel():
|
|
||||||
"""Verifica se há conexão com a internet."""
|
|
||||||
url = 'http://www.google.com/'
|
|
||||||
timeout = 5
|
|
||||||
try:
|
|
||||||
_ = requests.get(url, timeout=timeout)
|
|
||||||
return True
|
|
||||||
except requests.ConnectionError:
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Argumentos e configurações iniciais
|
|
||||||
pathFiles = sys.argv[1]
|
|
||||||
fileName = sys.argv[2]
|
|
||||||
outputName = sys.argv[3]
|
|
||||||
outputMapName = sys.argv[4]
|
|
||||||
topico_gps = sys.argv[5]
|
|
||||||
topico_ruas = sys.argv[6]
|
|
||||||
topico_trajeto_dinamico = sys.argv[7]
|
|
||||||
mapa_dados_json = sys.argv[8]
|
|
||||||
pastaSaida = 'Python/Output/'
|
|
||||||
|
|
||||||
|
|
||||||
if mapa_dados_json == "0":
|
|
||||||
# Carregar o arquivo shapefile contendo a geometria
|
|
||||||
input_shapefile = pathFiles + fileName + '.shp'
|
|
||||||
data_geometry = gpd.read_file(input_shapefile)
|
|
||||||
|
|
||||||
# Converter o GeoDataFrame para GeoJSON e adicionar ao mapa
|
|
||||||
geojson_data = data_geometry.to_json()
|
|
||||||
# Calcular os limites (bounds) da geometria
|
|
||||||
minx, miny, maxx, maxy = data_geometry.total_bounds
|
|
||||||
center = [(miny + maxy) / 2, (minx + maxx) / 2]
|
|
||||||
|
|
||||||
# Salvar GEOJson
|
|
||||||
data_geometry.to_file(pastaSaida + outputName, driver='GeoJSON')
|
|
||||||
else:
|
|
||||||
# Lendo os dados JSON
|
|
||||||
with open(pathFiles + fileName + '.json', 'r', encoding='utf-8-sig') as f:
|
|
||||||
geojson_data = json.load(f)
|
|
||||||
# Obter os limites (bounds) dos dados GeoJSON
|
|
||||||
bounds = folium.GeoJson(geojson_data).get_bounds()
|
|
||||||
center = [(bounds[0][0] + bounds[1][0]) / 2, (bounds[0][1] + bounds[1][1]) / 2]
|
|
||||||
|
|
||||||
# Adicionando um ID sequencial a cada Feature
|
|
||||||
for idx, feature in enumerate(geojson_data["features"]):
|
|
||||||
# Adicionar uma propriedade 'id' para cada Feature começando do índice zero
|
|
||||||
feature['id'] = idx
|
|
||||||
|
|
||||||
# Copiando o arquivo JSON para a pasta de saída
|
|
||||||
shutil.copy(pathFiles + fileName + '.json', pastaSaida + outputName)
|
|
||||||
|
|
||||||
# Verificar se há conexão com a internet
|
|
||||||
if internet_disponivel():
|
|
||||||
m = folium.Map(location=center, zoom_start=12)
|
|
||||||
else:
|
|
||||||
m = folium.Map(location=center, zoom_start=12, tiles=None)
|
|
||||||
|
|
||||||
|
|
||||||
folium.GeoJson(geojson_data).add_to(m)
|
|
||||||
|
|
||||||
# Salvar o mapa interativo em um arquivo HTML
|
|
||||||
m.save(pastaSaida + outputMapName)
|
|
||||||
|
|
||||||
|
|
||||||
# Caminho completo para o arquivo HTML gerado
|
|
||||||
caminho_completo_html = pastaSaida + outputMapName
|
|
||||||
|
|
||||||
# Abrir o arquivo HTML para leitura e escrita
|
|
||||||
with open(caminho_completo_html, 'r+') as arquivo_html:
|
|
||||||
# Ler o conteúdo do arquivo
|
|
||||||
conteudo_html = arquivo_html.read()
|
|
||||||
|
|
||||||
# Usar expressão regular para encontrar o ID do mapa
|
|
||||||
padrao_id_mapa = re.compile(r'id="map_(.*?)"')
|
|
||||||
resultado_busca = padrao_id_mapa.search(conteudo_html)
|
|
||||||
|
|
||||||
# Verificar se encontrou um ID de mapa
|
|
||||||
if resultado_busca:
|
|
||||||
id_mapa = 'map_' + resultado_busca.group(1)
|
|
||||||
else:
|
|
||||||
raise ValueError("Não foi possível encontrar o ID do mapa no arquivo HTML.")
|
|
||||||
|
|
||||||
# Usar expressão regular para encontrar o ID da Trajetoria
|
|
||||||
padrao_id_trajetoria = re.compile(r'var geo_json_(\w+)\s*=')
|
|
||||||
resultado_busca_trajetoria = padrao_id_trajetoria.search(conteudo_html)
|
|
||||||
|
|
||||||
# Verificar se encontrou um ID de trajetória
|
|
||||||
if resultado_busca_trajetoria:
|
|
||||||
id_trajetoria = 'geo_json_' + resultado_busca_trajetoria.group(1)
|
|
||||||
else:
|
|
||||||
# Adicionar mensagem de depuração para verificar o conteúdo do arquivo HTML
|
|
||||||
raise ValueError("Não foi possível encontrar o ID da trajetória no arquivo HTML.")
|
|
||||||
|
|
||||||
# Script para representar a trajetoria que o robô deve fazer até iniciar o trabalho
|
|
||||||
script_desenha_trajetoria_dinamica = f"""
|
|
||||||
<script>
|
|
||||||
function trajeto_dinamico_json_onEachFeature(feature, layer) {{
|
|
||||||
layer.on({{
|
|
||||||
}});
|
|
||||||
}};
|
|
||||||
var trajeto_dinamico_json = L.geoJson(null, {{
|
|
||||||
onEachFeature: trajeto_dinamico_json_onEachFeature,
|
|
||||||
style: function(feature) {{
|
|
||||||
return {{color: 'green'}};
|
|
||||||
}}
|
|
||||||
}}
|
|
||||||
);
|
|
||||||
function trajeto_dinamico_json_add (data) {{
|
|
||||||
trajeto_dinamico_json.addData(data);
|
|
||||||
}}
|
|
||||||
trajeto_dinamico_json_add({{"features": []}});
|
|
||||||
|
|
||||||
trajeto_dinamico_json.addTo({id_mapa});
|
|
||||||
|
|
||||||
function adicionarGeometriaDinamica(novaGeometria) {{
|
|
||||||
trajeto_dinamico_json.addData(novaGeometria);
|
|
||||||
}}
|
|
||||||
|
|
||||||
function adicionarCoordenadaDinamica(idGeometria, coordenadas) {{
|
|
||||||
var feature = trajeto_dinamico_json.toGeoJSON().features.find(f => f.id === idGeometria);
|
|
||||||
if (feature) {{
|
|
||||||
feature.geometry.coordinates = [];
|
|
||||||
coordenadas.forEach(x => feature.geometry.coordinates.push([x.longitude, x.latitude]));
|
|
||||||
var ft = feature;
|
|
||||||
trajeto_dinamico_json.clearLayers();
|
|
||||||
trajeto_dinamico_json.addData(ft);
|
|
||||||
}} else {{
|
|
||||||
console.log("Feature com ID " + idGeometria + " nao encontrada.");
|
|
||||||
}}
|
|
||||||
}}
|
|
||||||
|
|
||||||
adicionarGeometriaDinamica({{
|
|
||||||
"type": "Feature",
|
|
||||||
"geometry": {{
|
|
||||||
"type": "LineString",
|
|
||||||
"coordinates": []
|
|
||||||
}},
|
|
||||||
"properties": {{"Dist1": 0.0, "Dist2": 0.0, "Id": 1517, "Length": 21.724783283, "Name": "Projeto"}},
|
|
||||||
"id": "TjD"
|
|
||||||
}});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Script para desenhar o trajo percorrido no mapa
|
|
||||||
script_desenha_trajeotria = f"""
|
|
||||||
<script>
|
|
||||||
function trajeto_json_onEachFeature(feature, layer) {{
|
|
||||||
layer.on({{
|
|
||||||
}});
|
|
||||||
}};
|
|
||||||
var trajeto_json = L.geoJson(null, {{
|
|
||||||
onEachFeature: trajeto_json_onEachFeature,
|
|
||||||
style: function(feature) {{
|
|
||||||
return {{color: 'red'}};
|
|
||||||
}}
|
|
||||||
}}
|
|
||||||
);
|
|
||||||
function trajeto_json_add (data) {{
|
|
||||||
trajeto_json.addData(data);
|
|
||||||
}}
|
|
||||||
trajeto_json_add({{"features": []}});
|
|
||||||
|
|
||||||
trajeto_json.addTo({id_mapa});
|
|
||||||
|
|
||||||
function adicionarGeometria(novaGeometria) {{
|
|
||||||
trajeto_json.addData(novaGeometria);
|
|
||||||
}}
|
|
||||||
|
|
||||||
function saoCoordenadasIguais(coord1, coord2, tolerancia) {{
|
|
||||||
return Math.abs(coord1[0] - coord2[0]) < tolerancia && Math.abs(coord1[1] - coord2[1]) < tolerancia;
|
|
||||||
}}
|
|
||||||
|
|
||||||
function adicionarCoordenada(idGeometria, novaCoordenada) {{
|
|
||||||
var feature = trajeto_json.toGeoJSON().features.find(f => f.id === idGeometria);
|
|
||||||
if (feature) {{
|
|
||||||
var ultima = [0.0,0.0];
|
|
||||||
if (feature.geometry.coordinates.length > 0) {{
|
|
||||||
ultima = feature.geometry.coordinates[feature.geometry.coordinates.length - 1];
|
|
||||||
}}
|
|
||||||
if (!saoCoordenadasIguais(ultima, novaCoordenada, 0.000001)) {{
|
|
||||||
feature.geometry.coordinates.push(novaCoordenada);
|
|
||||||
var ft = feature;
|
|
||||||
trajeto_json.clearLayers();
|
|
||||||
trajeto_json.addData(ft);
|
|
||||||
}}
|
|
||||||
|
|
||||||
}} else {{
|
|
||||||
console.log("Feature com ID " + idGeometria + " não encontrada.");
|
|
||||||
}}
|
|
||||||
}}
|
|
||||||
|
|
||||||
adicionarGeometria({{
|
|
||||||
"type": "Feature",
|
|
||||||
"geometry": {{
|
|
||||||
"type": "LineString",
|
|
||||||
"coordinates": []
|
|
||||||
}},
|
|
||||||
"properties": {{"Dist1": 0.0, "Dist2": 0.0, "Id": 1517, "Length": 21.724783283, "Name": "Projeto"}},
|
|
||||||
"id": "Tj"
|
|
||||||
}});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Script JavaScript para adicionar ao HTML, com o ID do mapa substituído
|
|
||||||
script_atualizacao_marcador = f"""
|
|
||||||
<script src="folium/mqtt.min.js"></script>
|
|
||||||
<script src="folium/leaflet.rotatedMarker.js"></script>
|
|
||||||
<script>
|
|
||||||
let posicaoAtualEquipamento = {{
|
|
||||||
lat: 0,
|
|
||||||
long: 0
|
|
||||||
}};
|
|
||||||
|
|
||||||
let posicaoAtualBase = {{
|
|
||||||
lat: 0,
|
|
||||||
long: 0
|
|
||||||
}};
|
|
||||||
|
|
||||||
var customIcon = L.icon({{
|
|
||||||
iconUrl: 'folium/images/position_marker.png',
|
|
||||||
iconSize: [32, 32],
|
|
||||||
iconAnchor: [16, 16],
|
|
||||||
popupAnchor: [0, -16]
|
|
||||||
}});
|
|
||||||
|
|
||||||
var marcadorEquipamento = L.marker([0, 0], {{
|
|
||||||
icon: customIcon
|
|
||||||
}}).addTo({id_mapa});
|
|
||||||
|
|
||||||
var marcadorBase = L.marker([0, 0], {{}}).addTo({id_mapa});
|
|
||||||
var icon = L.AwesomeMarkers.icon(
|
|
||||||
{{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}}
|
|
||||||
);
|
|
||||||
marcadorBase.setIcon(icon);
|
|
||||||
|
|
||||||
// Conectar ao broker MQTT
|
|
||||||
const client = mqtt.connect('ws://localhost:9001'); // Use wss para conexão segura
|
|
||||||
|
|
||||||
// Quando conectado, inscreva-se no tópico desejado
|
|
||||||
client.on('connect', function () {{
|
|
||||||
console.log('Conectado ao broker MQTT');
|
|
||||||
|
|
||||||
// Inscrever-se no tópico
|
|
||||||
client.subscribe('{topico_gps}', function (err) {{
|
|
||||||
if (!err) {{
|
|
||||||
console.log("Inscricao bem-sucedida no topico");
|
|
||||||
}} else {{
|
|
||||||
console.error("Falha na inscricao do topico", err);
|
|
||||||
}}
|
|
||||||
}});
|
|
||||||
client.subscribe('{topico_trajeto_dinamico}', function (err) {{
|
|
||||||
if (!err) {{
|
|
||||||
console.log("Inscricao bem-sucedida no topico");
|
|
||||||
}} else {{
|
|
||||||
console.error("Falha na inscricao do topico", err);
|
|
||||||
}}
|
|
||||||
}});
|
|
||||||
client.subscribe('{topico_ruas}', function (err) {{
|
|
||||||
if (!err) {{
|
|
||||||
console.log("Inscricao bem-sucedida no topico");
|
|
||||||
}} else {{
|
|
||||||
console.error("Falha na inscricao do topico", err);
|
|
||||||
}}
|
|
||||||
}});
|
|
||||||
}});
|
|
||||||
|
|
||||||
// Lidar com mensagens recebidas para o topico inscrito
|
|
||||||
client.on('message', function (topic, message) {{
|
|
||||||
var dados = JSON.parse(message);
|
|
||||||
if (topic === "{topico_trajeto_dinamico}") {{
|
|
||||||
adicionarCoordenadaDinamica("TjD", dados); // "Tj" é o ID da feature no GeoJSON
|
|
||||||
}}
|
|
||||||
else if (topic === "{topico_gps}") {{
|
|
||||||
// A mensagem e um Buffer, converta para string ou objeto conforme necessario
|
|
||||||
//console.log(`Mensagem recebida no topico '${{topic}}': ${{message.toString()}}`);
|
|
||||||
|
|
||||||
var id = dados.id;
|
|
||||||
var novaLatitude = dados.latitude;
|
|
||||||
var novaLongitude = dados.longitude;
|
|
||||||
var novaPosicao = [novaLatitude, novaLongitude];
|
|
||||||
var orientacao = dados.orientacao;
|
|
||||||
var foco = dados.foco;
|
|
||||||
|
|
||||||
if (id == 1) {{
|
|
||||||
marcadorBase.setLatLng(novaPosicao);
|
|
||||||
|
|
||||||
// Calcular angulo de rotacao
|
|
||||||
var angulo = dados.orientacao;
|
|
||||||
|
|
||||||
posicaoAtualBase.lat = novaPosicao[0];
|
|
||||||
posicaoAtualBase.long = novaPosicao[1];
|
|
||||||
|
|
||||||
// Rotacionar o marcador para o angulo calculado
|
|
||||||
marcadorBase.setRotationAngle(angulo);
|
|
||||||
}}
|
|
||||||
else {{
|
|
||||||
marcadorEquipamento.setLatLng(novaPosicao);
|
|
||||||
|
|
||||||
// Calcular angulo de rotacao
|
|
||||||
var angulo = dados.orientacao;
|
|
||||||
|
|
||||||
posicaoAtualEquipamento.lat = novaPosicao[0];
|
|
||||||
posicaoAtualEquipamento.long = novaPosicao[1];
|
|
||||||
|
|
||||||
// Rotacionar o marcador para o angulo calculado
|
|
||||||
marcadorEquipamento.setRotationAngle(angulo);
|
|
||||||
|
|
||||||
adicionarCoordenada("Tj", [novaLongitude, novaLatitude]);
|
|
||||||
}}
|
|
||||||
|
|
||||||
if (foco) {{
|
|
||||||
{id_mapa}.setView(novaPosicao, {id_mapa}.getZoom());
|
|
||||||
}}
|
|
||||||
|
|
||||||
}}
|
|
||||||
else if (topic === '{topico_ruas}') {{
|
|
||||||
var selecionadas = dados;
|
|
||||||
if (selecionadas.length != RuasSelecionadas.length) {{
|
|
||||||
atualizarSelecaoRuas(selecionadas);
|
|
||||||
}}
|
|
||||||
}}
|
|
||||||
|
|
||||||
}});
|
|
||||||
|
|
||||||
// Função para atualizar a seleção das ruas e mudar a cor no mapa
|
|
||||||
function atualizarSelecaoRuas(selecionadas) {{
|
|
||||||
selecionadas = JSON.parse(selecionadas);
|
|
||||||
RuasSelecionadas = Array.isArray(selecionadas) ? [...selecionadas] : [];
|
|
||||||
{id_trajetoria}.eachLayer(function (layer) {{
|
|
||||||
if (RuasSelecionadas.includes(parseInt(layer.feature.id))) {{
|
|
||||||
layer.setStyle({{ color: 'blue' }});
|
|
||||||
}} else {{
|
|
||||||
layer.setStyle({{ color: '#3388ff' }}); // Cor original
|
|
||||||
}}
|
|
||||||
}});
|
|
||||||
}}
|
|
||||||
|
|
||||||
function calcularOrientacao(P1latitude, P1longitude, P2latitude, P2longitude) {{
|
|
||||||
// Converter latitudes e longitudes de graus para radianos
|
|
||||||
const latA = P1latitude * (Math.PI / 180.0);
|
|
||||||
const lonA = P1longitude * (Math.PI / 180.0);
|
|
||||||
const latB = P2latitude * (Math.PI / 180.0);
|
|
||||||
const lonB = P2longitude * (Math.PI / 180.0);
|
|
||||||
|
|
||||||
// Calcular a diferença de longitude
|
|
||||||
const deltaLon = lonB - lonA;
|
|
||||||
|
|
||||||
// Calcular a direção
|
|
||||||
const y = Math.sin(deltaLon) * Math.cos(latB);
|
|
||||||
const x = Math.cos(latA) * Math.sin(latB) - Math.sin(latA) * Math.cos(latB) * Math.cos(deltaLon);
|
|
||||||
const direcaoRadianos = Math.atan2(y, x);
|
|
||||||
|
|
||||||
// Converter a direção de radianos para graus
|
|
||||||
let direcaoGraus = direcaoRadianos * (180.0 / Math.PI);
|
|
||||||
|
|
||||||
// Normalizar a direção para que esteja no intervalo de 0 a 360 graus
|
|
||||||
direcaoGraus = (direcaoGraus + 360) % 360;
|
|
||||||
|
|
||||||
return direcaoGraus;
|
|
||||||
}}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Primeiro, vamos definir o novo trecho de JavaScript que você quer adicionar
|
|
||||||
funcao_define_ruas_selecionadas = f"""
|
|
||||||
var trajetosSelecionados = {{}};
|
|
||||||
var RuasSelecionadas = [];
|
|
||||||
function enviarSelecaoParaServidor() {{
|
|
||||||
client.publish("{topico_ruas}", JSON.stringify(RuasSelecionadas), function (err) {{
|
|
||||||
/*if (!err) {{
|
|
||||||
console.log("Mensagem publicada com sucesso");
|
|
||||||
}} else {{
|
|
||||||
console.error("Falha ao publicar mensagem", err);
|
|
||||||
}}*/
|
|
||||||
}});
|
|
||||||
}}
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Código para inserir dentro do layer.on({})
|
|
||||||
codigo_layer_on = """
|
|
||||||
click: function(e) {
|
|
||||||
// Verificar se o trajeto já está selecionado
|
|
||||||
if (trajetosSelecionados[feature.id]) {
|
|
||||||
// Se já está selecionado, reverta para a cor original e remova da seleção
|
|
||||||
e.target.setStyle({
|
|
||||||
color: '#3388ff' // Cor original
|
|
||||||
});
|
|
||||||
delete trajetosSelecionados[feature.id];
|
|
||||||
RuasSelecionadas.splice(RuasSelecionadas.indexOf(feature.id), 1);
|
|
||||||
} else {
|
|
||||||
// Se não está selecionado, mude a cor para indicar seleção e adicione ao objeto de seleção
|
|
||||||
e.target.setStyle({
|
|
||||||
color: 'blue' // Cor de seleção
|
|
||||||
});
|
|
||||||
trajetosSelecionados[feature.id] = true;
|
|
||||||
RuasSelecionadas.push(feature.id);
|
|
||||||
}
|
|
||||||
enviarSelecaoParaServidor();
|
|
||||||
}/*, mouseover: function(e) {
|
|
||||||
// Mostrar tooltip com o ID da geometria quando o mouse passar sobre a linha
|
|
||||||
var tooltip = L.tooltip({
|
|
||||||
direction: 'auto', // Leaflet determina a melhor posição
|
|
||||||
sticky: true // Faz com que o tooltip siga o cursor do mouse
|
|
||||||
})
|
|
||||||
.setContent('Rua ' + feature.id); // Define o conteúdo do tooltip
|
|
||||||
|
|
||||||
// Abre o tooltip na posição atual do mouse
|
|
||||||
var latLng = e.latlng;
|
|
||||||
tooltip.setLatLng(latLng);
|
|
||||||
layer.bindTooltip(tooltip).openTooltip(latLng);
|
|
||||||
}*/
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Importar arquivos localmente
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://code.jquery.com/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.0/css/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/', 'folium/')
|
|
||||||
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/', 'folium/')
|
|
||||||
|
|
||||||
# Inserir o script no conteúdo HTML
|
|
||||||
conteudo_atualizado = conteudo_html.replace('</html>', script_desenha_trajeotria + script_desenha_trajetoria_dinamica + script_atualizacao_marcador + '</html>')
|
|
||||||
# Encontrar a posição onde inserir o novo trecho de JavaScript
|
|
||||||
indice_inicio_funcao = conteudo_atualizado.find("function geo_json_")
|
|
||||||
# Inserir o novo trecho de JavaScript antes da função
|
|
||||||
conteudo_atualizado = conteudo_atualizado[:indice_inicio_funcao] + funcao_define_ruas_selecionadas + conteudo_atualizado[indice_inicio_funcao:]
|
|
||||||
# Agora, para adicionar o código dentro do layer.on({})
|
|
||||||
# Você precisa encontrar o local exato. Isso pode ser um pouco mais complicado, pois pode haver várias ocorrências.
|
|
||||||
# Uma abordagem seria encontrar a primeira ocorrência após o seu trecho inserido anteriormente.
|
|
||||||
indice_layer_on = conteudo_atualizado.find("layer.on({", indice_inicio_funcao)
|
|
||||||
# Verificar se encontrou o layer.on({})
|
|
||||||
if indice_layer_on != -1:
|
|
||||||
# Encontrar a posição do fechamento do layer.on({})
|
|
||||||
indice_fechamento = conteudo_atualizado.find("});", indice_layer_on) # +1 para incluir a abertura da chave
|
|
||||||
# Inserir o código dentro do layer.on({})
|
|
||||||
conteudo_atualizado = conteudo_atualizado[:indice_fechamento] + codigo_layer_on + conteudo_atualizado[indice_fechamento:]
|
|
||||||
|
|
||||||
# Agora, reabrir o arquivo para escrita e sobrescrever o conteúdo com a versão atualizada
|
|
||||||
with open(caminho_completo_html, 'w') as arquivo_html:
|
|
||||||
arquivo_html.write(conteudo_atualizado)
|
|
||||||
|
|
@ -1,231 +0,0 @@
|
||||||
import serial
|
|
||||||
import time
|
|
||||||
import threading
|
|
||||||
import sys
|
|
||||||
import json
|
|
||||||
|
|
||||||
import uuid
|
|
||||||
import paho.mqtt.client as mqtt
|
|
||||||
mqtt_client = mqtt.Client(f"client_pzem_{uuid.uuid4()}")
|
|
||||||
mqtt_client.connect("localhost", port=1883)
|
|
||||||
mqtt_topic = sys.argv[1]
|
|
||||||
|
|
||||||
# Configuração da porta serial
|
|
||||||
porta_serial = 'COM14' # Substitua '/dev/ttyUSB0' pelo nome da porta serial correta no seu sistema
|
|
||||||
baud_rate = 9600
|
|
||||||
timeout = 2 # Tempo de espera para a resposta
|
|
||||||
|
|
||||||
CodigosFuncoes = {
|
|
||||||
"LeituraParametro": 0x3,
|
|
||||||
"AquisicaoDados": 0x04,
|
|
||||||
"GravacaoParametro": 0x06,
|
|
||||||
"ResetEnergia": 0x42,
|
|
||||||
}
|
|
||||||
|
|
||||||
Parametros = {
|
|
||||||
"AlarmeTensaoMaxima": 0x0000,
|
|
||||||
"AlarmeTensaoMinima": 0x0001,
|
|
||||||
"EnderecoRTU": 0x0002,
|
|
||||||
"EscalaCorrenteAtual": 0x0003,
|
|
||||||
}
|
|
||||||
|
|
||||||
slave_address = 0x01
|
|
||||||
|
|
||||||
# Inicialização da porta serial
|
|
||||||
ser = serial.Serial(porta_serial, baud_rate, timeout=timeout)
|
|
||||||
|
|
||||||
# Função para calcular o CRC16 de um comando
|
|
||||||
def crc16(data: bytes):
|
|
||||||
crc = 0xFFFF
|
|
||||||
for pos in data:
|
|
||||||
crc ^= pos
|
|
||||||
for i in range(8):
|
|
||||||
if (crc & 1) != 0:
|
|
||||||
crc >>= 1
|
|
||||||
crc ^= 0xA001
|
|
||||||
else:
|
|
||||||
crc >>= 1
|
|
||||||
return crc.to_bytes(2, byteorder='little')
|
|
||||||
|
|
||||||
def verificar_crc(resposta_hex):
|
|
||||||
resposta_bytes = bytes.fromhex(resposta_hex)
|
|
||||||
crc_recebido = resposta_bytes[-2:]
|
|
||||||
crc_calculado = crc16(resposta_bytes[:-2])
|
|
||||||
return crc_recebido == crc_calculado
|
|
||||||
|
|
||||||
|
|
||||||
# Monta o comando para ler os registros
|
|
||||||
def comando_aquisicao_dados():
|
|
||||||
function_code = CodigosFuncoes["AquisicaoDados"]
|
|
||||||
start_address = 0x0000
|
|
||||||
num_of_registers = 0x0008
|
|
||||||
command = bytearray([slave_address, function_code]) + start_address.to_bytes(2, byteorder='big') + num_of_registers.to_bytes(2, byteorder='big')
|
|
||||||
command += crc16(command)
|
|
||||||
return command
|
|
||||||
|
|
||||||
def decifrar_resposta_aquisicao(resposta):
|
|
||||||
resposta = resposta.hex()
|
|
||||||
# Certifique-se de que a resposta é do tipo bytes
|
|
||||||
if isinstance(resposta, str):
|
|
||||||
resposta = bytes.fromhex(resposta)
|
|
||||||
|
|
||||||
print(resposta.hex())
|
|
||||||
print(len(resposta))
|
|
||||||
print(resposta[1])
|
|
||||||
print(CodigosFuncoes["AquisicaoDados"])
|
|
||||||
|
|
||||||
# Verifica o comprimento da resposta e o código da função
|
|
||||||
if len(resposta) >= 5 and resposta[1] == CodigosFuncoes["AquisicaoDados"]:
|
|
||||||
# Extrai o número de bytes de dados
|
|
||||||
num_bytes = resposta[2]
|
|
||||||
|
|
||||||
if num_bytes == 16: # Se o número de bytes de dados for 16
|
|
||||||
# Decodificação de tensão, corrente, potência e energia
|
|
||||||
tensao_raw = int.from_bytes(resposta[3:5], byteorder='big')
|
|
||||||
corrente_raw = int.from_bytes(resposta[5:7], byteorder='big')
|
|
||||||
potencia_raw = int.from_bytes(resposta[7:11], byteorder='big') # 4 bytes para potência
|
|
||||||
energia_raw = int.from_bytes(resposta[11:15], byteorder='big') # 4 bytes para energia
|
|
||||||
high_alarm_raw = resposta[15]
|
|
||||||
low_alarm_raw = resposta[16]
|
|
||||||
|
|
||||||
# Conversões (ajuste conforme necessário)
|
|
||||||
tensao = tensao_raw * 0.01
|
|
||||||
corrente = corrente_raw * 0.01
|
|
||||||
potencia = potencia_raw * 0.1
|
|
||||||
energia = energia_raw * 1
|
|
||||||
|
|
||||||
# Decodificação dos estados de alarme
|
|
||||||
alarme_alta_tensao = "Ativo" if high_alarm_raw == 0xFFFF else "Nao Ativo"
|
|
||||||
alarme_baixa_tensao = "Ativo" if low_alarm_raw == 0xFFFF else "Nao Ativo"
|
|
||||||
|
|
||||||
# Retorno formatado com todos os valores
|
|
||||||
resultado = {
|
|
||||||
"Tensao": f"{tensao} V",
|
|
||||||
"Corrente": f"{corrente} A",
|
|
||||||
"Potencia": f"{potencia} W",
|
|
||||||
"Energia": f"{energia} Wh",
|
|
||||||
"Alarme de Alta Tensao": alarme_alta_tensao,
|
|
||||||
"Alarme de Baixa Tensao": alarme_baixa_tensao
|
|
||||||
}
|
|
||||||
|
|
||||||
mqtt_client.publish(mqtt_topic, json.dumps(resultado).encode('utf-8'))
|
|
||||||
else:
|
|
||||||
print("Número de bytes de dados não esperado.")
|
|
||||||
else:
|
|
||||||
print("Resposta inválida ou código de função incorreto.")
|
|
||||||
return None
|
|
||||||
|
|
||||||
def comando_set_parametro(Parametro, valor):
|
|
||||||
# Convertendo o valor de tensão para o formato correto (LSB = 0.01V)
|
|
||||||
valor_int = int(valor * 100) # Convertendo para inteiro conforme a resolução
|
|
||||||
function_code = CodigosFuncoes["GravacaoParametro"]
|
|
||||||
register_address = Parametro
|
|
||||||
|
|
||||||
# Construindo o comando
|
|
||||||
command = bytearray([slave_address, function_code]) + register_address.to_bytes(2, byteorder='big') + valor_int.to_bytes(2, byteorder='big')
|
|
||||||
|
|
||||||
# Adicionando o CRC ao comando
|
|
||||||
command += crc16(command)
|
|
||||||
return command
|
|
||||||
|
|
||||||
|
|
||||||
def comando_get_parametro(Parametro):
|
|
||||||
function_code = CodigosFuncoes["LeituraParametro"]
|
|
||||||
register_address = Parametro
|
|
||||||
number_of_registers = 0x0001 # Lendo apenas um registro
|
|
||||||
|
|
||||||
# Construindo o comando
|
|
||||||
command = bytearray([slave_address, function_code]) + register_address.to_bytes(2, byteorder='big') + number_of_registers.to_bytes(2, byteorder='big')
|
|
||||||
|
|
||||||
# Adicionando o CRC ao comando
|
|
||||||
command += crc16(command)
|
|
||||||
return command
|
|
||||||
|
|
||||||
def decifrar_resposta_get_parametro(resposta_hex):
|
|
||||||
# Primeiro, verifique se a resposta é válida verificando o CRC
|
|
||||||
if not verificar_crc(resposta_hex):
|
|
||||||
return "CRC inválido. A resposta pode estar corrompida."
|
|
||||||
|
|
||||||
# Converte a parte dos dados da resposta de hex para decimal
|
|
||||||
valor_hex = resposta_hex[6:10]
|
|
||||||
valor_decimal = int(valor_hex, 16)
|
|
||||||
|
|
||||||
# Converte o valor para a unidade correta (LSB = 0.01V)
|
|
||||||
valor_unidade = valor_decimal * 0.01
|
|
||||||
|
|
||||||
return valor_unidade
|
|
||||||
|
|
||||||
|
|
||||||
def comando_reset_energia():
|
|
||||||
# Código de função específico para reset de energia
|
|
||||||
function_code = CodigosFuncoes["ResetEnergia"]
|
|
||||||
|
|
||||||
# Construindo o comando
|
|
||||||
command = bytearray([slave_address, function_code])
|
|
||||||
|
|
||||||
# Adicionando o CRC ao comando
|
|
||||||
command += crc16(command)
|
|
||||||
return command
|
|
||||||
|
|
||||||
def comando_calibragem():
|
|
||||||
# Bytes fixos para o comando de calibragem
|
|
||||||
bytes_comando = bytearray([0xF8, 0x41, 0x37, 0x21])
|
|
||||||
|
|
||||||
# Calculando o CRC para os bytes do comando
|
|
||||||
crc = crc16(bytes_comando)
|
|
||||||
|
|
||||||
# Adicionando o CRC ao comando
|
|
||||||
comando_calibragem = bytes_comando + crc
|
|
||||||
|
|
||||||
return comando_calibragem
|
|
||||||
|
|
||||||
|
|
||||||
def enviar_comando(comando):
|
|
||||||
ser.write(comando)
|
|
||||||
time.sleep(0.1) # Pequena pausa para garantir o envio
|
|
||||||
resposta = ser.read(ser.inWaiting()) # Lê todos os dados disponíveis na porta
|
|
||||||
return resposta
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
comando = comando_aquisicao_dados()
|
|
||||||
|
|
||||||
enviar_comando(comando_calibragem())
|
|
||||||
time.sleep(5)
|
|
||||||
#com_set = comando_set_parametro(Parametros["EscalaCorrenteAtual"], 0)
|
|
||||||
#enviar_comando(com_set)
|
|
||||||
#time.sleep(1)
|
|
||||||
vmax = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["AlarmeTensaoMaxima"])).hex())
|
|
||||||
vmin = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["AlarmeTensaoMinima"])).hex())
|
|
||||||
addr = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["EnderecoRTU"])).hex())
|
|
||||||
rang = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["EscalaCorrenteAtual"])).hex())
|
|
||||||
print(f"Alarme tensao maxima: {vmax}")
|
|
||||||
print(f"Alarme tensao minima: {vmin}")
|
|
||||||
print(f"Endereco RTU: {addr}")
|
|
||||||
print(f"Escala de corrente: {rang}")
|
|
||||||
|
|
||||||
try:
|
|
||||||
while True:
|
|
||||||
resposta = enviar_comando(comando)
|
|
||||||
try:
|
|
||||||
decifrar_resposta_aquisicao(resposta)
|
|
||||||
except:
|
|
||||||
print("Erro ao decodificar mensagem: " + resposta.hex())
|
|
||||||
#time.sleep(1) # Espera 1 segundo antes da próxima leitura
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
print("Programa encerrado pelo usuário")
|
|
||||||
finally:
|
|
||||||
ser.close()
|
|
||||||
|
|
||||||
|
|
||||||
# Esta função é para confirmar que script está pronto para execução
|
|
||||||
def send_script_ready():
|
|
||||||
mqtt_client.publish(mqtt_topic, "OK")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
# Cria trhead separada para informar que o script iniciou com sucesso
|
|
||||||
mqtt_thread = threading.Thread(target=send_script_ready)
|
|
||||||
mqtt_thread.start()
|
|
||||||
|
|
||||||
main()
|
|
||||||
|
|
@ -1,183 +0,0 @@
|
||||||
import torch
|
|
||||||
from PIL import Image
|
|
||||||
import torchvision.transforms as T
|
|
||||||
import numpy as np
|
|
||||||
import cv2
|
|
||||||
import json
|
|
||||||
import time
|
|
||||||
import io
|
|
||||||
import paho.mqtt.client as mqtt
|
|
||||||
import uuid
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
import base64
|
|
||||||
|
|
||||||
# Parâmetros de entrada
|
|
||||||
output_folder = 'Python/Output/'
|
|
||||||
model_folder = 'C:\\ZendionINC\\agrobot_base\\Treinamento\\models\\ruas\\'
|
|
||||||
mqtt_send_topic = sys.argv[1] # Tópico para receber o bitmap
|
|
||||||
mqtt_receive_topic = sys.argv[2] # Tópico para enviar o resultado
|
|
||||||
|
|
||||||
# Configurações MQTT
|
|
||||||
mqtt_client = mqtt.Client(f"client_street_detector_{uuid.uuid4()}")
|
|
||||||
mqtt_client.connect("localhost", port=1883)
|
|
||||||
|
|
||||||
script_dir = os.path.dirname(__file__) # Obtém o diretório onde o script está localizado
|
|
||||||
parent_dir = os.path.dirname(script_dir) # Obtém o diretório pai (Python/)
|
|
||||||
sys.path.append(parent_dir)
|
|
||||||
|
|
||||||
# Supondo que você tenha a estrutura do repositório e o módulo `network` conforme descrito no README
|
|
||||||
from Models.deeplabv3plus.modeling import deeplabv3plus_resnet50 as deeplabv3_model
|
|
||||||
|
|
||||||
# Configurações Iniciais
|
|
||||||
NUM_CLASSES = 4 # Pascal VOC possui 3 classes + 1 para o fundo
|
|
||||||
OUTPUT_STRIDE = 16 # Valor comum para DeepLab
|
|
||||||
MODEL_PATH = model_folder + 'backup/ruasModel_final.pth' # Caminho para o modelo pré-treinado
|
|
||||||
|
|
||||||
# Função para carregar o modelo
|
|
||||||
def load_model(model_path):
|
|
||||||
model = deeplabv3_model(num_classes=NUM_CLASSES, output_stride=OUTPUT_STRIDE)
|
|
||||||
model.load_state_dict(torch.load(model_path), strict=False)
|
|
||||||
model.eval() # Modo de avaliação
|
|
||||||
return model
|
|
||||||
|
|
||||||
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
||||||
# Carregar o modelo
|
|
||||||
model = load_model(MODEL_PATH)
|
|
||||||
model.to(device)
|
|
||||||
|
|
||||||
# Função para processar o frame
|
|
||||||
def segment_frame(frame):
|
|
||||||
image = Image.fromarray(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
|
|
||||||
transform = T.Compose([
|
|
||||||
T.Resize(520),
|
|
||||||
T.ToTensor(),
|
|
||||||
T.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
|
|
||||||
])
|
|
||||||
|
|
||||||
input_tensor = transform(image).unsqueeze(0).to(device)
|
|
||||||
with torch.no_grad():
|
|
||||||
output = model(input_tensor)
|
|
||||||
output_predictions = output.max(1)[1].squeeze().detach().cpu().numpy()
|
|
||||||
|
|
||||||
return output_predictions
|
|
||||||
|
|
||||||
# Função para ler o mapa de rótulos
|
|
||||||
def read_labelmap(path):
|
|
||||||
label_colors = []
|
|
||||||
class_names = []
|
|
||||||
with open(path, 'r') as file:
|
|
||||||
for line in file.readlines():
|
|
||||||
if line.startswith('#'):
|
|
||||||
continue
|
|
||||||
parts = line.strip().split(':')
|
|
||||||
if len(parts) >= 2:
|
|
||||||
label = parts[0].strip()
|
|
||||||
color = tuple(map(int, parts[1].split(',')))
|
|
||||||
class_names.append(label)
|
|
||||||
label_colors.append(color)
|
|
||||||
return np.array(label_colors), class_names
|
|
||||||
|
|
||||||
# Função para gerar o JSON de saída
|
|
||||||
def generate_json(image):
|
|
||||||
label_colors, class_names = read_labelmap(model_folder + "dataset/labelmap.txt")
|
|
||||||
detected_classes = set(np.unique(image))
|
|
||||||
|
|
||||||
timestamp = time.time()
|
|
||||||
json_data = {'timestamp': timestamp, 'Classes': []}
|
|
||||||
for l in detected_classes:
|
|
||||||
if l < len(label_colors):
|
|
||||||
class_entry = {'Classe': class_names[l], 'Contornos': []}
|
|
||||||
mask = (image == l).astype(np.uint8) * 255
|
|
||||||
contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
|
|
||||||
for contour in contours:
|
|
||||||
if contour.size > 0:
|
|
||||||
for point in contour:
|
|
||||||
class_entry['Contornos'].append(point.squeeze().tolist())
|
|
||||||
json_data['Classes'].append(class_entry)
|
|
||||||
|
|
||||||
return json_data
|
|
||||||
|
|
||||||
# Função para aplicar o overlay da segmentação no frame original
|
|
||||||
def apply_segmentation_overlay(frame, output_predictions):
|
|
||||||
label_colors, class_names = read_labelmap(model_folder + "dataset/labelmap.txt")
|
|
||||||
nc = len(label_colors)
|
|
||||||
|
|
||||||
height, width, _ = frame.shape
|
|
||||||
overlay = np.zeros((height, width, 3), dtype=np.uint8)
|
|
||||||
|
|
||||||
output_predictions_resized = cv2.resize(output_predictions, (width, height), interpolation=cv2.INTER_NEAREST)
|
|
||||||
|
|
||||||
for l in np.unique(output_predictions_resized):
|
|
||||||
if l < nc:
|
|
||||||
mask = output_predictions_resized == l
|
|
||||||
overlay[mask] = label_colors[l]
|
|
||||||
|
|
||||||
overlayed_frame = cv2.addWeighted(frame, 0.6, overlay, 0.4, 0)
|
|
||||||
|
|
||||||
return overlayed_frame
|
|
||||||
|
|
||||||
# Função para converter imagem para base64
|
|
||||||
def image_to_base64(image):
|
|
||||||
_, buffer = cv2.imencode('.jpg', image)
|
|
||||||
image_base64 = base64.b64encode(buffer).decode('utf-8')
|
|
||||||
return image_base64
|
|
||||||
|
|
||||||
# Função para decodificar a imagem bitmap recebida via MQTT
|
|
||||||
def decode_bitmap_message(payload):
|
|
||||||
image_stream = io.BytesIO(payload)
|
|
||||||
image = Image.open(image_stream)
|
|
||||||
return np.array(image)
|
|
||||||
|
|
||||||
# Função chamada quando uma mensagem MQTT é recebida
|
|
||||||
def on_message(client, userdata, message):
|
|
||||||
print(f"Mensagem recebida no tópico {message.topic}")
|
|
||||||
try:
|
|
||||||
bitmap = decode_bitmap_message(message.payload)
|
|
||||||
output_predictions = segment_frame(bitmap)
|
|
||||||
|
|
||||||
# Gerar JSON das classes detectadas
|
|
||||||
json_data = generate_json(output_predictions)
|
|
||||||
|
|
||||||
# Aplicar segmentação ao bitmap
|
|
||||||
segmented_bitmap = apply_segmentation_overlay(bitmap, output_predictions)
|
|
||||||
|
|
||||||
# Converter o bitmap segmentado em base64
|
|
||||||
segmented_bitmap_base64 = image_to_base64(segmented_bitmap)
|
|
||||||
|
|
||||||
# Adicionar o bitmap segmentado no JSON
|
|
||||||
json_data['segmented_image'] = segmented_bitmap_base64
|
|
||||||
|
|
||||||
# Enviar JSON e bitmap segmentado via MQTT
|
|
||||||
mqtt_client.publish(mqtt_send_topic, json.dumps(json_data).encode('utf-8')) # Enviar JSON
|
|
||||||
print(f"Segmentação processada e enviada para {mqtt_send_topic}")
|
|
||||||
except Exception as e:
|
|
||||||
print(f"Erro ao processar a imagem: {e}")
|
|
||||||
|
|
||||||
def on_connect(client, userdata, flags, rc):
|
|
||||||
if rc == 0:
|
|
||||||
print("Conectado ao MQTT com sucesso!")
|
|
||||||
else:
|
|
||||||
print(f"Falha ao conectar ao MQTT: {rc}")
|
|
||||||
|
|
||||||
def on_disconnect(client, userdata, rc):
|
|
||||||
print(f"Desconectado do MQTT: {rc}")
|
|
||||||
|
|
||||||
# Configurações do MQTT
|
|
||||||
mqtt_client.on_connect = on_connect
|
|
||||||
mqtt_client.on_disconnect = on_disconnect
|
|
||||||
mqtt_client.on_message = on_message
|
|
||||||
mqtt_client.subscribe(mqtt_receive_topic)
|
|
||||||
|
|
||||||
mqtt_client.publish(mqtt_send_topic, "OK")
|
|
||||||
|
|
||||||
mqtt_client.loop_forever()
|
|
||||||
|
|
||||||
# Loop principal aguardando mensagens MQTT
|
|
||||||
try:
|
|
||||||
while True:
|
|
||||||
time.sleep(1)
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
print("Finalizando script...")
|
|
||||||
finally:
|
|
||||||
mqtt_client.loop_stop()
|
|
||||||
|
|
@ -1,198 +0,0 @@
|
||||||
import torch
|
|
||||||
from PIL import Image
|
|
||||||
import torchvision.transforms as T
|
|
||||||
import numpy as np
|
|
||||||
import cv2
|
|
||||||
import json
|
|
||||||
import time
|
|
||||||
from flask import Flask, Response, request
|
|
||||||
import threading
|
|
||||||
import socket
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
import uuid
|
|
||||||
import paho.mqtt.client as mqtt
|
|
||||||
mqtt_client = mqtt.Client(f"client_street_detector_{uuid.uuid4()}")
|
|
||||||
mqtt_client.connect("localhost", port=1883)
|
|
||||||
|
|
||||||
|
|
||||||
json_reading_data = None
|
|
||||||
output_folder = 'Python/Output/'
|
|
||||||
model_folder = 'C:\\ZendionINC\\agrobot_base\\Treinamento\\models\\ruas\\'
|
|
||||||
max_readings = int(sys.argv[1])
|
|
||||||
port = sys.argv[2]
|
|
||||||
url = sys.argv[3]
|
|
||||||
output_file = sys.argv[4]
|
|
||||||
show_lines = sys.argv[5] == "1"
|
|
||||||
mqtt_topic = sys.argv[6]
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
|
||||||
|
|
||||||
script_dir = os.path.dirname(__file__) # Obtém o diretório onde o script está localizado
|
|
||||||
parent_dir = os.path.dirname(script_dir) # Obtém o diretório pai (Python/)
|
|
||||||
sys.path.append(parent_dir)
|
|
||||||
|
|
||||||
# Supondo que você tenha a estrutura do repositório e o módulo `network` conforme descrito no README
|
|
||||||
from Models.deeplabv3plus.modeling import deeplabv3plus_resnet50 as deeplabv3_model
|
|
||||||
|
|
||||||
# Configurações Iniciais
|
|
||||||
NUM_CLASSES = 4 # Pascal VOC possui 3 classes + 1 para o fundo
|
|
||||||
OUTPUT_STRIDE = 16 # Valor comum para DeepLab
|
|
||||||
MODEL_PATH = model_folder + 'backup/ruasModel_final.pth' # Caminho para o modelo pré-treinado
|
|
||||||
|
|
||||||
# Função para carregar o modelo
|
|
||||||
def load_model(model_path):
|
|
||||||
model = deeplabv3_model(num_classes=NUM_CLASSES, output_stride=OUTPUT_STRIDE)
|
|
||||||
model.load_state_dict(torch.load(model_path), strict=False)
|
|
||||||
model.eval() # Modo de avaliação
|
|
||||||
return model
|
|
||||||
|
|
||||||
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
||||||
# Carregar o modelo
|
|
||||||
model = load_model(MODEL_PATH)
|
|
||||||
model.to(device)
|
|
||||||
|
|
||||||
# Função modificada para processar um frame da câmera
|
|
||||||
def segment_frame(frame):
|
|
||||||
# Converte o frame do OpenCV (BGR) para o formato RGB
|
|
||||||
image = Image.fromarray(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
|
|
||||||
transform = T.Compose([
|
|
||||||
T.Resize(520),
|
|
||||||
T.ToTensor(),
|
|
||||||
T.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
|
|
||||||
])
|
|
||||||
|
|
||||||
input_tensor = transform(image).unsqueeze(0).to(device)
|
|
||||||
with torch.no_grad():
|
|
||||||
output = model(input_tensor)
|
|
||||||
output_predictions = output.max(1)[1].squeeze().detach().cpu().numpy()
|
|
||||||
|
|
||||||
generate_and_save_json(output_predictions)
|
|
||||||
|
|
||||||
return output_predictions
|
|
||||||
|
|
||||||
def read_labelmap(path):
|
|
||||||
label_colors = []
|
|
||||||
class_names = []
|
|
||||||
with open(path, 'r') as file:
|
|
||||||
for line in file.readlines():
|
|
||||||
# Ignora linhas comentadas
|
|
||||||
if line.startswith('#'):
|
|
||||||
continue
|
|
||||||
parts = line.strip().split(':')
|
|
||||||
if len(parts) >= 2:
|
|
||||||
label = parts[0].strip()
|
|
||||||
color = tuple(map(int, parts[1].split(',')))
|
|
||||||
class_names.append(label)
|
|
||||||
label_colors.append(color)
|
|
||||||
return np.array(label_colors), class_names
|
|
||||||
|
|
||||||
def generate_and_save_json(image):
|
|
||||||
label_colors, class_names = read_labelmap(model_folder + "dataset/labelmap.txt")
|
|
||||||
detected_classes = set(np.unique(image))
|
|
||||||
|
|
||||||
global json_reading_data
|
|
||||||
|
|
||||||
# Caminho completo para o arquivo de saída
|
|
||||||
output_path = output_folder + output_file
|
|
||||||
|
|
||||||
timestamp = time.time()
|
|
||||||
json_data = {'timestamp': timestamp, 'Classes': []}
|
|
||||||
for l in detected_classes:
|
|
||||||
if l < len(label_colors): # Verifica se o índice está dentro do intervalo das cores definidas
|
|
||||||
class_entry = {'Classe': class_names[l], 'Contornos': []}
|
|
||||||
# Extrai a máscara para a classe atual
|
|
||||||
mask = (image == l).astype(np.uint8) * 255
|
|
||||||
contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
|
|
||||||
for contour in contours:
|
|
||||||
# Verifica se o contorno não está vazio e tem a dimensão adequada
|
|
||||||
if contour.size > 0:
|
|
||||||
# Para cada ponto no contorno, adiciona diretamente ao array Contornos
|
|
||||||
for point in contour:
|
|
||||||
class_entry['Contornos'].append(point.squeeze().tolist())
|
|
||||||
json_data['Classes'].append(class_entry)
|
|
||||||
|
|
||||||
# Garante que o diretório de saída exista
|
|
||||||
if not os.path.exists(output_folder):
|
|
||||||
os.makedirs(output_folder)
|
|
||||||
|
|
||||||
# Salva os dados em um arquivo JSON, sobrescrevendo o arquivo existente
|
|
||||||
try:
|
|
||||||
with open(output_path, 'w') as f:
|
|
||||||
json.dump([json_data], f, indent=4) # Envolva json_data em uma lista para manter o formato de lista no arquivo JSON
|
|
||||||
except OSError as e:
|
|
||||||
print(f"Erro ao abrir o arquivo: {e}")
|
|
||||||
print(f"Caminho do arquivo tentado: {output_path}")
|
|
||||||
|
|
||||||
json_reading_data = json_data
|
|
||||||
mqtt_client.publish(mqtt_topic, json.dumps(json_data).encode('utf-8'))
|
|
||||||
|
|
||||||
|
|
||||||
# Função para decodificar e aplicar o mapa de segmentação em um frame
|
|
||||||
def apply_segmentation_overlay(frame, output_predictions):
|
|
||||||
label_colors, class_names = read_labelmap(model_folder + "dataset/labelmap.txt")
|
|
||||||
nc = len(label_colors)
|
|
||||||
|
|
||||||
height, width, _ = frame.shape
|
|
||||||
overlay = np.zeros((height, width, 3), dtype=np.uint8)
|
|
||||||
|
|
||||||
# Redimensiona as previsões do modelo para corresponder ao tamanho do frame
|
|
||||||
output_predictions_resized = cv2.resize(output_predictions, (width, height), interpolation=cv2.INTER_NEAREST)
|
|
||||||
|
|
||||||
for l in np.unique(output_predictions_resized):
|
|
||||||
if l < nc:
|
|
||||||
mask = output_predictions_resized == l
|
|
||||||
overlay[mask] = label_colors[l]
|
|
||||||
|
|
||||||
# Combinação do frame original com o overlay da segmentação
|
|
||||||
overlayed_frame = cv2.addWeighted(frame, 0.6, overlay, 0.4, 0)
|
|
||||||
|
|
||||||
return overlayed_frame
|
|
||||||
|
|
||||||
# Função para processar e transmitir o vídeo
|
|
||||||
def detect_and_stream(camera_index):
|
|
||||||
cap = cv2.VideoCapture(camera_index)
|
|
||||||
while True:
|
|
||||||
ret, frame = cap.read()
|
|
||||||
if not ret:
|
|
||||||
break
|
|
||||||
|
|
||||||
#frame = cv2.imread(model_folder + "dataset/images/81.jpeg")
|
|
||||||
|
|
||||||
# Processa o frame com seu modelo
|
|
||||||
output_predictions = segment_frame(frame)
|
|
||||||
# Aplica a segmentação sobre o frame capturado
|
|
||||||
overlayed_frame = apply_segmentation_overlay(frame, output_predictions)
|
|
||||||
|
|
||||||
frame_saida = overlayed_frame if show_lines == 1 else frame
|
|
||||||
|
|
||||||
# Codifica o frame para JPEG e transmite
|
|
||||||
ret, buffer = cv2.imencode('.jpg', frame_saida)
|
|
||||||
frame = buffer.tobytes()
|
|
||||||
yield (b'--frame\r\n'
|
|
||||||
b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n')
|
|
||||||
|
|
||||||
|
|
||||||
# Esta função é para confirmar que script está pronto para execução
|
|
||||||
def send_script_ready():
|
|
||||||
mqtt_client.publish(mqtt_topic, "OK")
|
|
||||||
|
|
||||||
|
|
||||||
@app.route('/' + url, methods=['GET'])
|
|
||||||
def stream():
|
|
||||||
camera_index = int(request.args.get('camera_index'))
|
|
||||||
return Response(detect_and_stream(camera_index),
|
|
||||||
mimetype='multipart/x-mixed-replace; boundary=frame')
|
|
||||||
|
|
||||||
def run_flask_server():
|
|
||||||
app.run(host='0.0.0.0', port=port, threaded=True, debug=False)
|
|
||||||
|
|
||||||
# Iniciar o servidor
|
|
||||||
if __name__ == '__main__':
|
|
||||||
# Cria trhead separada para informar que o script iniciou com sucesso
|
|
||||||
mqtt_thread = threading.Thread(target=send_script_ready)
|
|
||||||
mqtt_thread.start()
|
|
||||||
|
|
||||||
# Inicia o servidor Flask na thread principal
|
|
||||||
run_flask_server()
|
|
||||||
|
|
@ -1,171 +0,0 @@
|
||||||
import cv2
|
|
||||||
import torch
|
|
||||||
import time
|
|
||||||
import threading
|
|
||||||
import numpy as np
|
|
||||||
from numpy import random
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
from flask import Flask, Response, request
|
|
||||||
import json
|
|
||||||
|
|
||||||
models_path = os.path.join(os.path.dirname(__file__), '..', 'Models/yolov7')
|
|
||||||
sys.path.append(models_path)
|
|
||||||
|
|
||||||
from models.experimental import attempt_load
|
|
||||||
from utils.general import non_max_suppression, scale_coords, check_img_size
|
|
||||||
from utils.torch_utils import select_device, time_synchronized
|
|
||||||
from utils.datasets import letterbox
|
|
||||||
from utils.plots import plot_one_box
|
|
||||||
|
|
||||||
import uuid
|
|
||||||
import paho.mqtt.client as mqtt
|
|
||||||
mqtt_client = mqtt.Client(f"client_weed_detector_{uuid.uuid4()}")
|
|
||||||
mqtt_client.connect("localhost", port=1883)
|
|
||||||
|
|
||||||
# Outras configurações
|
|
||||||
json_data = None
|
|
||||||
output_folder = 'Python/Output/'
|
|
||||||
max_readings = int(sys.argv[1])
|
|
||||||
porta = sys.argv[2]
|
|
||||||
url = sys.argv[3]
|
|
||||||
arquivoSaida = sys.argv[4]
|
|
||||||
mostrar_linhas = sys.argv[5] == "1"
|
|
||||||
mqtt_topic = sys.argv[6]
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
|
||||||
|
|
||||||
def detect(weights, _camera_index, img_size=512, conf_thres=0.25, iou_thres=0.45):
|
|
||||||
with torch.no_grad():
|
|
||||||
# Initialize
|
|
||||||
device = select_device('')
|
|
||||||
half = device.type != 'cpu' # half precision only supported on CUDA
|
|
||||||
|
|
||||||
# Load model
|
|
||||||
model = attempt_load(weights, map_location=device) # load FP32 model
|
|
||||||
model.eval()
|
|
||||||
stride = int(model.stride.max()) # model stride
|
|
||||||
imgsz = check_img_size(img_size, s=stride) # check img_size
|
|
||||||
if half:
|
|
||||||
model.half() # to FP16
|
|
||||||
|
|
||||||
# Open camera
|
|
||||||
cap = cv2.VideoCapture(_camera_index) # 0 for the first webcam device
|
|
||||||
#cap.set(3, 640) # set video width
|
|
||||||
#cap.set(4, 480) # set video height
|
|
||||||
width = cap.get(cv2.CAP_PROP_FRAME_WIDTH)
|
|
||||||
height = cap.get(cv2.CAP_PROP_FRAME_HEIGHT)
|
|
||||||
readings = []
|
|
||||||
|
|
||||||
while True:
|
|
||||||
ret, frame = cap.read()
|
|
||||||
if not ret:
|
|
||||||
break
|
|
||||||
|
|
||||||
# Padded resize
|
|
||||||
img = letterbox(frame, imgsz, stride=stride)[0]
|
|
||||||
|
|
||||||
# Convert
|
|
||||||
img = img[:, :, ::-1].transpose(2, 0, 1) # BGR to RGB, to 3x416x416
|
|
||||||
img = np.ascontiguousarray(img)
|
|
||||||
|
|
||||||
img = torch.from_numpy(img).to(device)
|
|
||||||
img = img.half() if half else img.float() # uint8 to fp16/32
|
|
||||||
img /= 255.0 # 0 - 255 to 0.0 - 1.0
|
|
||||||
if img.ndimension() == 3:
|
|
||||||
img = img.unsqueeze(0)
|
|
||||||
|
|
||||||
# Inference
|
|
||||||
t1 = time_synchronized()
|
|
||||||
pred = model(img, augment=False)[0]
|
|
||||||
t2 = time_synchronized()
|
|
||||||
|
|
||||||
# Apply NMS
|
|
||||||
pred = non_max_suppression(pred, conf_thres, iou_thres, classes=None, agnostic=False)
|
|
||||||
|
|
||||||
current_readings = []
|
|
||||||
# Process detections
|
|
||||||
for i, det in enumerate(pred): # detections per frame
|
|
||||||
if len(det):
|
|
||||||
# Rescale boxes from img_size to frame size
|
|
||||||
det[:, :4] = scale_coords(img.shape[2:], det[:, :4], frame.shape).round()
|
|
||||||
|
|
||||||
# Print results and draw boxes
|
|
||||||
for *xyxy, conf, cls in reversed(det):
|
|
||||||
x1, y1, x2, y2 = xyxy
|
|
||||||
x = int(x1)
|
|
||||||
y = int(y1)
|
|
||||||
w = int(x2 - x1)
|
|
||||||
h = int(y2 - y1)
|
|
||||||
class_id = int(cls)
|
|
||||||
confidence = float(conf)
|
|
||||||
|
|
||||||
detection_info = {
|
|
||||||
'id': class_id,
|
|
||||||
'descricao': model.module.names[class_id] if hasattr(model, 'module') else model.names[class_id],
|
|
||||||
'x': x,
|
|
||||||
'y': y,
|
|
||||||
'largura': w,
|
|
||||||
'altura': h,
|
|
||||||
'confianca': confidence
|
|
||||||
}
|
|
||||||
current_readings.append(detection_info)
|
|
||||||
|
|
||||||
if mostrar_linhas:
|
|
||||||
label = f'{model.names[class_id]} {confidence:.2f}'
|
|
||||||
plot_one_box(xyxy, frame, label=label, color=[random.randint(0, 255) for _ in range(3)], line_thickness=3)
|
|
||||||
|
|
||||||
# Após a detecção:
|
|
||||||
del img # Delete the image tensor to free up memory
|
|
||||||
#if device.type == 'cuda':
|
|
||||||
# torch.cuda.empty_cache() # Clear CUDA cache
|
|
||||||
#gc.collect() # Run garbage collection
|
|
||||||
|
|
||||||
global json_data
|
|
||||||
timestamp = time.time()
|
|
||||||
json_data = {'timestamp': timestamp, 'x_max': width, 'y_max': height, 'objetos': current_readings}
|
|
||||||
readings.append(json_data)
|
|
||||||
|
|
||||||
mqtt_client.publish(mqtt_topic, json.dumps(json_data).encode('utf-8'))
|
|
||||||
|
|
||||||
if not os.path.exists(output_folder):
|
|
||||||
os.makedirs(output_folder)
|
|
||||||
|
|
||||||
if len(readings) > max_readings:
|
|
||||||
readings.pop(0)
|
|
||||||
|
|
||||||
with open(output_folder + arquivoSaida, 'w') as file:
|
|
||||||
json.dump(readings, file, indent=4)
|
|
||||||
|
|
||||||
ret, buffer = cv2.imencode('.jpg', frame)
|
|
||||||
frame = buffer.tobytes()
|
|
||||||
yield (b'--frame\r\n'
|
|
||||||
b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Esta função é para confirmar que script está pronto para execução
|
|
||||||
def send_script_ready():
|
|
||||||
mqtt_client.publish(mqtt_topic, "OK")
|
|
||||||
|
|
||||||
# Iniciar o servidor Flask em uma thread separada
|
|
||||||
def run_flask_server():
|
|
||||||
app.run(host='0.0.0.0', port=porta, threaded=True, debug=False)
|
|
||||||
|
|
||||||
@app.route('/' + url, methods=['GET'])
|
|
||||||
def video_feed():
|
|
||||||
weights_path = 'C:\\ZendionINC\\agrobot_base\\Treinamento\\models\\ervas_v7\\backup\\best.pt'
|
|
||||||
conf_threshold = float(request.args.get('conf_threshold'))
|
|
||||||
nms_threshold = float(request.args.get('nms_threshold'))
|
|
||||||
camera_index = int(request.args.get('camera_index'))
|
|
||||||
return Response(detect(weights_path, camera_index, 512), mimetype='multipart/x-mixed-replace; boundary=frame')
|
|
||||||
|
|
||||||
|
|
||||||
# Iniciar o servidor
|
|
||||||
if __name__ == '__main__':
|
|
||||||
# Cria trhead separada para informar que o script iniciou com sucesso
|
|
||||||
mqtt_thread = threading.Thread(target=send_script_ready)
|
|
||||||
mqtt_thread.start()
|
|
||||||
|
|
||||||
# Inicia o servidor Flask na thread principal
|
|
||||||
run_flask_server()
|
|
||||||
|
|
@ -1,135 +0,0 @@
|
||||||
import cv2
|
|
||||||
import numpy as np
|
|
||||||
from flask import Flask, Response, request
|
|
||||||
import json
|
|
||||||
import time
|
|
||||||
import threading
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
|
|
||||||
import uuid
|
|
||||||
import paho.mqtt.client as mqtt
|
|
||||||
mqtt_client = mqtt.Client(f"client_weed_detector_{uuid.uuid4()}")
|
|
||||||
mqtt_client.connect("localhost", port=1883)
|
|
||||||
|
|
||||||
# Adiciona as configurações do modelo YOLO
|
|
||||||
model_config = 'C:\\ZendionINC\\agrobot_base\\Treinamento\\models\\ervas\\ervas.cfg'
|
|
||||||
model_weights = 'C:\\ZendionINC\\agrobot_base\\Treinamento\\models\\ervas\\backup\\ervas_final.weights'
|
|
||||||
labels_path = 'C:\\ZendionINC\\agrobot_base\\Treinamento\\models\\ervas\\labels.txt'
|
|
||||||
|
|
||||||
# Carregar as classes
|
|
||||||
with open(labels_path, 'rt') as f:
|
|
||||||
classes = f.read().rstrip('\n').split('\n')
|
|
||||||
|
|
||||||
# Carregar o modelo YOLO
|
|
||||||
net = cv2.dnn.readNetFromDarknet(model_config, model_weights)
|
|
||||||
net.setPreferableBackend(cv2.dnn.DNN_BACKEND_OPENCV)
|
|
||||||
net.setPreferableTarget(cv2.dnn.DNN_TARGET_OPENCL)
|
|
||||||
|
|
||||||
# Outras configurações
|
|
||||||
json_data = None
|
|
||||||
output_folder = 'Python/Output/'
|
|
||||||
max_readings = int(sys.argv[1])
|
|
||||||
porta = sys.argv[2]
|
|
||||||
url = sys.argv[3]
|
|
||||||
arquivoSaida = sys.argv[4]
|
|
||||||
mostrar_linhas = sys.argv[5] == "1"
|
|
||||||
mqtt_topic = sys.argv[6]
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
|
||||||
|
|
||||||
# Função adaptada para detecção de ervas usando YOLO
|
|
||||||
def detect_objects(conf_threshold, nms_threshold, _camera_index):
|
|
||||||
#cap = cv2.VideoCapture(_camera_index, cv2.CAP_DSHOW)
|
|
||||||
cap = cv2.VideoCapture(_camera_index, cv2.CAP_MSMF)
|
|
||||||
width = cap.get(cv2.CAP_PROP_FRAME_WIDTH)
|
|
||||||
height = cap.get(cv2.CAP_PROP_FRAME_HEIGHT)
|
|
||||||
readings = []
|
|
||||||
|
|
||||||
while True:
|
|
||||||
ret, frame = cap.read()
|
|
||||||
#frame = cv2.flip(frame, 1)
|
|
||||||
if not ret:
|
|
||||||
break
|
|
||||||
|
|
||||||
blob = cv2.dnn.blobFromImage(frame, 0.00392, (416, 416), (0, 0, 0), True, crop=False)
|
|
||||||
net.setInput(blob)
|
|
||||||
outs = net.forward(net.getUnconnectedOutLayersNames())
|
|
||||||
|
|
||||||
current_readings = []
|
|
||||||
for out in outs:
|
|
||||||
for detection in out:
|
|
||||||
scores = detection[5:]
|
|
||||||
class_id = np.argmax(scores)
|
|
||||||
confidence = scores[class_id]
|
|
||||||
if confidence > conf_threshold:
|
|
||||||
center_x = int(detection[0] * width)
|
|
||||||
center_y = int(detection[1] * height)
|
|
||||||
w = int(detection[2] * width)
|
|
||||||
h = int(detection[3] * height)
|
|
||||||
x = int(center_x - w / 2)
|
|
||||||
y = int(center_y - h / 2)
|
|
||||||
|
|
||||||
# Salvar as informações da detecção
|
|
||||||
detection_info = {
|
|
||||||
'id': int(class_id),
|
|
||||||
'descricao': classes[class_id],
|
|
||||||
'x': int(x),
|
|
||||||
'y': int(y),
|
|
||||||
'largura': int(w),
|
|
||||||
'altura': int(h),
|
|
||||||
'confianca': float(confidence)
|
|
||||||
}
|
|
||||||
current_readings.append(detection_info)
|
|
||||||
|
|
||||||
if mostrar_linhas:
|
|
||||||
cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)
|
|
||||||
cv2.putText(frame, f'{classes[class_id]} {confidence:.2f}', (x, y - 5), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2)
|
|
||||||
|
|
||||||
global json_data
|
|
||||||
timestamp = time.time()
|
|
||||||
json_data = {'timestamp': timestamp, 'x_max': width, 'y_max': height, 'objetos': current_readings}
|
|
||||||
readings.append(json_data)
|
|
||||||
|
|
||||||
mqtt_client.publish(mqtt_topic, json.dumps(json_data).encode('utf-8'))
|
|
||||||
|
|
||||||
if not os.path.exists(output_folder):
|
|
||||||
os.makedirs(output_folder)
|
|
||||||
|
|
||||||
if len(readings) > max_readings:
|
|
||||||
readings.pop(0)
|
|
||||||
|
|
||||||
with open(output_folder + arquivoSaida, 'w') as file:
|
|
||||||
json.dump(readings, file, indent=4)
|
|
||||||
|
|
||||||
ret, buffer = cv2.imencode('.jpg', frame)
|
|
||||||
frame = buffer.tobytes()
|
|
||||||
yield (b'--frame\r\n'
|
|
||||||
b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Esta função é para confirmar que script está pronto para execução
|
|
||||||
def send_script_ready():
|
|
||||||
mqtt_client.publish(mqtt_topic, "OK")
|
|
||||||
|
|
||||||
# Iniciar o servidor Flask em uma thread separada
|
|
||||||
def run_flask_server():
|
|
||||||
app.run(host='0.0.0.0', port=porta, threaded=True, debug=False)
|
|
||||||
|
|
||||||
@app.route('/' + url, methods=['GET'])
|
|
||||||
def video_feed():
|
|
||||||
conf_threshold = float(request.args.get('conf_threshold'))
|
|
||||||
nms_threshold = float(request.args.get('nms_threshold'))
|
|
||||||
camera_index = int(request.args.get('camera_index'))
|
|
||||||
return Response(detect_objects(conf_threshold, nms_threshold, camera_index), mimetype='multipart/x-mixed-replace; boundary=frame')
|
|
||||||
|
|
||||||
|
|
||||||
# Iniciar o servidor
|
|
||||||
if __name__ == '__main__':
|
|
||||||
# Cria trhead separada para informar que o script iniciou com sucesso
|
|
||||||
mqtt_thread = threading.Thread(target=send_script_ready)
|
|
||||||
mqtt_thread.start()
|
|
||||||
|
|
||||||
# Inicia o servidor Flask na thread principal
|
|
||||||
run_flask_server()
|
|
||||||
Binary file not shown.
|
|
@ -128,21 +128,11 @@ C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\deeplabv
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\deeplabv3plus\utils.py
|
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\deeplabv3plus\utils.py
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\deeplabv3plus\_deeplab.py
|
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\deeplabv3plus\_deeplab.py
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\deeplabv3plus\__init__.py
|
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\deeplabv3plus\__init__.py
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Scripts\api.py
|
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Scripts\pzem.py
|
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Scripts\street-detector.py
|
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Scripts\weed-detector-v7.py
|
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Scripts\weed-detector.py
|
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\yolo\coco-tiny.names
|
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\yolo\coco-tiny.names
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\yolo\yolov3-tiny.cfg
|
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\yolo\yolov3-tiny.cfg
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\yolo\yolov3-tiny.weights
|
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\yolo\yolov3-tiny.weights
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\yolo\yolov3-weed.weights
|
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\yolo\yolov3-weed.weights
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\yolo\crop_weed_detection.weights
|
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\yolo\crop_weed_detection.weights
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Scripts\gps-viewer.py
|
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Scripts\green-detector.py
|
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Scripts\line-angle.py
|
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Scripts\line-angle2.py
|
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Scripts\map-load.py
|
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\deeplabv3plus\backbone\__pycache__\hrnetv2.cpython-311.pyc
|
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\deeplabv3plus\backbone\__pycache__\hrnetv2.cpython-311.pyc
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\deeplabv3plus\backbone\__pycache__\mobilenetv2.cpython-311.pyc
|
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\deeplabv3plus\backbone\__pycache__\mobilenetv2.cpython-311.pyc
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\deeplabv3plus\backbone\__pycache__\resnet.cpython-311.pyc
|
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Models\deeplabv3plus\backbone\__pycache__\resnet.cpython-311.pyc
|
||||||
|
|
@ -195,14 +185,11 @@ C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\OpenTK.GLControl.xml
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\OpenTK.xml
|
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\OpenTK.xml
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMonitor.Forms.frmAjustesOperacao.resources
|
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMonitor.Forms.frmAjustesOperacao.resources
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMonitor.Forms.frmMonitoramento.resources
|
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMonitor.Forms.frmMonitoramento.resources
|
||||||
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Scripts\map-follow.py
|
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMonitor.csproj.CopyComplete
|
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMonitor.csproj.CopyComplete
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\dll\x86\OpenCvSharpExtern.dll
|
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\dll\x86\OpenCvSharpExtern.dll
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\dll\x86\opencv_videoio_ffmpeg4100.dll
|
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\dll\x86\opencv_videoio_ffmpeg4100.dll
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\dll\x64\OpenCvSharpExtern.dll
|
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\dll\x64\OpenCvSharpExtern.dll
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\dll\x64\opencv_videoio_ffmpeg4100_64.dll
|
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\dll\x64\opencv_videoio_ffmpeg4100_64.dll
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Output\Mont.mtl
|
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Output\Mont.obj
|
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\x64\concrt140.dll
|
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\x64\concrt140.dll
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\x64\cvextern.dll
|
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\x64\cvextern.dll
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\x64\msvcp140.dll
|
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\x64\msvcp140.dll
|
||||||
|
|
@ -220,7 +207,4 @@ C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\x86\msvcp140_2.dll
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\x86\msvcp140_codecvt_ids.dll
|
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\x86\msvcp140_codecvt_ids.dll
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\x86\opencv_videoio_ffmpeg440.dll
|
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\x86\opencv_videoio_ffmpeg440.dll
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\x86\vcruntime140.dll
|
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\x86\vcruntime140.dll
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Scripts\street-detector-mqtt.py
|
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\AssimpNet.dll
|
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\AssimpNet.xml
|
|
||||||
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\OpenHardwareMonitorLib.dll
|
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\OpenHardwareMonitorLib.dll
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue