criado modulo PC no health worker, comecar operacao do meio da rua

This commit is contained in:
Diego Freitas 2025-10-24 08:45:47 -03:00
parent 62d4cf9aae
commit fda7bb5096
63 changed files with 1040 additions and 263 deletions

Binary file not shown.

View File

@ -100,19 +100,54 @@
this.tabSensores = new System.Windows.Forms.TabPage();
this.tabControle = new System.Windows.Forms.TabPage();
this.pnlControle = new System.Windows.Forms.Panel();
this.chbSonarAtivado = new System.Windows.Forms.CheckBox();
this.chbPulverizadorAutomatico = new System.Windows.Forms.CheckBox();
this.pnlFreio = new System.Windows.Forms.Panel();
this.lblAnguloDirecional = new System.Windows.Forms.Label();
this.tkbAnguloDirecional = new System.Windows.Forms.TrackBar();
this.lblVelocidade = new System.Windows.Forms.Label();
this.tkbVelocidade = new System.Windows.Forms.TrackBar();
this.tabMapa = new System.Windows.Forms.TabPage();
this.tabModulos = new System.Windows.Forms.TabPage();
this.tabOperacao = new System.Windows.Forms.TabPage();
this.btnReferenciar = new System.Windows.Forms.Button();
this.btnPausarOperacao = new System.Windows.Forms.Button();
this.txtModuloMotivo = new System.Windows.Forms.RichTextBox();
this.txtModulos = new System.Windows.Forms.RichTextBox();
this.clbModulos = new System.Windows.Forms.CheckedListBox();
this.picFechar = new System.Windows.Forms.PictureBox();
this.chbPulverizadorAutomatico = new System.Windows.Forms.CheckBox();
this.chbSonarAtivado = new System.Windows.Forms.CheckBox();
this.gpbMov = new System.Windows.Forms.GroupBox();
this.gpbAtuador = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.nudVelSemErvas = new System.Windows.Forms.NumericUpDown();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.nudVelComErvas = new System.Windows.Forms.NumericUpDown();
this.label4 = new System.Windows.Forms.Label();
this.chbFrenagemAutomatica = new System.Windows.Forms.CheckBox();
this.label5 = new System.Windows.Forms.Label();
this.nudPercentualAtuacaoBico = new System.Windows.Forms.NumericUpDown();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.nudPressaoLinha = new System.Windows.Forms.NumericUpDown();
this.label8 = new System.Windows.Forms.Label();
this.btnSalvarParametros = new System.Windows.Forms.Button();
this.gpbMPC = new System.Windows.Forms.GroupBox();
this.label9 = new System.Windows.Forms.Label();
this.txtPesoPosicao = new System.Windows.Forms.TextBox();
this.txtPesoOrientacao = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.txtPesoSuavidadeMin = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.txtPesoSuavidadeMax = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.txtPesoFatorRe = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.txtPesoIdeal = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.txtPesoLateralMin = new System.Windows.Forms.TextBox();
this.label15 = new System.Windows.Forms.Label();
this.txtPesoLateralMax = new System.Windows.Forms.TextBox();
this.label16 = new System.Windows.Forms.Label();
this.pnlMapa.SuspendLayout();
this.pnlMapaDinamico.SuspendLayout();
this.pnlSensores.SuspendLayout();
@ -124,8 +159,15 @@
((System.ComponentModel.ISupportInitialize)(this.tkbAnguloDirecional)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tkbVelocidade)).BeginInit();
this.tabMapa.SuspendLayout();
this.tabModulos.SuspendLayout();
this.tabOperacao.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picFechar)).BeginInit();
this.gpbMov.SuspendLayout();
this.gpbAtuador.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudVelSemErvas)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudVelComErvas)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudPercentualAtuacaoBico)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudPressaoLinha)).BeginInit();
this.gpbMPC.SuspendLayout();
this.SuspendLayout();
//
// pnlMapa
@ -808,7 +850,7 @@
this.tabControl1.Controls.Add(this.tabSensores);
this.tabControl1.Controls.Add(this.tabControle);
this.tabControl1.Controls.Add(this.tabMapa);
this.tabControl1.Controls.Add(this.tabModulos);
this.tabControl1.Controls.Add(this.tabOperacao);
this.tabControl1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabControl1.Location = new System.Drawing.Point(703, 34);
this.tabControl1.Name = "tabControl1";
@ -841,8 +883,6 @@
// pnlControle
//
this.pnlControle.AutoScroll = true;
this.pnlControle.Controls.Add(this.chbSonarAtivado);
this.pnlControle.Controls.Add(this.chbPulverizadorAutomatico);
this.pnlControle.Controls.Add(this.pnlFreio);
this.pnlControle.Controls.Add(this.lblAnguloDirecional);
this.pnlControle.Controls.Add(this.tkbAnguloDirecional);
@ -857,6 +897,26 @@
this.pnlControle.Size = new System.Drawing.Size(307, 497);
this.pnlControle.TabIndex = 0;
//
// chbSonarAtivado
//
this.chbSonarAtivado.AutoSize = true;
this.chbSonarAtivado.Location = new System.Drawing.Point(6, 30);
this.chbSonarAtivado.Name = "chbSonarAtivado";
this.chbSonarAtivado.Size = new System.Drawing.Size(164, 29);
this.chbSonarAtivado.TabIndex = 38;
this.chbSonarAtivado.Text = "Sonar ativado";
this.chbSonarAtivado.UseVisualStyleBackColor = true;
//
// chbPulverizadorAutomatico
//
this.chbPulverizadorAutomatico.AutoSize = true;
this.chbPulverizadorAutomatico.Location = new System.Drawing.Point(6, 30);
this.chbPulverizadorAutomatico.Name = "chbPulverizadorAutomatico";
this.chbPulverizadorAutomatico.Size = new System.Drawing.Size(262, 29);
this.chbPulverizadorAutomatico.TabIndex = 37;
this.chbPulverizadorAutomatico.Text = "Pulverizador automático";
this.chbPulverizadorAutomatico.UseVisualStyleBackColor = true;
//
// pnlFreio
//
this.pnlFreio.Location = new System.Drawing.Point(134, 305);
@ -868,7 +928,7 @@
// lblAnguloDirecional
//
this.lblAnguloDirecional.AutoSize = true;
this.lblAnguloDirecional.Location = new System.Drawing.Point(3, 205);
this.lblAnguloDirecional.Location = new System.Drawing.Point(3, 168);
this.lblAnguloDirecional.Name = "lblAnguloDirecional";
this.lblAnguloDirecional.Size = new System.Drawing.Size(164, 20);
this.lblAnguloDirecional.TabIndex = 35;
@ -877,7 +937,7 @@
// tkbAnguloDirecional
//
this.tkbAnguloDirecional.Enabled = false;
this.tkbAnguloDirecional.Location = new System.Drawing.Point(7, 228);
this.tkbAnguloDirecional.Location = new System.Drawing.Point(7, 191);
this.tkbAnguloDirecional.Maximum = 90;
this.tkbAnguloDirecional.Name = "tkbAnguloDirecional";
this.tkbAnguloDirecional.Size = new System.Drawing.Size(277, 45);
@ -889,7 +949,7 @@
// lblVelocidade
//
this.lblVelocidade.AutoSize = true;
this.lblVelocidade.Location = new System.Drawing.Point(3, 114);
this.lblVelocidade.Location = new System.Drawing.Point(3, 77);
this.lblVelocidade.Name = "lblVelocidade";
this.lblVelocidade.Size = new System.Drawing.Size(179, 20);
this.lblVelocidade.TabIndex = 33;
@ -898,7 +958,7 @@
// tkbVelocidade
//
this.tkbVelocidade.Enabled = false;
this.tkbVelocidade.Location = new System.Drawing.Point(7, 137);
this.tkbVelocidade.Location = new System.Drawing.Point(7, 100);
this.tkbVelocidade.Maximum = 100;
this.tkbVelocidade.Name = "tkbVelocidade";
this.tkbVelocidade.Size = new System.Drawing.Size(277, 45);
@ -918,28 +978,55 @@
this.tabMapa.Text = "Mapa";
this.tabMapa.UseVisualStyleBackColor = true;
//
// tabModulos
// tabOperacao
//
this.tabModulos.BackColor = System.Drawing.SystemColors.Control;
this.tabModulos.Controls.Add(this.txtModuloMotivo);
this.tabModulos.Controls.Add(this.txtModulos);
this.tabModulos.Controls.Add(this.clbModulos);
this.tabModulos.Location = new System.Drawing.Point(4, 34);
this.tabModulos.Name = "tabModulos";
this.tabModulos.Padding = new System.Windows.Forms.Padding(3);
this.tabModulos.Size = new System.Drawing.Size(313, 503);
this.tabModulos.TabIndex = 3;
this.tabModulos.Text = "Módulos";
this.tabOperacao.AutoScroll = true;
this.tabOperacao.BackColor = System.Drawing.SystemColors.Control;
this.tabOperacao.Controls.Add(this.gpbMPC);
this.tabOperacao.Controls.Add(this.btnSalvarParametros);
this.tabOperacao.Controls.Add(this.gpbAtuador);
this.tabOperacao.Controls.Add(this.gpbMov);
this.tabOperacao.Controls.Add(this.btnReferenciar);
this.tabOperacao.Controls.Add(this.btnPausarOperacao);
this.tabOperacao.Controls.Add(this.txtModuloMotivo);
this.tabOperacao.Controls.Add(this.txtModulos);
this.tabOperacao.Controls.Add(this.clbModulos);
this.tabOperacao.Location = new System.Drawing.Point(4, 34);
this.tabOperacao.Name = "tabOperacao";
this.tabOperacao.Padding = new System.Windows.Forms.Padding(3);
this.tabOperacao.Size = new System.Drawing.Size(313, 503);
this.tabOperacao.TabIndex = 3;
this.tabOperacao.Text = "Operação";
//
// btnReferenciar
//
this.btnReferenciar.Location = new System.Drawing.Point(148, 6);
this.btnReferenciar.Name = "btnReferenciar";
this.btnReferenciar.Size = new System.Drawing.Size(143, 34);
this.btnReferenciar.TabIndex = 4;
this.btnReferenciar.Text = "Referenciar";
this.btnReferenciar.UseVisualStyleBackColor = true;
this.btnReferenciar.Click += new System.EventHandler(this.btnReferenciar_Click);
//
// btnPausarOperacao
//
this.btnPausarOperacao.Location = new System.Drawing.Point(6, 6);
this.btnPausarOperacao.Name = "btnPausarOperacao";
this.btnPausarOperacao.Size = new System.Drawing.Size(136, 34);
this.btnPausarOperacao.TabIndex = 3;
this.btnPausarOperacao.Text = "Pausar";
this.btnPausarOperacao.UseVisualStyleBackColor = true;
this.btnPausarOperacao.Click += new System.EventHandler(this.btnPausarOperacao_Click);
//
// txtModuloMotivo
//
this.txtModuloMotivo.BackColor = System.Drawing.SystemColors.Control;
this.txtModuloMotivo.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtModuloMotivo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtModuloMotivo.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtModuloMotivo.Location = new System.Drawing.Point(6, 405);
this.txtModuloMotivo.Name = "txtModuloMotivo";
this.txtModuloMotivo.ReadOnly = true;
this.txtModuloMotivo.Size = new System.Drawing.Size(299, 92);
this.txtModuloMotivo.Size = new System.Drawing.Size(285, 92);
this.txtModuloMotivo.TabIndex = 2;
this.txtModuloMotivo.Text = "";
//
@ -947,24 +1034,21 @@
//
this.txtModulos.BackColor = System.Drawing.SystemColors.Control;
this.txtModulos.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtModulos.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtModulos.Location = new System.Drawing.Point(6, 7);
this.txtModulos.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtModulos.Location = new System.Drawing.Point(6, 46);
this.txtModulos.Name = "txtModulos";
this.txtModulos.ReadOnly = true;
this.txtModulos.Size = new System.Drawing.Size(299, 122);
this.txtModulos.Size = new System.Drawing.Size(285, 83);
this.txtModulos.TabIndex = 1;
this.txtModulos.Text = "Status por módulo, é possível liberar a opreação caso algum módulo mandatório não" +
" esteja saudável, para fins de contingência.";
//
// clbModulos
//
this.clbModulos.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.clbModulos.FormattingEnabled = true;
this.clbModulos.Location = new System.Drawing.Point(6, 135);
this.clbModulos.Name = "clbModulos";
this.clbModulos.Size = new System.Drawing.Size(304, 264);
this.clbModulos.Size = new System.Drawing.Size(284, 264);
this.clbModulos.TabIndex = 0;
//
// picFechar
@ -977,27 +1061,323 @@
this.picFechar.TabIndex = 1;
this.picFechar.TabStop = false;
//
// chbPulverizadorAutomatico
// gpbMov
//
this.chbPulverizadorAutomatico.AutoSize = true;
this.chbPulverizadorAutomatico.Location = new System.Drawing.Point(7, 43);
this.chbPulverizadorAutomatico.Name = "chbPulverizadorAutomatico";
this.chbPulverizadorAutomatico.Size = new System.Drawing.Size(199, 24);
this.chbPulverizadorAutomatico.TabIndex = 37;
this.chbPulverizadorAutomatico.Text = "Pulverizador Automático";
this.chbPulverizadorAutomatico.UseVisualStyleBackColor = true;
this.chbPulverizadorAutomatico.CheckedChanged += new System.EventHandler(this.chbPulverizadorAutomatico_CheckedChanged);
this.gpbMov.Controls.Add(this.chbFrenagemAutomatica);
this.gpbMov.Controls.Add(this.label3);
this.gpbMov.Controls.Add(this.nudVelComErvas);
this.gpbMov.Controls.Add(this.label4);
this.gpbMov.Controls.Add(this.label2);
this.gpbMov.Controls.Add(this.nudVelSemErvas);
this.gpbMov.Controls.Add(this.label1);
this.gpbMov.Controls.Add(this.chbSonarAtivado);
this.gpbMov.Location = new System.Drawing.Point(6, 503);
this.gpbMov.Name = "gpbMov";
this.gpbMov.Size = new System.Drawing.Size(284, 171);
this.gpbMov.TabIndex = 39;
this.gpbMov.TabStop = false;
this.gpbMov.Text = "Movimentação";
//
// chbSonarAtivado
// gpbAtuador
//
this.chbSonarAtivado.AutoSize = true;
this.chbSonarAtivado.Location = new System.Drawing.Point(7, 73);
this.chbSonarAtivado.Name = "chbSonarAtivado";
this.chbSonarAtivado.Size = new System.Drawing.Size(156, 24);
this.chbSonarAtivado.TabIndex = 38;
this.chbSonarAtivado.Text = "Sonar Automático";
this.chbSonarAtivado.UseVisualStyleBackColor = true;
this.chbSonarAtivado.CheckedChanged += new System.EventHandler(this.chbSonarAtivado_CheckedChanged);
this.gpbAtuador.Controls.Add(this.label7);
this.gpbAtuador.Controls.Add(this.nudPressaoLinha);
this.gpbAtuador.Controls.Add(this.label8);
this.gpbAtuador.Controls.Add(this.label5);
this.gpbAtuador.Controls.Add(this.nudPercentualAtuacaoBico);
this.gpbAtuador.Controls.Add(this.label6);
this.gpbAtuador.Controls.Add(this.chbPulverizadorAutomatico);
this.gpbAtuador.Location = new System.Drawing.Point(6, 680);
this.gpbAtuador.Name = "gpbAtuador";
this.gpbAtuador.Size = new System.Drawing.Size(284, 140);
this.gpbAtuador.TabIndex = 40;
this.gpbAtuador.TabStop = false;
this.gpbAtuador.Text = "Atuador";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 97);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(154, 25);
this.label1.TabIndex = 39;
this.label1.Text = "Vel. sem ervas";
//
// nudVelSemErvas
//
this.nudVelSemErvas.Location = new System.Drawing.Point(163, 95);
this.nudVelSemErvas.Name = "nudVelSemErvas";
this.nudVelSemErvas.Size = new System.Drawing.Size(74, 31);
this.nudVelSemErvas.TabIndex = 40;
this.nudVelSemErvas.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(243, 97);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(31, 25);
this.label2.TabIndex = 41;
this.label2.Text = "%";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(243, 134);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(31, 25);
this.label3.TabIndex = 44;
this.label3.Text = "%";
//
// nudVelComErvas
//
this.nudVelComErvas.Location = new System.Drawing.Point(163, 132);
this.nudVelComErvas.Name = "nudVelComErvas";
this.nudVelComErvas.Size = new System.Drawing.Size(74, 31);
this.nudVelComErvas.TabIndex = 43;
this.nudVelComErvas.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(6, 134);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(154, 25);
this.label4.TabIndex = 42;
this.label4.Text = "Vel. com ervas";
//
// chbFrenagemAutomatica
//
this.chbFrenagemAutomatica.AutoSize = true;
this.chbFrenagemAutomatica.Location = new System.Drawing.Point(6, 65);
this.chbFrenagemAutomatica.Name = "chbFrenagemAutomatica";
this.chbFrenagemAutomatica.Size = new System.Drawing.Size(273, 29);
this.chbFrenagemAutomatica.TabIndex = 45;
this.chbFrenagemAutomatica.Text = "Frenagem em obstáculos";
this.chbFrenagemAutomatica.UseVisualStyleBackColor = true;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(243, 62);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(31, 25);
this.label5.TabIndex = 44;
this.label5.Text = "%";
//
// nudPercentualAtuacaoBico
//
this.nudPercentualAtuacaoBico.Location = new System.Drawing.Point(163, 60);
this.nudPercentualAtuacaoBico.Name = "nudPercentualAtuacaoBico";
this.nudPercentualAtuacaoBico.Size = new System.Drawing.Size(74, 31);
this.nudPercentualAtuacaoBico.TabIndex = 43;
this.nudPercentualAtuacaoBico.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(6, 62);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(144, 25);
this.label6.TabIndex = 42;
this.label6.Text = "Atuar bico em";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(243, 99);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(40, 25);
this.label7.TabIndex = 47;
this.label7.Text = "psi";
//
// nudPressaoLinha
//
this.nudPressaoLinha.Location = new System.Drawing.Point(163, 97);
this.nudPressaoLinha.Name = "nudPressaoLinha";
this.nudPressaoLinha.Size = new System.Drawing.Size(74, 31);
this.nudPressaoLinha.TabIndex = 46;
this.nudPressaoLinha.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(6, 99);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(143, 25);
this.label8.TabIndex = 45;
this.label8.Text = "Pressão linha";
//
// btnSalvarParametros
//
this.btnSalvarParametros.Location = new System.Drawing.Point(6, 1160);
this.btnSalvarParametros.Name = "btnSalvarParametros";
this.btnSalvarParametros.Size = new System.Drawing.Size(283, 40);
this.btnSalvarParametros.TabIndex = 48;
this.btnSalvarParametros.Text = "Salvar Parâmetros";
this.btnSalvarParametros.UseVisualStyleBackColor = true;
this.btnSalvarParametros.Click += new System.EventHandler(this.btnSalvarParametros_Click);
//
// gpbMPC
//
this.gpbMPC.Controls.Add(this.txtPesoLateralMax);
this.gpbMPC.Controls.Add(this.label16);
this.gpbMPC.Controls.Add(this.txtPesoLateralMin);
this.gpbMPC.Controls.Add(this.label15);
this.gpbMPC.Controls.Add(this.txtPesoIdeal);
this.gpbMPC.Controls.Add(this.label14);
this.gpbMPC.Controls.Add(this.txtPesoFatorRe);
this.gpbMPC.Controls.Add(this.label13);
this.gpbMPC.Controls.Add(this.txtPesoSuavidadeMax);
this.gpbMPC.Controls.Add(this.label12);
this.gpbMPC.Controls.Add(this.txtPesoSuavidadeMin);
this.gpbMPC.Controls.Add(this.label11);
this.gpbMPC.Controls.Add(this.txtPesoOrientacao);
this.gpbMPC.Controls.Add(this.label10);
this.gpbMPC.Controls.Add(this.txtPesoPosicao);
this.gpbMPC.Controls.Add(this.label9);
this.gpbMPC.Location = new System.Drawing.Point(6, 826);
this.gpbMPC.Name = "gpbMPC";
this.gpbMPC.Size = new System.Drawing.Size(285, 327);
this.gpbMPC.TabIndex = 49;
this.gpbMPC.TabStop = false;
this.gpbMPC.Text = "Pesos MPC";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(6, 31);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(89, 25);
this.label9.TabIndex = 0;
this.label9.Text = "Posição";
//
// txtPesoPosicao
//
this.txtPesoPosicao.Location = new System.Drawing.Point(181, 28);
this.txtPesoPosicao.Name = "txtPesoPosicao";
this.txtPesoPosicao.Size = new System.Drawing.Size(74, 31);
this.txtPesoPosicao.TabIndex = 1;
this.txtPesoPosicao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// txtPesoOrientacao
//
this.txtPesoOrientacao.Location = new System.Drawing.Point(181, 65);
this.txtPesoOrientacao.Name = "txtPesoOrientacao";
this.txtPesoOrientacao.Size = new System.Drawing.Size(74, 31);
this.txtPesoOrientacao.TabIndex = 3;
this.txtPesoOrientacao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(6, 68);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(117, 25);
this.label10.TabIndex = 2;
this.label10.Text = "Orientação";
//
// txtPesoSuavidadeMin
//
this.txtPesoSuavidadeMin.Location = new System.Drawing.Point(181, 102);
this.txtPesoSuavidadeMin.Name = "txtPesoSuavidadeMin";
this.txtPesoSuavidadeMin.Size = new System.Drawing.Size(74, 31);
this.txtPesoSuavidadeMin.TabIndex = 5;
this.txtPesoSuavidadeMin.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(6, 105);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(154, 25);
this.label11.TabIndex = 4;
this.label11.Text = "Suavidade min";
//
// txtPesoSuavidadeMax
//
this.txtPesoSuavidadeMax.Location = new System.Drawing.Point(181, 139);
this.txtPesoSuavidadeMax.Name = "txtPesoSuavidadeMax";
this.txtPesoSuavidadeMax.Size = new System.Drawing.Size(74, 31);
this.txtPesoSuavidadeMax.TabIndex = 7;
this.txtPesoSuavidadeMax.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(6, 142);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(160, 25);
this.label12.TabIndex = 6;
this.label12.Text = "Suavidade max";
//
// txtPesoFatorRe
//
this.txtPesoFatorRe.Location = new System.Drawing.Point(181, 176);
this.txtPesoFatorRe.Name = "txtPesoFatorRe";
this.txtPesoFatorRe.Size = new System.Drawing.Size(74, 31);
this.txtPesoFatorRe.TabIndex = 9;
this.txtPesoFatorRe.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(6, 179);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(117, 25);
this.label13.TabIndex = 8;
this.label13.Text = "Fator de ré";
//
// txtPesoIdeal
//
this.txtPesoIdeal.Location = new System.Drawing.Point(181, 213);
this.txtPesoIdeal.Name = "txtPesoIdeal";
this.txtPesoIdeal.Size = new System.Drawing.Size(74, 31);
this.txtPesoIdeal.TabIndex = 11;
this.txtPesoIdeal.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(6, 216);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(58, 25);
this.label14.TabIndex = 10;
this.label14.Text = "Ideal";
//
// txtPesoLateralMin
//
this.txtPesoLateralMin.Location = new System.Drawing.Point(181, 250);
this.txtPesoLateralMin.Name = "txtPesoLateralMin";
this.txtPesoLateralMin.Size = new System.Drawing.Size(74, 31);
this.txtPesoLateralMin.TabIndex = 13;
this.txtPesoLateralMin.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(6, 253);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(118, 25);
this.label15.TabIndex = 12;
this.label15.Text = "Lateral min";
//
// txtPesoLateralMax
//
this.txtPesoLateralMax.Location = new System.Drawing.Point(181, 287);
this.txtPesoLateralMax.Name = "txtPesoLateralMax";
this.txtPesoLateralMax.Size = new System.Drawing.Size(74, 31);
this.txtPesoLateralMax.TabIndex = 15;
this.txtPesoLateralMax.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(6, 290);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(124, 25);
this.label16.TabIndex = 14;
this.label16.Text = "Lateral max";
//
// frmDialogoMapa
//
@ -1035,8 +1415,18 @@
((System.ComponentModel.ISupportInitialize)(this.tkbAnguloDirecional)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tkbVelocidade)).EndInit();
this.tabMapa.ResumeLayout(false);
this.tabModulos.ResumeLayout(false);
this.tabOperacao.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.picFechar)).EndInit();
this.gpbMov.ResumeLayout(false);
this.gpbMov.PerformLayout();
this.gpbAtuador.ResumeLayout(false);
this.gpbAtuador.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudVelSemErvas)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudVelComErvas)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudPercentualAtuacaoBico)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudPressaoLinha)).EndInit();
this.gpbMPC.ResumeLayout(false);
this.gpbMPC.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@ -1122,11 +1512,46 @@
private System.Windows.Forms.TextBox txtInclinacao;
private System.Windows.Forms.Label lblInclinacao;
private System.Windows.Forms.CheckBox chbAcompanharCarro;
private System.Windows.Forms.TabPage tabModulos;
private System.Windows.Forms.TabPage tabOperacao;
private System.Windows.Forms.RichTextBox txtModulos;
private System.Windows.Forms.CheckedListBox clbModulos;
private System.Windows.Forms.RichTextBox txtModuloMotivo;
private System.Windows.Forms.CheckBox chbPulverizadorAutomatico;
private System.Windows.Forms.CheckBox chbSonarAtivado;
private System.Windows.Forms.Button btnReferenciar;
private System.Windows.Forms.Button btnPausarOperacao;
private System.Windows.Forms.GroupBox gpbAtuador;
private System.Windows.Forms.GroupBox gpbMov;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.NumericUpDown nudVelComErvas;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.NumericUpDown nudVelSemErvas;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox chbFrenagemAutomatica;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.NumericUpDown nudPercentualAtuacaoBico;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.NumericUpDown nudPressaoLinha;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Button btnSalvarParametros;
private System.Windows.Forms.GroupBox gpbMPC;
private System.Windows.Forms.TextBox txtPesoLateralMax;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.TextBox txtPesoLateralMin;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.TextBox txtPesoIdeal;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.TextBox txtPesoFatorRe;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.TextBox txtPesoSuavidadeMax;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox txtPesoSuavidadeMin;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox txtPesoOrientacao;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox txtPesoPosicao;
private System.Windows.Forms.Label label9;
}
}

View File

@ -3,6 +3,7 @@ using AgroBase.Models.Components;
using AgroBase.Models.Operadores;
using AgroBase.Services;
using AgroBase.Services.Operadores;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
@ -183,10 +184,10 @@ namespace AgroBase.Forms.IHM
txtBateriaConsumida.Text = _Sensoriamento.Bateria.BateriaConsumida.ToString("0.00") + " %";
FuncoesGlobais.PreencheValorProgressBar(pgbReservatorio, _Sensoriamento.Atuador.PercentualReservatorio);
lblReservatorio.Text = "Reservatório: " + _Sensoriamento.Atuador.PercentualReservatorio.ToString("0.00") + "%";
lblReservatorio.Text = "Reservatório: " + _Sensoriamento.Atuador.VolumeReservatorio.ToString("0.00") + " l " + _Sensoriamento.Atuador.PercentualReservatorio.ToString("0.00") + "%";
FuncoesGlobais.PreencheValorProgressBar(pgbBateria, _Sensoriamento.Bateria.PorcentagemBateria);
lblBateria.Text = "Bateria: " + _Sensoriamento.Bateria.TensaoInstantanea.ToString("0.00") + "v " + _Sensoriamento.Bateria.CorrenteInstantanea.ToString("0.00") + "A " + _Sensoriamento.Bateria.PorcentagemBateria.ToString("0.00") + "%";
lblBateria.Text = "Bateria: " + _Sensoriamento.Bateria.TensaoInstantanea.ToString("0.00") + "v " + _Sensoriamento.Bateria.PorcentagemBateria.ToString("0.00") + "%";
FuncoesGlobais.PreencheValorProgressBar(pgbOperacao, _Sensoriamento.Trajetoria.ProgressoTrajeto);
lblOperacao.Text = "Operação: " + _Sensoriamento.Trajetoria.ProgressoTrajeto.ToString("0.00") + "%";
@ -197,7 +198,7 @@ namespace AgroBase.Forms.IHM
lblCorrecaoGPS.Text = (_Sensoriamento.Gps.Ntrip_ativado ? "N " : "B ") + _Sensoriamento.Gps.IdadeCorrecao + ": " + _Sensoriamento.Gps.QualidadeFix.ToString();
lblPrecisaoGPS.Text = $"Precisão: {_Sensoriamento.Gps.PrecisaoCm.ToString("0.00")} cm";
bool automatico = Variaveis.OperacaoEmAndamento.Modo != Enums.ModoOperacao.Manual;
bool automatico = Variaveis.OperacaoEmAndamento.Modo != ModoOperacao.Manual;
cmbModoControle.Enabled = !automatico;
tkbVelocidade.Enabled = !automatico;
tkbAnguloDirecional.Enabled = !automatico;
@ -331,14 +332,29 @@ namespace AgroBase.Forms.IHM
tkbVelocidade.Enabled = false;
pnlJoystick.Visible = false;
tabControl1.TabPages.Remove(tabControle);
chbPulverizadorAutomatico.Checked = Variaveis.OperacaoEmAndamento.Controle.PulverizadorAutomatico;
chbSonarAtivado.Checked = Variaveis.OperacaoEmAndamento.Controle.SonarAtivado;
cmbModoControle.SelectedIndex = (int)Variaveis.OperacaoEmAndamento.Controle.TipoMovimento;
var _Controle = Variaveis.OperacaoEmAndamento.Controle;
cmbModoControle.SelectedIndex = (int)_Controle.TipoMovimento;
chbSonarAtivado.Checked = _Controle.SonarAtivado;
chbFrenagemAutomatica.Checked = _Controle.FrenagemAutomatica;
nudVelSemErvas.Value = (int)_Controle.PercentualVelocidadeMax;
nudVelComErvas.Value = (int)_Controle.PercentualVelocidadeMin;
chbPulverizadorAutomatico.Checked = _Controle.PulverizadorAutomatico;
nudPercentualAtuacaoBico.Value = (int)(_Controle.PercentualInicioPulverizacao * 100.0);
nudPressaoLinha.Value = (int)_Controle.PressaoLinha;
FuncoesGlobais.PreencheValorTrackBar(tkbAnguloDirecional, _Controle.Angulo);
FuncoesGlobais.PreencheValorTrackBar(tkbVelocidade, _Controle.PercentualVelocidadeSP);
FuncoesGlobais.PreencheValorTrackBar(tkbAnguloDirecional, Variaveis.OperacaoEmAndamento.Controle.Angulo);
FuncoesGlobais.PreencheValorTrackBar(tkbVelocidade, Variaveis.OperacaoEmAndamento.Controle.PercentualVelocidadeSP);
string pesosMpcStr = RedisService.Get(CtxKey.DadosPesosMPC);
var pesos = JsonConvert.DeserializeObject<MPCPesosModel>(pesosMpcStr);
txtPesoPosicao.Text = pesos.posicao.ToString();
txtPesoOrientacao.Text = pesos.orientacao.ToString();
txtPesoSuavidadeMin.Text = pesos.suavidade_min.ToString();
txtPesoSuavidadeMax.Text = pesos.suavidade_max.ToString();
txtPesoFatorRe.Text = pesos.fator_re.ToString();
txtPesoIdeal.Text = pesos.ideal.ToString();
txtPesoLateralMin.Text = pesos.lateral_min.ToString();
txtPesoLateralMax.Text = pesos.lateral_max.ToString();
tkbVelocidade_Scroll(null, null);
tkbAnguloDirecional_Scroll(null, null);
@ -592,16 +608,6 @@ namespace AgroBase.Forms.IHM
Variaveis.OperacaoEmAndamento.Controle.TipoMovimento = (Enums.TipoMovimentoDirecional)cmbModoControle.SelectedIndex;
}
private void chbPulverizadorAutomatico_CheckedChanged(object sender, EventArgs e)
{
Variaveis.OperacaoEmAndamento.Controle.PulverizadorAutomatico = ((CheckBox)sender).Checked;
}
private void chbSonarAtivado_CheckedChanged(object sender, EventArgs e)
{
Variaveis.OperacaoEmAndamento.Controle.SonarAtivado = ((CheckBox)sender).Checked;
}
private void tkbVelocidade_Scroll(object sender, EventArgs e)
{
Variaveis.OperacaoEmAndamento.Controle.PercentualVelocidadeSP = tkbVelocidade.Value;
@ -641,6 +647,8 @@ namespace AgroBase.Forms.IHM
#region OPERACAO
public class ModuloUIItem
{
public T_Code Disp { get; set; }
@ -827,6 +835,87 @@ namespace AgroBase.Forms.IHM
txtModuloMotivo.Text = _modulosUI[clbModulos.SelectedIndex].Motivo;
}
private void btnPausarOperacao_Click(object sender, EventArgs e)
{
if (!Variaveis.OperacaoEmAndamento.Pausa)
{
Variaveis.OperacaoEmAndamento.Pausa = true;
btnPausarOperacao.Text = "Retomar";
}
else
{
Variaveis.OperacaoEmAndamento.Pausa = false;
btnPausarOperacao.Text = "Pausar";
}
}
private async void btnReferenciar_Click(object sender, EventArgs e)
{
await Variaveis.OperacaoEmAndamento.RealizarCalibragemInicialAsync(true);
}
private void btnSalvarParametros_Click(object sender, EventArgs e)
{
var res = CustomDialog.ShowDialog(
"Salvar parâmetros da operação",
"Deseja aplicar os novos parâmetros para operação atual?",
MessageBoxIcon.Question,
new Dictionary<(string, DialogResult?), Action>()
{
{ ("Sim", DialogResult.Yes), () => { } },
{ ("Não", DialogResult.No), () => { } },
}
);
var _Controle = Variaveis.OperacaoEmAndamento.Controle;
if (res == DialogResult.Yes)
{
_Controle.SonarAtivado = chbSonarAtivado.Checked;
_Controle.FrenagemAutomatica = chbFrenagemAutomatica.Checked;
_Controle.RPM_Max = (int)FuncoesMatematicas.CalculaRPMVelocidade(FuncoesMatematicas.CalculaVelocidadeMsPercentual((int)nudVelSemErvas.Value));
_Controle.RPM_Min = (int)FuncoesMatematicas.CalculaRPMVelocidade(FuncoesMatematicas.CalculaVelocidadeMsPercentual((int)nudVelComErvas.Value));
_Controle.PulverizadorAutomatico = chbPulverizadorAutomatico.Checked;
_Controle.PercentualInicioPulverizacao = ((double)nudPercentualAtuacaoBico.Value / 100.0);
_Controle.PressaoLinha = (double)nudPressaoLinha.Value;
RedisService.AtualizarCampos(
CtxKey.DadosPesosMPC,
("posicao", Convert.ToDouble(txtPesoPosicao.Text)),
("orientacao", Convert.ToDouble(txtPesoOrientacao.Text)),
("suavidade_min", Convert.ToDouble(txtPesoSuavidadeMin.Text)),
("suavidade_max", Convert.ToDouble(txtPesoSuavidadeMax.Text)),
("fator_re", Convert.ToDouble(txtPesoFatorRe.Text)),
("ideal", Convert.ToDouble(txtPesoIdeal.Text)),
("lateral_min", Convert.ToDouble(txtPesoLateralMin.Text)),
("lateral_max", Convert.ToDouble(txtPesoLateralMax.Text))
);
RedisService.AtualizarCampos(CtxKey.DadosOperacao, ("configurado", false));
}
else
{
chbSonarAtivado.Checked = _Controle.SonarAtivado;
chbFrenagemAutomatica.Checked = _Controle.FrenagemAutomatica;
nudVelSemErvas.Value = (int)_Controle.PercentualVelocidadeMax;
nudVelComErvas.Value = (int)_Controle.PercentualVelocidadeMin;
chbPulverizadorAutomatico.Checked = _Controle.PulverizadorAutomatico;
nudPercentualAtuacaoBico.Value = (int)(_Controle.PercentualInicioPulverizacao * 100.0);
nudPressaoLinha.Value = (int)_Controle.PressaoLinha;
string pesosMpcStr = RedisService.Get(CtxKey.DadosPesosMPC);
var pesos = JsonConvert.DeserializeObject<MPCPesosModel>(pesosMpcStr);
txtPesoPosicao.Text = pesos.posicao.ToString();
txtPesoOrientacao.Text = pesos.orientacao.ToString();
txtPesoSuavidadeMin.Text = pesos.suavidade_min.ToString();
txtPesoSuavidadeMax.Text = pesos.suavidade_max.ToString();
txtPesoFatorRe.Text = pesos.fator_re.ToString();
txtPesoIdeal.Text = pesos.ideal.ToString();
txtPesoLateralMin.Text = pesos.lateral_min.ToString();
txtPesoLateralMax.Text = pesos.lateral_max.ToString();
}
}
#endregion
}
}

View File

@ -494,6 +494,31 @@ namespace AgroBase.Models
public static int ParseInt(string s) =>
int.TryParse(s, NumberStyles.Integer, CultureInfo.InvariantCulture, out var v) ? v : 0;
public static (GPSModel, double) CalcularPontoMaisProximoTrajetoria(GPSModel posicaoAtual, List<GPSModel> Trajetoria)
{
if (Trajetoria.Count == 0) return (null, -1);
double menorDistancia = double.MaxValue;
GPSModel melhorPonto = null;
for (int i = 0; i < Trajetoria.Count; i++)
{
double distanciaAtual = Math.Abs(DistanciaEntrePontos(posicaoAtual, Trajetoria[i]));
if (distanciaAtual < menorDistancia)
{
melhorPonto = Trajetoria[i];
menorDistancia = distanciaAtual;
}
}
if (melhorPonto != null)
{
return (melhorPonto, menorDistancia);
}
return (null, -1);
}
}

View File

@ -543,7 +543,7 @@ namespace AgroBase
!Forms.IHM.frmDiagnosticos.Diagnosticando && !ForcarComando &&
(
Variaveis.OperacaoEmAndamento.Modo == ModoOperacao.Manual && (
MKS057DCanService.Referenciando ||
Variaveis.OperacaoEmAndamento.Calibrando ||
!Variaveis.OperacaoEmAndamento.OperacaoLiberada ||
!Variaveis.OperacaoEmAndamento.Iniciado ||
!VerificaComandoValidoSonar(Tecla)

View File

@ -193,3 +193,15 @@ public class MPCSimulacaoModel
public double longitude { get; set; }
public double orientacao { get; set; }
}
public class MPCPesosModel
{
public double posicao { get; set; }
public double orientacao { get; set; }
public double suavidade_min { get; set; }
public double suavidade_max { get; set; }
public double fator_re { get; set; }
public double ideal { get; set; }
public double lateral_min { get; set; }
public double lateral_max { get; set; }
}

View File

@ -772,6 +772,18 @@ namespace AgroBase.Models.Modules
if (bomba != null)
{
bool leituraEstado = (bomba.ValoresLeituras?.FirstOrDefault(x => x.funcao == FuncoesPinout.Potencia)?.atual?.valor ?? 0) > 0;
// Desliga a bomba caso esteja ligada e o nivel de herbicida caiu
if (PercentualReservatorio < VariaveisEquipamento.PercentualReservatorioMin && leituraEstado == true)
{
bomba.ComandoAtuar = false;
}
// Religa a bomba caso esteja desligada, o nivel de herbicida esta estavel e o pulverizador automatico esta ligado
else if (PercentualReservatorio >= VariaveisEquipamento.PercentualReservatorioMin && leituraEstado == false && Variaveis.OperacaoEmAndamento.Controle.PulverizadorAutomatico)
{
bomba.ComandoAtuar = true;
}
if (bomba.ComandoAtuar != leituraEstado)
{
GeneralJoystick.EnviarComandoAtuador(bomba.Componente, bomba.ComandoAtuar, bomba.ID);
@ -803,7 +815,7 @@ namespace AgroBase.Models.Modules
}
public async Task<bool> RealizarTestesIniciais()
public async Task<bool> RealizarTestesIniciais(bool forcar)
{
var calAtu = Variaveis.OperacaoEmAndamento.ModsCalibragem[T_Code.Atu];
@ -811,12 +823,12 @@ namespace AgroBase.Models.Modules
foreach (var Bomba in BombasPressurizadoras.Where(x => x.Comandar))
{
calAtu.TryGetValue(Bomba.ID, out var cal);
if (cal && calAtu[Bomba.ID]) continue;
if (!forcar && cal && calAtu[Bomba.ID]) continue;
calAtu[Bomba.ID] = false;
// Sem herbicida no reservatorio, bomba nao precisa ligar
if (!Bomba.Inicializado || PercentualReservatorio < 5.0)
if (!Bomba.Inicializado || PercentualReservatorio < VariaveisEquipamento.PercentualReservatorioMin)
{
break;
}
@ -858,7 +870,7 @@ namespace AgroBase.Models.Modules
foreach (var Bico in BicosPulverizadores.Where(x => x.Comandar))
{
calAtu.TryGetValue(Bico.ID, out var cal);
if (cal && calAtu[Bico.ID]) continue;
if (!forcar && cal && calAtu[Bico.ID]) continue;
calAtu[Bico.ID] = false;
@ -881,12 +893,13 @@ namespace AgroBase.Models.Modules
return sucesso;
}
public List<Task> RealizarCalibragemAsync()
public List<Task> RealizarCalibragemAsync(bool forcar)
{
List<Task> tasks = new List<Task>();
var DispAtu = Variaveis.OperacaoEmAndamento.DispAtu;
if (DispAtu != null)
tasks.Add(DispAtu.Dados.RealizarTestesIniciais().ContinueWith(t => {
{
tasks.Add(DispAtu.Dados.RealizarTestesIniciais(forcar).ContinueWith(t => {
if (t.IsFaulted)
Console.WriteLine($"Erro no referenciamento do módulo {Modulo_ID}: {t.Exception?.InnerException?.Message}");
if (t.IsCompleted)
@ -897,6 +910,7 @@ namespace AgroBase.Models.Modules
}
}));
}
return tasks;
}

View File

@ -391,7 +391,7 @@ namespace AgroBase.Models.Modules
return Modulos.All(x => x.DirMotor.Referenciado);
}
public List<Task> RealizarCalibragemMovAsync()
public List<Task> RealizarCalibragemMovAsync(bool forcar)
{
List<Task> tasks = new List<Task>();
var DispMvd = Variaveis.OperacaoEmAndamento.DispMvd;
@ -401,7 +401,7 @@ namespace AgroBase.Models.Modules
foreach (var mod in DispMvd.Dados.Modulos)
{
calMov.TryGetValue(mod.Modulo_ID, out var cal);
if (cal && calMov[mod.Modulo_ID]) continue;
if (!forcar && cal && calMov[mod.Modulo_ID]) continue;
calMov[mod.Modulo_ID] = mod.MovMotor.Inicializado;
}
@ -410,7 +410,7 @@ namespace AgroBase.Models.Modules
return tasks;
}
public List<Task> RealizarCalibragemDirAsync()
public List<Task> RealizarCalibragemDirAsync(bool forcar)
{
List<Task> tasks = new List<Task>();
var DispMvd = Variaveis.OperacaoEmAndamento.DispMvd;
@ -420,7 +420,7 @@ namespace AgroBase.Models.Modules
foreach (var mod in DispMvd.Dados.Modulos)
{
calDir.TryGetValue(mod.Modulo_ID, out var cal);
if (cal && calDir[mod.Modulo_ID]) continue;
if (!forcar && cal && calDir[mod.Modulo_ID]) continue;
calDir[mod.Modulo_ID] = false;
}

View File

@ -58,6 +58,7 @@ namespace AgroBase.Models
public StatusOperacao StatusAtual { get; private set; } = StatusOperacao.NaoIniciado;
public StatusOperacao StatusAnterior { get; private set; } = StatusOperacao.NaoIniciado;
public bool Emergencia { get; set; } = false;
public bool Pausa { get; set; } = false;
public bool OperacaoLiberada { get; private set; } = false;
public bool OperacaoConfigurada { get; private set; } = false;
public string ErroOperacaoLiberada { get; set; }
@ -128,6 +129,17 @@ namespace AgroBase.Models
}
}
private static AsyncTaskTimerModel tmrLogs;
public double tmrLeiturasInterval
{
get
{
return tmrLeituras.Interval;
}
set
{
tmrLeituras.SetInterval((int)value);
}
}
private static AsyncTaskTimerModel tmrLeituras;
@ -721,6 +733,8 @@ namespace AgroBase.Models
Iniciado = true;
Simulando = false;
Treinando = false;
Emergencia = false;
Pausa = false;
DataInicio = DateTime.Now;
DataFim = DateTime.MinValue;
idxLog = 0;
@ -766,7 +780,7 @@ namespace AgroBase.Models
GPSTrajetoria = new List<GPSModel>();
await RealizarCalibragemInicialAsync();
await RealizarCalibragemInicialAsync(true);
}
public async Task FinalizarOperacao()
@ -785,6 +799,8 @@ namespace AgroBase.Models
await Task.Delay(2000);
Variaveis.OperacaoEmAndamento.Iniciado = false;
Variaveis.OperacaoEmAndamento.Emergencia = false;
Variaveis.OperacaoEmAndamento.Pausa = false;
Variaveis.OperacaoEmAndamento.DataFim = DateTime.Now;
@ -795,25 +811,37 @@ namespace AgroBase.Models
Variaveis.OperacaoEmAndamento.Finalizando = false;
}
public async Task RealizarCalibragemInicialAsync()
public async Task RealizarCalibragemInicialAsync(bool forcar)
{
bool modsCalibrados = Variaveis.OperacaoEmAndamento.ModsCalibragem.All(x => x.Value.Values.Count > 0 && x.Value.Values.All(y => y == true));
if (modsCalibrados) return;
if (!forcar && modsCalibrados) return;
Console.WriteLine("Calibragem inicial inciada...");
var DispAtu = Variaveis.OperacaoEmAndamento.DispAtu;
var DispMvd = Variaveis.OperacaoEmAndamento.DispMvd;
List<StatusModulo> sv = new List<StatusModulo>() { StatusModulo.Operante, StatusModulo.Alerta };
var s = HealthWorkerService.ModulosSaude;
bool calibragemAtuNecessaria = Variaveis.OperacaoEmAndamento.Controle.PulverizadorAutomatico && (DispAtu?.Dados != null && sv.Contains(s.FirstOrDefault(x => x.modulo == T_Code.Atu)?.status ?? StatusModulo.Desconectado) && (forcar || Variaveis.OperacaoEmAndamento.ModsCalibragem[T_Code.Atu].Any(x => !x.Value) || !Variaveis.OperacaoEmAndamento.ModsCalibragem[T_Code.Atu].Any()));
bool calibragemDirNecessaria = (DispMvd?.Dados != null && sv.Contains(s.FirstOrDefault(x => x.modulo == T_Code.Dir)?.status ?? StatusModulo.Desconectado) && (forcar || Variaveis.OperacaoEmAndamento.ModsCalibragem[T_Code.Dir].Any(x => !x.Value) || !Variaveis.OperacaoEmAndamento.ModsCalibragem[T_Code.Dir].Any()));
bool calibragemMovNecessaria = (DispMvd?.Dados != null && sv.Contains(s.FirstOrDefault(x => x.modulo == T_Code.Mov)?.status ?? StatusModulo.Desconectado) && (forcar || Variaveis.OperacaoEmAndamento.ModsCalibragem[T_Code.Mov].Any(x => !x.Value) || !Variaveis.OperacaoEmAndamento.ModsCalibragem[T_Code.Mov].Any()));
if (!calibragemAtuNecessaria && !calibragemDirNecessaria && !calibragemMovNecessaria) return;
Console.WriteLine("Pausa para calibragem inicial");
Variaveis.OperacaoEmAndamento.Pausa = true;
await Task.Delay(5000);
Console.WriteLine("Calibragem dos modulos inciada...");
Variaveis.OperacaoEmAndamento.Calibrando = true;
RedisService.AtualizarCampos(CtxKey.DadosOperacao, ("calibrando", Variaveis.OperacaoEmAndamento.Calibrando));
TipoMovimentoDirecional tipoControle = Variaveis.OperacaoEmAndamento.Controle.TipoMovimento;
var DispAtu = Variaveis.OperacaoEmAndamento.DispAtu;
var DispMvd = Variaveis.OperacaoEmAndamento.DispMvd;
var tasks = new List<Task>();
if (DispAtu?.Dados != null && (Variaveis.OperacaoEmAndamento.ModsCalibragem[T_Code.Atu].Any(x => !x.Value) || !Variaveis.OperacaoEmAndamento.ModsCalibragem[T_Code.Atu].Any())) tasks.AddRange(DispAtu.Dados.RealizarCalibragemAsync());
if (DispMvd?.Dados != null && (Variaveis.OperacaoEmAndamento.ModsCalibragem[T_Code.Dir].Any(x => !x.Value) || !Variaveis.OperacaoEmAndamento.ModsCalibragem[T_Code.Dir].Any())) tasks.AddRange(DispMvd.Dados.RealizarCalibragemDirAsync());
if (DispMvd?.Dados != null && (Variaveis.OperacaoEmAndamento.ModsCalibragem[T_Code.Mov].Any(x => !x.Value) || !Variaveis.OperacaoEmAndamento.ModsCalibragem[T_Code.Mov].Any())) tasks.AddRange(DispMvd.Dados.RealizarCalibragemMovAsync());
if (calibragemAtuNecessaria) tasks.AddRange(DispAtu.Dados.RealizarCalibragemAsync(forcar));
if (calibragemDirNecessaria) tasks.AddRange(DispMvd.Dados.RealizarCalibragemDirAsync(forcar));
if (calibragemMovNecessaria) tasks.AddRange(DispMvd.Dados.RealizarCalibragemMovAsync(forcar));
if (tasks.Count == 0)
{
@ -831,7 +859,6 @@ namespace AgroBase.Models
if (completed == allTasks)
{
Console.WriteLine("Calibragem finalizada com sucesso!");
}
else
{
@ -844,6 +871,7 @@ namespace AgroBase.Models
}
Variaveis.OperacaoEmAndamento.Controle.TipoMovimento = tipoControle;
Variaveis.OperacaoEmAndamento.Calibrando = false;
Variaveis.OperacaoEmAndamento.Pausa = false;
RedisService.AtualizarCampos(CtxKey.DadosOperacao, ("calibrando", Variaveis.OperacaoEmAndamento.Calibrando));
}
@ -1180,9 +1208,9 @@ namespace AgroBase.Models
public void ExecutaComandoDaBase(OperacaoControleBaseModel controleBase)
{
Emergencia = controleBase.Emergencia;
Variaveis.OperacaoEmAndamento.Emergencia = controleBase.Emergencia;
if (Emergencia) return;
if (Variaveis.OperacaoEmAndamento.Emergencia) return;
if (Variaveis.OperacaoEmAndamento.Controle.MovimentoAutomatico) return;
@ -1229,7 +1257,7 @@ namespace AgroBase.Models
if (idxLog % 5 == 0 && !Variaveis.OperacaoEmAndamento.Calibrando)
{
Task.Run(async () => await RealizarCalibragemInicialAsync());
Task.Run(async () => await RealizarCalibragemInicialAsync(false));
}
}
}
@ -1599,7 +1627,6 @@ namespace AgroBase.Models
return Convert.ToInt32(RPM_SP * VariaveisEquipamento.RelacaoRPM);
}
}
private double _velocidade_sp = 0.0;
public double PercentualVelocidadeSP { get; set; }
public double PercentualVelocidadeMin
{

View File

@ -27,6 +27,7 @@ namespace AgroBase.Models
private double DistanciaPrimeirosPontosProjecao { get; set; } = 3.0; // Distancia máxima para projetar os primeiros pontos com distancia menor
public static double LarguraCorredorPadrao { get; set; } = 1.5; // Largura de um corredor padrão
private int JanelaAtualizacaoDePontos { get; set; } = 20; // Define o tamanho da janela de pontos a atualizar
private bool VerificacaoInicialMeioRuaConcluida { get; set; } = false; // Realiza a verificacao inicial para saber se o robo deve comecar a operacao do meio da rua
#endregion
@ -522,6 +523,7 @@ namespace AgroBase.Models
public void AtualizarDistanciaErroMapaPlantacao()
{
if (DistanciaErroMapaPlantacao > -1) return;
if (CorredorAtual == null) return;
if (CorredorAtual.Idx > 0) return;
if (!CorredorAtual.Dentro) return;
@ -633,14 +635,18 @@ namespace AgroBase.Models
AtualizarTempoEntreLeituras();
AtualizarDistanciaMaximaEntreLeituras();
AtualizarIndicesJanela();
AtualizarTrajetoriaJanela();
Inicio:
AtualizarIndicesJanela();
AtualizarTrajetoriaJanela();
VerificaFimCorredorSegmentacao();
VerificaFimCorredorSegmentacao();
DefinirPontoAtual();
AtualizarCorredorAtual();
DefinirProximoPonto();
if (VerificaInicioOperacaoMeioRua()) goto Inicio;
DefinirPontoAtual();
AtualizarCorredorAtual();
DefinirProximoPonto();
MarcarPontosIntermediariosNaoVisitados();
DefinirPontoMaisProximo();
AtualizarAnguloMedioCorredor();
@ -661,6 +667,67 @@ namespace AgroBase.Models
AtualizarDistanciaErroMapaPlantacao();
}
private int VerificaEquipamentoDentroCorredor(GPSModel posicaoAtual)
{
Dictionary<int, (bool, double)> melhoresPontosCorredores = new Dictionary<int, (bool, double)>();
foreach (var corredor in Corredores)
{
(GPSModel pontoMaisProximo, double distanciaAtual) = GPSUtils.CalcularPontoMaisProximoTrajetoria(posicaoAtual, corredor);
if (pontoMaisProximo == null)
{
return -1;
}
double distanciaMargem = LarguraCorredorPadrao * 0.8;
bool naMargem = distanciaAtual < distanciaMargem;
melhoresPontosCorredores.Add(melhoresPontosCorredores.Count, (naMargem, distanciaAtual));
}
return melhoresPontosCorredores.Any(x => x.Value.Item1) ? melhoresPontosCorredores.Where(x => x.Value.Item1).OrderBy(x => x.Value.Item2).FirstOrDefault().Key : -1;
}
private (bool, int) VerificaEquipamentoDentroCorredor()
{
_TrajetoriaJanela = _TrajetoriaFixa;
AtualizarPropriedadesPontosTrajetoria();
AtualizarTrajetoriaJanela();
List<PontoTrajetoriaModel> melhoresPontosCorredores = new List<PontoTrajetoriaModel>();
foreach (var corredor in Corredores)
{
(GPSModel pontoMaisProximo, double distanciaAtual) = GPSUtils.CalcularPontoMaisProximoTrajetoria(_TrajetoriaFixa[0].Posicao, corredor);
if (pontoMaisProximo == null)
{
return (false, -1);
}
var melhorPonto = _TrajetoriaFixa.FirstOrDefault(x => x.Posicao.Latitude == pontoMaisProximo.Latitude && x.Posicao.Longitude == pontoMaisProximo.Longitude);
melhoresPontosCorredores.Add(melhorPonto);
}
return (melhoresPontosCorredores.Any(x => x.NaMargem), melhoresPontosCorredores.Where(x => x.NaMargem).OrderBy(x => x.DistanciaAtual).FirstOrDefault().idxPonto);
}
private bool VerificaInicioOperacaoMeioRua()
{
if (!VerificacaoInicialMeioRuaConcluida && new List<StatusOperacao>() { StatusOperacao.Aguardando, StatusOperacao.EmAndamento }.Contains(Variaveis.OperacaoEmAndamento.StatusAtual))
{
VerificacaoInicialMeioRuaConcluida = true;
(bool noCoredor, var idxPontoMaisProximo) = VerificaEquipamentoDentroCorredor();
if (noCoredor)
{
for (int i = 0; i < idxPontoMaisProximo; i++)
{
_TrajetoriaFixa[i].Visitado = true;
}
return true;
}
}
return false;
}
private void VerificaFimCorredorSegmentacao()
{
if (CorredorAtual == null) return;
@ -1104,10 +1171,8 @@ namespace AgroBase.Models
(List<List<GPSModel>> corredores, List<double> CorredoresLarguras) = ProjetarCorredores();
Corredores = corredores;
Enums.DirecaoCarroRua direcaoAtual = ExtremoMaisProximoMapa == 0 ? Enums.DirecaoCarroRua.Ida : Enums.DirecaoCarroRua.Volta;
//Enums.DirecaoCarroRua direcaoAtual = Enums.DirecaoCarroRua.Ida;
double larguraCorredorMenor = LarguraCorredorPadrao * 0.9;
DirecaoCarroRua direcaoAtual = ExtremoMaisProximoMapa == 0 ? DirecaoCarroRua.Ida : DirecaoCarroRua.Volta;
PontoTrajetoriaModel PontoRobo = new PontoTrajetoriaModel(TipoPontoRua.PosicaoRobo)
{
@ -1115,11 +1180,30 @@ namespace AgroBase.Models
idxPonto = 0,
idxPontoCorredor = 0,
Posicao = posicaoRobo ?? Variaveis.OperacaoEmAndamento.Sensoriamento.Gps,
Direcao = direcaoAtual,
Orientacao = 0,
Direcao = direcaoAtual,
Visitado = true,
LarguraCorredor = 1.0
};
int idxCorredorDentro = VerificaEquipamentoDentroCorredor(PontoRobo.Posicao);
if (idxCorredorDentro > -1)
{
var corredor = Corredores[idxCorredorDentro];
double orientacaoCorredor = GPSUtils.CalcularOrientacao(corredor[0], corredor[1]);
double difOri = Math.Abs(orientacaoCorredor - PontoRobo.Posicao.OrientacaoReal);
bool alinhado = difOri < 180;
if (idxCorredorDentro % 2 == 0)
{
direcaoAtual = alinhado ? DirecaoCarroRua.Ida : DirecaoCarroRua.Volta;
}
else
{
direcaoAtual = alinhado ? DirecaoCarroRua.Volta : DirecaoCarroRua.Ida;
}
PontoRobo.Direcao = direcaoAtual;
}
_trajetoriaFixa.Add(PontoRobo);
int idxEsq = 0;
@ -1155,9 +1239,10 @@ namespace AgroBase.Models
bool ultimoCorredor = idx == Corredores.Count() - 1;
List<GPSModel> CorredorAtual = Corredores[idx];
double dP0 = GPSUtils.DistanciaEntrePontos(_trajetoriaFixa.Last().Posicao, CorredorAtual[0]);
double dP1 = GPSUtils.DistanciaEntrePontos(_trajetoriaFixa.Last().Posicao, CorredorAtual[CorredorAtual.Count() - 1]);
if (dP1 < dP0)
//double dP0 = GPSUtils.DistanciaEntrePontos(_trajetoriaFixa.Last().Posicao, CorredorAtual[0]);
//double dP1 = GPSUtils.DistanciaEntrePontos(_trajetoriaFixa.Last().Posicao, CorredorAtual[CorredorAtual.Count() - 1]);
//if (dP1 < dP0)
if (direcaoAtual == DirecaoCarroRua.Volta)
{
CorredorAtual.Reverse();
}

View File

@ -119,7 +119,7 @@ namespace AgroMonitor
public static bool EnviarDadosEmBroadcast { get; set; } = true;
public static double LeverArmFrontal { get; } = 0.0;
public static double LeverArmLateral { get; } = 0.58;
public static double LeverArmLateral { get; } = 0.0;
}
}

View File

@ -52,8 +52,6 @@ namespace AgroBase.Services
private static bool LoopRTK_Ntrip = false;
public static bool CorrecaoRTK_Ntrip = false;
public static DateTime UltimoEnvioCorrecaoRTK = DateTime.MinValue;
private static double HeadingOffsetCorrecao = 5.0;
private static double HeadingOffsetSimulador => Variaveis.OperacaoEmAndamento.Simulando ? -HeadingOffsetCorrecao : 0.0;
public static void AtualizarPortaCOM(SerialPort Porta)
{
@ -99,7 +97,7 @@ namespace AgroBase.Services
}
}
private static async Task ConfigurarModulo()
public static async Task ConfigurarModulo()
{
Console.WriteLine("Iniciando configuração do módulo GPS...");
if (Variaveis.IsAgroMonitor)
@ -1397,6 +1395,7 @@ namespace AgroBase.Services
}
public static bool CorrecaoAbsoluta = false;
public static bool CorrecaoEmAndamento = false;
public static bool FixLiberado = false;
// ===== 1) Função principal =====
public static async Task<bool> FixarBaseViaNtripAsync(string portaUsb = "com3", string portaEntrada = "com2", string portaSaida = "com2", string baseId = "957", int segsFixEstavel = 120, int maxJanelaSegs = 600, double madK = 3.5, Func<Task> startNtrip = null, Func<Task> stopNtrip = null)
@ -1500,7 +1499,7 @@ namespace AgroBase.Services
if (gga is null) continue;
// Considera "RTK FIX" como qualidade válida
if (!new List<TiposCorrecaoGPS>() { TiposCorrecaoGPS.RTKFixo }.Contains(gga.FixQuality))
if (!FixLiberado || !new List<TiposCorrecaoGPS>() { TiposCorrecaoGPS.RTKFixo }.Contains(gga.FixQuality))
{
inicioFix = null; // reset
continue;

View File

@ -61,7 +61,7 @@ namespace AgroBase.Services
ParametrosSet.tranModeAndWorCycle
};
Console.WriteLine($"Parametros de configuracao LoRa: {FuncoesGlobais.ConverterComandoBytesParaTexto(config2.ToArray())}");
//Console.WriteLine($"Parametros de configuracao LoRa: {FuncoesGlobais.ConverterComandoBytesParaTexto(config2.ToArray())}");
return new List<(int, CanMessagePosicaoDados, byte[])>()
{

View File

@ -89,6 +89,9 @@ namespace AgroBase.Services
Mod_ID = Mod_ID,
});
Variaveis.OperacaoEmAndamento.ModsCalibragem.TryGetValue(T_Code.Dir, out var m);
if (m == null)
Variaveis.OperacaoEmAndamento.ModsCalibragem.Add(T_Code.Dir, new Dictionary<string, bool>());
Variaveis.OperacaoEmAndamento.ModsCalibragem[T_Code.Dir][Mod_ID] = false;
}
}

View File

@ -94,6 +94,9 @@ namespace AgroBase.Services
Mod_ID = Mod_ID,
});
Variaveis.OperacaoEmAndamento.ModsCalibragem.TryGetValue(T_Code.Mov, out var m);
if (m == null)
Variaveis.OperacaoEmAndamento.ModsCalibragem.Add(T_Code.Mov, new Dictionary<string, bool>());
Variaveis.OperacaoEmAndamento.ModsCalibragem[T_Code.Mov][Mod_ID] = false;
}
}

View File

@ -93,7 +93,8 @@ namespace AgroBase.Services.Operadores
("iniciado", Variaveis.OperacaoEmAndamento.Iniciado),
("finalizando", Variaveis.OperacaoEmAndamento.Finalizando),
("calibrando", Variaveis.OperacaoEmAndamento.Calibrando),
("emergencia", Variaveis.OperacaoEmAndamento.Emergencia)
("emergencia", Variaveis.OperacaoEmAndamento.Emergencia),
("pausa", Variaveis.OperacaoEmAndamento.Pausa)
);
}
@ -556,6 +557,18 @@ namespace AgroBase.Services.Operadores
("last_rx", DadosLra.UltimoRxDados)
);
var DadosMod = _Sensoriamento.DadosPerformance;
RedisService.AtualizarCampos(RedisService.ModKey(Enums.T_Code.Mod),
("timestamp", agora),
("freq_base", 1.0 / Variaveis.OperacaoEmAndamento.tmrLeiturasInterval),
("cpu_load", DadosMod.CPU_load ?? 0),
("gpu_load", DadosMod.GPU_load ?? 0),
("hdd_load", DadosMod.HDD_load ?? 0),
("ram_usage", DadosMod.RAM_usage ?? 0),
("cpu_temp", DadosMod.CPU_temp ?? 0),
("gpu_temp", DadosMod.GPU_temp ?? 0)
);
}

View File

@ -109,6 +109,7 @@ namespace AgroBase.Services.Operadores
if (TempoDesconectado > 0 && TempoDesconectado % 10 == 0)
{
IniciarOperadores();
AudioAlertaService.Falar("Núcleo central de processamento desconectado, tentando reconectar.");
}
}
else

View File

@ -197,6 +197,7 @@ namespace AgroBase.Services
public const string DadosManagerWorker = "ctx:dados_manager_worker";
public const string DadosHealthWorker = "ctx:dados_health_worker";
public const string DadosCameraWorker = "ctx:dados_camera_worker";
public const string DadosPesosMPC = "ctx:dados_pesos_mpc";
}
public static class CmdKey

View File

@ -22,5 +22,5 @@
"top_topics_and_observing_domains": [ ]
} ],
"hex_encoded_hmac_key": "40F346D3248C3AFDF2BEE1FE496DBD32F7CED6E5AE98B881ABC421AA7E7B5642",
"next_scheduled_calculation_time": "13406040024195500"
"next_scheduled_calculation_time": "13406040024195951"
}

View File

@ -1,3 +1,3 @@
2025/10/21-15:55:46.193 7ba4 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001
2025/10/21-15:55:46.202 7ba4 Recovering log #3
2025/10/21-15:55:46.206 7ba4 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/000003.log
2025/10/23-15:56:01.035 1ce8 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001
2025/10/23-15:56:01.043 1ce8 Recovering log #3
2025/10/23-15:56:01.046 1ce8 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/000003.log

View File

@ -1,3 +1,3 @@
2025/10/21-15:32:17.079 e18 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001
2025/10/21-15:32:17.090 e18 Recovering log #3
2025/10/21-15:32:17.093 e18 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/000003.log
2025/10/23-15:36:24.310 41b8 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001
2025/10/23-15:36:24.321 41b8 Recovering log #3
2025/10/23-15:36:24.325 41b8 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Local Storage\leveldb/000003.log

View File

@ -1 +1 @@
{"net":{"http_server_properties":{"servers":[{"alternative_service":[{"advertised_alpns":["h3"],"expiration":"13405632946561751","port":443,"protocol_str":"quic"}],"anonymization":["DAAAAAcAAABmaWxlOi8vAA==",false,0],"network_stats":{"srtt":10850},"server":"https://tile.openstreetmap.org","supports_spdy":true}],"supports_quic":{"address":"2804:d78:6d1:df00:d5f9:343b:6650:d75a","used_quic":true},"version":5},"network_qualities":{"CAASABiAgICA+P////8B":"4G","CAESABiAgICA+P////8B":"4G","CAISABiAgICA+P////8B":"4G","CAYSABiAgICA+P////8B":"Offline"}}}
{"net":{"http_server_properties":{"servers":[{"alternative_service":[{"advertised_alpns":["h3"],"expiration":"13405805867157912","port":443,"protocol_str":"quic"}],"anonymization":["DAAAAAcAAABmaWxlOi8vAA==",false,0],"network_stats":{"srtt":6943},"server":"https://tile.openstreetmap.org","supports_spdy":true}],"supports_quic":{"address":"2804:d78:6d1:df00:f9d8:1bdb:44b7:ff04","used_quic":true},"version":5},"network_qualities":{"CAASABiAgICA+P////8B":"4G","CAESABiAgICA+P////8B":"4G","CAISABiAgICA+P////8B":"4G","CAYSABiAgICA+P////8B":"Offline"}}}

View File

@ -1 +1 @@
{"sts":[{"expiry":1792587142.154096,"host":"bWGAftl61rqoc0YzqPncsLvQQh/iC2Bdp3ejUeGC83w=","mode":"force-https","sts_include_subdomains":true,"sts_observed":1761051142.154101}],"version":2}
{"sts":[{"expiry":1792781769.148211,"host":"bWGAftl61rqoc0YzqPncsLvQQh/iC2Bdp3ejUeGC83w=","mode":"force-https","sts_include_subdomains":true,"sts_observed":1761245769.148224}],"version":2}

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,3 @@
2025/10/21-16:01:56.995 7ba4 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/MANIFEST-000001
2025/10/21-16:01:56.997 7ba4 Recovering log #3
2025/10/21-16:01:57.002 7ba4 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/000003.log
2025/10/23-16:04:52.329 1ce8 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/MANIFEST-000001
2025/10/23-16:04:52.330 1ce8 Recovering log #3
2025/10/23-16:04:52.334 1ce8 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/000003.log

View File

@ -1,3 +1,3 @@
2025/10/21-15:33:00.189 e18 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/MANIFEST-000001
2025/10/21-15:33:00.191 e18 Recovering log #3
2025/10/21-15:33:00.195 e18 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/000003.log
2025/10/23-15:55:52.724 41b8 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/MANIFEST-000001
2025/10/23-15:55:52.726 41b8 Recovering log #3
2025/10/23-15:55:52.729 41b8 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Session Storage/000003.log

View File

@ -1,3 +1,3 @@
2025/10/21-15:55:46.109 7a68 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/MANIFEST-000001
2025/10/21-15:55:46.111 7a68 Recovering log #7
2025/10/21-15:55:46.112 7a68 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/000007.log
2025/10/23-15:56:00.959 4ea8 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/MANIFEST-000001
2025/10/23-15:56:00.962 4ea8 Recovering log #7
2025/10/23-15:56:00.962 4ea8 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/000007.log

View File

@ -1,3 +1,3 @@
2025/10/21-15:32:17.002 2080 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/MANIFEST-000001
2025/10/21-15:32:17.004 2080 Recovering log #7
2025/10/21-15:32:17.005 2080 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/000007.log
2025/10/23-15:36:24.227 4d68 Reusing MANIFEST C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/MANIFEST-000001
2025/10/23-15:36:24.229 4d68 Recovering log #7
2025/10/23-15:36:24.229 4d68 Reusing old log C:\ZendionInc\agrobot_base\AgroBase\AgroBase\bin\x64\Debug\AgroBase.exe.WebView2\EBWebView\Default\Site Characteristics Database/000007.log

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

@ -1 +1 @@
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"Id":"1","Name":"CidadeJardimTerreno2","Length":14.558011415731592,"Dist1":14.558011415731592,"Dist2":0.0},"geometry":{"id":"0","type":"LineString","coordinates":[[-47.395205344,-22.172559531333334],[-47.395212610166666,-22.172614638833334],[-47.395219157,-22.172656417833334],[-47.395223544833335,-22.1726892105],[-47.395224140984432,-22.172693691611649],[-47.395225326538004,-22.172702654611555]]}},{"type":"Feature","properties":{"Id":"2","Name":"CidadeJardimTerreno2","Length":14.771318274761821,"Dist1":14.558011415731592,"Dist2":0.0},"geometry":{"id":"1","type":"LineString","coordinates":[[-47.395210902333332,-22.172708800833334],[-47.395206943666665,-22.172679811],[-47.395202420666664,-22.1726491015],[-47.395198865666664,-22.172615782833333],[-47.395193255833334,-22.172577132833332],[-47.395192610024395,-22.172572657695412],[-47.395191325698136,-22.172563706509337]]}},{"type":"Feature","properties":{"Id":"3","Name":"CidadeJardimTerreno2","Length":14.827915524386164,"Dist1":14.558011415731592,"Dist2":0.0},"geometry":{"id":"2","type":"LineString","coordinates":[[-47.3951762925,-22.172561603],[-47.395180824166665,-22.172591686166665],[-47.395185745333336,-22.172623080166666],[-47.395190433,-22.172656367166667],[-47.395195199,-22.172693641833334],[-47.395195769044363,-22.172698125891035],[-47.395196902671593,-22.172707094716973]]}},{"type":"Feature","properties":{"Id":"4","Name":"CidadeJardimTerreno2","Length":14.785159385903514,"Dist1":14.558011415731592,"Dist2":0.0},"geometry":{"id":"3","type":"LineString","coordinates":[[-47.395182932166669,-22.1727127985],[-47.39517819266667,-22.172680514833335],[-47.3951732595,-22.172646752833334],[-47.395168805166669,-22.1726149155],[-47.395163812333337,-22.172581167166665],[-47.395163154299318,-22.172576693573966],[-47.395161845655842,-22.172567745443878]]}},{"type":"Feature","properties":{"Id":"5","Name":"CidadeJardimTerreno2","Length":14.801176921912329,"Dist1":14.558011415731592,"Dist2":0.0},"geometry":{"id":"4","type":"LineString","coordinates":[[-47.395147317833334,-22.172566031],[-47.395151503166666,-22.172595452333333],[-47.3951561855,-22.172628011166665],[-47.395161598666668,-22.172663757333332],[-47.395166727166668,-22.172697770833334],[-47.395167397572706,-22.172702242832194],[-47.39516873082615,-22.172711187810091]]}}]}
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"Id":"1","Name":"CidadeJardimCerto","Length":18.438211678884382,"Dist1":18.438211678884382,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[-47.3952092235,-22.172566764333332],[-47.395214685166664,-22.172591648666668],[-47.395217691333336,-22.1726149115],[-47.39522120783333,-22.172638106166666],[-47.395224592333335,-22.172662264666666],[-47.395227536833332,-22.172683503833333],[-47.395231278833336,-22.172709659],[-47.3952341445,-22.1727307235]]}},{"type":"Feature","properties":{"Id":"2","Name":"CidadeJardimCerto","Length":18.304756653641313,"Dist1":18.438211678884382,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[-47.395219567666665,-22.172731676],[-47.3952166705,-22.172709694166667],[-47.395212956833333,-22.1726860135],[-47.395209649833333,-22.172662382166667],[-47.3952061285,-22.172638539666668],[-47.395203071333334,-22.172615091],[-47.395199642,-22.172589946333332],[-47.39519637716667,-22.172568656333333]]}},{"type":"Feature","properties":{"Id":"3","Name":"CidadeJardimCerto","Length":18.204085527823089,"Dist1":18.438211678884382,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[-47.395182856666665,-22.172571987333335],[-47.395186353666666,-22.172596904666666],[-47.3951894365,-22.1726195275],[-47.395192361833331,-22.172642871333334],[-47.3951957415,-22.1726662635],[-47.3951991415,-22.1726895815],[-47.395202583833331,-22.172713842],[-47.395205228833333,-22.172734196333334]]}},{"type":"Feature","properties":{"Id":"4","Name":"CidadeJardimCerto","Length":18.206275148810604,"Dist1":18.438211678884382,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[-47.3951911205,-22.172735722833334],[-47.395187572,-22.172712241833334],[-47.3951841675,-22.1726893895],[-47.395179907166664,-22.1726651245],[-47.3951765075,-22.172642284833334],[-47.395173248666666,-22.1726180985],[-47.395169798666664,-22.172594096166666],[-47.395167092166666,-22.172573705666668]]}},{"type":"Feature","properties":{"Id":"5","Name":"CidadeJardimCerto","Length":18.067139082589541,"Dist1":18.438211678884382,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[-47.395153470333334,-22.172576570833332],[-47.395156353166669,-22.172600550333332],[-47.395159992333333,-22.172624829333333],[-47.395162920833336,-22.172647923333333],[-47.39516644,-22.172671954333332],[-47.395169917833336,-22.1726952245],[-47.3951736845,-22.172721525666667],[-47.395175992333336,-22.172737516833333]]}}]}

View File

@ -17,7 +17,7 @@
<meta name="viewport" content="width=device-width,
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
#map_4186306e9b7fcd80c184ec506da89a65 {
#map_a1ef8c3e70e8908a7f1bb5399f597657 {
position: relative;
width: 100.0%;
height: 100.0%;
@ -54,14 +54,14 @@
<body>
<div class="folium-map" id="map_4186306e9b7fcd80c184ec506da89a65" ></div>
<div class="folium-map" id="map_a1ef8c3e70e8908a7f1bb5399f597657" ></div>
</body>
<script>
var map_4186306e9b7fcd80c184ec506da89a65 = L.map(
"map_4186306e9b7fcd80c184ec506da89a65",
var map_a1ef8c3e70e8908a7f1bb5399f597657 = L.map(
"map_a1ef8c3e70e8908a7f1bb5399f597657",
{
center: [0.0, 0.0],
crs: L.CRS.EPSG3857,
@ -78,7 +78,7 @@
var tile_layer_ce532da5c58425eee9e9d530494caa7a = L.tileLayer(
var tile_layer_803e009a4dc9aff53ea6e9c896136d2f = L.tileLayer(
"https://tile.openstreetmap.org/{z}/{x}/{y}.png",
{
"minZoom": 0,
@ -95,7 +95,7 @@
);
tile_layer_ce532da5c58425eee9e9d530494caa7a.addTo(map_4186306e9b7fcd80c184ec506da89a65);
tile_layer_803e009a4dc9aff53ea6e9c896136d2f.addTo(map_a1ef8c3e70e8908a7f1bb5399f597657);
</script>
@ -116,7 +116,7 @@
}
trajeto_json_add({"features": []});
trajeto_json.addTo(map_4186306e9b7fcd80c184ec506da89a65);
trajeto_json.addTo(map_a1ef8c3e70e8908a7f1bb5399f597657);
function adicionarGeometria(novaGeometria) {
trajeto_json.addData(novaGeometria);
@ -179,9 +179,9 @@
var marcadorEquipamento = L.marker([0, 0], {
icon: customIcon
}).addTo(map_4186306e9b7fcd80c184ec506da89a65);
}).addTo(map_a1ef8c3e70e8908a7f1bb5399f597657);
var marcadorBase = L.marker([0, 0], {}).addTo(map_4186306e9b7fcd80c184ec506da89a65);
var marcadorBase = L.marker([0, 0], {}).addTo(map_a1ef8c3e70e8908a7f1bb5399f597657);
var icon = L.AwesomeMarkers.icon(
{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}
);
@ -246,7 +246,7 @@
}
if (foco) {
map_4186306e9b7fcd80c184ec506da89a65.setView(novaPosicao, map_4186306e9b7fcd80c184ec506da89a65.getZoom());
map_a1ef8c3e70e8908a7f1bb5399f597657.setView(novaPosicao, map_a1ef8c3e70e8908a7f1bb5399f597657.getZoom());
}
}
@ -268,7 +268,7 @@
marcadorDinamico.setRotationAngle(angulo);
adicionarCoordenada("Tj", [novaLongitude, novaLatitude]);
map_4186306e9b7fcd80c184ec506da89a65.setView(novaPosicao, map_4186306e9b7fcd80c184ec506da89a65.getZoom());*/
map_a1ef8c3e70e8908a7f1bb5399f597657.setView(novaPosicao, map_a1ef8c3e70e8908a7f1bb5399f597657.getZoom());*/
});
function calcularOrientacao(P1latitude, P1longitude, P2latitude, P2longitude) {

View File

@ -17,7 +17,7 @@
<meta name="viewport" content="width=device-width,
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
#map_7ba0141a20a2db00be73b9931039e31d {
#map_5379e892dbbc3f3d9b1bc572efef0593 {
position: relative;
width: 100.0%;
height: 100.0%;
@ -54,16 +54,16 @@
<body>
<div class="folium-map" id="map_7ba0141a20a2db00be73b9931039e31d" ></div>
<div class="folium-map" id="map_5379e892dbbc3f3d9b1bc572efef0593" ></div>
</body>
<script>
var map_7ba0141a20a2db00be73b9931039e31d = L.map(
"map_7ba0141a20a2db00be73b9931039e31d",
var map_5379e892dbbc3f3d9b1bc572efef0593 = L.map(
"map_5379e892dbbc3f3d9b1bc572efef0593",
{
center: [-22.172636164916668, -47.395186322185666],
center: [-22.17265214058333, -47.39519380741667],
crs: L.CRS.EPSG3857,
...{
"zoom": 12,
@ -78,7 +78,7 @@
var tile_layer_d3497833d2518b0b016756360b8a56e0 = L.tileLayer(
var tile_layer_c5f08447c85df9b0abd1c82f67a28ab0 = L.tileLayer(
"https://tile.openstreetmap.org/{z}/{x}/{y}.png",
{
"minZoom": 0,
@ -95,7 +95,7 @@
);
tile_layer_d3497833d2518b0b016756360b8a56e0.addTo(map_7ba0141a20a2db00be73b9931039e31d);
tile_layer_c5f08447c85df9b0abd1c82f67a28ab0.addTo(map_5379e892dbbc3f3d9b1bc572efef0593);
@ -111,7 +111,7 @@
}*/
});
}
function geo_json_c539b434bced5d69b705574c7f380895_onEachFeature(feature, layer) {
function geo_json_63e68f682888a97c1251d59ed4c9393c_onEachFeature(feature, layer) {
layer.on({
@ -148,23 +148,23 @@
}*/
});
};
var geo_json_c539b434bced5d69b705574c7f380895 = L.geoJson(null, {
onEachFeature: geo_json_c539b434bced5d69b705574c7f380895_onEachFeature,
var geo_json_63e68f682888a97c1251d59ed4c9393c = L.geoJson(null, {
onEachFeature: geo_json_63e68f682888a97c1251d59ed4c9393c_onEachFeature,
...{
}
});
function geo_json_c539b434bced5d69b705574c7f380895_add (data) {
geo_json_c539b434bced5d69b705574c7f380895
function geo_json_63e68f682888a97c1251d59ed4c9393c_add (data) {
geo_json_63e68f682888a97c1251d59ed4c9393c
.addData(data);
}
geo_json_c539b434bced5d69b705574c7f380895_add({"features": [{"geometry": {"coordinates": [[-47.395205344, -22.172559531333334], [-47.395212610166666, -22.172614638833334], [-47.395219157, -22.172656417833334], [-47.395223544833335, -22.1726892105], [-47.39522414098443, -22.17269369161165], [-47.395225326538004, -22.172702654611555]], "id": "0", "type": "LineString"}, "id": 0, "properties": {"Dist1": 14.558011415731592, "Dist2": 0.0, "Id": "1", "Length": 14.558011415731592, "Name": "CidadeJardimTerreno2"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.39521090233333, -22.172708800833334], [-47.395206943666665, -22.172679811], [-47.395202420666664, -22.1726491015], [-47.395198865666664, -22.172615782833333], [-47.395193255833334, -22.172577132833332], [-47.395192610024395, -22.17257265769541], [-47.395191325698136, -22.172563706509337]], "id": "1", "type": "LineString"}, "id": 1, "properties": {"Dist1": 14.558011415731592, "Dist2": 0.0, "Id": "2", "Length": 14.771318274761821, "Name": "CidadeJardimTerreno2"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.3951762925, -22.172561603], [-47.395180824166665, -22.172591686166665], [-47.395185745333336, -22.172623080166666], [-47.395190433, -22.172656367166667], [-47.395195199, -22.172693641833334], [-47.39519576904436, -22.172698125891035], [-47.39519690267159, -22.172707094716973]], "id": "2", "type": "LineString"}, "id": 2, "properties": {"Dist1": 14.558011415731592, "Dist2": 0.0, "Id": "3", "Length": 14.827915524386164, "Name": "CidadeJardimTerreno2"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.39518293216667, -22.1727127985], [-47.39517819266667, -22.172680514833335], [-47.3951732595, -22.172646752833334], [-47.39516880516667, -22.1726149155], [-47.39516381233334, -22.172581167166665], [-47.39516315429932, -22.172576693573966], [-47.39516184565584, -22.172567745443878]], "id": "3", "type": "LineString"}, "id": 3, "properties": {"Dist1": 14.558011415731592, "Dist2": 0.0, "Id": "4", "Length": 14.785159385903514, "Name": "CidadeJardimTerreno2"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.395147317833334, -22.172566031], [-47.395151503166666, -22.172595452333333], [-47.3951561855, -22.172628011166665], [-47.39516159866667, -22.172663757333332], [-47.39516672716667, -22.172697770833334], [-47.395167397572706, -22.172702242832194], [-47.39516873082615, -22.17271118781009]], "id": "4", "type": "LineString"}, "id": 4, "properties": {"Dist1": 14.558011415731592, "Dist2": 0.0, "Id": "5", "Length": 14.80117692191233, "Name": "CidadeJardimTerreno2"}, "type": "Feature"}], "type": "FeatureCollection"});
geo_json_c539b434bced5d69b705574c7f380895.setStyle(function(feature) {return feature.properties.style;});
geo_json_63e68f682888a97c1251d59ed4c9393c_add({"features": [{"geometry": {"coordinates": [[-47.3952092235, -22.172566764333332], [-47.395214685166664, -22.172591648666668], [-47.395217691333336, -22.1726149115], [-47.39522120783333, -22.172638106166666], [-47.395224592333335, -22.172662264666666], [-47.39522753683333, -22.172683503833333], [-47.395231278833336, -22.172709659], [-47.3952341445, -22.1727307235]], "id": null, "type": "LineString"}, "id": 0, "properties": {"Dist1": 18.438211678884382, "Dist2": 0.0, "Id": "1", "Length": 18.438211678884382, "Name": "CidadeJardimCerto"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.395219567666665, -22.172731676], [-47.3952166705, -22.172709694166667], [-47.39521295683333, -22.1726860135], [-47.39520964983333, -22.172662382166667], [-47.3952061285, -22.172638539666668], [-47.395203071333334, -22.172615091], [-47.395199642, -22.172589946333332], [-47.39519637716667, -22.172568656333333]], "id": null, "type": "LineString"}, "id": 1, "properties": {"Dist1": 18.438211678884382, "Dist2": 0.0, "Id": "2", "Length": 18.304756653641313, "Name": "CidadeJardimCerto"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.395182856666665, -22.172571987333335], [-47.395186353666666, -22.172596904666666], [-47.3951894365, -22.1726195275], [-47.39519236183333, -22.172642871333334], [-47.3951957415, -22.1726662635], [-47.3951991415, -22.1726895815], [-47.39520258383333, -22.172713842], [-47.39520522883333, -22.172734196333334]], "id": null, "type": "LineString"}, "id": 2, "properties": {"Dist1": 18.438211678884382, "Dist2": 0.0, "Id": "3", "Length": 18.20408552782309, "Name": "CidadeJardimCerto"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.3951911205, -22.172735722833334], [-47.395187572, -22.172712241833334], [-47.3951841675, -22.1726893895], [-47.395179907166664, -22.1726651245], [-47.3951765075, -22.172642284833334], [-47.395173248666666, -22.1726180985], [-47.395169798666664, -22.172594096166666], [-47.395167092166666, -22.172573705666668]], "id": null, "type": "LineString"}, "id": 3, "properties": {"Dist1": 18.438211678884382, "Dist2": 0.0, "Id": "4", "Length": 18.206275148810604, "Name": "CidadeJardimCerto"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.395153470333334, -22.172576570833332], [-47.39515635316667, -22.172600550333332], [-47.39515999233333, -22.172624829333333], [-47.395162920833336, -22.172647923333333], [-47.39516644, -22.17267195433333], [-47.395169917833336, -22.1726952245], [-47.3951736845, -22.172721525666667], [-47.395175992333336, -22.172737516833333]], "id": null, "type": "LineString"}, "id": 4, "properties": {"Dist1": 18.438211678884382, "Dist2": 0.0, "Id": "5", "Length": 18.06713908258954, "Name": "CidadeJardimCerto"}, "type": "Feature"}], "type": "FeatureCollection"});
geo_json_63e68f682888a97c1251d59ed4c9393c.setStyle(function(feature) {return feature.properties.style;});
geo_json_c539b434bced5d69b705574c7f380895.addTo(map_7ba0141a20a2db00be73b9931039e31d);
geo_json_63e68f682888a97c1251d59ed4c9393c.addTo(map_5379e892dbbc3f3d9b1bc572efef0593);
</script>
@ -185,7 +185,7 @@
}
trajeto_json_add({"features": []});
trajeto_json.addTo(map_7ba0141a20a2db00be73b9931039e31d);
trajeto_json.addTo(map_5379e892dbbc3f3d9b1bc572efef0593);
function adicionarGeometria(novaGeometria) {
trajeto_json.addData(novaGeometria);
@ -243,7 +243,7 @@
}
trajeto_dinamico_json_add({"features": []});
trajeto_dinamico_json.addTo(map_7ba0141a20a2db00be73b9931039e31d);
trajeto_dinamico_json.addTo(map_5379e892dbbc3f3d9b1bc572efef0593);
function adicionarGeometriaDinamica(novaGeometria) {
trajeto_dinamico_json.addData(novaGeometria);
@ -296,9 +296,9 @@
var marcadorEquipamento = L.marker([0, 0], {
icon: customIcon
}).addTo(map_7ba0141a20a2db00be73b9931039e31d);
}).addTo(map_5379e892dbbc3f3d9b1bc572efef0593);
var marcadorBase = L.marker([0, 0], {}).addTo(map_7ba0141a20a2db00be73b9931039e31d);
var marcadorBase = L.marker([0, 0], {}).addTo(map_5379e892dbbc3f3d9b1bc572efef0593);
var icon = L.AwesomeMarkers.icon(
{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}
);
@ -380,7 +380,7 @@
}
if (foco) {
map_7ba0141a20a2db00be73b9931039e31d.setView(novaPosicao, map_7ba0141a20a2db00be73b9931039e31d.getZoom());
map_5379e892dbbc3f3d9b1bc572efef0593.setView(novaPosicao, map_5379e892dbbc3f3d9b1bc572efef0593.getZoom());
}
}
@ -397,7 +397,7 @@
function atualizarSelecaoRuas(selecionadas) {
selecionadas = JSON.parse(selecionadas);
RuasSelecionadas = Array.isArray(selecionadas) ? [...selecionadas] : [];
geo_json_c539b434bced5d69b705574c7f380895.eachLayer(function (layer) {
geo_json_63e68f682888a97c1251d59ed4c9393c.eachLayer(function (layer) {
if (RuasSelecionadas.includes(parseInt(layer.feature.id))) {
layer.setStyle({ color: 'blue' });
} else {

View File

@ -14,6 +14,7 @@ def main():
from health_worker.modulos.atuador import ModuloAtuador
from health_worker.modulos.lora import ModuloLoRa
from health_worker.modulos.imu import IMUCamera
from health_worker.modulos.pc import ModuloPC
from health_worker.config import mostrar_log
from shared.contexto_global_redis import ContextoGlobalRedis, CmdKey, CtxKey
@ -25,6 +26,7 @@ def main():
T_Code.Atu: ModuloAtuador(),
T_Code.Lra: ModuloLoRa(),
T_Code.Imu: IMUCamera(),
T_Code.Mod: ModuloPC(),
}
def loop_ativo():

View File

@ -6,6 +6,7 @@ import numpy as np
from shared.enums import StatusCarroMapa, TipoMovimentoDirecional
from manager_worker.config import mostrar_log
from shared.gps_handler import GPSHandler
from shared.contexto_global_redis import ContextoGlobalRedis
_mpc = None
_iniciado = False
@ -484,19 +485,20 @@ class ControladorMPC:
dentro = CARRO.get("DentroCorredor", False)
velocidade = CARRO.get("Velocidade", self.velocidade_min)
peso_erro_pos = 1.2 # 0 1.2
peso_erro_ori = 2.2 # 1 2.2
peso_suavidade = _w_from_err_inv(erro_lat_m, w_min=0.5, w_max=3.6, deadband=0.05, tol=0.25, power=1.3, smooth=True)
peso_fator_re = 0.05 # 3 0.05
peso_ideal = 1.4 # 4 1.4
peso_lateral = _w_from_err(erro_lat_m, w_min=1.8, w_max=8.5, deadband=0.05, tol=0.7, power=1.3, smooth=True) if dentro else 0.0
pesos = ContextoGlobalRedis.get_pesos_mpc()
peso_erro_pos = pesos.get("posicao", 1.2)
peso_erro_ori = pesos.get("orientacao", 2.2)
peso_suavidade = _w_from_err_inv(erro_lat_m, w_min=pesos.get("suavidade_min", 0.5), w_max=pesos.get("suavidade_max", 3.6), deadband=0.05, tol=0.25, power=1.3, smooth=True)
peso_fator_re = pesos.get("fator_re", 0.05)
peso_ideal = pesos.get("ideal", 1.4)
peso_lateral = _w_from_err(erro_lat_m, w_min=pesos.get("lateral_min", 1.8), w_max=pesos.get("lateral_max", 8.5), deadband=0.05, tol=0.7, power=1.3, smooth=True) if dentro else 0.0
# Penalidade proporcional à velocidade
penalidade_por_velocidade = (velocidade / self.velocidade_max) / 10.0
custo_movimento = {
TipoMovimentoDirecional.RodasDianteiras: 0.0,
TipoMovimentoDirecional.MovimentoArco: 0.0,
TipoMovimentoDirecional.RodasDianteiras: 0.0,
TipoMovimentoDirecional.MovimentoDiagonal: 0.0
}
@ -1656,7 +1658,7 @@ class ControladorMPC:
try:
# ---- pesos heurísticos (erro ao ideal)
peso_angulo_ideal = float(self._calcular_pesos_movimento(contexto, e_ori, e_lat)[4])
peso_angulo_ideal = float(ContextoGlobalRedis.get_pesos_mpc().get("ideal", 1.4))
# ---- dados da matriz / ensure LUTs (idempotente)
dados_matriz_custo = contexto.get("VisualWorker", {}).get("MatrizCusto", {})

View File

@ -19,6 +19,7 @@ class CtxKey(str, Enum):
DadosManagerWorker = "ctx:dados_manager_worker"
DadosHealthWorker = "ctx:dados_health_worker"
DadosCameraWorker = "ctx:dados_camera_worker"
DadosPesosMPC = "ctx:dados_pesos_mpc"
class CmdKey(str, Enum):
@ -191,6 +192,9 @@ class ContextoGlobalRedis:
modulos_opcionais_configurados=[]
)
@classmethod
def get_pesos_mpc(cls):
return cls.get(CtxKey.DadosPesosMPC, {})
@classmethod
@ -206,6 +210,7 @@ class ContextoGlobalRedis:
modulos_mandatorios = set(_operacao.get("modulos_mandatorios", []))
modulos_opcionais = set(_operacao.get("modulos_opcionais", []))
emergencia = _operacao.get("emergencia", False)
pausa = _operacao.get("pausa", False)
modulos_presentes = set()
status_modulos = []
@ -358,7 +363,12 @@ class ContextoGlobalRedis:
emergencia_ok = False
motivos_dos_modulos_mandatorios.append(f"Parada de emergencia solicitada pela base!")
liberou = (base_ok and parametros_ok and emergencia_ok) or debug_mode
pausa_ok = True
if pausa:
pausa_ok = False
motivos_dos_modulos_mandatorios.append(f"Operação pausada.")
liberou = (base_ok and parametros_ok and emergencia_ok and pausa_ok) or debug_mode
cls.atualizar_ctx_dict(
CtxKey.DadosOperacao,
@ -391,7 +401,6 @@ class ContextoGlobalRedis:
modo = ModoOperacao(_operacao.get("modo", ModoOperacao.NaoDefinido.value))
status_atual = StatusOperacao(_operacao.get("status", StatusOperacao.NaoIniciado.value))
iniciado = _operacao.get("iniciado", False)
emergencia = _operacao.get("emergencia", False)
configurado = _operacao.get("configurado", False)
status_iniciado_anterior = _operacao.get("status_iniciado_anterior", False)
finalizando = _operacao.get("finalizando", False)
@ -414,7 +423,23 @@ class ContextoGlobalRedis:
cls.atualizar_ctx_dict(CtxKey.DadosOperacao, status=StatusOperacao.Parametrizando.value)
return
# Verifica se esta em processo de calibragem inicial
calibrando = _operacao.get("calibrando", False)
if calibrando:
if status_atual != StatusOperacao.Calibrando:
cls.atualizar_ctx_dict(CtxKey.DadosOperacao, status=StatusOperacao.Calibrando.value)
return
# Comando de parada de emergencia da base
pausa = _operacao.get("pausa", False)
if pausa:
novo_status = StatusOperacao.Parado
if status_atual != novo_status:
cls.atualizar_ctx_dict(CtxKey.DadosOperacao, status=novo_status.value)
return
# Comando de parada de emergencia da base
emergencia = _operacao.get("emergencia", False)
if emergencia:
novo_status = StatusOperacao.Parado
if status_atual != novo_status:
@ -434,13 +459,6 @@ class ContextoGlobalRedis:
if (iniciado and not status_iniciado_anterior):
cls._iniciar_operacao()
# Verifica se esta em processo de calibragem inicial
calibrando = _operacao.get("calibrando", False)
if calibrando:
if status_atual != StatusOperacao.Calibrando:
cls.atualizar_ctx_dict(CtxKey.DadosOperacao, status=StatusOperacao.Calibrando.value)
return
# Verifica se ainda está aguardando tempo inicial
tempo_aguardando = cls.get_operacao().get("tempo_aguardando", 0)
em_espera = (tempo_aguardando + _operacao.get("tempo_aguardar_inicio_operacao", 25)) > agora

View File

@ -34,6 +34,13 @@
this.txtLatitude = new System.Windows.Forms.TextBox();
this.txtLongitude = new System.Windows.Forms.TextBox();
this.pnlDados = new System.Windows.Forms.Panel();
this.txtStatusFix = new System.Windows.Forms.TextBox();
this.txtPrecisao = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtNSatelites = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txtDistanciaEntreLeituras = new System.Windows.Forms.TextBox();
this.txtFix = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.txtCarroConectado = new System.Windows.Forms.TextBox();
@ -94,13 +101,7 @@
this.tvwFalhas = new System.Windows.Forms.TreeView();
this.lblMapa = new System.Windows.Forms.Label();
this.btnCarregar = new System.Windows.Forms.Button();
this.txtPrecisao = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtNSatelites = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txtDistanciaEntreLeituras = new System.Windows.Forms.TextBox();
this.txtStatusFix = new System.Windows.Forms.TextBox();
this.btnFixar = new System.Windows.Forms.Button();
this.pnlDados.SuspendLayout();
this.pnlControle.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tkbAnguloMP)).BeginInit();
@ -159,6 +160,7 @@
// pnlDados
//
this.pnlDados.AutoScroll = true;
this.pnlDados.Controls.Add(this.btnFixar);
this.pnlDados.Controls.Add(this.txtStatusFix);
this.pnlDados.Controls.Add(this.txtPrecisao);
this.pnlDados.Controls.Add(this.label2);
@ -225,6 +227,72 @@
this.pnlDados.Size = new System.Drawing.Size(274, 594);
this.pnlDados.TabIndex = 6;
//
// txtStatusFix
//
this.txtStatusFix.Location = new System.Drawing.Point(11, 248);
this.txtStatusFix.Name = "txtStatusFix";
this.txtStatusFix.ReadOnly = true;
this.txtStatusFix.Size = new System.Drawing.Size(208, 20);
this.txtStatusFix.TabIndex = 63;
this.txtStatusFix.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// txtPrecisao
//
this.txtPrecisao.Location = new System.Drawing.Point(159, 179);
this.txtPrecisao.Name = "txtPrecisao";
this.txtPrecisao.ReadOnly = true;
this.txtPrecisao.Size = new System.Drawing.Size(60, 20);
this.txtPrecisao.TabIndex = 62;
this.txtPrecisao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.label2.Location = new System.Drawing.Point(157, 159);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(63, 17);
this.label2.TabIndex = 61;
this.label2.Text = "Precisão";
//
// txtNSatelites
//
this.txtNSatelites.Location = new System.Drawing.Point(78, 179);
this.txtNSatelites.Name = "txtNSatelites";
this.txtNSatelites.ReadOnly = true;
this.txtNSatelites.Size = new System.Drawing.Size(75, 20);
this.txtNSatelites.TabIndex = 60;
this.txtNSatelites.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.label3.Location = new System.Drawing.Point(76, 159);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(62, 17);
this.label3.TabIndex = 59;
this.label3.Text = "Satelites";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.label4.Location = new System.Drawing.Point(12, 159);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(66, 17);
this.label4.TabIndex = 58;
this.label4.Text = "Distancia";
//
// txtDistanciaEntreLeituras
//
this.txtDistanciaEntreLeituras.Location = new System.Drawing.Point(11, 179);
this.txtDistanciaEntreLeituras.Name = "txtDistanciaEntreLeituras";
this.txtDistanciaEntreLeituras.ReadOnly = true;
this.txtDistanciaEntreLeituras.Size = new System.Drawing.Size(60, 20);
this.txtDistanciaEntreLeituras.TabIndex = 57;
this.txtDistanciaEntreLeituras.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// txtFix
//
this.txtFix.Location = new System.Drawing.Point(159, 136);
@ -801,71 +869,15 @@
this.btnCarregar.UseVisualStyleBackColor = true;
this.btnCarregar.Click += new System.EventHandler(this.btnCarregar_Click);
//
// txtPrecisao
// btnFixar
//
this.txtPrecisao.Location = new System.Drawing.Point(159, 179);
this.txtPrecisao.Name = "txtPrecisao";
this.txtPrecisao.ReadOnly = true;
this.txtPrecisao.Size = new System.Drawing.Size(60, 20);
this.txtPrecisao.TabIndex = 62;
this.txtPrecisao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.label2.Location = new System.Drawing.Point(157, 159);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(63, 17);
this.label2.TabIndex = 61;
this.label2.Text = "Precisão";
//
// txtNSatelites
//
this.txtNSatelites.Location = new System.Drawing.Point(78, 179);
this.txtNSatelites.Name = "txtNSatelites";
this.txtNSatelites.ReadOnly = true;
this.txtNSatelites.Size = new System.Drawing.Size(75, 20);
this.txtNSatelites.TabIndex = 60;
this.txtNSatelites.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.label3.Location = new System.Drawing.Point(76, 159);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(62, 17);
this.label3.TabIndex = 59;
this.label3.Text = "Satelites";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.label4.Location = new System.Drawing.Point(12, 159);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(66, 17);
this.label4.TabIndex = 58;
this.label4.Text = "Distancia";
//
// txtDistanciaEntreLeituras
//
this.txtDistanciaEntreLeituras.Location = new System.Drawing.Point(11, 179);
this.txtDistanciaEntreLeituras.Name = "txtDistanciaEntreLeituras";
this.txtDistanciaEntreLeituras.ReadOnly = true;
this.txtDistanciaEntreLeituras.Size = new System.Drawing.Size(60, 20);
this.txtDistanciaEntreLeituras.TabIndex = 57;
this.txtDistanciaEntreLeituras.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// txtStatusFix
//
this.txtStatusFix.Location = new System.Drawing.Point(11, 248);
this.txtStatusFix.Name = "txtStatusFix";
this.txtStatusFix.ReadOnly = true;
this.txtStatusFix.Size = new System.Drawing.Size(208, 20);
this.txtStatusFix.TabIndex = 63;
this.txtStatusFix.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.btnFixar.Location = new System.Drawing.Point(219, 246);
this.btnFixar.Name = "btnFixar";
this.btnFixar.Size = new System.Drawing.Size(35, 23);
this.btnFixar.TabIndex = 64;
this.btnFixar.Text = "F";
this.btnFixar.UseVisualStyleBackColor = true;
this.btnFixar.Click += new System.EventHandler(this.btnFixar_Click);
//
// frmMonitoramento
//
@ -966,5 +978,6 @@
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtDistanciaEntreLeituras;
private System.Windows.Forms.TextBox txtStatusFix;
private System.Windows.Forms.Button btnFixar;
}
}

View File

@ -1,4 +1,5 @@
using AgroBase.Models;
using AgroBase.Models.Components;
using AgroBase.Services;
using System;
using System.Collections.Generic;
@ -77,6 +78,12 @@ namespace AgroMonitor.Forms
bool foco = enderecoEquipamentoEmFoco == enderecoEquipamentoLog && chbFoco.Checked;
GPSService.EnviarCoordenadasParaMapa(eq.Value.Coordenadas.Latitude, eq.Value.Coordenadas.Longitude, eq.Value.Coordenadas.Orientacao, foco, eq.Key);
}
if (BaseFixService.CorrecaoAbsoluta && BaseFixService.FixLiberado && btnFixar.Text == "P")
{
BaseFixService.FixLiberado = false;
btnFixar.Text = "F";
}
}
private void VerificarAtualizacoesEquipamentos()
@ -345,5 +352,43 @@ namespace AgroMonitor.Forms
{
lblAngulo.Text = $"Angulo: {tkbAnguloMP.Value}°";
}
private void btnFixar_Click(object sender, EventArgs e)
{
if (!BaseFixService.FixLiberado)
{
if (BaseFixService.CorrecaoAbsoluta)
{
var res = CustomDialog.ShowDialog(
"Mudar posição da base?",
"Tem certeza que deseja fixar a posição da base novamente?",
MessageBoxIcon.Question,
new Dictionary<(string, dynamic), Action>()
{
{ ("Sim", null), () => { } },
{ ("Não", null), () => { } }
}
);
if (res == DialogResult.Yes)
{
btnFixar.Text = "P";
BaseFixService.FixLiberado = true;
Task.Run(async () => await GPSService.ConfigurarModulo());
}
}
else
{
btnFixar.Text = "P";
BaseFixService.FixLiberado = true;
}
}
else
{
btnFixar.Text = "F";
BaseFixService.FixLiberado = false;
}
}
}
}