inclusao do modulo ADS

This commit is contained in:
Diego Freitas 2025-03-24 15:36:15 -03:00
parent faf893d595
commit 9cc8bb27ec
58 changed files with 1531 additions and 689 deletions

Binary file not shown.

View File

@ -518,6 +518,7 @@
<None Include="Imagens\wifi_on.png" />
<Content Include="icon.ico" />
<None Include="Imagens\logo.png" />
<None Include="Imagens\ads.jpg" />
<Content Include="Python\Output\modelo_3d-1_0.mtl" />
<Content Include="Python\Output\modelo_3d-1_0.obj" />
<None Include="Resources\rede.png" />

View File

@ -30,8 +30,8 @@
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmDialogoMapa));
this.pnlMapa = new System.Windows.Forms.Panel();
this.pnlMapaDinamico = new System.Windows.Forms.Panel();
this.pnlJoystick = new System.Windows.Forms.Panel();
this.pnlMapaDinamico = new System.Windows.Forms.Panel();
this.pnlCameraCaminho = new System.Windows.Forms.Panel();
this.pnlCameraSoloD = new System.Windows.Forms.Panel();
this.pnlCameraSoloE = new System.Windows.Forms.Panel();
@ -64,13 +64,13 @@
this.txtModoOperacao = new System.Windows.Forms.TextBox();
this.pnlSensores = new System.Windows.Forms.Panel();
this.txtStatusCarro = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.lblStatusCarro = new System.Windows.Forms.Label();
this.txtMargemCorredor = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.lblMargemCorredor = new System.Windows.Forms.Label();
this.txtDentroCorredor = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.lblDentroCorredor = new System.Windows.Forms.Label();
this.txtDistanciasEsqDir = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.lblDistanciaLateral = new System.Windows.Forms.Label();
this.lblPrecisaoGPS = new System.Windows.Forms.Label();
this.lblCorrecaoGPS = new System.Windows.Forms.Label();
this.btnCodFalha = new System.Windows.Forms.Button();
@ -94,8 +94,16 @@
this.tkbAnguloDirecional = new System.Windows.Forms.TrackBar();
this.lblVelocidade = new System.Windows.Forms.Label();
this.tkbVelocidade = new System.Windows.Forms.TrackBar();
this.picFechar = new System.Windows.Forms.PictureBox();
this.tabMapa = new System.Windows.Forms.TabPage();
this.picFechar = new System.Windows.Forms.PictureBox();
this.txtEF = new System.Windows.Forms.TextBox();
this.lblEF = new System.Windows.Forms.Label();
this.txtDF = new System.Windows.Forms.TextBox();
this.lblDF = new System.Windows.Forms.Label();
this.txtDT = new System.Windows.Forms.TextBox();
this.lblDT = new System.Windows.Forms.Label();
this.txtET = new System.Windows.Forms.TextBox();
this.lblET = new System.Windows.Forms.Label();
this.pnlMapa.SuspendLayout();
this.pnlSensores.SuspendLayout();
this.statusStrip1.SuspendLayout();
@ -105,8 +113,8 @@
this.pnlControle.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tkbAnguloDirecional)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tkbVelocidade)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picFechar)).BeginInit();
this.tabMapa.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picFechar)).BeginInit();
this.SuspendLayout();
//
// pnlMapa
@ -117,14 +125,6 @@
this.pnlMapa.Size = new System.Drawing.Size(697, 500);
this.pnlMapa.TabIndex = 0;
//
// pnlMapaDinamico
//
this.pnlMapaDinamico.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlMapaDinamico.Location = new System.Drawing.Point(3, 3);
this.pnlMapaDinamico.Name = "pnlMapaDinamico";
this.pnlMapaDinamico.Size = new System.Drawing.Size(307, 497);
this.pnlMapaDinamico.TabIndex = 19;
//
// pnlJoystick
//
this.pnlJoystick.Location = new System.Drawing.Point(26, 268);
@ -133,6 +133,14 @@
this.pnlJoystick.TabIndex = 18;
this.pnlJoystick.Visible = false;
//
// pnlMapaDinamico
//
this.pnlMapaDinamico.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlMapaDinamico.Location = new System.Drawing.Point(3, 3);
this.pnlMapaDinamico.Name = "pnlMapaDinamico";
this.pnlMapaDinamico.Size = new System.Drawing.Size(307, 497);
this.pnlMapaDinamico.TabIndex = 19;
//
// pnlCameraCaminho
//
this.pnlCameraCaminho.Location = new System.Drawing.Point(246, 2);
@ -401,14 +409,22 @@
// pnlSensores
//
this.pnlSensores.AutoScroll = true;
this.pnlSensores.Controls.Add(this.txtDT);
this.pnlSensores.Controls.Add(this.lblDT);
this.pnlSensores.Controls.Add(this.txtET);
this.pnlSensores.Controls.Add(this.lblET);
this.pnlSensores.Controls.Add(this.txtDF);
this.pnlSensores.Controls.Add(this.lblDF);
this.pnlSensores.Controls.Add(this.txtEF);
this.pnlSensores.Controls.Add(this.lblEF);
this.pnlSensores.Controls.Add(this.txtStatusCarro);
this.pnlSensores.Controls.Add(this.label4);
this.pnlSensores.Controls.Add(this.lblStatusCarro);
this.pnlSensores.Controls.Add(this.txtMargemCorredor);
this.pnlSensores.Controls.Add(this.label3);
this.pnlSensores.Controls.Add(this.lblMargemCorredor);
this.pnlSensores.Controls.Add(this.txtDentroCorredor);
this.pnlSensores.Controls.Add(this.label2);
this.pnlSensores.Controls.Add(this.lblDentroCorredor);
this.pnlSensores.Controls.Add(this.txtDistanciasEsqDir);
this.pnlSensores.Controls.Add(this.label1);
this.pnlSensores.Controls.Add(this.lblDistanciaLateral);
this.pnlSensores.Controls.Add(this.lblPrecisaoGPS);
this.pnlSensores.Controls.Add(this.lblCorrecaoGPS);
this.pnlSensores.Controls.Add(this.btnCodFalha);
@ -453,59 +469,59 @@
// txtStatusCarro
//
this.txtStatusCarro.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtStatusCarro.Location = new System.Drawing.Point(167, 736);
this.txtStatusCarro.Location = new System.Drawing.Point(164, 736);
this.txtStatusCarro.Name = "txtStatusCarro";
this.txtStatusCarro.ReadOnly = true;
this.txtStatusCarro.Size = new System.Drawing.Size(120, 26);
this.txtStatusCarro.TabIndex = 43;
this.txtStatusCarro.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label4
// lblStatusCarro
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(6, 739);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(99, 20);
this.label4.TabIndex = 42;
this.label4.Text = "Status Carro";
this.lblStatusCarro.AutoSize = true;
this.lblStatusCarro.Location = new System.Drawing.Point(6, 739);
this.lblStatusCarro.Name = "lblStatusCarro";
this.lblStatusCarro.Size = new System.Drawing.Size(99, 20);
this.lblStatusCarro.TabIndex = 42;
this.lblStatusCarro.Text = "Status Carro";
//
// txtMargemCorredor
//
this.txtMargemCorredor.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtMargemCorredor.Location = new System.Drawing.Point(167, 704);
this.txtMargemCorredor.Location = new System.Drawing.Point(164, 704);
this.txtMargemCorredor.Name = "txtMargemCorredor";
this.txtMargemCorredor.ReadOnly = true;
this.txtMargemCorredor.Size = new System.Drawing.Size(120, 26);
this.txtMargemCorredor.TabIndex = 41;
this.txtMargemCorredor.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label3
// lblMargemCorredor
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(6, 707);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(133, 20);
this.label3.TabIndex = 40;
this.label3.Text = "Margem Corredor";
this.lblMargemCorredor.AutoSize = true;
this.lblMargemCorredor.Location = new System.Drawing.Point(6, 707);
this.lblMargemCorredor.Name = "lblMargemCorredor";
this.lblMargemCorredor.Size = new System.Drawing.Size(133, 20);
this.lblMargemCorredor.TabIndex = 40;
this.lblMargemCorredor.Text = "Margem Corredor";
//
// txtDentroCorredor
//
this.txtDentroCorredor.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtDentroCorredor.Location = new System.Drawing.Point(167, 672);
this.txtDentroCorredor.Location = new System.Drawing.Point(164, 672);
this.txtDentroCorredor.Name = "txtDentroCorredor";
this.txtDentroCorredor.ReadOnly = true;
this.txtDentroCorredor.Size = new System.Drawing.Size(120, 26);
this.txtDentroCorredor.TabIndex = 39;
this.txtDentroCorredor.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label2
// lblDentroCorredor
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(6, 675);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(124, 20);
this.label2.TabIndex = 38;
this.label2.Text = "Dentro Corredor";
this.lblDentroCorredor.AutoSize = true;
this.lblDentroCorredor.Location = new System.Drawing.Point(6, 675);
this.lblDentroCorredor.Name = "lblDentroCorredor";
this.lblDentroCorredor.Size = new System.Drawing.Size(124, 20);
this.lblDentroCorredor.TabIndex = 38;
this.lblDentroCorredor.Text = "Dentro Corredor";
//
// txtDistanciasEsqDir
//
@ -517,20 +533,20 @@
this.txtDistanciasEsqDir.TabIndex = 37;
this.txtDistanciasEsqDir.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label1
// lblDistanciaLateral
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(3, 643);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(147, 20);
this.label1.TabIndex = 36;
this.label1.Text = "Distancias Esq / Dir";
this.lblDistanciaLateral.AutoSize = true;
this.lblDistanciaLateral.Location = new System.Drawing.Point(3, 643);
this.lblDistanciaLateral.Name = "lblDistanciaLateral";
this.lblDistanciaLateral.Size = new System.Drawing.Size(147, 20);
this.lblDistanciaLateral.TabIndex = 36;
this.lblDistanciaLateral.Text = "Distancias Esq / Dir";
//
// lblPrecisaoGPS
//
this.lblPrecisaoGPS.AutoSize = true;
this.lblPrecisaoGPS.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblPrecisaoGPS.Location = new System.Drawing.Point(6, 485);
this.lblPrecisaoGPS.Location = new System.Drawing.Point(6, 497);
this.lblPrecisaoGPS.Name = "lblPrecisaoGPS";
this.lblPrecisaoGPS.Size = new System.Drawing.Size(105, 15);
this.lblPrecisaoGPS.TabIndex = 35;
@ -540,7 +556,7 @@
//
this.lblCorrecaoGPS.AutoSize = true;
this.lblCorrecaoGPS.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblCorrecaoGPS.Location = new System.Drawing.Point(184, 485);
this.lblCorrecaoGPS.Location = new System.Drawing.Point(184, 497);
this.lblCorrecaoGPS.Name = "lblCorrecaoGPS";
this.lblCorrecaoGPS.Size = new System.Drawing.Size(83, 15);
this.lblCorrecaoGPS.TabIndex = 34;
@ -589,7 +605,7 @@
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(184, 502);
this.pnlOrientacao.Location = new System.Drawing.Point(184, 514);
this.pnlOrientacao.Margin = new System.Windows.Forms.Padding(2);
this.pnlOrientacao.Name = "pnlOrientacao";
this.pnlOrientacao.Size = new System.Drawing.Size(100, 100);
@ -601,7 +617,7 @@
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(7, 502);
this.pnlInclinacao.Location = new System.Drawing.Point(7, 514);
this.pnlInclinacao.Margin = new System.Windows.Forms.Padding(2);
this.pnlInclinacao.Name = "pnlInclinacao";
this.pnlInclinacao.Size = new System.Drawing.Size(100, 100);
@ -759,16 +775,6 @@
this.tkbVelocidade.Value = 30;
this.tkbVelocidade.Scroll += new System.EventHandler(this.tkbVelocidade_Scroll);
//
// picFechar
//
this.picFechar.Image = global::AgroBase.Properties.Resources.fechar;
this.picFechar.Location = new System.Drawing.Point(974, 9);
this.picFechar.Name = "picFechar";
this.picFechar.Size = new System.Drawing.Size(43, 46);
this.picFechar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picFechar.TabIndex = 1;
this.picFechar.TabStop = false;
//
// tabMapa
//
this.tabMapa.Controls.Add(this.pnlMapaDinamico);
@ -780,6 +786,96 @@
this.tabMapa.Text = "Mapa";
this.tabMapa.UseVisualStyleBackColor = true;
//
// picFechar
//
this.picFechar.Image = global::AgroBase.Properties.Resources.fechar;
this.picFechar.Location = new System.Drawing.Point(974, 9);
this.picFechar.Name = "picFechar";
this.picFechar.Size = new System.Drawing.Size(43, 46);
this.picFechar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picFechar.TabIndex = 1;
this.picFechar.TabStop = false;
//
// txtEF
//
this.txtEF.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtEF.Location = new System.Drawing.Point(41, 790);
this.txtEF.Name = "txtEF";
this.txtEF.ReadOnly = true;
this.txtEF.Size = new System.Drawing.Size(89, 26);
this.txtEF.TabIndex = 45;
this.txtEF.Text = "0,00";
this.txtEF.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblEF
//
this.lblEF.AutoSize = true;
this.lblEF.Location = new System.Drawing.Point(6, 793);
this.lblEF.Name = "lblEF";
this.lblEF.Size = new System.Drawing.Size(30, 20);
this.lblEF.TabIndex = 44;
this.lblEF.Text = "EF";
//
// txtDF
//
this.txtDF.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtDF.Location = new System.Drawing.Point(195, 787);
this.txtDF.Name = "txtDF";
this.txtDF.ReadOnly = true;
this.txtDF.Size = new System.Drawing.Size(89, 26);
this.txtDF.TabIndex = 47;
this.txtDF.Text = "0,00";
this.txtDF.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblDF
//
this.lblDF.AutoSize = true;
this.lblDF.Location = new System.Drawing.Point(160, 790);
this.lblDF.Name = "lblDF";
this.lblDF.Size = new System.Drawing.Size(31, 20);
this.lblDF.TabIndex = 46;
this.lblDF.Text = "DF";
//
// txtDT
//
this.txtDT.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtDT.Location = new System.Drawing.Point(195, 819);
this.txtDT.Name = "txtDT";
this.txtDT.ReadOnly = true;
this.txtDT.Size = new System.Drawing.Size(89, 26);
this.txtDT.TabIndex = 51;
this.txtDT.Text = "0,00";
this.txtDT.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblDT
//
this.lblDT.AutoSize = true;
this.lblDT.Location = new System.Drawing.Point(160, 822);
this.lblDT.Name = "lblDT";
this.lblDT.Size = new System.Drawing.Size(30, 20);
this.lblDT.TabIndex = 50;
this.lblDT.Text = "DT";
//
// txtET
//
this.txtET.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F);
this.txtET.Location = new System.Drawing.Point(41, 822);
this.txtET.Name = "txtET";
this.txtET.ReadOnly = true;
this.txtET.Size = new System.Drawing.Size(89, 26);
this.txtET.TabIndex = 49;
this.txtET.Text = "0,00";
this.txtET.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblET
//
this.lblET.AutoSize = true;
this.lblET.Location = new System.Drawing.Point(6, 825);
this.lblET.Name = "lblET";
this.lblET.Size = new System.Drawing.Size(29, 20);
this.lblET.TabIndex = 48;
this.lblET.Text = "ET";
//
// frmDialogoMapa
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -813,8 +909,8 @@
this.pnlControle.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.tkbAnguloDirecional)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tkbVelocidade)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picFechar)).EndInit();
this.tabMapa.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.picFechar)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -881,13 +977,21 @@
private System.Windows.Forms.Label lblPrecisaoGPS;
private System.Windows.Forms.Label lblCorrecaoGPS;
private System.Windows.Forms.TextBox txtStatusCarro;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label lblStatusCarro;
private System.Windows.Forms.TextBox txtMargemCorredor;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label lblMargemCorredor;
private System.Windows.Forms.TextBox txtDentroCorredor;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label lblDentroCorredor;
private System.Windows.Forms.TextBox txtDistanciasEsqDir;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lblDistanciaLateral;
private System.Windows.Forms.TabPage tabMapa;
private System.Windows.Forms.TextBox txtDT;
private System.Windows.Forms.Label lblDT;
private System.Windows.Forms.TextBox txtET;
private System.Windows.Forms.Label lblET;
private System.Windows.Forms.TextBox txtDF;
private System.Windows.Forms.Label lblDF;
private System.Windows.Forms.TextBox txtEF;
private System.Windows.Forms.Label lblEF;
}
}

View File

@ -187,6 +187,19 @@ namespace AgroBase.Forms.IHM
txtMargemCorredor.Text = _Sensoriamento.Trajetoria.NaMargemDoCorredor ? "Sim" : "Não";
txtStatusCarro.Text = _Sensoriamento.Trajetoria.StatusCarro.ToString();
var ModET = Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.FirstOrDefault(x => x.Modulo_ID == "ET");
txtET.Text = (ModET?.MovMotor?.Corrente_Motor ?? 0).ToString("0.00");
lblET.ForeColor = (ModET?.Conectado ?? false) ? Color.Green : Color.Red;
var ModDT = Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.FirstOrDefault(x => x.Modulo_ID == "DT");
txtDT.Text = (ModDT?.MovMotor?.Corrente_Motor ?? 0).ToString("0.00");
lblDT.ForeColor = (ModDT?.Conectado ?? false) ? Color.Green : Color.Red;
var ModEF = Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.FirstOrDefault(x => x.Modulo_ID == "EF");
txtEF.Text = (ModEF?.MovMotor?.Corrente_Motor ?? 0).ToString("0.00");
lblEF.ForeColor = (ModEF?.Conectado ?? false) ? Color.Green : Color.Red;
var ModDF = Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos.FirstOrDefault(x => x.Modulo_ID == "DF");
txtDF.Text = (ModDF?.MovMotor?.Corrente_Motor ?? 0).ToString("0.00");
lblDF.ForeColor = (ModDF?.Conectado ?? false) ? Color.Green : Color.Red;
if (frmInstancial.DebugMode)
{
AtualizarMapaDinamico();

View File

@ -105,7 +105,7 @@ namespace AgroBase.Forms
{
var DispMvd = Variaveis.OperacaoEmAndamento.DispMvd;
lblTempoConectado.Text = "Tempo conectado: " + (DateTime.Now - DispMvd.CriadoEm).ToString("HH:mm:ss") + " hrs";
//lblTempoConectado.Text = "Tempo conectado: " + (DateTime.Now - DispMvd.CriadoEm).ToString("HH:mm:ss") + " hrs";
lblTempoEmMovimento.Text = "Tempo em movimento: " + TimeSpan.FromSeconds(DispMvd.Dados.TempoEmAtividade).ToString(@"hh\:mm\:ss") + " hrs";
lblDistanciaTotal.Text = "Distancia percorrida total: " + DispMvd.Dados.DistanciaPercorridaTotal.ToString("0.00") + " m";
lblDistanciaParcial.Text = "Distancia percorrida parcial: " + DispMvd.Dados.DistanciaPercorridaParcial.ToString("0.00") + " m";

View File

@ -76,33 +76,48 @@
this.cmb2 = new System.Windows.Forms.ComboBox();
this.cmb1 = new System.Windows.Forms.ComboBox();
this.cbTipo = new System.Windows.Forms.ComboBox();
this.imgESP32 = new System.Windows.Forms.PictureBox();
this.picMCP = new System.Windows.Forms.PictureBox();
this.cmbB7 = new System.Windows.Forms.ComboBox();
this.cmbB6 = new System.Windows.Forms.ComboBox();
this.cmbB5 = new System.Windows.Forms.ComboBox();
this.cmbB4 = new System.Windows.Forms.ComboBox();
this.cmbB3 = new System.Windows.Forms.ComboBox();
this.cmbB2 = new System.Windows.Forms.ComboBox();
this.cmbB1 = new System.Windows.Forms.ComboBox();
this.cmbB0 = new System.Windows.Forms.ComboBox();
this.cmbA7 = new System.Windows.Forms.ComboBox();
this.cmbA6 = new System.Windows.Forms.ComboBox();
this.cmbA5 = new System.Windows.Forms.ComboBox();
this.cmbA4 = new System.Windows.Forms.ComboBox();
this.cmbA3 = new System.Windows.Forms.ComboBox();
this.cmbA2 = new System.Windows.Forms.ComboBox();
this.cmbA1 = new System.Windows.Forms.ComboBox();
this.cmbA0 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_B7 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_B6 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_B5 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_B4 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_B3 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_B2 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_B1 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_B0 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_A7 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_A6 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_A5 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_A4 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_A3 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_A2 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_A1 = new System.Windows.Forms.ComboBox();
this.cmbMCP1_A0 = new System.Windows.Forms.ComboBox();
this.lblB1 = new System.Windows.Forms.Label();
this.lblA1 = new System.Windows.Forms.Label();
this.txtMCP1 = new System.Windows.Forms.TextBox();
this.lblMCP1 = new System.Windows.Forms.Label();
this.gpbMCP1 = new System.Windows.Forms.GroupBox();
this.chbMCP1 = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.imgESP32)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picMCP)).BeginInit();
this.picMCP = new System.Windows.Forms.PictureBox();
this.gpbADS1 = new System.Windows.Forms.GroupBox();
this.lblADS_A3 = new System.Windows.Forms.Label();
this.lblADS_A2 = new System.Windows.Forms.Label();
this.lblADS_A1 = new System.Windows.Forms.Label();
this.lblADS_A0 = new System.Windows.Forms.Label();
this.cmbADS1_A0 = new System.Windows.Forms.ComboBox();
this.cmbADS1_A1 = new System.Windows.Forms.ComboBox();
this.cmbADS1_A2 = new System.Windows.Forms.ComboBox();
this.cmbADS1_A3 = new System.Windows.Forms.ComboBox();
this.lblADS1 = new System.Windows.Forms.Label();
this.txtADS1 = new System.Windows.Forms.TextBox();
this.picADS = new System.Windows.Forms.PictureBox();
this.chbADS1 = new System.Windows.Forms.CheckBox();
this.imgESP32 = new System.Windows.Forms.PictureBox();
this.gpbMCP1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picMCP)).BeginInit();
this.gpbADS1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picADS)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.imgESP32)).BeginInit();
this.SuspendLayout();
//
// lblPinout
@ -631,203 +646,181 @@
this.cbTipo.TabIndex = 228;
this.cbTipo.SelectedIndexChanged += new System.EventHandler(this.cbTipo_SelectedIndexChanged);
//
// imgESP32
// cmbMCP1_B7
//
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.Name = "imgESP32";
this.imgESP32.Size = new System.Drawing.Size(304, 688);
this.imgESP32.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.imgESP32.TabIndex = 181;
this.imgESP32.TabStop = false;
this.cmbMCP1_B7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_B7.Enabled = false;
this.cmbMCP1_B7.FormattingEnabled = true;
this.cmbMCP1_B7.Location = new System.Drawing.Point(224, 271);
this.cmbMCP1_B7.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_B7.Name = "cmbMCP1_B7";
this.cmbMCP1_B7.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_B7.TabIndex = 237;
//
// picMCP
// cmbMCP1_B6
//
this.picMCP.Image = global::AgroBase.Properties.Resources.mcp;
this.picMCP.Location = new System.Drawing.Point(11, 42);
this.picMCP.Margin = new System.Windows.Forms.Padding(2);
this.picMCP.Name = "picMCP";
this.picMCP.Size = new System.Drawing.Size(208, 262);
this.picMCP.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picMCP.TabIndex = 229;
this.picMCP.TabStop = false;
this.cmbMCP1_B6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_B6.Enabled = false;
this.cmbMCP1_B6.FormattingEnabled = true;
this.cmbMCP1_B6.Location = new System.Drawing.Point(224, 247);
this.cmbMCP1_B6.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_B6.Name = "cmbMCP1_B6";
this.cmbMCP1_B6.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_B6.TabIndex = 236;
//
// cmbB7
// cmbMCP1_B5
//
this.cmbB7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbB7.Enabled = false;
this.cmbB7.FormattingEnabled = true;
this.cmbB7.Location = new System.Drawing.Point(224, 271);
this.cmbB7.Margin = new System.Windows.Forms.Padding(2);
this.cmbB7.Name = "cmbB7";
this.cmbB7.Size = new System.Drawing.Size(112, 21);
this.cmbB7.TabIndex = 237;
this.cmbMCP1_B5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_B5.Enabled = false;
this.cmbMCP1_B5.FormattingEnabled = true;
this.cmbMCP1_B5.Location = new System.Drawing.Point(224, 223);
this.cmbMCP1_B5.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_B5.Name = "cmbMCP1_B5";
this.cmbMCP1_B5.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_B5.TabIndex = 235;
//
// cmbB6
// cmbMCP1_B4
//
this.cmbB6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbB6.Enabled = false;
this.cmbB6.FormattingEnabled = true;
this.cmbB6.Location = new System.Drawing.Point(224, 247);
this.cmbB6.Margin = new System.Windows.Forms.Padding(2);
this.cmbB6.Name = "cmbB6";
this.cmbB6.Size = new System.Drawing.Size(112, 21);
this.cmbB6.TabIndex = 236;
this.cmbMCP1_B4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_B4.Enabled = false;
this.cmbMCP1_B4.FormattingEnabled = true;
this.cmbMCP1_B4.Location = new System.Drawing.Point(224, 198);
this.cmbMCP1_B4.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_B4.Name = "cmbMCP1_B4";
this.cmbMCP1_B4.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_B4.TabIndex = 234;
//
// cmbB5
// cmbMCP1_B3
//
this.cmbB5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbB5.Enabled = false;
this.cmbB5.FormattingEnabled = true;
this.cmbB5.Location = new System.Drawing.Point(224, 223);
this.cmbB5.Margin = new System.Windows.Forms.Padding(2);
this.cmbB5.Name = "cmbB5";
this.cmbB5.Size = new System.Drawing.Size(112, 21);
this.cmbB5.TabIndex = 235;
this.cmbMCP1_B3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_B3.Enabled = false;
this.cmbMCP1_B3.FormattingEnabled = true;
this.cmbMCP1_B3.Location = new System.Drawing.Point(224, 173);
this.cmbMCP1_B3.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_B3.Name = "cmbMCP1_B3";
this.cmbMCP1_B3.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_B3.TabIndex = 233;
//
// cmbB4
// cmbMCP1_B2
//
this.cmbB4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbB4.Enabled = false;
this.cmbB4.FormattingEnabled = true;
this.cmbB4.Location = new System.Drawing.Point(224, 198);
this.cmbB4.Margin = new System.Windows.Forms.Padding(2);
this.cmbB4.Name = "cmbB4";
this.cmbB4.Size = new System.Drawing.Size(112, 21);
this.cmbB4.TabIndex = 234;
this.cmbMCP1_B2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_B2.Enabled = false;
this.cmbMCP1_B2.FormattingEnabled = true;
this.cmbMCP1_B2.Location = new System.Drawing.Point(224, 150);
this.cmbMCP1_B2.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_B2.Name = "cmbMCP1_B2";
this.cmbMCP1_B2.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_B2.TabIndex = 232;
//
// cmbB3
// cmbMCP1_B1
//
this.cmbB3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbB3.Enabled = false;
this.cmbB3.FormattingEnabled = true;
this.cmbB3.Location = new System.Drawing.Point(224, 173);
this.cmbB3.Margin = new System.Windows.Forms.Padding(2);
this.cmbB3.Name = "cmbB3";
this.cmbB3.Size = new System.Drawing.Size(112, 21);
this.cmbB3.TabIndex = 233;
this.cmbMCP1_B1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_B1.Enabled = false;
this.cmbMCP1_B1.FormattingEnabled = true;
this.cmbMCP1_B1.Location = new System.Drawing.Point(224, 125);
this.cmbMCP1_B1.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_B1.Name = "cmbMCP1_B1";
this.cmbMCP1_B1.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_B1.TabIndex = 231;
//
// cmbB2
// cmbMCP1_B0
//
this.cmbB2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbB2.Enabled = false;
this.cmbB2.FormattingEnabled = true;
this.cmbB2.Location = new System.Drawing.Point(224, 150);
this.cmbB2.Margin = new System.Windows.Forms.Padding(2);
this.cmbB2.Name = "cmbB2";
this.cmbB2.Size = new System.Drawing.Size(112, 21);
this.cmbB2.TabIndex = 232;
this.cmbMCP1_B0.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_B0.Enabled = false;
this.cmbMCP1_B0.FormattingEnabled = true;
this.cmbMCP1_B0.Location = new System.Drawing.Point(224, 101);
this.cmbMCP1_B0.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_B0.Name = "cmbMCP1_B0";
this.cmbMCP1_B0.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_B0.TabIndex = 230;
//
// cmbB1
// cmbMCP1_A7
//
this.cmbB1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbB1.Enabled = false;
this.cmbB1.FormattingEnabled = true;
this.cmbB1.Location = new System.Drawing.Point(224, 125);
this.cmbB1.Margin = new System.Windows.Forms.Padding(2);
this.cmbB1.Name = "cmbB1";
this.cmbB1.Size = new System.Drawing.Size(112, 21);
this.cmbB1.TabIndex = 231;
this.cmbMCP1_A7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_A7.Enabled = false;
this.cmbMCP1_A7.FormattingEnabled = true;
this.cmbMCP1_A7.Location = new System.Drawing.Point(351, 271);
this.cmbMCP1_A7.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_A7.Name = "cmbMCP1_A7";
this.cmbMCP1_A7.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_A7.TabIndex = 245;
//
// cmbB0
// cmbMCP1_A6
//
this.cmbB0.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbB0.Enabled = false;
this.cmbB0.FormattingEnabled = true;
this.cmbB0.Location = new System.Drawing.Point(224, 101);
this.cmbB0.Margin = new System.Windows.Forms.Padding(2);
this.cmbB0.Name = "cmbB0";
this.cmbB0.Size = new System.Drawing.Size(112, 21);
this.cmbB0.TabIndex = 230;
this.cmbMCP1_A6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_A6.Enabled = false;
this.cmbMCP1_A6.FormattingEnabled = true;
this.cmbMCP1_A6.Location = new System.Drawing.Point(351, 247);
this.cmbMCP1_A6.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_A6.Name = "cmbMCP1_A6";
this.cmbMCP1_A6.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_A6.TabIndex = 244;
//
// cmbA7
// cmbMCP1_A5
//
this.cmbA7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbA7.Enabled = false;
this.cmbA7.FormattingEnabled = true;
this.cmbA7.Location = new System.Drawing.Point(351, 271);
this.cmbA7.Margin = new System.Windows.Forms.Padding(2);
this.cmbA7.Name = "cmbA7";
this.cmbA7.Size = new System.Drawing.Size(112, 21);
this.cmbA7.TabIndex = 245;
this.cmbMCP1_A5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_A5.Enabled = false;
this.cmbMCP1_A5.FormattingEnabled = true;
this.cmbMCP1_A5.Location = new System.Drawing.Point(351, 223);
this.cmbMCP1_A5.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_A5.Name = "cmbMCP1_A5";
this.cmbMCP1_A5.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_A5.TabIndex = 243;
//
// cmbA6
// cmbMCP1_A4
//
this.cmbA6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbA6.Enabled = false;
this.cmbA6.FormattingEnabled = true;
this.cmbA6.Location = new System.Drawing.Point(351, 247);
this.cmbA6.Margin = new System.Windows.Forms.Padding(2);
this.cmbA6.Name = "cmbA6";
this.cmbA6.Size = new System.Drawing.Size(112, 21);
this.cmbA6.TabIndex = 244;
this.cmbMCP1_A4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_A4.Enabled = false;
this.cmbMCP1_A4.FormattingEnabled = true;
this.cmbMCP1_A4.Location = new System.Drawing.Point(351, 198);
this.cmbMCP1_A4.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_A4.Name = "cmbMCP1_A4";
this.cmbMCP1_A4.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_A4.TabIndex = 242;
//
// cmbA5
// cmbMCP1_A3
//
this.cmbA5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbA5.Enabled = false;
this.cmbA5.FormattingEnabled = true;
this.cmbA5.Location = new System.Drawing.Point(351, 223);
this.cmbA5.Margin = new System.Windows.Forms.Padding(2);
this.cmbA5.Name = "cmbA5";
this.cmbA5.Size = new System.Drawing.Size(112, 21);
this.cmbA5.TabIndex = 243;
this.cmbMCP1_A3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_A3.Enabled = false;
this.cmbMCP1_A3.FormattingEnabled = true;
this.cmbMCP1_A3.Location = new System.Drawing.Point(351, 173);
this.cmbMCP1_A3.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_A3.Name = "cmbMCP1_A3";
this.cmbMCP1_A3.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_A3.TabIndex = 241;
//
// cmbA4
// cmbMCP1_A2
//
this.cmbA4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbA4.Enabled = false;
this.cmbA4.FormattingEnabled = true;
this.cmbA4.Location = new System.Drawing.Point(351, 198);
this.cmbA4.Margin = new System.Windows.Forms.Padding(2);
this.cmbA4.Name = "cmbA4";
this.cmbA4.Size = new System.Drawing.Size(112, 21);
this.cmbA4.TabIndex = 242;
this.cmbMCP1_A2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_A2.Enabled = false;
this.cmbMCP1_A2.FormattingEnabled = true;
this.cmbMCP1_A2.Location = new System.Drawing.Point(351, 150);
this.cmbMCP1_A2.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_A2.Name = "cmbMCP1_A2";
this.cmbMCP1_A2.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_A2.TabIndex = 240;
//
// cmbA3
// cmbMCP1_A1
//
this.cmbA3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbA3.Enabled = false;
this.cmbA3.FormattingEnabled = true;
this.cmbA3.Location = new System.Drawing.Point(351, 173);
this.cmbA3.Margin = new System.Windows.Forms.Padding(2);
this.cmbA3.Name = "cmbA3";
this.cmbA3.Size = new System.Drawing.Size(112, 21);
this.cmbA3.TabIndex = 241;
this.cmbMCP1_A1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_A1.Enabled = false;
this.cmbMCP1_A1.FormattingEnabled = true;
this.cmbMCP1_A1.Location = new System.Drawing.Point(351, 125);
this.cmbMCP1_A1.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_A1.Name = "cmbMCP1_A1";
this.cmbMCP1_A1.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_A1.TabIndex = 239;
//
// cmbA2
// cmbMCP1_A0
//
this.cmbA2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbA2.Enabled = false;
this.cmbA2.FormattingEnabled = true;
this.cmbA2.Location = new System.Drawing.Point(351, 150);
this.cmbA2.Margin = new System.Windows.Forms.Padding(2);
this.cmbA2.Name = "cmbA2";
this.cmbA2.Size = new System.Drawing.Size(112, 21);
this.cmbA2.TabIndex = 240;
//
// cmbA1
//
this.cmbA1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbA1.Enabled = false;
this.cmbA1.FormattingEnabled = true;
this.cmbA1.Location = new System.Drawing.Point(351, 125);
this.cmbA1.Margin = new System.Windows.Forms.Padding(2);
this.cmbA1.Name = "cmbA1";
this.cmbA1.Size = new System.Drawing.Size(112, 21);
this.cmbA1.TabIndex = 239;
//
// cmbA0
//
this.cmbA0.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbA0.Enabled = false;
this.cmbA0.FormattingEnabled = true;
this.cmbA0.Location = new System.Drawing.Point(351, 101);
this.cmbA0.Margin = new System.Windows.Forms.Padding(2);
this.cmbA0.Name = "cmbA0";
this.cmbA0.Size = new System.Drawing.Size(112, 21);
this.cmbA0.TabIndex = 238;
this.cmbMCP1_A0.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMCP1_A0.Enabled = false;
this.cmbMCP1_A0.FormattingEnabled = true;
this.cmbMCP1_A0.Location = new System.Drawing.Point(351, 101);
this.cmbMCP1_A0.Margin = new System.Windows.Forms.Padding(2);
this.cmbMCP1_A0.Name = "cmbMCP1_A0";
this.cmbMCP1_A0.Size = new System.Drawing.Size(112, 21);
this.cmbMCP1_A0.TabIndex = 238;
//
// lblB1
//
@ -878,25 +871,25 @@
this.gpbMCP1.Controls.Add(this.chbMCP1);
this.gpbMCP1.Controls.Add(this.picMCP);
this.gpbMCP1.Controls.Add(this.lblMCP1);
this.gpbMCP1.Controls.Add(this.cmbB0);
this.gpbMCP1.Controls.Add(this.cmbMCP1_B0);
this.gpbMCP1.Controls.Add(this.txtMCP1);
this.gpbMCP1.Controls.Add(this.cmbB1);
this.gpbMCP1.Controls.Add(this.cmbMCP1_B1);
this.gpbMCP1.Controls.Add(this.lblA1);
this.gpbMCP1.Controls.Add(this.cmbB2);
this.gpbMCP1.Controls.Add(this.cmbMCP1_B2);
this.gpbMCP1.Controls.Add(this.lblB1);
this.gpbMCP1.Controls.Add(this.cmbB3);
this.gpbMCP1.Controls.Add(this.cmbA7);
this.gpbMCP1.Controls.Add(this.cmbB4);
this.gpbMCP1.Controls.Add(this.cmbA6);
this.gpbMCP1.Controls.Add(this.cmbB5);
this.gpbMCP1.Controls.Add(this.cmbA5);
this.gpbMCP1.Controls.Add(this.cmbB6);
this.gpbMCP1.Controls.Add(this.cmbA4);
this.gpbMCP1.Controls.Add(this.cmbB7);
this.gpbMCP1.Controls.Add(this.cmbA3);
this.gpbMCP1.Controls.Add(this.cmbA0);
this.gpbMCP1.Controls.Add(this.cmbA2);
this.gpbMCP1.Controls.Add(this.cmbA1);
this.gpbMCP1.Controls.Add(this.cmbMCP1_B3);
this.gpbMCP1.Controls.Add(this.cmbMCP1_A7);
this.gpbMCP1.Controls.Add(this.cmbMCP1_B4);
this.gpbMCP1.Controls.Add(this.cmbMCP1_A6);
this.gpbMCP1.Controls.Add(this.cmbMCP1_B5);
this.gpbMCP1.Controls.Add(this.cmbMCP1_A5);
this.gpbMCP1.Controls.Add(this.cmbMCP1_B6);
this.gpbMCP1.Controls.Add(this.cmbMCP1_A4);
this.gpbMCP1.Controls.Add(this.cmbMCP1_B7);
this.gpbMCP1.Controls.Add(this.cmbMCP1_A3);
this.gpbMCP1.Controls.Add(this.cmbMCP1_A0);
this.gpbMCP1.Controls.Add(this.cmbMCP1_A2);
this.gpbMCP1.Controls.Add(this.cmbMCP1_A1);
this.gpbMCP1.Location = new System.Drawing.Point(569, 10);
this.gpbMCP1.Margin = new System.Windows.Forms.Padding(2);
this.gpbMCP1.Name = "gpbMCP1";
@ -916,7 +909,183 @@
this.chbMCP1.TabIndex = 250;
this.chbMCP1.Text = "MCP23017 conectado";
this.chbMCP1.UseVisualStyleBackColor = true;
this.chbMCP1.CheckedChanged += new System.EventHandler(this.chbMCP_CheckedChanged);
this.chbMCP1.CheckedChanged += new System.EventHandler(this.chbExpansor_CheckedChanged);
//
// picMCP
//
this.picMCP.Image = global::AgroBase.Properties.Resources.mcp;
this.picMCP.Location = new System.Drawing.Point(11, 42);
this.picMCP.Margin = new System.Windows.Forms.Padding(2);
this.picMCP.Name = "picMCP";
this.picMCP.Size = new System.Drawing.Size(208, 262);
this.picMCP.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picMCP.TabIndex = 229;
this.picMCP.TabStop = false;
//
// gpbADS1
//
this.gpbADS1.Controls.Add(this.lblADS_A3);
this.gpbADS1.Controls.Add(this.lblADS_A2);
this.gpbADS1.Controls.Add(this.lblADS_A1);
this.gpbADS1.Controls.Add(this.lblADS_A0);
this.gpbADS1.Controls.Add(this.cmbADS1_A0);
this.gpbADS1.Controls.Add(this.cmbADS1_A1);
this.gpbADS1.Controls.Add(this.cmbADS1_A2);
this.gpbADS1.Controls.Add(this.cmbADS1_A3);
this.gpbADS1.Controls.Add(this.lblADS1);
this.gpbADS1.Controls.Add(this.txtADS1);
this.gpbADS1.Controls.Add(this.picADS);
this.gpbADS1.Controls.Add(this.chbADS1);
this.gpbADS1.Location = new System.Drawing.Point(569, 328);
this.gpbADS1.Name = "gpbADS1";
this.gpbADS1.Size = new System.Drawing.Size(474, 321);
this.gpbADS1.TabIndex = 251;
this.gpbADS1.TabStop = false;
this.gpbADS1.Text = "Expansor ADC";
//
// lblADS_A3
//
this.lblADS_A3.AutoSize = true;
this.lblADS_A3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblADS_A3.Location = new System.Drawing.Point(224, 274);
this.lblADS_A3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblADS_A3.Name = "lblADS_A3";
this.lblADS_A3.Size = new System.Drawing.Size(35, 24);
this.lblADS_A3.TabIndex = 262;
this.lblADS_A3.Text = "A3";
//
// lblADS_A2
//
this.lblADS_A2.AutoSize = true;
this.lblADS_A2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblADS_A2.Location = new System.Drawing.Point(224, 250);
this.lblADS_A2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblADS_A2.Name = "lblADS_A2";
this.lblADS_A2.Size = new System.Drawing.Size(35, 24);
this.lblADS_A2.TabIndex = 261;
this.lblADS_A2.Text = "A2";
//
// lblADS_A1
//
this.lblADS_A1.AutoSize = true;
this.lblADS_A1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblADS_A1.Location = new System.Drawing.Point(224, 226);
this.lblADS_A1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblADS_A1.Name = "lblADS_A1";
this.lblADS_A1.Size = new System.Drawing.Size(35, 24);
this.lblADS_A1.TabIndex = 260;
this.lblADS_A1.Text = "A1";
//
// lblADS_A0
//
this.lblADS_A0.AutoSize = true;
this.lblADS_A0.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblADS_A0.Location = new System.Drawing.Point(224, 202);
this.lblADS_A0.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblADS_A0.Name = "lblADS_A0";
this.lblADS_A0.Size = new System.Drawing.Size(35, 24);
this.lblADS_A0.TabIndex = 259;
this.lblADS_A0.Text = "A0";
//
// cmbADS1_A0
//
this.cmbADS1_A0.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbADS1_A0.Enabled = false;
this.cmbADS1_A0.FormattingEnabled = true;
this.cmbADS1_A0.Location = new System.Drawing.Point(351, 205);
this.cmbADS1_A0.Margin = new System.Windows.Forms.Padding(2);
this.cmbADS1_A0.Name = "cmbADS1_A0";
this.cmbADS1_A0.Size = new System.Drawing.Size(112, 21);
this.cmbADS1_A0.TabIndex = 255;
//
// cmbADS1_A1
//
this.cmbADS1_A1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbADS1_A1.Enabled = false;
this.cmbADS1_A1.FormattingEnabled = true;
this.cmbADS1_A1.Location = new System.Drawing.Point(351, 230);
this.cmbADS1_A1.Margin = new System.Windows.Forms.Padding(2);
this.cmbADS1_A1.Name = "cmbADS1_A1";
this.cmbADS1_A1.Size = new System.Drawing.Size(112, 21);
this.cmbADS1_A1.TabIndex = 256;
//
// cmbADS1_A2
//
this.cmbADS1_A2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbADS1_A2.Enabled = false;
this.cmbADS1_A2.FormattingEnabled = true;
this.cmbADS1_A2.Location = new System.Drawing.Point(351, 255);
this.cmbADS1_A2.Margin = new System.Windows.Forms.Padding(2);
this.cmbADS1_A2.Name = "cmbADS1_A2";
this.cmbADS1_A2.Size = new System.Drawing.Size(112, 21);
this.cmbADS1_A2.TabIndex = 257;
//
// cmbADS1_A3
//
this.cmbADS1_A3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbADS1_A3.Enabled = false;
this.cmbADS1_A3.FormattingEnabled = true;
this.cmbADS1_A3.Location = new System.Drawing.Point(351, 280);
this.cmbADS1_A3.Margin = new System.Windows.Forms.Padding(2);
this.cmbADS1_A3.Name = "cmbADS1_A3";
this.cmbADS1_A3.Size = new System.Drawing.Size(112, 21);
this.cmbADS1_A3.TabIndex = 258;
//
// lblADS1
//
this.lblADS1.AutoSize = true;
this.lblADS1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblADS1.Location = new System.Drawing.Point(224, 44);
this.lblADS1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblADS1.Name = "lblADS1";
this.lblADS1.Size = new System.Drawing.Size(119, 20);
this.lblADS1.TabIndex = 254;
this.lblADS1.Text = "Endereço I2C";
//
// txtADS1
//
this.txtADS1.Enabled = false;
this.txtADS1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtADS1.Location = new System.Drawing.Point(351, 41);
this.txtADS1.Margin = new System.Windows.Forms.Padding(2);
this.txtADS1.Name = "txtADS1";
this.txtADS1.Size = new System.Drawing.Size(112, 26);
this.txtADS1.TabIndex = 253;
this.txtADS1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// picADS
//
this.picADS.Image = global::AgroBase.Properties.Resources.ads;
this.picADS.Location = new System.Drawing.Point(11, 41);
this.picADS.Margin = new System.Windows.Forms.Padding(2);
this.picADS.Name = "picADS";
this.picADS.Size = new System.Drawing.Size(208, 262);
this.picADS.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picADS.TabIndex = 252;
this.picADS.TabStop = false;
//
// chbADS1
//
this.chbADS1.AutoSize = true;
this.chbADS1.Location = new System.Drawing.Point(11, 20);
this.chbADS1.Margin = new System.Windows.Forms.Padding(2);
this.chbADS1.Name = "chbADS1";
this.chbADS1.Size = new System.Drawing.Size(126, 17);
this.chbADS1.TabIndex = 251;
this.chbADS1.Text = "ADS1115 conectado";
this.chbADS1.UseVisualStyleBackColor = true;
this.chbADS1.CheckedChanged += new System.EventHandler(this.chbExpansor_CheckedChanged);
//
// 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.Name = "imgESP32";
this.imgESP32.Size = new System.Drawing.Size(304, 688);
this.imgESP32.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.imgESP32.TabIndex = 181;
this.imgESP32.TabStop = false;
//
// frmPinout
//
@ -924,6 +1093,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1056, 697);
this.Controls.Add(this.gpbADS1);
this.Controls.Add(this.gpbMCP1);
this.Controls.Add(this.cbTipo);
this.Controls.Add(this.lblPinout);
@ -979,10 +1149,13 @@
this.Text = "Pinout";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmPinout_FormClosing);
this.Load += new System.EventHandler(this.frmPinout_Load);
((System.ComponentModel.ISupportInitialize)(this.imgESP32)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picMCP)).EndInit();
this.gpbMCP1.ResumeLayout(false);
this.gpbMCP1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picMCP)).EndInit();
this.gpbADS1.ResumeLayout(false);
this.gpbADS1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picADS)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.imgESP32)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -1039,27 +1212,40 @@
private System.Windows.Forms.PictureBox imgESP32;
private System.Windows.Forms.ComboBox cbTipo;
private System.Windows.Forms.PictureBox picMCP;
private System.Windows.Forms.ComboBox cmbB7;
private System.Windows.Forms.ComboBox cmbB6;
private System.Windows.Forms.ComboBox cmbB5;
private System.Windows.Forms.ComboBox cmbB4;
private System.Windows.Forms.ComboBox cmbB3;
private System.Windows.Forms.ComboBox cmbB2;
private System.Windows.Forms.ComboBox cmbB1;
private System.Windows.Forms.ComboBox cmbB0;
private System.Windows.Forms.ComboBox cmbA7;
private System.Windows.Forms.ComboBox cmbA6;
private System.Windows.Forms.ComboBox cmbA5;
private System.Windows.Forms.ComboBox cmbA4;
private System.Windows.Forms.ComboBox cmbA3;
private System.Windows.Forms.ComboBox cmbA2;
private System.Windows.Forms.ComboBox cmbA1;
private System.Windows.Forms.ComboBox cmbA0;
private System.Windows.Forms.ComboBox cmbMCP1_B7;
private System.Windows.Forms.ComboBox cmbMCP1_B6;
private System.Windows.Forms.ComboBox cmbMCP1_B5;
private System.Windows.Forms.ComboBox cmbMCP1_B4;
private System.Windows.Forms.ComboBox cmbMCP1_B3;
private System.Windows.Forms.ComboBox cmbMCP1_B2;
private System.Windows.Forms.ComboBox cmbMCP1_B1;
private System.Windows.Forms.ComboBox cmbMCP1_B0;
private System.Windows.Forms.ComboBox cmbMCP1_A7;
private System.Windows.Forms.ComboBox cmbMCP1_A6;
private System.Windows.Forms.ComboBox cmbMCP1_A5;
private System.Windows.Forms.ComboBox cmbMCP1_A4;
private System.Windows.Forms.ComboBox cmbMCP1_A3;
private System.Windows.Forms.ComboBox cmbMCP1_A2;
private System.Windows.Forms.ComboBox cmbMCP1_A1;
private System.Windows.Forms.ComboBox cmbMCP1_A0;
private System.Windows.Forms.Label lblB1;
private System.Windows.Forms.Label lblA1;
private System.Windows.Forms.TextBox txtMCP1;
private System.Windows.Forms.Label lblMCP1;
private System.Windows.Forms.GroupBox gpbMCP1;
private System.Windows.Forms.CheckBox chbMCP1;
private System.Windows.Forms.GroupBox gpbADS1;
private System.Windows.Forms.CheckBox chbADS1;
private System.Windows.Forms.PictureBox picADS;
private System.Windows.Forms.Label lblADS1;
private System.Windows.Forms.TextBox txtADS1;
private System.Windows.Forms.Label lblADS_A0;
private System.Windows.Forms.ComboBox cmbADS1_A0;
private System.Windows.Forms.ComboBox cmbADS1_A1;
private System.Windows.Forms.ComboBox cmbADS1_A2;
private System.Windows.Forms.ComboBox cmbADS1_A3;
private System.Windows.Forms.Label lblADS_A3;
private System.Windows.Forms.Label lblADS_A2;
private System.Windows.Forms.Label lblADS_A1;
}
}

View File

@ -43,7 +43,7 @@ namespace AgroBase.Forms
Pinout = new PinoutDataModel()
{
ExpansorGPIO = false,
EnderecoExpansor = "",
EnderecoGPIO = "",
Pinos = new List<PinoutModel>(),
};
Dispositivos = new List<DispositivoDataModel>();
@ -150,7 +150,10 @@ namespace AgroBase.Forms
}
chbMCP1.Checked = Pinout.ExpansorGPIO;
txtMCP1.Text = Pinout.EnderecoExpansor;
txtMCP1.Text = Pinout.EnderecoGPIO;
chbADS1.Checked = Pinout.ExpansorADS;
txtADS1.Text = Pinout.EnderecoADS;
Funcoes.ForEach(x => Pinos.Add(TipoDisp.ToString() + " " + Enum.GetName(typeof(FuncoesPinout), x)));
@ -161,6 +164,7 @@ namespace AgroBase.Forms
List<ComboBox> cmbs = this.Controls.OfType<ComboBox>().Where(x => x.Name.Contains("cmb")).ToList();
cmbs.AddRange(gpbMCP1.Controls.OfType<ComboBox>().ToList());
cmbs.AddRange(gpbADS1.Controls.OfType<ComboBox>().ToList());
foreach (var cmb in cmbs)
{
cmb.SelectedIndexChanged -= Cmb_SelectedIndexChanged;
@ -169,10 +173,15 @@ namespace AgroBase.Forms
Pinos.ForEach(x => cmb.Items.Add(x));
cmb.SelectedIndex = 0;
var Selecionado = Pinout.Pinos.FirstOrDefault(x => x.Descricao == cmb.Name.Replace("cmb", ""));
string pino = cmb.Name.Replace("cmb", "").Replace("MCP1_", "").Replace("ADS1_", "");
var Selecionado = Pinout.Pinos.FirstOrDefault(x => x.Descricao == pino);
if (Selecionado != null)
{
cmb.Enabled = (Selecionado.Barramento == TiposBarramentos.CONTROLADOR && Selecionado.Habilitado) || (Selecionado.Barramento == TiposBarramentos.EXPANSORI2C && chbMCP1.Checked);
cmb.Enabled =
(Selecionado.Barramento == TiposBarramentos.CONTROLADOR && Selecionado.Habilitado) ||
(Selecionado.Barramento == TiposBarramentos.EXPANSOR_GPIO && chbMCP1.Checked) ||
(Selecionado.Barramento == TiposBarramentos.EXPANSOR_ADS && chbADS1.Checked);
if (Selecionado.Habilitado)
{
cmb.SelectedItem = Selecionado.ComponenteID + " " + Enum.GetName(typeof(FuncoesPinout), Selecionado.Funcao);
@ -204,20 +213,28 @@ namespace AgroBase.Forms
List<ComboBox> cmbs = this.Controls.OfType<ComboBox>().Where(x => x.Name.Contains("cmb") && x.Enabled && x.Visible).ToList();
cmbs.AddRange(gpbMCP1.Controls.OfType<ComboBox>().ToList());
cmbs.AddRange(gpbADS1.Controls.OfType<ComboBox>().ToList());
foreach (var cmb in cmbs)
{
string ComponenteID = cmb.SelectedItem.ToString().Split(' ').Length > 1 ? cmb.SelectedItem.ToString().Split(' ')[0] : "";
FuncoesPinout Funcao = (FuncoesPinout)Enum.Parse(typeof(FuncoesPinout), ComponenteID != "" ? (cmb.SelectedItem.ToString().Split(' ')[1]) : cmb.SelectedItem.ToString());
if (Pinout.Pinos.Any(x => x.Descricao == cmb.Name.Replace("cmb", "")))
string pino = cmb.Name.Replace("cmb", "").Replace("MCP1_", "").Replace("ADS1_", "");
if (Pinout.Pinos.Any(x => x.Descricao == pino))
{
Pinout.Pinos.FirstOrDefault(x => x.Descricao == cmb.Name.Replace("cmb", "")).Funcao = Funcao;
Pinout.Pinos.FirstOrDefault(x => x.Descricao == cmb.Name.Replace("cmb", "")).ComponenteID = ComponenteID;
Pinout.Pinos.FirstOrDefault(x => x.Descricao == cmb.Name.Replace("cmb", "")).Barramento = cmb.Name.Contains("A") || cmb.Name.Contains("B") ? TiposBarramentos.EXPANSORI2C : TiposBarramentos.CONTROLADOR;
Pinout.Pinos.FirstOrDefault(x => x.Descricao == pino).Funcao = Funcao;
Pinout.Pinos.FirstOrDefault(x => x.Descricao == pino).ComponenteID = ComponenteID;
Pinout.Pinos.FirstOrDefault(x => x.Descricao == pino).Barramento =
cmb.Name.Contains("MCP") ? TiposBarramentos.EXPANSOR_GPIO :
cmb.Name.Contains("ADS") ? TiposBarramentos.EXPANSOR_ADS :
TiposBarramentos.CONTROLADOR;
}
}
Pinout.ExpansorGPIO = chbMCP1.Checked;
Pinout.EnderecoExpansor = txtMCP1.Text;
Pinout.EnderecoGPIO = txtMCP1.Text;
Pinout.ExpansorADS = chbADS1.Checked;
Pinout.EnderecoADS = txtADS1.Text;
VersaoArquivoModel arquivo = VersionamentoService.ArquivoPinout(TipoDisp);
if (arquivo != null)
@ -260,7 +277,7 @@ namespace AgroBase.Forms
Pinout = new PinoutDataModel()
{
ExpansorGPIO = false,
EnderecoExpansor = "",
EnderecoGPIO = "",
Pinos = PinoutModel.CarregarPinoutPadrao_S3(),
};
break;
@ -272,7 +289,7 @@ namespace AgroBase.Forms
Pinout = new PinoutDataModel()
{
ExpansorGPIO = false,
EnderecoExpansor = "",
EnderecoGPIO = "",
Pinos = PinoutModel.CarregarPinoutPadrao_Wrover(),
};
break;
@ -290,15 +307,22 @@ namespace AgroBase.Forms
chbMCP1.Checked = Pinout.ExpansorGPIO;
}
private void chbMCP_CheckedChanged(object sender, EventArgs e)
private void chbExpansor_CheckedChanged(object sender, EventArgs e)
{
CheckBox chb = (CheckBox)sender;
AtualizarCombosMCP(chb);
CheckBox chb = sender as CheckBox;
if (chb.Name.Contains("MCP"))
{
AtualizarCombosMCP(chb);
}
else if (chb.Name.Contains("ADS"))
{
AtualizarCombosADS(chb);
}
}
private void AtualizarCombosMCP(CheckBox chb)
{
if (chb.Checked && !Pinout.Pinos.Any(x => x.Barramento == TiposBarramentos.EXPANSORI2C))
if (chb.Checked && !Pinout.Pinos.Any(x => x.Barramento == TiposBarramentos.EXPANSOR_GPIO))
{
Pinout.Pinos.AddRange(PinoutModel.CarregarPinoutPadrao_MCP());
}
@ -312,6 +336,21 @@ namespace AgroBase.Forms
txt.Enabled = chb.Checked;
}
private void AtualizarCombosADS(CheckBox chb)
{
if (chb.Checked && !Pinout.Pinos.Any(x => x.Barramento == TiposBarramentos.EXPANSOR_ADS))
{
Pinout.Pinos.AddRange(PinoutModel.CarregarPinoutPadrao_ADS());
}
string ID = chb.Name.Replace("chbADS", "");
GroupBox gpb = this.Controls.OfType<GroupBox>().FirstOrDefault(x => x.Name == "gpbADS" + ID);
foreach (var cmb in gpb.Controls.OfType<ComboBox>())
{
cmb.Enabled = chb.Checked;
}
TextBox txt = gpb.Controls.OfType<TextBox>().FirstOrDefault(x => x.Name == "txtADS" + ID);
txt.Enabled = chb.Checked;
}
}
class DispositivoDataModel

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

View File

@ -520,6 +520,7 @@ namespace AgroBase
else if (Comando.Comando == Keys.Add)
{
Comando.Dispositivo = T_Code.Mov;
Controle = Variaveis.OperacaoEmAndamento.Controle.TiposControle.FirstOrDefault(x => x.Tipo == Comando.Dispositivo);
DirecaoAtual = Controle?.UltimaDirecao ?? Direcao.Parado;
Variaveis.OperacaoEmAndamento.Controle.PercentualVelocidadeSP++;
Pressionado = true;
@ -527,6 +528,7 @@ namespace AgroBase
else if (Comando.Comando == Keys.Subtract)
{
Comando.Dispositivo = T_Code.Mov;
Controle = Variaveis.OperacaoEmAndamento.Controle.TiposControle.FirstOrDefault(x => x.Tipo == Comando.Dispositivo);
DirecaoAtual = Controle?.UltimaDirecao ?? Direcao.Parado;
Variaveis.OperacaoEmAndamento.Controle.PercentualVelocidadeSP--;
Pressionado = true;
@ -645,7 +647,8 @@ namespace AgroBase
}
}
Controle = Variaveis.OperacaoEmAndamento.Controle.TiposControle.FirstOrDefault(x => x.Tipo == Comando.Dispositivo);
if (Controle != null)
{
Controle.UltimaDirecao = DirecaoAtual;

View File

@ -724,7 +724,7 @@ namespace AgroBase.Models.Modules
var _pinout = new PinoutDataModel()
{
ExpansorGPIO = Pinout.ExpansorGPIO,
EnderecoExpansor = Pinout.EnderecoExpansor,
EnderecoGPIO = Pinout.EnderecoGPIO,
Pinos = Pinout.Pinos.ToList(),
};
_pinout.Pinos = _pinout.Pinos.Where(x => x.ComponenteID == ID).ToList();
@ -867,7 +867,7 @@ namespace AgroBase.Models.Modules
var _pinout = new PinoutDataModel()
{
ExpansorGPIO = Pinout.ExpansorGPIO,
EnderecoExpansor = Pinout.EnderecoExpansor,
EnderecoGPIO = Pinout.EnderecoGPIO,
Pinos = Pinout.Pinos.ToList(),
};
_pinout.Pinos = _pinout.Pinos.Where(x => x.ComponenteID == ID).ToList();

View File

@ -473,7 +473,7 @@ namespace AgroBase.Models.Modules
var _pinout = new PinoutDataModel()
{
ExpansorGPIO = Pinout.ExpansorGPIO,
EnderecoExpansor = Pinout.EnderecoExpansor,
EnderecoGPIO = Pinout.EnderecoGPIO,
Pinos = Pinout.Pinos.ToList(),
};
_pinout.Pinos = _pinout.Pinos.Where(x => x.ComponenteID == T_Code.Mvd.ToString()).ToList();
@ -908,7 +908,7 @@ namespace AgroBase.Models.Modules
var _pinout = new PinoutDataModel()
{
ExpansorGPIO = ModuloMvdModel.Pinout.ExpansorGPIO,
EnderecoExpansor = ModuloMvdModel.Pinout.EnderecoExpansor,
EnderecoGPIO = ModuloMvdModel.Pinout.EnderecoGPIO,
Pinos = ModuloMvdModel.Pinout.Pinos.ToList(),
};
_pinout.Pinos = _pinout.Pinos.Where(x => x.ComponenteID == ID).ToList();

View File

@ -10,7 +10,9 @@ namespace AgroBase.Models.Modules
public class PinoutDataModel
{
public bool ExpansorGPIO { get; set; }
public string EnderecoExpansor { get; set; }
public string EnderecoGPIO { get; set; }
public bool ExpansorADS { get; set; }
public string EnderecoADS { get; set; }
public List<PinoutModel> Pinos { get; set; }
}
@ -229,22 +231,35 @@ namespace AgroBase.Models.Modules
{
List<PinoutModel> Pinout = new List<PinoutModel>()
{
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 0, ComponenteID = "", Descricao = "A0", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 1, ComponenteID = "", Descricao = "A1", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 2, ComponenteID = "", Descricao = "A2", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 3, ComponenteID = "", Descricao = "A3", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 4, ComponenteID = "", Descricao = "A4", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 5, ComponenteID = "", Descricao = "A5", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 6, ComponenteID = "", Descricao = "A6", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 7, ComponenteID = "", Descricao = "A7", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 8, ComponenteID = "", Descricao = "B0", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 9, ComponenteID = "", Descricao = "B1", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 10, ComponenteID = "", Descricao = "B2", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 11, ComponenteID = "", Descricao = "B3", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 12, ComponenteID = "", Descricao = "B4", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 13, ComponenteID = "", Descricao = "B5", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 14, ComponenteID = "", Descricao = "B6", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 15, ComponenteID = "", Descricao = "B7", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 0, ComponenteID = "", Descricao = "A0", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 1, ComponenteID = "", Descricao = "A1", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 2, ComponenteID = "", Descricao = "A2", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 3, ComponenteID = "", Descricao = "A3", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 4, ComponenteID = "", Descricao = "A4", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 5, ComponenteID = "", Descricao = "A5", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 6, ComponenteID = "", Descricao = "A6", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 7, ComponenteID = "", Descricao = "A7", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 8, ComponenteID = "", Descricao = "B0", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 9, ComponenteID = "", Descricao = "B1", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 10, ComponenteID = "", Descricao = "B2", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 11, ComponenteID = "", Descricao = "B3", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 12, ComponenteID = "", Descricao = "B4", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 13, ComponenteID = "", Descricao = "B5", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 14, ComponenteID = "", Descricao = "B6", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_GPIO, Pino = 15, ComponenteID = "", Descricao = "B7", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
};
return Pinout;
}
public static List<PinoutModel> CarregarPinoutPadrao_ADS()
{
List<PinoutModel> Pinout = new List<PinoutModel>()
{
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_ADS, Pino = 0, ComponenteID = "", Descricao = "A0", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_ADS, Pino = 1, ComponenteID = "", Descricao = "A1", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_ADS, Pino = 2, ComponenteID = "", Descricao = "A2", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSOR_ADS, Pino = 3, ComponenteID = "", Descricao = "A3", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
};
return Pinout;
@ -256,7 +271,8 @@ namespace AgroBase.Models.Modules
var newPinout = new PinoutDataModel()
{
ExpansorGPIO = false,
EnderecoExpansor = "",
ExpansorADS = false,
EnderecoGPIO = "",
Pinos = CarregarPinoutPadrao_S3(),
};
@ -296,7 +312,7 @@ namespace AgroBase.Models.Modules
Pinos += splitparms;
}
var pino = _pinout.Pinos.FirstOrDefault(x => x.Funcao == funcao);
if (pino != null && (pino.Barramento == TiposBarramentos.CONTROLADOR || (pino.Barramento == TiposBarramentos.EXPANSORI2C && _pinout.ExpansorGPIO)))
if (pino != null && (pino.Barramento == TiposBarramentos.CONTROLADOR || (pino.Barramento == TiposBarramentos.EXPANSOR_GPIO && _pinout.ExpansorGPIO) || (pino.Barramento == TiposBarramentos.EXPANSOR_ADS && _pinout.ExpansorADS)))
{
Pinos += ((int)pino.Barramento).ToString() + splitparms + pino.Pino.ToString();
}
@ -322,7 +338,8 @@ namespace AgroBase.Models.Modules
public enum TiposBarramentos
{
CONTROLADOR = 0,
EXPANSORI2C = 1
EXPANSOR_GPIO = 1,
EXPANSOR_ADS = 2,
}
public enum FuncoesPinout

View File

@ -1070,7 +1070,9 @@ namespace AgroBase.Models.Modules
var _pinout = new PinoutDataModel()
{
ExpansorGPIO = Pinout.ExpansorGPIO,
EnderecoExpansor = Pinout.EnderecoExpansor,
EnderecoGPIO = Pinout.EnderecoGPIO,
ExpansorADS = Pinout.ExpansorADS,
EnderecoADS = Pinout.EnderecoADS,
Pinos = Pinout.Pinos.ToList(),
};
_pinout.Pinos = _pinout.Pinos.Where(x => x.ComponenteID == ID).ToList();
@ -1133,7 +1135,7 @@ namespace AgroBase.Models.Modules
var _pinout = new PinoutDataModel()
{
ExpansorGPIO = Pinout.ExpansorGPIO,
EnderecoExpansor = Pinout.EnderecoExpansor,
EnderecoGPIO = Pinout.EnderecoGPIO,
Pinos = Pinout.Pinos.ToList(),
};
_pinout.Pinos = _pinout.Pinos.Where(x => x.ComponenteID == ID).ToList();
@ -1208,7 +1210,7 @@ namespace AgroBase.Models.Modules
var _pinout = new PinoutDataModel()
{
ExpansorGPIO = Pinout.ExpansorGPIO,
EnderecoExpansor = Pinout.EnderecoExpansor,
EnderecoGPIO = Pinout.EnderecoGPIO,
Pinos = Pinout.Pinos.ToList(),
};
_pinout.Pinos = _pinout.Pinos.Where(x => x.ComponenteID == ID).ToList();
@ -1275,7 +1277,7 @@ namespace AgroBase.Models.Modules
var _pinout = new PinoutDataModel()
{
ExpansorGPIO = Pinout.ExpansorGPIO,
EnderecoExpansor = Pinout.EnderecoExpansor,
EnderecoGPIO = Pinout.EnderecoGPIO,
Pinos = Pinout.Pinos.ToList(),
};
@ -1441,7 +1443,8 @@ namespace AgroBase.Models.Modules
{
double temperaturaAtual = FuncoesMatematicas.CalcularTemperatura(_leitura, fatorCalibracao);
_atual = Math.Round(filtroKalman.Filtrar(temperaturaAtual), 2);
//_atual = Math.Round(filtroKalman.Filtrar(temperaturaAtual), 2);
_atual = temperaturaAtual;
AtualizarExtremos();
}

View File

@ -1120,6 +1120,8 @@ namespace AgroBase.Models
double Ro = 10000.0; // Resistência do NTC a 25°C
double adcMax = 4095.0; // Valor máximo do ADC (12 bits ESP32)
if (leitura < 200) return -1;
// Calcula a tensão de saída do divisor
double Vout = leitura * Vs / adcMax;
@ -1128,7 +1130,8 @@ namespace AgroBase.Models
if (Vout >= Vs) return double.NaN; // Se Vout for igual a Vs, leitura inválida
// Calcula a resistência do NTC
double Rt = Ro * (Vout / (Vs - Vout));
double Rt = Ro * (Vout / (Vs - Vout)); // NTC EM CIMA
//double Rt = Ro * ((Vs - Vout) / Vout); // NTC EM BAIXO
// Aplica a equação de Steinhart-Hart para calcular a temperatura em Kelvin
double T = 1.0 / (1.0 / To + Math.Log(Rt / Ro) / Beta);

View File

@ -60,6 +60,16 @@ namespace AgroBase.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ads {
get {
object obj = ResourceManager.GetObject("ads", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@ -118,85 +118,88 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="salvar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\salvar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="roda_superior" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\roda_superior.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="esp32-s3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\esp32-s3.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="seta_voltar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\seta_voltar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="mcp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\mcp.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="cana" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\cana.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ajustes" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\ajustes.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="localizacao" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\localizacao.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="transferidor" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\transferidor.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="esp32-s3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\esp32-s3.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="voltar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\voltar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="bussola" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\bussola.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="rosa_dos_ventos" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\rosa_dos_ventos.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pasta" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\pasta.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="wifi_off" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\wifi_off.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="esp32-wrover" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\esp32-wrover.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="joystick" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\joystick.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="wifi_on" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\wifi_on.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="diagnostico" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\diagnostico.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="salvar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\salvar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="iniciar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\iniciar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="atualizar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\atualizar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="rede" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\rede.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="fechar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\fechar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="roda_superior" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\roda_superior.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="localizacao" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\localizacao.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="loading" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\loading.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="excluir" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\excluir.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="joystick" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\joystick.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="wifi_off" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\wifi_off.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="diagnostico" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\diagnostico.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="rede" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\rede.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="atualizar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\atualizar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="esp32-wrover" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\esp32-wrover.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="robo_superior" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\robo_superior.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="iniciar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\iniciar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="voltar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\voltar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="fechar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\fechar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="transferidor" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\transferidor.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="seta_voltar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\seta_voltar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="desligar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\desligar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pasta" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\pasta.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="cana" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\cana.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="rosa_dos_ventos" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\rosa_dos_ventos.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="wifi_on" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\wifi_on.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="ads" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Imagens\ads.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@ -136,7 +136,7 @@ namespace AgroBase.Services
ErrosComunicacao.Add(mensagem);
VariaveisOperacao.RegistrarLogDispositivo(ErrosComunicacao, T_Code.Mks, "_err.txt", 50);
VariaveisOperacao.RegistrarLogDispositivo(ErrosComunicacao, T_Code.Dir, "_err.txt", 50);
}
public static void RegisrarComandosComunicacao(byte addr, string mensagem)
@ -145,7 +145,7 @@ namespace AgroBase.Services
ComandosComunicacao.Add(mensagem);
VariaveisOperacao.RegistrarLogDispositivo(ComandosComunicacao, T_Code.Mks, "_log.txt", 1000);
VariaveisOperacao.RegistrarLogDispositivo(ComandosComunicacao, T_Code.Dir, "_log.txt", 1000);
}
private static void DefinirDispositivo(List<string> Mod_IDs)

View File

@ -953,7 +953,7 @@ namespace AgroBase.Services
ErrosComunicacao.Add(mensagem);
VariaveisOperacao.RegistrarLogDispositivo(ErrosComunicacao, T_Code.Oid, "_err.txt", 50);
VariaveisOperacao.RegistrarLogDispositivo(ErrosComunicacao, T_Code.Mov, "_err.txt", 50);
}
public static void RegisrarComandosComunicacao(byte addr, string mensagem)
@ -962,7 +962,7 @@ namespace AgroBase.Services
ComandosComunicacao.Add(mensagem);
VariaveisOperacao.RegistrarLogDispositivo(ComandosComunicacao, T_Code.Oid, "_log.txt", 1000);
VariaveisOperacao.RegistrarLogDispositivo(ComandosComunicacao, T_Code.Mov, "_log.txt", 1000);
}
private static async Task tmrLoopComandos_Tick()

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"tmrRegistrador":{"_uiControl":null,"State":2,"IsRunning":false,"IsStopped":true,"IsCreated":false,"Interval":500,"StackTrace":"AtuadorModel.IniciarRegistrador","Id":"tmrRegistrador_Atu","TimeTick":"00:00:00"},"Modulo_ID":"Atu","IP":"192.168.100.13","RequisitarDados":true,"Conectado":false,"QuantidadeBicos":4,"DensidadeHerbicida":1.05,"BicosPulverizadores":[{"ID":"B01","Posicao":1,"Componente":422,"AtuacaoNivelAlto":true,"ComandoAtuar":false,"Comandar":true,"Testando":false,"Funcoes":[21],"LeituraStatusBico":false,"MediaNivelFluxo":0.0,"Leitura":null,"Inicializado":false,"Atuacoes":0,"InicioAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0},{"ID":"B02","Posicao":2,"Componente":422,"AtuacaoNivelAlto":true,"ComandoAtuar":false,"Comandar":true,"Testando":false,"Funcoes":[21],"LeituraStatusBico":false,"MediaNivelFluxo":0.0,"Leitura":null,"Inicializado":false,"Atuacoes":0,"InicioAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0},{"ID":"B03","Posicao":3,"Componente":422,"AtuacaoNivelAlto":true,"ComandoAtuar":false,"Comandar":true,"Testando":false,"Funcoes":[21],"LeituraStatusBico":false,"MediaNivelFluxo":0.0,"Leitura":null,"Inicializado":false,"Atuacoes":0,"InicioAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0},{"ID":"B04","Posicao":4,"Componente":422,"AtuacaoNivelAlto":true,"ComandoAtuar":false,"Comandar":true,"Testando":false,"Funcoes":[21],"LeituraStatusBico":false,"MediaNivelFluxo":0.21614702381868367,"Leitura":null,"Inicializado":false,"Atuacoes":0,"InicioAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0}],"BombasPressurizadoras":[{"ID":"BOMBA","ComandoAtuar":false,"Componente":325,"LeituraEstado":false,"Comandar":true,"Testando":false,"Funcoes":[14,35,36,37,5],"LeituraPotencia":0.0,"LeituraPressaoSP":0.0,"LeituraPressao":0.0,"Leitura":null,"Inicializado":false}],"Sensores":[{"LogGrafico":[],"ID":"FLXLN","Prioridade":23,"Descricao":"Fluxo na linha principal","Componente":198,"Aferir":true,"DelayAmostragem":300,"Leitura":null,"Inicializado":false,"Testando":false,"Funcoes":[25],"Parametros":[],"UnidadeMedida":"mL/s","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"MASRS","Prioridade":3,"Descricao":"Massa do reservatório de herbicida","Componente":532,"Aferir":true,"DelayAmostragem":1000,"Leitura":null,"Inicializado":false,"Testando":false,"Funcoes":[22,23],"Parametros":[],"UnidadeMedida":"Kg","LimiteMaximo":50.0,"LimiteMinimo":5.0},{"LogGrafico":[],"ID":"PRSLN","Prioridade":3,"Descricao":"Pressão na linha principal","Componente":333,"Aferir":true,"DelayAmostragem":1000,"Leitura":null,"Inicializado":false,"Testando":false,"Funcoes":[24],"Parametros":[["Vmin","000.00"],["Vmax","004.50"],["Pmax","174.04"]],"UnidadeMedida":"psi","LimiteMaximo":120.0,"LimiteMinimo":60.0}],"BombaPressurizadora":{"ID":"BOMBA","ComandoAtuar":false,"Componente":325,"LeituraEstado":false,"Comandar":true,"Testando":false,"Funcoes":[14,35,36,37,5],"LeituraPotencia":0.0,"LeituraPressaoSP":0.0,"LeituraPressao":0.0,"Leitura":null,"Inicializado":false},"ScriptDeteccaoErvas":"weed_detector_oak-1_0.py","DadosLeitura":{"Momento":"0001-01-01T00:00:00","Conectado":false,"Mod_ID":null,"QualidadeWifi":0,"LatenciaLoop":0,"BicosPulverizadores":[],"BombasPressurizadoras":[],"SensoresFluxo":[],"SensoresMassa":[],"SensoresPressao":[]},"_MassaRef":0.8,"_MassaLeituraRef":40876.37,"_MassaLeituraExtra":1895800.0,"MassaReservatorio":0.0,"VolumeReservatorio":0.0,"PercentualReservatorio":0.0,"VolumeVazaoAferido":0.0,"_FluxoMlRef":102.0,"_FluxoPulsoRef":80.0,"VazaoFluxoMLpSInstantanea":0.0,"VazaoFluxoMLpSMedia":0.0,"VolumeVazaoML":0.0,"InicioAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0,"_PressaoVmin":0.0,"_PressaoVmax":4.5,"_PressaoMax":174.045,"PressaoLinha":0.0,"PressaoLinhaCalc":0.0,"PercentualErvasTerreno":0.0}
{"tmrRegistrador":{"_uiControl":null,"State":2,"IsRunning":false,"IsStopped":true,"IsCreated":false,"Interval":500,"StackTrace":"AtuadorModel.IniciarRegistrador","Id":"tmrRegistrador_Atu","TimeTick":"00:00:00"},"Modulo_ID":"Atu","IP":"192.168.100.13","RequisitarDados":true,"Conectado":false,"QuantidadeBicos":4,"DensidadeHerbicida":1.05,"BicosPulverizadores":[{"ID":"B01","Posicao":1,"Componente":422,"AtuacaoNivelAlto":true,"ComandoAtuar":false,"Comandar":true,"Testando":false,"Funcoes":[21],"LeituraStatusBico":false,"MediaNivelFluxo":4.0838582378089558,"Leitura":null,"Inicializado":false,"Atuacoes":0,"InicioAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0},{"ID":"B02","Posicao":2,"Componente":422,"AtuacaoNivelAlto":true,"ComandoAtuar":false,"Comandar":true,"Testando":false,"Funcoes":[21],"LeituraStatusBico":false,"MediaNivelFluxo":0.0,"Leitura":null,"Inicializado":false,"Atuacoes":0,"InicioAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0},{"ID":"B03","Posicao":3,"Componente":422,"AtuacaoNivelAlto":true,"ComandoAtuar":false,"Comandar":true,"Testando":false,"Funcoes":[21],"LeituraStatusBico":false,"MediaNivelFluxo":0.0,"Leitura":null,"Inicializado":false,"Atuacoes":0,"InicioAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0},{"ID":"B04","Posicao":4,"Componente":422,"AtuacaoNivelAlto":true,"ComandoAtuar":false,"Comandar":true,"Testando":false,"Funcoes":[21],"LeituraStatusBico":false,"MediaNivelFluxo":0.0,"Leitura":null,"Inicializado":false,"Atuacoes":0,"InicioAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0}],"BombasPressurizadoras":[{"ID":"BOMBA","ComandoAtuar":false,"Componente":325,"LeituraEstado":false,"Comandar":true,"Testando":false,"Funcoes":[14,35,36,37,5],"LeituraPotencia":0.0,"LeituraPressaoSP":0.0,"LeituraPressao":0.0,"Leitura":null,"Inicializado":false}],"Sensores":[{"LogGrafico":[],"ID":"FLXLN","Prioridade":23,"Descricao":"Fluxo na linha principal","Componente":198,"Aferir":true,"DelayAmostragem":300,"Leitura":null,"Inicializado":false,"Testando":false,"Funcoes":[25],"Parametros":[],"UnidadeMedida":"mL/s","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"MASRS","Prioridade":3,"Descricao":"Massa do reservatório de herbicida","Componente":532,"Aferir":true,"DelayAmostragem":1000,"Leitura":null,"Inicializado":false,"Testando":false,"Funcoes":[22,23],"Parametros":[],"UnidadeMedida":"Kg","LimiteMaximo":50.0,"LimiteMinimo":5.0},{"LogGrafico":[],"ID":"PRSLN","Prioridade":3,"Descricao":"Pressão na linha principal","Componente":333,"Aferir":true,"DelayAmostragem":1000,"Leitura":null,"Inicializado":false,"Testando":false,"Funcoes":[24],"Parametros":[["Vmin","000.00"],["Vmax","004.50"],["Pmax","174.04"]],"UnidadeMedida":"psi","LimiteMaximo":120.0,"LimiteMinimo":60.0}],"BombaPressurizadora":{"ID":"BOMBA","ComandoAtuar":false,"Componente":325,"LeituraEstado":false,"Comandar":true,"Testando":false,"Funcoes":[14,35,36,37,5],"LeituraPotencia":0.0,"LeituraPressaoSP":0.0,"LeituraPressao":0.0,"Leitura":null,"Inicializado":false},"ScriptDeteccaoErvas":"weed_detector_oak-1_0.py","DadosLeitura":{"Momento":"0001-01-01T00:00:00","Conectado":false,"Mod_ID":null,"QualidadeWifi":0,"LatenciaLoop":0,"BicosPulverizadores":[],"BombasPressurizadoras":[],"SensoresFluxo":[],"SensoresMassa":[],"SensoresPressao":[]},"_MassaRef":0.8,"_MassaLeituraRef":40876.37,"_MassaLeituraExtra":1895800.0,"MassaReservatorio":0.0,"VolumeReservatorio":0.0,"PercentualReservatorio":0.0,"VolumeVazaoAferido":0.0,"_FluxoMlRef":102.0,"_FluxoPulsoRef":80.0,"VazaoFluxoMLpSInstantanea":0.0,"VazaoFluxoMLpSMedia":0.0,"VolumeVazaoML":0.0,"InicioAtuacao":"0001-01-01T00:00:00","TempoAtuado":0.0,"_PressaoVmin":0.0,"_PressaoVmax":4.5,"_PressaoMax":174.045,"PressaoLinha":0.0,"PressaoLinhaCalc":0.0,"PercentualErvasTerreno":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

File diff suppressed because one or more lines are too long

View File

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

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

@ -205,4 +205,4 @@ C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMonitor.csproj.Gen
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMonitor.csproj.CoreCompileInputs.cache
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMonitor.exe
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMonitor.pdb
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMoni.D419EBC3.Up2Date
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMonitor.csproj.CopyComplete

View File

@ -92,7 +92,8 @@ enum StatusLED
enum TiposBarramentos {
CONTROLADOR = 0,
EXPANSORI2C = 1
EXPANSOR_GPIO = 1,
EXPANSOR_ADS = 2,
};
enum TiposPinos {

View File

@ -2,12 +2,15 @@
#include "SerialService.h"
#include <Wire.h>
#include <Adafruit_MCP23X17.h>
#include <Adafruit_ADS1X15.h>
#ifndef Pinout
#define Pinout
Adafruit_MCP23X17 mcp;
Adafruit_ADS1115 ads;
bool mcpInicializado = false;
bool adsInicializado = false;
class PinoModel {
public:
@ -33,7 +36,7 @@ class PinoModel {
set(statusInicial);
}
}
else if (barramento == EXPANSORI2C) {
else if (barramento == EXPANSOR_GPIO) {
if (tipo == _INPUT) {
mcp.pinMode(num, INPUT);
} else if (tipo == _OUTPUT) {
@ -52,7 +55,7 @@ class PinoModel {
}
pinMode(num, INPUT);
}
else if (barramento == EXPANSORI2C) {
else if (barramento == EXPANSOR_GPIO) {
mcp.pinMode(num, INPUT);
}
}
@ -73,9 +76,19 @@ class PinoModel {
return l / leituras;
}
}
else if (barramento == EXPANSORI2C) {
else if (barramento == EXPANSOR_GPIO) {
return mcp.digitalRead(num);
}
else if (barramento == EXPANSOR_ADS) {
double l = 0;
for (int i = 0; i < leituras; i++) {
int leituraADC = (int)(ads.readADC_SingleEnded(num));
int leitura12bits = map(leituraADC, 0, 32767, 0, 4095);
l += leitura12bits;
delay(1);
}
return l / leituras;
}
}
return -1;
}
@ -85,7 +98,7 @@ class PinoModel {
if (barramento == CONTROLADOR) {
digitalWrite(num, status ? HIGH : LOW);
}
else if (barramento == EXPANSORI2C) {
else if (barramento == EXPANSOR_GPIO) {
mcp.digitalWrite(num, status ? HIGH : LOW);
}
}
@ -109,7 +122,7 @@ void iniciarMCP(T_Code Modulo, String Mod_ID, int sda, int scl, byte endereco, b
iniciarMCP(Modulo, Mod_ID, sda, scl, endereco, Mandatorio);
}
else {
PrintTela("MCP nao mandatorio, continuando o fluxo...");
PrintTela("MCP23X17 nao mandatorio, continuando o fluxo...");
}
}
else {
@ -119,4 +132,32 @@ void iniciarMCP(T_Code Modulo, String Mod_ID, int sda, int scl, byte endereco, b
}
}
void iniciarADS(T_Code Modulo, String Mod_ID, int sda, int scl, byte endereco, bool Mandatorio = false) {
PrintTela("Iniciando ADS1115...");
if (!adsInicializado) {
bool init = Wire.begin(sda, scl);
String str = "SDA " + (String)sda + " SCL " + (String)scl + " Res " + init;
PrintTela(str, false);
if (!ads.begin(endereco, &Wire)) {
adsInicializado = false;
PrintTela("Erro ao iniciar ADS1115!");
if (Mandatorio) {
PrintTela("Conexão obrigatória, tentando novamente em 5 segundos...");
//EnviarDadosSerial(Mod_ID, MontarProtocoloErro(Modulo));
delay(5000);
iniciarADS(Modulo, Mod_ID, sda, scl, endereco, Mandatorio);
}
else {
PrintTela("ADS1115 nao mandatorio, continuando o fluxo...");
}
}
else {
ads.setGain(GAIN_ONE);
PrintTela("ADS1115 iniciado com sucesso!");
adsInicializado = true;
}
}
}
#endif

View File

@ -23,7 +23,7 @@ class SensorTemperatura {
double leitura = 0;
SimpleKalmanFilter filtro = SimpleKalmanFilter(5, 15, 0.01);
//SimpleKalmanFilter filtro = SimpleKalmanFilter(5, 15, 0.01);
bool Iniciado = false;
bool Checando = false;
@ -58,7 +58,7 @@ class SensorTemperatura {
void AferirTemperatura() {
leitura = _pino.get(5);
leitura = filtro.updateEstimate(leitura);
//leitura = filtro.updateEstimate(leitura);
}
void RequisitarDados() {

View File

@ -4,7 +4,7 @@
#ifndef SerialService
#define SerialService
bool DebugMode = false;
bool DebugMode = true;
const char BeginLine = '@';
const char EndLine = '$';

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,384 @@
// Dispositivo: Sensoriamento
// Versão Firmware: 15
// Ultima atualização: 24/03/2025
// Atualização: Implementado modulo ADS1115 para leituras analógicas com precisão
#include <ArduinoJson.h>
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\MqttService.h"
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\WifiService.h"
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\EepromService.h"
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\SerialService.h"
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\Utils.h"
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\Pinout.h"
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\SensorTemperaturaModel.h"
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\SensorCorrenteModel.h"
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\SinaleiroModel.h"
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\ReleModel.h"
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\ServoFreioModel.h"
#include "C:\ZendionInc\agrobot_base\Firmware\Modulos\SensorPotenciometroModel.h"
// Configurações do IP estático
IPAddress local_IP(192, 168, String(WIFI_FAIXA).toInt(), 12); // IP fixo para o ESP
IPAddress gateway(192, 168, String(WIFI_FAIXA).toInt(), 1); // Gateway padrão
IPAddress subnet(255, 255, 255, 0); // Máscara de sub-rede
IPAddress primaryDNS(8, 8, 8, 8); // Servidor DNS primário (opcional)
// Instancia o serviço MQTT
MqttService mqttService;
#define D_Code Sen
#define VERSION 15
String Mod_ID = "Sen";
#define _pinoLED RGB_BUILTIN
long _baudRate = 115200;
bool Conectado = false;
bool Verificando = false;
int _TaxaAmostragem = 1000;
volatile bool RequisitarDados = false;
int latenciaLoop = 0;
//PinoModel _pinoSDA = PinoModel(21, CONTROLADOR, _INPUT);
PinoModel _pinoSDA = PinoModel(1, CONTROLADOR, _INPUT);
//PinoModel _pinoSCL = PinoModel(22, CONTROLADOR, _INPUT);
PinoModel _pinoSCL = PinoModel(2, CONTROLADOR, _INPUT);
std::vector<SensorTemperatura*> listaSensoresTemperatura;
std::vector<SensorCorrente*> listaSensoresCorrente;
std::vector<Sinaleiro*> listaSinaleiros;
std::vector<Rele*> listaReles;
std::vector<ServoFreio*> listaServoFreios;
std::vector<SensorPotenciometro*> listaSensoresPotenciometros;
void InicializarComunicacaoMQTT(bool RenovarConexao) {
if (RenovarConexao) {
mqttService.unsubscribe(TopicoRecepcao);
delay(1000);
}
mqttService.setModID(Mod_ID);
mqttService.InicializarComunicacaoMqtt();
mqttService.setMessageCallback(ProcessarProtocolo);
}
void setup() {
Serial.begin(_baudRate);
iniciarMCP(D_Code, Mod_ID, _pinoSDA.num, _pinoSCL.num, 0x20, false);
iniciarADS(D_Code, Mod_ID, _pinoSDA.num, _pinoSCL.num, 0x48, false);
InicializarConexaoWifi(local_IP, gateway, subnet, primaryDNS);
if (!WifiIsConnected) {
connectToWiFi();
if (WifiIsConnected) {
PrintTela("Conectado com sucesso");
}
else {
PrintTela("Erro ao se conectar ao wifi");
ESP.restart();
}
}
delay(100);
if (WifiIsConnected) {
InicializarComunicacaoMQTT(false);
}
}
void loop() {
unsigned long startLoop = millis();
// Manter leitura dos angulos direcional atualizado
for (auto* sensor : listaSensoresPotenciometros) {
sensor->Loop();
}
if (!RequisitarDados) {
enviarLogsPeriodicamente();
}
mqttService.loop();
delay(1);
latenciaLoop = millis() - startLoop;
}
// Função para enviar logs do sensor periodicamente via MQTT
unsigned long ultimoEnvioLogs = 0;
const unsigned long intervaloEnvioLogs = 1000; // 1 segundo
void enviarLogsPeriodicamente() {
unsigned long tempoAtual = millis();
// Verifica se o intervalo de 5 segundos já passou
if (tempoAtual - ultimoEnvioLogs >= intervaloEnvioLogs) {
ultimoEnvioLogs = tempoAtual; // Atualiza o tempo do último envio
enviarDadosSensores(); // Chama o método que já envia os dados do sensor via MQTT
}
}
void enviarDadosSensores() {
if (Conectado && !Verificando) {
PrintTela("Atualizando dados dos sensores...");
//changeWifiStatus(false);
// Aferir dados dos sensores
for (auto* sensor : listaSensoresTemperatura) {
sensor->AferirTemperatura();
}
// Aferir dados dos sensores
for (auto* sensor : listaSensoresCorrente) {
sensor->AferirCorrente();
}
// Aferir dados dos sensores
for (auto* sensor : listaSinaleiros) {
sensor->AtualizarLeitura();
}
// Aferir dados dos sensores
for (auto* sensor : listaReles) {
sensor->AtualizarLeitura();
}
// Aferir dados dos sensores
for (auto* sensor : listaSensoresPotenciometros) {
sensor->AferirAngulo();
}
//changeWifiStatus(true);
//mqttService.InicializarComunicacaoMqtt(true);
String jsonString = MontarMensagemSensores() + String(EndLine);
mqttService.EnviarDados(Mod_ID, jsonString);
}
}
String MontarMensagemSensores() {
// Criação de um objeto JSON dinâmico com tamanho adequado
DynamicJsonDocument jsonDoc(2048);
// Adicionar campos gerais
jsonDoc["Conectado"] = Conectado;
jsonDoc["Mod_ID"] = Mod_ID;
jsonDoc["QualidadeWifi"] = WiFi.RSSI();
jsonDoc["LatenciaLoop"] = latenciaLoop;
// Array JSON para sensores de temperatura
JsonArray sensoresTemperaturaArray = jsonDoc.createNestedArray("SensoresTemperatura");
for (const auto* sensor : listaSensoresTemperatura) {
JsonObject sensorData = sensoresTemperaturaArray.createNestedObject();
sensorData["Id"] = sensor->_ID;
sensorData["Iniciado"] = sensor->Iniciado;
sensorData["Leitura"] = sensor->leitura;
}
// Array JSON para sensores de corrente
JsonArray sensoresCorrenteArray = jsonDoc.createNestedArray("SensoresCorrente");
for (const auto* sensor : listaSensoresCorrente) {
JsonObject sensorData = sensoresCorrenteArray.createNestedObject();
sensorData["Id"] = sensor->_ID;
sensorData["Iniciado"] = sensor->Iniciado;
sensorData["BusVoltage"] = sensor->busVoltage;
sensorData["ShuntVoltage"] = sensor->shuntVoltage;
sensorData["Current"] = sensor->current;
sensorData["Power"] = sensor->power;
}
// Array JSON para sinaleiros
JsonArray sinaleirosArray = jsonDoc.createNestedArray("Sinaleiros");
for (const auto* sensor : listaSinaleiros) {
JsonObject sensorData = sinaleirosArray.createNestedObject();
sensorData["Id"] = sensor->_ID;
sensorData["Iniciado"] = sensor->Iniciado;
sensorData["Leitura"] = sensor->_StatusLeitura;
sensorData["Comando"] = sensor->_Status;
}
// Array JSON para reles
JsonArray relesArray = jsonDoc.createNestedArray("Reles");
for (const auto* sensor : listaReles) {
JsonObject sensorData = relesArray.createNestedObject();
sensorData["Id"] = sensor->_ID;
sensorData["Iniciado"] = sensor->Iniciado;
sensorData["Leitura"] = sensor->_Status;
}
// Array JSON para servo freios
JsonArray servoFreiosArray = jsonDoc.createNestedArray("ServoFreios");
for (const auto* sensor : listaServoFreios) {
JsonObject sensorData = servoFreiosArray.createNestedObject();
sensorData["Id"] = sensor->_ID;
sensorData["Iniciado"] = sensor->Iniciado;
sensorData["Angulo"] = sensor->_Angulo;
}
// Array JSON para sensores de potenciometro
JsonArray sensoresPotenciometroArray = jsonDoc.createNestedArray("SensoresPotenciometro");
for (const auto* sensor : listaSensoresPotenciometros) {
JsonObject sensorData = sensoresPotenciometroArray.createNestedObject();
sensorData["Id"] = sensor->_ID;
sensorData["Iniciado"] = sensor->Iniciado;
sensorData["Leitura"] = sensor->leitura;
sensorData["Angulo"] = sensor->angulo;
sensorData["Sentido"] = sensor->sentido;
sensorData["LimiteExcedido"] = sensor->limiteExcedido;
}
// Serializa o JSON para uma string
String jsonString;
serializeJson(jsonDoc, jsonString);
int messageSize = jsonString.length();
PrintTela("Tamanho da mensagem: ", false);
PrintTela((String)messageSize);
return jsonString;
}
void ProcessarProtocolo(ProtocoloSerial Mensagem) {
switch (Mensagem.funcao) {
case Chk:
ProcessarChk(Mensagem);
break;
case Cfg:
ProcessarCfg(Mensagem);
break;
case Cmd:
ProcessarCmd(Mensagem);
break;
case Req:
ProcessarReq(Mensagem);
break;
}
if (Mensagem.idMensagem > 0) {
mqttService.EnviarDados(Mod_ID, MontarProtocoloMensagemRecebida(Mensagem.idMensagem));
}
}
void ProcessarChk(ProtocoloSerial Mensagem) {
Verificando = true;
mqttService.EnviarDados(Mod_ID, MontarProtocoloVerificacao(D_Code, VERSION, Conectado));
delay(2000);
Verificando = false;
}
void ProcessarCfg(ProtocoloSerial Mensagem) {
std::vector<String> Partes = SplitString(Mensagem.protocolo, SplitParams);
T_Code Tipo = (T_Code)(Partes[0].toInt());
if (Tipo == Mod) {
bool Conectar = Partes[1] == "1";
_TaxaAmostragem = Partes[2].toInt();
RequisitarDados = Partes[3] == "1";
TiposBarramentos pinoSDAB = (TiposBarramentos)Partes[4].toInt();
int pinoSDA = Partes[5].toInt();
TiposBarramentos pinoSCLB = (TiposBarramentos)Partes[6].toInt();
int pinoSCL = Partes[7].toInt();
if (pinoSDA > -1 && pinoSCL > -1) {
_pinoSDA = PinoModel(pinoSDA, pinoSDAB, _INPUT);
_pinoSCL = PinoModel(pinoSCL, pinoSCLB, _INPUT);
Wire.end();
Wire.begin(_pinoSDA.num, _pinoSCL.num);
}
vTaskDelay(pdMS_TO_TICKS(100));
Conectado = Conectar;
Verificando = false;
enviarDadosSensores();
}
else {
S_Code componente = (S_Code)Partes[1].toInt();
String config = Partes[2];
switch (componente) {
case sTMP: {
SensorTemperatura::InicializarLista(listaSensoresTemperatura, config, Mod_ID);
break;
}
case sCOR: {
SensorCorrente::InicializarLista(listaSensoresCorrente, config, Mod_ID);
break;
}
case sLED: {
Sinaleiro::InicializarLista(listaSinaleiros, config, Mod_ID);
break;
}
case sRLE: {
Rele::InicializarLista(listaReles, config, Mod_ID);
break;
}
case sFRO: {
ServoFreio::InicializarLista(listaServoFreios, config, Mod_ID);
break;
}
case sPOT: {
SensorPotenciometro::InicializarLista(listaSensoresPotenciometros, config, Mod_ID, listaReles);
break;
}
}
}
}
void ProcessarCmd(ProtocoloSerial Mensagem) {
std::vector<String> Partes = SplitString(Mensagem.protocolo, SplitParams);
String ID = Partes[0];
S_Code componente = (S_Code)Partes[1].toInt();
switch (componente) {
case sLED: {
for (auto* _led : listaSinaleiros) {
if (_led->_ID == ID) {
_led->_Status = (StatusLED)Partes[2].toInt();
_led->_Qtd = Partes[3].toInt();
_led->_TempoMs = Partes[4].toInt();
_led->_PausaMs = Partes[5].toInt();
return;
}
}
break;
}
case sRLE: {
for (auto* _rele : listaReles) {
if (_rele->_ID == ID) {
Estado novoEstado = (Estado)Partes[2].toInt();
_rele->AtualizarStatus(novoEstado);
}
}
break;
}
case sFRO: {
for (auto* _freio : listaServoFreios) {
if (_freio->_ID == ID) {
int novoAngulo = Partes[2].toInt();
_freio->AtualizarAngulo(novoAngulo);
}
}
break;
}
}
}
void ProcessarReq(ProtocoloSerial Mensagem) {
enviarDadosSensores();
}