diff --git a/AgroBase/.vs/AgroBase/FileContentIndex/c8bef506-d0e4-4b94-9e20-51b4a8e6c826.vsidx b/AgroBase/.vs/AgroBase/FileContentIndex/bc85f031-726e-43c5-86b6-4ece5a3a49c6.vsidx similarity index 65% rename from AgroBase/.vs/AgroBase/FileContentIndex/c8bef506-d0e4-4b94-9e20-51b4a8e6c826.vsidx rename to AgroBase/.vs/AgroBase/FileContentIndex/bc85f031-726e-43c5-86b6-4ece5a3a49c6.vsidx index 6acc24a7d..8f6608c64 100644 Binary files a/AgroBase/.vs/AgroBase/FileContentIndex/c8bef506-d0e4-4b94-9e20-51b4a8e6c826.vsidx and b/AgroBase/.vs/AgroBase/FileContentIndex/bc85f031-726e-43c5-86b6-4ece5a3a49c6.vsidx differ diff --git a/AgroBase/.vs/AgroBase/v17/.suo b/AgroBase/.vs/AgroBase/v17/.suo index 82012d280..1c81d32da 100644 Binary files a/AgroBase/.vs/AgroBase/v17/.suo and b/AgroBase/.vs/AgroBase/v17/.suo differ diff --git a/AgroBase/.vs/AgroBase/v17/DocumentLayout.json b/AgroBase/.vs/AgroBase/v17/DocumentLayout.json index 27dfbc6fc..fe6447f6a 100644 --- a/AgroBase/.vs/AgroBase/v17/DocumentLayout.json +++ b/AgroBase/.vs/AgroBase/v17/DocumentLayout.json @@ -2,13 +2,21 @@ "Version": 1, "WorkspaceRootPath": "C:\\ZendionINC\\agrobot_base\\AgroBase\\", "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|C:\\ZendionINC\\agrobot_base\\AgroBase\\agrobase\\forms\\frmmapa.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form", + "RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\frmmapa.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form" + }, { "AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|c:\\zendioninc\\agrobot_base\\agrobase\\agrobase\\forms\\frmmapa.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\frmmapa.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, { - "AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|c:\\zendioninc\\agrobot_base\\agrobase\\agrobase\\forms\\frmmapa.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form", - "RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\frmmapa.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form" + "AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|c:\\zendioninc\\agrobot_base\\agrobase\\agrobase\\forms\\frmgps.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\frmgps.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|c:\\zendioninc\\agrobot_base\\agrobase\\agrobase\\forms\\frmgps.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form", + "RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\frmgps.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form" } ], "DocumentGroupContainers": [ @@ -18,24 +26,49 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 0, + "SelectedChildIndex": 3, "Children": [ { "$type": "Document", - "DocumentIndex": 0, + "DocumentIndex": 2, + "Title": "frmGPS.cs", + "DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmGPS.cs", + "RelativeDocumentMoniker": "AgroBase\\Forms\\frmGPS.cs", + "ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmGPS.cs", + "RelativeToolTip": "AgroBase\\Forms\\frmGPS.cs", + "ViewState": "AQIAABMAAAAAAAAAAAAwwFMAAAB1AAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-06T23:36:23.855Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 3, + "Title": "frmGPS.cs [Design]", + "DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmGPS.cs", + "RelativeDocumentMoniker": "AgroBase\\Forms\\frmGPS.cs", + "ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmGPS.cs [Design]", + "RelativeToolTip": "AgroBase\\Forms\\frmGPS.cs [Design]", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-06T23:32:18.176Z", + "EditorCaption": " [Design]" + }, + { + "$type": "Document", + "DocumentIndex": 1, "Title": "frmMapa.cs", "DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmMapa.cs", "RelativeDocumentMoniker": "AgroBase\\Forms\\frmMapa.cs", "ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmMapa.cs", "RelativeToolTip": "AgroBase\\Forms\\frmMapa.cs", - "ViewState": "AQIAACQAAAAAAAAAAAAowEgAAADCAAAA", + "ViewState": "AQIAAI0AAAAAAAAAAAAqwJwAAAAuAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2025-02-06T17:31:27.011Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 1, + "DocumentIndex": 0, "Title": "frmMapa.cs [Design]", "DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmMapa.cs", "RelativeDocumentMoniker": "AgroBase\\Forms\\frmMapa.cs", diff --git a/AgroBase/AgroBase/Forms/frmMapa.Designer.cs b/AgroBase/AgroBase/Forms/frmMapa.Designer.cs index af8c9cbe0..ae6c840fe 100644 --- a/AgroBase/AgroBase/Forms/frmMapa.Designer.cs +++ b/AgroBase/AgroBase/Forms/frmMapa.Designer.cs @@ -30,15 +30,23 @@ namespace AgroBase.Forms private void InitializeComponent() { this.pnlMapa = new System.Windows.Forms.Panel(); - this.pnlBotoes = new System.Windows.Forms.Panel(); - this.btnCalcular = new System.Windows.Forms.Button(); - this.btnCalcularPontos = new System.Windows.Forms.Button(); - this.lblMapa = new System.Windows.Forms.Label(); - this.btnCarregar = new System.Windows.Forms.Button(); this.pnlOrientacaoGps = new System.Windows.Forms.Panel(); + this.pnlBotoes = new System.Windows.Forms.Panel(); + this.btnGerarMapa = new System.Windows.Forms.Button(); + this.btnLimpar = new System.Windows.Forms.Button(); this.lblStatusGPS = new System.Windows.Forms.Label(); + this.btnRegistrarrPonto = new System.Windows.Forms.Button(); + this.lblMapa = new System.Windows.Forms.Label(); + this.btnCarregarMapa = new System.Windows.Forms.Button(); + this.dgPontos = new System.Windows.Forms.DataGridView(); + this.btnNovaRua = new System.Windows.Forms.Button(); + this.lblRuaAtual = new System.Windows.Forms.Label(); + this.txtDescricao = new System.Windows.Forms.TextBox(); + this.dgRuas = new System.Windows.Forms.DataGridView(); this.pnlMapa.SuspendLayout(); this.pnlBotoes.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgPontos)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgRuas)).BeginInit(); this.SuspendLayout(); // // pnlMapa @@ -47,48 +55,89 @@ namespace AgroBase.Forms | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.pnlMapa.Controls.Add(this.pnlOrientacaoGps); - this.pnlMapa.Location = new System.Drawing.Point(9, 33); - this.pnlMapa.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.pnlMapa.Location = new System.Drawing.Point(700, 12); + this.pnlMapa.Margin = new System.Windows.Forms.Padding(2); this.pnlMapa.Name = "pnlMapa"; - this.pnlMapa.Size = new System.Drawing.Size(772, 441); + this.pnlMapa.Size = new System.Drawing.Size(767, 462); this.pnlMapa.TabIndex = 1; // + // pnlOrientacaoGps + // + this.pnlOrientacaoGps.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.pnlOrientacaoGps.BackColor = System.Drawing.Color.White; + this.pnlOrientacaoGps.BackgroundImage = global::AgroBase.Properties.Resources.rosa_dos_ventos; + this.pnlOrientacaoGps.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.pnlOrientacaoGps.Location = new System.Drawing.Point(633, 2); + this.pnlOrientacaoGps.Margin = new System.Windows.Forms.Padding(2); + this.pnlOrientacaoGps.Name = "pnlOrientacaoGps"; + this.pnlOrientacaoGps.Size = new System.Drawing.Size(132, 132); + this.pnlOrientacaoGps.TabIndex = 13; + this.pnlOrientacaoGps.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlOrientacaoGps_Paint); + // // pnlBotoes // - this.pnlBotoes.Controls.Add(this.btnCalcular); - this.pnlBotoes.Controls.Add(this.btnCalcularPontos); + this.pnlBotoes.Controls.Add(this.txtDescricao); + this.pnlBotoes.Controls.Add(this.lblRuaAtual); + this.pnlBotoes.Controls.Add(this.btnNovaRua); + this.pnlBotoes.Controls.Add(this.btnGerarMapa); + this.pnlBotoes.Controls.Add(this.btnLimpar); + this.pnlBotoes.Controls.Add(this.lblStatusGPS); + this.pnlBotoes.Controls.Add(this.btnRegistrarrPonto); this.pnlBotoes.Controls.Add(this.lblMapa); - this.pnlBotoes.Controls.Add(this.btnCarregar); + this.pnlBotoes.Controls.Add(this.btnCarregarMapa); this.pnlBotoes.Dock = System.Windows.Forms.DockStyle.Bottom; this.pnlBotoes.Location = new System.Drawing.Point(0, 479); - this.pnlBotoes.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.pnlBotoes.Margin = new System.Windows.Forms.Padding(2); this.pnlBotoes.Name = "pnlBotoes"; - this.pnlBotoes.Size = new System.Drawing.Size(790, 46); + this.pnlBotoes.Size = new System.Drawing.Size(1476, 46); this.pnlBotoes.TabIndex = 2; // - // btnCalcular + // btnGerarMapa // - this.btnCalcular.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnCalcular.Location = new System.Drawing.Point(523, 11); - this.btnCalcular.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.btnCalcular.Name = "btnCalcular"; - this.btnCalcular.Size = new System.Drawing.Size(118, 26); - this.btnCalcular.TabIndex = 3; - this.btnCalcular.Text = "Calcular Trecho"; - this.btnCalcular.UseVisualStyleBackColor = true; - this.btnCalcular.Click += new System.EventHandler(this.btnCalcular_Click); + this.btnGerarMapa.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnGerarMapa.Location = new System.Drawing.Point(1266, 11); + this.btnGerarMapa.Margin = new System.Windows.Forms.Padding(2); + this.btnGerarMapa.Name = "btnGerarMapa"; + this.btnGerarMapa.Size = new System.Drawing.Size(100, 26); + this.btnGerarMapa.TabIndex = 4; + this.btnGerarMapa.Text = "Gerar Mapa"; + this.btnGerarMapa.UseVisualStyleBackColor = true; + this.btnGerarMapa.Click += new System.EventHandler(this.btnGerarMapa_Click); // - // btnCalcularPontos + // btnLimpar // - this.btnCalcularPontos.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnCalcularPontos.Location = new System.Drawing.Point(400, 11); - this.btnCalcularPontos.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.btnCalcularPontos.Name = "btnCalcularPontos"; - this.btnCalcularPontos.Size = new System.Drawing.Size(118, 26); - this.btnCalcularPontos.TabIndex = 2; - this.btnCalcularPontos.Text = "Registrar Ponto"; - this.btnCalcularPontos.UseVisualStyleBackColor = true; - this.btnCalcularPontos.Click += new System.EventHandler(this.btnCalcularPontos_Click); + this.btnLimpar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnLimpar.Location = new System.Drawing.Point(1162, 11); + this.btnLimpar.Margin = new System.Windows.Forms.Padding(2); + this.btnLimpar.Name = "btnLimpar"; + this.btnLimpar.Size = new System.Drawing.Size(100, 26); + this.btnLimpar.TabIndex = 3; + this.btnLimpar.Text = "Limpar Pontos"; + this.btnLimpar.UseVisualStyleBackColor = true; + this.btnLimpar.Click += new System.EventHandler(this.btnLimpar_Click); + // + // lblStatusGPS + // + this.lblStatusGPS.AutoSize = true; + this.lblStatusGPS.Location = new System.Drawing.Point(260, 17); + this.lblStatusGPS.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblStatusGPS.Name = "lblStatusGPS"; + this.lblStatusGPS.Size = new System.Drawing.Size(463, 13); + this.lblStatusGPS.TabIndex = 3; + this.lblStatusGPS.Text = "GPS - Precisão: 9999, Coreção: SemCorrecao, Satélites: 0, Distância: 0,00 m, Orie" + + "ntação: 0,00 º"; + // + // btnRegistrarrPonto + // + this.btnRegistrarrPonto.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnRegistrarrPonto.Location = new System.Drawing.Point(954, 11); + this.btnRegistrarrPonto.Margin = new System.Windows.Forms.Padding(2); + this.btnRegistrarrPonto.Name = "btnRegistrarrPonto"; + this.btnRegistrarrPonto.Size = new System.Drawing.Size(100, 26); + this.btnRegistrarrPonto.TabIndex = 2; + this.btnRegistrarrPonto.Text = "Registrar Ponto"; + this.btnRegistrarrPonto.UseVisualStyleBackColor = true; + this.btnRegistrarrPonto.Click += new System.EventHandler(this.btnRegistrarPontos_Click); // // lblMapa // @@ -100,50 +149,78 @@ namespace AgroBase.Forms this.lblMapa.TabIndex = 1; this.lblMapa.Text = "Mapa carregado: "; // - // btnCarregar + // btnCarregarMapa // - this.btnCarregar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnCarregar.Location = new System.Drawing.Point(684, 11); - this.btnCarregar.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.btnCarregar.Name = "btnCarregar"; - this.btnCarregar.Size = new System.Drawing.Size(98, 26); - this.btnCarregar.TabIndex = 0; - this.btnCarregar.Text = "Carregar mapa"; - this.btnCarregar.UseVisualStyleBackColor = true; - this.btnCarregar.Click += new System.EventHandler(this.btnCarregar_Click); + this.btnCarregarMapa.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnCarregarMapa.Location = new System.Drawing.Point(1370, 11); + this.btnCarregarMapa.Margin = new System.Windows.Forms.Padding(2); + this.btnCarregarMapa.Name = "btnCarregarMapa"; + this.btnCarregarMapa.Size = new System.Drawing.Size(98, 26); + this.btnCarregarMapa.TabIndex = 0; + this.btnCarregarMapa.Text = "Carregar mapa"; + this.btnCarregarMapa.UseVisualStyleBackColor = true; + this.btnCarregarMapa.Click += new System.EventHandler(this.btnCarregarMapa_Click); // - // pnlOrientacaoGps + // dgPontos // - this.pnlOrientacaoGps.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pnlOrientacaoGps.BackColor = System.Drawing.Color.White; - this.pnlOrientacaoGps.BackgroundImage = global::AgroBase.Properties.Resources.rosa_dos_ventos; - this.pnlOrientacaoGps.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.pnlOrientacaoGps.Location = new System.Drawing.Point(692, 2); - this.pnlOrientacaoGps.Margin = new System.Windows.Forms.Padding(2); - this.pnlOrientacaoGps.Name = "pnlOrientacaoGps"; - this.pnlOrientacaoGps.Size = new System.Drawing.Size(78, 84); - this.pnlOrientacaoGps.TabIndex = 13; - this.pnlOrientacaoGps.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlOrientacaoGps_Paint); + this.dgPontos.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.dgPontos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgPontos.Location = new System.Drawing.Point(12, 189); + this.dgPontos.Name = "dgPontos"; + this.dgPontos.Size = new System.Drawing.Size(683, 285); + this.dgPontos.TabIndex = 4; // - // lblStatusGPS + // btnNovaRua // - this.lblStatusGPS.AutoSize = true; - this.lblStatusGPS.Location = new System.Drawing.Point(11, 9); - this.lblStatusGPS.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.lblStatusGPS.Name = "lblStatusGPS"; - this.lblStatusGPS.Size = new System.Drawing.Size(292, 13); - this.lblStatusGPS.TabIndex = 3; - this.lblStatusGPS.Text = "GPS - Precisão: 9999 Coreção: SemCorrecao Satélites: 0"; + this.btnNovaRua.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnNovaRua.Location = new System.Drawing.Point(1058, 11); + this.btnNovaRua.Margin = new System.Windows.Forms.Padding(2); + this.btnNovaRua.Name = "btnNovaRua"; + this.btnNovaRua.Size = new System.Drawing.Size(100, 26); + this.btnNovaRua.TabIndex = 5; + this.btnNovaRua.Text = "Nova Rua"; + this.btnNovaRua.UseVisualStyleBackColor = true; + this.btnNovaRua.Click += new System.EventHandler(this.btnNovaRua_Click); + // + // lblRuaAtual + // + this.lblRuaAtual.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.lblRuaAtual.AutoSize = true; + this.lblRuaAtual.Location = new System.Drawing.Point(868, 18); + this.lblRuaAtual.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblRuaAtual.Name = "lblRuaAtual"; + this.lblRuaAtual.Size = new System.Drawing.Size(66, 13); + this.lblRuaAtual.TabIndex = 6; + this.lblRuaAtual.Text = "Rua Atual: 1"; + // + // txtDescricao + // + this.txtDescricao.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.txtDescricao.Location = new System.Drawing.Point(763, 15); + this.txtDescricao.Name = "txtDescricao"; + this.txtDescricao.Size = new System.Drawing.Size(100, 20); + this.txtDescricao.TabIndex = 7; + // + // dgRuas + // + this.dgRuas.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgRuas.Location = new System.Drawing.Point(12, 12); + this.dgRuas.Name = "dgRuas"; + this.dgRuas.Size = new System.Drawing.Size(683, 171); + this.dgRuas.TabIndex = 5; + this.dgRuas.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgRuas_CellDoubleClick); // // frmMapa // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(790, 525); - this.Controls.Add(this.lblStatusGPS); + this.ClientSize = new System.Drawing.Size(1476, 525); + this.Controls.Add(this.dgRuas); + this.Controls.Add(this.dgPontos); this.Controls.Add(this.pnlBotoes); this.Controls.Add(this.pnlMapa); - this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.Margin = new System.Windows.Forms.Padding(2); this.Name = "frmMapa"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Mapas"; @@ -151,8 +228,9 @@ namespace AgroBase.Forms this.pnlMapa.ResumeLayout(false); this.pnlBotoes.ResumeLayout(false); this.pnlBotoes.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgPontos)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgRuas)).EndInit(); this.ResumeLayout(false); - this.PerformLayout(); } @@ -161,10 +239,16 @@ namespace AgroBase.Forms private System.Windows.Forms.Panel pnlMapa; private System.Windows.Forms.Panel pnlBotoes; private System.Windows.Forms.Label lblMapa; - private System.Windows.Forms.Button btnCarregar; - private System.Windows.Forms.Button btnCalcularPontos; - private System.Windows.Forms.Button btnCalcular; + private System.Windows.Forms.Button btnCarregarMapa; + private System.Windows.Forms.Button btnRegistrarrPonto; + private System.Windows.Forms.Button btnLimpar; private System.Windows.Forms.Panel pnlOrientacaoGps; private System.Windows.Forms.Label lblStatusGPS; + private System.Windows.Forms.DataGridView dgPontos; + private System.Windows.Forms.Button btnGerarMapa; + private System.Windows.Forms.Button btnNovaRua; + private System.Windows.Forms.Label lblRuaAtual; + private System.Windows.Forms.TextBox txtDescricao; + private System.Windows.Forms.DataGridView dgRuas; } } \ No newline at end of file diff --git a/AgroBase/AgroBase/Forms/frmMapa.cs b/AgroBase/AgroBase/Forms/frmMapa.cs index 27e826dbc..40e3c465c 100644 --- a/AgroBase/AgroBase/Forms/frmMapa.cs +++ b/AgroBase/AgroBase/Forms/frmMapa.cs @@ -1,19 +1,10 @@ using AgroBase.Models; using AgroBase.Services; -using CefSharp.WinForms; -using Newtonsoft.Json; using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Drawing; -using System.IO; using System.Linq; -using System.Text; using System.Threading.Tasks; using System.Windows.Forms; -using static AgroBase.Models.Enums; namespace AgroBase.Forms { @@ -21,7 +12,8 @@ namespace AgroBase.Forms { private MapasModel Mapa; - List Pontos = new List(); + int idxRua = 0; + List> Pontos = new List>() { new List() }; AsyncTaskTimerModel tmrLeitura; public frmMapa() @@ -39,38 +31,94 @@ namespace AgroBase.Forms tmrLeitura = new AsyncTaskTimerModel("tmrLeitura", tmrLeitura_Tick, 500, this); tmrLeitura.Start(); + + + dgPontos.Columns.Clear(); + dgPontos.Columns.Add("clRua", "Rua"); + dgPontos.Columns.Add("clPonto", "Ponto"); + dgPontos.Columns.Add("clLatitude", "Latitude"); + dgPontos.Columns.Add("clLongitude", "Longitude"); + dgPontos.Columns.Add("clDistancia", "Distancia (m)"); + dgPontos.Columns.Add("clOrientacao", "Orientação (º)"); + dgPontos.Columns.Add("clSatelites", "N Satélites"); + dgPontos.Columns.Add("clCorrecao", "Correção"); + dgPontos.Columns.Add("clPrecisao", "Precisão (cm)"); + + dgRuas.Columns.Clear(); + dgRuas.Columns.Add("clRua", "Rua"); + dgRuas.Columns.Add("clPontos", "Pontos"); + dgRuas.Columns.Add("clDistancia", "Distância (m)"); + dgRuas.Columns.Add("clOrientacao", "Orientação (º)"); + + AtualizarGrid(); } - private void btnCarregar_Click(object sender, EventArgs e) + private void btnCarregarMapa_Click(object sender, EventArgs e) { Mapa.btnCarregar_Click(sender, e); } - private void btnCalcularPontos_Click(object sender, EventArgs e) + private void btnRegistrarPontos_Click(object sender, EventArgs e) { - GPSModel P1 = new GPSModel() + GPSModel P1 = GPSService.UltimaLeitura.Clone(); + + if (Pontos[idxRua].Count == 0) { - Latitude = GPSService.UltimaLeitura.Latitude, - Longitude = GPSService.UltimaLeitura.Longitude, - DataHora = DateTime.Now, - }; - Pontos.Add(P1); - MessageBox.Show("Ponto " + Pontos.Count() + " Registrado!"); + P1.Distancia = 0; + P1.OrientacaoMovimento = 0; + } + else + { + P1.Distancia = GPSUtils.DistanciaEntrePontos(Pontos[idxRua][Pontos[idxRua].Count - 1], P1); + P1.OrientacaoMovimento = GPSUtils.CalcularOrientacao(Pontos[idxRua][Pontos[idxRua].Count - 1], P1); + } + + P1.Altitude = idxRua + 1; + P1.VariacaoMagnetica = Pontos[idxRua].Count + 1; + + Pontos[idxRua].Add(P1); + + AtualizarGrid(); } - private void btnCalcular_Click(object sender, EventArgs e) + private void btnNovaRua_Click(object sender, EventArgs e) { - double distancia = GPSUtils.DistanciaDoTrecho(Pontos); - double orientacao = GPSUtils.CalcularOrientacao(Pontos[0], Pontos[Pontos.Count() - 1]); - MessageBox.Show("Distancia: " + distancia.ToString("0.00") + ", Orientacao: " + orientacao.ToString("0.00")); - - Pontos = new List(); + if (!Pontos.Any() || Pontos[idxRua].Count < 2) + { + MessageBox.Show("Selecione pelo menos 2 pontos para a rua " + (idxRua + 1)); + return; + } + Pontos.Add(new List()); + idxRua = Pontos.Count - 2; + AtualizarGrid(); } - private async Task tmrLeitura_Tick() + private void btnLimpar_Click(object sender, EventArgs e) { - pnlOrientacaoGps.Invalidate(); - lblStatusGPS.Text = $"GPS - Precisão: {GPSService.UltimaLeitura.PrecisaoCm} Coreção: {GPSService.UltimaLeitura.QualidadeFix} Satélites: {GPSService.UltimaLeitura.NumeroSatelites}"; + if (MessageBox.Show("Limpar pontos registrados?", "Limpar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + Pontos = new List>() { new List() }; + idxRua = 0; + + AtualizarGrid(); + } + } + + private void btnGerarMapa_Click(object sender, EventArgs e) + { + if (!Pontos.Any() || Pontos[idxRua].Count < 2) + { + MessageBox.Show("Selecione os pontos da rua " + (idxRua + 1) + " para gerar o mapa!"); + return; + } + if (txtDescricao.Text == "") + { + MessageBox.Show("Preencha o nome do arquivo de mapa!"); + txtDescricao.Focus(); + return; + } + MapasService.CriarArquivoMapa(Pontos, 1517, txtDescricao.Text, GPSUtils.DistanciaDoTrecho(Pontos[0])); + MessageBox.Show("Mapa gerado com sucesso!", "Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information); } private void pnlOrientacaoGps_Paint(object sender, PaintEventArgs e) @@ -84,5 +132,60 @@ namespace AgroBase.Forms catch { } } + private void AtualizarGrid() + { + dgPontos.Rows.Clear(); + foreach (var ponto in Pontos.SelectMany(x => x)) + { + dgPontos.Rows.Add(new string[] { + ponto.Altitude.ToString(), + ponto.VariacaoMagnetica.ToString(), + ponto.Latitude.ToString(), + ponto.Longitude.ToString(), + ponto.Distancia.ToString("0.00"), + ponto.OrientacaoMovimento.ToString("0.00"), + ponto.NumeroSatelites.ToString(), + ponto.QualidadeFix.ToString(), + ponto.PrecisaoCm.ToString("0.00") + }); + } + + dgRuas.Rows.Clear(); + foreach (var rua in Pontos) + { + int ruaAtual = Pontos.IndexOf(rua) + 1; + dgRuas.Rows.Add(new string[] { + ruaAtual.ToString(), + rua.Count().ToString(), + GPSUtils.DistanciaDoTrecho(rua).ToString("0.00"), + (rua.Count < 2 ? 0 : GPSUtils.CalcularOrientacao(rua[0], rua[rua.Count() - 1])).ToString("0.00") + }); + } + + lblRuaAtual.Text = "Rua Atual: " + (idxRua + 1).ToString(); + } + + private async Task tmrLeitura_Tick() + { + bool add = Pontos.Any(x => x?.Any() ?? false); + GPSModel ultimoPonto = new GPSModel(); + if (add) + { + ultimoPonto = Pontos[Pontos.Count - 1][Pontos[Pontos.Count - 1].Count - 1]; + } + + pnlOrientacaoGps.Invalidate(); + lblStatusGPS.Text = $"GPS - Precisão: {GPSService.UltimaLeitura.PrecisaoCm} cm, " + + $"Coreção: {GPSService.UltimaLeitura.QualidadeFix}, " + + $"Satélites: {GPSService.UltimaLeitura.NumeroSatelites}, " + + $"Distância: {(!add ? 0 : GPSUtils.DistanciaEntrePontos(ultimoPonto, GPSService.UltimaLeitura) ).ToString("0.00")} m, " + + $"Orientação: {(!add ? 0 : GPSUtils.CalcularOrientacao(ultimoPonto, GPSService.UltimaLeitura)).ToString("0.00")}º"; + } + + private void dgRuas_CellDoubleClick(object sender, DataGridViewCellEventArgs e) + { + idxRua = dgRuas.CurrentRow.Index; + AtualizarGrid(); + } } } diff --git a/AgroBase/AgroBase/bin/Debug/AgroBase.pdb b/AgroBase/AgroBase/bin/Debug/AgroBase.pdb index ecff29307..e0f4ba16a 100644 Binary files a/AgroBase/AgroBase/bin/Debug/AgroBase.pdb and b/AgroBase/AgroBase/bin/Debug/AgroBase.pdb differ diff --git a/AgroBase/AgroBase/bin/Debug/DawnCache/data_1 b/AgroBase/AgroBase/bin/Debug/DawnCache/data_1 index c23d126da..d0b7695e2 100644 Binary files a/AgroBase/AgroBase/bin/Debug/DawnCache/data_1 and b/AgroBase/AgroBase/bin/Debug/DawnCache/data_1 differ diff --git a/AgroBase/AgroBase/bin/Debug/GPUCache/data_1 b/AgroBase/AgroBase/bin/Debug/GPUCache/data_1 index ceafbcce6..f012121ea 100644 Binary files a/AgroBase/AgroBase/bin/Debug/GPUCache/data_1 and b/AgroBase/AgroBase/bin/Debug/GPUCache/data_1 differ diff --git a/AgroBase/AgroBase/bin/Debug/Python/Output/mapa_interativo.html b/AgroBase/AgroBase/bin/Debug/Python/Output/mapa_interativo.html index 1fdd37667..fdca534a4 100644 --- a/AgroBase/AgroBase/bin/Debug/Python/Output/mapa_interativo.html +++ b/AgroBase/AgroBase/bin/Debug/Python/Output/mapa_interativo.html @@ -25,7 +25,7 @@