refinamento do fluxo
This commit is contained in:
parent
408911a68f
commit
0de0e13d65
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,121 +1,12 @@
|
|||
{
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "C:\\ZendionINC\\agrobot_base\\AgroBase\\",
|
||||
"Documents": [
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|C:\\ZendionINC\\agrobot_base\\AgroBase\\agrobase\\models\\operacoes\\operacaomodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\models\\operacoes\\operacaomodel.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\\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\\frminstancial.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\frminstancial.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}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|c:\\zendioninc\\agrobot_base\\agrobase\\agrobase\\forms\\operacoes\\frmresultadosoperacao.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\operacoes\\frmresultadosoperacao.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\\gpsservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\services\\gpsservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
}
|
||||
],
|
||||
"Documents": [],
|
||||
"DocumentGroupContainers": [
|
||||
{
|
||||
"Orientation": 0,
|
||||
"VerticalTabListWidth": 256,
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 5,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"Title": "frmInstancial.cs",
|
||||
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmInstancial.cs",
|
||||
"RelativeDocumentMoniker": "AgroBase\\Forms\\frmInstancial.cs",
|
||||
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmInstancial.cs",
|
||||
"RelativeToolTip": "AgroBase\\Forms\\frmInstancial.cs",
|
||||
"ViewState": "AQIAAEEAAAAAAAAAAAAwwJQAAAAAAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-12-17T13:19:03.476Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 3,
|
||||
"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": "AQIAAAIAAAAAAAAAAAAnwC4AAAAtAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-12-17T12:52:54.097Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 1,
|
||||
"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": "AQIAAGQDAAAAAAAAAAAmwFEDAAAUAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-12-17T12:26:28.54Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 4,
|
||||
"Title": "frmResultadosOperacao.cs",
|
||||
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\Operacoes\\frmResultadosOperacao.cs",
|
||||
"RelativeDocumentMoniker": "AgroBase\\Forms\\Operacoes\\frmResultadosOperacao.cs",
|
||||
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\Operacoes\\frmResultadosOperacao.cs",
|
||||
"RelativeToolTip": "AgroBase\\Forms\\Operacoes\\frmResultadosOperacao.cs",
|
||||
"ViewState": "AQIAAMEBAAAAAAAAAAAmwPoBAABAAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-12-13T18:54:41.843Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 5,
|
||||
"Title": "GPSService.cs",
|
||||
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Services\\GPSService.cs",
|
||||
"RelativeDocumentMoniker": "AgroBase\\Services\\GPSService.cs",
|
||||
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Services\\GPSService.cs",
|
||||
"RelativeToolTip": "AgroBase\\Services\\GPSService.cs",
|
||||
"ViewState": "AQIAAOIAAAAAAAAAAAAxwOsBAAAmAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-12-13T13:06:36.311Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "OperacaoModel.cs",
|
||||
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\Operacoes\\OperacaoModel.cs",
|
||||
"RelativeDocumentMoniker": "AgroBase\\Models\\Operacoes\\OperacaoModel.cs",
|
||||
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\Operacoes\\OperacaoModel.cs",
|
||||
"RelativeToolTip": "AgroBase\\Models\\Operacoes\\OperacaoModel.cs",
|
||||
"ViewState": "AQIAAAAAAAAAAAAAAAAAAEAAAAAIAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-12-13T12:14:30.018Z",
|
||||
"EditorCaption": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
"DocumentGroups": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@ namespace AgroBase.Forms.IHM
|
|||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void frmAjustes_Load(object sender, EventArgs e)
|
||||
private async void frmAjustes_Load(object sender, EventArgs e)
|
||||
{
|
||||
cmbComunicacao.Items.Clear();
|
||||
cmbComunicacao.Items.AddRange(new string[] { "Equipamento", "Base" });
|
||||
|
|
@ -90,7 +90,7 @@ namespace AgroBase.Forms.IHM
|
|||
AtualizarCameras();
|
||||
if (LoRaService.Iniciado)
|
||||
{
|
||||
AtualizarParametros().ConfigureAwait(false);
|
||||
await AtualizarParametros();
|
||||
}
|
||||
|
||||
chbKinect.Enabled = KinectService.Iniciado;
|
||||
|
|
@ -349,9 +349,12 @@ namespace AgroBase.Forms.IHM
|
|||
|
||||
#endregion
|
||||
|
||||
private void cmbComunicacao_SelectedIndexChanged(object sender, EventArgs e)
|
||||
private async void cmbComunicacao_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
AtualizarParametros().ConfigureAwait(false);
|
||||
if (LoRaService.Iniciado)
|
||||
{
|
||||
await AtualizarParametros();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnCalibrarKinect_Click(object sender, EventArgs e)
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ namespace AgroBase.Forms.IHM
|
|||
sucesso ? MessageBoxIcon.Asterisk : MessageBoxIcon.Error
|
||||
);
|
||||
|
||||
SyncDataService.SincronizarArquivosComServidor().ConfigureAwait(false);
|
||||
Task.Run(async () => await SyncDataService.SincronizarArquivosComServidor());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -491,6 +491,24 @@ namespace AgroBase.Forms.Operacoes
|
|||
Valores = LogsOperacao.Select(x => (double)(x?.GPU_temp ?? 0)).ToList(),
|
||||
Visivel = true,
|
||||
},
|
||||
new GraficoInterativoSerieModel()
|
||||
{
|
||||
Titulo = "Threads Ativas",
|
||||
Valores = LogsOperacao.Select(x => (double)(x?.ActiveThreads ?? 0)).ToList(),
|
||||
Visivel = true,
|
||||
},
|
||||
new GraficoInterativoSerieModel()
|
||||
{
|
||||
Titulo = "Threads de Trabalho %",
|
||||
Valores = LogsOperacao.Select(x => (double)((x?.MaxWorkerThreads ?? 1) - (x?.WorkerThreads ?? 0)) / (x?.MaxWorkerThreads ?? 1) * 100.0).ToList(),
|
||||
Visivel = true,
|
||||
},
|
||||
new GraficoInterativoSerieModel()
|
||||
{
|
||||
Titulo = "Threads de Portas %",
|
||||
Valores = LogsOperacao.Select(x => (double)((x?.MaxCompletionPortThreads ?? 1) - (x?.CompletionPortThreads ?? 0)) / (x?.MaxCompletionPortThreads ?? 1) * 100.0).ToList(),
|
||||
Visivel = true,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace AgroBase.Forms
|
|||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void frmLoraConfig_Load(object sender, EventArgs e)
|
||||
private async void frmLoraConfig_Load(object sender, EventArgs e)
|
||||
{
|
||||
tmrLeitura = new AsyncTaskTimerModel("tmrLeitura", tmrLeitura_Tick, 1000, this);
|
||||
tmrLeitura.Start();
|
||||
|
|
@ -28,7 +28,7 @@ namespace AgroBase.Forms
|
|||
//Parametros = loraService.CarregarParametros();
|
||||
if (LoRaService.Iniciado)
|
||||
{
|
||||
AtualizarParametros().ConfigureAwait(false);
|
||||
await AtualizarParametros();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -104,15 +104,15 @@ namespace AgroBase.Forms
|
|||
btnSalvar.Enabled = false;
|
||||
}
|
||||
|
||||
private void btnLerParametros_Click(object sender, EventArgs e)
|
||||
private async void btnLerParametros_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (LoRaService.Iniciado)
|
||||
{
|
||||
AtualizarParametros().ConfigureAwait(false);
|
||||
await AtualizarParametros();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnGravarParametros_Click(object sender, EventArgs e)
|
||||
private async void btnGravarParametros_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (LoRaService.Iniciado)
|
||||
{
|
||||
|
|
@ -125,7 +125,7 @@ namespace AgroBase.Forms
|
|||
Parametros.worCycle = LoRaService.CodigosWorCycles.FirstOrDefault(x => x.Key.ToString() == cmbWorCycle.Text).Value;
|
||||
Parametros.power = LoRaService.CodigosPowers.FirstOrDefault(x => x.Key.ToString() == cmbPower.Text).Value;
|
||||
|
||||
ConfigurarModulo().ConfigureAwait(false);
|
||||
await ConfigurarModulo();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,14 +52,44 @@ namespace AgroBase
|
|||
|
||||
private void AtualizarListaRotinas()
|
||||
{
|
||||
string[] timers = new string[] { };
|
||||
var selecionados = clbRotinas.CheckedItems.Cast<string>().ToHashSet();
|
||||
|
||||
string[] novosTimers;
|
||||
|
||||
// Bloqueia para coletar os dados mais recentes
|
||||
lock (AsyncTaskTimerModel._timersLock)
|
||||
{
|
||||
timers = AsyncTaskTimerModel.Timers.Select(x => $"{x.StackTrace} -> {x.Id} - Interval: {x.Interval} - Tick: {x.TimeTick.TotalSeconds} s - State: {x.State.ToString()}").ToArray();
|
||||
novosTimers = AsyncTaskTimerModel.Timers
|
||||
.Select(x => $"{x.StackTrace} -> {x.Id} - Interval: {x.Interval} - Tick: {x.TimeTick.TotalSeconds} s - State: {x.State.ToString()}")
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
clbRotinas.Items.Clear();
|
||||
clbRotinas.Items.AddRange(timers);
|
||||
// Dicionário para facilitar comparação entre os itens atuais e os novos
|
||||
var itensAtuais = clbRotinas.Items.Cast<string>().ToHashSet();
|
||||
var novosItens = novosTimers.ToHashSet();
|
||||
|
||||
// 1. Remover itens que não existem mais
|
||||
foreach (var item in itensAtuais.Except(novosItens))
|
||||
{
|
||||
clbRotinas.Items.Remove(item);
|
||||
}
|
||||
|
||||
// 2. Adicionar novos itens que ainda não estão presentes
|
||||
foreach (var item in novosItens.Except(itensAtuais))
|
||||
{
|
||||
clbRotinas.Items.Add(item);
|
||||
}
|
||||
|
||||
// 3. (Opcional) Atualizar os itens existentes
|
||||
// Neste caso, não precisa porque `string` é imutável e não há "atualização parcial".
|
||||
|
||||
// Restaura a seleção
|
||||
foreach (var item in selecionados)
|
||||
{
|
||||
int index = clbRotinas.Items.IndexOf(item);
|
||||
if (index >= 0)
|
||||
clbRotinas.SetItemChecked(index, true);
|
||||
}
|
||||
}
|
||||
|
||||
#region DISPOSITIVOS
|
||||
|
|
@ -147,21 +177,48 @@ namespace AgroBase
|
|||
}
|
||||
|
||||
|
||||
lstDisponiveis.Items.Clear();
|
||||
lstDisponiveis.Items.AddRange(
|
||||
SerialService.DispositivosMapeados
|
||||
var itensAtuais = lstDisponiveis.Items
|
||||
.Cast<ListViewItem>()
|
||||
.ToDictionary(item => item.Text, item => item);
|
||||
|
||||
var novosItens = SerialService.DispositivosMapeados
|
||||
.GroupBy(x => x.Dispositivo)
|
||||
.Select(x => new ListViewItem()
|
||||
{
|
||||
Text =
|
||||
x.FirstOrDefault().Endereco + " - " + Enum.GetName(typeof(T_Code), x.Key) + " v" + x.FirstOrDefault().Versao +
|
||||
Text = x.FirstOrDefault().Endereco + " - " +
|
||||
Enum.GetName(typeof(T_Code), x.Key) + " v" +
|
||||
x.FirstOrDefault().Versao +
|
||||
(SerialService.DispositivosMultiplos.Contains(x.FirstOrDefault().Dispositivo)
|
||||
? (" (" + string.Join(", ", x.Where(y => y.Conectado).Select(y => y.Mod_ID)) + ")")
|
||||
: "") +
|
||||
" - " +
|
||||
(x.Any(y => y.Conectado) ? "Conectado" : "Desconectado")
|
||||
})
|
||||
.ToDictionary(item => item.Text, item => item);
|
||||
|
||||
(SerialService.DispositivosMultiplos.Contains(x.FirstOrDefault().Dispositivo) ? (" (" + string.Join(", ", x.Where(y => y.Conectado).Select(y => y.Mod_ID)) + ")") :
|
||||
// **1. Remover itens que saíram**
|
||||
foreach (var item in itensAtuais.Keys.Except(novosItens.Keys))
|
||||
{
|
||||
lstDisponiveis.Items.Remove(itensAtuais[item]);
|
||||
}
|
||||
|
||||
// **2. Adicionar novos itens**
|
||||
foreach (var item in novosItens.Keys.Except(itensAtuais.Keys))
|
||||
{
|
||||
lstDisponiveis.Items.Add(novosItens[item]);
|
||||
}
|
||||
|
||||
// **3. Atualizar itens que mudaram**
|
||||
foreach (var item in novosItens.Keys.Intersect(itensAtuais.Keys))
|
||||
{
|
||||
var itemAtual = itensAtuais[item];
|
||||
var novoItem = novosItens[item];
|
||||
if (itemAtual.Text != novoItem.Text) // Só atualiza se mudou
|
||||
{
|
||||
itemAtual.Text = novoItem.Text;
|
||||
}
|
||||
}
|
||||
|
||||
"") + " - " +
|
||||
(x.Any(y => y.Conectado) ? "Conectado" : "Desconectado")
|
||||
}).ToArray()
|
||||
);
|
||||
|
||||
tkbVelocidade.Minimum = 0;
|
||||
tkbVelocidade.Maximum = 100;
|
||||
|
|
@ -186,10 +243,10 @@ namespace AgroBase
|
|||
|
||||
#region VERSIONAMENTO DE ARQUIVOS
|
||||
|
||||
private void btnForcarAtualizacao_Click(object sender, EventArgs e)
|
||||
private async void btnForcarAtualizacao_Click(object sender, EventArgs e)
|
||||
{
|
||||
VersionamentoService.ForcarDownloadArquivos = true;
|
||||
VersionamentoService.AtualizarArquivoVersionamento(true).ConfigureAwait(false);
|
||||
await VersionamentoService.AtualizarArquivoVersionamento(true);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ namespace AgroBase.Models
|
|||
panel.Controls.Remove(browser);
|
||||
}
|
||||
browser = null;
|
||||
Variaveis.MqttService.UnsubscribeAsync(camera._mqttTopico).ConfigureAwait(false);
|
||||
Task.Run(async () => await Variaveis.MqttService.UnsubscribeAsync(camera._mqttTopico));
|
||||
if (camera.pythonProcess != null)
|
||||
{
|
||||
camera.pythonProcess.Kill();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using AgroBase.Services;
|
||||
using CefSharp.WinForms;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AgroBase.Models
|
||||
|
|
@ -23,7 +24,7 @@ namespace AgroBase.Models
|
|||
panel.Controls.Remove(browser);
|
||||
}
|
||||
browser = null;
|
||||
Variaveis.MqttService.UnsubscribeAsync(camera._mqttTopico).ConfigureAwait(false);
|
||||
Task.Run(async () => Variaveis.MqttService.UnsubscribeAsync(camera._mqttTopico));
|
||||
if (camera.pythonProcess != null && !camera.pythonProcess.HasExited)
|
||||
{
|
||||
camera.pythonProcess.Kill();
|
||||
|
|
|
|||
|
|
@ -195,7 +195,9 @@ namespace AgroBase.Models.Operacoes
|
|||
|
||||
private void DefinirTipoMovimento(StatusCarroMapa statusCarro)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Controle.TipoMovimento = statusCarro == StatusCarroMapa.Manobrando ? TipoMovimentoDirecional.MovimentoArco : TipoMovimentoDirecional.RodasDianteiras;
|
||||
Variaveis.OperacaoEmAndamento.Controle.TipoMovimento =
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.ManobrandoEntreRuas ? TipoMovimentoDirecional.MovimentoArco :
|
||||
TipoMovimentoDirecional.RodasDianteiras;
|
||||
}
|
||||
|
||||
public void CalculaDadosMovimentacaoAutonoma()
|
||||
|
|
@ -459,6 +461,16 @@ namespace AgroBase.Models.Operacoes
|
|||
return Variaveis.OperacaoEmAndamento.Mapa.IdxUltimoPontoTrajetoria == 0 && StatusAtual == StatusCarroMapa.Direcionando;
|
||||
}
|
||||
}
|
||||
public bool ManobrandoEntreRuas
|
||||
{
|
||||
get
|
||||
{
|
||||
bool proximoEntradaRua = Variaveis.OperacaoEmAndamento.Mapa.DistanciaAteProximoPonto <= Variaveis.OperacaoEmAndamento.Mapa.DistanciaProjecaoRua;
|
||||
bool Manobrando = proximoEntradaRua && EmManobra;
|
||||
|
||||
return Manobrando;
|
||||
}
|
||||
}
|
||||
|
||||
public void VerificaFimRuaAtual()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -365,6 +365,7 @@ namespace AgroBase.Models
|
|||
saveFileDialog.DefaultExt = "opr";
|
||||
saveFileDialog.AddExtension = true;
|
||||
saveFileDialog.InitialDirectory = Variaveis.CaminhoSistema + Variaveis.CaminhoOperacoes;
|
||||
saveFileDialog.FileName = descricao;
|
||||
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
string filePath = saveFileDialog.FileName;
|
||||
|
|
@ -1890,7 +1891,6 @@ namespace AgroBase.Models
|
|||
}
|
||||
|
||||
int activeThreads = Process.GetCurrentProcess().Threads.Count;
|
||||
// Status do Thread Pool
|
||||
ThreadPool.GetAvailableThreads(out int workerThreads, out int completionPortThreads);
|
||||
ThreadPool.GetMaxThreads(out int maxWorkerThreads, out int maxCompletionPortThreads);
|
||||
|
||||
|
|
@ -2145,7 +2145,7 @@ namespace AgroBase.Models
|
|||
|
||||
SalvarLogKinect(Agora);
|
||||
|
||||
SalvarLogCameras(Agora).ConfigureAwait(false);
|
||||
Task.Run(async () => await SalvarLogCameras(Agora));
|
||||
|
||||
string ArquivoOp = Variaveis.CaminhoOperacoes + Variaveis.OperacaoEmAndamento.ID + "/data.lgop";
|
||||
if (!File.Exists(ArquivoOp))
|
||||
|
|
|
|||
|
|
@ -570,12 +570,12 @@ namespace AgroBase.Models
|
|||
}
|
||||
public static void picBtn_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
TransicaoTamanho((Control)sender, true, 5).ConfigureAwait(false);
|
||||
Task.Run(async () => await TransicaoTamanho((Control)sender, true, 5));
|
||||
}
|
||||
|
||||
public static void picBtn_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
TransicaoTamanho((Control)sender, false, 5).ConfigureAwait(false);
|
||||
Task.Run(async () => await TransicaoTamanho((Control)sender, false, 5));
|
||||
}
|
||||
|
||||
private static void AlteraTamanhoObjeto(Control ctrl, bool Cresce)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
using AgroBase.Forms;
|
||||
using AgroBase.Models;
|
||||
using AgroBase.Models;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO.Ports;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using static AgroBase.Models.Enums;
|
||||
|
||||
namespace AgroBase.Services
|
||||
|
|
@ -650,10 +650,13 @@ namespace AgroBase.Services
|
|||
id = ID,
|
||||
foco = EmFoco
|
||||
};
|
||||
Variaveis.MqttService.PublishAsync(
|
||||
Variaveis.MqttService.Topicos.First(x => x.Topico == MapasVariaveisModel.TopicoCoordenadasGPS),
|
||||
JsonConvert.SerializeObject(Coordenadas)
|
||||
).ConfigureAwait(false);
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Variaveis.MqttService.PublishAsync(
|
||||
Variaveis.MqttService.Topicos.First(x => x.Topico == MapasVariaveisModel.TopicoCoordenadasGPS),
|
||||
JsonConvert.SerializeObject(Coordenadas)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
public static void AtualizarTrajetoriaDinamica()
|
||||
|
|
@ -666,20 +669,26 @@ namespace AgroBase.Services
|
|||
latitude = x.Latitude,
|
||||
longitude = x.Longitude
|
||||
}).ToArray();
|
||||
Variaveis.MqttService.PublishAsync(
|
||||
Variaveis.MqttService.Topicos.First(x => x.Topico == MapasVariaveisModel.TopicoTrajetoriaDinamica),
|
||||
JsonConvert.SerializeObject(Trajetoria)
|
||||
).ConfigureAwait(false);
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Variaveis.MqttService.PublishAsync(
|
||||
Variaveis.MqttService.Topicos.First(x => x.Topico == MapasVariaveisModel.TopicoTrajetoriaDinamica),
|
||||
JsonConvert.SerializeObject(Trajetoria)
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static void AtualizarRuasSelecionadas(List<string> RuasSelecionadas)
|
||||
{
|
||||
Variaveis.MqttService.PublishAsync(
|
||||
Variaveis.MqttService.Topicos.First(x => x.Topico == MapasVariaveisModel.TopicoSelecaoRuasMapa),
|
||||
JsonConvert.SerializeObject("[" + string.Join(",", RuasSelecionadas.ToArray()) + "]"),
|
||||
true
|
||||
).ConfigureAwait(false);
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Variaveis.MqttService.PublishAsync(
|
||||
Variaveis.MqttService.Topicos.First(x => x.Topico == MapasVariaveisModel.TopicoSelecaoRuasMapa),
|
||||
JsonConvert.SerializeObject("[" + string.Join(",", RuasSelecionadas.ToArray()) + "]"),
|
||||
true
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
public static List<GPSModel> InterpolarPontos(GPSModel inicio, GPSModel destino, double distanciaPasso)
|
||||
|
|
|
|||
|
|
@ -322,29 +322,35 @@ namespace AgroBase.Services
|
|||
|
||||
private static void RealizarVerificacaoDeRotina()
|
||||
{
|
||||
FuncoesGlobais.SafeExecuteAsync(async () =>
|
||||
Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
await FuncoesGlobais.SafeExecuteAsync(async () =>
|
||||
{
|
||||
await VersionamentoService.AtualizarArquivoVersionamento(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Erro ao atualizar arquivo de versionamento: {ex.Message}");
|
||||
}
|
||||
}).ConfigureAwait(false);
|
||||
try
|
||||
{
|
||||
await VersionamentoService.AtualizarArquivoVersionamento(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Erro ao atualizar arquivo de versionamento: {ex.Message}");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
FuncoesGlobais.SafeExecuteAsync(async () =>
|
||||
Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
await FuncoesGlobais.SafeExecuteAsync(async () =>
|
||||
{
|
||||
await SyncDataService.SincronizarArquivosComServidor();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Erro ao sincronizar arquivos com o servidor: {ex.Message}");
|
||||
}
|
||||
}).ConfigureAwait(false);
|
||||
try
|
||||
{
|
||||
await SyncDataService.SincronizarArquivosComServidor();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Erro ao sincronizar arquivos com o servidor: {ex.Message}");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private static bool ProcessarRespostaDispositivo(SerialPort Porta)
|
||||
|
|
|
|||
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"Id":"1","Name":"17_12_2024_08_33_02","Length":33.462942499632895,"Dist1":0.0,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[-47.3815305,-22.213009],[-47.381530166666664,-22.213009],[-47.381528166666669,-22.213008833333333],[-47.381527666666663,-22.213008833333333],[-47.3815275,-22.213008833333333],[-47.381527166666665,-22.213008833333333],[-47.381528333333335,-22.213007833333332],[-47.3815315,-22.213003833333332],[-47.381532666666665,-22.213001666666667],[-47.38153366666667,-22.212998833333334],[-47.381534,-22.212990666666666],[-47.3815325,-22.212985333333332],[-47.381526666666666,-22.2129765],[-47.381525333333336,-22.212974166666665],[-47.381525666666668,-22.212974833333334],[-47.381529833333332,-22.212982666666665],[-47.3815305,-22.212983833333332],[-47.381525666666668,-22.212981333333332],[-47.381523166666668,-22.212980166666668],[-47.381521,-22.212979166666667],[-47.381515833333332,-22.2129785],[-47.381515333333333,-22.212979333333333],[-47.381516,-22.212979833333332],[-47.381516166666664,-22.21298],[-47.3815185,-22.212979666666666],[-47.381518,-22.2129795],[-47.381517833333334,-22.2129795],[-47.381522666666669,-22.212981833333334],[-47.3815235,-22.212982166666666],[-47.3815295,-22.212984666666667],[-47.381532833333331,-22.212985666666668],[-47.38153333333333,-22.212985833333335],[-47.381529,-22.212989166666667],[-47.381527333333331,-22.212990833333333],[-47.38152516666667,-22.212994333333334],[-47.381523666666666,-22.212996],[-47.381522666666669,-22.212997],[-47.381519,-22.213001],[-47.3815185,-22.213001666666667],[-47.381512666666666,-22.213006833333335],[-47.381508,-22.213010166666667],[-47.381505,-22.213013833333335],[-47.3815015,-22.213023166666666],[-47.381501,-22.213028],[-47.381502166666664,-22.213038166666667],[-47.381502,-22.213043333333335],[-47.381502,-22.213052833333332],[-47.381504166666666,-22.213057666666668],[-47.381506666666667,-22.213062833333332],[-47.38151116666667,-22.213072833333332],[-47.381512166666667,-22.213077333333334],[-47.381513666666663,-22.213084],[-47.3815145,-22.213088666666668],[-47.381517,-22.213092166666666],[-47.3815215,-22.213095333333332],[-47.381522666666669,-22.213096],[-47.3815255,-22.213096333333333],[-47.3815285,-22.2130975],[-47.3815315,-22.213099166666666],[-47.3815385,-22.213101166666668],[-47.381541666666664,-22.213102833333334],[-47.381549666666665,-22.21311],[-47.381554666666666,-22.213113333333332],[-47.381561,-22.213115],[-47.381571,-22.2131175],[-47.381574833333332,-22.213119],[-47.381578,-22.213125833333333],[-47.381581,-22.213127833333335],[-47.381585,-22.213130666666668],[-47.381586333333331,-22.213132166666668],[-47.381587333333336,-22.213133],[-47.381587333333336,-22.213133833333334],[-47.381588,-22.213134],[-47.381588833333332,-22.213135166666667],[-47.38159,-22.213137],[-47.381590333333335,-22.213137833333334],[-47.38159233333333,-22.213139666666667],[-47.381593166666669,-22.213140833333334],[-47.381593,-22.213140666666668],[-47.381592833333336,-22.2131405],[-47.381593,-22.213140833333334],[-47.381593833333334,-22.213142333333334],[-47.381594,-22.213142666666666],[-47.381594,-22.213142666666666]]}}]}
|
||||
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"Id":"1","Name":"Projeto","Length":21.332976190943135,"Dist1":0.0,"Dist2":0.0},"geometry":{"id":"0","type":"LineString","coordinates":[[-47.381495333333334,-22.213068166666666],[-47.381469166666669,-22.213091333333335],[-47.38141825,-22.213137833333334],[-47.3813925,-22.213161666666668],[-47.381369666666664,-22.2131845]]}},{"type":"Feature","properties":{"Id":"2","Name":"Projeto","Length":24.045328359726675,"Dist1":0.0,"Dist2":0.0},"geometry":{"id":"1","type":"LineString","coordinates":[[-47.381340166666668,-22.213175666666668],[-47.381375333333331,-22.213137166666666],[-47.38140933333333,-22.213102666666668],[-47.381453666666665,-22.213058166666666],[-47.381496666666663,-22.213015666666667]]}}]}
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
<meta name="viewport" content="width=device-width,
|
||||
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<style>
|
||||
#map_5ccd27c8efed2f1d5f821cab9236ab21 {
|
||||
#map_f0b88e3c9fbbb871f17a4dbd225c6fff {
|
||||
position: relative;
|
||||
width: 100.0%;
|
||||
height: 100.0%;
|
||||
|
|
@ -39,16 +39,16 @@
|
|||
<body>
|
||||
|
||||
|
||||
<div class="folium-map" id="map_5ccd27c8efed2f1d5f821cab9236ab21" ></div>
|
||||
<div class="folium-map" id="map_f0b88e3c9fbbb871f17a4dbd225c6fff" ></div>
|
||||
|
||||
</body>
|
||||
<script>
|
||||
|
||||
|
||||
var map_5ccd27c8efed2f1d5f821cab9236ab21 = L.map(
|
||||
"map_5ccd27c8efed2f1d5f821cab9236ab21",
|
||||
var map_f0b88e3c9fbbb871f17a4dbd225c6fff = L.map(
|
||||
"map_f0b88e3c9fbbb871f17a4dbd225c6fff",
|
||||
{
|
||||
center: [-22.213058416666666, -47.381547499999996],
|
||||
center: [-22.213100083333334, -47.38141841666666],
|
||||
crs: L.CRS.EPSG3857,
|
||||
zoom: 12,
|
||||
zoomControl: true,
|
||||
|
|
@ -60,13 +60,13 @@
|
|||
|
||||
|
||||
|
||||
var tile_layer_9147458df3f36d24646c83b8de0dce25 = L.tileLayer(
|
||||
var tile_layer_fb166f510d9dc07cae4560a0da44b242 = 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_9147458df3f36d24646c83b8de0dce25.addTo(map_5ccd27c8efed2f1d5f821cab9236ab21);
|
||||
tile_layer_fb166f510d9dc07cae4560a0da44b242.addTo(map_f0b88e3c9fbbb871f17a4dbd225c6fff);
|
||||
|
||||
|
||||
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
}*/
|
||||
});
|
||||
}
|
||||
function geo_json_04db30abe29c98f8b704fb7bbb35c27c_onEachFeature(feature, layer) {
|
||||
function geo_json_afbdf9289c407bb446a01d22a6f4e29b_onEachFeature(feature, layer) {
|
||||
layer.on({
|
||||
|
||||
click: function(e) {
|
||||
|
|
@ -118,20 +118,20 @@
|
|||
}*/
|
||||
});
|
||||
};
|
||||
var geo_json_04db30abe29c98f8b704fb7bbb35c27c = L.geoJson(null, {
|
||||
onEachFeature: geo_json_04db30abe29c98f8b704fb7bbb35c27c_onEachFeature,
|
||||
var geo_json_afbdf9289c407bb446a01d22a6f4e29b = L.geoJson(null, {
|
||||
onEachFeature: geo_json_afbdf9289c407bb446a01d22a6f4e29b_onEachFeature,
|
||||
|
||||
});
|
||||
|
||||
function geo_json_04db30abe29c98f8b704fb7bbb35c27c_add (data) {
|
||||
geo_json_04db30abe29c98f8b704fb7bbb35c27c
|
||||
function geo_json_afbdf9289c407bb446a01d22a6f4e29b_add (data) {
|
||||
geo_json_afbdf9289c407bb446a01d22a6f4e29b
|
||||
.addData(data);
|
||||
}
|
||||
geo_json_04db30abe29c98f8b704fb7bbb35c27c_add({"features": [{"geometry": {"coordinates": [[-47.3815305, -22.213009], [-47.381530166666664, -22.213009], [-47.38152816666667, -22.213008833333333], [-47.38152766666666, -22.213008833333333], [-47.3815275, -22.213008833333333], [-47.381527166666665, -22.213008833333333], [-47.381528333333335, -22.213007833333332], [-47.3815315, -22.21300383333333], [-47.381532666666665, -22.213001666666667], [-47.38153366666667, -22.212998833333334], [-47.381534, -22.212990666666666], [-47.3815325, -22.212985333333332], [-47.381526666666666, -22.2129765], [-47.381525333333336, -22.212974166666665], [-47.38152566666667, -22.212974833333334], [-47.38152983333333, -22.212982666666665], [-47.3815305, -22.212983833333332], [-47.38152566666667, -22.21298133333333], [-47.38152316666667, -22.212980166666668], [-47.381521, -22.212979166666667], [-47.38151583333333, -22.2129785], [-47.38151533333333, -22.212979333333333], [-47.381516, -22.212979833333332], [-47.381516166666664, -22.21298], [-47.3815185, -22.212979666666666], [-47.381518, -22.2129795], [-47.381517833333334, -22.2129795], [-47.38152266666667, -22.212981833333334], [-47.3815235, -22.212982166666666], [-47.3815295, -22.212984666666667], [-47.38153283333333, -22.21298566666667], [-47.38153333333333, -22.212985833333335], [-47.381529, -22.212989166666667], [-47.38152733333333, -22.212990833333333], [-47.38152516666667, -22.212994333333334], [-47.381523666666666, -22.212996], [-47.38152266666667, -22.212997], [-47.381519, -22.213001], [-47.3815185, -22.213001666666667], [-47.381512666666666, -22.213006833333335], [-47.381508, -22.213010166666667], [-47.381505, -22.213013833333335], [-47.3815015, -22.213023166666666], [-47.381501, -22.213028], [-47.381502166666664, -22.213038166666667], [-47.381502, -22.213043333333335], [-47.381502, -22.213052833333332], [-47.381504166666666, -22.213057666666668], [-47.38150666666667, -22.213062833333332], [-47.38151116666667, -22.21307283333333], [-47.38151216666667, -22.213077333333334], [-47.38151366666666, -22.213084], [-47.3815145, -22.213088666666668], [-47.381517, -22.213092166666666], [-47.3815215, -22.21309533333333], [-47.38152266666667, -22.213096], [-47.3815255, -22.213096333333333], [-47.3815285, -22.2130975], [-47.3815315, -22.213099166666666], [-47.3815385, -22.213101166666668], [-47.381541666666664, -22.213102833333334], [-47.381549666666665, -22.21311], [-47.381554666666666, -22.213113333333332], [-47.381561, -22.213115], [-47.381571, -22.2131175], [-47.38157483333333, -22.213119], [-47.381578, -22.213125833333333], [-47.381581, -22.213127833333335], [-47.381585, -22.213130666666668], [-47.38158633333333, -22.213132166666668], [-47.381587333333336, -22.213133], [-47.381587333333336, -22.213133833333334], [-47.381588, -22.213134], [-47.38158883333333, -22.213135166666667], [-47.38159, -22.213137], [-47.381590333333335, -22.213137833333334], [-47.38159233333333, -22.213139666666667], [-47.38159316666667, -22.213140833333334], [-47.381593, -22.213140666666668], [-47.381592833333336, -22.2131405], [-47.381593, -22.213140833333334], [-47.38159383333333, -22.213142333333334], [-47.381594, -22.213142666666666], [-47.381594, -22.213142666666666]], "id": null, "type": "LineString"}, "id": 0, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "1", "Length": 33.462942499632895, "Name": "17_12_2024_08_33_02"}, "type": "Feature"}], "type": "FeatureCollection"});
|
||||
geo_json_afbdf9289c407bb446a01d22a6f4e29b_add({"features": [{"geometry": {"coordinates": [[-47.38149533333333, -22.213068166666666], [-47.38146916666667, -22.213091333333335], [-47.38141825, -22.213137833333334], [-47.3813925, -22.213161666666668], [-47.381369666666664, -22.2131845]], "id": "0", "type": "LineString"}, "id": 0, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "1", "Length": 21.332976190943135, "Name": "Projeto"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.38134016666667, -22.213175666666668], [-47.38137533333333, -22.213137166666666], [-47.38140933333333, -22.213102666666668], [-47.381453666666665, -22.213058166666666], [-47.38149666666666, -22.213015666666667]], "id": "1", "type": "LineString"}, "id": 1, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "2", "Length": 24.045328359726675, "Name": "Projeto"}, "type": "Feature"}], "type": "FeatureCollection"});
|
||||
|
||||
|
||||
|
||||
geo_json_04db30abe29c98f8b704fb7bbb35c27c.addTo(map_5ccd27c8efed2f1d5f821cab9236ab21);
|
||||
geo_json_afbdf9289c407bb446a01d22a6f4e29b.addTo(map_f0b88e3c9fbbb871f17a4dbd225c6fff);
|
||||
|
||||
</script>
|
||||
|
||||
|
|
@ -152,7 +152,7 @@
|
|||
}
|
||||
trajeto_json_add({"features": []});
|
||||
|
||||
trajeto_json.addTo(map_5ccd27c8efed2f1d5f821cab9236ab21);
|
||||
trajeto_json.addTo(map_f0b88e3c9fbbb871f17a4dbd225c6fff);
|
||||
|
||||
function adicionarGeometria(novaGeometria) {
|
||||
trajeto_json.addData(novaGeometria);
|
||||
|
|
@ -210,7 +210,7 @@
|
|||
}
|
||||
trajeto_dinamico_json_add({"features": []});
|
||||
|
||||
trajeto_dinamico_json.addTo(map_5ccd27c8efed2f1d5f821cab9236ab21);
|
||||
trajeto_dinamico_json.addTo(map_f0b88e3c9fbbb871f17a4dbd225c6fff);
|
||||
|
||||
function adicionarGeometriaDinamica(novaGeometria) {
|
||||
trajeto_dinamico_json.addData(novaGeometria);
|
||||
|
|
@ -263,9 +263,9 @@
|
|||
|
||||
var marcadorEquipamento = L.marker([0, 0], {
|
||||
icon: customIcon
|
||||
}).addTo(map_5ccd27c8efed2f1d5f821cab9236ab21);
|
||||
}).addTo(map_f0b88e3c9fbbb871f17a4dbd225c6fff);
|
||||
|
||||
var marcadorBase = L.marker([0, 0], {}).addTo(map_5ccd27c8efed2f1d5f821cab9236ab21);
|
||||
var marcadorBase = L.marker([0, 0], {}).addTo(map_f0b88e3c9fbbb871f17a4dbd225c6fff);
|
||||
var icon = L.AwesomeMarkers.icon(
|
||||
{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}
|
||||
);
|
||||
|
|
@ -347,7 +347,7 @@
|
|||
}
|
||||
|
||||
if (foco) {
|
||||
map_5ccd27c8efed2f1d5f821cab9236ab21.setView(novaPosicao, map_5ccd27c8efed2f1d5f821cab9236ab21.getZoom());
|
||||
map_f0b88e3c9fbbb871f17a4dbd225c6fff.setView(novaPosicao, map_f0b88e3c9fbbb871f17a4dbd225c6fff.getZoom());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -364,7 +364,7 @@
|
|||
function atualizarSelecaoRuas(selecionadas) {
|
||||
selecionadas = JSON.parse(selecionadas);
|
||||
RuasSelecionadas = Array.isArray(selecionadas) ? [...selecionadas] : [];
|
||||
geo_json_04db30abe29c98f8b704fb7bbb35c27c.eachLayer(function (layer) {
|
||||
geo_json_afbdf9289c407bb446a01d22a6f4e29b.eachLayer(function (layer) {
|
||||
if (RuasSelecionadas.includes(parseInt(layer.feature.id))) {
|
||||
layer.setStyle({ color: 'blue' });
|
||||
} else {
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -16,6 +16,7 @@ namespace AgroMonitor.Forms
|
|||
AsyncTaskTimerModel tmrDadosMapa;
|
||||
string path = Variaveis.CaminhoSistema + Variaveis.CaminhoOperacoes + "\\" + MapasVariaveisModel.NomeArquivoMapaInterativoSaida;
|
||||
UltrasonicA05Configuracoes ConfigUltrassom = UltrasonicA05Helper.CarregarConfiguracaoPadrao(ConfiguracaoSensorUltrassonico.NaoUtilizado);
|
||||
bool carregarOpPadrao = true;
|
||||
|
||||
public frmAjustesOperacao()
|
||||
{
|
||||
|
|
@ -42,12 +43,12 @@ namespace AgroMonitor.Forms
|
|||
|
||||
private void cmbModosOperacao_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
AtualizarDadosOperacao(true);
|
||||
AtualizarDadosOperacao();
|
||||
}
|
||||
|
||||
private void AtualizarDadosOperacao(bool CarregarOperacao)
|
||||
private void AtualizarDadosOperacao()
|
||||
{
|
||||
if (CarregarOperacao)
|
||||
if (carregarOpPadrao)
|
||||
{
|
||||
OperacaoModel.CarregarParametrosOperacaoPadrao((ModoOperacao)cmbModosOperacao.SelectedIndex);
|
||||
}
|
||||
|
|
@ -162,14 +163,15 @@ namespace AgroMonitor.Forms
|
|||
{
|
||||
tabControl1.SelectedIndex = 1;
|
||||
|
||||
AtualizarDadosOperacao(false);
|
||||
carregarOpPadrao = false;
|
||||
cmbModosOperacao.SelectedIndex = (int)Variaveis.OperacaoEmAndamento.Modo;
|
||||
|
||||
MessageBox.Show("Operação carregada com sucesso!", "Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
|
||||
tmrDadosMapa = new AsyncTaskTimerModel("tmrDadosMapa", tmrDadosMapa_Tick, 500, this);
|
||||
tmrDadosMapa.Start();
|
||||
|
||||
await Task.Delay(1000);
|
||||
await Task.Delay(2000);
|
||||
|
||||
if (ruasSelecionadas.Any())
|
||||
{
|
||||
|
|
@ -177,6 +179,8 @@ namespace AgroMonitor.Forms
|
|||
GPSService.AtualizarRuasSelecionadas(ruasSelecionadas);
|
||||
File.Delete(path);
|
||||
}
|
||||
|
||||
carregarOpPadrao = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
|
|
@ -1,47 +1 @@
|
|||
{
|
||||
"type": "FeatureCollection",
|
||||
"features": [
|
||||
{
|
||||
"type": "Feature",
|
||||
"properties": {
|
||||
"Id": "1",
|
||||
"Name": "Projeto",
|
||||
"Length": 21.332976190943135,
|
||||
"Dist1": 0.0,
|
||||
"Dist2": 0.0
|
||||
},
|
||||
"geometry": {
|
||||
"id": null,
|
||||
"type": "LineString",
|
||||
"coordinates": [
|
||||
[-47.381495333333334, -22.213068166666666],
|
||||
[-47.38146916666667, -22.213091333333335],
|
||||
[-47.38141825, -22.213137833333333],
|
||||
[-47.3813925, -22.213161666666668],
|
||||
[-47.381369666666664, -22.2131845]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Feature",
|
||||
"properties": {
|
||||
"Id": "2",
|
||||
"Name": "Projeto",
|
||||
"Length": 24.045328359726675,
|
||||
"Dist1": 0.0,
|
||||
"Dist2": 0.0
|
||||
},
|
||||
"geometry": {
|
||||
"id": null,
|
||||
"type": "LineString",
|
||||
"coordinates": [
|
||||
[-47.381340166666668, -22.213175666666668],
|
||||
[-47.381375333333331, -22.213137166666666],
|
||||
[-47.38140933333333, -22.213102666666668],
|
||||
[-47.381453666666665, -22.213058166666666],
|
||||
[-47.381496666666663, -22.213015666666667]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"Id":"1","Name":"Projeto","Length":21.332976190943135,"Dist1":0.0,"Dist2":0.0},"geometry":{"id":"0","type":"LineString","coordinates":[[-47.381495333333334,-22.213068166666666],[-47.381469166666669,-22.213091333333335],[-47.38141825,-22.213137833333334],[-47.3813925,-22.213161666666668],[-47.381369666666664,-22.2131845]]}},{"type":"Feature","properties":{"Id":"2","Name":"Projeto","Length":24.045328359726675,"Dist1":0.0,"Dist2":0.0},"geometry":{"id":"1","type":"LineString","coordinates":[[-47.381340166666668,-22.213175666666668],[-47.381375333333331,-22.213137166666666],[-47.38140933333333,-22.213102666666668],[-47.381453666666665,-22.213058166666666],[-47.381496666666663,-22.213015666666667]]}}]}
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
<meta name="viewport" content="width=device-width,
|
||||
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<style>
|
||||
#map_978f1cf22df0182e13bba9beda806341 {
|
||||
#map_db1225b1e62d9bab1ce65e5a1b0337da {
|
||||
position: relative;
|
||||
width: 100.0%;
|
||||
height: 100.0%;
|
||||
|
|
@ -39,14 +39,14 @@
|
|||
<body>
|
||||
|
||||
|
||||
<div class="folium-map" id="map_978f1cf22df0182e13bba9beda806341" ></div>
|
||||
<div class="folium-map" id="map_db1225b1e62d9bab1ce65e5a1b0337da" ></div>
|
||||
|
||||
</body>
|
||||
<script>
|
||||
|
||||
|
||||
var map_978f1cf22df0182e13bba9beda806341 = L.map(
|
||||
"map_978f1cf22df0182e13bba9beda806341",
|
||||
var map_db1225b1e62d9bab1ce65e5a1b0337da = L.map(
|
||||
"map_db1225b1e62d9bab1ce65e5a1b0337da",
|
||||
{
|
||||
center: [-22.213100083333334, -47.38141841666666],
|
||||
crs: L.CRS.EPSG3857,
|
||||
|
|
@ -60,13 +60,13 @@
|
|||
|
||||
|
||||
|
||||
var tile_layer_c69220a59438ecb349e64b03d41a2724 = L.tileLayer(
|
||||
var tile_layer_780db0f51e5cd4e2609b0632b0bfa588 = 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_c69220a59438ecb349e64b03d41a2724.addTo(map_978f1cf22df0182e13bba9beda806341);
|
||||
tile_layer_780db0f51e5cd4e2609b0632b0bfa588.addTo(map_db1225b1e62d9bab1ce65e5a1b0337da);
|
||||
|
||||
|
||||
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
}*/
|
||||
});
|
||||
}
|
||||
function geo_json_8f995dd45ce0247620e88f5983daaaeb_onEachFeature(feature, layer) {
|
||||
function geo_json_c919ee5e792846159b7b6a14116f9dcb_onEachFeature(feature, layer) {
|
||||
layer.on({
|
||||
|
||||
click: function(e) {
|
||||
|
|
@ -118,20 +118,20 @@
|
|||
}*/
|
||||
});
|
||||
};
|
||||
var geo_json_8f995dd45ce0247620e88f5983daaaeb = L.geoJson(null, {
|
||||
onEachFeature: geo_json_8f995dd45ce0247620e88f5983daaaeb_onEachFeature,
|
||||
var geo_json_c919ee5e792846159b7b6a14116f9dcb = L.geoJson(null, {
|
||||
onEachFeature: geo_json_c919ee5e792846159b7b6a14116f9dcb_onEachFeature,
|
||||
|
||||
});
|
||||
|
||||
function geo_json_8f995dd45ce0247620e88f5983daaaeb_add (data) {
|
||||
geo_json_8f995dd45ce0247620e88f5983daaaeb
|
||||
function geo_json_c919ee5e792846159b7b6a14116f9dcb_add (data) {
|
||||
geo_json_c919ee5e792846159b7b6a14116f9dcb
|
||||
.addData(data);
|
||||
}
|
||||
geo_json_8f995dd45ce0247620e88f5983daaaeb_add({"features": [{"geometry": {"coordinates": [[-47.38149533333333, -22.213068166666666], [-47.38146916666667, -22.213091333333335], [-47.38141825, -22.213137833333334], [-47.3813925, -22.213161666666668], [-47.381369666666664, -22.2131845]], "id": null, "type": "LineString"}, "id": 0, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "1", "Length": 21.332976190943135, "Name": "Projeto"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.38134016666667, -22.213175666666668], [-47.38137533333333, -22.213137166666666], [-47.38140933333333, -22.213102666666668], [-47.381453666666665, -22.213058166666666], [-47.38149666666666, -22.213015666666667]], "id": null, "type": "LineString"}, "id": 1, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "2", "Length": 24.045328359726675, "Name": "Projeto"}, "type": "Feature"}], "type": "FeatureCollection"});
|
||||
geo_json_c919ee5e792846159b7b6a14116f9dcb_add({"features": [{"geometry": {"coordinates": [[-47.38149533333333, -22.213068166666666], [-47.38146916666667, -22.213091333333335], [-47.38141825, -22.213137833333334], [-47.3813925, -22.213161666666668], [-47.381369666666664, -22.2131845]], "id": "0", "type": "LineString"}, "id": 0, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "1", "Length": 21.332976190943135, "Name": "Projeto"}, "type": "Feature"}, {"geometry": {"coordinates": [[-47.38134016666667, -22.213175666666668], [-47.38137533333333, -22.213137166666666], [-47.38140933333333, -22.213102666666668], [-47.381453666666665, -22.213058166666666], [-47.38149666666666, -22.213015666666667]], "id": "1", "type": "LineString"}, "id": 1, "properties": {"Dist1": 0.0, "Dist2": 0.0, "Id": "2", "Length": 24.045328359726675, "Name": "Projeto"}, "type": "Feature"}], "type": "FeatureCollection"});
|
||||
|
||||
|
||||
|
||||
geo_json_8f995dd45ce0247620e88f5983daaaeb.addTo(map_978f1cf22df0182e13bba9beda806341);
|
||||
geo_json_c919ee5e792846159b7b6a14116f9dcb.addTo(map_db1225b1e62d9bab1ce65e5a1b0337da);
|
||||
|
||||
</script>
|
||||
|
||||
|
|
@ -152,7 +152,7 @@
|
|||
}
|
||||
trajeto_json_add({"features": []});
|
||||
|
||||
trajeto_json.addTo(map_978f1cf22df0182e13bba9beda806341);
|
||||
trajeto_json.addTo(map_db1225b1e62d9bab1ce65e5a1b0337da);
|
||||
|
||||
function adicionarGeometria(novaGeometria) {
|
||||
trajeto_json.addData(novaGeometria);
|
||||
|
|
@ -210,7 +210,7 @@
|
|||
}
|
||||
trajeto_dinamico_json_add({"features": []});
|
||||
|
||||
trajeto_dinamico_json.addTo(map_978f1cf22df0182e13bba9beda806341);
|
||||
trajeto_dinamico_json.addTo(map_db1225b1e62d9bab1ce65e5a1b0337da);
|
||||
|
||||
function adicionarGeometriaDinamica(novaGeometria) {
|
||||
trajeto_dinamico_json.addData(novaGeometria);
|
||||
|
|
@ -263,9 +263,9 @@
|
|||
|
||||
var marcadorEquipamento = L.marker([0, 0], {
|
||||
icon: customIcon
|
||||
}).addTo(map_978f1cf22df0182e13bba9beda806341);
|
||||
}).addTo(map_db1225b1e62d9bab1ce65e5a1b0337da);
|
||||
|
||||
var marcadorBase = L.marker([0, 0], {}).addTo(map_978f1cf22df0182e13bba9beda806341);
|
||||
var marcadorBase = L.marker([0, 0], {}).addTo(map_db1225b1e62d9bab1ce65e5a1b0337da);
|
||||
var icon = L.AwesomeMarkers.icon(
|
||||
{"extraClasses": "fa-rotate-0", "icon": "info-sign", "iconColor": "white", "markerColor": "red", "prefix": "glyphicon"}
|
||||
);
|
||||
|
|
@ -347,7 +347,7 @@
|
|||
}
|
||||
|
||||
if (foco) {
|
||||
map_978f1cf22df0182e13bba9beda806341.setView(novaPosicao, map_978f1cf22df0182e13bba9beda806341.getZoom());
|
||||
map_db1225b1e62d9bab1ce65e5a1b0337da.setView(novaPosicao, map_db1225b1e62d9bab1ce65e5a1b0337da.getZoom());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -364,7 +364,7 @@
|
|||
function atualizarSelecaoRuas(selecionadas) {
|
||||
selecionadas = JSON.parse(selecionadas);
|
||||
RuasSelecionadas = Array.isArray(selecionadas) ? [...selecionadas] : [];
|
||||
geo_json_8f995dd45ce0247620e88f5983daaaeb.eachLayer(function (layer) {
|
||||
geo_json_c919ee5e792846159b7b6a14116f9dcb.eachLayer(function (layer) {
|
||||
if (RuasSelecionadas.includes(parseInt(layer.feature.id))) {
|
||||
layer.setStyle({ color: 'blue' });
|
||||
} else {
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue