ajustado eixo imu traseiro, refletido parametros recebidos da base na ihm, corrigido status desejado da bomba no atuador ao iniciar, watchdog para finalizar calibragem travada, retorno a base reinicia mpc, iniciar operacao nao zera leituras, verificacao da orientacao real do corredor
This commit is contained in:
parent
63cc8d7e5e
commit
f5645ce227
|
|
@ -44,6 +44,12 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
this.paramAlturaArea = new AgroBase.Forms.IHM.Operacao.Parametros.Controls.HmiCompactNumericField();
|
this.paramAlturaArea = new AgroBase.Forms.IHM.Operacao.Parametros.Controls.HmiCompactNumericField();
|
||||||
this.paramErvasOn = new AgroBase.Forms.IHM.Operacao.Parametros.Controls.HmiCompactNumericField();
|
this.paramErvasOn = new AgroBase.Forms.IHM.Operacao.Parametros.Controls.HmiCompactNumericField();
|
||||||
this.paramErvasOff = new AgroBase.Forms.IHM.Operacao.Parametros.Controls.HmiCompactNumericField();
|
this.paramErvasOff = new AgroBase.Forms.IHM.Operacao.Parametros.Controls.HmiCompactNumericField();
|
||||||
|
this.cabecaModeloLayout = new System.Windows.Forms.TableLayoutPanel();
|
||||||
|
this.lblCabecaModelo = new System.Windows.Forms.Label();
|
||||||
|
this.cmbCabecaModelo = new System.Windows.Forms.ComboBox();
|
||||||
|
this.classeAlvoLayout = new System.Windows.Forms.TableLayoutPanel();
|
||||||
|
this.lblClasseAlvo = new System.Windows.Forms.Label();
|
||||||
|
this.cmbClasseAlvo = new System.Windows.Forms.ComboBox();
|
||||||
this.rootLayout.SuspendLayout();
|
this.rootLayout.SuspendLayout();
|
||||||
this.pnlAgitador.SuspendLayout();
|
this.pnlAgitador.SuspendLayout();
|
||||||
this.agitadorLayout.SuspendLayout();
|
this.agitadorLayout.SuspendLayout();
|
||||||
|
|
@ -52,6 +58,8 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
this.pulverizacaoLayout.SuspendLayout();
|
this.pulverizacaoLayout.SuspendLayout();
|
||||||
this.pulverizacaoHeaderLayout.SuspendLayout();
|
this.pulverizacaoHeaderLayout.SuspendLayout();
|
||||||
this.parametrosLayout.SuspendLayout();
|
this.parametrosLayout.SuspendLayout();
|
||||||
|
this.cabecaModeloLayout.SuspendLayout();
|
||||||
|
this.classeAlvoLayout.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// rootLayout
|
// rootLayout
|
||||||
|
|
@ -370,14 +378,17 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
this.parametrosLayout.Controls.Add(this.paramAlturaArea, 1, 1);
|
this.parametrosLayout.Controls.Add(this.paramAlturaArea, 1, 1);
|
||||||
this.parametrosLayout.Controls.Add(this.paramErvasOn, 0, 2);
|
this.parametrosLayout.Controls.Add(this.paramErvasOn, 0, 2);
|
||||||
this.parametrosLayout.Controls.Add(this.paramErvasOff, 1, 2);
|
this.parametrosLayout.Controls.Add(this.paramErvasOff, 1, 2);
|
||||||
|
this.parametrosLayout.Controls.Add(this.cabecaModeloLayout, 0, 3);
|
||||||
|
this.parametrosLayout.Controls.Add(this.classeAlvoLayout, 1, 3);
|
||||||
this.parametrosLayout.Dock = System.Windows.Forms.DockStyle.Fill;
|
this.parametrosLayout.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.parametrosLayout.Location = new System.Drawing.Point(0, 60);
|
this.parametrosLayout.Location = new System.Drawing.Point(0, 60);
|
||||||
this.parametrosLayout.Margin = new System.Windows.Forms.Padding(0);
|
this.parametrosLayout.Margin = new System.Windows.Forms.Padding(0);
|
||||||
this.parametrosLayout.Name = "parametrosLayout";
|
this.parametrosLayout.Name = "parametrosLayout";
|
||||||
this.parametrosLayout.RowCount = 3;
|
this.parametrosLayout.RowCount = 4;
|
||||||
this.parametrosLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33F));
|
this.parametrosLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
|
||||||
this.parametrosLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33F));
|
this.parametrosLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
|
||||||
this.parametrosLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.34F));
|
this.parametrosLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
|
||||||
|
this.parametrosLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
|
||||||
this.parametrosLayout.Size = new System.Drawing.Size(437, 210);
|
this.parametrosLayout.Size = new System.Drawing.Size(437, 210);
|
||||||
this.parametrosLayout.TabIndex = 2;
|
this.parametrosLayout.TabIndex = 2;
|
||||||
//
|
//
|
||||||
|
|
@ -397,10 +408,10 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0});
|
0});
|
||||||
this.paramBicosEmUso.MinimumSize = new System.Drawing.Size(0, 60);
|
this.paramBicosEmUso.MinimumSize = new System.Drawing.Size(0, 45);
|
||||||
this.paramBicosEmUso.Name = "paramBicosEmUso";
|
this.paramBicosEmUso.Name = "paramBicosEmUso";
|
||||||
this.paramBicosEmUso.Padding = new System.Windows.Forms.Padding(7, 5, 7, 5);
|
this.paramBicosEmUso.Padding = new System.Windows.Forms.Padding(4, 2, 4, 3);
|
||||||
this.paramBicosEmUso.Size = new System.Drawing.Size(212, 63);
|
this.paramBicosEmUso.Size = new System.Drawing.Size(212, 46);
|
||||||
this.paramBicosEmUso.TabIndex = 0;
|
this.paramBicosEmUso.TabIndex = 0;
|
||||||
this.paramBicosEmUso.Titulo = "Bicos em uso";
|
this.paramBicosEmUso.Titulo = "Bicos em uso";
|
||||||
this.paramBicosEmUso.Unidade = "";
|
this.paramBicosEmUso.Unidade = "";
|
||||||
|
|
@ -421,10 +432,10 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0});
|
0});
|
||||||
this.paramPressaoLinha.MinimumSize = new System.Drawing.Size(0, 60);
|
this.paramPressaoLinha.MinimumSize = new System.Drawing.Size(0, 45);
|
||||||
this.paramPressaoLinha.Name = "paramPressaoLinha";
|
this.paramPressaoLinha.Name = "paramPressaoLinha";
|
||||||
this.paramPressaoLinha.Padding = new System.Windows.Forms.Padding(7, 5, 7, 5);
|
this.paramPressaoLinha.Padding = new System.Windows.Forms.Padding(4, 2, 4, 3);
|
||||||
this.paramPressaoLinha.Size = new System.Drawing.Size(213, 63);
|
this.paramPressaoLinha.Size = new System.Drawing.Size(213, 46);
|
||||||
this.paramPressaoLinha.TabIndex = 1;
|
this.paramPressaoLinha.TabIndex = 1;
|
||||||
this.paramPressaoLinha.Titulo = "Pressão da linha";
|
this.paramPressaoLinha.Titulo = "Pressão da linha";
|
||||||
this.paramPressaoLinha.Unidade = "psi";
|
this.paramPressaoLinha.Unidade = "psi";
|
||||||
|
|
@ -438,12 +449,12 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
//
|
//
|
||||||
this.paramInicioTela.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(36)))), ((int)(((byte)(41)))));
|
this.paramInicioTela.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(36)))), ((int)(((byte)(41)))));
|
||||||
this.paramInicioTela.Dock = System.Windows.Forms.DockStyle.Fill;
|
this.paramInicioTela.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.paramInicioTela.Location = new System.Drawing.Point(2, 71);
|
this.paramInicioTela.Location = new System.Drawing.Point(2, 54);
|
||||||
this.paramInicioTela.Margin = new System.Windows.Forms.Padding(2, 2, 4, 4);
|
this.paramInicioTela.Margin = new System.Windows.Forms.Padding(2, 2, 4, 4);
|
||||||
this.paramInicioTela.MinimumSize = new System.Drawing.Size(0, 60);
|
this.paramInicioTela.MinimumSize = new System.Drawing.Size(0, 45);
|
||||||
this.paramInicioTela.Name = "paramInicioTela";
|
this.paramInicioTela.Name = "paramInicioTela";
|
||||||
this.paramInicioTela.Padding = new System.Windows.Forms.Padding(7, 5, 7, 5);
|
this.paramInicioTela.Padding = new System.Windows.Forms.Padding(4, 2, 4, 3);
|
||||||
this.paramInicioTela.Size = new System.Drawing.Size(212, 63);
|
this.paramInicioTela.Size = new System.Drawing.Size(212, 46);
|
||||||
this.paramInicioTela.TabIndex = 2;
|
this.paramInicioTela.TabIndex = 2;
|
||||||
this.paramInicioTela.Titulo = "Início da atuação";
|
this.paramInicioTela.Titulo = "Início da atuação";
|
||||||
this.paramInicioTela.Unidade = "%";
|
this.paramInicioTela.Unidade = "%";
|
||||||
|
|
@ -457,17 +468,17 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
//
|
//
|
||||||
this.paramAlturaArea.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(36)))), ((int)(((byte)(41)))));
|
this.paramAlturaArea.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(36)))), ((int)(((byte)(41)))));
|
||||||
this.paramAlturaArea.Dock = System.Windows.Forms.DockStyle.Fill;
|
this.paramAlturaArea.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.paramAlturaArea.Location = new System.Drawing.Point(222, 71);
|
this.paramAlturaArea.Location = new System.Drawing.Point(222, 54);
|
||||||
this.paramAlturaArea.Margin = new System.Windows.Forms.Padding(4, 2, 2, 4);
|
this.paramAlturaArea.Margin = new System.Windows.Forms.Padding(4, 2, 2, 4);
|
||||||
this.paramAlturaArea.Minimum = new decimal(new int[] {
|
this.paramAlturaArea.Minimum = new decimal(new int[] {
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0});
|
0});
|
||||||
this.paramAlturaArea.MinimumSize = new System.Drawing.Size(0, 60);
|
this.paramAlturaArea.MinimumSize = new System.Drawing.Size(0, 45);
|
||||||
this.paramAlturaArea.Name = "paramAlturaArea";
|
this.paramAlturaArea.Name = "paramAlturaArea";
|
||||||
this.paramAlturaArea.Padding = new System.Windows.Forms.Padding(7, 5, 7, 5);
|
this.paramAlturaArea.Padding = new System.Windows.Forms.Padding(4, 2, 4, 3);
|
||||||
this.paramAlturaArea.Size = new System.Drawing.Size(213, 63);
|
this.paramAlturaArea.Size = new System.Drawing.Size(213, 46);
|
||||||
this.paramAlturaArea.TabIndex = 3;
|
this.paramAlturaArea.TabIndex = 3;
|
||||||
this.paramAlturaArea.Titulo = "Altura da área";
|
this.paramAlturaArea.Titulo = "Altura da área";
|
||||||
this.paramAlturaArea.Unidade = "%";
|
this.paramAlturaArea.Unidade = "%";
|
||||||
|
|
@ -487,12 +498,12 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
65536});
|
65536});
|
||||||
this.paramErvasOn.Location = new System.Drawing.Point(2, 140);
|
this.paramErvasOn.Location = new System.Drawing.Point(2, 106);
|
||||||
this.paramErvasOn.Margin = new System.Windows.Forms.Padding(2, 2, 4, 0);
|
this.paramErvasOn.Margin = new System.Windows.Forms.Padding(2, 2, 4, 0);
|
||||||
this.paramErvasOn.MinimumSize = new System.Drawing.Size(0, 60);
|
this.paramErvasOn.MinimumSize = new System.Drawing.Size(0, 45);
|
||||||
this.paramErvasOn.Name = "paramErvasOn";
|
this.paramErvasOn.Name = "paramErvasOn";
|
||||||
this.paramErvasOn.Padding = new System.Windows.Forms.Padding(7, 5, 7, 5);
|
this.paramErvasOn.Padding = new System.Windows.Forms.Padding(4, 2, 4, 3);
|
||||||
this.paramErvasOn.Size = new System.Drawing.Size(212, 70);
|
this.paramErvasOn.Size = new System.Drawing.Size(212, 50);
|
||||||
this.paramErvasOn.TabIndex = 4;
|
this.paramErvasOn.TabIndex = 4;
|
||||||
this.paramErvasOn.Titulo = "Ervas para ligar";
|
this.paramErvasOn.Titulo = "Ervas para ligar";
|
||||||
this.paramErvasOn.Unidade = "%";
|
this.paramErvasOn.Unidade = "%";
|
||||||
|
|
@ -512,12 +523,12 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
65536});
|
65536});
|
||||||
this.paramErvasOff.Location = new System.Drawing.Point(222, 140);
|
this.paramErvasOff.Location = new System.Drawing.Point(222, 106);
|
||||||
this.paramErvasOff.Margin = new System.Windows.Forms.Padding(4, 2, 2, 0);
|
this.paramErvasOff.Margin = new System.Windows.Forms.Padding(4, 2, 2, 0);
|
||||||
this.paramErvasOff.MinimumSize = new System.Drawing.Size(0, 60);
|
this.paramErvasOff.MinimumSize = new System.Drawing.Size(0, 45);
|
||||||
this.paramErvasOff.Name = "paramErvasOff";
|
this.paramErvasOff.Name = "paramErvasOff";
|
||||||
this.paramErvasOff.Padding = new System.Windows.Forms.Padding(7, 5, 7, 5);
|
this.paramErvasOff.Padding = new System.Windows.Forms.Padding(4, 2, 4, 3);
|
||||||
this.paramErvasOff.Size = new System.Drawing.Size(213, 70);
|
this.paramErvasOff.Size = new System.Drawing.Size(213, 50);
|
||||||
this.paramErvasOff.TabIndex = 5;
|
this.paramErvasOff.TabIndex = 5;
|
||||||
this.paramErvasOff.Titulo = "Ervas para desligar";
|
this.paramErvasOff.Titulo = "Ervas para desligar";
|
||||||
this.paramErvasOff.Unidade = "%";
|
this.paramErvasOff.Unidade = "%";
|
||||||
|
|
@ -527,6 +538,100 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
0,
|
0,
|
||||||
65536});
|
65536});
|
||||||
//
|
//
|
||||||
|
// cabecaModeloLayout
|
||||||
|
//
|
||||||
|
this.cabecaModeloLayout.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(36)))), ((int)(((byte)(41)))));
|
||||||
|
this.cabecaModeloLayout.ColumnCount = 1;
|
||||||
|
this.cabecaModeloLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||||
|
this.cabecaModeloLayout.Controls.Add(this.lblCabecaModelo, 0, 0);
|
||||||
|
this.cabecaModeloLayout.Controls.Add(this.cmbCabecaModelo, 0, 1);
|
||||||
|
this.cabecaModeloLayout.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.cabecaModeloLayout.Location = new System.Drawing.Point(2, 158);
|
||||||
|
this.cabecaModeloLayout.Margin = new System.Windows.Forms.Padding(2, 2, 4, 0);
|
||||||
|
this.cabecaModeloLayout.Name = "cabecaModeloLayout";
|
||||||
|
this.cabecaModeloLayout.Padding = new System.Windows.Forms.Padding(7, 2, 7, 3);
|
||||||
|
this.cabecaModeloLayout.RowCount = 2;
|
||||||
|
this.cabecaModeloLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
|
||||||
|
this.cabecaModeloLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||||
|
this.cabecaModeloLayout.Size = new System.Drawing.Size(212, 52);
|
||||||
|
this.cabecaModeloLayout.TabIndex = 6;
|
||||||
|
//
|
||||||
|
// lblCabecaModelo
|
||||||
|
//
|
||||||
|
this.lblCabecaModelo.AutoEllipsis = true;
|
||||||
|
this.lblCabecaModelo.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.lblCabecaModelo.Font = new System.Drawing.Font("Segoe UI", 7F);
|
||||||
|
this.lblCabecaModelo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(164)))), ((int)(((byte)(174)))), ((int)(((byte)(181)))));
|
||||||
|
this.lblCabecaModelo.Location = new System.Drawing.Point(7, 2);
|
||||||
|
this.lblCabecaModelo.Margin = new System.Windows.Forms.Padding(0);
|
||||||
|
this.lblCabecaModelo.Name = "lblCabecaModelo";
|
||||||
|
this.lblCabecaModelo.Size = new System.Drawing.Size(198, 17);
|
||||||
|
this.lblCabecaModelo.TabIndex = 0;
|
||||||
|
this.lblCabecaModelo.Text = "Cabeça de segmentação";
|
||||||
|
this.lblCabecaModelo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||||
|
//
|
||||||
|
// cmbCabecaModelo
|
||||||
|
//
|
||||||
|
this.cmbCabecaModelo.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(45)))), ((int)(((byte)(50)))));
|
||||||
|
this.cmbCabecaModelo.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.cmbCabecaModelo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cmbCabecaModelo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
|
this.cmbCabecaModelo.Font = new System.Drawing.Font("Segoe UI", 8F);
|
||||||
|
this.cmbCabecaModelo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(241)))), ((int)(((byte)(245)))), ((int)(((byte)(247)))));
|
||||||
|
this.cmbCabecaModelo.FormattingEnabled = true;
|
||||||
|
this.cmbCabecaModelo.Location = new System.Drawing.Point(7, 19);
|
||||||
|
this.cmbCabecaModelo.Margin = new System.Windows.Forms.Padding(0);
|
||||||
|
this.cmbCabecaModelo.Name = "cmbCabecaModelo";
|
||||||
|
this.cmbCabecaModelo.Size = new System.Drawing.Size(198, 21);
|
||||||
|
this.cmbCabecaModelo.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// classeAlvoLayout
|
||||||
|
//
|
||||||
|
this.classeAlvoLayout.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(36)))), ((int)(((byte)(41)))));
|
||||||
|
this.classeAlvoLayout.ColumnCount = 1;
|
||||||
|
this.classeAlvoLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||||
|
this.classeAlvoLayout.Controls.Add(this.lblClasseAlvo, 0, 0);
|
||||||
|
this.classeAlvoLayout.Controls.Add(this.cmbClasseAlvo, 0, 1);
|
||||||
|
this.classeAlvoLayout.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.classeAlvoLayout.Location = new System.Drawing.Point(222, 158);
|
||||||
|
this.classeAlvoLayout.Margin = new System.Windows.Forms.Padding(4, 2, 2, 0);
|
||||||
|
this.classeAlvoLayout.Name = "classeAlvoLayout";
|
||||||
|
this.classeAlvoLayout.Padding = new System.Windows.Forms.Padding(7, 2, 7, 3);
|
||||||
|
this.classeAlvoLayout.RowCount = 2;
|
||||||
|
this.classeAlvoLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
|
||||||
|
this.classeAlvoLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||||
|
this.classeAlvoLayout.Size = new System.Drawing.Size(213, 52);
|
||||||
|
this.classeAlvoLayout.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// lblClasseAlvo
|
||||||
|
//
|
||||||
|
this.lblClasseAlvo.AutoEllipsis = true;
|
||||||
|
this.lblClasseAlvo.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.lblClasseAlvo.Font = new System.Drawing.Font("Segoe UI", 7F);
|
||||||
|
this.lblClasseAlvo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(164)))), ((int)(((byte)(174)))), ((int)(((byte)(181)))));
|
||||||
|
this.lblClasseAlvo.Location = new System.Drawing.Point(7, 2);
|
||||||
|
this.lblClasseAlvo.Margin = new System.Windows.Forms.Padding(0);
|
||||||
|
this.lblClasseAlvo.Name = "lblClasseAlvo";
|
||||||
|
this.lblClasseAlvo.Size = new System.Drawing.Size(199, 17);
|
||||||
|
this.lblClasseAlvo.TabIndex = 0;
|
||||||
|
this.lblClasseAlvo.Text = "Classe alvo";
|
||||||
|
this.lblClasseAlvo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||||
|
//
|
||||||
|
// cmbClasseAlvo
|
||||||
|
//
|
||||||
|
this.cmbClasseAlvo.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(45)))), ((int)(((byte)(50)))));
|
||||||
|
this.cmbClasseAlvo.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.cmbClasseAlvo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cmbClasseAlvo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
|
this.cmbClasseAlvo.Font = new System.Drawing.Font("Segoe UI", 8F);
|
||||||
|
this.cmbClasseAlvo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(241)))), ((int)(((byte)(245)))), ((int)(((byte)(247)))));
|
||||||
|
this.cmbClasseAlvo.FormattingEnabled = true;
|
||||||
|
this.cmbClasseAlvo.Location = new System.Drawing.Point(7, 19);
|
||||||
|
this.cmbClasseAlvo.Margin = new System.Windows.Forms.Padding(0);
|
||||||
|
this.cmbClasseAlvo.Name = "cmbClasseAlvo";
|
||||||
|
this.cmbClasseAlvo.Size = new System.Drawing.Size(199, 21);
|
||||||
|
this.cmbClasseAlvo.TabIndex = 1;
|
||||||
|
//
|
||||||
// ucParametrosAtuador
|
// ucParametrosAtuador
|
||||||
//
|
//
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||||
|
|
@ -544,6 +649,8 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
this.pulverizacaoLayout.ResumeLayout(false);
|
this.pulverizacaoLayout.ResumeLayout(false);
|
||||||
this.pulverizacaoHeaderLayout.ResumeLayout(false);
|
this.pulverizacaoHeaderLayout.ResumeLayout(false);
|
||||||
this.parametrosLayout.ResumeLayout(false);
|
this.parametrosLayout.ResumeLayout(false);
|
||||||
|
this.cabecaModeloLayout.ResumeLayout(false);
|
||||||
|
this.classeAlvoLayout.ResumeLayout(false);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -573,5 +680,11 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
private AgroBase.Forms.IHM.Operacao.Parametros.Controls.HmiCompactNumericField paramAlturaArea;
|
private AgroBase.Forms.IHM.Operacao.Parametros.Controls.HmiCompactNumericField paramAlturaArea;
|
||||||
private AgroBase.Forms.IHM.Operacao.Parametros.Controls.HmiCompactNumericField paramErvasOn;
|
private AgroBase.Forms.IHM.Operacao.Parametros.Controls.HmiCompactNumericField paramErvasOn;
|
||||||
private AgroBase.Forms.IHM.Operacao.Parametros.Controls.HmiCompactNumericField paramErvasOff;
|
private AgroBase.Forms.IHM.Operacao.Parametros.Controls.HmiCompactNumericField paramErvasOff;
|
||||||
|
private System.Windows.Forms.TableLayoutPanel cabecaModeloLayout;
|
||||||
|
private System.Windows.Forms.Label lblCabecaModelo;
|
||||||
|
private System.Windows.Forms.ComboBox cmbCabecaModelo;
|
||||||
|
private System.Windows.Forms.TableLayoutPanel classeAlvoLayout;
|
||||||
|
private System.Windows.Forms.Label lblClasseAlvo;
|
||||||
|
private System.Windows.Forms.ComboBox cmbClasseAlvo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -12,6 +12,14 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
public ucParametrosAtuador()
|
public ucParametrosAtuador()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
cmbCabecaModelo.Items.Clear();
|
||||||
|
cmbCabecaModelo.Items.AddRange(Enum.GetNames(typeof(Enums.CabecasModelo)));
|
||||||
|
cmbCabecaModelo.SelectedIndex = 0;
|
||||||
|
cmbClasseAlvo.Items.Clear();
|
||||||
|
cmbClasseAlvo.Items.AddRange(new string[] { "chao", "cana", "erva" });
|
||||||
|
cmbClasseAlvo.SelectedIndex = 2;
|
||||||
|
|
||||||
VincularEventos();
|
VincularEventos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -31,6 +39,9 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
paramAlturaArea.ValueChanged += Controle_Alterado;
|
paramAlturaArea.ValueChanged += Controle_Alterado;
|
||||||
paramErvasOn.ValueChanged += Controle_Alterado;
|
paramErvasOn.ValueChanged += Controle_Alterado;
|
||||||
paramErvasOff.ValueChanged += Controle_Alterado;
|
paramErvasOff.ValueChanged += Controle_Alterado;
|
||||||
|
|
||||||
|
cmbCabecaModelo.SelectedValueChanged += Controle_Alterado;
|
||||||
|
cmbClasseAlvo.SelectedValueChanged += Controle_Alterado;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DefinirOperacao(OperacaoModel operacao)
|
public void DefinirOperacao(OperacaoModel operacao)
|
||||||
|
|
@ -61,6 +72,9 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
paramAlturaArea.Value = (decimal)(parametros?.AtuAlturaAreaPulverizacao ?? 0);
|
paramAlturaArea.Value = (decimal)(parametros?.AtuAlturaAreaPulverizacao ?? 0);
|
||||||
paramErvasOn.Value = (decimal)(parametros?.AtuPercentualErvasBicoOn ?? 0);
|
paramErvasOn.Value = (decimal)(parametros?.AtuPercentualErvasBicoOn ?? 0);
|
||||||
paramErvasOff.Value = (decimal)(parametros?.AtuPercentualErvasBicoOff ?? 0);
|
paramErvasOff.Value = (decimal)(parametros?.AtuPercentualErvasBicoOff ?? 0);
|
||||||
|
|
||||||
|
cmbCabecaModelo.SelectedIndex = (int)(parametros?.AtuModeloCabeca ?? 0);
|
||||||
|
cmbClasseAlvo.SelectedItem = parametros?.AtuClasseAlvo ?? "erva";
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
@ -94,6 +108,9 @@ namespace AgroBase.Forms.IHM.Operacao.Parametros
|
||||||
parametros.AtuAlturaAreaPulverizacao = (double)paramAlturaArea.Value;
|
parametros.AtuAlturaAreaPulverizacao = (double)paramAlturaArea.Value;
|
||||||
parametros.AtuPercentualErvasBicoOn = (double)paramErvasOn.Value;
|
parametros.AtuPercentualErvasBicoOn = (double)paramErvasOn.Value;
|
||||||
parametros.AtuPercentualErvasBicoOff = (double)paramErvasOff.Value;
|
parametros.AtuPercentualErvasBicoOff = (double)paramErvasOff.Value;
|
||||||
|
|
||||||
|
parametros.AtuModeloCabeca = (Enums.CabecasModelo)cmbCabecaModelo.SelectedIndex;
|
||||||
|
parametros.AtuClasseAlvo = cmbClasseAlvo.Text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -256,6 +256,7 @@ namespace AgroBase.Forms.IHM.Operacao
|
||||||
|
|
||||||
public void AtualizarDadosControle(OperacaoControleModel controle, OperacaoParametrosControleModel parametros)
|
public void AtualizarDadosControle(OperacaoControleModel controle, OperacaoParametrosControleModel parametros)
|
||||||
{
|
{
|
||||||
|
_modoManualAtivado = parametros.ControleManualAcionado;
|
||||||
bool operacaoManual = (op?.Parametros?.Modo ?? ModoOperacao.NaoDefinido) == ModoOperacao.Manual;
|
bool operacaoManual = (op?.Parametros?.Modo ?? ModoOperacao.NaoDefinido) == ModoOperacao.Manual;
|
||||||
btnControleManual.Enabled = !operacaoManual;
|
btnControleManual.Enabled = !operacaoManual;
|
||||||
MudarStatusModoManual(_modoManualAtivado || operacaoManual);
|
MudarStatusModoManual(_modoManualAtivado || operacaoManual);
|
||||||
|
|
|
||||||
|
|
@ -340,7 +340,7 @@ namespace AgroBase.Forms.IHM.Operacao
|
||||||
this.txtDescricaoOperacao.Margin = new System.Windows.Forms.Padding(3, 1, 5, 3);
|
this.txtDescricaoOperacao.Margin = new System.Windows.Forms.Padding(3, 1, 5, 3);
|
||||||
this.txtDescricaoOperacao.MaxLength = 120;
|
this.txtDescricaoOperacao.MaxLength = 120;
|
||||||
this.txtDescricaoOperacao.Name = "txtDescricaoOperacao";
|
this.txtDescricaoOperacao.Name = "txtDescricaoOperacao";
|
||||||
this.txtDescricaoOperacao.Size = new System.Drawing.Size(190, 29);
|
this.txtDescricaoOperacao.Size = new System.Drawing.Size(190, 21);
|
||||||
this.txtDescricaoOperacao.TabIndex = 1;
|
this.txtDescricaoOperacao.TabIndex = 1;
|
||||||
//
|
//
|
||||||
// campoRegistroLayout
|
// campoRegistroLayout
|
||||||
|
|
@ -406,6 +406,7 @@ namespace AgroBase.Forms.IHM.Operacao
|
||||||
this.btnRedefinir.IconText = "↻";
|
this.btnRedefinir.IconText = "↻";
|
||||||
this.btnRedefinir.Location = new System.Drawing.Point(491, 0);
|
this.btnRedefinir.Location = new System.Drawing.Point(491, 0);
|
||||||
this.btnRedefinir.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
|
this.btnRedefinir.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
|
||||||
|
this.btnRedefinir.MinimumSize = new System.Drawing.Size(60, 34);
|
||||||
this.btnRedefinir.Name = "btnRedefinir";
|
this.btnRedefinir.Name = "btnRedefinir";
|
||||||
this.btnRedefinir.Size = new System.Drawing.Size(132, 50);
|
this.btnRedefinir.Size = new System.Drawing.Size(132, 50);
|
||||||
this.btnRedefinir.TabIndex = 3;
|
this.btnRedefinir.TabIndex = 3;
|
||||||
|
|
@ -422,6 +423,7 @@ namespace AgroBase.Forms.IHM.Operacao
|
||||||
this.btnSalvar.IconText = "▣";
|
this.btnSalvar.IconText = "▣";
|
||||||
this.btnSalvar.Location = new System.Drawing.Point(626, 0);
|
this.btnSalvar.Location = new System.Drawing.Point(626, 0);
|
||||||
this.btnSalvar.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
|
this.btnSalvar.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
|
||||||
|
this.btnSalvar.MinimumSize = new System.Drawing.Size(60, 34);
|
||||||
this.btnSalvar.Name = "btnSalvar";
|
this.btnSalvar.Name = "btnSalvar";
|
||||||
this.btnSalvar.Size = new System.Drawing.Size(142, 50);
|
this.btnSalvar.Size = new System.Drawing.Size(142, 50);
|
||||||
this.btnSalvar.TabIndex = 4;
|
this.btnSalvar.TabIndex = 4;
|
||||||
|
|
@ -442,6 +444,7 @@ namespace AgroBase.Forms.IHM.Operacao
|
||||||
this.footerLayout.ResumeLayout(false);
|
this.footerLayout.ResumeLayout(false);
|
||||||
this.campoModoLayout.ResumeLayout(false);
|
this.campoModoLayout.ResumeLayout(false);
|
||||||
this.campoDescricaoLayout.ResumeLayout(false);
|
this.campoDescricaoLayout.ResumeLayout(false);
|
||||||
|
this.campoDescricaoLayout.PerformLayout();
|
||||||
this.campoRegistroLayout.ResumeLayout(false);
|
this.campoRegistroLayout.ResumeLayout(false);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
using AgroBase.Forms.IHM.Controls;
|
using AgroBase.Forms.IHM.Controls;
|
||||||
using AgroBase.Forms.IHM.Operacao.Parametros;
|
using AgroBase.Forms.IHM.Operacao.Parametros;
|
||||||
using AgroBase.Models;
|
using AgroBase.Models;
|
||||||
using AgroBase.Models.Components;
|
|
||||||
using Emgu.CV;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
|
@ -282,6 +280,10 @@ namespace AgroBase.Forms.IHM.Operacao
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void AtualizarParametrosTela(OperacaoModel op)
|
||||||
|
{
|
||||||
|
DefinirOperacaoParametrizando(op, true);
|
||||||
|
}
|
||||||
public void AtualizarDadosTela()
|
public void AtualizarDadosTela()
|
||||||
{
|
{
|
||||||
operacaoParametrizando?.Mapa?.AtualizarInteratividadeMapaAsync(parametrizacao: true);
|
operacaoParametrizando?.Mapa?.AtualizarInteratividadeMapaAsync(parametrizacao: true);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace AgroBase.Forms.IHM
|
||||||
public frmMenu frmMenu = new frmMenu();
|
public frmMenu frmMenu = new frmMenu();
|
||||||
private frmAjustes _frmAjustes;
|
private frmAjustes _frmAjustes;
|
||||||
private frmDiagnosticos _frmDiagnosticos;
|
private frmDiagnosticos _frmDiagnosticos;
|
||||||
private frmOperacao _frmOperacao;
|
public frmOperacao _frmOperacao;
|
||||||
//private frmTestes _frmTestes;
|
//private frmTestes _frmTestes;
|
||||||
|
|
||||||
private StatusOperacaoControl cardBateria;
|
private StatusOperacaoControl cardBateria;
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,11 @@ namespace AgroBase.Forms.IHM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AtualizarParametrosTela(OperacaoModel op)
|
||||||
|
{
|
||||||
|
_ucParametros.AtualizarParametrosTela(op);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -349,7 +349,7 @@ namespace AgroBase.Forms
|
||||||
|
|
||||||
double anguloControle = 0.0;
|
double anguloControle = 0.0;
|
||||||
TipoMovimentoDirecional tipoMovimento = Variaveis.OperacaoEmAndamento.Controle.TipoMovimento;
|
TipoMovimentoDirecional tipoMovimento = Variaveis.OperacaoEmAndamento.Controle.TipoMovimento;
|
||||||
double veloccidade = (new List<StatusOperacao>() { StatusOperacao.Concluido, StatusOperacao.Aguardando, StatusOperacao.Parametrizando }.Contains(Variaveis.OperacaoEmAndamento.Sensoriamento.Operacao.StatusOperacaoAtual)) ? 0 : velocidadeCarroMs;
|
double veloccidade = Variaveis.OperacaoEmAndamento.Sensoriamento.Operacao.StatusOperacaoAtual != StatusOperacao.EmAndamento ? 0 : velocidadeCarroMs;
|
||||||
|
|
||||||
var tipoControle = Variaveis.OperacaoEmAndamento.Parametros.Controle.DirTipoMovimento;
|
var tipoControle = Variaveis.OperacaoEmAndamento.Parametros.Controle.DirTipoMovimento;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1233,18 +1233,21 @@ namespace AgroBase.Models.Modules
|
||||||
Dados.PercentualErvasTerreno = 0;
|
Dados.PercentualErvasTerreno = 0;
|
||||||
Dados.BombasPressurizadoras.ForEach(x => x.Funcoes = x.Funcoes.Distinct().ToList());
|
Dados.BombasPressurizadoras.ForEach(x => x.Funcoes = x.Funcoes.Distinct().ToList());
|
||||||
|
|
||||||
ReiniciarLeituras(Dados);
|
ReiniciarLeituras(Dados, true);
|
||||||
PrepararAtuadorParaOperacao(Dados, resetarComandos: true);
|
PrepararAtuadorParaOperacao(Dados, resetarComandos: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReiniciarLeituras(AtuadorModel Dados)
|
public void ReiniciarLeituras(AtuadorModel Dados, bool apagarValoresLeituras)
|
||||||
{
|
{
|
||||||
Dados.Sensores.ForEach(x =>
|
Dados.Sensores.ForEach(x =>
|
||||||
|
{
|
||||||
|
if (apagarValoresLeituras)
|
||||||
{
|
{
|
||||||
x.ValoresLeituras.ForEach(l =>
|
x.ValoresLeituras.ForEach(l =>
|
||||||
{
|
{
|
||||||
l.atual = new CanCommandFreqModel<dynamic>();
|
l.atual = new CanCommandFreqModel<dynamic>();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Dados.BicosPulverizadores.ForEach(x =>
|
Dados.BicosPulverizadores.ForEach(x =>
|
||||||
|
|
@ -1267,10 +1270,13 @@ namespace AgroBase.Models.Modules
|
||||||
|
|
||||||
x.ReiniciarHistoricoAtuacao(true);
|
x.ReiniciarHistoricoAtuacao(true);
|
||||||
|
|
||||||
|
if (apagarValoresLeituras)
|
||||||
|
{
|
||||||
x.ValoresLeituras.ForEach(l =>
|
x.ValoresLeituras.ForEach(l =>
|
||||||
{
|
{
|
||||||
l.atual = new CanCommandFreqModel<dynamic>();
|
l.atual = new CanCommandFreqModel<dynamic>();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Dados.BombasPressurizadoras.ForEach(x =>
|
Dados.BombasPressurizadoras.ForEach(x =>
|
||||||
|
|
@ -1289,10 +1295,13 @@ namespace AgroBase.Models.Modules
|
||||||
x.UltimaPressaoDesejada = 0;
|
x.UltimaPressaoDesejada = 0;
|
||||||
x.UltimoComandoEnviado = DateTime.MinValue;
|
x.UltimoComandoEnviado = DateTime.MinValue;
|
||||||
|
|
||||||
|
if (apagarValoresLeituras)
|
||||||
|
{
|
||||||
x.ValoresLeituras.ForEach(l =>
|
x.ValoresLeituras.ForEach(l =>
|
||||||
{
|
{
|
||||||
l.atual = new CanCommandFreqModel<dynamic>();
|
l.atual = new CanCommandFreqModel<dynamic>();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Dados.VolumeVazadoML = 0;
|
Dados.VolumeVazadoML = 0;
|
||||||
|
|
@ -1967,10 +1976,13 @@ namespace AgroBase.Models.Modules
|
||||||
|
|
||||||
dispAtu.AdicionarMensagemFila(bomba.ID_Num, dado, dado, data, false);
|
dispAtu.AdicionarMensagemFila(bomba.ID_Num, dado, dado, data, false);
|
||||||
|
|
||||||
|
if (ehComandoEstado)
|
||||||
|
{
|
||||||
bomba.UltimoComandoEnviado = DateTime.Now;
|
bomba.UltimoComandoEnviado = DateTime.Now;
|
||||||
bomba.UltimoStatusDesejado = status;
|
bomba.UltimoStatusDesejado = status;
|
||||||
if (potencia.HasValue) bomba.UltimaPotenciaDesejada = potencia.Value;
|
if (potencia.HasValue) bomba.UltimaPotenciaDesejada = potencia.Value;
|
||||||
if (pressao.HasValue) bomba.UltimaPressaoDesejada = pressao.Value;
|
if (pressao.HasValue) bomba.UltimaPressaoDesejada = pressao.Value;
|
||||||
|
}
|
||||||
|
|
||||||
if (!setarControle)
|
if (!setarControle)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using AgroBase.Comum;
|
using AgroBase.Comum;
|
||||||
|
using AgroBase.Forms;
|
||||||
using AgroBase.Forms.Operacoes;
|
using AgroBase.Forms.Operacoes;
|
||||||
using AgroBase.Models.Modules;
|
using AgroBase.Models.Modules;
|
||||||
using AgroBase.Models.Operacoes;
|
using AgroBase.Models.Operacoes;
|
||||||
|
|
@ -220,6 +221,28 @@ namespace AgroBase.Models
|
||||||
return itens.TryGetValue(id, out bool ok) && ok;
|
return itens.TryGetValue(id, out bool ok) && ok;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
internal bool TodosModulosMandatoriosCalibrados()
|
||||||
|
{
|
||||||
|
var op = Sensoriamento?.Operacao;
|
||||||
|
var obrigatorios = Parametros?.ModulosMandatorios?
|
||||||
|
.Where(x => x.Mandatorio && x.Utilizar)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (op?.ModsCalibragem == null || obrigatorios == null || obrigatorios.Count == 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var modulo in obrigatorios)
|
||||||
|
{
|
||||||
|
if (!op.ModsCalibragem.TryGetValue(modulo.Dispositivo, out var itens) || itens == null || itens.Count == 0 || itens.Any(x => !x.Value))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private readonly object _eventosLock = new object();
|
private readonly object _eventosLock = new object();
|
||||||
|
|
@ -297,6 +320,17 @@ namespace AgroBase.Models
|
||||||
Sensoriamento?.AtualizarDados();
|
Sensoriamento?.AtualizarDados();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
internal void SubstituirOperacaoSnapshot(OperacaoSensoriamentoConjuntoModel conjunto, OperacaoSensoriamentoLogModel novoSnapshot)
|
||||||
|
{
|
||||||
|
if (conjunto == null || novoSnapshot == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
lock (_sensoriamentoStateLock)
|
||||||
|
{
|
||||||
|
novoSnapshot.CopiarEstadoRuntimeDe(conjunto.Operacao);
|
||||||
|
conjunto.Operacao = novoSnapshot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Form frmOperacao { get; set; }
|
public Form frmOperacao { get; set; }
|
||||||
|
|
@ -307,7 +341,7 @@ namespace AgroBase.Models
|
||||||
public double SimulacaoRpmControle { get; set; } = 0;
|
public double SimulacaoRpmControle { get; set; } = 0;
|
||||||
|
|
||||||
public int TempoIniciarOperacao { get; set; } = 10;
|
public int TempoIniciarOperacao { get; set; } = 10;
|
||||||
public int TempoAguardarRetomada { get; set; } = 5;
|
public int TempoAguardarRetomada { get; set; } = 10;
|
||||||
|
|
||||||
public string ID { get; set; }
|
public string ID { get; set; }
|
||||||
|
|
||||||
|
|
@ -368,7 +402,6 @@ namespace AgroBase.Models
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region PARAMETRIZACAO
|
#region PARAMETRIZACAO
|
||||||
|
|
||||||
private bool EhOperacaoAtual(string origem)
|
private bool EhOperacaoAtual(string origem)
|
||||||
|
|
@ -1285,6 +1318,8 @@ namespace AgroBase.Models
|
||||||
|
|
||||||
RedisService.AtualizarCampos(CtxKey.DadosOperacao, ("configurado", false));
|
RedisService.AtualizarCampos(CtxKey.DadosOperacao, ("configurado", false));
|
||||||
|
|
||||||
|
frmInstancial.frmIHM?._frmOperacao?.AtualizarParametrosTela(novaOp);
|
||||||
|
|
||||||
return novaOp;
|
return novaOp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1324,8 +1359,8 @@ namespace AgroBase.Models
|
||||||
op.AtualizarSensoriamentoSeguro();
|
op.AtualizarSensoriamentoSeguro();
|
||||||
|
|
||||||
dispMvd?.Dados?.ReiniciarLeituras(dispMvd?.Dados);
|
dispMvd?.Dados?.ReiniciarLeituras(dispMvd?.Dados);
|
||||||
dispAtu?.Dados?.ReiniciarLeituras(dispAtu?.Dados);
|
dispAtu?.Dados?.ReiniciarLeituras(dispAtu?.Dados, false);
|
||||||
dispSen?.Dados?.ReiniciarLeituras(dispSen?.Dados);
|
//dispSen?.Dados?.ReiniciarLeituras(dispSen?.Dados);
|
||||||
dispAtu?.Dados?.PrepararAtuadorParaOperacao();
|
dispAtu?.Dados?.PrepararAtuadorParaOperacao();
|
||||||
|
|
||||||
op.Sensoriamento.Operacao.ModsCalibragem = new Dictionary<T_Code, Dictionary<string, bool>>()
|
op.Sensoriamento.Operacao.ModsCalibragem = new Dictionary<T_Code, Dictionary<string, bool>>()
|
||||||
|
|
@ -1358,9 +1393,9 @@ namespace AgroBase.Models
|
||||||
op.idxLog = 0;
|
op.idxLog = 0;
|
||||||
op.IniciarTimerLogsOperacao();
|
op.IniciarTimerLogsOperacao();
|
||||||
|
|
||||||
await op.RealizarCalibragemInicialAsync(true);
|
RedisService.Publish(CmdKey.ManagerWorkerRx, JsonConvert.SerializeObject(new { cmd = ManagerWorkerCommandType.IniciarMPC }));
|
||||||
|
|
||||||
RedisService.Publish(CmdKey.ManagerWorkerRx, JsonConvert.SerializeObject(new { cmd = ManagerWorkerCommandType.IniciarMPC } ));
|
await op.RealizarCalibragemInicialAsync(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task FinalizarOperacao()
|
public async Task FinalizarOperacao()
|
||||||
|
|
@ -1462,8 +1497,8 @@ namespace AgroBase.Models
|
||||||
op.AtualizarSensoriamentoSeguro();
|
op.AtualizarSensoriamentoSeguro();
|
||||||
|
|
||||||
dispMvd?.Dados?.ReiniciarLeituras(dispMvd.Dados);
|
dispMvd?.Dados?.ReiniciarLeituras(dispMvd.Dados);
|
||||||
dispAtu?.Dados?.ReiniciarLeituras(dispAtu.Dados);
|
dispAtu?.Dados?.ReiniciarLeituras(dispAtu.Dados, false);
|
||||||
dispSen?.Dados?.ReiniciarLeituras(dispSen.Dados);
|
//dispSen?.Dados?.ReiniciarLeituras(dispSen.Dados);
|
||||||
|
|
||||||
RedisService.AtualizarCampos(CtxKey.DadosOperacao, ("configurado", false));
|
RedisService.AtualizarCampos(CtxKey.DadosOperacao, ("configurado", false));
|
||||||
WeedWorkerService.ReiniciarLeituraAnalise();
|
WeedWorkerService.ReiniciarLeituraAnalise();
|
||||||
|
|
@ -1514,8 +1549,8 @@ namespace AgroBase.Models
|
||||||
op.ID = "";
|
op.ID = "";
|
||||||
|
|
||||||
dispMvd?.Dados?.ReiniciarLeituras(dispMvd.Dados);
|
dispMvd?.Dados?.ReiniciarLeituras(dispMvd.Dados);
|
||||||
dispAtu?.Dados?.ReiniciarLeituras(dispAtu.Dados);
|
dispAtu?.Dados?.ReiniciarLeituras(dispAtu.Dados, false);
|
||||||
dispSen?.Dados?.ReiniciarLeituras(dispSen.Dados);
|
//dispSen?.Dados?.ReiniciarLeituras(dispSen.Dados);
|
||||||
|
|
||||||
op.Controle.Angulo = 0;
|
op.Controle.Angulo = 0;
|
||||||
op.Controle.PercentualVelocidadeSP = 0;
|
op.Controle.PercentualVelocidadeSP = 0;
|
||||||
|
|
@ -2118,15 +2153,17 @@ namespace AgroBase.Models
|
||||||
|
|
||||||
if (op.Parametros?.Modo == ModoOperacao.Manual)
|
if (op.Parametros?.Modo == ModoOperacao.Manual)
|
||||||
{
|
{
|
||||||
|
bool carroEmMovimento = op.Controle?.RPM_SP > 0;
|
||||||
|
|
||||||
var Sonar = op.Sensoriamento?.OperadorVisual;
|
var Sonar = op.Sensoriamento?.OperadorVisual;
|
||||||
Sonar?.Resumo?.AtualizarStatusBloqueioManual(Sonar, true);
|
Sonar?.Resumo?.AtualizarStatusBloqueioManual(Sonar, true);
|
||||||
if (Sonar?.Resumo?.EnviarComandoParada ?? false)
|
if (carroEmMovimento && (Sonar?.Resumo?.EnviarComandoParada ?? false))
|
||||||
{
|
{
|
||||||
Variaveis.MostrarLog($"[OperacaoModel] Deve enviar o comando de parada em tmrLeituras_Tick por trava do Visual Worker: {Sonar?.Analises?.matriz_confianca?.block?.reason}");
|
Variaveis.MostrarLog($"[OperacaoModel] Deve enviar o comando de parada em tmrLeituras_Tick por trava do Visual Worker: {Sonar?.Analises?.matriz_confianca?.block?.reason}");
|
||||||
GeneralJoystick.PararCarroControle($"Deve enviar o comando de parada em tmrLeituras_Tick por trava do Visual Worker: {Sonar?.Analises?.matriz_confianca?.block?.reason}");
|
GeneralJoystick.PararCarroControle($"Deve enviar o comando de parada em tmrLeituras_Tick por trava do Visual Worker: {Sonar?.Analises?.matriz_confianca?.block?.reason}");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!op.Sensoriamento.Operacao.OperacaoLiberada)
|
if (carroEmMovimento &&!op.Sensoriamento.Operacao.OperacaoLiberada)
|
||||||
{
|
{
|
||||||
Variaveis.MostrarLog($"[OperacaoModel] Deve enviar o comando de parada em tmrLeituras_Tick por Operacao Bloqueada: {op?.Sensoriamento?.Operacao?.ErroOperacaoLiberada}");
|
Variaveis.MostrarLog($"[OperacaoModel] Deve enviar o comando de parada em tmrLeituras_Tick por Operacao Bloqueada: {op?.Sensoriamento?.Operacao?.ErroOperacaoLiberada}");
|
||||||
GeneralJoystick.PararCarroControle($"Deve enviar o comando de parada em tmrLeituras_Tick por Operacao Bloqueada: {op?.Sensoriamento?.Operacao?.ErroOperacaoLiberada}");
|
GeneralJoystick.PararCarroControle($"Deve enviar o comando de parada em tmrLeituras_Tick por Operacao Bloqueada: {op?.Sensoriamento?.Operacao?.ErroOperacaoLiberada}");
|
||||||
|
|
@ -3138,11 +3175,18 @@ namespace AgroBase.Models
|
||||||
AudioAlertaService.AlertaSonoroPorStatus(op.Sensoriamento.Operacao.StatusOperacaoAtual);
|
AudioAlertaService.AlertaSonoroPorStatus(op.Sensoriamento.Operacao.StatusOperacaoAtual);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (op.idxLog % 5 == 0 && !op.CalibrandoRuntime && op.PodeTentarCalibragemAutomatica())
|
if (op.idxLog % 5 == 0)
|
||||||
|
{
|
||||||
|
if (!op.CalibrandoRuntime && op.PodeTentarCalibragemAutomatica())
|
||||||
{
|
{
|
||||||
op.RegistrarTentativaCalibragem();
|
op.RegistrarTentativaCalibragem();
|
||||||
_ = Task.Run(async () => await op.RealizarCalibragemInicialAsync(false));
|
_ = Task.Run(async () => await op.RealizarCalibragemInicialAsync(false));
|
||||||
}
|
}
|
||||||
|
if (op.CalibrandoRuntime && op.TodosModulosMandatoriosCalibrados())
|
||||||
|
{
|
||||||
|
op.DefinirEstadoCalibragemRuntime(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<bool> SalvarLogsSeguroAsync(bool fim)
|
private async Task<bool> SalvarLogsSeguroAsync(bool fim)
|
||||||
|
|
@ -4017,7 +4061,7 @@ namespace AgroBase.Models
|
||||||
saude_geral < 80.0 ? StatusModulo.Alerta :
|
saude_geral < 80.0 ? StatusModulo.Alerta :
|
||||||
StatusModulo.Operante;
|
StatusModulo.Operante;
|
||||||
|
|
||||||
Operacao = operacaoAtualizada;
|
op.SubstituirOperacaoSnapshot(this, operacaoAtualizada);
|
||||||
|
|
||||||
if (statusMudou)
|
if (statusMudou)
|
||||||
{
|
{
|
||||||
|
|
@ -5265,6 +5309,16 @@ namespace AgroBase.Models
|
||||||
DataInicio = origem.DataInicio;
|
DataInicio = origem.DataInicio;
|
||||||
DataFim = origem.DataFim;
|
DataFim = origem.DataFim;
|
||||||
StatusOperacaoAnterior = origem.StatusOperacaoAnterior;
|
StatusOperacaoAnterior = origem.StatusOperacaoAnterior;
|
||||||
|
|
||||||
|
ModsCalibragem =
|
||||||
|
origem.ModsCalibragem?
|
||||||
|
.ToDictionary(
|
||||||
|
x => x.Key,
|
||||||
|
x => new Dictionary<string, bool>(
|
||||||
|
x.Value ?? new Dictionary<string, bool>()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
?? new Dictionary<T_Code, Dictionary<string, bool>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,9 @@ namespace AgroBase.Models
|
||||||
public bool VerificacaoInicialMeioRuaConcluida { get; set; } = false; // Realiza a verificacao inicial para saber se o robo deve comecar a operacao do meio da rua
|
public bool VerificacaoInicialMeioRuaConcluida { get; set; } = false; // Realiza a verificacao inicial para saber se o robo deve comecar a operacao do meio da rua
|
||||||
private int JanelaBuscaAvancoPontos { get; set; } = 14;
|
private int JanelaBuscaAvancoPontos { get; set; } = 14;
|
||||||
private double MargemExtraAvancoM { get; set; } = 0.35;
|
private double MargemExtraAvancoM { get; set; } = 0.35;
|
||||||
private double DistanciaConclusaoTrajetoriaM { get; set; } = 3.0;
|
private double DistanciaConclusaoTrajetoriaM { get; set; } = 2.0;
|
||||||
private double DistanciaRestanteMaximaParaTrocarCorredorM { get; set; } = 1.0;
|
private double DistanciaRestanteMaximaParaTrocarCorredorM { get; set; } = 1.0;
|
||||||
|
private double DistanciaExtensaoCorredorM { get; set; } = 0.50;
|
||||||
private int PontosRestantesMaximosParaTrocarCorredor { get; set; } = 0;
|
private int PontosRestantesMaximosParaTrocarCorredor { get; set; } = 0;
|
||||||
private int MaxTentativasRecuperacaoTrajetoria { get; set; } = 3;
|
private int MaxTentativasRecuperacaoTrajetoria { get; set; } = 3;
|
||||||
private double ToleranciaLateralRecuperacaoM { get; set; } = 1.5;
|
private double ToleranciaLateralRecuperacaoM { get; set; } = 1.5;
|
||||||
|
|
@ -2011,6 +2012,25 @@ namespace AgroBase.Models
|
||||||
// Remover pontos que estão a menos de 1m de distância
|
// Remover pontos que estão a menos de 1m de distância
|
||||||
corredor = RemoverPontosMuitoProximos(corredor, DistanciaEntrePontos, primeiraDistancia, DistanciaEntrePontosCurva);
|
corredor = RemoverPontosMuitoProximos(corredor, DistanciaEntrePontos, primeiraDistancia, DistanciaEntrePontosCurva);
|
||||||
|
|
||||||
|
// Estender o corredor 50 cm em cada extremidade
|
||||||
|
if (corredor.Count >= 2)
|
||||||
|
{
|
||||||
|
var primeiroPonto = corredor[0];
|
||||||
|
var segundoPonto = corredor[1];
|
||||||
|
|
||||||
|
var penultimoPonto = corredor[corredor.Count - 2];
|
||||||
|
var ultimoPonto = corredor[corredor.Count - 1];
|
||||||
|
|
||||||
|
double anguloInicial = GPSUtils.CalcularOrientacao(primeiroPonto, segundoPonto);
|
||||||
|
double anguloAnterior = (anguloInicial + 180.0) % 360.0;
|
||||||
|
var pontoAntesDoCorredor = GPSUtils.ProjetarPontoDeslocado(primeiroPonto, DistanciaExtensaoCorredorM, anguloAnterior);
|
||||||
|
double anguloFinal = GPSUtils.CalcularOrientacao(penultimoPonto, ultimoPonto);
|
||||||
|
var pontoDepoisDoCorredor = GPSUtils.ProjetarPontoDeslocado(ultimoPonto, DistanciaExtensaoCorredorM, anguloFinal);
|
||||||
|
|
||||||
|
corredor.Insert(0, pontoAntesDoCorredor);
|
||||||
|
corredor.Add(pontoDepoisDoCorredor);
|
||||||
|
}
|
||||||
|
|
||||||
// Calcular largura média entre as duas ruas
|
// Calcular largura média entre as duas ruas
|
||||||
double larguraCorredor = CalcularLarguraMediaDoCorredor(rua1, rua2);
|
double larguraCorredor = CalcularLarguraMediaDoCorredor(rua1, rua2);
|
||||||
|
|
||||||
|
|
@ -2165,22 +2185,48 @@ namespace AgroBase.Models
|
||||||
};
|
};
|
||||||
|
|
||||||
int idxCorredorDentro = VerificaEquipamentoDentroCorredor(PontoRobo.Posicao);
|
int idxCorredorDentro = VerificaEquipamentoDentroCorredor(PontoRobo.Posicao);
|
||||||
if (idxCorredorDentro > -1)
|
if (idxCorredorDentro >= 0 && idxCorredorDentro < Corredores.Count && Corredores[idxCorredorDentro]?.Count >= 2 && PontoRobo.Posicao != null)
|
||||||
{
|
{
|
||||||
var corredor = Corredores[idxCorredorDentro];
|
var corredor = Corredores[idxCorredorDentro];
|
||||||
|
|
||||||
double orientacaoCorredor = GPSUtils.CalcularOrientacao(corredor[0], corredor[1]);
|
double orientacaoCorredor = GPSUtils.CalcularOrientacao(corredor[0], corredor[1]);
|
||||||
double difOri = Math.Abs(orientacaoCorredor - PontoRobo.Posicao?.OrientacaoReal ?? 0);
|
double orientacaoRobo = PontoRobo.Posicao.OrientacaoReal;
|
||||||
bool alinhado = difOri < 180;
|
|
||||||
if (idxCorredorDentro % 2 == 0)
|
// Diferença angular circular entre 0° e 180°
|
||||||
|
double diferencaAngular = Math.Abs(((orientacaoRobo - orientacaoCorredor + 540.0) % 360.0) - 180.0);
|
||||||
|
|
||||||
|
// Menos de 90°: robô olha no sentido corredor[0] -> corredor[^1]
|
||||||
|
// Mais de 90°: robô olha no sentido corredor[^1] -> corredor[0]
|
||||||
|
bool alinhadoComOrdemCorredor = diferencaAngular < 90.0;
|
||||||
|
|
||||||
|
// O extremo considerado é aquele para o qual o robô está olhando
|
||||||
|
var pontoDestino = alinhadoComOrdemCorredor ? corredor[corredor.Count - 1] : corredor[0];
|
||||||
|
|
||||||
|
double distanciaDestino = GPSUtils.DistanciaEntrePontos(PontoRobo.Posicao, pontoDestino);
|
||||||
|
|
||||||
|
if (!double.IsNaN(distanciaDestino) && !double.IsInfinity(distanciaDestino) && distanciaDestino > 5.0)
|
||||||
{
|
{
|
||||||
direcaoAtual = alinhado ? DirecaoCarroRua.Ida : DirecaoCarroRua.Volta;
|
/*
|
||||||
|
* A lista do corredor sempre está no sentido:
|
||||||
|
* corredor[0] -> corredor[^1].
|
||||||
|
*
|
||||||
|
* Nos corredores pares, esse sentido representa Ida.
|
||||||
|
* Nos corredores ímpares, esse sentido representa Volta.
|
||||||
|
*/
|
||||||
|
bool corredorPar = idxCorredorDentro % 2 == 0;
|
||||||
|
|
||||||
|
if (alinhadoComOrdemCorredor)
|
||||||
|
{
|
||||||
|
direcaoAtual = corredorPar ? DirecaoCarroRua.Ida : DirecaoCarroRua.Volta;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
direcaoAtual = alinhado ? DirecaoCarroRua.Volta : DirecaoCarroRua.Ida;
|
direcaoAtual = corredorPar ? DirecaoCarroRua.Volta : DirecaoCarroRua.Ida;
|
||||||
}
|
}
|
||||||
|
|
||||||
PontoRobo.Direcao = direcaoAtual;
|
PontoRobo.Direcao = direcaoAtual;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_trajetoriaFixa.Add(PontoRobo);
|
_trajetoriaFixa.Add(PontoRobo);
|
||||||
|
|
||||||
|
|
@ -2329,7 +2375,7 @@ namespace AgroBase.Models
|
||||||
}
|
}
|
||||||
|
|
||||||
double percentualAcrescimoPontoAberturaCurva = 0.8;
|
double percentualAcrescimoPontoAberturaCurva = 0.8;
|
||||||
double distancia_projetar = !ultimoCorredor ? (DistanciaProjecaoRua * percentualAcrescimoPontoAberturaCurva) : (DistanciaProjecaoRua * percentualAcrescimoPontoAberturaCurva);
|
double distancia_projetar = !ultimoCorredor ? (DistanciaProjecaoRua * percentualAcrescimoPontoAberturaCurva) : DistanciaProjecaoRua;
|
||||||
|
|
||||||
GPSModel ultimoPontoCorredorAtual = CorredorAtual.Last();
|
GPSModel ultimoPontoCorredorAtual = CorredorAtual.Last();
|
||||||
double anguloProjetar2 = GPSUtils.CalcularOrientacao(CorredorAtual.Skip(CorredorAtual.Count() - 2).FirstOrDefault(), ultimoPontoCorredorAtual);
|
double anguloProjetar2 = GPSUtils.CalcularOrientacao(CorredorAtual.Skip(CorredorAtual.Count() - 2).FirstOrDefault(), ultimoPontoCorredorAtual);
|
||||||
|
|
@ -2684,6 +2730,8 @@ namespace AgroBase.Models
|
||||||
}
|
}
|
||||||
|
|
||||||
RedisService.AtualizarCampos(CtxKey.DadosOperacao, ("configurado", false));
|
RedisService.AtualizarCampos(CtxKey.DadosOperacao, ("configurado", false));
|
||||||
|
|
||||||
|
RedisService.Publish(CmdKey.ManagerWorkerRx, JsonConvert.SerializeObject(new { cmd = ManagerWorkerCommandType.IniciarMPC }));
|
||||||
}
|
}
|
||||||
|
|
||||||
private (bool valido, List<GPSModel> pontos) GerarTrajetoriaRetornoAutomatico(GPSModel baseGps)
|
private (bool valido, List<GPSModel> pontos) GerarTrajetoriaRetornoAutomatico(GPSModel baseGps)
|
||||||
|
|
|
||||||
|
|
@ -1176,7 +1176,7 @@ namespace AgroBase.Services.Operadores
|
||||||
tempo_com_potencia = bomba.TempoComPotencia,
|
tempo_com_potencia = bomba.TempoComPotencia,
|
||||||
potencia_media_ativa = bomba.PotenciaMediaAtiva,
|
potencia_media_ativa = bomba.PotenciaMediaAtiva,
|
||||||
|
|
||||||
comando_solicitado = bomba.ComandoAtuar,
|
comando_solicitado = bomba.Comandar && bomba.ComandoAtuar,
|
||||||
status_desejado_fisico = bomba.UltimoStatusDesejado,
|
status_desejado_fisico = bomba.UltimoStatusDesejado,
|
||||||
potencia_desejada_fisica = bomba.UltimaPotenciaDesejada,
|
potencia_desejada_fisica = bomba.UltimaPotenciaDesejada,
|
||||||
pressao_desejada_fisica = bomba.UltimaPressaoDesejada,
|
pressao_desejada_fisica = bomba.UltimaPressaoDesejada,
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ class CameraMultispectral:
|
||||||
modo=self.imu_modo,
|
modo=self.imu_modo,
|
||||||
gyro_unidade="rad_s",
|
gyro_unidade="rad_s",
|
||||||
referencial_robo="r,p,y",
|
referencial_robo="r,p,y",
|
||||||
sinal_roll=1.0,
|
sinal_roll=-1.0,
|
||||||
sinal_pitch=-1.0,
|
sinal_pitch=-1.0,
|
||||||
sinal_yaw=-1.0,
|
sinal_yaw=-1.0,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue