incluido telas de ihm

This commit is contained in:
Diego Freitas 2024-07-12 16:44:56 -03:00
parent 3c7cd9c5da
commit 09150c93c4
160 changed files with 492665 additions and 28163 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -265,6 +265,18 @@
<Compile Include="Forms\frmWT901C.Designer.cs">
<DependentUpon>frmWT901C.cs</DependentUpon>
</Compile>
<Compile Include="Forms\IHM\frmAjustes.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\IHM\frmAjustes.Designer.cs">
<DependentUpon>frmAjustes.cs</DependentUpon>
</Compile>
<Compile Include="Forms\IHM\frmDialogoMapa.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\IHM\frmDialogoMapa.Designer.cs">
<DependentUpon>frmDialogoMapa.cs</DependentUpon>
</Compile>
<Compile Include="Forms\IHM\frmIHM.cs">
<SubType>Form</SubType>
</Compile>
@ -307,10 +319,10 @@
<Compile Include="Forms\Movimentacao\frmMovPlot.Designer.cs">
<DependentUpon>frmMovPlot.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Operacoes\frmInicioOperacao.cs">
<Compile Include="Forms\IHM\frmInicioOperacao.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\Operacoes\frmInicioOperacao.Designer.cs">
<Compile Include="Forms\IHM\frmInicioOperacao.Designer.cs">
<DependentUpon>frmInicioOperacao.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Operacoes\frmOperacaoManual.cs">
@ -379,6 +391,7 @@
<Compile Include="Models\Operacoes\OperacaoManualModel.cs" />
<Compile Include="Models\Operacoes\OperacaoMapaGPSModel.cs" />
<Compile Include="Models\Operacoes\OperacaoModel.cs" />
<Compile Include="Models\Operacoes\OperacaoParametrosModel.cs" />
<Compile Include="Models\PIDModel.cs" />
<Compile Include="Models\PZEMModel.cs" />
<Compile Include="Models\SonarModel.cs" />
@ -413,13 +426,26 @@
<Compile Include="Services\SerialService.cs" />
<Compile Include="Services\SocketService.cs" />
<Compile Include="Services\WT901CService.cs" />
<None Include="Resources\rede.png" />
<None Include="Imagens\bussola.png" />
<None Include="Imagens\atualizar.png" />
<None Include="Imagens\cana.png" />
<None Include="Imagens\iniciar.png" />
<None Include="Imagens\diagnostico.png" />
<None Include="Imagens\fechar.png" />
<None Include="Imagens\desligar.png" />
<None Include="Imagens\ajustes.png" />
<None Include="Imagens\excluir.png" />
<Content Include="Imagens\loading.gif" />
<None Include="Imagens\robo_superior.jpg" />
<None Include="Imagens\mcp.jpg" />
<None Include="Imagens\pasta.png" />
<None Include="Imagens\localizacao.png" />
<Content Include="Imagens\roda_superior.png" />
<Content Include="Imagens\rosa_dos_ventos.png" />
<None Include="Imagens\salvar.png" />
<Content Include="Imagens\transferidor.png" />
<None Include="Imagens\voltar.png" />
<Content Include="Python\Models\deeplabv3plus\backbone\hrnetv2.py">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
@ -615,6 +641,12 @@
<EmbeddedResource Include="Forms\frmWT901C.resx">
<DependentUpon>frmWT901C.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\IHM\frmAjustes.resx">
<DependentUpon>frmAjustes.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\IHM\frmDialogoMapa.resx">
<DependentUpon>frmDialogoMapa.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\IHM\frmIHM.resx">
<DependentUpon>frmIHM.cs</DependentUpon>
</EmbeddedResource>
@ -639,7 +671,7 @@
<EmbeddedResource Include="Forms\frmJoystick.resx">
<DependentUpon>frmJoystick.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Operacoes\frmInicioOperacao.resx">
<EmbeddedResource Include="Forms\IHM\frmInicioOperacao.resx">
<DependentUpon>frmInicioOperacao.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Operacoes\frmOperacaoManual.resx">
@ -790,7 +822,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Python\Models\yolov7\utils\wandb_logging\__pycache__\" />
<Folder Include="Resources\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

View File

@ -30,7 +30,7 @@ namespace AgroBase.Forms.Atuador
{
PopularBicos();
nudPressaoSP.Value = Convert.ToInt32(DispAtu.Dados.BombaPressurizadora.PressaoSP);
nudPressaoSP.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.PressaoLinha);
txtMMassaRef.Text = DispAtu.Dados._MassaRef.ToString();
txtMLeituraRef.Text = DispAtu.Dados._MassaLeituraRef.ToString();
txtPressaoVmin.Text = DispAtu.Dados._PressaoVmin.ToString();
@ -160,7 +160,7 @@ namespace AgroBase.Forms.Atuador
private void nudPressaoSP_ValueChanged(object sender, EventArgs e)
{
DispAtu.Dados.BombaPressurizadora.PressaoSP = Convert.ToInt32(((NumericUpDown)sender).Value);
Variaveis.OperacaoEmAndamento.Controle.PressaoLinha = Convert.ToInt32(((NumericUpDown)sender).Value);
EnviarProtocoloComandoBomba();
}
@ -227,7 +227,7 @@ namespace AgroBase.Forms.Atuador
private void btnSalvar_Click(object sender, EventArgs e)
{
DispAtu.Dados.BombaPressurizadora.PressaoSP = Convert.ToDouble(nudPressaoSP.Value);
Variaveis.OperacaoEmAndamento.Controle.PressaoLinha = Convert.ToDouble(nudPressaoSP.Value);
DispAtu.Dados._MassaRef = Convert.ToDouble(txtMMassaRef.Text);
DispAtu.Dados._MassaLeituraRef = Convert.ToDouble(txtMLeituraRef.Text);
DispAtu.Dados._PressaoVmin = Convert.ToDouble(txtPressaoVmin.Text);

View File

@ -35,7 +35,7 @@ namespace AgroBase.Forms.Atuador
chbBicosAtuacao.Checked = Disp.Dados.AtuacaoNivelAlto;
nudBicosQtd.Value = Disp.Dados.QuantidadeBicos;
txtDensidade.Text = Disp.Dados.DensidadeHerbicida.ToString("0.00");
nudCapMax.Value = Convert.ToInt32(Disp.Dados.CapacidadeReservatorio);
nudCapMax.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.CapacidadeReservatorio);
}
private void frmAtuConfig_FormClosing(object sender, FormClosingEventArgs e)
@ -49,7 +49,7 @@ namespace AgroBase.Forms.Atuador
Disp.Dados.AtuacaoNivelAlto = chbBicosAtuacao.Checked;
Disp.Dados.QuantidadeBicos = Convert.ToInt32(nudBicosQtd.Value);
Disp.Dados.DensidadeHerbicida = Convert.ToDouble(txtDensidade.Text.Replace(".", ","));
Disp.Dados.CapacidadeReservatorio = Convert.ToDouble(nudCapMax.Value);
Variaveis.OperacaoEmAndamento.CapacidadeReservatorio = Convert.ToDouble(nudCapMax.Value);
Disp.SalvarParametros(Disp.Dados);
}

View File

@ -0,0 +1,535 @@
namespace AgroBase.Forms.IHM
{
partial class frmAjustes
{
/// <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.pnlEsquerda = new System.Windows.Forms.Panel();
this.lblCameras = new System.Windows.Forms.Label();
this.lblEsquerda = new System.Windows.Forms.Label();
this.lblDireita = new System.Windows.Forms.Label();
this.pnlDireita = new System.Windows.Forms.Panel();
this.pnlCentro = new System.Windows.Forms.Panel();
this.lblCentro = new System.Windows.Forms.Label();
this.cmbS0 = new System.Windows.Forms.ComboBox();
this.cmbC = new System.Windows.Forms.ComboBox();
this.cmbS1 = new System.Windows.Forms.ComboBox();
this.lblComunicacao = new System.Windows.Forms.Label();
this.picVoltar = new System.Windows.Forms.PictureBox();
this.picSalvar = new System.Windows.Forms.PictureBox();
this.lblCanal = new System.Windows.Forms.Label();
this.txtCanal = new System.Windows.Forms.TextBox();
this.lblEndereco = new System.Windows.Forms.Label();
this.txtEndereco = new System.Windows.Forms.TextBox();
this.cmbPower = new System.Windows.Forms.ComboBox();
this.lblPotencia = new System.Windows.Forms.Label();
this.cmbWorCycle = new System.Windows.Forms.ComboBox();
this.lblWorCycle = new System.Windows.Forms.Label();
this.cmbTransmissao = new System.Windows.Forms.ComboBox();
this.lblTransmissao = new System.Windows.Forms.Label();
this.cmbPacketSize = new System.Windows.Forms.ComboBox();
this.lblTamanhoPacote = new System.Windows.Forms.Label();
this.cmbAirRate = new System.Windows.Forms.ComboBox();
this.lblAirRate = new System.Windows.Forms.Label();
this.cmbBaudRate = new System.Windows.Forms.ComboBox();
this.lblBaudRate = new System.Windows.Forms.Label();
this.picLer = new System.Windows.Forms.PictureBox();
this.picGravar = new System.Windows.Forms.PictureBox();
this.picAtualizar = new System.Windows.Forms.PictureBox();
this.picEsquerda = new System.Windows.Forms.PictureBox();
this.picCentro = new System.Windows.Forms.PictureBox();
this.picDireita = new System.Windows.Forms.PictureBox();
this.pnlEsquerda.SuspendLayout();
this.pnlDireita.SuspendLayout();
this.pnlCentro.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picVoltar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picSalvar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picLer)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picGravar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picAtualizar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picEsquerda)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picCentro)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picDireita)).BeginInit();
this.SuspendLayout();
//
// pnlEsquerda
//
this.pnlEsquerda.Controls.Add(this.picEsquerda);
this.pnlEsquerda.Location = new System.Drawing.Point(101, 71);
this.pnlEsquerda.Name = "pnlEsquerda";
this.pnlEsquerda.Size = new System.Drawing.Size(225, 172);
this.pnlEsquerda.TabIndex = 0;
//
// lblCameras
//
this.lblCameras.AutoSize = true;
this.lblCameras.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblCameras.Location = new System.Drawing.Point(97, 9);
this.lblCameras.Name = "lblCameras";
this.lblCameras.Size = new System.Drawing.Size(85, 24);
this.lblCameras.TabIndex = 2;
this.lblCameras.Text = "Câmeras";
//
// lblEsquerda
//
this.lblEsquerda.AutoSize = true;
this.lblEsquerda.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.lblEsquerda.Location = new System.Drawing.Point(123, 48);
this.lblEsquerda.Name = "lblEsquerda";
this.lblEsquerda.Size = new System.Drawing.Size(178, 20);
this.lblEsquerda.TabIndex = 3;
this.lblEsquerda.Text = "Esquerda Pulverizador";
//
// lblDireita
//
this.lblDireita.AutoSize = true;
this.lblDireita.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.lblDireita.Location = new System.Drawing.Point(595, 48);
this.lblDireita.Name = "lblDireita";
this.lblDireita.Size = new System.Drawing.Size(157, 20);
this.lblDireita.TabIndex = 5;
this.lblDireita.Text = "Direita Pulverizador";
//
// pnlDireita
//
this.pnlDireita.Controls.Add(this.picDireita);
this.pnlDireita.Location = new System.Drawing.Point(563, 71);
this.pnlDireita.Name = "pnlDireita";
this.pnlDireita.Size = new System.Drawing.Size(225, 172);
this.pnlDireita.TabIndex = 4;
//
// pnlCentro
//
this.pnlCentro.Controls.Add(this.picCentro);
this.pnlCentro.Location = new System.Drawing.Point(332, 71);
this.pnlCentro.Name = "pnlCentro";
this.pnlCentro.Size = new System.Drawing.Size(225, 172);
this.pnlCentro.TabIndex = 1;
//
// lblCentro
//
this.lblCentro.AutoSize = true;
this.lblCentro.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.lblCentro.Location = new System.Drawing.Point(374, 48);
this.lblCentro.Name = "lblCentro";
this.lblCentro.Size = new System.Drawing.Size(132, 20);
this.lblCentro.TabIndex = 6;
this.lblCentro.Text = "Caminho Frontal";
//
// cmbS0
//
this.cmbS0.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbS0.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.cmbS0.FormattingEnabled = true;
this.cmbS0.Location = new System.Drawing.Point(101, 249);
this.cmbS0.Name = "cmbS0";
this.cmbS0.Size = new System.Drawing.Size(225, 28);
this.cmbS0.TabIndex = 7;
//
// cmbC
//
this.cmbC.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbC.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.cmbC.FormattingEnabled = true;
this.cmbC.Location = new System.Drawing.Point(332, 249);
this.cmbC.Name = "cmbC";
this.cmbC.Size = new System.Drawing.Size(225, 28);
this.cmbC.TabIndex = 8;
//
// cmbS1
//
this.cmbS1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbS1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.cmbS1.FormattingEnabled = true;
this.cmbS1.Location = new System.Drawing.Point(563, 249);
this.cmbS1.Name = "cmbS1";
this.cmbS1.Size = new System.Drawing.Size(225, 28);
this.cmbS1.TabIndex = 9;
//
// lblComunicacao
//
this.lblComunicacao.AutoSize = true;
this.lblComunicacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblComunicacao.Location = new System.Drawing.Point(97, 303);
this.lblComunicacao.Name = "lblComunicacao";
this.lblComunicacao.Size = new System.Drawing.Size(127, 24);
this.lblComunicacao.TabIndex = 10;
this.lblComunicacao.Text = "Comunicação";
//
// picVoltar
//
this.picVoltar.Image = global::AgroBase.Properties.Resources.voltar;
this.picVoltar.Location = new System.Drawing.Point(12, 12);
this.picVoltar.Name = "picVoltar";
this.picVoltar.Size = new System.Drawing.Size(65, 65);
this.picVoltar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picVoltar.TabIndex = 11;
this.picVoltar.TabStop = false;
//
// picSalvar
//
this.picSalvar.Image = global::AgroBase.Properties.Resources.salvar;
this.picSalvar.Location = new System.Drawing.Point(12, 212);
this.picSalvar.Name = "picSalvar";
this.picSalvar.Size = new System.Drawing.Size(65, 65);
this.picSalvar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picSalvar.TabIndex = 12;
this.picSalvar.TabStop = false;
//
// lblCanal
//
this.lblCanal.AutoSize = true;
this.lblCanal.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblCanal.Location = new System.Drawing.Point(127, 436);
this.lblCanal.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblCanal.Name = "lblCanal";
this.lblCanal.Size = new System.Drawing.Size(60, 17);
this.lblCanal.TabIndex = 32;
this.lblCanal.Text = "Channel";
//
// txtCanal
//
this.txtCanal.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtCanal.Location = new System.Drawing.Point(247, 431);
this.txtCanal.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtCanal.Name = "txtCanal";
this.txtCanal.Size = new System.Drawing.Size(155, 26);
this.txtCanal.TabIndex = 31;
//
// lblEndereco
//
this.lblEndereco.AutoSize = true;
this.lblEndereco.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblEndereco.Location = new System.Drawing.Point(127, 406);
this.lblEndereco.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblEndereco.Name = "lblEndereco";
this.lblEndereco.Size = new System.Drawing.Size(60, 17);
this.lblEndereco.TabIndex = 30;
this.lblEndereco.Text = "Address";
//
// txtEndereco
//
this.txtEndereco.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtEndereco.Location = new System.Drawing.Point(247, 401);
this.txtEndereco.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtEndereco.Name = "txtEndereco";
this.txtEndereco.Size = new System.Drawing.Size(155, 26);
this.txtEndereco.TabIndex = 29;
//
// cmbPower
//
this.cmbPower.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbPower.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.cmbPower.FormattingEnabled = true;
this.cmbPower.Location = new System.Drawing.Point(563, 433);
this.cmbPower.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cmbPower.Name = "cmbPower";
this.cmbPower.Size = new System.Drawing.Size(155, 28);
this.cmbPower.TabIndex = 28;
//
// lblPotencia
//
this.lblPotencia.AutoSize = true;
this.lblPotencia.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblPotencia.Location = new System.Drawing.Point(444, 438);
this.lblPotencia.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblPotencia.Name = "lblPotencia";
this.lblPotencia.Size = new System.Drawing.Size(47, 17);
this.lblPotencia.TabIndex = 27;
this.lblPotencia.Text = "Power";
//
// cmbWorCycle
//
this.cmbWorCycle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbWorCycle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.cmbWorCycle.FormattingEnabled = true;
this.cmbWorCycle.Location = new System.Drawing.Point(563, 401);
this.cmbWorCycle.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cmbWorCycle.Name = "cmbWorCycle";
this.cmbWorCycle.Size = new System.Drawing.Size(155, 28);
this.cmbWorCycle.TabIndex = 26;
//
// lblWorCycle
//
this.lblWorCycle.AutoSize = true;
this.lblWorCycle.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblWorCycle.Location = new System.Drawing.Point(444, 406);
this.lblWorCycle.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblWorCycle.Name = "lblWorCycle";
this.lblWorCycle.Size = new System.Drawing.Size(75, 17);
this.lblWorCycle.TabIndex = 25;
this.lblWorCycle.Text = "Wor Clycle";
//
// cmbTransmissao
//
this.cmbTransmissao.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbTransmissao.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.cmbTransmissao.FormattingEnabled = true;
this.cmbTransmissao.Location = new System.Drawing.Point(247, 369);
this.cmbTransmissao.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cmbTransmissao.Name = "cmbTransmissao";
this.cmbTransmissao.Size = new System.Drawing.Size(155, 28);
this.cmbTransmissao.TabIndex = 24;
//
// lblTransmissao
//
this.lblTransmissao.AutoSize = true;
this.lblTransmissao.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblTransmissao.Location = new System.Drawing.Point(127, 374);
this.lblTransmissao.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTransmissao.Name = "lblTransmissao";
this.lblTransmissao.Size = new System.Drawing.Size(89, 17);
this.lblTransmissao.TabIndex = 23;
this.lblTransmissao.Text = "Transmissão";
//
// cmbPacketSize
//
this.cmbPacketSize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbPacketSize.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.cmbPacketSize.FormattingEnabled = true;
this.cmbPacketSize.Location = new System.Drawing.Point(563, 369);
this.cmbPacketSize.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cmbPacketSize.Name = "cmbPacketSize";
this.cmbPacketSize.Size = new System.Drawing.Size(155, 28);
this.cmbPacketSize.TabIndex = 22;
//
// lblTamanhoPacote
//
this.lblTamanhoPacote.AutoSize = true;
this.lblTamanhoPacote.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblTamanhoPacote.Location = new System.Drawing.Point(444, 374);
this.lblTamanhoPacote.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTamanhoPacote.Name = "lblTamanhoPacote";
this.lblTamanhoPacote.Size = new System.Drawing.Size(82, 17);
this.lblTamanhoPacote.TabIndex = 21;
this.lblTamanhoPacote.Text = "Packet Size";
//
// cmbAirRate
//
this.cmbAirRate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbAirRate.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.cmbAirRate.FormattingEnabled = true;
this.cmbAirRate.Location = new System.Drawing.Point(563, 337);
this.cmbAirRate.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cmbAirRate.Name = "cmbAirRate";
this.cmbAirRate.Size = new System.Drawing.Size(155, 28);
this.cmbAirRate.TabIndex = 20;
//
// lblAirRate
//
this.lblAirRate.AutoSize = true;
this.lblAirRate.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblAirRate.Location = new System.Drawing.Point(444, 342);
this.lblAirRate.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblAirRate.Name = "lblAirRate";
this.lblAirRate.Size = new System.Drawing.Size(59, 17);
this.lblAirRate.TabIndex = 19;
this.lblAirRate.Text = "Air Rate";
//
// cmbBaudRate
//
this.cmbBaudRate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbBaudRate.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.cmbBaudRate.FormattingEnabled = true;
this.cmbBaudRate.Location = new System.Drawing.Point(247, 337);
this.cmbBaudRate.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cmbBaudRate.Name = "cmbBaudRate";
this.cmbBaudRate.Size = new System.Drawing.Size(155, 28);
this.cmbBaudRate.TabIndex = 18;
//
// lblBaudRate
//
this.lblBaudRate.AutoSize = true;
this.lblBaudRate.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblBaudRate.Location = new System.Drawing.Point(127, 342);
this.lblBaudRate.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblBaudRate.Name = "lblBaudRate";
this.lblBaudRate.Size = new System.Drawing.Size(75, 17);
this.lblBaudRate.TabIndex = 17;
this.lblBaudRate.Text = "Baud Rate";
//
// picLer
//
this.picLer.Image = global::AgroBase.Properties.Resources.atualizar;
this.picLer.Location = new System.Drawing.Point(12, 311);
this.picLer.Name = "picLer";
this.picLer.Size = new System.Drawing.Size(65, 65);
this.picLer.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picLer.TabIndex = 33;
this.picLer.TabStop = false;
//
// picGravar
//
this.picGravar.Image = global::AgroBase.Properties.Resources.salvar;
this.picGravar.Location = new System.Drawing.Point(12, 395);
this.picGravar.Name = "picGravar";
this.picGravar.Size = new System.Drawing.Size(65, 65);
this.picGravar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picGravar.TabIndex = 34;
this.picGravar.TabStop = false;
//
// picAtualizar
//
this.picAtualizar.Image = global::AgroBase.Properties.Resources.atualizar;
this.picAtualizar.Location = new System.Drawing.Point(12, 127);
this.picAtualizar.Name = "picAtualizar";
this.picAtualizar.Size = new System.Drawing.Size(65, 65);
this.picAtualizar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picAtualizar.TabIndex = 35;
this.picAtualizar.TabStop = false;
//
// picEsquerda
//
this.picEsquerda.BackColor = System.Drawing.Color.Black;
this.picEsquerda.Dock = System.Windows.Forms.DockStyle.Fill;
this.picEsquerda.Location = new System.Drawing.Point(0, 0);
this.picEsquerda.Name = "picEsquerda";
this.picEsquerda.Size = new System.Drawing.Size(225, 172);
this.picEsquerda.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picEsquerda.TabIndex = 0;
this.picEsquerda.TabStop = false;
//
// picCentro
//
this.picCentro.BackColor = System.Drawing.Color.Black;
this.picCentro.Dock = System.Windows.Forms.DockStyle.Fill;
this.picCentro.Location = new System.Drawing.Point(0, 0);
this.picCentro.Name = "picCentro";
this.picCentro.Size = new System.Drawing.Size(225, 172);
this.picCentro.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picCentro.TabIndex = 1;
this.picCentro.TabStop = false;
//
// picDireita
//
this.picDireita.BackColor = System.Drawing.Color.Black;
this.picDireita.Dock = System.Windows.Forms.DockStyle.Fill;
this.picDireita.Location = new System.Drawing.Point(0, 0);
this.picDireita.Name = "picDireita";
this.picDireita.Size = new System.Drawing.Size(225, 172);
this.picDireita.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picDireita.TabIndex = 1;
this.picDireita.TabStop = false;
//
// frmAjustes
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Ivory;
this.ClientSize = new System.Drawing.Size(800, 480);
this.Controls.Add(this.picSalvar);
this.Controls.Add(this.picAtualizar);
this.Controls.Add(this.picGravar);
this.Controls.Add(this.picLer);
this.Controls.Add(this.lblCanal);
this.Controls.Add(this.txtCanal);
this.Controls.Add(this.lblEndereco);
this.Controls.Add(this.txtEndereco);
this.Controls.Add(this.cmbPower);
this.Controls.Add(this.lblPotencia);
this.Controls.Add(this.cmbWorCycle);
this.Controls.Add(this.lblWorCycle);
this.Controls.Add(this.cmbTransmissao);
this.Controls.Add(this.lblTransmissao);
this.Controls.Add(this.cmbPacketSize);
this.Controls.Add(this.lblTamanhoPacote);
this.Controls.Add(this.cmbAirRate);
this.Controls.Add(this.lblAirRate);
this.Controls.Add(this.cmbBaudRate);
this.Controls.Add(this.lblBaudRate);
this.Controls.Add(this.picVoltar);
this.Controls.Add(this.lblComunicacao);
this.Controls.Add(this.cmbS1);
this.Controls.Add(this.cmbC);
this.Controls.Add(this.cmbS0);
this.Controls.Add(this.lblCentro);
this.Controls.Add(this.pnlCentro);
this.Controls.Add(this.lblDireita);
this.Controls.Add(this.pnlDireita);
this.Controls.Add(this.lblEsquerda);
this.Controls.Add(this.lblCameras);
this.Controls.Add(this.pnlEsquerda);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "frmAjustes";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "frmAjustes";
this.Load += new System.EventHandler(this.frmAjustes_Load);
this.pnlEsquerda.ResumeLayout(false);
this.pnlDireita.ResumeLayout(false);
this.pnlCentro.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.picVoltar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picSalvar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picLer)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picGravar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picAtualizar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picEsquerda)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picCentro)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picDireita)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Panel pnlEsquerda;
private System.Windows.Forms.Label lblCameras;
private System.Windows.Forms.Label lblEsquerda;
private System.Windows.Forms.Label lblDireita;
private System.Windows.Forms.Panel pnlDireita;
private System.Windows.Forms.Panel pnlCentro;
private System.Windows.Forms.Label lblCentro;
private System.Windows.Forms.ComboBox cmbS0;
private System.Windows.Forms.ComboBox cmbC;
private System.Windows.Forms.ComboBox cmbS1;
private System.Windows.Forms.Label lblComunicacao;
private System.Windows.Forms.PictureBox picVoltar;
private System.Windows.Forms.PictureBox picSalvar;
private System.Windows.Forms.Label lblCanal;
private System.Windows.Forms.TextBox txtCanal;
private System.Windows.Forms.Label lblEndereco;
private System.Windows.Forms.TextBox txtEndereco;
private System.Windows.Forms.ComboBox cmbPower;
private System.Windows.Forms.Label lblPotencia;
private System.Windows.Forms.ComboBox cmbWorCycle;
private System.Windows.Forms.Label lblWorCycle;
private System.Windows.Forms.ComboBox cmbTransmissao;
private System.Windows.Forms.Label lblTransmissao;
private System.Windows.Forms.ComboBox cmbPacketSize;
private System.Windows.Forms.Label lblTamanhoPacote;
private System.Windows.Forms.ComboBox cmbAirRate;
private System.Windows.Forms.Label lblAirRate;
private System.Windows.Forms.ComboBox cmbBaudRate;
private System.Windows.Forms.Label lblBaudRate;
private System.Windows.Forms.PictureBox picLer;
private System.Windows.Forms.PictureBox picGravar;
private System.Windows.Forms.PictureBox picAtualizar;
private System.Windows.Forms.PictureBox picEsquerda;
private System.Windows.Forms.PictureBox picDireita;
private System.Windows.Forms.PictureBox picCentro;
}
}

View File

@ -0,0 +1,324 @@
using AForge.Video.DirectShow;
using AForge.Video;
using AgroBase.Models;
using AgroBase.Models.Modules;
using AgroBase.Services;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AgroBase.Forms.IHM
{
public partial class frmAjustes : Form
{
LoRaService loraService;
LoRaParametrosModel Parametros = null;
Dictionary<string, string> Cameras = new Dictionary<string, string>();
public frmAjustes(LoRaService lora)
{
InitializeComponent();
loraService = lora;
}
private void frmAjustes_Load(object sender, EventArgs e)
{
FuncoesGlobais.DefinirEventosPicBtn(picVoltar, async () =>
{
this.Close();
});
FuncoesGlobais.DefinirEventosPicBtn(picSalvar, async () =>
{
Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_Caminho = cmbC.Text;
Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_Solo.Clear();
Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_Solo.AddRange(new string[] { cmbS0.Text, cmbS1.Text });
MessageBox.Show("Configuração de câmeras salva com sucesso!", "Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information);
});
FuncoesGlobais.DefinirEventosPicBtn(picAtualizar, async () =>
{
AtualizarCameras();
});
FuncoesGlobais.DefinirEventosPicBtn(picLer, async () =>
{
if (LoRaService.Iniciado)
{
await AtualizarParametros();
}
else
{
MessageBox.Show("Módulo LoRa de comunicação não está conectado ou não está no modo de parametrização!", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
});
FuncoesGlobais.DefinirEventosPicBtn(picGravar, async () =>
{
if (LoRaService.Iniciado)
{
Parametros.baudRate = LoRaService.CodigosBaudRates.FirstOrDefault(x => x.Key.ToString() == cmbBaudRate.Text).Value;
Parametros.tranMode = LoRaService.CodigosTipoTransmissao.FirstOrDefault(x => x.Key.ToString() == cmbTransmissao.Text).Value;
Parametros.address = Convert.ToByte(txtEndereco.Text);
Parametros.channel = Convert.ToByte(txtCanal.Text);
Parametros.airRate = LoRaService.CodigosAirRates.FirstOrDefault(x => x.Key.ToString() == cmbAirRate.Text).Value;
Parametros.packetSize = LoRaService.CodigosPacketSizes.FirstOrDefault(x => x.Key.ToString() == cmbPacketSize.Text).Value;
Parametros.worCycle = LoRaService.CodigosWorCycles.FirstOrDefault(x => x.Key.ToString() == cmbWorCycle.Text).Value;
Parametros.power = LoRaService.CodigosPowers.FirstOrDefault(x => x.Key.ToString() == cmbPower.Text).Value;
await ConfigurarModulo();
MessageBox.Show("Configuração de comunicação salva com sucesso!", "Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("Módulo LoRa de comunicação não está conectado ou não está no modo de parametrização!", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
});
AtualizarCameras();
if (LoRaService.Iniciado)
{
AtualizarParametros().ConfigureAwait(false);
}
}
#region COMUNICACAO
private async Task AtualizarParametros()
{
var (sucesso, par) = await loraService.RequisitarParametrosModuloAsync();
if (!sucesso)
{
MessageBox.Show("Erro ao requisitar parâmetros! Verifique o modo do módulo LoRa!");
}
Parametros = par;
txtEndereco.Text = ((int)Parametros.address).ToString();
txtCanal.Text = ((int)Parametros.channel).ToString();
cmbBaudRate.Items.Clear();
cmbBaudRate.Items.AddRange(LoRaService.CodigosBaudRates.Keys.Select(x => x.ToString()).ToArray());
cmbBaudRate.SelectedItem = LoRaService.CodigosBaudRates.FirstOrDefault(x => x.Value == Parametros.baudRate).Key.ToString();
cmbTransmissao.Items.Clear();
cmbTransmissao.Items.AddRange(LoRaService.CodigosTipoTransmissao.Keys.Select(x => x.ToString()).ToArray());
cmbTransmissao.SelectedItem = LoRaService.CodigosTipoTransmissao.FirstOrDefault(x => x.Value == Parametros.tranMode).Key.ToString();
cmbAirRate.Items.Clear();
cmbAirRate.Items.AddRange(LoRaService.CodigosAirRates.Keys.Select(x => x.ToString()).ToArray());
cmbAirRate.SelectedItem = LoRaService.CodigosAirRates.FirstOrDefault(x => x.Value == Parametros.airRate).Key.ToString();
cmbPacketSize.Items.Clear();
cmbPacketSize.Items.AddRange(LoRaService.CodigosPacketSizes.Keys.Select(x => x.ToString()).ToArray());
cmbPacketSize.SelectedItem = LoRaService.CodigosPacketSizes.FirstOrDefault(x => x.Value == Parametros.packetSize).Key.ToString();
cmbWorCycle.Items.Clear();
cmbWorCycle.Items.AddRange(LoRaService.CodigosWorCycles.Keys.Select(x => x.ToString()).ToArray());
cmbWorCycle.SelectedItem = LoRaService.CodigosWorCycles.FirstOrDefault(x => x.Value == Parametros.worCycle).Key.ToString();
cmbPower.Items.Clear();
cmbPower.Items.AddRange(LoRaService.CodigosPowers.Keys.Select(x => x.ToString()).ToArray());
cmbPower.SelectedItem = LoRaService.CodigosPowers.FirstOrDefault(x => x.Value == Parametros.power).Key.ToString();
}
private async Task ConfigurarModulo()
{
var Sucesso = await loraService.ConfigurarModuloAsync(Parametros);
if (Sucesso != null)
{
MessageBox.Show("Módulo configurado com sucesso!");
}
else
{
MessageBox.Show("Erro ao configurar módulo!");
}
await AtualizarParametros();
}
#endregion
#region CAMERAS
private FilterInfoCollection videoDevices;
private VideoCaptureDevice videoSourceCentro;
private VideoCaptureDevice videoSourceEsquerda;
private VideoCaptureDevice videoSourceDireita;
private void AtualizarCameras()
{
Variaveis.OperacaoEmAndamento.CameraCaminho.combo = cmbC;
Variaveis.OperacaoEmAndamento.CamerasSolo[0].combo = cmbS0;
Variaveis.OperacaoEmAndamento.CamerasSolo[1].combo = cmbS1;
cmbC.SelectedIndexChanged -= cmbCentro_SelectedIndexChanged;
cmbC.SelectedIndexChanged += cmbCentro_SelectedIndexChanged;
cmbS0.SelectedIndexChanged -= cmbCameraSolo_SelectedIndexChanged;
cmbS0.SelectedIndexChanged += cmbCameraSolo_SelectedIndexChanged;
cmbS1.SelectedIndexChanged -= cmbCameraSolo_SelectedIndexChanged;
cmbS1.SelectedIndexChanged += cmbCameraSolo_SelectedIndexChanged;
Cameras = CameraService.AtualizaListaCameras();
cmbC.Items.Clear();
cmbC.Items.AddRange(Cameras.Values.ToArray());
string IDrua = Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_Caminho;
if (Cameras.Any(x => x.Value == IDrua))
{
cmbC.SelectedIndex = cmbC.Items.IndexOf(IDrua);
}
else
{
cmbC.Text = IDrua;
}
var CamerasSolo = Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_Solo;
cmbS0.Items.Clear();
cmbS0.Items.AddRange(Cameras.Values.ToArray());
string IDsoloE = CamerasSolo.Count() > 0 ? CamerasSolo[0] : "";
if (Cameras.Any(x => x.Value == IDsoloE))
{
cmbS0.SelectedIndex = cmbS0.Items.IndexOf(IDsoloE);
}
else
{
cmbS0.Text = IDsoloE;
}
cmbS1.Items.Clear();
cmbS1.Items.AddRange(Cameras.Values.ToArray());
string IDsoloD = CamerasSolo.Count() > 1 ? CamerasSolo[1] : "";
if (Cameras.Any(x => x.Value == IDsoloD))
{
cmbS1.SelectedIndex = cmbS1.Items.IndexOf(IDsoloD);
}
else
{
cmbS1.Text = IDsoloD;
}
IniciarCameras();
}
private void IniciarCameras()
{
Bitmap blackBitmap = new Bitmap(picCentro.Width, picCentro.Height);
using (Graphics g = Graphics.FromImage(blackBitmap))
{
g.Clear(Color.Black);
}
if (videoSourceCentro != null)
{
videoSourceCentro.Stop();
videoSourceCentro = null;
picCentro.Image = blackBitmap;
}
if (videoSourceEsquerda != null)
{
videoSourceEsquerda.Stop();
videoSourceEsquerda = null;
picEsquerda.Image = blackBitmap;
}
if (videoSourceDireita != null)
{
videoSourceDireita.Stop();
videoSourceDireita = null;
picDireita.Image = blackBitmap;
}
videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
List<string> CamerasIDs = new List<string>();
foreach (FilterInfo info in videoDevices)
{
CamerasIDs.Add(info.MonikerString.ToLower());
}
//string IDcamRua = Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_Caminho.ToLower().Replace("\\", "#");
string IDcamRua = cmbC.Text.ToLower().Replace("\\", "#");
if (!string.IsNullOrEmpty(IDcamRua) && CamerasIDs.Any(x => x.Contains(IDcamRua)))
{
videoSourceCentro = new VideoCaptureDevice(CamerasIDs.First(x => x.Contains(IDcamRua)));
videoSourceCentro.NewFrame += new NewFrameEventHandler(videoSourceCentro_NewFrame);
videoSourceCentro.Start();
}
//string IDcamSoloE = Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_Solo.Count() > 0 ? Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_Solo[0].ToLower().Replace("\\", "#") : "";
string IDcamSoloE = cmbS0.Text.ToLower().Replace("\\", "#");
if (!string.IsNullOrEmpty(IDcamSoloE) && CamerasIDs.Any(x => x.Contains(IDcamSoloE)))
{
videoSourceEsquerda = new VideoCaptureDevice(CamerasIDs.First(x => x.Contains(IDcamSoloE)));
videoSourceEsquerda.NewFrame += new NewFrameEventHandler(videoSourceEsquerda_NewFrame);
videoSourceEsquerda.Start();
}
//string IDcamSoloD = Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_Solo.Count() > 1 ? Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_Solo[1].ToLower().Replace("\\", "#") : "";
string IDcamSoloD = cmbS1.Text.ToLower().Replace("\\", "#");
if (!string.IsNullOrEmpty(IDcamSoloD) && CamerasIDs.Any(x => x.Contains(IDcamSoloD)))
{
videoSourceDireita = new VideoCaptureDevice(CamerasIDs.First(x => x.Contains(IDcamSoloD)));
videoSourceDireita.NewFrame += new NewFrameEventHandler(videoSourceDireita_NewFrame);
videoSourceDireita.Start();
}
}
private void videoSourceCentro_NewFrame(object sender, NewFrameEventArgs eventArgs)
{
Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone();
picCentro.Image = bitmap;
}
private void videoSourceEsquerda_NewFrame(object sender, NewFrameEventArgs eventArgs)
{
Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone();
picEsquerda.Image = bitmap;
}
private void videoSourceDireita_NewFrame(object sender, NewFrameEventArgs eventArgs)
{
Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone();
picDireita.Image = bitmap;
}
private void cmbCentro_SelectedIndexChanged(object sender, EventArgs e)
{
if (Variaveis.OperacaoEmAndamento.CameraCaminho.combo.SelectedIndex > 0 && Variaveis.OperacaoEmAndamento.CamerasSolo.Any(x => x.combo.SelectedIndex == Variaveis.OperacaoEmAndamento.CameraCaminho.combo.SelectedIndex))
{
MessageBox.Show("Essa câmera já está sendo usada por outro processo!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Warning);
Variaveis.OperacaoEmAndamento.CameraCaminho.combo.SelectedIndex = Variaveis.OperacaoEmAndamento.CameraCaminho.camera.selectedCamera;
return;
}
Variaveis.OperacaoEmAndamento.CameraCaminho.camera.selectedCamera = cmbC.SelectedIndex;
IniciarCameras();
}
private void cmbCameraSolo_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox cmb = (ComboBox)sender;
string CamID = cmb.Name.Replace("cmb", "");
CameraSoloModel CameraSolo = Variaveis.OperacaoEmAndamento.CamerasSolo.FirstOrDefault(x => x.ID == CamID);
if (CameraSolo.combo.SelectedIndex > 0 && (cmbC.SelectedIndex == CameraSolo.combo.SelectedIndex || Variaveis.OperacaoEmAndamento.CamerasSolo.Any(x => x.Nome != CameraSolo.Nome && x.combo.SelectedIndex == CameraSolo.combo.SelectedIndex)))
{
MessageBox.Show("Essa câmera já está sendo usada por outro processo!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Warning);
CameraSolo.combo.SelectedIndex = CameraSolo.camera.selectedCamera;
return;
}
CameraSolo.camera.selectedCamera = CameraSolo.combo.SelectedIndex;
IniciarCameras();
}
#endregion
}
}

View File

@ -0,0 +1,488 @@
namespace AgroBase.Forms.IHM
{
partial class frmDialogoMapa
{
/// <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.pnlMapa = new System.Windows.Forms.Panel();
this.lblMapaCarregado = new System.Windows.Forms.Label();
this.txtStatusAtual = new System.Windows.Forms.TextBox();
this.lblStatusAtual = new System.Windows.Forms.Label();
this.txtIniciadoEm = new System.Windows.Forms.TextBox();
this.lblIniciadoEm = new System.Windows.Forms.Label();
this.txtConcluidoEm = new System.Windows.Forms.TextBox();
this.lblConcluidoEm = new System.Windows.Forms.Label();
this.txtDistanciaPercorrida = new System.Windows.Forms.TextBox();
this.lblDistanciaPercorrida = new System.Windows.Forms.Label();
this.txtTempoOperacao = new System.Windows.Forms.TextBox();
this.lblTempoOperacao = new System.Windows.Forms.Label();
this.txtErvasIdentificadas = new System.Windows.Forms.TextBox();
this.lblErvasIdentificadas = new System.Windows.Forms.Label();
this.txtHerbicidaAplicado = new System.Windows.Forms.TextBox();
this.lblHerbicidaAplicado = new System.Windows.Forms.Label();
this.txtBateriaConsumida = new System.Windows.Forms.TextBox();
this.lblBateriaConsumida = new System.Windows.Forms.Label();
this.pgbReservatorio = new System.Windows.Forms.ProgressBar();
this.lblReservatorio = new System.Windows.Forms.Label();
this.lblBateria = new System.Windows.Forms.Label();
this.pgbBateria = new System.Windows.Forms.ProgressBar();
this.lblOperacao = new System.Windows.Forms.Label();
this.pgbOperacao = new System.Windows.Forms.ProgressBar();
this.lblRuaAtual = new System.Windows.Forms.Label();
this.pgbRuaAtual = new System.Windows.Forms.ProgressBar();
this.lblUltimaLeituraSolo = new System.Windows.Forms.Label();
this.lblUltimaLeituraRua = new System.Windows.Forms.Label();
this.lblModoOperacao = new System.Windows.Forms.Label();
this.txtModoOperacao = new System.Windows.Forms.TextBox();
this.pnlCameraSoloE = new System.Windows.Forms.Panel();
this.pnlCameraSoloD = new System.Windows.Forms.Panel();
this.pnlCameraCaminho = new System.Windows.Forms.Panel();
this.picFechar = new System.Windows.Forms.PictureBox();
this.pnlInclinacao = new System.Windows.Forms.Panel();
this.pnlOrientacao = new System.Windows.Forms.Panel();
this.pnlMapa.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picFechar)).BeginInit();
this.SuspendLayout();
//
// pnlMapa
//
this.pnlMapa.Controls.Add(this.pnlCameraCaminho);
this.pnlMapa.Controls.Add(this.pnlCameraSoloD);
this.pnlMapa.Controls.Add(this.pnlCameraSoloE);
this.pnlMapa.Controls.Add(this.pnlInclinacao);
this.pnlMapa.Controls.Add(this.pnlOrientacao);
this.pnlMapa.Location = new System.Drawing.Point(0, 0);
this.pnlMapa.Name = "pnlMapa";
this.pnlMapa.Size = new System.Drawing.Size(480, 463);
this.pnlMapa.TabIndex = 0;
//
// lblMapaCarregado
//
this.lblMapaCarregado.AutoSize = true;
this.lblMapaCarregado.Location = new System.Drawing.Point(486, 9);
this.lblMapaCarregado.Name = "lblMapaCarregado";
this.lblMapaCarregado.Size = new System.Drawing.Size(112, 13);
this.lblMapaCarregado.TabIndex = 2;
this.lblMapaCarregado.Text = "Mapa Carregado: N/A";
//
// txtStatusAtual
//
this.txtStatusAtual.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtStatusAtual.Location = new System.Drawing.Point(652, 90);
this.txtStatusAtual.Name = "txtStatusAtual";
this.txtStatusAtual.ReadOnly = true;
this.txtStatusAtual.Size = new System.Drawing.Size(136, 26);
this.txtStatusAtual.TabIndex = 6;
this.txtStatusAtual.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblStatusAtual
//
this.lblStatusAtual.AutoSize = true;
this.lblStatusAtual.Location = new System.Drawing.Point(486, 98);
this.lblStatusAtual.Name = "lblStatusAtual";
this.lblStatusAtual.Size = new System.Drawing.Size(64, 13);
this.lblStatusAtual.TabIndex = 5;
this.lblStatusAtual.Text = "Status Atual";
//
// txtIniciadoEm
//
this.txtIniciadoEm.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtIniciadoEm.Location = new System.Drawing.Point(652, 122);
this.txtIniciadoEm.Name = "txtIniciadoEm";
this.txtIniciadoEm.ReadOnly = true;
this.txtIniciadoEm.Size = new System.Drawing.Size(136, 26);
this.txtIniciadoEm.TabIndex = 8;
this.txtIniciadoEm.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblIniciadoEm
//
this.lblIniciadoEm.AutoSize = true;
this.lblIniciadoEm.Location = new System.Drawing.Point(486, 130);
this.lblIniciadoEm.Name = "lblIniciadoEm";
this.lblIniciadoEm.Size = new System.Drawing.Size(62, 13);
this.lblIniciadoEm.TabIndex = 7;
this.lblIniciadoEm.Text = "Iniciado Em";
//
// txtConcluidoEm
//
this.txtConcluidoEm.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtConcluidoEm.Location = new System.Drawing.Point(652, 154);
this.txtConcluidoEm.Name = "txtConcluidoEm";
this.txtConcluidoEm.ReadOnly = true;
this.txtConcluidoEm.Size = new System.Drawing.Size(136, 26);
this.txtConcluidoEm.TabIndex = 10;
this.txtConcluidoEm.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblConcluidoEm
//
this.lblConcluidoEm.AutoSize = true;
this.lblConcluidoEm.Location = new System.Drawing.Point(486, 162);
this.lblConcluidoEm.Name = "lblConcluidoEm";
this.lblConcluidoEm.Size = new System.Drawing.Size(74, 13);
this.lblConcluidoEm.TabIndex = 9;
this.lblConcluidoEm.Text = "Concluído Em";
//
// txtDistanciaPercorrida
//
this.txtDistanciaPercorrida.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtDistanciaPercorrida.Location = new System.Drawing.Point(652, 186);
this.txtDistanciaPercorrida.Name = "txtDistanciaPercorrida";
this.txtDistanciaPercorrida.ReadOnly = true;
this.txtDistanciaPercorrida.Size = new System.Drawing.Size(136, 26);
this.txtDistanciaPercorrida.TabIndex = 12;
this.txtDistanciaPercorrida.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblDistanciaPercorrida
//
this.lblDistanciaPercorrida.AutoSize = true;
this.lblDistanciaPercorrida.Location = new System.Drawing.Point(486, 194);
this.lblDistanciaPercorrida.Name = "lblDistanciaPercorrida";
this.lblDistanciaPercorrida.Size = new System.Drawing.Size(102, 13);
this.lblDistanciaPercorrida.TabIndex = 11;
this.lblDistanciaPercorrida.Text = "Distância Percorrida";
//
// txtTempoOperacao
//
this.txtTempoOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtTempoOperacao.Location = new System.Drawing.Point(652, 218);
this.txtTempoOperacao.Name = "txtTempoOperacao";
this.txtTempoOperacao.ReadOnly = true;
this.txtTempoOperacao.Size = new System.Drawing.Size(136, 26);
this.txtTempoOperacao.TabIndex = 14;
this.txtTempoOperacao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblTempoOperacao
//
this.lblTempoOperacao.AutoSize = true;
this.lblTempoOperacao.Location = new System.Drawing.Point(486, 226);
this.lblTempoOperacao.Name = "lblTempoOperacao";
this.lblTempoOperacao.Size = new System.Drawing.Size(105, 13);
this.lblTempoOperacao.TabIndex = 13;
this.lblTempoOperacao.Text = "Tempo de Operação";
//
// txtErvasIdentificadas
//
this.txtErvasIdentificadas.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtErvasIdentificadas.Location = new System.Drawing.Point(652, 250);
this.txtErvasIdentificadas.Name = "txtErvasIdentificadas";
this.txtErvasIdentificadas.ReadOnly = true;
this.txtErvasIdentificadas.Size = new System.Drawing.Size(136, 26);
this.txtErvasIdentificadas.TabIndex = 16;
this.txtErvasIdentificadas.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblErvasIdentificadas
//
this.lblErvasIdentificadas.AutoSize = true;
this.lblErvasIdentificadas.Location = new System.Drawing.Point(486, 258);
this.lblErvasIdentificadas.Name = "lblErvasIdentificadas";
this.lblErvasIdentificadas.Size = new System.Drawing.Size(97, 13);
this.lblErvasIdentificadas.TabIndex = 15;
this.lblErvasIdentificadas.Text = "Ervas Identificadas";
//
// txtHerbicidaAplicado
//
this.txtHerbicidaAplicado.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtHerbicidaAplicado.Location = new System.Drawing.Point(652, 282);
this.txtHerbicidaAplicado.Name = "txtHerbicidaAplicado";
this.txtHerbicidaAplicado.ReadOnly = true;
this.txtHerbicidaAplicado.Size = new System.Drawing.Size(136, 26);
this.txtHerbicidaAplicado.TabIndex = 18;
this.txtHerbicidaAplicado.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblHerbicidaAplicado
//
this.lblHerbicidaAplicado.AutoSize = true;
this.lblHerbicidaAplicado.Location = new System.Drawing.Point(486, 290);
this.lblHerbicidaAplicado.Name = "lblHerbicidaAplicado";
this.lblHerbicidaAplicado.Size = new System.Drawing.Size(96, 13);
this.lblHerbicidaAplicado.TabIndex = 17;
this.lblHerbicidaAplicado.Text = "Herbicida Aplicado";
//
// txtBateriaConsumida
//
this.txtBateriaConsumida.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtBateriaConsumida.Location = new System.Drawing.Point(652, 314);
this.txtBateriaConsumida.Name = "txtBateriaConsumida";
this.txtBateriaConsumida.ReadOnly = true;
this.txtBateriaConsumida.Size = new System.Drawing.Size(136, 26);
this.txtBateriaConsumida.TabIndex = 20;
this.txtBateriaConsumida.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblBateriaConsumida
//
this.lblBateriaConsumida.AutoSize = true;
this.lblBateriaConsumida.Location = new System.Drawing.Point(486, 322);
this.lblBateriaConsumida.Name = "lblBateriaConsumida";
this.lblBateriaConsumida.Size = new System.Drawing.Size(95, 13);
this.lblBateriaConsumida.TabIndex = 19;
this.lblBateriaConsumida.Text = "Bateria Consumida";
//
// pgbReservatorio
//
this.pgbReservatorio.Location = new System.Drawing.Point(652, 346);
this.pgbReservatorio.Name = "pgbReservatorio";
this.pgbReservatorio.Size = new System.Drawing.Size(136, 26);
this.pgbReservatorio.TabIndex = 21;
//
// lblReservatorio
//
this.lblReservatorio.AutoSize = true;
this.lblReservatorio.Location = new System.Drawing.Point(486, 354);
this.lblReservatorio.Name = "lblReservatorio";
this.lblReservatorio.Size = new System.Drawing.Size(84, 13);
this.lblReservatorio.TabIndex = 23;
this.lblReservatorio.Text = "Reservatório (%)";
//
// lblBateria
//
this.lblBateria.AutoSize = true;
this.lblBateria.Location = new System.Drawing.Point(486, 386);
this.lblBateria.Name = "lblBateria";
this.lblBateria.Size = new System.Drawing.Size(57, 13);
this.lblBateria.TabIndex = 25;
this.lblBateria.Text = "Bateria (%)";
//
// pgbBateria
//
this.pgbBateria.Location = new System.Drawing.Point(652, 378);
this.pgbBateria.Name = "pgbBateria";
this.pgbBateria.Size = new System.Drawing.Size(136, 26);
this.pgbBateria.TabIndex = 24;
//
// lblOperacao
//
this.lblOperacao.AutoSize = true;
this.lblOperacao.Location = new System.Drawing.Point(486, 418);
this.lblOperacao.Name = "lblOperacao";
this.lblOperacao.Size = new System.Drawing.Size(71, 13);
this.lblOperacao.TabIndex = 27;
this.lblOperacao.Text = "Operação (%)";
//
// pgbOperacao
//
this.pgbOperacao.Location = new System.Drawing.Point(652, 410);
this.pgbOperacao.Name = "pgbOperacao";
this.pgbOperacao.Size = new System.Drawing.Size(136, 26);
this.pgbOperacao.TabIndex = 26;
//
// lblRuaAtual
//
this.lblRuaAtual.AutoSize = true;
this.lblRuaAtual.Location = new System.Drawing.Point(486, 450);
this.lblRuaAtual.Name = "lblRuaAtual";
this.lblRuaAtual.Size = new System.Drawing.Size(71, 13);
this.lblRuaAtual.TabIndex = 29;
this.lblRuaAtual.Text = "Rua Atual (%)";
//
// pgbRuaAtual
//
this.pgbRuaAtual.Location = new System.Drawing.Point(652, 442);
this.pgbRuaAtual.Name = "pgbRuaAtual";
this.pgbRuaAtual.Size = new System.Drawing.Size(136, 26);
this.pgbRuaAtual.TabIndex = 28;
//
// lblUltimaLeituraSolo
//
this.lblUltimaLeituraSolo.AutoSize = true;
this.lblUltimaLeituraSolo.Location = new System.Drawing.Point(12, 466);
this.lblUltimaLeituraSolo.Name = "lblUltimaLeituraSolo";
this.lblUltimaLeituraSolo.Size = new System.Drawing.Size(164, 13);
this.lblUltimaLeituraSolo.TabIndex = 30;
this.lblUltimaLeituraSolo.Text = "Ultima Leitura Solo: 00:00:00.000";
//
// lblUltimaLeituraRua
//
this.lblUltimaLeituraRua.AutoSize = true;
this.lblUltimaLeituraRua.Location = new System.Drawing.Point(207, 466);
this.lblUltimaLeituraRua.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblUltimaLeituraRua.Name = "lblUltimaLeituraRua";
this.lblUltimaLeituraRua.Size = new System.Drawing.Size(163, 13);
this.lblUltimaLeituraRua.TabIndex = 31;
this.lblUltimaLeituraRua.Text = "Ultima Leitura Rua: 00:00:00.000";
//
// lblModoOperacao
//
this.lblModoOperacao.AutoSize = true;
this.lblModoOperacao.Location = new System.Drawing.Point(486, 66);
this.lblModoOperacao.Name = "lblModoOperacao";
this.lblModoOperacao.Size = new System.Drawing.Size(99, 13);
this.lblModoOperacao.TabIndex = 3;
this.lblModoOperacao.Text = "Modo de Operação";
//
// txtModoOperacao
//
this.txtModoOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtModoOperacao.Location = new System.Drawing.Point(652, 58);
this.txtModoOperacao.Name = "txtModoOperacao";
this.txtModoOperacao.ReadOnly = true;
this.txtModoOperacao.Size = new System.Drawing.Size(136, 26);
this.txtModoOperacao.TabIndex = 4;
this.txtModoOperacao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// pnlCameraSoloE
//
this.pnlCameraSoloE.Location = new System.Drawing.Point(0, 363);
this.pnlCameraSoloE.Name = "pnlCameraSoloE";
this.pnlCameraSoloE.Size = new System.Drawing.Size(130, 100);
this.pnlCameraSoloE.TabIndex = 17;
//
// pnlCameraSoloD
//
this.pnlCameraSoloD.Location = new System.Drawing.Point(350, 363);
this.pnlCameraSoloD.Name = "pnlCameraSoloD";
this.pnlCameraSoloD.Size = new System.Drawing.Size(130, 100);
this.pnlCameraSoloD.TabIndex = 18;
//
// pnlCameraCaminho
//
this.pnlCameraCaminho.Location = new System.Drawing.Point(174, 363);
this.pnlCameraCaminho.Name = "pnlCameraCaminho";
this.pnlCameraCaminho.Size = new System.Drawing.Size(130, 100);
this.pnlCameraCaminho.TabIndex = 18;
//
// picFechar
//
this.picFechar.Image = global::AgroBase.Properties.Resources.fechar;
this.picFechar.Location = new System.Drawing.Point(753, 9);
this.picFechar.Name = "picFechar";
this.picFechar.Size = new System.Drawing.Size(35, 35);
this.picFechar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picFechar.TabIndex = 1;
this.picFechar.TabStop = false;
//
// pnlInclinacao
//
this.pnlInclinacao.BackColor = System.Drawing.Color.White;
this.pnlInclinacao.BackgroundImage = global::AgroBase.Properties.Resources.transferidor;
this.pnlInclinacao.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pnlInclinacao.Location = new System.Drawing.Point(0, 0);
this.pnlInclinacao.Margin = new System.Windows.Forms.Padding(2);
this.pnlInclinacao.Name = "pnlInclinacao";
this.pnlInclinacao.Size = new System.Drawing.Size(78, 84);
this.pnlInclinacao.TabIndex = 16;
this.pnlInclinacao.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlInclinacao_Paint);
//
// pnlOrientacao
//
this.pnlOrientacao.BackColor = System.Drawing.Color.White;
this.pnlOrientacao.BackgroundImage = global::AgroBase.Properties.Resources.rosa_dos_ventos;
this.pnlOrientacao.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pnlOrientacao.Location = new System.Drawing.Point(402, 0);
this.pnlOrientacao.Margin = new System.Windows.Forms.Padding(2);
this.pnlOrientacao.Name = "pnlOrientacao";
this.pnlOrientacao.Size = new System.Drawing.Size(78, 84);
this.pnlOrientacao.TabIndex = 12;
this.pnlOrientacao.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlOrientacao_Paint);
//
// frmDialogoMapa
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Ivory;
this.ClientSize = new System.Drawing.Size(800, 480);
this.Controls.Add(this.lblUltimaLeituraRua);
this.Controls.Add(this.lblUltimaLeituraSolo);
this.Controls.Add(this.lblRuaAtual);
this.Controls.Add(this.pgbRuaAtual);
this.Controls.Add(this.lblOperacao);
this.Controls.Add(this.pgbOperacao);
this.Controls.Add(this.lblBateria);
this.Controls.Add(this.pgbBateria);
this.Controls.Add(this.lblReservatorio);
this.Controls.Add(this.pgbReservatorio);
this.Controls.Add(this.txtBateriaConsumida);
this.Controls.Add(this.lblBateriaConsumida);
this.Controls.Add(this.txtHerbicidaAplicado);
this.Controls.Add(this.lblHerbicidaAplicado);
this.Controls.Add(this.txtErvasIdentificadas);
this.Controls.Add(this.lblErvasIdentificadas);
this.Controls.Add(this.txtTempoOperacao);
this.Controls.Add(this.lblTempoOperacao);
this.Controls.Add(this.txtDistanciaPercorrida);
this.Controls.Add(this.lblDistanciaPercorrida);
this.Controls.Add(this.txtConcluidoEm);
this.Controls.Add(this.lblConcluidoEm);
this.Controls.Add(this.txtIniciadoEm);
this.Controls.Add(this.lblIniciadoEm);
this.Controls.Add(this.txtStatusAtual);
this.Controls.Add(this.lblStatusAtual);
this.Controls.Add(this.txtModoOperacao);
this.Controls.Add(this.lblModoOperacao);
this.Controls.Add(this.lblMapaCarregado);
this.Controls.Add(this.picFechar);
this.Controls.Add(this.pnlMapa);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "frmDialogoMapa";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "frmDialogoMapa";
this.pnlMapa.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.picFechar)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
public System.Windows.Forms.Panel pnlMapa;
private System.Windows.Forms.PictureBox picFechar;
public System.Windows.Forms.Label lblMapaCarregado;
private System.Windows.Forms.TextBox txtStatusAtual;
private System.Windows.Forms.Label lblStatusAtual;
private System.Windows.Forms.TextBox txtIniciadoEm;
private System.Windows.Forms.Label lblIniciadoEm;
private System.Windows.Forms.TextBox txtConcluidoEm;
private System.Windows.Forms.Label lblConcluidoEm;
private System.Windows.Forms.TextBox txtDistanciaPercorrida;
private System.Windows.Forms.Label lblDistanciaPercorrida;
private System.Windows.Forms.TextBox txtTempoOperacao;
private System.Windows.Forms.Label lblTempoOperacao;
private System.Windows.Forms.TextBox txtErvasIdentificadas;
private System.Windows.Forms.Label lblErvasIdentificadas;
private System.Windows.Forms.TextBox txtHerbicidaAplicado;
private System.Windows.Forms.Label lblHerbicidaAplicado;
private System.Windows.Forms.TextBox txtBateriaConsumida;
private System.Windows.Forms.Label lblBateriaConsumida;
private System.Windows.Forms.ProgressBar pgbReservatorio;
private System.Windows.Forms.Label lblReservatorio;
private System.Windows.Forms.Label lblBateria;
private System.Windows.Forms.ProgressBar pgbBateria;
private System.Windows.Forms.Label lblOperacao;
private System.Windows.Forms.ProgressBar pgbOperacao;
private System.Windows.Forms.Label lblRuaAtual;
private System.Windows.Forms.ProgressBar pgbRuaAtual;
private System.Windows.Forms.Panel pnlOrientacao;
private System.Windows.Forms.Panel pnlInclinacao;
public System.Windows.Forms.Label lblUltimaLeituraSolo;
private System.Windows.Forms.Label lblUltimaLeituraRua;
private System.Windows.Forms.Panel pnlCameraCaminho;
private System.Windows.Forms.Panel pnlCameraSoloD;
private System.Windows.Forms.Panel pnlCameraSoloE;
private System.Windows.Forms.Label lblModoOperacao;
private System.Windows.Forms.TextBox txtModoOperacao;
}
}

View File

@ -0,0 +1,114 @@
using AgroBase.Models;
using AgroBase.Models.Modules;
using AgroBase.Services;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
namespace AgroBase.Forms.IHM
{
public partial class frmDialogoMapa : Form
{
Timer tmrLeitura = new Timer() { Interval = 500 };
public frmDialogoMapa()
{
InitializeComponent();
tmrLeitura.Tick += tmrLeitura_Tick;
tmrLeitura.Start();
FuncoesGlobais.DefinirEventosPicBtn(picFechar, async () =>
{
if (Variaveis.OperacaoEmAndamento.Iniciado)
{
if (MessageBox.Show("Tem certeza que deseja interromper a operação em andamento?", "Interromper Operação", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
Variaveis.OperacaoEmAndamento.FinalizarOperacao();
}
}
else
{
this.Hide();
}
});
}
public async Task AtualizarRuasSelecionadas(List<string> ruasSelecionadas)
{
Variaveis.OperacaoEmAndamento.AtualizaListaCameras(pnlCameraCaminho, new List<Panel>(){ pnlCameraSoloE, pnlCameraSoloD }, true);
await Task.Delay(1000);
GPSService.AtualizarRuasSelecionadas(ruasSelecionadas);
}
public void IniciarOperacao()
{
Variaveis.OperacaoEmAndamento.IniciarOperacao();
}
private void tmrLeitura_Tick(object sender, EventArgs e)
{
pnlOrientacao.Invalidate();
pnlInclinacao.Invalidate();
var ultimaLeitura = Variaveis.OperacaoEmAndamento.CamerasSolo.OrderByDescending(x => x.Leitura.timestamp).FirstOrDefault();
if (ultimaLeitura != null)
{
lblUltimaLeituraSolo.Text = "Ultima Leitura Solo: " + FuncoesGlobais.TimestampToDate(ultimaLeitura.Leitura.timestamp);
}
if (Variaveis.OperacaoEmAndamento.CameraCaminho != null)
{
lblUltimaLeituraRua.Text = "Ultima Leitura Rua: " + FuncoesGlobais.TimestampToDate(Variaveis.OperacaoEmAndamento.CameraCaminho.Leitura.timestamp);
}
txtModoOperacao.Text = Variaveis.OperacaoEmAndamento.Modo.ToString();
txtStatusAtual.Text = Variaveis.OperacaoEmAndamento.StatusAtual.ToString();
txtIniciadoEm.Text = new DateTime(Variaveis.OperacaoEmAndamento.TimestampInicio).ToString("dd/MM HH:mm:ss");
txtConcluidoEm.Text = new DateTime(Variaveis.OperacaoEmAndamento.TimestampFim).ToString("dd/MM HH:mm:ss");
txtDistanciaPercorrida.Text = Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaPercorrida.Sum().ToString("0.00") + " m";
txtTempoOperacao.Text = Variaveis.OperacaoEmAndamento.Tempo.Hours.ToString("00") + ":" + Variaveis.OperacaoEmAndamento.Tempo.Minutes.ToString("00") + ":" + Variaveis.OperacaoEmAndamento.Tempo.Seconds.ToString("00");
txtErvasIdentificadas.Text = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ErvasIdentificadas.ToString("000");
txtHerbicidaAplicado.Text = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.HerbicidaConsumido.ToString("0.000") + " L";
txtBateriaConsumida.Text = Variaveis.OperacaoEmAndamento.Sensoriamento.BateriaConsumida.ToString("0.00") + "%";
FuncoesGlobais.PreencheValorProgressBar(pgbReservatorio, Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio);
lblReservatorio.Text = "Reservatório: " + (Variaveis.OperacaoEmAndamento.DispAtu.Dados.VolumeReservatorio.ToString("0.000") + " L " + (Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio < 0 ? 0 : Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio).ToString("00.00") + "%");
FuncoesGlobais.PreencheValorProgressBar(pgbBateria, Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria);
lblBateria.Text = "Bateria: " + (PZEMService.Iniciado && PZEMService.UltimaLeitura != null ? PZEMService.UltimaLeitura.Tensao.ToString("0.00") + "v " + PZEMService.UltimaLeitura.Corrente.ToString("0.00") + "A " : "") + (Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria < 0 ? 0 : Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria).ToString("00.00") + "%";
FuncoesGlobais.PreencheValorProgressBar(pgbOperacao, Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoTrajeto);
lblOperacao.Text = "Operação: " + (Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoTrajeto < 0 ? 0 : Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoTrajeto).ToString("00.00") + "%";
FuncoesGlobais.PreencheValorProgressBar(pgbRuaAtual, Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoRua);
lblRuaAtual.Text = "Rua Atual: " + (Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoRua < 0 ? 0 : Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoRua).ToString("00.00") + "%";
}
private void pnlOrientacao_Paint(object sender, PaintEventArgs e)
{
try
{
double angulo = Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarro;
FuncoesGlobais.DesenharInclinacao((Panel)sender, e, (float)angulo, -90);
}
catch { }
}
private void pnlInclinacao_Paint(object sender, PaintEventArgs e)
{
try
{
FuncoesGlobais.DesenharInclinacao((Panel)sender, e, (float)(Variaveis.OperacaoEmAndamento.Controle.Angulo), 90);
}
catch { }
}
}
}

View File

@ -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>

View File

@ -28,186 +28,393 @@
/// </summary>
private void InitializeComponent()
{
this.lblD_Mov = new System.Windows.Forms.Label();
this.lblD_Dir = new System.Windows.Forms.Label();
this.lblD_Mvd_DF = new System.Windows.Forms.Label();
this.lblD_Atu = new System.Windows.Forms.Label();
this.lblD_Sen = new System.Windows.Forms.Label();
this.lblD_Gps = new System.Windows.Forms.Label();
this.btnConfigurar = new System.Windows.Forms.Button();
this.btnIniciar = new System.Windows.Forms.Button();
this.cmbOperacao = new System.Windows.Forms.ComboBox();
this.lblOperacao = new System.Windows.Forms.Label();
this.lblOperacaoStatus = new System.Windows.Forms.Label();
this.lblMqtt = new System.Windows.Forms.Label();
this.lblD_PZM = new System.Windows.Forms.Label();
this.picRobo = new System.Windows.Forms.PictureBox();
this.lblD_Pzm = new System.Windows.Forms.Label();
this.lblD_Lra = new System.Windows.Forms.Label();
this.lblD_Wit = new System.Windows.Forms.Label();
this.lblD_Mvd_DT = new System.Windows.Forms.Label();
this.lblD_Mks_DF = new System.Windows.Forms.Label();
this.lblD_Mks_EF = new System.Windows.Forms.Label();
this.lblD_Mvd_EF = new System.Windows.Forms.Label();
this.lblD_Mks_DT = new System.Windows.Forms.Label();
this.lblD_Mks_ET = new System.Windows.Forms.Label();
this.lblD_Mvd_ET = new System.Windows.Forms.Label();
this.lblD_Cam_S0 = new System.Windows.Forms.Label();
this.lblD_Cam_S1 = new System.Windows.Forms.Label();
this.lblD_Cam_C = new System.Windows.Forms.Label();
this.picDiagnosticos = new System.Windows.Forms.PictureBox();
this.picOperacao = new System.Windows.Forms.PictureBox();
this.picAjustes = new System.Windows.Forms.PictureBox();
this.picDesligar = new System.Windows.Forms.PictureBox();
this.picRobo = new System.Windows.Forms.PictureBox();
this.lblDiagnosticos = new System.Windows.Forms.Label();
this.lblOperacao = new System.Windows.Forms.Label();
this.lblAjustes = new System.Windows.Forms.Label();
this.lblDesligar = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.picDiagnosticos)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picOperacao)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picAjustes)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picDesligar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picRobo)).BeginInit();
this.SuspendLayout();
//
// lblD_Mov
// lblD_Mvd_DF
//
this.lblD_Mov.AutoSize = true;
this.lblD_Mov.BackColor = System.Drawing.Color.Transparent;
this.lblD_Mov.Location = new System.Drawing.Point(414, 33);
this.lblD_Mov.Name = "lblD_Mov";
this.lblD_Mov.Size = new System.Drawing.Size(169, 29);
this.lblD_Mov.TabIndex = 2;
this.lblD_Mov.Text = "Movimentação";
//
// lblD_Dir
//
this.lblD_Dir.AutoSize = true;
this.lblD_Dir.Location = new System.Drawing.Point(72, 121);
this.lblD_Dir.Name = "lblD_Dir";
this.lblD_Dir.Size = new System.Drawing.Size(122, 29);
this.lblD_Dir.TabIndex = 3;
this.lblD_Dir.Text = "Direcional";
this.lblD_Mvd_DF.AutoSize = true;
this.lblD_Mvd_DF.BackColor = System.Drawing.Color.Transparent;
this.lblD_Mvd_DF.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Mvd_DF.Location = new System.Drawing.Point(264, 66);
this.lblD_Mvd_DF.Name = "lblD_Mvd_DF";
this.lblD_Mvd_DF.Size = new System.Drawing.Size(52, 24);
this.lblD_Mvd_DF.TabIndex = 2;
this.lblD_Mvd_DF.Text = "MVD";
this.lblD_Mvd_DF.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblD_Atu
//
this.lblD_Atu.AutoSize = true;
this.lblD_Atu.Location = new System.Drawing.Point(442, 633);
this.lblD_Atu.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Atu.Location = new System.Drawing.Point(250, 397);
this.lblD_Atu.Name = "lblD_Atu";
this.lblD_Atu.Size = new System.Drawing.Size(96, 29);
this.lblD_Atu.Size = new System.Drawing.Size(48, 24);
this.lblD_Atu.TabIndex = 4;
this.lblD_Atu.Text = "Atuador";
this.lblD_Atu.Text = "ATU";
this.lblD_Atu.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblD_Sen
//
this.lblD_Sen.AutoSize = true;
this.lblD_Sen.BackColor = System.Drawing.Color.Lavender;
this.lblD_Sen.Location = new System.Drawing.Point(430, 324);
this.lblD_Sen.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Sen.Location = new System.Drawing.Point(53, 206);
this.lblD_Sen.Name = "lblD_Sen";
this.lblD_Sen.Size = new System.Drawing.Size(176, 29);
this.lblD_Sen.Size = new System.Drawing.Size(49, 24);
this.lblD_Sen.TabIndex = 5;
this.lblD_Sen.Text = "Sensoriamento";
this.lblD_Sen.Text = "SEN";
this.lblD_Sen.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblD_Gps
//
this.lblD_Gps.AutoSize = true;
this.lblD_Gps.Location = new System.Drawing.Point(430, 208);
this.lblD_Gps.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Gps.Location = new System.Drawing.Point(153, 23);
this.lblD_Gps.Name = "lblD_Gps";
this.lblD_Gps.Size = new System.Drawing.Size(63, 29);
this.lblD_Gps.Size = new System.Drawing.Size(48, 24);
this.lblD_Gps.TabIndex = 6;
this.lblD_Gps.Text = "GPS";
//
// btnConfigurar
//
this.btnConfigurar.Location = new System.Drawing.Point(775, 173);
this.btnConfigurar.Name = "btnConfigurar";
this.btnConfigurar.Size = new System.Drawing.Size(202, 64);
this.btnConfigurar.TabIndex = 8;
this.btnConfigurar.Text = "Configurar";
this.btnConfigurar.UseVisualStyleBackColor = true;
this.btnConfigurar.Click += new System.EventHandler(this.btnConfigurar_Click);
//
// btnIniciar
//
this.btnIniciar.Location = new System.Drawing.Point(775, 258);
this.btnIniciar.Name = "btnIniciar";
this.btnIniciar.Size = new System.Drawing.Size(202, 64);
this.btnIniciar.TabIndex = 9;
this.btnIniciar.Text = "Iniciar";
this.btnIniciar.UseVisualStyleBackColor = true;
this.btnIniciar.Click += new System.EventHandler(this.btnIniciar_Click);
//
// cmbOperacao
//
this.cmbOperacao.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbOperacao.FormattingEnabled = true;
this.cmbOperacao.Location = new System.Drawing.Point(775, 81);
this.cmbOperacao.Name = "cmbOperacao";
this.cmbOperacao.Size = new System.Drawing.Size(202, 37);
this.cmbOperacao.TabIndex = 10;
this.cmbOperacao.SelectedIndexChanged += new System.EventHandler(this.cmbOperacao_SelectedIndexChanged);
//
// lblOperacao
//
this.lblOperacao.AutoSize = true;
this.lblOperacao.Location = new System.Drawing.Point(771, 45);
this.lblOperacao.Name = "lblOperacao";
this.lblOperacao.Size = new System.Drawing.Size(222, 29);
this.lblOperacao.TabIndex = 11;
this.lblOperacao.Text = "Modo de Operação";
//
// lblOperacaoStatus
//
this.lblOperacaoStatus.AutoSize = true;
this.lblOperacaoStatus.Location = new System.Drawing.Point(651, 602);
this.lblOperacaoStatus.Name = "lblOperacaoStatus";
this.lblOperacaoStatus.Size = new System.Drawing.Size(365, 29);
this.lblOperacaoStatus.TabIndex = 12;
this.lblOperacaoStatus.Text = "Operação: Manual - Não iniciado";
this.lblD_Gps.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblMqtt
//
this.lblMqtt.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.lblMqtt.AutoSize = true;
this.lblMqtt.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblMqtt.Location = new System.Drawing.Point(894, 675);
this.lblMqtt.Location = new System.Drawing.Point(12, 458);
this.lblMqtt.Name = "lblMqtt";
this.lblMqtt.Size = new System.Drawing.Size(147, 17);
this.lblMqtt.Size = new System.Drawing.Size(114, 13);
this.lblMqtt.TabIndex = 13;
this.lblMqtt.Text = "MQTT: Desconectado";
//
// lblD_PZM
// lblD_Pzm
//
this.lblD_PZM.AutoSize = true;
this.lblD_PZM.BackColor = System.Drawing.Color.Lavender;
this.lblD_PZM.Location = new System.Drawing.Point(137, 309);
this.lblD_PZM.Name = "lblD_PZM";
this.lblD_PZM.Size = new System.Drawing.Size(79, 29);
this.lblD_PZM.TabIndex = 14;
this.lblD_PZM.Text = "PZEM";
//
// picRobo
//
this.picRobo.Image = global::AgroBase.Properties.Resources.robo_superior;
this.picRobo.Location = new System.Drawing.Point(66, 12);
this.picRobo.Name = "picRobo";
this.picRobo.Size = new System.Drawing.Size(534, 673);
this.picRobo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picRobo.TabIndex = 1;
this.picRobo.TabStop = false;
this.lblD_Pzm.AutoSize = true;
this.lblD_Pzm.BackColor = System.Drawing.Color.Lavender;
this.lblD_Pzm.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Pzm.Location = new System.Drawing.Point(250, 206);
this.lblD_Pzm.Name = "lblD_Pzm";
this.lblD_Pzm.Size = new System.Drawing.Size(50, 24);
this.lblD_Pzm.TabIndex = 14;
this.lblD_Pzm.Text = "PZM";
this.lblD_Pzm.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblD_Lra
//
this.lblD_Lra.AutoSize = true;
this.lblD_Lra.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.lblD_Lra.Location = new System.Drawing.Point(296, 495);
this.lblD_Lra.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Lra.Location = new System.Drawing.Point(153, 311);
this.lblD_Lra.Name = "lblD_Lra";
this.lblD_Lra.Size = new System.Drawing.Size(70, 29);
this.lblD_Lra.Size = new System.Drawing.Size(46, 24);
this.lblD_Lra.TabIndex = 15;
this.lblD_Lra.Text = "LoRa";
this.lblD_Lra.Text = "LRA";
this.lblD_Lra.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblD_Wit
//
this.lblD_Wit.AutoSize = true;
this.lblD_Wit.BackColor = System.Drawing.Color.Lavender;
this.lblD_Wit.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Wit.Location = new System.Drawing.Point(53, 397);
this.lblD_Wit.Name = "lblD_Wit";
this.lblD_Wit.Size = new System.Drawing.Size(44, 24);
this.lblD_Wit.TabIndex = 16;
this.lblD_Wit.Text = "WIT";
this.lblD_Wit.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblD_Mvd_DT
//
this.lblD_Mvd_DT.AutoSize = true;
this.lblD_Mvd_DT.BackColor = System.Drawing.Color.Lavender;
this.lblD_Mvd_DT.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Mvd_DT.Location = new System.Drawing.Point(264, 255);
this.lblD_Mvd_DT.Name = "lblD_Mvd_DT";
this.lblD_Mvd_DT.Size = new System.Drawing.Size(52, 24);
this.lblD_Mvd_DT.TabIndex = 18;
this.lblD_Mvd_DT.Text = "MVD";
this.lblD_Mvd_DT.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblD_Mks_DF
//
this.lblD_Mks_DF.AutoSize = true;
this.lblD_Mks_DF.BackColor = System.Drawing.Color.Transparent;
this.lblD_Mks_DF.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Mks_DF.Location = new System.Drawing.Point(264, 90);
this.lblD_Mks_DF.Name = "lblD_Mks_DF";
this.lblD_Mks_DF.Size = new System.Drawing.Size(50, 24);
this.lblD_Mks_DF.TabIndex = 19;
this.lblD_Mks_DF.Text = "MKS";
this.lblD_Mks_DF.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblD_Mks_EF
//
this.lblD_Mks_EF.AutoSize = true;
this.lblD_Mks_EF.BackColor = System.Drawing.Color.Transparent;
this.lblD_Mks_EF.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Mks_EF.Location = new System.Drawing.Point(35, 90);
this.lblD_Mks_EF.Name = "lblD_Mks_EF";
this.lblD_Mks_EF.Size = new System.Drawing.Size(50, 24);
this.lblD_Mks_EF.TabIndex = 21;
this.lblD_Mks_EF.Text = "MKS";
this.lblD_Mks_EF.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblD_Mvd_EF
//
this.lblD_Mvd_EF.AutoSize = true;
this.lblD_Mvd_EF.BackColor = System.Drawing.Color.Transparent;
this.lblD_Mvd_EF.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Mvd_EF.Location = new System.Drawing.Point(35, 66);
this.lblD_Mvd_EF.Name = "lblD_Mvd_EF";
this.lblD_Mvd_EF.Size = new System.Drawing.Size(52, 24);
this.lblD_Mvd_EF.TabIndex = 20;
this.lblD_Mvd_EF.Text = "MVD";
this.lblD_Mvd_EF.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblD_Mks_DT
//
this.lblD_Mks_DT.AutoSize = true;
this.lblD_Mks_DT.BackColor = System.Drawing.Color.Lavender;
this.lblD_Mks_DT.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Mks_DT.Location = new System.Drawing.Point(264, 279);
this.lblD_Mks_DT.Name = "lblD_Mks_DT";
this.lblD_Mks_DT.Size = new System.Drawing.Size(50, 24);
this.lblD_Mks_DT.TabIndex = 22;
this.lblD_Mks_DT.Text = "MKS";
this.lblD_Mks_DT.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblD_Mks_ET
//
this.lblD_Mks_ET.AutoSize = true;
this.lblD_Mks_ET.BackColor = System.Drawing.Color.Lavender;
this.lblD_Mks_ET.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Mks_ET.Location = new System.Drawing.Point(35, 279);
this.lblD_Mks_ET.Name = "lblD_Mks_ET";
this.lblD_Mks_ET.Size = new System.Drawing.Size(50, 24);
this.lblD_Mks_ET.TabIndex = 24;
this.lblD_Mks_ET.Text = "MKS";
this.lblD_Mks_ET.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblD_Mvd_ET
//
this.lblD_Mvd_ET.AutoSize = true;
this.lblD_Mvd_ET.BackColor = System.Drawing.Color.Lavender;
this.lblD_Mvd_ET.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Mvd_ET.Location = new System.Drawing.Point(35, 255);
this.lblD_Mvd_ET.Name = "lblD_Mvd_ET";
this.lblD_Mvd_ET.Size = new System.Drawing.Size(52, 24);
this.lblD_Mvd_ET.TabIndex = 23;
this.lblD_Mvd_ET.Text = "MVD";
this.lblD_Mvd_ET.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblD_Cam_S0
//
this.lblD_Cam_S0.AutoSize = true;
this.lblD_Cam_S0.BackColor = System.Drawing.Color.Lavender;
this.lblD_Cam_S0.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Cam_S0.Location = new System.Drawing.Point(72, 346);
this.lblD_Cam_S0.Name = "lblD_Cam_S0";
this.lblD_Cam_S0.Size = new System.Drawing.Size(52, 24);
this.lblD_Cam_S0.TabIndex = 29;
this.lblD_Cam_S0.Text = "CAM";
this.lblD_Cam_S0.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblD_Cam_S1
//
this.lblD_Cam_S1.AutoSize = true;
this.lblD_Cam_S1.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Cam_S1.Location = new System.Drawing.Point(234, 346);
this.lblD_Cam_S1.Name = "lblD_Cam_S1";
this.lblD_Cam_S1.Size = new System.Drawing.Size(52, 24);
this.lblD_Cam_S1.TabIndex = 30;
this.lblD_Cam_S1.Text = "CAM";
this.lblD_Cam_S1.Click += new System.EventHandler(this.lblModulo_Click);
//
// lblD_Cam_C
//
this.lblD_Cam_C.AutoSize = true;
this.lblD_Cam_C.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblD_Cam_C.Location = new System.Drawing.Point(153, 90);
this.lblD_Cam_C.Name = "lblD_Cam_C";
this.lblD_Cam_C.Size = new System.Drawing.Size(52, 24);
this.lblD_Cam_C.TabIndex = 31;
this.lblD_Cam_C.Text = "CAM";
this.lblD_Cam_C.Click += new System.EventHandler(this.lblModulo_Click);
//
// picDiagnosticos
//
this.picDiagnosticos.Cursor = System.Windows.Forms.Cursors.Default;
this.picDiagnosticos.Image = global::AgroBase.Properties.Resources.diagnostico;
this.picDiagnosticos.Location = new System.Drawing.Point(362, 12);
this.picDiagnosticos.Name = "picDiagnosticos";
this.picDiagnosticos.Size = new System.Drawing.Size(130, 130);
this.picDiagnosticos.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picDiagnosticos.TabIndex = 25;
this.picDiagnosticos.TabStop = false;
//
// picOperacao
//
this.picOperacao.Cursor = System.Windows.Forms.Cursors.Default;
this.picOperacao.Image = global::AgroBase.Properties.Resources.cana;
this.picOperacao.Location = new System.Drawing.Point(509, 12);
this.picOperacao.Name = "picOperacao";
this.picOperacao.Size = new System.Drawing.Size(130, 130);
this.picOperacao.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picOperacao.TabIndex = 26;
this.picOperacao.TabStop = false;
//
// picAjustes
//
this.picAjustes.Cursor = System.Windows.Forms.Cursors.Default;
this.picAjustes.Image = global::AgroBase.Properties.Resources.ajustes;
this.picAjustes.Location = new System.Drawing.Point(658, 12);
this.picAjustes.Name = "picAjustes";
this.picAjustes.Size = new System.Drawing.Size(130, 130);
this.picAjustes.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picAjustes.TabIndex = 29;
this.picAjustes.TabStop = false;
//
// picDesligar
//
this.picDesligar.Cursor = System.Windows.Forms.Cursors.Default;
this.picDesligar.Image = global::AgroBase.Properties.Resources.desligar;
this.picDesligar.Location = new System.Drawing.Point(658, 302);
this.picDesligar.Name = "picDesligar";
this.picDesligar.Size = new System.Drawing.Size(130, 130);
this.picDesligar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picDesligar.TabIndex = 27;
this.picDesligar.TabStop = false;
//
// picRobo
//
this.picRobo.Image = global::AgroBase.Properties.Resources.robo_superior;
this.picRobo.Location = new System.Drawing.Point(12, 12);
this.picRobo.Name = "picRobo";
this.picRobo.Size = new System.Drawing.Size(335, 420);
this.picRobo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picRobo.TabIndex = 1;
this.picRobo.TabStop = false;
//
// lblDiagnosticos
//
this.lblDiagnosticos.AutoSize = true;
this.lblDiagnosticos.BackColor = System.Drawing.Color.Transparent;
this.lblDiagnosticos.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblDiagnosticos.Location = new System.Drawing.Point(369, 162);
this.lblDiagnosticos.Name = "lblDiagnosticos";
this.lblDiagnosticos.Size = new System.Drawing.Size(117, 24);
this.lblDiagnosticos.TabIndex = 32;
this.lblDiagnosticos.Text = "Diagnósticos";
//
// lblOperacao
//
this.lblOperacao.AutoSize = true;
this.lblOperacao.BackColor = System.Drawing.Color.Transparent;
this.lblOperacao.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblOperacao.Location = new System.Drawing.Point(527, 162);
this.lblOperacao.Name = "lblOperacao";
this.lblOperacao.Size = new System.Drawing.Size(94, 24);
this.lblOperacao.TabIndex = 33;
this.lblOperacao.Text = "Operação";
//
// lblAjustes
//
this.lblAjustes.AutoSize = true;
this.lblAjustes.BackColor = System.Drawing.Color.Transparent;
this.lblAjustes.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblAjustes.Location = new System.Drawing.Point(689, 162);
this.lblAjustes.Name = "lblAjustes";
this.lblAjustes.Size = new System.Drawing.Size(71, 24);
this.lblAjustes.TabIndex = 35;
this.lblAjustes.Text = "Ajustes";
//
// lblDesligar
//
this.lblDesligar.AutoSize = true;
this.lblDesligar.BackColor = System.Drawing.Color.Transparent;
this.lblDesligar.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblDesligar.Location = new System.Drawing.Point(685, 450);
this.lblDesligar.Name = "lblDesligar";
this.lblDesligar.Size = new System.Drawing.Size(78, 24);
this.lblDesligar.TabIndex = 36;
this.lblDesligar.Text = "Desligar";
//
// frmIHM
//
this.AutoScaleDimensions = new System.Drawing.SizeF(14F, 29F);
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1020, 697);
this.Controls.Add(this.lblD_Lra);
this.Controls.Add(this.lblD_PZM);
this.Controls.Add(this.lblMqtt);
this.Controls.Add(this.lblOperacaoStatus);
this.ClientSize = new System.Drawing.Size(800, 480);
this.Controls.Add(this.lblDesligar);
this.Controls.Add(this.lblAjustes);
this.Controls.Add(this.lblOperacao);
this.Controls.Add(this.cmbOperacao);
this.Controls.Add(this.btnIniciar);
this.Controls.Add(this.btnConfigurar);
this.Controls.Add(this.lblDiagnosticos);
this.Controls.Add(this.picDiagnosticos);
this.Controls.Add(this.picOperacao);
this.Controls.Add(this.lblD_Cam_C);
this.Controls.Add(this.picAjustes);
this.Controls.Add(this.lblD_Cam_S1);
this.Controls.Add(this.lblD_Cam_S0);
this.Controls.Add(this.picDesligar);
this.Controls.Add(this.lblD_Mks_ET);
this.Controls.Add(this.lblD_Mvd_ET);
this.Controls.Add(this.lblD_Mks_DT);
this.Controls.Add(this.lblD_Mks_EF);
this.Controls.Add(this.lblD_Mvd_EF);
this.Controls.Add(this.lblD_Mks_DF);
this.Controls.Add(this.lblD_Mvd_DT);
this.Controls.Add(this.lblD_Wit);
this.Controls.Add(this.lblD_Lra);
this.Controls.Add(this.lblD_Pzm);
this.Controls.Add(this.lblMqtt);
this.Controls.Add(this.lblD_Gps);
this.Controls.Add(this.lblD_Sen);
this.Controls.Add(this.lblD_Atu);
this.Controls.Add(this.lblD_Dir);
this.Controls.Add(this.lblD_Mov);
this.Controls.Add(this.lblD_Mvd_DF);
this.Controls.Add(this.picRobo);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Margin = new System.Windows.Forms.Padding(6);
this.Name = "frmIHM";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Agrobotics Persistence";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.frmIHM_Load);
((System.ComponentModel.ISupportInitialize)(this.picDiagnosticos)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picOperacao)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picAjustes)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picDesligar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picRobo)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -217,18 +424,31 @@
#endregion
private System.Windows.Forms.PictureBox picRobo;
private System.Windows.Forms.Label lblD_Mov;
private System.Windows.Forms.Label lblD_Dir;
private System.Windows.Forms.Label lblD_Mvd_DF;
private System.Windows.Forms.Label lblD_Atu;
private System.Windows.Forms.Label lblD_Sen;
private System.Windows.Forms.Label lblD_Gps;
private System.Windows.Forms.Button btnConfigurar;
private System.Windows.Forms.Button btnIniciar;
private System.Windows.Forms.ComboBox cmbOperacao;
private System.Windows.Forms.Label lblOperacao;
private System.Windows.Forms.Label lblOperacaoStatus;
private System.Windows.Forms.Label lblMqtt;
private System.Windows.Forms.Label lblD_PZM;
private System.Windows.Forms.Label lblD_Pzm;
private System.Windows.Forms.Label lblD_Lra;
private System.Windows.Forms.Label lblD_Wit;
private System.Windows.Forms.Label lblD_Mvd_DT;
private System.Windows.Forms.Label lblD_Mks_DF;
private System.Windows.Forms.Label lblD_Mks_EF;
private System.Windows.Forms.Label lblD_Mvd_EF;
private System.Windows.Forms.Label lblD_Mks_DT;
private System.Windows.Forms.Label lblD_Mks_ET;
private System.Windows.Forms.Label lblD_Mvd_ET;
private System.Windows.Forms.PictureBox picDiagnosticos;
private System.Windows.Forms.PictureBox picOperacao;
private System.Windows.Forms.PictureBox picDesligar;
private System.Windows.Forms.Label lblD_Cam_S0;
private System.Windows.Forms.Label lblD_Cam_S1;
private System.Windows.Forms.Label lblD_Cam_C;
private System.Windows.Forms.PictureBox picAjustes;
private System.Windows.Forms.Label lblDiagnosticos;
private System.Windows.Forms.Label lblOperacao;
private System.Windows.Forms.Label lblAjustes;
private System.Windows.Forms.Label lblDesligar;
}
}

View File

@ -6,6 +6,7 @@ using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO.Ports;
using System.Linq;
@ -25,17 +26,44 @@ namespace AgroBase.Forms.IHM
InitializeComponent();
}
private void frmIHM_Load(object sender, EventArgs e)
{
tmrDispositivos.Tick += TmrDispositivos_Tick;
tmrDispositivos.Start();
cmbOperacao.Items.Clear();
cmbOperacao.Items.AddRange(Enum.GetNames(typeof(ModoOperacao)));
cmbOperacao.SelectedIndex = (int)Variaveis.OperacaoEmAndamento.Modo;
Variaveis.OperacaoEmAndamento = OperacaoModel.CarregarOperacaoPersonalizada(Application.StartupPath + "\\operacao" + Enum.GetName(typeof(ModoOperacao), Variaveis.OperacaoEmAndamento.Modo) + ".opr");
FuncoesGlobais.DefinirEventosPicBtn(picOperacao, async () =>
{
frmInicioOperacao frm = new frmInicioOperacao();
frm.ShowDialog();
});
FuncoesGlobais.DefinirEventosPicBtn(picDiagnosticos, async () =>
{
});
/*FuncoesGlobais.DefinirEventosPicBtn(picComunicacao, async () =>
{
if (LoRaService.Iniciado)
{
frmLoraConfig frm = new frmLoraConfig(Variaveis.ConexaoLoRa);
frm.Show();
}
else
{
MessageBox.Show("Módulo LoRa de comunicação não está conectado ou não está no modo de parametrização!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
});*/
FuncoesGlobais.DefinirEventosPicBtn(picAjustes, async () =>
{
frmAjustes frm = new frmAjustes(Variaveis.ConexaoLoRa);
frm.ShowDialog();
});
FuncoesGlobais.DefinirEventosPicBtn(picDesligar, async () =>
{
if (MessageBox.Show("Deseja desligar o equipamento?", "Desligar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
Process.Start("shutdown", "/s /t 0");
}
});
}
private void TmrDispositivos_Tick(object sender, EventArgs e)
@ -45,57 +73,38 @@ namespace AgroBase.Forms.IHM
var Labels = this.Controls.OfType<Label>().Where(y => y.Name.Contains("lblD_")).ToList();
Labels.ForEach(lbl =>
{
lbl.ForeColor = Color.Black;
});
T_Code Dispositivo = (T_Code)Enum.Parse(typeof(T_Code), lbl.Name.Split('_')[1]);
string Mod_ID = lbl.Name.Split('_').Length == 3 ? lbl.Name.Split('_')[2] : lbl.Name.Split('_')[1];
SerialService.DispositivosMapeados.ForEach(Modulo =>
{
Label lblDisp = Labels.Where(y => y.Name.Replace("lblD_", "") == Enum.GetName(typeof(T_Code), Modulo.Dispositivo)).FirstOrDefault();
if (lblDisp != null)
if (Dispositivo == T_Code.Cam)
{
bool DispositivoConectado = false;
var listaCameras = CameraService.AtualizaListaCameras();
if (Modulo.Dispositivo == T_Code.Gps)
var CameraCaminho = Variaveis.OperacaoEmAndamento.CameraCaminho;
if (CameraCaminho != null && Mod_ID == CameraCaminho.ID)
{
DispositivoConectado = GPSService.Iniciado;
}
else if (Modulo.Dispositivo == T_Code.Pzm)
{
DispositivoConectado = PZEMService.Iniciado;
}
else if (Modulo.Dispositivo == T_Code.Lra)
{
DispositivoConectado = LoRaService.Iniciado;
}
else if (Modulo.Dispositivo == T_Code.Wit)
{
DispositivoConectado = WT901CService.Iniciado;
}
else if (Modulo.Dispositivo == T_Code.Bld)
{
DispositivoConectado = Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.Any(x => x.MovMotor.DadosDriver.Iniciado);
lbl.ForeColor = !listaCameras.Any(x => x.Value == CameraCaminho.CameraSelecionada) ? Color.DarkRed : CameraCaminho.camera.selectedCamera == 0 ? Color.Gold : Color.DarkGreen;
}
else
{
IDispositivosService dispositivoService = Variaveis.DispositivosConectados.FirstOrDefault(x => x.Dispositivo == Modulo.Dispositivo && x._Porta.PortName == Modulo.PortaCOM);
if (dispositivoService != null)
var CameraSolo = Variaveis.OperacaoEmAndamento.CamerasSolo.FirstOrDefault(x => x.ID == Mod_ID);
if (CameraSolo != null)
{
if (!dispositivoService._Porta.IsOpen)
{
if (dispositivoService.Dispositivo != T_Code.Sen || (dispositivoService.Dispositivo == T_Code.Sen && SerialService.DispositivosMapeados.Any(x => x.Dispositivo == T_Code.Lra && !x.Erro)))
{
dispositivoService.btnConectar_Click(new object(), new EventArgs());
}
}
DispositivoConectado = dispositivoService._Porta.IsOpen;
}
else
{
DispositivoConectado = false;
lbl.ForeColor = !listaCameras.Any(x => x.Value == CameraSolo.CameraSelecionada) ? Color.DarkRed : CameraSolo.camera.selectedCamera == 0 ? Color.Gold : Color.DarkGreen;
}
}
lblDisp.ForeColor = Modulo.Erro ? Color.Yellow : DispositivoConectado ? Color.Green : Color.Red;
}
else
{
var Modulo = SerialService.DispositivosMapeados.FirstOrDefault(x => x.Dispositivo == Dispositivo && (x.Mod_ID == Mod_ID || x.Mod_ID == null));
if (Modulo != null)
{
lbl.ForeColor = Modulo.Erro ? Color.Gold : Modulo.Conectado ? Color.DarkGreen : Color.DarkRed;
}
else
{
lbl.ForeColor = Color.Black;
}
}
});
@ -106,42 +115,38 @@ namespace AgroBase.Forms.IHM
lblMqtt.Text = "MQTT: " + (Variaveis.MqttService.StatusConexao() ? "Conectado" : "Desconectado");
lblMqtt.ForeColor = Variaveis.MqttService.StatusConexao() ? Color.Green : Color.Red;
if (
Variaveis.OperacaoEmAndamento.DispAtu == null && Variaveis.DispositivosConectados.Any(x => x.Dispositivo == T_Code.Atu) ||
//Variaveis.OperacaoEmAndamento.DispDir == null && Variaveis.DispositivosConectados.Any(x => x.Dispositivo == T_Code.Dir) ||
//Variaveis.OperacaoEmAndamento.DispMov == null && Variaveis.DispositivosConectados.Any(x => x.Dispositivo == T_Code.Mov) ||
Variaveis.OperacaoEmAndamento.DispMvd == null && Variaveis.DispositivosConectados.Any(x => x.Dispositivo == T_Code.Mvd) ||
Variaveis.OperacaoEmAndamento.DispSen == null && Variaveis.DispositivosConectados.Any(x => x.Dispositivo == T_Code.Sen)
)
{
Variaveis.OperacaoEmAndamento = OperacaoModel.CarregarParametrosOperacaoPadrao((ModoOperacao)cmbOperacao.SelectedIndex);
}
}
private void btnConfigurar_Click(object sender, EventArgs e)
private void lblModulo_Click(object sender, EventArgs e)
{
frmParametrizacaoOperacao frmParametrizacaoOperacao = new frmParametrizacaoOperacao();
frmParametrizacaoOperacao.ShowDialog();
Label lbl = (Label)sender;
T_Code Dispositivo = (T_Code)Enum.Parse(typeof(T_Code), lbl.Name.Split('_')[1]);
string Mod_ID = lbl.Name.Split('_').Length == 3 ? lbl.Name.Split('_')[2] : lbl.Name.Split('_')[1];
var Modulo = SerialService.DispositivosMapeados.FirstOrDefault(x => x.Dispositivo == Dispositivo && (x.Mod_ID == Mod_ID || x.Mod_ID == null));
string msg = "Módulo: " + Dispositivo +
"\r\nID: " + Mod_ID +
"\r\nConectado: " + (Modulo != null ? "Sim" : "Não") +
"\r\nInicializado: " + (Modulo != null && Modulo.Conectado ? "Sim" : "Não") +
"\r\nVersão: " + (Modulo != null ? Modulo.Versao : "") +
"\r\nErro: " + (Modulo != null && Modulo.Erro ? "Sim" : "Não") +
"\r\nStatus: " + (
lbl.ForeColor == Color.Black ? "Não conectado" :
lbl.ForeColor == Color.DarkRed ? "Não inicializado" :
lbl.ForeColor == Color.DarkGreen ? "Inicializado" :
lbl.ForeColor == Color.Gold ? "Não configurado" :
""
);
var res = MessageBox.Show(
msg,
"Detalhes",
Modulo != null && Modulo.Conectado ? MessageBoxButtons.OK : MessageBoxButtons.RetryCancel,
Modulo != null && Modulo.Erro ? MessageBoxIcon.Error : Modulo != null && Modulo.Conectado ? MessageBoxIcon.Information : MessageBoxIcon.Exclamation
);
}
private void cmbOperacao_SelectedIndexChanged(object sender, EventArgs e)
{
Variaveis.OperacaoEmAndamento = OperacaoModel.CarregarParametrosOperacaoPadrao((ModoOperacao)cmbOperacao.SelectedIndex);
AtualizarLabelOperacao();
}
private void btnIniciar_Click(object sender, EventArgs e)
{
Variaveis.OperacaoEmAndamento.AbrirForm();
AtualizarLabelOperacao();
}
private void AtualizarLabelOperacao()
{
lblOperacaoStatus.Text = "Operação: " + Enum.GetName(typeof(ModoOperacao), Variaveis.OperacaoEmAndamento.Modo) + " " + (Variaveis.OperacaoEmAndamento.Iniciado ? "Iniciado" : "Não iniciado");
}
}
}

View File

@ -0,0 +1,523 @@
namespace AgroBase.Forms.Operacoes
{
partial class frmInicioOperacao
{
/// <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.cmbMidias = new System.Windows.Forms.ComboBox();
this.lblMidias = new System.Windows.Forms.Label();
this.rtbMidias = new System.Windows.Forms.RichTextBox();
this.fpnlPastas = new System.Windows.Forms.FlowLayoutPanel();
this.txtCaminho = new System.Windows.Forms.TextBox();
this.fpnlInformacoes = new System.Windows.Forms.FlowLayoutPanel();
this.lblModoOperacao = new System.Windows.Forms.Label();
this.txtModoOperacao = new System.Windows.Forms.TextBox();
this.lblDescricao = new System.Windows.Forms.Label();
this.txtDescricao = new System.Windows.Forms.TextBox();
this.lblCriadoEm = new System.Windows.Forms.Label();
this.txtCriadoEm = new System.Windows.Forms.TextBox();
this.lblRuasPercorrer = new System.Windows.Forms.Label();
this.txtRuasPercorrer = new System.Windows.Forms.TextBox();
this.lblDistanciaTotal = new System.Windows.Forms.Label();
this.txtDistanciaTotal = new System.Windows.Forms.TextBox();
this.lblTempoEstimado = new System.Windows.Forms.Label();
this.txtTempoEstimado = new System.Windows.Forms.TextBox();
this.lblModulosMandatorios = new System.Windows.Forms.Label();
this.chbMvd = new System.Windows.Forms.CheckBox();
this.chbMks = new System.Windows.Forms.CheckBox();
this.chbSen = new System.Windows.Forms.CheckBox();
this.chbPzm = new System.Windows.Forms.CheckBox();
this.chbWit = new System.Windows.Forms.CheckBox();
this.chbGps = new System.Windows.Forms.CheckBox();
this.chbAtu = new System.Windows.Forms.CheckBox();
this.chbLra = new System.Windows.Forms.CheckBox();
this.lblInformacoes = new System.Windows.Forms.Label();
this.picFechar = new System.Windows.Forms.PictureBox();
this.picMapa = new System.Windows.Forms.PictureBox();
this.picIniciar = new System.Windows.Forms.PictureBox();
this.picAtualizar = new System.Windows.Forms.PictureBox();
this.picVoltar = new System.Windows.Forms.PictureBox();
this.picExcluir = new System.Windows.Forms.PictureBox();
this.picSalvar = new System.Windows.Forms.PictureBox();
this.fpnlInformacoes.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picFechar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picMapa)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picIniciar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picAtualizar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picVoltar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picExcluir)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picSalvar)).BeginInit();
this.SuspendLayout();
//
// cmbMidias
//
this.cmbMidias.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMidias.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cmbMidias.FormattingEnabled = true;
this.cmbMidias.Location = new System.Drawing.Point(12, 32);
this.cmbMidias.Name = "cmbMidias";
this.cmbMidias.Size = new System.Drawing.Size(125, 33);
this.cmbMidias.TabIndex = 0;
//
// lblMidias
//
this.lblMidias.AutoSize = true;
this.lblMidias.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F);
this.lblMidias.Location = new System.Drawing.Point(9, 11);
this.lblMidias.Name = "lblMidias";
this.lblMidias.Size = new System.Drawing.Size(135, 18);
this.lblMidias.TabIndex = 1;
this.lblMidias.Text = "Mídias Conectadas";
//
// rtbMidias
//
this.rtbMidias.BackColor = System.Drawing.Color.Ivory;
this.rtbMidias.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbMidias.Location = new System.Drawing.Point(12, 71);
this.rtbMidias.Name = "rtbMidias";
this.rtbMidias.ReadOnly = true;
this.rtbMidias.Size = new System.Drawing.Size(125, 67);
this.rtbMidias.TabIndex = 3;
this.rtbMidias.Text = "Selecione a unidade de mídia conectado ao equipamento para listar as operações di" +
"sponíveis";
//
// fpnlPastas
//
this.fpnlPastas.AutoScroll = true;
this.fpnlPastas.BackColor = System.Drawing.Color.White;
this.fpnlPastas.Location = new System.Drawing.Point(154, 38);
this.fpnlPastas.Name = "fpnlPastas";
this.fpnlPastas.Size = new System.Drawing.Size(476, 430);
this.fpnlPastas.TabIndex = 4;
//
// txtCaminho
//
this.txtCaminho.BackColor = System.Drawing.Color.White;
this.txtCaminho.Location = new System.Drawing.Point(154, 12);
this.txtCaminho.Name = "txtCaminho";
this.txtCaminho.ReadOnly = true;
this.txtCaminho.Size = new System.Drawing.Size(475, 20);
this.txtCaminho.TabIndex = 5;
//
// fpnlInformacoes
//
this.fpnlInformacoes.Controls.Add(this.lblModoOperacao);
this.fpnlInformacoes.Controls.Add(this.txtModoOperacao);
this.fpnlInformacoes.Controls.Add(this.lblDescricao);
this.fpnlInformacoes.Controls.Add(this.txtDescricao);
this.fpnlInformacoes.Controls.Add(this.lblCriadoEm);
this.fpnlInformacoes.Controls.Add(this.txtCriadoEm);
this.fpnlInformacoes.Controls.Add(this.lblRuasPercorrer);
this.fpnlInformacoes.Controls.Add(this.txtRuasPercorrer);
this.fpnlInformacoes.Controls.Add(this.lblDistanciaTotal);
this.fpnlInformacoes.Controls.Add(this.txtDistanciaTotal);
this.fpnlInformacoes.Controls.Add(this.lblTempoEstimado);
this.fpnlInformacoes.Controls.Add(this.txtTempoEstimado);
this.fpnlInformacoes.Controls.Add(this.lblModulosMandatorios);
this.fpnlInformacoes.Controls.Add(this.chbMvd);
this.fpnlInformacoes.Controls.Add(this.chbMks);
this.fpnlInformacoes.Controls.Add(this.chbSen);
this.fpnlInformacoes.Controls.Add(this.chbPzm);
this.fpnlInformacoes.Controls.Add(this.chbWit);
this.fpnlInformacoes.Controls.Add(this.chbGps);
this.fpnlInformacoes.Controls.Add(this.chbAtu);
this.fpnlInformacoes.Controls.Add(this.chbLra);
this.fpnlInformacoes.Location = new System.Drawing.Point(636, 38);
this.fpnlInformacoes.Name = "fpnlInformacoes";
this.fpnlInformacoes.Size = new System.Drawing.Size(152, 363);
this.fpnlInformacoes.TabIndex = 9;
//
// lblModoOperacao
//
this.lblModoOperacao.AutoSize = true;
this.lblModoOperacao.Location = new System.Drawing.Point(3, 0);
this.lblModoOperacao.Name = "lblModoOperacao";
this.lblModoOperacao.Size = new System.Drawing.Size(99, 13);
this.lblModoOperacao.TabIndex = 0;
this.lblModoOperacao.Text = "Modo de Operação";
//
// txtModoOperacao
//
this.txtModoOperacao.BackColor = System.Drawing.Color.White;
this.txtModoOperacao.Location = new System.Drawing.Point(3, 16);
this.txtModoOperacao.Name = "txtModoOperacao";
this.txtModoOperacao.ReadOnly = true;
this.txtModoOperacao.Size = new System.Drawing.Size(142, 20);
this.txtModoOperacao.TabIndex = 1;
this.txtModoOperacao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblDescricao
//
this.lblDescricao.AutoSize = true;
this.lblDescricao.Location = new System.Drawing.Point(3, 39);
this.lblDescricao.Name = "lblDescricao";
this.lblDescricao.Size = new System.Drawing.Size(55, 13);
this.lblDescricao.TabIndex = 2;
this.lblDescricao.Text = "Descrição";
//
// txtDescricao
//
this.txtDescricao.BackColor = System.Drawing.Color.White;
this.txtDescricao.Location = new System.Drawing.Point(3, 55);
this.txtDescricao.Name = "txtDescricao";
this.txtDescricao.ReadOnly = true;
this.txtDescricao.Size = new System.Drawing.Size(142, 20);
this.txtDescricao.TabIndex = 3;
this.txtDescricao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblCriadoEm
//
this.lblCriadoEm.AutoSize = true;
this.lblCriadoEm.Location = new System.Drawing.Point(3, 78);
this.lblCriadoEm.Name = "lblCriadoEm";
this.lblCriadoEm.Size = new System.Drawing.Size(55, 13);
this.lblCriadoEm.TabIndex = 4;
this.lblCriadoEm.Text = "Criado Em";
//
// txtCriadoEm
//
this.txtCriadoEm.BackColor = System.Drawing.Color.White;
this.txtCriadoEm.Location = new System.Drawing.Point(3, 94);
this.txtCriadoEm.Name = "txtCriadoEm";
this.txtCriadoEm.ReadOnly = true;
this.txtCriadoEm.Size = new System.Drawing.Size(142, 20);
this.txtCriadoEm.TabIndex = 5;
this.txtCriadoEm.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblRuasPercorrer
//
this.lblRuasPercorrer.AutoSize = true;
this.lblRuasPercorrer.Location = new System.Drawing.Point(3, 117);
this.lblRuasPercorrer.Name = "lblRuasPercorrer";
this.lblRuasPercorrer.Size = new System.Drawing.Size(78, 13);
this.lblRuasPercorrer.TabIndex = 6;
this.lblRuasPercorrer.Text = "Ruas Percorrer";
//
// txtRuasPercorrer
//
this.txtRuasPercorrer.BackColor = System.Drawing.Color.White;
this.txtRuasPercorrer.Location = new System.Drawing.Point(3, 133);
this.txtRuasPercorrer.Name = "txtRuasPercorrer";
this.txtRuasPercorrer.ReadOnly = true;
this.txtRuasPercorrer.Size = new System.Drawing.Size(142, 20);
this.txtRuasPercorrer.TabIndex = 7;
this.txtRuasPercorrer.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblDistanciaTotal
//
this.lblDistanciaTotal.AutoSize = true;
this.lblDistanciaTotal.Location = new System.Drawing.Point(3, 156);
this.lblDistanciaTotal.Name = "lblDistanciaTotal";
this.lblDistanciaTotal.Size = new System.Drawing.Size(78, 13);
this.lblDistanciaTotal.TabIndex = 8;
this.lblDistanciaTotal.Text = "Distância Total";
//
// txtDistanciaTotal
//
this.txtDistanciaTotal.BackColor = System.Drawing.Color.White;
this.txtDistanciaTotal.Location = new System.Drawing.Point(3, 172);
this.txtDistanciaTotal.Name = "txtDistanciaTotal";
this.txtDistanciaTotal.ReadOnly = true;
this.txtDistanciaTotal.Size = new System.Drawing.Size(142, 20);
this.txtDistanciaTotal.TabIndex = 9;
this.txtDistanciaTotal.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblTempoEstimado
//
this.lblTempoEstimado.AutoSize = true;
this.lblTempoEstimado.Location = new System.Drawing.Point(3, 195);
this.lblTempoEstimado.Name = "lblTempoEstimado";
this.lblTempoEstimado.Size = new System.Drawing.Size(86, 13);
this.lblTempoEstimado.TabIndex = 10;
this.lblTempoEstimado.Text = "Tempo Estimado";
//
// txtTempoEstimado
//
this.txtTempoEstimado.BackColor = System.Drawing.Color.White;
this.txtTempoEstimado.Location = new System.Drawing.Point(3, 211);
this.txtTempoEstimado.Name = "txtTempoEstimado";
this.txtTempoEstimado.ReadOnly = true;
this.txtTempoEstimado.Size = new System.Drawing.Size(142, 20);
this.txtTempoEstimado.TabIndex = 11;
this.txtTempoEstimado.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblModulosMandatorios
//
this.lblModulosMandatorios.AutoSize = true;
this.lblModulosMandatorios.Location = new System.Drawing.Point(3, 234);
this.lblModulosMandatorios.Name = "lblModulosMandatorios";
this.lblModulosMandatorios.Size = new System.Drawing.Size(108, 13);
this.lblModulosMandatorios.TabIndex = 12;
this.lblModulosMandatorios.Text = "Módulos Mandatórios";
//
// chbMvd
//
this.chbMvd.AutoSize = true;
this.chbMvd.Enabled = false;
this.chbMvd.Location = new System.Drawing.Point(3, 250);
this.chbMvd.Name = "chbMvd";
this.chbMvd.Size = new System.Drawing.Size(50, 17);
this.chbMvd.TabIndex = 13;
this.chbMvd.Text = "MVD";
this.chbMvd.UseVisualStyleBackColor = true;
//
// chbMks
//
this.chbMks.AutoSize = true;
this.chbMks.Enabled = false;
this.chbMks.Location = new System.Drawing.Point(59, 250);
this.chbMks.Name = "chbMks";
this.chbMks.Size = new System.Drawing.Size(49, 17);
this.chbMks.TabIndex = 14;
this.chbMks.Text = "MKS";
this.chbMks.UseVisualStyleBackColor = true;
//
// chbSen
//
this.chbSen.AutoSize = true;
this.chbSen.Enabled = false;
this.chbSen.Location = new System.Drawing.Point(3, 273);
this.chbSen.Name = "chbSen";
this.chbSen.Size = new System.Drawing.Size(48, 17);
this.chbSen.TabIndex = 15;
this.chbSen.Text = "SEN";
this.chbSen.UseVisualStyleBackColor = true;
//
// chbPzm
//
this.chbPzm.AutoSize = true;
this.chbPzm.Enabled = false;
this.chbPzm.Location = new System.Drawing.Point(57, 273);
this.chbPzm.Name = "chbPzm";
this.chbPzm.Size = new System.Drawing.Size(49, 17);
this.chbPzm.TabIndex = 16;
this.chbPzm.Text = "PZM";
this.chbPzm.UseVisualStyleBackColor = true;
//
// chbWit
//
this.chbWit.AutoSize = true;
this.chbWit.Enabled = false;
this.chbWit.Location = new System.Drawing.Point(3, 296);
this.chbWit.Name = "chbWit";
this.chbWit.Size = new System.Drawing.Size(47, 17);
this.chbWit.TabIndex = 17;
this.chbWit.Text = "WIT";
this.chbWit.UseVisualStyleBackColor = true;
//
// chbGps
//
this.chbGps.AutoSize = true;
this.chbGps.Enabled = false;
this.chbGps.Location = new System.Drawing.Point(56, 296);
this.chbGps.Name = "chbGps";
this.chbGps.Size = new System.Drawing.Size(48, 17);
this.chbGps.TabIndex = 18;
this.chbGps.Text = "GPS";
this.chbGps.UseVisualStyleBackColor = true;
//
// chbAtu
//
this.chbAtu.AutoSize = true;
this.chbAtu.Enabled = false;
this.chbAtu.Location = new System.Drawing.Point(3, 319);
this.chbAtu.Name = "chbAtu";
this.chbAtu.Size = new System.Drawing.Size(48, 17);
this.chbAtu.TabIndex = 19;
this.chbAtu.Text = "ATU";
this.chbAtu.UseVisualStyleBackColor = true;
//
// chbLra
//
this.chbLra.AutoSize = true;
this.chbLra.Enabled = false;
this.chbLra.Location = new System.Drawing.Point(57, 319);
this.chbLra.Name = "chbLra";
this.chbLra.Size = new System.Drawing.Size(47, 17);
this.chbLra.TabIndex = 20;
this.chbLra.Text = "LRA";
this.chbLra.UseVisualStyleBackColor = true;
//
// lblInformacoes
//
this.lblInformacoes.AutoSize = true;
this.lblInformacoes.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblInformacoes.Location = new System.Drawing.Point(635, 15);
this.lblInformacoes.Name = "lblInformacoes";
this.lblInformacoes.Size = new System.Drawing.Size(98, 20);
this.lblInformacoes.TabIndex = 2;
this.lblInformacoes.Text = "Informações";
//
// picFechar
//
this.picFechar.Image = global::AgroBase.Properties.Resources.fechar;
this.picFechar.Location = new System.Drawing.Point(738, 418);
this.picFechar.Name = "picFechar";
this.picFechar.Size = new System.Drawing.Size(50, 50);
this.picFechar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picFechar.TabIndex = 12;
this.picFechar.TabStop = false;
//
// picMapa
//
this.picMapa.Image = global::AgroBase.Properties.Resources.localizacao;
this.picMapa.Location = new System.Drawing.Point(36, 272);
this.picMapa.Name = "picMapa";
this.picMapa.Size = new System.Drawing.Size(75, 75);
this.picMapa.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picMapa.TabIndex = 11;
this.picMapa.TabStop = false;
//
// picIniciar
//
this.picIniciar.Image = global::AgroBase.Properties.Resources.iniciar;
this.picIniciar.Location = new System.Drawing.Point(17, 353);
this.picIniciar.Name = "picIniciar";
this.picIniciar.Size = new System.Drawing.Size(115, 115);
this.picIniciar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picIniciar.TabIndex = 10;
this.picIniciar.TabStop = false;
//
// picAtualizar
//
this.picAtualizar.Image = global::AgroBase.Properties.Resources.atualizar;
this.picAtualizar.Location = new System.Drawing.Point(87, 144);
this.picAtualizar.Name = "picAtualizar";
this.picAtualizar.Size = new System.Drawing.Size(50, 50);
this.picAtualizar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picAtualizar.TabIndex = 8;
this.picAtualizar.TabStop = false;
//
// picVoltar
//
this.picVoltar.Image = global::AgroBase.Properties.Resources.voltar;
this.picVoltar.Location = new System.Drawing.Point(12, 144);
this.picVoltar.Name = "picVoltar";
this.picVoltar.Size = new System.Drawing.Size(50, 50);
this.picVoltar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picVoltar.TabIndex = 7;
this.picVoltar.TabStop = false;
//
// picExcluir
//
this.picExcluir.Image = global::AgroBase.Properties.Resources.excluir;
this.picExcluir.Location = new System.Drawing.Point(87, 210);
this.picExcluir.Name = "picExcluir";
this.picExcluir.Size = new System.Drawing.Size(50, 50);
this.picExcluir.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picExcluir.TabIndex = 13;
this.picExcluir.TabStop = false;
//
// picSalvar
//
this.picSalvar.Image = global::AgroBase.Properties.Resources.salvar;
this.picSalvar.Location = new System.Drawing.Point(12, 210);
this.picSalvar.Name = "picSalvar";
this.picSalvar.Size = new System.Drawing.Size(50, 50);
this.picSalvar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picSalvar.TabIndex = 14;
this.picSalvar.TabStop = false;
//
// frmInicioOperacao
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Ivory;
this.ClientSize = new System.Drawing.Size(800, 480);
this.Controls.Add(this.picSalvar);
this.Controls.Add(this.picExcluir);
this.Controls.Add(this.picFechar);
this.Controls.Add(this.picMapa);
this.Controls.Add(this.lblInformacoes);
this.Controls.Add(this.fpnlInformacoes);
this.Controls.Add(this.picIniciar);
this.Controls.Add(this.picAtualizar);
this.Controls.Add(this.picVoltar);
this.Controls.Add(this.txtCaminho);
this.Controls.Add(this.fpnlPastas);
this.Controls.Add(this.rtbMidias);
this.Controls.Add(this.lblMidias);
this.Controls.Add(this.cmbMidias);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "frmInicioOperacao";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Preparando operação...";
this.Load += new System.EventHandler(this.frmInicioOperacao_Load);
this.fpnlInformacoes.ResumeLayout(false);
this.fpnlInformacoes.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picFechar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picMapa)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picIniciar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picAtualizar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picVoltar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picExcluir)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picSalvar)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ComboBox cmbMidias;
private System.Windows.Forms.Label lblMidias;
private System.Windows.Forms.RichTextBox rtbMidias;
private System.Windows.Forms.FlowLayoutPanel fpnlPastas;
private System.Windows.Forms.TextBox txtCaminho;
private System.Windows.Forms.PictureBox picVoltar;
private System.Windows.Forms.PictureBox picAtualizar;
private System.Windows.Forms.FlowLayoutPanel fpnlInformacoes;
private System.Windows.Forms.Label lblModoOperacao;
private System.Windows.Forms.TextBox txtModoOperacao;
private System.Windows.Forms.Label lblDescricao;
private System.Windows.Forms.TextBox txtDescricao;
private System.Windows.Forms.Label lblCriadoEm;
private System.Windows.Forms.TextBox txtCriadoEm;
private System.Windows.Forms.Label lblInformacoes;
private System.Windows.Forms.Label lblRuasPercorrer;
private System.Windows.Forms.TextBox txtRuasPercorrer;
private System.Windows.Forms.Label lblDistanciaTotal;
private System.Windows.Forms.TextBox txtDistanciaTotal;
private System.Windows.Forms.Label lblTempoEstimado;
private System.Windows.Forms.TextBox txtTempoEstimado;
private System.Windows.Forms.Label lblModulosMandatorios;
private System.Windows.Forms.CheckBox chbMvd;
private System.Windows.Forms.CheckBox chbMks;
private System.Windows.Forms.CheckBox chbSen;
private System.Windows.Forms.CheckBox chbPzm;
private System.Windows.Forms.CheckBox chbWit;
private System.Windows.Forms.CheckBox chbGps;
private System.Windows.Forms.CheckBox chbAtu;
private System.Windows.Forms.CheckBox chbLra;
private System.Windows.Forms.PictureBox picIniciar;
private System.Windows.Forms.PictureBox picMapa;
private System.Windows.Forms.PictureBox picFechar;
private System.Windows.Forms.PictureBox picExcluir;
private System.Windows.Forms.PictureBox picSalvar;
}
}

View File

@ -0,0 +1,266 @@
using AgroBase.Forms.IHM;
using AgroBase.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static AgroBase.Models.Enuns;
namespace AgroBase.Forms.Operacoes
{
public partial class frmInicioOperacao : Form
{
string CaminhoOperacoesSistema = Variaveis.CaminhoSistema + Variaveis.CaminhoOperacoesSalvas;
frmDialogoMapa frmDialogo = new frmDialogoMapa();
List<string> ruasSelecionadas = new List<string>();
string pathOperacaoSelecionada = "";
public frmInicioOperacao()
{
InitializeComponent();
FuncoesGlobais.DefinirEventosPicBtn(picAtualizar, async () =>
{
LoadDirectoryFiles(txtCaminho.Text);
});
FuncoesGlobais.DefinirEventosPicBtn(picVoltar, async () =>
{
string diretorioPai = Path.GetDirectoryName(txtCaminho.Text);
if (diretorioPai != null)
{
LoadDirectoryFiles(diretorioPai);
}
});
FuncoesGlobais.DefinirEventosPicBtn(picMapa, async () =>
{
frmDialogo.Show();
await frmDialogo.AtualizarRuasSelecionadas(ruasSelecionadas);
});
FuncoesGlobais.DefinirEventosPicBtn(picFechar, async () =>
{
this.Close();
});
FuncoesGlobais.DefinirEventosPicBtn(picIniciar, async () =>
{
if (Variaveis.OperacaoEmAndamento.OperacaoLiberada)
{
if (MessageBox.Show("Deseja iniciar a operação selecionada?", "Iniciar Operação", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
frmDialogo.ShowDialog();
await frmDialogo.AtualizarRuasSelecionadas(ruasSelecionadas);
frmDialogo.IniciarOperacao();
}
}
else
{
MessageBox.Show(Variaveis.OperacaoEmAndamento.ErroOperacaoLiberada, "Conexão de módulos pendentes", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
});
FuncoesGlobais.DefinirEventosPicBtn(picExcluir, async () =>
{
if (pathOperacaoSelecionada.Contains(CaminhoOperacoesSistema))
{
if (MessageBox.Show("Tem certeza que deseja excluir a operação do sistema?", "Excluir Operação", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
File.Delete(pathOperacaoSelecionada);
MessageBox.Show("Operação excluída da memória do equipamento com sucesso!", "Excluir Operação", MessageBoxButtons.OK, MessageBoxIcon.Information);
LoadDirectoryFiles(txtCaminho.Text);
}
}
});
FuncoesGlobais.DefinirEventosPicBtn(picSalvar, async () =>
{
if (!pathOperacaoSelecionada.Contains(CaminhoOperacoesSistema))
{
string fileName = Path.GetFileName(pathOperacaoSelecionada);
if (!Directory.Exists(CaminhoOperacoesSistema))
{
Directory.CreateDirectory(CaminhoOperacoesSistema);
}
File.Copy(pathOperacaoSelecionada, CaminhoOperacoesSistema + fileName);
MessageBox.Show("Operação copiada da mídia para a memória do equipamento com sucesso!", "Copiar Operação", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
});
cmbMidias.SelectedIndexChanged += cmbMidias_SelectedIndexChanged;
}
private void frmInicioOperacao_Load(object sender, EventArgs e)
{
PopulateDrivesComboBox();
}
private void PopulateDrivesComboBox()
{
cmbMidias.Items.Clear();
var drives = DriveInfo.GetDrives().Where(d => d.IsReady).Select(d => d.Name);
cmbMidias.Items.Add("Local");
cmbMidias.Items.AddRange(drives.ToArray());
cmbMidias.SelectedIndex = 0;
}
private void cmbMidias_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox cmb = (ComboBox)sender;
if (cmb.SelectedItem != null)
{
string selectedDrive = cmb.SelectedItem.ToString();
LoadDirectoryFiles(selectedDrive == "Local" ? CaminhoOperacoesSistema : selectedDrive);
}
}
private void LoadDirectoryFiles(string path)
{
pathOperacaoSelecionada = "";
FlowLayoutPanel flowPanel = fpnlPastas;
flowPanel.Controls.Clear();
try
{
var directories = Directory.GetDirectories(path);
var files = Directory.GetFiles(path);
foreach (var directory in directories)
{
AddItemToFlowPanel(flowPanel, directory, true);
}
foreach (var file in files)
{
AddItemToFlowPanel(flowPanel, file, false);
}
txtCaminho.Text = path;
}
catch (Exception ex)
{
MessageBox.Show($"Erro ao listar arquivos e pastas: {ex.Message}");
}
}
private void CarregarDadosOperacao(string path)
{
(bool sucesso, List<string> ruas) = Variaveis.OperacaoEmAndamento.CarregarParametrizacaoOperacao(frmDialogo.pnlMapa, frmDialogo.lblMapaCarregado, path);
ruasSelecionadas = ruas;
foreach (var chb in fpnlInformacoes.Controls.OfType<CheckBox>())
{
string disp = chb.Name.Replace("chb", "");
T_Code Dispositivo = (T_Code)Enum.Parse(typeof(T_Code), disp);
chb.Checked = Variaveis.OperacaoEmAndamento.ModulosMandatorios.Any(x => x.Dispositivo == Dispositivo);
}
double velocidadeMax = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.Controle.RPM_Max);
double velocidadeMin = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.Controle.RPM_Min);
txtModoOperacao.Text = Variaveis.OperacaoEmAndamento.Modo.ToString();
txtDescricao.Text = Variaveis.OperacaoEmAndamento.Descricao;
txtCriadoEm.Text = new FileInfo(path).CreationTime.ToString("dd/MM/yyyy HH:mm");
txtRuasPercorrer.Text = Variaveis.OperacaoEmAndamento.Mapa.RuasPercorrer.Count().ToString();
txtDistanciaTotal.Text = Variaveis.OperacaoEmAndamento.Mapa.DistanciaTotal.ToString("0.00");
string tempo = Variaveis.OperacaoEmAndamento.TempoEstimado(velocidadeMax, velocidadeMin);
txtTempoEstimado.Text = tempo;
pathOperacaoSelecionada = path;
/*txtVelocidadeSemErvas.Text = velocidadeMax.ToString("0.00");
txtVelocidadeComErvas.Text = velocidadeMin.ToString("0.00");
txtAnguloMaximo.Text = Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.Angulo_Max.ToString("0");
txtVelocidadeDirecional.Text = Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.VelocidadeMP.ToString("0");
txtPercentualAtuacao.Text = (Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.PercentualInicioPulverizacao * 100).ToString("0");
txtCapacidadeReservatorio.Text = Variaveis.OperacaoEmAndamento.CapacidadeReservatorio.ToString("0");
txtPressaoLinha.Text = Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.PressaoLinha.ToString("0");
txtDuracaoAtuacao.Text = Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.TempoAtuacao.ToString("0");*/
}
private void AddItemToFlowPanel(FlowLayoutPanel flowPanel, string path, bool isDirectory)
{
bool isOperation = !isDirectory && Path.GetExtension(path) == ".opr";
if (!isDirectory && !isOperation)
{
return;
}
string pnlNome = "fpnl_" + path.Split('/')[path.Split('/').Length - 1];
// Criação do FlowLayoutPanel para o item
FlowLayoutPanel itemPanel = new FlowLayoutPanel
{
Size = new Size(100, 110),
Margin = new Padding(5),
Name = pnlNome,
//BorderStyle = path == pathOperacaoSelecionada ? BorderStyle.FixedSingle : BorderStyle.None
};
// Criação do PictureBox
PictureBox pictureBox = new PictureBox
{
Size = new Size(94, 65),
Image = isDirectory ? Properties.Resources.pasta : isOperation ? Properties.Resources.cana : GetIconForFile(path),
SizeMode = PictureBoxSizeMode.Zoom,
Margin = new Padding(3),
Cursor = Cursors.Hand
};
// Criação do RichTextBox
RichTextBox richTextBox = new RichTextBox
{
Size = new Size(94, 34),
Text = Path.GetFileName(path),
ReadOnly = true,
BorderStyle = BorderStyle.None,
BackColor = Color.White,
Margin = new Padding(3)
};
pictureBox.Click += (s, args) =>
{
if (isDirectory)
{
LoadDirectoryFiles(path);
}
else if (isOperation)
{
fpnlPastas.Controls.OfType<FlowLayoutPanel>().ToList().ForEach(flowLayoutPanel =>
{
flowLayoutPanel.BorderStyle = BorderStyle.None;
});
CarregarDadosOperacao(path);
((FlowLayoutPanel)fpnlPastas.Controls.Find(pnlNome, false).First()).BorderStyle = BorderStyle.FixedSingle;
}
};
// Adiciona os controles ao itemPanel
itemPanel.Controls.Add(pictureBox);
itemPanel.Controls.Add(richTextBox);
// Adiciona o itemPanel ao flowPanel
flowPanel.Controls.Add(itemPanel);
}
private Image GetIconForFile(string filePath)
{
// Método para obter o ícone do arquivo
Icon icon = Icon.ExtractAssociatedIcon(filePath);
return icon.ToBitmap();
}
}
}

View File

@ -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>

View File

@ -1,47 +0,0 @@
namespace AgroBase.Forms.Operacoes
{
partial class frmInicioOperacao
{
/// <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.SuspendLayout();
//
// frmInicioOperacao
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1176, 578);
this.Name = "frmInicioOperacao";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Preparando operação...";
this.ResumeLayout(false);
}
#endregion
}
}

View File

@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AgroBase.Forms.Operacoes
{
public partial class frmInicioOperacao : Form
{
public frmInicioOperacao()
{
InitializeComponent();
}
}
}

View File

@ -28,14 +28,12 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = 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.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = 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.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
this.pnlCamerasSolo = new System.Windows.Forms.Panel();
this.pnlCameraSoloE = new System.Windows.Forms.Panel();
this.picCameraSoloE = new System.Windows.Forms.PictureBox();
this.pnlCameraSoloD = new System.Windows.Forms.Panel();
this.picCameraSoloD = new System.Windows.Forms.PictureBox();
this.pnlAtuadores = new System.Windows.Forms.Panel();
this.btnIniciarOperacao = new System.Windows.Forms.Button();
this.chartGraficos = new System.Windows.Forms.DataVisualization.Charting.Chart();
@ -65,7 +63,6 @@
this.btnDesligarBomba = new System.Windows.Forms.Button();
this.btnLigarBomba = new System.Windows.Forms.Button();
this.pnlCameraRua = new System.Windows.Forms.Panel();
this.picCameraRua = new System.Windows.Forms.PictureBox();
this.pnlDir_EF = new System.Windows.Forms.Panel();
this.chbLivre_EF = new System.Windows.Forms.CheckBox();
this.chbCmd_EF = new System.Windows.Forms.CheckBox();
@ -91,10 +88,6 @@
this.lblVelocidade = new System.Windows.Forms.Label();
this.lblKmh = new System.Windows.Forms.Label();
this.pnlCamerasSolo.SuspendLayout();
this.pnlCameraSoloE.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picCameraSoloE)).BeginInit();
this.pnlCameraSoloD.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picCameraSoloD)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.chartGraficos)).BeginInit();
this.tabControl1.SuspendLayout();
this.tabMapa.SuspendLayout();
@ -105,8 +98,6 @@
((System.ComponentModel.ISupportInitialize)(this.picSonar)).BeginInit();
this.tabPulverizador.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudPressaoSP)).BeginInit();
this.pnlCameraRua.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picCameraRua)).BeginInit();
this.pnlDir_EF.SuspendLayout();
this.pnlDir_ET.SuspendLayout();
this.pnlDir_DT.SuspendLayout();
@ -119,59 +110,33 @@
this.pnlCamerasSolo.Controls.Add(this.pnlCameraSoloE);
this.pnlCamerasSolo.Controls.Add(this.pnlCameraSoloD);
this.pnlCamerasSolo.Location = new System.Drawing.Point(23, 328);
this.pnlCamerasSolo.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pnlCamerasSolo.Margin = new System.Windows.Forms.Padding(2);
this.pnlCamerasSolo.Name = "pnlCamerasSolo";
this.pnlCamerasSolo.Size = new System.Drawing.Size(588, 184);
this.pnlCamerasSolo.TabIndex = 0;
//
// pnlCameraSoloE
//
this.pnlCameraSoloE.Controls.Add(this.picCameraSoloE);
this.pnlCameraSoloE.Location = new System.Drawing.Point(2, 2);
this.pnlCameraSoloE.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pnlCameraSoloE.Margin = new System.Windows.Forms.Padding(2);
this.pnlCameraSoloE.Name = "pnlCameraSoloE";
this.pnlCameraSoloE.Size = new System.Drawing.Size(289, 178);
this.pnlCameraSoloE.TabIndex = 24;
//
// picCameraSoloE
//
this.picCameraSoloE.BackColor = System.Drawing.SystemColors.ButtonFace;
this.picCameraSoloE.Dock = System.Windows.Forms.DockStyle.Fill;
this.picCameraSoloE.Location = new System.Drawing.Point(0, 0);
this.picCameraSoloE.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.picCameraSoloE.Name = "picCameraSoloE";
this.picCameraSoloE.Size = new System.Drawing.Size(289, 178);
this.picCameraSoloE.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.picCameraSoloE.TabIndex = 1;
this.picCameraSoloE.TabStop = false;
//
// pnlCameraSoloD
//
this.pnlCameraSoloD.Controls.Add(this.picCameraSoloD);
this.pnlCameraSoloD.Location = new System.Drawing.Point(296, 2);
this.pnlCameraSoloD.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pnlCameraSoloD.Margin = new System.Windows.Forms.Padding(2);
this.pnlCameraSoloD.Name = "pnlCameraSoloD";
this.pnlCameraSoloD.Size = new System.Drawing.Size(289, 178);
this.pnlCameraSoloD.TabIndex = 23;
//
// picCameraSoloD
//
this.picCameraSoloD.BackColor = System.Drawing.SystemColors.ButtonFace;
this.picCameraSoloD.Dock = System.Windows.Forms.DockStyle.Fill;
this.picCameraSoloD.Location = new System.Drawing.Point(0, 0);
this.picCameraSoloD.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.picCameraSoloD.Name = "picCameraSoloD";
this.picCameraSoloD.Size = new System.Drawing.Size(289, 178);
this.picCameraSoloD.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.picCameraSoloD.TabIndex = 1;
this.picCameraSoloD.TabStop = false;
//
// pnlAtuadores
//
this.pnlAtuadores.BackColor = System.Drawing.Color.White;
this.pnlAtuadores.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pnlAtuadores.Location = new System.Drawing.Point(23, 518);
this.pnlAtuadores.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pnlAtuadores.Margin = new System.Windows.Forms.Padding(2);
this.pnlAtuadores.Name = "pnlAtuadores";
this.pnlAtuadores.Size = new System.Drawing.Size(589, 127);
this.pnlAtuadores.TabIndex = 1;
@ -182,7 +147,7 @@
this.btnIniciarOperacao.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnIniciarOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnIniciarOperacao.Location = new System.Drawing.Point(1119, 585);
this.btnIniciarOperacao.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnIniciarOperacao.Margin = new System.Windows.Forms.Padding(2);
this.btnIniciarOperacao.Name = "btnIniciarOperacao";
this.btnIniciarOperacao.Size = new System.Drawing.Size(113, 53);
this.btnIniciarOperacao.TabIndex = 25;
@ -194,17 +159,17 @@
//
this.chartGraficos.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
chartArea3.Name = "ChartArea1";
this.chartGraficos.ChartAreas.Add(chartArea3);
legend3.Name = "Legend1";
this.chartGraficos.Legends.Add(legend3);
chartArea1.Name = "ChartArea1";
this.chartGraficos.ChartAreas.Add(chartArea1);
legend1.Name = "Legend1";
this.chartGraficos.Legends.Add(legend1);
this.chartGraficos.Location = new System.Drawing.Point(640, 7);
this.chartGraficos.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.chartGraficos.Margin = new System.Windows.Forms.Padding(2);
this.chartGraficos.Name = "chartGraficos";
series3.ChartArea = "ChartArea1";
series3.Legend = "Legend1";
series3.Name = "Series1";
this.chartGraficos.Series.Add(series3);
series1.ChartArea = "ChartArea1";
series1.Legend = "Legend1";
series1.Name = "Series1";
this.chartGraficos.Series.Add(series1);
this.chartGraficos.Size = new System.Drawing.Size(591, 318);
this.chartGraficos.TabIndex = 2;
this.chartGraficos.Text = "chart1";
@ -259,7 +224,7 @@
this.tabControl1.Controls.Add(this.tabDeteccoes);
this.tabControl1.Controls.Add(this.tabPulverizador);
this.tabControl1.Location = new System.Drawing.Point(640, 331);
this.tabControl1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabControl1.Margin = new System.Windows.Forms.Padding(2);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(471, 314);
@ -278,9 +243,9 @@
this.tabMapa.Controls.Add(this.pnlAnguloMagnetometro);
this.tabMapa.Controls.Add(this.lblMagnetometro);
this.tabMapa.Location = new System.Drawing.Point(4, 22);
this.tabMapa.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabMapa.Margin = new System.Windows.Forms.Padding(2);
this.tabMapa.Name = "tabMapa";
this.tabMapa.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabMapa.Padding = new System.Windows.Forms.Padding(2);
this.tabMapa.Size = new System.Drawing.Size(463, 288);
this.tabMapa.TabIndex = 0;
this.tabMapa.Text = "Mapa";
@ -328,7 +293,7 @@
// pnlMapa
//
this.pnlMapa.Location = new System.Drawing.Point(104, 2);
this.pnlMapa.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pnlMapa.Margin = new System.Windows.Forms.Padding(2);
this.pnlMapa.Name = "pnlMapa";
this.pnlMapa.Size = new System.Drawing.Size(359, 286);
this.pnlMapa.TabIndex = 0;
@ -349,7 +314,7 @@
this.pnlAnguloGPS.BackgroundImage = global::AgroBase.Properties.Resources.rosa_dos_ventos;
this.pnlAnguloGPS.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pnlAnguloGPS.Location = new System.Drawing.Point(7, 18);
this.pnlAnguloGPS.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pnlAnguloGPS.Margin = new System.Windows.Forms.Padding(2);
this.pnlAnguloGPS.Name = "pnlAnguloGPS";
this.pnlAnguloGPS.Size = new System.Drawing.Size(78, 84);
this.pnlAnguloGPS.TabIndex = 18;
@ -361,7 +326,7 @@
this.pnlAnguloMagnetometro.BackgroundImage = global::AgroBase.Properties.Resources.rosa_dos_ventos;
this.pnlAnguloMagnetometro.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pnlAnguloMagnetometro.Location = new System.Drawing.Point(7, 203);
this.pnlAnguloMagnetometro.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pnlAnguloMagnetometro.Margin = new System.Windows.Forms.Padding(2);
this.pnlAnguloMagnetometro.Name = "pnlAnguloMagnetometro";
this.pnlAnguloMagnetometro.Size = new System.Drawing.Size(78, 84);
this.pnlAnguloMagnetometro.TabIndex = 20;
@ -381,9 +346,9 @@
//
this.tabInformacoes.Controls.Add(this.gridDados);
this.tabInformacoes.Location = new System.Drawing.Point(4, 22);
this.tabInformacoes.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabInformacoes.Margin = new System.Windows.Forms.Padding(2);
this.tabInformacoes.Name = "tabInformacoes";
this.tabInformacoes.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabInformacoes.Padding = new System.Windows.Forms.Padding(2);
this.tabInformacoes.Size = new System.Drawing.Size(463, 288);
this.tabInformacoes.TabIndex = 1;
this.tabInformacoes.Text = "Informações";
@ -394,7 +359,7 @@
this.gridDados.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridDados.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridDados.Location = new System.Drawing.Point(2, 2);
this.gridDados.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.gridDados.Margin = new System.Windows.Forms.Padding(2);
this.gridDados.Name = "gridDados";
this.gridDados.RowHeadersWidth = 51;
this.gridDados.RowTemplate.Height = 24;
@ -405,9 +370,9 @@
//
this.tabDeteccoes.Controls.Add(this.pnlDeteccoesRua);
this.tabDeteccoes.Location = new System.Drawing.Point(4, 22);
this.tabDeteccoes.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabDeteccoes.Margin = new System.Windows.Forms.Padding(2);
this.tabDeteccoes.Name = "tabDeteccoes";
this.tabDeteccoes.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabDeteccoes.Padding = new System.Windows.Forms.Padding(2);
this.tabDeteccoes.Size = new System.Drawing.Size(463, 288);
this.tabDeteccoes.TabIndex = 2;
this.tabDeteccoes.Text = "Detecção rua";
@ -418,7 +383,7 @@
this.pnlDeteccoesRua.Controls.Add(this.picSonar);
this.pnlDeteccoesRua.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlDeteccoesRua.Location = new System.Drawing.Point(2, 2);
this.pnlDeteccoesRua.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pnlDeteccoesRua.Margin = new System.Windows.Forms.Padding(2);
this.pnlDeteccoesRua.Name = "pnlDeteccoesRua";
this.pnlDeteccoesRua.Size = new System.Drawing.Size(459, 284);
this.pnlDeteccoesRua.TabIndex = 0;
@ -426,7 +391,7 @@
// picSonar
//
this.picSonar.Location = new System.Drawing.Point(13, 13);
this.picSonar.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.picSonar.Margin = new System.Windows.Forms.Padding(2);
this.picSonar.Name = "picSonar";
this.picSonar.Size = new System.Drawing.Size(434, 260);
this.picSonar.TabIndex = 0;
@ -439,9 +404,9 @@
this.tabPulverizador.Controls.Add(this.btnDesligarBomba);
this.tabPulverizador.Controls.Add(this.btnLigarBomba);
this.tabPulverizador.Location = new System.Drawing.Point(4, 22);
this.tabPulverizador.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabPulverizador.Margin = new System.Windows.Forms.Padding(2);
this.tabPulverizador.Name = "tabPulverizador";
this.tabPulverizador.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabPulverizador.Padding = new System.Windows.Forms.Padding(2);
this.tabPulverizador.Size = new System.Drawing.Size(463, 288);
this.tabPulverizador.TabIndex = 3;
this.tabPulverizador.Text = "Pulverizador";
@ -462,7 +427,7 @@
//
this.nudPressaoSP.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.nudPressaoSP.Location = new System.Drawing.Point(18, 27);
this.nudPressaoSP.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.nudPressaoSP.Margin = new System.Windows.Forms.Padding(2);
this.nudPressaoSP.Maximum = new decimal(new int[] {
200,
0,
@ -478,7 +443,7 @@
//
this.btnDesligarBomba.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnDesligarBomba.Location = new System.Drawing.Point(244, 17);
this.btnDesligarBomba.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnDesligarBomba.Margin = new System.Windows.Forms.Padding(2);
this.btnDesligarBomba.Name = "btnDesligarBomba";
this.btnDesligarBomba.Size = new System.Drawing.Size(104, 28);
this.btnDesligarBomba.TabIndex = 27;
@ -490,7 +455,7 @@
//
this.btnLigarBomba.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnLigarBomba.Location = new System.Drawing.Point(118, 17);
this.btnLigarBomba.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnLigarBomba.Margin = new System.Windows.Forms.Padding(2);
this.btnLigarBomba.Name = "btnLigarBomba";
this.btnLigarBomba.Size = new System.Drawing.Size(104, 28);
this.btnLigarBomba.TabIndex = 26;
@ -500,25 +465,12 @@
//
// pnlCameraRua
//
this.pnlCameraRua.Controls.Add(this.picCameraRua);
this.pnlCameraRua.Location = new System.Drawing.Point(140, 23);
this.pnlCameraRua.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pnlCameraRua.Margin = new System.Windows.Forms.Padding(2);
this.pnlCameraRua.Name = "pnlCameraRua";
this.pnlCameraRua.Size = new System.Drawing.Size(357, 286);
this.pnlCameraRua.TabIndex = 22;
//
// picCameraRua
//
this.picCameraRua.BackColor = System.Drawing.SystemColors.ButtonFace;
this.picCameraRua.Dock = System.Windows.Forms.DockStyle.Fill;
this.picCameraRua.Location = new System.Drawing.Point(0, 0);
this.picCameraRua.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.picCameraRua.Name = "picCameraRua";
this.picCameraRua.Size = new System.Drawing.Size(357, 286);
this.picCameraRua.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picCameraRua.TabIndex = 0;
this.picCameraRua.TabStop = false;
//
// pnlDir_EF
//
this.pnlDir_EF.Controls.Add(this.chbLivre_EF);
@ -526,7 +478,7 @@
this.pnlDir_EF.Controls.Add(this.btnRef_EF);
this.pnlDir_EF.Controls.Add(this.lblDir_EF);
this.pnlDir_EF.Location = new System.Drawing.Point(0, 0);
this.pnlDir_EF.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pnlDir_EF.Margin = new System.Windows.Forms.Padding(2);
this.pnlDir_EF.Name = "pnlDir_EF";
this.pnlDir_EF.Size = new System.Drawing.Size(150, 162);
this.pnlDir_EF.TabIndex = 23;
@ -536,7 +488,7 @@
this.chbLivre_EF.AutoSize = true;
this.chbLivre_EF.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.chbLivre_EF.Location = new System.Drawing.Point(101, 144);
this.chbLivre_EF.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.chbLivre_EF.Margin = new System.Windows.Forms.Padding(2);
this.chbLivre_EF.Name = "chbLivre_EF";
this.chbLivre_EF.Size = new System.Drawing.Size(49, 17);
this.chbLivre_EF.TabIndex = 17;
@ -547,7 +499,7 @@
//
this.chbCmd_EF.AutoSize = true;
this.chbCmd_EF.Location = new System.Drawing.Point(3, 144);
this.chbCmd_EF.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.chbCmd_EF.Margin = new System.Windows.Forms.Padding(2);
this.chbCmd_EF.Name = "chbCmd_EF";
this.chbCmd_EF.Size = new System.Drawing.Size(68, 17);
this.chbCmd_EF.TabIndex = 15;
@ -557,7 +509,7 @@
// btnRef_EF
//
this.btnRef_EF.Location = new System.Drawing.Point(111, 2);
this.btnRef_EF.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnRef_EF.Margin = new System.Windows.Forms.Padding(2);
this.btnRef_EF.Name = "btnRef_EF";
this.btnRef_EF.Size = new System.Drawing.Size(37, 19);
this.btnRef_EF.TabIndex = 13;
@ -571,7 +523,7 @@
this.pnlDir_ET.Controls.Add(this.btnRef_ET);
this.pnlDir_ET.Controls.Add(this.lblDir_ET);
this.pnlDir_ET.Location = new System.Drawing.Point(0, 162);
this.pnlDir_ET.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pnlDir_ET.Margin = new System.Windows.Forms.Padding(2);
this.pnlDir_ET.Name = "pnlDir_ET";
this.pnlDir_ET.Size = new System.Drawing.Size(150, 162);
this.pnlDir_ET.TabIndex = 24;
@ -581,7 +533,7 @@
this.chbLivre_ET.AutoSize = true;
this.chbLivre_ET.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.chbLivre_ET.Location = new System.Drawing.Point(101, 144);
this.chbLivre_ET.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.chbLivre_ET.Margin = new System.Windows.Forms.Padding(2);
this.chbLivre_ET.Name = "chbLivre_ET";
this.chbLivre_ET.Size = new System.Drawing.Size(49, 17);
this.chbLivre_ET.TabIndex = 16;
@ -592,7 +544,7 @@
//
this.chbCmd_ET.AutoSize = true;
this.chbCmd_ET.Location = new System.Drawing.Point(3, 144);
this.chbCmd_ET.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.chbCmd_ET.Margin = new System.Windows.Forms.Padding(2);
this.chbCmd_ET.Name = "chbCmd_ET";
this.chbCmd_ET.Size = new System.Drawing.Size(68, 17);
this.chbCmd_ET.TabIndex = 15;
@ -602,7 +554,7 @@
// btnRef_ET
//
this.btnRef_ET.Location = new System.Drawing.Point(111, 2);
this.btnRef_ET.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnRef_ET.Margin = new System.Windows.Forms.Padding(2);
this.btnRef_ET.Name = "btnRef_ET";
this.btnRef_ET.Size = new System.Drawing.Size(37, 19);
this.btnRef_ET.TabIndex = 13;
@ -616,7 +568,7 @@
this.pnlDir_DT.Controls.Add(this.btnRef_DT);
this.pnlDir_DT.Controls.Add(this.lblDir_DT);
this.pnlDir_DT.Location = new System.Drawing.Point(486, 162);
this.pnlDir_DT.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pnlDir_DT.Margin = new System.Windows.Forms.Padding(2);
this.pnlDir_DT.Name = "pnlDir_DT";
this.pnlDir_DT.Size = new System.Drawing.Size(150, 162);
this.pnlDir_DT.TabIndex = 24;
@ -626,7 +578,7 @@
this.chbLivre_DT.AutoSize = true;
this.chbLivre_DT.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.chbLivre_DT.Location = new System.Drawing.Point(101, 144);
this.chbLivre_DT.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.chbLivre_DT.Margin = new System.Windows.Forms.Padding(2);
this.chbLivre_DT.Name = "chbLivre_DT";
this.chbLivre_DT.Size = new System.Drawing.Size(49, 17);
this.chbLivre_DT.TabIndex = 19;
@ -637,7 +589,7 @@
//
this.chbCmd_DT.AutoSize = true;
this.chbCmd_DT.Location = new System.Drawing.Point(3, 144);
this.chbCmd_DT.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.chbCmd_DT.Margin = new System.Windows.Forms.Padding(2);
this.chbCmd_DT.Name = "chbCmd_DT";
this.chbCmd_DT.Size = new System.Drawing.Size(68, 17);
this.chbCmd_DT.TabIndex = 13;
@ -647,7 +599,7 @@
// btnRef_DT
//
this.btnRef_DT.Location = new System.Drawing.Point(111, 2);
this.btnRef_DT.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnRef_DT.Margin = new System.Windows.Forms.Padding(2);
this.btnRef_DT.Name = "btnRef_DT";
this.btnRef_DT.Size = new System.Drawing.Size(37, 19);
this.btnRef_DT.TabIndex = 12;
@ -661,7 +613,7 @@
this.pnlDir_DF.Controls.Add(this.btnRef_DF);
this.pnlDir_DF.Controls.Add(this.lblDir_DF);
this.pnlDir_DF.Location = new System.Drawing.Point(486, 0);
this.pnlDir_DF.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pnlDir_DF.Margin = new System.Windows.Forms.Padding(2);
this.pnlDir_DF.Name = "pnlDir_DF";
this.pnlDir_DF.Size = new System.Drawing.Size(150, 162);
this.pnlDir_DF.TabIndex = 24;
@ -671,7 +623,7 @@
this.chbLivre_DF.AutoSize = true;
this.chbLivre_DF.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.chbLivre_DF.Location = new System.Drawing.Point(101, 144);
this.chbLivre_DF.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.chbLivre_DF.Margin = new System.Windows.Forms.Padding(2);
this.chbLivre_DF.Name = "chbLivre_DF";
this.chbLivre_DF.Size = new System.Drawing.Size(49, 17);
this.chbLivre_DF.TabIndex = 18;
@ -682,7 +634,7 @@
//
this.chbCmd_DF.AutoSize = true;
this.chbCmd_DF.Location = new System.Drawing.Point(3, 144);
this.chbCmd_DF.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.chbCmd_DF.Margin = new System.Windows.Forms.Padding(2);
this.chbCmd_DF.Name = "chbCmd_DF";
this.chbCmd_DF.Size = new System.Drawing.Size(68, 17);
this.chbCmd_DF.TabIndex = 14;
@ -692,7 +644,7 @@
// btnRef_DF
//
this.btnRef_DF.Location = new System.Drawing.Point(111, 2);
this.btnRef_DF.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnRef_DF.Margin = new System.Windows.Forms.Padding(2);
this.btnRef_DF.Name = "btnRef_DF";
this.btnRef_DF.Size = new System.Drawing.Size(37, 19);
this.btnRef_DF.TabIndex = 13;
@ -725,7 +677,7 @@
//
this.chbSonar.AutoSize = true;
this.chbSonar.Location = new System.Drawing.Point(227, 311);
this.chbSonar.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.chbSonar.Margin = new System.Windows.Forms.Padding(2);
this.chbSonar.Name = "chbSonar";
this.chbSonar.Size = new System.Drawing.Size(183, 17);
this.chbSonar.TabIndex = 28;
@ -810,17 +762,13 @@
this.Controls.Add(this.chartGraficos);
this.Controls.Add(this.pnlAtuadores);
this.Controls.Add(this.pnlCamerasSolo);
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "frmOperacaoManual";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Operação Manual";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmOperacaoManual_FormClosing);
this.Load += new System.EventHandler(this.frmOperacaoManual_Load);
this.pnlCamerasSolo.ResumeLayout(false);
this.pnlCameraSoloE.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.picCameraSoloE)).EndInit();
this.pnlCameraSoloD.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.picCameraSoloD)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.chartGraficos)).EndInit();
this.tabControl1.ResumeLayout(false);
this.tabMapa.ResumeLayout(false);
@ -833,8 +781,6 @@
this.tabPulverizador.ResumeLayout(false);
this.tabPulverizador.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudPressaoSP)).EndInit();
this.pnlCameraRua.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.picCameraRua)).EndInit();
this.pnlDir_EF.ResumeLayout(false);
this.pnlDir_EF.PerformLayout();
this.pnlDir_ET.ResumeLayout(false);
@ -875,10 +821,7 @@
private System.Windows.Forms.Panel pnlDir_ET;
private System.Windows.Forms.Panel pnlDir_DT;
private System.Windows.Forms.Panel pnlDir_DF;
private System.Windows.Forms.PictureBox picCameraRua;
private System.Windows.Forms.Button btnIniciarOperacao;
private System.Windows.Forms.PictureBox picCameraSoloE;
private System.Windows.Forms.PictureBox picCameraSoloD;
private System.Windows.Forms.TabPage tabPulverizador;
private System.Windows.Forms.Label lblPressaoSP;
private System.Windows.Forms.NumericUpDown nudPressaoSP;

View File

@ -46,8 +46,9 @@ namespace AgroBase.Forms.Operacoes
private void frmOperacaoManual_Load(object sender, EventArgs e)
{
Variaveis.OperacaoEmAndamento.AtualizaListaCameras(pnlCameraRua, new List<Panel>() { pnlCameraSoloE, pnlCameraSoloD }, true);
InicializarComandosDirecional();
IniciarCameras();
PopularInformacoesGerais();
InicializarMapa();
PopularBicos();
@ -62,19 +63,7 @@ namespace AgroBase.Forms.Operacoes
{
tmrLeitura.Stop();
tmrLeitura.Dispose();
Variaveis.OperacaoEmAndamento.Mapa.PararProcessamento();
if (videoSourceRua != null)
{
videoSourceRua.Stop();
}
if (videoSourceSoloD != null)
{
videoSourceSoloD.Stop();
}
if (videoSourceSoloE != null)
{
videoSourceSoloE.Stop();
}
Variaveis.OperacaoEmAndamento.FinalizarOperacao();
}
private void btnIniciarOperacao_Click(object sender, EventArgs e)
@ -369,65 +358,6 @@ namespace AgroBase.Forms.Operacoes
#endregion
#region Cameras
private FilterInfoCollection videoDevices;
private VideoCaptureDevice videoSourceRua;
private VideoCaptureDevice videoSourceSoloE;
private VideoCaptureDevice videoSourceSoloD;
private void IniciarCameras()
{
videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
List<string> CamerasIDs = new List<string>();
foreach (FilterInfo info in videoDevices)
{
CamerasIDs.Add(info.MonikerString.ToLower());
}
string IDcamRua = Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_Caminho?.ToLower().Replace("\\", "#");
if (!string.IsNullOrEmpty(IDcamRua) && CamerasIDs.Any(x => x.Contains(IDcamRua)))
{
videoSourceRua = new VideoCaptureDevice(CamerasIDs.First(x => x.Contains(IDcamRua)));
videoSourceRua.NewFrame += new NewFrameEventHandler(videoSourceRua_NewFrame);
videoSourceRua.Start();
}
string IDcamSoloE = Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_SoloE?.ToLower().Replace("\\", "#");
if (!string.IsNullOrEmpty(IDcamSoloE) && CamerasIDs.Any(x => x.Contains(IDcamSoloE)))
{
videoSourceSoloE = new VideoCaptureDevice(CamerasIDs.First(x => x.Contains(IDcamSoloE)));
videoSourceSoloE.NewFrame += new NewFrameEventHandler(videoSourceSoloE_NewFrame);
videoSourceSoloE.Start();
}
string IDcamSoloD = Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_SoloD?.ToLower().Replace("\\", "#");
if (!string.IsNullOrEmpty(IDcamSoloD) && CamerasIDs.Any(x => x.Contains(IDcamSoloD)))
{
videoSourceSoloD = new VideoCaptureDevice(CamerasIDs.First(x => x.Contains(IDcamSoloD)));
videoSourceSoloD.NewFrame += new NewFrameEventHandler(videoSourceSoloD_NewFrame);
videoSourceSoloD.Start();
}
}
private void videoSourceRua_NewFrame(object sender, NewFrameEventArgs eventArgs)
{
Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone();
Variaveis.OperacaoEmAndamento.DispSen.Dados.ultimoFrameCaminho = bitmap;
picCameraRua.Image = bitmap;
}
private void videoSourceSoloE_NewFrame(object sender, NewFrameEventArgs eventArgs)
{
Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone();
Variaveis.OperacaoEmAndamento.DispSen.Dados.ultimoFrameSoloE = bitmap;
picCameraSoloE.Image = bitmap;
}
private void videoSourceSoloD_NewFrame(object sender, NewFrameEventArgs eventArgs)
{
Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone();
Variaveis.OperacaoEmAndamento.DispSen.Dados.ultimoFrameSoloD = bitmap;
picCameraSoloD.Image = bitmap;
}
#endregion
#region Angulo orientacao Magnetica
private void pnlAnguloGPS_Paint(object sender, PaintEventArgs e)
@ -685,7 +615,7 @@ namespace AgroBase.Forms.Operacoes
private void PopularBicos()
{
var Atuador = Variaveis.OperacaoEmAndamento.DispAtu;
nudPressaoSP.Value = Convert.ToInt32(Atuador.Dados.BombaPressurizadora.PressaoSP);
nudPressaoSP.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.PressaoLinha);
int panelWidth = pnlAtuadores.Width;
int circleDiameter = 40; // Diâmetro dos círculos grandes
@ -753,7 +683,7 @@ namespace AgroBase.Forms.Operacoes
private void nudPressaoSP_ValueChanged(object sender, EventArgs e)
{
Variaveis.OperacaoEmAndamento.DispAtu.Dados.BombaPressurizadora.PressaoSP = Convert.ToInt32(((NumericUpDown)sender).Value);
Variaveis.OperacaoEmAndamento.Controle.PressaoLinha = Convert.ToInt32(((NumericUpDown)sender).Value);
EnviarProtocoloComandoBomba();
}

View File

@ -19,8 +19,6 @@ using System.Management;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using static AgroBase.Models.Enuns;
namespace AgroBase.Forms.Operacoes
{
@ -54,18 +52,12 @@ namespace AgroBase.Forms.Operacoes
tmrLeituras.Start();
AtualizarDispositivos();
AtualizaListaCameras();
nudPressaoSP.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.DispAtu.Dados.BombaPressurizadora.PressaoSP);
Variaveis.OperacaoEmAndamento.AtualizaListaCameras(pnlCameraCaminho, new List<Panel>() { pnlCameraSoloE, pnlCameraSoloD }, true);
}
private void frmOperacaoMapaGPS_FormClosing(object sender, FormClosingEventArgs e)
{
tmrLeituras.Stop();
Variaveis.OperacaoEmAndamento.CamerasSolo.ForEach(Camera =>
{
DesligarCameraSolo(Camera);
});
DesligarCameraCaminho(Variaveis.OperacaoEmAndamento.CameraCaminho);
Variaveis.OperacaoEmAndamento.FinalizarOperacao();
}
@ -75,8 +67,7 @@ namespace AgroBase.Forms.Operacoes
chbDIRativo.Checked = Variaveis.OperacaoEmAndamento.DispMvd != null && Variaveis.OperacaoEmAndamento.DispMvd._Porta.IsOpen && Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.Any(x => x.DirMotor.Inicializado);
chbATUativo.Checked = Variaveis.OperacaoEmAndamento.DispAtu != null && Variaveis.OperacaoEmAndamento.DispAtu._Porta.IsOpen;
chbGPSativo.Checked = GPSService.PortaGPS != null && GPSService.PortaGPS.IsOpen;
AtualizarGrafico();
Variaveis.OperacaoEmAndamento.chartGraficos = chartGraficos;
}
#endregion
@ -85,265 +76,22 @@ namespace AgroBase.Forms.Operacoes
private void TmrLeituras_Tick(object sender, EventArgs e)
{
if (Variaveis.OperacaoEmAndamento.Iniciado)
{
Variaveis.OperacaoEmAndamento.CamerasSolo.Where(x => x.Iniciada).ToList().ForEach(CameraSolo =>
{
try
{
AtualizaLeituraCameraSolo(CameraSolo);
}
catch
{
}
});
Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ErvasNoRadar = Variaveis.OperacaoEmAndamento.CamerasSolo.Sum(x => x.ErvasNoRadar);
try
{
AtualizaLeituraCameraCaminho();
}
catch
{
}
}
else
{
Variaveis.OperacaoEmAndamento.OpMapaGPS.AtualizarRuasSelecionadas();
}
AtualizaInformacoesControleOperacao();
AtualizarGrafico();
AtualizarInformacoesGerais();
pnlOrientacao.Invalidate();
pnlInclinacao.Invalidate();
pnlAtuadores.Invalidate();
pnlCaminho.Invalidate();
pnlAnguloCamera.Invalidate();
var ultimaLeitura = Variaveis.OperacaoEmAndamento.CamerasSolo.OrderByDescending(x => x.Leitura.timestamp).FirstOrDefault();
if (ultimaLeitura != null)
{
lblUltimaLeituraSolo.Text = "Ultima Leitura Solo: " + FuncoesGlobais.TimestampToDate(ultimaLeitura.Leitura.timestamp);
}
lblUltimaLeituraRua.Text = "Ultima Leitura Rua: " + FuncoesGlobais.TimestampToDate(Variaveis.OperacaoEmAndamento.CameraCaminho.Leitura.timestamp);
btnCarregarMapa.Enabled = !Variaveis.OperacaoEmAndamento.Iniciado;
nudPressaoSP.Enabled = !Variaveis.OperacaoEmAndamento.Iniciado;
if (!Variaveis.OperacaoEmAndamento.Iniciado && btnIniciarOperacao.Text == "Finalizar Operação")
{
AtualizaComponentesOperacao();
}
}
private void AtualizaLeituraCameraSolo(CameraSoloModel CameraSolo)
{
if (CameraSolo.camera._mqttTopico != null && CameraSolo.camera._mqttTopico.Mensagens.Any(x => x.Momento > CameraSolo.camera.IniciadoEm))
{
try
{
var Mensagem = CameraSolo.camera._mqttTopico.Mensagens.LastOrDefault(x => x.Momento > CameraSolo.camera.IniciadoEm);
if (Mensagem != null)
{
CameraSolo.Leitura = JsonConvert.DeserializeObject<CameraCoordenadasFrameModel>(Mensagem.Mensagem);
}
}
catch
{
}
var Atuador = Variaveis.OperacaoEmAndamento.DispAtu;
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 inicioBarraPulverizadora = Convert.ToInt32(CameraSolo.Leitura.y_max * (1 - Atuador.Dados.PercentualInicioPulverizacao));
List<bool> BicosAnteriores = new List<bool>();
// Inicialize todos os bicos como inativos antes de verificar os objetos verdes
for (int i = 0; i < BicosPorCamera; i++)
{
int iBico = i + (CameraSolo.Posicao * BicosPorCamera);
BicosAnteriores.Add(Atuador.Dados.BicosPulverizadores[iBico].Atuado ? true : false);
Atuador.Dados.BicosPulverizadores[iBico].Atuado = false;
}
foreach (var verde in Verdes)
{
// Calcule a posição final (y + altura) do objeto verde
int posicaoFinalVerdeY = verde.y + verde.altura;
if (posicaoFinalVerdeY > inicioBarraPulverizadora)
{
// Calcule a posição final (x + largura) do objeto verde
int posicaoFinalVerdeX = verde.x + verde.largura;
// Para cada objeto verde, verifique se ele está dentro do intervalo de algum bico e atue-o
for (int i = 0; i < BicosPorCamera; i++)
{
// Determina o intervalo no eixo x para o bico atual
int limiteInferior = intervaloPorBico * i;
int limiteSuperior = limiteInferior + intervaloPorBico;
// Verifica se o objeto 'verde' está dentro do intervalo deste bico
// A condição foi ajustada para verificar se qualquer parte do objeto verde cruza com o intervalo do bico
if (verde.x < limiteSuperior && posicaoFinalVerdeX > limiteInferior)
{
int iBico = i + (CameraSolo.Posicao * BicosPorCamera);
Atuador.Dados.BicosPulverizadores[iBico].Atuado = true;
}
}
}
}
CameraSolo.ErvasNoRadar = Verdes.Count();
for (int i = 0; i < BicosPorCamera; i++)
{
int iBico = i + (CameraSolo.Posicao * BicosPorCamera);
if (Atuador.Dados.BicosPulverizadores[iBico].Atuado && BicosAnteriores[i] != Atuador.Dados.BicosPulverizadores[iBico].Atuado)
{
Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico[iBico]++;
}
}
lblUltimaLeituraSolo.Text = "Ultima Leitura Solo: " + FuncoesGlobais.TimestampToDate(CameraSolo.Leitura.timestamp);
AtualizaInformacoesControleOperacao();
}
}
private void AtualizaLeituraCameraCaminho()
{
try
{
var cameraCaminho = Variaveis.OperacaoEmAndamento.CameraCaminho;
var MqttTopico = Variaveis.MqttService.Topicos.FirstOrDefault(x => x.Topico == cameraCaminho.MqttTopico);
if (MqttTopico != null && MqttTopico.Mensagens.Any(x => x.Momento > cameraCaminho.camera.IniciadoEm))
{
try
{
var Mensagem = MqttTopico.Mensagens.LastOrDefault(x => x.Momento > cameraCaminho.camera.IniciadoEm);
if (Mensagem != null)
{
cameraCaminho.Leitura = JsonConvert.DeserializeObject<CameraDeepLabV3PlusModel>(Mensagem.Mensagem);
}
}
catch
{
}
}
//var contornosJson = File.ReadAllText("Python/Output/" + cameraCaminho.ArquivoLeitura);
//cameraCaminho.Leituras = JsonConvert.DeserializeObject<CameraDeepLabV3PlusModel[]>(contornosJson).ToList();
pnlCaminho.Invalidate();
if (cameraCaminho.PontosExtremos.Any())
{
double esq_CA = cameraCaminho.PontosExtremos[2].X - cameraCaminho.PontosExtremos[1].X;
double esq_CO = cameraCaminho.PontosExtremos[1].Y - cameraCaminho.PontosExtremos[2].Y;
double esq_AG = Math.Atan(esq_CO / esq_CA) * (180 / Math.PI);
double dir_CA = cameraCaminho.PontosExtremos[4].X - cameraCaminho.PontosExtremos[3].X;
double dir_CO = cameraCaminho.PontosExtremos[4].Y - cameraCaminho.PontosExtremos[3].Y;
double dir_AG = Math.Atan(dir_CO / dir_CA) * (180 / Math.PI);
cameraCaminho.Angulo = dir_AG - esq_AG;
cameraCaminho.AnguloDireito = dir_AG;
cameraCaminho.AnguloEsquerdo = esq_AG;
}
else
{
cameraCaminho.Angulo = 0;
cameraCaminho.AnguloDireito = 0;
cameraCaminho.AnguloEsquerdo = 0;
}
Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AnguloRuaCamera = cameraCaminho.Angulo;
pnlAnguloCamera.Invalidate();
lblUltimaLeituraRua.Text = "Ultima Leitura Rua: " + FuncoesGlobais.TimestampToDate(cameraCaminho.Leitura.timestamp);
AtualizaInformacoesControleOperacao();
}
catch (Exception ex)
{
Console.WriteLine("Erro ao receber dados da Camera Caminho: " + ex.Message);
}
}
private void AtualizaInformacoesControleOperacao()
{
Variaveis.OperacaoEmAndamento.OpMapaGPS.AtualizarControleAtuadores();
Variaveis.OperacaoEmAndamento.OpMapaGPS.CalculaDadosMovimentacaoAutonoma();
Variaveis.OperacaoEmAndamento.OpMapaGPS.AtualizarDadosControle();
}
private void AtualizarGrafico()
{
MvdMotorMOVSensorimanetoGrafico Log = null;
// Primeiro, coletar todos os logs alinhados por índice em uma lista de tuplas (index, moduloLog)
var Logs = Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos
.SelectMany(m => m.MovMotor.LogGrafico.Select((log, index) => new { Index = index, Log = log }))
.GroupBy(x => x.Index) // Agrupa por índice
.OrderBy(g => g.Key) // Ordena pelos índices (opcional, mas ajuda na leitura)
.Select(g => new MvdMotorMOVSensorimanetoGrafico()
{
// Calcula a média de cada propriedade no grupo
Momento = new DateTime((long)g.Average(x => x.Log.Momento.Ticks)),
Velocidade = g.Average(x => x.Log.Velocidade),
RPM = Convert.ToInt32(g.Average(x => x.Log.RPM)),
RPM_SP = Convert.ToInt32(g.Average(x => x.Log.RPM_SP)),
Temperatura = g.Average(x => x.Log.Temperatura),
Tensao = g.Average(x => x.Log.Tensao),
})
.ToList();
if (Logs.Count > 0)
{
Log = Logs.Last();
}
double Minimo = 0;
double Maximo = 0;
Chart chart = chartGraficos;
chart.Titles.Clear();
chart.Titles.Add("Acompanhamento");
//var Logs = (Motor.LogGrafico.Count > MovimentacaoModel.LogsManter ? Motor.LogGrafico.Skip(Math.Max(0, Motor.LogGrafico.Count - MovimentacaoModel.LogsManter)).Take(MovimentacaoModel.LogsManter).ToList() : Motor.LogGrafico).Where(log => log.Modulo_ID == Modulo.Modulo_ID).ToList();
chart.Series.Clear();
List<string> Momentos = Logs.Select(x => x.Momento.ToString("mm:ss:fff")).ToList();
var serieVelocidade = new Series("Velocidade: " + (Log != null ? Log.Velocidade : 0));
serieVelocidade.Points.DataBindXY(Momentos, Logs.Select(x => x.Velocidade).ToList());
serieVelocidade.ChartType = SeriesChartType.Line;
chart.Series.Add(serieVelocidade);
Minimo = Logs.Min(x => x.Velocidade) < Minimo ? Logs.Min(x => x.Velocidade) : Minimo;
Maximo = Logs.Min(x => x.Velocidade) > Maximo ? Logs.Min(x => x.Velocidade) : Maximo;
var serieRPMsp = new Series("RPM SP: " + (Log != null ? Log.RPM_SP : 0));
serieRPMsp.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM_SP).ToList());
serieRPMsp.ChartType = SeriesChartType.Spline;
chart.Series.Add(serieRPMsp);
Minimo = Logs.Min(x => x.RPM_SP) < Minimo ? Logs.Min(x => x.RPM_SP) : Minimo;
Maximo = Logs.Max(x => x.RPM_SP) > Maximo ? Logs.Max(x => x.RPM_SP) : Maximo;
var serieTemperatura = new Series("Temperatura: " + (Log != null ? Log.Temperatura : 0));
serieTemperatura.Points.DataBindXY(Momentos, Logs.Select(x => x.Temperatura).ToList());
serieTemperatura.ChartType = SeriesChartType.Line;
chart.Series.Add(serieTemperatura);
Minimo = Logs.Min(x => x.Temperatura) < Minimo ? Logs.Min(x => x.Temperatura) : Minimo;
Maximo = Logs.Max(x => x.Temperatura) > Maximo ? Logs.Max(x => x.Temperatura) : Maximo;
foreach (var legend in chart.Legends)
{
legend.Docking = Docking.Bottom;
}
chart.ChartAreas[0].AxisY.Minimum = Minimo - 5;
chart.ChartAreas[0].AxisY.Maximum = Maximo + 5;
}
private void AtualizarInformacoesGerais()
{
this.Text = Variaveis.OperacaoEmAndamento.TextoFormOperacao("Mapa GPS");
//lblDistanciaEsquerda.Text = "Distancia da Esquerda: " + Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaEsquerda.ToString("0.00") + " cm";
@ -371,232 +119,12 @@ namespace AgroBase.Forms.Operacoes
lblPorcentagemProgressoRua.Text = (Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoRua < 0 ? 0 : Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoRua).ToString("00.00") + "%";
lblDistancia.Text = "Distância Operação: " + (Variaveis.OperacaoEmAndamento.Mapa == null ? 0 : Variaveis.OperacaoEmAndamento.Mapa.DistanciaTotal).ToString("00.00") + " m";
lblPerformance.Text = Variaveis.OperacaoEmAndamento.PerformanceStr;
AtualizarDadosPerformance();
}
PerformanceCounter cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");
PerformanceCounter ramCounter = new PerformanceCounter("Memory", "Available MBytes");
DateTime UltimaLeituraCPU = DateTime.Now;
float cpuUsage = 0;
public void AtualizarDadosPerformance()
{
// Obter memória total
ObjectQuery wql = new ObjectQuery("SELECT * FROM Win32_ComputerSystem");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(wql);
ManagementObjectCollection results = searcher.Get();
double totalMemory = 0;
foreach (ManagementObject result in results)
if (!Variaveis.OperacaoEmAndamento.Iniciado && btnIniciarOperacao.Text == "Finalizar Operação")
{
totalMemory = Convert.ToDouble(result["TotalPhysicalMemory"]);
AtualizaComponentesOperacao();
}
// Convertendo para MB
totalMemory = totalMemory / 1024 / 1024;
float availableMemory = ramCounter.NextValue();
float usedMemory = (float)totalMemory - availableMemory;
// CPU
if (DateTime.Now > UltimaLeituraCPU.AddSeconds(1))
{
cpuUsage = cpuCounter.NextValue();
UltimaLeituraCPU = DateTime.Now;
}
// RAM (usando o cálculo de porcentagem descrito anteriormente)
float memoryUsagePercentage = (usedMemory / (float)totalMemory) * 100;
// Atualizando o label (GPU não incluído devido à complexidade)
lblPerformance.Text = $"GPU: {1.ToString("0.0")}% CPU: {cpuUsage.ToString("0.0")}% RAM: {memoryUsagePercentage.ToString("0.0")}%";
}
#endregion
#region Seleção de câmeras
ComboBox cmbCameraCaminho = new ComboBox() { Name = "cmbCameraCaminho", Visible = false };
ComboBox cmbCameraSoloD = new ComboBox() { Name = "cmbCameraSoloD", Visible = false };
ComboBox cmbCameraSoloE = new ComboBox() { Name = "cmbCameraSoloE", Visible = false };
private void AtualizaListaCameras()
{
cmbCameraCaminho.SelectedIndexChanged -= cmbCameraCaminho_SelectedIndexChanged;
cmbCameraCaminho.SelectedIndexChanged += cmbCameraCaminho_SelectedIndexChanged;
cmbCameraSoloD.SelectedIndexChanged -= cmbCameraSolo_SelectedIndexChanged;
cmbCameraSoloD.SelectedIndexChanged += cmbCameraSolo_SelectedIndexChanged;
cmbCameraSoloE.SelectedIndexChanged -= cmbCameraSolo_SelectedIndexChanged;
cmbCameraSoloE.SelectedIndexChanged += cmbCameraSolo_SelectedIndexChanged;
gpbOpcoes.Controls.Add(cmbCameraCaminho);
gpbOpcoes.Controls.Add(cmbCameraSoloE);
gpbOpcoes.Controls.Add(cmbCameraSoloD);
var listaCameras = CameraService.AtualizaListaCameras().Values.ToArray();
var cameras = gpbOpcoes.Controls.OfType<ComboBox>().Where(x => x.Name.Contains("cmbCameraSolo")).OrderBy(x => x.TabIndex).ToList();
foreach (ComboBox cmb in cameras)
{
string CamNome = cmb.Name.Replace("cmbCameraSolo", "");
CameraSoloModel CameraSolo = Variaveis.OperacaoEmAndamento.CamerasSolo.FirstOrDefault(x => x.Nome == CamNome);
if (CameraSolo == null)
{
CameraSolo = new CameraSoloModel()
{
Nome = CamNome,
Posicao = Variaveis.OperacaoEmAndamento.CamerasSolo.Count(),
ArquivoLeitura = "ervas_" + CamNome + ".json",
browser = null,
camera = new CameraService(),
CameraSelecionada = "",
MaxLeituras = 10,
VideoPorta = (VariaveisPortas.CameraSolo + Variaveis.OperacaoEmAndamento.CamerasSolo.Count()).ToString(),
VideoUrl = "green_objects_" + CamNome,
MqttTopico = "green_objects_" + CamNome,
};
Variaveis.OperacaoEmAndamento.CamerasSolo.Add(CameraSolo);
}
CameraSolo.combo = cmb;
CameraSolo.panel = pnlCameraSolo.Controls.OfType<Panel>().Where(x => x.Name.Replace("pnl", "cmb") == cmb.Name).FirstOrDefault();
CameraSolo.combo.Items.Clear();
CameraSolo.combo.Items.AddRange(listaCameras);
if (CamNome == "D")
{
CameraSolo.combo.SelectedIndex = CameraSolo.combo.Items.IndexOf(Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_SoloD);
}
else if (CamNome == "E")
{
CameraSolo.combo.SelectedIndex = CameraSolo.combo.Items.IndexOf(Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_SoloE);
}
else
{
CameraSolo.combo.SelectedIndex = CameraSolo.camera.selectedCamera;
}
}
if (Variaveis.OperacaoEmAndamento.CameraCaminho == null)
{
Variaveis.OperacaoEmAndamento.CameraCaminho = new CameraCaminhoModel()
{
Nome = "Caminho",
Posicao = 0,
ArquivoLeitura = "leitura_ruas.json",
browser = null,
camera = new CameraService(),
CameraSelecionada = "",
combo = cmbCameraCaminho,
MaxLeituras = 1,
VideoPorta = (VariaveisPortas.CameraCaminho + 0).ToString(),
VideoUrl = "street_detector",
MqttTopico = "street_detector",
panel = pnlCameraCaminho,
Angulo = 0,
AnguloDireito = 0,
AnguloEsquerdo = 0,
Leitura = new CameraDeepLabV3PlusModel(),
PontosExtremos = new List<Point>()
};
}
cmbCameraCaminho.Items.Clear();
cmbCameraCaminho.Items.AddRange(listaCameras);
cmbCameraCaminho.SelectedIndex = cmbCameraCaminho.Items.IndexOf(Variaveis.OperacaoEmAndamento.DispSen.Dados.CameraID_Caminho);
//cmbCameraCaminho.SelectedIndex = Variaveis.OperacaoEmAndamento.CameraCaminho.camera.selectedCamera;
}
private void cmbCameraSolo_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox cmb = (ComboBox)sender;
string CamNome = cmb.Name.Replace("cmbCameraSolo", "");
CameraSoloModel CameraSolo = Variaveis.OperacaoEmAndamento.CamerasSolo.FirstOrDefault(x => x.Nome == CamNome);
if (CameraSolo.combo.SelectedIndex > 0 && (cmbCameraCaminho.SelectedIndex == CameraSolo.combo.SelectedIndex || Variaveis.OperacaoEmAndamento.CamerasSolo.Any(x => x.Nome != CameraSolo.Nome && x.combo.SelectedIndex == CameraSolo.combo.SelectedIndex)))
{
MessageBox.Show("Essa câmera já está sendo usada por outro processo!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Warning);
CameraSolo.combo.SelectedIndex = CameraSolo.camera.selectedCamera;
return;
}
CameraSolo.camera.selectedCamera = CameraSolo.combo.SelectedIndex;
DesligarCameraSolo(CameraSolo);
if (CameraSolo.camera.selectedCamera > 0)
{
IniciarCameraSolo(CameraSolo);
}
CameraSolo.CameraSelecionada = CameraSolo.combo.Text;
}
private void IniciarCameraSolo(CameraSoloModel CameraSolo)
{
CameraSolo.camera.IniciarCamera(
Variaveis.OperacaoEmAndamento.DispAtu.Dados.ScriptDeteccaoErvas,
new string[] {
CameraSolo.MaxLeituras.ToString(),
CameraSolo.VideoPorta,
CameraSolo.VideoUrl,
CameraSolo.ArquivoLeitura,
"1",
CameraSolo.MqttTopico
},
CameraSolo.VideoPorta,
CameraSolo.VideoUrl,
CameraSolo.MqttTopico,
CameraSolo.tmrProcesso
);
}
private void DesligarCameraSolo(CameraSoloModel CameraSolo)
{
CameraSolo.DesligarCamera();
}
private void cmbCameraCaminho_SelectedIndexChanged(object sender, EventArgs e)
{
if (Variaveis.OperacaoEmAndamento.CameraCaminho.combo.SelectedIndex > 0 && Variaveis.OperacaoEmAndamento.CamerasSolo.Any(x => x.combo.SelectedIndex == Variaveis.OperacaoEmAndamento.CameraCaminho.combo.SelectedIndex))
{
MessageBox.Show("Essa câmera já está sendo usada por outro processo!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Warning);
Variaveis.OperacaoEmAndamento.CameraCaminho.combo.SelectedIndex = Variaveis.OperacaoEmAndamento.CameraCaminho.camera.selectedCamera;
return;
}
Variaveis.OperacaoEmAndamento.CameraCaminho.camera.selectedCamera = cmbCameraCaminho.SelectedIndex;
DesligarCameraCaminho(Variaveis.OperacaoEmAndamento.CameraCaminho);
if (Variaveis.OperacaoEmAndamento.CameraCaminho.camera.selectedCamera > 0)
{
IniciarCameraCaminho(Variaveis.OperacaoEmAndamento.CameraCaminho);
}
Variaveis.OperacaoEmAndamento.CameraCaminho.CameraSelecionada = cmbCameraCaminho.Text;
}
private void IniciarCameraCaminho(CameraCaminhoModel cameraCaminho)
{
cameraCaminho.camera.IniciarCamera(
PythonService.ScriptStreetDetector,
new string[] {
cameraCaminho.MaxLeituras.ToString(),
cameraCaminho.VideoPorta,
cameraCaminho.VideoUrl,
cameraCaminho.ArquivoLeitura,
"1",
cameraCaminho.MqttTopico
},
cameraCaminho.VideoPorta,
cameraCaminho.VideoUrl,
cameraCaminho.MqttTopico,
cameraCaminho.tmrProcesso
);
}
private void DesligarCameraCaminho(CameraCaminhoModel cameraCaminho)
{
cameraCaminho.DesligarCamera();
}
#endregion
@ -629,7 +157,7 @@ namespace AgroBase.Forms.Operacoes
{
if (Variaveis.OperacaoEmAndamento.OperacaoLiberada && Variaveis.OperacaoEmAndamento.Mapa.DistanciaTotal > 0 && Variaveis.OperacaoEmAndamento.Mapa.RuasPercorrer.Any())
{
Variaveis.OperacaoEmAndamento.DispAtu.Dados.BombaPressurizadora.PressaoSP = Convert.ToDouble(nudPressaoSP.Value);
//Variaveis.OperacaoEmAndamento.DispAtu.Dados.BombaPressurizadora.PressaoSP = Convert.ToDouble(nudPressaoSP.Value);
Variaveis.OperacaoEmAndamento.IniciarOperacao(null, false);
}
else
@ -643,9 +171,6 @@ namespace AgroBase.Forms.Operacoes
private void AtualizaComponentesOperacao()
{
btnIniciarOperacao.Text = !Variaveis.OperacaoEmAndamento.Iniciado ? "Iniciar Operação" : "Finalizar Operação";
cmbCameraSoloE.Enabled = !Variaveis.OperacaoEmAndamento.Iniciado;
cmbCameraSoloD.Enabled = !Variaveis.OperacaoEmAndamento.Iniciado;
cmbCameraCaminho.Enabled = !Variaveis.OperacaoEmAndamento.Iniciado;
}
#endregion
@ -804,7 +329,7 @@ namespace AgroBase.Forms.Operacoes
try
{
//DesenharInclinacao((Panel)sender, e, (float)cameraCaminho.Angulo);
FuncoesGlobais.DesenharInclinacao((Panel)sender, e, (float)(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.Angulo), 90);
FuncoesGlobais.DesenharInclinacao((Panel)sender, e, (float)(Variaveis.OperacaoEmAndamento.Controle.Angulo), 90);
}
catch { }
}

View File

@ -61,9 +61,6 @@ namespace AgroBase.Forms.Operacoes
this.lblPorcentagemReservatorio = new System.Windows.Forms.Label();
this.pgbReservatorio = new System.Windows.Forms.ProgressBar();
this.gpbOpcoes = new System.Windows.Forms.GroupBox();
this.lblPSI = new System.Windows.Forms.Label();
this.lblPressaoSP = new System.Windows.Forms.Label();
this.nudPressaoSP = new System.Windows.Forms.NumericUpDown();
this.btnCarregarMapa = new System.Windows.Forms.Button();
this.btnIniciarOperacao = new System.Windows.Forms.Button();
this.gpbInformacoesGerais = new System.Windows.Forms.GroupBox();
@ -98,7 +95,6 @@ namespace AgroBase.Forms.Operacoes
((System.ComponentModel.ISupportInitialize)(this.picSonar)).BeginInit();
this.pnlNiveis.SuspendLayout();
this.gpbOpcoes.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudPressaoSP)).BeginInit();
this.gpbInformacoesGerais.SuspendLayout();
this.pnlInferior.SuspendLayout();
this.SuspendLayout();
@ -404,9 +400,6 @@ namespace AgroBase.Forms.Operacoes
//
// gpbOpcoes
//
this.gpbOpcoes.Controls.Add(this.lblPSI);
this.gpbOpcoes.Controls.Add(this.lblPressaoSP);
this.gpbOpcoes.Controls.Add(this.nudPressaoSP);
this.gpbOpcoes.Controls.Add(this.btnCarregarMapa);
this.gpbOpcoes.Controls.Add(this.btnIniciarOperacao);
this.gpbOpcoes.Font = new System.Drawing.Font("Mongolian Baiti", 9F, System.Drawing.FontStyle.Bold);
@ -419,40 +412,6 @@ namespace AgroBase.Forms.Operacoes
this.gpbOpcoes.TabStop = false;
this.gpbOpcoes.Text = "Opções";
//
// lblPSI
//
this.lblPSI.AutoSize = true;
this.lblPSI.Location = new System.Drawing.Point(164, 23);
this.lblPSI.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblPSI.Name = "lblPSI";
this.lblPSI.Size = new System.Drawing.Size(24, 13);
this.lblPSI.TabIndex = 10;
this.lblPSI.Text = "psi";
//
// lblPressaoSP
//
this.lblPressaoSP.AutoSize = true;
this.lblPressaoSP.Location = new System.Drawing.Point(4, 23);
this.lblPressaoSP.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblPressaoSP.Name = "lblPressaoSP";
this.lblPressaoSP.Size = new System.Drawing.Size(100, 13);
this.lblPressaoSP.TabIndex = 9;
this.lblPressaoSP.Text = "Pressão da linha";
//
// nudPressaoSP
//
this.nudPressaoSP.Location = new System.Drawing.Point(104, 19);
this.nudPressaoSP.Margin = new System.Windows.Forms.Padding(2);
this.nudPressaoSP.Maximum = new decimal(new int[] {
200,
0,
0,
0});
this.nudPressaoSP.Name = "nudPressaoSP";
this.nudPressaoSP.Size = new System.Drawing.Size(56, 21);
this.nudPressaoSP.TabIndex = 8;
this.nudPressaoSP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// btnCarregarMapa
//
this.btnCarregarMapa.Location = new System.Drawing.Point(22, 58);
@ -754,8 +713,6 @@ namespace AgroBase.Forms.Operacoes
this.pnlNiveis.ResumeLayout(false);
this.pnlNiveis.PerformLayout();
this.gpbOpcoes.ResumeLayout(false);
this.gpbOpcoes.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudPressaoSP)).EndInit();
this.gpbInformacoesGerais.ResumeLayout(false);
this.gpbInformacoesGerais.PerformLayout();
this.pnlInferior.ResumeLayout(false);
@ -816,9 +773,6 @@ namespace AgroBase.Forms.Operacoes
private System.Windows.Forms.Label lblProgressoRua;
private System.Windows.Forms.Panel pnlAnguloCamera;
private System.Windows.Forms.Label lblPerformance;
private System.Windows.Forms.Label lblPSI;
private System.Windows.Forms.Label lblPressaoSP;
private System.Windows.Forms.NumericUpDown nudPressaoSP;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabGrafico;
private System.Windows.Forms.TabPage tabSonar;

View File

@ -53,19 +53,19 @@ namespace AgroBase.Forms.Operacoes
}
});
nudVelocidadeComErvas.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.RPM_Min);
nudVelocidadeSemErvas.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.RPM_Max);
lblKmhCErvas.Text = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.RPM_Min).ToString("0.00") + " Km/h";
lblKmhSErvas.Text = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.RPM_Max).ToString("0.00") + " Km/h";
nudAnguloMaximo.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.Angulo_Max);
nudAnguloMinimo.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.Angulo_Min);
nudVelocidadeMP.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.VelocidadeMP);
nudVelocidadeComErvas.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.RPM_Min);
nudVelocidadeSemErvas.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.RPM_Max);
lblKmhCErvas.Text = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.Controle.RPM_Min).ToString("0.00") + " Km/h";
lblKmhSErvas.Text = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.Controle.RPM_Max).ToString("0.00") + " Km/h";
nudAnguloMaximo.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.Angulo_Max);
nudAnguloMinimo.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.Angulo_Min);
nudVelocidadeMP.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.VelocidadeMP);
nudTemposalvarlog.Value = Variaveis.OperacaoEmAndamento.tmrLogs.Interval / 1000;
nudQtdBicos.Value = Variaveis.OperacaoEmAndamento.DispAtu.Dados.QuantidadeBicos;
nudQtdCameras.Value = Variaveis.OperacaoEmAndamento.QuantidadeCamerasSolo;
nudCapacidadereservatorio.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.DispAtu.Dados.CapacidadeReservatorio);
nudCapacidadereservatorio.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.CapacidadeReservatorio);
txtDensidadeherbicida.Text = Variaveis.OperacaoEmAndamento.DispAtu.Dados.DensidadeHerbicida.ToString("0.00");
nudAtuarem.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualInicioPulverizacao * 100);
nudAtuarem.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.PercentualInicioPulverizacao * 100);
cmbScriptErvas.SelectedIndex = cmbScriptErvas.Items.IndexOf(Variaveis.OperacaoEmAndamento.DispAtu.Dados.ScriptDeteccaoErvas.Replace(".py", ""));
}
@ -122,17 +122,17 @@ namespace AgroBase.Forms.Operacoes
void SalvarOperacao()
{
Variaveis.OperacaoEmAndamento.ModulosMandatorios = ModulosMandatorios.Where(x => x.Utilizar).ToList();
Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.RPM_Max = (int)(nudVelocidadeSemErvas.Value);
Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.RPM_Min = (int)(nudVelocidadeComErvas.Value);
Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.Angulo_Max = (int)(nudAnguloMaximo.Value);
Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.Angulo_Min = (int)(nudAnguloMinimo.Value);
Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.VelocidadeMP = (int)(nudVelocidadeMP.Value);
Variaveis.OperacaoEmAndamento.Controle.RPM_Max = (int)(nudVelocidadeSemErvas.Value);
Variaveis.OperacaoEmAndamento.Controle.RPM_Min = (int)(nudVelocidadeComErvas.Value);
Variaveis.OperacaoEmAndamento.Controle.Angulo_Max = (int)(nudAnguloMaximo.Value);
Variaveis.OperacaoEmAndamento.Controle.Angulo_Min = (int)(nudAnguloMinimo.Value);
Variaveis.OperacaoEmAndamento.Controle.VelocidadeMP = (int)(nudVelocidadeMP.Value);
Variaveis.OperacaoEmAndamento.tmrLogs.Interval = (int)(nudTemposalvarlog.Value * 1000);
Variaveis.OperacaoEmAndamento.DispAtu.Dados.QuantidadeBicos = (int)nudQtdBicos.Value;
Variaveis.OperacaoEmAndamento.QuantidadeCamerasSolo = (int)nudQtdCameras.Value;
Variaveis.OperacaoEmAndamento.DispAtu.Dados.CapacidadeReservatorio = (double)nudCapacidadereservatorio.Value;
Variaveis.OperacaoEmAndamento.CapacidadeReservatorio = (double)nudCapacidadereservatorio.Value;
Variaveis.OperacaoEmAndamento.DispAtu.Dados.DensidadeHerbicida = Convert.ToDouble(txtDensidadeherbicida.Text.Replace(".", ","));
Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualInicioPulverizacao = (double)(nudAtuarem.Value / 100);
Variaveis.OperacaoEmAndamento.Controle.PercentualInicioPulverizacao = (double)(nudAtuarem.Value / 100);
Variaveis.OperacaoEmAndamento.DispAtu.Dados.ScriptDeteccaoErvas = cmbScriptErvas.Text + ".py";
if (chbSalvar.Checked)

View File

@ -80,9 +80,11 @@ namespace AgroBase.Forms.Sensoriamento
cmbCaminho.Text = IDrua;
}
var CamerasSolo = ((SensoriamentoModel)Disp.Dados).CameraID_Solo;
cmbSoloEsq.Items.Clear();
cmbSoloEsq.Items.AddRange(Cameras.Values.ToArray());
string IDsoloE = ((SensoriamentoModel)Disp.Dados).CameraID_SoloE;
string IDsoloE = CamerasSolo.Count() > 0 ? CamerasSolo[0] : "";
if (Cameras.Any(x => x.Value == IDsoloE))
{
cmbSoloEsq.SelectedIndex = cmbSoloEsq.Items.IndexOf(IDsoloE);
@ -94,7 +96,7 @@ namespace AgroBase.Forms.Sensoriamento
cmbSoloDir.Items.Clear();
cmbSoloDir.Items.AddRange(Cameras.Values.ToArray());
string IDsoloD = ((SensoriamentoModel)Disp.Dados).CameraID_SoloD;
string IDsoloD = CamerasSolo.Count() > 1 ? CamerasSolo[1] : "";
if (Cameras.Any(x => x.Value == IDsoloD))
{
cmbSoloDir.SelectedIndex = cmbSoloDir.Items.IndexOf(IDsoloD);
@ -197,8 +199,8 @@ namespace AgroBase.Forms.Sensoriamento
var _Disp = (DispositivosService<SensoriamentoModel>)Variaveis.DispositivosConectados.FirstOrDefault(x => x.Dispositivo == Dispositivo);
_Disp.Dados.Sensores = Sensores.ToList();
_Disp.Dados.CameraID_Caminho = cmbCaminho.Text;
_Disp.Dados.CameraID_SoloE = cmbSoloEsq.Text;
_Disp.Dados.CameraID_SoloD = cmbSoloDir.Text;
_Disp.Dados.CameraID_Solo.Clear();
_Disp.Dados.CameraID_Solo.AddRange(new string[] { cmbSoloEsq.Text, cmbSoloDir.Text });
_Disp.SalvarParametros(_Disp.Dados);
break;
}

View File

@ -75,12 +75,6 @@ namespace AgroBase.Forms
{
Disp.btnConectar_Click(new object(), new EventArgs());
}
if (Disp.Dispositivo == T_Code.Sen)
{
((SensoriamentoModel)Disp.Dados).ultimoFrameSoloE = null;
((SensoriamentoModel)Disp.Dados).ultimoFrameSoloD = null;
((SensoriamentoModel)Disp.Dados).ultimoFrameCaminho = null;
}
Disp.SalvarParametros(Disp.Dados);
}

View File

@ -121,7 +121,7 @@ namespace AgroBase
this.gpbAcoes.Margin = new System.Windows.Forms.Padding(2);
this.gpbAcoes.Name = "gpbAcoes";
this.gpbAcoes.Padding = new System.Windows.Forms.Padding(2);
this.gpbAcoes.Size = new System.Drawing.Size(558, 609);
this.gpbAcoes.Size = new System.Drawing.Size(619, 609);
this.gpbAcoes.TabIndex = 0;
this.gpbAcoes.TabStop = false;
this.gpbAcoes.Text = "Conexão";
@ -134,7 +134,7 @@ namespace AgroBase
this.erroStrip.Location = new System.Drawing.Point(2, 585);
this.erroStrip.Name = "erroStrip";
this.erroStrip.Padding = new System.Windows.Forms.Padding(1, 0, 10, 0);
this.erroStrip.Size = new System.Drawing.Size(554, 22);
this.erroStrip.Size = new System.Drawing.Size(615, 22);
this.erroStrip.TabIndex = 1;
this.erroStrip.Text = "statusStrip1";
//
@ -158,7 +158,7 @@ namespace AgroBase
this.pnlLateral.Location = new System.Drawing.Point(2, 15);
this.pnlLateral.Margin = new System.Windows.Forms.Padding(2);
this.pnlLateral.Name = "pnlLateral";
this.pnlLateral.Size = new System.Drawing.Size(554, 592);
this.pnlLateral.Size = new System.Drawing.Size(615, 592);
this.pnlLateral.TabIndex = 0;
//
// chbConexaoautomatica
@ -173,26 +173,30 @@ namespace AgroBase
//
// gpbDispositivos
//
this.gpbDispositivos.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.gpbDispositivos.Controls.Add(this.lstDisponiveis);
this.gpbDispositivos.Location = new System.Drawing.Point(161, 78);
this.gpbDispositivos.Margin = new System.Windows.Forms.Padding(2);
this.gpbDispositivos.Name = "gpbDispositivos";
this.gpbDispositivos.Padding = new System.Windows.Forms.Padding(2);
this.gpbDispositivos.Size = new System.Drawing.Size(386, 133);
this.gpbDispositivos.Size = new System.Drawing.Size(428, 133);
this.gpbDispositivos.TabIndex = 3;
this.gpbDispositivos.TabStop = false;
this.gpbDispositivos.Text = "Dispositivos disponíveis";
//
// lstDisponiveis
//
this.lstDisponiveis.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lstDisponiveis.HideSelection = false;
this.lstDisponiveis.Location = new System.Drawing.Point(11, 20);
this.lstDisponiveis.Margin = new System.Windows.Forms.Padding(2);
this.lstDisponiveis.Name = "lstDisponiveis";
this.lstDisponiveis.Size = new System.Drawing.Size(252, 102);
this.lstDisponiveis.Size = new System.Drawing.Size(413, 102);
this.lstDisponiveis.TabIndex = 0;
this.lstDisponiveis.UseCompatibleStateImageBehavior = false;
this.lstDisponiveis.View = System.Windows.Forms.View.List;
this.lstDisponiveis.View = System.Windows.Forms.View.Tile;
//
// btnRemover
//
@ -830,7 +834,7 @@ namespace AgroBase
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1028, 609);
this.ClientSize = new System.Drawing.Size(1089, 609);
this.Controls.Add(this.gpbOperacao);
this.Controls.Add(this.gpbAtalhos);
this.Controls.Add(this.gpbControleDirecional);

View File

@ -122,13 +122,14 @@ namespace AgroBase
(x.FirstOrDefault().Dispositivo == T_Code.Mvd ? (" (" + string.Join(", ", x.Select(y => y.Mod_ID)) + ")") :
(x.FirstOrDefault().Dispositivo == T_Code.Bld ? (" (" + string.Join(", ", x.Select(y => y.Mod_ID)) + ")") :
"")) + " - " +
(x.Any(y => y.Conectado) ? "Conectado" : "Desconectado")
(x.FirstOrDefault().Dispositivo == T_Code.Gps ? (GPSService.Iniciado ? "Conectado" : "Desconectado") :
/*(x.FirstOrDefault().Dispositivo == T_Code.Gps ? (GPSService.Iniciado ? "Conectado" : "Desconectado") :
x.FirstOrDefault().Dispositivo == T_Code.Pzm ? (PZEMService.Iniciado ? "Conectado" : "Desconectado") :
x.FirstOrDefault().Dispositivo == T_Code.Lra ? (LoRaService.Iniciado ? "Conectado" : "Desconectado") :
x.FirstOrDefault().Dispositivo == T_Code.Wit ? (WT901CService.Iniciado ? "Conectado" : "Desconectado") :
x.FirstOrDefault().Dispositivo == T_Code.Bld ? (Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.Any(y => y.MovMotor.DadosDriver.Iniciado) ? "Conectado" : "Desconectado") :
(Variaveis.DispositivosConectados.FirstOrDefault(y => y.PortaCOM() == x.FirstOrDefault().PortaCOM)?.StatusPorta() ?? "Desconectado"))
(Variaveis.DispositivosConectados.FirstOrDefault(y => y.PortaCOM() == x.FirstOrDefault().PortaCOM)?.StatusPorta() ?? "Desconectado"))*/
}).ToArray()
);
if (SerialService.DispositivosMapeados.Count == 0)

View File

@ -202,7 +202,7 @@ namespace AgroBase.Forms
{
try
{
double angulo = Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.Angulo;
double angulo = Variaveis.OperacaoEmAndamento.Controle.Angulo;
DesenharInclinacao((Panel)sender, e, (float)angulo, 90);
}
catch { }
@ -337,13 +337,13 @@ namespace AgroBase.Forms
Variaveis.OperacaoEmAndamento.OpMapaGPS.CalculaDadosMovimentacaoAutonoma();
double anguloAtual = double.Parse(txtAnguloGPS.Text);
double novoAngulo = (anguloAtual + Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.Angulo) % 360;
double novoAngulo = (anguloAtual + Variaveis.OperacaoEmAndamento.Controle.Angulo) % 360;
txtAnguloGPS.Text = novoAngulo.ToString("0.00");
double anguloControle = Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.Angulo;
double anguloControle = Variaveis.OperacaoEmAndamento.Controle.Angulo;
txtAnguloControle.Text = anguloControle.ToString("0.00");
double velocidade = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.RPM);
double velocidade = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.Controle.RPM);
double velocidadeMs = MovimentacaoModel.ConverteKmhParaMs(velocidade);
txtVelocidade.Text = velocidade.ToString("0.00");

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -63,6 +63,7 @@ namespace AgroBase.Models
public string ID { get; set; }
public string Nome { get; set; }
public int Posicao { get; set; }
public bool Iniciada { get; set; } = false;

View File

@ -47,7 +47,7 @@ namespace AgroBase.Models
panel.Controls.Remove(browser);
browser = null;
Variaveis.MqttService.UnsubscribeAsync(camera._mqttTopico).ConfigureAwait(false);
if (camera.pythonProcess != null)
if (camera.pythonProcess != null && !camera.pythonProcess.HasExited)
{
camera.pythonProcess.Kill();
}
@ -61,6 +61,7 @@ namespace AgroBase.Models
public string ID { get; set; }
public string Nome { get; set; }
public int Posicao { get; set; }
public bool Iniciada { get; set; } = false;

View File

@ -60,6 +60,7 @@ namespace AgroBase.Models
Mvd = 109,
Mbs = 110,
Mks = 111,
Cam = 112,
}
public enum F_Code

View File

@ -28,7 +28,20 @@ namespace AgroBase.Models
public int IdxRuaAtual { get; set; } = 0;
public int IdxUltimoPontoTrajetoria { get; set;} = 0;
public int IdxUltimoPontoTrajetoriaDinamica { get; set;} = 0;
public double DistanciaTotal { get; set; } = 0;
public double DistanciaTotal
{
get
{
double distancia = 0.0;
foreach (var trecho in Trajetoria)
{
distancia += GPSService.DistanciaDoTrecho(trecho);
}
return distancia;
}
}
public DirecaoCarroRua DirecaoCaminho
{
get
@ -354,7 +367,7 @@ namespace AgroBase.Models
if (mapaService.DadosMapa != null)
{
double OrientacaoRuas = -999;
DistanciaTotal = 0;
//DistanciaTotal = 0;
/*if (!RuasPercorrer.Any())
{
RuasPercorrer = mapaService.DadosMapa.features.Select(x => x.geometry.id).ToList();
@ -375,10 +388,10 @@ namespace AgroBase.Models
Latitude = ponto[1],
};
Trajetoria[Trajetoria.Count - 1].Add(item);
if (Trajetoria[Trajetoria.Count - 1].Count > 1)
/*if (Trajetoria[Trajetoria.Count - 1].Count > 1)
{
DistanciaTotal += GPSService.DistanciaEntrePontos(Trajetoria[Trajetoria.Count - 1][Trajetoria[Trajetoria.Count - 1].Count - 2], item);
}
}*/
}
var Rua = Trajetoria[Trajetoria.Count - 1];

View File

@ -35,12 +35,10 @@ namespace AgroBase.Models.Modules
};
public int QuantidadeBicos { get; set; } = 4;
public double DensidadeHerbicida { get; set; } = 1.1;
public double CapacidadeReservatorio { get; set; } = 30;
public bool AtuacaoNivelAlto { get; set; } = true;
public List<AtuadorBicoModel> BicosPulverizadores { get; set; } = new List<AtuadorBicoModel>();
public AtuadorBombaModel BombaPressurizadora { get; set; } = new AtuadorBombaModel();
public List<SensorModel> Sensores { get; set; } = new List<SensorModel>();
public double PercentualInicioPulverizacao { get; set; } = 0.3;
public string ScriptDeteccaoErvas { get; set; } = PythonService.ScriptWeedDetector;
#region MASSA
@ -72,7 +70,7 @@ namespace AgroBase.Models.Modules
{
get
{
return VolumeReservatorio / CapacidadeReservatorio * 100;
return VolumeReservatorio / Variaveis.OperacaoEmAndamento.CapacidadeReservatorio * 100;
}
}
#endregion
@ -151,7 +149,7 @@ namespace AgroBase.Models.Modules
Ligado = false,
Inicializado = false,
Pressao = 0,
PressaoSP = 80,
//PressaoSP = 80,
Testando = false,
Funcoes = new List<FuncoesPinout>()
{
@ -689,7 +687,7 @@ namespace AgroBase.Models.Modules
public bool Inicializado { get; set; }
public bool Testando { get; set; }
public List<FuncoesPinout> Funcoes { get; set; } = new List<FuncoesPinout>();
public double PressaoSP { get; set; }
//public double PressaoSP { get; set; }
public double Pressao { get; set; }
public double Potencia { get; set; }
@ -707,7 +705,8 @@ namespace AgroBase.Models.Modules
ID + SerialService.SplitParams +
(Conectar ? "1" : "0") + SerialService.SplitParams +
(Comandar ? "1" : "0") + SerialService.SplitParams +
PressaoSP.ToString("000") + SerialService.SplitParams +
//PressaoSP.ToString("000") + SerialService.SplitParams +
Variaveis.OperacaoEmAndamento.Controle.PressaoLinha.ToString() + SerialService.SplitParams +
PinoutModel.PinoProtocolo(_pinout, Funcoes);
return Protocolo;
@ -721,7 +720,8 @@ namespace AgroBase.Models.Modules
((int)F_Code.Cmd).ToString() + SerialService.SplitMessage +
ID.PadRight(5, ' ') + SerialService.SplitParams +
(BombaAtuada ? "1" : "0") + SerialService.SplitParams +
PressaoSP.ToString();
//PressaoSP.ToString();
Variaveis.OperacaoEmAndamento.Controle.PressaoLinha.ToString();
return ProtocoloBomba;
}
return "";
@ -751,7 +751,7 @@ namespace AgroBase.Models.Modules
Testando = this.Testando,
Funcoes = this.Funcoes,
Pressao = this.Pressao,
PressaoSP = this.PressaoSP,
//PressaoSP = this.PressaoSP,
};
return clone;

View File

@ -341,8 +341,6 @@ namespace AgroBase.Models.Modules
{
string Protocolo = Modulo.ProtocoloAquisicaoDados();
Variaveis.OperacaoEmAndamento.DispMvd.AdicionarMensagemFila(Modulo.Modulo_ID, Protocolo, false, false);
Modulo.DirMotor.ProtocoloAquisicaoDados();
}
}
@ -605,20 +603,6 @@ namespace AgroBase.Models.Modules
return "";
}
public string ProtocoloAquisicaoDados()
{
if (Inicializado)
{
string ProtocoloMotor =
((int)F_Code.Req).ToString() + SerialService.SplitMessage +
ID + SerialService.SplitParams +
"";
return ProtocoloMotor;
}
return "";
}
}
@ -720,13 +704,15 @@ namespace AgroBase.Models.Modules
{
int mx = Sentido_SP == Sentido.Antihorario ? -1 : 1;
int vel = Convert.ToInt32((Velocidade / 100.0) * (MKS057DService.DadosLeitura.FirstOrDefault(x => x.Endereco == Convert.ToByte(Endereco.Replace("0x", ""), 16))?.Velocidade ?? 600));
MKS057DService.EnviarComandoControle(new MKS057ComandoModel()
{
Get = false,
Comando = Convert.ToByte("13"),
Endereco = Endereco,
Angulo = Angulo_SP * mx,
Velocidade = Velocidade,
Velocidade = vel,
_Sentido = Sentido_SP,
ModoControle = ModosControle.AnguloAbsoluto,
AguardaResposta = false,
@ -740,29 +726,6 @@ namespace AgroBase.Models.Modules
return "";
}
public string ProtocoloAquisicaoDados()
{
bool mksIniciado = MKS057DService.DadosLeitura.Any(x => x.Iniciado && Convert.ToByte(Endereco.Replace("0x", ""), 16) == x.Endereco);
if (Inicializado || mksIniciado)
{
string ProtocoloMotor =
((int)F_Code.Req).ToString() + SerialService.SplitMessage +
ID + SerialService.SplitParams +
"";
if (mksIniciado)
{
MKS057DService.EnviarComandoRequisicao(Endereco).ConfigureAwait(false);
ProtocoloMotor = "";
}
return ProtocoloMotor;
}
return "";
}
}
public class MvdMotorMOVSensorimanetoGrafico

View File

@ -41,13 +41,9 @@ namespace AgroBase.Models.Modules
FuncoesPinout.Geral,
};
public List<SensorModel> Sensores { get; set; }
public List<SensorSinaleiroModel> Sinaleiros { get; set; }
public string CameraID_Caminho { get; set; }
public Bitmap ultimoFrameCaminho { get; set; }
public string CameraID_SoloE { get; set; }
public Bitmap ultimoFrameSoloE { get; set; }
public string CameraID_SoloD { get; set; }
public Bitmap ultimoFrameSoloD { get; set; }
public List<SensorSinaleiroModel> Sinaleiros { get; set; }
public string CameraID_Caminho { get; set; } = "";
public List<string> CameraID_Solo { get; set; } = new List<string>();
public double BateriaCargaConsumida { get; set; }
@ -678,13 +674,16 @@ namespace AgroBase.Models.Modules
}
if (Sensor.Leituras[0] > Sensor.ValorMaximo)
if (Sensor.Leituras != null)
{
Sensor.ValorMaximo = Sensor.Leituras[0];
}
else if (Sensor.Leituras[0] < Sensor.ValorMinimo)
{
Sensor.ValorMinimo = Sensor.Leituras[0];
if (Sensor.Leituras[0] > Sensor.ValorMaximo)
{
Sensor.ValorMaximo = Sensor.Leituras[0];
}
else if (Sensor.Leituras[0] < Sensor.ValorMinimo)
{
Sensor.ValorMinimo = Sensor.Leituras[0];
}
}
MovSensoriamentoMotor Motor =

View File

@ -29,8 +29,6 @@ namespace AgroBase.Models.Operacoes
}
public OperacaoRefRuaGPS ReferencialRuaGPS { get; set; } = new OperacaoRefRuaGPS();
public OperacaoMapaGPSSensoriamentoModel Sensoriamento { get; set; } = new OperacaoMapaGPSSensoriamentoModel();
public OperacaoControleModel Controle { get; set; } = new OperacaoControleModel();
public OperacaoControleModel ControleAnterior { get; set; } = new OperacaoControleModel();
public List<StatusCarroMapa> StatusDentroRua = new List<StatusCarroMapa>()
{
StatusCarroMapa.EntrandoRua,
@ -38,148 +36,6 @@ namespace AgroBase.Models.Operacoes
StatusCarroMapa.SaindoRua
};
public void AtualizarDadosControle()
{
DateTime Agora = DateTime.Now;
OperacaoControleTipoModel ControleMov = Controle.TiposControle != null ? Controle.TiposControle.FirstOrDefault(x => x.Tipo == T_Code.Mov) : null;
OperacaoControleTipoModel ControleDir = Controle.TiposControle != null ? Controle.TiposControle.FirstOrDefault(x => x.Tipo == T_Code.Dir) : null;
OperacaoControleTipoModel ControleAtu = Controle.TiposControle != null ? Controle.TiposControle.FirstOrDefault(x => x.Tipo == T_Code.Atu) : null;
if (ControleMov != null && Controle.RPM != ControleAnterior.RPM && (Agora - ControleMov.UltimoComando).TotalMilliseconds > ControleMov.DelayEnvioComando)
{
// Enviar comando MOV
var Protocolos = EnviarProtocoloComando(Variaveis.OperacaoEmAndamento.DispMvd, T_Code.Mov);
ControleMov.UltimoComando = Agora;
ControleMov.Comandos.AddRange(Protocolos);
ControleAnterior.RPM = Controle.RPM;
}
if (ControleDir != null && Convert.ToInt32(Controle.Angulo) != Convert.ToInt32(ControleAnterior.Angulo) && (Agora - ControleDir.UltimoComando).TotalMilliseconds > ControleDir.DelayEnvioComando)
{
// Enviar comando DIR
var Protocolos = EnviarProtocoloComando(Variaveis.OperacaoEmAndamento.DispMvd, T_Code.Dir);
ControleDir.UltimoComando = Agora;
ControleDir.Comandos.AddRange(Protocolos);
ControleAnterior.Angulo = Controle.Angulo;
}
if (ControleAtu != null && !Controle.BicosAtuados.Select(x => x.Atuado).SequenceEqual(ControleAnterior.BicosAtuados.Select(x => x.Atuado)) && (Agora - ControleAtu.UltimoComando).TotalMilliseconds > ControleAtu.DelayEnvioComando)
{
// Enviar comando ATU
var Protocolos = EnviarProtocoloComando(Variaveis.OperacaoEmAndamento.DispAtu, T_Code.Atu);
ControleAtu.UltimoComando = Agora;
ControleAtu.Comandos.AddRange(Protocolos);
ControleAnterior.BicosAtuados = new List<AtuadorBicoModel>();
foreach (var bico in Controle.BicosAtuados)
{
ControleAnterior.BicosAtuados.Add(bico.Clone());
}
}
AtualizarDadosOperacao();
}
public List<string> EnviarProtocoloComando(IDispositivosService Dispositivo, T_Code Tipo)
{
if (Dispositivo == null)
{
return new List<string>();
}
if (Tipo == T_Code.Mov)
{
GeneralJoystick.RPM = Controle.RPM;
if (Controle.RPM == 0)
{
Controle.Direcao = Direcao.Parado;
}
else
{
if (Controle.RPM < 0)
{
GeneralJoystick.RPM *= -1;
Controle.Direcao = Direcao.Tras;
}
else
{
Controle.Direcao = Direcao.Frente;
}
}
}
else if (Tipo == T_Code.Dir)
{
GeneralJoystick.Angulo = Controle.Angulo;
if (Controle.Angulo < 0)
{
GeneralJoystick.Angulo *= -1;
if (ControleAnterior.Angulo < Controle.Angulo)
{
Controle.Direcao = Direcao.Parado;
}
else
{
Controle.Direcao = Direcao.Baixo;
}
}
else
{
if (ControleAnterior.Angulo > Controle.Angulo)
{
Controle.Direcao = Direcao.Parado;
}
else
{
Controle.Direcao = Direcao.Cima;
}
}
}
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.Dir ? ((MovimentacaoUnificadaModel)Dispositivo.Dados).Modulos.Select(x => new { Mod_ID = x.Modulo_ID, Protocolo = x.DirMotor.ProtocoloComando(Controle.Direcao) }) :
Tipo == T_Code.Atu ? ((AtuadorModel)Dispositivo.Dados).BicosPulverizadores.Select(x => new { Mod_ID = ((AtuadorModel)Dispositivo.Dados).Modulo_ID, Protocolo = x.ProtocoloComando() }) :
null;
foreach (var Protocolo in Protocolos)
{
Dispositivo.AdicionarMensagemFila(Protocolo.Mod_ID, Protocolo.Protocolo, true, false);
}
return Protocolos.Select(x => x.Protocolo).ToList();
}
private void AtualizarDadosOperacao()
{
if (Variaveis.OperacaoEmAndamento.DispMvd == null)
{
return;
}
try
{
Sensoriamento.ProgressoTrajeto = Variaveis.OperacaoEmAndamento.Mapa.mapaService.pythonProcess == null ? 0 : Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaPercorrida.Sum() / Variaveis.OperacaoEmAndamento.Mapa.DistanciaTotal * 100;
if (Sensoriamento.ProgressoTrajeto < 0 && Sensoriamento.ProgressoTrajeto >= 0)
{
Sensoriamento.ProgressoTrajeto = 0;
}
Sensoriamento.ProgressoRua =
Variaveis.OperacaoEmAndamento.Mapa == null || Variaveis.OperacaoEmAndamento.Mapa.pnlMapa == null || Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual >= Variaveis.OperacaoEmAndamento.Mapa.Trajetoria.Count() ? 0 :
(ReferencialRuaGPS.Direcao == DirecaoCarroRua.Ida ? ((double)ReferencialRuaGPS.IdxPontoAproximadoRua / (double)(Variaveis.OperacaoEmAndamento.Mapa.Trajetoria[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual].Count - 1)) :
ReferencialRuaGPS.Direcao == DirecaoCarroRua.Volta ? ((double)(Variaveis.OperacaoEmAndamento.Mapa.Trajetoria[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual].Count - 1 - ReferencialRuaGPS.IdxPontoAproximadoRua) / (double)(Variaveis.OperacaoEmAndamento.Mapa.Trajetoria[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual].Count - 1)) :
0) * 100;
}
catch
{
}
}
public void AtualizarControleAtuadores()
{
Controle.BicosAtuados = Variaveis.OperacaoEmAndamento.DispAtu.Dados.BicosPulverizadores;
}
public void CalcularAnguloInclinacao(StatusCarroMapa statusCarroRua)
{
double erroOrientacao = 0.0;
@ -208,21 +64,21 @@ namespace AgroBase.Models.Operacoes
// Atualiza o PID com o erro combinado
if (statusCarroRua != StatusCarroMapa.Parado)
{
Controle.PIDdirecional.Atualizar(erroCombinado);
Variaveis.OperacaoEmAndamento.Controle.PIDdirecional.Atualizar(erroCombinado);
}
double correcaoAngulo = Controle.PIDdirecional.Saida;
double correcaoAngulo = Variaveis.OperacaoEmAndamento.Controle.PIDdirecional.Saida;
// Aplica a correção. Isso pode incluir limites para evitar comandos excessivos.
if (correcaoAngulo > Controle.Angulo_Max)
if (correcaoAngulo > Variaveis.OperacaoEmAndamento.Controle.Angulo_Max)
{
correcaoAngulo = Controle.Angulo_Max;
correcaoAngulo = Variaveis.OperacaoEmAndamento.Controle.Angulo_Max;
}
else if (correcaoAngulo < Controle.Angulo_Min)
else if (correcaoAngulo < Variaveis.OperacaoEmAndamento.Controle.Angulo_Min)
{
correcaoAngulo = Controle.Angulo_Min;
correcaoAngulo = Variaveis.OperacaoEmAndamento.Controle.Angulo_Min;
}
Controle.Angulo = correcaoAngulo;
Variaveis.OperacaoEmAndamento.Controle.Angulo = correcaoAngulo;
if (statusCarroRua == StatusCarroMapa.Manobrando)
{
@ -293,6 +149,11 @@ namespace AgroBase.Models.Operacoes
public void CalculaDadosMovimentacaoAutonoma()
{
if (Variaveis.OperacaoEmAndamento.Modo == ModoOperacao.MapaGPS)
{
return;
}
var statusAtual = ReferencialRuaGPS.StatusAtual;
CalcularAnguloInclinacao(statusAtual);
@ -301,49 +162,49 @@ namespace AgroBase.Models.Operacoes
{
var BicosNaoAtuados = new List<AtuadorBicoModel>(Variaveis.OperacaoEmAndamento.DispAtu.Dados.BicosPulverizadores);
BicosNaoAtuados.ForEach(x => x.Atuado = false);
Controle.BicosAtuados = BicosNaoAtuados.ToList();
Controle.RPM = 0;
Controle.Angulo = 0;
Variaveis.OperacaoEmAndamento.Controle.BicosAtuados = BicosNaoAtuados.ToList();
Variaveis.OperacaoEmAndamento.Controle.RPM = 0;
Variaveis.OperacaoEmAndamento.Controle.Angulo = 0;
}
else if (statusAtual == StatusCarroMapa.Direcionando)
{
if (Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.DesvioNecessario)
{
Controle.RPM = Controle.RPM_Min;
Variaveis.OperacaoEmAndamento.Controle.RPM = Variaveis.OperacaoEmAndamento.Controle.RPM_Min;
}
else
{
Controle.RPM = Controle.RPM_Max;
Variaveis.OperacaoEmAndamento.Controle.RPM = Variaveis.OperacaoEmAndamento.Controle.RPM_Max;
}
}
else if (statusAtual == StatusCarroMapa.EntrandoRua)
{
Controle.RPM = Controle.RPM_Min;
Variaveis.OperacaoEmAndamento.Controle.RPM = Variaveis.OperacaoEmAndamento.Controle.RPM_Min;
}
else if (statusAtual == StatusCarroMapa.SaindoRua)
{
Controle.RPM = Controle.RPM_Min;
Variaveis.OperacaoEmAndamento.Controle.RPM = Variaveis.OperacaoEmAndamento.Controle.RPM_Min;
}
else if (statusAtual == StatusCarroMapa.CaminhandoRua)
{
if (Sensoriamento.ErvasNoRadar == 0)
{
Controle.RPM = Controle.RPM_Max;
Variaveis.OperacaoEmAndamento.Controle.RPM = Variaveis.OperacaoEmAndamento.Controle.RPM_Max;
}
else
{
Controle.RPM = Convert.ToInt32(Controle.RPM_Max * 0.85);
Variaveis.OperacaoEmAndamento.Controle.RPM = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.RPM_Max * 0.85);
}
double margemAngulo = 5;
if (Controle.Angulo > margemAngulo || Controle.Angulo < (margemAngulo * -1))
if (Variaveis.OperacaoEmAndamento.Controle.Angulo > margemAngulo || Variaveis.OperacaoEmAndamento.Controle.Angulo < (margemAngulo * -1))
{
Controle.RPM = Controle.RPM_Min;
Variaveis.OperacaoEmAndamento.Controle.RPM = Variaveis.OperacaoEmAndamento.Controle.RPM_Min;
}
}
else if (statusAtual == StatusCarroMapa.Manobrando)
{
Controle.RPM = Controle.RPM_Max / 2;
Variaveis.OperacaoEmAndamento.Controle.RPM = Variaveis.OperacaoEmAndamento.Controle.RPM_Max / 2;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static AgroBase.Models.Enuns;
namespace AgroBase.Models.Operacoes
{
public class OperacaoParametrosModel
{
public ModoOperacao Modo { get; set; }
public string Descricao { get; set; }
public List<OperacaoModulosMandatoriosModel> ModulosMandatorios { get; set; }
public double MovVelocidadeSErvas { get; set; }
public double MovVelocidadeCErvas { get; set; }
public int DirAnguloMaximo { get; set; }
public int DirVelocidadeMovimento { get; set; }
public int AtuPercentualDeteccaoVertical { get; set; }
public double AtuCapacidadeReservatorio { get; set; }
public double AtuPressaoLinha { get; set; }
public int AtuDuracaoAtuacao { get; set; }
public MapasModel Mapa { get; set; }
}
}

View File

@ -13,6 +13,9 @@ using static AgroBase.Models.Enuns;
using System.Drawing.Drawing2D;
using Microsoft.Win32;
using System.Reflection;
using AgroBase.Forms.Operacoes;
using CefSharp.WinForms;
using System.IO;
namespace AgroBase.Models
{
@ -21,6 +24,7 @@ namespace AgroBase.Models
public static string CaminhoSistema { get; set; } = AppDomain.CurrentDomain.BaseDirectory;
public static string CaminhoLogsDispositivos { get; } = "Logs/";
public static string CaminhoOperacoes { get; } = "Operacoes/";
public static string CaminhoOperacoesSalvas { get; } = "OperacoesSalvas\\";
public static string CaminhoMapasConvertidos { get; } = "Mapas/";
public static string CaminhoParametros { get; } = "Parametros/";
public static List<IDispositivosService> DispositivosConectados { get; set; } = new List<IDispositivosService>();
@ -104,7 +108,13 @@ namespace AgroBase.Models
return comportamento;
}
public static LoRaService ConexaoLoRa = new LoRaService();
public static bool IsAgroMonitor
{
get
{
return CaminhoSistema.Contains("AgroMonitor");
}
}
}
public static class VariaveisPortas
@ -137,6 +147,13 @@ namespace AgroBase.Models
}
public static class VariaveisOperacao
{
public static double TempoManobra { get; set; } = 15;
public static double PercentualComErvas { get; set; } = 0.3;
public static double PercentualSemErvas { get; set; } = 0.7;
}
public static class FuncoesGlobais
{
public static void AddApplicationToStartup()
@ -366,6 +383,129 @@ namespace AgroBase.Models
while (Agora < DateTime.Now.AddMilliseconds(-ms)) { }
}
public static void DefinirEventosPicBtn(Control ctrl, Func<Task> func)
{
ctrl.Cursor = Cursors.Hand;
ctrl.MouseEnter += picBtn_MouseEnter;
ctrl.MouseLeave += picBtn_MouseLeave;
ctrl.Click += (s, args) =>
{
picBtn_Click(s, args).ContinueWith(t =>
{
if (t.IsCompleted)
{
func().ContinueWith(ft =>
{
if (ft.IsFaulted)
{
MessageBox.Show("Erro ao carregar operação!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}, TaskScheduler.FromCurrentSynchronizationContext());
}
}, TaskScheduler.FromCurrentSynchronizationContext());
};
}
public static async Task picBtn_Click(object sender, EventArgs e)
{
await PiscarBtn((Control)sender, 2);
}
public static void picBtn_MouseEnter(object sender, EventArgs e)
{
TransicaoTamanho((Control)sender, true).ConfigureAwait(false);
}
public static void picBtn_MouseLeave(object sender, EventArgs e)
{
TransicaoTamanho((Control)sender, false).ConfigureAwait(false);
}
private static void AlteraTamanhoObjeto(Control ctrl, bool Cresce)
{
int acX = Convert.ToInt32(ctrl.Width * 0.06);
if (acX % 2 == 1) acX++;
int acY = Convert.ToInt32(ctrl.Height * 0.06);
if (acY % 2 == 1) acY++;
if (!Cresce)
{
acX *= -1;
acY *= -1;
}
ctrl.Size = new Size((int)(ctrl.Width + acX), (int)(ctrl.Height + acY));
ctrl.Location = new Point(ctrl.Location.X - (acX / 2), ctrl.Location.Y - (acY / 2));
}
private static async Task TransicaoTamanho(Control ctrl, bool Cresce)
{
int steps = 10; // Número de passos na transição
int delay = 10; // Atraso entre os passos em milissegundos
int acX = Convert.ToInt32(ctrl.Width * 0.06);
if (acX % 2 == 1) acX++;
int acY = Convert.ToInt32(ctrl.Height * 0.06);
if (acY % 2 == 1) acY++;
// Ajuste para garantir que stepX e stepY sejam pelo menos 2
int stepX = Math.Max(acX / steps, 2);
int stepY = Math.Max(acY / steps, 2);
if (!Cresce)
{
stepX = -stepX;
stepY = -stepY;
}
for (int i = 0; i < steps; i++)
{
ctrl.Invoke((MethodInvoker)(() =>
{
ctrl.Size = new Size(ctrl.Width + stepX, ctrl.Height + stepY);
ctrl.Location = new Point(ctrl.Location.X - (stepX / 2), ctrl.Location.Y - (stepY / 2));
}));
await Task.Delay(delay);
}
}
private static async Task PiscarBtn(Control ctrl, int vezes)
{
for (int i = 0; i < vezes; i++)
{
await TransicaoTamanho(ctrl, true);
await Task.Delay(10);
await TransicaoTamanho(ctrl, false);
await Task.Delay(10);
}
}
public static Bitmap GetPanelImage(Panel panel)
{
// Cria um bitmap do tamanho do panel
Bitmap bitmap = new Bitmap(panel.Width, panel.Height);
// Desenha o conteúdo do panel no bitmap
panel.DrawToBitmap(bitmap, new Rectangle(0, 0, panel.Width, panel.Height));
// Retorna o bitmap
return bitmap;
}
public static async Task<Bitmap> GetBrowserImage(ChromiumWebBrowser browser)
{
if (browser != null)
{
var screenshot = await browser.CaptureScreenshotAsync();
using (var stream = new MemoryStream(screenshot))
{
var bitmap = new Bitmap(stream);
return bitmap;
}
}
return null;
}
}
public static class FuncoesMatematicas

View File

@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// O código foi gerado por uma ferramenta.
// Versão de Tempo de Execução:4.0.30319.42000
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// As alterações ao arquivo poderão causar comportamento incorreto e serão perdidas se
// o código for gerado novamente.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ -13,12 +13,12 @@ namespace AgroBase.Properties {
/// <summary>
/// Uma classe de recurso de tipo de alta segurança, para pesquisar cadeias de caracteres localizadas etc.
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// Essa classe foi gerada automaticamente pela classe StronglyTypedResourceBuilder
// através de uma ferramenta como ResGen ou Visual Studio.
// Para adicionar ou remover um associado, edite o arquivo .ResX e execute ResGen novamente
// com a opção /str, ou recrie o projeto do VS.
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
@ -33,7 +33,7 @@ namespace AgroBase.Properties {
}
/// <summary>
/// Retorna a instância de ResourceManager armazenada em cache usada por essa classe.
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
@ -47,8 +47,8 @@ namespace AgroBase.Properties {
}
/// <summary>
/// Substitui a propriedade CurrentUICulture do thread atual para todas as
/// pesquisas de recursos que usam essa classe de recurso de tipo de alta segurança.
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
@ -61,7 +61,27 @@ namespace AgroBase.Properties {
}
/// <summary>
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ajustes {
get {
object obj = ResourceManager.GetObject("ajustes", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap atualizar {
get {
object obj = ResourceManager.GetObject("atualizar", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap bussola {
get {
@ -71,7 +91,37 @@ namespace AgroBase.Properties {
}
/// <summary>
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap cana {
get {
object obj = ResourceManager.GetObject("cana", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap desligar {
get {
object obj = ResourceManager.GetObject("desligar", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap diagnostico {
get {
object obj = ResourceManager.GetObject("diagnostico", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap esp32_s3 {
get {
@ -81,7 +131,7 @@ namespace AgroBase.Properties {
}
/// <summary>
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap esp32_wrover {
get {
@ -91,7 +141,37 @@ namespace AgroBase.Properties {
}
/// <summary>
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap excluir {
get {
object obj = ResourceManager.GetObject("excluir", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap fechar {
get {
object obj = ResourceManager.GetObject("fechar", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap iniciar {
get {
object obj = ResourceManager.GetObject("iniciar", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap loading {
get {
@ -101,7 +181,17 @@ namespace AgroBase.Properties {
}
/// <summary>
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap localizacao {
get {
object obj = ResourceManager.GetObject("localizacao", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap mcp {
get {
@ -111,7 +201,27 @@ namespace AgroBase.Properties {
}
/// <summary>
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap pasta {
get {
object obj = ResourceManager.GetObject("pasta", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap rede {
get {
object obj = ResourceManager.GetObject("rede", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap robo_superior {
get {
@ -121,7 +231,7 @@ namespace AgroBase.Properties {
}
/// <summary>
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap roda_superior {
get {
@ -131,7 +241,7 @@ namespace AgroBase.Properties {
}
/// <summary>
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap rosa_dos_ventos {
get {
@ -141,7 +251,17 @@ namespace AgroBase.Properties {
}
/// <summary>
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap salvar {
get {
object obj = ResourceManager.GetObject("salvar", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap transferidor {
get {
@ -149,5 +269,15 @@ namespace AgroBase.Properties {
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap voltar {
get {
object obj = ResourceManager.GetObject("voltar", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -145,4 +145,43 @@
<data name="bussola" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\bussola.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="atualizar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\atualizar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="cana" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\cana.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pasta" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\pasta.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="voltar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\voltar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="iniciar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\iniciar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="diagnostico" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\diagnostico.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="fechar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\fechar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="localizacao" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\localizacao.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="desligar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\desligar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="rede" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\rede.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ajustes" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\ajustes.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="salvar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\salvar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="excluir" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\excluir.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@ -87,6 +87,17 @@ with open(caminho_completo_html, 'r+') as arquivo_html:
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"""
@ -243,6 +254,13 @@ with open(caminho_completo_html, 'r+') as arquivo_html:
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
@ -271,8 +289,25 @@ with open(caminho_completo_html, 'r+') as arquivo_html:
adicionarCoordenada("Tj", [novaLongitude, novaLatitude]);
{id_mapa}.setView(novaPosicao, {id_mapa}.getZoom());
}}
else if (topic === '{topico_ruas}') {{
var selecionadas = dados;
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -48,6 +48,7 @@ namespace AgroBase.Services
Variaveis.MqttService.SubscribeAsync(_mqttTopico).ConfigureAwait(false);
tmrProcesso.Start();
pythonProcess = new Process();
pythonProcess = PythonService.RunScript(Script, Argumentos);
pythonProcess.Exited += PythonProcess_Exited;
IniciadoEm = DateTime.Now;

View File

@ -601,6 +601,15 @@ namespace AgroBase.Services
).ConfigureAwait(false);
}
public static void AtualizarRuasSelecionadas(List<string> RuasSelecionadas)
{
Variaveis.MqttService.PublishAsync(
Variaveis.MqttService.Topicos.First(x => x.Topico == MapasVariaveisModel.TopicoSelecaoRuasMapa),
JsonConvert.SerializeObject("[" + string.Join(",", RuasSelecionadas.ToArray()) + "]"),
true
).ConfigureAwait(false);
}
public static List<GPSModel> InterpolarPontos(GPSModel inicio, GPSModel destino, double distanciaPasso)
{
List<GPSModel> pontos = new List<GPSModel>();

View File

@ -134,6 +134,7 @@ namespace AgroBase.Services
public static async Task<bool> VerificaPortaLoRa(SerialPort porta)
{
porta.Close();
porta.BaudRate = 9600;
var comando = ComandoRequisitarParametros();

View File

@ -1,4 +1,5 @@
using AgroBase.Models;
using AgroBase.Forms;
using AgroBase.Models;
using CefSharp.DevTools.Page;
using OpenTK.Audio.OpenAL;
using SharpDX.DirectInput;
@ -16,7 +17,7 @@ namespace AgroBase.Services
public class MKS057DService
{
public static bool Iniciado { get; set; } = false;
public static int TaxaAmostragem { get; set; } = 1000;
public static SerialPort _PortaMKS = new SerialPort();
public static async Task<bool> VerificaPortaMKS(SerialPort porta)
@ -109,6 +110,8 @@ namespace AgroBase.Services
Erro = !Iniciado,
Versao = "HV: " + HV + ", FV: " + FV,
});
ReceberDados().ConfigureAwait(false);
}
public static void EnviarComando(SerialPort _Porta, byte[] Comando)
@ -391,6 +394,32 @@ namespace AgroBase.Services
}
private static async Task<bool> ReceberDados()
{
if (!ModbusService.Iniciado)
{
Iniciado = false;
return false;
}
foreach (var Modulo in Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.Where(x => x.DirMotor.Inicializado))
{
await EnviarComandoRequisicao(Modulo.DirMotor.Endereco);
}
await Task.Delay(TaxaAmostragem);
if (ModbusService.Iniciado)
{
return await ReceberDados();
}
else
{
return false;
}
}
#region METODOS PRINCIPAIS
private static void WriteByteToSerialPort(byte[] data, byte start, byte length)
@ -2000,9 +2029,9 @@ namespace AgroBase.Services
MessageBox.Show("Erro ao decodificar resposta");
break;
}
}
leitura.Iniciado = true;
leitura.Iniciado = true;
}
Respondido = true;
}

View File

@ -48,12 +48,9 @@ namespace AgroBase.Services
Title = "Selecionar arquivo de mapa"
};
if (caminhoArquivo != "" || opfMapa.ShowDialog() == DialogResult.OK)
if (!string.IsNullOrEmpty(caminhoArquivo) || opfMapa.ShowDialog() == DialogResult.OK)
{
if (caminhoArquivo == "")
{
caminhoArquivo = opfMapa.FileName;
}
caminhoArquivo = string.IsNullOrEmpty(caminhoArquivo) ? opfMapa.FileName : caminhoArquivo;
string extensao = "." + caminhoArquivo.Split('.')[caminhoArquivo.Split('.').Length - 1];
NomeArquivos = caminhoArquivo.Split('\\')[caminhoArquivo.Split('\\').Length - 1].Replace(extensao, "");
CaminhoMapa = caminhoArquivo.Replace(NomeArquivos, "").Replace(extensao, "").Replace("\\", "/");

View File

@ -122,9 +122,9 @@ public class MqttService
await _client.DisconnectAsync();
}
public async Task PublishAsync(MqttTopicosModel topic, string message)
public async Task PublishAsync(MqttTopicosModel topic, string message, bool Forcar = false)
{
if (topic.Inscrever)
if (topic.Inscrever && !Forcar)
{
return;
}

View File

@ -33,6 +33,55 @@ namespace AgroBase.Services
public bool Erro { get; set; }
public string Versao { get; set; }
public string Mod_ID { get; set; }
public bool Conectado
{
get
{
bool DispositivoConectado = false;
if (Dispositivo == T_Code.Gps)
{
DispositivoConectado = GPSService.Iniciado;
}
else if (Dispositivo == T_Code.Pzm)
{
DispositivoConectado = PZEMService.Iniciado;
}
else if (Dispositivo == T_Code.Lra)
{
DispositivoConectado = LoRaService.Iniciado;
}
else if (Dispositivo == T_Code.Wit)
{
DispositivoConectado = WT901CService.Iniciado;
}
else if (Dispositivo == T_Code.Bld)
{
DispositivoConectado = Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.Any(x => x.MovMotor.DadosDriver.Iniciado);
}
else
{
IDispositivosService dispositivoService = Variaveis.DispositivosConectados.FirstOrDefault(x => x.Dispositivo == Dispositivo && x._Porta.PortName == PortaCOM);
if (dispositivoService != null)
{
if (!dispositivoService._Porta.IsOpen)
{
if (dispositivoService.Dispositivo != T_Code.Sen || (dispositivoService.Dispositivo == T_Code.Sen && SerialService.DispositivosMapeados.Any(x => x.Dispositivo == T_Code.Lra && !x.Erro)))
{
dispositivoService.btnConectar_Click(new object(), new EventArgs());
}
}
DispositivoConectado = dispositivoService._Porta.IsOpen;
}
else
{
DispositivoConectado = false;
}
}
return DispositivoConectado;
}
}
}
public static List<DispositivoDetalhesModel> DispositivosMapeados = new List<DispositivoDetalhesModel>();
@ -126,7 +175,7 @@ namespace AgroBase.Services
DispositivosMapeados.Remove(Dispositivo);
}
if (!Variaveis.CaminhoSistema.Contains("AgroMonitor"))
if (!Variaveis.IsAgroMonitor)
{
AtualizarDispositivos();
}
@ -164,8 +213,9 @@ namespace AgroBase.Services
private static bool ProcessarRespostaDispositivo(SerialPort Porta)
{
if (Porta.BytesToRead == 0)
if (Porta.BytesToRead <= 15)
{
VerificarRespostaPortasDesconhecidas(Porta);
return false;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
[{"Momento":"2024-07-10T08:39:23.3589694-03:00","Protocolo":"@1;Sen;258;AB3V,1,322,1,500,10,0,-1,0x44,219$","Enviado":true},{"Momento":"2024-07-10T08:39:24.3694897-03:00","Protocolo":"Sen;AB3V nao iniciado, endereco 68 nao encontrado!\r","Enviado":false},{"Momento":"2024-07-10T08:39:24.3804912-03:00","Protocolo":"Sen;#211;AB3V;0$\r","Enviado":false},{"Momento":"2024-07-10T08:39:24.3925012-03:00","Protocolo":"Sen;655;1;$\r","Enviado":false},{"Momento":"2024-07-10T08:39:24.400499-03:00","Protocolo":"@2;Sen;258;AB5V,1,322,1,500,10,0,-1,0x41,219$","Enviado":true},{"Momento":"2024-07-10T08:39:25.4110382-03:00","Protocolo":"Sen;AB5V nao iniciado, endereco 65 nao encontrado!\r","Enviado":false},{"Momento":"2024-07-10T08:39:25.4220386-03:00","Protocolo":"Sen;#211;AB5V;0$\r","Enviado":false},{"Momento":"2024-07-10T08:39:25.4330408-03:00","Protocolo":"Sen;655;2;$\r","Enviado":false},{"Momento":"2024-07-10T08:39:25.4400382-03:00","Protocolo":"@3;Sen;258;AB7V2,1,322,1,500,10,0,-1,0x40,219$","Enviado":true},{"Momento":"2024-07-10T08:39:26.4513499-03:00","Protocolo":"Sen;AB7V2 nao iniciado, endereco 64 nao encontrado!\r","Enviado":false},{"Momento":"2024-07-10T08:39:26.462346-03:00","Protocolo":"Sen;#211;AB7V2;0$\r","Enviado":false},{"Momento":"2024-07-10T08:39:26.4733464-03:00","Protocolo":"Sen;655;3;$\r","Enviado":false},{"Momento":"2024-07-10T08:39:26.4793466-03:00","Protocolo":"@4;Sen;258;AB12V,1,322,1,500,10,0,-1,0x45,226$","Enviado":true},{"Momento":"2024-07-10T08:39:27.4902106-03:00","Protocolo":"Sen;AB12V nao iniciado, endereco 69 nao encontrado!\r","Enviado":false},{"Momento":"2024-07-10T08:39:27.5012083-03:00","Protocolo":"Sen;#211;AB12V;0$\r","Enviado":false},{"Momento":"2024-07-10T08:40:01.4208361-03:00","Protocolo":"@5;Sen;258;LEDMN,1,0,4$","Enviado":true},{"Momento":"2024-07-10T08:40:01.443839-03:00","Protocolo":"Sen;655;4;$\r","Enviado":false},{"Momento":"2024-07-10T08:40:17.027587-03:00","Protocolo":"@9;Sen;258;AB3V,1,322,1,500,10,0,-1,0x44,219$","Enviado":true},{"Momento":"2024-07-10T08:40:40.5801669-03:00","Protocolo":"@17;Sen;258;AB3V,1,322,1,500,10,0,-1,0x44,219$","Enviado":true},{"Momento":"2024-07-10T08:40:41.5919103-03:00","Protocolo":"Sen;AB3V nao iniciado, endereco 68 nao encontrado!\r","Enviado":false},{"Momento":"2024-07-10T08:40:41.6029108-03:00","Protocolo":"Sen;#211;AB3V;0$\r","Enviado":false},{"Momento":"2024-07-10T08:40:41.6129005-03:00","Protocolo":"Sen;655;17;$\r","Enviado":false},{"Momento":"2024-07-10T08:40:41.6179-03:00","Protocolo":"@18;Sen;258;AB5V,1,322,1,500,10,0,-1,0x41,219$","Enviado":true},{"Momento":"2024-07-10T08:40:42.6291612-03:00","Protocolo":"Sen;AB5V nao iniciado, endereco 65 nao encontrado!\r","Enviado":false},{"Momento":"2024-07-10T08:40:42.6401643-03:00","Protocolo":"Sen;#211;AB5V;0$\r","Enviado":false},{"Momento":"2024-07-10T08:40:42.6511698-03:00","Protocolo":"Sen;655;18;$\r","Enviado":false}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"Modulo_ID":"Atu","RequisitarDados":false,"Conectado":false,"QuantidadeBicos":4,"DensidadeHerbicida":1.05,"CapacidadeReservatorio":30.0,"AtuacaoNivelAlto":true,"BicosPulverizadores":[{"ID":"B01","Posicao":1,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":17.1964398137526},{"ID":"B02","Posicao":2,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":14.876485059544191},{"ID":"B03","Posicao":3,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":18.103588945512129},{"ID":"B04","Posicao":4,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":18.437319738098896}],"BombaPressurizadora":{"ID":"BOMBA","BombaAtuada":false,"Ligado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[14,35,36,37,5],"PressaoSP":85.0,"Pressao":46.61,"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":[0.0,0.0],"ValorMinimo":0.0,"ValorMaximo":25222.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":[2010623.62],"ValorMinimo":-1.281631101976581E+32,"ValorMaximo":2.8836731440342142E+24,"LimiteMaximo":50.0,"LimiteMinimo":5.0},{"LogGrafico":[],"ID":"PRSLN","Prioridade":3,"Descricao":"Pressão na linha principal","Componente":333,"Aferir":true,"DelayAmostragem":1000,"Inicializado":true,"Testando":false,"Funcoes":[24],"Parametros":[["Vmin","000.00"],["Vmax","004.50"],["Pmax","174.04"]],"UnidadeMedida":"psi","Leituras":[46.61],"ValorMinimo":0.0,"ValorMaximo":127.63,"LimiteMaximo":120.0,"LimiteMinimo":60.0}],"PercentualInicioPulverizacao":0.3,"ScriptDeteccaoErvas":"weed-detector-v7.py","_MassaRef":0.8,"_MassaLeituraRef":40876.37,"_MassaLeituraExtra":1895800.0,"_MassaLeitura":2010623.62,"MassaReservatorio":-2.2472371201258845,"VolumeReservatorio":-2.1402258286913183,"PercentualReservatorio":-7.1340860956377279,"VolumeVazaoAferido":102.0,"_FluxoMlRef":102.0,"_FluxoPulsoRef":80.0,"_LeituraPulsos":0,"_LeituraPeriodo":0,"VazaoFluxoMLpS":0.0,"VolumeVazaoML":978.53188147416961,"_PressaoVmin":0.0,"_PressaoVmax":4.5,"_PressaoMax":174.045,"_LeituraPressao":1495.64,"PressaoLinha":46.61,"PressaoLinhaCalc":46.616122129426124}
{"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":17.1964398137526},{"ID":"B02","Posicao":2,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":14.876485059544191},{"ID":"B03","Posicao":3,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":18.103588945512129},{"ID":"B04","Posicao":4,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":18.437319738098896}],"BombaPressurizadora":{"ID":"BOMBA","BombaAtuada":false,"Ligado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[14,35,36,37,5],"Pressao":46.61,"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":[0.0,0.0],"ValorMinimo":0.0,"ValorMaximo":25222.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":[2010623.62],"ValorMinimo":-1.281631101976581E+32,"ValorMaximo":2.8836731440342142E+24,"LimiteMaximo":50.0,"LimiteMinimo":5.0},{"LogGrafico":[],"ID":"PRSLN","Prioridade":3,"Descricao":"Pressão na linha principal","Componente":333,"Aferir":true,"DelayAmostragem":1000,"Inicializado":true,"Testando":false,"Funcoes":[24],"Parametros":[["Vmin","000.00"],["Vmax","004.50"],["Pmax","174.04"]],"UnidadeMedida":"psi","Leituras":[46.61],"ValorMinimo":0.0,"ValorMaximo":127.63,"LimiteMaximo":120.0,"LimiteMinimo":60.0}],"ScriptDeteccaoErvas":"weed-detector-v7.py","_MassaRef":0.8,"_MassaLeituraRef":40876.37,"_MassaLeituraExtra":1895800.0,"_MassaLeitura":2010623.62,"MassaReservatorio":-2.2472371201258845,"VolumeReservatorio":-2.1402258286913183,"PercentualReservatorio":-7.1340860956377279,"VolumeVazaoAferido":102.0,"_FluxoMlRef":102.0,"_FluxoPulsoRef":80.0,"_LeituraPulsos":0,"_LeituraPeriodo":0,"VazaoFluxoMLpS":0.0,"VolumeVazaoML":0.0,"_PressaoVmin":0.0,"_PressaoVmax":4.5,"_PressaoMax":174.045,"_LeituraPressao":1495.64,"PressaoLinha":46.61,"PressaoLinhaCalc":46.616122129426124}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"ExpansorGPIO":false,"EnderecoExpansor":"","Pinos":[{"Controlador":1,"Barramento":0,"Pino":99,"Descricao":"1","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":98,"Descricao":"2","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":36,"Descricao":"3","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":39,"Descricao":"4","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":34,"Descricao":"5","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":35,"Descricao":"6","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":32,"Descricao":"7","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":33,"Descricao":"8","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":25,"Descricao":"9","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":26,"Descricao":"10","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":27,"Descricao":"11","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":14,"Descricao":"12","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":12,"Descricao":"13","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":97,"Descricao":"14","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":13,"Descricao":"15","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":9,"Descricao":"16","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":10,"Descricao":"17","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":11,"Descricao":"18","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":96,"Descricao":"19","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":6,"Descricao":"26","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":7,"Descricao":"27","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":8,"Descricao":"28","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":15,"Descricao":"29","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":2,"Descricao":"30","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":0,"Descricao":"31","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":4,"Descricao":"32","Funcao":38,"Habilitado":true,"ComponenteID":"LEDMN"},{"Controlador":1,"Barramento":0,"Pino":16,"Descricao":"33","Funcao":38,"Habilitado":true,"ComponenteID":"LEDAT"},{"Controlador":1,"Barramento":0,"Pino":17,"Descricao":"34","Funcao":38,"Habilitado":true,"ComponenteID":"LEDOP"},{"Controlador":1,"Barramento":0,"Pino":5,"Descricao":"35","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":18,"Descricao":"36","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":19,"Descricao":"37","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":95,"Descricao":"38","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":21,"Descricao":"39","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":3,"Descricao":"40","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":1,"Descricao":"41","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":22,"Descricao":"42","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":23,"Descricao":"43","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":94,"Descricao":"44","Funcao":0,"Habilitado":false,"ComponenteID":""}]}
{"ExpansorGPIO":false,"EnderecoExpansor":"","Pinos":[{"Controlador":1,"Barramento":0,"Pino":99,"Descricao":"1","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":98,"Descricao":"2","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":36,"Descricao":"3","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":39,"Descricao":"4","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":34,"Descricao":"5","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":35,"Descricao":"6","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":32,"Descricao":"7","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":33,"Descricao":"8","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":25,"Descricao":"9","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":26,"Descricao":"10","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":27,"Descricao":"11","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":14,"Descricao":"12","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":12,"Descricao":"13","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":97,"Descricao":"14","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":13,"Descricao":"15","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":9,"Descricao":"16","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":10,"Descricao":"17","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":11,"Descricao":"18","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":96,"Descricao":"19","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":6,"Descricao":"26","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":7,"Descricao":"27","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":8,"Descricao":"28","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":15,"Descricao":"29","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":2,"Descricao":"30","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":0,"Descricao":"31","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":4,"Descricao":"32","Funcao":38,"Habilitado":true,"ComponenteID":"LEDMN"},{"Controlador":1,"Barramento":0,"Pino":16,"Descricao":"33","Funcao":38,"Habilitado":true,"ComponenteID":"LEDAT"},{"Controlador":1,"Barramento":0,"Pino":17,"Descricao":"34","Funcao":38,"Habilitado":true,"ComponenteID":"LEDOP"},{"Controlador":1,"Barramento":0,"Pino":5,"Descricao":"35","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":18,"Descricao":"36","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":19,"Descricao":"37","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":95,"Descricao":"38","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":21,"Descricao":"39","Funcao":33,"Habilitado":true,"ComponenteID":"Sen"},{"Controlador":1,"Barramento":0,"Pino":3,"Descricao":"40","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":1,"Descricao":"41","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Controlador":1,"Barramento":0,"Pino":22,"Descricao":"42","Funcao":34,"Habilitado":true,"ComponenteID":"Sen"},{"Controlador":1,"Barramento":0,"Pino":23,"Descricao":"43","Funcao":4,"Habilitado":true,"ComponenteID":"Sen"},{"Controlador":1,"Barramento":0,"Pino":94,"Descricao":"44","Funcao":0,"Habilitado":false,"ComponenteID":""}]}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,112 @@
[
{
"timestamp": 1720792265.1483266,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1720792265.1863298,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 0,
"descricao": "weed",
"x": 8,
"y": 217,
"largura": 488,
"altura": 261,
"confianca": 0.37255859375
}
]
},
{
"timestamp": 1720792265.2258418,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 0,
"descricao": "weed",
"x": 8,
"y": 217,
"largura": 488,
"altura": 261,
"confianca": 0.37255859375
}
]
},
{
"timestamp": 1720792265.268842,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 0,
"descricao": "weed",
"x": 10,
"y": 217,
"largura": 484,
"altura": 260,
"confianca": 0.259521484375
}
]
},
{
"timestamp": 1720792265.3103592,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 0,
"descricao": "weed",
"x": 7,
"y": 218,
"largura": 495,
"altura": 260,
"confianca": 0.38037109375
}
]
},
{
"timestamp": 1720792265.3493602,
"x_max": 640.0,
"y_max": 480.0,
"objetos": [
{
"id": 0,
"descricao": "weed",
"x": 7,
"y": 218,
"largura": 495,
"altura": 260,
"confianca": 0.38037109375
}
]
},
{
"timestamp": 1720792265.3853674,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1720792265.4218738,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1720792265.457874,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1720792265.498396,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
}
]

View File

@ -0,0 +1,62 @@
[
{
"timestamp": 1720813300.7637486,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1720813300.798267,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1720813300.832266,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1720813300.8652663,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1720813300.9017835,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1720813300.9357924,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1720813300.9717884,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1720813301.0073028,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1720813301.0563085,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1720813301.110864,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
}
]

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because one or more lines are too long

View File

@ -87,6 +87,17 @@ with open(caminho_completo_html, 'r+') as arquivo_html:
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"""
@ -243,6 +254,13 @@ with open(caminho_completo_html, 'r+') as arquivo_html:
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
@ -271,8 +289,25 @@ with open(caminho_completo_html, 'r+') as arquivo_html:
adicionarCoordenada("Tj", [novaLongitude, novaLatitude]);
{id_mapa}.setView(novaPosicao, {id_mapa}.getZoom());
}}
else if (topic === '{topico_ruas}') {{
var selecionadas = dados;
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

View File

@ -1 +1 @@
58884735b1d4182bf9da87e3d317e8cb10ba3ade748bdea766548bfee2967a8e
0c695cd57cad231400810d60deb1c8f75621a0ff4e838c8ff79a964355874c9c

View File

@ -450,3 +450,5 @@ C:\ZendionINC\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmBLD.res
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmMvdConfig.resources
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.csproj.CopyComplete
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmMKS.resources
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.IHM.frmDialogoMapa.resources
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.IHM.frmAjustes.resources

View File

@ -33,6 +33,10 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CefSharp.WinForms, Version=119.4.30.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138" />
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@ -46,6 +50,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Forms\frmAjustesOperacao.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\frmAjustesOperacao.Designer.cs">
<DependentUpon>frmAjustesOperacao.cs</DependentUpon>
</Compile>
<Compile Include="frmInicial.cs">
<SubType>Form</SubType>
</Compile>
@ -55,6 +65,9 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="VariaveisMonitoramento.cs" />
<EmbeddedResource Include="Forms\frmAjustesOperacao.resx">
<DependentUpon>frmAjustesOperacao.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmInicial.resx">
<DependentUpon>frmInicial.cs</DependentUpon>
</EmbeddedResource>
@ -66,7 +79,9 @@
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@ -86,5 +101,14 @@
<Name>AgroBase</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Imagens\ajustes.png" />
</ItemGroup>
<ItemGroup>
<None Include="Imagens\rastreamento.png" />
</ItemGroup>
<ItemGroup>
<None Include="Imagens\rede.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,872 @@
namespace AgroMonitor.Forms
{
partial class frmAjustesOperacao
{
/// <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.gpbModulos = new System.Windows.Forms.GroupBox();
this.pnlModulos = new System.Windows.Forms.Panel();
this.rtbLRA = new System.Windows.Forms.RichTextBox();
this.chbLra = new System.Windows.Forms.CheckBox();
this.rtbATU = new System.Windows.Forms.RichTextBox();
this.chbMvd = new System.Windows.Forms.CheckBox();
this.chbAtu = new System.Windows.Forms.CheckBox();
this.rtbMVD = new System.Windows.Forms.RichTextBox();
this.rtbGPS = new System.Windows.Forms.RichTextBox();
this.chbMks = new System.Windows.Forms.CheckBox();
this.chbGps = new System.Windows.Forms.CheckBox();
this.rtbMKS = new System.Windows.Forms.RichTextBox();
this.rtbWIT = new System.Windows.Forms.RichTextBox();
this.chbSen = new System.Windows.Forms.CheckBox();
this.chbWit = new System.Windows.Forms.CheckBox();
this.rtbSEN = new System.Windows.Forms.RichTextBox();
this.rtbPZM = new System.Windows.Forms.RichTextBox();
this.chbPzm = new System.Windows.Forms.CheckBox();
this.cmbModosOperacao = new System.Windows.Forms.ComboBox();
this.lblModoOperacao = new System.Windows.Forms.Label();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabParametros = new System.Windows.Forms.TabPage();
this.btnProximo = new System.Windows.Forms.Button();
this.gpbAtuador = new System.Windows.Forms.GroupBox();
this.lblMs = new System.Windows.Forms.Label();
this.txtDuracaoAtuacao = new System.Windows.Forms.TextBox();
this.lblDuracaoAtuacao = new System.Windows.Forms.Label();
this.lblPsi = new System.Windows.Forms.Label();
this.txtPressaoLinha = new System.Windows.Forms.TextBox();
this.lblPressaoLinha = new System.Windows.Forms.Label();
this.lblPercentualAtuacao2 = new System.Windows.Forms.Label();
this.lblLitros = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.txtCapacidadeReservatorio = new System.Windows.Forms.TextBox();
this.txtPercentualAtuacao = new System.Windows.Forms.TextBox();
this.lblCapacidadeReservatorio = new System.Windows.Forms.Label();
this.lblPercentualAtuacao1 = new System.Windows.Forms.Label();
this.gpbDirecional = new System.Windows.Forms.GroupBox();
this.lblPercentual1 = new System.Windows.Forms.Label();
this.lblAngulo = new System.Windows.Forms.Label();
this.txtVelocidadeDirecional = new System.Windows.Forms.TextBox();
this.txtAnguloMaximo = new System.Windows.Forms.TextBox();
this.lblVelocidadeDirecional = new System.Windows.Forms.Label();
this.lblAnguloMaximo = new System.Windows.Forms.Label();
this.gpbLocomocao = new System.Windows.Forms.GroupBox();
this.lblKmh2 = new System.Windows.Forms.Label();
this.lblKmh1 = new System.Windows.Forms.Label();
this.txtVelocidadeComErvas = new System.Windows.Forms.TextBox();
this.txtVelocidadeSemErvas = new System.Windows.Forms.TextBox();
this.lblVelocidadeComErvas = new System.Windows.Forms.Label();
this.lblVelocidadeSemErvas = new System.Windows.Forms.Label();
this.tabMapa = new System.Windows.Forms.TabPage();
this.lblTempoEstimado = new System.Windows.Forms.Label();
this.lblDistanciaOperacao = new System.Windows.Forms.Label();
this.lblDistanciaTotal = new System.Windows.Forms.Label();
this.btnCarregarMapa = new System.Windows.Forms.Button();
this.lblMapaCarregado = new System.Windows.Forms.Label();
this.pnlMapa = new System.Windows.Forms.Panel();
this.btnSalvar = new System.Windows.Forms.Button();
this.btnCarregar = new System.Windows.Forms.Button();
this.txtDescricao = new System.Windows.Forms.TextBox();
this.lblDescricao = new System.Windows.Forms.Label();
this.gpbModulos.SuspendLayout();
this.pnlModulos.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabParametros.SuspendLayout();
this.gpbAtuador.SuspendLayout();
this.gpbDirecional.SuspendLayout();
this.gpbLocomocao.SuspendLayout();
this.tabMapa.SuspendLayout();
this.SuspendLayout();
//
// gpbModulos
//
this.gpbModulos.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.gpbModulos.Controls.Add(this.pnlModulos);
this.gpbModulos.Location = new System.Drawing.Point(12, 12);
this.gpbModulos.Name = "gpbModulos";
this.gpbModulos.Size = new System.Drawing.Size(216, 500);
this.gpbModulos.TabIndex = 0;
this.gpbModulos.TabStop = false;
this.gpbModulos.Text = "Módulos";
//
// pnlModulos
//
this.pnlModulos.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.pnlModulos.AutoScroll = true;
this.pnlModulos.Controls.Add(this.rtbLRA);
this.pnlModulos.Controls.Add(this.chbLra);
this.pnlModulos.Controls.Add(this.rtbATU);
this.pnlModulos.Controls.Add(this.chbMvd);
this.pnlModulos.Controls.Add(this.chbAtu);
this.pnlModulos.Controls.Add(this.rtbMVD);
this.pnlModulos.Controls.Add(this.rtbGPS);
this.pnlModulos.Controls.Add(this.chbMks);
this.pnlModulos.Controls.Add(this.chbGps);
this.pnlModulos.Controls.Add(this.rtbMKS);
this.pnlModulos.Controls.Add(this.rtbWIT);
this.pnlModulos.Controls.Add(this.chbSen);
this.pnlModulos.Controls.Add(this.chbWit);
this.pnlModulos.Controls.Add(this.rtbSEN);
this.pnlModulos.Controls.Add(this.rtbPZM);
this.pnlModulos.Controls.Add(this.chbPzm);
this.pnlModulos.Location = new System.Drawing.Point(6, 19);
this.pnlModulos.Name = "pnlModulos";
this.pnlModulos.Size = new System.Drawing.Size(204, 475);
this.pnlModulos.TabIndex = 6;
//
// rtbLRA
//
this.rtbLRA.BackColor = System.Drawing.SystemColors.Control;
this.rtbLRA.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbLRA.Location = new System.Drawing.Point(3, 524);
this.rtbLRA.Name = "rtbLRA";
this.rtbLRA.ReadOnly = true;
this.rtbLRA.Size = new System.Drawing.Size(174, 42);
this.rtbLRA.TabIndex = 14;
this.rtbLRA.Text = "Responsável pela comunicação entre o equipamento e a base central de controle";
//
// chbLra
//
this.chbLra.AutoSize = true;
this.chbLra.BackColor = System.Drawing.SystemColors.Control;
this.chbLra.Location = new System.Drawing.Point(3, 501);
this.chbLra.Name = "chbLra";
this.chbLra.Size = new System.Drawing.Size(47, 17);
this.chbLra.TabIndex = 15;
this.chbLra.Text = "LRA";
this.chbLra.UseVisualStyleBackColor = false;
this.chbLra.CheckedChanged += new System.EventHandler(this.chbModulo_CheckedChanged);
//
// rtbATU
//
this.rtbATU.BackColor = System.Drawing.SystemColors.Control;
this.rtbATU.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbATU.Location = new System.Drawing.Point(3, 459);
this.rtbATU.Name = "rtbATU";
this.rtbATU.ReadOnly = true;
this.rtbATU.Size = new System.Drawing.Size(174, 36);
this.rtbATU.TabIndex = 12;
this.rtbATU.Text = "Responsável pelo controle do pulverizador";
//
// chbMvd
//
this.chbMvd.AutoSize = true;
this.chbMvd.Location = new System.Drawing.Point(3, 4);
this.chbMvd.Name = "chbMvd";
this.chbMvd.Size = new System.Drawing.Size(50, 17);
this.chbMvd.TabIndex = 1;
this.chbMvd.Text = "MVD";
this.chbMvd.UseVisualStyleBackColor = true;
this.chbMvd.CheckedChanged += new System.EventHandler(this.chbModulo_CheckedChanged);
//
// chbAtu
//
this.chbAtu.AutoSize = true;
this.chbAtu.BackColor = System.Drawing.SystemColors.Control;
this.chbAtu.Location = new System.Drawing.Point(3, 436);
this.chbAtu.Name = "chbAtu";
this.chbAtu.Size = new System.Drawing.Size(48, 17);
this.chbAtu.TabIndex = 13;
this.chbAtu.Text = "ATU";
this.chbAtu.UseVisualStyleBackColor = false;
this.chbAtu.CheckedChanged += new System.EventHandler(this.chbModulo_CheckedChanged);
//
// rtbMVD
//
this.rtbMVD.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbMVD.Location = new System.Drawing.Point(3, 27);
this.rtbMVD.Name = "rtbMVD";
this.rtbMVD.ReadOnly = true;
this.rtbMVD.Size = new System.Drawing.Size(174, 35);
this.rtbMVD.TabIndex = 1;
this.rtbMVD.Text = "Responsável pela locomoção do equipamento";
//
// rtbGPS
//
this.rtbGPS.BackColor = System.Drawing.SystemColors.Control;
this.rtbGPS.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbGPS.Location = new System.Drawing.Point(3, 394);
this.rtbGPS.Name = "rtbGPS";
this.rtbGPS.ReadOnly = true;
this.rtbGPS.Size = new System.Drawing.Size(174, 36);
this.rtbGPS.TabIndex = 10;
this.rtbGPS.Text = "Responsável pelo monitoramento da posição geográfica do equipamento";
//
// chbMks
//
this.chbMks.AutoSize = true;
this.chbMks.Location = new System.Drawing.Point(3, 68);
this.chbMks.Name = "chbMks";
this.chbMks.Size = new System.Drawing.Size(49, 17);
this.chbMks.TabIndex = 3;
this.chbMks.Text = "MKS";
this.chbMks.UseVisualStyleBackColor = true;
this.chbMks.CheckedChanged += new System.EventHandler(this.chbModulo_CheckedChanged);
//
// chbGps
//
this.chbGps.AutoSize = true;
this.chbGps.BackColor = System.Drawing.SystemColors.Control;
this.chbGps.Location = new System.Drawing.Point(3, 371);
this.chbGps.Name = "chbGps";
this.chbGps.Size = new System.Drawing.Size(48, 17);
this.chbGps.TabIndex = 11;
this.chbGps.Text = "GPS";
this.chbGps.UseVisualStyleBackColor = false;
this.chbGps.CheckedChanged += new System.EventHandler(this.chbModulo_CheckedChanged);
//
// rtbMKS
//
this.rtbMKS.BackColor = System.Drawing.SystemColors.Control;
this.rtbMKS.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbMKS.Location = new System.Drawing.Point(3, 91);
this.rtbMKS.Name = "rtbMKS";
this.rtbMKS.ReadOnly = true;
this.rtbMKS.Size = new System.Drawing.Size(174, 35);
this.rtbMKS.TabIndex = 2;
this.rtbMKS.Text = "Responsável pelo controle direcional do equipamento";
//
// rtbWIT
//
this.rtbWIT.BackColor = System.Drawing.SystemColors.Control;
this.rtbWIT.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbWIT.Location = new System.Drawing.Point(3, 320);
this.rtbWIT.Name = "rtbWIT";
this.rtbWIT.ReadOnly = true;
this.rtbWIT.Size = new System.Drawing.Size(174, 45);
this.rtbWIT.TabIndex = 8;
this.rtbWIT.Text = "Responsável exclusivamente pelo monitramento da orientação e inclinação do equipa" +
"mento";
//
// chbSen
//
this.chbSen.AutoSize = true;
this.chbSen.BackColor = System.Drawing.SystemColors.Control;
this.chbSen.Location = new System.Drawing.Point(3, 132);
this.chbSen.Name = "chbSen";
this.chbSen.Size = new System.Drawing.Size(48, 17);
this.chbSen.TabIndex = 5;
this.chbSen.Text = "SEN";
this.chbSen.UseVisualStyleBackColor = false;
this.chbSen.CheckedChanged += new System.EventHandler(this.chbModulo_CheckedChanged);
//
// chbWit
//
this.chbWit.AutoSize = true;
this.chbWit.BackColor = System.Drawing.SystemColors.Control;
this.chbWit.Location = new System.Drawing.Point(3, 297);
this.chbWit.Name = "chbWit";
this.chbWit.Size = new System.Drawing.Size(47, 17);
this.chbWit.TabIndex = 9;
this.chbWit.Text = "WIT";
this.chbWit.UseVisualStyleBackColor = false;
this.chbWit.CheckedChanged += new System.EventHandler(this.chbModulo_CheckedChanged);
//
// rtbSEN
//
this.rtbSEN.BackColor = System.Drawing.SystemColors.Control;
this.rtbSEN.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbSEN.Location = new System.Drawing.Point(3, 155);
this.rtbSEN.Name = "rtbSEN";
this.rtbSEN.ReadOnly = true;
this.rtbSEN.Size = new System.Drawing.Size(174, 62);
this.rtbSEN.TabIndex = 4;
this.rtbSEN.Text = "Responsável pelo monitoramento dos sensores gerais do equipamento, como também do" +
"s sinaleiros indicativos";
//
// rtbPZM
//
this.rtbPZM.BackColor = System.Drawing.SystemColors.Control;
this.rtbPZM.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbPZM.Location = new System.Drawing.Point(3, 246);
this.rtbPZM.Name = "rtbPZM";
this.rtbPZM.ReadOnly = true;
this.rtbPZM.Size = new System.Drawing.Size(174, 45);
this.rtbPZM.TabIndex = 6;
this.rtbPZM.Text = "Responsável exclusivamente pelo monitoramento da bateria do equipamento";
//
// chbPzm
//
this.chbPzm.AutoSize = true;
this.chbPzm.BackColor = System.Drawing.SystemColors.Control;
this.chbPzm.Location = new System.Drawing.Point(3, 223);
this.chbPzm.Name = "chbPzm";
this.chbPzm.Size = new System.Drawing.Size(49, 17);
this.chbPzm.TabIndex = 7;
this.chbPzm.Text = "PZM";
this.chbPzm.UseVisualStyleBackColor = false;
this.chbPzm.CheckedChanged += new System.EventHandler(this.chbModulo_CheckedChanged);
//
// cmbModosOperacao
//
this.cmbModosOperacao.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbModosOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cmbModosOperacao.FormattingEnabled = true;
this.cmbModosOperacao.Location = new System.Drawing.Point(234, 39);
this.cmbModosOperacao.Name = "cmbModosOperacao";
this.cmbModosOperacao.Size = new System.Drawing.Size(171, 24);
this.cmbModosOperacao.TabIndex = 1;
this.cmbModosOperacao.SelectedIndexChanged += new System.EventHandler(this.cmbModosOperacao_SelectedIndexChanged);
//
// lblModoOperacao
//
this.lblModoOperacao.AutoSize = true;
this.lblModoOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblModoOperacao.Location = new System.Drawing.Point(230, 12);
this.lblModoOperacao.Name = "lblModoOperacao";
this.lblModoOperacao.Size = new System.Drawing.Size(175, 24);
this.lblModoOperacao.TabIndex = 2;
this.lblModoOperacao.Text = "Modo de Operação";
//
// tabControl1
//
this.tabControl1.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.tabControl1.Controls.Add(this.tabParametros);
this.tabControl1.Controls.Add(this.tabMapa);
this.tabControl1.Location = new System.Drawing.Point(234, 69);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(572, 443);
this.tabControl1.TabIndex = 3;
//
// tabParametros
//
this.tabParametros.Controls.Add(this.btnProximo);
this.tabParametros.Controls.Add(this.gpbAtuador);
this.tabParametros.Controls.Add(this.gpbDirecional);
this.tabParametros.Controls.Add(this.gpbLocomocao);
this.tabParametros.Location = new System.Drawing.Point(4, 22);
this.tabParametros.Name = "tabParametros";
this.tabParametros.Padding = new System.Windows.Forms.Padding(3);
this.tabParametros.Size = new System.Drawing.Size(564, 417);
this.tabParametros.TabIndex = 0;
this.tabParametros.Text = "Parâmetros";
this.tabParametros.UseVisualStyleBackColor = true;
//
// btnProximo
//
this.btnProximo.Location = new System.Drawing.Point(481, 388);
this.btnProximo.Name = "btnProximo";
this.btnProximo.Size = new System.Drawing.Size(75, 23);
this.btnProximo.TabIndex = 10;
this.btnProximo.Text = "Próximo";
this.btnProximo.UseVisualStyleBackColor = true;
this.btnProximo.Click += new System.EventHandler(this.btnProximo_Click);
//
// gpbAtuador
//
this.gpbAtuador.Controls.Add(this.lblMs);
this.gpbAtuador.Controls.Add(this.txtDuracaoAtuacao);
this.gpbAtuador.Controls.Add(this.lblDuracaoAtuacao);
this.gpbAtuador.Controls.Add(this.lblPsi);
this.gpbAtuador.Controls.Add(this.txtPressaoLinha);
this.gpbAtuador.Controls.Add(this.lblPressaoLinha);
this.gpbAtuador.Controls.Add(this.lblPercentualAtuacao2);
this.gpbAtuador.Controls.Add(this.lblLitros);
this.gpbAtuador.Controls.Add(this.label11);
this.gpbAtuador.Controls.Add(this.txtCapacidadeReservatorio);
this.gpbAtuador.Controls.Add(this.txtPercentualAtuacao);
this.gpbAtuador.Controls.Add(this.lblCapacidadeReservatorio);
this.gpbAtuador.Controls.Add(this.lblPercentualAtuacao1);
this.gpbAtuador.Location = new System.Drawing.Point(6, 194);
this.gpbAtuador.Name = "gpbAtuador";
this.gpbAtuador.Size = new System.Drawing.Size(550, 166);
this.gpbAtuador.TabIndex = 7;
this.gpbAtuador.TabStop = false;
this.gpbAtuador.Text = "Atuador";
//
// lblMs
//
this.lblMs.AutoSize = true;
this.lblMs.Location = new System.Drawing.Point(484, 129);
this.lblMs.Name = "lblMs";
this.lblMs.Size = new System.Drawing.Size(20, 13);
this.lblMs.TabIndex = 12;
this.lblMs.Text = "ms";
//
// txtDuracaoAtuacao
//
this.txtDuracaoAtuacao.Location = new System.Drawing.Point(358, 126);
this.txtDuracaoAtuacao.Name = "txtDuracaoAtuacao";
this.txtDuracaoAtuacao.Size = new System.Drawing.Size(100, 20);
this.txtDuracaoAtuacao.TabIndex = 9;
this.txtDuracaoAtuacao.Text = "500";
this.txtDuracaoAtuacao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblDuracaoAtuacao
//
this.lblDuracaoAtuacao.AutoSize = true;
this.lblDuracaoAtuacao.Location = new System.Drawing.Point(6, 129);
this.lblDuracaoAtuacao.Name = "lblDuracaoAtuacao";
this.lblDuracaoAtuacao.Size = new System.Drawing.Size(332, 13);
this.lblDuracaoAtuacao.TabIndex = 10;
this.lblDuracaoAtuacao.Text = "Duração de atuação do bico pulverizador ao identificar erva no radar";
//
// lblPsi
//
this.lblPsi.AutoSize = true;
this.lblPsi.Location = new System.Drawing.Point(484, 94);
this.lblPsi.Name = "lblPsi";
this.lblPsi.Size = new System.Drawing.Size(21, 13);
this.lblPsi.TabIndex = 9;
this.lblPsi.Text = "Psi";
//
// txtPressaoLinha
//
this.txtPressaoLinha.Location = new System.Drawing.Point(358, 91);
this.txtPressaoLinha.Name = "txtPressaoLinha";
this.txtPressaoLinha.Size = new System.Drawing.Size(100, 20);
this.txtPressaoLinha.TabIndex = 8;
this.txtPressaoLinha.Text = "85";
this.txtPressaoLinha.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblPressaoLinha
//
this.lblPressaoLinha.AutoSize = true;
this.lblPressaoLinha.Location = new System.Drawing.Point(6, 94);
this.lblPressaoLinha.Name = "lblPressaoLinha";
this.lblPressaoLinha.Size = new System.Drawing.Size(188, 13);
this.lblPressaoLinha.TabIndex = 7;
this.lblPressaoLinha.Text = "Pressão de setpoint da linha hidráulica";
//
// lblPercentualAtuacao2
//
this.lblPercentualAtuacao2.AutoSize = true;
this.lblPercentualAtuacao2.Location = new System.Drawing.Point(6, 34);
this.lblPercentualAtuacao2.Name = "lblPercentualAtuacao2";
this.lblPercentualAtuacao2.Size = new System.Drawing.Size(211, 13);
this.lblPercentualAtuacao2.TabIndex = 6;
this.lblPercentualAtuacao2.Text = "para acionamento dos bicos pulverizadores";
//
// lblLitros
//
this.lblLitros.AutoSize = true;
this.lblLitros.Location = new System.Drawing.Point(484, 58);
this.lblLitros.Name = "lblLitros";
this.lblLitros.Size = new System.Drawing.Size(13, 13);
this.lblLitros.TabIndex = 5;
this.lblLitros.Text = "L";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(484, 21);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(15, 13);
this.label11.TabIndex = 4;
this.label11.Text = "%";
//
// txtCapacidadeReservatorio
//
this.txtCapacidadeReservatorio.Location = new System.Drawing.Point(358, 55);
this.txtCapacidadeReservatorio.Name = "txtCapacidadeReservatorio";
this.txtCapacidadeReservatorio.Size = new System.Drawing.Size(100, 20);
this.txtCapacidadeReservatorio.TabIndex = 7;
this.txtCapacidadeReservatorio.Text = "30";
this.txtCapacidadeReservatorio.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// txtPercentualAtuacao
//
this.txtPercentualAtuacao.Location = new System.Drawing.Point(358, 18);
this.txtPercentualAtuacao.Name = "txtPercentualAtuacao";
this.txtPercentualAtuacao.Size = new System.Drawing.Size(100, 20);
this.txtPercentualAtuacao.TabIndex = 6;
this.txtPercentualAtuacao.Text = "30";
this.txtPercentualAtuacao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblCapacidadeReservatorio
//
this.lblCapacidadeReservatorio.AutoSize = true;
this.lblCapacidadeReservatorio.Location = new System.Drawing.Point(6, 58);
this.lblCapacidadeReservatorio.Name = "lblCapacidadeReservatorio";
this.lblCapacidadeReservatorio.Size = new System.Drawing.Size(236, 13);
this.lblCapacidadeReservatorio.TabIndex = 1;
this.lblCapacidadeReservatorio.Text = "Capacidade máxima do reservatório de herbicida";
//
// lblPercentualAtuacao1
//
this.lblPercentualAtuacao1.AutoSize = true;
this.lblPercentualAtuacao1.Location = new System.Drawing.Point(6, 21);
this.lblPercentualAtuacao1.Name = "lblPercentualAtuacao1";
this.lblPercentualAtuacao1.Size = new System.Drawing.Size(268, 13);
this.lblPercentualAtuacao1.TabIndex = 0;
this.lblPercentualAtuacao1.Text = "Percentual na vertical para detecção de ervas no radar";
//
// gpbDirecional
//
this.gpbDirecional.Controls.Add(this.lblPercentual1);
this.gpbDirecional.Controls.Add(this.lblAngulo);
this.gpbDirecional.Controls.Add(this.txtVelocidadeDirecional);
this.gpbDirecional.Controls.Add(this.txtAnguloMaximo);
this.gpbDirecional.Controls.Add(this.lblVelocidadeDirecional);
this.gpbDirecional.Controls.Add(this.lblAnguloMaximo);
this.gpbDirecional.Location = new System.Drawing.Point(6, 100);
this.gpbDirecional.Name = "gpbDirecional";
this.gpbDirecional.Size = new System.Drawing.Size(550, 88);
this.gpbDirecional.TabIndex = 6;
this.gpbDirecional.TabStop = false;
this.gpbDirecional.Text = "Direcional";
//
// lblPercentual1
//
this.lblPercentual1.AutoSize = true;
this.lblPercentual1.Location = new System.Drawing.Point(484, 58);
this.lblPercentual1.Name = "lblPercentual1";
this.lblPercentual1.Size = new System.Drawing.Size(15, 13);
this.lblPercentual1.TabIndex = 5;
this.lblPercentual1.Text = "%";
//
// lblAngulo
//
this.lblAngulo.AutoSize = true;
this.lblAngulo.Location = new System.Drawing.Point(484, 21);
this.lblAngulo.Name = "lblAngulo";
this.lblAngulo.Size = new System.Drawing.Size(11, 13);
this.lblAngulo.TabIndex = 4;
this.lblAngulo.Text = "º";
//
// txtVelocidadeDirecional
//
this.txtVelocidadeDirecional.Location = new System.Drawing.Point(358, 55);
this.txtVelocidadeDirecional.Name = "txtVelocidadeDirecional";
this.txtVelocidadeDirecional.Size = new System.Drawing.Size(100, 20);
this.txtVelocidadeDirecional.TabIndex = 5;
this.txtVelocidadeDirecional.Text = "75";
this.txtVelocidadeDirecional.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// txtAnguloMaximo
//
this.txtAnguloMaximo.Location = new System.Drawing.Point(358, 18);
this.txtAnguloMaximo.Name = "txtAnguloMaximo";
this.txtAnguloMaximo.Size = new System.Drawing.Size(100, 20);
this.txtAnguloMaximo.TabIndex = 4;
this.txtAnguloMaximo.Text = "30";
this.txtAnguloMaximo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblVelocidadeDirecional
//
this.lblVelocidadeDirecional.AutoSize = true;
this.lblVelocidadeDirecional.Location = new System.Drawing.Point(6, 58);
this.lblVelocidadeDirecional.Name = "lblVelocidadeDirecional";
this.lblVelocidadeDirecional.Size = new System.Drawing.Size(177, 13);
this.lblVelocidadeDirecional.TabIndex = 1;
this.lblVelocidadeDirecional.Text = "Velocidade do movimento direcional";
//
// lblAnguloMaximo
//
this.lblAnguloMaximo.AutoSize = true;
this.lblAnguloMaximo.Location = new System.Drawing.Point(6, 21);
this.lblAnguloMaximo.Name = "lblAnguloMaximo";
this.lblAnguloMaximo.Size = new System.Drawing.Size(249, 13);
this.lblAnguloMaximo.TabIndex = 0;
this.lblAnguloMaximo.Text = "Angulo máximo permitido para movimento direcional";
//
// gpbLocomocao
//
this.gpbLocomocao.Controls.Add(this.lblKmh2);
this.gpbLocomocao.Controls.Add(this.lblKmh1);
this.gpbLocomocao.Controls.Add(this.txtVelocidadeComErvas);
this.gpbLocomocao.Controls.Add(this.txtVelocidadeSemErvas);
this.gpbLocomocao.Controls.Add(this.lblVelocidadeComErvas);
this.gpbLocomocao.Controls.Add(this.lblVelocidadeSemErvas);
this.gpbLocomocao.Location = new System.Drawing.Point(6, 6);
this.gpbLocomocao.Name = "gpbLocomocao";
this.gpbLocomocao.Size = new System.Drawing.Size(550, 88);
this.gpbLocomocao.TabIndex = 0;
this.gpbLocomocao.TabStop = false;
this.gpbLocomocao.Text = "Locomoção";
//
// lblKmh2
//
this.lblKmh2.AutoSize = true;
this.lblKmh2.Location = new System.Drawing.Point(484, 58);
this.lblKmh2.Name = "lblKmh2";
this.lblKmh2.Size = new System.Drawing.Size(32, 13);
this.lblKmh2.TabIndex = 5;
this.lblKmh2.Text = "km/h";
//
// lblKmh1
//
this.lblKmh1.AutoSize = true;
this.lblKmh1.Location = new System.Drawing.Point(484, 21);
this.lblKmh1.Name = "lblKmh1";
this.lblKmh1.Size = new System.Drawing.Size(32, 13);
this.lblKmh1.TabIndex = 4;
this.lblKmh1.Text = "km/h";
//
// txtVelocidadeComErvas
//
this.txtVelocidadeComErvas.Location = new System.Drawing.Point(358, 55);
this.txtVelocidadeComErvas.Name = "txtVelocidadeComErvas";
this.txtVelocidadeComErvas.Size = new System.Drawing.Size(100, 20);
this.txtVelocidadeComErvas.TabIndex = 3;
this.txtVelocidadeComErvas.Text = "3";
this.txtVelocidadeComErvas.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// txtVelocidadeSemErvas
//
this.txtVelocidadeSemErvas.Location = new System.Drawing.Point(358, 18);
this.txtVelocidadeSemErvas.Name = "txtVelocidadeSemErvas";
this.txtVelocidadeSemErvas.Size = new System.Drawing.Size(100, 20);
this.txtVelocidadeSemErvas.TabIndex = 2;
this.txtVelocidadeSemErvas.Text = "5";
this.txtVelocidadeSemErvas.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblVelocidadeComErvas
//
this.lblVelocidadeComErvas.AutoSize = true;
this.lblVelocidadeComErvas.Location = new System.Drawing.Point(6, 58);
this.lblVelocidadeComErvas.Name = "lblVelocidadeComErvas";
this.lblVelocidadeComErvas.Size = new System.Drawing.Size(206, 13);
this.lblVelocidadeComErvas.TabIndex = 1;
this.lblVelocidadeComErvas.Text = "Velocidade quando houver ervas no radar";
//
// lblVelocidadeSemErvas
//
this.lblVelocidadeSemErvas.AutoSize = true;
this.lblVelocidadeSemErvas.Location = new System.Drawing.Point(6, 21);
this.lblVelocidadeSemErvas.Name = "lblVelocidadeSemErvas";
this.lblVelocidadeSemErvas.Size = new System.Drawing.Size(227, 13);
this.lblVelocidadeSemErvas.TabIndex = 0;
this.lblVelocidadeSemErvas.Text = "Velocidade quando não houver ervas no radar";
//
// tabMapa
//
this.tabMapa.Controls.Add(this.lblTempoEstimado);
this.tabMapa.Controls.Add(this.lblDistanciaOperacao);
this.tabMapa.Controls.Add(this.lblDistanciaTotal);
this.tabMapa.Controls.Add(this.btnCarregarMapa);
this.tabMapa.Controls.Add(this.lblMapaCarregado);
this.tabMapa.Controls.Add(this.pnlMapa);
this.tabMapa.Location = new System.Drawing.Point(4, 22);
this.tabMapa.Name = "tabMapa";
this.tabMapa.Padding = new System.Windows.Forms.Padding(3);
this.tabMapa.Size = new System.Drawing.Size(564, 417);
this.tabMapa.TabIndex = 1;
this.tabMapa.Text = "Mapa";
this.tabMapa.UseVisualStyleBackColor = true;
//
// lblTempoEstimado
//
this.lblTempoEstimado.AutoSize = true;
this.lblTempoEstimado.Location = new System.Drawing.Point(411, 14);
this.lblTempoEstimado.Name = "lblTempoEstimado";
this.lblTempoEstimado.Size = new System.Drawing.Size(135, 13);
this.lblTempoEstimado.TabIndex = 5;
this.lblTempoEstimado.Text = "Tempo estimado: 00:00 hrs";
//
// lblDistanciaOperacao
//
this.lblDistanciaOperacao.AutoSize = true;
this.lblDistanciaOperacao.Location = new System.Drawing.Point(252, 14);
this.lblDistanciaOperacao.Name = "lblDistanciaOperacao";
this.lblDistanciaOperacao.Size = new System.Drawing.Size(137, 13);
this.lblDistanciaOperacao.TabIndex = 4;
this.lblDistanciaOperacao.Text = "Distância operação: 0,00 m";
//
// lblDistanciaTotal
//
this.lblDistanciaTotal.AutoSize = true;
this.lblDistanciaTotal.Location = new System.Drawing.Point(118, 14);
this.lblDistanciaTotal.Name = "lblDistanciaTotal";
this.lblDistanciaTotal.Size = new System.Drawing.Size(112, 13);
this.lblDistanciaTotal.TabIndex = 3;
this.lblDistanciaTotal.Text = "Distância total: 0,00 m";
//
// btnCarregarMapa
//
this.btnCarregarMapa.Location = new System.Drawing.Point(6, 9);
this.btnCarregarMapa.Name = "btnCarregarMapa";
this.btnCarregarMapa.Size = new System.Drawing.Size(97, 23);
this.btnCarregarMapa.TabIndex = 2;
this.btnCarregarMapa.Text = "Carregar mapa...";
this.btnCarregarMapa.UseVisualStyleBackColor = true;
this.btnCarregarMapa.Click += new System.EventHandler(this.btnCarregarMapa_Click);
//
// lblMapaCarregado
//
this.lblMapaCarregado.AutoSize = true;
this.lblMapaCarregado.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.25F);
this.lblMapaCarregado.Location = new System.Drawing.Point(6, 35);
this.lblMapaCarregado.Name = "lblMapaCarregado";
this.lblMapaCarregado.Size = new System.Drawing.Size(116, 13);
this.lblMapaCarregado.TabIndex = 1;
this.lblMapaCarregado.Text = "Arquivo carregado: N/C";
//
// pnlMapa
//
this.pnlMapa.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnlMapa.Location = new System.Drawing.Point(6, 52);
this.pnlMapa.Name = "pnlMapa";
this.pnlMapa.Size = new System.Drawing.Size(550, 359);
this.pnlMapa.TabIndex = 0;
//
// btnSalvar
//
this.btnSalvar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnSalvar.Location = new System.Drawing.Point(719, 39);
this.btnSalvar.Name = "btnSalvar";
this.btnSalvar.Size = new System.Drawing.Size(75, 23);
this.btnSalvar.TabIndex = 4;
this.btnSalvar.Text = "Salvar";
this.btnSalvar.UseVisualStyleBackColor = true;
this.btnSalvar.Click += new System.EventHandler(this.btnSalvar_Click);
//
// btnCarregar
//
this.btnCarregar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnCarregar.Location = new System.Drawing.Point(638, 40);
this.btnCarregar.Name = "btnCarregar";
this.btnCarregar.Size = new System.Drawing.Size(75, 23);
this.btnCarregar.TabIndex = 5;
this.btnCarregar.Text = "Carregar";
this.btnCarregar.UseVisualStyleBackColor = true;
this.btnCarregar.Click += new System.EventHandler(this.btnCarregar_Click);
//
// txtDescricao
//
this.txtDescricao.Location = new System.Drawing.Point(418, 41);
this.txtDescricao.Name = "txtDescricao";
this.txtDescricao.Size = new System.Drawing.Size(214, 20);
this.txtDescricao.TabIndex = 6;
//
// lblDescricao
//
this.lblDescricao.AutoSize = true;
this.lblDescricao.Location = new System.Drawing.Point(415, 25);
this.lblDescricao.Name = "lblDescricao";
this.lblDescricao.Size = new System.Drawing.Size(55, 13);
this.lblDescricao.TabIndex = 7;
this.lblDescricao.Text = "Descrição";
//
// frmAjustesOperacao
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(818, 524);
this.Controls.Add(this.lblDescricao);
this.Controls.Add(this.txtDescricao);
this.Controls.Add(this.btnCarregar);
this.Controls.Add(this.btnSalvar);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.lblModoOperacao);
this.Controls.Add(this.cmbModosOperacao);
this.Controls.Add(this.gpbModulos);
this.Name = "frmAjustesOperacao";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Parametrização da Operação";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmAjustesOperacao_FormClosing);
this.Load += new System.EventHandler(this.frmAjustesOperacao_Load);
this.gpbModulos.ResumeLayout(false);
this.pnlModulos.ResumeLayout(false);
this.pnlModulos.PerformLayout();
this.tabControl1.ResumeLayout(false);
this.tabParametros.ResumeLayout(false);
this.gpbAtuador.ResumeLayout(false);
this.gpbAtuador.PerformLayout();
this.gpbDirecional.ResumeLayout(false);
this.gpbDirecional.PerformLayout();
this.gpbLocomocao.ResumeLayout(false);
this.gpbLocomocao.PerformLayout();
this.tabMapa.ResumeLayout(false);
this.tabMapa.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.GroupBox gpbModulos;
private System.Windows.Forms.CheckBox chbMvd;
private System.Windows.Forms.RichTextBox rtbPZM;
private System.Windows.Forms.CheckBox chbPzm;
private System.Windows.Forms.RichTextBox rtbSEN;
private System.Windows.Forms.CheckBox chbSen;
private System.Windows.Forms.RichTextBox rtbMKS;
private System.Windows.Forms.CheckBox chbMks;
private System.Windows.Forms.RichTextBox rtbMVD;
private System.Windows.Forms.RichTextBox rtbGPS;
private System.Windows.Forms.CheckBox chbGps;
private System.Windows.Forms.RichTextBox rtbWIT;
private System.Windows.Forms.CheckBox chbWit;
private System.Windows.Forms.RichTextBox rtbATU;
private System.Windows.Forms.CheckBox chbAtu;
private System.Windows.Forms.ComboBox cmbModosOperacao;
private System.Windows.Forms.Label lblModoOperacao;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabParametros;
private System.Windows.Forms.TabPage tabMapa;
private System.Windows.Forms.Button btnSalvar;
private System.Windows.Forms.Button btnCarregar;
private System.Windows.Forms.GroupBox gpbDirecional;
private System.Windows.Forms.Label lblPercentual1;
private System.Windows.Forms.Label lblAngulo;
private System.Windows.Forms.TextBox txtVelocidadeDirecional;
private System.Windows.Forms.TextBox txtAnguloMaximo;
private System.Windows.Forms.Label lblVelocidadeDirecional;
private System.Windows.Forms.Label lblAnguloMaximo;
private System.Windows.Forms.GroupBox gpbLocomocao;
private System.Windows.Forms.Label lblKmh2;
private System.Windows.Forms.Label lblKmh1;
private System.Windows.Forms.TextBox txtVelocidadeComErvas;
private System.Windows.Forms.TextBox txtVelocidadeSemErvas;
private System.Windows.Forms.Label lblVelocidadeComErvas;
private System.Windows.Forms.Label lblVelocidadeSemErvas;
private System.Windows.Forms.GroupBox gpbAtuador;
private System.Windows.Forms.Label lblPercentualAtuacao2;
private System.Windows.Forms.Label lblLitros;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox txtCapacidadeReservatorio;
private System.Windows.Forms.TextBox txtPercentualAtuacao;
private System.Windows.Forms.Label lblCapacidadeReservatorio;
private System.Windows.Forms.Label lblPercentualAtuacao1;
private System.Windows.Forms.Button btnProximo;
private System.Windows.Forms.Panel pnlModulos;
private System.Windows.Forms.RichTextBox rtbLRA;
private System.Windows.Forms.CheckBox chbLra;
private System.Windows.Forms.Label lblMapaCarregado;
private System.Windows.Forms.Panel pnlMapa;
private System.Windows.Forms.Button btnCarregarMapa;
private System.Windows.Forms.Label lblTempoEstimado;
private System.Windows.Forms.Label lblDistanciaOperacao;
private System.Windows.Forms.Label lblDistanciaTotal;
private System.Windows.Forms.Label lblPsi;
private System.Windows.Forms.TextBox txtPressaoLinha;
private System.Windows.Forms.Label lblPressaoLinha;
private System.Windows.Forms.Label lblMs;
private System.Windows.Forms.TextBox txtDuracaoAtuacao;
private System.Windows.Forms.Label lblDuracaoAtuacao;
private System.Windows.Forms.TextBox txtDescricao;
private System.Windows.Forms.Label lblDescricao;
}
}

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