criado parametrizacao atuadores
This commit is contained in:
parent
4743f1947e
commit
35ef616767
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -156,6 +156,12 @@
|
|||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Forms\Atuador\frmAtuConfig.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Atuador\frmAtuConfig.Designer.cs">
|
||||
<DependentUpon>frmAtuConfig.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Direcional\frmDirConfig.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
|
@ -277,6 +283,9 @@
|
|||
<Compile Include="Services\PythonService.cs" />
|
||||
<Compile Include="Services\SerialService.cs" />
|
||||
<Compile Include="Services\SocketService.cs" />
|
||||
<EmbeddedResource Include="Forms\Atuador\frmAtuConfig.resx">
|
||||
<DependentUpon>frmAtuConfig.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\Direcional\frmDirConfig.resx">
|
||||
<DependentUpon>frmDirConfig.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,115 @@
|
|||
namespace AgroBase.Forms.Atuador
|
||||
{
|
||||
partial class frmAtuConfig
|
||||
{
|
||||
/// <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.nudBicosQtd = new System.Windows.Forms.NumericUpDown();
|
||||
this.gpbBicos = new System.Windows.Forms.GroupBox();
|
||||
this.lblBicosQtd = new System.Windows.Forms.Label();
|
||||
this.chbBicosAtuacao = new System.Windows.Forms.CheckBox();
|
||||
this.btnSalvar = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudBicosQtd)).BeginInit();
|
||||
this.gpbBicos.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nudBicosQtd
|
||||
//
|
||||
this.nudBicosQtd.Location = new System.Drawing.Point(74, 19);
|
||||
this.nudBicosQtd.Name = "nudBicosQtd";
|
||||
this.nudBicosQtd.Size = new System.Drawing.Size(72, 20);
|
||||
this.nudBicosQtd.TabIndex = 1;
|
||||
this.nudBicosQtd.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// gpbBicos
|
||||
//
|
||||
this.gpbBicos.Controls.Add(this.chbBicosAtuacao);
|
||||
this.gpbBicos.Controls.Add(this.lblBicosQtd);
|
||||
this.gpbBicos.Controls.Add(this.nudBicosQtd);
|
||||
this.gpbBicos.Location = new System.Drawing.Point(12, 12);
|
||||
this.gpbBicos.Name = "gpbBicos";
|
||||
this.gpbBicos.Size = new System.Drawing.Size(158, 74);
|
||||
this.gpbBicos.TabIndex = 2;
|
||||
this.gpbBicos.TabStop = false;
|
||||
this.gpbBicos.Text = "Bicos Pulverizadores";
|
||||
//
|
||||
// lblBicosQtd
|
||||
//
|
||||
this.lblBicosQtd.AutoSize = true;
|
||||
this.lblBicosQtd.Location = new System.Drawing.Point(6, 21);
|
||||
this.lblBicosQtd.Name = "lblBicosQtd";
|
||||
this.lblBicosQtd.Size = new System.Drawing.Size(62, 13);
|
||||
this.lblBicosQtd.TabIndex = 2;
|
||||
this.lblBicosQtd.Text = "Quantidade";
|
||||
//
|
||||
// chbBicosAtuacao
|
||||
//
|
||||
this.chbBicosAtuacao.AutoSize = true;
|
||||
this.chbBicosAtuacao.Location = new System.Drawing.Point(9, 45);
|
||||
this.chbBicosAtuacao.Name = "chbBicosAtuacao";
|
||||
this.chbBicosAtuacao.Size = new System.Drawing.Size(130, 17);
|
||||
this.chbBicosAtuacao.TabIndex = 3;
|
||||
this.chbBicosAtuacao.Text = "Atuação em nível alto";
|
||||
this.chbBicosAtuacao.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnSalvar
|
||||
//
|
||||
this.btnSalvar.Location = new System.Drawing.Point(176, 63);
|
||||
this.btnSalvar.Name = "btnSalvar";
|
||||
this.btnSalvar.Size = new System.Drawing.Size(94, 23);
|
||||
this.btnSalvar.TabIndex = 3;
|
||||
this.btnSalvar.Text = "Salvar";
|
||||
this.btnSalvar.UseVisualStyleBackColor = true;
|
||||
this.btnSalvar.Click += new System.EventHandler(this.btnSalvar_Click);
|
||||
//
|
||||
// frmAtuConfig
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(282, 100);
|
||||
this.Controls.Add(this.btnSalvar);
|
||||
this.Controls.Add(this.gpbBicos);
|
||||
this.Name = "frmAtuConfig";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Atuador - Parametrização";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmAtuConfig_FormClosing);
|
||||
this.Load += new System.EventHandler(this.frmAtuConfig_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudBicosQtd)).EndInit();
|
||||
this.gpbBicos.ResumeLayout(false);
|
||||
this.gpbBicos.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.NumericUpDown nudBicosQtd;
|
||||
private System.Windows.Forms.GroupBox gpbBicos;
|
||||
private System.Windows.Forms.CheckBox chbBicosAtuacao;
|
||||
private System.Windows.Forms.Label lblBicosQtd;
|
||||
private System.Windows.Forms.Button btnSalvar;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
using AgroBase.Comum;
|
||||
using AgroBase.Models;
|
||||
using AgroBase.Models.Modules;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static AgroBase.Models.Enuns;
|
||||
|
||||
namespace AgroBase.Forms.Atuador
|
||||
{
|
||||
public partial class frmAtuConfig : Form
|
||||
{
|
||||
DispositivosService<AtuadorModel> Disp = (DispositivosService<AtuadorModel>)Variaveis.DispositivosConectados.FirstOrDefault(x => x.Dispositivo == T_Code.Atu);
|
||||
|
||||
public frmAtuConfig()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void frmAtuConfig_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (Disp == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
chbBicosAtuacao.Checked = Disp.Dados.AtuacaoNivelAlto;
|
||||
nudBicosQtd.Value = Disp.Dados.QuantidadeBicos;
|
||||
}
|
||||
|
||||
private void frmAtuConfig_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
e.Cancel = true;
|
||||
this.Visible = false;
|
||||
}
|
||||
|
||||
private void btnSalvar_Click(object sender, EventArgs e)
|
||||
{
|
||||
Disp.Dados.AtuacaoNivelAlto = chbBicosAtuacao.Checked;
|
||||
Disp.Dados.QuantidadeBicos = Convert.ToInt32(nudBicosQtd.Value);
|
||||
|
||||
Disp.SalvarParametros(Disp.Dados);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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>
|
||||
|
|
@ -17,6 +17,7 @@ namespace AgroBase.Models.Modules
|
|||
public static List<PinoutModel> Pinout { get; set; }
|
||||
public static List<FuncoesPinout> Funcoes { get; set; } = new List<FuncoesPinout>() { FuncoesPinout.Geral };
|
||||
public int QuantidadeBicos { get; set; } = 10;
|
||||
public bool AtuacaoNivelAlto { get; set; } = true;
|
||||
public List<AtuadorBicoModel> BicosPulverizadores { get; set; } = new List<AtuadorBicoModel>();
|
||||
public double PercentualInicioPulverizacao { get; set; } = 0.3;
|
||||
|
||||
|
|
@ -58,7 +59,8 @@ namespace AgroBase.Models.Modules
|
|||
"MD " + ";" + // 0 ~ 2
|
||||
(Conectar ? "1" : "0") + ";" + // 4
|
||||
_TaxaAmostragem.ToString("00000") + ";" + // 6 ~ 10
|
||||
(Pinout.Any(x => x.Funcao == FuncoesPinout.Geral) ? Pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.Geral).Pino.ToString("00") : "-1"); // 12 ~ 13
|
||||
(Pinout.Any(x => x.Funcao == FuncoesPinout.Geral) ? Pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.Geral).Pino.ToString("00") : "-1") + ";" + // 12 ~ 13
|
||||
(AtuacaoNivelAlto ? "1" : "0"); // 15
|
||||
Config.Add(ProtocoloMOD);
|
||||
return Config;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using AgroBase.Forms;
|
||||
using AgroBase.Forms.Atuador;
|
||||
using AgroBase.Forms.Direcional;
|
||||
using AgroBase.Forms.Movimentacao;
|
||||
using AgroBase.Forms.Sensoriamento;
|
||||
|
|
@ -203,7 +204,7 @@ namespace AgroBase.Comum
|
|||
break;
|
||||
case T_Code.Atu:
|
||||
Dados = CarregarParametros(AtuadorModel.CarregarParametrosIniciais());
|
||||
//frmConfig = new frmAtuConfig();
|
||||
frmConfig = new frmAtuConfig();
|
||||
break;
|
||||
default:
|
||||
Dados = default(T);
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
{"Conectado":false,"QuantidadeBicos":10,"BicosPulverizadores":[{"ID":"B01","Posicao":1,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B02","Posicao":2,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B03","Posicao":3,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B04","Posicao":4,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B05","Posicao":5,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B06","Posicao":6,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B07","Posicao":7,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B08","Posicao":8,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B09","Posicao":9,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B10","Posicao":10,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0}],"PercentualInicioPulverizacao":0.3,"PercentualReservatorio":0.0}
|
||||
{"Conectado":false,"QuantidadeBicos":4,"AtuacaoNivelAlto":false,"BicosPulverizadores":[{"ID":"B01","Posicao":1,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B02","Posicao":2,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B03","Posicao":3,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B04","Posicao":4,"Atuado":false,"Comandar":true,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B05","Posicao":5,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B06","Posicao":6,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B07","Posicao":7,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B08","Posicao":8,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B09","Posicao":9,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0},{"ID":"B10","Posicao":10,"Atuado":false,"Comandar":false,"Inicializado":false,"Testando":false,"Funcoes":[21,22],"StatusBico":false,"NivelFluxo":0.0}],"PercentualInicioPulverizacao":0.3,"PercentualReservatorio":0.0}
|
||||
|
|
@ -1 +1 @@
|
|||
[{"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":21,"Habilitado":true,"ComponenteID":"B01"},{"Tipo":1,"Pino":33,"Descricao":"8","Funcao":21,"Habilitado":true,"ComponenteID":"B02"},{"Tipo":1,"Pino":25,"Descricao":"9","Funcao":21,"Habilitado":true,"ComponenteID":"B03"},{"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":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":17,"Descricao":"34","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":5,"Descricao":"35","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":18,"Descricao":"36","Funcao":0,"Habilitado":true,"ComponenteID":""},{"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":true,"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":21,"Habilitado":true,"ComponenteID":"B01"},{"Tipo":1,"Pino":33,"Descricao":"8","Funcao":21,"Habilitado":true,"ComponenteID":"B02"},{"Tipo":1,"Pino":25,"Descricao":"9","Funcao":21,"Habilitado":true,"ComponenteID":"B03"},{"Tipo":1,"Pino":26,"Descricao":"10","Funcao":21,"Habilitado":true,"ComponenteID":"B04"},{"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":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":17,"Descricao":"34","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":5,"Descricao":"35","Funcao":0,"Habilitado":true,"ComponenteID":""},{"Tipo":1,"Pino":18,"Descricao":"36","Funcao":0,"Habilitado":true,"ComponenteID":""},{"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":true,"ComponenteID":""}]
|
||||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
522c469433cd27a9bb1c105d2bee798bc5682bc54372eaac60a028a8592b0825
|
||||
d77718b040b4cf6fc82b2b41e96331db6c3f023ad308bfa85c86b2147e72a6ff
|
||||
|
|
|
|||
|
|
@ -362,3 +362,4 @@ C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\Debug\Python\Scripts\gps-viewer
|
|||
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmGPS.resources
|
||||
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmPinout.resources
|
||||
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.Sensoriamento.frmSenConfig.resources
|
||||
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.Atuador.frmAtuConfig.resources
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -14,7 +14,7 @@ bool Conectado = false;
|
|||
|
||||
int _TaxaAmostragem = 500;
|
||||
int BicosAtivos = 10;
|
||||
bool BicoLigado = false;
|
||||
bool AtuacaoNivelAlto = false;
|
||||
|
||||
class BicoPulverizador {
|
||||
public:
|
||||
|
|
@ -37,7 +37,7 @@ public:
|
|||
bool StatusBico;
|
||||
|
||||
// Entrada de dados
|
||||
bool _BicoAtuado = !BicoLigado;
|
||||
bool _BicoAtuado = !AtuacaoNivelAlto;
|
||||
|
||||
void Inicializar() {
|
||||
if (Iniciado) {
|
||||
|
|
@ -48,9 +48,9 @@ public:
|
|||
|
||||
if (_pinoSolenoide > -1) {
|
||||
pinMode(_pinoSolenoide, OUTPUT);
|
||||
_BicoAtuado = !BicoLigado;
|
||||
_BicoAtuado = !AtuacaoNivelAlto;
|
||||
digitalWrite(_pinoSolenoide, _BicoAtuado);
|
||||
StatusBico = digitalRead(_pinoSolenoide) == (BicoLigado ? 1 : 0);
|
||||
StatusBico = digitalRead(_pinoSolenoide) == (AtuacaoNivelAlto ? 1 : 0);
|
||||
}
|
||||
if (_pinoSensor > -1) {
|
||||
pinMode(_pinoSensor, INPUT);
|
||||
|
|
@ -89,7 +89,7 @@ public:
|
|||
|
||||
void AlterarStatusBico() {
|
||||
digitalWrite(_pinoSolenoide, _BicoAtuado);
|
||||
StatusBico = digitalRead(_pinoSolenoide) == (BicoLigado ? 1 : 0);
|
||||
StatusBico = digitalRead(_pinoSolenoide) == (AtuacaoNivelAlto ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -157,7 +157,7 @@ void ZerarPinos() {
|
|||
|
||||
for (int i = 0; i < sizeof(gpios) / sizeof(gpios[0]); i++) {
|
||||
pinMode(gpios[i], OUTPUT);
|
||||
digitalWrite(gpios[i], !BicoLigado);
|
||||
digitalWrite(gpios[i], !AtuacaoNivelAlto);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ bool Conectado = false;
|
|||
|
||||
int _TaxaAmostragem = 500;
|
||||
int BicosAtivos = 10;
|
||||
bool BicoLigado = false;
|
||||
bool AtuacaoNivelAlto = false;
|
||||
|
||||
class BicoPulverizador {
|
||||
public:
|
||||
|
|
@ -37,7 +37,7 @@ public:
|
|||
bool StatusBico;
|
||||
|
||||
// Entrada de dados
|
||||
bool _BicoAtuado = !BicoLigado;
|
||||
bool _BicoAtuado = !AtuacaoNivelAlto;
|
||||
|
||||
void Inicializar() {
|
||||
if (Iniciado) {
|
||||
|
|
@ -48,9 +48,9 @@ public:
|
|||
|
||||
if (_pinoSolenoide > -1) {
|
||||
pinMode(_pinoSolenoide, OUTPUT);
|
||||
_BicoAtuado = !BicoLigado;
|
||||
_BicoAtuado = !AtuacaoNivelAlto;
|
||||
digitalWrite(_pinoSolenoide, _BicoAtuado);
|
||||
StatusBico = digitalRead(_pinoSolenoide) == (BicoLigado ? 1 : 0);
|
||||
StatusBico = digitalRead(_pinoSolenoide) == (AtuacaoNivelAlto ? 1 : 0);
|
||||
}
|
||||
if (_pinoSensor > -1) {
|
||||
pinMode(_pinoSensor, INPUT);
|
||||
|
|
@ -89,7 +89,7 @@ public:
|
|||
|
||||
void AlterarStatusBico() {
|
||||
digitalWrite(_pinoSolenoide, _BicoAtuado);
|
||||
StatusBico = digitalRead(_pinoSolenoide) == (BicoLigado ? 1 : 0);
|
||||
StatusBico = digitalRead(_pinoSolenoide) == (AtuacaoNivelAlto ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -157,7 +157,7 @@ void ZerarPinos() {
|
|||
|
||||
for (int i = 0; i < sizeof(gpios) / sizeof(gpios[0]); i++) {
|
||||
pinMode(gpios[i], OUTPUT);
|
||||
digitalWrite(gpios[i], !BicoLigado);
|
||||
digitalWrite(gpios[i], !AtuacaoNivelAlto);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -201,6 +201,7 @@ void loop() {
|
|||
if (ID == "MD ") {
|
||||
_TaxaAmostragem = ((String)Protocolo[6] + (String)Protocolo[7] + (String)Protocolo[8] + (String)Protocolo[9] + (String)Protocolo[10]).toInt();
|
||||
int pinoReleGeral = ((String)Protocolo[12] + (String)Protocolo[13]).toInt();
|
||||
bool _atuacaoNivelAlto = Protocolo[15] == "1";
|
||||
|
||||
if (pinoReleGeral > -1) {
|
||||
pinMode(_pinoReleGeral, INPUT);
|
||||
|
|
@ -209,6 +210,8 @@ void loop() {
|
|||
digitalWrite(_pinoReleGeral, Conectar);
|
||||
}
|
||||
|
||||
AtuacaoNivelAlto = _atuacaoNivelAlto;
|
||||
|
||||
vTaskDelay(pdMS_TO_TICKS(100));
|
||||
Conectado = Conectar;
|
||||
EnviarDadosSerial(MontarProtocoloSensor(sCFG, "MD ", Conectado ? "1" : "0"));
|
||||
|
|
|
|||
Loading…
Reference in New Issue