ajuste simulacao
This commit is contained in:
parent
bb30a71dc3
commit
d93bea8441
Binary file not shown.
Binary file not shown.
|
|
@ -3,36 +3,12 @@
|
|||
"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}",
|
||||
"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\\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\\frmsimulacaomapagps.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\frmsimulacaomapagps.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\\frmoperacaomanual.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\operacoes\\frmoperacaomanual.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\\forms\\operacoes\\frmresultadosoperacao.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
|
||||
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\operacoes\\frmresultadosoperacao.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\\variaveis.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\models\\variaveis.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
|
|
@ -42,58 +18,8 @@
|
|||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 4,
|
||||
"SelectedChildIndex": 0,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 6,
|
||||
"Title": "frmResultadosOperacao.cs [Design]",
|
||||
"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 [Design]",
|
||||
"RelativeToolTip": "AgroBase\\Forms\\Operacoes\\frmResultadosOperacao.cs [Design]",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-12-18T15:16:47.82Z",
|
||||
"EditorCaption": " [Design]"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 7,
|
||||
"Title": "Variaveis.cs",
|
||||
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\Variaveis.cs",
|
||||
"RelativeDocumentMoniker": "AgroBase\\Models\\Variaveis.cs",
|
||||
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\Variaveis.cs",
|
||||
"RelativeToolTip": "AgroBase\\Models\\Variaveis.cs",
|
||||
"ViewState": "AQIAAC8AAAAAAAAAAAAywE0AAAAsAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-12-18T10:12:52.226Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 4,
|
||||
"Title": "frmOperacaoManual.cs",
|
||||
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\Operacoes\\frmOperacaoManual.cs",
|
||||
"RelativeDocumentMoniker": "AgroBase\\Forms\\Operacoes\\frmOperacaoManual.cs",
|
||||
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\Operacoes\\frmOperacaoManual.cs",
|
||||
"RelativeToolTip": "AgroBase\\Forms\\Operacoes\\frmOperacaoManual.cs",
|
||||
"ViewState": "AQIAAD0AAAAAAAAAAAAUwJ4AAABuAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-12-18T10:08:22.722Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 3,
|
||||
"Title": "frmSimulacaoMapaGPS.cs",
|
||||
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmSimulacaoMapaGPS.cs",
|
||||
"RelativeDocumentMoniker": "AgroBase\\Forms\\frmSimulacaoMapaGPS.cs",
|
||||
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\frmSimulacaoMapaGPS.cs",
|
||||
"RelativeToolTip": "AgroBase\\Forms\\frmSimulacaoMapaGPS.cs",
|
||||
"ViewState": "AQIAABoAAAAAAAAAAAAUwKgAAAAAAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-12-17T20:31:58.828Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
|
|
@ -102,49 +28,23 @@
|
|||
"RelativeDocumentMoniker": "AgroBase\\Models\\Operacoes\\OperacaoModel.cs",
|
||||
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\Operacoes\\OperacaoModel.cs",
|
||||
"RelativeToolTip": "AgroBase\\Models\\Operacoes\\OperacaoModel.cs",
|
||||
"ViewState": "AQIAAN8EAAAAAAAAAAAwwOcEAAAAAAAA",
|
||||
"ViewState": "AQIAAF0GAAAAAAAAAAApwBQHAABTAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-12-17T20:14:20.606Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"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": "AQIAAGQCAAAAAAAAAAAUwGICAACIAAAA",
|
||||
"ViewState": "AQIAAHsCAAAAAAAAAAAnwOkCAABUAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-12-18T13:02:20.66Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 5,
|
||||
"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": "AQIAADcAAAAAAAAAAAAwwAIDAAAzAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-12-18T14:06:28.014Z",
|
||||
"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": "AQIAANcAAAAAAAAAAAAswFMBAABUAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-12-18T12:25:31.449Z",
|
||||
"EditorCaption": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -691,19 +691,27 @@ namespace AgroBase.Forms.Operacoes
|
|||
|
||||
private Bitmap CarregarImagemCamera(string Caminho)
|
||||
{
|
||||
if (File.Exists(Caminho + trbMomento.Value + ".jpg"))
|
||||
string caminhoCompleto = Caminho + trbMomento.Value + ".jpg";
|
||||
Bitmap frame = new Bitmap(1, 1);
|
||||
using (Graphics g = Graphics.FromImage(frame))
|
||||
{
|
||||
return new Bitmap(Image.FromFile(Caminho + trbMomento.Value + ".jpg"));
|
||||
g.Clear(Color.Black);
|
||||
}
|
||||
else
|
||||
Bitmap blackFrame = new Bitmap(frame);
|
||||
|
||||
if (File.Exists(caminhoCompleto))
|
||||
{
|
||||
Bitmap frame = new Bitmap(1, 1);
|
||||
using (Graphics g = Graphics.FromImage(frame))
|
||||
try
|
||||
{
|
||||
g.Clear(Color.Black);
|
||||
return new Bitmap(Image.FromFile(caminhoCompleto));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
return new Bitmap(frame);
|
||||
}
|
||||
|
||||
return blackFrame;
|
||||
}
|
||||
|
||||
private Bitmap DesenharDeteccoesErvas(CameraCoordenadasFrameModel frame, Bitmap bitmapOriginal)
|
||||
|
|
|
|||
|
|
@ -192,24 +192,37 @@ namespace AgroBase.Models
|
|||
// Desenhar o ponto GPS
|
||||
DrawPoint(g, x, y, pointColor);
|
||||
|
||||
GPSModel posicaoRobo = GPSService.UltimaLeitura;
|
||||
// Calcular as dimensões do robô em centímetros
|
||||
float larguraTotal = larguraEsquerda + larguraDireita; // Largura total em cm
|
||||
float comprimentoTotal = comprimentoFrente + comprimentoTras; // Comprimento total em cm
|
||||
|
||||
// Ajustar o ângulo base para cálculo dos pontos
|
||||
int agPlus = Convert.ToInt32(135 + angle);
|
||||
// Calcular os deslocamentos do GPS em relação ao centro do robô
|
||||
float deslocamentoX = (larguraTotal / 2) - larguraEsquerda; // GPS deslocado horizontalmente
|
||||
float deslocamentoY = (comprimentoTotal / 2) - comprimentoFrente; // GPS deslocado verticalmente
|
||||
|
||||
// Calcular os pontos laterais considerando zoom em latitude e longitude
|
||||
(float xET, float yET) = CalcularPontosLateraisRobo(posicaoRobo, larguraEsquerda, comprimentoTras, x, y, agPlus + 90);
|
||||
(float xDT, float yDT) = CalcularPontosLateraisRobo(posicaoRobo, larguraDireita, comprimentoTras, x, y, agPlus + 0);
|
||||
(float xEF, float yEF) = CalcularPontosLateraisRobo(posicaoRobo, larguraEsquerda, comprimentoFrente, x, y, agPlus + 180);
|
||||
(float xDF, float yDF) = CalcularPontosLateraisRobo(posicaoRobo, larguraDireita, comprimentoFrente, x, y, agPlus + 270);
|
||||
// Ajustar as dimensões para o espaço de pixels considerando o zoom
|
||||
float larguraPixel = (float)(larguraTotal * _zoom / 1e7); // Escala do zoom em pixels
|
||||
float comprimentoPixel = (float)(comprimentoTotal * _zoom / 1e7); // Escala do zoom em pixels
|
||||
|
||||
// Calcular os cantos do retângulo usando os pontos calculados
|
||||
// Calcular os deslocamentos em pixels
|
||||
float deslocamentoXPixel = (float)(deslocamentoX * _zoom / 1e7);
|
||||
float deslocamentoYPixel = (float)(deslocamentoY * _zoom / 1e7);
|
||||
|
||||
// Coordenadas ajustadas para o centro do robô
|
||||
float centroRoboX = x + deslocamentoXPixel; // Ajuste do deslocamento em pixels
|
||||
float centroRoboY = y - deslocamentoYPixel;
|
||||
|
||||
// Calcular os vértices do retângulo representando o robô
|
||||
PointF[] corners = new PointF[4];
|
||||
|
||||
corners[0] = new PointF(xET, yET); // Superior esquerdo
|
||||
corners[1] = new PointF(xDT, yDT); // Superior direito
|
||||
corners[2] = new PointF(xDF, yDF); // Inferior direito
|
||||
corners[3] = new PointF(xEF, yEF); // Inferior esquerdo
|
||||
// Superior esquerdo
|
||||
corners[0] = CalcularPontoRotacionado(centroRoboX, centroRoboY, -larguraPixel / 2, -comprimentoPixel / 2, angle);
|
||||
// Superior direito
|
||||
corners[1] = CalcularPontoRotacionado(centroRoboX, centroRoboY, larguraPixel / 2, -comprimentoPixel / 2, angle);
|
||||
// Inferior direito
|
||||
corners[2] = CalcularPontoRotacionado(centroRoboX, centroRoboY, larguraPixel / 2, comprimentoPixel / 2, angle);
|
||||
// Inferior esquerdo
|
||||
corners[3] = CalcularPontoRotacionado(centroRoboX, centroRoboY, -larguraPixel / 2, comprimentoPixel / 2, angle);
|
||||
|
||||
// Desenhar o contorno do robô
|
||||
using (Pen pen = new Pen(borderColor, 2))
|
||||
|
|
@ -217,15 +230,38 @@ namespace AgroBase.Models
|
|||
g.DrawPolygon(pen, corners);
|
||||
}
|
||||
|
||||
// Desenhar a linha indicando a frente do robô (do ponto central para a frente)
|
||||
DrawFrontLine(g, x, y, corners[2].X, corners[2].Y, corners[3].X, corners[3].Y, borderColor);
|
||||
// Calcular o ponto final da linha indicando a frente do robô
|
||||
float linhaFrenteComprimento = comprimentoFrente * (float)_zoom / 1e7f; // Ajustar para pixels considerando o zoom
|
||||
float frenteLinhaX = x + linhaFrenteComprimento * (float)Math.Cos((angle) * Math.PI / 180);
|
||||
float frenteLinhaY = y - linhaFrenteComprimento * (float)Math.Sin((angle) * Math.PI / 180);
|
||||
|
||||
// Desenhar a linha do GPS até a frente do robô
|
||||
using (Pen frontPen = new Pen(borderColor, 2))
|
||||
{
|
||||
g.DrawLine(frontPen, x, y, frenteLinhaX, frenteLinhaY);
|
||||
}
|
||||
|
||||
// Calcular a relação pixel para cm baseado na largura total
|
||||
float PxToCm = Math.Abs(xET - xDT) / (larguraDireita + larguraEsquerda);
|
||||
float PxToCm = larguraTotal / larguraPixel;
|
||||
|
||||
return PxToCm;
|
||||
}
|
||||
|
||||
private PointF CalcularPontoRotacionado(float centroX, float centroY, float offsetX, float offsetY, float angle)
|
||||
{
|
||||
// Converter o ângulo para radianos
|
||||
float rad = angle * (float)Math.PI / 180;
|
||||
|
||||
// Calcular as novas coordenadas após rotação
|
||||
float cos = (float)Math.Cos(rad);
|
||||
float sin = (float)Math.Sin(rad);
|
||||
|
||||
float novoX = centroX + (offsetX * cos - offsetY * sin);
|
||||
float novoY = centroY + (offsetX * sin + offsetY * cos);
|
||||
|
||||
return new PointF(novoX, novoY);
|
||||
}
|
||||
|
||||
private void DrawObstacle(Graphics g, float xRobot, float yRobot, Color pointColor, Color borderColor, float angle, Obstaculo obstaculo, float PxToCm)
|
||||
{
|
||||
GPSModel posicaoRobo = GPSService.UltimaLeitura;
|
||||
|
|
|
|||
|
|
@ -1200,26 +1200,31 @@ namespace AgroBase.Models
|
|||
var _Controle = Variaveis.OperacaoEmAndamento.Controle;
|
||||
var _ControleAnterior = Variaveis.OperacaoEmAndamento.ControleAnterior;
|
||||
|
||||
bool MovimentoLiberado = !MKS057DService.Referenciando;
|
||||
|
||||
OperacaoControleTipoModel ControleMov = _Controle.TiposControle != null ? _Controle.TiposControle.FirstOrDefault(x => x.Tipo == T_Code.Mov) : null;
|
||||
OperacaoControleTipoModel ControleDir = _Controle.TiposControle != null ? _Controle.TiposControle.FirstOrDefault(x => x.Tipo == T_Code.Dir) : null;
|
||||
|
||||
if (ControleMov != null && (Agora - ControleMov.UltimoComando).TotalMilliseconds > ControleMov.DelayEnvioComando) // && _Controle.RPM_SP != _ControleAnterior.RPM_SP
|
||||
if (MovimentoLiberado)
|
||||
{
|
||||
// Enviar comando MOV
|
||||
var Protocolos = EnviarProtocoloComando(Variaveis.OperacaoEmAndamento.DispMvd, T_Code.Mov, ForcarEnvio);
|
||||
ControleMov.UltimoComando = Agora;
|
||||
ControleMov.Comandos.AddRange(Protocolos);
|
||||
if (ControleMov != null && (Agora - ControleMov.UltimoComando).TotalMilliseconds > ControleMov.DelayEnvioComando) // && _Controle.RPM_SP != _ControleAnterior.RPM_SP
|
||||
{
|
||||
// Enviar comando MOV
|
||||
var Protocolos = EnviarProtocoloComando(Variaveis.OperacaoEmAndamento.DispMvd, T_Code.Mov, ForcarEnvio);
|
||||
ControleMov.UltimoComando = Agora;
|
||||
ControleMov.Comandos.AddRange(Protocolos);
|
||||
|
||||
_ControleAnterior.PercentualVelocidadeSP = _Controle.PercentualVelocidadeSP;
|
||||
}
|
||||
if (ControleDir != null && (Agora - ControleDir.UltimoComando).TotalMilliseconds > ControleDir.DelayEnvioComando) // && Convert.ToInt32(_Controle.Angulo) != Convert.ToInt32(_ControleAnterior.Angulo)
|
||||
{
|
||||
// Enviar comando DIR
|
||||
var Protocolos = EnviarProtocoloComando(Variaveis.OperacaoEmAndamento.DispMvd, T_Code.Dir, ForcarEnvio);
|
||||
ControleDir.UltimoComando = Agora;
|
||||
ControleDir.Comandos.AddRange(Protocolos);
|
||||
_ControleAnterior.PercentualVelocidadeSP = _Controle.PercentualVelocidadeSP;
|
||||
}
|
||||
if (ControleDir != null && (Agora - ControleDir.UltimoComando).TotalMilliseconds > ControleDir.DelayEnvioComando) // && Convert.ToInt32(_Controle.Angulo) != Convert.ToInt32(_ControleAnterior.Angulo)
|
||||
{
|
||||
// Enviar comando DIR
|
||||
var Protocolos = EnviarProtocoloComando(Variaveis.OperacaoEmAndamento.DispMvd, T_Code.Dir, ForcarEnvio);
|
||||
ControleDir.UltimoComando = Agora;
|
||||
ControleDir.Comandos.AddRange(Protocolos);
|
||||
|
||||
_ControleAnterior.Angulo = _Controle.Angulo;
|
||||
_ControleAnterior.Angulo = _Controle.Angulo;
|
||||
}
|
||||
}
|
||||
|
||||
AtualizarDadosOperacao();
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
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
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
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
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"Id":"1","Name":"18_12_2024_13_02_30","Length":64.9313379312302,"Dist1":0.0,"Dist2":0.0},"geometry":{"id":null,"type":"LineString","coordinates":[[-47.381543333333333,-22.213024833333332],[-47.381543166666667,-22.213024833333332],[-47.381543166666667,-22.213025],[-47.381543166666667,-22.213025],[-47.381543166666667,-22.213025],[-47.381543166666667,-22.213025],[-47.381543166666667,-22.213025166666668],[-47.381543,-22.213025333333334],[-47.381543,-22.213025333333334],[-47.381543166666667,-22.2130255],[-47.381543166666667,-22.2130255],[-47.381543333333333,-22.213025666666667],[-47.381543333333333,-22.213025666666667],[-47.3815435,-22.213025666666667],[-47.381543666666666,-22.213025833333333],[-47.381543833333332,-22.213025666666667],[-47.381543833333332,-22.213025666666667],[-47.381544,-22.213025666666667],[-47.381541666666664,-22.213026833333334],[-47.381538666666664,-22.213029],[-47.381535666666664,-22.213034166666667],[-47.3815335,-22.213036833333334],[-47.381531333333335,-22.213043333333335],[-47.381529833333332,-22.213046333333335],[-47.381528333333335,-22.213049666666667],[-47.381528,-22.213056666666667],[-47.381528,-22.213058666666665],[-47.38152216666667,-22.213063],[-47.381518333333332,-22.213064833333334],[-47.3815135,-22.213069],[-47.38151083333333,-22.213071666666668],[-47.38150816666667,-22.213073833333333],[-47.381503,-22.213078666666668],[-47.381500333333335,-22.213081],[-47.381495166666667,-22.213086333333333],[-47.381492666666666,-22.213088833333334],[-47.381490166666666,-22.213091333333335],[-47.381483833333334,-22.213098166666665],[-47.381479666666664,-22.213101833333333],[-47.3814715,-22.213109166666666],[-47.381467833333332,-22.213112666666667],[-47.381463833333335,-22.213116166666666],[-47.381455333333335,-22.213122666666667],[-47.381451166666665,-22.213126],[-47.381442833333331,-22.213132833333333],[-47.381438833333334,-22.213136166666665],[-47.38143516666667,-22.213139833333333],[-47.381428,-22.213147166666666],[-47.381424,-22.213150666666667],[-47.381416,-22.2131575],[-47.3814125,-22.213161166666666],[-47.381408833333332,-22.213164666666668],[-47.381401333333336,-22.213172],[-47.3813975,-22.2131755],[-47.381389333333331,-22.2131825],[-47.381385833333333,-22.213186166666667],[-47.381380333333333,-22.213192833333334],[-47.381378,-22.213195333333335],[-47.3813755,-22.213198],[-47.3813705,-22.2132035],[-47.381368,-22.213206166666666],[-47.381362333333335,-22.213210833333335],[-47.381360166666667,-22.213213333333332],[-47.3813585,-22.213216166666665],[-47.381357,-22.213219166666665],[-47.38135066666667,-22.213223],[-47.3813475,-22.213223666666668],[-47.381341166666665,-22.213222833333333],[-47.381338666666664,-22.2132215],[-47.3813365,-22.213220166666666],[-47.381333,-22.213214666666666],[-47.381332333333333,-22.213211166666667],[-47.38133366666667,-22.213204833333332],[-47.381335833333331,-22.213201833333333],[-47.381339333333337,-22.213199333333332],[-47.38134766666667,-22.213197],[-47.3813505,-22.213196],[-47.3813545,-22.213191666666667],[-47.381355166666665,-22.213188166666665],[-47.381356,-22.213184333333334],[-47.38135916666667,-22.213178166666665],[-47.381360666666666,-22.2131755],[-47.3813645,-22.213169833333332],[-47.381366666666665,-22.213167166666668],[-47.381372,-22.213161666666668],[-47.3813745,-22.213159166666667],[-47.381377333333333,-22.213156833333333],[-47.381383166666666,-22.2131525],[-47.381386333333332,-22.213150333333335],[-47.381393333333335,-22.213146666666667],[-47.381397,-22.213145166666667],[-47.381400666666664,-22.213143833333334],[-47.381407,-22.213141],[-47.381408833333332,-22.213139],[-47.38141233333333,-22.213131166666667],[-47.3814135,-22.213127166666666],[-47.3814145,-22.213123833333334],[-47.381417166666665,-22.213117666666665],[-47.381418666666669,-22.213114833333332],[-47.381422,-22.213109],[-47.381424166666669,-22.213106166666666],[-47.3814265,-22.213103333333333],[-47.381431666666664,-22.213098],[-47.3814345,-22.213095333333332],[-47.3814405,-22.213090666666666],[-47.3814435,-22.213088666666668],[-47.3814505,-22.213084833333333],[-47.381453833333332,-22.213083166666667],[-47.38145733333333,-22.213081666666668],[-47.381463833333335,-22.213078666666668],[-47.381465333333331,-22.2130765],[-47.381468333333331,-22.2130695],[-47.381470333333333,-22.2130665],[-47.3814725,-22.213064],[-47.381477333333336,-22.213058833333335],[-47.38147983333333,-22.213056166666668],[-47.3814825,-22.213053666666667],[-47.3814885,-22.213049],[-47.381491333333337,-22.213046833333333],[-47.381498,-22.213043],[-47.3815015,-22.213041333333333],[-47.381503833333333,-22.213039333333334],[-47.381507,-22.213033666666668],[-47.381508,-22.2130295],[-47.381510166666665,-22.213022666666667],[-47.3815115,-22.2130195],[-47.381512833333332,-22.213016666666668],[-47.381516,-22.213010666666666],[-47.381518,-22.213007666666666],[-47.3815225,-22.213001833333333],[-47.3815225,-22.213001833333333]]}}]}
|
||||
{"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]]}}]}
|
||||
File diff suppressed because one or more lines are too long
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
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_0fff78eb96d18efec1cee81d04739815 {
|
||||
#map_2a97fe143e1a57c5373ce602f0b267bf {
|
||||
position: relative;
|
||||
width: 100.0%;
|
||||
height: 100.0%;
|
||||
|
|
@ -39,14 +39,14 @@
|
|||
<body>
|
||||
|
||||
|
||||
<div class="folium-map" id="map_0fff78eb96d18efec1cee81d04739815" ></div>
|
||||
<div class="folium-map" id="map_2a97fe143e1a57c5373ce602f0b267bf" ></div>
|
||||
|
||||
</body>
|
||||
<script>
|
||||
|
||||
|
||||
var map_0fff78eb96d18efec1cee81d04739815 = L.map(
|
||||
"map_0fff78eb96d18efec1cee81d04739815",
|
||||
var map_2a97fe143e1a57c5373ce602f0b267bf = L.map(
|
||||
"map_2a97fe143e1a57c5373ce602f0b267bf",
|
||||
{
|
||||
center: [-22.213100083333334, -47.38141841666666],
|
||||
crs: L.CRS.EPSG3857,
|
||||
|
|
@ -60,13 +60,13 @@
|
|||
|
||||
|
||||
|
||||
var tile_layer_34bda382118d1e677c622cff3c40dd70 = L.tileLayer(
|
||||
var tile_layer_cec48e9f9320eca1ecf867866cacccd7 = 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_34bda382118d1e677c622cff3c40dd70.addTo(map_0fff78eb96d18efec1cee81d04739815);
|
||||
tile_layer_cec48e9f9320eca1ecf867866cacccd7.addTo(map_2a97fe143e1a57c5373ce602f0b267bf);
|
||||
|
||||
|
||||
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
}*/
|
||||
});
|
||||
}
|
||||
function geo_json_f1da1bfaa69b1a5885ba8a223c93d9bc_onEachFeature(feature, layer) {
|
||||
function geo_json_02e5d4ac6c7aea7e6316347630612906_onEachFeature(feature, layer) {
|
||||
layer.on({
|
||||
|
||||
click: function(e) {
|
||||
|
|
@ -118,20 +118,20 @@
|
|||
}*/
|
||||
});
|
||||
};
|
||||
var geo_json_f1da1bfaa69b1a5885ba8a223c93d9bc = L.geoJson(null, {
|
||||
onEachFeature: geo_json_f1da1bfaa69b1a5885ba8a223c93d9bc_onEachFeature,
|
||||
var geo_json_02e5d4ac6c7aea7e6316347630612906 = L.geoJson(null, {
|
||||
onEachFeature: geo_json_02e5d4ac6c7aea7e6316347630612906_onEachFeature,
|
||||
|
||||
});
|
||||
|
||||
function geo_json_f1da1bfaa69b1a5885ba8a223c93d9bc_add (data) {
|
||||
geo_json_f1da1bfaa69b1a5885ba8a223c93d9bc
|
||||
function geo_json_02e5d4ac6c7aea7e6316347630612906_add (data) {
|
||||
geo_json_02e5d4ac6c7aea7e6316347630612906
|
||||
.addData(data);
|
||||
}
|
||||
geo_json_f1da1bfaa69b1a5885ba8a223c93d9bc_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_02e5d4ac6c7aea7e6316347630612906_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_f1da1bfaa69b1a5885ba8a223c93d9bc.addTo(map_0fff78eb96d18efec1cee81d04739815);
|
||||
geo_json_02e5d4ac6c7aea7e6316347630612906.addTo(map_2a97fe143e1a57c5373ce602f0b267bf);
|
||||
|
||||
</script>
|
||||
|
||||
|
|
@ -152,7 +152,7 @@
|
|||
}
|
||||
trajeto_json_add({"features": []});
|
||||
|
||||
trajeto_json.addTo(map_0fff78eb96d18efec1cee81d04739815);
|
||||
trajeto_json.addTo(map_2a97fe143e1a57c5373ce602f0b267bf);
|
||||
|
||||
function adicionarGeometria(novaGeometria) {
|
||||
trajeto_json.addData(novaGeometria);
|
||||
|
|
@ -210,7 +210,7 @@
|
|||
}
|
||||
trajeto_dinamico_json_add({"features": []});
|
||||
|
||||
trajeto_dinamico_json.addTo(map_0fff78eb96d18efec1cee81d04739815);
|
||||
trajeto_dinamico_json.addTo(map_2a97fe143e1a57c5373ce602f0b267bf);
|
||||
|
||||
function adicionarGeometriaDinamica(novaGeometria) {
|
||||
trajeto_dinamico_json.addData(novaGeometria);
|
||||
|
|
@ -263,9 +263,9 @@
|
|||
|
||||
var marcadorEquipamento = L.marker([0, 0], {
|
||||
icon: customIcon
|
||||
}).addTo(map_0fff78eb96d18efec1cee81d04739815);
|
||||
}).addTo(map_2a97fe143e1a57c5373ce602f0b267bf);
|
||||
|
||||
var marcadorBase = L.marker([0, 0], {}).addTo(map_0fff78eb96d18efec1cee81d04739815);
|
||||
var marcadorBase = L.marker([0, 0], {}).addTo(map_2a97fe143e1a57c5373ce602f0b267bf);
|
||||
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_0fff78eb96d18efec1cee81d04739815.setView(novaPosicao, map_0fff78eb96d18efec1cee81d04739815.getZoom());
|
||||
map_2a97fe143e1a57c5373ce602f0b267bf.setView(novaPosicao, map_2a97fe143e1a57c5373ce602f0b267bf.getZoom());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -364,7 +364,7 @@
|
|||
function atualizarSelecaoRuas(selecionadas) {
|
||||
selecionadas = JSON.parse(selecionadas);
|
||||
RuasSelecionadas = Array.isArray(selecionadas) ? [...selecionadas] : [];
|
||||
geo_json_f1da1bfaa69b1a5885ba8a223c93d9bc.eachLayer(function (layer) {
|
||||
geo_json_02e5d4ac6c7aea7e6316347630612906.eachLayer(function (layer) {
|
||||
if (RuasSelecionadas.includes(parseInt(layer.feature.id))) {
|
||||
layer.setStyle({ color: 'blue' });
|
||||
} else {
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue