iniciado tela de diagnosticos

This commit is contained in:
Diego Freitas 2024-07-16 17:04:09 -03:00
parent 7118c17bfe
commit 40abb022b9
71 changed files with 2500 additions and 891 deletions

Binary file not shown.

View File

@ -3,32 +3,24 @@
"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\\models\\modules\\movimentacaounificadomodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\models\\modules\\movimentacaounificadomodel.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\\ihm\\frmdiagnosticos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\ihm\\frmdiagnosticos.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\\models\\generaljoystick.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\models\\generaljoystick.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\\ihm\\frmdiagnosticos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\ihm\\frmdiagnosticos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|c:\\zendioninc\\agrobot_base\\agrobase\\agrobase\\models\\enuns.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\models\\enuns.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\\ihm\\frmihm.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\ihm\\frmihm.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\\services\\serialservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\services\\serialservice.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\\ihm\\frmajustes.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\ihm\\frmajustes.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\\services\\dispositivosservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\services\\dispositivosservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|c:\\zendioninc\\agrobot_base\\agrobase\\agrobase\\services\\filaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\services\\filaservice.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\\frmprincipal.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\frmprincipal.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\\ihm\\frmihm.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\ihm\\frmihm.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
@ -38,96 +30,68 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 6,
"SelectedChildIndex": 3,
"Children": [
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "Enuns.cs",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\Enuns.cs",
"RelativeDocumentMoniker": "AgroBase\\Models\\Enuns.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\Enuns.cs",
"RelativeToolTip": "AgroBase\\Models\\Enuns.cs",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAB4AAAATAAAA",
"DocumentIndex": 4,
"Title": "frmIHM.cs",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\IHM\\frmIHM.cs",
"RelativeDocumentMoniker": "AgroBase\\Forms\\IHM\\frmIHM.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\IHM\\frmIHM.cs",
"RelativeToolTip": "AgroBase\\Forms\\IHM\\frmIHM.cs",
"ViewState": "AQIAAA8AAAAAAAAAAAAAABcAAAAXAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-06-13T18:47:52.232Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "GeneralJoystick.cs",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\GeneralJoystick.cs",
"RelativeDocumentMoniker": "AgroBase\\Models\\GeneralJoystick.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\GeneralJoystick.cs",
"RelativeToolTip": "AgroBase\\Models\\GeneralJoystick.cs",
"ViewState": "AQIAACwCAAAAAAAAAAAYwE8CAACVAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-06-13T18:41:06.762Z",
"WhenOpened": "2024-07-16T18:11:05.21Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "SerialService.cs",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Services\\SerialService.cs",
"RelativeDocumentMoniker": "AgroBase\\Services\\SerialService.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Services\\SerialService.cs",
"RelativeToolTip": "AgroBase\\Services\\SerialService.cs",
"ViewState": "AQIAAC0AAAAAAAAAAAAQwEwAAAAYAAAA",
"Title": "frmAjustes.cs [Design]",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\IHM\\frmAjustes.cs",
"RelativeDocumentMoniker": "AgroBase\\Forms\\IHM\\frmAjustes.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\IHM\\frmAjustes.cs [Design]",
"RelativeToolTip": "AgroBase\\Forms\\IHM\\frmAjustes.cs [Design]",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-06-13T17:24:58.564Z",
"EditorCaption": ""
"WhenOpened": "2024-07-16T18:10:00.133Z",
"EditorCaption": " [Design]"
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "DispositivosService.cs",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Services\\DispositivosService.cs",
"RelativeDocumentMoniker": "AgroBase\\Services\\DispositivosService.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Services\\DispositivosService.cs",
"RelativeToolTip": "AgroBase\\Services\\DispositivosService.cs",
"ViewState": "AQIAABkAAAAAAAAAAAAgwCwAAAArAAAA",
"DocumentIndex": 2,
"Title": "frmIHM.cs [Design]",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\IHM\\frmIHM.cs",
"RelativeDocumentMoniker": "AgroBase\\Forms\\IHM\\frmIHM.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\IHM\\frmIHM.cs [Design]",
"RelativeToolTip": "AgroBase\\Forms\\IHM\\frmIHM.cs [Design]",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-06-13T16:57:41.713Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 5,
"Title": "FilaService.cs",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Services\\FilaService.cs",
"RelativeDocumentMoniker": "AgroBase\\Services\\FilaService.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Services\\FilaService.cs",
"RelativeToolTip": "AgroBase\\Services\\FilaService.cs",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAOAAAAABAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-06-11T17:06:06.589Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 6,
"Title": "frmPrincipal.cs",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmPrincipal.cs",
"RelativeDocumentMoniker": "AgroBase\\Forms\\frmPrincipal.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmPrincipal.cs",
"RelativeToolTip": "AgroBase\\Forms\\frmPrincipal.cs",
"ViewState": "AQIAADMAAAAAAAAAAAAqwFcAAAAJAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-06-11T17:04:24.362Z"
"WhenOpened": "2024-07-16T17:59:00.517Z",
"EditorCaption": " [Design]"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "MovimentacaoUnificadoModel.cs",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\Modules\\MovimentacaoUnificadoModel.cs",
"RelativeDocumentMoniker": "AgroBase\\Models\\Modules\\MovimentacaoUnificadoModel.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\Modules\\MovimentacaoUnificadoModel.cs",
"RelativeToolTip": "AgroBase\\Models\\Modules\\MovimentacaoUnificadoModel.cs",
"ViewState": "AQIAANcBAAAAAAAAAAAuwBsCAABUAAAA",
"Title": "frmDiagnosticos.cs [Design]",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\IHM\\frmDiagnosticos.cs",
"RelativeDocumentMoniker": "AgroBase\\Forms\\IHM\\frmDiagnosticos.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\IHM\\frmDiagnosticos.cs [Design]",
"RelativeToolTip": "AgroBase\\Forms\\IHM\\frmDiagnosticos.cs [Design]",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-06-06T18:02:19.931Z",
"WhenOpened": "2024-07-16T17:37:18.816Z",
"EditorCaption": " [Design]"
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "frmDiagnosticos.cs",
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\IHM\\frmDiagnosticos.cs",
"RelativeDocumentMoniker": "AgroBase\\Forms\\IHM\\frmDiagnosticos.cs",
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\IHM\\frmDiagnosticos.cs",
"RelativeToolTip": "AgroBase\\Forms\\IHM\\frmDiagnosticos.cs",
"ViewState": "AQIAAFIAAAAAAAAAAAAowHIAAABRAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-07-16T17:37:12.117Z",
"EditorCaption": ""
}
]

File diff suppressed because one or more lines are too long

View File

@ -271,6 +271,12 @@
<Compile Include="Forms\IHM\frmAjustes.Designer.cs">
<DependentUpon>frmAjustes.cs</DependentUpon>
</Compile>
<Compile Include="Forms\IHM\frmDiagnosticos.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\IHM\frmDiagnosticos.Designer.cs">
<DependentUpon>frmDiagnosticos.cs</DependentUpon>
</Compile>
<Compile Include="Forms\IHM\frmDialogoMapa.cs">
<SubType>Form</SubType>
</Compile>
@ -581,6 +587,9 @@
<Content Include="Python\Output\folium\leaflet.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Python\Scripts\map-follow.py">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Python\Scripts\pzem.py">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
@ -644,6 +653,9 @@
<EmbeddedResource Include="Forms\IHM\frmAjustes.resx">
<DependentUpon>frmAjustes.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\IHM\frmDiagnosticos.resx">
<DependentUpon>frmDiagnosticos.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\IHM\frmDialogoMapa.resx">
<DependentUpon>frmDialogoMapa.cs</DependentUpon>
</EmbeddedResource>

View File

@ -0,0 +1,291 @@
namespace AgroBase.Forms.IHM
{
partial class frmDiagnosticos
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPulverizador = new System.Windows.Forms.TabPage();
this.tabMovimentacao = new System.Windows.Forms.TabPage();
this.tabDirecional = new System.Windows.Forms.TabPage();
this.tabSensoriamento = new System.Windows.Forms.TabPage();
this.tabComunicacao = new System.Windows.Forms.TabPage();
this.tabCameras = new System.Windows.Forms.TabPage();
this.tabSinaleiros = new System.Windows.Forms.TabPage();
this.picVoltar = new System.Windows.Forms.PictureBox();
this.tabResultados = new System.Windows.Forms.TabPage();
this.picDiagnosticarTudo = new System.Windows.Forms.PictureBox();
this.dgPulverizador = new System.Windows.Forms.DataGridView();
this.picIniciarDiagnostico = new System.Windows.Forms.PictureBox();
this.dgMovimentacao = new System.Windows.Forms.DataGridView();
this.dgDirecional = new System.Windows.Forms.DataGridView();
this.dgSensoriamento = new System.Windows.Forms.DataGridView();
this.tabControl1.SuspendLayout();
this.tabPulverizador.SuspendLayout();
this.tabMovimentacao.SuspendLayout();
this.tabDirecional.SuspendLayout();
this.tabSensoriamento.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picVoltar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picDiagnosticarTudo)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgPulverizador)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picIniciarDiagnostico)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgMovimentacao)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgDirecional)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgSensoriamento)).BeginInit();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPulverizador);
this.tabControl1.Controls.Add(this.tabMovimentacao);
this.tabControl1.Controls.Add(this.tabDirecional);
this.tabControl1.Controls.Add(this.tabSensoriamento);
this.tabControl1.Controls.Add(this.tabComunicacao);
this.tabControl1.Controls.Add(this.tabCameras);
this.tabControl1.Controls.Add(this.tabSinaleiros);
this.tabControl1.Controls.Add(this.tabResultados);
this.tabControl1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.tabControl1.Location = new System.Drawing.Point(100, 12);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(688, 456);
this.tabControl1.TabIndex = 0;
//
// tabPulverizador
//
this.tabPulverizador.Controls.Add(this.dgPulverizador);
this.tabPulverizador.Location = new System.Drawing.Point(4, 34);
this.tabPulverizador.Name = "tabPulverizador";
this.tabPulverizador.Padding = new System.Windows.Forms.Padding(3);
this.tabPulverizador.Size = new System.Drawing.Size(680, 418);
this.tabPulverizador.TabIndex = 0;
this.tabPulverizador.Text = "Pulverizador";
this.tabPulverizador.UseVisualStyleBackColor = true;
//
// tabMovimentacao
//
this.tabMovimentacao.Controls.Add(this.dgMovimentacao);
this.tabMovimentacao.Location = new System.Drawing.Point(4, 34);
this.tabMovimentacao.Name = "tabMovimentacao";
this.tabMovimentacao.Padding = new System.Windows.Forms.Padding(3);
this.tabMovimentacao.Size = new System.Drawing.Size(680, 418);
this.tabMovimentacao.TabIndex = 1;
this.tabMovimentacao.Text = "Movimentação";
this.tabMovimentacao.UseVisualStyleBackColor = true;
//
// tabDirecional
//
this.tabDirecional.Controls.Add(this.dgDirecional);
this.tabDirecional.Location = new System.Drawing.Point(4, 34);
this.tabDirecional.Name = "tabDirecional";
this.tabDirecional.Padding = new System.Windows.Forms.Padding(3);
this.tabDirecional.Size = new System.Drawing.Size(680, 418);
this.tabDirecional.TabIndex = 2;
this.tabDirecional.Text = "Direcional";
this.tabDirecional.UseVisualStyleBackColor = true;
//
// tabSensoriamento
//
this.tabSensoriamento.Controls.Add(this.dgSensoriamento);
this.tabSensoriamento.Location = new System.Drawing.Point(4, 34);
this.tabSensoriamento.Name = "tabSensoriamento";
this.tabSensoriamento.Padding = new System.Windows.Forms.Padding(3);
this.tabSensoriamento.Size = new System.Drawing.Size(680, 418);
this.tabSensoriamento.TabIndex = 3;
this.tabSensoriamento.Text = "Sensoriamento";
this.tabSensoriamento.UseVisualStyleBackColor = true;
//
// tabComunicacao
//
this.tabComunicacao.Location = new System.Drawing.Point(4, 34);
this.tabComunicacao.Name = "tabComunicacao";
this.tabComunicacao.Padding = new System.Windows.Forms.Padding(3);
this.tabComunicacao.Size = new System.Drawing.Size(697, 418);
this.tabComunicacao.TabIndex = 4;
this.tabComunicacao.Text = "Comunicação";
this.tabComunicacao.UseVisualStyleBackColor = true;
//
// tabCameras
//
this.tabCameras.Location = new System.Drawing.Point(4, 34);
this.tabCameras.Name = "tabCameras";
this.tabCameras.Padding = new System.Windows.Forms.Padding(3);
this.tabCameras.Size = new System.Drawing.Size(697, 418);
this.tabCameras.TabIndex = 5;
this.tabCameras.Text = "Câmeras";
this.tabCameras.UseVisualStyleBackColor = true;
//
// tabSinaleiros
//
this.tabSinaleiros.Location = new System.Drawing.Point(4, 34);
this.tabSinaleiros.Name = "tabSinaleiros";
this.tabSinaleiros.Padding = new System.Windows.Forms.Padding(3);
this.tabSinaleiros.Size = new System.Drawing.Size(697, 418);
this.tabSinaleiros.TabIndex = 6;
this.tabSinaleiros.Text = "Sinaleiros";
this.tabSinaleiros.UseVisualStyleBackColor = true;
//
// picVoltar
//
this.picVoltar.Image = global::AgroBase.Properties.Resources.voltar;
this.picVoltar.Location = new System.Drawing.Point(12, 12);
this.picVoltar.Name = "picVoltar";
this.picVoltar.Size = new System.Drawing.Size(65, 65);
this.picVoltar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picVoltar.TabIndex = 12;
this.picVoltar.TabStop = false;
//
// tabResultados
//
this.tabResultados.Location = new System.Drawing.Point(4, 34);
this.tabResultados.Name = "tabResultados";
this.tabResultados.Padding = new System.Windows.Forms.Padding(3);
this.tabResultados.Size = new System.Drawing.Size(697, 418);
this.tabResultados.TabIndex = 7;
this.tabResultados.Text = "Resultados";
this.tabResultados.UseVisualStyleBackColor = true;
//
// picDiagnosticarTudo
//
this.picDiagnosticarTudo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.picDiagnosticarTudo.Image = global::AgroBase.Properties.Resources.diagnostico;
this.picDiagnosticarTudo.Location = new System.Drawing.Point(12, 399);
this.picDiagnosticarTudo.Name = "picDiagnosticarTudo";
this.picDiagnosticarTudo.Size = new System.Drawing.Size(65, 65);
this.picDiagnosticarTudo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picDiagnosticarTudo.TabIndex = 13;
this.picDiagnosticarTudo.TabStop = false;
//
// dgPulverizador
//
this.dgPulverizador.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgPulverizador.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgPulverizador.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
this.dgPulverizador.Location = new System.Drawing.Point(6, 6);
this.dgPulverizador.Name = "dgPulverizador";
this.dgPulverizador.Size = new System.Drawing.Size(668, 406);
this.dgPulverizador.TabIndex = 0;
//
// picIniciarDiagnostico
//
this.picIniciarDiagnostico.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.picIniciarDiagnostico.Image = global::AgroBase.Properties.Resources.iniciar;
this.picIniciarDiagnostico.Location = new System.Drawing.Point(12, 305);
this.picIniciarDiagnostico.Name = "picIniciarDiagnostico";
this.picIniciarDiagnostico.Size = new System.Drawing.Size(65, 65);
this.picIniciarDiagnostico.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picIniciarDiagnostico.TabIndex = 14;
this.picIniciarDiagnostico.TabStop = false;
//
// dgMovimentacao
//
this.dgMovimentacao.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgMovimentacao.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgMovimentacao.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
this.dgMovimentacao.Location = new System.Drawing.Point(6, 6);
this.dgMovimentacao.Name = "dgMovimentacao";
this.dgMovimentacao.Size = new System.Drawing.Size(668, 406);
this.dgMovimentacao.TabIndex = 1;
//
// dgDirecional
//
this.dgDirecional.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgDirecional.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgDirecional.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
this.dgDirecional.Location = new System.Drawing.Point(6, 6);
this.dgDirecional.Name = "dgDirecional";
this.dgDirecional.Size = new System.Drawing.Size(668, 406);
this.dgDirecional.TabIndex = 2;
//
// dgSensoriamento
//
this.dgSensoriamento.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgSensoriamento.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgSensoriamento.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
this.dgSensoriamento.Location = new System.Drawing.Point(6, 6);
this.dgSensoriamento.Name = "dgSensoriamento";
this.dgSensoriamento.Size = new System.Drawing.Size(668, 406);
this.dgSensoriamento.TabIndex = 3;
//
// frmDiagnosticos
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 480);
this.Controls.Add(this.picIniciarDiagnostico);
this.Controls.Add(this.picDiagnosticarTudo);
this.Controls.Add(this.picVoltar);
this.Controls.Add(this.tabControl1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "frmDiagnosticos";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Diagnósticos";
this.Load += new System.EventHandler(this.frmDiagnosticos_Load);
this.tabControl1.ResumeLayout(false);
this.tabPulverizador.ResumeLayout(false);
this.tabMovimentacao.ResumeLayout(false);
this.tabDirecional.ResumeLayout(false);
this.tabSensoriamento.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.picVoltar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picDiagnosticarTudo)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgPulverizador)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picIniciarDiagnostico)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgMovimentacao)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgDirecional)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgSensoriamento)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPulverizador;
private System.Windows.Forms.TabPage tabMovimentacao;
private System.Windows.Forms.TabPage tabDirecional;
private System.Windows.Forms.TabPage tabSensoriamento;
private System.Windows.Forms.TabPage tabComunicacao;
private System.Windows.Forms.TabPage tabCameras;
private System.Windows.Forms.TabPage tabSinaleiros;
private System.Windows.Forms.PictureBox picVoltar;
private System.Windows.Forms.TabPage tabResultados;
private System.Windows.Forms.PictureBox picDiagnosticarTudo;
private System.Windows.Forms.DataGridView dgPulverizador;
private System.Windows.Forms.PictureBox picIniciarDiagnostico;
private System.Windows.Forms.DataGridView dgMovimentacao;
private System.Windows.Forms.DataGridView dgDirecional;
private System.Windows.Forms.DataGridView dgSensoriamento;
}
}

View File

@ -0,0 +1,119 @@
using AgroBase.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
namespace AgroBase.Forms.IHM
{
public partial class frmDiagnosticos : Form
{
public frmDiagnosticos()
{
InitializeComponent();
FuncoesGlobais.DefinirEventosPicBtn(picVoltar, async () =>
{
this.Close();
});
FuncoesGlobais.DefinirEventosPicBtn(picDiagnosticarTudo, async () =>
{
if (MessageBox.Show("Iniciar o diagnóstico completo do equipamento?", "Iniciar Diagnóstico", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
}
});
FuncoesGlobais.DefinirEventosPicBtn(picIniciarDiagnostico, async () =>
{
string ModuloSelecionado = tabControl1.SelectedTab.Text;
if (MessageBox.Show("Iniciar o diagnóstico do módulo " + ModuloSelecionado + "?", "Iniciar Diagnóstico", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
}
});
}
private void frmDiagnosticos_Load(object sender, EventArgs e)
{
PreencherGridPulverizador(dgPulverizador);
PreencherGridMovimentacao(dgMovimentacao);
PreencherGridDirecional(dgDirecional);
PreencherGridSensoriamento(dgSensoriamento);
}
private void PreencheCabecalho(DataGridView grid)
{
grid.Columns.Clear();
grid.Rows.Clear();
grid.Columns.Add("clComponente", "Componente");
grid.Columns.Add("clTeste", "Teste");
grid.Columns.Add("clValorPadrao", "Valor Padrão");
grid.Columns.Add("clValorAferido", "Valor Aferido");
grid.Columns.Add("clResultado", "Resultado");
}
private void PreencherGridPulverizador(DataGridView grid)
{
PreencheCabecalho(grid);
grid.Rows.Add("Bomba Hidráulica", "Atuação", "> 50", "", "Pendente");
grid.Rows.Add("Sensor de Pressão", "Aferição", "> 85", "", "Pendente");
grid.Rows.Add("Sensor de Fluxo", "Aferição", "> 15", "", "Pendente");
grid.Rows.Add("Sensor de Massa", "Aferição", "> 0", "", "Pendente");
foreach (var Bico in Variaveis.OperacaoEmAndamento.DispAtu.Dados.BicosPulverizadores)
{
grid.Rows.Add("Bico Pulverizador " + Bico.ID, "Liga", "1", "", "Pendente");
grid.Rows.Add("Bico Pulverizador " + Bico.ID, "Desliga", "0", "", "Pendente");
}
}
private void PreencherGridMovimentacao(DataGridView grid)
{
PreencheCabecalho(grid);
foreach (var Modulo in Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos)
{
grid.Rows.Add(Modulo.Modulo_ID, "Para Frente", "> 10", "", "Pendente");
grid.Rows.Add(Modulo.Modulo_ID, "Para Trás", "> 10", "", "Pendente");
grid.Rows.Add(Modulo.Modulo_ID, "Tensão", "> 36", "", "Pendente");
grid.Rows.Add(Modulo.Modulo_ID, "Temperatura", "> 15", "", "Pendente");
grid.Rows.Add(Modulo.Modulo_ID, "Código Erro", "0", "", "Pendente");
}
}
private void PreencherGridDirecional(DataGridView grid)
{
PreencheCabecalho(grid);
foreach (var Modulo in Variaveis.OperacaoEmAndamento.DispMvd.Dados.Modulos)
{
grid.Rows.Add(Modulo.Modulo_ID, "Horário", "> 25", "", "Pendente");
grid.Rows.Add(Modulo.Modulo_ID, "Antihorário", "< -25", "", "Pendente");
grid.Rows.Add(Modulo.Modulo_ID, "Ponto Zero", "0", "", "Pendente");
grid.Rows.Add(Modulo.Modulo_ID, "Código Erro", "0", "", "Pendente");
}
}
private void PreencherGridSensoriamento(DataGridView grid)
{
PreencheCabecalho(grid);
grid.Rows.Add("Precisão GPS", "Aferição", "> 90", "", "Pendente");
grid.Rows.Add("Orientação", "Aferição", "~", "", "Pendente");
grid.Rows.Add("Tensão Bateria", "Aferição", "> 36", "", "Pendente");
grid.Rows.Add("Corrente Bateria", "Aferição", "> 2", "", "Pendente");
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -24,12 +24,6 @@ namespace AgroBase.Forms.IHM
public frmIHM()
{
InitializeComponent();
}
private void frmIHM_Load(object sender, EventArgs e)
{
tmrDispositivos.Tick += TmrDispositivos_Tick;
tmrDispositivos.Start();
FuncoesGlobais.DefinirEventosPicBtn(picOperacao, async () =>
{
@ -38,20 +32,9 @@ namespace AgroBase.Forms.IHM
});
FuncoesGlobais.DefinirEventosPicBtn(picDiagnosticos, async () =>
{
frmDiagnosticos frm = new frmDiagnosticos();
frm.ShowDialog();
});
/*FuncoesGlobais.DefinirEventosPicBtn(picComunicacao, async () =>
{
if (LoRaService.Iniciado)
{
frmLoraConfig frm = new frmLoraConfig(Variaveis.ConexaoLoRa);
frm.Show();
}
else
{
MessageBox.Show("Módulo LoRa de comunicação não está conectado ou não está no modo de parametrização!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
});*/
FuncoesGlobais.DefinirEventosPicBtn(picAjustes, async () =>
{
frmAjustes frm = new frmAjustes();
@ -61,11 +44,24 @@ namespace AgroBase.Forms.IHM
{
if (MessageBox.Show("Deseja desligar o equipamento?", "Desligar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
Process.Start("shutdown", "/s /t 0");
if (frmInstancial.DebugMode)
{
this.Close();
}
else
{
Process.Start("shutdown", "/s /t 0");
}
}
});
}
private void frmIHM_Load(object sender, EventArgs e)
{
tmrDispositivos.Tick += TmrDispositivos_Tick;
tmrDispositivos.Start();
}
private void TmrDispositivos_Tick(object sender, EventArgs e)
{
SerialService.RealizarVarreduraPortasUSB().ConfigureAwait(false);

View File

@ -531,7 +531,8 @@ namespace AgroBase.Forms.Operacoes
txtGPS_Satelites.Text = (Log?.NumeroSatelites ?? 0).ToString();
txtGPS_Velocidade.Text = (Log?.Velocidade ?? 0).ToString();
GPSService.EnviarCoordenadasParaMapa(Log?.Latitude ?? 0, Log?.Longitude ?? 0, Log?.Orientacao ?? 0);
int ID = Convert.ToInt32(Variaveis.IsAgroMonitor ? Variaveis.OperacaoEmAndamento.DispSen.Dados.LoRaParametrosBase.address : Variaveis.ConexaoLoRa.parametros.address);
GPSService.EnviarCoordenadasParaMapa(Log?.Latitude ?? 0, Log?.Longitude ?? 0, Log?.Orientacao ?? 0, true, ID);
pnlOrientacaoGPS.Invalidate();
}

View File

@ -73,7 +73,8 @@ namespace AgroBase.Forms
if (!GPSService.Iniciado)
{
GPSService.EnviarCoordenadasParaMapa(GPSService.UltimaLeitura.Latitude, GPSService.UltimaLeitura.Longitude, Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarro);
int ID = Convert.ToInt32(Variaveis.IsAgroMonitor ? Variaveis.OperacaoEmAndamento.DispSen.Dados.LoRaParametrosBase.address : Variaveis.ConexaoLoRa.parametros.address);
GPSService.EnviarCoordenadasParaMapa(GPSService.UltimaLeitura.Latitude, GPSService.UltimaLeitura.Longitude, Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarro, true, ID);
}
}

View File

@ -18,7 +18,7 @@ namespace AgroBase.Forms
{
public partial class frmInstancial : Form
{
public bool DebugMode = true;
public static bool DebugMode = true;
public static bool Fechando = false;

View File

@ -208,6 +208,7 @@ namespace AgroBase.Models
Parametrizacao = 0x00,
MensagemTexto = 0x01,
DadosOperacao = 0x02,
PosicaoGPS = 0x03,
}
}

View File

@ -297,10 +297,16 @@ namespace AgroBase.Models
}
}
public void btnCarregar_Click(object sender, EventArgs e, string caminhoArquivo = "")
public void btnCarregar_Click(object sender, EventArgs e, string caminhoArquivo = "", bool monitoramento = false)
{
mapaService.CarregarMapa(MapasVariaveisModel.NomeArquivoMapaInterativo, MapasVariaveisModel.NomeArquivoMapaInterativoSaida, caminhoArquivo);
if (monitoramento)
{
mapaService.CarregarMapaMonitoramento(MapasVariaveisModel.NomeArquivoMapaInterativo, MapasVariaveisModel.NomeArquivoMapaInterativoSaida, caminhoArquivo);
}
else
{
mapaService.CarregarMapa(MapasVariaveisModel.NomeArquivoMapaInterativo, MapasVariaveisModel.NomeArquivoMapaInterativoSaida, caminhoArquivo);
}
if (mapaService.MapaUrl != "")
{
if (picLoading == null)

View File

@ -141,6 +141,7 @@ namespace AgroBase.Models
public static double TempoManobra { get; set; } = 15;
public static double PercentualComErvas { get; set; } = 0.3;
public static double PercentualSemErvas { get; set; } = 0.7;
public static GPSModel PosicaoBase { get; set; } = new GPSModel();
}
public static class FuncoesGlobais

View File

@ -0,0 +1,235 @@
import geopandas as gpd
import json
import sys
import folium
import requests
import re
import shutil
def internet_disponivel():
"""Verifica se há conexão com a internet."""
url = 'http://www.google.com/'
timeout = 5
try:
_ = requests.get(url, timeout=timeout)
return True
except requests.ConnectionError:
return False
# Argumentos e configurações iniciais
pathFiles = sys.argv[1]
fileName = sys.argv[2]
outputName = sys.argv[3]
outputMapName = sys.argv[4]
topico_gps = sys.argv[5]
topico_ruas = sys.argv[6]
topico_trajeto_dinamico = sys.argv[7]
mapa_dados_json = sys.argv[8]
pastaSaida = 'Python/Output/'
if mapa_dados_json == "0":
# Carregar o arquivo shapefile contendo a geometria
input_shapefile = pathFiles + fileName + '.shp'
data_geometry = gpd.read_file(input_shapefile)
# Converter o GeoDataFrame para GeoJSON e adicionar ao mapa
geojson_data = data_geometry.to_json()
# Calcular os limites (bounds) da geometria
minx, miny, maxx, maxy = data_geometry.total_bounds
center = [(miny + maxy) / 2, (minx + maxx) / 2]
# Salvar GEOJson
data_geometry.to_file(pastaSaida + outputName, driver='GeoJSON')
else:
# Lendo os dados JSON
with open(pathFiles + fileName + '.json', 'r', encoding='utf-8-sig') as f:
geojson_data = json.load(f)
# Obter os limites (bounds) dos dados GeoJSON
bounds = folium.GeoJson(geojson_data).get_bounds()
center = [(bounds[0][0] + bounds[1][0]) / 2, (bounds[0][1] + bounds[1][1]) / 2]
# Adicionando um ID sequencial a cada Feature
for idx, feature in enumerate(geojson_data["features"]):
# Adicionar uma propriedade 'id' para cada Feature começando do índice zero
feature['id'] = idx
# Copiando o arquivo JSON para a pasta de saída
shutil.copy(pathFiles + fileName + '.json', pastaSaida + outputName)
# Verificar se há conexão com a internet
if internet_disponivel():
m = folium.Map(location=center, zoom_start=12)
else:
m = folium.Map(location=center, zoom_start=12, tiles=None)
folium.GeoJson(geojson_data).add_to(m)
# Salvar o mapa interativo em um arquivo HTML
m.save(pastaSaida + outputMapName)
# Caminho completo para o arquivo HTML gerado
caminho_completo_html = pastaSaida + outputMapName
# Abrir o arquivo HTML para leitura e escrita
with open(caminho_completo_html, 'r+') as arquivo_html:
# Ler o conteúdo do arquivo
conteudo_html = arquivo_html.read()
# Usar expressão regular para encontrar o ID do mapa
padrao_id_mapa = re.compile(r'id="map_(.*?)"')
resultado_busca = padrao_id_mapa.search(conteudo_html)
# Verificar se encontrou um ID de mapa
if resultado_busca:
id_mapa = 'map_' + resultado_busca.group(1)
else:
raise ValueError("Não foi possível encontrar o ID do mapa no arquivo HTML.")
# Script para desenhar o trajo percorrido no mapa
script_marcadores_dinamicos = f"""
<script src="folium/mqtt.min.js"></script>
<script src="folium/leaflet.rotatedMarker.js"></script>
<script>
var marcadores = {{}};
var trajetos = {{}};
function criarMarcador(id, coordenadas, orientacao) {{
var marcador;
if (id == 1) {{
marcador = L.marker(coordenadas, {{}}).addTo({id_mapa});
var icon = L.AwesomeMarkers.icon(
{{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}}
);
marcador.setIcon(icon);
}}
else {{
var customIcon = L.icon({{
iconUrl: 'folium/images/position_marker.png',
iconSize: [32, 32],
iconAnchor: [16, 16],
popupAnchor: [0, -16]
}});
marcador = L.marker(coordenadas, {{ icon: customIcon }}).addTo({id_mapa});
marcador.setRotationAngle(orientacao);
}}
var popup = L.popup({{"maxWidth": "100%"}});
var html = $(`<div id="html_${{id}}" style="width: 100.0%; height: 100.0%;">Endereco: ${{id}}</div>`)[0];
popup.setContent(html);
marcador.bindPopup(popup)
marcadores[id] = marcador;
}}
function criarTrajeto(id) {{
trajetos[id] = L.geoJson(null, {{
style: function(feature) {{
return {{ color: 'red' }};
}}
}}).addTo({id_mapa});
}}
function atualizarMarcador(id, coordenadas, orientacao) {{
var marcador = marcadores[id];
if (marcador) {{
marcador.setLatLng(coordenadas);
marcador.setRotationAngle(orientacao);
}}
}}
function atualizarTrajeto(id, coordenadas) {{
var trajeto = trajetos[id];
if (trajeto) {{
var feature = trajeto.toGeoJSON().features.find(f => f.id === id);
if (feature) {{
var ultima = [0.0, 0.0];
if (feature.geometry.coordinates.length > 0) {{
ultima = feature.geometry.coordinates[feature.geometry.coordinates.length - 1];
}}
if (!saoCoordenadasIguais(ultima, coordenadas, 0.000001)) {{
feature.geometry.coordinates.push(coordenadas);
trajeto.clearLayers();
trajeto.addData(feature);
}}
}}
}}
}}
function saoCoordenadasIguais(coord1, coord2, tolerancia) {{
return Math.abs(coord1[0] - coord2[0]) < tolerancia && Math.abs(coord1[1] - coord2[1]) < tolerancia;
}}
function adicionarDados(id, coordenadas, orientacao, foco) {{
if (!marcadores[id]) {{
criarMarcador(id, coordenadas, orientacao);
criarTrajeto(id);
trajetos[id].addData({{
"type": "Feature",
"geometry": {{
"type": "LineString",
"coordinates": []
}},
"properties": {{"Dist1": 0.0, "Dist2": 0.0, "Id": id, "Length": 0.0, "Name": "Trajeto"}},
"id": id
}});
}} else {{
atualizarMarcador(id, coordenadas, orientacao);
atualizarTrajeto(id, [coordenadas[1], coordenadas[0]]);
}}
if (foco) {{
{id_mapa}.setView(coordenadas, {id_mapa}.getZoom());
}}
}}
const client = mqtt.connect('ws://localhost:9001'); // Use wss para conexao segura
client.on('connect', function () {{
console.log('Conectado ao broker MQTT');
client.subscribe('{topico_gps}', function (err) {{
if (!err) {{
console.log("Inscricao bem-sucedida no topico");
}} else {{
console.error("Falha na inscricao do topico", err);
}}
}});
}});
client.on('message', function (topic, message) {{
var dados = JSON.parse(message);
if (topic === '{topico_gps}') {{
var id = dados.id;
var novaLatitude = dados.latitude;
var novaLongitude = dados.longitude;
var novaPosicao = [novaLatitude, novaLongitude];
var orientacao = dados.orientacao;
var foco = dados.foco;
adicionarDados(id, novaPosicao, orientacao, foco);
}}
}});
</script>
"""
# Importar arquivos localmente
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/', 'folium/')
conteudo_html = conteudo_html.replace('https://code.jquery.com/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/', 'folium/')
conteudo_html = conteudo_html.replace('https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.0/css/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/', 'folium/')
# Inserir o script no conteúdo HTML
conteudo_atualizado = conteudo_html.replace('</html>', script_marcadores_dinamicos + '</html>')
# Agora, reabrir o arquivo para escrita e sobrescrever o conteúdo com a versão atualizada
with open(caminho_completo_html, 'w') as arquivo_html:
arquivo_html.write(conteudo_atualizado)

View File

@ -538,7 +538,8 @@ namespace AgroBase.Services
public static void AtualizarCoordenadasGPS()
{
EnviarCoordenadasParaMapa(UltimaLeitura.Latitude, UltimaLeitura.Longitude, ((Variaveis.OperacaoEmAndamento.Sensoriamento?.AnguloCarro ?? 0) - 180));
int ID = Convert.ToInt32(Variaveis.IsAgroMonitor ? Variaveis.OperacaoEmAndamento.DispSen.Dados.LoRaParametrosBase.address : Variaveis.ConexaoLoRa.parametros.address);
EnviarCoordenadasParaMapa(UltimaLeitura.Latitude, UltimaLeitura.Longitude, ((Variaveis.OperacaoEmAndamento.Sensoriamento?.AnguloCarro ?? 0) - 180), true, ID);
if (Variaveis.OperacaoEmAndamento.Iniciado)
{
@ -574,14 +575,15 @@ namespace AgroBase.Services
}
}
public static void EnviarCoordenadasParaMapa(double Latitude, double Longitude, double Orientacao)
public static void EnviarCoordenadasParaMapa(double Latitude, double Longitude, double Orientacao, bool EmFoco, int ID)
{
var Coordenadas = new
{
latitude = Latitude,
longitude = Longitude,
orientacao = Orientacao,
id = Convert.ToInt32(Variaveis.IsAgroMonitor ? Variaveis.OperacaoEmAndamento.DispSen.Dados.LoRaParametrosBase.address : Variaveis.ConexaoLoRa.parametros.address)
id = ID,
foco = EmFoco
};
Variaveis.MqttService.PublishAsync(
Variaveis.MqttService.Topicos.First(x => x.Topico == MapasVariaveisModel.TopicoCoordenadasGPS),

View File

@ -115,5 +115,45 @@ namespace AgroBase.Services
return model;
}
public static byte[] SerializeGPSModel(byte Endereco, GPSModel model)
{
List<byte> bytes = new List<byte>();
// Serializar Momento (DateTime)
bytes.AddRange(BitConverter.GetBytes(model.Momento.ToBinary()));
// Serializar EnderecoCarro (byte)
bytes.Add(Endereco);
// Serializar Coordenadas (LoRaProtocoloTransmissaoCoordenadasModel)
bytes.AddRange(BitConverter.GetBytes(model.Latitude));
bytes.AddRange(BitConverter.GetBytes(model.Longitude));
bytes.AddRange(BitConverter.GetBytes(model.Orientacao));
return bytes.ToArray();
}
public static (byte, GPSModel) DeserializeGPSModel(byte[] bytes)
{
GPSModel model = new GPSModel();
int index = 0;
// Desserializar Momento (DateTime)
model.Momento = DateTime.FromBinary(BitConverter.ToInt64(bytes, index));
index += sizeof(long);
// Desserializar EnderecoCarro (byte)
byte Endereco = bytes[index];
index += sizeof(byte);
// Desserializar Coordenadas (LoRaProtocoloTransmissaoCoordenadasModel)
model.Latitude = BitConverter.ToDouble(bytes, index);
model.Longitude = BitConverter.ToDouble(bytes, index + sizeof(double));
model.Orientacao = BitConverter.ToDouble(bytes, index + 2 * sizeof(double));
return (Endereco, model);
}
}
}

View File

@ -429,12 +429,22 @@ namespace AgroBase.Services
case LoRaTipoProtocolo.DadosOperacao:
{
byte[] bufferDados = new byte[resposta.Buffer.Length - 4];
Console.WriteLine("Recebendo log via LoRa... " + bufferDados.Length + " bytes");
Array.Copy(resposta.Buffer, 4, bufferDados, 0, bufferDados.Length);
LoRaProtocoloTransmissaoModel Dados = LoRaSerializer.DeserializeLoRaProtocoloTransmissaoModel(bufferDados);
LeituraDadosOperacao.Add(Dados);
break;
}
case LoRaTipoProtocolo.PosicaoGPS:
{
byte[] bufferDados = new byte[resposta.Buffer.Length - 4];
Array.Copy(resposta.Buffer, 4, bufferDados, 0, bufferDados.Length);
(byte Endereco, GPSModel Posicao) = LoRaSerializer.DeserializeGPSModel(bufferDados);
if (Endereco == Variaveis.OperacaoEmAndamento.DispSen.Dados.LoRaParametrosBase.address)
{
VariaveisOperacao.PosicaoBase = Posicao;
}
break;
}
}
}
@ -775,6 +785,16 @@ namespace AgroBase.Services
}
}
public static void EnviarDadosPosicao(byte EnderecoRemetente, byte EnderecoDestinatario)
{
if (Iniciado && Variaveis.IsAgroMonitor)
{
byte[] dadosEnvio = LoRaSerializer.SerializeGPSModel(EnderecoRemetente, GPSService.UltimaLeitura);
MontarMensagemEnvio(dadosEnvio, EnderecoDestinatario, LoRaTipoProtocolo.PosicaoGPS, true);
}
}
}

View File

@ -72,6 +72,42 @@ namespace AgroBase.Services
}
}
public void CarregarMapaMonitoramento(string nomeArquivoMapa, string nomeArquivoSaida, string caminhoArquivo = "")
{
NomeArquivoMapa = nomeArquivoMapa;
ArquivoSaida = nomeArquivoSaida;
opfMapa = new OpenFileDialog
{
DefaultExt = ".shp",
Filter = "Shapefile (*.shp)|*.shp|JSON Files (*.json)|*.json",
Title = "Selecionar arquivo de mapa"
};
if (!string.IsNullOrEmpty(caminhoArquivo) || opfMapa.ShowDialog() == DialogResult.OK)
{
caminhoArquivo = string.IsNullOrEmpty(caminhoArquivo) ? opfMapa.FileName : caminhoArquivo;
string extensao = "." + caminhoArquivo.Split('.')[caminhoArquivo.Split('.').Length - 1];
NomeArquivos = caminhoArquivo.Split('\\')[caminhoArquivo.Split('\\').Length - 1].Replace(extensao, "");
CaminhoMapa = caminhoArquivo.Replace(NomeArquivos, "").Replace(extensao, "").Replace("\\", "/");
pythonProcess = PythonService.RunScript(PythonService.ScriptMapFollower, new string[]
{
CaminhoMapa,
NomeArquivos,
ArquivoSaida,
NomeArquivoMapa,
MapasVariaveisModel.TopicoCoordenadasGPS,
MapasVariaveisModel.TopicoSelecaoRuasMapa,
MapasVariaveisModel.TopicoTrajetoriaDinamica,
caminhoArquivo.Split('.')[1] == "json" ? "1" : "0"
});
MapaUrl = new Uri(CaminhoSaida + NomeArquivoMapa).AbsoluteUri;
CaminhoDadosMapa = CaminhoSaida + ArquivoSaida;
}
}
public void CarregarMapaGPS(string nomeArquivoMapa)
{
NomeArquivoMapa = nomeArquivoMapa;

View File

@ -19,6 +19,7 @@ namespace AgroBase.Services
public static string ScriptGreenDetector = "green-detector.py";
public static string ScriptStreetDetector = "street-detector.py";
public static string ScriptMapConverter = "map-load.py";
public static string ScriptMapFollower = "map-follow.py";
public static string ScriptLineAngle = "line-angle2.py";
public static string ScriptMapGPS = "gps-viewer.py";

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -69,41 +69,13 @@
tile_layer_eaee1d1720b584ca7e1d5153ee999b8c.addTo(map_9483db57aca52339fbb12d0797720dd8);
var trajetosSelecionados = {};
var RuasSelecionadas = [];
function enviarSelecaoParaServidor() {
client.publish("selecao_ruas_mapa", JSON.stringify(RuasSelecionadas), function (err) {
/*if (!err) {
console.log("Mensagem publicada com sucesso");
} else {
console.error("Falha ao publicar mensagem", err);
}*/
});
}
function geo_json_a4d4e644e3bfa4703ba740c32f8243fb_onEachFeature(feature, layer) {
layer.on({
click: function(e) {
// Verificar se o trajeto ja esta selecionado
if (trajetosSelecionados[feature.id]) {
// Se ja esta selecionado, reverta para a cor original e remova da selecao
e.target.setStyle({
color: '#3388ff' // Cor original
});
delete trajetosSelecionados[feature.id];
RuasSelecionadas.splice(RuasSelecionadas.indexOf(feature.id), 1);
} else {
// Se nao esta selecionado, mude a cor para indicar selecao e adicione ao objeto de selecao
e.target.setStyle({
color: 'blue' // Cor de selecao
});
trajetosSelecionados[feature.id] = true;
RuasSelecionadas.push(feature.id);
}
enviarSelecaoParaServidor();
}/*, mouseover: function(e) {
},
mouseover: function(e) {
// Mostrar tooltip com o ID da geometria quando o mouse passar sobre a linha
var tooltip = L.tooltip({
direction: 'auto', // Leaflet determina a melhor posicao
@ -115,7 +87,7 @@
var latLng = e.latlng;
tooltip.setLatLng(latLng);
layer.bindTooltip(tooltip).openTooltip(latLng);
}*/
}
});
};
var geo_json_a4d4e644e3bfa4703ba740c32f8243fb = L.geoJson(null, {
@ -127,7 +99,7 @@
geo_json_a4d4e644e3bfa4703ba740c32f8243fb
.addData(data);
}
geo_json_a4d4e644e3bfa4703ba740c32f8243fb_add({"features": [{"geometry": {"coordinates": [[-47.19774285726267, -22.07749281377239], [-47.19768293088881, -22.0774805271304], [-47.19759543090566, -22.077462587055873], [-47.197507930940425, -22.077444646932662], [-47.19742043099309, -22.0774267067607], [-47.19733293106367, -22.077408766540014], [-47.19724543115216, -22.0773908262706], [-47.19715793125859, -22.077372885952467], [-47.1970704313829, -22.077354945585615], [-47.19698293152512, -22.077337005170033], [-47.19689543168528, -22.07731906470573], [-47.19680793186334, -22.077301124192708], [-47.196720432059315, -22.077283183630975], [-47.196632932273204, -22.077265243020502], [-47.196545432505005, -22.07724730236131], [-47.19645793275472, -22.077229361653394], [-47.19637043302235, -22.077211420896752], [-47.19628293330789, -22.077193480091395], [-47.196195433611365, -22.077175539237324], [-47.19610793393272, -22.077157598334523], [-47.19602043427201, -22.077139657383004], [-47.19593293462923, -22.077121716382738], [-47.19584543500434, -22.077103775333782], [-47.19575793539737, -22.07708583423609], [-47.19567043580832, -22.077067893089676], [-47.19558293623719, -22.077049951894537], [-47.19549543668397, -22.077032010650683], [-47.19540793714869, -22.077014069358103], [-47.195320437631295, -22.07699612801682], [-47.195232938131824, -22.076978186626807], [-47.19514543865027, -22.07696024518807], [-47.19505793918664, -22.07694230370061], [-47.19497043974093, -22.076924362164426], [-47.19488294031313, -22.076906420579526], [-47.19479544090325, -22.076888478945907], [-47.19470794151129, -22.076870537263577], [-47.19462044213724, -22.076852595532525], [-47.19453294278113, -22.076834653752726], [-47.19444544344292, -22.076816711924245], [-47.19435794412263, -22.076798770047027], [-47.19429795311945, -22.076786468764478]], "id": "0", "type": "LineString"}, "id": 0, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "1517", "Length": 364.122430372, "Name": "Curvas"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.19554116539534, -22.078719292053304], [-47.19546767417662, -22.07870422337033], [-47.195442805154286, -22.078699124202906]], "id": "223", "type": "LineString"}, "id": 223, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "1517", "Length": 10.396452589, "Name": "Curvas"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.195512980813604, -22.07872738005577], [-47.19547733357063, -22.078720070922746]], "id": "224", "type": "LineString"}, "id": 224, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "1517", "Length": 3.767831676, "Name": "Curvas"}, "type": "Feature"}], "type": "FeatureCollection"});
geo_json_a4d4e644e3bfa4703ba740c32f8243fb_add({"features": [{"geometry": {"coordinates": [[-47.195512980813604, -22.07872738005577], [-47.19547733357063, -22.078720070922746]], "id": "224", "type": "LineString"}, "id": 224, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "1517", "Length": 3.767831676, "Name": "Curvas"}, "type": "Feature"}], "type": "FeatureCollection"});
@ -177,7 +149,7 @@
}
} else {
console.log("Feature com ID " + idGeometria + " n<EFBFBD>o encontrada.");
console.log("Feature com ID " + idGeometria + " nao encontrada.");
}
}
@ -193,54 +165,6 @@
</script>
<script>
function trajeto_dinamico_json_onEachFeature(feature, layer) {
layer.on({
});
};
var trajeto_dinamico_json = L.geoJson(null, {
onEachFeature: trajeto_dinamico_json_onEachFeature,
style: function(feature) {
return {color: 'green'};
}
}
);
function trajeto_dinamico_json_add (data) {
trajeto_dinamico_json.addData(data);
}
trajeto_dinamico_json_add({"features": []});
trajeto_dinamico_json.addTo(map_9483db57aca52339fbb12d0797720dd8);
function adicionarGeometriaDinamica(novaGeometria) {
trajeto_dinamico_json.addData(novaGeometria);
}
function adicionarCoordenadaDinamica(idGeometria, coordenadas) {
var feature = trajeto_dinamico_json.toGeoJSON().features.find(f => f.id === idGeometria);
if (feature) {
feature.geometry.coordinates = [];
coordenadas.forEach(x => feature.geometry.coordinates.push([x.longitude, x.latitude]));
var ft = feature;
trajeto_dinamico_json.clearLayers();
trajeto_dinamico_json.addData(ft);
} else {
console.log("Feature com ID " + idGeometria + " nao encontrada.");
}
}
adicionarGeometriaDinamica({
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": []
},
"properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": 1517, "Length": 21.724783283, "Name": "Projeto"},
"id": "TjD"
});
</script>
<script src="folium/mqtt.min.js"></script>
<script src="folium/leaflet.rotatedMarker.js"></script>
<script>
@ -275,29 +199,12 @@
console.error("Falha na inscricao do topico", err);
}
});
client.subscribe('trajetoria_dinamica', function (err) {
if (!err) {
console.log("Inscricao bem-sucedida no topico");
} else {
console.error("Falha na inscricao do topico", err);
}
});
client.subscribe('selecao_ruas_mapa', function (err) {
if (!err) {
console.log("Inscricao bem-sucedida no topico");
} else {
console.error("Falha na inscricao do topico", err);
}
});
});
// Lidar com mensagens recebidas para o topico inscrito
client.on('message', function (topic, message) {
var dados = JSON.parse(message);
if (topic === "trajetoria_dinamica") {
adicionarCoordenadaDinamica("TjD", dados); // "Tj" e o ID da feature no GeoJSON
}
else if (topic === "coordenadas_gps") {
if (topic === "coordenadas_gps") {
// A mensagem e um Buffer, converta para string ou objeto conforme necessario
//console.log(`Mensagem recebida no topico '${topic}': ${message.toString()}`);
var novaLatitude = dados.latitude;
@ -317,49 +224,9 @@
adicionarCoordenada("Tj", [novaLongitude, novaLatitude]);
map_9483db57aca52339fbb12d0797720dd8.setView(novaPosicao, map_9483db57aca52339fbb12d0797720dd8.getZoom());
}
else if (topic === 'selecao_ruas_mapa') {
var selecionadas = dados;
atualizarSelecaoRuas(selecionadas);
}
});
// Funcao para atualizar a selecao das ruas e mudar a cor no mapa
function atualizarSelecaoRuas(selecionadas) {
selecionadas = JSON.parse(selecionadas);
RuasSelecionadas = Array.isArray(selecionadas) ? [...selecionadas] : [];
geo_json_a4d4e644e3bfa4703ba740c32f8243fb.eachLayer(function (layer) {
if (RuasSelecionadas.includes(parseInt(layer.feature.id))) {
layer.setStyle({ color: 'blue' });
} else {
layer.setStyle({ color: '#3388ff' }); // Cor original
}
});
}
function calcularOrientacao(P1latitude, P1longitude, P2latitude, P2longitude) {
// Converter latitudes e longitudes de graus para radianos
const latA = P1latitude * (Math.PI / 180.0);
const lonA = P1longitude * (Math.PI / 180.0);
const latB = P2latitude * (Math.PI / 180.0);
const lonB = P2longitude * (Math.PI / 180.0);
// Calcular a diferenca de longitude
const deltaLon = lonB - lonA;
// Calcular a direcao
const y = Math.sin(deltaLon) * Math.cos(latB);
const x = Math.cos(latA) * Math.sin(latB) - Math.sin(latA) * Math.cos(latB) * Math.cos(deltaLon);
const direcaoRadianos = Math.atan2(y, x);
// Converter a direcao de radianos para graus
let direcaoGraus = direcaoRadianos * (180.0 / Math.PI);
// Normalizar a direcao para que esteja no intervalo de 0 a 360 graus
direcaoGraus = (direcaoGraus + 360) % 360;
return direcaoGraus;
}
</script>
</html>

View File

@ -0,0 +1,217 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script>
L_NO_TOUCH = false;
L_DISABLE_3D = false;
</script>
<style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>
<style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>
<script src="folium/leaflet.js"></script>
<script src="folium/jquery-3.7.1.min.js"></script>
<script src="folium/bootstrap.bundle.min.js"></script>
<script src="folium/leaflet.awesome-markers.js"></script>
<link rel="stylesheet" href="folium/leaflet.css"/>
<link rel="stylesheet" href="folium/bootstrap.min.css"/>
<link rel="stylesheet" href="folium/all.min.css"/>
<link rel="stylesheet" href="folium/leaflet.awesome-markers.css"/>
<link rel="stylesheet" href="folium/leaflet.awesome.rotate.min.css"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
#map_9483db57aca52339fbb12d0797720dd8 {
position: relative;
width: 100.0%;
height: 100.0%;
left: 0.0%;
top: 0.0%;
}
.leaflet-container { font-size: 1rem; }
</style>
</head>
<body>
<div class="folium-map" id="map_9483db57aca52339fbb12d0797720dd8"></div>
</body>
<script src="folium/mqtt.min.js"></script>
<script src="folium/leaflet.rotatedMarker.js"></script>
<script>
var map_9483db57aca52339fbb12d0797720dd8 = L.map("map_9483db57aca52339fbb12d0797720dd8", {
center: [-22.07700866624257, -47.19598995141658],
crs: L.CRS.EPSG3857,
zoom: 12,
zoomControl: true,
preferCanvas: false,
});
var tile_layer_eaee1d1720b584ca7e1d5153ee999b8c = L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png", {
"attribution": "\u0026copy; \u003ca href=\"https://www.openstreetmap.org/copyright\"\u003eOpenStreetMap\u003c/a\u003e contributors",
"detectRetina": false,
"maxNativeZoom": 19,
"maxZoom": 19,
"minZoom": 0,
"noWrap": false,
"opacity": 1,
"subdomains": "abc",
"tms": false
});
tile_layer_eaee1d1720b584ca7e1d5153ee999b8c.addTo(map_9483db57aca52339fbb12d0797720dd8);
function geo_json_a4d4e644e3bfa4703ba740c32f8243fb_onEachFeature(feature, layer) {
layer.on({
click: function(e) {
},
mouseover: function(e) {
// Mostrar tooltip com o ID da geometria quando o mouse passar sobre a linha
var tooltip = L.tooltip({
direction: 'auto', // Leaflet determina a melhor posicao
sticky: true // Faz com que o tooltip siga o cursor do mouse
})
.setContent('Rua ' + feature.id); // Define o conteudo do tooltip
// Abre o tooltip na posicao atual do mouse
var latLng = e.latlng;
tooltip.setLatLng(latLng);
layer.bindTooltip(tooltip).openTooltip(latLng);
}
});
};
var geo_json_a4d4e644e3bfa4703ba740c32f8243fb = L.geoJson(null, {
onEachFeature: geo_json_a4d4e644e3bfa4703ba740c32f8243fb_onEachFeature,
});
function geo_json_a4d4e644e3bfa4703ba740c32f8243fb_add (data) {
geo_json_a4d4e644e3bfa4703ba740c32f8243fb
.addData(data);
}
geo_json_a4d4e644e3bfa4703ba740c32f8243fb_add({"features": [{"geometry": {"coordinates": [[-47.195512980813604, -22.07872738005577], [-47.19547733357063, -22.078720070922746]], "id": "224", "type": "LineString"}, "id": 224, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "1517", "Length": 3.767831676, "Name": "Curvas"}, "type": "Feature"}], "type": "FeatureCollection"});
geo_json_a4d4e644e3bfa4703ba740c32f8243fb.addTo(map_9483db57aca52339fbb12d0797720dd8);
var marcadores = {};
var trajetos = {};
function criarMarcador(id, coordenadas, orientacao) {
var marcador;
if (id == 1) {
//marcador = L.marker(coordenadas).addTo(map_9483db57aca52339fbb12d0797720dd8);
marcador = L.marker(coordenadas, {}).addTo(map_9483db57aca52339fbb12d0797720dd8);
var icon = L.AwesomeMarkers.icon(
{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}
);
marcador.setIcon(icon);
}
else {
var customIcon = L.icon({
iconUrl: 'folium/images/position_marker.png',
iconSize: [32, 32],
iconAnchor: [16, 16],
popupAnchor: [0, -16]
});
marcador = L.marker(coordenadas, { icon: customIcon }).addTo(map_9483db57aca52339fbb12d0797720dd8);
marcador.setRotationAngle(orientacao);
}
var popup = L.popup({"maxWidth": "100%"});
var html = $(`<div id="html_${id}" style="width: 100.0%; height: 100.0%;">Endereço: ${id}</div>`)[0];
popup.setContent(html);
marcador.bindPopup(popup)
marcadores[id] = marcador;
}
function criarTrajeto(id) {
trajetos[id] = L.geoJson(null, {
style: function(feature) {
return { color: 'red' };
}
}).addTo(map_9483db57aca52339fbb12d0797720dd8);
}
function atualizarMarcador(id, coordenadas, orientacao) {
var marcador = marcadores[id];
if (marcador) {
marcador.setLatLng(coordenadas);
marcador.setRotationAngle(orientacao);
}
}
function atualizarTrajeto(id, coordenadas) {
var trajeto = trajetos[id];
if (trajeto) {
var feature = trajeto.toGeoJSON().features.find(f => f.id === id);
if (feature) {
var ultima = [0.0, 0.0];
if (feature.geometry.coordinates.length > 0) {
ultima = feature.geometry.coordinates[feature.geometry.coordinates.length - 1];
}
if (!saoCoordenadasIguais(ultima, coordenadas, 0.000001)) {
feature.geometry.coordinates.push(coordenadas);
trajeto.clearLayers();
trajeto.addData(feature);
}
}
}
}
function saoCoordenadasIguais(coord1, coord2, tolerancia) {
return Math.abs(coord1[0] - coord2[0]) < tolerancia && Math.abs(coord1[1] - coord2[1]) < tolerancia;
}
function adicionarDados(id, coordenadas, orientacao, foco) {
if (!marcadores[id]) {
criarMarcador(id, coordenadas, orientacao);
criarTrajeto(id);
trajetos[id].addData({
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": []
},
"properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": id, "Length": 0.0, "Name": "Trajeto"},
"id": id
});
} else {
atualizarMarcador(id, coordenadas, orientacao);
atualizarTrajeto(id, [coordenadas[1], coordenadas[0]]);
}
if (foco) {
map_9483db57aca52339fbb12d0797720dd8.setView(coordenadas, map_9483db57aca52339fbb12d0797720dd8.getZoom());
}
}
const client = mqtt.connect('ws://localhost:9001'); // Use wss para conexao segura
client.on('connect', function () {
console.log('Conectado ao broker MQTT');
client.subscribe('coordenadas_gps', function (err) {
if (!err) {
console.log("Inscricao bem-sucedida no topico");
} else {
console.error("Falha na inscricao do topico", err);
}
});
});
client.on('message', function (topic, message) {
var dados = JSON.parse(message);
if (topic === "coordenadas_gps") {
var id = dados.id;
var novaLatitude = dados.latitude;
var novaLongitude = dados.longitude;
var novaPosicao = [novaLatitude, novaLongitude];
var orientacao = dados.orientacao;
var foco = dados.foco;
adicionarDados(id, novaPosicao, orientacao, foco);
}
});
</script>
</html>

View File

@ -0,0 +1,235 @@
import geopandas as gpd
import json
import sys
import folium
import requests
import re
import shutil
def internet_disponivel():
"""Verifica se há conexão com a internet."""
url = 'http://www.google.com/'
timeout = 5
try:
_ = requests.get(url, timeout=timeout)
return True
except requests.ConnectionError:
return False
# Argumentos e configurações iniciais
pathFiles = sys.argv[1]
fileName = sys.argv[2]
outputName = sys.argv[3]
outputMapName = sys.argv[4]
topico_gps = sys.argv[5]
topico_ruas = sys.argv[6]
topico_trajeto_dinamico = sys.argv[7]
mapa_dados_json = sys.argv[8]
pastaSaida = 'Python/Output/'
if mapa_dados_json == "0":
# Carregar o arquivo shapefile contendo a geometria
input_shapefile = pathFiles + fileName + '.shp'
data_geometry = gpd.read_file(input_shapefile)
# Converter o GeoDataFrame para GeoJSON e adicionar ao mapa
geojson_data = data_geometry.to_json()
# Calcular os limites (bounds) da geometria
minx, miny, maxx, maxy = data_geometry.total_bounds
center = [(miny + maxy) / 2, (minx + maxx) / 2]
# Salvar GEOJson
data_geometry.to_file(pastaSaida + outputName, driver='GeoJSON')
else:
# Lendo os dados JSON
with open(pathFiles + fileName + '.json', 'r', encoding='utf-8-sig') as f:
geojson_data = json.load(f)
# Obter os limites (bounds) dos dados GeoJSON
bounds = folium.GeoJson(geojson_data).get_bounds()
center = [(bounds[0][0] + bounds[1][0]) / 2, (bounds[0][1] + bounds[1][1]) / 2]
# Adicionando um ID sequencial a cada Feature
for idx, feature in enumerate(geojson_data["features"]):
# Adicionar uma propriedade 'id' para cada Feature começando do índice zero
feature['id'] = idx
# Copiando o arquivo JSON para a pasta de saída
shutil.copy(pathFiles + fileName + '.json', pastaSaida + outputName)
# Verificar se há conexão com a internet
if internet_disponivel():
m = folium.Map(location=center, zoom_start=12)
else:
m = folium.Map(location=center, zoom_start=12, tiles=None)
folium.GeoJson(geojson_data).add_to(m)
# Salvar o mapa interativo em um arquivo HTML
m.save(pastaSaida + outputMapName)
# Caminho completo para o arquivo HTML gerado
caminho_completo_html = pastaSaida + outputMapName
# Abrir o arquivo HTML para leitura e escrita
with open(caminho_completo_html, 'r+') as arquivo_html:
# Ler o conteúdo do arquivo
conteudo_html = arquivo_html.read()
# Usar expressão regular para encontrar o ID do mapa
padrao_id_mapa = re.compile(r'id="map_(.*?)"')
resultado_busca = padrao_id_mapa.search(conteudo_html)
# Verificar se encontrou um ID de mapa
if resultado_busca:
id_mapa = 'map_' + resultado_busca.group(1)
else:
raise ValueError("Não foi possível encontrar o ID do mapa no arquivo HTML.")
# Script para desenhar o trajo percorrido no mapa
script_marcadores_dinamicos = f"""
<script src="folium/mqtt.min.js"></script>
<script src="folium/leaflet.rotatedMarker.js"></script>
<script>
var marcadores = {{}};
var trajetos = {{}};
function criarMarcador(id, coordenadas, orientacao) {{
var marcador;
if (id == 1) {{
marcador = L.marker(coordenadas, {{}}).addTo({id_mapa});
var icon = L.AwesomeMarkers.icon(
{{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}}
);
marcador.setIcon(icon);
}}
else {{
var customIcon = L.icon({{
iconUrl: 'folium/images/position_marker.png',
iconSize: [32, 32],
iconAnchor: [16, 16],
popupAnchor: [0, -16]
}});
marcador = L.marker(coordenadas, {{ icon: customIcon }}).addTo({id_mapa});
marcador.setRotationAngle(orientacao);
}}
var popup = L.popup({{"maxWidth": "100%"}});
var html = $(`<div id="html_${{id}}" style="width: 100.0%; height: 100.0%;">Endereco: ${{id}}</div>`)[0];
popup.setContent(html);
marcador.bindPopup(popup)
marcadores[id] = marcador;
}}
function criarTrajeto(id) {{
trajetos[id] = L.geoJson(null, {{
style: function(feature) {{
return {{ color: 'red' }};
}}
}}).addTo({id_mapa});
}}
function atualizarMarcador(id, coordenadas, orientacao) {{
var marcador = marcadores[id];
if (marcador) {{
marcador.setLatLng(coordenadas);
marcador.setRotationAngle(orientacao);
}}
}}
function atualizarTrajeto(id, coordenadas) {{
var trajeto = trajetos[id];
if (trajeto) {{
var feature = trajeto.toGeoJSON().features.find(f => f.id === id);
if (feature) {{
var ultima = [0.0, 0.0];
if (feature.geometry.coordinates.length > 0) {{
ultima = feature.geometry.coordinates[feature.geometry.coordinates.length - 1];
}}
if (!saoCoordenadasIguais(ultima, coordenadas, 0.000001)) {{
feature.geometry.coordinates.push(coordenadas);
trajeto.clearLayers();
trajeto.addData(feature);
}}
}}
}}
}}
function saoCoordenadasIguais(coord1, coord2, tolerancia) {{
return Math.abs(coord1[0] - coord2[0]) < tolerancia && Math.abs(coord1[1] - coord2[1]) < tolerancia;
}}
function adicionarDados(id, coordenadas, orientacao, foco) {{
if (!marcadores[id]) {{
criarMarcador(id, coordenadas, orientacao);
criarTrajeto(id);
trajetos[id].addData({{
"type": "Feature",
"geometry": {{
"type": "LineString",
"coordinates": []
}},
"properties": {{"Dist1": 0.0, "Dist2": 0.0, "Id": id, "Length": 0.0, "Name": "Trajeto"}},
"id": id
}});
}} else {{
atualizarMarcador(id, coordenadas, orientacao);
atualizarTrajeto(id, [coordenadas[1], coordenadas[0]]);
}}
if (foco) {{
{id_mapa}.setView(coordenadas, {id_mapa}.getZoom());
}}
}}
const client = mqtt.connect('ws://localhost:9001'); // Use wss para conexao segura
client.on('connect', function () {{
console.log('Conectado ao broker MQTT');
client.subscribe('{topico_gps}', function (err) {{
if (!err) {{
console.log("Inscricao bem-sucedida no topico");
}} else {{
console.error("Falha na inscricao do topico", err);
}}
}});
}});
client.on('message', function (topic, message) {{
var dados = JSON.parse(message);
if (topic === '{topico_gps}') {{
var id = dados.id;
var novaLatitude = dados.latitude;
var novaLongitude = dados.longitude;
var novaPosicao = [novaLatitude, novaLongitude];
var orientacao = dados.orientacao;
var foco = dados.foco;
adicionarDados(id, novaPosicao, orientacao, foco);
}}
}});
</script>
"""
# Importar arquivos localmente
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/', 'folium/')
conteudo_html = conteudo_html.replace('https://code.jquery.com/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/', 'folium/')
conteudo_html = conteudo_html.replace('https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.0/css/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/', 'folium/')
# Inserir o script no conteúdo HTML
conteudo_atualizado = conteudo_html.replace('</html>', script_marcadores_dinamicos + '</html>')
# Agora, reabrir o arquivo para escrita e sobrescrever o conteúdo com a versão atualizada
with open(caminho_completo_html, 'w') as arquivo_html:
arquivo_html.write(conteudo_atualizado)

View File

@ -1 +1 @@
0c695cd57cad231400810d60deb1c8f75621a0ff4e838c8ff79a964355874c9c
ac062275567cd9a86db8371b4a772de2c1d73d8e4e0725f27a4ebb96a196467f

View File

@ -448,7 +448,10 @@ C:\ZendionINC\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.pdb
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmWT901C.resources
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmBLD.resources
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmMvdConfig.resources
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.csproj.CopyComplete
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmMKS.resources
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.IHM.frmDialogoMapa.resources
C:\ZendionInc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.IHM.frmAjustes.resources
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\bin\Debug\Microsoft.Kinect.dll
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.csproj.Up2Date
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\bin\Debug\Python\Scripts\map-follow.py
C:\ZendionINC\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.IHM.frmDiagnosticos.resources

File diff suppressed because one or more lines are too long

View File

@ -35,44 +35,48 @@
this.txtLatitude = new System.Windows.Forms.TextBox();
this.txtLongitude = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel();
this.txtLeitura = new System.Windows.Forms.TextBox();
this.lblLeitura = new System.Windows.Forms.Label();
this.txtOrientacao = new System.Windows.Forms.TextBox();
this.lblOrientacao = new System.Windows.Forms.Label();
this.pgbBateria = new System.Windows.Forms.ProgressBar();
this.lblBateria = new System.Windows.Forms.Label();
this.lblReservatorio = new System.Windows.Forms.Label();
this.pgbReservatorio = new System.Windows.Forms.ProgressBar();
this.lblBateriaDados = new System.Windows.Forms.Label();
this.lblReservatorioDados = new System.Windows.Forms.Label();
this.lblTemperaturaMotoresDados = new System.Windows.Forms.Label();
this.lblTemperaturaMotores = new System.Windows.Forms.Label();
this.pgbTemperaturaMotores = new System.Windows.Forms.ProgressBar();
this.lblTemperaturaCampoDados = new System.Windows.Forms.Label();
this.lblTemperaturaCampo = new System.Windows.Forms.Label();
this.pgbTemperaturaCampo = new System.Windows.Forms.ProgressBar();
this.lblPressaoDados = new System.Windows.Forms.Label();
this.lblPressao = new System.Windows.Forms.Label();
this.pgbPressao = new System.Windows.Forms.ProgressBar();
this.lblHerbicidaDados = new System.Windows.Forms.Label();
this.lblHerbicida = new System.Windows.Forms.Label();
this.pgbHerbicidaAplicado = new System.Windows.Forms.ProgressBar();
this.lblVelocidadeDados = new System.Windows.Forms.Label();
this.lblVelocidade = new System.Windows.Forms.Label();
this.pgbVelocidade = new System.Windows.Forms.ProgressBar();
this.lblErvasIdentificadas = new System.Windows.Forms.Label();
this.txtStatusCarro = new System.Windows.Forms.TextBox();
this.lblStatusCarro = new System.Windows.Forms.Label();
this.lblStatusOperacao = new System.Windows.Forms.Label();
this.txtStatusOperacao = new System.Windows.Forms.TextBox();
this.lblProgressoOperacao = new System.Windows.Forms.Label();
this.pgbProgressoOperacao = new System.Windows.Forms.ProgressBar();
this.lblProgressoRua = new System.Windows.Forms.Label();
this.pgbProgressoRua = new System.Windows.Forms.ProgressBar();
this.txtTempoEstimado = new System.Windows.Forms.TextBox();
this.lblTempoEstimado = new System.Windows.Forms.Label();
this.lblTempoDecorrido = new System.Windows.Forms.Label();
this.txtTempoDecorrido = new System.Windows.Forms.TextBox();
this.lblProgressoRua = new System.Windows.Forms.Label();
this.pgbProgressoRua = new System.Windows.Forms.ProgressBar();
this.lblProgressoOperacao = new System.Windows.Forms.Label();
this.pgbProgressoOperacao = new System.Windows.Forms.ProgressBar();
this.txtStatusCarro = new System.Windows.Forms.TextBox();
this.lblStatusCarro = new System.Windows.Forms.Label();
this.lblStatusOperacao = new System.Windows.Forms.Label();
this.txtStatusOperacao = new System.Windows.Forms.TextBox();
this.lblErvasIdentificadas = new System.Windows.Forms.Label();
this.lblVelocidadeDados = new System.Windows.Forms.Label();
this.lblVelocidade = new System.Windows.Forms.Label();
this.pgbVelocidade = new System.Windows.Forms.ProgressBar();
this.lblHerbicidaDados = new System.Windows.Forms.Label();
this.lblHerbicida = new System.Windows.Forms.Label();
this.pgbHerbicidaAplicado = new System.Windows.Forms.ProgressBar();
this.lblPressaoDados = new System.Windows.Forms.Label();
this.lblPressao = new System.Windows.Forms.Label();
this.pgbPressao = new System.Windows.Forms.ProgressBar();
this.lblTemperaturaCampoDados = new System.Windows.Forms.Label();
this.lblTemperaturaCampo = new System.Windows.Forms.Label();
this.pgbTemperaturaCampo = new System.Windows.Forms.ProgressBar();
this.lblTemperaturaMotoresDados = new System.Windows.Forms.Label();
this.lblTemperaturaMotores = new System.Windows.Forms.Label();
this.pgbTemperaturaMotores = new System.Windows.Forms.ProgressBar();
this.lblReservatorioDados = new System.Windows.Forms.Label();
this.lblBateriaDados = new System.Windows.Forms.Label();
this.lblReservatorio = new System.Windows.Forms.Label();
this.pgbReservatorio = new System.Windows.Forms.ProgressBar();
this.lblBateria = new System.Windows.Forms.Label();
this.pgbBateria = new System.Windows.Forms.ProgressBar();
this.txtOrientacao = new System.Windows.Forms.TextBox();
this.lblOrientacao = new System.Windows.Forms.Label();
this.lblLeitura = new System.Windows.Forms.Label();
this.txtLeitura = new System.Windows.Forms.TextBox();
this.chbFoco = new System.Windows.Forms.CheckBox();
this.pnlMapa = new System.Windows.Forms.Panel();
this.lblMapa = new System.Windows.Forms.Label();
this.btnCarregar = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
@ -101,7 +105,7 @@
//
this.lblLatitude.AutoSize = true;
this.lblLatitude.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblLatitude.Location = new System.Drawing.Point(6, 88);
this.lblLatitude.Location = new System.Drawing.Point(6, 113);
this.lblLatitude.Name = "lblLatitude";
this.lblLatitude.Size = new System.Drawing.Size(59, 17);
this.lblLatitude.TabIndex = 2;
@ -111,7 +115,7 @@
//
this.lblLongitude.AutoSize = true;
this.lblLongitude.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblLongitude.Location = new System.Drawing.Point(111, 88);
this.lblLongitude.Location = new System.Drawing.Point(111, 113);
this.lblLongitude.Name = "lblLongitude";
this.lblLongitude.Size = new System.Drawing.Size(71, 17);
this.lblLongitude.TabIndex = 3;
@ -119,7 +123,7 @@
//
// txtLatitude
//
this.txtLatitude.Location = new System.Drawing.Point(5, 108);
this.txtLatitude.Location = new System.Drawing.Point(5, 133);
this.txtLatitude.Name = "txtLatitude";
this.txtLatitude.ReadOnly = true;
this.txtLatitude.Size = new System.Drawing.Size(100, 20);
@ -128,7 +132,7 @@
//
// txtLongitude
//
this.txtLongitude.Location = new System.Drawing.Point(113, 108);
this.txtLongitude.Location = new System.Drawing.Point(113, 133);
this.txtLongitude.Name = "txtLongitude";
this.txtLongitude.ReadOnly = true;
this.txtLongitude.Size = new System.Drawing.Size(100, 20);
@ -138,6 +142,7 @@
// panel1
//
this.panel1.AutoScroll = true;
this.panel1.Controls.Add(this.chbFoco);
this.panel1.Controls.Add(this.txtTempoEstimado);
this.panel1.Controls.Add(this.lblTempoEstimado);
this.panel1.Controls.Add(this.lblTempoDecorrido);
@ -185,326 +190,12 @@
this.panel1.Dock = System.Windows.Forms.DockStyle.Right;
this.panel1.Location = new System.Drawing.Point(787, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(239, 566);
this.panel1.Size = new System.Drawing.Size(239, 594);
this.panel1.TabIndex = 6;
//
// txtLeitura
//
this.txtLeitura.Location = new System.Drawing.Point(5, 65);
this.txtLeitura.Name = "txtLeitura";
this.txtLeitura.ReadOnly = true;
this.txtLeitura.Size = new System.Drawing.Size(100, 20);
this.txtLeitura.TabIndex = 6;
this.txtLeitura.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblLeitura
//
this.lblLeitura.AutoSize = true;
this.lblLeitura.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblLeitura.Location = new System.Drawing.Point(6, 45);
this.lblLeitura.Name = "lblLeitura";
this.lblLeitura.Size = new System.Drawing.Size(52, 17);
this.lblLeitura.TabIndex = 7;
this.lblLeitura.Text = "Leitura";
//
// txtOrientacao
//
this.txtOrientacao.Location = new System.Drawing.Point(113, 65);
this.txtOrientacao.Name = "txtOrientacao";
this.txtOrientacao.ReadOnly = true;
this.txtOrientacao.Size = new System.Drawing.Size(100, 20);
this.txtOrientacao.TabIndex = 9;
this.txtOrientacao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblOrientacao
//
this.lblOrientacao.AutoSize = true;
this.lblOrientacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblOrientacao.Location = new System.Drawing.Point(111, 45);
this.lblOrientacao.Name = "lblOrientacao";
this.lblOrientacao.Size = new System.Drawing.Size(78, 17);
this.lblOrientacao.TabIndex = 8;
this.lblOrientacao.Text = "Orientação";
//
// pgbBateria
//
this.pgbBateria.Location = new System.Drawing.Point(5, 280);
this.pgbBateria.Name = "pgbBateria";
this.pgbBateria.Size = new System.Drawing.Size(100, 20);
this.pgbBateria.TabIndex = 10;
//
// lblBateria
//
this.lblBateria.AutoSize = true;
this.lblBateria.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblBateria.Location = new System.Drawing.Point(6, 260);
this.lblBateria.Name = "lblBateria";
this.lblBateria.Size = new System.Drawing.Size(53, 17);
this.lblBateria.TabIndex = 11;
this.lblBateria.Text = "Bateria";
//
// lblReservatorio
//
this.lblReservatorio.AutoSize = true;
this.lblReservatorio.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblReservatorio.Location = new System.Drawing.Point(6, 303);
this.lblReservatorio.Name = "lblReservatorio";
this.lblReservatorio.Size = new System.Drawing.Size(153, 17);
this.lblReservatorio.TabIndex = 13;
this.lblReservatorio.Text = "Reservatório Herbicida";
//
// pgbReservatorio
//
this.pgbReservatorio.Location = new System.Drawing.Point(5, 323);
this.pgbReservatorio.Maximum = 35;
this.pgbReservatorio.Name = "pgbReservatorio";
this.pgbReservatorio.Size = new System.Drawing.Size(100, 20);
this.pgbReservatorio.TabIndex = 12;
//
// lblBateriaDados
//
this.lblBateriaDados.AutoSize = true;
this.lblBateriaDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblBateriaDados.Location = new System.Drawing.Point(111, 283);
this.lblBateriaDados.Name = "lblBateriaDados";
this.lblBateriaDados.Size = new System.Drawing.Size(98, 13);
this.lblBateriaDados.TabIndex = 14;
this.lblBateriaDados.Text = "42,3V 5,2A 100,0%";
//
// lblReservatorioDados
//
this.lblReservatorioDados.AutoSize = true;
this.lblReservatorioDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblReservatorioDados.Location = new System.Drawing.Point(111, 326);
this.lblReservatorioDados.Name = "lblReservatorioDados";
this.lblReservatorioDados.Size = new System.Drawing.Size(75, 13);
this.lblReservatorioDados.TabIndex = 15;
this.lblReservatorioDados.Text = "28,5 L 100,0%";
//
// lblTemperaturaMotoresDados
//
this.lblTemperaturaMotoresDados.AutoSize = true;
this.lblTemperaturaMotoresDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblTemperaturaMotoresDados.Location = new System.Drawing.Point(111, 455);
this.lblTemperaturaMotoresDados.Name = "lblTemperaturaMotoresDados";
this.lblTemperaturaMotoresDados.Size = new System.Drawing.Size(42, 13);
this.lblTemperaturaMotoresDados.TabIndex = 21;
this.lblTemperaturaMotoresDados.Text = "57,5 ºC";
//
// lblTemperaturaMotores
//
this.lblTemperaturaMotores.AutoSize = true;
this.lblTemperaturaMotores.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblTemperaturaMotores.Location = new System.Drawing.Point(6, 432);
this.lblTemperaturaMotores.Name = "lblTemperaturaMotores";
this.lblTemperaturaMotores.Size = new System.Drawing.Size(145, 17);
this.lblTemperaturaMotores.TabIndex = 20;
this.lblTemperaturaMotores.Text = "Temperatura Motores";
//
// pgbTemperaturaMotores
//
this.pgbTemperaturaMotores.Location = new System.Drawing.Point(5, 452);
this.pgbTemperaturaMotores.Maximum = 200;
this.pgbTemperaturaMotores.Name = "pgbTemperaturaMotores";
this.pgbTemperaturaMotores.Size = new System.Drawing.Size(100, 20);
this.pgbTemperaturaMotores.TabIndex = 19;
//
// lblTemperaturaCampoDados
//
this.lblTemperaturaCampoDados.AutoSize = true;
this.lblTemperaturaCampoDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblTemperaturaCampoDados.Location = new System.Drawing.Point(111, 498);
this.lblTemperaturaCampoDados.Name = "lblTemperaturaCampoDados";
this.lblTemperaturaCampoDados.Size = new System.Drawing.Size(42, 13);
this.lblTemperaturaCampoDados.TabIndex = 24;
this.lblTemperaturaCampoDados.Text = "38,7 ºC";
//
// lblTemperaturaCampo
//
this.lblTemperaturaCampo.AutoSize = true;
this.lblTemperaturaCampo.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblTemperaturaCampo.Location = new System.Drawing.Point(6, 475);
this.lblTemperaturaCampo.Name = "lblTemperaturaCampo";
this.lblTemperaturaCampo.Size = new System.Drawing.Size(138, 17);
this.lblTemperaturaCampo.TabIndex = 23;
this.lblTemperaturaCampo.Text = "Temperatura Campo";
//
// pgbTemperaturaCampo
//
this.pgbTemperaturaCampo.Location = new System.Drawing.Point(5, 495);
this.pgbTemperaturaCampo.Name = "pgbTemperaturaCampo";
this.pgbTemperaturaCampo.Size = new System.Drawing.Size(100, 20);
this.pgbTemperaturaCampo.TabIndex = 22;
//
// lblPressaoDados
//
this.lblPressaoDados.AutoSize = true;
this.lblPressaoDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblPressaoDados.Location = new System.Drawing.Point(111, 412);
this.lblPressaoDados.Name = "lblPressaoDados";
this.lblPressaoDados.Size = new System.Drawing.Size(44, 13);
this.lblPressaoDados.TabIndex = 27;
this.lblPressaoDados.Text = "86,3 psi";
//
// lblPressao
//
this.lblPressao.AutoSize = true;
this.lblPressao.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblPressao.Location = new System.Drawing.Point(6, 389);
this.lblPressao.Name = "lblPressao";
this.lblPressao.Size = new System.Drawing.Size(119, 17);
this.lblPressao.TabIndex = 26;
this.lblPressao.Text = "Pressão da Linha";
//
// pgbPressao
//
this.pgbPressao.Location = new System.Drawing.Point(5, 409);
this.pgbPressao.Maximum = 150;
this.pgbPressao.Name = "pgbPressao";
this.pgbPressao.Size = new System.Drawing.Size(100, 20);
this.pgbPressao.TabIndex = 25;
//
// lblHerbicidaDados
//
this.lblHerbicidaDados.AutoSize = true;
this.lblHerbicidaDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblHerbicidaDados.Location = new System.Drawing.Point(111, 369);
this.lblHerbicidaDados.Name = "lblHerbicidaDados";
this.lblHerbicidaDados.Size = new System.Drawing.Size(100, 13);
this.lblHerbicidaDados.TabIndex = 30;
this.lblHerbicidaDados.Text = "2,3 L (35,9 ml/erva)";
//
// lblHerbicida
//
this.lblHerbicida.AutoSize = true;
this.lblHerbicida.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblHerbicida.Location = new System.Drawing.Point(6, 346);
this.lblHerbicida.Name = "lblHerbicida";
this.lblHerbicida.Size = new System.Drawing.Size(126, 17);
this.lblHerbicida.TabIndex = 29;
this.lblHerbicida.Text = "Herbicida Aplicado";
//
// pgbHerbicidaAplicado
//
this.pgbHerbicidaAplicado.Location = new System.Drawing.Point(5, 366);
this.pgbHerbicidaAplicado.Maximum = 35;
this.pgbHerbicidaAplicado.Name = "pgbHerbicidaAplicado";
this.pgbHerbicidaAplicado.Size = new System.Drawing.Size(100, 20);
this.pgbHerbicidaAplicado.TabIndex = 28;
//
// lblVelocidadeDados
//
this.lblVelocidadeDados.AutoSize = true;
this.lblVelocidadeDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblVelocidadeDados.Location = new System.Drawing.Point(111, 541);
this.lblVelocidadeDados.Name = "lblVelocidadeDados";
this.lblVelocidadeDados.Size = new System.Drawing.Size(82, 13);
this.lblVelocidadeDados.TabIndex = 33;
this.lblVelocidadeDados.Text = "5,3 km/h 85,3%";
//
// lblVelocidade
//
this.lblVelocidade.AutoSize = true;
this.lblVelocidade.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblVelocidade.Location = new System.Drawing.Point(6, 518);
this.lblVelocidade.Name = "lblVelocidade";
this.lblVelocidade.Size = new System.Drawing.Size(78, 17);
this.lblVelocidade.TabIndex = 32;
this.lblVelocidade.Text = "Velocidade";
//
// pgbVelocidade
//
this.pgbVelocidade.Location = new System.Drawing.Point(5, 538);
this.pgbVelocidade.Maximum = 20;
this.pgbVelocidade.Name = "pgbVelocidade";
this.pgbVelocidade.Size = new System.Drawing.Size(100, 20);
this.pgbVelocidade.TabIndex = 31;
//
// lblErvasIdentificadas
//
this.lblErvasIdentificadas.AutoSize = true;
this.lblErvasIdentificadas.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblErvasIdentificadas.Location = new System.Drawing.Point(152, 356);
this.lblErvasIdentificadas.Name = "lblErvasIdentificadas";
this.lblErvasIdentificadas.Size = new System.Drawing.Size(54, 13);
this.lblErvasIdentificadas.TabIndex = 34;
this.lblErvasIdentificadas.Text = "154 ervas";
//
// txtStatusCarro
//
this.txtStatusCarro.Location = new System.Drawing.Point(113, 151);
this.txtStatusCarro.Name = "txtStatusCarro";
this.txtStatusCarro.ReadOnly = true;
this.txtStatusCarro.Size = new System.Drawing.Size(100, 20);
this.txtStatusCarro.TabIndex = 38;
this.txtStatusCarro.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblStatusCarro
//
this.lblStatusCarro.AutoSize = true;
this.lblStatusCarro.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblStatusCarro.Location = new System.Drawing.Point(111, 131);
this.lblStatusCarro.Name = "lblStatusCarro";
this.lblStatusCarro.Size = new System.Drawing.Size(43, 17);
this.lblStatusCarro.TabIndex = 37;
this.lblStatusCarro.Text = "Carro";
//
// lblStatusOperacao
//
this.lblStatusOperacao.AutoSize = true;
this.lblStatusOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblStatusOperacao.Location = new System.Drawing.Point(6, 131);
this.lblStatusOperacao.Name = "lblStatusOperacao";
this.lblStatusOperacao.Size = new System.Drawing.Size(71, 17);
this.lblStatusOperacao.TabIndex = 36;
this.lblStatusOperacao.Text = "Operação";
//
// txtStatusOperacao
//
this.txtStatusOperacao.Location = new System.Drawing.Point(5, 151);
this.txtStatusOperacao.Name = "txtStatusOperacao";
this.txtStatusOperacao.ReadOnly = true;
this.txtStatusOperacao.Size = new System.Drawing.Size(100, 20);
this.txtStatusOperacao.TabIndex = 35;
this.txtStatusOperacao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblProgressoOperacao
//
this.lblProgressoOperacao.AutoSize = true;
this.lblProgressoOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblProgressoOperacao.Location = new System.Drawing.Point(6, 217);
this.lblProgressoOperacao.Name = "lblProgressoOperacao";
this.lblProgressoOperacao.Size = new System.Drawing.Size(87, 17);
this.lblProgressoOperacao.TabIndex = 40;
this.lblProgressoOperacao.Text = "% Operação";
//
// pgbProgressoOperacao
//
this.pgbProgressoOperacao.Location = new System.Drawing.Point(5, 237);
this.pgbProgressoOperacao.Name = "pgbProgressoOperacao";
this.pgbProgressoOperacao.Size = new System.Drawing.Size(100, 20);
this.pgbProgressoOperacao.TabIndex = 39;
//
// lblProgressoRua
//
this.lblProgressoRua.AutoSize = true;
this.lblProgressoRua.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblProgressoRua.Location = new System.Drawing.Point(112, 217);
this.lblProgressoRua.Name = "lblProgressoRua";
this.lblProgressoRua.Size = new System.Drawing.Size(50, 17);
this.lblProgressoRua.TabIndex = 42;
this.lblProgressoRua.Text = "% Rua";
//
// pgbProgressoRua
//
this.pgbProgressoRua.Location = new System.Drawing.Point(111, 237);
this.pgbProgressoRua.Name = "pgbProgressoRua";
this.pgbProgressoRua.Size = new System.Drawing.Size(100, 20);
this.pgbProgressoRua.TabIndex = 41;
//
// txtTempoEstimado
//
this.txtTempoEstimado.Location = new System.Drawing.Point(113, 194);
this.txtTempoEstimado.Location = new System.Drawing.Point(113, 219);
this.txtTempoEstimado.Name = "txtTempoEstimado";
this.txtTempoEstimado.ReadOnly = true;
this.txtTempoEstimado.Size = new System.Drawing.Size(100, 20);
@ -515,7 +206,7 @@
//
this.lblTempoEstimado.AutoSize = true;
this.lblTempoEstimado.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblTempoEstimado.Location = new System.Drawing.Point(111, 174);
this.lblTempoEstimado.Location = new System.Drawing.Point(111, 199);
this.lblTempoEstimado.Name = "lblTempoEstimado";
this.lblTempoEstimado.Size = new System.Drawing.Size(66, 17);
this.lblTempoEstimado.TabIndex = 45;
@ -525,7 +216,7 @@
//
this.lblTempoDecorrido.AutoSize = true;
this.lblTempoDecorrido.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblTempoDecorrido.Location = new System.Drawing.Point(6, 174);
this.lblTempoDecorrido.Location = new System.Drawing.Point(6, 199);
this.lblTempoDecorrido.Name = "lblTempoDecorrido";
this.lblTempoDecorrido.Size = new System.Drawing.Size(70, 17);
this.lblTempoDecorrido.TabIndex = 44;
@ -533,18 +224,379 @@
//
// txtTempoDecorrido
//
this.txtTempoDecorrido.Location = new System.Drawing.Point(5, 194);
this.txtTempoDecorrido.Location = new System.Drawing.Point(5, 219);
this.txtTempoDecorrido.Name = "txtTempoDecorrido";
this.txtTempoDecorrido.ReadOnly = true;
this.txtTempoDecorrido.Size = new System.Drawing.Size(100, 20);
this.txtTempoDecorrido.TabIndex = 43;
this.txtTempoDecorrido.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblProgressoRua
//
this.lblProgressoRua.AutoSize = true;
this.lblProgressoRua.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblProgressoRua.Location = new System.Drawing.Point(112, 242);
this.lblProgressoRua.Name = "lblProgressoRua";
this.lblProgressoRua.Size = new System.Drawing.Size(50, 17);
this.lblProgressoRua.TabIndex = 42;
this.lblProgressoRua.Text = "% Rua";
//
// pgbProgressoRua
//
this.pgbProgressoRua.Location = new System.Drawing.Point(111, 262);
this.pgbProgressoRua.Name = "pgbProgressoRua";
this.pgbProgressoRua.Size = new System.Drawing.Size(100, 20);
this.pgbProgressoRua.TabIndex = 41;
//
// lblProgressoOperacao
//
this.lblProgressoOperacao.AutoSize = true;
this.lblProgressoOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblProgressoOperacao.Location = new System.Drawing.Point(6, 242);
this.lblProgressoOperacao.Name = "lblProgressoOperacao";
this.lblProgressoOperacao.Size = new System.Drawing.Size(87, 17);
this.lblProgressoOperacao.TabIndex = 40;
this.lblProgressoOperacao.Text = "% Operação";
//
// pgbProgressoOperacao
//
this.pgbProgressoOperacao.Location = new System.Drawing.Point(5, 262);
this.pgbProgressoOperacao.Name = "pgbProgressoOperacao";
this.pgbProgressoOperacao.Size = new System.Drawing.Size(100, 20);
this.pgbProgressoOperacao.TabIndex = 39;
//
// txtStatusCarro
//
this.txtStatusCarro.Location = new System.Drawing.Point(113, 176);
this.txtStatusCarro.Name = "txtStatusCarro";
this.txtStatusCarro.ReadOnly = true;
this.txtStatusCarro.Size = new System.Drawing.Size(100, 20);
this.txtStatusCarro.TabIndex = 38;
this.txtStatusCarro.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblStatusCarro
//
this.lblStatusCarro.AutoSize = true;
this.lblStatusCarro.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblStatusCarro.Location = new System.Drawing.Point(111, 156);
this.lblStatusCarro.Name = "lblStatusCarro";
this.lblStatusCarro.Size = new System.Drawing.Size(43, 17);
this.lblStatusCarro.TabIndex = 37;
this.lblStatusCarro.Text = "Carro";
//
// lblStatusOperacao
//
this.lblStatusOperacao.AutoSize = true;
this.lblStatusOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblStatusOperacao.Location = new System.Drawing.Point(6, 156);
this.lblStatusOperacao.Name = "lblStatusOperacao";
this.lblStatusOperacao.Size = new System.Drawing.Size(71, 17);
this.lblStatusOperacao.TabIndex = 36;
this.lblStatusOperacao.Text = "Operação";
//
// txtStatusOperacao
//
this.txtStatusOperacao.Location = new System.Drawing.Point(5, 176);
this.txtStatusOperacao.Name = "txtStatusOperacao";
this.txtStatusOperacao.ReadOnly = true;
this.txtStatusOperacao.Size = new System.Drawing.Size(100, 20);
this.txtStatusOperacao.TabIndex = 35;
this.txtStatusOperacao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblErvasIdentificadas
//
this.lblErvasIdentificadas.AutoSize = true;
this.lblErvasIdentificadas.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblErvasIdentificadas.Location = new System.Drawing.Point(152, 381);
this.lblErvasIdentificadas.Name = "lblErvasIdentificadas";
this.lblErvasIdentificadas.Size = new System.Drawing.Size(54, 13);
this.lblErvasIdentificadas.TabIndex = 34;
this.lblErvasIdentificadas.Text = "154 ervas";
//
// lblVelocidadeDados
//
this.lblVelocidadeDados.AutoSize = true;
this.lblVelocidadeDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblVelocidadeDados.Location = new System.Drawing.Point(111, 566);
this.lblVelocidadeDados.Name = "lblVelocidadeDados";
this.lblVelocidadeDados.Size = new System.Drawing.Size(82, 13);
this.lblVelocidadeDados.TabIndex = 33;
this.lblVelocidadeDados.Text = "5,3 km/h 85,3%";
//
// lblVelocidade
//
this.lblVelocidade.AutoSize = true;
this.lblVelocidade.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblVelocidade.Location = new System.Drawing.Point(6, 543);
this.lblVelocidade.Name = "lblVelocidade";
this.lblVelocidade.Size = new System.Drawing.Size(78, 17);
this.lblVelocidade.TabIndex = 32;
this.lblVelocidade.Text = "Velocidade";
//
// pgbVelocidade
//
this.pgbVelocidade.Location = new System.Drawing.Point(5, 563);
this.pgbVelocidade.Maximum = 20;
this.pgbVelocidade.Name = "pgbVelocidade";
this.pgbVelocidade.Size = new System.Drawing.Size(100, 20);
this.pgbVelocidade.TabIndex = 31;
//
// lblHerbicidaDados
//
this.lblHerbicidaDados.AutoSize = true;
this.lblHerbicidaDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblHerbicidaDados.Location = new System.Drawing.Point(111, 394);
this.lblHerbicidaDados.Name = "lblHerbicidaDados";
this.lblHerbicidaDados.Size = new System.Drawing.Size(100, 13);
this.lblHerbicidaDados.TabIndex = 30;
this.lblHerbicidaDados.Text = "2,3 L (35,9 ml/erva)";
//
// lblHerbicida
//
this.lblHerbicida.AutoSize = true;
this.lblHerbicida.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblHerbicida.Location = new System.Drawing.Point(6, 371);
this.lblHerbicida.Name = "lblHerbicida";
this.lblHerbicida.Size = new System.Drawing.Size(126, 17);
this.lblHerbicida.TabIndex = 29;
this.lblHerbicida.Text = "Herbicida Aplicado";
//
// pgbHerbicidaAplicado
//
this.pgbHerbicidaAplicado.Location = new System.Drawing.Point(5, 391);
this.pgbHerbicidaAplicado.Maximum = 35;
this.pgbHerbicidaAplicado.Name = "pgbHerbicidaAplicado";
this.pgbHerbicidaAplicado.Size = new System.Drawing.Size(100, 20);
this.pgbHerbicidaAplicado.TabIndex = 28;
//
// lblPressaoDados
//
this.lblPressaoDados.AutoSize = true;
this.lblPressaoDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblPressaoDados.Location = new System.Drawing.Point(111, 437);
this.lblPressaoDados.Name = "lblPressaoDados";
this.lblPressaoDados.Size = new System.Drawing.Size(44, 13);
this.lblPressaoDados.TabIndex = 27;
this.lblPressaoDados.Text = "86,3 psi";
//
// lblPressao
//
this.lblPressao.AutoSize = true;
this.lblPressao.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblPressao.Location = new System.Drawing.Point(6, 414);
this.lblPressao.Name = "lblPressao";
this.lblPressao.Size = new System.Drawing.Size(119, 17);
this.lblPressao.TabIndex = 26;
this.lblPressao.Text = "Pressão da Linha";
//
// pgbPressao
//
this.pgbPressao.Location = new System.Drawing.Point(5, 434);
this.pgbPressao.Maximum = 150;
this.pgbPressao.Name = "pgbPressao";
this.pgbPressao.Size = new System.Drawing.Size(100, 20);
this.pgbPressao.TabIndex = 25;
//
// lblTemperaturaCampoDados
//
this.lblTemperaturaCampoDados.AutoSize = true;
this.lblTemperaturaCampoDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblTemperaturaCampoDados.Location = new System.Drawing.Point(111, 523);
this.lblTemperaturaCampoDados.Name = "lblTemperaturaCampoDados";
this.lblTemperaturaCampoDados.Size = new System.Drawing.Size(42, 13);
this.lblTemperaturaCampoDados.TabIndex = 24;
this.lblTemperaturaCampoDados.Text = "38,7 ºC";
//
// lblTemperaturaCampo
//
this.lblTemperaturaCampo.AutoSize = true;
this.lblTemperaturaCampo.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblTemperaturaCampo.Location = new System.Drawing.Point(6, 500);
this.lblTemperaturaCampo.Name = "lblTemperaturaCampo";
this.lblTemperaturaCampo.Size = new System.Drawing.Size(138, 17);
this.lblTemperaturaCampo.TabIndex = 23;
this.lblTemperaturaCampo.Text = "Temperatura Campo";
//
// pgbTemperaturaCampo
//
this.pgbTemperaturaCampo.Location = new System.Drawing.Point(5, 520);
this.pgbTemperaturaCampo.Name = "pgbTemperaturaCampo";
this.pgbTemperaturaCampo.Size = new System.Drawing.Size(100, 20);
this.pgbTemperaturaCampo.TabIndex = 22;
//
// lblTemperaturaMotoresDados
//
this.lblTemperaturaMotoresDados.AutoSize = true;
this.lblTemperaturaMotoresDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblTemperaturaMotoresDados.Location = new System.Drawing.Point(111, 480);
this.lblTemperaturaMotoresDados.Name = "lblTemperaturaMotoresDados";
this.lblTemperaturaMotoresDados.Size = new System.Drawing.Size(42, 13);
this.lblTemperaturaMotoresDados.TabIndex = 21;
this.lblTemperaturaMotoresDados.Text = "57,5 ºC";
//
// lblTemperaturaMotores
//
this.lblTemperaturaMotores.AutoSize = true;
this.lblTemperaturaMotores.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblTemperaturaMotores.Location = new System.Drawing.Point(6, 457);
this.lblTemperaturaMotores.Name = "lblTemperaturaMotores";
this.lblTemperaturaMotores.Size = new System.Drawing.Size(145, 17);
this.lblTemperaturaMotores.TabIndex = 20;
this.lblTemperaturaMotores.Text = "Temperatura Motores";
//
// pgbTemperaturaMotores
//
this.pgbTemperaturaMotores.Location = new System.Drawing.Point(5, 477);
this.pgbTemperaturaMotores.Maximum = 200;
this.pgbTemperaturaMotores.Name = "pgbTemperaturaMotores";
this.pgbTemperaturaMotores.Size = new System.Drawing.Size(100, 20);
this.pgbTemperaturaMotores.TabIndex = 19;
//
// lblReservatorioDados
//
this.lblReservatorioDados.AutoSize = true;
this.lblReservatorioDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblReservatorioDados.Location = new System.Drawing.Point(111, 351);
this.lblReservatorioDados.Name = "lblReservatorioDados";
this.lblReservatorioDados.Size = new System.Drawing.Size(75, 13);
this.lblReservatorioDados.TabIndex = 15;
this.lblReservatorioDados.Text = "28,5 L 100,0%";
//
// lblBateriaDados
//
this.lblBateriaDados.AutoSize = true;
this.lblBateriaDados.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.lblBateriaDados.Location = new System.Drawing.Point(111, 308);
this.lblBateriaDados.Name = "lblBateriaDados";
this.lblBateriaDados.Size = new System.Drawing.Size(98, 13);
this.lblBateriaDados.TabIndex = 14;
this.lblBateriaDados.Text = "42,3V 5,2A 100,0%";
//
// lblReservatorio
//
this.lblReservatorio.AutoSize = true;
this.lblReservatorio.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblReservatorio.Location = new System.Drawing.Point(6, 328);
this.lblReservatorio.Name = "lblReservatorio";
this.lblReservatorio.Size = new System.Drawing.Size(153, 17);
this.lblReservatorio.TabIndex = 13;
this.lblReservatorio.Text = "Reservatório Herbicida";
//
// pgbReservatorio
//
this.pgbReservatorio.Location = new System.Drawing.Point(5, 348);
this.pgbReservatorio.Maximum = 35;
this.pgbReservatorio.Name = "pgbReservatorio";
this.pgbReservatorio.Size = new System.Drawing.Size(100, 20);
this.pgbReservatorio.TabIndex = 12;
//
// lblBateria
//
this.lblBateria.AutoSize = true;
this.lblBateria.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblBateria.Location = new System.Drawing.Point(6, 285);
this.lblBateria.Name = "lblBateria";
this.lblBateria.Size = new System.Drawing.Size(53, 17);
this.lblBateria.TabIndex = 11;
this.lblBateria.Text = "Bateria";
//
// pgbBateria
//
this.pgbBateria.Location = new System.Drawing.Point(5, 305);
this.pgbBateria.Name = "pgbBateria";
this.pgbBateria.Size = new System.Drawing.Size(100, 20);
this.pgbBateria.TabIndex = 10;
//
// txtOrientacao
//
this.txtOrientacao.Location = new System.Drawing.Point(113, 90);
this.txtOrientacao.Name = "txtOrientacao";
this.txtOrientacao.ReadOnly = true;
this.txtOrientacao.Size = new System.Drawing.Size(100, 20);
this.txtOrientacao.TabIndex = 9;
this.txtOrientacao.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lblOrientacao
//
this.lblOrientacao.AutoSize = true;
this.lblOrientacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblOrientacao.Location = new System.Drawing.Point(111, 70);
this.lblOrientacao.Name = "lblOrientacao";
this.lblOrientacao.Size = new System.Drawing.Size(78, 17);
this.lblOrientacao.TabIndex = 8;
this.lblOrientacao.Text = "Orientação";
//
// lblLeitura
//
this.lblLeitura.AutoSize = true;
this.lblLeitura.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F);
this.lblLeitura.Location = new System.Drawing.Point(6, 70);
this.lblLeitura.Name = "lblLeitura";
this.lblLeitura.Size = new System.Drawing.Size(52, 17);
this.lblLeitura.TabIndex = 7;
this.lblLeitura.Text = "Leitura";
//
// txtLeitura
//
this.txtLeitura.Location = new System.Drawing.Point(5, 90);
this.txtLeitura.Name = "txtLeitura";
this.txtLeitura.ReadOnly = true;
this.txtLeitura.Size = new System.Drawing.Size(100, 20);
this.txtLeitura.TabIndex = 6;
this.txtLeitura.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// chbFoco
//
this.chbFoco.AutoSize = true;
this.chbFoco.Location = new System.Drawing.Point(9, 41);
this.chbFoco.Name = "chbFoco";
this.chbFoco.Size = new System.Drawing.Size(86, 17);
this.chbFoco.TabIndex = 7;
this.chbFoco.Text = "Acompanhar";
this.chbFoco.UseVisualStyleBackColor = true;
//
// pnlMapa
//
this.pnlMapa.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnlMapa.Location = new System.Drawing.Point(11, 11);
this.pnlMapa.Margin = new System.Windows.Forms.Padding(2);
this.pnlMapa.Name = "pnlMapa";
this.pnlMapa.Size = new System.Drawing.Size(771, 542);
this.pnlMapa.TabIndex = 7;
//
// lblMapa
//
this.lblMapa.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lblMapa.AutoSize = true;
this.lblMapa.Location = new System.Drawing.Point(137, 564);
this.lblMapa.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblMapa.Name = "lblMapa";
this.lblMapa.Size = new System.Drawing.Size(91, 13);
this.lblMapa.TabIndex = 8;
this.lblMapa.Text = "Mapa carregado: ";
//
// btnCarregar
//
this.btnCarregar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCarregar.Location = new System.Drawing.Point(11, 557);
this.btnCarregar.Margin = new System.Windows.Forms.Padding(2);
this.btnCarregar.Name = "btnCarregar";
this.btnCarregar.Size = new System.Drawing.Size(98, 26);
this.btnCarregar.TabIndex = 9;
this.btnCarregar.Text = "Carregar mapa";
this.btnCarregar.UseVisualStyleBackColor = true;
this.btnCarregar.Click += new System.EventHandler(this.btnCarregar_Click);
//
// frmMonitoramento
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1026, 566);
this.ClientSize = new System.Drawing.Size(1026, 594);
this.Controls.Add(this.btnCarregar);
this.Controls.Add(this.lblMapa);
this.Controls.Add(this.pnlMapa);
this.Controls.Add(this.panel1);
this.Name = "frmMonitoramento";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
@ -553,6 +605,7 @@
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
@ -602,5 +655,9 @@
private System.Windows.Forms.Label lblTempoEstimado;
private System.Windows.Forms.Label lblTempoDecorrido;
private System.Windows.Forms.TextBox txtTempoDecorrido;
private System.Windows.Forms.CheckBox chbFoco;
private System.Windows.Forms.Panel pnlMapa;
private System.Windows.Forms.Label lblMapa;
private System.Windows.Forms.Button btnCarregar;
}
}

View File

@ -16,6 +16,9 @@ namespace AgroMonitor.Forms
{
Timer tmrLeituras = new Timer();
DateTime MomentoLog = DateTime.Now;
private MapasModel Mapa;
Dictionary<byte, List<LoRaProtocoloTransmissaoModel>> Logs = new Dictionary<byte, List<LoRaProtocoloTransmissaoModel>>();
int ticks = 0;
public frmMonitoramento()
{
@ -27,6 +30,14 @@ namespace AgroMonitor.Forms
tmrLeituras.Interval = 1000;
tmrLeituras.Tick += tmrLeituras_Tick;
tmrLeituras.Start();
Mapa = new MapasModel()
{
pnlMapa = pnlMapa,
lblMapa = lblMapa,
};
Logs = new Dictionary<byte, List<LoRaProtocoloTransmissaoModel>>(VariaveisMonitoramento.EquipamentosConectadosLogs);
}
private void tmrLeituras_Tick(object sender, EventArgs e)
@ -46,6 +57,53 @@ namespace AgroMonitor.Forms
{
AtualizarDadosTela();
}
// Verifica atualizações nos equipamentos conectados
VerificarAtualizacoesEquipamentos();
if (ticks % (tmrLeituras.Interval * VariaveisEquipamento.TempoEntrePingsConexao) == 0)
{
byte EnderecoBase = VariaveisMonitoramento.ComunicacaoLoRa.parametros.address;
GPSService.EnviarCoordenadasParaMapa(GPSService.UltimaLeitura.Latitude, GPSService.UltimaLeitura.Longitude, GPSService.UltimaLeitura.Orientacao, chbFoco.Checked, Convert.ToInt32(EnderecoBase));
foreach (var Equipamento in VariaveisMonitoramento.EquipamentosConectados.Where(x => x.Key != EnderecoBase))
{
LoRaService.EnviarDadosPosicao(EnderecoBase, Equipamento.Key);
}
}
ticks++;
}
private void VerificarAtualizacoesEquipamentos()
{
foreach (var key in VariaveisMonitoramento.EquipamentosConectados.Keys)
{
// Verifica se o equipamento foi atualizado
if (!Logs.ContainsKey(key) || !EquipamentosIguais(VariaveisMonitoramento.EquipamentosConectadosLogs[key], Logs[key]))
{
// Se sim, consuma o último valor (último log)
ConsumirUltimoValor(VariaveisMonitoramento.EquipamentosConectadosLogs[key]);
// Atualiza o estado anterior da lista EquipamentosConectados
Logs[key] = new List<LoRaProtocoloTransmissaoModel>(VariaveisMonitoramento.EquipamentosConectadosLogs[key]);
}
}
}
private bool EquipamentosIguais(List<LoRaProtocoloTransmissaoModel> listaAtual, List<LoRaProtocoloTransmissaoModel> listaAnterior)
{
// Verifica se as listas são iguais
return listaAtual.SequenceEqual(listaAnterior);
}
private void ConsumirUltimoValor(List<LoRaProtocoloTransmissaoModel> equipamento)
{
// Consumir o último valor (último log) do equipamento atualizado
if (equipamento.Count > 0)
{
var ultimoLog = equipamento[equipamento.Count - 1];
GPSService.EnviarCoordenadasParaMapa(ultimoLog.Coordenadas.Latitude, ultimoLog.Coordenadas.Longitude, ultimoLog.Coordenadas.Orientacao, chbFoco.Checked, Convert.ToInt32(ultimoLog.EnderecoCarro));
}
}
private void cmbEquipamento_SelectedIndexChanged(object sender, EventArgs e)
@ -57,6 +115,7 @@ namespace AgroMonitor.Forms
private void AtualizarDadosTela()
{
byte Endereco = Convert.ToByte(cmbEquipamento.Text);
if (Endereco == VariaveisMonitoramento.ComunicacaoLoRa.parametros.address)
{
MomentoLog = DateTime.Now;
@ -124,8 +183,15 @@ namespace AgroMonitor.Forms
lblVelocidadeDados.Text = $"{Equipamento.Sensores.Velocidade.ToString("0.00")} km/h";
}
}
}
private void btnCarregar_Click(object sender, EventArgs e)
{
Mapa.btnCarregar_Click(sender, e, "", true);
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,235 @@
import geopandas as gpd
import json
import sys
import folium
import requests
import re
import shutil
def internet_disponivel():
"""Verifica se há conexão com a internet."""
url = 'http://www.google.com/'
timeout = 5
try:
_ = requests.get(url, timeout=timeout)
return True
except requests.ConnectionError:
return False
# Argumentos e configurações iniciais
pathFiles = sys.argv[1]
fileName = sys.argv[2]
outputName = sys.argv[3]
outputMapName = sys.argv[4]
topico_gps = sys.argv[5]
topico_ruas = sys.argv[6]
topico_trajeto_dinamico = sys.argv[7]
mapa_dados_json = sys.argv[8]
pastaSaida = 'Python/Output/'
if mapa_dados_json == "0":
# Carregar o arquivo shapefile contendo a geometria
input_shapefile = pathFiles + fileName + '.shp'
data_geometry = gpd.read_file(input_shapefile)
# Converter o GeoDataFrame para GeoJSON e adicionar ao mapa
geojson_data = data_geometry.to_json()
# Calcular os limites (bounds) da geometria
minx, miny, maxx, maxy = data_geometry.total_bounds
center = [(miny + maxy) / 2, (minx + maxx) / 2]
# Salvar GEOJson
data_geometry.to_file(pastaSaida + outputName, driver='GeoJSON')
else:
# Lendo os dados JSON
with open(pathFiles + fileName + '.json', 'r', encoding='utf-8-sig') as f:
geojson_data = json.load(f)
# Obter os limites (bounds) dos dados GeoJSON
bounds = folium.GeoJson(geojson_data).get_bounds()
center = [(bounds[0][0] + bounds[1][0]) / 2, (bounds[0][1] + bounds[1][1]) / 2]
# Adicionando um ID sequencial a cada Feature
for idx, feature in enumerate(geojson_data["features"]):
# Adicionar uma propriedade 'id' para cada Feature começando do índice zero
feature['id'] = idx
# Copiando o arquivo JSON para a pasta de saída
shutil.copy(pathFiles + fileName + '.json', pastaSaida + outputName)
# Verificar se há conexão com a internet
if internet_disponivel():
m = folium.Map(location=center, zoom_start=12)
else:
m = folium.Map(location=center, zoom_start=12, tiles=None)
folium.GeoJson(geojson_data).add_to(m)
# Salvar o mapa interativo em um arquivo HTML
m.save(pastaSaida + outputMapName)
# Caminho completo para o arquivo HTML gerado
caminho_completo_html = pastaSaida + outputMapName
# Abrir o arquivo HTML para leitura e escrita
with open(caminho_completo_html, 'r+') as arquivo_html:
# Ler o conteúdo do arquivo
conteudo_html = arquivo_html.read()
# Usar expressão regular para encontrar o ID do mapa
padrao_id_mapa = re.compile(r'id="map_(.*?)"')
resultado_busca = padrao_id_mapa.search(conteudo_html)
# Verificar se encontrou um ID de mapa
if resultado_busca:
id_mapa = 'map_' + resultado_busca.group(1)
else:
raise ValueError("Não foi possível encontrar o ID do mapa no arquivo HTML.")
# Script para desenhar o trajo percorrido no mapa
script_marcadores_dinamicos = f"""
<script src="folium/mqtt.min.js"></script>
<script src="folium/leaflet.rotatedMarker.js"></script>
<script>
var marcadores = {{}};
var trajetos = {{}};
function criarMarcador(id, coordenadas, orientacao) {{
var marcador;
if (id == 1) {{
marcador = L.marker(coordenadas, {{}}).addTo({id_mapa});
var icon = L.AwesomeMarkers.icon(
{{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}}
);
marcador.setIcon(icon);
}}
else {{
var customIcon = L.icon({{
iconUrl: 'folium/images/position_marker.png',
iconSize: [32, 32],
iconAnchor: [16, 16],
popupAnchor: [0, -16]
}});
marcador = L.marker(coordenadas, {{ icon: customIcon }}).addTo({id_mapa});
marcador.setRotationAngle(orientacao);
}}
var popup = L.popup({{"maxWidth": "100%"}});
var html = $(`<div id="html_${{id}}" style="width: 100.0%; height: 100.0%;">Endereco: ${{id}}</div>`)[0];
popup.setContent(html);
marcador.bindPopup(popup)
marcadores[id] = marcador;
}}
function criarTrajeto(id) {{
trajetos[id] = L.geoJson(null, {{
style: function(feature) {{
return {{ color: 'red' }};
}}
}}).addTo({id_mapa});
}}
function atualizarMarcador(id, coordenadas, orientacao) {{
var marcador = marcadores[id];
if (marcador) {{
marcador.setLatLng(coordenadas);
marcador.setRotationAngle(orientacao);
}}
}}
function atualizarTrajeto(id, coordenadas) {{
var trajeto = trajetos[id];
if (trajeto) {{
var feature = trajeto.toGeoJSON().features.find(f => f.id === id);
if (feature) {{
var ultima = [0.0, 0.0];
if (feature.geometry.coordinates.length > 0) {{
ultima = feature.geometry.coordinates[feature.geometry.coordinates.length - 1];
}}
if (!saoCoordenadasIguais(ultima, coordenadas, 0.000001)) {{
feature.geometry.coordinates.push(coordenadas);
trajeto.clearLayers();
trajeto.addData(feature);
}}
}}
}}
}}
function saoCoordenadasIguais(coord1, coord2, tolerancia) {{
return Math.abs(coord1[0] - coord2[0]) < tolerancia && Math.abs(coord1[1] - coord2[1]) < tolerancia;
}}
function adicionarDados(id, coordenadas, orientacao, foco) {{
if (!marcadores[id]) {{
criarMarcador(id, coordenadas, orientacao);
criarTrajeto(id);
trajetos[id].addData({{
"type": "Feature",
"geometry": {{
"type": "LineString",
"coordinates": []
}},
"properties": {{"Dist1": 0.0, "Dist2": 0.0, "Id": id, "Length": 0.0, "Name": "Trajeto"}},
"id": id
}});
}} else {{
atualizarMarcador(id, coordenadas, orientacao);
atualizarTrajeto(id, [coordenadas[1], coordenadas[0]]);
}}
if (foco) {{
{id_mapa}.setView(coordenadas, {id_mapa}.getZoom());
}}
}}
const client = mqtt.connect('ws://localhost:9001'); // Use wss para conexao segura
client.on('connect', function () {{
console.log('Conectado ao broker MQTT');
client.subscribe('{topico_gps}', function (err) {{
if (!err) {{
console.log("Inscricao bem-sucedida no topico");
}} else {{
console.error("Falha na inscricao do topico", err);
}}
}});
}});
client.on('message', function (topic, message) {{
var dados = JSON.parse(message);
if (topic === '{topico_gps}') {{
var id = dados.id;
var novaLatitude = dados.latitude;
var novaLongitude = dados.longitude;
var novaPosicao = [novaLatitude, novaLongitude];
var orientacao = dados.orientacao;
var foco = dados.foco;
adicionarDados(id, novaPosicao, orientacao, foco);
}}
}});
</script>
"""
# Importar arquivos localmente
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/', 'folium/')
conteudo_html = conteudo_html.replace('https://code.jquery.com/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/', 'folium/')
conteudo_html = conteudo_html.replace('https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.0/css/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/', 'folium/')
conteudo_html = conteudo_html.replace('https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/', 'folium/')
# Inserir o script no conteúdo HTML
conteudo_atualizado = conteudo_html.replace('</html>', script_marcadores_dinamicos + '</html>')
# Agora, reabrir o arquivo para escrita e sobrescrever o conteúdo com a versão atualizada
with open(caminho_completo_html, 'w') as arquivo_html:
arquivo_html.write(conteudo_atualizado)

View File

@ -213,6 +213,7 @@ C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\System.Text.Encodings.
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\System.Threading.Tasks.Extensions.xml
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Microsoft.Bcl.AsyncInterfaces.xml
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\bin\Debug\System.Runtime.CompilerServices.Unsafe.xml
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMonitor.csproj.CopyComplete
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMonitor.Forms.frmAjustesOperacao.resources
C:\ZendionInc\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMonitor.Forms.frmMonitoramento.resources
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\bin\Debug\Python\Scripts\map-follow.py
C:\ZendionINC\agrobot_base\AgroBase\AgroMonitor\obj\Debug\AgroMoni.D419EBC3.Up2Date