diff --git a/AgroBase/.vs/AgroBase/FileContentIndex/32888aa0-4530-44d8-a801-1292a74fa100.vsidx b/AgroBase/.vs/AgroBase/FileContentIndex/32888aa0-4530-44d8-a801-1292a74fa100.vsidx deleted file mode 100644 index 1e19fc539..000000000 Binary files a/AgroBase/.vs/AgroBase/FileContentIndex/32888aa0-4530-44d8-a801-1292a74fa100.vsidx and /dev/null differ diff --git a/AgroBase/.vs/AgroBase/FileContentIndex/aa176177-0584-43cb-bc0c-3d8cd1ff3d57.vsidx b/AgroBase/.vs/AgroBase/FileContentIndex/3f8b76b9-9470-491f-b6bc-16d3d645b731.vsidx similarity index 79% rename from AgroBase/.vs/AgroBase/FileContentIndex/aa176177-0584-43cb-bc0c-3d8cd1ff3d57.vsidx rename to AgroBase/.vs/AgroBase/FileContentIndex/3f8b76b9-9470-491f-b6bc-16d3d645b731.vsidx index e86f2850c..e4d9eac0e 100644 Binary files a/AgroBase/.vs/AgroBase/FileContentIndex/aa176177-0584-43cb-bc0c-3d8cd1ff3d57.vsidx and b/AgroBase/.vs/AgroBase/FileContentIndex/3f8b76b9-9470-491f-b6bc-16d3d645b731.vsidx differ diff --git a/AgroBase/.vs/AgroBase/FileContentIndex/99a32fe7-acb6-482c-bf01-a73b149a268d.vsidx b/AgroBase/.vs/AgroBase/FileContentIndex/99a32fe7-acb6-482c-bf01-a73b149a268d.vsidx new file mode 100644 index 000000000..7a873014b Binary files /dev/null and b/AgroBase/.vs/AgroBase/FileContentIndex/99a32fe7-acb6-482c-bf01-a73b149a268d.vsidx differ diff --git a/AgroBase/.vs/AgroBase/v17/.suo b/AgroBase/.vs/AgroBase/v17/.suo index b1d0b910d..340ed6b4b 100644 Binary files a/AgroBase/.vs/AgroBase/v17/.suo and b/AgroBase/.vs/AgroBase/v17/.suo differ diff --git a/AgroBase/AgroBase/AgroBase.csproj b/AgroBase/AgroBase/AgroBase.csproj index f156249ff..1053e4e25 100644 --- a/AgroBase/AgroBase/AgroBase.csproj +++ b/AgroBase/AgroBase/AgroBase.csproj @@ -442,6 +442,7 @@ + diff --git a/AgroBase/AgroBase/Forms/IHM/frmDialogoMapa.Designer.cs b/AgroBase/AgroBase/Forms/IHM/frmDialogoMapa.Designer.cs index 91bfe08bc..eebca89c4 100644 --- a/AgroBase/AgroBase/Forms/IHM/frmDialogoMapa.Designer.cs +++ b/AgroBase/AgroBase/Forms/IHM/frmDialogoMapa.Designer.cs @@ -29,6 +29,11 @@ private void InitializeComponent() { this.pnlMapa = new System.Windows.Forms.Panel(); + this.pnlCameraCaminho = new System.Windows.Forms.Panel(); + this.pnlCameraSoloD = new System.Windows.Forms.Panel(); + this.pnlCameraSoloE = new System.Windows.Forms.Panel(); + this.pnlInclinacao = new System.Windows.Forms.Panel(); + this.pnlOrientacao = new System.Windows.Forms.Panel(); this.lblMapaCarregado = new System.Windows.Forms.Label(); this.txtStatusAtual = new System.Windows.Forms.TextBox(); this.lblStatusAtual = new System.Windows.Forms.Label(); @@ -54,22 +59,26 @@ this.pgbOperacao = new System.Windows.Forms.ProgressBar(); this.lblRuaAtual = new System.Windows.Forms.Label(); this.pgbRuaAtual = new System.Windows.Forms.ProgressBar(); - this.lblUltimaLeituraSolo = new System.Windows.Forms.Label(); - this.lblUltimaLeituraRua = new System.Windows.Forms.Label(); this.lblModoOperacao = new System.Windows.Forms.Label(); this.txtModoOperacao = new System.Windows.Forms.TextBox(); - this.pnlCameraSoloE = new System.Windows.Forms.Panel(); - this.pnlCameraSoloD = new System.Windows.Forms.Panel(); - this.pnlCameraCaminho = new System.Windows.Forms.Panel(); this.picFechar = new System.Windows.Forms.PictureBox(); - this.pnlInclinacao = new System.Windows.Forms.Panel(); - this.pnlOrientacao = new System.Windows.Forms.Panel(); + this.pnlJoystick = new System.Windows.Forms.Panel(); + this.pnlAcompanhamento = new System.Windows.Forms.Panel(); + this.cmbModoControle = new System.Windows.Forms.ComboBox(); + this.lblModoControle = new System.Windows.Forms.Label(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.lblUltimaLeituraCaminho = new System.Windows.Forms.ToolStripStatusLabel(); + this.lblUltimaLeituraSolo = new System.Windows.Forms.ToolStripStatusLabel(); + this.lblPerformance = new System.Windows.Forms.ToolStripStatusLabel(); this.pnlMapa.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.picFechar)).BeginInit(); + this.pnlAcompanhamento.SuspendLayout(); + this.statusStrip1.SuspendLayout(); this.SuspendLayout(); // // pnlMapa // + this.pnlMapa.Controls.Add(this.pnlJoystick); this.pnlMapa.Controls.Add(this.pnlCameraCaminho); this.pnlMapa.Controls.Add(this.pnlCameraSoloD); this.pnlMapa.Controls.Add(this.pnlCameraSoloE); @@ -77,302 +86,29 @@ this.pnlMapa.Controls.Add(this.pnlOrientacao); this.pnlMapa.Location = new System.Drawing.Point(0, 0); this.pnlMapa.Name = "pnlMapa"; - this.pnlMapa.Size = new System.Drawing.Size(480, 463); + this.pnlMapa.Size = new System.Drawing.Size(480, 455); this.pnlMapa.TabIndex = 0; // - // lblMapaCarregado - // - this.lblMapaCarregado.AutoSize = true; - this.lblMapaCarregado.Location = new System.Drawing.Point(486, 9); - this.lblMapaCarregado.Name = "lblMapaCarregado"; - this.lblMapaCarregado.Size = new System.Drawing.Size(112, 13); - this.lblMapaCarregado.TabIndex = 2; - this.lblMapaCarregado.Text = "Mapa Carregado: N/A"; - // - // txtStatusAtual - // - this.txtStatusAtual.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); - this.txtStatusAtual.Location = new System.Drawing.Point(652, 90); - this.txtStatusAtual.Name = "txtStatusAtual"; - this.txtStatusAtual.ReadOnly = true; - this.txtStatusAtual.Size = new System.Drawing.Size(136, 26); - this.txtStatusAtual.TabIndex = 6; - this.txtStatusAtual.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // lblStatusAtual - // - this.lblStatusAtual.AutoSize = true; - this.lblStatusAtual.Location = new System.Drawing.Point(486, 98); - this.lblStatusAtual.Name = "lblStatusAtual"; - this.lblStatusAtual.Size = new System.Drawing.Size(64, 13); - this.lblStatusAtual.TabIndex = 5; - this.lblStatusAtual.Text = "Status Atual"; - // - // txtIniciadoEm - // - this.txtIniciadoEm.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); - this.txtIniciadoEm.Location = new System.Drawing.Point(652, 122); - this.txtIniciadoEm.Name = "txtIniciadoEm"; - this.txtIniciadoEm.ReadOnly = true; - this.txtIniciadoEm.Size = new System.Drawing.Size(136, 26); - this.txtIniciadoEm.TabIndex = 8; - this.txtIniciadoEm.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // lblIniciadoEm - // - this.lblIniciadoEm.AutoSize = true; - this.lblIniciadoEm.Location = new System.Drawing.Point(486, 130); - this.lblIniciadoEm.Name = "lblIniciadoEm"; - this.lblIniciadoEm.Size = new System.Drawing.Size(62, 13); - this.lblIniciadoEm.TabIndex = 7; - this.lblIniciadoEm.Text = "Iniciado Em"; - // - // txtConcluidoEm - // - this.txtConcluidoEm.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); - this.txtConcluidoEm.Location = new System.Drawing.Point(652, 154); - this.txtConcluidoEm.Name = "txtConcluidoEm"; - this.txtConcluidoEm.ReadOnly = true; - this.txtConcluidoEm.Size = new System.Drawing.Size(136, 26); - this.txtConcluidoEm.TabIndex = 10; - this.txtConcluidoEm.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // lblConcluidoEm - // - this.lblConcluidoEm.AutoSize = true; - this.lblConcluidoEm.Location = new System.Drawing.Point(486, 162); - this.lblConcluidoEm.Name = "lblConcluidoEm"; - this.lblConcluidoEm.Size = new System.Drawing.Size(74, 13); - this.lblConcluidoEm.TabIndex = 9; - this.lblConcluidoEm.Text = "Concluído Em"; - // - // txtDistanciaPercorrida - // - this.txtDistanciaPercorrida.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); - this.txtDistanciaPercorrida.Location = new System.Drawing.Point(652, 186); - this.txtDistanciaPercorrida.Name = "txtDistanciaPercorrida"; - this.txtDistanciaPercorrida.ReadOnly = true; - this.txtDistanciaPercorrida.Size = new System.Drawing.Size(136, 26); - this.txtDistanciaPercorrida.TabIndex = 12; - this.txtDistanciaPercorrida.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // lblDistanciaPercorrida - // - this.lblDistanciaPercorrida.AutoSize = true; - this.lblDistanciaPercorrida.Location = new System.Drawing.Point(486, 194); - this.lblDistanciaPercorrida.Name = "lblDistanciaPercorrida"; - this.lblDistanciaPercorrida.Size = new System.Drawing.Size(102, 13); - this.lblDistanciaPercorrida.TabIndex = 11; - this.lblDistanciaPercorrida.Text = "Distância Percorrida"; - // - // txtTempoOperacao - // - this.txtTempoOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); - this.txtTempoOperacao.Location = new System.Drawing.Point(652, 218); - this.txtTempoOperacao.Name = "txtTempoOperacao"; - this.txtTempoOperacao.ReadOnly = true; - this.txtTempoOperacao.Size = new System.Drawing.Size(136, 26); - this.txtTempoOperacao.TabIndex = 14; - this.txtTempoOperacao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // lblTempoOperacao - // - this.lblTempoOperacao.AutoSize = true; - this.lblTempoOperacao.Location = new System.Drawing.Point(486, 226); - this.lblTempoOperacao.Name = "lblTempoOperacao"; - this.lblTempoOperacao.Size = new System.Drawing.Size(105, 13); - this.lblTempoOperacao.TabIndex = 13; - this.lblTempoOperacao.Text = "Tempo de Operação"; - // - // txtErvasIdentificadas - // - this.txtErvasIdentificadas.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); - this.txtErvasIdentificadas.Location = new System.Drawing.Point(652, 250); - this.txtErvasIdentificadas.Name = "txtErvasIdentificadas"; - this.txtErvasIdentificadas.ReadOnly = true; - this.txtErvasIdentificadas.Size = new System.Drawing.Size(136, 26); - this.txtErvasIdentificadas.TabIndex = 16; - this.txtErvasIdentificadas.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // lblErvasIdentificadas - // - this.lblErvasIdentificadas.AutoSize = true; - this.lblErvasIdentificadas.Location = new System.Drawing.Point(486, 258); - this.lblErvasIdentificadas.Name = "lblErvasIdentificadas"; - this.lblErvasIdentificadas.Size = new System.Drawing.Size(97, 13); - this.lblErvasIdentificadas.TabIndex = 15; - this.lblErvasIdentificadas.Text = "Ervas Identificadas"; - // - // txtHerbicidaAplicado - // - this.txtHerbicidaAplicado.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); - this.txtHerbicidaAplicado.Location = new System.Drawing.Point(652, 282); - this.txtHerbicidaAplicado.Name = "txtHerbicidaAplicado"; - this.txtHerbicidaAplicado.ReadOnly = true; - this.txtHerbicidaAplicado.Size = new System.Drawing.Size(136, 26); - this.txtHerbicidaAplicado.TabIndex = 18; - this.txtHerbicidaAplicado.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // lblHerbicidaAplicado - // - this.lblHerbicidaAplicado.AutoSize = true; - this.lblHerbicidaAplicado.Location = new System.Drawing.Point(486, 290); - this.lblHerbicidaAplicado.Name = "lblHerbicidaAplicado"; - this.lblHerbicidaAplicado.Size = new System.Drawing.Size(96, 13); - this.lblHerbicidaAplicado.TabIndex = 17; - this.lblHerbicidaAplicado.Text = "Herbicida Aplicado"; - // - // txtBateriaConsumida - // - this.txtBateriaConsumida.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); - this.txtBateriaConsumida.Location = new System.Drawing.Point(652, 314); - this.txtBateriaConsumida.Name = "txtBateriaConsumida"; - this.txtBateriaConsumida.ReadOnly = true; - this.txtBateriaConsumida.Size = new System.Drawing.Size(136, 26); - this.txtBateriaConsumida.TabIndex = 20; - this.txtBateriaConsumida.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // lblBateriaConsumida - // - this.lblBateriaConsumida.AutoSize = true; - this.lblBateriaConsumida.Location = new System.Drawing.Point(486, 322); - this.lblBateriaConsumida.Name = "lblBateriaConsumida"; - this.lblBateriaConsumida.Size = new System.Drawing.Size(95, 13); - this.lblBateriaConsumida.TabIndex = 19; - this.lblBateriaConsumida.Text = "Bateria Consumida"; - // - // pgbReservatorio - // - this.pgbReservatorio.Location = new System.Drawing.Point(652, 346); - this.pgbReservatorio.Name = "pgbReservatorio"; - this.pgbReservatorio.Size = new System.Drawing.Size(136, 26); - this.pgbReservatorio.TabIndex = 21; - // - // lblReservatorio - // - this.lblReservatorio.AutoSize = true; - this.lblReservatorio.Location = new System.Drawing.Point(486, 354); - this.lblReservatorio.Name = "lblReservatorio"; - this.lblReservatorio.Size = new System.Drawing.Size(84, 13); - this.lblReservatorio.TabIndex = 23; - this.lblReservatorio.Text = "Reservatório (%)"; - // - // lblBateria - // - this.lblBateria.AutoSize = true; - this.lblBateria.Location = new System.Drawing.Point(486, 386); - this.lblBateria.Name = "lblBateria"; - this.lblBateria.Size = new System.Drawing.Size(57, 13); - this.lblBateria.TabIndex = 25; - this.lblBateria.Text = "Bateria (%)"; - // - // pgbBateria - // - this.pgbBateria.Location = new System.Drawing.Point(652, 378); - this.pgbBateria.Name = "pgbBateria"; - this.pgbBateria.Size = new System.Drawing.Size(136, 26); - this.pgbBateria.TabIndex = 24; - // - // lblOperacao - // - this.lblOperacao.AutoSize = true; - this.lblOperacao.Location = new System.Drawing.Point(486, 418); - this.lblOperacao.Name = "lblOperacao"; - this.lblOperacao.Size = new System.Drawing.Size(71, 13); - this.lblOperacao.TabIndex = 27; - this.lblOperacao.Text = "Operação (%)"; - // - // pgbOperacao - // - this.pgbOperacao.Location = new System.Drawing.Point(652, 410); - this.pgbOperacao.Name = "pgbOperacao"; - this.pgbOperacao.Size = new System.Drawing.Size(136, 26); - this.pgbOperacao.TabIndex = 26; - // - // lblRuaAtual - // - this.lblRuaAtual.AutoSize = true; - this.lblRuaAtual.Location = new System.Drawing.Point(486, 450); - this.lblRuaAtual.Name = "lblRuaAtual"; - this.lblRuaAtual.Size = new System.Drawing.Size(71, 13); - this.lblRuaAtual.TabIndex = 29; - this.lblRuaAtual.Text = "Rua Atual (%)"; - // - // pgbRuaAtual - // - this.pgbRuaAtual.Location = new System.Drawing.Point(652, 442); - this.pgbRuaAtual.Name = "pgbRuaAtual"; - this.pgbRuaAtual.Size = new System.Drawing.Size(136, 26); - this.pgbRuaAtual.TabIndex = 28; - // - // lblUltimaLeituraSolo - // - this.lblUltimaLeituraSolo.AutoSize = true; - this.lblUltimaLeituraSolo.Location = new System.Drawing.Point(12, 466); - this.lblUltimaLeituraSolo.Name = "lblUltimaLeituraSolo"; - this.lblUltimaLeituraSolo.Size = new System.Drawing.Size(164, 13); - this.lblUltimaLeituraSolo.TabIndex = 30; - this.lblUltimaLeituraSolo.Text = "Ultima Leitura Solo: 00:00:00.000"; - // - // lblUltimaLeituraRua - // - this.lblUltimaLeituraRua.AutoSize = true; - this.lblUltimaLeituraRua.Location = new System.Drawing.Point(207, 466); - this.lblUltimaLeituraRua.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.lblUltimaLeituraRua.Name = "lblUltimaLeituraRua"; - this.lblUltimaLeituraRua.Size = new System.Drawing.Size(163, 13); - this.lblUltimaLeituraRua.TabIndex = 31; - this.lblUltimaLeituraRua.Text = "Ultima Leitura Rua: 00:00:00.000"; - // - // lblModoOperacao - // - this.lblModoOperacao.AutoSize = true; - this.lblModoOperacao.Location = new System.Drawing.Point(486, 66); - this.lblModoOperacao.Name = "lblModoOperacao"; - this.lblModoOperacao.Size = new System.Drawing.Size(99, 13); - this.lblModoOperacao.TabIndex = 3; - this.lblModoOperacao.Text = "Modo de Operação"; - // - // txtModoOperacao - // - this.txtModoOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); - this.txtModoOperacao.Location = new System.Drawing.Point(652, 58); - this.txtModoOperacao.Name = "txtModoOperacao"; - this.txtModoOperacao.ReadOnly = true; - this.txtModoOperacao.Size = new System.Drawing.Size(136, 26); - this.txtModoOperacao.TabIndex = 4; - this.txtModoOperacao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // pnlCameraSoloE - // - this.pnlCameraSoloE.Location = new System.Drawing.Point(0, 363); - this.pnlCameraSoloE.Name = "pnlCameraSoloE"; - this.pnlCameraSoloE.Size = new System.Drawing.Size(130, 100); - this.pnlCameraSoloE.TabIndex = 17; - // - // pnlCameraSoloD - // - this.pnlCameraSoloD.Location = new System.Drawing.Point(350, 363); - this.pnlCameraSoloD.Name = "pnlCameraSoloD"; - this.pnlCameraSoloD.Size = new System.Drawing.Size(130, 100); - this.pnlCameraSoloD.TabIndex = 18; - // // pnlCameraCaminho // - this.pnlCameraCaminho.Location = new System.Drawing.Point(174, 363); + this.pnlCameraCaminho.Location = new System.Drawing.Point(176, 355); this.pnlCameraCaminho.Name = "pnlCameraCaminho"; this.pnlCameraCaminho.Size = new System.Drawing.Size(130, 100); this.pnlCameraCaminho.TabIndex = 18; // - // picFechar + // pnlCameraSoloD // - this.picFechar.Image = global::AgroBase.Properties.Resources.fechar; - this.picFechar.Location = new System.Drawing.Point(753, 9); - this.picFechar.Name = "picFechar"; - this.picFechar.Size = new System.Drawing.Size(35, 35); - this.picFechar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.picFechar.TabIndex = 1; - this.picFechar.TabStop = false; + this.pnlCameraSoloD.Location = new System.Drawing.Point(350, 355); + this.pnlCameraSoloD.Name = "pnlCameraSoloD"; + this.pnlCameraSoloD.Size = new System.Drawing.Size(130, 100); + this.pnlCameraSoloD.TabIndex = 18; + // + // pnlCameraSoloE + // + this.pnlCameraSoloE.Location = new System.Drawing.Point(0, 355); + this.pnlCameraSoloE.Name = "pnlCameraSoloE"; + this.pnlCameraSoloE.Size = new System.Drawing.Size(130, 100); + this.pnlCameraSoloE.TabIndex = 17; // // pnlInclinacao // @@ -398,40 +134,362 @@ this.pnlOrientacao.TabIndex = 12; this.pnlOrientacao.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlOrientacao_Paint); // + // lblMapaCarregado + // + this.lblMapaCarregado.AutoSize = true; + this.lblMapaCarregado.Location = new System.Drawing.Point(486, 9); + this.lblMapaCarregado.Name = "lblMapaCarregado"; + this.lblMapaCarregado.Size = new System.Drawing.Size(112, 13); + this.lblMapaCarregado.TabIndex = 2; + this.lblMapaCarregado.Text = "Mapa Carregado: N/A"; + // + // txtStatusAtual + // + this.txtStatusAtual.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); + this.txtStatusAtual.Location = new System.Drawing.Point(169, 71); + this.txtStatusAtual.Name = "txtStatusAtual"; + this.txtStatusAtual.ReadOnly = true; + this.txtStatusAtual.Size = new System.Drawing.Size(120, 26); + this.txtStatusAtual.TabIndex = 6; + this.txtStatusAtual.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // lblStatusAtual + // + this.lblStatusAtual.AutoSize = true; + this.lblStatusAtual.Location = new System.Drawing.Point(3, 79); + this.lblStatusAtual.Name = "lblStatusAtual"; + this.lblStatusAtual.Size = new System.Drawing.Size(64, 13); + this.lblStatusAtual.TabIndex = 5; + this.lblStatusAtual.Text = "Status Atual"; + // + // txtIniciadoEm + // + this.txtIniciadoEm.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); + this.txtIniciadoEm.Location = new System.Drawing.Point(169, 103); + this.txtIniciadoEm.Name = "txtIniciadoEm"; + this.txtIniciadoEm.ReadOnly = true; + this.txtIniciadoEm.Size = new System.Drawing.Size(120, 26); + this.txtIniciadoEm.TabIndex = 8; + this.txtIniciadoEm.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // lblIniciadoEm + // + this.lblIniciadoEm.AutoSize = true; + this.lblIniciadoEm.Location = new System.Drawing.Point(3, 111); + this.lblIniciadoEm.Name = "lblIniciadoEm"; + this.lblIniciadoEm.Size = new System.Drawing.Size(62, 13); + this.lblIniciadoEm.TabIndex = 7; + this.lblIniciadoEm.Text = "Iniciado Em"; + // + // txtConcluidoEm + // + this.txtConcluidoEm.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); + this.txtConcluidoEm.Location = new System.Drawing.Point(169, 135); + this.txtConcluidoEm.Name = "txtConcluidoEm"; + this.txtConcluidoEm.ReadOnly = true; + this.txtConcluidoEm.Size = new System.Drawing.Size(120, 26); + this.txtConcluidoEm.TabIndex = 10; + this.txtConcluidoEm.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // lblConcluidoEm + // + this.lblConcluidoEm.AutoSize = true; + this.lblConcluidoEm.Location = new System.Drawing.Point(3, 143); + this.lblConcluidoEm.Name = "lblConcluidoEm"; + this.lblConcluidoEm.Size = new System.Drawing.Size(74, 13); + this.lblConcluidoEm.TabIndex = 9; + this.lblConcluidoEm.Text = "Concluído Em"; + // + // txtDistanciaPercorrida + // + this.txtDistanciaPercorrida.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); + this.txtDistanciaPercorrida.Location = new System.Drawing.Point(169, 167); + this.txtDistanciaPercorrida.Name = "txtDistanciaPercorrida"; + this.txtDistanciaPercorrida.ReadOnly = true; + this.txtDistanciaPercorrida.Size = new System.Drawing.Size(120, 26); + this.txtDistanciaPercorrida.TabIndex = 12; + this.txtDistanciaPercorrida.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // lblDistanciaPercorrida + // + this.lblDistanciaPercorrida.AutoSize = true; + this.lblDistanciaPercorrida.Location = new System.Drawing.Point(3, 175); + this.lblDistanciaPercorrida.Name = "lblDistanciaPercorrida"; + this.lblDistanciaPercorrida.Size = new System.Drawing.Size(102, 13); + this.lblDistanciaPercorrida.TabIndex = 11; + this.lblDistanciaPercorrida.Text = "Distância Percorrida"; + // + // txtTempoOperacao + // + this.txtTempoOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); + this.txtTempoOperacao.Location = new System.Drawing.Point(169, 199); + this.txtTempoOperacao.Name = "txtTempoOperacao"; + this.txtTempoOperacao.ReadOnly = true; + this.txtTempoOperacao.Size = new System.Drawing.Size(120, 26); + this.txtTempoOperacao.TabIndex = 14; + this.txtTempoOperacao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // lblTempoOperacao + // + this.lblTempoOperacao.AutoSize = true; + this.lblTempoOperacao.Location = new System.Drawing.Point(3, 207); + this.lblTempoOperacao.Name = "lblTempoOperacao"; + this.lblTempoOperacao.Size = new System.Drawing.Size(105, 13); + this.lblTempoOperacao.TabIndex = 13; + this.lblTempoOperacao.Text = "Tempo de Operação"; + // + // txtErvasIdentificadas + // + this.txtErvasIdentificadas.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); + this.txtErvasIdentificadas.Location = new System.Drawing.Point(169, 231); + this.txtErvasIdentificadas.Name = "txtErvasIdentificadas"; + this.txtErvasIdentificadas.ReadOnly = true; + this.txtErvasIdentificadas.Size = new System.Drawing.Size(120, 26); + this.txtErvasIdentificadas.TabIndex = 16; + this.txtErvasIdentificadas.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // lblErvasIdentificadas + // + this.lblErvasIdentificadas.AutoSize = true; + this.lblErvasIdentificadas.Location = new System.Drawing.Point(3, 239); + this.lblErvasIdentificadas.Name = "lblErvasIdentificadas"; + this.lblErvasIdentificadas.Size = new System.Drawing.Size(97, 13); + this.lblErvasIdentificadas.TabIndex = 15; + this.lblErvasIdentificadas.Text = "Ervas Identificadas"; + // + // txtHerbicidaAplicado + // + this.txtHerbicidaAplicado.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); + this.txtHerbicidaAplicado.Location = new System.Drawing.Point(169, 263); + this.txtHerbicidaAplicado.Name = "txtHerbicidaAplicado"; + this.txtHerbicidaAplicado.ReadOnly = true; + this.txtHerbicidaAplicado.Size = new System.Drawing.Size(120, 26); + this.txtHerbicidaAplicado.TabIndex = 18; + this.txtHerbicidaAplicado.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // lblHerbicidaAplicado + // + this.lblHerbicidaAplicado.AutoSize = true; + this.lblHerbicidaAplicado.Location = new System.Drawing.Point(3, 271); + this.lblHerbicidaAplicado.Name = "lblHerbicidaAplicado"; + this.lblHerbicidaAplicado.Size = new System.Drawing.Size(96, 13); + this.lblHerbicidaAplicado.TabIndex = 17; + this.lblHerbicidaAplicado.Text = "Herbicida Aplicado"; + // + // txtBateriaConsumida + // + this.txtBateriaConsumida.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); + this.txtBateriaConsumida.Location = new System.Drawing.Point(169, 295); + this.txtBateriaConsumida.Name = "txtBateriaConsumida"; + this.txtBateriaConsumida.ReadOnly = true; + this.txtBateriaConsumida.Size = new System.Drawing.Size(120, 26); + this.txtBateriaConsumida.TabIndex = 20; + this.txtBateriaConsumida.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // lblBateriaConsumida + // + this.lblBateriaConsumida.AutoSize = true; + this.lblBateriaConsumida.Location = new System.Drawing.Point(3, 303); + this.lblBateriaConsumida.Name = "lblBateriaConsumida"; + this.lblBateriaConsumida.Size = new System.Drawing.Size(95, 13); + this.lblBateriaConsumida.TabIndex = 19; + this.lblBateriaConsumida.Text = "Bateria Consumida"; + // + // pgbReservatorio + // + this.pgbReservatorio.Location = new System.Drawing.Point(169, 327); + this.pgbReservatorio.Name = "pgbReservatorio"; + this.pgbReservatorio.Size = new System.Drawing.Size(120, 26); + this.pgbReservatorio.TabIndex = 21; + // + // lblReservatorio + // + this.lblReservatorio.AutoSize = true; + this.lblReservatorio.Location = new System.Drawing.Point(3, 335); + this.lblReservatorio.Name = "lblReservatorio"; + this.lblReservatorio.Size = new System.Drawing.Size(84, 13); + this.lblReservatorio.TabIndex = 23; + this.lblReservatorio.Text = "Reservatório (%)"; + // + // lblBateria + // + this.lblBateria.AutoSize = true; + this.lblBateria.Location = new System.Drawing.Point(3, 367); + this.lblBateria.Name = "lblBateria"; + this.lblBateria.Size = new System.Drawing.Size(57, 13); + this.lblBateria.TabIndex = 25; + this.lblBateria.Text = "Bateria (%)"; + // + // pgbBateria + // + this.pgbBateria.Location = new System.Drawing.Point(169, 359); + this.pgbBateria.Name = "pgbBateria"; + this.pgbBateria.Size = new System.Drawing.Size(120, 26); + this.pgbBateria.TabIndex = 24; + // + // lblOperacao + // + this.lblOperacao.AutoSize = true; + this.lblOperacao.Location = new System.Drawing.Point(3, 399); + this.lblOperacao.Name = "lblOperacao"; + this.lblOperacao.Size = new System.Drawing.Size(71, 13); + this.lblOperacao.TabIndex = 27; + this.lblOperacao.Text = "Operação (%)"; + // + // pgbOperacao + // + this.pgbOperacao.Location = new System.Drawing.Point(169, 391); + this.pgbOperacao.Name = "pgbOperacao"; + this.pgbOperacao.Size = new System.Drawing.Size(120, 26); + this.pgbOperacao.TabIndex = 26; + // + // lblRuaAtual + // + this.lblRuaAtual.AutoSize = true; + this.lblRuaAtual.Location = new System.Drawing.Point(3, 431); + this.lblRuaAtual.Name = "lblRuaAtual"; + this.lblRuaAtual.Size = new System.Drawing.Size(71, 13); + this.lblRuaAtual.TabIndex = 29; + this.lblRuaAtual.Text = "Rua Atual (%)"; + // + // pgbRuaAtual + // + this.pgbRuaAtual.Location = new System.Drawing.Point(169, 423); + this.pgbRuaAtual.Name = "pgbRuaAtual"; + this.pgbRuaAtual.Size = new System.Drawing.Size(120, 26); + this.pgbRuaAtual.TabIndex = 28; + // + // lblModoOperacao + // + this.lblModoOperacao.AutoSize = true; + this.lblModoOperacao.Location = new System.Drawing.Point(3, 13); + this.lblModoOperacao.Name = "lblModoOperacao"; + this.lblModoOperacao.Size = new System.Drawing.Size(99, 13); + this.lblModoOperacao.TabIndex = 3; + this.lblModoOperacao.Text = "Modo de Operação"; + // + // txtModoOperacao + // + this.txtModoOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); + this.txtModoOperacao.Location = new System.Drawing.Point(169, 5); + this.txtModoOperacao.Name = "txtModoOperacao"; + this.txtModoOperacao.ReadOnly = true; + this.txtModoOperacao.Size = new System.Drawing.Size(120, 26); + this.txtModoOperacao.TabIndex = 4; + this.txtModoOperacao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // picFechar + // + this.picFechar.Image = global::AgroBase.Properties.Resources.fechar; + this.picFechar.Location = new System.Drawing.Point(753, 9); + this.picFechar.Name = "picFechar"; + this.picFechar.Size = new System.Drawing.Size(35, 35); + this.picFechar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.picFechar.TabIndex = 1; + this.picFechar.TabStop = false; + // + // pnlJoystick + // + this.pnlJoystick.Location = new System.Drawing.Point(16, 242); + this.pnlJoystick.Name = "pnlJoystick"; + this.pnlJoystick.Size = new System.Drawing.Size(100, 100); + this.pnlJoystick.TabIndex = 18; + this.pnlJoystick.Visible = false; + // + // pnlAcompanhamento + // + this.pnlAcompanhamento.AutoScroll = true; + this.pnlAcompanhamento.Controls.Add(this.lblModoControle); + this.pnlAcompanhamento.Controls.Add(this.cmbModoControle); + this.pnlAcompanhamento.Controls.Add(this.lblModoOperacao); + this.pnlAcompanhamento.Controls.Add(this.txtModoOperacao); + this.pnlAcompanhamento.Controls.Add(this.lblStatusAtual); + this.pnlAcompanhamento.Controls.Add(this.lblRuaAtual); + this.pnlAcompanhamento.Controls.Add(this.txtStatusAtual); + this.pnlAcompanhamento.Controls.Add(this.pgbRuaAtual); + this.pnlAcompanhamento.Controls.Add(this.lblIniciadoEm); + this.pnlAcompanhamento.Controls.Add(this.lblOperacao); + this.pnlAcompanhamento.Controls.Add(this.txtIniciadoEm); + this.pnlAcompanhamento.Controls.Add(this.pgbOperacao); + this.pnlAcompanhamento.Controls.Add(this.lblConcluidoEm); + this.pnlAcompanhamento.Controls.Add(this.lblBateria); + this.pnlAcompanhamento.Controls.Add(this.txtConcluidoEm); + this.pnlAcompanhamento.Controls.Add(this.pgbBateria); + this.pnlAcompanhamento.Controls.Add(this.lblDistanciaPercorrida); + this.pnlAcompanhamento.Controls.Add(this.lblReservatorio); + this.pnlAcompanhamento.Controls.Add(this.txtDistanciaPercorrida); + this.pnlAcompanhamento.Controls.Add(this.pgbReservatorio); + this.pnlAcompanhamento.Controls.Add(this.lblTempoOperacao); + this.pnlAcompanhamento.Controls.Add(this.txtBateriaConsumida); + this.pnlAcompanhamento.Controls.Add(this.txtTempoOperacao); + this.pnlAcompanhamento.Controls.Add(this.lblBateriaConsumida); + this.pnlAcompanhamento.Controls.Add(this.lblErvasIdentificadas); + this.pnlAcompanhamento.Controls.Add(this.txtHerbicidaAplicado); + this.pnlAcompanhamento.Controls.Add(this.txtErvasIdentificadas); + this.pnlAcompanhamento.Controls.Add(this.lblHerbicidaAplicado); + this.pnlAcompanhamento.Location = new System.Drawing.Point(486, 58); + this.pnlAcompanhamento.Name = "pnlAcompanhamento"; + this.pnlAcompanhamento.Size = new System.Drawing.Size(312, 397); + this.pnlAcompanhamento.TabIndex = 32; + // + // cmbModoControle + // + this.cmbModoControle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbModoControle.Enabled = false; + this.cmbModoControle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F); + this.cmbModoControle.FormattingEnabled = true; + this.cmbModoControle.Location = new System.Drawing.Point(169, 37); + this.cmbModoControle.Name = "cmbModoControle"; + this.cmbModoControle.Size = new System.Drawing.Size(120, 28); + this.cmbModoControle.TabIndex = 30; + // + // lblModoControle + // + this.lblModoControle.AutoSize = true; + this.lblModoControle.Location = new System.Drawing.Point(3, 45); + this.lblModoControle.Name = "lblModoControle"; + this.lblModoControle.Size = new System.Drawing.Size(91, 13); + this.lblModoControle.TabIndex = 31; + this.lblModoControle.Text = "Modo de Controle"; + // + // statusStrip1 + // + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.lblUltimaLeituraSolo, + this.lblUltimaLeituraCaminho, + this.lblPerformance}); + this.statusStrip1.Location = new System.Drawing.Point(0, 458); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Size = new System.Drawing.Size(800, 22); + this.statusStrip1.TabIndex = 33; + this.statusStrip1.Text = "statusStrip1"; + // + // lblUltimaLeituraCaminho + // + this.lblUltimaLeituraCaminho.Name = "lblUltimaLeituraCaminho"; + this.lblUltimaLeituraCaminho.Size = new System.Drawing.Size(181, 17); + this.lblUltimaLeituraCaminho.Text = "Última Leitura Caminho: 00:00:00"; + // + // lblUltimaLeituraSolo + // + this.lblUltimaLeituraSolo.Name = "lblUltimaLeituraSolo"; + this.lblUltimaLeituraSolo.Size = new System.Drawing.Size(155, 17); + this.lblUltimaLeituraSolo.Text = "Última Leitura Solo: 00:00:00"; + // + // lblPerformance + // + this.lblPerformance.Name = "lblPerformance"; + this.lblPerformance.Size = new System.Drawing.Size(190, 17); + this.lblPerformance.Text = "CPU: 0,0% GPU: 0,0% RAM: 0,0%"; + // // frmDialogoMapa // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Ivory; this.ClientSize = new System.Drawing.Size(800, 480); - this.Controls.Add(this.lblUltimaLeituraRua); - this.Controls.Add(this.lblUltimaLeituraSolo); - this.Controls.Add(this.lblRuaAtual); - this.Controls.Add(this.pgbRuaAtual); - this.Controls.Add(this.lblOperacao); - this.Controls.Add(this.pgbOperacao); - this.Controls.Add(this.lblBateria); - this.Controls.Add(this.pgbBateria); - this.Controls.Add(this.lblReservatorio); - this.Controls.Add(this.pgbReservatorio); - this.Controls.Add(this.txtBateriaConsumida); - this.Controls.Add(this.lblBateriaConsumida); - this.Controls.Add(this.txtHerbicidaAplicado); - this.Controls.Add(this.lblHerbicidaAplicado); - this.Controls.Add(this.txtErvasIdentificadas); - this.Controls.Add(this.lblErvasIdentificadas); - this.Controls.Add(this.txtTempoOperacao); - this.Controls.Add(this.lblTempoOperacao); - this.Controls.Add(this.txtDistanciaPercorrida); - this.Controls.Add(this.lblDistanciaPercorrida); - this.Controls.Add(this.txtConcluidoEm); - this.Controls.Add(this.lblConcluidoEm); - this.Controls.Add(this.txtIniciadoEm); - this.Controls.Add(this.lblIniciadoEm); - this.Controls.Add(this.txtStatusAtual); - this.Controls.Add(this.lblStatusAtual); - this.Controls.Add(this.txtModoOperacao); - this.Controls.Add(this.lblModoOperacao); + this.Controls.Add(this.statusStrip1); + this.Controls.Add(this.pnlAcompanhamento); this.Controls.Add(this.lblMapaCarregado); this.Controls.Add(this.picFechar); this.Controls.Add(this.pnlMapa); @@ -441,6 +499,10 @@ this.Text = "frmDialogoMapa"; this.pnlMapa.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.picFechar)).EndInit(); + this.pnlAcompanhamento.ResumeLayout(false); + this.pnlAcompanhamento.PerformLayout(); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -477,12 +539,18 @@ private System.Windows.Forms.ProgressBar pgbRuaAtual; private System.Windows.Forms.Panel pnlOrientacao; private System.Windows.Forms.Panel pnlInclinacao; - public System.Windows.Forms.Label lblUltimaLeituraSolo; - private System.Windows.Forms.Label lblUltimaLeituraRua; private System.Windows.Forms.Panel pnlCameraCaminho; private System.Windows.Forms.Panel pnlCameraSoloD; private System.Windows.Forms.Panel pnlCameraSoloE; private System.Windows.Forms.Label lblModoOperacao; private System.Windows.Forms.TextBox txtModoOperacao; + private System.Windows.Forms.Panel pnlJoystick; + private System.Windows.Forms.Panel pnlAcompanhamento; + private System.Windows.Forms.Label lblModoControle; + private System.Windows.Forms.ComboBox cmbModoControle; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ToolStripStatusLabel lblUltimaLeituraSolo; + private System.Windows.Forms.ToolStripStatusLabel lblUltimaLeituraCaminho; + private System.Windows.Forms.ToolStripStatusLabel lblPerformance; } } \ No newline at end of file diff --git a/AgroBase/AgroBase/Forms/IHM/frmDialogoMapa.cs b/AgroBase/AgroBase/Forms/IHM/frmDialogoMapa.cs index 574fde0f8..f2168dd41 100644 --- a/AgroBase/AgroBase/Forms/IHM/frmDialogoMapa.cs +++ b/AgroBase/AgroBase/Forms/IHM/frmDialogoMapa.cs @@ -11,7 +11,6 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -using System.Windows.Forms.DataVisualization.Charting; namespace AgroBase.Forms.IHM { @@ -22,9 +21,22 @@ namespace AgroBase.Forms.IHM public frmDialogoMapa() { InitializeComponent(); + + // Ativa o double buffering + this.DoubleBuffered = true; + this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); + this.SetStyle(ControlStyles.UserPaint, true); + this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); + + pnlJoystick.GetType().GetMethod("SetStyle", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).Invoke(pnlJoystick, new object[] { ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true }); + tmrLeitura.Tick += tmrLeitura_Tick; tmrLeitura.Start(); + cmbModoControle.Items.Clear(); + cmbModoControle.Items.AddRange(Enum.GetNames(typeof(Enums.TipoMovimentoDirecional))); + cmbModoControle.SelectedIndexChanged += CmbModoControle_SelectedIndexChanged; + FuncoesGlobais.DefinirEventosPicBtn(picFechar, async () => { if (Variaveis.OperacaoEmAndamento.Iniciado) @@ -32,6 +44,10 @@ namespace AgroBase.Forms.IHM if (MessageBox.Show("Tem certeza que deseja interromper a operação em andamento?", "Interromper Operação", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Variaveis.OperacaoEmAndamento.FinalizarOperacao(); + if (Variaveis.OperacaoEmAndamento.Modo == Enums.ModoOperacao.Manual) + { + this.Close(); + } } } else @@ -39,6 +55,8 @@ namespace AgroBase.Forms.IHM this.Hide(); } }); + + InicializarModoManual(); } public async Task AtualizarRuasSelecionadas(List ruasSelecionadas) @@ -62,14 +80,16 @@ namespace AgroBase.Forms.IHM var ultimaLeitura = Variaveis.OperacaoEmAndamento.CamerasSolo.OrderByDescending(x => x.Leitura.timestamp).FirstOrDefault(); if (ultimaLeitura != null) { - lblUltimaLeituraSolo.Text = "Ultima Leitura Solo: " + FuncoesGlobais.TimestampToDate(ultimaLeitura.Leitura.timestamp); + lblUltimaLeituraSolo.Text = "Última Leitura Solo: " + FuncoesGlobais.TimestampToDate(ultimaLeitura.Leitura.timestamp); } if (Variaveis.OperacaoEmAndamento.CameraCaminho != null) { - lblUltimaLeituraRua.Text = "Ultima Leitura Rua: " + FuncoesGlobais.TimestampToDate(Variaveis.OperacaoEmAndamento.CameraCaminho.Leitura.timestamp); + lblUltimaLeituraCaminho.Text = "Última Leitura Caminho: " + FuncoesGlobais.TimestampToDate(Variaveis.OperacaoEmAndamento.CameraCaminho.Leitura.timestamp); } + lblPerformance.Text = Variaveis.OperacaoEmAndamento.PerformanceStr; txtModoOperacao.Text = Variaveis.OperacaoEmAndamento.Modo.ToString(); + cmbModoControle.SelectedIndex = (int)Variaveis.OperacaoEmAndamento.Controle.TipoMovimento; txtStatusAtual.Text = Variaveis.OperacaoEmAndamento.StatusAtual.ToString(); txtIniciadoEm.Text = new DateTime(Variaveis.OperacaoEmAndamento.TimestampInicio).ToString("dd/MM HH:mm:ss"); txtConcluidoEm.Text = new DateTime(Variaveis.OperacaoEmAndamento.TimestampFim).ToString("dd/MM HH:mm:ss"); @@ -109,6 +129,147 @@ namespace AgroBase.Forms.IHM } catch { } } - + + + #region MODO MANUAL + + private Point joystickCenter; + private bool isDragging = false; + private Keys prevMovKey = Keys.None; + private Keys prevDirKey = Keys.None; + + private int joystickRadius; + private Point joystickPosition; + + private void InicializarModoManual() + { + if (Variaveis.OperacaoEmAndamento.Modo == Enums.ModoOperacao.Manual) + { + Variaveis.OperacaoEmAndamento.Mapa = new MapasModel() + { + pnlMapa = pnlMapa, + lblMapa = lblMapaCarregado + }; + Variaveis.OperacaoEmAndamento.Mapa.CarregarMapaGPS(); + + cmbModoControle.Enabled = true; + + pnlJoystick.Visible = true; + + // Configurar o painel do joystick + pnlJoystick.BackColor = Color.FromArgb(128, 0, 0, 0); // Fundo semitransparente + + // Definir região circular para o painel + System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath(); + path.AddEllipse(0, 0, pnlJoystick.Width, pnlJoystick.Height); + pnlJoystick.Region = new Region(path); + + // Calcular o centro do joystick + joystickCenter = new Point(pnlJoystick.Width / 2, pnlJoystick.Height / 2); + + // Definir o raio do joystick + joystickRadius = 25; // Metade do tamanho do círculo + joystickPosition = joystickCenter; + + // Evento de pintura do painel + pnlJoystick.Paint += PanelJoystickBack_Paint; + + // Eventos de toque/mouse + pnlJoystick.MouseDown += PanelJoystickBack_MouseDown; + pnlJoystick.MouseMove += PanelJoystickBack_MouseMove; + pnlJoystick.MouseUp += PanelJoystickBack_MouseUp; + + IniciarOperacao(); + } + } + + private void PanelJoystickBack_Paint(object sender, PaintEventArgs e) + { + e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; + e.Graphics.FillEllipse(Brushes.Red, joystickPosition.X - joystickRadius, joystickPosition.Y - joystickRadius, joystickRadius * 2, joystickRadius * 2); + } + + private void PanelJoystickBack_MouseDown(object sender, MouseEventArgs e) + { + isDragging = true; + } + + private void PanelJoystickBack_MouseMove(object sender, MouseEventArgs e) + { + if (isDragging) + { + // Calcula a nova posição do joystick + var mouseX = e.X; + var mouseY = e.Y; + + var deltaX = mouseX - joystickCenter.X; + var deltaY = mouseY - joystickCenter.Y; + + // Limitar o movimento do joystick ao círculo do painel + var distance = Math.Sqrt(deltaX * deltaX + deltaY * deltaY); + var maxDistance = pnlJoystick.Width / 2; + + if (distance > maxDistance) + { + deltaX = (int)(deltaX / distance * maxDistance); + deltaY = (int)(deltaY / distance * maxDistance); + } + + joystickPosition = new Point(joystickCenter.X + deltaX, joystickCenter.Y + deltaY); + pnlJoystick.Invalidate(); // Redesenha o painel + + // Enviar comandos de movimento ao robô + SendMovementCommand(deltaX, deltaY); + } + } + + private void PanelJoystickBack_MouseUp(object sender, MouseEventArgs e) + { + isDragging = false; + // Retorna o joystick ao centro + joystickPosition = joystickCenter; + pnlJoystick.Invalidate(); // Redesenha o painel + + // Enviar comando de parada ao robô + SendMovementCommand(0, 0); + } + + private void SendMovementCommand(int deltaX, int deltaY) + { + Keys MovKey = Keys.Escape; + if (deltaY < -10) MovKey = Keys.Up; + else if (deltaY > 10) MovKey = Keys.Down; + + Keys DirKey = Keys.Escape; + if (deltaX < -10) DirKey = Keys.Left; + else if (deltaX > 10) DirKey = Keys.Right; + + // Verifica se o estado da tecla de movimento mudou + if (MovKey != prevMovKey) + { + // Lógica para enviar comando ao robô baseado em MovKey + Console.WriteLine($"Movimento: MovKey={MovKey}"); + GeneralJoystick.EnviaComandoMotor(MovKey, Enums.T_Code.Mov); + prevMovKey = MovKey; // Atualiza o estado anterior + } + + // Verifica se o estado da tecla de direção mudou + if (DirKey != prevDirKey) + { + // Lógica para enviar comando ao robô baseado em DirKey + Console.WriteLine($"Direção: DirKey={DirKey}"); + GeneralJoystick.EnviaComandoMotor(DirKey, Enums.T_Code.Dir); + prevDirKey = DirKey; // Atualiza o estado anterior + } + } + + private void CmbModoControle_SelectedIndexChanged(object sender, EventArgs e) + { + Variaveis.OperacaoEmAndamento.Controle.TipoMovimento = (Enums.TipoMovimentoDirecional)cmbModoControle.SelectedIndex; + } + + #endregion + + } } diff --git a/AgroBase/AgroBase/Forms/IHM/frmDialogoMapa.resx b/AgroBase/AgroBase/Forms/IHM/frmDialogoMapa.resx index 1af7de150..174ebc727 100644 --- a/AgroBase/AgroBase/Forms/IHM/frmDialogoMapa.resx +++ b/AgroBase/AgroBase/Forms/IHM/frmDialogoMapa.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/AgroBase/AgroBase/Forms/IHM/frmIHM.Designer.cs b/AgroBase/AgroBase/Forms/IHM/frmIHM.Designer.cs index 44098818a..febb56859 100644 --- a/AgroBase/AgroBase/Forms/IHM/frmIHM.Designer.cs +++ b/AgroBase/AgroBase/Forms/IHM/frmIHM.Designer.cs @@ -46,15 +46,18 @@ this.lblD_Cam_S0 = new System.Windows.Forms.Label(); this.lblD_Cam_S1 = new System.Windows.Forms.Label(); this.lblD_Cam_C = new System.Windows.Forms.Label(); + this.lblDiagnosticos = new System.Windows.Forms.Label(); + this.lblOperacao = new System.Windows.Forms.Label(); + this.lblAjustes = new System.Windows.Forms.Label(); + this.lblDesligar = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.picManual = new System.Windows.Forms.PictureBox(); this.picDiagnosticos = new System.Windows.Forms.PictureBox(); this.picOperacao = new System.Windows.Forms.PictureBox(); this.picAjustes = new System.Windows.Forms.PictureBox(); this.picDesligar = new System.Windows.Forms.PictureBox(); this.picRobo = new System.Windows.Forms.PictureBox(); - this.lblDiagnosticos = new System.Windows.Forms.Label(); - this.lblOperacao = new System.Windows.Forms.Label(); - this.lblAjustes = new System.Windows.Forms.Label(); - this.lblDesligar = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.picManual)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picDiagnosticos)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picOperacao)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picAjustes)).BeginInit(); @@ -273,6 +276,72 @@ this.lblD_Cam_C.Text = "CAM"; this.lblD_Cam_C.Click += new System.EventHandler(this.lblModulo_Click); // + // lblDiagnosticos + // + this.lblDiagnosticos.AutoSize = true; + this.lblDiagnosticos.BackColor = System.Drawing.Color.Transparent; + this.lblDiagnosticos.Cursor = System.Windows.Forms.Cursors.Hand; + this.lblDiagnosticos.Location = new System.Drawing.Point(369, 162); + this.lblDiagnosticos.Name = "lblDiagnosticos"; + this.lblDiagnosticos.Size = new System.Drawing.Size(117, 24); + this.lblDiagnosticos.TabIndex = 32; + this.lblDiagnosticos.Text = "Diagnósticos"; + // + // lblOperacao + // + this.lblOperacao.AutoSize = true; + this.lblOperacao.BackColor = System.Drawing.Color.Transparent; + this.lblOperacao.Cursor = System.Windows.Forms.Cursors.Hand; + this.lblOperacao.Location = new System.Drawing.Point(527, 162); + this.lblOperacao.Name = "lblOperacao"; + this.lblOperacao.Size = new System.Drawing.Size(94, 24); + this.lblOperacao.TabIndex = 33; + this.lblOperacao.Text = "Operação"; + // + // lblAjustes + // + this.lblAjustes.AutoSize = true; + this.lblAjustes.BackColor = System.Drawing.Color.Transparent; + this.lblAjustes.Cursor = System.Windows.Forms.Cursors.Hand; + this.lblAjustes.Location = new System.Drawing.Point(689, 162); + this.lblAjustes.Name = "lblAjustes"; + this.lblAjustes.Size = new System.Drawing.Size(71, 24); + this.lblAjustes.TabIndex = 35; + this.lblAjustes.Text = "Ajustes"; + // + // lblDesligar + // + this.lblDesligar.AutoSize = true; + this.lblDesligar.BackColor = System.Drawing.Color.Transparent; + this.lblDesligar.Cursor = System.Windows.Forms.Cursors.Hand; + this.lblDesligar.Location = new System.Drawing.Point(685, 450); + this.lblDesligar.Name = "lblDesligar"; + this.lblDesligar.Size = new System.Drawing.Size(78, 24); + this.lblDesligar.TabIndex = 36; + this.lblDesligar.Text = "Desligar"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.BackColor = System.Drawing.Color.Transparent; + this.label1.Cursor = System.Windows.Forms.Cursors.Hand; + this.label1.Location = new System.Drawing.Point(364, 450); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(126, 24); + this.label1.TabIndex = 38; + this.label1.Text = "Modo Manual"; + // + // picManual + // + this.picManual.Cursor = System.Windows.Forms.Cursors.Default; + this.picManual.Image = global::AgroBase.Properties.Resources.joystick; + this.picManual.Location = new System.Drawing.Point(362, 302); + this.picManual.Name = "picManual"; + this.picManual.Size = new System.Drawing.Size(130, 130); + this.picManual.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.picManual.TabIndex = 37; + this.picManual.TabStop = false; + // // picDiagnosticos // this.picDiagnosticos.Cursor = System.Windows.Forms.Cursors.Default; @@ -327,56 +396,14 @@ this.picRobo.TabIndex = 1; this.picRobo.TabStop = false; // - // lblDiagnosticos - // - this.lblDiagnosticos.AutoSize = true; - this.lblDiagnosticos.BackColor = System.Drawing.Color.Transparent; - this.lblDiagnosticos.Cursor = System.Windows.Forms.Cursors.Hand; - this.lblDiagnosticos.Location = new System.Drawing.Point(369, 162); - this.lblDiagnosticos.Name = "lblDiagnosticos"; - this.lblDiagnosticos.Size = new System.Drawing.Size(117, 24); - this.lblDiagnosticos.TabIndex = 32; - this.lblDiagnosticos.Text = "Diagnósticos"; - // - // lblOperacao - // - this.lblOperacao.AutoSize = true; - this.lblOperacao.BackColor = System.Drawing.Color.Transparent; - this.lblOperacao.Cursor = System.Windows.Forms.Cursors.Hand; - this.lblOperacao.Location = new System.Drawing.Point(527, 162); - this.lblOperacao.Name = "lblOperacao"; - this.lblOperacao.Size = new System.Drawing.Size(94, 24); - this.lblOperacao.TabIndex = 33; - this.lblOperacao.Text = "Operação"; - // - // lblAjustes - // - this.lblAjustes.AutoSize = true; - this.lblAjustes.BackColor = System.Drawing.Color.Transparent; - this.lblAjustes.Cursor = System.Windows.Forms.Cursors.Hand; - this.lblAjustes.Location = new System.Drawing.Point(689, 162); - this.lblAjustes.Name = "lblAjustes"; - this.lblAjustes.Size = new System.Drawing.Size(71, 24); - this.lblAjustes.TabIndex = 35; - this.lblAjustes.Text = "Ajustes"; - // - // lblDesligar - // - this.lblDesligar.AutoSize = true; - this.lblDesligar.BackColor = System.Drawing.Color.Transparent; - this.lblDesligar.Cursor = System.Windows.Forms.Cursors.Hand; - this.lblDesligar.Location = new System.Drawing.Point(685, 450); - this.lblDesligar.Name = "lblDesligar"; - this.lblDesligar.Size = new System.Drawing.Size(78, 24); - this.lblDesligar.TabIndex = 36; - this.lblDesligar.Text = "Desligar"; - // // frmIHM // this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(800, 480); + this.Controls.Add(this.label1); + this.Controls.Add(this.picManual); this.Controls.Add(this.lblDesligar); this.Controls.Add(this.lblAjustes); this.Controls.Add(this.lblOperacao); @@ -411,6 +438,7 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Agrobotics Persistence"; this.Load += new System.EventHandler(this.frmIHM_Load); + ((System.ComponentModel.ISupportInitialize)(this.picManual)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.picDiagnosticos)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.picOperacao)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.picAjustes)).EndInit(); @@ -450,5 +478,7 @@ private System.Windows.Forms.Label lblOperacao; private System.Windows.Forms.Label lblAjustes; private System.Windows.Forms.Label lblDesligar; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.PictureBox picManual; } } \ No newline at end of file diff --git a/AgroBase/AgroBase/Forms/IHM/frmIHM.cs b/AgroBase/AgroBase/Forms/IHM/frmIHM.cs index e46d8a250..5c89940a6 100644 --- a/AgroBase/AgroBase/Forms/IHM/frmIHM.cs +++ b/AgroBase/AgroBase/Forms/IHM/frmIHM.cs @@ -40,6 +40,19 @@ namespace AgroBase.Forms.IHM frmAjustes frm = new frmAjustes(); frm.ShowDialog(); }); + FuncoesGlobais.DefinirEventosPicBtn(picManual, async () => + { + Variaveis.OperacaoEmAndamento = OperacaoModel.CarregarParametrosOperacaoPadrao(ModoOperacao.Manual); + if (Variaveis.OperacaoEmAndamento.OperacaoLiberada) + { + frmDialogoMapa frm = new frmDialogoMapa(); + frm.ShowDialog(); + } + else + { + MessageBox.Show(Variaveis.OperacaoEmAndamento.ErroOperacaoLiberada, "Iniciar Operação Manual", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + }); FuncoesGlobais.DefinirEventosPicBtn(picDesligar, async () => { if (MessageBox.Show("Deseja desligar o equipamento?", "Desligar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) diff --git a/AgroBase/AgroBase/Forms/Sensoriamento/frmSenConfig.cs b/AgroBase/AgroBase/Forms/Sensoriamento/frmSenConfig.cs index df5418385..2e569d735 100644 --- a/AgroBase/AgroBase/Forms/Sensoriamento/frmSenConfig.cs +++ b/AgroBase/AgroBase/Forms/Sensoriamento/frmSenConfig.cs @@ -223,8 +223,14 @@ namespace AgroBase.Forms.Sensoriamento } else { + PZEMService.ModoLeitura = true; var Comando = PZEMService.ComandoGetParametro(PZEMService.Parametros[cmbBateriaParametro.Text]); PZEMService.EnviarComando(ModbusService._PortaModbus, Comando); + Task.Run(async () => + { + await Task.Delay(1000); + PZEMService.ModoLeitura = false; + }); } } diff --git a/AgroBase/AgroBase/Forms/frmAcompanhamento.cs b/AgroBase/AgroBase/Forms/frmAcompanhamento.cs index b304c30e0..07640d5f1 100644 --- a/AgroBase/AgroBase/Forms/frmAcompanhamento.cs +++ b/AgroBase/AgroBase/Forms/frmAcompanhamento.cs @@ -78,7 +78,7 @@ namespace AgroBase.Forms foreach (var Modulo in DispMvd.Dados.Modulos) { Label lblTitulo = pnlFundo.Controls.OfType