refinamento sistema pulverizador

This commit is contained in:
Diego Freitas 2024-04-01 08:03:25 -03:00
parent 288790359e
commit 1582fb18dc
92 changed files with 4474 additions and 637 deletions

Binary file not shown.

View File

@ -0,0 +1,115 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\ZendionINC\\agrobot_base\\AgroBase\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|c:\\zendioninc\\agrobot_base\\agrobase\\agrobase\\models\\modules\\atuadormodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\models\\modules\\atuadormodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|C:\\ZendionINC\\agrobot_base\\AgroBase\\agrobase\\forms\\atuador\\frmatucalibragem.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\atuador\\frmatucalibragem.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|C:\\ZendionINC\\agrobot_base\\AgroBase\\agrobase\\forms\\atuador\\frmatucalibragem.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\atuador\\frmatucalibragem.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form"
},
{
"AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|C:\\ZendionINC\\agrobot_base\\AgroBase\\agrobase\\forms\\frmprincipal.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\frmprincipal.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|C:\\ZendionINC\\agrobot_base\\AgroBase\\agrobase\\forms\\operacoes\\frmoperacaomapagps.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\operacoes\\frmoperacaomapagps.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|C:\\ZendionINC\\agrobot_base\\AgroBase\\agrobase\\forms\\frmprincipal.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\frmprincipal.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 2,
"Children": [
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "frmAtuCalibragem.cs",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\Atuador\\frmAtuCalibragem.cs",
"RelativeDocumentMoniker": "AgroBase\\Forms\\Atuador\\frmAtuCalibragem.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\Atuador\\frmAtuCalibragem.cs",
"RelativeToolTip": "AgroBase\\Forms\\Atuador\\frmAtuCalibragem.cs",
"ViewState": "AQIAAJ8AAAAAAAAAAAAswCMBAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-03-26T19:38:16.149Z"
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "frmAtuCalibragem.cs [Design]",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\Atuador\\frmAtuCalibragem.cs",
"RelativeDocumentMoniker": "AgroBase\\Forms\\Atuador\\frmAtuCalibragem.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\Atuador\\frmAtuCalibragem.cs [Design]",
"RelativeToolTip": "AgroBase\\Forms\\Atuador\\frmAtuCalibragem.cs [Design]",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-03-26T19:26:25.571Z"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "AtuadorModel.cs",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\Modules\\AtuadorModel.cs",
"RelativeDocumentMoniker": "AgroBase\\Models\\Modules\\AtuadorModel.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\Modules\\AtuadorModel.cs",
"RelativeToolTip": "AgroBase\\Models\\Modules\\AtuadorModel.cs",
"ViewState": "AQIAAAAAAAAAAAAAAAAAACAAAAAIAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-03-26T12:45:51.9Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "frmPrincipal.cs",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmPrincipal.cs",
"RelativeDocumentMoniker": "AgroBase\\Forms\\frmPrincipal.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmPrincipal.cs",
"RelativeToolTip": "AgroBase\\Forms\\frmPrincipal.cs",
"ViewState": "AQIAACoAAAAAAAAAAADwv4AAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-03-25T19:55:51.951Z"
},
{
"$type": "Document",
"DocumentIndex": 5,
"Title": "frmPrincipal.cs [Design]",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmPrincipal.cs",
"RelativeDocumentMoniker": "AgroBase\\Forms\\frmPrincipal.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmPrincipal.cs [Design]",
"RelativeToolTip": "AgroBase\\Forms\\frmPrincipal.cs [Design]",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-03-25T19:55:44.547Z"
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "frmOperacaoMapaGPS.cs",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\Operacoes\\frmOperacaoMapaGPS.cs",
"RelativeDocumentMoniker": "AgroBase\\Forms\\Operacoes\\frmOperacaoMapaGPS.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\Operacoes\\frmOperacaoMapaGPS.cs",
"RelativeToolTip": "AgroBase\\Forms\\Operacoes\\frmOperacaoMapaGPS.cs",
"ViewState": "AQIAAF8BAAAAAAAAAAAwwGcBAAB1AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-03-20T13:42:47.8Z"
}
]
}
]
}
]
}

File diff suppressed because one or more lines are too long

View File

@ -168,6 +168,12 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Forms\Atuador\frmAtuCalibragem.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\Atuador\frmAtuCalibragem.Designer.cs">
<DependentUpon>frmAtuCalibragem.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Atuador\frmAtuConfig.cs">
<SubType>Form</SubType>
</Compile>
@ -299,6 +305,7 @@
<Compile Include="Models\MotorComum.cs" />
<Compile Include="Models\Operacoes\OperacaoModel.cs" />
<Compile Include="Models\PIDModel.cs" />
<Compile Include="Models\PZEMModel.cs" />
<Compile Include="Models\Variaveis.cs" />
<Compile Include="Services\APIService.cs" />
<Compile Include="Services\CameraService.cs" />
@ -317,6 +324,7 @@
<Compile Include="Services\MapasService.cs" />
<Compile Include="Services\MqttService.cs" />
<Compile Include="Services\PythonService.cs" />
<Compile Include="Services\PZEMService.cs" />
<Compile Include="Services\SerialService.cs" />
<Compile Include="Services\SocketService.cs" />
<Content Include="Imagens\loading.gif" />
@ -388,12 +396,18 @@
<Content Include="Python\Output\folium\leaflet.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Python\Scripts\pzem.py">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Python\Scripts\street-detector.py">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Python\Scripts\weed-detector.py">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<EmbeddedResource Include="Forms\Atuador\frmAtuCalibragem.resx">
<DependentUpon>frmAtuCalibragem.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Atuador\frmAtuConfig.resx">
<DependentUpon>frmAtuConfig.cs</DependentUpon>
</EmbeddedResource>

View File

@ -0,0 +1,414 @@
namespace AgroBase.Forms.Atuador
{
partial class frmAtuCalibragem
{
/// <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.btnLigarBomba = new System.Windows.Forms.Button();
this.grdSensoriamento = new System.Windows.Forms.DataGridView();
this.lblSensoriamento = new System.Windows.Forms.Label();
this.btnDesligarBomba = new System.Windows.Forms.Button();
this.gpbBicos = new System.Windows.Forms.GroupBox();
this.pnlBicos = new System.Windows.Forms.Panel();
this.nudPressaoSP = new System.Windows.Forms.NumericUpDown();
this.lblPressaSP = new System.Windows.Forms.Label();
this.lblConectado = new System.Windows.Forms.Label();
this.txtMMassaRef = new System.Windows.Forms.TextBox();
this.txtMLeituraRef = new System.Windows.Forms.TextBox();
this.lblMMassaRef = new System.Windows.Forms.Label();
this.lblMLeituraRef = new System.Windows.Forms.Label();
this.gpbMassa = new System.Windows.Forms.GroupBox();
this.gpbPressao = new System.Windows.Forms.GroupBox();
this.txtPressaoVmin = new System.Windows.Forms.TextBox();
this.lblPressaoVmax = new System.Windows.Forms.Label();
this.txtPressaoVmax = new System.Windows.Forms.TextBox();
this.lblPressaoVmin = new System.Windows.Forms.Label();
this.btnSalvar = new System.Windows.Forms.Button();
this.gpbFluxo = new System.Windows.Forms.GroupBox();
this.txtMLRef = new System.Windows.Forms.TextBox();
this.lblPulsosRef = new System.Windows.Forms.Label();
this.txtPulsosRef = new System.Windows.Forms.TextBox();
this.lblMLRef = new System.Windows.Forms.Label();
this.txtVolume = new System.Windows.Forms.TextBox();
this.lblVolume = new System.Windows.Forms.Label();
this.btnCalibrarVazao = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.grdSensoriamento)).BeginInit();
this.gpbBicos.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudPressaoSP)).BeginInit();
this.gpbMassa.SuspendLayout();
this.gpbPressao.SuspendLayout();
this.gpbFluxo.SuspendLayout();
this.SuspendLayout();
//
// btnLigarBomba
//
this.btnLigarBomba.Location = new System.Drawing.Point(15, 35);
this.btnLigarBomba.Name = "btnLigarBomba";
this.btnLigarBomba.Size = new System.Drawing.Size(130, 23);
this.btnLigarBomba.TabIndex = 0;
this.btnLigarBomba.Text = "Ligar Bomba";
this.btnLigarBomba.UseVisualStyleBackColor = true;
this.btnLigarBomba.Click += new System.EventHandler(this.btnLigarBomba_Click);
//
// grdSensoriamento
//
this.grdSensoriamento.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.grdSensoriamento.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.grdSensoriamento.Location = new System.Drawing.Point(12, 93);
this.grdSensoriamento.Name = "grdSensoriamento";
this.grdSensoriamento.RowHeadersWidth = 51;
this.grdSensoriamento.RowTemplate.Height = 24;
this.grdSensoriamento.Size = new System.Drawing.Size(286, 370);
this.grdSensoriamento.TabIndex = 2;
//
// lblSensoriamento
//
this.lblSensoriamento.AutoSize = true;
this.lblSensoriamento.Location = new System.Drawing.Point(12, 74);
this.lblSensoriamento.Name = "lblSensoriamento";
this.lblSensoriamento.Size = new System.Drawing.Size(98, 16);
this.lblSensoriamento.TabIndex = 3;
this.lblSensoriamento.Text = "Sensoriamento";
//
// btnDesligarBomba
//
this.btnDesligarBomba.Location = new System.Drawing.Point(168, 35);
this.btnDesligarBomba.Name = "btnDesligarBomba";
this.btnDesligarBomba.Size = new System.Drawing.Size(130, 23);
this.btnDesligarBomba.TabIndex = 4;
this.btnDesligarBomba.Text = "Desligar Bomba";
this.btnDesligarBomba.UseVisualStyleBackColor = true;
this.btnDesligarBomba.Click += new System.EventHandler(this.btnDesligarBomba_Click);
//
// gpbBicos
//
this.gpbBicos.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.gpbBicos.Controls.Add(this.pnlBicos);
this.gpbBicos.Location = new System.Drawing.Point(304, 93);
this.gpbBicos.Name = "gpbBicos";
this.gpbBicos.Size = new System.Drawing.Size(956, 271);
this.gpbBicos.TabIndex = 5;
this.gpbBicos.TabStop = false;
this.gpbBicos.Text = "Bicos Pulverizadores";
//
// pnlBicos
//
this.pnlBicos.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.pnlBicos.AutoScroll = true;
this.pnlBicos.Location = new System.Drawing.Point(6, 21);
this.pnlBicos.Name = "pnlBicos";
this.pnlBicos.Size = new System.Drawing.Size(944, 244);
this.pnlBicos.TabIndex = 0;
//
// nudPressaoSP
//
this.nudPressaoSP.Location = new System.Drawing.Point(168, 7);
this.nudPressaoSP.Maximum = new decimal(new int[] {
200,
0,
0,
0});
this.nudPressaoSP.Name = "nudPressaoSP";
this.nudPressaoSP.Size = new System.Drawing.Size(130, 22);
this.nudPressaoSP.TabIndex = 6;
this.nudPressaoSP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.nudPressaoSP.ValueChanged += new System.EventHandler(this.nudPressaoSP_ValueChanged);
//
// lblPressaSP
//
this.lblPressaSP.AutoSize = true;
this.lblPressaSP.Location = new System.Drawing.Point(12, 9);
this.lblPressaSP.Name = "lblPressaSP";
this.lblPressaSP.Size = new System.Drawing.Size(137, 16);
this.lblPressaSP.TabIndex = 7;
this.lblPressaSP.Text = "Pressão de linha (SP)";
//
// lblConectado
//
this.lblConectado.AutoSize = true;
this.lblConectado.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblConectado.Location = new System.Drawing.Point(336, 9);
this.lblConectado.Name = "lblConectado";
this.lblConectado.Size = new System.Drawing.Size(129, 20);
this.lblConectado.TabIndex = 9;
this.lblConectado.Text = "Conectado: Não";
//
// txtMMassaRef
//
this.txtMMassaRef.Location = new System.Drawing.Point(90, 21);
this.txtMMassaRef.Name = "txtMMassaRef";
this.txtMMassaRef.Size = new System.Drawing.Size(100, 22);
this.txtMMassaRef.TabIndex = 10;
this.txtMMassaRef.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// txtMLeituraRef
//
this.txtMLeituraRef.Location = new System.Drawing.Point(90, 49);
this.txtMLeituraRef.Name = "txtMLeituraRef";
this.txtMLeituraRef.Size = new System.Drawing.Size(100, 22);
this.txtMLeituraRef.TabIndex = 11;
this.txtMLeituraRef.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblMMassaRef
//
this.lblMMassaRef.AutoSize = true;
this.lblMMassaRef.Location = new System.Drawing.Point(12, 24);
this.lblMMassaRef.Name = "lblMMassaRef";
this.lblMMassaRef.Size = new System.Drawing.Size(72, 16);
this.lblMMassaRef.TabIndex = 12;
this.lblMMassaRef.Text = "Massa Ref";
//
// lblMLeituraRef
//
this.lblMLeituraRef.AutoSize = true;
this.lblMLeituraRef.Location = new System.Drawing.Point(12, 52);
this.lblMLeituraRef.Name = "lblMLeituraRef";
this.lblMLeituraRef.Size = new System.Drawing.Size(71, 16);
this.lblMLeituraRef.TabIndex = 13;
this.lblMLeituraRef.Text = "Leitura Ref";
//
// gpbMassa
//
this.gpbMassa.Controls.Add(this.txtMMassaRef);
this.gpbMassa.Controls.Add(this.lblMLeituraRef);
this.gpbMassa.Controls.Add(this.txtMLeituraRef);
this.gpbMassa.Controls.Add(this.lblMMassaRef);
this.gpbMassa.Location = new System.Drawing.Point(310, 370);
this.gpbMassa.Name = "gpbMassa";
this.gpbMassa.Size = new System.Drawing.Size(200, 78);
this.gpbMassa.TabIndex = 14;
this.gpbMassa.TabStop = false;
this.gpbMassa.Text = "Massa";
//
// gpbPressao
//
this.gpbPressao.Controls.Add(this.txtPressaoVmin);
this.gpbPressao.Controls.Add(this.lblPressaoVmax);
this.gpbPressao.Controls.Add(this.txtPressaoVmax);
this.gpbPressao.Controls.Add(this.lblPressaoVmin);
this.gpbPressao.Location = new System.Drawing.Point(516, 370);
this.gpbPressao.Name = "gpbPressao";
this.gpbPressao.Size = new System.Drawing.Size(200, 78);
this.gpbPressao.TabIndex = 15;
this.gpbPressao.TabStop = false;
this.gpbPressao.Text = "Pressão";
//
// txtPressaoVmin
//
this.txtPressaoVmin.Location = new System.Drawing.Point(90, 21);
this.txtPressaoVmin.Name = "txtPressaoVmin";
this.txtPressaoVmin.Size = new System.Drawing.Size(100, 22);
this.txtPressaoVmin.TabIndex = 10;
this.txtPressaoVmin.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblPressaoVmax
//
this.lblPressaoVmax.AutoSize = true;
this.lblPressaoVmax.Location = new System.Drawing.Point(12, 52);
this.lblPressaoVmax.Name = "lblPressaoVmax";
this.lblPressaoVmax.Size = new System.Drawing.Size(47, 16);
this.lblPressaoVmax.TabIndex = 13;
this.lblPressaoVmax.Text = "V máx.";
//
// txtPressaoVmax
//
this.txtPressaoVmax.Location = new System.Drawing.Point(90, 49);
this.txtPressaoVmax.Name = "txtPressaoVmax";
this.txtPressaoVmax.Size = new System.Drawing.Size(100, 22);
this.txtPressaoVmax.TabIndex = 11;
this.txtPressaoVmax.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblPressaoVmin
//
this.lblPressaoVmin.AutoSize = true;
this.lblPressaoVmin.Location = new System.Drawing.Point(12, 24);
this.lblPressaoVmin.Name = "lblPressaoVmin";
this.lblPressaoVmin.Size = new System.Drawing.Size(43, 16);
this.lblPressaoVmin.TabIndex = 12;
this.lblPressaoVmin.Text = "V min.";
//
// btnSalvar
//
this.btnSalvar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSalvar.Location = new System.Drawing.Point(1158, 440);
this.btnSalvar.Name = "btnSalvar";
this.btnSalvar.Size = new System.Drawing.Size(102, 23);
this.btnSalvar.TabIndex = 16;
this.btnSalvar.Text = "Salvar";
this.btnSalvar.UseVisualStyleBackColor = true;
this.btnSalvar.Click += new System.EventHandler(this.btnSalvar_Click);
//
// gpbFluxo
//
this.gpbFluxo.Controls.Add(this.btnCalibrarVazao);
this.gpbFluxo.Controls.Add(this.lblVolume);
this.gpbFluxo.Controls.Add(this.txtVolume);
this.gpbFluxo.Controls.Add(this.txtMLRef);
this.gpbFluxo.Controls.Add(this.lblPulsosRef);
this.gpbFluxo.Controls.Add(this.txtPulsosRef);
this.gpbFluxo.Controls.Add(this.lblMLRef);
this.gpbFluxo.Location = new System.Drawing.Point(722, 370);
this.gpbFluxo.Name = "gpbFluxo";
this.gpbFluxo.Size = new System.Drawing.Size(366, 78);
this.gpbFluxo.TabIndex = 16;
this.gpbFluxo.TabStop = false;
this.gpbFluxo.Text = "Fluxo";
//
// txtMLRef
//
this.txtMLRef.Location = new System.Drawing.Point(90, 21);
this.txtMLRef.Name = "txtMLRef";
this.txtMLRef.Size = new System.Drawing.Size(100, 22);
this.txtMLRef.TabIndex = 10;
this.txtMLRef.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblPulsosRef
//
this.lblPulsosRef.AutoSize = true;
this.lblPulsosRef.Location = new System.Drawing.Point(12, 52);
this.lblPulsosRef.Name = "lblPulsosRef";
this.lblPulsosRef.Size = new System.Drawing.Size(72, 16);
this.lblPulsosRef.TabIndex = 13;
this.lblPulsosRef.Text = "Pulsos Ref";
//
// txtPulsosRef
//
this.txtPulsosRef.Location = new System.Drawing.Point(90, 49);
this.txtPulsosRef.Name = "txtPulsosRef";
this.txtPulsosRef.Size = new System.Drawing.Size(100, 22);
this.txtPulsosRef.TabIndex = 11;
this.txtPulsosRef.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblMLRef
//
this.lblMLRef.AutoSize = true;
this.lblMLRef.Location = new System.Drawing.Point(12, 24);
this.lblMLRef.Name = "lblMLRef";
this.lblMLRef.Size = new System.Drawing.Size(49, 16);
this.lblMLRef.TabIndex = 12;
this.lblMLRef.Text = "ML Ref";
//
// txtVolume
//
this.txtVolume.Location = new System.Drawing.Point(260, 21);
this.txtVolume.Name = "txtVolume";
this.txtVolume.Size = new System.Drawing.Size(100, 22);
this.txtVolume.TabIndex = 17;
this.txtVolume.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblVolume
//
this.lblVolume.AutoSize = true;
this.lblVolume.Location = new System.Drawing.Point(201, 24);
this.lblVolume.Name = "lblVolume";
this.lblVolume.Size = new System.Drawing.Size(53, 16);
this.lblVolume.TabIndex = 18;
this.lblVolume.Text = "Volume";
//
// btnCalibrarVazao
//
this.btnCalibrarVazao.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCalibrarVazao.Location = new System.Drawing.Point(258, 48);
this.btnCalibrarVazao.Name = "btnCalibrarVazao";
this.btnCalibrarVazao.Size = new System.Drawing.Size(102, 23);
this.btnCalibrarVazao.TabIndex = 17;
this.btnCalibrarVazao.Text = "Calibrar";
this.btnCalibrarVazao.UseVisualStyleBackColor = true;
this.btnCalibrarVazao.Click += new System.EventHandler(this.btnCalibrarVazao_Click);
//
// frmAtuCalibragem
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1272, 475);
this.Controls.Add(this.gpbFluxo);
this.Controls.Add(this.btnSalvar);
this.Controls.Add(this.gpbPressao);
this.Controls.Add(this.gpbMassa);
this.Controls.Add(this.lblConectado);
this.Controls.Add(this.lblPressaSP);
this.Controls.Add(this.nudPressaoSP);
this.Controls.Add(this.gpbBicos);
this.Controls.Add(this.btnDesligarBomba);
this.Controls.Add(this.lblSensoriamento);
this.Controls.Add(this.grdSensoriamento);
this.Controls.Add(this.btnLigarBomba);
this.Name = "frmAtuCalibragem";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Atuador - Calibragem";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmAtuCalibragem_FormClosing);
this.Load += new System.EventHandler(this.frmAtuCalibragem_Load);
((System.ComponentModel.ISupportInitialize)(this.grdSensoriamento)).EndInit();
this.gpbBicos.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.nudPressaoSP)).EndInit();
this.gpbMassa.ResumeLayout(false);
this.gpbMassa.PerformLayout();
this.gpbPressao.ResumeLayout(false);
this.gpbPressao.PerformLayout();
this.gpbFluxo.ResumeLayout(false);
this.gpbFluxo.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnLigarBomba;
private System.Windows.Forms.DataGridView grdSensoriamento;
private System.Windows.Forms.Label lblSensoriamento;
private System.Windows.Forms.Button btnDesligarBomba;
private System.Windows.Forms.GroupBox gpbBicos;
private System.Windows.Forms.NumericUpDown nudPressaoSP;
private System.Windows.Forms.Label lblPressaSP;
private System.Windows.Forms.Label lblConectado;
private System.Windows.Forms.Panel pnlBicos;
private System.Windows.Forms.TextBox txtMMassaRef;
private System.Windows.Forms.TextBox txtMLeituraRef;
private System.Windows.Forms.Label lblMMassaRef;
private System.Windows.Forms.Label lblMLeituraRef;
private System.Windows.Forms.GroupBox gpbMassa;
private System.Windows.Forms.GroupBox gpbPressao;
private System.Windows.Forms.TextBox txtPressaoVmin;
private System.Windows.Forms.Label lblPressaoVmax;
private System.Windows.Forms.TextBox txtPressaoVmax;
private System.Windows.Forms.Label lblPressaoVmin;
private System.Windows.Forms.Button btnSalvar;
private System.Windows.Forms.GroupBox gpbFluxo;
private System.Windows.Forms.TextBox txtMLRef;
private System.Windows.Forms.Label lblPulsosRef;
private System.Windows.Forms.TextBox txtPulsosRef;
private System.Windows.Forms.Label lblMLRef;
private System.Windows.Forms.Button btnCalibrarVazao;
private System.Windows.Forms.Label lblVolume;
private System.Windows.Forms.TextBox txtVolume;
}
}

View File

@ -0,0 +1,391 @@
using AgroBase.Comum;
using AgroBase.Models;
using AgroBase.Models.Modules;
using Microsoft.DirectX.PrivateImplementationDetails;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using static AgroBase.Models.Enuns;
namespace AgroBase.Forms.Atuador
{
public partial class frmAtuCalibragem : Form
{
Timer tmrLeitura = new Timer() { Interval = 1000 };
DispositivosService<AtuadorModel> DispAtu = (DispositivosService<AtuadorModel>)Variaveis.DispositivosConectados.FirstOrDefault(x => x.Dispositivo == T_Code.Atu);
CalibragemVazao _CalibragemVazao = new CalibragemVazao();
public frmAtuCalibragem()
{
InitializeComponent();
}
private void frmAtuCalibragem_Load(object sender, EventArgs e)
{
PopularBicos();
nudPressaoSP.Value = Convert.ToInt32(DispAtu.Dados.BombaPressurizadora.PressaoSP);
txtMMassaRef.Text = DispAtu.Dados._MassaRef.ToString();
txtMLeituraRef.Text = DispAtu.Dados._MassaLeituraRef.ToString();
txtPressaoVmin.Text = DispAtu.Dados._PressaoVmin.ToString();
txtPressaoVmax.Text = DispAtu.Dados._PressaoVmax.ToString();
txtMLRef.Text = DispAtu.Dados._FluxoMlRef.ToString();
txtPulsosRef.Text = DispAtu.Dados._FluxoPulsoRef.ToString();
txtVolume.Text = DispAtu.Dados.VolumeVazaoAferido.ToString();
grdSensoriamento.Rows.Clear();
grdSensoriamento.Columns.Clear();
grdSensoriamento.Columns.Add("clDado", "Dado");
grdSensoriamento.Columns.Add("clValor", "Valor");
grdSensoriamento.Rows.Add(new object[] { "Bomba Iniciada", "Não" });
grdSensoriamento.Rows.Add(new object[] { "Bomba Cmd Ligar", "Não" });
grdSensoriamento.Rows.Add(new object[] { "Bomba Ligada", "Não" });
grdSensoriamento.Rows.Add(new object[] { "Bomba Potencia", "0" });
grdSensoriamento.Rows.Add(new object[] { "Pressão", "0" });
grdSensoriamento.Rows.Add(new object[] { "Pressão Calc", "0" });
grdSensoriamento.Rows.Add(new object[] { "Vazão", "0" });
grdSensoriamento.Rows.Add(new object[] { "Massa", "0" });
grdSensoriamento.Rows.Add(new object[] { "Volume", "0" });
grdSensoriamento.Rows.Add(new object[] { "Percentual", "0" });
tmrLeitura.Tick += TmrLeitura_Tick;
tmrLeitura.Start();
}
private void frmAtuCalibragem_FormClosing(object sender, FormClosingEventArgs e)
{
tmrLeitura.Stop();
}
private void PopularBicos()
{
for (int i = 0; i < DispAtu.Dados.QuantidadeBicos; i++)
{
string ID = DispAtu.Dados.BicosPulverizadores[i].ID;
Label lblBico = new Label()
{
Name = "lbl_" + ID,
Location = new Point(0, 0),
Text = ID
};
Panel pnlBico = new Panel()
{
Name = "pnlB_" + ID,
Size = new Size(166, 166),
Location = new Point(30 + (i * 166), 0),
};
pnlBico.Paint -= pnlBico_Paint;
pnlBico.Paint += pnlBico_Paint;
Button btnDesligar = new Button()
{
Name = "btn0_" + ID,
Size = new Size(75, 27),
Location = new Point(5, 136),
Text = "Desligar"
};
btnDesligar.Click -= btn0_Click;
btnDesligar.Click += btn0_Click;
Button btnLigar = new Button()
{
Name = "btn1_" + ID,
Size = new Size(75, 27),
Location = new Point(86, 136),
Text = "Ligar"
};
btnLigar.Click -= btn1_Click;
btnLigar.Click += btn1_Click;
Label lblCmd = new Label()
{
Name = "lblCmd_" + ID,
Size = new Size(150, 20),
Location = new Point(5, 115),
Text = "Comando: Desligado"
};
pnlBico.Controls.Add(lblBico);
pnlBico.Controls.Add(btnDesligar);
pnlBico.Controls.Add(btnLigar);
pnlBico.Controls.Add(lblCmd);
pnlBico.Location = new Point(30 + (i * 166), 22);
pnlBicos.Controls.Add(pnlBico);
}
}
private void TmrLeitura_Tick(object sender, EventArgs e)
{
DispAtu = (DispositivosService<AtuadorModel>)Variaveis.DispositivosConectados.FirstOrDefault(x => x.Dispositivo == T_Code.Atu);
if (DispAtu != null)
{
lblConectado.Text = "Conectado: " + (DispAtu.Dados.Conectado ? "Sim" : "Não");
AtualizarGridSensores();
foreach (var pnlBico in pnlBicos.Controls.OfType<Panel>().Where(x => x.Name.Contains("pnlB_")))
{
pnlBico.Invalidate();
}
}
}
private void AtualizarGridSensores()
{
grdSensoriamento.Rows[0].Cells[1].Value = DispAtu.Dados.BombaPressurizadora.Inicializado;
grdSensoriamento.Rows[1].Cells[1].Value = DispAtu.Dados.BombaPressurizadora.BombaAtuada;
grdSensoriamento.Rows[2].Cells[1].Value = DispAtu.Dados.BombaPressurizadora.Ligado;
grdSensoriamento.Rows[3].Cells[1].Value = DispAtu.Dados.BombaPressurizadora.Potencia;
grdSensoriamento.Rows[4].Cells[1].Value = DispAtu.Dados.PressaoLinha.ToString("0.00000");
grdSensoriamento.Rows[5].Cells[1].Value = DispAtu.Dados.PressaoLinhaCalc.ToString("0.00000");
grdSensoriamento.Rows[6].Cells[1].Value = DispAtu.Dados.VazaoFluxoMLpS.ToString("0.00000");
grdSensoriamento.Rows[7].Cells[1].Value = DispAtu.Dados.MassaReservatorio.ToString("0.00000");
grdSensoriamento.Rows[8].Cells[1].Value = DispAtu.Dados.VolumeReservatorio.ToString("0.00000");
grdSensoriamento.Rows[9].Cells[1].Value = DispAtu.Dados.PercentualReservatorio.ToString("0.00");
}
private void EnviarProtocoloComandoBomba()
{
string Protocolo = DispAtu.Dados.BombaPressurizadora.ProtocoloComando();
DispAtu.EnviarDadosSerial(Protocolo);
}
private void nudPressaoSP_ValueChanged(object sender, EventArgs e)
{
DispAtu.Dados.BombaPressurizadora.PressaoSP = Convert.ToInt32(((NumericUpDown)sender).Value);
EnviarProtocoloComandoBomba();
}
private void btnLigarBomba_Click(object sender, EventArgs e)
{
DispAtu.Dados.BombaPressurizadora.BombaAtuada = true;
EnviarProtocoloComandoBomba();
}
private void btnDesligarBomba_Click(object sender, EventArgs e)
{
DispAtu.Dados.BombaPressurizadora.BombaAtuada = false;
EnviarProtocoloComandoBomba();
}
private void pnlBico_Paint(object sender, PaintEventArgs e)
{
Panel pnl = (Panel)sender;
string ID = pnl.Name.Replace("pnlB_", "");
Graphics g = e.Graphics;
int circleDiameter = 50; // Diâmetro do círculo
int circleX = (pnl.Width - circleDiameter) / 2; // Posição X do círculo (centro horizontal)
int circleY = pnl.Height / 4; // Posição Y do círculo (mais próximo ao topo)
// Desenhar o círculo
if (DispAtu.Dados.BicosPulverizadores.First(x => x.ID == ID).StatusBico)
g.FillEllipse(Brushes.Green, circleX, circleY, circleDiameter, circleDiameter); // LED aceso (círculo preenchido)
else
g.DrawEllipse(Pens.Black, circleX, circleY, circleDiameter, circleDiameter); // LED apagado (círculo vazio)
}
private void btn0_Click(object sender, EventArgs e)
{
Button btn = (Button)sender;
string ID = btn.Name.Replace("btn0_", "");
var Bico = DispAtu.Dados.BicosPulverizadores.FirstOrDefault(x => x.ID == ID);
if (Bico != null)
{
Bico.Atuado = !DispAtu.Dados.AtuacaoNivelAlto;
string Protocolo = Bico.ProtocoloComando();
DispAtu.EnviarDadosSerial(Protocolo);
pnlBicos.Controls.OfType<Panel>().First(x => x.Name == "pnlB_" + ID).Invalidate();
pnlBicos.Controls.OfType<Panel>().First(x => x.Name == "pnlB_" + ID).Controls.OfType<Label>().First(x => x.Name == "lblCmd_" + ID).Text = "Comando: Desligado";
}
}
private void btn1_Click(object sender, EventArgs e)
{
Button btn = (Button)sender;
string ID = btn.Name.Replace("btn1_", "");
var Bico = DispAtu.Dados.BicosPulverizadores.FirstOrDefault(x => x.ID == ID);
if (Bico != null)
{
Bico.Atuado = DispAtu.Dados.AtuacaoNivelAlto;
string Protocolo = Bico.ProtocoloComando();
DispAtu.EnviarDadosSerial(Protocolo);
pnlBicos.Controls.OfType<Panel>().First(x => x.Name == "pnlB_" + ID).Invalidate();
pnlBicos.Controls.OfType<Panel>().First(x => x.Name == "pnlB_" + ID).Controls.OfType<Label>().First(x => x.Name == "lblCmd_" + ID).Text = "Comando: Ligado";
}
}
private void btnSalvar_Click(object sender, EventArgs e)
{
DispAtu.Dados.BombaPressurizadora.PressaoSP = 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);
DispAtu.Dados._PressaoVmax = Convert.ToDouble(txtPressaoVmax.Text);
DispAtu.Dados._FluxoMlRef = Convert.ToDouble(txtMLRef.Text);
DispAtu.Dados._FluxoPulsoRef = Convert.ToDouble(txtPulsosRef.Text);
DispAtu.Dados.VolumeVazaoAferido = Convert.ToDouble(txtVolume.Text);
}
private void btnCalibrarVazao_Click(object sender, EventArgs e)
{
if (btnCalibrarVazao.Text == "Calcular")
{
if (txtVolume.Text == "" || double.TryParse(txtVolume.Text, out double Volume) == false)
{
MessageBox.Show("Informe o volume obtido durante a calibragem!");
return;
}
_CalibragemVazao.VolumeComputado = Volume;
btnCalibrarVazao.Text = "Calibrar";
string Resultados =
"Valores iniciais" + Environment.NewLine +
"Massa = " + _CalibragemVazao.MassaInicial.ToString("0.0000") + " Kg" + Environment.NewLine +
"Pressão = " + _CalibragemVazao.PressoesAferidas.First().ToString("0.0000") + " psi" + Environment.NewLine +
Environment.NewLine +
"Medições" + Environment.NewLine +
"V = " + _CalibragemVazao.VolumeComputado.ToString("0.0000") + "mL" + Environment.NewLine +
"P = " + _CalibragemVazao.PressaoMedia.ToString("0.0000") + " psi" + Environment.NewLine +
"NP = " + _CalibragemVazao.QtdPulsos + Environment.NewLine +
"T = " + _CalibragemVazao.Periodo + " s" + Environment.NewLine +
"M = " + _CalibragemVazao.MassaFinal.ToString("0.0000") + " Kg" + Environment.NewLine +
Environment.NewLine +
"Cálculos" + Environment.NewLine +
"Massa Perdida = " + _CalibragemVazao.MassaPerdida.ToString("0.0000") + " g" + Environment.NewLine +
"d = " + _CalibragemVazao.d.ToString("0.0000") + Environment.NewLine +
"Q = " + _CalibragemVazao.Q.ToString("0.0000") + " mL/s" + Environment.NewLine +
"x = " + _CalibragemVazao.x.ToString("0.0000") + Environment.NewLine +
"Q2 = " + _CalibragemVazao.Q2.ToString("0.0000") + " mL" + Environment.NewLine +
""
;
Console.WriteLine(Resultados);
MessageBox.Show(Resultados, "Resultado da calibragem");
if (MessageBox.Show("Deseja aceitar os parâmetros de calibragem?", "Atualizar dados", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
txtMLRef.Text = _CalibragemVazao.VolumeComputado.ToString();
txtPulsosRef.Text = _CalibragemVazao.QtdPulsos.ToString();
DispAtu.Dados.DensidadeHerbicida = _CalibragemVazao.d;
btnSalvar_Click(sender, EventArgs.Empty);
}
}
else
{
btnCalibrarVazao.Enabled = false;
btnLigarBomba_Click(sender, e);
var tmrInicioCalibragemVazao = new Timer { Interval = 1000 };
tmrInicioCalibragemVazao.Tick += tmrInicioCalibragemVazao_Tick;
tmrInicioCalibragemVazao.Start();
}
}
private void tmrInicioCalibragemVazao_Tick(object sender, EventArgs e)
{
((Timer)sender).Stop();
var tmrCalibragemVazao = new Timer() { Interval = 500 };
_CalibragemVazao = new CalibragemVazao()
{
Calibrando = true,
MassaInicial = DispAtu.Dados.MassaReservatorio,
PressoesAferidas = new List<double>()
{
DispAtu.Dados.PressaoLinha,
}
};
tmrCalibragemVazao.Tick += tmrCalibragemVazao_Tick;
tmrCalibragemVazao.Start();
btn1_Click(new Button() { Name = "btn1_" + DispAtu.Dados.BicosPulverizadores.First(x => x.Inicializado).ID }, e);
}
private void tmrCalibragemVazao_Tick(object sender, EventArgs e)
{
_CalibragemVazao.QtdPulsos = DispAtu.Dados._LeituraPulsos;
_CalibragemVazao.Periodo = DispAtu.Dados._LeituraPeriodo;
_CalibragemVazao.PressoesAferidas.Add(DispAtu.Dados.PressaoLinha);
_CalibragemVazao.MassaFinal = DispAtu.Dados.MassaReservatorio;
if (DispAtu.Dados._LeituraPeriodo >= _CalibragemVazao.TempoCalibragem)
{
((Timer)sender).Stop();
btn0_Click(new Button() { Name = "btn0_" + DispAtu.Dados.BicosPulverizadores.First(x => x.Inicializado).ID }, e);
btnDesligarBomba_Click(sender, e);
_CalibragemVazao.Periodo = _CalibragemVazao.Periodo / 1000.0;
btnCalibrarVazao.Text = "Calcular";
btnCalibrarVazao.Enabled = true;
}
}
}
class CalibragemVazao
{
public bool Calibrando { get; set; } = false;
public double TempoCalibragem { get; set; } = 10000.0;
public double VolumeComputado { get; set; } = 0;
public List<double> PressoesAferidas { get; set; } = new List<double>();
public double MassaInicial { get; set; } = 0.0;
public double MassaFinal { get; set; } = 0.0;
public int QtdPulsos { get; set; } = 0;
public double Periodo { get; set; } = 0.0;
public double PressaoMedia
{
get
{
return PressoesAferidas.Average();
}
}
public double MassaPerdida
{
get
{
return (MassaInicial - MassaFinal) * 1000;
}
}
public double Q
{
get
{
return (double)VolumeComputado / (double)Periodo;
}
}
public double VolumeCalculado { get; set;} = 0.0;
public double d
{
get
{
return (double)MassaPerdida / (double)VolumeComputado;
}
}
public double x
{
get
{
return (double)VolumeComputado / (double)QtdPulsos;
}
}
public double Q2
{
get
{
return (double)x * (double)QtdPulsos;
}
}
}
}

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

@ -116,6 +116,8 @@ namespace AgroBase.Forms.Operacoes
pnlOrientacao.Invalidate();
pnlInclinacao.Invalidate();
PZEMService.EnviarComando(PZEMService.PortaPZEM, PZEMService.ComandoAquisicaoDados());
if (!Variaveis.OperacaoEmAndamento.Iniciado && btnIniciarOperacao.Text == "Finalizar Operação")
{
AtualizaComponentesOperacao();
@ -364,8 +366,8 @@ namespace AgroBase.Forms.Operacoes
pgbReservatorio.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio);
lblPorcentagemReservatorio.Text = Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio.ToString("00.00") + "%";
pgbBateria.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria);
lblPorcentagemBateria.Text = Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria.ToString("00.00") + "%";
pgbBateria.Value = Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria <= 100 ? Convert.ToInt32(Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria) : 100;
lblPorcentagemBateria.Text = (PZEMService.Iniciado && PZEMService.UltimaLeitura != null ? PZEMService.UltimaLeitura.Tensao.ToString("0.00") + "v " + PZEMService.UltimaLeitura.Corrente.ToString("0.00") + "A " : "") + Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria.ToString("00.00") + "%";
pgbProgresso.Value = Variaveis.OperacaoEmAndamento.Sensoriamento.ProgressoTrajeto <= 100 ? Convert.ToInt32(Variaveis.OperacaoEmAndamento.Sensoriamento.ProgressoTrajeto) : 100;
lblPorcentagemProgresso.Text = Variaveis.OperacaoEmAndamento.Sensoriamento.ProgressoTrajeto.ToString("00.00") + "%";

View File

@ -29,9 +29,9 @@ namespace AgroBase.Forms.Operacoes
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series2 = 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.pnlCameraSolo = new System.Windows.Forms.Panel();
this.pnlCameraSoloD = new System.Windows.Forms.Panel();
this.pnlCameraSoloE = new System.Windows.Forms.Panel();
@ -106,35 +106,37 @@ namespace AgroBase.Forms.Operacoes
this.pnlCameraSolo.BackColor = System.Drawing.SystemColors.ControlDark;
this.pnlCameraSolo.Controls.Add(this.pnlCameraSoloD);
this.pnlCameraSolo.Controls.Add(this.pnlCameraSoloE);
this.pnlCameraSolo.Location = new System.Drawing.Point(9, 217);
this.pnlCameraSolo.Margin = new System.Windows.Forms.Padding(2);
this.pnlCameraSolo.Location = new System.Drawing.Point(12, 267);
this.pnlCameraSolo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pnlCameraSolo.Name = "pnlCameraSolo";
this.pnlCameraSolo.Size = new System.Drawing.Size(592, 268);
this.pnlCameraSolo.Size = new System.Drawing.Size(789, 330);
this.pnlCameraSolo.TabIndex = 0;
//
// pnlCameraSoloD
//
this.pnlCameraSoloD.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.pnlCameraSoloD.Location = new System.Drawing.Point(299, 2);
this.pnlCameraSoloD.Location = new System.Drawing.Point(399, 2);
this.pnlCameraSoloD.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.pnlCameraSoloD.Name = "pnlCameraSoloD";
this.pnlCameraSoloD.Size = new System.Drawing.Size(289, 264);
this.pnlCameraSoloD.Size = new System.Drawing.Size(385, 325);
this.pnlCameraSoloD.TabIndex = 1;
//
// pnlCameraSoloE
//
this.pnlCameraSoloE.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.pnlCameraSoloE.Location = new System.Drawing.Point(4, 2);
this.pnlCameraSoloE.Location = new System.Drawing.Point(5, 2);
this.pnlCameraSoloE.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.pnlCameraSoloE.Name = "pnlCameraSoloE";
this.pnlCameraSoloE.Size = new System.Drawing.Size(289, 264);
this.pnlCameraSoloE.Size = new System.Drawing.Size(385, 325);
this.pnlCameraSoloE.TabIndex = 0;
//
// pnlCameraCaminho
//
this.pnlCameraCaminho.BackColor = System.Drawing.SystemColors.ControlDarkDark;
this.pnlCameraCaminho.Location = new System.Drawing.Point(361, 10);
this.pnlCameraCaminho.Margin = new System.Windows.Forms.Padding(2);
this.pnlCameraCaminho.Location = new System.Drawing.Point(481, 12);
this.pnlCameraCaminho.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pnlCameraCaminho.Name = "pnlCameraCaminho";
this.pnlCameraCaminho.Size = new System.Drawing.Size(262, 203);
this.pnlCameraCaminho.Size = new System.Drawing.Size(349, 250);
this.pnlCameraCaminho.TabIndex = 1;
//
// pnlAtuadores
@ -142,56 +144,57 @@ namespace AgroBase.Forms.Operacoes
this.pnlAtuadores.BackColor = System.Drawing.SystemColors.Control;
this.pnlAtuadores.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pnlAtuadores.Controls.Add(this.lblPressao);
this.pnlAtuadores.Location = new System.Drawing.Point(9, 491);
this.pnlAtuadores.Margin = new System.Windows.Forms.Padding(2);
this.pnlAtuadores.Location = new System.Drawing.Point(12, 604);
this.pnlAtuadores.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pnlAtuadores.Name = "pnlAtuadores";
this.pnlAtuadores.Size = new System.Drawing.Size(594, 71);
this.pnlAtuadores.Size = new System.Drawing.Size(791, 86);
this.pnlAtuadores.TabIndex = 2;
this.pnlAtuadores.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlAtuadores_Paint);
//
// lblPressao
//
this.lblPressao.AutoSize = true;
this.lblPressao.Location = new System.Drawing.Point(-2, 0);
this.lblPressao.Location = new System.Drawing.Point(-3, 0);
this.lblPressao.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblPressao.Name = "lblPressao";
this.lblPressao.Size = new System.Drawing.Size(57, 13);
this.lblPressao.Size = new System.Drawing.Size(67, 16);
this.lblPressao.TabIndex = 0;
this.lblPressao.Text = "P: 0.00 psi";
//
// pnlCaminho
//
this.pnlCaminho.BackColor = System.Drawing.Color.White;
this.pnlCaminho.Location = new System.Drawing.Point(627, 21);
this.pnlCaminho.Margin = new System.Windows.Forms.Padding(2);
this.pnlCaminho.Location = new System.Drawing.Point(836, 26);
this.pnlCaminho.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pnlCaminho.Name = "pnlCaminho";
this.pnlCaminho.Size = new System.Drawing.Size(384, 279);
this.pnlCaminho.Size = new System.Drawing.Size(512, 343);
this.pnlCaminho.TabIndex = 3;
this.pnlCaminho.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlCaminho_Paint);
//
// pnlGraficos
//
this.pnlGraficos.Controls.Add(this.chartGraficos);
this.pnlGraficos.Location = new System.Drawing.Point(606, 307);
this.pnlGraficos.Margin = new System.Windows.Forms.Padding(2);
this.pnlGraficos.Location = new System.Drawing.Point(808, 378);
this.pnlGraficos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pnlGraficos.Name = "pnlGraficos";
this.pnlGraficos.Size = new System.Drawing.Size(405, 254);
this.pnlGraficos.Size = new System.Drawing.Size(540, 313);
this.pnlGraficos.TabIndex = 4;
//
// chartGraficos
//
chartArea2.Name = "ChartArea1";
this.chartGraficos.ChartAreas.Add(chartArea2);
chartArea1.Name = "ChartArea1";
this.chartGraficos.ChartAreas.Add(chartArea1);
this.chartGraficos.Dock = System.Windows.Forms.DockStyle.Fill;
legend2.Name = "Legend1";
this.chartGraficos.Legends.Add(legend2);
legend1.Name = "Legend1";
this.chartGraficos.Legends.Add(legend1);
this.chartGraficos.Location = new System.Drawing.Point(0, 0);
this.chartGraficos.Margin = new System.Windows.Forms.Padding(2);
this.chartGraficos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.chartGraficos.Name = "chartGraficos";
series2.ChartArea = "ChartArea1";
series2.Legend = "Legend1";
series2.Name = "Series1";
this.chartGraficos.Series.Add(series2);
this.chartGraficos.Size = new System.Drawing.Size(405, 254);
series1.ChartArea = "ChartArea1";
series1.Legend = "Legend1";
series1.Name = "Series1";
this.chartGraficos.Series.Add(series1);
this.chartGraficos.Size = new System.Drawing.Size(540, 313);
this.chartGraficos.TabIndex = 0;
this.chartGraficos.Text = "chart1";
//
@ -215,28 +218,27 @@ namespace AgroBase.Forms.Operacoes
this.pnlNiveis.Controls.Add(this.lblPorcentagemReservatorio);
this.pnlNiveis.Controls.Add(this.pgbReservatorio);
this.pnlNiveis.Font = new System.Drawing.Font("Mongolian Baiti", 9F, System.Drawing.FontStyle.Bold);
this.pnlNiveis.Location = new System.Drawing.Point(9, 570);
this.pnlNiveis.Margin = new System.Windows.Forms.Padding(2);
this.pnlNiveis.Location = new System.Drawing.Point(12, 702);
this.pnlNiveis.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pnlNiveis.Name = "pnlNiveis";
this.pnlNiveis.Size = new System.Drawing.Size(592, 69);
this.pnlNiveis.Size = new System.Drawing.Size(789, 85);
this.pnlNiveis.TabIndex = 6;
//
// lblPorcentagemProgressoRua
//
this.lblPorcentagemProgressoRua.AutoSize = true;
this.lblPorcentagemProgressoRua.Location = new System.Drawing.Point(533, 23);
this.lblPorcentagemProgressoRua.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblPorcentagemProgressoRua.Location = new System.Drawing.Point(711, 28);
this.lblPorcentagemProgressoRua.Name = "lblPorcentagemProgressoRua";
this.lblPorcentagemProgressoRua.Size = new System.Drawing.Size(50, 13);
this.lblPorcentagemProgressoRua.Size = new System.Drawing.Size(62, 16);
this.lblPorcentagemProgressoRua.TabIndex = 16;
this.lblPorcentagemProgressoRua.Text = "00,00%";
//
// btnSimular
//
this.btnSimular.Location = new System.Drawing.Point(479, 42);
this.btnSimular.Margin = new System.Windows.Forms.Padding(2);
this.btnSimular.Location = new System.Drawing.Point(639, 52);
this.btnSimular.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnSimular.Name = "btnSimular";
this.btnSimular.Size = new System.Drawing.Size(61, 21);
this.btnSimular.Size = new System.Drawing.Size(81, 26);
this.btnSimular.TabIndex = 12;
this.btnSimular.Text = "Simular";
this.btnSimular.UseVisualStyleBackColor = true;
@ -244,28 +246,27 @@ namespace AgroBase.Forms.Operacoes
//
// pgbProgressoRua
//
this.pgbProgressoRua.Location = new System.Drawing.Point(375, 23);
this.pgbProgressoRua.Margin = new System.Windows.Forms.Padding(2);
this.pgbProgressoRua.Location = new System.Drawing.Point(500, 28);
this.pgbProgressoRua.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pgbProgressoRua.Name = "pgbProgressoRua";
this.pgbProgressoRua.Size = new System.Drawing.Size(150, 13);
this.pgbProgressoRua.Size = new System.Drawing.Size(200, 16);
this.pgbProgressoRua.TabIndex = 15;
//
// lblProgressoRua
//
this.lblProgressoRua.AutoSize = true;
this.lblProgressoRua.Location = new System.Drawing.Point(307, 23);
this.lblProgressoRua.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblProgressoRua.Location = new System.Drawing.Point(409, 28);
this.lblProgressoRua.Name = "lblProgressoRua";
this.lblProgressoRua.Size = new System.Drawing.Size(44, 13);
this.lblProgressoRua.Size = new System.Drawing.Size(54, 16);
this.lblProgressoRua.TabIndex = 14;
this.lblProgressoRua.Text = "% Rua";
//
// btnManobraConcluida
//
this.btnManobraConcluida.Location = new System.Drawing.Point(544, 43);
this.btnManobraConcluida.Margin = new System.Windows.Forms.Padding(2);
this.btnManobraConcluida.Location = new System.Drawing.Point(725, 53);
this.btnManobraConcluida.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnManobraConcluida.Name = "btnManobraConcluida";
this.btnManobraConcluida.Size = new System.Drawing.Size(39, 21);
this.btnManobraConcluida.Size = new System.Drawing.Size(52, 26);
this.btnManobraConcluida.TabIndex = 13;
this.btnManobraConcluida.Text = "MC";
this.btnManobraConcluida.UseVisualStyleBackColor = true;
@ -275,10 +276,9 @@ namespace AgroBase.Forms.Operacoes
//
this.lblDirecao.AutoSize = true;
this.lblDirecao.Font = new System.Drawing.Font("Mongolian Baiti", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblDirecao.Location = new System.Drawing.Point(308, 54);
this.lblDirecao.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblDirecao.Location = new System.Drawing.Point(411, 66);
this.lblDirecao.Name = "lblDirecao";
this.lblDirecao.Size = new System.Drawing.Size(94, 11);
this.lblDirecao.Size = new System.Drawing.Size(113, 15);
this.lblDirecao.TabIndex = 11;
this.lblDirecao.Text = "Direção: Parado";
//
@ -286,96 +286,89 @@ namespace AgroBase.Forms.Operacoes
//
this.lblStatus.AutoSize = true;
this.lblStatus.Font = new System.Drawing.Font("Mongolian Baiti", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblStatus.Location = new System.Drawing.Point(308, 41);
this.lblStatus.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblStatus.Location = new System.Drawing.Point(411, 50);
this.lblStatus.Name = "lblStatus";
this.lblStatus.Size = new System.Drawing.Size(114, 11);
this.lblStatus.Size = new System.Drawing.Size(136, 15);
this.lblStatus.TabIndex = 10;
this.lblStatus.Text = "Status: Aguardando";
//
// lblProgressoT
//
this.lblProgressoT.AutoSize = true;
this.lblProgressoT.Location = new System.Drawing.Point(307, 6);
this.lblProgressoT.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblProgressoT.Location = new System.Drawing.Point(409, 7);
this.lblProgressoT.Name = "lblProgressoT";
this.lblProgressoT.Size = new System.Drawing.Size(62, 13);
this.lblProgressoT.Size = new System.Drawing.Size(77, 16);
this.lblProgressoT.TabIndex = 8;
this.lblProgressoT.Text = "% Trajeto";
//
// lblPorcentagemBateria
//
this.lblPorcentagemBateria.AutoSize = true;
this.lblPorcentagemBateria.Location = new System.Drawing.Point(167, 43);
this.lblPorcentagemBateria.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblPorcentagemBateria.Location = new System.Drawing.Point(138, 53);
this.lblPorcentagemBateria.Name = "lblPorcentagemBateria";
this.lblPorcentagemBateria.Size = new System.Drawing.Size(50, 13);
this.lblPorcentagemBateria.Size = new System.Drawing.Size(62, 16);
this.lblPorcentagemBateria.TabIndex = 3;
this.lblPorcentagemBateria.Text = "00,00%";
//
// lblBateriaT
//
this.lblBateriaT.AutoSize = true;
this.lblBateriaT.Location = new System.Drawing.Point(2, 44);
this.lblBateriaT.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblBateriaT.Location = new System.Drawing.Point(3, 54);
this.lblBateriaT.Name = "lblBateriaT";
this.lblBateriaT.Size = new System.Drawing.Size(47, 13);
this.lblBateriaT.Size = new System.Drawing.Size(58, 16);
this.lblBateriaT.TabIndex = 7;
this.lblBateriaT.Text = "Bateria";
//
// lblReservatorioT
//
this.lblReservatorioT.AutoSize = true;
this.lblReservatorioT.Location = new System.Drawing.Point(2, 13);
this.lblReservatorioT.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblReservatorioT.Location = new System.Drawing.Point(3, 16);
this.lblReservatorioT.Name = "lblReservatorioT";
this.lblReservatorioT.Size = new System.Drawing.Size(79, 13);
this.lblReservatorioT.Size = new System.Drawing.Size(98, 16);
this.lblReservatorioT.TabIndex = 6;
this.lblReservatorioT.Text = "Reservatório";
//
// lblPorcentagemProgresso
//
this.lblPorcentagemProgresso.AutoSize = true;
this.lblPorcentagemProgresso.Location = new System.Drawing.Point(533, 6);
this.lblPorcentagemProgresso.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblPorcentagemProgresso.Location = new System.Drawing.Point(711, 7);
this.lblPorcentagemProgresso.Name = "lblPorcentagemProgresso";
this.lblPorcentagemProgresso.Size = new System.Drawing.Size(50, 13);
this.lblPorcentagemProgresso.Size = new System.Drawing.Size(62, 16);
this.lblPorcentagemProgresso.TabIndex = 5;
this.lblPorcentagemProgresso.Text = "00,00%";
//
// pgbBateria
//
this.pgbBateria.Location = new System.Drawing.Point(98, 36);
this.pgbBateria.Margin = new System.Windows.Forms.Padding(2);
this.pgbBateria.Location = new System.Drawing.Point(131, 44);
this.pgbBateria.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pgbBateria.Name = "pgbBateria";
this.pgbBateria.Size = new System.Drawing.Size(175, 27);
this.pgbBateria.Size = new System.Drawing.Size(233, 33);
this.pgbBateria.TabIndex = 2;
//
// pgbProgresso
//
this.pgbProgresso.Location = new System.Drawing.Point(375, 6);
this.pgbProgresso.Margin = new System.Windows.Forms.Padding(2);
this.pgbProgresso.Location = new System.Drawing.Point(500, 7);
this.pgbProgresso.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pgbProgresso.Name = "pgbProgresso";
this.pgbProgresso.Size = new System.Drawing.Size(150, 13);
this.pgbProgresso.Size = new System.Drawing.Size(200, 16);
this.pgbProgresso.TabIndex = 4;
//
// lblPorcentagemReservatorio
//
this.lblPorcentagemReservatorio.AutoSize = true;
this.lblPorcentagemReservatorio.BackColor = System.Drawing.Color.Transparent;
this.lblPorcentagemReservatorio.Location = new System.Drawing.Point(167, 12);
this.lblPorcentagemReservatorio.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblPorcentagemReservatorio.Location = new System.Drawing.Point(138, 15);
this.lblPorcentagemReservatorio.Name = "lblPorcentagemReservatorio";
this.lblPorcentagemReservatorio.Size = new System.Drawing.Size(50, 13);
this.lblPorcentagemReservatorio.Size = new System.Drawing.Size(62, 16);
this.lblPorcentagemReservatorio.TabIndex = 1;
this.lblPorcentagemReservatorio.Text = "00,00%";
//
// pgbReservatorio
//
this.pgbReservatorio.Location = new System.Drawing.Point(98, 5);
this.pgbReservatorio.Margin = new System.Windows.Forms.Padding(2);
this.pgbReservatorio.Location = new System.Drawing.Point(131, 6);
this.pgbReservatorio.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pgbReservatorio.Name = "pgbReservatorio";
this.pgbReservatorio.Size = new System.Drawing.Size(175, 27);
this.pgbReservatorio.Size = new System.Drawing.Size(233, 33);
this.pgbReservatorio.TabIndex = 0;
//
// gpbOpcoes
@ -389,21 +382,21 @@ namespace AgroBase.Forms.Operacoes
this.gpbOpcoes.Controls.Add(this.cmbCameraSoloE);
this.gpbOpcoes.Controls.Add(this.lblCameraSoloE);
this.gpbOpcoes.Font = new System.Drawing.Font("Mongolian Baiti", 9F, System.Drawing.FontStyle.Bold);
this.gpbOpcoes.Location = new System.Drawing.Point(813, 566);
this.gpbOpcoes.Margin = new System.Windows.Forms.Padding(2);
this.gpbOpcoes.Location = new System.Drawing.Point(1084, 697);
this.gpbOpcoes.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbOpcoes.Name = "gpbOpcoes";
this.gpbOpcoes.Padding = new System.Windows.Forms.Padding(2);
this.gpbOpcoes.Size = new System.Drawing.Size(198, 119);
this.gpbOpcoes.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbOpcoes.Size = new System.Drawing.Size(264, 146);
this.gpbOpcoes.TabIndex = 7;
this.gpbOpcoes.TabStop = false;
this.gpbOpcoes.Text = "Opções";
//
// btnCarregarMapa
//
this.btnCarregarMapa.Location = new System.Drawing.Point(4, 93);
this.btnCarregarMapa.Margin = new System.Windows.Forms.Padding(2);
this.btnCarregarMapa.Location = new System.Drawing.Point(5, 114);
this.btnCarregarMapa.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnCarregarMapa.Name = "btnCarregarMapa";
this.btnCarregarMapa.Size = new System.Drawing.Size(74, 21);
this.btnCarregarMapa.Size = new System.Drawing.Size(99, 26);
this.btnCarregarMapa.TabIndex = 5;
this.btnCarregarMapa.Text = "Mapa";
this.btnCarregarMapa.UseVisualStyleBackColor = true;
@ -413,29 +406,28 @@ namespace AgroBase.Forms.Operacoes
//
this.cmbCameraSoloD.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCameraSoloD.FormattingEnabled = true;
this.cmbCameraSoloD.Location = new System.Drawing.Point(83, 42);
this.cmbCameraSoloD.Margin = new System.Windows.Forms.Padding(2);
this.cmbCameraSoloD.Location = new System.Drawing.Point(111, 52);
this.cmbCameraSoloD.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmbCameraSoloD.Name = "cmbCameraSoloD";
this.cmbCameraSoloD.Size = new System.Drawing.Size(111, 21);
this.cmbCameraSoloD.Size = new System.Drawing.Size(147, 24);
this.cmbCameraSoloD.TabIndex = 8;
this.cmbCameraSoloD.SelectedIndexChanged += new System.EventHandler(this.cmbCameraSolo_SelectedIndexChanged);
//
// lblCameraSoloD
//
this.lblCameraSoloD.AutoSize = true;
this.lblCameraSoloD.Location = new System.Drawing.Point(4, 45);
this.lblCameraSoloD.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblCameraSoloD.Location = new System.Drawing.Point(5, 55);
this.lblCameraSoloD.Name = "lblCameraSoloD";
this.lblCameraSoloD.Size = new System.Drawing.Size(76, 13);
this.lblCameraSoloD.Size = new System.Drawing.Size(93, 16);
this.lblCameraSoloD.TabIndex = 7;
this.lblCameraSoloD.Text = "Cam Solo D";
//
// btnIniciarOperacao
//
this.btnIniciarOperacao.Location = new System.Drawing.Point(83, 93);
this.btnIniciarOperacao.Margin = new System.Windows.Forms.Padding(2);
this.btnIniciarOperacao.Location = new System.Drawing.Point(111, 114);
this.btnIniciarOperacao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnIniciarOperacao.Name = "btnIniciarOperacao";
this.btnIniciarOperacao.Size = new System.Drawing.Size(111, 21);
this.btnIniciarOperacao.Size = new System.Drawing.Size(148, 26);
this.btnIniciarOperacao.TabIndex = 6;
this.btnIniciarOperacao.Text = "Iniciar Operação";
this.btnIniciarOperacao.UseVisualStyleBackColor = true;
@ -445,20 +437,19 @@ namespace AgroBase.Forms.Operacoes
//
this.cmbCameraCaminho.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCameraCaminho.FormattingEnabled = true;
this.cmbCameraCaminho.Location = new System.Drawing.Point(83, 67);
this.cmbCameraCaminho.Margin = new System.Windows.Forms.Padding(2);
this.cmbCameraCaminho.Location = new System.Drawing.Point(111, 82);
this.cmbCameraCaminho.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmbCameraCaminho.Name = "cmbCameraCaminho";
this.cmbCameraCaminho.Size = new System.Drawing.Size(111, 21);
this.cmbCameraCaminho.Size = new System.Drawing.Size(147, 24);
this.cmbCameraCaminho.TabIndex = 3;
this.cmbCameraCaminho.SelectedIndexChanged += new System.EventHandler(this.cmbCameraCaminho_SelectedIndexChanged);
//
// lblCameraCaminho
//
this.lblCameraCaminho.AutoSize = true;
this.lblCameraCaminho.Location = new System.Drawing.Point(4, 70);
this.lblCameraCaminho.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblCameraCaminho.Location = new System.Drawing.Point(5, 86);
this.lblCameraCaminho.Name = "lblCameraCaminho";
this.lblCameraCaminho.Size = new System.Drawing.Size(75, 13);
this.lblCameraCaminho.Size = new System.Drawing.Size(94, 16);
this.lblCameraCaminho.TabIndex = 2;
this.lblCameraCaminho.Text = "Camera Rua";
//
@ -466,20 +457,19 @@ namespace AgroBase.Forms.Operacoes
//
this.cmbCameraSoloE.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbCameraSoloE.FormattingEnabled = true;
this.cmbCameraSoloE.Location = new System.Drawing.Point(83, 17);
this.cmbCameraSoloE.Margin = new System.Windows.Forms.Padding(2);
this.cmbCameraSoloE.Location = new System.Drawing.Point(111, 21);
this.cmbCameraSoloE.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmbCameraSoloE.Name = "cmbCameraSoloE";
this.cmbCameraSoloE.Size = new System.Drawing.Size(111, 21);
this.cmbCameraSoloE.Size = new System.Drawing.Size(147, 24);
this.cmbCameraSoloE.TabIndex = 1;
this.cmbCameraSoloE.SelectedIndexChanged += new System.EventHandler(this.cmbCameraSolo_SelectedIndexChanged);
//
// lblCameraSoloE
//
this.lblCameraSoloE.AutoSize = true;
this.lblCameraSoloE.Location = new System.Drawing.Point(4, 20);
this.lblCameraSoloE.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblCameraSoloE.Location = new System.Drawing.Point(5, 25);
this.lblCameraSoloE.Name = "lblCameraSoloE";
this.lblCameraSoloE.Size = new System.Drawing.Size(74, 13);
this.lblCameraSoloE.Size = new System.Drawing.Size(91, 16);
this.lblCameraSoloE.TabIndex = 0;
this.lblCameraSoloE.Text = "Cam Solo E";
//
@ -493,11 +483,11 @@ namespace AgroBase.Forms.Operacoes
this.gpbInformacoesGerais.Controls.Add(this.lblTempoOperacao);
this.gpbInformacoesGerais.Controls.Add(this.lblDistanciaPercorrida);
this.gpbInformacoesGerais.Font = new System.Drawing.Font("Mongolian Baiti", 9F, System.Drawing.FontStyle.Bold);
this.gpbInformacoesGerais.Location = new System.Drawing.Point(606, 566);
this.gpbInformacoesGerais.Margin = new System.Windows.Forms.Padding(2);
this.gpbInformacoesGerais.Location = new System.Drawing.Point(808, 697);
this.gpbInformacoesGerais.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbInformacoesGerais.Name = "gpbInformacoesGerais";
this.gpbInformacoesGerais.Padding = new System.Windows.Forms.Padding(2);
this.gpbInformacoesGerais.Size = new System.Drawing.Size(202, 119);
this.gpbInformacoesGerais.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbInformacoesGerais.Size = new System.Drawing.Size(269, 146);
this.gpbInformacoesGerais.TabIndex = 9;
this.gpbInformacoesGerais.TabStop = false;
this.gpbInformacoesGerais.Text = "Informações Gerais";
@ -505,70 +495,63 @@ namespace AgroBase.Forms.Operacoes
// lblBateriaConsumida
//
this.lblBateriaConsumida.AutoSize = true;
this.lblBateriaConsumida.Location = new System.Drawing.Point(8, 100);
this.lblBateriaConsumida.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblBateriaConsumida.Location = new System.Drawing.Point(11, 123);
this.lblBateriaConsumida.Name = "lblBateriaConsumida";
this.lblBateriaConsumida.Size = new System.Drawing.Size(158, 13);
this.lblBateriaConsumida.Size = new System.Drawing.Size(199, 16);
this.lblBateriaConsumida.TabIndex = 6;
this.lblBateriaConsumida.Text = "Bateria Consumida: 0,00%";
//
// lblHerbicidaPorErva
//
this.lblHerbicidaPorErva.AutoSize = true;
this.lblHerbicidaPorErva.Location = new System.Drawing.Point(8, 87);
this.lblHerbicidaPorErva.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblHerbicidaPorErva.Location = new System.Drawing.Point(11, 107);
this.lblHerbicidaPorErva.Name = "lblHerbicidaPorErva";
this.lblHerbicidaPorErva.Size = new System.Drawing.Size(177, 13);
this.lblHerbicidaPorErva.Size = new System.Drawing.Size(223, 16);
this.lblHerbicidaPorErva.TabIndex = 5;
this.lblHerbicidaPorErva.Text = "Herbicida por Erva: 0,000 mL";
//
// lblHerbicidaAplicado
//
this.lblHerbicidaAplicado.AutoSize = true;
this.lblHerbicidaAplicado.Location = new System.Drawing.Point(8, 74);
this.lblHerbicidaAplicado.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblHerbicidaAplicado.Location = new System.Drawing.Point(11, 91);
this.lblHerbicidaAplicado.Name = "lblHerbicidaAplicado";
this.lblHerbicidaAplicado.Size = new System.Drawing.Size(162, 13);
this.lblHerbicidaAplicado.Size = new System.Drawing.Size(204, 16);
this.lblHerbicidaAplicado.TabIndex = 4;
this.lblHerbicidaAplicado.Text = "Herbicida Aplicado: 0,00 L";
//
// lblErvasIdentificadas
//
this.lblErvasIdentificadas.AutoSize = true;
this.lblErvasIdentificadas.Location = new System.Drawing.Point(8, 61);
this.lblErvasIdentificadas.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblErvasIdentificadas.Location = new System.Drawing.Point(11, 75);
this.lblErvasIdentificadas.Name = "lblErvasIdentificadas";
this.lblErvasIdentificadas.Size = new System.Drawing.Size(145, 13);
this.lblErvasIdentificadas.Size = new System.Drawing.Size(182, 16);
this.lblErvasIdentificadas.TabIndex = 3;
this.lblErvasIdentificadas.Text = "Ervas Identificadas: 000";
//
// lblVelocidadeMedia
//
this.lblVelocidadeMedia.AutoSize = true;
this.lblVelocidadeMedia.Location = new System.Drawing.Point(8, 48);
this.lblVelocidadeMedia.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblVelocidadeMedia.Location = new System.Drawing.Point(11, 59);
this.lblVelocidadeMedia.Name = "lblVelocidadeMedia";
this.lblVelocidadeMedia.Size = new System.Drawing.Size(174, 13);
this.lblVelocidadeMedia.Size = new System.Drawing.Size(220, 16);
this.lblVelocidadeMedia.TabIndex = 2;
this.lblVelocidadeMedia.Text = "Velocidade Média: 0,00 km/h";
//
// lblTempoOperacao
//
this.lblTempoOperacao.AutoSize = true;
this.lblTempoOperacao.Location = new System.Drawing.Point(8, 35);
this.lblTempoOperacao.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTempoOperacao.Location = new System.Drawing.Point(11, 43);
this.lblTempoOperacao.Name = "lblTempoOperacao";
this.lblTempoOperacao.Size = new System.Drawing.Size(177, 13);
this.lblTempoOperacao.Size = new System.Drawing.Size(225, 16);
this.lblTempoOperacao.TabIndex = 1;
this.lblTempoOperacao.Text = "Tempo de Operação: 00:00:00";
//
// lblDistanciaPercorrida
//
this.lblDistanciaPercorrida.AutoSize = true;
this.lblDistanciaPercorrida.Location = new System.Drawing.Point(8, 22);
this.lblDistanciaPercorrida.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblDistanciaPercorrida.Location = new System.Drawing.Point(11, 27);
this.lblDistanciaPercorrida.Name = "lblDistanciaPercorrida";
this.lblDistanciaPercorrida.Size = new System.Drawing.Size(170, 13);
this.lblDistanciaPercorrida.Size = new System.Drawing.Size(213, 16);
this.lblDistanciaPercorrida.TabIndex = 0;
this.lblDistanciaPercorrida.Text = "Distancia Percorrida: 0,00 m";
//
@ -576,10 +559,9 @@ namespace AgroBase.Forms.Operacoes
//
this.lblDistanciaEsquerda.AutoSize = true;
this.lblDistanciaEsquerda.Font = new System.Drawing.Font("Mongolian Baiti", 9.25F, System.Drawing.FontStyle.Bold);
this.lblDistanciaEsquerda.Location = new System.Drawing.Point(608, 300);
this.lblDistanciaEsquerda.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblDistanciaEsquerda.Location = new System.Drawing.Point(811, 369);
this.lblDistanciaEsquerda.Name = "lblDistanciaEsquerda";
this.lblDistanciaEsquerda.Size = new System.Drawing.Size(215, 14);
this.lblDistanciaEsquerda.Size = new System.Drawing.Size(246, 16);
this.lblDistanciaEsquerda.TabIndex = 11;
this.lblDistanciaEsquerda.Text = "Distancia da Esquerda: 00.00 cm";
//
@ -587,10 +569,9 @@ namespace AgroBase.Forms.Operacoes
//
this.lblDistanciaDireita.AutoSize = true;
this.lblDistanciaDireita.Font = new System.Drawing.Font("Mongolian Baiti", 9F, System.Drawing.FontStyle.Bold);
this.lblDistanciaDireita.Location = new System.Drawing.Point(834, 301);
this.lblDistanciaDireita.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblDistanciaDireita.Location = new System.Drawing.Point(1112, 370);
this.lblDistanciaDireita.Name = "lblDistanciaDireita";
this.lblDistanciaDireita.Size = new System.Drawing.Size(180, 13);
this.lblDistanciaDireita.Size = new System.Drawing.Size(227, 16);
this.lblDistanciaDireita.TabIndex = 12;
this.lblDistanciaDireita.Text = "Distancia da Direita: 00.00 cm";
//
@ -605,20 +586,19 @@ namespace AgroBase.Forms.Operacoes
this.pnlInferior.Controls.Add(this.lblUltimaLeituraRua);
this.pnlInferior.Controls.Add(this.lblUltimaLeituraSolo);
this.pnlInferior.Font = new System.Drawing.Font("Mongolian Baiti", 9F, System.Drawing.FontStyle.Bold);
this.pnlInferior.Location = new System.Drawing.Point(9, 644);
this.pnlInferior.Margin = new System.Windows.Forms.Padding(2);
this.pnlInferior.Location = new System.Drawing.Point(12, 793);
this.pnlInferior.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pnlInferior.Name = "pnlInferior";
this.pnlInferior.Size = new System.Drawing.Size(592, 41);
this.pnlInferior.Size = new System.Drawing.Size(789, 50);
this.pnlInferior.TabIndex = 13;
//
// lblDistancia
//
this.lblDistancia.AutoSize = true;
this.lblDistancia.Font = new System.Drawing.Font("Mongolian Baiti", 9F, System.Drawing.FontStyle.Bold);
this.lblDistancia.Location = new System.Drawing.Point(227, 24);
this.lblDistancia.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblDistancia.Location = new System.Drawing.Point(303, 30);
this.lblDistancia.Name = "lblDistancia";
this.lblDistancia.Size = new System.Drawing.Size(171, 13);
this.lblDistancia.Size = new System.Drawing.Size(216, 16);
this.lblDistancia.TabIndex = 10;
this.lblDistancia.Text = "Distância Operação: 00,00 m";
//
@ -626,19 +606,19 @@ namespace AgroBase.Forms.Operacoes
//
this.lblMapaCarregado.AutoSize = true;
this.lblMapaCarregado.Font = new System.Drawing.Font("Mongolian Baiti", 9F, System.Drawing.FontStyle.Bold);
this.lblMapaCarregado.Location = new System.Drawing.Point(227, 4);
this.lblMapaCarregado.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblMapaCarregado.Location = new System.Drawing.Point(303, 5);
this.lblMapaCarregado.Name = "lblMapaCarregado";
this.lblMapaCarregado.Size = new System.Drawing.Size(129, 13);
this.lblMapaCarregado.Size = new System.Drawing.Size(161, 16);
this.lblMapaCarregado.TabIndex = 8;
this.lblMapaCarregado.Text = "Mapa carregado: N/A";
//
// chbGPSativo
//
this.chbGPSativo.AutoSize = true;
this.chbGPSativo.Location = new System.Drawing.Point(531, 20);
this.chbGPSativo.Location = new System.Drawing.Point(708, 25);
this.chbGPSativo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chbGPSativo.Name = "chbGPSativo";
this.chbGPSativo.Size = new System.Drawing.Size(52, 17);
this.chbGPSativo.Size = new System.Drawing.Size(59, 20);
this.chbGPSativo.TabIndex = 9;
this.chbGPSativo.Text = "GPS";
this.chbGPSativo.UseVisualStyleBackColor = true;
@ -646,9 +626,10 @@ namespace AgroBase.Forms.Operacoes
// chbATUativo
//
this.chbATUativo.AutoSize = true;
this.chbATUativo.Location = new System.Drawing.Point(531, 3);
this.chbATUativo.Location = new System.Drawing.Point(708, 4);
this.chbATUativo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chbATUativo.Name = "chbATUativo";
this.chbATUativo.Size = new System.Drawing.Size(54, 17);
this.chbATUativo.Size = new System.Drawing.Size(63, 20);
this.chbATUativo.TabIndex = 8;
this.chbATUativo.Text = "ATU";
this.chbATUativo.UseVisualStyleBackColor = true;
@ -656,9 +637,10 @@ namespace AgroBase.Forms.Operacoes
// chbDIRativo
//
this.chbDIRativo.AutoSize = true;
this.chbDIRativo.Location = new System.Drawing.Point(467, 23);
this.chbDIRativo.Location = new System.Drawing.Point(623, 28);
this.chbDIRativo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chbDIRativo.Name = "chbDIRativo";
this.chbDIRativo.Size = new System.Drawing.Size(50, 17);
this.chbDIRativo.Size = new System.Drawing.Size(58, 20);
this.chbDIRativo.TabIndex = 7;
this.chbDIRativo.Text = "DIR";
this.chbDIRativo.UseVisualStyleBackColor = true;
@ -666,9 +648,10 @@ namespace AgroBase.Forms.Operacoes
// chbMOVativo
//
this.chbMOVativo.AutoSize = true;
this.chbMOVativo.Location = new System.Drawing.Point(467, 3);
this.chbMOVativo.Location = new System.Drawing.Point(623, 4);
this.chbMOVativo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chbMOVativo.Name = "chbMOVativo";
this.chbMOVativo.Size = new System.Drawing.Size(58, 17);
this.chbMOVativo.Size = new System.Drawing.Size(67, 20);
this.chbMOVativo.TabIndex = 6;
this.chbMOVativo.Text = "MOV";
this.chbMOVativo.UseVisualStyleBackColor = true;
@ -676,28 +659,27 @@ namespace AgroBase.Forms.Operacoes
// lblUltimaLeituraRua
//
this.lblUltimaLeituraRua.AutoSize = true;
this.lblUltimaLeituraRua.Location = new System.Drawing.Point(2, 4);
this.lblUltimaLeituraRua.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblUltimaLeituraRua.Location = new System.Drawing.Point(3, 5);
this.lblUltimaLeituraRua.Name = "lblUltimaLeituraRua";
this.lblUltimaLeituraRua.Size = new System.Drawing.Size(198, 13);
this.lblUltimaLeituraRua.Size = new System.Drawing.Size(250, 16);
this.lblUltimaLeituraRua.TabIndex = 5;
this.lblUltimaLeituraRua.Text = "Ultima Leitura Rua: 00:00:00.000";
//
// lblUltimaLeituraSolo
//
this.lblUltimaLeituraSolo.AutoSize = true;
this.lblUltimaLeituraSolo.Location = new System.Drawing.Point(2, 24);
this.lblUltimaLeituraSolo.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblUltimaLeituraSolo.Location = new System.Drawing.Point(3, 30);
this.lblUltimaLeituraSolo.Name = "lblUltimaLeituraSolo";
this.lblUltimaLeituraSolo.Size = new System.Drawing.Size(202, 13);
this.lblUltimaLeituraSolo.Size = new System.Drawing.Size(254, 16);
this.lblUltimaLeituraSolo.TabIndex = 4;
this.lblUltimaLeituraSolo.Text = "Ultima Leitura Solo: 00:00:00.000";
//
// pnlMapa
//
this.pnlMapa.Location = new System.Drawing.Point(9, 6);
this.pnlMapa.Location = new System.Drawing.Point(12, 7);
this.pnlMapa.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.pnlMapa.Name = "pnlMapa";
this.pnlMapa.Size = new System.Drawing.Size(347, 207);
this.pnlMapa.Size = new System.Drawing.Size(463, 255);
this.pnlMapa.TabIndex = 14;
//
// pnlOrientacao
@ -705,10 +687,10 @@ namespace AgroBase.Forms.Operacoes
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(283, 6);
this.pnlOrientacao.Margin = new System.Windows.Forms.Padding(2);
this.pnlOrientacao.Location = new System.Drawing.Point(377, 7);
this.pnlOrientacao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pnlOrientacao.Name = "pnlOrientacao";
this.pnlOrientacao.Size = new System.Drawing.Size(78, 84);
this.pnlOrientacao.Size = new System.Drawing.Size(104, 103);
this.pnlOrientacao.TabIndex = 11;
this.pnlOrientacao.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlOrientacao_Paint);
//
@ -717,10 +699,10 @@ namespace AgroBase.Forms.Operacoes
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(937, 6);
this.pnlInclinacao.Margin = new System.Windows.Forms.Padding(2);
this.pnlInclinacao.Location = new System.Drawing.Point(1249, 7);
this.pnlInclinacao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pnlInclinacao.Name = "pnlInclinacao";
this.pnlInclinacao.Size = new System.Drawing.Size(78, 84);
this.pnlInclinacao.Size = new System.Drawing.Size(104, 103);
this.pnlInclinacao.TabIndex = 10;
this.pnlInclinacao.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlInclinacao_Paint);
//
@ -729,10 +711,10 @@ namespace AgroBase.Forms.Operacoes
this.pnlAnguloCamera.BackColor = System.Drawing.Color.White;
this.pnlAnguloCamera.BackgroundImage = global::AgroBase.Properties.Resources.transferidor;
this.pnlAnguloCamera.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pnlAnguloCamera.Location = new System.Drawing.Point(623, 6);
this.pnlAnguloCamera.Margin = new System.Windows.Forms.Padding(2);
this.pnlAnguloCamera.Location = new System.Drawing.Point(831, 7);
this.pnlAnguloCamera.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pnlAnguloCamera.Name = "pnlAnguloCamera";
this.pnlAnguloCamera.Size = new System.Drawing.Size(78, 84);
this.pnlAnguloCamera.Size = new System.Drawing.Size(104, 103);
this.pnlAnguloCamera.TabIndex = 15;
this.pnlAnguloCamera.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlAnguloCamera_Paint);
//
@ -740,18 +722,19 @@ namespace AgroBase.Forms.Operacoes
//
this.lblPerformance.AutoSize = true;
this.lblPerformance.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblPerformance.Location = new System.Drawing.Point(812, 684);
this.lblPerformance.Location = new System.Drawing.Point(1083, 842);
this.lblPerformance.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblPerformance.Name = "lblPerformance";
this.lblPerformance.Size = new System.Drawing.Size(158, 12);
this.lblPerformance.Size = new System.Drawing.Size(205, 15);
this.lblPerformance.TabIndex = 16;
this.lblPerformance.Text = "CPU: 0,0% GPU: 0,0% RAM: 0,0%";
//
// frmOperacaoMapaGPS
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1020, 697);
this.ClientSize = new System.Drawing.Size(1360, 858);
this.Controls.Add(this.lblPerformance);
this.Controls.Add(this.pnlAnguloCamera);
this.Controls.Add(this.pnlOrientacao);
@ -768,7 +751,7 @@ namespace AgroBase.Forms.Operacoes
this.Controls.Add(this.pnlAtuadores);
this.Controls.Add(this.pnlCameraCaminho);
this.Controls.Add(this.pnlCameraSolo);
this.Margin = new System.Windows.Forms.Padding(2);
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "frmOperacaoMapaGPS";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Operação Mapa GPS";

View File

@ -43,6 +43,12 @@
this.gridsMAS = new System.Windows.Forms.DataGridView();
this.lblUltrassom = new System.Windows.Forms.Label();
this.gridsPRS = new System.Windows.Forms.DataGridView();
this.btnBateriaVer = new System.Windows.Forms.Button();
this.cmbBateriaParametro = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.nudBateriaValor = new System.Windows.Forms.NumericUpDown();
this.btnBateriaDefinir = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.gridsTEN)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridsCOR)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridsTMP)).BeginInit();
@ -50,30 +56,36 @@
((System.ComponentModel.ISupportInitialize)(this.gridsFLX)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridsMAS)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridsPRS)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudBateriaValor)).BeginInit();
this.SuspendLayout();
//
// gridsTEN
//
this.gridsTEN.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridsTEN.Location = new System.Drawing.Point(15, 25);
this.gridsTEN.Location = new System.Drawing.Point(20, 31);
this.gridsTEN.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.gridsTEN.Name = "gridsTEN";
this.gridsTEN.Size = new System.Drawing.Size(450, 124);
this.gridsTEN.RowHeadersWidth = 51;
this.gridsTEN.Size = new System.Drawing.Size(600, 153);
this.gridsTEN.TabIndex = 1;
//
// gridsCOR
//
this.gridsCOR.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridsCOR.Location = new System.Drawing.Point(15, 168);
this.gridsCOR.Location = new System.Drawing.Point(20, 207);
this.gridsCOR.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.gridsCOR.Name = "gridsCOR";
this.gridsCOR.Size = new System.Drawing.Size(450, 124);
this.gridsCOR.RowHeadersWidth = 51;
this.gridsCOR.Size = new System.Drawing.Size(600, 153);
this.gridsCOR.TabIndex = 1;
//
// btnSalvar
//
this.btnSalvar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSalvar.Location = new System.Drawing.Point(867, 554);
this.btnSalvar.Location = new System.Drawing.Point(1156, 682);
this.btnSalvar.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnSalvar.Name = "btnSalvar";
this.btnSalvar.Size = new System.Drawing.Size(75, 23);
this.btnSalvar.Size = new System.Drawing.Size(100, 28);
this.btnSalvar.TabIndex = 3;
this.btnSalvar.Text = "Salvar";
this.btnSalvar.UseVisualStyleBackColor = true;
@ -82,111 +94,191 @@
// lblTensao
//
this.lblTensao.AutoSize = true;
this.lblTensao.Location = new System.Drawing.Point(12, 9);
this.lblTensao.Location = new System.Drawing.Point(16, 11);
this.lblTensao.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblTensao.Name = "lblTensao";
this.lblTensao.Size = new System.Drawing.Size(43, 13);
this.lblTensao.Size = new System.Drawing.Size(54, 16);
this.lblTensao.TabIndex = 4;
this.lblTensao.Text = "Tensão";
//
// lblCorrente
//
this.lblCorrente.AutoSize = true;
this.lblCorrente.Location = new System.Drawing.Point(12, 152);
this.lblCorrente.Location = new System.Drawing.Point(16, 187);
this.lblCorrente.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblCorrente.Name = "lblCorrente";
this.lblCorrente.Size = new System.Drawing.Size(47, 13);
this.lblCorrente.Size = new System.Drawing.Size(58, 16);
this.lblCorrente.TabIndex = 5;
this.lblCorrente.Text = "Corrente";
//
// lblTemperatura
//
this.lblTemperatura.AutoSize = true;
this.lblTemperatura.Location = new System.Drawing.Point(12, 295);
this.lblTemperatura.Location = new System.Drawing.Point(16, 363);
this.lblTemperatura.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblTemperatura.Name = "lblTemperatura";
this.lblTemperatura.Size = new System.Drawing.Size(67, 13);
this.lblTemperatura.Size = new System.Drawing.Size(85, 16);
this.lblTemperatura.TabIndex = 7;
this.lblTemperatura.Text = "Temperatura";
//
// gridsTMP
//
this.gridsTMP.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridsTMP.Location = new System.Drawing.Point(15, 311);
this.gridsTMP.Location = new System.Drawing.Point(20, 383);
this.gridsTMP.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.gridsTMP.Name = "gridsTMP";
this.gridsTMP.Size = new System.Drawing.Size(450, 124);
this.gridsTMP.RowHeadersWidth = 51;
this.gridsTMP.Size = new System.Drawing.Size(600, 153);
this.gridsTMP.TabIndex = 6;
//
// lblPressao
//
this.lblPressao.AutoSize = true;
this.lblPressao.Location = new System.Drawing.Point(485, 9);
this.lblPressao.Location = new System.Drawing.Point(647, 11);
this.lblPressao.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblPressao.Name = "lblPressao";
this.lblPressao.Size = new System.Drawing.Size(45, 13);
this.lblPressao.Size = new System.Drawing.Size(58, 16);
this.lblPressao.TabIndex = 9;
this.lblPressao.Text = "Pressão";
//
// gridsULT
//
this.gridsULT.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridsULT.Location = new System.Drawing.Point(15, 454);
this.gridsULT.Location = new System.Drawing.Point(20, 559);
this.gridsULT.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.gridsULT.Name = "gridsULT";
this.gridsULT.Size = new System.Drawing.Size(450, 124);
this.gridsULT.RowHeadersWidth = 51;
this.gridsULT.Size = new System.Drawing.Size(600, 153);
this.gridsULT.TabIndex = 8;
//
// lblFluxo
//
this.lblFluxo.AutoSize = true;
this.lblFluxo.Location = new System.Drawing.Point(485, 152);
this.lblFluxo.Location = new System.Drawing.Point(647, 187);
this.lblFluxo.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblFluxo.Name = "lblFluxo";
this.lblFluxo.Size = new System.Drawing.Size(71, 13);
this.lblFluxo.Size = new System.Drawing.Size(89, 16);
this.lblFluxo.TabIndex = 11;
this.lblFluxo.Text = "Fluxo (Vazão)";
//
// gridsFLX
//
this.gridsFLX.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridsFLX.Location = new System.Drawing.Point(488, 168);
this.gridsFLX.Location = new System.Drawing.Point(651, 207);
this.gridsFLX.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.gridsFLX.Name = "gridsFLX";
this.gridsFLX.Size = new System.Drawing.Size(450, 124);
this.gridsFLX.RowHeadersWidth = 51;
this.gridsFLX.Size = new System.Drawing.Size(600, 153);
this.gridsFLX.TabIndex = 10;
//
// lblMassa
//
this.lblMassa.AutoSize = true;
this.lblMassa.Location = new System.Drawing.Point(485, 295);
this.lblMassa.Location = new System.Drawing.Point(647, 363);
this.lblMassa.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblMassa.Name = "lblMassa";
this.lblMassa.Size = new System.Drawing.Size(155, 13);
this.lblMassa.Size = new System.Drawing.Size(199, 16);
this.lblMassa.TabIndex = 13;
this.lblMassa.Text = "Massa (Reservatório Herbicida)";
//
// gridsMAS
//
this.gridsMAS.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridsMAS.Location = new System.Drawing.Point(488, 311);
this.gridsMAS.Location = new System.Drawing.Point(651, 383);
this.gridsMAS.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.gridsMAS.Name = "gridsMAS";
this.gridsMAS.Size = new System.Drawing.Size(450, 124);
this.gridsMAS.RowHeadersWidth = 51;
this.gridsMAS.Size = new System.Drawing.Size(600, 153);
this.gridsMAS.TabIndex = 12;
//
// lblUltrassom
//
this.lblUltrassom.AutoSize = true;
this.lblUltrassom.Location = new System.Drawing.Point(12, 438);
this.lblUltrassom.Location = new System.Drawing.Point(16, 539);
this.lblUltrassom.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblUltrassom.Name = "lblUltrassom";
this.lblUltrassom.Size = new System.Drawing.Size(106, 13);
this.lblUltrassom.Size = new System.Drawing.Size(135, 16);
this.lblUltrassom.TabIndex = 15;
this.lblUltrassom.Text = "Ultrassom (Distancia)";
//
// gridsPRS
//
this.gridsPRS.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridsPRS.Location = new System.Drawing.Point(488, 25);
this.gridsPRS.Location = new System.Drawing.Point(651, 31);
this.gridsPRS.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.gridsPRS.Name = "gridsPRS";
this.gridsPRS.Size = new System.Drawing.Size(450, 124);
this.gridsPRS.RowHeadersWidth = 51;
this.gridsPRS.Size = new System.Drawing.Size(600, 153);
this.gridsPRS.TabIndex = 14;
//
// btnBateriaVer
//
this.btnBateriaVer.Location = new System.Drawing.Point(837, 586);
this.btnBateriaVer.Name = "btnBateriaVer";
this.btnBateriaVer.Size = new System.Drawing.Size(75, 23);
this.btnBateriaVer.TabIndex = 16;
this.btnBateriaVer.Text = "Ver";
this.btnBateriaVer.UseVisualStyleBackColor = true;
this.btnBateriaVer.Click += new System.EventHandler(this.btnBateriaVer_Click);
//
// cmbBateriaParametro
//
this.cmbBateriaParametro.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbBateriaParametro.FormattingEnabled = true;
this.cmbBateriaParametro.Location = new System.Drawing.Point(650, 586);
this.cmbBateriaParametro.Name = "cmbBateriaParametro";
this.cmbBateriaParametro.Size = new System.Drawing.Size(181, 24);
this.cmbBateriaParametro.TabIndex = 17;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(648, 539);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(50, 16);
this.label1.TabIndex = 18;
this.label1.Text = "Bateria";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(648, 567);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(70, 16);
this.label2.TabIndex = 19;
this.label2.Text = "Parâmetro";
//
// nudBateriaValor
//
this.nudBateriaValor.Location = new System.Drawing.Point(651, 616);
this.nudBateriaValor.Name = "nudBateriaValor";
this.nudBateriaValor.Size = new System.Drawing.Size(105, 22);
this.nudBateriaValor.TabIndex = 20;
this.nudBateriaValor.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// btnBateriaDefinir
//
this.btnBateriaDefinir.Location = new System.Drawing.Point(837, 615);
this.btnBateriaDefinir.Name = "btnBateriaDefinir";
this.btnBateriaDefinir.Size = new System.Drawing.Size(75, 23);
this.btnBateriaDefinir.TabIndex = 21;
this.btnBateriaDefinir.Text = "Definir";
this.btnBateriaDefinir.UseVisualStyleBackColor = true;
this.btnBateriaDefinir.Click += new System.EventHandler(this.btnBateriaDefinir_Click);
//
// frmSenConfig
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(954, 585);
this.ClientSize = new System.Drawing.Size(1272, 720);
this.Controls.Add(this.btnBateriaDefinir);
this.Controls.Add(this.nudBateriaValor);
this.Controls.Add(this.label2);
this.Controls.Add(this.btnBateriaVer);
this.Controls.Add(this.cmbBateriaParametro);
this.Controls.Add(this.label1);
this.Controls.Add(this.lblUltrassom);
this.Controls.Add(this.gridsPRS);
this.Controls.Add(this.lblMassa);
@ -202,6 +294,7 @@
this.Controls.Add(this.gridsCOR);
this.Controls.Add(this.gridsTEN);
this.Controls.Add(this.btnSalvar);
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Name = "frmSenConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Sensoriamento - Parametrização";
@ -214,6 +307,7 @@
((System.ComponentModel.ISupportInitialize)(this.gridsFLX)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridsMAS)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridsPRS)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudBateriaValor)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -235,5 +329,11 @@
private System.Windows.Forms.DataGridView gridsMAS;
private System.Windows.Forms.Label lblUltrassom;
private System.Windows.Forms.DataGridView gridsPRS;
private System.Windows.Forms.Button btnBateriaVer;
private System.Windows.Forms.ComboBox cmbBateriaParametro;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.NumericUpDown nudBateriaValor;
private System.Windows.Forms.Button btnBateriaDefinir;
}
}

View File

@ -54,6 +54,10 @@ namespace AgroBase.Forms.Sensoriamento
PopulaParametrosSensor();
PreencheParametrosSensores();
cmbBateriaParametro.Items.Clear();
cmbBateriaParametro.Items.AddRange(PZEMService.Parametros.Keys.ToArray());
cmbBateriaParametro.SelectedIndex = 0;
}
private void PopulaParametrosSensor()
@ -155,5 +159,17 @@ namespace AgroBase.Forms.Sensoriamento
}
}
private void btnBateriaVer_Click(object sender, EventArgs e)
{
var Comando = PZEMService.ComandoGetParametro(PZEMService.Parametros[cmbBateriaParametro.Text]);
PZEMService.EnviarComando(PZEMService.PortaPZEM, Comando);
}
private void btnBateriaDefinir_Click(object sender, EventArgs e)
{
var Comando = PZEMService.ComandoSetParametro(PZEMService.Parametros[cmbBateriaParametro.Text], Convert.ToInt32(nudBateriaValor.Value));
PZEMService.EnviarComando(PZEMService.PortaPZEM, Comando);
}
}
}

View File

@ -82,10 +82,9 @@
// lblPinout
//
this.lblPinout.AutoSize = true;
this.lblPinout.Location = new System.Drawing.Point(9, 9);
this.lblPinout.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblPinout.Location = new System.Drawing.Point(12, 11);
this.lblPinout.Name = "lblPinout";
this.lblPinout.Size = new System.Drawing.Size(37, 13);
this.lblPinout.Size = new System.Drawing.Size(44, 16);
this.lblPinout.TabIndex = 227;
this.lblPinout.Text = "Pinout";
//
@ -94,10 +93,10 @@
this.cmb22.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb22.Enabled = false;
this.cmb22.FormattingEnabled = true;
this.cmb22.Location = new System.Drawing.Point(12, 588);
this.cmb22.Margin = new System.Windows.Forms.Padding(2);
this.cmb22.Location = new System.Drawing.Point(16, 724);
this.cmb22.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb22.Name = "cmb22";
this.cmb22.Size = new System.Drawing.Size(112, 21);
this.cmb22.Size = new System.Drawing.Size(148, 24);
this.cmb22.TabIndex = 226;
this.cmb22.Visible = false;
//
@ -106,10 +105,10 @@
this.cmb21.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb21.Enabled = false;
this.cmb21.FormattingEnabled = true;
this.cmb21.Location = new System.Drawing.Point(12, 564);
this.cmb21.Margin = new System.Windows.Forms.Padding(2);
this.cmb21.Location = new System.Drawing.Point(16, 694);
this.cmb21.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb21.Name = "cmb21";
this.cmb21.Size = new System.Drawing.Size(112, 21);
this.cmb21.Size = new System.Drawing.Size(148, 24);
this.cmb21.TabIndex = 225;
this.cmb21.Visible = false;
//
@ -117,10 +116,10 @@
//
this.cmb20.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb20.FormattingEnabled = true;
this.cmb20.Location = new System.Drawing.Point(12, 539);
this.cmb20.Margin = new System.Windows.Forms.Padding(2);
this.cmb20.Location = new System.Drawing.Point(16, 663);
this.cmb20.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb20.Name = "cmb20";
this.cmb20.Size = new System.Drawing.Size(112, 21);
this.cmb20.Size = new System.Drawing.Size(148, 24);
this.cmb20.TabIndex = 224;
this.cmb20.Visible = false;
//
@ -129,10 +128,10 @@
this.cmb23.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb23.Enabled = false;
this.cmb23.FormattingEnabled = true;
this.cmb23.Location = new System.Drawing.Point(436, 588);
this.cmb23.Margin = new System.Windows.Forms.Padding(2);
this.cmb23.Location = new System.Drawing.Point(581, 724);
this.cmb23.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb23.Name = "cmb23";
this.cmb23.Size = new System.Drawing.Size(112, 21);
this.cmb23.Size = new System.Drawing.Size(148, 24);
this.cmb23.TabIndex = 223;
this.cmb23.Visible = false;
//
@ -141,10 +140,10 @@
this.cmb24.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb24.Enabled = false;
this.cmb24.FormattingEnabled = true;
this.cmb24.Location = new System.Drawing.Point(436, 564);
this.cmb24.Margin = new System.Windows.Forms.Padding(2);
this.cmb24.Location = new System.Drawing.Point(581, 694);
this.cmb24.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb24.Name = "cmb24";
this.cmb24.Size = new System.Drawing.Size(112, 21);
this.cmb24.Size = new System.Drawing.Size(148, 24);
this.cmb24.TabIndex = 222;
this.cmb24.Visible = false;
//
@ -152,19 +151,19 @@
//
this.cmb25.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb25.FormattingEnabled = true;
this.cmb25.Location = new System.Drawing.Point(436, 539);
this.cmb25.Margin = new System.Windows.Forms.Padding(2);
this.cmb25.Location = new System.Drawing.Point(581, 663);
this.cmb25.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb25.Name = "cmb25";
this.cmb25.Size = new System.Drawing.Size(112, 21);
this.cmb25.Size = new System.Drawing.Size(148, 24);
this.cmb25.TabIndex = 221;
this.cmb25.Visible = false;
//
// btnSalvar
//
this.btnSalvar.Location = new System.Drawing.Point(436, 658);
this.btnSalvar.Margin = new System.Windows.Forms.Padding(2);
this.btnSalvar.Location = new System.Drawing.Point(581, 810);
this.btnSalvar.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnSalvar.Name = "btnSalvar";
this.btnSalvar.Size = new System.Drawing.Size(111, 32);
this.btnSalvar.Size = new System.Drawing.Size(148, 39);
this.btnSalvar.TabIndex = 220;
this.btnSalvar.Text = "Salvar";
this.btnSalvar.UseVisualStyleBackColor = true;
@ -174,10 +173,10 @@
//
this.cmb26.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb26.FormattingEnabled = true;
this.cmb26.Location = new System.Drawing.Point(436, 515);
this.cmb26.Margin = new System.Windows.Forms.Padding(2);
this.cmb26.Location = new System.Drawing.Point(581, 634);
this.cmb26.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb26.Name = "cmb26";
this.cmb26.Size = new System.Drawing.Size(112, 21);
this.cmb26.Size = new System.Drawing.Size(148, 24);
this.cmb26.TabIndex = 219;
this.cmb26.Visible = false;
//
@ -185,10 +184,10 @@
//
this.cmb27.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb27.FormattingEnabled = true;
this.cmb27.Location = new System.Drawing.Point(436, 491);
this.cmb27.Margin = new System.Windows.Forms.Padding(2);
this.cmb27.Location = new System.Drawing.Point(581, 604);
this.cmb27.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb27.Name = "cmb27";
this.cmb27.Size = new System.Drawing.Size(112, 21);
this.cmb27.Size = new System.Drawing.Size(148, 24);
this.cmb27.TabIndex = 218;
this.cmb27.Visible = false;
//
@ -196,10 +195,10 @@
//
this.cmb28.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb28.FormattingEnabled = true;
this.cmb28.Location = new System.Drawing.Point(436, 466);
this.cmb28.Margin = new System.Windows.Forms.Padding(2);
this.cmb28.Location = new System.Drawing.Point(581, 574);
this.cmb28.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb28.Name = "cmb28";
this.cmb28.Size = new System.Drawing.Size(112, 21);
this.cmb28.Size = new System.Drawing.Size(148, 24);
this.cmb28.TabIndex = 217;
this.cmb28.Visible = false;
//
@ -207,10 +206,10 @@
//
this.cmb29.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb29.FormattingEnabled = true;
this.cmb29.Location = new System.Drawing.Point(436, 442);
this.cmb29.Margin = new System.Windows.Forms.Padding(2);
this.cmb29.Location = new System.Drawing.Point(581, 544);
this.cmb29.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb29.Name = "cmb29";
this.cmb29.Size = new System.Drawing.Size(112, 21);
this.cmb29.Size = new System.Drawing.Size(148, 24);
this.cmb29.TabIndex = 216;
this.cmb29.Visible = false;
//
@ -218,10 +217,10 @@
//
this.cmb30.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb30.FormattingEnabled = true;
this.cmb30.Location = new System.Drawing.Point(436, 418);
this.cmb30.Margin = new System.Windows.Forms.Padding(2);
this.cmb30.Location = new System.Drawing.Point(581, 514);
this.cmb30.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb30.Name = "cmb30";
this.cmb30.Size = new System.Drawing.Size(112, 21);
this.cmb30.Size = new System.Drawing.Size(148, 24);
this.cmb30.TabIndex = 215;
this.cmb30.Visible = false;
//
@ -229,10 +228,10 @@
//
this.cmb31.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb31.FormattingEnabled = true;
this.cmb31.Location = new System.Drawing.Point(436, 393);
this.cmb31.Margin = new System.Windows.Forms.Padding(2);
this.cmb31.Location = new System.Drawing.Point(581, 484);
this.cmb31.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb31.Name = "cmb31";
this.cmb31.Size = new System.Drawing.Size(112, 21);
this.cmb31.Size = new System.Drawing.Size(148, 24);
this.cmb31.TabIndex = 214;
this.cmb31.Visible = false;
//
@ -240,10 +239,10 @@
//
this.cmb32.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb32.FormattingEnabled = true;
this.cmb32.Location = new System.Drawing.Point(436, 369);
this.cmb32.Margin = new System.Windows.Forms.Padding(2);
this.cmb32.Location = new System.Drawing.Point(581, 454);
this.cmb32.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb32.Name = "cmb32";
this.cmb32.Size = new System.Drawing.Size(112, 21);
this.cmb32.Size = new System.Drawing.Size(148, 24);
this.cmb32.TabIndex = 213;
this.cmb32.Visible = false;
//
@ -251,10 +250,10 @@
//
this.cmb33.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb33.FormattingEnabled = true;
this.cmb33.Location = new System.Drawing.Point(436, 344);
this.cmb33.Margin = new System.Windows.Forms.Padding(2);
this.cmb33.Location = new System.Drawing.Point(581, 423);
this.cmb33.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb33.Name = "cmb33";
this.cmb33.Size = new System.Drawing.Size(112, 21);
this.cmb33.Size = new System.Drawing.Size(148, 24);
this.cmb33.TabIndex = 212;
this.cmb33.Visible = false;
//
@ -262,10 +261,10 @@
//
this.cmb34.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb34.FormattingEnabled = true;
this.cmb34.Location = new System.Drawing.Point(436, 320);
this.cmb34.Margin = new System.Windows.Forms.Padding(2);
this.cmb34.Location = new System.Drawing.Point(581, 394);
this.cmb34.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb34.Name = "cmb34";
this.cmb34.Size = new System.Drawing.Size(112, 21);
this.cmb34.Size = new System.Drawing.Size(148, 24);
this.cmb34.TabIndex = 211;
this.cmb34.Visible = false;
//
@ -273,10 +272,10 @@
//
this.cmb35.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb35.FormattingEnabled = true;
this.cmb35.Location = new System.Drawing.Point(436, 296);
this.cmb35.Margin = new System.Windows.Forms.Padding(2);
this.cmb35.Location = new System.Drawing.Point(581, 364);
this.cmb35.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb35.Name = "cmb35";
this.cmb35.Size = new System.Drawing.Size(112, 21);
this.cmb35.Size = new System.Drawing.Size(148, 24);
this.cmb35.TabIndex = 210;
this.cmb35.Visible = false;
//
@ -284,10 +283,10 @@
//
this.cmb36.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb36.FormattingEnabled = true;
this.cmb36.Location = new System.Drawing.Point(436, 271);
this.cmb36.Margin = new System.Windows.Forms.Padding(2);
this.cmb36.Location = new System.Drawing.Point(581, 334);
this.cmb36.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb36.Name = "cmb36";
this.cmb36.Size = new System.Drawing.Size(112, 21);
this.cmb36.Size = new System.Drawing.Size(148, 24);
this.cmb36.TabIndex = 209;
this.cmb36.Visible = false;
//
@ -295,10 +294,10 @@
//
this.cmb37.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb37.FormattingEnabled = true;
this.cmb37.Location = new System.Drawing.Point(436, 247);
this.cmb37.Margin = new System.Windows.Forms.Padding(2);
this.cmb37.Location = new System.Drawing.Point(581, 304);
this.cmb37.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb37.Name = "cmb37";
this.cmb37.Size = new System.Drawing.Size(112, 21);
this.cmb37.Size = new System.Drawing.Size(148, 24);
this.cmb37.TabIndex = 208;
this.cmb37.Visible = false;
//
@ -306,10 +305,10 @@
//
this.cmb38.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb38.FormattingEnabled = true;
this.cmb38.Location = new System.Drawing.Point(436, 223);
this.cmb38.Margin = new System.Windows.Forms.Padding(2);
this.cmb38.Location = new System.Drawing.Point(581, 274);
this.cmb38.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb38.Name = "cmb38";
this.cmb38.Size = new System.Drawing.Size(112, 21);
this.cmb38.Size = new System.Drawing.Size(148, 24);
this.cmb38.TabIndex = 207;
this.cmb38.Visible = false;
//
@ -317,10 +316,10 @@
//
this.cmb39.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb39.FormattingEnabled = true;
this.cmb39.Location = new System.Drawing.Point(436, 198);
this.cmb39.Margin = new System.Windows.Forms.Padding(2);
this.cmb39.Location = new System.Drawing.Point(581, 244);
this.cmb39.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb39.Name = "cmb39";
this.cmb39.Size = new System.Drawing.Size(112, 21);
this.cmb39.Size = new System.Drawing.Size(148, 24);
this.cmb39.TabIndex = 206;
this.cmb39.Visible = false;
//
@ -328,10 +327,10 @@
//
this.cmb40.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb40.FormattingEnabled = true;
this.cmb40.Location = new System.Drawing.Point(436, 174);
this.cmb40.Margin = new System.Windows.Forms.Padding(2);
this.cmb40.Location = new System.Drawing.Point(581, 214);
this.cmb40.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb40.Name = "cmb40";
this.cmb40.Size = new System.Drawing.Size(112, 21);
this.cmb40.Size = new System.Drawing.Size(148, 24);
this.cmb40.TabIndex = 205;
this.cmb40.Visible = false;
//
@ -339,10 +338,10 @@
//
this.cmb41.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb41.FormattingEnabled = true;
this.cmb41.Location = new System.Drawing.Point(436, 149);
this.cmb41.Margin = new System.Windows.Forms.Padding(2);
this.cmb41.Location = new System.Drawing.Point(581, 183);
this.cmb41.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb41.Name = "cmb41";
this.cmb41.Size = new System.Drawing.Size(112, 21);
this.cmb41.Size = new System.Drawing.Size(148, 24);
this.cmb41.TabIndex = 204;
this.cmb41.Visible = false;
//
@ -351,10 +350,10 @@
this.cmb42.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb42.Enabled = false;
this.cmb42.FormattingEnabled = true;
this.cmb42.Location = new System.Drawing.Point(436, 125);
this.cmb42.Margin = new System.Windows.Forms.Padding(2);
this.cmb42.Location = new System.Drawing.Point(581, 154);
this.cmb42.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb42.Name = "cmb42";
this.cmb42.Size = new System.Drawing.Size(112, 21);
this.cmb42.Size = new System.Drawing.Size(148, 24);
this.cmb42.TabIndex = 203;
this.cmb42.Visible = false;
//
@ -363,10 +362,10 @@
this.cmb43.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb43.Enabled = false;
this.cmb43.FormattingEnabled = true;
this.cmb43.Location = new System.Drawing.Point(436, 101);
this.cmb43.Margin = new System.Windows.Forms.Padding(2);
this.cmb43.Location = new System.Drawing.Point(581, 124);
this.cmb43.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb43.Name = "cmb43";
this.cmb43.Size = new System.Drawing.Size(112, 21);
this.cmb43.Size = new System.Drawing.Size(148, 24);
this.cmb43.TabIndex = 202;
this.cmb43.Visible = false;
//
@ -375,10 +374,10 @@
this.cmb44.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb44.Enabled = false;
this.cmb44.FormattingEnabled = true;
this.cmb44.Location = new System.Drawing.Point(436, 76);
this.cmb44.Margin = new System.Windows.Forms.Padding(2);
this.cmb44.Location = new System.Drawing.Point(581, 94);
this.cmb44.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb44.Name = "cmb44";
this.cmb44.Size = new System.Drawing.Size(112, 21);
this.cmb44.Size = new System.Drawing.Size(148, 24);
this.cmb44.TabIndex = 201;
this.cmb44.Visible = false;
//
@ -386,10 +385,10 @@
//
this.cmb19.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb19.FormattingEnabled = true;
this.cmb19.Location = new System.Drawing.Point(12, 515);
this.cmb19.Margin = new System.Windows.Forms.Padding(2);
this.cmb19.Location = new System.Drawing.Point(16, 634);
this.cmb19.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb19.Name = "cmb19";
this.cmb19.Size = new System.Drawing.Size(112, 21);
this.cmb19.Size = new System.Drawing.Size(148, 24);
this.cmb19.TabIndex = 200;
this.cmb19.Visible = false;
//
@ -397,10 +396,10 @@
//
this.cmb18.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb18.FormattingEnabled = true;
this.cmb18.Location = new System.Drawing.Point(12, 491);
this.cmb18.Margin = new System.Windows.Forms.Padding(2);
this.cmb18.Location = new System.Drawing.Point(16, 604);
this.cmb18.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb18.Name = "cmb18";
this.cmb18.Size = new System.Drawing.Size(112, 21);
this.cmb18.Size = new System.Drawing.Size(148, 24);
this.cmb18.TabIndex = 199;
this.cmb18.Visible = false;
//
@ -408,10 +407,10 @@
//
this.cmb17.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb17.FormattingEnabled = true;
this.cmb17.Location = new System.Drawing.Point(12, 466);
this.cmb17.Margin = new System.Windows.Forms.Padding(2);
this.cmb17.Location = new System.Drawing.Point(16, 574);
this.cmb17.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb17.Name = "cmb17";
this.cmb17.Size = new System.Drawing.Size(112, 21);
this.cmb17.Size = new System.Drawing.Size(148, 24);
this.cmb17.TabIndex = 198;
this.cmb17.Visible = false;
//
@ -419,10 +418,10 @@
//
this.cmb16.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb16.FormattingEnabled = true;
this.cmb16.Location = new System.Drawing.Point(12, 442);
this.cmb16.Margin = new System.Windows.Forms.Padding(2);
this.cmb16.Location = new System.Drawing.Point(16, 544);
this.cmb16.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb16.Name = "cmb16";
this.cmb16.Size = new System.Drawing.Size(112, 21);
this.cmb16.Size = new System.Drawing.Size(148, 24);
this.cmb16.TabIndex = 197;
this.cmb16.Visible = false;
//
@ -430,10 +429,10 @@
//
this.cmb15.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb15.FormattingEnabled = true;
this.cmb15.Location = new System.Drawing.Point(12, 418);
this.cmb15.Margin = new System.Windows.Forms.Padding(2);
this.cmb15.Location = new System.Drawing.Point(16, 514);
this.cmb15.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb15.Name = "cmb15";
this.cmb15.Size = new System.Drawing.Size(112, 21);
this.cmb15.Size = new System.Drawing.Size(148, 24);
this.cmb15.TabIndex = 196;
this.cmb15.Visible = false;
//
@ -441,10 +440,10 @@
//
this.cmb14.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb14.FormattingEnabled = true;
this.cmb14.Location = new System.Drawing.Point(12, 393);
this.cmb14.Margin = new System.Windows.Forms.Padding(2);
this.cmb14.Location = new System.Drawing.Point(16, 484);
this.cmb14.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb14.Name = "cmb14";
this.cmb14.Size = new System.Drawing.Size(112, 21);
this.cmb14.Size = new System.Drawing.Size(148, 24);
this.cmb14.TabIndex = 195;
this.cmb14.Visible = false;
//
@ -452,10 +451,10 @@
//
this.cmb13.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb13.FormattingEnabled = true;
this.cmb13.Location = new System.Drawing.Point(12, 369);
this.cmb13.Margin = new System.Windows.Forms.Padding(2);
this.cmb13.Location = new System.Drawing.Point(16, 454);
this.cmb13.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb13.Name = "cmb13";
this.cmb13.Size = new System.Drawing.Size(112, 21);
this.cmb13.Size = new System.Drawing.Size(148, 24);
this.cmb13.TabIndex = 194;
this.cmb13.Visible = false;
//
@ -463,10 +462,10 @@
//
this.cmb12.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb12.FormattingEnabled = true;
this.cmb12.Location = new System.Drawing.Point(12, 344);
this.cmb12.Margin = new System.Windows.Forms.Padding(2);
this.cmb12.Location = new System.Drawing.Point(16, 423);
this.cmb12.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb12.Name = "cmb12";
this.cmb12.Size = new System.Drawing.Size(112, 21);
this.cmb12.Size = new System.Drawing.Size(148, 24);
this.cmb12.TabIndex = 193;
this.cmb12.Visible = false;
//
@ -474,10 +473,10 @@
//
this.cmb11.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb11.FormattingEnabled = true;
this.cmb11.Location = new System.Drawing.Point(12, 320);
this.cmb11.Margin = new System.Windows.Forms.Padding(2);
this.cmb11.Location = new System.Drawing.Point(16, 394);
this.cmb11.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb11.Name = "cmb11";
this.cmb11.Size = new System.Drawing.Size(112, 21);
this.cmb11.Size = new System.Drawing.Size(148, 24);
this.cmb11.TabIndex = 192;
this.cmb11.Visible = false;
//
@ -485,10 +484,10 @@
//
this.cmb10.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb10.FormattingEnabled = true;
this.cmb10.Location = new System.Drawing.Point(12, 296);
this.cmb10.Margin = new System.Windows.Forms.Padding(2);
this.cmb10.Location = new System.Drawing.Point(16, 364);
this.cmb10.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb10.Name = "cmb10";
this.cmb10.Size = new System.Drawing.Size(112, 21);
this.cmb10.Size = new System.Drawing.Size(148, 24);
this.cmb10.TabIndex = 191;
this.cmb10.Visible = false;
//
@ -496,10 +495,10 @@
//
this.cmb9.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb9.FormattingEnabled = true;
this.cmb9.Location = new System.Drawing.Point(12, 271);
this.cmb9.Margin = new System.Windows.Forms.Padding(2);
this.cmb9.Location = new System.Drawing.Point(16, 334);
this.cmb9.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb9.Name = "cmb9";
this.cmb9.Size = new System.Drawing.Size(112, 21);
this.cmb9.Size = new System.Drawing.Size(148, 24);
this.cmb9.TabIndex = 190;
this.cmb9.Visible = false;
//
@ -507,10 +506,10 @@
//
this.cmb8.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb8.FormattingEnabled = true;
this.cmb8.Location = new System.Drawing.Point(12, 247);
this.cmb8.Margin = new System.Windows.Forms.Padding(2);
this.cmb8.Location = new System.Drawing.Point(16, 304);
this.cmb8.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb8.Name = "cmb8";
this.cmb8.Size = new System.Drawing.Size(112, 21);
this.cmb8.Size = new System.Drawing.Size(148, 24);
this.cmb8.TabIndex = 189;
this.cmb8.Visible = false;
//
@ -518,10 +517,10 @@
//
this.cmb7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb7.FormattingEnabled = true;
this.cmb7.Location = new System.Drawing.Point(12, 223);
this.cmb7.Margin = new System.Windows.Forms.Padding(2);
this.cmb7.Location = new System.Drawing.Point(16, 274);
this.cmb7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb7.Name = "cmb7";
this.cmb7.Size = new System.Drawing.Size(112, 21);
this.cmb7.Size = new System.Drawing.Size(148, 24);
this.cmb7.TabIndex = 188;
this.cmb7.Visible = false;
//
@ -529,10 +528,10 @@
//
this.cmb6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb6.FormattingEnabled = true;
this.cmb6.Location = new System.Drawing.Point(12, 198);
this.cmb6.Margin = new System.Windows.Forms.Padding(2);
this.cmb6.Location = new System.Drawing.Point(16, 244);
this.cmb6.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb6.Name = "cmb6";
this.cmb6.Size = new System.Drawing.Size(112, 21);
this.cmb6.Size = new System.Drawing.Size(148, 24);
this.cmb6.TabIndex = 187;
this.cmb6.Visible = false;
//
@ -540,10 +539,10 @@
//
this.cmb5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb5.FormattingEnabled = true;
this.cmb5.Location = new System.Drawing.Point(12, 174);
this.cmb5.Margin = new System.Windows.Forms.Padding(2);
this.cmb5.Location = new System.Drawing.Point(16, 214);
this.cmb5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb5.Name = "cmb5";
this.cmb5.Size = new System.Drawing.Size(112, 21);
this.cmb5.Size = new System.Drawing.Size(148, 24);
this.cmb5.TabIndex = 186;
this.cmb5.Visible = false;
//
@ -551,10 +550,10 @@
//
this.cmb4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb4.FormattingEnabled = true;
this.cmb4.Location = new System.Drawing.Point(12, 149);
this.cmb4.Margin = new System.Windows.Forms.Padding(2);
this.cmb4.Location = new System.Drawing.Point(16, 183);
this.cmb4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb4.Name = "cmb4";
this.cmb4.Size = new System.Drawing.Size(112, 21);
this.cmb4.Size = new System.Drawing.Size(148, 24);
this.cmb4.TabIndex = 185;
this.cmb4.Visible = false;
//
@ -563,10 +562,10 @@
this.cmb3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb3.Enabled = false;
this.cmb3.FormattingEnabled = true;
this.cmb3.Location = new System.Drawing.Point(12, 125);
this.cmb3.Margin = new System.Windows.Forms.Padding(2);
this.cmb3.Location = new System.Drawing.Point(16, 154);
this.cmb3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb3.Name = "cmb3";
this.cmb3.Size = new System.Drawing.Size(112, 21);
this.cmb3.Size = new System.Drawing.Size(148, 24);
this.cmb3.TabIndex = 184;
this.cmb3.Visible = false;
//
@ -575,10 +574,10 @@
this.cmb2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb2.Enabled = false;
this.cmb2.FormattingEnabled = true;
this.cmb2.Location = new System.Drawing.Point(12, 101);
this.cmb2.Margin = new System.Windows.Forms.Padding(2);
this.cmb2.Location = new System.Drawing.Point(16, 124);
this.cmb2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb2.Name = "cmb2";
this.cmb2.Size = new System.Drawing.Size(112, 21);
this.cmb2.Size = new System.Drawing.Size(148, 24);
this.cmb2.TabIndex = 183;
this.cmb2.Visible = false;
//
@ -587,20 +586,20 @@
this.cmb1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb1.Enabled = false;
this.cmb1.FormattingEnabled = true;
this.cmb1.Location = new System.Drawing.Point(12, 76);
this.cmb1.Margin = new System.Windows.Forms.Padding(2);
this.cmb1.Location = new System.Drawing.Point(16, 94);
this.cmb1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmb1.Name = "cmb1";
this.cmb1.Size = new System.Drawing.Size(112, 21);
this.cmb1.Size = new System.Drawing.Size(148, 24);
this.cmb1.TabIndex = 182;
this.cmb1.Visible = false;
//
// imgESP32
//
this.imgESP32.Image = global::AgroBase.Properties.Resources.esp32_s3;
this.imgESP32.Location = new System.Drawing.Point(127, 2);
this.imgESP32.Margin = new System.Windows.Forms.Padding(2);
this.imgESP32.Location = new System.Drawing.Point(169, 2);
this.imgESP32.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.imgESP32.Name = "imgESP32";
this.imgESP32.Size = new System.Drawing.Size(304, 688);
this.imgESP32.Size = new System.Drawing.Size(405, 847);
this.imgESP32.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.imgESP32.TabIndex = 181;
this.imgESP32.TabStop = false;
@ -609,18 +608,19 @@
//
this.cbTipo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbTipo.FormattingEnabled = true;
this.cbTipo.Location = new System.Drawing.Point(12, 25);
this.cbTipo.Location = new System.Drawing.Point(16, 31);
this.cbTipo.Margin = new System.Windows.Forms.Padding(4);
this.cbTipo.Name = "cbTipo";
this.cbTipo.Size = new System.Drawing.Size(112, 21);
this.cbTipo.Size = new System.Drawing.Size(148, 24);
this.cbTipo.TabIndex = 228;
this.cbTipo.SelectedIndexChanged += new System.EventHandler(this.cbTipo_SelectedIndexChanged);
//
// frmPinout
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(561, 693);
this.ClientSize = new System.Drawing.Size(748, 862);
this.Controls.Add(this.cbTipo);
this.Controls.Add(this.lblPinout);
this.Controls.Add(this.cmb22);
@ -669,6 +669,7 @@
this.Controls.Add(this.cmb2);
this.Controls.Add(this.cmb1);
this.Controls.Add(this.imgESP32);
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "frmPinout";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Pinout";

View File

@ -123,6 +123,11 @@ namespace AgroBase.Forms
Funcoes = AtuadorModel.Funcoes.ToList();
Pinout = AtuadorModel.Pinout.ToList();
Dispositivos = new List<DispositivoDataModel>();
Dispositivos.Add(new DispositivoDataModel()
{
ID = Disp.Dados.BombaPressurizadora.ID,
Funcoes = Disp.Dados.BombaPressurizadora.Funcoes
});
Dispositivos.AddRange(Disp.Dados.BicosPulverizadores.Select(x => new DispositivoDataModel()
{
ID = x.ID,

View File

@ -87,6 +87,7 @@ namespace AgroBase
this.btnIniciarOperacao = new System.Windows.Forms.Button();
this.lblModoOperacao = new System.Windows.Forms.Label();
this.cmbModoOperacao = new System.Windows.Forms.ComboBox();
this.btnAtuCalibragem = new System.Windows.Forms.Button();
this.gpbAcoes.SuspendLayout();
this.erroStrip.SuspendLayout();
this.pnlLateral.SuspendLayout();
@ -111,11 +112,11 @@ namespace AgroBase
this.gpbAcoes.Controls.Add(this.erroStrip);
this.gpbAcoes.Controls.Add(this.pnlLateral);
this.gpbAcoes.Dock = System.Windows.Forms.DockStyle.Right;
this.gpbAcoes.Location = new System.Drawing.Point(441, 0);
this.gpbAcoes.Margin = new System.Windows.Forms.Padding(2);
this.gpbAcoes.Location = new System.Drawing.Point(588, 0);
this.gpbAcoes.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbAcoes.Name = "gpbAcoes";
this.gpbAcoes.Padding = new System.Windows.Forms.Padding(2);
this.gpbAcoes.Size = new System.Drawing.Size(617, 609);
this.gpbAcoes.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbAcoes.Size = new System.Drawing.Size(823, 750);
this.gpbAcoes.TabIndex = 0;
this.gpbAcoes.TabStop = false;
this.gpbAcoes.Text = "Conexão";
@ -125,17 +126,17 @@ namespace AgroBase
this.erroStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
this.erroStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.lblStripErro});
this.erroStrip.Location = new System.Drawing.Point(2, 585);
this.erroStrip.Location = new System.Drawing.Point(3, 722);
this.erroStrip.Name = "erroStrip";
this.erroStrip.Padding = new System.Windows.Forms.Padding(1, 0, 10, 0);
this.erroStrip.Size = new System.Drawing.Size(613, 22);
this.erroStrip.Padding = new System.Windows.Forms.Padding(1, 0, 13, 0);
this.erroStrip.Size = new System.Drawing.Size(817, 26);
this.erroStrip.TabIndex = 1;
this.erroStrip.Text = "statusStrip1";
//
// lblStripErro
//
this.lblStripErro.Name = "lblStripErro";
this.lblStripErro.Size = new System.Drawing.Size(49, 17);
this.lblStripErro.Size = new System.Drawing.Size(62, 20);
this.lblStripErro.Text = "Iniciado";
//
// pnlLateral
@ -149,18 +150,19 @@ namespace AgroBase
this.pnlLateral.Controls.Add(this.gpbNovoDispositivo);
this.pnlLateral.Controls.Add(this.btnNovoDispositivo);
this.pnlLateral.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlLateral.Location = new System.Drawing.Point(2, 15);
this.pnlLateral.Margin = new System.Windows.Forms.Padding(2);
this.pnlLateral.Location = new System.Drawing.Point(3, 17);
this.pnlLateral.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pnlLateral.Name = "pnlLateral";
this.pnlLateral.Size = new System.Drawing.Size(613, 592);
this.pnlLateral.Size = new System.Drawing.Size(817, 731);
this.pnlLateral.TabIndex = 0;
//
// chbConexaoautomatica
//
this.chbConexaoautomatica.AutoSize = true;
this.chbConexaoautomatica.Location = new System.Drawing.Point(172, 28);
this.chbConexaoautomatica.Location = new System.Drawing.Point(229, 34);
this.chbConexaoautomatica.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.chbConexaoautomatica.Name = "chbConexaoautomatica";
this.chbConexaoautomatica.Size = new System.Drawing.Size(123, 17);
this.chbConexaoautomatica.Size = new System.Drawing.Size(152, 20);
this.chbConexaoautomatica.TabIndex = 21;
this.chbConexaoautomatica.Text = "Conexão automática";
this.chbConexaoautomatica.UseVisualStyleBackColor = true;
@ -168,11 +170,11 @@ namespace AgroBase
// gpbDispositivos
//
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.Location = new System.Drawing.Point(215, 96);
this.gpbDispositivos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbDispositivos.Name = "gpbDispositivos";
this.gpbDispositivos.Padding = new System.Windows.Forms.Padding(2);
this.gpbDispositivos.Size = new System.Drawing.Size(449, 133);
this.gpbDispositivos.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbDispositivos.Size = new System.Drawing.Size(599, 164);
this.gpbDispositivos.TabIndex = 3;
this.gpbDispositivos.TabStop = false;
this.gpbDispositivos.Text = "Dispositivos disponíveis";
@ -180,20 +182,20 @@ namespace AgroBase
// lstDisponiveis
//
this.lstDisponiveis.HideSelection = false;
this.lstDisponiveis.Location = new System.Drawing.Point(11, 20);
this.lstDisponiveis.Margin = new System.Windows.Forms.Padding(2);
this.lstDisponiveis.Location = new System.Drawing.Point(15, 25);
this.lstDisponiveis.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.lstDisponiveis.Name = "lstDisponiveis";
this.lstDisponiveis.Size = new System.Drawing.Size(252, 102);
this.lstDisponiveis.Size = new System.Drawing.Size(335, 125);
this.lstDisponiveis.TabIndex = 0;
this.lstDisponiveis.UseCompatibleStateImageBehavior = false;
this.lstDisponiveis.View = System.Windows.Forms.View.List;
//
// btnRemover
//
this.btnRemover.Location = new System.Drawing.Point(87, 50);
this.btnRemover.Margin = new System.Windows.Forms.Padding(2);
this.btnRemover.Location = new System.Drawing.Point(116, 62);
this.btnRemover.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnRemover.Name = "btnRemover";
this.btnRemover.Size = new System.Drawing.Size(62, 23);
this.btnRemover.Size = new System.Drawing.Size(83, 28);
this.btnRemover.TabIndex = 12;
this.btnRemover.Text = "Remover";
this.btnRemover.UseVisualStyleBackColor = true;
@ -202,10 +204,9 @@ namespace AgroBase
// lblDispositivos
//
this.lblDispositivos.AutoSize = true;
this.lblDispositivos.Location = new System.Drawing.Point(20, 10);
this.lblDispositivos.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblDispositivos.Location = new System.Drawing.Point(27, 12);
this.lblDispositivos.Name = "lblDispositivos";
this.lblDispositivos.Size = new System.Drawing.Size(63, 13);
this.lblDispositivos.Size = new System.Drawing.Size(81, 16);
this.lblDispositivos.TabIndex = 11;
this.lblDispositivos.Text = "Dispositivos";
//
@ -213,10 +214,10 @@ namespace AgroBase
//
this.cmbDispositivos.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbDispositivos.FormattingEnabled = true;
this.cmbDispositivos.Location = new System.Drawing.Point(22, 26);
this.cmbDispositivos.Margin = new System.Windows.Forms.Padding(2);
this.cmbDispositivos.Location = new System.Drawing.Point(29, 32);
this.cmbDispositivos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmbDispositivos.Name = "cmbDispositivos";
this.cmbDispositivos.Size = new System.Drawing.Size(128, 21);
this.cmbDispositivos.Size = new System.Drawing.Size(169, 24);
this.cmbDispositivos.TabIndex = 10;
this.cmbDispositivos.SelectedIndexChanged += new System.EventHandler(this.cmbDispositivos_SelectedIndexChanged);
//
@ -228,11 +229,11 @@ namespace AgroBase
this.gpbNovoDispositivo.Controls.Add(this.lblDescricao);
this.gpbNovoDispositivo.Controls.Add(this.lblTipo);
this.gpbNovoDispositivo.Enabled = false;
this.gpbNovoDispositivo.Location = new System.Drawing.Point(16, 78);
this.gpbNovoDispositivo.Margin = new System.Windows.Forms.Padding(2);
this.gpbNovoDispositivo.Location = new System.Drawing.Point(21, 96);
this.gpbNovoDispositivo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbNovoDispositivo.Name = "gpbNovoDispositivo";
this.gpbNovoDispositivo.Padding = new System.Windows.Forms.Padding(2);
this.gpbNovoDispositivo.Size = new System.Drawing.Size(141, 133);
this.gpbNovoDispositivo.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbNovoDispositivo.Size = new System.Drawing.Size(188, 164);
this.gpbNovoDispositivo.TabIndex = 9;
this.gpbNovoDispositivo.TabStop = false;
this.gpbNovoDispositivo.Text = "Novo Dispositivo";
@ -241,18 +242,18 @@ namespace AgroBase
//
this.cmbTipos.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbTipos.FormattingEnabled = true;
this.cmbTipos.Location = new System.Drawing.Point(7, 37);
this.cmbTipos.Margin = new System.Windows.Forms.Padding(2);
this.cmbTipos.Location = new System.Drawing.Point(9, 46);
this.cmbTipos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmbTipos.Name = "cmbTipos";
this.cmbTipos.Size = new System.Drawing.Size(128, 21);
this.cmbTipos.Size = new System.Drawing.Size(169, 24);
this.cmbTipos.TabIndex = 2;
//
// btnSalvar
//
this.btnSalvar.Location = new System.Drawing.Point(7, 101);
this.btnSalvar.Margin = new System.Windows.Forms.Padding(2);
this.btnSalvar.Location = new System.Drawing.Point(9, 124);
this.btnSalvar.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnSalvar.Name = "btnSalvar";
this.btnSalvar.Size = new System.Drawing.Size(127, 20);
this.btnSalvar.Size = new System.Drawing.Size(169, 25);
this.btnSalvar.TabIndex = 9;
this.btnSalvar.Text = "Salvar";
this.btnSalvar.UseVisualStyleBackColor = true;
@ -260,38 +261,36 @@ namespace AgroBase
//
// txtDescricao
//
this.txtDescricao.Location = new System.Drawing.Point(7, 76);
this.txtDescricao.Margin = new System.Windows.Forms.Padding(2);
this.txtDescricao.Location = new System.Drawing.Point(9, 94);
this.txtDescricao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtDescricao.Name = "txtDescricao";
this.txtDescricao.Size = new System.Drawing.Size(128, 20);
this.txtDescricao.Size = new System.Drawing.Size(169, 22);
this.txtDescricao.TabIndex = 3;
//
// lblDescricao
//
this.lblDescricao.AutoSize = true;
this.lblDescricao.Location = new System.Drawing.Point(4, 60);
this.lblDescricao.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblDescricao.Location = new System.Drawing.Point(5, 74);
this.lblDescricao.Name = "lblDescricao";
this.lblDescricao.Size = new System.Drawing.Size(55, 13);
this.lblDescricao.Size = new System.Drawing.Size(69, 16);
this.lblDescricao.TabIndex = 2;
this.lblDescricao.Text = "Descrição";
//
// lblTipo
//
this.lblTipo.AutoSize = true;
this.lblTipo.Location = new System.Drawing.Point(4, 20);
this.lblTipo.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTipo.Location = new System.Drawing.Point(5, 25);
this.lblTipo.Name = "lblTipo";
this.lblTipo.Size = new System.Drawing.Size(28, 13);
this.lblTipo.Size = new System.Drawing.Size(35, 16);
this.lblTipo.TabIndex = 0;
this.lblTipo.Text = "Tipo";
//
// btnNovoDispositivo
//
this.btnNovoDispositivo.Location = new System.Drawing.Point(22, 50);
this.btnNovoDispositivo.Margin = new System.Windows.Forms.Padding(2);
this.btnNovoDispositivo.Location = new System.Drawing.Point(29, 62);
this.btnNovoDispositivo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnNovoDispositivo.Name = "btnNovoDispositivo";
this.btnNovoDispositivo.Size = new System.Drawing.Size(60, 23);
this.btnNovoDispositivo.Size = new System.Drawing.Size(80, 28);
this.btnNovoDispositivo.TabIndex = 8;
this.btnNovoDispositivo.Text = "Novo dispositivo";
this.btnNovoDispositivo.UseVisualStyleBackColor = true;
@ -306,41 +305,41 @@ namespace AgroBase
this.lblStripOperacao,
this.lblStripOperacaoStatus,
this.lblStripMqtt});
this.generalStrip.Location = new System.Drawing.Point(0, 587);
this.generalStrip.Location = new System.Drawing.Point(0, 724);
this.generalStrip.Name = "generalStrip";
this.generalStrip.Padding = new System.Windows.Forms.Padding(1, 0, 10, 0);
this.generalStrip.Size = new System.Drawing.Size(441, 22);
this.generalStrip.Padding = new System.Windows.Forms.Padding(1, 0, 13, 0);
this.generalStrip.Size = new System.Drawing.Size(588, 26);
this.generalStrip.TabIndex = 1;
this.generalStrip.Text = "statusStrip1";
//
// lblStripJoystick
//
this.lblStripJoystick.Name = "lblStripJoystick";
this.lblStripJoystick.Size = new System.Drawing.Size(129, 17);
this.lblStripJoystick.Size = new System.Drawing.Size(161, 20);
this.lblStripJoystick.Text = "Joystick: Desconectado";
//
// lblStripJoystickComando
//
this.lblStripJoystickComando.Name = "lblStripJoystickComando";
this.lblStripJoystickComando.Size = new System.Drawing.Size(16, 17);
this.lblStripJoystickComando.Size = new System.Drawing.Size(18, 20);
this.lblStripJoystickComando.Text = "...";
//
// lblStripOperacao
//
this.lblStripOperacao.Name = "lblStripOperacao";
this.lblStripOperacao.Size = new System.Drawing.Size(104, 17);
this.lblStripOperacao.Size = new System.Drawing.Size(130, 20);
this.lblStripOperacao.Text = "Operação: Manual";
//
// lblStripOperacaoStatus
//
this.lblStripOperacaoStatus.Name = "lblStripOperacaoStatus";
this.lblStripOperacaoStatus.Size = new System.Drawing.Size(74, 17);
this.lblStripOperacaoStatus.Size = new System.Drawing.Size(94, 20);
this.lblStripOperacaoStatus.Text = "Não iniciado";
//
// lblStripMqtt
//
this.lblStripMqtt.Name = "lblStripMqtt";
this.lblStripMqtt.Size = new System.Drawing.Size(119, 15);
this.lblStripMqtt.Size = new System.Drawing.Size(150, 20);
this.lblStripMqtt.Text = "MQTT: Desconectado";
//
// gpbMovimentacao
@ -349,11 +348,11 @@ namespace AgroBase
this.gpbMovimentacao.Controls.Add(this.trkKmh);
this.gpbMovimentacao.Controls.Add(this.trkRPM);
this.gpbMovimentacao.Controls.Add(this.lblRPM);
this.gpbMovimentacao.Location = new System.Drawing.Point(9, 63);
this.gpbMovimentacao.Margin = new System.Windows.Forms.Padding(2);
this.gpbMovimentacao.Location = new System.Drawing.Point(12, 78);
this.gpbMovimentacao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbMovimentacao.Name = "gpbMovimentacao";
this.gpbMovimentacao.Padding = new System.Windows.Forms.Padding(2);
this.gpbMovimentacao.Size = new System.Drawing.Size(330, 85);
this.gpbMovimentacao.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbMovimentacao.Size = new System.Drawing.Size(440, 105);
this.gpbMovimentacao.TabIndex = 2;
this.gpbMovimentacao.TabStop = false;
this.gpbMovimentacao.Text = "Controle Movimentação";
@ -361,20 +360,19 @@ namespace AgroBase
// lblKmh
//
this.lblKmh.AutoSize = true;
this.lblKmh.Location = new System.Drawing.Point(166, 20);
this.lblKmh.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblKmh.Location = new System.Drawing.Point(221, 25);
this.lblKmh.Name = "lblKmh";
this.lblKmh.Size = new System.Drawing.Size(100, 13);
this.lblKmh.Size = new System.Drawing.Size(122, 16);
this.lblKmh.TabIndex = 23;
this.lblKmh.Text = "Velocidade: 3 km/h";
//
// trkKmh
//
this.trkKmh.Location = new System.Drawing.Point(168, 37);
this.trkKmh.Margin = new System.Windows.Forms.Padding(2);
this.trkKmh.Location = new System.Drawing.Point(224, 46);
this.trkKmh.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.trkKmh.Maximum = 34;
this.trkKmh.Name = "trkKmh";
this.trkKmh.Size = new System.Drawing.Size(158, 45);
this.trkKmh.Size = new System.Drawing.Size(211, 56);
this.trkKmh.TabIndex = 22;
this.trkKmh.TickFrequency = 2;
this.trkKmh.Value = 3;
@ -382,12 +380,12 @@ namespace AgroBase
//
// trkRPM
//
this.trkRPM.Location = new System.Drawing.Point(4, 37);
this.trkRPM.Margin = new System.Windows.Forms.Padding(2);
this.trkRPM.Location = new System.Drawing.Point(5, 46);
this.trkRPM.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.trkRPM.Maximum = 500;
this.trkRPM.Minimum = 5;
this.trkRPM.Name = "trkRPM";
this.trkRPM.Size = new System.Drawing.Size(158, 45);
this.trkRPM.Size = new System.Drawing.Size(211, 56);
this.trkRPM.TabIndex = 20;
this.trkRPM.TickFrequency = 20;
this.trkRPM.Value = 5;
@ -396,20 +394,19 @@ namespace AgroBase
// lblRPM
//
this.lblRPM.AutoSize = true;
this.lblRPM.Location = new System.Drawing.Point(2, 20);
this.lblRPM.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblRPM.Location = new System.Drawing.Point(3, 25);
this.lblRPM.Name = "lblRPM";
this.lblRPM.Size = new System.Drawing.Size(43, 13);
this.lblRPM.Size = new System.Drawing.Size(50, 16);
this.lblRPM.TabIndex = 21;
this.lblRPM.Text = "RPM: 5";
//
// tkbAngulo
//
this.tkbAngulo.Location = new System.Drawing.Point(4, 95);
this.tkbAngulo.Margin = new System.Windows.Forms.Padding(2);
this.tkbAngulo.Location = new System.Drawing.Point(5, 117);
this.tkbAngulo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.tkbAngulo.Maximum = 180;
this.tkbAngulo.Name = "tkbAngulo";
this.tkbAngulo.Size = new System.Drawing.Size(314, 45);
this.tkbAngulo.Size = new System.Drawing.Size(419, 56);
this.tkbAngulo.TabIndex = 17;
this.tkbAngulo.TickFrequency = 5;
this.tkbAngulo.ValueChanged += new System.EventHandler(this.tkbRampa_ValueChanged);
@ -417,31 +414,29 @@ namespace AgroBase
// lblAngulo
//
this.lblAngulo.AutoSize = true;
this.lblAngulo.Location = new System.Drawing.Point(2, 79);
this.lblAngulo.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblAngulo.Location = new System.Drawing.Point(3, 97);
this.lblAngulo.Name = "lblAngulo";
this.lblAngulo.Size = new System.Drawing.Size(56, 13);
this.lblAngulo.Size = new System.Drawing.Size(67, 16);
this.lblAngulo.TabIndex = 16;
this.lblAngulo.Text = "Angulo: 0º";
//
// lblVelocidade
//
this.lblVelocidade.AutoSize = true;
this.lblVelocidade.Location = new System.Drawing.Point(2, 19);
this.lblVelocidade.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblVelocidade.Location = new System.Drawing.Point(3, 23);
this.lblVelocidade.Name = "lblVelocidade";
this.lblVelocidade.Size = new System.Drawing.Size(80, 13);
this.lblVelocidade.Size = new System.Drawing.Size(102, 16);
this.lblVelocidade.TabIndex = 15;
this.lblVelocidade.Text = "Velocidade: 1%";
//
// tkbVelocidade
//
this.tkbVelocidade.Location = new System.Drawing.Point(4, 35);
this.tkbVelocidade.Margin = new System.Windows.Forms.Padding(2);
this.tkbVelocidade.Location = new System.Drawing.Point(5, 43);
this.tkbVelocidade.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.tkbVelocidade.Maximum = 100;
this.tkbVelocidade.Minimum = 1;
this.tkbVelocidade.Name = "tkbVelocidade";
this.tkbVelocidade.Size = new System.Drawing.Size(314, 45);
this.tkbVelocidade.Size = new System.Drawing.Size(419, 56);
this.tkbVelocidade.TabIndex = 14;
this.tkbVelocidade.TickFrequency = 5;
this.tkbVelocidade.Value = 1;
@ -449,10 +444,10 @@ namespace AgroBase
//
// btnVer
//
this.btnVer.Location = new System.Drawing.Point(256, 20);
this.btnVer.Margin = new System.Windows.Forms.Padding(2);
this.btnVer.Location = new System.Drawing.Point(341, 25);
this.btnVer.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnVer.Name = "btnVer";
this.btnVer.Size = new System.Drawing.Size(63, 20);
this.btnVer.Size = new System.Drawing.Size(84, 25);
this.btnVer.TabIndex = 13;
this.btnVer.Text = "Ver";
this.btnVer.UseVisualStyleBackColor = true;
@ -460,10 +455,10 @@ namespace AgroBase
//
// btnJoyAtt
//
this.btnJoyAtt.Location = new System.Drawing.Point(121, 20);
this.btnJoyAtt.Margin = new System.Windows.Forms.Padding(2);
this.btnJoyAtt.Location = new System.Drawing.Point(161, 25);
this.btnJoyAtt.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnJoyAtt.Name = "btnJoyAtt";
this.btnJoyAtt.Size = new System.Drawing.Size(63, 20);
this.btnJoyAtt.Size = new System.Drawing.Size(84, 25);
this.btnJoyAtt.TabIndex = 12;
this.btnJoyAtt.Text = "Atualizar";
this.btnJoyAtt.UseVisualStyleBackColor = true;
@ -471,10 +466,10 @@ namespace AgroBase
//
// btnJoyEdt
//
this.btnJoyEdt.Location = new System.Drawing.Point(188, 20);
this.btnJoyEdt.Margin = new System.Windows.Forms.Padding(2);
this.btnJoyEdt.Location = new System.Drawing.Point(251, 25);
this.btnJoyEdt.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnJoyEdt.Name = "btnJoyEdt";
this.btnJoyEdt.Size = new System.Drawing.Size(63, 20);
this.btnJoyEdt.Size = new System.Drawing.Size(84, 25);
this.btnJoyEdt.TabIndex = 11;
this.btnJoyEdt.Text = "Editar";
this.btnJoyEdt.UseVisualStyleBackColor = true;
@ -484,10 +479,10 @@ namespace AgroBase
//
this.cmbJoysticks.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbJoysticks.FormattingEnabled = true;
this.cmbJoysticks.Location = new System.Drawing.Point(4, 21);
this.cmbJoysticks.Margin = new System.Windows.Forms.Padding(2);
this.cmbJoysticks.Location = new System.Drawing.Point(5, 26);
this.cmbJoysticks.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmbJoysticks.Name = "cmbJoysticks";
this.cmbJoysticks.Size = new System.Drawing.Size(112, 21);
this.cmbJoysticks.Size = new System.Drawing.Size(148, 24);
this.cmbJoysticks.TabIndex = 3;
//
// timerDispositivos
@ -502,11 +497,11 @@ namespace AgroBase
| System.Windows.Forms.AnchorStyles.Right)));
this.gpbSensoriamento.Controls.Add(this.lblSenMotores);
this.gpbSensoriamento.Controls.Add(this.gridSenMotores);
this.gpbSensoriamento.Location = new System.Drawing.Point(9, 413);
this.gpbSensoriamento.Margin = new System.Windows.Forms.Padding(2);
this.gpbSensoriamento.Location = new System.Drawing.Point(12, 508);
this.gpbSensoriamento.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbSensoriamento.Name = "gpbSensoriamento";
this.gpbSensoriamento.Padding = new System.Windows.Forms.Padding(2);
this.gpbSensoriamento.Size = new System.Drawing.Size(423, 172);
this.gpbSensoriamento.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbSensoriamento.Size = new System.Drawing.Size(564, 212);
this.gpbSensoriamento.TabIndex = 13;
this.gpbSensoriamento.TabStop = false;
this.gpbSensoriamento.Text = "Sensoriamento";
@ -514,10 +509,9 @@ namespace AgroBase
// lblSenMotores
//
this.lblSenMotores.AutoSize = true;
this.lblSenMotores.Location = new System.Drawing.Point(9, 19);
this.lblSenMotores.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblSenMotores.Location = new System.Drawing.Point(12, 23);
this.lblSenMotores.Name = "lblSenMotores";
this.lblSenMotores.Size = new System.Drawing.Size(45, 13);
this.lblSenMotores.Size = new System.Drawing.Size(56, 16);
this.lblSenMotores.TabIndex = 1;
this.lblSenMotores.Text = "Motores";
//
@ -527,20 +521,20 @@ namespace AgroBase
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.gridSenMotores.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridSenMotores.Location = new System.Drawing.Point(4, 35);
this.gridSenMotores.Margin = new System.Windows.Forms.Padding(2);
this.gridSenMotores.Location = new System.Drawing.Point(5, 43);
this.gridSenMotores.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gridSenMotores.Name = "gridSenMotores";
this.gridSenMotores.RowHeadersWidth = 51;
this.gridSenMotores.RowTemplate.Height = 24;
this.gridSenMotores.Size = new System.Drawing.Size(414, 132);
this.gridSenMotores.Size = new System.Drawing.Size(552, 162);
this.gridSenMotores.TabIndex = 0;
//
// btnDiagnosticos
//
this.btnDiagnosticos.Location = new System.Drawing.Point(4, 17);
this.btnDiagnosticos.Margin = new System.Windows.Forms.Padding(2);
this.btnDiagnosticos.Location = new System.Drawing.Point(5, 21);
this.btnDiagnosticos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnDiagnosticos.Name = "btnDiagnosticos";
this.btnDiagnosticos.Size = new System.Drawing.Size(84, 20);
this.btnDiagnosticos.Size = new System.Drawing.Size(112, 25);
this.btnDiagnosticos.TabIndex = 14;
this.btnDiagnosticos.Text = "Diagnósticos";
this.btnDiagnosticos.UseVisualStyleBackColor = true;
@ -548,10 +542,10 @@ namespace AgroBase
//
// btnAcompanhamento
//
this.btnAcompanhamento.Location = new System.Drawing.Point(4, 42);
this.btnAcompanhamento.Margin = new System.Windows.Forms.Padding(2);
this.btnAcompanhamento.Location = new System.Drawing.Point(5, 52);
this.btnAcompanhamento.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnAcompanhamento.Name = "btnAcompanhamento";
this.btnAcompanhamento.Size = new System.Drawing.Size(84, 20);
this.btnAcompanhamento.Size = new System.Drawing.Size(112, 25);
this.btnAcompanhamento.TabIndex = 15;
this.btnAcompanhamento.Text = "Plotagem";
this.btnAcompanhamento.UseVisualStyleBackColor = true;
@ -559,10 +553,10 @@ namespace AgroBase
//
// btnAtuCamera
//
this.btnAtuCamera.Location = new System.Drawing.Point(4, 67);
this.btnAtuCamera.Margin = new System.Windows.Forms.Padding(2);
this.btnAtuCamera.Location = new System.Drawing.Point(5, 82);
this.btnAtuCamera.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnAtuCamera.Name = "btnAtuCamera";
this.btnAtuCamera.Size = new System.Drawing.Size(84, 20);
this.btnAtuCamera.Size = new System.Drawing.Size(112, 25);
this.btnAtuCamera.TabIndex = 16;
this.btnAtuCamera.Text = "Ver solo";
this.btnAtuCamera.UseVisualStyleBackColor = true;
@ -570,10 +564,10 @@ namespace AgroBase
//
// btnMapas
//
this.btnMapas.Location = new System.Drawing.Point(4, 118);
this.btnMapas.Margin = new System.Windows.Forms.Padding(2);
this.btnMapas.Location = new System.Drawing.Point(5, 145);
this.btnMapas.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnMapas.Name = "btnMapas";
this.btnMapas.Size = new System.Drawing.Size(84, 20);
this.btnMapas.Size = new System.Drawing.Size(112, 25);
this.btnMapas.TabIndex = 17;
this.btnMapas.Text = "Mapas";
this.btnMapas.UseVisualStyleBackColor = true;
@ -581,10 +575,10 @@ namespace AgroBase
//
// btnSenCamera
//
this.btnSenCamera.Location = new System.Drawing.Point(4, 93);
this.btnSenCamera.Margin = new System.Windows.Forms.Padding(2);
this.btnSenCamera.Location = new System.Drawing.Point(5, 114);
this.btnSenCamera.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnSenCamera.Name = "btnSenCamera";
this.btnSenCamera.Size = new System.Drawing.Size(84, 20);
this.btnSenCamera.Size = new System.Drawing.Size(112, 25);
this.btnSenCamera.TabIndex = 18;
this.btnSenCamera.Text = "Ver caminho";
this.btnSenCamera.UseVisualStyleBackColor = true;
@ -596,11 +590,11 @@ namespace AgroBase
this.gpbJoystick.Controls.Add(this.btnJoyEdt);
this.gpbJoystick.Controls.Add(this.btnJoyAtt);
this.gpbJoystick.Controls.Add(this.btnVer);
this.gpbJoystick.Location = new System.Drawing.Point(9, 10);
this.gpbJoystick.Margin = new System.Windows.Forms.Padding(2);
this.gpbJoystick.Location = new System.Drawing.Point(12, 12);
this.gpbJoystick.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbJoystick.Name = "gpbJoystick";
this.gpbJoystick.Padding = new System.Windows.Forms.Padding(2);
this.gpbJoystick.Size = new System.Drawing.Size(330, 49);
this.gpbJoystick.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbJoystick.Size = new System.Drawing.Size(440, 60);
this.gpbJoystick.TabIndex = 18;
this.gpbJoystick.TabStop = false;
this.gpbJoystick.Text = "Joystick";
@ -611,17 +605,18 @@ namespace AgroBase
this.gpbControleDirecional.Controls.Add(this.tkbAngulo);
this.gpbControleDirecional.Controls.Add(this.lblAngulo);
this.gpbControleDirecional.Controls.Add(this.lblVelocidade);
this.gpbControleDirecional.Location = new System.Drawing.Point(9, 154);
this.gpbControleDirecional.Margin = new System.Windows.Forms.Padding(2);
this.gpbControleDirecional.Location = new System.Drawing.Point(12, 190);
this.gpbControleDirecional.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbControleDirecional.Name = "gpbControleDirecional";
this.gpbControleDirecional.Padding = new System.Windows.Forms.Padding(2);
this.gpbControleDirecional.Size = new System.Drawing.Size(330, 149);
this.gpbControleDirecional.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbControleDirecional.Size = new System.Drawing.Size(440, 183);
this.gpbControleDirecional.TabIndex = 19;
this.gpbControleDirecional.TabStop = false;
this.gpbControleDirecional.Text = "Controle Direcional";
//
// gpbAtalhos
//
this.gpbAtalhos.Controls.Add(this.btnAtuCalibragem);
this.gpbAtalhos.Controls.Add(this.btnContornos);
this.gpbAtalhos.Controls.Add(this.btnGPS);
this.gpbAtalhos.Controls.Add(this.btnDiagnosticos);
@ -629,21 +624,21 @@ namespace AgroBase
this.gpbAtalhos.Controls.Add(this.btnSenCamera);
this.gpbAtalhos.Controls.Add(this.btnAtuCamera);
this.gpbAtalhos.Controls.Add(this.btnMapas);
this.gpbAtalhos.Location = new System.Drawing.Point(344, 10);
this.gpbAtalhos.Margin = new System.Windows.Forms.Padding(2);
this.gpbAtalhos.Location = new System.Drawing.Point(459, 12);
this.gpbAtalhos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbAtalhos.Name = "gpbAtalhos";
this.gpbAtalhos.Padding = new System.Windows.Forms.Padding(2);
this.gpbAtalhos.Size = new System.Drawing.Size(93, 292);
this.gpbAtalhos.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbAtalhos.Size = new System.Drawing.Size(124, 359);
this.gpbAtalhos.TabIndex = 20;
this.gpbAtalhos.TabStop = false;
this.gpbAtalhos.Text = "Atalhos";
//
// btnContornos
//
this.btnContornos.Location = new System.Drawing.Point(4, 166);
this.btnContornos.Margin = new System.Windows.Forms.Padding(2);
this.btnContornos.Location = new System.Drawing.Point(5, 204);
this.btnContornos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnContornos.Name = "btnContornos";
this.btnContornos.Size = new System.Drawing.Size(84, 20);
this.btnContornos.Size = new System.Drawing.Size(112, 25);
this.btnContornos.TabIndex = 20;
this.btnContornos.Text = "Contornos";
this.btnContornos.UseVisualStyleBackColor = true;
@ -651,10 +646,10 @@ namespace AgroBase
//
// btnGPS
//
this.btnGPS.Location = new System.Drawing.Point(4, 142);
this.btnGPS.Margin = new System.Windows.Forms.Padding(2);
this.btnGPS.Location = new System.Drawing.Point(5, 175);
this.btnGPS.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnGPS.Name = "btnGPS";
this.btnGPS.Size = new System.Drawing.Size(84, 20);
this.btnGPS.Size = new System.Drawing.Size(112, 25);
this.btnGPS.TabIndex = 19;
this.btnGPS.Text = "GPS";
this.btnGPS.UseVisualStyleBackColor = true;
@ -668,21 +663,21 @@ namespace AgroBase
this.gpbOperacao.Controls.Add(this.btnIniciarOperacao);
this.gpbOperacao.Controls.Add(this.lblModoOperacao);
this.gpbOperacao.Controls.Add(this.cmbModoOperacao);
this.gpbOperacao.Location = new System.Drawing.Point(9, 307);
this.gpbOperacao.Margin = new System.Windows.Forms.Padding(2);
this.gpbOperacao.Location = new System.Drawing.Point(12, 378);
this.gpbOperacao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbOperacao.Name = "gpbOperacao";
this.gpbOperacao.Padding = new System.Windows.Forms.Padding(2);
this.gpbOperacao.Size = new System.Drawing.Size(428, 101);
this.gpbOperacao.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gpbOperacao.Size = new System.Drawing.Size(571, 124);
this.gpbOperacao.TabIndex = 21;
this.gpbOperacao.TabStop = false;
this.gpbOperacao.Text = "Operação";
//
// btnIHM
//
this.btnIHM.Location = new System.Drawing.Point(296, 63);
this.btnIHM.Margin = new System.Windows.Forms.Padding(2);
this.btnIHM.Location = new System.Drawing.Point(395, 78);
this.btnIHM.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnIHM.Name = "btnIHM";
this.btnIHM.Size = new System.Drawing.Size(122, 33);
this.btnIHM.Size = new System.Drawing.Size(163, 41);
this.btnIHM.TabIndex = 16;
this.btnIHM.Text = "IHM";
this.btnIHM.UseVisualStyleBackColor = true;
@ -690,10 +685,10 @@ namespace AgroBase
//
// btnConfigurarOperacao
//
this.btnConfigurarOperacao.Location = new System.Drawing.Point(121, 63);
this.btnConfigurarOperacao.Margin = new System.Windows.Forms.Padding(2);
this.btnConfigurarOperacao.Location = new System.Drawing.Point(161, 78);
this.btnConfigurarOperacao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnConfigurarOperacao.Name = "btnConfigurarOperacao";
this.btnConfigurarOperacao.Size = new System.Drawing.Size(122, 33);
this.btnConfigurarOperacao.Size = new System.Drawing.Size(163, 41);
this.btnConfigurarOperacao.TabIndex = 15;
this.btnConfigurarOperacao.Text = "Configurar Operação";
this.btnConfigurarOperacao.UseVisualStyleBackColor = true;
@ -702,20 +697,20 @@ namespace AgroBase
// chbDebugMode
//
this.chbDebugMode.AutoSize = true;
this.chbDebugMode.Location = new System.Drawing.Point(134, 40);
this.chbDebugMode.Margin = new System.Windows.Forms.Padding(2);
this.chbDebugMode.Location = new System.Drawing.Point(179, 49);
this.chbDebugMode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.chbDebugMode.Name = "chbDebugMode";
this.chbDebugMode.Size = new System.Drawing.Size(109, 17);
this.chbDebugMode.Size = new System.Drawing.Size(135, 20);
this.chbDebugMode.TabIndex = 14;
this.chbDebugMode.Text = "Modo Depuração";
this.chbDebugMode.UseVisualStyleBackColor = true;
//
// btnIniciarOperacao
//
this.btnIniciarOperacao.Location = new System.Drawing.Point(7, 63);
this.btnIniciarOperacao.Margin = new System.Windows.Forms.Padding(2);
this.btnIniciarOperacao.Location = new System.Drawing.Point(9, 78);
this.btnIniciarOperacao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnIniciarOperacao.Name = "btnIniciarOperacao";
this.btnIniciarOperacao.Size = new System.Drawing.Size(109, 33);
this.btnIniciarOperacao.Size = new System.Drawing.Size(145, 41);
this.btnIniciarOperacao.TabIndex = 13;
this.btnIniciarOperacao.Text = "Iniciar Operação";
this.btnIniciarOperacao.UseVisualStyleBackColor = true;
@ -724,10 +719,9 @@ namespace AgroBase
// lblModoOperacao
//
this.lblModoOperacao.AutoSize = true;
this.lblModoOperacao.Location = new System.Drawing.Point(4, 22);
this.lblModoOperacao.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblModoOperacao.Location = new System.Drawing.Point(5, 27);
this.lblModoOperacao.Name = "lblModoOperacao";
this.lblModoOperacao.Size = new System.Drawing.Size(34, 13);
this.lblModoOperacao.Size = new System.Drawing.Size(42, 16);
this.lblModoOperacao.TabIndex = 13;
this.lblModoOperacao.Text = "Modo";
//
@ -735,18 +729,29 @@ namespace AgroBase
//
this.cmbModoOperacao.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbModoOperacao.FormattingEnabled = true;
this.cmbModoOperacao.Location = new System.Drawing.Point(7, 38);
this.cmbModoOperacao.Margin = new System.Windows.Forms.Padding(2);
this.cmbModoOperacao.Location = new System.Drawing.Point(9, 47);
this.cmbModoOperacao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cmbModoOperacao.Name = "cmbModoOperacao";
this.cmbModoOperacao.Size = new System.Drawing.Size(110, 21);
this.cmbModoOperacao.Size = new System.Drawing.Size(145, 24);
this.cmbModoOperacao.TabIndex = 13;
this.cmbModoOperacao.SelectedIndexChanged += new System.EventHandler(this.cmbModoOperacao_SelectedIndexChanged);
//
// btnAtuCalibragem
//
this.btnAtuCalibragem.Location = new System.Drawing.Point(6, 233);
this.btnAtuCalibragem.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnAtuCalibragem.Name = "btnAtuCalibragem";
this.btnAtuCalibragem.Size = new System.Drawing.Size(112, 25);
this.btnAtuCalibragem.TabIndex = 21;
this.btnAtuCalibragem.Text = "Calibrar Atuador";
this.btnAtuCalibragem.UseVisualStyleBackColor = true;
this.btnAtuCalibragem.Click += new System.EventHandler(this.btnAtuCalibragem_Click);
//
// frmPrincipal
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1058, 609);
this.ClientSize = new System.Drawing.Size(1411, 750);
this.Controls.Add(this.gpbOperacao);
this.Controls.Add(this.gpbAtalhos);
this.Controls.Add(this.gpbControleDirecional);
@ -755,7 +760,7 @@ namespace AgroBase
this.Controls.Add(this.gpbSensoriamento);
this.Controls.Add(this.generalStrip);
this.Controls.Add(this.gpbAcoes);
this.Margin = new System.Windows.Forms.Padding(2);
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "frmPrincipal";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Agro Base";
@ -852,6 +857,7 @@ namespace AgroBase
public System.Windows.Forms.Panel pnlLateral;
public System.Windows.Forms.CheckBox chbConexaoautomatica;
public System.Windows.Forms.CheckBox chbDebugMode;
private System.Windows.Forms.Button btnAtuCalibragem;
}
}

View File

@ -1,5 +1,6 @@
using AgroBase.Comum;
using AgroBase.Forms;
using AgroBase.Forms.Atuador;
using AgroBase.Forms.IHM;
using AgroBase.Forms.Movimentacao;
using AgroBase.Forms.Operacoes;
@ -137,7 +138,10 @@ namespace AgroBase
SerialService.DispositivosMapeados
.Select(x => new ListViewItem()
{
Text = x.PortaCOM + " - " + Enum.GetName(typeof(T_Code), x.Dispositivo) + " - " + (x.Dispositivo == T_Code.Gps ? (GPSService.PortaGPS != null && GPSService.PortaGPS.IsOpen ? "Conectado" : "Desconectado") : (Variaveis.DispositivosConectados.FirstOrDefault(y => y.PortaCOM() == x.PortaCOM)?.StatusPorta() ?? "Desconectado"))
Text = x.PortaCOM + " - " + Enum.GetName(typeof(T_Code), x.Dispositivo) + " - " +
(x.Dispositivo == T_Code.Gps ? (GPSService.PortaGPS != null && GPSService.PortaGPS.IsOpen ? "Conectado" : "Desconectado") :
x.Dispositivo == T_Code.Pzm ? (PZEMService.PortaPZEM != null && PZEMService.PortaPZEM.IsOpen ? "Conectado" : "Desconectado") :
(Variaveis.DispositivosConectados.FirstOrDefault(y => y.PortaCOM() == x.PortaCOM)?.StatusPorta() ?? "Desconectado"))
}).ToArray()
);
if (SerialService.DispositivosMapeados.Count == 0)
@ -301,7 +305,10 @@ namespace AgroBase
frmMovCamera.Show();
}
private void btnAtuCalibragem_Click(object sender, EventArgs e)
{
frmAtuCalibragem frm = new frmAtuCalibragem();
frm.Show();
}
}
}

View File

@ -52,6 +52,7 @@ namespace AgroBase.Models
Sen = 102,
Atu = 103,
Gps = 104,
Pzm = 105,
}
public enum F_Code
@ -78,6 +79,7 @@ namespace AgroBase.Models
sBIC = 422,
sPRS = 333,
sMAG = 855,
sBMB = 325,
}
public enum BotoesJoystick

View File

@ -15,20 +15,113 @@ namespace AgroBase.Models.Modules
public static int _TaxaAmostragem { get; set; } = 500;
public bool Conectado { get; set; } = false;
public static List<PinoutModel> Pinout { get; set; }
public static List<FuncoesPinout> Funcoes { get; set; } = new List<FuncoesPinout>() { FuncoesPinout.Geral };
public static List<FuncoesPinout> Funcoes { get; set; } = new List<FuncoesPinout>()
{
FuncoesPinout.Geral,
FuncoesPinout.SDA,
FuncoesPinout.SCL,
};
public int QuantidadeBicos { get; set; } = 10;
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 double MassaReservatorio { get; set; } = 0;
public double VolumeReservatorio { get; set; } = 0;
public double PercentualReservatorio { get; set; } = 0;
public double MediaNivelFluxo { get; set; } = 0;
#region MASSA
public double _MassaRef { get; set; } = 0.8;
public double _MassaLeituraRef { get; set; } = 40876.37;
public double _MassaLeituraExtra { get; set; } = 1895800; // 2015000.0;
public double _MassaLeitura { get; set; }
public double MassaReservatorio
{
get
{
double leituraMassa = _MassaLeitura * -1;
leituraMassa += _MassaLeituraExtra;
double FatorLeitura = _MassaRef / _MassaLeituraRef;
double Massa = FatorLeitura * leituraMassa;
return Massa;
}
}
public double VolumeReservatorio
{
get
{
return MassaReservatorio / DensidadeHerbicida;
}
}
public double PercentualReservatorio
{
get
{
return VolumeReservatorio / CapacidadeReservatorio * 100;
}
}
#endregion
#region VAZAO
public double VolumeVazaoAferido { get; set; } = 0;
public double _FluxoMlRef { get; set;} = 600;
public double _FluxoPulsoRef { get; set;} = 538;
public int _LeituraPulsos { get; set; }
public int _LeituraPeriodo { get; set; }
public double VazaoFluxoMLpS
{
get
{
if (_LeituraPeriodo == 0)
{
return 0;
}
else
{
double FatorLeitura = (double)_FluxoMlRef / (double)_FluxoPulsoRef;
double Frequencia = ((double)_LeituraPulsos / (double)_LeituraPeriodo * 1000);
//double vazao = (_LeituraPulsos * FatorLeitura) / ((double)_LeituraPeriodo / 1000);
//double vazao = ((double)1 / FatorLeitura) * (60 * 1000 / _LeituraPeriodo);
//double vazao = ((double)_LeituraPulsos / (((double)_LeituraPeriodo / 1000) * 8.1)) + 3;
//double Fator = (double)_LeituraPulsos / (double)_LeituraPeriodo;
//double vazao = ((double)_LeituraPulsos / (double)_LeituraPeriodo * 1000) * ;
//double vazao = Frequencia * 1.22;
double Rh = 0.0047;
double Rt = 0.0037;
double vazao = (Frequencia * 2 * Math.PI * Rh * Math.PI * (Rt * Rt)) * 1000000;
Console.WriteLine("Pulsos: " + _LeituraPulsos + " - Periodo: " + _LeituraPeriodo + " ms - Vazão: " + vazao.ToString("0.00000"));
return vazao;
}
}
}
public double VolumeVazaoML { get; set; }
#endregion
#region PRESSAO
public double _PressaoVmin { get; set; } = 0.0;
public double _PressaoVmax { get; set; } = 4.5;
public double _PressaoMax { get; set; } = 174.045; // 1,2 MPa
public double _LeituraPressao { get; set; }
public double PressaoLinha { get; set; } = 0;
public double PressaoLinhaCalc
{
get
{
double tensao = FuncoesGlobais.Map(_LeituraPressao, 0, 4095, 0, 3300) / 1000.0;
double pressao = FuncoesGlobais.Map(tensao, _PressaoVmin, _PressaoVmax, 0, _PressaoMax);
return pressao;
}
}
#endregion
public static AtuadorModel CarregarParametrosIniciais()
@ -38,13 +131,31 @@ namespace AgroBase.Models.Modules
QuantidadeBicos = 10,
Conectado = false,
BicosPulverizadores = new List<AtuadorBicoModel>(),
BombaPressurizadora = new AtuadorBombaModel()
{
ID = "BOMBA",
Comandar = false,
Ligado = false,
Inicializado = false,
Pressao = 0,
PressaoSP = 80,
Testando = false,
Funcoes = new List<FuncoesPinout>()
{
FuncoesPinout.ENA,
FuncoesPinout.CS,
FuncoesPinout.INA,
FuncoesPinout.INB,
FuncoesPinout.PWM,
}
},
Sensores = new List<SensorModel>()
{
new SensorModel()
{
ID = "FLXLN",
Descricao = "Fluxo na linha principal",
Prioridade = 10,
Prioridade = 23,
Componente = S_Code.sFLX,
Aferir = false,
Inicializado = false,
@ -53,12 +164,9 @@ namespace AgroBase.Models.Modules
{
FuncoesPinout.Fluxo,
},
DelayAmostragem = 200,
UnidadeMedida = "L/m",
Parametros = new List<string[]>()
{
new string[] { "Calibragem", "00450" }
},
DelayAmostragem = 100,
UnidadeMedida = "mL/s",
Parametros = new List<string[]>(),
},
new SensorModel()
{
@ -93,7 +201,12 @@ namespace AgroBase.Models.Modules
},
DelayAmostragem = 1000,
UnidadeMedida = "psi",
Parametros = new List<string[]>(),
Parametros = new List<string[]>()
{
new string[] { "Vmin", "000.00" },
new string[] { "Vmax", "004.50" },
new string[] { "Pmax", "174.04" },
},
},
},
};
@ -119,6 +232,7 @@ namespace AgroBase.Models.Modules
public List<string> ProtocoloConfiguracao(bool Conectar)
{
List<string> Config = BicosPulverizadores.Select(x => x.ProtocoloConfiguracaoBico(Conectar)).ToList();
Config.Add(BombaPressurizadora.ProtocoloConfiguracaoBomba(Conectar));
Config.AddRange(Sensores.Select(x => x.ProtocoloConfiguracaoSensor(Pinout, Conectar)).ToList());
string ProtocoloMOD = ((int)F_Code.Cfg).ToString() +
"MD".PadRight(5, ' ') + ";" + // 0 ~ 4
@ -136,12 +250,14 @@ namespace AgroBase.Models.Modules
if (!string.IsNullOrEmpty(Protocolo) && Protocolo[0].ToString() == SerialService.BeginSensor)
{
string[] Dados = Protocolo.Replace(SerialService.BeginSensor, "").Split(SerialService.EndLine[0])[0].Split(';');
string _id = Dados[1].Trim();
S_Code TipoSensor = (S_Code)(int.Parse(Dados[0]));
AtuadorBicoModel Bico = BicosPulverizadores.FirstOrDefault(x => x.ID == Dados[1]);
SensorModel Sensor = Sensores.FirstOrDefault(x => x.ID == Dados[1]);
if (Bico == null && Sensor == null)
AtuadorBicoModel Bico = BicosPulverizadores.FirstOrDefault(x => x.ID.Trim() == _id);
SensorModel Sensor = Sensores.FirstOrDefault(x => x.ID.Trim() == _id);
AtuadorBombaModel Bomba = _id == BombaPressurizadora.ID.Trim() ? BombaPressurizadora : null;
if (Bico == null && Sensor == null && Bomba == null)
{
if (Dados[1] == "MD ")
if (_id == "MD")
{
Conectado = Dados[2] == "1";
}
@ -162,6 +278,10 @@ namespace AgroBase.Models.Modules
{
Sensor.Inicializado = Inicializado;
}
if (Bomba != null)
{
Bomba.Inicializado = Inicializado;
}
break;
}
case S_Code.sTST:
@ -185,26 +305,30 @@ namespace AgroBase.Models.Modules
}
case S_Code.sFLX:
{
double nivelFluxo = 0;
double.TryParse(Dados[2].Replace(".", ","), out nivelFluxo);
int pulsos = 0;
int.TryParse(Dados[2].Replace(".", ","), out pulsos);
int tempo = 0;
int.TryParse(Dados[3].Replace(".", ","), out tempo);
if (nivelFluxo > 0)
{
MediaNivelFluxo = nivelFluxo;
_LeituraPulsos = pulsos;
_LeituraPeriodo = tempo;
if (VazaoFluxoMLpS > 0)
{
foreach (var bico in BicosPulverizadores.Where(x => x.Atuado))
{
bico.MediaNivelFluxo = nivelFluxo / BicosPulverizadores.Count(y => y.Atuado);
bico.MediaNivelFluxo = VazaoFluxoMLpS / BicosPulverizadores.Count(y => y.Atuado);
};
Variaveis.OperacaoEmAndamento.Sensoriamento.HerbicidaConsumido += nivelFluxo;
double periodoAtual = Sensor.Leituras.Any() ? (double)_LeituraPeriodo - Sensor.Leituras[1] : (double)_LeituraPeriodo;
VolumeVazaoML += (VazaoFluxoMLpS) * (periodoAtual / 1000);
Variaveis.OperacaoEmAndamento.Sensoriamento.HerbicidaConsumido = (VolumeVazaoML / 1000);
}
Sensor.Leituras = new List<double>()
{
nivelFluxo,
pulsos,
tempo
};
break;
@ -213,9 +337,7 @@ namespace AgroBase.Models.Modules
{
double massa = 0;
double.TryParse(Dados[2].Replace(".", ","), out massa);
MassaReservatorio = massa;
VolumeReservatorio = massa / DensidadeHerbicida;
PercentualReservatorio = VolumeReservatorio / CapacidadeReservatorio * 100;
_MassaLeitura = massa;
Sensor.Leituras = new List<double>()
{
@ -227,17 +349,29 @@ namespace AgroBase.Models.Modules
{
double pressao = 0;
double.TryParse(Dados[2].Replace(".", ","), out pressao);
int leitura = 0;
int.TryParse(Dados[3].Replace(".", ","), out leitura);
double leitura = 0;
double.TryParse(Dados[3].Replace(".", ","), out leitura);
PressaoLinha = pressao;
_LeituraPressao = leitura;
BombaPressurizadora.Pressao = PressaoLinha;
Sensor.Leituras = new List<double>()
{
pressao,
leitura
};
break;
}
case S_Code.sBMB:
{
bool Ligado = Dados[2] == "1";
Bomba.Ligado = Ligado;
double potencia = 0;
double.TryParse(Dados[3].Replace(".", ","), out potencia);
Bomba.Potencia = potencia;
break;
}
}
if (Sensor != null)
@ -337,8 +471,8 @@ namespace AgroBase.Models.Modules
{
string ProtocoloBico =
((int)F_Code.Cmd).ToString() +
ID + ";" + // 0 ~ 2
(Atuado ? "1" : "0"); // 4
ID.PadRight(5, ' ') + ";" + // 0 ~ 4
(Atuado ? "1" : "0"); // 6
return ProtocoloBico;
}
return "";
@ -350,7 +484,7 @@ namespace AgroBase.Models.Modules
{
string ProtocoloBico =
((int)F_Code.Tst).ToString() +
ID; // 0 ~ 2;
ID.PadRight(5, ' '); // 0 ~ 4;
return ProtocoloBico;
}
return "";
@ -375,4 +509,80 @@ namespace AgroBase.Models.Modules
return clone;
}
}
public class AtuadorBombaModel
{
public string ID { get; set; }
public bool BombaAtuada { get; set; }
public bool Ligado { get; set; }
public bool Comandar { get; set; }
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 Pressao { get; set; }
public double Potencia { get; set; }
public string ProtocoloConfiguracaoBomba(bool Conectar)
{
var _pinout = AtuadorModel.Pinout.Where(x => x.ComponenteID == ID).ToList();
return ((int)F_Code.Cfg).ToString() +
ID.PadRight(5, ' ') + ";" + // 0 ~ 4
(Conectar ? "1" : "0") + ";" + // 6
(Comandar ? "1" : "0") + ";" + // 8
PressaoSP.ToString("000") + ";" + // 10 ~ 12
(_pinout.Any(x => x.Funcao == FuncoesPinout.ENA) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.ENA).Pino.ToString("00") : "-1") + ";" + // 14 ~ 15
(_pinout.Any(x => x.Funcao == FuncoesPinout.CS) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.CS).Pino.ToString("00") : "-1") + ";" + // 17 ~ 18
(_pinout.Any(x => x.Funcao == FuncoesPinout.INA) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.INA).Pino.ToString("00") : "-1") + ";" + // 20 ~ 21
(_pinout.Any(x => x.Funcao == FuncoesPinout.INB) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.INB).Pino.ToString("00") : "-1") + ";" + // 23 ~ 24
(_pinout.Any(x => x.Funcao == FuncoesPinout.PWM) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.PWM).Pino.ToString("00") : "-1"); // 26 ~ 27
}
public string ProtocoloComando()
{
if (Comandar)
{
string ProtocoloBomba =
((int)F_Code.Cmd).ToString() +
ID.PadRight(5, ' ') + ";" + // 0 ~ 4
(BombaAtuada ? "1" : "0") + ";" + // 6
PressaoSP.ToString("000"); // 8 ~ 10
return ProtocoloBomba;
}
return "";
}
public string ProtocoloTeste()
{
if (Comandar)
{
string ProtocoloBomba =
((int)F_Code.Tst).ToString() +
ID.PadRight(5, ' '); // 0 ~ 4;
return ProtocoloBomba;
}
return "";
}
public AtuadorBombaModel Clone()
{
AtuadorBombaModel clone = new AtuadorBombaModel()
{
ID = this.ID,
Ligado = this.Ligado,
Comandar = this.Comandar,
Inicializado = this.Inicializado,
Testando = this.Testando,
Funcoes = this.Funcoes,
Pressao = this.Pressao,
PressaoSP = this.PressaoSP,
};
return clone;
}
}
}

View File

@ -278,6 +278,11 @@ namespace AgroBase.Models.Modules
Echo,
Trigger,
Massa,
SDA,
SCL,
CS,
INA,
INB,
}
public static class PinoutUtils

View File

@ -17,7 +17,11 @@ namespace AgroBase.Models.Modules
public bool Conectado { get; set; } = false;
public static int LogsManter { get; set; } = 60;
public static List<PinoutModel> Pinout { get; set; }
public static List<FuncoesPinout> Funcoes { get; set; } = new List<FuncoesPinout>();
public static List<FuncoesPinout> Funcoes { get; set; } = new List<FuncoesPinout>()
{
FuncoesPinout.SDA,
FuncoesPinout.SCL,
};
public List<SensorModel> Sensores { get; set; }
@ -342,7 +346,7 @@ namespace AgroBase.Models.Modules
UnidadeMedida = "º",
Parametros = new List<string[]>(),
},
}
},
};
}
@ -352,7 +356,9 @@ namespace AgroBase.Models.Modules
string ProtocoloMOD = ((int)F_Code.Cfg).ToString() +
"MD".PadRight(5, ' ') + ";" + // 0 ~ 4
(Conectar ? "1" : "0") + ";" + // 6
_TaxaAmostragem.ToString("00000"); // 8 ~ 12
_TaxaAmostragem.ToString("00000") + // 8 ~ 12
(Pinout.Any(x => x.Funcao == FuncoesPinout.SDA) ? Pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.SDA).Pino.ToString("00") : "-1") + ";" + // 14 ~ 15
(Pinout.Any(x => x.Funcao == FuncoesPinout.SCL) ? Pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.SCL).Pino.ToString("00") : "-1"); // 17 ~ 18
Config.Add(ProtocoloMOD);
return Config;
}

View File

@ -393,6 +393,7 @@ namespace AgroBase.Models
{
Sensoriamento.AtuacoesPorBico.Add(0);
}
DispAtu.Dados.VolumeVazaoML = 0;
}
Sensoriamento.DistanciaPercorrida = new List<double>();
Logs = new List<OperacaoSensoriamentoModel>();
@ -974,7 +975,7 @@ namespace AgroBase.Models
{
try
{
if (Variaveis.OperacaoEmAndamento.DispSen.Dados.Sensores.Any(x => x.Componente == S_Code.sMAG && x.Inicializado))
if (Variaveis.OperacaoEmAndamento.DispSen._Porta.IsOpen && Variaveis.OperacaoEmAndamento.DispSen.Dados.Sensores.Any(x => x.Componente == S_Code.sMAG && x.Inicializado))
{
return Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarroBussola;
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AgroBase.Models
{
public class PZEMModel
{
public double Tensao { get; set; }
public double Corrente { get; set; }
public double Potencia { get; set; }
public double Energia { get; set; }
public bool AlarmeTensaoMax { get; set; }
public bool AlarmeTensaoMin { get; set; }
}
}

View File

@ -35,6 +35,11 @@ namespace AgroBase.Models
return formattedDate;
}
public static double Map(double valor, double deMin, double deMax, double paraMin, double paraMax)
{
return paraMin + (valor - deMin) * (paraMax - paraMin) / (deMax - deMin);
}
}
public static class VariaveisPortas

View File

@ -0,0 +1,226 @@
import serial
import time
import threading
import sys
import json
import uuid
import paho.mqtt.client as mqtt
mqtt_client = mqtt.Client(f"client_pzem_{uuid.uuid4()}")
mqtt_client.connect("localhost", port=1883)
mqtt_topic = sys.argv[1]
# Configuração da porta serial
porta_serial = 'COM14' # Substitua '/dev/ttyUSB0' pelo nome da porta serial correta no seu sistema
baud_rate = 9600
timeout = 2 # Tempo de espera para a resposta
CodigosFuncoes = {
"LeituraParametro": 0x3,
"AquisicaoDados": 0x04,
"GravacaoParametro": 0x06,
"ResetEnergia": 0x42,
}
Parametros = {
"AlarmeTensaoMaxima": 0x0000,
"AlarmeTensaoMinima": 0x0001,
"EnderecoRTU": 0x0002,
"EscalaCorrenteAtual": 0x0003,
}
slave_address = 0x01
# Inicialização da porta serial
ser = serial.Serial(porta_serial, baud_rate, timeout=timeout)
# Função para calcular o CRC16 de um comando
def crc16(data: bytes):
crc = 0xFFFF
for pos in data:
crc ^= pos
for i in range(8):
if (crc & 1) != 0:
crc >>= 1
crc ^= 0xA001
else:
crc >>= 1
return crc.to_bytes(2, byteorder='little')
def verificar_crc(resposta_hex):
resposta_bytes = bytes.fromhex(resposta_hex)
crc_recebido = resposta_bytes[-2:]
crc_calculado = crc16(resposta_bytes[:-2])
return crc_recebido == crc_calculado
# Monta o comando para ler os registros
def comando_aquisicao_dados():
function_code = CodigosFuncoes["AquisicaoDados"]
start_address = 0x0000
num_of_registers = 0x0008
command = bytearray([slave_address, function_code]) + start_address.to_bytes(2, byteorder='big') + num_of_registers.to_bytes(2, byteorder='big')
command += crc16(command)
return command
def decifrar_resposta_aquisicao(resposta):
resposta = resposta.hex()
# Certifique-se de que a resposta é do tipo bytes
if isinstance(resposta, str):
resposta = bytes.fromhex(resposta)
# Verifica o comprimento da resposta e o código da função
if len(resposta) >= 5 and resposta[1] == CodigosFuncoes["AquisicaoDados"]:
# Extrai o número de bytes de dados
num_bytes = resposta[2]
if num_bytes == 16: # Se o número de bytes de dados for 16
# Decodificação de tensão, corrente, potência e energia
tensao_raw = int.from_bytes(resposta[3:5], byteorder='big')
corrente_raw = int.from_bytes(resposta[5:7], byteorder='big')
potencia_raw = int.from_bytes(resposta[7:11], byteorder='big') # 4 bytes para potência
energia_raw = int.from_bytes(resposta[11:15], byteorder='big') # 4 bytes para energia
high_alarm_raw = resposta[15]
low_alarm_raw = resposta[16]
# Conversões (ajuste conforme necessário)
tensao = tensao_raw * 0.01
corrente = corrente_raw * 0.01
potencia = potencia_raw * 0.1
energia = energia_raw * 1
# Decodificação dos estados de alarme
alarme_alta_tensao = "Ativo" if high_alarm_raw == 0xFFFF else "Não Ativo"
alarme_baixa_tensao = "Ativo" if low_alarm_raw == 0xFFFF else "Não Ativo"
# Retorno formatado com todos os valores
resultado = {
"Tensão": f"{tensao} V",
"Corrente": f"{corrente} A",
"Potência": f"{potencia} W",
"Energia": f"{energia} Wh",
"Alarme de Alta Tensão": alarme_alta_tensao,
"Alarme de Baixa Tensão": alarme_baixa_tensao
}
mqtt_client.publish(mqtt_topic, json.dumps(resultado).encode('utf-8'))
else:
print("Número de bytes de dados não esperado.")
else:
print("Resposta inválida ou código de função incorreto.")
return None
def comando_set_parametro(Parametro, valor):
# Convertendo o valor de tensão para o formato correto (LSB = 0.01V)
valor_int = int(valor * 100) # Convertendo para inteiro conforme a resolução
function_code = CodigosFuncoes["GravacaoParametro"]
register_address = Parametro
# Construindo o comando
command = bytearray([slave_address, function_code]) + register_address.to_bytes(2, byteorder='big') + valor_int.to_bytes(2, byteorder='big')
# Adicionando o CRC ao comando
command += crc16(command)
return command
def comando_get_parametro(Parametro):
function_code = CodigosFuncoes["LeituraParametro"]
register_address = Parametro
number_of_registers = 0x0001 # Lendo apenas um registro
# Construindo o comando
command = bytearray([slave_address, function_code]) + register_address.to_bytes(2, byteorder='big') + number_of_registers.to_bytes(2, byteorder='big')
# Adicionando o CRC ao comando
command += crc16(command)
return command
def decifrar_resposta_get_parametro(resposta_hex):
# Primeiro, verifique se a resposta é válida verificando o CRC
if not verificar_crc(resposta_hex):
return "CRC inválido. A resposta pode estar corrompida."
# Converte a parte dos dados da resposta de hex para decimal
valor_hex = resposta_hex[6:10]
valor_decimal = int(valor_hex, 16)
# Converte o valor para a unidade correta (LSB = 0.01V)
valor_unidade = valor_decimal * 0.01
return valor_unidade
def comando_reset_energia():
# Código de função específico para reset de energia
function_code = CodigosFuncoes["ResetEnergia"]
# Construindo o comando
command = bytearray([slave_address, function_code])
# Adicionando o CRC ao comando
command += crc16(command)
return command
def comando_calibragem():
# Bytes fixos para o comando de calibragem
bytes_comando = bytearray([0xF8, 0x41, 0x37, 0x21])
# Calculando o CRC para os bytes do comando
crc = crc16(bytes_comando)
# Adicionando o CRC ao comando
comando_calibragem = bytes_comando + crc
return comando_calibragem
def enviar_comando(comando):
ser.write(comando)
time.sleep(0.1) # Pequena pausa para garantir o envio
resposta = ser.read(ser.inWaiting()) # Lê todos os dados disponíveis na porta
return resposta
def main():
comando = comando_aquisicao_dados()
enviar_comando(comando_calibragem())
time.sleep(5)
#com_set = comando_set_parametro(Parametros["EscalaCorrenteAtual"], 0)
#enviar_comando(com_set)
#time.sleep(1)
#vmax = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["AlarmeTensaoMaxima"])).hex())
#vmin = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["AlarmeTensaoMinima"])).hex())
#addr = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["EnderecoRTU"])).hex())
#rang = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["EscalaCorrenteAtual"])).hex())
#print(f"Alarme tensao maxima: {vmax}")
#print(f"Alarme tensao minima: {vmin}")
#print(f"Endereco RTU: {addr}")
#print(f"Escala de corrente: {rang}")
try:
while True:
resposta = enviar_comando(comando)
try:
decifrar_resposta_aquisicao(resposta)
except:
print("Erro ao decodificar mensagem: " + resposta.hex())
#time.sleep(1) # Espera 1 segundo antes da próxima leitura
except KeyboardInterrupt:
print("Programa encerrado pelo usuário")
finally:
ser.close()
# Esta função é para confirmar que script está pronto para execução
def send_script_ready():
mqtt_client.publish(mqtt_topic, "OK")
if __name__ == "__main__":
# Cria trhead separada para informar que o script iniciou com sucesso
mqtt_thread = threading.Thread(target=send_script_ready)
mqtt_thread.start()
main()

View File

@ -19,7 +19,7 @@ mqtt_client.connect("localhost", port=1883)
json_reading_data = None
output_folder = 'Python/Output/'
model_folder = 'C:\\train\\DeepLabV3Plus-Pytorch\\'
model_folder = 'C:\\ZendionINC\\agrobot_base\\Treinamento\\models\\ruas\\'
max_readings = int(sys.argv[1])
port = sys.argv[2]
url = sys.argv[3]

View File

@ -13,9 +13,9 @@ mqtt_client = mqtt.Client(f"client_weed_detector_{uuid.uuid4()}")
mqtt_client.connect("localhost", port=1883)
# Adiciona as configurações do modelo YOLO
model_config = 'C:\\train\\models\\ervas\\ervas.cfg'
model_weights = 'C:\\train\\models\\ervas\\backup\\ervas_final.weights'
labels_path = 'C:\\train\\models\\ervas\\labels.txt'
model_config = 'C:\\ZendionINC\\agrobot_base\\Treinamento\\models\\ervas\\ervas.cfg'
model_weights = 'C:\\ZendionINC\\agrobot_base\\Treinamento\\models\\ervas\\backup\\ervas_final.weights'
labels_path = 'C:\\ZendionINC\\agrobot_base\\Treinamento\\models\\ervas\\labels.txt'
# Carregar as classes
with open(labels_path, 'rt') as f:

View File

@ -363,6 +363,8 @@ namespace AgroBase.Comum
else if (Dados is AtuadorModel atuModel && Dispositivo == T_Code.Atu)
{
clbDispositivos.Items.Clear();
clbDispositivos.Items.Add(atuModel.BombaPressurizadora.ID.ToString());
clbDispositivos.SetItemChecked(clbDispositivos.Items.Count - 1, atuModel.BombaPressurizadora.Comandar);
var Bicos = atuModel.BicosPulverizadores.ToList();
foreach (var Bico in Bicos)
{
@ -572,6 +574,7 @@ namespace AgroBase.Comum
{
atuModel.BicosPulverizadores.ForEach(x => x.Comandar = false);
atuModel.Sensores.ForEach(x => x.Aferir = false);
atuModel.BombaPressurizadora.Comandar = false;
foreach (var Item in ((CheckedListBox)sender).CheckedItems)
{
if (atuModel.BicosPulverizadores.Any(x => x.ID == Item.ToString()))
@ -582,6 +585,10 @@ namespace AgroBase.Comum
{
atuModel.Sensores.FirstOrDefault(x => x.ID == Item.ToString()).Aferir = true;
}
else if (atuModel.BombaPressurizadora.ID == Item.ToString())
{
atuModel.BombaPressurizadora.Comandar = true;
}
}
}
break;

View File

@ -0,0 +1,322 @@
using AgroBase.Models;
using CefSharp.WinForms;
using CefSharp;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO.Ports;
using System.Linq;
using System.Windows.Forms;
using Newtonsoft.Json;
using Emgu.CV.CvEnum;
using Emgu.CV.Aruco;
using static AgroBase.Services.SerialService;
namespace AgroBase.Services
{
public class PZEMService
{
public static bool Iniciado = false;
public static SerialPort PortaPZEM = null;
public static PZEMModel UltimaLeitura = new PZEMModel();
public static PZEMModel PenultimaLeitura = new PZEMModel();
private static byte slaveAddress = 0x01;
private static Dictionary<string, byte> CodigosFuncoes = new Dictionary<string, byte>()
{
{ "LeituraParametro", 0x03 },
{ "AquisicaoDados", 0x04 },
{ "GravacaoParametro", 0x06 },
{ "ResetEnergia", 0x42 },
{ "ErroGravaParametro", 0x86 },
{ "Calibrar", 0x41 },
{ "ErroCalibrar", 0xC1 },
};
public static Dictionary<string, byte> Parametros = new Dictionary<string, byte>()
{
{ "AlarmeTensaoMaxima", 0x0000 },
{ "AlarmeTensaoMinima", 0x0001 },
{ "EnderecoRTU", 0x0002 },
{ "EscalaCorrenteAtual", 0x0003 },
};
public static void AtualizarPortaCOM(SerialPort Porta)
{
try
{
Porta.BaudRate = 9600;
Porta.DataReceived -= PortaPZEM_DataReceived;
Porta.DataReceived += PortaPZEM_DataReceived;
Porta.Open();
var Comando = ComandoCalibragem();
string comandoHex = BitConverter.ToString(Comando).Replace("-", "");
EnviarComando(Porta, Comando);
}
catch (Exception ex)
{
Porta.Close();
}
}
public static void EnviarComando(SerialPort _Porta, byte[] Comando)
{
if (_Porta != null && _Porta.IsOpen)
{
_Porta.Write(Comando, 0, Comando.Length);
}
}
public static void PortaPZEM_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
if (Iniciado)
{
if (PortaPZEM.IsOpen)
{
PenultimaLeitura = UltimaLeitura;
int bytesToRead = PortaPZEM.BytesToRead;
byte[] buffer = new byte[bytesToRead];
PortaPZEM.Read(buffer, 0, bytesToRead);
DecifrarRespostaAquisicao(buffer);
}
}
else
{
var Porta = ((SerialPort)sender);
int bytesToRead = Porta.BytesToRead;
byte[] buffer = new byte[bytesToRead];
Porta.Read(buffer, 0, bytesToRead);
var Res = DecifrarRespostaAquisicao(buffer);
if (Res != null)
{
PortaPZEM = Porta;
Iniciado = true;
}
SerialService.DispositivosMapeados.Add(new DispositivoDetalhesModel()
{
PortaCOM = Porta.PortName,
Dispositivo = Enuns.T_Code.Pzm
});
}
}
#region Comandos
public static byte[] ComandoAquisicaoDados()
{
byte functionCode = CodigosFuncoes["AquisicaoDados"];
ushort startAddress = 0x0000;
ushort numOfRegisters = 0x0008;
List<byte> command = new List<byte>();
command.Add(slaveAddress);
command.Add(functionCode);
command.AddRange(BitConverter.GetBytes(startAddress).Reverse()); // Big endian
command.AddRange(BitConverter.GetBytes(numOfRegisters).Reverse()); // Big endian
byte[] crc = Crc16(command.ToArray()); // Supondo que você tenha a implementação do CRC16
command.AddRange(crc);
return command.ToArray();
}
public static byte[] ComandoSetParametro(byte Parametro, float valor)
{
// Convertendo o valor para o formato correto (LSB = 0.01)
int valorInt = (int)(valor * 100); // Convertendo para inteiro conforme a resolução
byte functionCode = CodigosFuncoes["GravacaoParametro"];
ushort registerAddress = Parametro;
// Construindo o comando
List<byte> command = new List<byte>();
command.Add(slaveAddress);
command.Add(functionCode);
command.AddRange(BitConverter.GetBytes(registerAddress).Reverse()); // Little endian
command.AddRange(BitConverter.GetBytes((ushort)valorInt).Reverse()); // Little endian
byte[] crc = Crc16(command.ToArray()); // Supondo que você tenha a implementação do CRC16
command.AddRange(crc);
return command.ToArray();
}
public static byte[] ComandoGetParametro(byte Parametro)
{
byte functionCode = CodigosFuncoes["LeituraParametro"];
ushort registerAddress = Parametro;
ushort numberOfRegisters = 0x0001; // Lendo apenas um registro
// Construindo o comando
List<byte> command = new List<byte>();
command.Add(slaveAddress);
command.Add(functionCode);
command.AddRange(BitConverter.GetBytes(registerAddress).Reverse()); // Big endian
command.AddRange(BitConverter.GetBytes(numberOfRegisters).Reverse()); // Big endian
byte[] crc = Crc16(command.ToArray()); // Supondo que você tenha a implementação do CRC16
command.AddRange(crc);
return command.ToArray();
}
public static byte[] ComandoResetEnergia()
{
// Código de função específico para reset de energia
byte functionCode = CodigosFuncoes["ResetEnergia"];
// Construindo o comando
List<byte> command = new List<byte>();
command.Add(slaveAddress);
command.Add(functionCode);
// Adicionando o CRC ao comando
byte[] crc = Crc16(command.ToArray()); // Supondo que você tenha a implementação do CRC16
command.AddRange(crc);
return command.ToArray();
}
public static byte[] ComandoCalibragem()
{
byte functionCode = CodigosFuncoes["Calibrar"];
// Bytes fixos para o comando de calibragem
byte[] bytesComando = new byte[] { 0xF8, functionCode, 0x37, 0x21 };
// Calculando o CRC para os bytes do comando
byte[] crc = Crc16(bytesComando);
// Adicionando o CRC ao comando
List<byte> comandoCalibragem = new List<byte>(bytesComando);
comandoCalibragem.AddRange(crc);
return comandoCalibragem.ToArray();
}
#endregion
public static byte[] Crc16(byte[] data)
{
ushort crc = 0xFFFF;
foreach (byte pos in data)
{
crc ^= pos;
for (int i = 0; i < 8; i++)
{
if ((crc & 1) != 0)
{
crc >>= 1;
crc ^= 0xA001;
}
else
{
crc >>= 1;
}
}
}
return new byte[] { (byte)crc, (byte)(crc >> 8) };
}
public static bool VerificarCrc(string respostaHex)
{
byte[] respostaBytes = HexStringToByteArray(respostaHex);
byte[] crcRecebido = new byte[] { respostaBytes[respostaBytes.Length - 2], respostaBytes[respostaBytes.Length - 1] };
byte[] dados = new byte[respostaBytes.Length - 2];
Array.Copy(respostaBytes, 0, dados, 0, dados.Length);
byte[] crcCalculado = Crc16(dados);
return crcRecebido[0] == crcCalculado[0] && crcRecebido[1] == crcCalculado[1];
}
public static byte[] HexStringToByteArray(string hex)
{
int NumberChars = hex.Length;
byte[] bytes = new byte[NumberChars / 2];
for (int i = 0; i < NumberChars; i += 2)
bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16);
return bytes;
}
public static PZEMModel DecifrarRespostaAquisicao(byte[] resposta)
{
try
{
/*if (!VerificarCrc(resposta))
{
Console.Write("CRC inválido. A resposta pode estar corrompida.");
return null;
}*/
if (resposta[1] == CodigosFuncoes["AquisicaoDados"])
{
int numBytes = resposta[2];
if (numBytes == 16) // Se o número de bytes de dados for 16
{
PZEMModel modelo = new PZEMModel();
var tensao_raw = "0x" + resposta[3].ToString("X") + resposta[4].ToString("X");
modelo.Tensao = Convert.ToInt32(tensao_raw, 16) * 0.01;
var corrente_raw = "0x" + resposta[5].ToString("X") + resposta[6].ToString("X");
modelo.Corrente = Convert.ToInt32(corrente_raw, 16) * 0.01;
var potencia_raw = "0x" + resposta[7].ToString("X") + resposta[8].ToString("X") + resposta[9].ToString("X") + resposta[10].ToString("X");
modelo.Potencia = Convert.ToInt32(potencia_raw, 16) * 0.1;
var energia_raw = "0x" + resposta[11].ToString("X") + resposta[12].ToString("X") + resposta[13].ToString("X") + resposta[14].ToString("X");
modelo.Energia = Convert.ToInt32(energia_raw, 16) * 1.0;
var almMax_raw = "0x" + resposta[15].ToString("X") + resposta[16].ToString("00").Substring(0, 2);
modelo.AlarmeTensaoMax = almMax_raw == "0xFFFF";
var almMin_raw = "0x" + resposta[17].ToString("X") + resposta[18].ToString("X");
modelo.AlarmeTensaoMin = almMin_raw == "0xFFFF";
Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria = (modelo.Tensao / 42) * 100;
UltimaLeitura = modelo;
return modelo;
}
else
{
Console.WriteLine("Número de bytes de dados não esperado.");
}
}
else if (resposta[1] == CodigosFuncoes["LeituraParametro"])
{
var parametro_raw = "0x" + resposta[3].ToString("X") + resposta[4].ToString("X");
double Valor = Convert.ToInt16(parametro_raw, 16) * 0.01;
MessageBox.Show("Valor do parâmetro: " + Valor);
}
else if (resposta[1] == CodigosFuncoes["GravacaoParametro"])
{
MessageBox.Show("Parâmetro gravado com sucesso!");
}
else if (resposta[1] == CodigosFuncoes["ErroGravaParametro"])
{
MessageBox.Show("Erro ao gravar parâmetro!");
}
else if (resposta[1] == CodigosFuncoes["Calibrar"])
{
MessageBox.Show("Calibragem do PZEM-017 finalizada com sucesso!");
}
else if (resposta[1] == CodigosFuncoes["ErroCalibrar"])
{
MessageBox.Show("Erro ao calibrar o PZEM-017!");
}
else
{
Console.WriteLine("Resposta inválida ou código de função incorreto.");
}
return new PZEMModel();
}
catch (Exception ex)
{
}
return null;
}
}
}

View File

@ -31,7 +31,8 @@ namespace AgroBase.Services
Args += ' '.ToString() + '"'.ToString() + arg + '"'.ToString();
}
Process pythonProcess = new Process();
pythonProcess.StartInfo.FileName = "C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python311\\python";
//pythonProcess.StartInfo.FileName = "C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python311\\python";
pythonProcess.StartInfo.FileName = "python";
pythonProcess.StartInfo.Arguments = ScriptPath + Args;
pythonProcess.StartInfo.UseShellExecute = false;
pythonProcess.StartInfo.RedirectStandardOutput = true;

View File

@ -6,6 +6,7 @@ using System.Drawing;
using System.IO.Ports;
using System.Linq;
using System.Net.NetworkInformation;
using System.Threading;
using System.Windows.Forms;
using static AgroBase.Models.Enuns;
@ -24,15 +25,53 @@ namespace AgroBase.Services
}
public static List<DispositivoDetalhesModel> DispositivosMapeados = new List<DispositivoDetalhesModel>();
public static List<SerialPort> PortasAguardandoResposta = new List<SerialPort>();
public static List<SerialPort> PortasComErro = new List<SerialPort>();
private static Dictionary<string, int> TentativasPortas = new Dictionary<string, int>();
public static void RealizarVarreduraPortasUSB()
{
PortasAguardandoResposta.ForEach(Porta =>
{
Porta.Close();
PortasComErro.Add(Porta);
});
PortasComErro.ForEach(Porta =>
{
Porta.DataReceived -= _Porta_DataReceived;
PortasAguardandoResposta.Remove(Porta);
if (PZEMService.PortaPZEM == null)
{
PZEMService.AtualizarPortaCOM(Porta);
}
if (TentativasPortas.TryGetValue(Porta.PortName, out int tentativas))
{
TentativasPortas[Porta.PortName] = tentativas + 1;
}
else
{
TentativasPortas.Add(Porta.PortName, 1);
}
if (TentativasPortas[Porta.PortName] > 2)
{
Porta.Close();
PortasComErro.Remove(Porta);
TentativasPortas.Remove(Porta.PortName);
}
});
var Portas = SerialPort.GetPortNames();
var PortasNaoMapeadas = Portas.Where(x => !DispositivosMapeados.Select(y => y.PortaCOM).Contains(x)).ToList();
var PortasNaoMapeadas = Portas.Where(x => !DispositivosMapeados.Select(y => y.PortaCOM).Contains(x) && !PortasComErro.Select(y => y.PortName).Contains(x)).ToList();
if (GPSService.PortaGPS != null)
{
PortasNaoMapeadas = PortasNaoMapeadas.Where(x => x != GPSService.PortaGPS.PortName).ToList();
}
if (PZEMService.PortaPZEM != null)
{
PortasNaoMapeadas = PortasNaoMapeadas.Where(x => x != PZEMService.PortaPZEM.PortName).ToList();
PortasComErro.Remove(PZEMService.PortaPZEM);
}
for (int i = 0; i < PortasNaoMapeadas.Count(); i++)
{
@ -45,6 +84,7 @@ namespace AgroBase.Services
{
_Porta.Open();
_Porta.Write(CodigoTest);
PortasAguardandoResposta.Add(_Porta);
}
catch (Exception ex)
{
@ -147,6 +187,7 @@ namespace AgroBase.Services
}
Porta.Close();
PortasAguardandoResposta.Remove(Porta);
}
}
}

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-03-26T10:50:29.1928115-03:00","ErvasNoRadar":5,"VelocidadeMedia":0.0,"HerbicidaConsumido":0.0,"HerbicidaPorErva":0.0,"PorcentagemBateria":0.0,"BateriaConsumida":0.0,"ErvasIdentificadas":2,"AtuacoesPorBico":[1,1,0,0],"DistanciaPercorrida":[],"ProgressoTrajeto":0.0,"ProgressoRua":0.0,"DistanciaEsquerda":0.0,"DistanciaDireita":0.0,"Status":2,"AnguloCarro":0.0,"AnguloCarroBussola":0.0,"AnguloRua":333.18452915675431,"AnguloRuaCamera":0.0,"AnguloDif":0.0,"Direcao":0,"DentroDaRua":false,"IdxPontoAproximadoRua":0,"IdxRuaAtual":0},{"Momento":"2024-03-26T10:50:34.1875977-03:00","ErvasNoRadar":3,"VelocidadeMedia":0.0,"HerbicidaConsumido":0.0,"HerbicidaPorErva":0.0,"PorcentagemBateria":0.0,"BateriaConsumida":0.0,"ErvasIdentificadas":15,"AtuacoesPorBico":[6,9,0,0],"DistanciaPercorrida":[],"ProgressoTrajeto":0.0,"ProgressoRua":0.0,"DistanciaEsquerda":0.0,"DistanciaDireita":0.0,"Status":3,"AnguloCarro":70.64967801047743,"AnguloCarroBussola":0.0,"AnguloRua":333.18452915675431,"AnguloRuaCamera":0.0,"AnguloDif":0.0,"Direcao":0,"DentroDaRua":false,"IdxPontoAproximadoRua":0,"IdxRuaAtual":0},{"Momento":"2024-03-26T10:50:39.1805174-03:00","ErvasNoRadar":3,"VelocidadeMedia":0.0,"HerbicidaConsumido":0.0,"HerbicidaPorErva":0.0,"PorcentagemBateria":0.0,"BateriaConsumida":0.0,"ErvasIdentificadas":18,"AtuacoesPorBico":[7,11,0,0],"DistanciaPercorrida":[0.0],"ProgressoTrajeto":0.0,"ProgressoRua":0.0,"DistanciaEsquerda":0.0,"DistanciaDireita":0.0,"Status":3,"AnguloCarro":0.0,"AnguloCarroBussola":0.0,"AnguloRua":333.18452915675431,"AnguloRuaCamera":0.0,"AnguloDif":0.0,"Direcao":0,"DentroDaRua":false,"IdxPontoAproximadoRua":0,"IdxRuaAtual":0},{"Momento":"2024-03-26T10:50:44.1865342-03:00","ErvasNoRadar":0,"VelocidadeMedia":0.0,"HerbicidaConsumido":0.0,"HerbicidaPorErva":0.0,"PorcentagemBateria":0.0,"BateriaConsumida":0.0,"ErvasIdentificadas":20,"AtuacoesPorBico":[8,12,0,0],"DistanciaPercorrida":[15.532164373823042],"ProgressoTrajeto":1.1641049109827626,"ProgressoRua":25.0,"DistanciaEsquerda":0.0,"DistanciaDireita":0.0,"Status":4,"AnguloCarro":332.97738784499131,"AnguloCarroBussola":0.0,"AnguloRua":333.39426226426644,"AnguloRuaCamera":0.0,"AnguloDif":-0.41687441927513191,"Direcao":1,"DentroDaRua":true,"IdxPontoAproximadoRua":2,"IdxRuaAtual":0},{"Momento":"2024-03-26T10:50:45.7804354-03:00","ErvasNoRadar":0,"VelocidadeMedia":0.0,"HerbicidaConsumido":0.0,"HerbicidaPorErva":0.0,"PorcentagemBateria":0.0,"BateriaConsumida":0.0,"ErvasIdentificadas":20,"AtuacoesPorBico":[8,12,0,0],"DistanciaPercorrida":[25.822843000933517],"ProgressoTrajeto":1.9353708620020584,"ProgressoRua":87.5,"DistanciaEsquerda":0.0,"DistanciaDireita":0.0,"Status":1,"AnguloCarro":333.59977895821442,"AnguloCarroBussola":0.0,"AnguloRua":333.80228575854244,"AnguloRuaCamera":0.0,"AnguloDif":-0.20250680032802393,"Direcao":1,"DentroDaRua":true,"IdxPontoAproximadoRua":7,"IdxRuaAtual":0}],{"Momento":"2024-03-26T10:50:47.0038668-03:00","ErvasNoRadar":0,"VelocidadeMedia":0.0,"HerbicidaConsumido":0.0,"HerbicidaPorErva":0.0,"PorcentagemBateria":0.0,"BateriaConsumida":0.0,"ErvasIdentificadas":20,"AtuacoesPorBico":[8,12,0,0],"DistanciaPercorrida":[30.785195830341259],"ProgressoTrajeto":2.3072893634878175,"ProgressoRua":0.0,"DistanciaEsquerda":0.0,"DistanciaDireita":0.0,"Status":1,"AnguloCarro":333.902355288222,"AnguloCarroBussola":0.0,"AnguloRua":333.80228575854244,"AnguloRuaCamera":0.0,"AnguloDif":-0.20250680032802393,"Direcao":0,"DentroDaRua":true,"IdxPontoAproximadoRua":7,"IdxRuaAtual":0}]

View File

@ -0,0 +1 @@
[{"Latitude":-22.339442335994335,"Longitude":-47.264067138109773,"DataHora":"2024-03-26T10:50:28.7866891-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339442335994335,"Longitude":-47.264067138109773,"DataHora":"2024-03-26T10:50:33.8269887-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339566770425247,"Longitude":-47.263998524140789,"DataHora":"2024-03-26T10:50:38.8078265-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339649665078522,"Longitude":-47.263954035496013,"DataHora":"2024-03-26T10:50:43.8187563-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339689742622607,"Longitude":-47.26393281077209,"DataHora":"2024-03-26T10:50:44.8171543-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339725742622608,"Longitude":-47.263923810772091,"DataHora":"2024-03-26T10:50:46.8111612-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0}]

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
[{"Latitude":-22.339725742622608,"Longitude":-47.263923810772091,"DataHora":"2024-03-26T10:51:29.0566331-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339725742622608,"Longitude":-47.263923810772091,"DataHora":"2024-03-26T10:51:34.0689148-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339797742622608,"Longitude":-47.263905810772087,"DataHora":"2024-03-26T10:51:39.0975986-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339797742622608,"Longitude":-47.263905810772087,"DataHora":"2024-03-26T10:51:44.1066161-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339797742622608,"Longitude":-47.263905810772087,"DataHora":"2024-03-26T10:51:49.1272271-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339797742622608,"Longitude":-47.263905810772087,"DataHora":"2024-03-26T10:51:54.1781588-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339797742622608,"Longitude":-47.263905810772087,"DataHora":"2024-03-26T10:51:59.2173757-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339797742622608,"Longitude":-47.263905810772087,"DataHora":"2024-03-26T10:52:04.2585268-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339797742622608,"Longitude":-47.263905810772087,"DataHora":"2024-03-26T10:52:08.2814039-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0}]

View File

@ -0,0 +1 @@
[{"Momento":"2024-03-26T10:52:20.6320622-03:00","ErvasNoRadar":1,"VelocidadeMedia":0.0,"HerbicidaConsumido":0.0,"HerbicidaPorErva":0.0,"PorcentagemBateria":0.0,"BateriaConsumida":0.0,"ErvasIdentificadas":0,"AtuacoesPorBico":[0,0,0,0],"DistanciaPercorrida":[],"ProgressoTrajeto":0.0,"ProgressoRua":0.0,"DistanciaEsquerda":0.0,"DistanciaDireita":0.0,"Status":2,"AnguloCarro":0.0,"AnguloCarroBussola":0.0,"AnguloRua":333.85247665632448,"AnguloRuaCamera":0.0,"AnguloDif":0.0,"Direcao":0,"DentroDaRua":false,"IdxPontoAproximadoRua":8,"IdxRuaAtual":0},{"Momento":"2024-03-26T10:52:25.6324458-03:00","ErvasNoRadar":2,"VelocidadeMedia":0.0,"HerbicidaConsumido":0.0,"HerbicidaPorErva":0.0,"PorcentagemBateria":0.0,"BateriaConsumida":0.0,"ErvasIdentificadas":27,"AtuacoesPorBico":[0,0,11,16],"DistanciaPercorrida":[],"ProgressoTrajeto":0.0,"ProgressoRua":0.0,"DistanciaEsquerda":0.0,"DistanciaDireita":0.0,"Status":3,"AnguloCarro":0.0,"AnguloCarroBussola":0.0,"AnguloRua":333.85247665632448,"AnguloRuaCamera":0.0,"AnguloDif":0.0,"Direcao":0,"DentroDaRua":false,"IdxPontoAproximadoRua":8,"IdxRuaAtual":0},{"Momento":"2024-03-26T10:52:30.6462856-03:00","ErvasNoRadar":0,"VelocidadeMedia":0.0,"HerbicidaConsumido":0.0,"HerbicidaPorErva":0.0,"PorcentagemBateria":0.0,"BateriaConsumida":0.0,"ErvasIdentificadas":31,"AtuacoesPorBico":[0,0,13,18],"DistanciaPercorrida":[0.0],"ProgressoTrajeto":0.0,"ProgressoRua":0.0,"DistanciaEsquerda":0.0,"DistanciaDireita":0.0,"Status":3,"AnguloCarro":0.0,"AnguloCarroBussola":0.0,"AnguloRua":333.85247665632448,"AnguloRuaCamera":0.0,"AnguloDif":0.0,"Direcao":0,"DentroDaRua":false,"IdxPontoAproximadoRua":8,"IdxRuaAtual":0},{"Momento":"2024-03-26T10:52:32.0700982-03:00","ErvasNoRadar":0,"VelocidadeMedia":0.0,"HerbicidaConsumido":0.0,"HerbicidaPorErva":0.0,"PorcentagemBateria":0.0,"BateriaConsumida":0.0,"ErvasIdentificadas":31,"AtuacoesPorBico":[0,0,13,18],"DistanciaPercorrida":[0.0],"ProgressoTrajeto":0.0,"ProgressoRua":0.0,"DistanciaEsquerda":0.0,"DistanciaDireita":0.0,"Status":1,"AnguloCarro":0.0,"AnguloCarroBussola":0.0,"AnguloRua":333.85247665632448,"AnguloRuaCamera":0.0,"AnguloDif":0.0,"Direcao":0,"DentroDaRua":false,"IdxPontoAproximadoRua":8,"IdxRuaAtual":0}],{"Momento":"2024-03-26T10:52:38.9429979-03:00","ErvasNoRadar":0,"VelocidadeMedia":0.0,"HerbicidaConsumido":0.0,"HerbicidaPorErva":0.0,"PorcentagemBateria":0.0,"BateriaConsumida":0.0,"ErvasIdentificadas":31,"AtuacoesPorBico":[0,0,13,18],"DistanciaPercorrida":[0.0],"ProgressoTrajeto":0.0,"ProgressoRua":0.0,"DistanciaEsquerda":0.0,"DistanciaDireita":0.0,"Status":1,"AnguloCarro":0.0,"AnguloCarroBussola":0.0,"AnguloRua":333.85247665632448,"AnguloRuaCamera":0.0,"AnguloDif":0.0,"Direcao":0,"DentroDaRua":false,"IdxPontoAproximadoRua":8,"IdxRuaAtual":0}]

View File

@ -0,0 +1 @@
[{"Latitude":-22.339797742622608,"Longitude":-47.263905810772087,"DataHora":"2024-03-26T10:52:20.3392473-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339797742622608,"Longitude":-47.263905810772087,"DataHora":"2024-03-26T10:52:25.3533674-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339797742622608,"Longitude":-47.263905810772087,"DataHora":"2024-03-26T10:52:30.4138294-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339797742622608,"Longitude":-47.263905810772087,"DataHora":"2024-03-26T10:52:31.4063226-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0},{"Latitude":-22.339797742622608,"Longitude":-47.263905810772087,"DataHora":"2024-03-26T10:52:38.4090915-03:00","Altitude":0.0,"Velocidade":0.0,"NumeroSatelites":0,"PrecisaoHorizontal":0.0,"Orientacao":0.0}]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,60 +1,60 @@
[
{
"timestamp": 1710253433.0835092,
"timestamp": 1711461153.3726723,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.1140728,
"timestamp": 1711461153.4061275,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.147628,
"timestamp": 1711461153.4376273,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.1787038,
"timestamp": 1711461153.4692657,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.2102582,
"timestamp": 1711461153.5010042,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.243348,
"timestamp": 1711461153.533227,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.2754176,
"timestamp": 1711461153.5645604,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.3059697,
"timestamp": 1711461153.5972886,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.339527,
"timestamp": 1711461153.629527,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.3721168,
"timestamp": 1711461153.673727,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []

View File

@ -1,60 +1,60 @@
[
{
"timestamp": 1710253433.0749855,
"timestamp": 1711461130.4628296,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.1075525,
"timestamp": 1711461130.4952347,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.1401093,
"timestamp": 1711461130.543707,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.1716878,
"timestamp": 1711461130.5755272,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.2032583,
"timestamp": 1711461130.6068747,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.235827,
"timestamp": 1711461130.6381526,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.282928,
"timestamp": 1711461130.6703184,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.3154922,
"timestamp": 1711461130.7022097,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.3480453,
"timestamp": 1711461130.7363334,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []
},
{
"timestamp": 1710253433.3801246,
"timestamp": 1711461130.766867,
"x_max": 640.0,
"y_max": 480.0,
"objetos": []

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,226 @@
import serial
import time
import threading
import sys
import json
import uuid
import paho.mqtt.client as mqtt
mqtt_client = mqtt.Client(f"client_pzem_{uuid.uuid4()}")
mqtt_client.connect("localhost", port=1883)
mqtt_topic = sys.argv[1]
# Configuração da porta serial
porta_serial = 'COM14' # Substitua '/dev/ttyUSB0' pelo nome da porta serial correta no seu sistema
baud_rate = 9600
timeout = 2 # Tempo de espera para a resposta
CodigosFuncoes = {
"LeituraParametro": 0x3,
"AquisicaoDados": 0x04,
"GravacaoParametro": 0x06,
"ResetEnergia": 0x42,
}
Parametros = {
"AlarmeTensaoMaxima": 0x0000,
"AlarmeTensaoMinima": 0x0001,
"EnderecoRTU": 0x0002,
"EscalaCorrenteAtual": 0x0003,
}
slave_address = 0x01
# Inicialização da porta serial
ser = serial.Serial(porta_serial, baud_rate, timeout=timeout)
# Função para calcular o CRC16 de um comando
def crc16(data: bytes):
crc = 0xFFFF
for pos in data:
crc ^= pos
for i in range(8):
if (crc & 1) != 0:
crc >>= 1
crc ^= 0xA001
else:
crc >>= 1
return crc.to_bytes(2, byteorder='little')
def verificar_crc(resposta_hex):
resposta_bytes = bytes.fromhex(resposta_hex)
crc_recebido = resposta_bytes[-2:]
crc_calculado = crc16(resposta_bytes[:-2])
return crc_recebido == crc_calculado
# Monta o comando para ler os registros
def comando_aquisicao_dados():
function_code = CodigosFuncoes["AquisicaoDados"]
start_address = 0x0000
num_of_registers = 0x0008
command = bytearray([slave_address, function_code]) + start_address.to_bytes(2, byteorder='big') + num_of_registers.to_bytes(2, byteorder='big')
command += crc16(command)
return command
def decifrar_resposta_aquisicao(resposta):
resposta = resposta.hex()
# Certifique-se de que a resposta é do tipo bytes
if isinstance(resposta, str):
resposta = bytes.fromhex(resposta)
# Verifica o comprimento da resposta e o código da função
if len(resposta) >= 5 and resposta[1] == CodigosFuncoes["AquisicaoDados"]:
# Extrai o número de bytes de dados
num_bytes = resposta[2]
if num_bytes == 16: # Se o número de bytes de dados for 16
# Decodificação de tensão, corrente, potência e energia
tensao_raw = int.from_bytes(resposta[3:5], byteorder='big')
corrente_raw = int.from_bytes(resposta[5:7], byteorder='big')
potencia_raw = int.from_bytes(resposta[7:11], byteorder='big') # 4 bytes para potência
energia_raw = int.from_bytes(resposta[11:15], byteorder='big') # 4 bytes para energia
high_alarm_raw = resposta[15]
low_alarm_raw = resposta[16]
# Conversões (ajuste conforme necessário)
tensao = tensao_raw * 0.01
corrente = corrente_raw * 0.01
potencia = potencia_raw * 0.1
energia = energia_raw * 1
# Decodificação dos estados de alarme
alarme_alta_tensao = "Ativo" if high_alarm_raw == 0xFFFF else "Não Ativo"
alarme_baixa_tensao = "Ativo" if low_alarm_raw == 0xFFFF else "Não Ativo"
# Retorno formatado com todos os valores
resultado = {
"Tensão": f"{tensao} V",
"Corrente": f"{corrente} A",
"Potência": f"{potencia} W",
"Energia": f"{energia} Wh",
"Alarme de Alta Tensão": alarme_alta_tensao,
"Alarme de Baixa Tensão": alarme_baixa_tensao
}
mqtt_client.publish(mqtt_topic, json.dumps(resultado).encode('utf-8'))
else:
print("Número de bytes de dados não esperado.")
else:
print("Resposta inválida ou código de função incorreto.")
return None
def comando_set_parametro(Parametro, valor):
# Convertendo o valor de tensão para o formato correto (LSB = 0.01V)
valor_int = int(valor * 100) # Convertendo para inteiro conforme a resolução
function_code = CodigosFuncoes["GravacaoParametro"]
register_address = Parametro
# Construindo o comando
command = bytearray([slave_address, function_code]) + register_address.to_bytes(2, byteorder='big') + valor_int.to_bytes(2, byteorder='big')
# Adicionando o CRC ao comando
command += crc16(command)
return command
def comando_get_parametro(Parametro):
function_code = CodigosFuncoes["LeituraParametro"]
register_address = Parametro
number_of_registers = 0x0001 # Lendo apenas um registro
# Construindo o comando
command = bytearray([slave_address, function_code]) + register_address.to_bytes(2, byteorder='big') + number_of_registers.to_bytes(2, byteorder='big')
# Adicionando o CRC ao comando
command += crc16(command)
return command
def decifrar_resposta_get_parametro(resposta_hex):
# Primeiro, verifique se a resposta é válida verificando o CRC
if not verificar_crc(resposta_hex):
return "CRC inválido. A resposta pode estar corrompida."
# Converte a parte dos dados da resposta de hex para decimal
valor_hex = resposta_hex[6:10]
valor_decimal = int(valor_hex, 16)
# Converte o valor para a unidade correta (LSB = 0.01V)
valor_unidade = valor_decimal * 0.01
return valor_unidade
def comando_reset_energia():
# Código de função específico para reset de energia
function_code = CodigosFuncoes["ResetEnergia"]
# Construindo o comando
command = bytearray([slave_address, function_code])
# Adicionando o CRC ao comando
command += crc16(command)
return command
def comando_calibragem():
# Bytes fixos para o comando de calibragem
bytes_comando = bytearray([0xF8, 0x41, 0x37, 0x21])
# Calculando o CRC para os bytes do comando
crc = crc16(bytes_comando)
# Adicionando o CRC ao comando
comando_calibragem = bytes_comando + crc
return comando_calibragem
def enviar_comando(comando):
ser.write(comando)
time.sleep(0.1) # Pequena pausa para garantir o envio
resposta = ser.read(ser.inWaiting()) # Lê todos os dados disponíveis na porta
return resposta
def main():
comando = comando_aquisicao_dados()
enviar_comando(comando_calibragem())
time.sleep(5)
#com_set = comando_set_parametro(Parametros["EscalaCorrenteAtual"], 0)
#enviar_comando(com_set)
#time.sleep(1)
#vmax = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["AlarmeTensaoMaxima"])).hex())
#vmin = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["AlarmeTensaoMinima"])).hex())
#addr = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["EnderecoRTU"])).hex())
#rang = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["EscalaCorrenteAtual"])).hex())
#print(f"Alarme tensao maxima: {vmax}")
#print(f"Alarme tensao minima: {vmin}")
#print(f"Endereco RTU: {addr}")
#print(f"Escala de corrente: {rang}")
try:
while True:
resposta = enviar_comando(comando)
try:
decifrar_resposta_aquisicao(resposta)
except:
print("Erro ao decodificar mensagem: " + resposta.hex())
#time.sleep(1) # Espera 1 segundo antes da próxima leitura
except KeyboardInterrupt:
print("Programa encerrado pelo usuário")
finally:
ser.close()
# Esta função é para confirmar que script está pronto para execução
def send_script_ready():
mqtt_client.publish(mqtt_topic, "OK")
if __name__ == "__main__":
# Cria trhead separada para informar que o script iniciou com sucesso
mqtt_thread = threading.Thread(target=send_script_ready)
mqtt_thread.start()
main()

View File

@ -19,7 +19,7 @@ mqtt_client.connect("localhost", port=1883)
json_reading_data = None
output_folder = 'Python/Output/'
model_folder = 'C:\\train\\DeepLabV3Plus-Pytorch\\'
model_folder = 'C:\\ZendionINC\\agrobot_base\\Treinamento\\models\\ruas\\'
max_readings = int(sys.argv[1])
port = sys.argv[2]
url = sys.argv[3]

View File

@ -13,9 +13,9 @@ mqtt_client = mqtt.Client(f"client_weed_detector_{uuid.uuid4()}")
mqtt_client.connect("localhost", port=1883)
# Adiciona as configurações do modelo YOLO
model_config = 'C:\\train\\models\\ervas\\ervas.cfg'
model_weights = 'C:\\train\\models\\ervas\\backup\\ervas_final.weights'
labels_path = 'C:\\train\\models\\ervas\\labels.txt'
model_config = 'C:\\ZendionINC\\agrobot_base\\Treinamento\\models\\ervas\\ervas.cfg'
model_weights = 'C:\\ZendionINC\\agrobot_base\\Treinamento\\models\\ervas\\backup\\ervas_final.weights'
labels_path = 'C:\\ZendionINC\\agrobot_base\\Treinamento\\models\\ervas\\labels.txt'
# Carregar as classes
with open(labels_path, 'rt') as f:

View File

@ -1 +1 @@
{"Conectado":false,"QuantidadeBicos":4,"DensidadeHerbicida":1.1,"CapacidadeReservatorio":30.0,"AtuacaoNivelAlto":true,"BicosPulverizadores":[{"ID":"B01","Posicao":1,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B02","Posicao":2,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B03","Posicao":3,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B04","Posicao":4,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B05","Posicao":5,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B06","Posicao":6,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B07","Posicao":7,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B08","Posicao":8,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B09","Posicao":9,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B10","Posicao":10,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0}],"Sensores":[{"LogGrafico":[],"ID":"FLXLN","Prioridade":10,"Descricao":"Fluxo na linha principal","Componente":198,"Aferir":false,"DelayAmostragem":200,"Inicializado":false,"Testando":false,"Funcoes":[25],"Parametros":[["Calibragem","00450"]],"UnidadeMedida":"L/m","Leituras":[0.0,0.0],"ValorMinimo":0.0,"ValorMaximo":26.67,"LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"MASRS","Prioridade":3,"Descricao":"Massa do reservatório de herbicida","Componente":532,"Aferir":false,"DelayAmostragem":1000,"Inicializado":false,"Testando":false,"Funcoes":[22,23],"Parametros":[],"UnidadeMedida":"Kg","Leituras":[0.0],"ValorMinimo":0.0,"ValorMaximo":1.0,"LimiteMaximo":25.0,"LimiteMinimo":3.0},{"LogGrafico":[],"ID":"PRSLN","Prioridade":3,"Descricao":"Pressão na linha principal","Componente":333,"Aferir":false,"DelayAmostragem":1000,"Inicializado":false,"Testando":false,"Funcoes":[24],"Parametros":[],"UnidadeMedida":"psi","Leituras":[0.22,190.0],"ValorMinimo":0.0,"ValorMaximo":0.77,"LimiteMaximo":0.0,"LimiteMinimo":0.0}],"PercentualInicioPulverizacao":0.35,"MassaReservatorio":0.0,"VolumeReservatorio":0.0,"PercentualReservatorio":0.0,"MediaNivelFluxo":0.01,"PressaoLinha":0.22}
{"Conectado":false,"QuantidadeBicos":4,"DensidadeHerbicida":1.0473705439684133,"CapacidadeReservatorio":30.0,"AtuacaoNivelAlto":true,"BicosPulverizadores":[{"ID":"B01","Posicao":1,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":13.43999906834482},{"ID":"B02","Posicao":2,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":8.7743276142532789},{"ID":"B03","Posicao":3,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":8.7743276142532789},{"ID":"B04","Posicao":4,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":6.54738843715332},{"ID":"B05","Posicao":5,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B06","Posicao":6,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B07","Posicao":7,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B08","Posicao":8,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B09","Posicao":9,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0},{"ID":"B10","Posicao":10,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21],"StatusBico":false,"MediaNivelFluxo":0.0}],"BombaPressurizadora":{"ID":"BOMBA","BombaAtuada":false,"Ligado":true,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[14,35,36,37,5],"PressaoSP":120.0,"Pressao":101.53,"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":1820.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":[1196478.5],"ValorMinimo":0.0,"ValorMaximo":2015214.5,"LimiteMaximo":50.0,"LimiteMinimo":5.0},{"LogGrafico":[],"ID":"PRSLN","Prioridade":3,"Descricao":"Pressão na linha principal","Componente":333,"Aferir":true,"DelayAmostragem":1000,"Inicializado":false,"Testando":false,"Funcoes":[24],"Parametros":[["Vmin","000.00"],["Vmax","004.50"],["Pmax","174.04"]],"UnidadeMedida":"psi","Leituras":[101.53],"ValorMinimo":0.0,"ValorMaximo":127.63,"LimiteMaximo":120.0,"LimiteMinimo":60.0}],"PercentualInicioPulverizacao":0.3,"_MassaRef":0.8,"_MassaLeituraRef":40876.37,"_MassaLeituraExtra":1895800.0,"_MassaLeitura":1196478.5,"MassaReservatorio":13.686567569478406,"VolumeReservatorio":13.067550589709125,"PercentualReservatorio":43.558501965697083,"VolumeVazaoAferido":102.0,"_FluxoMlRef":102.0,"_FluxoPulsoRef":80.0,"_LeituraPulsos":0,"_LeituraPeriodo":0,"VazaoFluxoMLpS":0.0,"VolumeVazaoML":27669.860995913026,"_PressaoVmin":0.0,"_PressaoVmax":4.5,"_PressaoMax":174.045,"_LeituraPressao":3257.0,"PressaoLinha":101.53,"PressaoLinhaCalc":101.51420781440781}

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
[{"Tipo":0,"Pino":99,"Descricao":"1","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":98,"Descricao":"2","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":97,"Descricao":"3","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":4,"Descricao":"4","Funcao":21,"Habilitado":true,"ComponenteID":"B01"},{"Tipo":0,"Pino":5,"Descricao":"5","Funcao":21,"Habilitado":true,"ComponenteID":"B02"},{"Tipo":0,"Pino":6,"Descricao":"6","Funcao":21,"Habilitado":true,"ComponenteID":"B03"},{"Tipo":0,"Pino":7,"Descricao":"7","Funcao":21,"Habilitado":true,"ComponenteID":"B04"},{"Tipo":0,"Pino":15,"Descricao":"8","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":16,"Descricao":"9","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":17,"Descricao":"10","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":18,"Descricao":"11","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":8,"Descricao":"12","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":3,"Descricao":"13","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":46,"Descricao":"14","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":9,"Descricao":"15","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":10,"Descricao":"16","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":11,"Descricao":"17","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":12,"Descricao":"18","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":13,"Descricao":"19","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":14,"Descricao":"20","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":96,"Descricao":"21","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":95,"Descricao":"22","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":94,"Descricao":"23","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":93,"Descricao":"24","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":19,"Descricao":"25","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":20,"Descricao":"26","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":21,"Descricao":"27","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":47,"Descricao":"28","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":48,"Descricao":"29","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":45,"Descricao":"30","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":0,"Descricao":"31","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":35,"Descricao":"32","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":36,"Descricao":"33","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":37,"Descricao":"34","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":38,"Descricao":"35","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":39,"Descricao":"36","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":40,"Descricao":"37","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":41,"Descricao":"38","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":42,"Descricao":"39","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":2,"Descricao":"40","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":1,"Descricao":"41","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":44,"Descricao":"42","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":43,"Descricao":"43","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":92,"Descricao":"44","Funcao":0,"Habilitado":false,"ComponenteID":""}]
[{"Tipo":0,"Pino":99,"Descricao":"1","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":98,"Descricao":"2","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":97,"Descricao":"3","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":4,"Descricao":"4","Funcao":22,"Habilitado":true,"ComponenteID":"MASRS"},{"Tipo":0,"Pino":5,"Descricao":"5","Funcao":23,"Habilitado":true,"ComponenteID":"MASRS"},{"Tipo":0,"Pino":6,"Descricao":"6","Funcao":24,"Habilitado":true,"ComponenteID":"PRSLN"},{"Tipo":0,"Pino":7,"Descricao":"7","Funcao":25,"Habilitado":true,"ComponenteID":"FLXLN"},{"Tipo":0,"Pino":15,"Descricao":"8","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":16,"Descricao":"9","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":17,"Descricao":"10","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":18,"Descricao":"11","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":8,"Descricao":"12","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":3,"Descricao":"13","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":46,"Descricao":"14","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":9,"Descricao":"15","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":10,"Descricao":"16","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":11,"Descricao":"17","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":12,"Descricao":"18","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":13,"Descricao":"19","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":14,"Descricao":"20","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":96,"Descricao":"21","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":95,"Descricao":"22","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":94,"Descricao":"23","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":93,"Descricao":"24","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":19,"Descricao":"25","Funcao":21,"Habilitado":true,"ComponenteID":"B01"},{"Tipo":0,"Pino":20,"Descricao":"26","Funcao":21,"Habilitado":true,"ComponenteID":"B02"},{"Tipo":0,"Pino":21,"Descricao":"27","Funcao":21,"Habilitado":true,"ComponenteID":"B03"},{"Tipo":0,"Pino":47,"Descricao":"28","Funcao":21,"Habilitado":true,"ComponenteID":"B04"},{"Tipo":0,"Pino":48,"Descricao":"29","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":45,"Descricao":"30","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":0,"Descricao":"31","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":35,"Descricao":"32","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":36,"Descricao":"33","Funcao":35,"Habilitado":true,"ComponenteID":"BOMBA"},{"Tipo":0,"Pino":37,"Descricao":"34","Funcao":37,"Habilitado":true,"ComponenteID":"BOMBA"},{"Tipo":0,"Pino":38,"Descricao":"35","Funcao":36,"Habilitado":true,"ComponenteID":"BOMBA"},{"Tipo":0,"Pino":39,"Descricao":"36","Funcao":5,"Habilitado":true,"ComponenteID":"BOMBA"},{"Tipo":0,"Pino":40,"Descricao":"37","Funcao":14,"Habilitado":true,"ComponenteID":"BOMBA"},{"Tipo":0,"Pino":41,"Descricao":"38","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":42,"Descricao":"39","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":2,"Descricao":"40","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":1,"Descricao":"41","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":44,"Descricao":"42","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":43,"Descricao":"43","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":92,"Descricao":"44","Funcao":0,"Habilitado":false,"ComponenteID":""}]

View File

@ -1 +1 @@
[{"Tipo":0,"Pino":99,"Descricao":"1","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":98,"Descricao":"2","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":97,"Descricao":"3","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":4,"Descricao":"4","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":5,"Descricao":"5","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":6,"Descricao":"6","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":7,"Descricao":"7","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":15,"Descricao":"8","Funcao":12,"Habilitado":true,"ComponenteID":"TBAT"},{"Tipo":0,"Pino":16,"Descricao":"9","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":17,"Descricao":"10","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":18,"Descricao":"11","Funcao":12,"Habilitado":true,"ComponenteID":"TMVET"},{"Tipo":0,"Pino":8,"Descricao":"12","Funcao":12,"Habilitado":true,"ComponenteID":"TMVEF"},{"Tipo":0,"Pino":3,"Descricao":"13","Funcao":12,"Habilitado":true,"ComponenteID":"TMVDT"},{"Tipo":0,"Pino":46,"Descricao":"14","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":9,"Descricao":"15","Funcao":12,"Habilitado":true,"ComponenteID":"TMVDF"},{"Tipo":0,"Pino":10,"Descricao":"16","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":11,"Descricao":"17","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":12,"Descricao":"18","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":13,"Descricao":"19","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":14,"Descricao":"20","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":96,"Descricao":"21","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":95,"Descricao":"22","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":94,"Descricao":"23","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":93,"Descricao":"24","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":19,"Descricao":"25","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":20,"Descricao":"26","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":21,"Descricao":"27","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":47,"Descricao":"28","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":48,"Descricao":"29","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":45,"Descricao":"30","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":0,"Descricao":"31","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":35,"Descricao":"32","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":36,"Descricao":"33","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":37,"Descricao":"34","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":38,"Descricao":"35","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":39,"Descricao":"36","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":40,"Descricao":"37","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":41,"Descricao":"38","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":42,"Descricao":"39","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":2,"Descricao":"40","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":1,"Descricao":"41","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":0,"Pino":44,"Descricao":"42","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":43,"Descricao":"43","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":0,"Pino":92,"Descricao":"44","Funcao":0,"Habilitado":false,"ComponenteID":""}]
[{"Tipo":1,"Pino":99,"Descricao":"1","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":1,"Pino":98,"Descricao":"2","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":1,"Pino":36,"Descricao":"3","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":39,"Descricao":"4","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":34,"Descricao":"5","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":35,"Descricao":"6","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":32,"Descricao":"7","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":33,"Descricao":"8","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":25,"Descricao":"9","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":26,"Descricao":"10","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":27,"Descricao":"11","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":14,"Descricao":"12","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":12,"Descricao":"13","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":97,"Descricao":"14","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":1,"Pino":13,"Descricao":"15","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":9,"Descricao":"16","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":1,"Pino":10,"Descricao":"17","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":1,"Pino":11,"Descricao":"18","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":1,"Pino":96,"Descricao":"19","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":1,"Pino":6,"Descricao":"26","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":1,"Pino":7,"Descricao":"27","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":1,"Pino":8,"Descricao":"28","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":1,"Pino":15,"Descricao":"29","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":2,"Descricao":"30","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":0,"Descricao":"31","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":4,"Descricao":"32","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":16,"Descricao":"33","Funcao":12,"Habilitado":true,"ComponenteID":"TMVET"},{"Tipo":1,"Pino":17,"Descricao":"34","Funcao":12,"Habilitado":true,"ComponenteID":"TMVEF"},{"Tipo":1,"Pino":5,"Descricao":"35","Funcao":12,"Habilitado":true,"ComponenteID":"TMVDT"},{"Tipo":1,"Pino":18,"Descricao":"36","Funcao":12,"Habilitado":true,"ComponenteID":"TMVDF"},{"Tipo":1,"Pino":19,"Descricao":"37","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":95,"Descricao":"38","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":1,"Pino":21,"Descricao":"39","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":3,"Descricao":"40","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":1,"Pino":1,"Descricao":"41","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Tipo":1,"Pino":22,"Descricao":"42","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":23,"Descricao":"43","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":94,"Descricao":"44","Funcao":0,"Habilitado":false,"ComponenteID":""}]

View File

@ -1 +1 @@
bfc8de38622af1aa7681cfcdebacc9ef0ae324878809f2475643f97d2fcf216f
953f8999a754e37f88b27d67ffc351a97b4df4f97b143b09fc5a17239fb13cff

View File

@ -390,7 +390,6 @@ C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.Sensoriame
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Properties.Resources.resources
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.csproj.GenerateResource.cache
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.csproj.CoreCompileInputs.cache
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.csproj.CopyComplete
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.exe
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.pdb
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\Python\Output\folium\all.min.css
@ -408,3 +407,6 @@ C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\Python\Output\fonts\glyph
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\Python\Output\fonts\glyphicons-halflings-regular.woff
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\MQTTnet.dll
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\Python\Output\folium\mqtt.min.js
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.csproj.Up2Date
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\bin\Debug\Python\Scripts\pzem.py
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.Atuador.frmAtuCalibragem.resources

Binary file not shown.

208
Exemplos/pzem.py Normal file
View File

@ -0,0 +1,208 @@
import serial
import time
# Configuração da porta serial
porta_serial = 'COM14' # Substitua '/dev/ttyUSB0' pelo nome da porta serial correta no seu sistema
baud_rate = 9600
timeout = 2 # Tempo de espera para a resposta
CodigosFuncoes = {
"LeituraParametro": 0x3,
"AquisicaoDados": 0x04,
"GravacaoParametro": 0x06,
"ResetEnergia": 0x42,
}
Parametros = {
"AlarmeTensaoMaxima": 0x0000,
"AlarmeTensaoMinima": 0x0001,
"EnderecoRTU": 0x0002,
"EscalaCorrenteAtual": 0x0003,
}
slave_address = 0x01
# Inicialização da porta serial
ser = serial.Serial(porta_serial, baud_rate, timeout=timeout)
# Função para calcular o CRC16 de um comando
def crc16(data: bytes):
crc = 0xFFFF
for pos in data:
crc ^= pos
for i in range(8):
if (crc & 1) != 0:
crc >>= 1
crc ^= 0xA001
else:
crc >>= 1
return crc.to_bytes(2, byteorder='little')
def verificar_crc(resposta_hex):
resposta_bytes = bytes.fromhex(resposta_hex)
crc_recebido = resposta_bytes[-2:]
crc_calculado = crc16(resposta_bytes[:-2])
return crc_recebido == crc_calculado
# Monta o comando para ler os registros
def comando_aquisicao_dados():
function_code = CodigosFuncoes["AquisicaoDados"]
start_address = 0x0000
num_of_registers = 0x0008
command = bytearray([slave_address, function_code]) + start_address.to_bytes(2, byteorder='big') + num_of_registers.to_bytes(2, byteorder='big')
command += crc16(command)
return command
def decifrar_resposta_aquisicao(resposta):
resposta = resposta.hex()
# Certifique-se de que a resposta é do tipo bytes
if isinstance(resposta, str):
resposta = bytes.fromhex(resposta)
# Verifica o comprimento da resposta e o código da função
if len(resposta) >= 5 and resposta[1] == CodigosFuncoes["AquisicaoDados"]:
# Extrai o número de bytes de dados
num_bytes = resposta[2]
if num_bytes == 16: # Se o número de bytes de dados for 16
# Decodificação de tensão, corrente, potência e energia
tensao_raw = int.from_bytes(resposta[3:5], byteorder='big')
corrente_raw = int.from_bytes(resposta[5:7], byteorder='big')
potencia_raw = int.from_bytes(resposta[7:11], byteorder='big') # 4 bytes para potência
energia_raw = int.from_bytes(resposta[11:15], byteorder='big') # 4 bytes para energia
high_alarm_raw = resposta[15]
low_alarm_raw = resposta[16]
# Conversões (ajuste conforme necessário)
tensao = tensao_raw * 0.01
corrente = corrente_raw * 0.01
potencia = potencia_raw * 0.1
energia = energia_raw * 1
# Decodificação dos estados de alarme
alarme_alta_tensao = "Ativo" if high_alarm_raw == 0xFFFF else "Não Ativo"
alarme_baixa_tensao = "Ativo" if low_alarm_raw == 0xFFFF else "Não Ativo"
# Retorno formatado com todos os valores
resultado = {
"Tensão": f"{tensao} V",
"Corrente": f"{corrente} A",
"Potência": f"{potencia} W",
"Energia": f"{energia} Wh",
"Alarme de Alta Tensão": alarme_alta_tensao,
"Alarme de Baixa Tensão": alarme_baixa_tensao
}
print(resultado)
else:
print("Número de bytes de dados não esperado.")
else:
print("Resposta inválida ou código de função incorreto.")
return None
def comando_set_parametro(Parametro, valor):
# Convertendo o valor de tensão para o formato correto (LSB = 0.01V)
valor_int = int(valor * 100) # Convertendo para inteiro conforme a resolução
function_code = CodigosFuncoes["GravacaoParametro"]
register_address = Parametro
# Construindo o comando
command = bytearray([slave_address, function_code]) + register_address.to_bytes(2, byteorder='big') + valor_int.to_bytes(2, byteorder='big')
# Adicionando o CRC ao comando
command += crc16(command)
return command
def comando_get_parametro(Parametro):
function_code = CodigosFuncoes["LeituraParametro"]
register_address = Parametro
number_of_registers = 0x0001 # Lendo apenas um registro
# Construindo o comando
command = bytearray([slave_address, function_code]) + register_address.to_bytes(2, byteorder='big') + number_of_registers.to_bytes(2, byteorder='big')
# Adicionando o CRC ao comando
command += crc16(command)
return command
def decifrar_resposta_get_parametro(resposta_hex):
# Primeiro, verifique se a resposta é válida verificando o CRC
if not verificar_crc(resposta_hex):
return "CRC inválido. A resposta pode estar corrompida."
# Converte a parte dos dados da resposta de hex para decimal
valor_hex = resposta_hex[6:10]
valor_decimal = int(valor_hex, 16)
# Converte o valor para a unidade correta (LSB = 0.01V)
valor_unidade = valor_decimal * 0.01
return valor_unidade
def comando_reset_energia():
# Código de função específico para reset de energia
function_code = CodigosFuncoes["ResetEnergia"]
# Construindo o comando
command = bytearray([slave_address, function_code])
# Adicionando o CRC ao comando
command += crc16(command)
return command
def comando_calibragem():
# Bytes fixos para o comando de calibragem
bytes_comando = bytearray([0xF8, 0x41, 0x37, 0x21])
# Calculando o CRC para os bytes do comando
crc = crc16(bytes_comando)
# Adicionando o CRC ao comando
comando_calibragem = bytes_comando + crc
return comando_calibragem
def enviar_comando(comando):
ser.write(comando)
time.sleep(0.1) # Pequena pausa para garantir o envio
resposta = ser.read(ser.inWaiting()) # Lê todos os dados disponíveis na porta
return resposta
def main():
comando = comando_aquisicao_dados()
enviar_comando(comando_calibragem())
time.sleep(5)
#com_set = comando_set_parametro(Parametros["EscalaCorrenteAtual"], 0)
#enviar_comando(com_set)
#time.sleep(1)
vmax = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["AlarmeTensaoMaxima"])).hex())
vmin = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["AlarmeTensaoMinima"])).hex())
addr = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["EnderecoRTU"])).hex())
rang = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["EscalaCorrenteAtual"])).hex())
print(f"Alarme tensao maxima: {vmax}")
print(f"Alarme tensao minima: {vmin}")
print(f"Endereco RTU: {addr}")
print(f"Escala de corrente: {rang}")
try:
while True:
print(comando.hex())
resposta = enviar_comando(comando)
try:
decifrar_resposta_aquisicao(resposta)
except:
print("Erro ao decodificar mensagem: " + resposta.hex())
#time.sleep(1) # Espera 1 segundo antes da próxima leitura
except KeyboardInterrupt:
print("Programa encerrado pelo usuário")
finally:
ser.close()
if __name__ == "__main__":
main()

View File

@ -0,0 +1,8 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
"version": "0.2.0",
"configurations": [
]
}

View File

@ -0,0 +1,890 @@
// Dispositivo: Atuador
// Versão Firmware: 3
// Ultima atualização: 28/03/2024
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\SerialService.h"
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\Utils.h"
#include "HX711.h"
#include <PID_v1.h>
#include <SimpleKalmanFilter.h>
#define D_Code Atu
#define _pinoLED RGB_BUILTIN
long _baudRate = 115200;
bool Conectado = false;
int _TaxaAmostragem = 500;
int BicosAtivos = 10;
bool AtuacaoNivelAlto = true;
static double _PressaoAtual = 0.0;
class BicoPulverizador {
public:
// Construtor
BicoPulverizador(String desc) {
_ID = desc;
}
// Definições
String _ID;
int _posicao;
int _pinoSolenoide;
bool Iniciado = false;
bool Testando = false;
// Consumo
bool StatusBico;
// Entrada de dados
bool _BicoAtuado = !AtuacaoNivelAlto;
void Inicializar() {
if (Iniciado) {
EnviarDadosSerial(_ID + " ja inicializado");
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
return;
}
if (_pinoSolenoide > -1) {
pinMode(_pinoSolenoide, OUTPUT);
_BicoAtuado = !AtuacaoNivelAlto;
digitalWrite(_pinoSolenoide, _BicoAtuado);
StatusBico = digitalRead(_pinoSolenoide) == (AtuacaoNivelAlto ? 1 : 0);
}
xTaskCreatePinnedToCore(&BicoPulverizador::SensorTaskWrapper, "SensorTask", 5000, this, 25 - _posicao, &SensorTaskHandle, tskNO_AFFINITY);
EnviarDadosSerial(_ID + " Iniciado");
Iniciado = true;
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
}
void Desligar() {
if (!Iniciado) {
EnviarDadosSerial(_ID + " nao esta inicializado");
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
return;
}
// Parar a execução das tarefas
vTaskDelete(SensorTaskHandle);
// Redefinir as configurações para os valores iniciais
pinMode(_pinoSolenoide, INPUT);
EnviarDadosSerial(_ID + " Desligado");
Iniciado = false;
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
}
void AlterarStatusBico() {
digitalWrite(_pinoSolenoide, _BicoAtuado);
StatusBico = digitalRead(_pinoSolenoide) == (AtuacaoNivelAlto ? 1 : 0);
}
private:
TaskHandle_t SensorTaskHandle = NULL;
static void SensorTaskWrapper(void *pvParameters) {
BicoPulverizador *bico = static_cast<BicoPulverizador*>(pvParameters);
bico->SensorTask();
}
void SensorTask() {
unsigned long previousMillisLeitura = millis();
while (1)
{
if (!Conectado) {
// Caso não esteja conectado, aguarda 1 segundo até a próxima verificação, liberando uso de CPU
vTaskDelay(1000);
continue;
}
unsigned long currentMillis = millis();
if ((currentMillis - previousMillisLeitura) >= _TaxaAmostragem) {
previousMillisLeitura = currentMillis;
EnviarDadosSerial(MontarProtocoloSensor(sBIC, _ID, MontarDadosProtocoloBicoPulverizador(StatusBico)));
}
vTaskDelay(1);
}
}
};
class BombaPressurizadora {
public:
// Construtor
BombaPressurizadora(String desc) {
_ID = desc;
}
// Definições
String _ID;
int _pinoEN;
int _pinoCS;
int _pinoINA;
int _pinoINB;
int _pinoPWM;
double _Kp = 3.0;
double _Ki = 2.2;
double _Kd = 0.5;
PID* _PID = nullptr;
int ZeroRampa = 0;
int RampaMax = 1023;
bool Iniciado = false;
bool Testando = false;
int _canal = 0;
// Consumo
bool Ligado;
double PotenciaAtual = 0;
// Entrada de dados
double _PressaoSP = 0;
bool _BombaAtuada = false;
void Inicializar() {
if (Iniciado) {
EnviarDadosSerial(_ID + " ja inicializado");
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
return;
}
if (_pinoEN > -1) {
_BombaAtuada = false;
pinMode(_pinoEN, OUTPUT);
digitalWrite(_pinoEN, _BombaAtuada);
Ligado = digitalRead(_pinoEN) == 1;
}
if (_pinoCS > -1) {
pinMode(_pinoEN, INPUT);
}
if (_pinoINA > -1) {
pinMode(_pinoINA, OUTPUT);
digitalWrite(_pinoINA, LOW);
}
if (_pinoINB > -1) {
pinMode(_pinoINB, OUTPUT);
digitalWrite(_pinoINB, HIGH);
}
if (_pinoPWM > -1) {
ledcSetup(_canal, 1000, 10);
ledcAttachPin(_pinoPWM, _canal);
PotenciaAtual = 0;
_PressaoSP = 0;
ledcWrite(_canal, PotenciaAtual);
}
_PID = new PID(&_PressaoAtual, &PotenciaAtual, &_PressaoSP, _Kp, _Ki, _Kd, DIRECT);
_PID->SetOutputLimits(ZeroRampa, RampaMax);
_PID->SetMode(AUTOMATIC);
xTaskCreatePinnedToCore(&BombaPressurizadora::SensorTaskWrapper, "SensorTask", 15000, this, 25, &SensorTaskHandle, tskNO_AFFINITY);
EnviarDadosSerial(_ID + " Iniciado");
Iniciado = true;
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
}
void Desligar() {
if (!Iniciado) {
EnviarDadosSerial(_ID + " nao esta inicializado");
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
return;
}
// Parar a execução das tarefas
vTaskDelete(SensorTaskHandle);
// Desanexar o canal PWM
if (_pinoPWM > -1) {
ledcDetachPin(_pinoPWM);
}
// Redefinir as configurações para os valores iniciais
pinMode(_pinoEN, INPUT);
pinMode(_pinoCS, INPUT);
pinMode(_pinoINA, INPUT);
pinMode(_pinoINB, INPUT);
pinMode(_pinoPWM, INPUT);
// Outras redefinições de variáveis de estado, se necessário
delete _PID;
EnviarDadosSerial(_ID + " Desligado");
Iniciado = false;
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
}
void AlterarStatusBomba() {
digitalWrite(_pinoEN, _BombaAtuada);
Ligado = digitalRead(_pinoEN) == 1;
}
private:
TaskHandle_t SensorTaskHandle = NULL;
static void SensorTaskWrapper(void *pvParameters) {
BombaPressurizadora *bomba = static_cast<BombaPressurizadora*>(pvParameters);
bomba->SensorTask();
}
void SensorTask() {
unsigned long previousMillisLeitura = millis();
while (1)
{
if (!Conectado) {
// Caso não esteja conectado, aguarda 1 segundo até a próxima verificação, liberando uso de CPU
vTaskDelay(1000);
continue;
}
if (_BombaAtuada/* && _PressaoAtual < _PressaoSP*/) {
_PID->Compute();
//PotenciaAtual = RampaMax * 0.5;
}
else {
PotenciaAtual = ZeroRampa;
}
ledcWrite(_canal, PotenciaAtual);
unsigned long currentMillis = millis();
if ((currentMillis - previousMillisLeitura) >= _TaxaAmostragem) {
previousMillisLeitura = currentMillis;
AtualizarStatusSensor();
}
vTaskDelay(1);
}
}
void AtualizarStatusSensor() {
Ligado = digitalRead(_pinoEN) == 1;
float PercentualPotencia = (PotenciaAtual / RampaMax) * 100;
EnviarDadosSerial(MontarProtocoloSensor(sBMB, _ID, MontarDadosProtocoloBombaPressurizadora(Ligado, PercentualPotencia)));
}
};
class SensorFluxo {
public:
SensorFluxo(String desc) {
_ID = desc;
}
// Definições
String _ID;
S_Code _componente = sFLX;
int _pino;
int _delayAmostragem;
int _prioridade;
float _calibragem;
bool Iniciado = false;
// Consumo
volatile int ultimaLeitura = 0;
volatile unsigned int tempoAnterior = 0;
void Inicializar() {
if (Iniciado) {
EnviarDadosSerial(_ID + " ja inicializado");
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
return;
}
if (_pino > -1) {
pinMode(_pino, INPUT);
ultimaLeitura = digitalRead(_pino);
tempoAnterior = 0;
}
xTaskCreatePinnedToCore(&SensorFluxo::SFTaskWrapper, "SFTask", 10000, this, _prioridade, &SFTaskHandle, tskNO_AFFINITY);
EnviarDadosSerial(_ID + " Iniciado");
Iniciado = true;
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
}
void Desligar() {
if (!Iniciado) {
EnviarDadosSerial(_ID + " nao esta inicializado");
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
return;
}
// Parar a execução das tarefas
vTaskDelete(SFTaskHandle);
// Redefinir as configurações para os valores iniciais
pinMode(_pino, INPUT);
EnviarDadosSerial(_ID + " Desligado");
Iniciado = false;
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
}
private:
TaskHandle_t SFTaskHandle = NULL;
static void SFTaskWrapper(void *pvParameters) {
SensorFluxo *sensor = static_cast<SensorFluxo*>(pvParameters);
sensor->SFTask();
}
void SFTask() {
unsigned long firstMilis = millis();
volatile int pulsos = 0;
volatile int pulsosA = 0;
volatile float periodo = 0;
volatile float periodoTotal = 0;
while (1)
{
if (!Conectado) {
// Caso não esteja conectado, aguarda 1 segundo até a próxima verificação, liberando uso de CPU
vTaskDelay(1000);
continue;
}
bool Leitura = digitalRead(_pino) == 1;
if (Leitura != ultimaLeitura) {
ultimaLeitura = Leitura;
pulsos++;
// Calcular o período em microssegundos
unsigned long tempoAtual = micros();
unsigned long periodoUs = pulsos == 1 ? 0 : (tempoAtual - tempoAnterior);
periodo = periodoUs / 1000.0; // Converte de us para ms (2300 us para 2,3 ms)
periodoTotal += periodo;
//CalcularFluxo(periodo);
tempoAnterior = tempoAtual;
}
long intMillis = (millis() - firstMilis);
int Tempo = _TaxaAmostragem + _delayAmostragem;
// A cada _TaxaAmostragem, enviar os dados para o software
if (intMillis >= Tempo) {
if (pulsos == pulsosA) {
periodoTotal = 0;
pulsos = 0;
}
EnviarDadosSerial(MontarProtocoloSensor(sFLX, _ID, MontarDadosProtocoloFluxo(pulsos, periodoTotal)));
pulsosA = pulsos;
firstMilis = millis();
}
// Aguarda metade do menor período possível entre leituras
vTaskDelay(1);
}
}
};
class SensorMassa {
public:
SensorMassa(String desc) {
_ID = desc;
}
// Definições
String _ID;
S_Code _componente = sMAS;
int _pinoDT;
int _pinoSCK;
int _delayAmostragem;
int _prioridade;
HX711* balanca = nullptr;
SimpleKalmanFilter* filtro = nullptr;
bool Iniciado = false;
void Inicializar() {
if (Iniciado) {
EnviarDadosSerial(_ID + " ja inicializado");
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
return;
}
if (_pinoDT > -1 && _pinoSCK > -1) {
balanca = new HX711();
filtro = new SimpleKalmanFilter(2, 2, 0.01);
balanca->begin(_pinoDT, _pinoSCK);
balanca->set_scale();
//balanca->tare();
}
xTaskCreatePinnedToCore(&SensorMassa::SMTaskWrapper, "SMTask", 5000, this, _prioridade, &SMTaskHandle, tskNO_AFFINITY);
EnviarDadosSerial(_ID + " Iniciado");
Iniciado = true;
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
}
void Desligar() {
if (!Iniciado) {
EnviarDadosSerial(_ID + " nao esta inicializado");
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
return;
}
delete balanca;
delete filtro;
// Parar a execução das tarefas
vTaskDelete(SMTaskHandle);
// Redefinir as configurações para os valores iniciais
pinMode(_pinoDT, INPUT);
pinMode(_pinoSCK, INPUT);
EnviarDadosSerial(_ID + " Desligado");
Iniciado = false;
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
}
private:
TaskHandle_t SMTaskHandle = NULL;
static void SMTaskWrapper(void *pvParameters) {
SensorMassa *sensor = static_cast<SensorMassa*>(pvParameters);
sensor->SMTask();
}
void SMTask() {
unsigned long firstMilis = millis();
while (1)
{
if (!Conectado) {
// Caso não esteja conectado, aguarda 1 segundo até a próxima verificação, liberando uso de CPU
vTaskDelay(1000);
continue;
}
long intMillis = (millis() - firstMilis);
// A cada _TaxaAmostragem, enviar os dados para o software
if (intMillis >= (_TaxaAmostragem + _delayAmostragem)) {
AferirMassa();
firstMilis = millis();
}
// Aguarda metade do menor período possível entre leituras
vTaskDelay(1);
}
}
void AferirMassa() {
float leitura = balanca->get_units(5);
double leituraNormalizada = filtro->updateEstimate(leitura);
EnviarDadosSerial(MontarProtocoloSensor(sMAS, _ID, MontarDadosProtocoloMassa(leituraNormalizada)));
}
};
class SensorPressao {
public:
SensorPressao(String desc) {
_ID = desc;
}
// Definições
String _ID;
S_Code _componente = sPRS;
int _pino;
int _delayAmostragem;
int _prioridade;
double _Vmin = 0.0;
double _Vmax = 4.5;
double _Pmax = 174.045;
SimpleKalmanFilter* filtro = nullptr;
bool Iniciado = false;
void Inicializar() {
if (Iniciado) {
EnviarDadosSerial(_ID + " ja inicializado");
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
return;
}
if (_pino > -1) {
pinMode(_pino, INPUT);
filtro = new SimpleKalmanFilter(2, 2, 0.01);
}
xTaskCreatePinnedToCore(&SensorPressao::SPTaskWrapper, "SPTask", 5000, this, _prioridade, &SPTaskHandle, tskNO_AFFINITY);
EnviarDadosSerial(_ID + " Iniciado");
Iniciado = true;
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
}
void Desligar() {
if (!Iniciado) {
EnviarDadosSerial(_ID + " nao esta inicializado");
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
return;
}
delete filtro;
// Parar a execução das tarefas
vTaskDelete(SPTaskHandle);
// Redefinir as configurações para os valores iniciais
pinMode(_pino, INPUT);
EnviarDadosSerial(_ID + " Desligado");
Iniciado = false;
EnviarDadosSerial(MontarProtocoloSensor(sCFG, _ID, Iniciado ? "1" : "0"));
}
private:
double leituraNormalizada = 0.0;
TaskHandle_t SPTaskHandle = NULL;
static void SPTaskWrapper(void *pvParameters) {
SensorPressao *sensor = static_cast<SensorPressao*>(pvParameters);
sensor->SPTask();
}
void SPTask() {
unsigned long firstMilis = millis();
while (1)
{
if (!Conectado) {
// Caso não esteja conectado, aguarda 1 segundo até a próxima verificação, liberando uso de CPU
vTaskDelay(1000);
continue;
}
AferirPressao();
long intMillis = (millis() - firstMilis);
// A cada _TaxaAmostragem, enviar os dados para o software
if (intMillis >= (_TaxaAmostragem + _delayAmostragem)) {
EnviarDadosSerial(MontarProtocoloSensor(sPRS, _ID, MontarDadosProtocoloPressao(_PressaoAtual, leituraNormalizada)));
firstMilis = millis();
}
// Aguarda metade do menor período possível entre leituras
vTaskDelay(1);
}
}
void AferirPressao() {
int leitura = analogRead(_pino);
leituraNormalizada = filtro->updateEstimate(leitura);
double tensao = fmap(leituraNormalizada, 0.0, 4095.0, 0.0, 3300.0) / 1000.0;
_PressaoAtual = fmap(tensao, _Vmin, _Vmax, 0.0, _Pmax);
}
};
BicoPulverizador B_01("B01 ");
BicoPulverizador B_02("B02 ");
BicoPulverizador B_03("B03 ");
BicoPulverizador B_04("B04 ");
BicoPulverizador B_05("B05 ");
BicoPulverizador B_06("B06 ");
BicoPulverizador B_07("B07 ");
BicoPulverizador B_08("B08 ");
BicoPulverizador B_09("B09 ");
BicoPulverizador B_10("B10 ");
BombaPressurizadora BOMBA("BOMBA");
SensorFluxo SenFlx("FLXLN");
SensorMassa SenMas("MASRS");
SensorPressao SenPrs("PRSLN");
BicoPulverizador* BicoPorID(String ID) {
BicoPulverizador* _bico =
ID == "B01 " ? &B_01 :
ID == "B02 " ? &B_02 :
ID == "B03 " ? &B_03 :
ID == "B04 " ? &B_04 :
ID == "B05 " ? &B_05 :
ID == "B06 " ? &B_06 :
ID == "B07 " ? &B_07 :
ID == "B08 " ? &B_08 :
ID == "B09 " ? &B_09 :
ID == "B10 " ? &B_10 :
nullptr;
return _bico;
}
BombaPressurizadora* BombaPorID(String ID) {
BombaPressurizadora* _bomba =
ID == "BOMBA" ? &BOMBA :
nullptr;
return _bomba;
}
SensorFluxo* SFPorID(String ID) {
SensorFluxo* _sensor =
ID == "FLXLN" ? &SenFlx :
nullptr;
return _sensor;
}
SensorMassa* SMPorID(String ID) {
SensorMassa* _sensor =
ID == "MASRS" ? &SenMas :
nullptr;
return _sensor;
}
SensorPressao* SPPorID(String ID) {
SensorPressao* _sensor =
ID == "PRSLN" ? &SenPrs :
nullptr;
return _sensor;
}
void ZerarPinos() {
//const int gpios[] = {2, 4, 5, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33};
const int gpios[] = {4, 5, 6, 7, 15, 16, 17, 18, 8, 3, 46, 9, 10, 11, 12, 13, 14, 19, 20, 21, 47, 48, 45, 0, 35, 36, 37, 38, 39, 40, 41, 42, 2, 1};
for (int i = 0; i < sizeof(gpios) / sizeof(gpios[0]); i++) {
pinMode(gpios[i], OUTPUT);
digitalWrite(gpios[i], !AtuacaoNivelAlto);
}
}
void setup() {
Serial.begin(_baudRate);
ZerarPinos();
}
void loop() {
if (Serial.available() > 3) {
String Protocolo = "";
F_Code _funcao = Nda;
while (Serial.available()) {
char Entrada = (char)Serial.read();
if (Entrada == EndLine) {
break;
}
Protocolo += Entrada;
if (Protocolo.length() == 3) {
if (_funcao == Nda) {
_funcao = (F_Code)((String)Protocolo[0] + (String)Protocolo[1] + (String)Protocolo[2]).toInt();
Protocolo = "";
}
}
}
EnviarDadosSerial("OK");
if (_funcao == Chk) {
EnviarDadosSerial(MontarProtocoloVerificacao(D_Code));
}
else if (_funcao == Cfg) {
String ID = ((String)Protocolo[0] + (String)Protocolo[1] + (String)Protocolo[2] + (String)Protocolo[3] + (String)Protocolo[4]);
bool Conectar = (String)Protocolo[6] == "1";
if (ID == "MD ") {
_TaxaAmostragem = ((String)Protocolo[8] + (String)Protocolo[9] + (String)Protocolo[10] + (String)Protocolo[11] + (String)Protocolo[12]).toInt();
int pinoReleGeral = ((String)Protocolo[14] + (String)Protocolo[15]).toInt();
bool _AtuaNivelAlto = (String)Protocolo[17] == "1";
AtuacaoNivelAlto = _AtuaNivelAlto;
vTaskDelay(pdMS_TO_TICKS(100));
Conectado = Conectar;
EnviarDadosSerial(MontarProtocoloSensor(sCFG, "MD ", Conectado ? "1" : "0"));
}
else {
BicoPulverizador* _bico = BicoPorID(ID);
BombaPressurizadora* _bomba = BombaPorID(ID);
if (_bico != nullptr) {
bool bico_ativado = (String)Protocolo[8] == "1";
int posicao = ((String)Protocolo[10] + (String)Protocolo[11]).toInt();
int solenoide = ((String)Protocolo[13] + (String)Protocolo[14]).toInt();
if (bico_ativado) {
if (Conectar) {
_bico->_posicao = posicao;
_bico->_pinoSolenoide = solenoide;
_bico->Inicializar();
}
else {
_bico->Desligar();
}
vTaskDelay(pdMS_TO_TICKS(500));
}
}
else if (_bomba != nullptr) {
bool bomba_ativada = (String)Protocolo[8] == "1";
double pressaoSP = ((String)Protocolo[10] + (String)Protocolo[11] + (String)Protocolo[12]).toDouble();
int pinoEN = ((String)Protocolo[14] + (String)Protocolo[15]).toInt();
int pinoCS = ((String)Protocolo[17] + (String)Protocolo[18]).toInt();
int pinoINA = ((String)Protocolo[20] + (String)Protocolo[21]).toInt();
int pinoINB = ((String)Protocolo[23] + (String)Protocolo[24]).toInt();
int pinoPWM = ((String)Protocolo[26] + (String)Protocolo[27]).toInt();
if (bomba_ativada) {
if (Conectar) {
_bomba->_PressaoSP = pressaoSP;
_bomba->_pinoEN = pinoEN;
_bomba->_pinoCS = pinoCS;
_bomba->_pinoINA = pinoINA;
_bomba->_pinoINB = pinoINB;
_bomba->_pinoPWM = pinoPWM;
_bomba->Inicializar();
}
else {
_bomba->Desligar();
}
vTaskDelay(pdMS_TO_TICKS(500));
}
}
else {
S_Code componente = (S_Code)((String)Protocolo[8] + (String)Protocolo[9] + (String)Protocolo[10]).toInt();
bool sensor_ativado = (String)Protocolo[12] == "1";
int delayAmostragem = ((String)Protocolo[14] + (String)Protocolo[15] + (String)Protocolo[16] + (String)Protocolo[17] + (String)Protocolo[18]).toInt();
int prioridade = ((String)Protocolo[20] + (String)Protocolo[21]).toInt();
int pino = ((String)Protocolo[23] + (String)Protocolo[24]).toInt();
int pino2 = ((String)Protocolo[26] + (String)Protocolo[27]).toInt();
switch (componente) {
case sFLX: {
SensorFluxo* _sensor = SFPorID(ID);
if (sensor_ativado) {
if (Conectar) {
_sensor->_pino = pino;
_sensor->_prioridade = prioridade;
_sensor->_delayAmostragem = delayAmostragem;
_sensor->Inicializar();
}
else {
_sensor->Desligar();
}
}
break;
}
case sMAS: {
SensorMassa* _sensor = SMPorID(ID);
if (sensor_ativado) {
if (Conectar) {
_sensor->_pinoDT = pino;
_sensor->_pinoSCK = pino2;
_sensor->_prioridade = prioridade;
_sensor->_delayAmostragem = delayAmostragem;
_sensor->Inicializar();
}
else {
_sensor->Desligar();
}
}
break;
}
case sPRS: {
SensorPressao* _sensor = SPPorID(ID);
if (sensor_ativado) {
double Vmin = ((String)Protocolo[29] + (String)Protocolo[30] + (String)Protocolo[31] + (String)Protocolo[32] + (String)Protocolo[33] + (String)Protocolo[34]).toDouble();
double Vmax = ((String)Protocolo[36] + (String)Protocolo[37] + (String)Protocolo[38] + (String)Protocolo[39] + (String)Protocolo[40] + (String)Protocolo[41]).toDouble();
double Pmax = ((String)Protocolo[43] + (String)Protocolo[44] + (String)Protocolo[45] + (String)Protocolo[46] + (String)Protocolo[47] + (String)Protocolo[48]).toDouble();
if (Conectar) {
_sensor->_Vmin = Vmin;
_sensor->_Vmax = Vmax;
_sensor->_Pmax = Pmax;
_sensor->_pino = pino;
_sensor->_prioridade = prioridade;
_sensor->_delayAmostragem = delayAmostragem;
_sensor->Inicializar();
}
else {
_sensor->Desligar();
}
}
break;
}
}
}
}
}
else if (_funcao == Cmd) {
//canal;potencia;sentido;rampa;precisao;rpm
//0;000;0;000;000;000
String ID = ((String)Protocolo[0] + (String)Protocolo[1] + (String)Protocolo[2] + (String)Protocolo[3] + (String)Protocolo[4]);
BicoPulverizador* _bico = BicoPorID(ID);
BombaPressurizadora* _bomba = BombaPorID(ID);
if (_bico != nullptr) {
_bico->_BicoAtuado = (String)Protocolo[6] == (AtuacaoNivelAlto ? "1" : "0");
_bico->AlterarStatusBico();
}
else if (_bomba != nullptr) {
_bomba->_BombaAtuada = (String)Protocolo[6] == "1";
_bomba->_PressaoSP = ((String)Protocolo[8] + (String)Protocolo[9] + (String)Protocolo[10]).toDouble();
_bomba->AlterarStatusBomba();
}
}
else if (_funcao == Tst) {
String ID = ((String)Protocolo[0] + (String)Protocolo[1] + (String)Protocolo[2]);
BicoPulverizador* _bico = BicoPorID(ID);
bool EmTeste = _bico->Testando;
if (!EmTeste) {
//_motor->Testar();
}
}
}
}

View File

@ -1,8 +1,14 @@
#include "HX711.h"
#include <SimpleKalmanFilter.h>
// Defina os pinos para o módulo HX711
#define PINO_DT 5 // Pino de dados do HX711 ao GPIO5 do ESP32
#define PINO_SCK 18 // Pino de clock do HX711 ao GPIO18 do ESP32
#define PINO_DT 4 // Pino de dados do HX711 ao GPIO5 do ESP32
#define PINO_SCK 5 // Pino de clock do HX711 ao GPIO18 do ESP32
SimpleKalmanFilter kalman = SimpleKalmanFilter(2, 2, 0.01);
double massaRef = 0.8;
double leituraRef = 40876.37;
double leituraExtra = 2015000;
// Inicialize a biblioteca HX711
HX711 balanca;
@ -11,12 +17,20 @@ void setup() {
Serial.begin(115200);
balanca.begin(PINO_DT, PINO_SCK);
balanca.set_scale();
balanca.tare();
//balanca.tare();
Serial.println("Leitura do HX711 iniciada...");
}
void loop() {
Serial.print("Valor da leitura: ");
Serial.println(balanca.get_units(5), 2);
delay(1000);
//Serial.print("Valor da leitura: ");
double leitura = balanca.get_units(5);
double leituraFiltrada = kalman.updateEstimate(leitura);
leituraFiltrada *= -1;
leituraFiltrada += leituraExtra;
double massa = (massaRef / leituraRef) * leituraFiltrada;
Serial.println(massa);
//Serial.println(leituraFiltrada);
delay(200);
}

View File

@ -1,5 +1,5 @@
// Definindo o pino de entrada para o sensor
const int pinSensor = 12;
const int pinSensor = 6;
void setup() {
Serial.begin(115200); // Inicia a comunicação serial
@ -8,9 +8,10 @@ void setup() {
void loop() {
// Lê o valor do sensor (0 a 1023 para Arduino UNO/Nano/Mega)
int valorSensor = analogRead(pinSensor);
Serial.println(valorSensor);
// Converte o valor lido (0 a 1023) para tensão (0.5 a 4.5V)
float tensao = map(valorSensor, 0, 1023, 500, 4500) / 1000.0;
float tensao = map(valorSensor, 0, 4095, 500, 4500) / 1000.0;
// Converte a tensão para pressão em MPa
// A tensão de 0,5V corresponde a 0 MPa e 4,5V corresponde a 1,2 MPa

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -31,6 +31,7 @@ enum S_Code {
sBIC = 422,
sPRS = 333,
sMAG = 855,
sBMB = 325,
};
enum Sentido {

View File

@ -78,6 +78,13 @@ String MontarDadosProtocoloBicoPulverizador(bool statusBico) {
return Protocolo;
}
String MontarDadosProtocoloBombaPressurizadora(bool ligado, float percentualPotencia) {
String Protocolo =
String(ligado ? "1" : "0") + ";" +
String(percentualPotencia);
return Protocolo;
}
String MontarDadosProtocoloSensorGenerico(String dados1, String dados2 = "", String dados3 = "", String dados4 = "") {
String Protocolo =
dados1 + ";" +
@ -125,9 +132,9 @@ String MontarDadosProtocoloUltrassom(float distancia, long duracao) {
return Protocolo;
}
String MontarDadosProtocoloFluxo(float vazao, int tempo) {
String MontarDadosProtocoloFluxo(int pulsos, int tempo) {
String Protocolo =
(String)vazao + ";" +
(String)pulsos + ";" +
(String)tempo;
return Protocolo;
}

View File

@ -0,0 +1,212 @@
/*
PZEM EDL - PZEM Event Driven Library
This code implements communication and data exchange with PZEM004T V3.0 module using MODBUS proto
and provides an API for energy metrics monitoring and data processing.
This file is part of the 'PZEM event-driven library' project.
Copyright (C) Emil Muratov, 2021
GitHub: https://github.com/vortigont/pzem-edl
*/
#include "main.h"
// #include "pzem_edl.hpp"
/*
will need this namespace's methods to work with
PZEM-003 (same as PZEM-017) DC 10/50/100/200/300 Amps meter
NOTE: I do not have any of PZEM003 DC devies to make real test-case scenarios,
I only imlemented MODBUS RTU proto according to specs.
Pls, provide any feedback
*/
using namespace pz003;
/*
This is a small sketch that shows how to run a single PZEM003 instance:
- create an event-driven UART Queue object
- create PZ003 instance
- attach UART Queue to the PZEM instance
- mannualy poll for data
- enable auto-polling
- use call-backs
1. Connect only ONE device to ESP32's UART port using default or any other custom pins
2. Build the sketch and use terminal programm like platformio's devmon, putty or Arduino IDE to check for sketch output
*/
#define PZEM_UART_PORT UART_NUM_1 // port attached to pzem (UART_NUM_1 is 2-nd uart port on ESP32, 1-st one is usually busy with USB-to-serial chip)
#define RX_PIN 22 // custom RX pin number
#define TX_PIN 19 // custom TX pin number
#define PZEM_ID 42 // this is a unique PZEM ID for reference, it is NOT slave MODBUS address, just some random id
// (we all know why '42' is THE number, right? :) )
// first, we need a UartQ object to handle RX/TX message queues
UartQ *qport;
// Also we need a placeholder for PZEM object
PZ003 *pz;
void setup(){
Serial.begin(115200); // just an ordinary Serial console to interact with
Serial.printf("\n\n\n\tPZEM003 single instance example\n\n");
// PZEM003 requires custom config for serial port
uart_config_t cfg = {
.baud_rate = PZEM_BAUD_RATE,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_2, // PZEM003 need 2 stop bits
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE
};
// we can map port to any custom pins and use our config for serial port setup
qport = new UartQ(PZEM_UART_PORT, cfg, RX_PIN, TX_PIN); // or use custom pins
// Now let's create a PZEM003 object
pz = new PZ003(PZEM_ID);
// and link our port with PZEM object
pz->attachMsgQ(qport);
// one last step - we must start PortQ tasks to handle messages
qport->startQueues();
// set shunt type
pz->setShunt(shunt_t::type_50A);
// now it is all ready to exchange data with PZEM
// let's update it's metrics
pz->updateMetrics();
// and try to check the voltage value
auto *m = pz->getMetricsPZ003(); // obtain a pointer to objects metrics
Serial.printf("PZEM voltage: %d (decivolts)\n", m->voltage);
/*
But, hey! Wait a minute! Why the voltage value printed in console is ZERO?
That's the trick! We are currently enqueued request message to PZEM and it will respond back
some time in the future, somewhere in about ~100 ms... Almost an eternity in CPU cycles :)
When we checked our metrics for data and printed the result - request might be still on it's
way to PZEM over serial line.
Let's not waste the time we have while PZEM is making a reply and do something usefull meanwhile
*/
Serial.println("We can do some funny stuff while PZEM is preparing a reply");
// OK, 1000 ms is too long to print garbage, let's just take some sleep
delay(200); // for 200 ms
// now we should have some response with updated values, let's check again
Serial.printf("PZEM voltage: %d (decivolts)\n", m->voltage);
// and find how long ago we had a reply came back while we were sleeping
Serial.printf("PZEM data has been updated %lld ms ago\n", pz->getState()->dataAge());
// let's check other metrics
Serial.printf("PZEM current: %u (mA)\n", m->current);
// Or if someone likes floats instead? (I don't)
Serial.printf("PZEM current as float: %.3f (Amps)\n", m->asFloat(pzmbus::meter_t::cur)); // allowed arguments are in enum meter_t:uint8_t { vol, cur, pwr, enrg, frq, pf, alrm }
/*
OK, you may not like this updateMetrics(), than wait, than get values approach in the code, right?
If u want just some simple 'gimme values' style? Here is the proper way - run autopollig in background!
Let's enable it!
*/
if (pz->autopoll(true)){
Serial.println("Autopolling enabled");
} else {
Serial.println("Sorry, can't autopoll somehow :(");
}
/*
Now we can do all kind of other stuff and anytime we ask for values from PZEM object it will give us some fresh data
(default poll time is 1 second)
Let's make a simple task - we will sleep for random time from 0 to 5 seconds and on wake we will check PZEM for new data
*/
int times = 5;
do {
long t = random(5000);
Serial.printf("Going to sleep for %ld ms\n", t);
delay(t);
Serial.println("Wake up!");
Serial.printf("PZEM voltage: %d (decivolts), last update time %lld ms ago\n\n", m->voltage, pz->getState()->dataAge());
} while(--times);
// Cool, huh? :)
/*
And the last trick - assume I don't want this sleep/check also, I want to call some action once new data from PZEM arrives,
i.e. send this data over websocket to a nice GUI (something like im my ESPEM project https://github.com/vortigont/espem).
I have my own call-back routine and I want PZEM object to pull the string once it gets a fresh reply.
Check the function mycallback() below for now....
*/
// let's assign our callback to the PZEM instance.
// I'm using lambda here to provide functional callback
pz->attach_rx_callback([](uint8_t pzid, const RX_msg* m){
// I can do all the required things here, but to keep it sepparate -
// let's just call our function
mycallback(pzid, m);
});
// now I do not need to do anything
// I can just halt here in an endless loop, but every second with a new message
// console will print metrics data from PZEM
for (;;){
delay(1000);
}
}
void loop(){
// we do not need this loop at all :)
for (;;){
delay(1000);
}
}
/**
* @brief this is a custom callback for newly arrived data from PZEM
*
* @param id - this will be the ID of PZEM object, receiving the data
* @param m - this will be the struct with PZEM data (not only metrics, but any one)
*/
void mycallback(uint8_t id, const RX_msg* m){
// I can get the id of PZEM (might get handy if have more than one attached)
Serial.printf("\nCallback triggered for PZEM ID: %d\n", id);
/*
Here it is possible to obtain a fresh new data same way as before
Serial.printf("PZEM current as float: %.3f (Amps)\n", pz->getMetricsPZ003()->asFloat(pzmbus::meter_t::cur));
*/
/*
It is also possible to work directly on a raw data from PZEM
let's call for a little help here and use a pretty_printer() function
that parses and prints RX_msg to the stdout
*/
rx_msg_prettyp(m);
// that's the end of a callback
}

View File

@ -0,0 +1,16 @@
/*
PZEM EDL - PZEM Event Driven Library
This code implements communication and data exchange with PZEM004T V3.0 module using MODBUS proto
and provides an API for energy metrics monitoring and data processing.
This file is part of the 'PZEM event-driven library' project.
Copyright (C) Emil Muratov, 2021
GitHub: https://github.com/vortigont/pzem-edl
*/
#include <Arduino.h>
#include "pzem_edl.hpp"
void mycallback(uint8_t id, const RX_msg* m);

View File

@ -0,0 +1,212 @@
/*
PZEM EDL - PZEM Event Driven Library
This code implements communication and data exchange with PZEM004T V3.0 module using MODBUS proto
and provides an API for energy metrics monitoring and data processing.
This file is part of the 'PZEM event-driven library' project.
Copyright (C) Emil Muratov, 2021
GitHub: https://github.com/vortigont/pzem-edl
*/
#include "main.h"
// #include "pzem_edl.hpp"
/*
will need this namespace's methods to work with
PZEM-003 (same as PZEM-017) DC 10/50/100/200/300 Amps meter
NOTE: I do not have any of PZEM003 DC devies to make real test-case scenarios,
I only imlemented MODBUS RTU proto according to specs.
Pls, provide any feedback
*/
using namespace pz003;
/*
This is a small sketch that shows how to run a single PZEM003 instance:
- create an event-driven UART Queue object
- create PZ003 instance
- attach UART Queue to the PZEM instance
- mannualy poll for data
- enable auto-polling
- use call-backs
1. Connect only ONE device to ESP32's UART port using default or any other custom pins
2. Build the sketch and use terminal programm like platformio's devmon, putty or Arduino IDE to check for sketch output
*/
#define PZEM_UART_PORT UART_NUM_1 // port attached to pzem (UART_NUM_1 is 2-nd uart port on ESP32, 1-st one is usually busy with USB-to-serial chip)
#define RX_PIN 22 // custom RX pin number
#define TX_PIN 19 // custom TX pin number
#define PZEM_ID 42 // this is a unique PZEM ID for reference, it is NOT slave MODBUS address, just some random id
// (we all know why '42' is THE number, right? :) )
// first, we need a UartQ object to handle RX/TX message queues
UartQ *qport;
// Also we need a placeholder for PZEM object
PZ003 *pz;
void setup(){
Serial.begin(115200); // just an ordinary Serial console to interact with
Serial.printf("\n\n\n\tPZEM003 single instance example\n\n");
// PZEM003 requires custom config for serial port
uart_config_t cfg = {
.baud_rate = PZEM_BAUD_RATE,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_2, // PZEM003 need 2 stop bits
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE
};
// we can map port to any custom pins and use our config for serial port setup
qport = new UartQ(PZEM_UART_PORT, cfg, RX_PIN, TX_PIN); // or use custom pins
// Now let's create a PZEM003 object
pz = new PZ003(PZEM_ID);
// and link our port with PZEM object
pz->attachMsgQ(qport);
// one last step - we must start PortQ tasks to handle messages
qport->startQueues();
// set shunt type
pz->setShunt(shunt_t::type_50A);
// now it is all ready to exchange data with PZEM
// let's update it's metrics
pz->updateMetrics();
// and try to check the voltage value
auto *m = pz->getMetricsPZ003(); // obtain a pointer to objects metrics
Serial.printf("PZEM voltage: %d (decivolts)\n", m->voltage);
/*
But, hey! Wait a minute! Why the voltage value printed in console is ZERO?
That's the trick! We are currently enqueued request message to PZEM and it will respond back
some time in the future, somewhere in about ~100 ms... Almost an eternity in CPU cycles :)
When we checked our metrics for data and printed the result - request might be still on it's
way to PZEM over serial line.
Let's not waste the time we have while PZEM is making a reply and do something usefull meanwhile
*/
Serial.println("We can do some funny stuff while PZEM is preparing a reply");
// OK, 1000 ms is too long to print garbage, let's just take some sleep
delay(200); // for 200 ms
// now we should have some response with updated values, let's check again
Serial.printf("PZEM voltage: %d (decivolts)\n", m->voltage);
// and find how long ago we had a reply came back while we were sleeping
Serial.printf("PZEM data has been updated %lld ms ago\n", pz->getState()->dataAge());
// let's check other metrics
Serial.printf("PZEM current: %u (mA)\n", m->current);
// Or if someone likes floats instead? (I don't)
Serial.printf("PZEM current as float: %.3f (Amps)\n", m->asFloat(pzmbus::meter_t::cur)); // allowed arguments are in enum meter_t:uint8_t { vol, cur, pwr, enrg, frq, pf, alrm }
/*
OK, you may not like this updateMetrics(), than wait, than get values approach in the code, right?
If u want just some simple 'gimme values' style? Here is the proper way - run autopollig in background!
Let's enable it!
*/
if (pz->autopoll(true)){
Serial.println("Autopolling enabled");
} else {
Serial.println("Sorry, can't autopoll somehow :(");
}
/*
Now we can do all kind of other stuff and anytime we ask for values from PZEM object it will give us some fresh data
(default poll time is 1 second)
Let's make a simple task - we will sleep for random time from 0 to 5 seconds and on wake we will check PZEM for new data
*/
int times = 5;
do {
long t = random(5000);
Serial.printf("Going to sleep for %ld ms\n", t);
delay(t);
Serial.println("Wake up!");
Serial.printf("PZEM voltage: %d (decivolts), last update time %lld ms ago\n\n", m->voltage, pz->getState()->dataAge());
} while(--times);
// Cool, huh? :)
/*
And the last trick - assume I don't want this sleep/check also, I want to call some action once new data from PZEM arrives,
i.e. send this data over websocket to a nice GUI (something like im my ESPEM project https://github.com/vortigont/espem).
I have my own call-back routine and I want PZEM object to pull the string once it gets a fresh reply.
Check the function mycallback() below for now....
*/
// let's assign our callback to the PZEM instance.
// I'm using lambda here to provide functional callback
pz->attach_rx_callback([](uint8_t pzid, const RX_msg* m){
// I can do all the required things here, but to keep it sepparate -
// let's just call our function
mycallback(pzid, m);
});
// now I do not need to do anything
// I can just halt here in an endless loop, but every second with a new message
// console will print metrics data from PZEM
for (;;){
delay(1000);
}
}
void loop(){
// we do not need this loop at all :)
for (;;){
delay(1000);
}
}
/**
* @brief this is a custom callback for newly arrived data from PZEM
*
* @param id - this will be the ID of PZEM object, receiving the data
* @param m - this will be the struct with PZEM data (not only metrics, but any one)
*/
void mycallback(uint8_t id, const RX_msg* m){
// I can get the id of PZEM (might get handy if have more than one attached)
Serial.printf("\nCallback triggered for PZEM ID: %d\n", id);
/*
Here it is possible to obtain a fresh new data same way as before
Serial.printf("PZEM current as float: %.3f (Amps)\n", pz->getMetricsPZ003()->asFloat(pzmbus::meter_t::cur));
*/
/*
It is also possible to work directly on a raw data from PZEM
let's call for a little help here and use a pretty_printer() function
that parses and prints RX_msg to the stdout
*/
rx_msg_prettyp(m);
// that's the end of a callback
}

View File

@ -1,3 +1,7 @@
// Dispositivo: Sensoriamento
// Versão Firmware: 6
// Ultima atualização: 26/03/2024
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\SerialService.h"
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\Utils.h"
@ -17,8 +21,8 @@ bool Conectado = false;
int _TaxaAmostragem;
int FrequenciaMaxima = 10000;
#define _pinoSDA 19
#define _pinoSCL 20
int _pinoSDA = 32;
int _pinoSCL = 33;
class SensorTemperatura {
@ -650,6 +654,14 @@ void loop() {
bool Conectar = (String)Protocolo[6] == "1";
if (ID == "MD ") {
_TaxaAmostragem = ((String)Protocolo[8] + (String)Protocolo[9] + (String)Protocolo[10] + (String)Protocolo[11] + (String)Protocolo[12]).toInt();
int pinoSDA = ((String)Protocolo[14] + (String)Protocolo[15]).toInt();
int pinoSCL = ((String)Protocolo[17] + (String)Protocolo[18]).toInt();
if (pinoSDA > -1 && pinoSCL > -1) {
_pinoSDA = pinoSDA;
_pinoSCL = pinoSCL;
Wire.begin(_pinoSDA, _pinoSCL);
}
vTaskDelay(pdMS_TO_TICKS(100));
Conectado = Conectar;