sonar e definicao de rota dinamica
This commit is contained in:
parent
df5605c649
commit
91c4647b81
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -3,24 +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\\forms\\operacoes\\frmoperacaomanual.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
|
||||
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\operacoes\\frmoperacaomanual.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\\mapasmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\models\\mapasmodel.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\\models\\operacoes\\operacaomapagpsmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\models\\operacoes\\operacaomapagpsmodel.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\\frmoperacaomapagps.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\operacoes\\frmoperacaomapagps.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\\sonarmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\models\\sonarmodel.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\\frmoperacaomapagps.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
|
||||
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\forms\\operacoes\\frmoperacaomapagps.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\\modules\\sensoriamentomodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{C54B41C0-1D21-4E3E-949E-0F86BBC86A33}|AgroBase\\AgroBase.csproj|solutionrelative:agrobase\\models\\modules\\sensoriamentomodel.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\\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}"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
|
|
@ -30,70 +30,68 @@
|
|||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 2,
|
||||
"SelectedChildIndex": 3,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"Title": "frmOperacaoMapaGPS.cs",
|
||||
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\Operacoes\\frmOperacaoMapaGPS.cs",
|
||||
"RelativeDocumentMoniker": "AgroBase\\Forms\\Operacoes\\frmOperacaoMapaGPS.cs",
|
||||
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\Operacoes\\frmOperacaoMapaGPS.cs",
|
||||
"RelativeToolTip": "AgroBase\\Forms\\Operacoes\\frmOperacaoMapaGPS.cs",
|
||||
"ViewState": "AQIAAE8BAAAAAAAAAAAuwGUBAAAMAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-04-02T18:31:03.966Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 1,
|
||||
"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": "AQIAAAsAAAAAAAAAAAAIwEwAAAAkAAAA",
|
||||
"Title": "OperacaoMapaGPSModel.cs",
|
||||
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\Operacoes\\OperacaoMapaGPSModel.cs",
|
||||
"RelativeDocumentMoniker": "AgroBase\\Models\\Operacoes\\OperacaoMapaGPSModel.cs",
|
||||
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\Operacoes\\OperacaoMapaGPSModel.cs",
|
||||
"RelativeToolTip": "AgroBase\\Models\\Operacoes\\OperacaoMapaGPSModel.cs",
|
||||
"ViewState": "AQIAAGACAAAAAAAAAAAnwHUCAAAmAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-04-02T10:59:16.426Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "frmOperacaoManual.cs [Design]",
|
||||
"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 [Design]",
|
||||
"RelativeToolTip": "AgroBase\\Forms\\Operacoes\\frmOperacaoManual.cs [Design]",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-04-02T00:33:46.091Z",
|
||||
"EditorCaption": " [Design]"
|
||||
"WhenOpened": "2024-04-12T13:21:22.58Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 3,
|
||||
"Title": "frmOperacaoMapaGPS.cs [Design]",
|
||||
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\Operacoes\\frmOperacaoMapaGPS.cs",
|
||||
"RelativeDocumentMoniker": "AgroBase\\Forms\\Operacoes\\frmOperacaoMapaGPS.cs",
|
||||
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Forms\\Operacoes\\frmOperacaoMapaGPS.cs [Design]",
|
||||
"RelativeToolTip": "AgroBase\\Forms\\Operacoes\\frmOperacaoMapaGPS.cs [Design]",
|
||||
"Title": "SensoriamentoModel.cs",
|
||||
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\Modules\\SensoriamentoModel.cs",
|
||||
"RelativeDocumentMoniker": "AgroBase\\Models\\Modules\\SensoriamentoModel.cs",
|
||||
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\Modules\\SensoriamentoModel.cs",
|
||||
"RelativeToolTip": "AgroBase\\Models\\Modules\\SensoriamentoModel.cs",
|
||||
"ViewState": "AQIAAPcBAAAAAAAAAAArwCICAAArAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-04-02T00:34:02.185Z",
|
||||
"EditorCaption": " [Design]"
|
||||
"WhenOpened": "2024-04-12T11:06:00.27Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"Title": "SonarModel.cs",
|
||||
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\SonarModel.cs",
|
||||
"RelativeDocumentMoniker": "AgroBase\\Models\\SonarModel.cs",
|
||||
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\SonarModel.cs",
|
||||
"RelativeToolTip": "AgroBase\\Models\\SonarModel.cs",
|
||||
"ViewState": "AQIAADkAAAAAAAAAAAAvwFMAAAAMAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-04-11T23:46:37.051Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "MapasModel.cs",
|
||||
"DocumentMoniker": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\MapasModel.cs",
|
||||
"RelativeDocumentMoniker": "AgroBase\\Models\\MapasModel.cs",
|
||||
"ToolTip": "C:\\ZendionINC\\agrobot_base\\AgroBase\\AgroBase\\Models\\MapasModel.cs",
|
||||
"RelativeToolTip": "AgroBase\\Models\\MapasModel.cs",
|
||||
"ViewState": "AQIAAJAAAAAAAAAAAAAEwKwAAAAsAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-04-11T21:39:31.046Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 4,
|
||||
"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": "AQIAAGECAAAAAAAAAAAzwAoDAAAAAAAA",
|
||||
"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": "AQIAAKwAAAAAAAAAAAD4v+IAAAAIAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-04-01T16:36:28.825Z",
|
||||
"EditorCaption": ""
|
||||
"WhenOpened": "2024-04-11T21:39:24.948Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -222,6 +222,12 @@
|
|||
<Compile Include="Forms\frmPinout.Designer.cs">
|
||||
<DependentUpon>frmPinout.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\frmSimulacaoMapaGPS.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\frmSimulacaoMapaGPS.Designer.cs">
|
||||
<DependentUpon>frmSimulacaoMapaGPS.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\IHM\frmIHM.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
|
@ -300,6 +306,12 @@
|
|||
<Compile Include="Forms\Sensoriamento\frmSenConfig.Designer.cs">
|
||||
<DependentUpon>frmSenConfig.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Sensoriamento\frmSonar.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Sensoriamento\frmSonar.Designer.cs">
|
||||
<DependentUpon>frmSonar.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Models\AlarmeModel.cs" />
|
||||
<Compile Include="Models\CameraCaminhoModel.cs" />
|
||||
<Compile Include="Models\CameraModel.cs" />
|
||||
|
|
@ -315,9 +327,12 @@
|
|||
<Compile Include="Models\Modules\PinoutModel.cs" />
|
||||
<Compile Include="Models\Modules\SensoriamentoModel.cs" />
|
||||
<Compile Include="Models\MotorComum.cs" />
|
||||
<Compile Include="Models\Operacoes\OperacaoManualModel.cs" />
|
||||
<Compile Include="Models\Operacoes\OperacaoMapaGPSModel.cs" />
|
||||
<Compile Include="Models\Operacoes\OperacaoModel.cs" />
|
||||
<Compile Include="Models\PIDModel.cs" />
|
||||
<Compile Include="Models\PZEMModel.cs" />
|
||||
<Compile Include="Models\SonarModel.cs" />
|
||||
<Compile Include="Models\Variaveis.cs" />
|
||||
<Compile Include="Services\APIService.cs" />
|
||||
<Compile Include="Services\CameraService.cs" />
|
||||
|
|
@ -340,6 +355,8 @@
|
|||
<Compile Include="Services\SerialService.cs" />
|
||||
<Compile Include="Services\SocketService.cs" />
|
||||
<Content Include="Imagens\loading.gif" />
|
||||
<None Include="Imagens\robo_superior.jpg" />
|
||||
<None Include="Imagens\mcp.jpg" />
|
||||
<Content Include="Imagens\rosa_dos_ventos.png" />
|
||||
<Content Include="Imagens\transferidor.png" />
|
||||
<Content Include="Python\Models\deeplabv3plus\backbone\hrnetv2.py">
|
||||
|
|
@ -444,6 +461,9 @@
|
|||
<EmbeddedResource Include="Forms\frmPinout.resx">
|
||||
<DependentUpon>frmPinout.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\frmSimulacaoMapaGPS.resx">
|
||||
<DependentUpon>frmSimulacaoMapaGPS.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\IHM\frmIHM.resx">
|
||||
<DependentUpon>frmIHM.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
|
@ -486,6 +506,9 @@
|
|||
<EmbeddedResource Include="Forms\Sensoriamento\frmSenConfig.resx">
|
||||
<DependentUpon>frmSenConfig.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\Sensoriamento\frmSonar.resx">
|
||||
<DependentUpon>frmSonar.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@
|
|||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmIHM));
|
||||
this.picRobo = new System.Windows.Forms.PictureBox();
|
||||
this.lblD_Mov = new System.Windows.Forms.Label();
|
||||
this.lblD_Dir = new System.Windows.Forms.Label();
|
||||
this.lblD_Atu = new System.Windows.Forms.Label();
|
||||
|
|
@ -42,23 +40,15 @@
|
|||
this.lblOperacaoStatus = new System.Windows.Forms.Label();
|
||||
this.lblMqtt = new System.Windows.Forms.Label();
|
||||
this.lblD_PZM = new System.Windows.Forms.Label();
|
||||
this.picRobo = new System.Windows.Forms.PictureBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picRobo)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// picRobo
|
||||
//
|
||||
this.picRobo.Image = ((System.Drawing.Image)(resources.GetObject("picRobo.Image")));
|
||||
this.picRobo.Location = new System.Drawing.Point(111, 12);
|
||||
this.picRobo.Name = "picRobo";
|
||||
this.picRobo.Size = new System.Drawing.Size(370, 673);
|
||||
this.picRobo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.picRobo.TabIndex = 1;
|
||||
this.picRobo.TabStop = false;
|
||||
//
|
||||
// lblD_Mov
|
||||
//
|
||||
this.lblD_Mov.AutoSize = true;
|
||||
this.lblD_Mov.Location = new System.Drawing.Point(457, 40);
|
||||
this.lblD_Mov.BackColor = System.Drawing.Color.Transparent;
|
||||
this.lblD_Mov.Location = new System.Drawing.Point(414, 33);
|
||||
this.lblD_Mov.Name = "lblD_Mov";
|
||||
this.lblD_Mov.Size = new System.Drawing.Size(169, 29);
|
||||
this.lblD_Mov.TabIndex = 2;
|
||||
|
|
@ -67,7 +57,7 @@
|
|||
// lblD_Dir
|
||||
//
|
||||
this.lblD_Dir.AutoSize = true;
|
||||
this.lblD_Dir.Location = new System.Drawing.Point(61, 422);
|
||||
this.lblD_Dir.Location = new System.Drawing.Point(72, 121);
|
||||
this.lblD_Dir.Name = "lblD_Dir";
|
||||
this.lblD_Dir.Size = new System.Drawing.Size(122, 29);
|
||||
this.lblD_Dir.TabIndex = 3;
|
||||
|
|
@ -76,7 +66,7 @@
|
|||
// lblD_Atu
|
||||
//
|
||||
this.lblD_Atu.AutoSize = true;
|
||||
this.lblD_Atu.Location = new System.Drawing.Point(435, 645);
|
||||
this.lblD_Atu.Location = new System.Drawing.Point(442, 633);
|
||||
this.lblD_Atu.Name = "lblD_Atu";
|
||||
this.lblD_Atu.Size = new System.Drawing.Size(96, 29);
|
||||
this.lblD_Atu.TabIndex = 4;
|
||||
|
|
@ -85,7 +75,8 @@
|
|||
// lblD_Sen
|
||||
//
|
||||
this.lblD_Sen.AutoSize = true;
|
||||
this.lblD_Sen.Location = new System.Drawing.Point(311, 519);
|
||||
this.lblD_Sen.BackColor = System.Drawing.Color.Lavender;
|
||||
this.lblD_Sen.Location = new System.Drawing.Point(430, 324);
|
||||
this.lblD_Sen.Name = "lblD_Sen";
|
||||
this.lblD_Sen.Size = new System.Drawing.Size(176, 29);
|
||||
this.lblD_Sen.TabIndex = 5;
|
||||
|
|
@ -94,7 +85,7 @@
|
|||
// lblD_Gps
|
||||
//
|
||||
this.lblD_Gps.AutoSize = true;
|
||||
this.lblD_Gps.Location = new System.Drawing.Point(129, 193);
|
||||
this.lblD_Gps.Location = new System.Drawing.Point(430, 208);
|
||||
this.lblD_Gps.Name = "lblD_Gps";
|
||||
this.lblD_Gps.Size = new System.Drawing.Size(63, 29);
|
||||
this.lblD_Gps.TabIndex = 6;
|
||||
|
|
@ -162,16 +153,28 @@
|
|||
// lblD_PZM
|
||||
//
|
||||
this.lblD_PZM.AutoSize = true;
|
||||
this.lblD_PZM.Location = new System.Drawing.Point(356, 306);
|
||||
this.lblD_PZM.BackColor = System.Drawing.Color.Lavender;
|
||||
this.lblD_PZM.Location = new System.Drawing.Point(137, 309);
|
||||
this.lblD_PZM.Name = "lblD_PZM";
|
||||
this.lblD_PZM.Size = new System.Drawing.Size(79, 29);
|
||||
this.lblD_PZM.TabIndex = 14;
|
||||
this.lblD_PZM.Text = "PZEM";
|
||||
//
|
||||
// picRobo
|
||||
//
|
||||
this.picRobo.Image = global::AgroBase.Properties.Resources.robo_superior;
|
||||
this.picRobo.Location = new System.Drawing.Point(66, 12);
|
||||
this.picRobo.Name = "picRobo";
|
||||
this.picRobo.Size = new System.Drawing.Size(534, 673);
|
||||
this.picRobo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.picRobo.TabIndex = 1;
|
||||
this.picRobo.TabStop = false;
|
||||
//
|
||||
// frmIHM
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(14F, 29F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
this.ClientSize = new System.Drawing.Size(1020, 697);
|
||||
this.Controls.Add(this.lblD_PZM);
|
||||
this.Controls.Add(this.lblMqtt);
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ namespace AgroBase.Forms.IHM
|
|||
}
|
||||
}
|
||||
|
||||
lblDisp.ForeColor = DispositivoConectado ? Color.Green : Color.Red;
|
||||
lblDisp.ForeColor = Modulo.Erro ? Color.Yellow : DispositivoConectado ? Color.Green : Color.Red;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -129,23 +129,7 @@ namespace AgroBase.Forms.IHM
|
|||
|
||||
private void btnIniciar_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Variaveis.OperacaoEmAndamento.ModulosConectados)
|
||||
{
|
||||
/*if (Variaveis.OperacaoEmAndamento.Modo == ModoOperacao.Manual)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.frmOperacao = new frmAcompanhamento();
|
||||
}
|
||||
else if (Variaveis.OperacaoEmAndamento.Modo == ModoOperacao.MapaGPS)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.frmOperacao = new frmOperacaoMapaGPS();
|
||||
}*/
|
||||
Variaveis.OperacaoEmAndamento.frmOperacao = (Form)Activator.CreateInstance(Variaveis.OperacaoEmAndamento.frmOperacao.GetType());
|
||||
Variaveis.OperacaoEmAndamento.frmOperacao.ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(Variaveis.OperacaoEmAndamento.ErroOperacaoLiberada, "Conexão de módulos pendentes", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
Variaveis.OperacaoEmAndamento.AbrirForm();
|
||||
|
||||
AtualizarLabelOperacao();
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -28,9 +28,9 @@
|
|||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea6 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||
System.Windows.Forms.DataVisualization.Charting.Legend legend6 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||
System.Windows.Forms.DataVisualization.Charting.Series series6 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||
System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||
System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||
this.pnlCamerasSolo = new System.Windows.Forms.Panel();
|
||||
this.pnlCameraSoloE = new System.Windows.Forms.Panel();
|
||||
this.picCameraSoloE = new System.Windows.Forms.PictureBox();
|
||||
|
|
@ -44,29 +44,46 @@
|
|||
this.lblDir_ET = new System.Windows.Forms.Label();
|
||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||
this.tabMapa = new System.Windows.Forms.TabPage();
|
||||
this.lblGPSprecisao = new System.Windows.Forms.Label();
|
||||
this.lblGPSaltitude = new System.Windows.Forms.Label();
|
||||
this.lblGPSvelocidade = new System.Windows.Forms.Label();
|
||||
this.lblGPSsatelites = new System.Windows.Forms.Label();
|
||||
this.pnlMapa = new System.Windows.Forms.Panel();
|
||||
this.lblGPS = new System.Windows.Forms.Label();
|
||||
this.pnlAnguloGPS = new System.Windows.Forms.Panel();
|
||||
this.pnlAnguloMagnetometro = new System.Windows.Forms.Panel();
|
||||
this.lblMagnetometro = new System.Windows.Forms.Label();
|
||||
this.tabInformacoes = new System.Windows.Forms.TabPage();
|
||||
this.gridDados = new System.Windows.Forms.DataGridView();
|
||||
this.tabDeteccoes = new System.Windows.Forms.TabPage();
|
||||
this.pnlDeteccoesRua = new System.Windows.Forms.Panel();
|
||||
this.pnlAnguloGPS = new System.Windows.Forms.Panel();
|
||||
this.lblGPS = new System.Windows.Forms.Label();
|
||||
this.lblMagnetometro = new System.Windows.Forms.Label();
|
||||
this.pnlAnguloMagnetometro = new System.Windows.Forms.Panel();
|
||||
this.tabPulverizador = new System.Windows.Forms.TabPage();
|
||||
this.lblPressaoSP = new System.Windows.Forms.Label();
|
||||
this.nudPressaoSP = new System.Windows.Forms.NumericUpDown();
|
||||
this.btnDesligarBomba = new System.Windows.Forms.Button();
|
||||
this.btnLigarBomba = new System.Windows.Forms.Button();
|
||||
this.pnlCameraRua = new System.Windows.Forms.Panel();
|
||||
this.picCameraRua = new System.Windows.Forms.PictureBox();
|
||||
this.pnlDir_EF = new System.Windows.Forms.Panel();
|
||||
this.chbLivre_EF = new System.Windows.Forms.CheckBox();
|
||||
this.chbCmd_EF = new System.Windows.Forms.CheckBox();
|
||||
this.btnRef_EF = new System.Windows.Forms.Button();
|
||||
this.pnlDir_ET = new System.Windows.Forms.Panel();
|
||||
this.chbLivre_ET = new System.Windows.Forms.CheckBox();
|
||||
this.chbCmd_ET = new System.Windows.Forms.CheckBox();
|
||||
this.btnRef_ET = new System.Windows.Forms.Button();
|
||||
this.pnlDir_DT = new System.Windows.Forms.Panel();
|
||||
this.chbLivre_DT = new System.Windows.Forms.CheckBox();
|
||||
this.chbCmd_DT = new System.Windows.Forms.CheckBox();
|
||||
this.btnRef_DT = new System.Windows.Forms.Button();
|
||||
this.pnlDir_DF = new System.Windows.Forms.Panel();
|
||||
this.chbLivre_DF = new System.Windows.Forms.CheckBox();
|
||||
this.chbCmd_DF = new System.Windows.Forms.CheckBox();
|
||||
this.btnRef_DF = new System.Windows.Forms.Button();
|
||||
this.btnIniciarOperacao = new System.Windows.Forms.Button();
|
||||
this.tabPulverizador = new System.Windows.Forms.TabPage();
|
||||
this.btnLigarBomba = new System.Windows.Forms.Button();
|
||||
this.btnDesligarBomba = new System.Windows.Forms.Button();
|
||||
this.nudPressaoSP = new System.Windows.Forms.NumericUpDown();
|
||||
this.lblPressaoSP = new System.Windows.Forms.Label();
|
||||
this.lblDistanciaEsquerda = new System.Windows.Forms.Label();
|
||||
this.lblDistanciaDireita = new System.Windows.Forms.Label();
|
||||
this.picSonar = new System.Windows.Forms.PictureBox();
|
||||
this.pnlCamerasSolo.SuspendLayout();
|
||||
this.pnlCameraSoloE.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picCameraSoloE)).BeginInit();
|
||||
|
|
@ -78,22 +95,24 @@
|
|||
this.tabInformacoes.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridDados)).BeginInit();
|
||||
this.tabDeteccoes.SuspendLayout();
|
||||
this.pnlDeteccoesRua.SuspendLayout();
|
||||
this.tabPulverizador.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudPressaoSP)).BeginInit();
|
||||
this.pnlCameraRua.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picCameraRua)).BeginInit();
|
||||
this.pnlDir_EF.SuspendLayout();
|
||||
this.pnlDir_ET.SuspendLayout();
|
||||
this.pnlDir_DT.SuspendLayout();
|
||||
this.pnlDir_DF.SuspendLayout();
|
||||
this.tabPulverizador.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudPressaoSP)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picSonar)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pnlCamerasSolo
|
||||
//
|
||||
this.pnlCamerasSolo.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.pnlCamerasSolo.BackColor = System.Drawing.Color.White;
|
||||
this.pnlCamerasSolo.Controls.Add(this.pnlCameraSoloE);
|
||||
this.pnlCamerasSolo.Controls.Add(this.pnlCameraSoloD);
|
||||
this.pnlCamerasSolo.Location = new System.Drawing.Point(12, 404);
|
||||
this.pnlCamerasSolo.Location = new System.Drawing.Point(31, 404);
|
||||
this.pnlCamerasSolo.Name = "pnlCamerasSolo";
|
||||
this.pnlCamerasSolo.Size = new System.Drawing.Size(784, 227);
|
||||
this.pnlCamerasSolo.TabIndex = 0;
|
||||
|
|
@ -108,6 +127,7 @@
|
|||
//
|
||||
// picCameraSoloE
|
||||
//
|
||||
this.picCameraSoloE.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.picCameraSoloE.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.picCameraSoloE.Location = new System.Drawing.Point(0, 0);
|
||||
this.picCameraSoloE.Name = "picCameraSoloE";
|
||||
|
|
@ -126,6 +146,7 @@
|
|||
//
|
||||
// picCameraSoloD
|
||||
//
|
||||
this.picCameraSoloD.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.picCameraSoloD.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.picCameraSoloD.Location = new System.Drawing.Point(0, 0);
|
||||
this.picCameraSoloD.Name = "picCameraSoloD";
|
||||
|
|
@ -138,7 +159,7 @@
|
|||
//
|
||||
this.pnlAtuadores.BackColor = System.Drawing.Color.White;
|
||||
this.pnlAtuadores.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.pnlAtuadores.Location = new System.Drawing.Point(12, 637);
|
||||
this.pnlAtuadores.Location = new System.Drawing.Point(31, 637);
|
||||
this.pnlAtuadores.Name = "pnlAtuadores";
|
||||
this.pnlAtuadores.Size = new System.Drawing.Size(784, 155);
|
||||
this.pnlAtuadores.TabIndex = 1;
|
||||
|
|
@ -146,17 +167,17 @@
|
|||
//
|
||||
// chartGraficos
|
||||
//
|
||||
chartArea6.Name = "ChartArea1";
|
||||
this.chartGraficos.ChartAreas.Add(chartArea6);
|
||||
legend6.Name = "Legend1";
|
||||
this.chartGraficos.Legends.Add(legend6);
|
||||
this.chartGraficos.Location = new System.Drawing.Point(802, 404);
|
||||
chartArea2.Name = "ChartArea1";
|
||||
this.chartGraficos.ChartAreas.Add(chartArea2);
|
||||
legend2.Name = "Legend1";
|
||||
this.chartGraficos.Legends.Add(legend2);
|
||||
this.chartGraficos.Location = new System.Drawing.Point(854, 9);
|
||||
this.chartGraficos.Name = "chartGraficos";
|
||||
series6.ChartArea = "ChartArea1";
|
||||
series6.Legend = "Legend1";
|
||||
series6.Name = "Series1";
|
||||
this.chartGraficos.Series.Add(series6);
|
||||
this.chartGraficos.Size = new System.Drawing.Size(837, 388);
|
||||
series2.ChartArea = "ChartArea1";
|
||||
series2.Legend = "Legend1";
|
||||
series2.Name = "Series1";
|
||||
this.chartGraficos.Series.Add(series2);
|
||||
this.chartGraficos.Size = new System.Drawing.Size(785, 392);
|
||||
this.chartGraficos.TabIndex = 2;
|
||||
this.chartGraficos.Text = "chart1";
|
||||
//
|
||||
|
|
@ -172,7 +193,7 @@
|
|||
// lblDir_DF
|
||||
//
|
||||
this.lblDir_DF.AutoSize = true;
|
||||
this.lblDir_DF.Location = new System.Drawing.Point(3, 1);
|
||||
this.lblDir_DF.Location = new System.Drawing.Point(1, 1);
|
||||
this.lblDir_DF.Name = "lblDir_DF";
|
||||
this.lblDir_DF.Size = new System.Drawing.Size(54, 16);
|
||||
this.lblDir_DF.TabIndex = 10;
|
||||
|
|
@ -181,7 +202,7 @@
|
|||
// lblDir_DT
|
||||
//
|
||||
this.lblDir_DT.AutoSize = true;
|
||||
this.lblDir_DT.Location = new System.Drawing.Point(3, 183);
|
||||
this.lblDir_DT.Location = new System.Drawing.Point(1, 3);
|
||||
this.lblDir_DT.Name = "lblDir_DT";
|
||||
this.lblDir_DT.Size = new System.Drawing.Size(55, 16);
|
||||
this.lblDir_DT.TabIndex = 11;
|
||||
|
|
@ -190,7 +211,7 @@
|
|||
// lblDir_ET
|
||||
//
|
||||
this.lblDir_ET.AutoSize = true;
|
||||
this.lblDir_ET.Location = new System.Drawing.Point(1, 183);
|
||||
this.lblDir_ET.Location = new System.Drawing.Point(1, 3);
|
||||
this.lblDir_ET.Name = "lblDir_ET";
|
||||
this.lblDir_ET.Size = new System.Drawing.Size(54, 16);
|
||||
this.lblDir_ET.TabIndex = 12;
|
||||
|
|
@ -202,38 +223,123 @@
|
|||
this.tabControl1.Controls.Add(this.tabInformacoes);
|
||||
this.tabControl1.Controls.Add(this.tabDeteccoes);
|
||||
this.tabControl1.Controls.Add(this.tabPulverizador);
|
||||
this.tabControl1.Location = new System.Drawing.Point(1011, 12);
|
||||
this.tabControl1.Location = new System.Drawing.Point(854, 407);
|
||||
this.tabControl1.Name = "tabControl1";
|
||||
this.tabControl1.SelectedIndex = 0;
|
||||
this.tabControl1.Size = new System.Drawing.Size(628, 387);
|
||||
this.tabControl1.Size = new System.Drawing.Size(628, 386);
|
||||
this.tabControl1.TabIndex = 17;
|
||||
//
|
||||
// tabMapa
|
||||
//
|
||||
this.tabMapa.Controls.Add(this.lblGPSprecisao);
|
||||
this.tabMapa.Controls.Add(this.lblGPSaltitude);
|
||||
this.tabMapa.Controls.Add(this.lblGPSvelocidade);
|
||||
this.tabMapa.Controls.Add(this.lblGPSsatelites);
|
||||
this.tabMapa.Controls.Add(this.pnlMapa);
|
||||
this.tabMapa.Controls.Add(this.lblGPS);
|
||||
this.tabMapa.Controls.Add(this.pnlAnguloGPS);
|
||||
this.tabMapa.Controls.Add(this.pnlAnguloMagnetometro);
|
||||
this.tabMapa.Controls.Add(this.lblMagnetometro);
|
||||
this.tabMapa.Location = new System.Drawing.Point(4, 25);
|
||||
this.tabMapa.Name = "tabMapa";
|
||||
this.tabMapa.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabMapa.Size = new System.Drawing.Size(620, 358);
|
||||
this.tabMapa.Size = new System.Drawing.Size(620, 357);
|
||||
this.tabMapa.TabIndex = 0;
|
||||
this.tabMapa.Text = "Mapa";
|
||||
this.tabMapa.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// lblGPSprecisao
|
||||
//
|
||||
this.lblGPSprecisao.AutoSize = true;
|
||||
this.lblGPSprecisao.Location = new System.Drawing.Point(6, 143);
|
||||
this.lblGPSprecisao.Name = "lblGPSprecisao";
|
||||
this.lblGPSprecisao.Size = new System.Drawing.Size(105, 16);
|
||||
this.lblGPSprecisao.TabIndex = 31;
|
||||
this.lblGPSprecisao.Text = "Precisão: 0,00 m";
|
||||
//
|
||||
// lblGPSaltitude
|
||||
//
|
||||
this.lblGPSaltitude.AutoSize = true;
|
||||
this.lblGPSaltitude.Location = new System.Drawing.Point(6, 175);
|
||||
this.lblGPSaltitude.Name = "lblGPSaltitude";
|
||||
this.lblGPSaltitude.Size = new System.Drawing.Size(88, 16);
|
||||
this.lblGPSaltitude.TabIndex = 30;
|
||||
this.lblGPSaltitude.Text = "Altitude: 0,0 m";
|
||||
//
|
||||
// lblGPSvelocidade
|
||||
//
|
||||
this.lblGPSvelocidade.AutoSize = true;
|
||||
this.lblGPSvelocidade.Location = new System.Drawing.Point(6, 159);
|
||||
this.lblGPSvelocidade.Name = "lblGPSvelocidade";
|
||||
this.lblGPSvelocidade.Size = new System.Drawing.Size(92, 16);
|
||||
this.lblGPSvelocidade.TabIndex = 29;
|
||||
this.lblGPSvelocidade.Text = "Vel.: 0,00 km/h";
|
||||
//
|
||||
// lblGPSsatelites
|
||||
//
|
||||
this.lblGPSsatelites.AutoSize = true;
|
||||
this.lblGPSsatelites.Location = new System.Drawing.Point(6, 127);
|
||||
this.lblGPSsatelites.Name = "lblGPSsatelites";
|
||||
this.lblGPSsatelites.Size = new System.Drawing.Size(67, 16);
|
||||
this.lblGPSsatelites.TabIndex = 28;
|
||||
this.lblGPSsatelites.Text = "0 satélites";
|
||||
//
|
||||
// pnlMapa
|
||||
//
|
||||
this.pnlMapa.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pnlMapa.Location = new System.Drawing.Point(3, 3);
|
||||
this.pnlMapa.Location = new System.Drawing.Point(119, 3);
|
||||
this.pnlMapa.Name = "pnlMapa";
|
||||
this.pnlMapa.Size = new System.Drawing.Size(614, 352);
|
||||
this.pnlMapa.Size = new System.Drawing.Size(498, 352);
|
||||
this.pnlMapa.TabIndex = 0;
|
||||
//
|
||||
// lblGPS
|
||||
//
|
||||
this.lblGPS.AutoSize = true;
|
||||
this.lblGPS.Location = new System.Drawing.Point(6, 3);
|
||||
this.lblGPS.Name = "lblGPS";
|
||||
this.lblGPS.Size = new System.Drawing.Size(35, 16);
|
||||
this.lblGPS.TabIndex = 19;
|
||||
this.lblGPS.Text = "GPS";
|
||||
//
|
||||
// pnlAnguloGPS
|
||||
//
|
||||
this.pnlAnguloGPS.BackColor = System.Drawing.Color.White;
|
||||
this.pnlAnguloGPS.BackgroundImage = global::AgroBase.Properties.Resources.rosa_dos_ventos;
|
||||
this.pnlAnguloGPS.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||
this.pnlAnguloGPS.Location = new System.Drawing.Point(9, 22);
|
||||
this.pnlAnguloGPS.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.pnlAnguloGPS.Name = "pnlAnguloGPS";
|
||||
this.pnlAnguloGPS.Size = new System.Drawing.Size(104, 103);
|
||||
this.pnlAnguloGPS.TabIndex = 18;
|
||||
this.pnlAnguloGPS.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlAnguloGPS_Paint);
|
||||
//
|
||||
// pnlAnguloMagnetometro
|
||||
//
|
||||
this.pnlAnguloMagnetometro.BackColor = System.Drawing.Color.White;
|
||||
this.pnlAnguloMagnetometro.BackgroundImage = global::AgroBase.Properties.Resources.rosa_dos_ventos;
|
||||
this.pnlAnguloMagnetometro.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||
this.pnlAnguloMagnetometro.Location = new System.Drawing.Point(9, 250);
|
||||
this.pnlAnguloMagnetometro.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.pnlAnguloMagnetometro.Name = "pnlAnguloMagnetometro";
|
||||
this.pnlAnguloMagnetometro.Size = new System.Drawing.Size(104, 103);
|
||||
this.pnlAnguloMagnetometro.TabIndex = 20;
|
||||
this.pnlAnguloMagnetometro.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlAnguloMagnetometro_Paint);
|
||||
//
|
||||
// lblMagnetometro
|
||||
//
|
||||
this.lblMagnetometro.AutoSize = true;
|
||||
this.lblMagnetometro.Location = new System.Drawing.Point(6, 231);
|
||||
this.lblMagnetometro.Name = "lblMagnetometro";
|
||||
this.lblMagnetometro.Size = new System.Drawing.Size(94, 16);
|
||||
this.lblMagnetometro.TabIndex = 21;
|
||||
this.lblMagnetometro.Text = "Magnetômetro";
|
||||
//
|
||||
// tabInformacoes
|
||||
//
|
||||
this.tabInformacoes.Controls.Add(this.gridDados);
|
||||
this.tabInformacoes.Location = new System.Drawing.Point(4, 25);
|
||||
this.tabInformacoes.Name = "tabInformacoes";
|
||||
this.tabInformacoes.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabInformacoes.Size = new System.Drawing.Size(620, 358);
|
||||
this.tabInformacoes.Size = new System.Drawing.Size(620, 357);
|
||||
this.tabInformacoes.TabIndex = 1;
|
||||
this.tabInformacoes.Text = "Informações";
|
||||
this.tabInformacoes.UseVisualStyleBackColor = true;
|
||||
|
|
@ -246,7 +352,7 @@
|
|||
this.gridDados.Name = "gridDados";
|
||||
this.gridDados.RowHeadersWidth = 51;
|
||||
this.gridDados.RowTemplate.Height = 24;
|
||||
this.gridDados.Size = new System.Drawing.Size(614, 352);
|
||||
this.gridDados.Size = new System.Drawing.Size(614, 351);
|
||||
this.gridDados.TabIndex = 0;
|
||||
//
|
||||
// tabDeteccoes
|
||||
|
|
@ -255,122 +361,20 @@
|
|||
this.tabDeteccoes.Location = new System.Drawing.Point(4, 25);
|
||||
this.tabDeteccoes.Name = "tabDeteccoes";
|
||||
this.tabDeteccoes.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabDeteccoes.Size = new System.Drawing.Size(620, 358);
|
||||
this.tabDeteccoes.Size = new System.Drawing.Size(620, 357);
|
||||
this.tabDeteccoes.TabIndex = 2;
|
||||
this.tabDeteccoes.Text = "Detecção rua";
|
||||
this.tabDeteccoes.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pnlDeteccoesRua
|
||||
//
|
||||
this.pnlDeteccoesRua.Controls.Add(this.picSonar);
|
||||
this.pnlDeteccoesRua.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pnlDeteccoesRua.Location = new System.Drawing.Point(3, 3);
|
||||
this.pnlDeteccoesRua.Name = "pnlDeteccoesRua";
|
||||
this.pnlDeteccoesRua.Size = new System.Drawing.Size(614, 352);
|
||||
this.pnlDeteccoesRua.Size = new System.Drawing.Size(614, 351);
|
||||
this.pnlDeteccoesRua.TabIndex = 0;
|
||||
//
|
||||
// pnlAnguloGPS
|
||||
//
|
||||
this.pnlAnguloGPS.BackColor = System.Drawing.Color.White;
|
||||
this.pnlAnguloGPS.BackgroundImage = global::AgroBase.Properties.Resources.rosa_dos_ventos;
|
||||
this.pnlAnguloGPS.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||
this.pnlAnguloGPS.Location = new System.Drawing.Point(879, 37);
|
||||
this.pnlAnguloGPS.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.pnlAnguloGPS.Name = "pnlAnguloGPS";
|
||||
this.pnlAnguloGPS.Size = new System.Drawing.Size(104, 103);
|
||||
this.pnlAnguloGPS.TabIndex = 18;
|
||||
this.pnlAnguloGPS.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlAnguloGPS_Paint);
|
||||
//
|
||||
// lblGPS
|
||||
//
|
||||
this.lblGPS.AutoSize = true;
|
||||
this.lblGPS.Location = new System.Drawing.Point(876, 18);
|
||||
this.lblGPS.Name = "lblGPS";
|
||||
this.lblGPS.Size = new System.Drawing.Size(35, 16);
|
||||
this.lblGPS.TabIndex = 19;
|
||||
this.lblGPS.Text = "GPS";
|
||||
//
|
||||
// lblMagnetometro
|
||||
//
|
||||
this.lblMagnetometro.AutoSize = true;
|
||||
this.lblMagnetometro.Location = new System.Drawing.Point(876, 165);
|
||||
this.lblMagnetometro.Name = "lblMagnetometro";
|
||||
this.lblMagnetometro.Size = new System.Drawing.Size(94, 16);
|
||||
this.lblMagnetometro.TabIndex = 21;
|
||||
this.lblMagnetometro.Text = "Magnetômetro";
|
||||
//
|
||||
// pnlAnguloMagnetometro
|
||||
//
|
||||
this.pnlAnguloMagnetometro.BackColor = System.Drawing.Color.White;
|
||||
this.pnlAnguloMagnetometro.BackgroundImage = global::AgroBase.Properties.Resources.rosa_dos_ventos;
|
||||
this.pnlAnguloMagnetometro.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||
this.pnlAnguloMagnetometro.Location = new System.Drawing.Point(879, 184);
|
||||
this.pnlAnguloMagnetometro.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.pnlAnguloMagnetometro.Name = "pnlAnguloMagnetometro";
|
||||
this.pnlAnguloMagnetometro.Size = new System.Drawing.Size(104, 103);
|
||||
this.pnlAnguloMagnetometro.TabIndex = 20;
|
||||
this.pnlAnguloMagnetometro.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlAnguloMagnetometro_Paint);
|
||||
//
|
||||
// pnlCameraRua
|
||||
//
|
||||
this.pnlCameraRua.Controls.Add(this.picCameraRua);
|
||||
this.pnlCameraRua.Location = new System.Drawing.Point(186, 28);
|
||||
this.pnlCameraRua.Name = "pnlCameraRua";
|
||||
this.pnlCameraRua.Size = new System.Drawing.Size(476, 369);
|
||||
this.pnlCameraRua.TabIndex = 22;
|
||||
//
|
||||
// picCameraRua
|
||||
//
|
||||
this.picCameraRua.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.picCameraRua.Location = new System.Drawing.Point(0, 0);
|
||||
this.picCameraRua.Name = "picCameraRua";
|
||||
this.picCameraRua.Size = new System.Drawing.Size(476, 369);
|
||||
this.picCameraRua.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.picCameraRua.TabIndex = 0;
|
||||
this.picCameraRua.TabStop = false;
|
||||
//
|
||||
// pnlDir_EF
|
||||
//
|
||||
this.pnlDir_EF.Controls.Add(this.lblDir_EF);
|
||||
this.pnlDir_EF.Location = new System.Drawing.Point(0, 0);
|
||||
this.pnlDir_EF.Name = "pnlDir_EF";
|
||||
this.pnlDir_EF.Size = new System.Drawing.Size(200, 200);
|
||||
this.pnlDir_EF.TabIndex = 23;
|
||||
//
|
||||
// pnlDir_ET
|
||||
//
|
||||
this.pnlDir_ET.Controls.Add(this.lblDir_ET);
|
||||
this.pnlDir_ET.Location = new System.Drawing.Point(0, 200);
|
||||
this.pnlDir_ET.Name = "pnlDir_ET";
|
||||
this.pnlDir_ET.Size = new System.Drawing.Size(200, 200);
|
||||
this.pnlDir_ET.TabIndex = 24;
|
||||
//
|
||||
// pnlDir_DT
|
||||
//
|
||||
this.pnlDir_DT.Controls.Add(this.lblDir_DT);
|
||||
this.pnlDir_DT.Location = new System.Drawing.Point(648, 200);
|
||||
this.pnlDir_DT.Name = "pnlDir_DT";
|
||||
this.pnlDir_DT.Size = new System.Drawing.Size(200, 200);
|
||||
this.pnlDir_DT.TabIndex = 24;
|
||||
//
|
||||
// pnlDir_DF
|
||||
//
|
||||
this.pnlDir_DF.Controls.Add(this.lblDir_DF);
|
||||
this.pnlDir_DF.Location = new System.Drawing.Point(648, 0);
|
||||
this.pnlDir_DF.Name = "pnlDir_DF";
|
||||
this.pnlDir_DF.Size = new System.Drawing.Size(200, 200);
|
||||
this.pnlDir_DF.TabIndex = 24;
|
||||
//
|
||||
// btnIniciarOperacao
|
||||
//
|
||||
this.btnIniciarOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnIniciarOperacao.Location = new System.Drawing.Point(854, 330);
|
||||
this.btnIniciarOperacao.Name = "btnIniciarOperacao";
|
||||
this.btnIniciarOperacao.Size = new System.Drawing.Size(151, 65);
|
||||
this.btnIniciarOperacao.TabIndex = 25;
|
||||
this.btnIniciarOperacao.Text = "Iniciar Operação";
|
||||
this.btnIniciarOperacao.UseVisualStyleBackColor = true;
|
||||
this.btnIniciarOperacao.Click += new System.EventHandler(this.btnIniciarOperacao_Click);
|
||||
//
|
||||
// tabPulverizador
|
||||
//
|
||||
this.tabPulverizador.Controls.Add(this.lblPressaoSP);
|
||||
|
|
@ -380,32 +384,20 @@
|
|||
this.tabPulverizador.Location = new System.Drawing.Point(4, 25);
|
||||
this.tabPulverizador.Name = "tabPulverizador";
|
||||
this.tabPulverizador.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPulverizador.Size = new System.Drawing.Size(620, 358);
|
||||
this.tabPulverizador.Size = new System.Drawing.Size(620, 357);
|
||||
this.tabPulverizador.TabIndex = 3;
|
||||
this.tabPulverizador.Text = "Pulverizador";
|
||||
this.tabPulverizador.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnLigarBomba
|
||||
// lblPressaoSP
|
||||
//
|
||||
this.btnLigarBomba.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnLigarBomba.Location = new System.Drawing.Point(158, 21);
|
||||
this.btnLigarBomba.Name = "btnLigarBomba";
|
||||
this.btnLigarBomba.Size = new System.Drawing.Size(139, 34);
|
||||
this.btnLigarBomba.TabIndex = 26;
|
||||
this.btnLigarBomba.Text = "Ligar Bomba";
|
||||
this.btnLigarBomba.UseVisualStyleBackColor = true;
|
||||
this.btnLigarBomba.Click += new System.EventHandler(this.btnLigarBomba_Click);
|
||||
//
|
||||
// btnDesligarBomba
|
||||
//
|
||||
this.btnDesligarBomba.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnDesligarBomba.Location = new System.Drawing.Point(325, 21);
|
||||
this.btnDesligarBomba.Name = "btnDesligarBomba";
|
||||
this.btnDesligarBomba.Size = new System.Drawing.Size(139, 34);
|
||||
this.btnDesligarBomba.TabIndex = 27;
|
||||
this.btnDesligarBomba.Text = "Desligar Bomba";
|
||||
this.btnDesligarBomba.UseVisualStyleBackColor = true;
|
||||
this.btnDesligarBomba.Click += new System.EventHandler(this.btnDesligarBomba_Click);
|
||||
this.lblPressaoSP.AutoSize = true;
|
||||
this.lblPressaoSP.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblPressaoSP.Location = new System.Drawing.Point(24, 14);
|
||||
this.lblPressaoSP.Name = "lblPressaoSP";
|
||||
this.lblPressaoSP.Size = new System.Drawing.Size(89, 16);
|
||||
this.lblPressaoSP.TabIndex = 29;
|
||||
this.lblPressaoSP.Text = "Pressão SP";
|
||||
//
|
||||
// nudPressaoSP
|
||||
//
|
||||
|
|
@ -422,15 +414,221 @@
|
|||
this.nudPressaoSP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.nudPressaoSP.ValueChanged += new System.EventHandler(this.nudPressaoSP_ValueChanged);
|
||||
//
|
||||
// lblPressaoSP
|
||||
// btnDesligarBomba
|
||||
//
|
||||
this.lblPressaoSP.AutoSize = true;
|
||||
this.lblPressaoSP.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblPressaoSP.Location = new System.Drawing.Point(24, 14);
|
||||
this.lblPressaoSP.Name = "lblPressaoSP";
|
||||
this.lblPressaoSP.Size = new System.Drawing.Size(89, 16);
|
||||
this.lblPressaoSP.TabIndex = 29;
|
||||
this.lblPressaoSP.Text = "Pressão SP";
|
||||
this.btnDesligarBomba.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnDesligarBomba.Location = new System.Drawing.Point(325, 21);
|
||||
this.btnDesligarBomba.Name = "btnDesligarBomba";
|
||||
this.btnDesligarBomba.Size = new System.Drawing.Size(139, 34);
|
||||
this.btnDesligarBomba.TabIndex = 27;
|
||||
this.btnDesligarBomba.Text = "Desligar Bomba";
|
||||
this.btnDesligarBomba.UseVisualStyleBackColor = true;
|
||||
this.btnDesligarBomba.Click += new System.EventHandler(this.btnDesligarBomba_Click);
|
||||
//
|
||||
// btnLigarBomba
|
||||
//
|
||||
this.btnLigarBomba.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnLigarBomba.Location = new System.Drawing.Point(158, 21);
|
||||
this.btnLigarBomba.Name = "btnLigarBomba";
|
||||
this.btnLigarBomba.Size = new System.Drawing.Size(139, 34);
|
||||
this.btnLigarBomba.TabIndex = 26;
|
||||
this.btnLigarBomba.Text = "Ligar Bomba";
|
||||
this.btnLigarBomba.UseVisualStyleBackColor = true;
|
||||
this.btnLigarBomba.Click += new System.EventHandler(this.btnLigarBomba_Click);
|
||||
//
|
||||
// pnlCameraRua
|
||||
//
|
||||
this.pnlCameraRua.Controls.Add(this.picCameraRua);
|
||||
this.pnlCameraRua.Location = new System.Drawing.Point(186, 28);
|
||||
this.pnlCameraRua.Name = "pnlCameraRua";
|
||||
this.pnlCameraRua.Size = new System.Drawing.Size(476, 352);
|
||||
this.pnlCameraRua.TabIndex = 22;
|
||||
//
|
||||
// picCameraRua
|
||||
//
|
||||
this.picCameraRua.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.picCameraRua.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.picCameraRua.Location = new System.Drawing.Point(0, 0);
|
||||
this.picCameraRua.Name = "picCameraRua";
|
||||
this.picCameraRua.Size = new System.Drawing.Size(476, 352);
|
||||
this.picCameraRua.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.picCameraRua.TabIndex = 0;
|
||||
this.picCameraRua.TabStop = false;
|
||||
//
|
||||
// pnlDir_EF
|
||||
//
|
||||
this.pnlDir_EF.Controls.Add(this.chbLivre_EF);
|
||||
this.pnlDir_EF.Controls.Add(this.chbCmd_EF);
|
||||
this.pnlDir_EF.Controls.Add(this.btnRef_EF);
|
||||
this.pnlDir_EF.Controls.Add(this.lblDir_EF);
|
||||
this.pnlDir_EF.Location = new System.Drawing.Point(0, 0);
|
||||
this.pnlDir_EF.Name = "pnlDir_EF";
|
||||
this.pnlDir_EF.Size = new System.Drawing.Size(200, 200);
|
||||
this.pnlDir_EF.TabIndex = 23;
|
||||
//
|
||||
// chbLivre_EF
|
||||
//
|
||||
this.chbLivre_EF.AutoSize = true;
|
||||
this.chbLivre_EF.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.chbLivre_EF.Location = new System.Drawing.Point(135, 177);
|
||||
this.chbLivre_EF.Name = "chbLivre_EF";
|
||||
this.chbLivre_EF.Size = new System.Drawing.Size(58, 20);
|
||||
this.chbLivre_EF.TabIndex = 17;
|
||||
this.chbLivre_EF.Text = "Livre";
|
||||
this.chbLivre_EF.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chbCmd_EF
|
||||
//
|
||||
this.chbCmd_EF.AutoSize = true;
|
||||
this.chbCmd_EF.Location = new System.Drawing.Point(4, 177);
|
||||
this.chbCmd_EF.Name = "chbCmd_EF";
|
||||
this.chbCmd_EF.Size = new System.Drawing.Size(83, 20);
|
||||
this.chbCmd_EF.TabIndex = 15;
|
||||
this.chbCmd_EF.Text = "Controlar";
|
||||
this.chbCmd_EF.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnRef_EF
|
||||
//
|
||||
this.btnRef_EF.Location = new System.Drawing.Point(148, 3);
|
||||
this.btnRef_EF.Name = "btnRef_EF";
|
||||
this.btnRef_EF.Size = new System.Drawing.Size(49, 23);
|
||||
this.btnRef_EF.TabIndex = 13;
|
||||
this.btnRef_EF.Text = "REF";
|
||||
this.btnRef_EF.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pnlDir_ET
|
||||
//
|
||||
this.pnlDir_ET.Controls.Add(this.chbLivre_ET);
|
||||
this.pnlDir_ET.Controls.Add(this.chbCmd_ET);
|
||||
this.pnlDir_ET.Controls.Add(this.btnRef_ET);
|
||||
this.pnlDir_ET.Controls.Add(this.lblDir_ET);
|
||||
this.pnlDir_ET.Location = new System.Drawing.Point(0, 200);
|
||||
this.pnlDir_ET.Name = "pnlDir_ET";
|
||||
this.pnlDir_ET.Size = new System.Drawing.Size(200, 200);
|
||||
this.pnlDir_ET.TabIndex = 24;
|
||||
//
|
||||
// chbLivre_ET
|
||||
//
|
||||
this.chbLivre_ET.AutoSize = true;
|
||||
this.chbLivre_ET.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.chbLivre_ET.Location = new System.Drawing.Point(135, 177);
|
||||
this.chbLivre_ET.Name = "chbLivre_ET";
|
||||
this.chbLivre_ET.Size = new System.Drawing.Size(58, 20);
|
||||
this.chbLivre_ET.TabIndex = 16;
|
||||
this.chbLivre_ET.Text = "Livre";
|
||||
this.chbLivre_ET.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chbCmd_ET
|
||||
//
|
||||
this.chbCmd_ET.AutoSize = true;
|
||||
this.chbCmd_ET.Location = new System.Drawing.Point(4, 177);
|
||||
this.chbCmd_ET.Name = "chbCmd_ET";
|
||||
this.chbCmd_ET.Size = new System.Drawing.Size(83, 20);
|
||||
this.chbCmd_ET.TabIndex = 15;
|
||||
this.chbCmd_ET.Text = "Controlar";
|
||||
this.chbCmd_ET.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnRef_ET
|
||||
//
|
||||
this.btnRef_ET.Location = new System.Drawing.Point(148, 3);
|
||||
this.btnRef_ET.Name = "btnRef_ET";
|
||||
this.btnRef_ET.Size = new System.Drawing.Size(49, 23);
|
||||
this.btnRef_ET.TabIndex = 13;
|
||||
this.btnRef_ET.Text = "REF";
|
||||
this.btnRef_ET.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pnlDir_DT
|
||||
//
|
||||
this.pnlDir_DT.Controls.Add(this.chbLivre_DT);
|
||||
this.pnlDir_DT.Controls.Add(this.chbCmd_DT);
|
||||
this.pnlDir_DT.Controls.Add(this.btnRef_DT);
|
||||
this.pnlDir_DT.Controls.Add(this.lblDir_DT);
|
||||
this.pnlDir_DT.Location = new System.Drawing.Point(648, 200);
|
||||
this.pnlDir_DT.Name = "pnlDir_DT";
|
||||
this.pnlDir_DT.Size = new System.Drawing.Size(200, 200);
|
||||
this.pnlDir_DT.TabIndex = 24;
|
||||
//
|
||||
// chbLivre_DT
|
||||
//
|
||||
this.chbLivre_DT.AutoSize = true;
|
||||
this.chbLivre_DT.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.chbLivre_DT.Location = new System.Drawing.Point(135, 177);
|
||||
this.chbLivre_DT.Name = "chbLivre_DT";
|
||||
this.chbLivre_DT.Size = new System.Drawing.Size(58, 20);
|
||||
this.chbLivre_DT.TabIndex = 19;
|
||||
this.chbLivre_DT.Text = "Livre";
|
||||
this.chbLivre_DT.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chbCmd_DT
|
||||
//
|
||||
this.chbCmd_DT.AutoSize = true;
|
||||
this.chbCmd_DT.Location = new System.Drawing.Point(4, 177);
|
||||
this.chbCmd_DT.Name = "chbCmd_DT";
|
||||
this.chbCmd_DT.Size = new System.Drawing.Size(83, 20);
|
||||
this.chbCmd_DT.TabIndex = 13;
|
||||
this.chbCmd_DT.Text = "Controlar";
|
||||
this.chbCmd_DT.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnRef_DT
|
||||
//
|
||||
this.btnRef_DT.Location = new System.Drawing.Point(148, 3);
|
||||
this.btnRef_DT.Name = "btnRef_DT";
|
||||
this.btnRef_DT.Size = new System.Drawing.Size(49, 23);
|
||||
this.btnRef_DT.TabIndex = 12;
|
||||
this.btnRef_DT.Text = "REF";
|
||||
this.btnRef_DT.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pnlDir_DF
|
||||
//
|
||||
this.pnlDir_DF.Controls.Add(this.chbLivre_DF);
|
||||
this.pnlDir_DF.Controls.Add(this.chbCmd_DF);
|
||||
this.pnlDir_DF.Controls.Add(this.btnRef_DF);
|
||||
this.pnlDir_DF.Controls.Add(this.lblDir_DF);
|
||||
this.pnlDir_DF.Location = new System.Drawing.Point(648, 0);
|
||||
this.pnlDir_DF.Name = "pnlDir_DF";
|
||||
this.pnlDir_DF.Size = new System.Drawing.Size(200, 200);
|
||||
this.pnlDir_DF.TabIndex = 24;
|
||||
//
|
||||
// chbLivre_DF
|
||||
//
|
||||
this.chbLivre_DF.AutoSize = true;
|
||||
this.chbLivre_DF.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.chbLivre_DF.Location = new System.Drawing.Point(135, 177);
|
||||
this.chbLivre_DF.Name = "chbLivre_DF";
|
||||
this.chbLivre_DF.Size = new System.Drawing.Size(58, 20);
|
||||
this.chbLivre_DF.TabIndex = 18;
|
||||
this.chbLivre_DF.Text = "Livre";
|
||||
this.chbLivre_DF.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chbCmd_DF
|
||||
//
|
||||
this.chbCmd_DF.AutoSize = true;
|
||||
this.chbCmd_DF.Location = new System.Drawing.Point(4, 177);
|
||||
this.chbCmd_DF.Name = "chbCmd_DF";
|
||||
this.chbCmd_DF.Size = new System.Drawing.Size(83, 20);
|
||||
this.chbCmd_DF.TabIndex = 14;
|
||||
this.chbCmd_DF.Text = "Controlar";
|
||||
this.chbCmd_DF.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnRef_DF
|
||||
//
|
||||
this.btnRef_DF.Location = new System.Drawing.Point(148, 3);
|
||||
this.btnRef_DF.Name = "btnRef_DF";
|
||||
this.btnRef_DF.Size = new System.Drawing.Size(49, 23);
|
||||
this.btnRef_DF.TabIndex = 13;
|
||||
this.btnRef_DF.Text = "REF";
|
||||
this.btnRef_DF.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnIniciarOperacao
|
||||
//
|
||||
this.btnIniciarOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnIniciarOperacao.Location = new System.Drawing.Point(1488, 724);
|
||||
this.btnIniciarOperacao.Name = "btnIniciarOperacao";
|
||||
this.btnIniciarOperacao.Size = new System.Drawing.Size(151, 65);
|
||||
this.btnIniciarOperacao.TabIndex = 25;
|
||||
this.btnIniciarOperacao.Text = "Iniciar Operação";
|
||||
this.btnIniciarOperacao.UseVisualStyleBackColor = true;
|
||||
this.btnIniciarOperacao.Click += new System.EventHandler(this.btnIniciarOperacao_Click);
|
||||
//
|
||||
// lblDistanciaEsquerda
|
||||
//
|
||||
|
|
@ -452,25 +650,29 @@
|
|||
this.lblDistanciaDireita.TabIndex = 27;
|
||||
this.lblDistanciaDireita.Text = "Distancia Dir: 00.00 cm";
|
||||
//
|
||||
// picSonar
|
||||
//
|
||||
this.picSonar.Location = new System.Drawing.Point(17, 16);
|
||||
this.picSonar.Name = "picSonar";
|
||||
this.picSonar.Size = new System.Drawing.Size(579, 320);
|
||||
this.picSonar.TabIndex = 0;
|
||||
this.picSonar.TabStop = false;
|
||||
//
|
||||
// frmOperacaoManual
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
this.ClientSize = new System.Drawing.Size(1651, 804);
|
||||
this.Controls.Add(this.lblDistanciaEsquerda);
|
||||
this.Controls.Add(this.lblDistanciaDireita);
|
||||
this.Controls.Add(this.btnIniciarOperacao);
|
||||
this.Controls.Add(this.lblDistanciaEsquerda);
|
||||
this.Controls.Add(this.tabControl1);
|
||||
this.Controls.Add(this.lblDistanciaDireita);
|
||||
this.Controls.Add(this.pnlDir_DF);
|
||||
this.Controls.Add(this.pnlDir_DT);
|
||||
this.Controls.Add(this.pnlDir_ET);
|
||||
this.Controls.Add(this.pnlDir_EF);
|
||||
this.Controls.Add(this.pnlCameraRua);
|
||||
this.Controls.Add(this.lblMagnetometro);
|
||||
this.Controls.Add(this.pnlAnguloMagnetometro);
|
||||
this.Controls.Add(this.lblGPS);
|
||||
this.Controls.Add(this.pnlAnguloGPS);
|
||||
this.Controls.Add(this.tabControl1);
|
||||
this.Controls.Add(this.chartGraficos);
|
||||
this.Controls.Add(this.pnlAtuadores);
|
||||
this.Controls.Add(this.pnlCamerasSolo);
|
||||
|
|
@ -487,9 +689,14 @@
|
|||
((System.ComponentModel.ISupportInitialize)(this.chartGraficos)).EndInit();
|
||||
this.tabControl1.ResumeLayout(false);
|
||||
this.tabMapa.ResumeLayout(false);
|
||||
this.tabMapa.PerformLayout();
|
||||
this.tabInformacoes.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridDados)).EndInit();
|
||||
this.tabDeteccoes.ResumeLayout(false);
|
||||
this.pnlDeteccoesRua.ResumeLayout(false);
|
||||
this.tabPulverizador.ResumeLayout(false);
|
||||
this.tabPulverizador.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudPressaoSP)).EndInit();
|
||||
this.pnlCameraRua.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.picCameraRua)).EndInit();
|
||||
this.pnlDir_EF.ResumeLayout(false);
|
||||
|
|
@ -500,9 +707,7 @@
|
|||
this.pnlDir_DT.PerformLayout();
|
||||
this.pnlDir_DF.ResumeLayout(false);
|
||||
this.pnlDir_DF.PerformLayout();
|
||||
this.tabPulverizador.ResumeLayout(false);
|
||||
this.tabPulverizador.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudPressaoSP)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picSonar)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
|
|
@ -546,5 +751,22 @@
|
|||
private System.Windows.Forms.Button btnLigarBomba;
|
||||
private System.Windows.Forms.Label lblDistanciaEsquerda;
|
||||
private System.Windows.Forms.Label lblDistanciaDireita;
|
||||
private System.Windows.Forms.Label lblGPSsatelites;
|
||||
private System.Windows.Forms.Label lblGPSaltitude;
|
||||
private System.Windows.Forms.Label lblGPSvelocidade;
|
||||
private System.Windows.Forms.Label lblGPSprecisao;
|
||||
private System.Windows.Forms.Button btnRef_EF;
|
||||
private System.Windows.Forms.Button btnRef_ET;
|
||||
private System.Windows.Forms.Button btnRef_DT;
|
||||
private System.Windows.Forms.Button btnRef_DF;
|
||||
private System.Windows.Forms.CheckBox chbCmd_EF;
|
||||
private System.Windows.Forms.CheckBox chbCmd_ET;
|
||||
private System.Windows.Forms.CheckBox chbCmd_DT;
|
||||
private System.Windows.Forms.CheckBox chbCmd_DF;
|
||||
private System.Windows.Forms.CheckBox chbLivre_EF;
|
||||
private System.Windows.Forms.CheckBox chbLivre_ET;
|
||||
private System.Windows.Forms.CheckBox chbLivre_DT;
|
||||
private System.Windows.Forms.CheckBox chbLivre_DF;
|
||||
private System.Windows.Forms.PictureBox picSonar;
|
||||
}
|
||||
}
|
||||
|
|
@ -43,12 +43,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
|
||||
private void frmOperacaoManual_Load(object sender, EventArgs e)
|
||||
{
|
||||
pnlDir_DF.Paint += pnlDir_Paint;
|
||||
pnlDir_DT.Paint += pnlDir_Paint;
|
||||
pnlDir_EF.Paint += pnlDir_Paint;
|
||||
pnlDir_ET.Paint += pnlDir_Paint;
|
||||
|
||||
|
||||
InicializarComandosDirecional();
|
||||
IniciarCameras();
|
||||
PopularInformacoesGerais();
|
||||
InicializarMapa();
|
||||
|
|
@ -63,10 +58,39 @@ namespace AgroBase.Forms.Operacoes
|
|||
{
|
||||
tmrLeitura.Stop();
|
||||
tmrLeitura.Dispose();
|
||||
Mapa.PararProcessamento();
|
||||
videoSourceRua.Stop();
|
||||
videoSourceSoloD.Stop();
|
||||
videoSourceSoloE.Stop();
|
||||
Variaveis.OperacaoEmAndamento.Mapa.PararProcessamento();
|
||||
if (videoSourceRua != null)
|
||||
{
|
||||
videoSourceRua.Stop();
|
||||
}
|
||||
if (videoSourceSoloD != null)
|
||||
{
|
||||
videoSourceSoloD.Stop();
|
||||
}
|
||||
if (videoSourceSoloE != null)
|
||||
{
|
||||
videoSourceSoloE.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnIniciarOperacao_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (btnIniciarOperacao.Text == "Finalizar Operação")
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.FinalizarOperacao();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Variaveis.OperacaoEmAndamento.OperacaoLiberada)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.IniciarOperacao(null, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Finalize a parametrização corretamente para iniciar a operação!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
btnIniciarOperacao.Text = !Variaveis.OperacaoEmAndamento.Iniciado ? "Iniciar Operação" : "Finalizar Operação";
|
||||
}
|
||||
|
||||
private void tmrLeitura_Tick(object sender, EventArgs e)
|
||||
|
|
@ -76,7 +100,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
|
||||
public void AtualizarDados()
|
||||
{
|
||||
var statusAtual = Variaveis.OperacaoEmAndamento.ReferencialRuaGPS.StatusAtual;
|
||||
var statusAtual = Variaveis.OperacaoEmAndamento.StatusAtual;
|
||||
|
||||
if (statusAtual == StatusOperacao.Parametrizando)
|
||||
{
|
||||
|
|
@ -86,11 +110,11 @@ namespace AgroBase.Forms.Operacoes
|
|||
{
|
||||
this.Text = "Operação Manual - Iniciando em " + (Variaveis.OperacaoEmAndamento.TempoAguardando.AddSeconds(Variaveis.OperacaoEmAndamento.TempoIniciarOperacao) - DateTime.Now).TotalSeconds.ToString("0") + " segundo" + ((Variaveis.OperacaoEmAndamento.TempoAguardando.AddSeconds(Variaveis.OperacaoEmAndamento.TempoIniciarOperacao) - DateTime.Now).TotalSeconds < 1 ? "" : "s") + "...";
|
||||
}
|
||||
else if (statusAtual == StatusOperacao.Concluida)
|
||||
else if (statusAtual == StatusOperacao.Concluido)
|
||||
{
|
||||
this.Text = "Operação Manual - Concluída";
|
||||
}
|
||||
else if (Variaveis.OperacaoEmAndamento.Iniciado)
|
||||
else if (statusAtual == StatusOperacao.EmAndamento)
|
||||
{
|
||||
this.Text = "Operação Manual - Em andamento";
|
||||
}
|
||||
|
|
@ -109,11 +133,51 @@ namespace AgroBase.Forms.Operacoes
|
|||
|
||||
lblDistanciaEsquerda.Text = "Distancia Esq: " + Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaEsquerda.ToString("0.00") + " cm";
|
||||
lblDistanciaDireita.Text = "Distancia Dir: " + Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaDireita.ToString("0.00") + " cm";
|
||||
lblGPSsatelites.Text = GPSService.UltimaLeitura.NumeroSatelites.ToString() + " satélites";
|
||||
lblGPSprecisao.Text = "Precisão: " + GPSService.UltimaLeitura.PrecisaoHorizontal.ToString("0.00") + " m";
|
||||
lblGPSvelocidade.Text = "Vel.: " + GPSService.UltimaLeitura.Velocidade.ToString("0.00") + " km/h";
|
||||
lblGPSaltitude.Text = "Altitude: " + GPSService.UltimaLeitura.Altitude.ToString("0.0") + " m";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region Direcionais
|
||||
|
||||
private void InicializarComandosDirecional()
|
||||
{
|
||||
pnlDir_DF.Paint += pnlDir_Paint;
|
||||
pnlDir_DT.Paint += pnlDir_Paint;
|
||||
pnlDir_EF.Paint += pnlDir_Paint;
|
||||
pnlDir_ET.Paint += pnlDir_Paint;
|
||||
btnRef_DF.Click += btnRef_Click;
|
||||
btnRef_DT.Click += btnRef_Click;
|
||||
btnRef_EF.Click += btnRef_Click;
|
||||
btnRef_ET.Click += btnRef_Click;
|
||||
chbCmd_DF.CheckedChanged += chbCmd_CheckedChanged;
|
||||
chbCmd_DT.CheckedChanged += chbCmd_CheckedChanged;
|
||||
chbCmd_EF.CheckedChanged += chbCmd_CheckedChanged;
|
||||
chbCmd_ET.CheckedChanged += chbCmd_CheckedChanged;
|
||||
chbLivre_DF.CheckedChanged += chbLivre_CheckedChanged;
|
||||
chbLivre_DT.CheckedChanged += chbLivre_CheckedChanged;
|
||||
chbLivre_EF.CheckedChanged += chbLivre_CheckedChanged;
|
||||
chbLivre_ET.CheckedChanged += chbLivre_CheckedChanged;
|
||||
DefinirStatusInicialChb(chbCmd_DF, chbLivre_DF);
|
||||
DefinirStatusInicialChb(chbCmd_DT, chbLivre_DT);
|
||||
DefinirStatusInicialChb(chbCmd_EF, chbLivre_EF);
|
||||
DefinirStatusInicialChb(chbCmd_ET, chbLivre_ET);
|
||||
}
|
||||
|
||||
private void DefinirStatusInicialChb(CheckBox chbCmd, CheckBox chbLivre)
|
||||
{
|
||||
string ID = chbCmd.Name.Split('_')[1];
|
||||
var Motor = Variaveis.OperacaoEmAndamento.DispDir.Dados.Motores.FirstOrDefault(x => x.ID == ID);
|
||||
chbCmd.Checked = Motor.Controlar;
|
||||
chbLivre.Checked = Motor.Livre;
|
||||
}
|
||||
|
||||
private void pnlDir_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
DesenharGraficos(sender, e);
|
||||
|
|
@ -221,6 +285,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
|
||||
// Desenhe os pontos nos angulos fixos
|
||||
int radiusCircle = 5;
|
||||
var fontText = new Font(FontFamily.GenericSerif, 7);
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
double angle = ((i * 90) * Math.PI) / 180;
|
||||
|
|
@ -239,7 +304,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
}
|
||||
|
||||
string angleText = ((i * 90).ToString() + "°");
|
||||
SizeF textSize = g.MeasureString(angleText, Font);
|
||||
SizeF textSize = g.MeasureString(angleText, fontText);
|
||||
|
||||
float textX = xA;
|
||||
float textY = yA;
|
||||
|
|
@ -267,11 +332,36 @@ namespace AgroBase.Forms.Operacoes
|
|||
textY -= textSize.Height / 2;
|
||||
}
|
||||
|
||||
g.DrawString(angleText, Font, Brushes.Black, textX, textY);
|
||||
g.DrawString(angleText, fontText, Brushes.Black, textX, textY);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void btnRef_Click(object sender, EventArgs e)
|
||||
{
|
||||
string ID = ((Button)sender).Name.Replace("btnRef_", "");
|
||||
var Dispositivo = Variaveis.OperacaoEmAndamento.DispDir;
|
||||
var Motor = Dispositivo.Dados.Motores.FirstOrDefault(x => x.ID == ID);
|
||||
string Comando = Motor.ProtocoloComando(Direcao.Parado, true);
|
||||
Dispositivo.EnviarDadosSerial(Comando);
|
||||
}
|
||||
|
||||
private void chbCmd_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
string ID = ((CheckBox)sender).Name.Replace("chbCmd_", "");
|
||||
var Dispositivo = Variaveis.OperacaoEmAndamento.DispDir;
|
||||
var Motor = Dispositivo.Dados.Motores.FirstOrDefault(x => x.ID == ID);
|
||||
Motor.Controlar = ((CheckBox)sender).Checked;
|
||||
}
|
||||
|
||||
private void chbLivre_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
string ID = ((CheckBox)sender).Name.Replace("chbLivre_", "");
|
||||
var Dispositivo = Variaveis.OperacaoEmAndamento.DispDir;
|
||||
var Motor = Dispositivo.Dados.Motores.FirstOrDefault(x => x.ID == ID);
|
||||
Motor.Livre = ((CheckBox)sender).Checked;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cameras
|
||||
|
|
@ -336,7 +426,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
{
|
||||
try
|
||||
{
|
||||
double angulo = Variaveis.OperacaoEmAndamento.ReferencialRuaGPS.AnguloCarroGPS;
|
||||
double angulo = GPSService.UltimaLeitura.Orientacao;
|
||||
DesenharInclinacao((Panel)sender, e, (float)angulo, -90);
|
||||
}
|
||||
catch { }
|
||||
|
|
@ -492,8 +582,6 @@ namespace AgroBase.Forms.Operacoes
|
|||
gridDados.Rows.Add("Corrente da Bateria", "", "A");
|
||||
gridDados.Rows.Add("Nível do Reservatório", "", "%");
|
||||
gridDados.Rows.Add("Volume do Reservatório", "", "L");
|
||||
gridDados.Rows.Add("Herbicida Aplicado", "", "L");
|
||||
gridDados.Rows.Add("Ervas Detectadas", "", "");
|
||||
gridDados.Rows.Add("Pressão da Linha", "", "psi");
|
||||
gridDados.Rows.Add("Potência na Bomba", "", "%");
|
||||
|
||||
|
|
@ -511,25 +599,21 @@ namespace AgroBase.Forms.Operacoes
|
|||
gridDados.Rows[6].Cells[1].Value = (PZEMService.Iniciado && PZEMService.UltimaLeitura != null ? PZEMService.UltimaLeitura.Corrente.ToString("0.00") : "");
|
||||
gridDados.Rows[7].Cells[1].Value = Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio.ToString("00.00");
|
||||
gridDados.Rows[8].Cells[1].Value = Variaveis.OperacaoEmAndamento.DispAtu.Dados.VolumeReservatorio.ToString("0.000");
|
||||
gridDados.Rows[9].Cells[1].Value = Variaveis.OperacaoEmAndamento.Sensoriamento.HerbicidaConsumido.ToString("0.000");
|
||||
gridDados.Rows[10].Cells[1].Value = Variaveis.OperacaoEmAndamento.Sensoriamento.ErvasIdentificadas.ToString("000");
|
||||
gridDados.Rows[11].Cells[1].Value = Variaveis.OperacaoEmAndamento.DispAtu.Dados.PressaoLinha.ToString("0.00");
|
||||
gridDados.Rows[12].Cells[1].Value = Variaveis.OperacaoEmAndamento.DispAtu.Dados.BombaPressurizadora.Potencia.ToString("0.00");
|
||||
gridDados.Rows[9].Cells[1].Value = Variaveis.OperacaoEmAndamento.DispAtu.Dados.PressaoLinha.ToString("0.00");
|
||||
gridDados.Rows[10].Cells[1].Value = Variaveis.OperacaoEmAndamento.DispAtu.Dados.BombaPressurizadora.Potencia.ToString("0.00");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mapa GPS
|
||||
|
||||
private MapasModel Mapa;
|
||||
|
||||
private void InicializarMapa()
|
||||
{
|
||||
Mapa = new MapasModel()
|
||||
Variaveis.OperacaoEmAndamento.Mapa = new MapasModel()
|
||||
{
|
||||
pnlMapa = pnlMapa,
|
||||
};
|
||||
Mapa.CarregarMapaGPS();
|
||||
Variaveis.OperacaoEmAndamento.Mapa.CarregarMapaGPS();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
@ -656,7 +740,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
|
||||
|
||||
// Define a string que representa a atuacao do bico
|
||||
string bicoAtuacao = Variaveis.OperacaoEmAndamento.Sensoriamento.AtuacoesPorBico[i].ToString("000");
|
||||
string bicoAtuacao = "000"; // Variaveis.OperacaoEmAndamento.Sensoriamento.AtuacoesPorBico[i].ToString("000");
|
||||
// Define a fonte para o texto
|
||||
Font fontA = new Font("Arial", 8, FontStyle.Bold);
|
||||
// Mede o tamanho do texto
|
||||
|
|
@ -691,26 +775,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
|
||||
#endregion
|
||||
|
||||
private void btnIniciarOperacao_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (btnIniciarOperacao.Text == "Finalizar Operação")
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.FinalizarOperacao();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Variaveis.OperacaoEmAndamento.OperacaoLiberada)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.IniciarOperacao(null, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Finalize a parametrização corretamente para iniciar a operação!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
btnIniciarOperacao.Text = !Variaveis.OperacaoEmAndamento.Iniciado ? "Iniciar Operação" : "Finalizar Operação";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ namespace AgroBase.Forms.Operacoes
|
|||
public partial class frmOperacaoMapaGPS : Form
|
||||
{
|
||||
private Timer tmrLeituras = new Timer() { Interval = 200 };
|
||||
CalibragemVazao _CalibragemVazao = new CalibragemVazao();
|
||||
|
||||
#region Eventos do formulário
|
||||
|
||||
|
|
@ -57,8 +56,6 @@ namespace AgroBase.Forms.Operacoes
|
|||
AtualizarDispositivos();
|
||||
AtualizaListaCameras();
|
||||
nudPressaoSP.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.DispAtu.Dados.BombaPressurizadora.PressaoSP);
|
||||
txtVolumeLido.Text = Variaveis.OperacaoEmAndamento.DispAtu.Dados._FluxoMlRef.ToString("0.0");
|
||||
lblVazao.Text = "Vazão " + (Variaveis.OperacaoEmAndamento.DispAtu.Dados._FluxoMlRef / _CalibragemVazao.TempoCalibragem * 1000).ToString("0") + " mL/s";
|
||||
}
|
||||
|
||||
private void frmOperacaoMapaGPS_FormClosing(object sender, FormClosingEventArgs e)
|
||||
|
|
@ -101,7 +98,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
|
||||
}
|
||||
});
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.ErvasNoRadar = Variaveis.OperacaoEmAndamento.CamerasSolo.Sum(x => x.ErvasNoRadar);
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ErvasNoRadar = Variaveis.OperacaoEmAndamento.CamerasSolo.Sum(x => x.ErvasNoRadar);
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -111,10 +108,20 @@ namespace AgroBase.Forms.Operacoes
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
var StatusCarro = Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.StatusAtual;
|
||||
if (StatusCarro == StatusCarroMapa.Direcionando)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Mapa.GerarCaminhoEntreDoisPontos(Variaveis.OperacaoEmAndamento.Mapa.Trajetoria[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual].First());
|
||||
}
|
||||
else if (StatusCarro == StatusCarroMapa.Manobrando)
|
||||
{
|
||||
//Variaveis.OperacaoEmAndamento.Mapa.GerarCaminhoEntreDoisPontos(Variaveis.OperacaoEmAndamento.Mapa.Trajetoria[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual].First());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.AtualizarRuasSelecionadas();
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.AtualizarRuasSelecionadas();
|
||||
}
|
||||
AtualizarGrafico();
|
||||
AtualizarInformacoesGerais();
|
||||
|
|
@ -122,7 +129,8 @@ namespace AgroBase.Forms.Operacoes
|
|||
pnlInclinacao.Invalidate();
|
||||
pnlAtuadores.Invalidate();
|
||||
|
||||
PZEMService.EnviarComando(PZEMService.PortaPZEM, PZEMService.ComandoAquisicaoDados());
|
||||
btnCarregarMapa.Enabled = !Variaveis.OperacaoEmAndamento.Iniciado;
|
||||
nudPressaoSP.Enabled = !Variaveis.OperacaoEmAndamento.Iniciado;
|
||||
|
||||
if (!Variaveis.OperacaoEmAndamento.Iniciado && btnIniciarOperacao.Text == "Finalizar Operação")
|
||||
{
|
||||
|
|
@ -197,7 +205,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
int iBico = i + (CameraSolo.Posicao * BicosPorCamera);
|
||||
if (Atuador.Dados.BicosPulverizadores[iBico].Atuado && BicosAnteriores[i] != Atuador.Dados.BicosPulverizadores[iBico].Atuado)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.AtuacoesPorBico[iBico]++;
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico[iBico]++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -255,7 +263,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
cameraCaminho.AnguloEsquerdo = 0;
|
||||
}
|
||||
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloRuaCamera = cameraCaminho.Angulo;
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AnguloRuaCamera = cameraCaminho.Angulo;
|
||||
|
||||
pnlAnguloCamera.Invalidate();
|
||||
|
||||
|
|
@ -271,9 +279,9 @@ namespace AgroBase.Forms.Operacoes
|
|||
|
||||
private void AtualizaInformacoesControleOperacao()
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.AtualizarControleAtuadores();
|
||||
Variaveis.OperacaoEmAndamento.CalculaDadosMovimentacaoAutonoma();
|
||||
Variaveis.OperacaoEmAndamento.AtualizarDadosControle();
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.AtualizarControleAtuadores();
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.CalculaDadosMovimentacaoAutonoma();
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.AtualizarDadosControle();
|
||||
}
|
||||
|
||||
private void AtualizarGrafico()
|
||||
|
|
@ -336,7 +344,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
|
||||
private void AtualizarInformacoesGerais()
|
||||
{
|
||||
var statusAtual = Variaveis.OperacaoEmAndamento.ReferencialRuaGPS.StatusAtual;
|
||||
var statusAtual = Variaveis.OperacaoEmAndamento.StatusAtual;
|
||||
|
||||
if (statusAtual == StatusOperacao.Parametrizando)
|
||||
{
|
||||
|
|
@ -344,40 +352,40 @@ namespace AgroBase.Forms.Operacoes
|
|||
}
|
||||
else if (statusAtual == StatusOperacao.Aguardando)
|
||||
{
|
||||
this.Text = "Operação Mapa GPS - Iniciando em " + (Variaveis.OperacaoEmAndamento.TempoAguardando.AddSeconds(Variaveis.OperacaoEmAndamento.TempoIniciarOperacao) - DateTime.Now).TotalSeconds.ToString("0") + " segundo" + ((Variaveis.OperacaoEmAndamento.TempoAguardando.AddSeconds(Variaveis.OperacaoEmAndamento.TempoIniciarOperacao) - DateTime.Now).TotalSeconds >= 1 ? "" : "s") + "...";
|
||||
this.Text = "Operação Mapa GPS - Iniciando em " + (Variaveis.OperacaoEmAndamento.TempoAguardando.AddSeconds(Variaveis.OperacaoEmAndamento.TempoIniciarOperacao) - DateTime.Now).TotalSeconds.ToString("0") + " segundo" + ((Variaveis.OperacaoEmAndamento.TempoAguardando.AddSeconds(Variaveis.OperacaoEmAndamento.TempoIniciarOperacao) - DateTime.Now).TotalSeconds < 1 ? "" : "s") + "...";
|
||||
}
|
||||
else if (statusAtual == StatusOperacao.Concluida)
|
||||
else if (statusAtual == StatusOperacao.Concluido)
|
||||
{
|
||||
this.Text = "Operação Mapa GPS - Concluída";
|
||||
}
|
||||
else if (Variaveis.OperacaoEmAndamento.Iniciado)
|
||||
else if (statusAtual == StatusOperacao.EmAndamento)
|
||||
{
|
||||
this.Text = "Operação Mapa GPS - Em andamento";
|
||||
}
|
||||
|
||||
lblDistanciaEsquerda.Text = "Distancia da Esquerda: " + Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaEsquerda.ToString("0.00") + " cm";
|
||||
lblDistanciaDireita.Text = "Distancia da Direita: " + Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaDireita.ToString("0.00") + " cm";
|
||||
//lblDistanciaEsquerda.Text = "Distancia da Esquerda: " + Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaEsquerda.ToString("0.00") + " cm";
|
||||
//lblDistanciaDireita.Text = "Distancia da Direita: " + Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaDireita.ToString("0.00") + " cm";
|
||||
|
||||
lblDistanciaPercorrida.Text = "Distancia Percorrida: " + Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaPercorrida.Sum().ToString("0.00") + " m";
|
||||
lblTempoOperacao.Text = "Tempo de Operação: " + Variaveis.OperacaoEmAndamento.Tempo.Hours.ToString("00") + ":" + Variaveis.OperacaoEmAndamento.Tempo.Minutes.ToString("00") + ":" + Variaveis.OperacaoEmAndamento.Tempo.Seconds.ToString("00");
|
||||
lblVelocidadeMedia.Text = "Velocidade Média: " + Variaveis.OperacaoEmAndamento.Sensoriamento.VelocidadeMedia.ToString("0.00") + " km/h";
|
||||
lblErvasIdentificadas.Text = "Ervas Identificadas: " + Variaveis.OperacaoEmAndamento.Sensoriamento.ErvasIdentificadas.ToString("000");
|
||||
lblHerbicidaAplicado.Text = "Herbicida Aplicado: " + Variaveis.OperacaoEmAndamento.Sensoriamento.HerbicidaConsumido.ToString("0.000") + " L";
|
||||
lblHerbicidaPorErva.Text = "Herbicida por Erva: " + Variaveis.OperacaoEmAndamento.Sensoriamento.HerbicidaPorErva.ToString("0.000") + " mL";
|
||||
lblErvasIdentificadas.Text = "Ervas Identificadas: " + Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ErvasIdentificadas.ToString("000");
|
||||
lblHerbicidaAplicado.Text = "Herbicida Aplicado: " + Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.HerbicidaConsumido.ToString("0.000") + " L";
|
||||
lblHerbicidaPorErva.Text = "Herbicida por Erva: " + Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.HerbicidaPorErva.ToString("0.000") + " mL";
|
||||
lblBateriaConsumida.Text = "Bateria Consumida: " + Variaveis.OperacaoEmAndamento.Sensoriamento.BateriaConsumida.ToString("0.00") + "%";
|
||||
|
||||
lblPressao.Text = "P: " + Variaveis.OperacaoEmAndamento.DispAtu.Dados.PressaoLinha.ToString("0.00") + " psi";
|
||||
|
||||
pgbReservatorio.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio);
|
||||
pgbReservatorio.Value = Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio <= 100 ? Convert.ToInt32(Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio) : 100;
|
||||
lblPorcentagemReservatorio.Text = Variaveis.OperacaoEmAndamento.DispAtu.Dados.VolumeReservatorio.ToString("0.000") + " L " + Variaveis.OperacaoEmAndamento.DispAtu.Dados.PercentualReservatorio.ToString("00.00") + "%";
|
||||
|
||||
pgbBateria.Value = Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria <= 100 ? Convert.ToInt32(Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria) : 100;
|
||||
lblPorcentagemBateria.Text = (PZEMService.Iniciado && PZEMService.UltimaLeitura != null ? PZEMService.UltimaLeitura.Tensao.ToString("0.00") + "v " + PZEMService.UltimaLeitura.Corrente.ToString("0.00") + "A " : "") + Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria.ToString("00.00") + "%";
|
||||
|
||||
pgbProgresso.Value = Variaveis.OperacaoEmAndamento.Sensoriamento.ProgressoTrajeto <= 100 ? Convert.ToInt32(Variaveis.OperacaoEmAndamento.Sensoriamento.ProgressoTrajeto) : 100;
|
||||
lblPorcentagemProgresso.Text = Variaveis.OperacaoEmAndamento.Sensoriamento.ProgressoTrajeto.ToString("00.00") + "%";
|
||||
pgbProgressoRua.Value = Variaveis.OperacaoEmAndamento.Sensoriamento.ProgressoRua <= 100 ? Convert.ToInt32(Variaveis.OperacaoEmAndamento.Sensoriamento.ProgressoRua) : 100;
|
||||
lblPorcentagemProgressoRua.Text = Variaveis.OperacaoEmAndamento.Sensoriamento.ProgressoRua.ToString("00.00") + "%";
|
||||
pgbProgresso.Value = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoTrajeto <= 100 ? Convert.ToInt32(Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoTrajeto) : 100;
|
||||
lblPorcentagemProgresso.Text = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoTrajeto.ToString("00.00") + "%";
|
||||
pgbProgressoRua.Value = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoRua <= 100 ? Convert.ToInt32(Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoRua) : 100;
|
||||
lblPorcentagemProgressoRua.Text = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.ProgressoRua.ToString("00.00") + "%";
|
||||
lblDistancia.Text = "Distância Operação: " + (Variaveis.OperacaoEmAndamento.Mapa == null ? 0 : Variaveis.OperacaoEmAndamento.Mapa.DistanciaTotal).ToString("00.00") + " m";
|
||||
|
||||
|
||||
|
|
@ -630,7 +638,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
}
|
||||
else
|
||||
{
|
||||
if (Variaveis.OperacaoEmAndamento.OperacaoLiberada)
|
||||
if (Variaveis.OperacaoEmAndamento.OperacaoLiberada && Variaveis.OperacaoEmAndamento.Mapa.DistanciaTotal > 0 && Variaveis.OperacaoEmAndamento.Mapa.RuasPercorrer.Any())
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.DispAtu.Dados.BombaPressurizadora.PressaoSP = Convert.ToDouble(nudPressaoSP.Value);
|
||||
Variaveis.OperacaoEmAndamento.IniciarOperacao(null, false);
|
||||
|
|
@ -694,7 +702,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
|
||||
|
||||
// Define a string que representa a atuacao do bico
|
||||
string bicoAtuacao = Variaveis.OperacaoEmAndamento.Sensoriamento.AtuacoesPorBico[i].ToString("000");
|
||||
string bicoAtuacao = Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AtuacoesPorBico[i].ToString("000");
|
||||
// Define a fonte para o texto
|
||||
Font fontA = new Font("Arial", 8, FontStyle.Bold);
|
||||
// Mede o tamanho do texto
|
||||
|
|
@ -807,7 +815,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
try
|
||||
{
|
||||
//DesenharInclinacao((Panel)sender, e, (float)cameraCaminho.Angulo);
|
||||
DesenharInclinacao((Panel)sender, e, (float)(Variaveis.OperacaoEmAndamento.Controle.Angulo), 90);
|
||||
DesenharInclinacao((Panel)sender, e, (float)(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.Angulo), 90);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
|
@ -817,7 +825,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
try
|
||||
{
|
||||
//DesenharInclinacao((Panel)sender, e, (float)cameraCaminho.Angulo);
|
||||
DesenharInclinacao((Panel)sender, e, (float)(Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloRuaCamera), 90);
|
||||
DesenharInclinacao((Panel)sender, e, (float)(Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.AnguloRuaCamera), 90);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
|
@ -826,7 +834,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
{
|
||||
try
|
||||
{
|
||||
double angulo = Variaveis.OperacaoEmAndamento.ReferencialRuaGPS.AnguloCarro;
|
||||
double angulo = Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.AnguloCarro;
|
||||
DesenharInclinacao((Panel)sender, e, (float)angulo, -90);
|
||||
}
|
||||
catch { }
|
||||
|
|
@ -912,16 +920,16 @@ namespace AgroBase.Forms.Operacoes
|
|||
{
|
||||
((Timer)sender).Stop();
|
||||
}
|
||||
lblStatus.Text = "Status: " + Enum.GetName(typeof(StatusOperacao), Variaveis.OperacaoEmAndamento.ReferencialRuaGPS.StatusAtual);
|
||||
lblDirecao.Text = "Direção: " + Enum.GetName(typeof(DirecaoCarroRua), Variaveis.OperacaoEmAndamento.ReferencialRuaGPS.Direcao);
|
||||
lblStatus.Text = "Status: " + Enum.GetName(typeof(StatusCarroMapa), Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.StatusAtual);
|
||||
lblDirecao.Text = "Direção: " + Enum.GetName(typeof(DirecaoCarroRua), Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.Direcao);
|
||||
//var Ponto = Variaveis.OperacaoEmAndamento.Mapa.Trajetoria[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual][Variaveis.OperacaoEmAndamento.ReferencialRuaGPS.IdxPontoAproximadoRua];
|
||||
}
|
||||
|
||||
private void btnManobraConcluida_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Variaveis.OperacaoEmAndamento.ReferencialRuaGPS.StatusAtual == StatusOperacao.Manobrando)
|
||||
if (Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.StatusAtual == StatusCarroMapa.Manobrando)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.ReferencialRuaGPS.ManobraConcluida = true;
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.ManobraConcluida = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -931,128 +939,6 @@ namespace AgroBase.Forms.Operacoes
|
|||
#endregion
|
||||
|
||||
|
||||
#region Calibragem do pulverizador
|
||||
|
||||
private void AtuarBico(AtuadorBicoModel Bico, bool Estado)
|
||||
{
|
||||
if (Bico != null)
|
||||
{
|
||||
Bico.Atuado = Variaveis.OperacaoEmAndamento.DispAtu.Dados.AtuacaoNivelAlto ? Estado : !Estado;
|
||||
string Protocolo = Bico.ProtocoloComando();
|
||||
Variaveis.OperacaoEmAndamento.DispAtu.EnviarDadosSerial(Protocolo);
|
||||
}
|
||||
}
|
||||
|
||||
private void AtuarBomba(bool Estado)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.DispAtu.Dados.BombaPressurizadora.BombaAtuada = Estado;
|
||||
string Protocolo = Variaveis.OperacaoEmAndamento.DispAtu.Dados.BombaPressurizadora.ProtocoloComando();
|
||||
Variaveis.OperacaoEmAndamento.DispAtu.EnviarDadosSerial(Protocolo);
|
||||
}
|
||||
|
||||
private void btnCalibrarVazao_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (btnCalibrarVazao.Text == "Calcular")
|
||||
{
|
||||
if (txtVolumeLido.Text == "" || double.TryParse(txtVolumeLido.Text, out double Volume) == false)
|
||||
{
|
||||
MessageBox.Show("Informe o volume obtido durante a calibragem!");
|
||||
return;
|
||||
}
|
||||
_CalibragemVazao.VolumeComputado = Volume;
|
||||
btnCalibrarVazao.Text = "Calibrar vazão";
|
||||
|
||||
string Resultados =
|
||||
"Valores iniciais" + Environment.NewLine +
|
||||
"Massa = " + _CalibragemVazao.MassaInicial.ToString("0.0000") + " Kg" + Environment.NewLine +
|
||||
"Pressão = " + _CalibragemVazao.PressoesAferidas.First().ToString("0.0000") + " psi" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"Medições" + Environment.NewLine +
|
||||
"V = " + _CalibragemVazao.VolumeComputado.ToString("0.0000") + "mL" + Environment.NewLine +
|
||||
"P = " + _CalibragemVazao.PressaoMedia.ToString("0.0000") + " psi" + Environment.NewLine +
|
||||
"NP = " + _CalibragemVazao.QtdPulsos + Environment.NewLine +
|
||||
"T = " + _CalibragemVazao.Periodo + " s" + Environment.NewLine +
|
||||
"M = " + _CalibragemVazao.MassaFinal.ToString("0.0000") + " Kg" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"Cálculos" + Environment.NewLine +
|
||||
"Massa Perdida = " + _CalibragemVazao.MassaPerdida.ToString("0.0000") + " g" + Environment.NewLine +
|
||||
"d = " + _CalibragemVazao.d.ToString("0.0000") + Environment.NewLine +
|
||||
"Q = " + _CalibragemVazao.Q.ToString("0.0000") + " mL/s" + Environment.NewLine +
|
||||
"x = " + _CalibragemVazao.x.ToString("0.0000") + Environment.NewLine +
|
||||
"Q2 = " + _CalibragemVazao.Q2.ToString("0.0000") + " mL" + Environment.NewLine +
|
||||
""
|
||||
;
|
||||
|
||||
Console.WriteLine(Resultados);
|
||||
MessageBox.Show(Resultados, "Resultado da calibragem");
|
||||
if (MessageBox.Show("Deseja aceitar os parâmetros de calibragem?", "Atualizar dados", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.DispAtu.Dados._FluxoMlRef = _CalibragemVazao.VolumeComputado;
|
||||
Variaveis.OperacaoEmAndamento.DispAtu.Dados._FluxoPulsoRef = _CalibragemVazao.QtdPulsos;
|
||||
Variaveis.OperacaoEmAndamento.DispAtu.Dados.DensidadeHerbicida = _CalibragemVazao.d;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
btnCalibrarVazao.Enabled = false;
|
||||
AtuarBomba(true);
|
||||
var tmrInicioCalibragemVazao = new Timer { Interval = 1000 };
|
||||
tmrInicioCalibragemVazao.Tick += tmrInicioCalibragemVazao_Tick;
|
||||
tmrInicioCalibragemVazao.Start();
|
||||
}
|
||||
txtVolumeLido.Enabled = false;
|
||||
}
|
||||
|
||||
private void tmrInicioCalibragemVazao_Tick(object sender, EventArgs e)
|
||||
{
|
||||
((Timer)sender).Stop();
|
||||
|
||||
var tmrCalibragemVazao = new Timer() { Interval = 500 };
|
||||
|
||||
_CalibragemVazao = new CalibragemVazao()
|
||||
{
|
||||
Calibrando = true,
|
||||
IniciadoEm = DateTime.Now,
|
||||
MassaInicial = Variaveis.OperacaoEmAndamento.DispAtu.Dados.MassaReservatorio,
|
||||
PressoesAferidas = new List<double>()
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.DispAtu.Dados.PressaoLinha,
|
||||
}
|
||||
};
|
||||
tmrCalibragemVazao.Tick += tmrCalibragemVazao_Tick;
|
||||
tmrCalibragemVazao.Start();
|
||||
|
||||
AtuarBico(Variaveis.OperacaoEmAndamento.DispAtu.Dados.BicosPulverizadores.FirstOrDefault(x => x.Inicializado), true);
|
||||
}
|
||||
|
||||
private void tmrCalibragemVazao_Tick(object sender, EventArgs e)
|
||||
{
|
||||
_CalibragemVazao.QtdPulsos = Variaveis.OperacaoEmAndamento.DispAtu.Dados._LeituraPulsos;
|
||||
_CalibragemVazao.Periodo = Variaveis.OperacaoEmAndamento.DispAtu.Dados._LeituraPeriodo;
|
||||
_CalibragemVazao.PressoesAferidas.Add(Variaveis.OperacaoEmAndamento.DispAtu.Dados.PressaoLinha);
|
||||
_CalibragemVazao.MassaFinal = Variaveis.OperacaoEmAndamento.DispAtu.Dados.MassaReservatorio;
|
||||
|
||||
if (Variaveis.OperacaoEmAndamento.DispAtu.Dados._LeituraPeriodo >= _CalibragemVazao.TempoCalibragem || DateTime.Now >= _CalibragemVazao.IniciadoEm.AddMilliseconds(_CalibragemVazao.TempoCalibragem))
|
||||
{
|
||||
((Timer)sender).Stop();
|
||||
|
||||
AtuarBico(Variaveis.OperacaoEmAndamento.DispAtu.Dados.BicosPulverizadores.FirstOrDefault(x => x.Inicializado), false);
|
||||
AtuarBomba(false);
|
||||
|
||||
_CalibragemVazao.Periodo = _CalibragemVazao.Periodo / 1000.0;
|
||||
if (_CalibragemVazao.Periodo == 0)
|
||||
{
|
||||
_CalibragemVazao.Periodo = _CalibragemVazao.TempoCalibragem / 1000;
|
||||
}
|
||||
|
||||
btnCalibrarVazao.Text = "Calcular";
|
||||
btnCalibrarVazao.Enabled = true;
|
||||
txtVolumeLido.Enabled = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ namespace AgroBase.Forms.Operacoes
|
|||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea6 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||
System.Windows.Forms.DataVisualization.Charting.Legend legend6 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||
System.Windows.Forms.DataVisualization.Charting.Series series6 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||
System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||
this.pnlCameraSolo = new System.Windows.Forms.Panel();
|
||||
this.pnlCameraSoloD = new System.Windows.Forms.Panel();
|
||||
this.pnlCameraSoloE = new System.Windows.Forms.Panel();
|
||||
|
|
@ -59,6 +59,9 @@ namespace AgroBase.Forms.Operacoes
|
|||
this.lblPorcentagemReservatorio = new System.Windows.Forms.Label();
|
||||
this.pgbReservatorio = new System.Windows.Forms.ProgressBar();
|
||||
this.gpbOpcoes = new System.Windows.Forms.GroupBox();
|
||||
this.lblPSI = new System.Windows.Forms.Label();
|
||||
this.lblPressaoSP = new System.Windows.Forms.Label();
|
||||
this.nudPressaoSP = new System.Windows.Forms.NumericUpDown();
|
||||
this.btnCarregarMapa = new System.Windows.Forms.Button();
|
||||
this.btnIniciarOperacao = new System.Windows.Forms.Button();
|
||||
this.gpbInformacoesGerais = new System.Windows.Forms.GroupBox();
|
||||
|
|
@ -69,8 +72,6 @@ namespace AgroBase.Forms.Operacoes
|
|||
this.lblVelocidadeMedia = new System.Windows.Forms.Label();
|
||||
this.lblTempoOperacao = new System.Windows.Forms.Label();
|
||||
this.lblDistanciaPercorrida = new System.Windows.Forms.Label();
|
||||
this.lblDistanciaEsquerda = new System.Windows.Forms.Label();
|
||||
this.lblDistanciaDireita = new System.Windows.Forms.Label();
|
||||
this.pnlInferior = new System.Windows.Forms.Panel();
|
||||
this.lblDistancia = new System.Windows.Forms.Label();
|
||||
this.lblMapaCarregado = new System.Windows.Forms.Label();
|
||||
|
|
@ -85,23 +86,23 @@ namespace AgroBase.Forms.Operacoes
|
|||
this.pnlInclinacao = new System.Windows.Forms.Panel();
|
||||
this.pnlAnguloCamera = new System.Windows.Forms.Panel();
|
||||
this.lblPerformance = new System.Windows.Forms.Label();
|
||||
this.btnCalibrarVazao = new System.Windows.Forms.Button();
|
||||
this.nudPressaoSP = new System.Windows.Forms.NumericUpDown();
|
||||
this.lblPressaoSP = new System.Windows.Forms.Label();
|
||||
this.lblPSI = new System.Windows.Forms.Label();
|
||||
this.txtVolumeLido = new System.Windows.Forms.TextBox();
|
||||
this.lblML = new System.Windows.Forms.Label();
|
||||
this.lblVolumeLido = new System.Windows.Forms.Label();
|
||||
this.lblVazao = new System.Windows.Forms.Label();
|
||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||
this.tabGrafico = new System.Windows.Forms.TabPage();
|
||||
this.tabSonar = new System.Windows.Forms.TabPage();
|
||||
this.picSonar = new System.Windows.Forms.PictureBox();
|
||||
this.pnlCameraSolo.SuspendLayout();
|
||||
this.pnlAtuadores.SuspendLayout();
|
||||
this.pnlGraficos.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chartGraficos)).BeginInit();
|
||||
this.pnlNiveis.SuspendLayout();
|
||||
this.gpbOpcoes.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudPressaoSP)).BeginInit();
|
||||
this.gpbInformacoesGerais.SuspendLayout();
|
||||
this.pnlInferior.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudPressaoSP)).BeginInit();
|
||||
this.tabControl1.SuspendLayout();
|
||||
this.tabGrafico.SuspendLayout();
|
||||
this.tabSonar.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picSonar)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pnlCameraSolo
|
||||
|
|
@ -176,7 +177,7 @@ namespace AgroBase.Forms.Operacoes
|
|||
//
|
||||
// pnlGraficos
|
||||
//
|
||||
this.pnlGraficos.Controls.Add(this.chartGraficos);
|
||||
this.pnlGraficos.Controls.Add(this.tabControl1);
|
||||
this.pnlGraficos.Location = new System.Drawing.Point(808, 378);
|
||||
this.pnlGraficos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.pnlGraficos.Name = "pnlGraficos";
|
||||
|
|
@ -185,19 +186,19 @@ namespace AgroBase.Forms.Operacoes
|
|||
//
|
||||
// chartGraficos
|
||||
//
|
||||
chartArea6.Name = "ChartArea1";
|
||||
this.chartGraficos.ChartAreas.Add(chartArea6);
|
||||
chartArea1.Name = "ChartArea1";
|
||||
this.chartGraficos.ChartAreas.Add(chartArea1);
|
||||
this.chartGraficos.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
legend6.Name = "Legend1";
|
||||
this.chartGraficos.Legends.Add(legend6);
|
||||
this.chartGraficos.Location = new System.Drawing.Point(0, 0);
|
||||
legend1.Name = "Legend1";
|
||||
this.chartGraficos.Legends.Add(legend1);
|
||||
this.chartGraficos.Location = new System.Drawing.Point(3, 3);
|
||||
this.chartGraficos.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.chartGraficos.Name = "chartGraficos";
|
||||
series6.ChartArea = "ChartArea1";
|
||||
series6.Legend = "Legend1";
|
||||
series6.Name = "Series1";
|
||||
this.chartGraficos.Series.Add(series6);
|
||||
this.chartGraficos.Size = new System.Drawing.Size(540, 313);
|
||||
series1.ChartArea = "ChartArea1";
|
||||
series1.Legend = "Legend1";
|
||||
series1.Name = "Series1";
|
||||
this.chartGraficos.Series.Add(series1);
|
||||
this.chartGraficos.Size = new System.Drawing.Size(526, 278);
|
||||
this.chartGraficos.TabIndex = 0;
|
||||
this.chartGraficos.Text = "chart1";
|
||||
//
|
||||
|
|
@ -376,14 +377,9 @@ namespace AgroBase.Forms.Operacoes
|
|||
//
|
||||
// gpbOpcoes
|
||||
//
|
||||
this.gpbOpcoes.Controls.Add(this.lblVazao);
|
||||
this.gpbOpcoes.Controls.Add(this.lblVolumeLido);
|
||||
this.gpbOpcoes.Controls.Add(this.lblML);
|
||||
this.gpbOpcoes.Controls.Add(this.txtVolumeLido);
|
||||
this.gpbOpcoes.Controls.Add(this.lblPSI);
|
||||
this.gpbOpcoes.Controls.Add(this.lblPressaoSP);
|
||||
this.gpbOpcoes.Controls.Add(this.nudPressaoSP);
|
||||
this.gpbOpcoes.Controls.Add(this.btnCalibrarVazao);
|
||||
this.gpbOpcoes.Controls.Add(this.btnCarregarMapa);
|
||||
this.gpbOpcoes.Controls.Add(this.btnIniciarOperacao);
|
||||
this.gpbOpcoes.Font = new System.Drawing.Font("Mongolian Baiti", 9F, System.Drawing.FontStyle.Bold);
|
||||
|
|
@ -396,23 +392,54 @@ namespace AgroBase.Forms.Operacoes
|
|||
this.gpbOpcoes.TabStop = false;
|
||||
this.gpbOpcoes.Text = "Opções";
|
||||
//
|
||||
// lblPSI
|
||||
//
|
||||
this.lblPSI.AutoSize = true;
|
||||
this.lblPSI.Location = new System.Drawing.Point(218, 28);
|
||||
this.lblPSI.Name = "lblPSI";
|
||||
this.lblPSI.Size = new System.Drawing.Size(28, 16);
|
||||
this.lblPSI.TabIndex = 10;
|
||||
this.lblPSI.Text = "psi";
|
||||
//
|
||||
// lblPressaoSP
|
||||
//
|
||||
this.lblPressaoSP.AutoSize = true;
|
||||
this.lblPressaoSP.Location = new System.Drawing.Point(6, 28);
|
||||
this.lblPressaoSP.Name = "lblPressaoSP";
|
||||
this.lblPressaoSP.Size = new System.Drawing.Size(124, 16);
|
||||
this.lblPressaoSP.TabIndex = 9;
|
||||
this.lblPressaoSP.Text = "Pressão da linha";
|
||||
//
|
||||
// nudPressaoSP
|
||||
//
|
||||
this.nudPressaoSP.Location = new System.Drawing.Point(138, 23);
|
||||
this.nudPressaoSP.Maximum = new decimal(new int[] {
|
||||
200,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nudPressaoSP.Name = "nudPressaoSP";
|
||||
this.nudPressaoSP.Size = new System.Drawing.Size(74, 25);
|
||||
this.nudPressaoSP.TabIndex = 8;
|
||||
this.nudPressaoSP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// btnCarregarMapa
|
||||
//
|
||||
this.btnCarregarMapa.Location = new System.Drawing.Point(5, 114);
|
||||
this.btnCarregarMapa.Location = new System.Drawing.Point(29, 71);
|
||||
this.btnCarregarMapa.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.btnCarregarMapa.Name = "btnCarregarMapa";
|
||||
this.btnCarregarMapa.Size = new System.Drawing.Size(99, 26);
|
||||
this.btnCarregarMapa.Size = new System.Drawing.Size(206, 26);
|
||||
this.btnCarregarMapa.TabIndex = 5;
|
||||
this.btnCarregarMapa.Text = "Mapa";
|
||||
this.btnCarregarMapa.Text = "Selecionar Mapa";
|
||||
this.btnCarregarMapa.UseVisualStyleBackColor = true;
|
||||
this.btnCarregarMapa.Click += new System.EventHandler(this.btnCarregarMapa_Click);
|
||||
//
|
||||
// btnIniciarOperacao
|
||||
//
|
||||
this.btnIniciarOperacao.Location = new System.Drawing.Point(110, 114);
|
||||
this.btnIniciarOperacao.Location = new System.Drawing.Point(29, 107);
|
||||
this.btnIniciarOperacao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.btnIniciarOperacao.Name = "btnIniciarOperacao";
|
||||
this.btnIniciarOperacao.Size = new System.Drawing.Size(149, 26);
|
||||
this.btnIniciarOperacao.Size = new System.Drawing.Size(206, 26);
|
||||
this.btnIniciarOperacao.TabIndex = 6;
|
||||
this.btnIniciarOperacao.Text = "Iniciar Operação";
|
||||
this.btnIniciarOperacao.UseVisualStyleBackColor = true;
|
||||
|
|
@ -500,26 +527,6 @@ namespace AgroBase.Forms.Operacoes
|
|||
this.lblDistanciaPercorrida.TabIndex = 0;
|
||||
this.lblDistanciaPercorrida.Text = "Distancia Percorrida: 0,00 m";
|
||||
//
|
||||
// lblDistanciaEsquerda
|
||||
//
|
||||
this.lblDistanciaEsquerda.AutoSize = true;
|
||||
this.lblDistanciaEsquerda.Font = new System.Drawing.Font("Mongolian Baiti", 9.25F, System.Drawing.FontStyle.Bold);
|
||||
this.lblDistanciaEsquerda.Location = new System.Drawing.Point(811, 369);
|
||||
this.lblDistanciaEsquerda.Name = "lblDistanciaEsquerda";
|
||||
this.lblDistanciaEsquerda.Size = new System.Drawing.Size(246, 16);
|
||||
this.lblDistanciaEsquerda.TabIndex = 11;
|
||||
this.lblDistanciaEsquerda.Text = "Distancia da Esquerda: 00.00 cm";
|
||||
//
|
||||
// lblDistanciaDireita
|
||||
//
|
||||
this.lblDistanciaDireita.AutoSize = true;
|
||||
this.lblDistanciaDireita.Font = new System.Drawing.Font("Mongolian Baiti", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.lblDistanciaDireita.Location = new System.Drawing.Point(1112, 370);
|
||||
this.lblDistanciaDireita.Name = "lblDistanciaDireita";
|
||||
this.lblDistanciaDireita.Size = new System.Drawing.Size(227, 16);
|
||||
this.lblDistanciaDireita.TabIndex = 12;
|
||||
this.lblDistanciaDireita.Text = "Distancia da Direita: 00.00 cm";
|
||||
//
|
||||
// pnlInferior
|
||||
//
|
||||
this.pnlInferior.Controls.Add(this.lblDistancia);
|
||||
|
|
@ -674,83 +681,47 @@ namespace AgroBase.Forms.Operacoes
|
|||
this.lblPerformance.TabIndex = 16;
|
||||
this.lblPerformance.Text = "CPU: 0,0% GPU: 0,0% RAM: 0,0%";
|
||||
//
|
||||
// btnCalibrarVazao
|
||||
// tabControl1
|
||||
//
|
||||
this.btnCalibrarVazao.Location = new System.Drawing.Point(138, 84);
|
||||
this.btnCalibrarVazao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.btnCalibrarVazao.Name = "btnCalibrarVazao";
|
||||
this.btnCalibrarVazao.Size = new System.Drawing.Size(120, 26);
|
||||
this.btnCalibrarVazao.TabIndex = 7;
|
||||
this.btnCalibrarVazao.Text = "Calibrar vazão";
|
||||
this.btnCalibrarVazao.UseVisualStyleBackColor = true;
|
||||
this.btnCalibrarVazao.Click += new System.EventHandler(this.btnCalibrarVazao_Click);
|
||||
this.tabControl1.Controls.Add(this.tabGrafico);
|
||||
this.tabControl1.Controls.Add(this.tabSonar);
|
||||
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tabControl1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tabControl1.Name = "tabControl1";
|
||||
this.tabControl1.SelectedIndex = 0;
|
||||
this.tabControl1.Size = new System.Drawing.Size(540, 313);
|
||||
this.tabControl1.TabIndex = 0;
|
||||
//
|
||||
// nudPressaoSP
|
||||
// tabGrafico
|
||||
//
|
||||
this.nudPressaoSP.Location = new System.Drawing.Point(138, 23);
|
||||
this.nudPressaoSP.Maximum = new decimal(new int[] {
|
||||
200,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nudPressaoSP.Name = "nudPressaoSP";
|
||||
this.nudPressaoSP.Size = new System.Drawing.Size(74, 25);
|
||||
this.nudPressaoSP.TabIndex = 8;
|
||||
this.nudPressaoSP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.tabGrafico.Controls.Add(this.chartGraficos);
|
||||
this.tabGrafico.Location = new System.Drawing.Point(4, 25);
|
||||
this.tabGrafico.Name = "tabGrafico";
|
||||
this.tabGrafico.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabGrafico.Size = new System.Drawing.Size(532, 284);
|
||||
this.tabGrafico.TabIndex = 0;
|
||||
this.tabGrafico.Text = "Desempenho";
|
||||
this.tabGrafico.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// lblPressaoSP
|
||||
// tabSonar
|
||||
//
|
||||
this.lblPressaoSP.AutoSize = true;
|
||||
this.lblPressaoSP.Location = new System.Drawing.Point(6, 28);
|
||||
this.lblPressaoSP.Name = "lblPressaoSP";
|
||||
this.lblPressaoSP.Size = new System.Drawing.Size(124, 16);
|
||||
this.lblPressaoSP.TabIndex = 9;
|
||||
this.lblPressaoSP.Text = "Pressão da linha";
|
||||
this.tabSonar.Controls.Add(this.picSonar);
|
||||
this.tabSonar.Location = new System.Drawing.Point(4, 25);
|
||||
this.tabSonar.Name = "tabSonar";
|
||||
this.tabSonar.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabSonar.Size = new System.Drawing.Size(532, 284);
|
||||
this.tabSonar.TabIndex = 1;
|
||||
this.tabSonar.Text = "Sonar";
|
||||
this.tabSonar.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// lblPSI
|
||||
// picSonar
|
||||
//
|
||||
this.lblPSI.AutoSize = true;
|
||||
this.lblPSI.Location = new System.Drawing.Point(218, 28);
|
||||
this.lblPSI.Name = "lblPSI";
|
||||
this.lblPSI.Size = new System.Drawing.Size(28, 16);
|
||||
this.lblPSI.TabIndex = 10;
|
||||
this.lblPSI.Text = "psi";
|
||||
//
|
||||
// txtVolumeLido
|
||||
//
|
||||
this.txtVolumeLido.Enabled = false;
|
||||
this.txtVolumeLido.Location = new System.Drawing.Point(138, 54);
|
||||
this.txtVolumeLido.Name = "txtVolumeLido";
|
||||
this.txtVolumeLido.Size = new System.Drawing.Size(74, 25);
|
||||
this.txtVolumeLido.TabIndex = 11;
|
||||
this.txtVolumeLido.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// lblML
|
||||
//
|
||||
this.lblML.AutoSize = true;
|
||||
this.lblML.Location = new System.Drawing.Point(218, 59);
|
||||
this.lblML.Name = "lblML";
|
||||
this.lblML.Size = new System.Drawing.Size(30, 16);
|
||||
this.lblML.TabIndex = 12;
|
||||
this.lblML.Text = "mL";
|
||||
//
|
||||
// lblVolumeLido
|
||||
//
|
||||
this.lblVolumeLido.AutoSize = true;
|
||||
this.lblVolumeLido.Location = new System.Drawing.Point(6, 59);
|
||||
this.lblVolumeLido.Name = "lblVolumeLido";
|
||||
this.lblVolumeLido.Size = new System.Drawing.Size(96, 16);
|
||||
this.lblVolumeLido.TabIndex = 13;
|
||||
this.lblVolumeLido.Text = "Volume lido";
|
||||
//
|
||||
// lblVazao
|
||||
//
|
||||
this.lblVazao.AutoSize = true;
|
||||
this.lblVazao.Location = new System.Drawing.Point(6, 91);
|
||||
this.lblVazao.Name = "lblVazao";
|
||||
this.lblVazao.Size = new System.Drawing.Size(120, 16);
|
||||
this.lblVazao.TabIndex = 14;
|
||||
this.lblVazao.Text = "Vazão: 10 mL/s";
|
||||
this.picSonar.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.picSonar.Location = new System.Drawing.Point(3, 3);
|
||||
this.picSonar.Name = "picSonar";
|
||||
this.picSonar.Size = new System.Drawing.Size(526, 278);
|
||||
this.picSonar.TabIndex = 1;
|
||||
this.picSonar.TabStop = false;
|
||||
//
|
||||
// frmOperacaoMapaGPS
|
||||
//
|
||||
|
|
@ -761,10 +732,8 @@ namespace AgroBase.Forms.Operacoes
|
|||
this.Controls.Add(this.lblPerformance);
|
||||
this.Controls.Add(this.pnlAnguloCamera);
|
||||
this.Controls.Add(this.pnlOrientacao);
|
||||
this.Controls.Add(this.lblDistanciaEsquerda);
|
||||
this.Controls.Add(this.pnlMapa);
|
||||
this.Controls.Add(this.pnlInferior);
|
||||
this.Controls.Add(this.lblDistanciaDireita);
|
||||
this.Controls.Add(this.pnlInclinacao);
|
||||
this.Controls.Add(this.gpbInformacoesGerais);
|
||||
this.Controls.Add(this.gpbOpcoes);
|
||||
|
|
@ -789,11 +758,15 @@ namespace AgroBase.Forms.Operacoes
|
|||
this.pnlNiveis.PerformLayout();
|
||||
this.gpbOpcoes.ResumeLayout(false);
|
||||
this.gpbOpcoes.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudPressaoSP)).EndInit();
|
||||
this.gpbInformacoesGerais.ResumeLayout(false);
|
||||
this.gpbInformacoesGerais.PerformLayout();
|
||||
this.pnlInferior.ResumeLayout(false);
|
||||
this.pnlInferior.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudPressaoSP)).EndInit();
|
||||
this.tabControl1.ResumeLayout(false);
|
||||
this.tabGrafico.ResumeLayout(false);
|
||||
this.tabSonar.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.picSonar)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
|
|
@ -826,8 +799,6 @@ namespace AgroBase.Forms.Operacoes
|
|||
private System.Windows.Forms.Label lblTempoOperacao;
|
||||
private System.Windows.Forms.Label lblDistanciaPercorrida;
|
||||
private System.Windows.Forms.Panel pnlInclinacao;
|
||||
private System.Windows.Forms.Label lblDistanciaEsquerda;
|
||||
private System.Windows.Forms.Label lblDistanciaDireita;
|
||||
private System.Windows.Forms.Panel pnlInferior;
|
||||
private System.Windows.Forms.Label lblUltimaLeituraRua;
|
||||
private System.Windows.Forms.Label lblUltimaLeituraSolo;
|
||||
|
|
@ -854,13 +825,12 @@ namespace AgroBase.Forms.Operacoes
|
|||
private System.Windows.Forms.Label lblProgressoRua;
|
||||
private System.Windows.Forms.Panel pnlAnguloCamera;
|
||||
private System.Windows.Forms.Label lblPerformance;
|
||||
private System.Windows.Forms.Label lblML;
|
||||
private System.Windows.Forms.TextBox txtVolumeLido;
|
||||
private System.Windows.Forms.Label lblPSI;
|
||||
private System.Windows.Forms.Label lblPressaoSP;
|
||||
private System.Windows.Forms.NumericUpDown nudPressaoSP;
|
||||
private System.Windows.Forms.Button btnCalibrarVazao;
|
||||
private System.Windows.Forms.Label lblVolumeLido;
|
||||
private System.Windows.Forms.Label lblVazao;
|
||||
private System.Windows.Forms.TabControl tabControl1;
|
||||
private System.Windows.Forms.TabPage tabGrafico;
|
||||
private System.Windows.Forms.TabPage tabSonar;
|
||||
private System.Windows.Forms.PictureBox picSonar;
|
||||
}
|
||||
}
|
||||
|
|
@ -53,13 +53,13 @@ namespace AgroBase.Forms.Operacoes
|
|||
}
|
||||
});
|
||||
|
||||
nudVelocidadeComErvas.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.RPM_Min);
|
||||
nudVelocidadeSemErvas.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.RPM_Max);
|
||||
lblKmhCErvas.Text = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.Controle.RPM_Min).ToString("0.00") + " Km/h";
|
||||
lblKmhSErvas.Text = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.Controle.RPM_Max).ToString("0.00") + " Km/h";
|
||||
nudAnguloMaximo.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.Angulo_Max);
|
||||
nudAnguloMinimo.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.Angulo_Min);
|
||||
nudVelocidadeMP.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.Controle.VelocidadeMP);
|
||||
nudVelocidadeComErvas.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.RPM_Min);
|
||||
nudVelocidadeSemErvas.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.RPM_Max);
|
||||
lblKmhCErvas.Text = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.RPM_Min).ToString("0.00") + " Km/h";
|
||||
lblKmhSErvas.Text = MovimentacaoModel.CalculaVelocidadeRPM(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.RPM_Max).ToString("0.00") + " Km/h";
|
||||
nudAnguloMaximo.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.Angulo_Max);
|
||||
nudAnguloMinimo.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.Angulo_Min);
|
||||
nudVelocidadeMP.Value = Convert.ToInt32(Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.VelocidadeMP);
|
||||
nudTemposalvarlog.Value = Variaveis.OperacaoEmAndamento.tmrLogs.Interval / 1000;
|
||||
nudQtdBicos.Value = Variaveis.OperacaoEmAndamento.DispAtu.Dados.QuantidadeBicos;
|
||||
nudQtdCameras.Value = Variaveis.OperacaoEmAndamento.QuantidadeCamerasSolo;
|
||||
|
|
@ -122,11 +122,11 @@ namespace AgroBase.Forms.Operacoes
|
|||
void SalvarOperacao()
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.ModulosMandatorios = ModulosMandatorios.Where(x => x.Utilizar).ToList();
|
||||
Variaveis.OperacaoEmAndamento.Controle.RPM_Max = (int)(nudVelocidadeSemErvas.Value);
|
||||
Variaveis.OperacaoEmAndamento.Controle.RPM_Min = (int)(nudVelocidadeComErvas.Value);
|
||||
Variaveis.OperacaoEmAndamento.Controle.Angulo_Max = (int)(nudAnguloMaximo.Value);
|
||||
Variaveis.OperacaoEmAndamento.Controle.Angulo_Min = (int)(nudAnguloMinimo.Value);
|
||||
Variaveis.OperacaoEmAndamento.Controle.VelocidadeMP = (int)(nudVelocidadeMP.Value);
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.RPM_Max = (int)(nudVelocidadeSemErvas.Value);
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.RPM_Min = (int)(nudVelocidadeComErvas.Value);
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.Angulo_Max = (int)(nudAnguloMaximo.Value);
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.Angulo_Min = (int)(nudAnguloMinimo.Value);
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.Controle.VelocidadeMP = (int)(nudVelocidadeMP.Value);
|
||||
Variaveis.OperacaoEmAndamento.tmrLogs.Interval = (int)(nudTemposalvarlog.Value * 1000);
|
||||
Variaveis.OperacaoEmAndamento.DispAtu.Dados.QuantidadeBicos = (int)nudQtdBicos.Value;
|
||||
Variaveis.OperacaoEmAndamento.QuantidadeCamerasSolo = (int)nudQtdCameras.Value;
|
||||
|
|
|
|||
|
|
@ -50,12 +50,13 @@
|
|||
this.btnBateriaDefinir = new System.Windows.Forms.Button();
|
||||
this.gpbBateria = new System.Windows.Forms.GroupBox();
|
||||
this.gpbCameras = new System.Windows.Forms.GroupBox();
|
||||
this.lblCaminho = new System.Windows.Forms.Label();
|
||||
this.cmbCaminho = new System.Windows.Forms.ComboBox();
|
||||
this.lblSoloesq = new System.Windows.Forms.Label();
|
||||
this.cmbSoloEsq = new System.Windows.Forms.ComboBox();
|
||||
this.lblSolodir = new System.Windows.Forms.Label();
|
||||
this.cmbSoloDir = new System.Windows.Forms.ComboBox();
|
||||
this.lblSoloesq = new System.Windows.Forms.Label();
|
||||
this.cmbSoloEsq = new System.Windows.Forms.ComboBox();
|
||||
this.lblCaminho = new System.Windows.Forms.Label();
|
||||
this.cmbCaminho = new System.Windows.Forms.ComboBox();
|
||||
this.btnBateriaCalibrar = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridsTEN)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridsCOR)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridsTMP)).BeginInit();
|
||||
|
|
@ -269,6 +270,7 @@
|
|||
//
|
||||
// gpbBateria
|
||||
//
|
||||
this.gpbBateria.Controls.Add(this.btnBateriaCalibrar);
|
||||
this.gpbBateria.Controls.Add(this.label2);
|
||||
this.gpbBateria.Controls.Add(this.btnBateriaDefinir);
|
||||
this.gpbBateria.Controls.Add(this.cmbBateriaParametro);
|
||||
|
|
@ -296,6 +298,44 @@
|
|||
this.gpbCameras.TabStop = false;
|
||||
this.gpbCameras.Text = "Câmeras";
|
||||
//
|
||||
// lblSolodir
|
||||
//
|
||||
this.lblSolodir.AutoSize = true;
|
||||
this.lblSolodir.Location = new System.Drawing.Point(7, 105);
|
||||
this.lblSolodir.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.lblSolodir.Name = "lblSolodir";
|
||||
this.lblSolodir.Size = new System.Drawing.Size(58, 16);
|
||||
this.lblSolodir.TabIndex = 25;
|
||||
this.lblSolodir.Text = "Solo Dir.";
|
||||
//
|
||||
// cmbSoloDir
|
||||
//
|
||||
this.cmbSoloDir.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbSoloDir.FormattingEnabled = true;
|
||||
this.cmbSoloDir.Location = new System.Drawing.Point(74, 97);
|
||||
this.cmbSoloDir.Name = "cmbSoloDir";
|
||||
this.cmbSoloDir.Size = new System.Drawing.Size(181, 24);
|
||||
this.cmbSoloDir.TabIndex = 24;
|
||||
//
|
||||
// lblSoloesq
|
||||
//
|
||||
this.lblSoloesq.AutoSize = true;
|
||||
this.lblSoloesq.Location = new System.Drawing.Point(7, 75);
|
||||
this.lblSoloesq.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.lblSoloesq.Name = "lblSoloesq";
|
||||
this.lblSoloesq.Size = new System.Drawing.Size(65, 16);
|
||||
this.lblSoloesq.TabIndex = 23;
|
||||
this.lblSoloesq.Text = "Solo Esq.";
|
||||
//
|
||||
// cmbSoloEsq
|
||||
//
|
||||
this.cmbSoloEsq.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbSoloEsq.FormattingEnabled = true;
|
||||
this.cmbSoloEsq.Location = new System.Drawing.Point(74, 67);
|
||||
this.cmbSoloEsq.Name = "cmbSoloEsq";
|
||||
this.cmbSoloEsq.Size = new System.Drawing.Size(181, 24);
|
||||
this.cmbSoloEsq.TabIndex = 22;
|
||||
//
|
||||
// lblCaminho
|
||||
//
|
||||
this.lblCaminho.AutoSize = true;
|
||||
|
|
@ -315,43 +355,15 @@
|
|||
this.cmbCaminho.Size = new System.Drawing.Size(181, 24);
|
||||
this.cmbCaminho.TabIndex = 20;
|
||||
//
|
||||
// lblSoloesq
|
||||
// btnBateriaCalibrar
|
||||
//
|
||||
this.lblSoloesq.AutoSize = true;
|
||||
this.lblSoloesq.Location = new System.Drawing.Point(7, 75);
|
||||
this.lblSoloesq.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.lblSoloesq.Name = "lblSoloesq";
|
||||
this.lblSoloesq.Size = new System.Drawing.Size(65, 16);
|
||||
this.lblSoloesq.TabIndex = 23;
|
||||
this.lblSoloesq.Text = "Solo Esq.";
|
||||
//
|
||||
// cmbSolodEsq
|
||||
//
|
||||
this.cmbSoloEsq.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbSoloEsq.FormattingEnabled = true;
|
||||
this.cmbSoloEsq.Location = new System.Drawing.Point(74, 67);
|
||||
this.cmbSoloEsq.Name = "cmbSolodEsq";
|
||||
this.cmbSoloEsq.Size = new System.Drawing.Size(181, 24);
|
||||
this.cmbSoloEsq.TabIndex = 22;
|
||||
//
|
||||
// lblSolodir
|
||||
//
|
||||
this.lblSolodir.AutoSize = true;
|
||||
this.lblSolodir.Location = new System.Drawing.Point(7, 105);
|
||||
this.lblSolodir.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.lblSolodir.Name = "lblSolodir";
|
||||
this.lblSolodir.Size = new System.Drawing.Size(58, 16);
|
||||
this.lblSolodir.TabIndex = 25;
|
||||
this.lblSolodir.Text = "Solo Dir.";
|
||||
//
|
||||
// cmbSoloDir
|
||||
//
|
||||
this.cmbSoloDir.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbSoloDir.FormattingEnabled = true;
|
||||
this.cmbSoloDir.Location = new System.Drawing.Point(74, 97);
|
||||
this.cmbSoloDir.Name = "cmbSoloDir";
|
||||
this.cmbSoloDir.Size = new System.Drawing.Size(181, 24);
|
||||
this.cmbSoloDir.TabIndex = 24;
|
||||
this.btnBateriaCalibrar.Location = new System.Drawing.Point(10, 122);
|
||||
this.btnBateriaCalibrar.Name = "btnBateriaCalibrar";
|
||||
this.btnBateriaCalibrar.Size = new System.Drawing.Size(180, 23);
|
||||
this.btnBateriaCalibrar.TabIndex = 22;
|
||||
this.btnBateriaCalibrar.Text = "Calibrar";
|
||||
this.btnBateriaCalibrar.UseVisualStyleBackColor = true;
|
||||
this.btnBateriaCalibrar.Click += new System.EventHandler(this.btnBateriaCalibrar_Click);
|
||||
//
|
||||
// frmSenConfig
|
||||
//
|
||||
|
|
@ -427,5 +439,6 @@
|
|||
private System.Windows.Forms.ComboBox cmbSoloEsq;
|
||||
private System.Windows.Forms.Label lblCaminho;
|
||||
private System.Windows.Forms.ComboBox cmbCaminho;
|
||||
private System.Windows.Forms.Button btnBateriaCalibrar;
|
||||
}
|
||||
}
|
||||
|
|
@ -43,6 +43,43 @@ namespace AgroBase.Forms.Sensoriamento
|
|||
case T_Code.Sen:
|
||||
{
|
||||
Sensores = ((SensoriamentoModel)Disp.Dados).Sensores.ToList();
|
||||
|
||||
Cameras = CameraService.AtualizaListaCameras();
|
||||
cmbCaminho.Items.Clear();
|
||||
cmbCaminho.Items.AddRange(Cameras.Values.ToArray());
|
||||
string IDrua = ((SensoriamentoModel)Disp.Dados).CameraID_Caminho;
|
||||
if (Cameras.Any(x => x.Value == IDrua))
|
||||
{
|
||||
cmbCaminho.SelectedIndex = cmbCaminho.Items.IndexOf(IDrua);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmbCaminho.Text = IDrua;
|
||||
}
|
||||
|
||||
cmbSoloEsq.Items.Clear();
|
||||
cmbSoloEsq.Items.AddRange(Cameras.Values.ToArray());
|
||||
string IDsoloE = ((SensoriamentoModel)Disp.Dados).CameraID_SoloE;
|
||||
if (Cameras.Any(x => x.Value == IDsoloE))
|
||||
{
|
||||
cmbSoloEsq.SelectedIndex = cmbSoloEsq.Items.IndexOf(IDsoloE);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmbSoloEsq.Text = IDsoloE;
|
||||
}
|
||||
|
||||
cmbSoloDir.Items.Clear();
|
||||
cmbSoloDir.Items.AddRange(Cameras.Values.ToArray());
|
||||
string IDsoloD = ((SensoriamentoModel)Disp.Dados).CameraID_SoloD;
|
||||
if (Cameras.Any(x => x.Value == IDsoloD))
|
||||
{
|
||||
cmbSoloDir.SelectedIndex = cmbSoloDir.Items.IndexOf(IDsoloD);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmbSoloDir.Text = IDsoloD;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case T_Code.Atu:
|
||||
|
|
@ -59,22 +96,6 @@ namespace AgroBase.Forms.Sensoriamento
|
|||
cmbBateriaParametro.Items.Clear();
|
||||
cmbBateriaParametro.Items.AddRange(PZEMService.Parametros.Keys.ToArray());
|
||||
cmbBateriaParametro.SelectedIndex = 0;
|
||||
|
||||
if (Disp != null && Disp.Dispositivo == T_Code.Sen)
|
||||
{
|
||||
Cameras = CameraService.AtualizaListaCameras();
|
||||
cmbCaminho.Items.Clear();
|
||||
cmbCaminho.Items.AddRange(Cameras.Values.ToArray());
|
||||
cmbCaminho.SelectedIndex = cmbCaminho.Items.IndexOf(((SensoriamentoModel)Disp.Dados).CameraID_Caminho);
|
||||
|
||||
cmbSoloEsq.Items.Clear();
|
||||
cmbSoloEsq.Items.AddRange(Cameras.Values.ToArray());
|
||||
cmbSoloEsq.SelectedIndex = cmbCaminho.Items.IndexOf(((SensoriamentoModel)Disp.Dados).CameraID_SoloE);
|
||||
|
||||
cmbSoloDir.Items.Clear();
|
||||
cmbSoloDir.Items.AddRange(Cameras.Values.ToArray());
|
||||
cmbSoloDir.SelectedIndex = cmbCaminho.Items.IndexOf(((SensoriamentoModel)Disp.Dados).CameraID_SoloD);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -192,5 +213,12 @@ namespace AgroBase.Forms.Sensoriamento
|
|||
var Comando = PZEMService.ComandoSetParametro(PZEMService.Parametros[cmbBateriaParametro.Text], Convert.ToInt32(nudBateriaValor.Value));
|
||||
PZEMService.EnviarComando(PZEMService.PortaPZEM, Comando);
|
||||
}
|
||||
|
||||
private void btnBateriaCalibrar_Click(object sender, EventArgs e)
|
||||
{
|
||||
var Comando = PZEMService.ComandoCalibragem();
|
||||
PZEMService.EnviarComando(PZEMService.PortaPZEM, Comando);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,64 @@
|
|||
namespace AgroBase.Forms.Sensoriamento
|
||||
{
|
||||
partial class frmSonar
|
||||
{
|
||||
/// <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.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.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.pictureBox1.Location = new System.Drawing.Point(12, 12);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(959, 600);
|
||||
this.pictureBox1.TabIndex = 0;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// frmSonar
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(983, 624);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Name = "frmSonar";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Sonar";
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
using AgroBase.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO.Ports;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AgroBase.Forms.Sensoriamento
|
||||
{
|
||||
public partial class frmSonar : Form
|
||||
{
|
||||
SonarModel sonar;
|
||||
|
||||
public frmSonar()
|
||||
{
|
||||
InitializeComponent();
|
||||
sonar = new SonarModel(pictureBox1);
|
||||
|
||||
// Habilita o double buffering
|
||||
this.SetStyle(ControlStyles.DoubleBuffer |
|
||||
ControlStyles.UserPaint |
|
||||
ControlStyles.AllPaintingInWmPaint,
|
||||
true);
|
||||
this.UpdateStyles();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -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>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -140,55 +140,65 @@ namespace AgroBase.Forms
|
|||
double Minimo = 0;
|
||||
double Maximo = 0;
|
||||
|
||||
Chart chart = (Chart)(pnlFundo.Controls.Find("chart" + Motor.ID, false).First());
|
||||
chart.Titles.Clear();
|
||||
chart.Titles.Add(Motor.Descricao);
|
||||
var Logs = (Motor.LogGrafico.Count > MovimentacaoModel.LogsManter ? Motor.LogGrafico.Skip(Math.Max(0, Motor.LogGrafico.Count - MovimentacaoModel.LogsManter)).Take(MovimentacaoModel.LogsManter).ToList() : Motor.LogGrafico).Where(log => log.ComponenteID == Motor.ID).ToList();
|
||||
chart.Series.Clear();
|
||||
List<string> Momentos = Logs.Select(x => x.Momento.ToString("mm:ss:fff")).ToList();
|
||||
|
||||
var serieRPMsp = new Series("RPM SP: " + (Log != null ? Log.RPM_SP : 0));
|
||||
serieRPMsp.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM_SP).ToList());
|
||||
serieRPMsp.ChartType = SeriesChartType.Line;
|
||||
chart.Series.Add(serieRPMsp);
|
||||
Minimo = Logs.Min(x => x.RPM_SP) < Minimo ? Logs.Min(x => x.RPM_SP) : Minimo;
|
||||
Maximo = Logs.Min(x => x.RPM_SP) > Maximo ? Logs.Min(x => x.RPM_SP) : Maximo;
|
||||
|
||||
var serieRPM = new Series("RPM: " + (Log != null ? Log.RPM : 0));
|
||||
serieRPM.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM).ToList());
|
||||
serieRPM.ChartType = SeriesChartType.Spline;
|
||||
chart.Series.Add(serieRPM);
|
||||
Minimo = Logs.Min(x => x.RPM) < Minimo ? Logs.Min(x => x.RPM) : Minimo;
|
||||
Maximo = Logs.Max(x => x.RPM) > Maximo ? Logs.Max(x => x.RPM) : Maximo;
|
||||
|
||||
var serieRPMOffset = new Series("RPM Offset: " + (Log != null ? Log.RPM_Offset : 0));
|
||||
serieRPMOffset.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM_Offset).ToList());
|
||||
serieRPMOffset.ChartType = SeriesChartType.Spline;
|
||||
chart.Series.Add(serieRPMOffset);
|
||||
Minimo = Logs.Min(x => x.RPM_Offset) < Minimo ? Logs.Min(x => x.RPM_Offset) : Minimo;
|
||||
Maximo = Logs.Max(x => x.RPM_Offset) > Maximo ? Logs.Max(x => x.RPM_Offset) : Maximo;
|
||||
|
||||
var seriePotencia = new Series("Potencia: " + (Log != null ? Log.Potencia : 0));
|
||||
seriePotencia.Points.DataBindXY(Momentos, Logs.Select(x => x.Potencia).ToList());
|
||||
seriePotencia.ChartType = SeriesChartType.Line;
|
||||
chart.Series.Add(seriePotencia);
|
||||
Minimo = Logs.Min(x => x.Potencia) < Minimo ? Logs.Min(x => x.Potencia) : Minimo;
|
||||
Maximo = Logs.Max(x => x.Potencia) > Maximo ? Logs.Max(x => x.Potencia) : Maximo;
|
||||
|
||||
var serieTemperatura = new Series("Temperatura: " + (Log != null ? Log.Temperatura : 0));
|
||||
serieTemperatura.Points.DataBindXY(Momentos, Logs.Select(x => x.Temperatura).ToList());
|
||||
serieTemperatura.ChartType = SeriesChartType.Line;
|
||||
chart.Series.Add(serieTemperatura);
|
||||
Minimo = Logs.Min(x => x.Temperatura) < Minimo ? Logs.Min(x => x.Temperatura) : Minimo;
|
||||
Maximo = Logs.Max(x => x.Temperatura) > Maximo ? Logs.Max(x => x.Temperatura) : Maximo;
|
||||
|
||||
foreach (var legend in chart.Legends)
|
||||
try
|
||||
{
|
||||
legend.Docking = Docking.Bottom;
|
||||
Chart chart = (Chart)(pnlFundo.Controls.Find("chart" + Motor.ID, false).First());
|
||||
chart.Titles.Clear();
|
||||
chart.Titles.Add(Motor.Descricao);
|
||||
var Logs = (Motor.LogGrafico.Count > MovimentacaoModel.LogsManter ? Motor.LogGrafico.Skip(Math.Max(0, Motor.LogGrafico.Count - MovimentacaoModel.LogsManter)).Take(MovimentacaoModel.LogsManter).ToList() : Motor.LogGrafico).Where(log => log.ComponenteID == Motor.ID).ToList();
|
||||
chart.Series.Clear();
|
||||
List<string> Momentos = Logs.Select(x => x.Momento.ToString("mm:ss:fff")).ToList();
|
||||
|
||||
var serieRPMsp = new Series("RPM SP: " + (Log != null ? Log.RPM_SP : 0));
|
||||
serieRPMsp.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM_SP).ToList());
|
||||
serieRPMsp.ChartType = SeriesChartType.Line;
|
||||
chart.Series.Add(serieRPMsp);
|
||||
Minimo = Logs.Min(x => x.RPM_SP) < Minimo ? Logs.Min(x => x.RPM_SP) : Minimo;
|
||||
Maximo = Logs.Min(x => x.RPM_SP) > Maximo ? Logs.Min(x => x.RPM_SP) : Maximo;
|
||||
|
||||
var serieRPM = new Series("RPM: " + (Log != null ? Log.RPM : 0));
|
||||
serieRPM.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM).ToList());
|
||||
serieRPM.ChartType = SeriesChartType.Spline;
|
||||
chart.Series.Add(serieRPM);
|
||||
Minimo = Logs.Min(x => x.RPM) < Minimo ? Logs.Min(x => x.RPM) : Minimo;
|
||||
Maximo = Logs.Max(x => x.RPM) > Maximo ? Logs.Max(x => x.RPM) : Maximo;
|
||||
|
||||
var serieRPMOffset = new Series("RPM Offset: " + (Log != null ? Log.RPM_Offset : 0));
|
||||
serieRPMOffset.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM_Offset).ToList());
|
||||
serieRPMOffset.ChartType = SeriesChartType.Spline;
|
||||
chart.Series.Add(serieRPMOffset);
|
||||
Minimo = Logs.Min(x => x.RPM_Offset) < Minimo ? Logs.Min(x => x.RPM_Offset) : Minimo;
|
||||
Maximo = Logs.Max(x => x.RPM_Offset) > Maximo ? Logs.Max(x => x.RPM_Offset) : Maximo;
|
||||
|
||||
var seriePotencia = new Series("Potencia: " + (Log != null ? Log.Potencia : 0));
|
||||
seriePotencia.Points.DataBindXY(Momentos, Logs.Select(x => x.Potencia).ToList());
|
||||
seriePotencia.ChartType = SeriesChartType.Line;
|
||||
chart.Series.Add(seriePotencia);
|
||||
Minimo = Logs.Min(x => x.Potencia) < Minimo ? Logs.Min(x => x.Potencia) : Minimo;
|
||||
Maximo = Logs.Max(x => x.Potencia) > Maximo ? Logs.Max(x => x.Potencia) : Maximo;
|
||||
|
||||
var serieTemperatura = new Series("Temperatura: " + (Log != null ? Log.Temperatura : 0));
|
||||
serieTemperatura.Points.DataBindXY(Momentos, Logs.Select(x => x.Temperatura).ToList());
|
||||
serieTemperatura.ChartType = SeriesChartType.Line;
|
||||
chart.Series.Add(serieTemperatura);
|
||||
Minimo = Logs.Min(x => x.Temperatura) < Minimo ? Logs.Min(x => x.Temperatura) : Minimo;
|
||||
Maximo = Logs.Max(x => x.Temperatura) > Maximo ? Logs.Max(x => x.Temperatura) : Maximo;
|
||||
|
||||
foreach (var legend in chart.Legends)
|
||||
{
|
||||
legend.Docking = Docking.Bottom;
|
||||
}
|
||||
|
||||
chart.ChartAreas[0].AxisY.Minimum = Minimo - 5;
|
||||
chart.ChartAreas[0].AxisY.Maximum = Maximo + 5;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
chart.ChartAreas[0].AxisY.Minimum = Minimo - 5;
|
||||
chart.ChartAreas[0].AxisY.Maximum = Maximo + 5;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -410,9 +420,12 @@ namespace AgroBase.Forms
|
|||
public void AtualizarSensores(string Texto)
|
||||
{
|
||||
Label lbl =
|
||||
Texto.Contains("Corrente") ? lblCorrente :
|
||||
Texto.Contains("Tensão") ? lblTensao:
|
||||
Texto.Contains("Bateria") ? lblTensao:
|
||||
Texto.Contains("Temp") ? lblTemperatura:
|
||||
Texto.Contains("3V") ? lblB3V :
|
||||
Texto.Contains("5V") ? lblB5V :
|
||||
Texto.Contains("7V2") ? lblB7V2 :
|
||||
Texto.Contains("12V") ? lblB12V :
|
||||
new Label();
|
||||
if (lbl.InvokeRequired)
|
||||
{
|
||||
|
|
@ -423,6 +436,5 @@ namespace AgroBase.Forms
|
|||
lbl.Text = Texto;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -10,6 +10,7 @@ namespace AgroBase.Forms
|
|||
public partial class frmGPS : Form
|
||||
{
|
||||
private MapasModel Mapa;
|
||||
private Timer tmrLeitura;
|
||||
|
||||
public frmGPS()
|
||||
{
|
||||
|
|
@ -24,6 +25,20 @@ namespace AgroBase.Forms
|
|||
private void frmGPS_Load(object sender, EventArgs e)
|
||||
{
|
||||
IniciarMapa();
|
||||
tmrLeitura = new Timer() { Interval = 1000 };
|
||||
tmrLeitura.Tick += tmrLeitura_Tick;
|
||||
tmrLeitura.Start();
|
||||
}
|
||||
|
||||
private void tmrLeitura_Tick(object sender, EventArgs e)
|
||||
{
|
||||
lblAltitude.Text = "Altitude: " + GPSService.UltimaLeitura.Altitude.ToString("0.0");
|
||||
lblDatahora.Text = "Ultima Leitura: " + GPSService.UltimaLeitura.DataHora.ToString("HH:mm:ss");
|
||||
lblLatitude.Text = "Latitude: " + GPSService.UltimaLeitura.Latitude.ToString();
|
||||
lblLongitude.Text = "Longitude: " + GPSService.UltimaLeitura.Longitude.ToString();
|
||||
lblPrecisao.Text = "Precisão: " + GPSService.UltimaLeitura.PrecisaoHorizontal.ToString();
|
||||
lblSatelites.Text = "Satélites: " + GPSService.UltimaLeitura.NumeroSatelites.ToString();
|
||||
lblVelocidade.Text = "Velocidade: " + GPSService.UltimaLeitura.Velocidade.ToString("0.00") + " km/h";
|
||||
}
|
||||
|
||||
private void frmGPS_FormClosing(object sender, FormClosingEventArgs e)
|
||||
|
|
|
|||
|
|
@ -74,9 +74,34 @@
|
|||
this.cmb3 = new System.Windows.Forms.ComboBox();
|
||||
this.cmb2 = new System.Windows.Forms.ComboBox();
|
||||
this.cmb1 = new System.Windows.Forms.ComboBox();
|
||||
this.imgESP32 = new System.Windows.Forms.PictureBox();
|
||||
this.cbTipo = new System.Windows.Forms.ComboBox();
|
||||
this.imgESP32 = new System.Windows.Forms.PictureBox();
|
||||
this.picMCP = new System.Windows.Forms.PictureBox();
|
||||
this.cmbB7 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbB6 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbB5 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbB4 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbB3 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbB2 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbB1 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbB0 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbA7 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbA6 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbA5 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbA4 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbA3 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbA2 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbA1 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbA0 = new System.Windows.Forms.ComboBox();
|
||||
this.lblB1 = new System.Windows.Forms.Label();
|
||||
this.lblA1 = new System.Windows.Forms.Label();
|
||||
this.txtMCP1 = new System.Windows.Forms.TextBox();
|
||||
this.lblMCP1 = new System.Windows.Forms.Label();
|
||||
this.gpbMCP1 = new System.Windows.Forms.GroupBox();
|
||||
this.chbMCP1 = new System.Windows.Forms.CheckBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.imgESP32)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picMCP)).BeginInit();
|
||||
this.gpbMCP1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lblPinout
|
||||
|
|
@ -160,7 +185,8 @@
|
|||
//
|
||||
// btnSalvar
|
||||
//
|
||||
this.btnSalvar.Location = new System.Drawing.Point(581, 810);
|
||||
this.btnSalvar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnSalvar.Location = new System.Drawing.Point(1240, 810);
|
||||
this.btnSalvar.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.btnSalvar.Name = "btnSalvar";
|
||||
this.btnSalvar.Size = new System.Drawing.Size(148, 39);
|
||||
|
|
@ -593,17 +619,6 @@
|
|||
this.cmb1.TabIndex = 182;
|
||||
this.cmb1.Visible = false;
|
||||
//
|
||||
// imgESP32
|
||||
//
|
||||
this.imgESP32.Image = global::AgroBase.Properties.Resources.esp32_s3;
|
||||
this.imgESP32.Location = new System.Drawing.Point(169, 2);
|
||||
this.imgESP32.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.imgESP32.Name = "imgESP32";
|
||||
this.imgESP32.Size = new System.Drawing.Size(405, 847);
|
||||
this.imgESP32.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.imgESP32.TabIndex = 181;
|
||||
this.imgESP32.TabStop = false;
|
||||
//
|
||||
// cbTipo
|
||||
//
|
||||
this.cbTipo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
|
|
@ -615,12 +630,292 @@
|
|||
this.cbTipo.TabIndex = 228;
|
||||
this.cbTipo.SelectedIndexChanged += new System.EventHandler(this.cbTipo_SelectedIndexChanged);
|
||||
//
|
||||
// imgESP32
|
||||
//
|
||||
this.imgESP32.Image = global::AgroBase.Properties.Resources.esp32_s3;
|
||||
this.imgESP32.Location = new System.Drawing.Point(169, 2);
|
||||
this.imgESP32.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.imgESP32.Name = "imgESP32";
|
||||
this.imgESP32.Size = new System.Drawing.Size(405, 847);
|
||||
this.imgESP32.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.imgESP32.TabIndex = 181;
|
||||
this.imgESP32.TabStop = false;
|
||||
//
|
||||
// picMCP
|
||||
//
|
||||
this.picMCP.Image = global::AgroBase.Properties.Resources.mcp;
|
||||
this.picMCP.Location = new System.Drawing.Point(15, 52);
|
||||
this.picMCP.Name = "picMCP";
|
||||
this.picMCP.Size = new System.Drawing.Size(278, 322);
|
||||
this.picMCP.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.picMCP.TabIndex = 229;
|
||||
this.picMCP.TabStop = false;
|
||||
//
|
||||
// cmbB7
|
||||
//
|
||||
this.cmbB7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbB7.Enabled = false;
|
||||
this.cmbB7.FormattingEnabled = true;
|
||||
this.cmbB7.Location = new System.Drawing.Point(299, 334);
|
||||
this.cmbB7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbB7.Name = "cmbB7";
|
||||
this.cmbB7.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbB7.TabIndex = 237;
|
||||
//
|
||||
// cmbB6
|
||||
//
|
||||
this.cmbB6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbB6.Enabled = false;
|
||||
this.cmbB6.FormattingEnabled = true;
|
||||
this.cmbB6.Location = new System.Drawing.Point(299, 304);
|
||||
this.cmbB6.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbB6.Name = "cmbB6";
|
||||
this.cmbB6.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbB6.TabIndex = 236;
|
||||
//
|
||||
// cmbB5
|
||||
//
|
||||
this.cmbB5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbB5.Enabled = false;
|
||||
this.cmbB5.FormattingEnabled = true;
|
||||
this.cmbB5.Location = new System.Drawing.Point(299, 274);
|
||||
this.cmbB5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbB5.Name = "cmbB5";
|
||||
this.cmbB5.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbB5.TabIndex = 235;
|
||||
//
|
||||
// cmbB4
|
||||
//
|
||||
this.cmbB4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbB4.Enabled = false;
|
||||
this.cmbB4.FormattingEnabled = true;
|
||||
this.cmbB4.Location = new System.Drawing.Point(299, 244);
|
||||
this.cmbB4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbB4.Name = "cmbB4";
|
||||
this.cmbB4.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbB4.TabIndex = 234;
|
||||
//
|
||||
// cmbB3
|
||||
//
|
||||
this.cmbB3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbB3.Enabled = false;
|
||||
this.cmbB3.FormattingEnabled = true;
|
||||
this.cmbB3.Location = new System.Drawing.Point(299, 213);
|
||||
this.cmbB3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbB3.Name = "cmbB3";
|
||||
this.cmbB3.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbB3.TabIndex = 233;
|
||||
//
|
||||
// cmbB2
|
||||
//
|
||||
this.cmbB2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbB2.Enabled = false;
|
||||
this.cmbB2.FormattingEnabled = true;
|
||||
this.cmbB2.Location = new System.Drawing.Point(299, 184);
|
||||
this.cmbB2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbB2.Name = "cmbB2";
|
||||
this.cmbB2.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbB2.TabIndex = 232;
|
||||
//
|
||||
// cmbB1
|
||||
//
|
||||
this.cmbB1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbB1.Enabled = false;
|
||||
this.cmbB1.FormattingEnabled = true;
|
||||
this.cmbB1.Location = new System.Drawing.Point(299, 154);
|
||||
this.cmbB1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbB1.Name = "cmbB1";
|
||||
this.cmbB1.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbB1.TabIndex = 231;
|
||||
//
|
||||
// cmbB0
|
||||
//
|
||||
this.cmbB0.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbB0.Enabled = false;
|
||||
this.cmbB0.FormattingEnabled = true;
|
||||
this.cmbB0.Location = new System.Drawing.Point(299, 124);
|
||||
this.cmbB0.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbB0.Name = "cmbB0";
|
||||
this.cmbB0.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbB0.TabIndex = 230;
|
||||
//
|
||||
// cmbA7
|
||||
//
|
||||
this.cmbA7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbA7.Enabled = false;
|
||||
this.cmbA7.FormattingEnabled = true;
|
||||
this.cmbA7.Location = new System.Drawing.Point(468, 334);
|
||||
this.cmbA7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbA7.Name = "cmbA7";
|
||||
this.cmbA7.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbA7.TabIndex = 245;
|
||||
//
|
||||
// cmbA6
|
||||
//
|
||||
this.cmbA6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbA6.Enabled = false;
|
||||
this.cmbA6.FormattingEnabled = true;
|
||||
this.cmbA6.Location = new System.Drawing.Point(468, 304);
|
||||
this.cmbA6.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbA6.Name = "cmbA6";
|
||||
this.cmbA6.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbA6.TabIndex = 244;
|
||||
//
|
||||
// cmbA5
|
||||
//
|
||||
this.cmbA5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbA5.Enabled = false;
|
||||
this.cmbA5.FormattingEnabled = true;
|
||||
this.cmbA5.Location = new System.Drawing.Point(468, 274);
|
||||
this.cmbA5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbA5.Name = "cmbA5";
|
||||
this.cmbA5.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbA5.TabIndex = 243;
|
||||
//
|
||||
// cmbA4
|
||||
//
|
||||
this.cmbA4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbA4.Enabled = false;
|
||||
this.cmbA4.FormattingEnabled = true;
|
||||
this.cmbA4.Location = new System.Drawing.Point(468, 244);
|
||||
this.cmbA4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbA4.Name = "cmbA4";
|
||||
this.cmbA4.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbA4.TabIndex = 242;
|
||||
//
|
||||
// cmbA3
|
||||
//
|
||||
this.cmbA3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbA3.Enabled = false;
|
||||
this.cmbA3.FormattingEnabled = true;
|
||||
this.cmbA3.Location = new System.Drawing.Point(468, 213);
|
||||
this.cmbA3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbA3.Name = "cmbA3";
|
||||
this.cmbA3.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbA3.TabIndex = 241;
|
||||
//
|
||||
// cmbA2
|
||||
//
|
||||
this.cmbA2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbA2.Enabled = false;
|
||||
this.cmbA2.FormattingEnabled = true;
|
||||
this.cmbA2.Location = new System.Drawing.Point(468, 184);
|
||||
this.cmbA2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbA2.Name = "cmbA2";
|
||||
this.cmbA2.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbA2.TabIndex = 240;
|
||||
//
|
||||
// cmbA1
|
||||
//
|
||||
this.cmbA1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbA1.Enabled = false;
|
||||
this.cmbA1.FormattingEnabled = true;
|
||||
this.cmbA1.Location = new System.Drawing.Point(468, 154);
|
||||
this.cmbA1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbA1.Name = "cmbA1";
|
||||
this.cmbA1.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbA1.TabIndex = 239;
|
||||
//
|
||||
// cmbA0
|
||||
//
|
||||
this.cmbA0.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbA0.Enabled = false;
|
||||
this.cmbA0.FormattingEnabled = true;
|
||||
this.cmbA0.Location = new System.Drawing.Point(468, 124);
|
||||
this.cmbA0.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.cmbA0.Name = "cmbA0";
|
||||
this.cmbA0.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbA0.TabIndex = 238;
|
||||
//
|
||||
// lblB1
|
||||
//
|
||||
this.lblB1.AutoSize = true;
|
||||
this.lblB1.Font = new System.Drawing.Font("Microsoft Sans Serif", 16.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblB1.Location = new System.Drawing.Point(352, 90);
|
||||
this.lblB1.Name = "lblB1";
|
||||
this.lblB1.Size = new System.Drawing.Size(34, 32);
|
||||
this.lblB1.TabIndex = 246;
|
||||
this.lblB1.Text = "B";
|
||||
//
|
||||
// lblA1
|
||||
//
|
||||
this.lblA1.AutoSize = true;
|
||||
this.lblA1.Font = new System.Drawing.Font("Microsoft Sans Serif", 16.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblA1.Location = new System.Drawing.Point(523, 90);
|
||||
this.lblA1.Name = "lblA1";
|
||||
this.lblA1.Size = new System.Drawing.Size(34, 32);
|
||||
this.lblA1.TabIndex = 247;
|
||||
this.lblA1.Text = "A";
|
||||
//
|
||||
// txtMCP1
|
||||
//
|
||||
this.txtMCP1.Enabled = false;
|
||||
this.txtMCP1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtMCP1.Location = new System.Drawing.Point(468, 52);
|
||||
this.txtMCP1.Name = "txtMCP1";
|
||||
this.txtMCP1.Size = new System.Drawing.Size(148, 30);
|
||||
this.txtMCP1.TabIndex = 248;
|
||||
this.txtMCP1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// lblMCP1
|
||||
//
|
||||
this.lblMCP1.AutoSize = true;
|
||||
this.lblMCP1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblMCP1.Location = new System.Drawing.Point(299, 55);
|
||||
this.lblMCP1.Name = "lblMCP1";
|
||||
this.lblMCP1.Size = new System.Drawing.Size(144, 25);
|
||||
this.lblMCP1.TabIndex = 249;
|
||||
this.lblMCP1.Text = "Endereço I2C";
|
||||
//
|
||||
// gpbMCP1
|
||||
//
|
||||
this.gpbMCP1.Controls.Add(this.chbMCP1);
|
||||
this.gpbMCP1.Controls.Add(this.picMCP);
|
||||
this.gpbMCP1.Controls.Add(this.lblMCP1);
|
||||
this.gpbMCP1.Controls.Add(this.cmbB0);
|
||||
this.gpbMCP1.Controls.Add(this.txtMCP1);
|
||||
this.gpbMCP1.Controls.Add(this.cmbB1);
|
||||
this.gpbMCP1.Controls.Add(this.lblA1);
|
||||
this.gpbMCP1.Controls.Add(this.cmbB2);
|
||||
this.gpbMCP1.Controls.Add(this.lblB1);
|
||||
this.gpbMCP1.Controls.Add(this.cmbB3);
|
||||
this.gpbMCP1.Controls.Add(this.cmbA7);
|
||||
this.gpbMCP1.Controls.Add(this.cmbB4);
|
||||
this.gpbMCP1.Controls.Add(this.cmbA6);
|
||||
this.gpbMCP1.Controls.Add(this.cmbB5);
|
||||
this.gpbMCP1.Controls.Add(this.cmbA5);
|
||||
this.gpbMCP1.Controls.Add(this.cmbB6);
|
||||
this.gpbMCP1.Controls.Add(this.cmbA4);
|
||||
this.gpbMCP1.Controls.Add(this.cmbB7);
|
||||
this.gpbMCP1.Controls.Add(this.cmbA3);
|
||||
this.gpbMCP1.Controls.Add(this.cmbA0);
|
||||
this.gpbMCP1.Controls.Add(this.cmbA2);
|
||||
this.gpbMCP1.Controls.Add(this.cmbA1);
|
||||
this.gpbMCP1.Location = new System.Drawing.Point(759, 12);
|
||||
this.gpbMCP1.Name = "gpbMCP1";
|
||||
this.gpbMCP1.Size = new System.Drawing.Size(632, 385);
|
||||
this.gpbMCP1.TabIndex = 250;
|
||||
this.gpbMCP1.TabStop = false;
|
||||
this.gpbMCP1.Text = "Expansor de GPIO";
|
||||
//
|
||||
// chbMCP1
|
||||
//
|
||||
this.chbMCP1.AutoSize = true;
|
||||
this.chbMCP1.Location = new System.Drawing.Point(15, 23);
|
||||
this.chbMCP1.Name = "chbMCP1";
|
||||
this.chbMCP1.Size = new System.Drawing.Size(160, 20);
|
||||
this.chbMCP1.TabIndex = 250;
|
||||
this.chbMCP1.Text = "MCP23017 conectado";
|
||||
this.chbMCP1.UseVisualStyleBackColor = true;
|
||||
this.chbMCP1.CheckedChanged += new System.EventHandler(this.chbMCP_CheckedChanged);
|
||||
//
|
||||
// frmPinout
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
this.ClientSize = new System.Drawing.Size(748, 862);
|
||||
this.ClientSize = new System.Drawing.Size(1408, 862);
|
||||
this.Controls.Add(this.gpbMCP1);
|
||||
this.Controls.Add(this.cbTipo);
|
||||
this.Controls.Add(this.lblPinout);
|
||||
this.Controls.Add(this.cmb22);
|
||||
|
|
@ -676,6 +971,9 @@
|
|||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmPinout_FormClosing);
|
||||
this.Load += new System.EventHandler(this.frmPinout_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.imgESP32)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picMCP)).EndInit();
|
||||
this.gpbMCP1.ResumeLayout(false);
|
||||
this.gpbMCP1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
|
|
@ -731,5 +1029,28 @@
|
|||
private System.Windows.Forms.ComboBox cmb1;
|
||||
private System.Windows.Forms.PictureBox imgESP32;
|
||||
private System.Windows.Forms.ComboBox cbTipo;
|
||||
private System.Windows.Forms.PictureBox picMCP;
|
||||
private System.Windows.Forms.ComboBox cmbB7;
|
||||
private System.Windows.Forms.ComboBox cmbB6;
|
||||
private System.Windows.Forms.ComboBox cmbB5;
|
||||
private System.Windows.Forms.ComboBox cmbB4;
|
||||
private System.Windows.Forms.ComboBox cmbB3;
|
||||
private System.Windows.Forms.ComboBox cmbB2;
|
||||
private System.Windows.Forms.ComboBox cmbB1;
|
||||
private System.Windows.Forms.ComboBox cmbB0;
|
||||
private System.Windows.Forms.ComboBox cmbA7;
|
||||
private System.Windows.Forms.ComboBox cmbA6;
|
||||
private System.Windows.Forms.ComboBox cmbA5;
|
||||
private System.Windows.Forms.ComboBox cmbA4;
|
||||
private System.Windows.Forms.ComboBox cmbA3;
|
||||
private System.Windows.Forms.ComboBox cmbA2;
|
||||
private System.Windows.Forms.ComboBox cmbA1;
|
||||
private System.Windows.Forms.ComboBox cmbA0;
|
||||
private System.Windows.Forms.Label lblB1;
|
||||
private System.Windows.Forms.Label lblA1;
|
||||
private System.Windows.Forms.TextBox txtMCP1;
|
||||
private System.Windows.Forms.Label lblMCP1;
|
||||
private System.Windows.Forms.GroupBox gpbMCP1;
|
||||
private System.Windows.Forms.CheckBox chbMCP1;
|
||||
}
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ namespace AgroBase.Forms
|
|||
Enum.GetName(typeof(FuncoesPinout), FuncoesPinout.NaoConectado),
|
||||
};
|
||||
List<FuncoesPinout> Funcoes = new List<FuncoesPinout>();
|
||||
List<PinoutModel> Pinout = new List<PinoutModel>();
|
||||
PinoutDataModel Pinout = new PinoutDataModel();
|
||||
List<DispositivoDataModel> Dispositivos = new List<DispositivoDataModel>();
|
||||
|
||||
public frmPinout(T_Code tipo)
|
||||
|
|
@ -44,7 +44,12 @@ namespace AgroBase.Forms
|
|||
Enum.GetName(typeof(FuncoesPinout), FuncoesPinout.NaoConectado),
|
||||
};
|
||||
Funcoes = new List<FuncoesPinout>();
|
||||
Pinout = new List<PinoutModel>();
|
||||
Pinout = new PinoutDataModel()
|
||||
{
|
||||
ExpansorGPIO = false,
|
||||
EnderecoExpansor = "",
|
||||
Pinos = new List<PinoutModel>(),
|
||||
};
|
||||
Dispositivos = new List<DispositivoDataModel>();
|
||||
|
||||
switch (TipoDisp)
|
||||
|
|
@ -61,7 +66,7 @@ namespace AgroBase.Forms
|
|||
this.Text = "Pinout - Movimentação";
|
||||
|
||||
Funcoes = MovimentacaoModel.Funcoes.ToList();
|
||||
Pinout = MovimentacaoModel.Pinout.ToList();
|
||||
Pinout = MovimentacaoModel.Pinout;
|
||||
Dispositivos = Disp.Dados.Motores.Select(x => new DispositivoDataModel()
|
||||
{
|
||||
ID = x.ID,
|
||||
|
|
@ -81,7 +86,7 @@ namespace AgroBase.Forms
|
|||
this.Text = "Pinout - Direcional";
|
||||
|
||||
Funcoes = DirecionalModel.Funcoes.ToList();
|
||||
Pinout = DirecionalModel.Pinout.ToList();
|
||||
Pinout = DirecionalModel.Pinout;
|
||||
Dispositivos = Disp.Dados.Motores.Select(x => new DispositivoDataModel()
|
||||
{
|
||||
ID = x.ID,
|
||||
|
|
@ -101,7 +106,7 @@ namespace AgroBase.Forms
|
|||
this.Text = "Pinout - Sensoriamento";
|
||||
|
||||
Funcoes = SensoriamentoModel.Funcoes.ToList();
|
||||
Pinout = SensoriamentoModel.Pinout.ToList();
|
||||
Pinout = SensoriamentoModel.Pinout;
|
||||
Dispositivos.Add(new DispositivoDataModel()
|
||||
{
|
||||
ID = "",
|
||||
|
|
@ -131,7 +136,7 @@ namespace AgroBase.Forms
|
|||
this.Text = "Pinout - Atuador";
|
||||
|
||||
Funcoes = AtuadorModel.Funcoes.ToList();
|
||||
Pinout = AtuadorModel.Pinout.ToList();
|
||||
Pinout = AtuadorModel.Pinout;
|
||||
Dispositivos = new List<DispositivoDataModel>();
|
||||
Dispositivos.Add(new DispositivoDataModel()
|
||||
{
|
||||
|
|
@ -152,7 +157,10 @@ namespace AgroBase.Forms
|
|||
}
|
||||
}
|
||||
|
||||
Funcoes.ForEach(x => Pinos.Add(Enum.GetName(typeof(FuncoesPinout), x)));
|
||||
chbMCP1.Checked = Pinout.ExpansorGPIO;
|
||||
txtMCP1.Text = Pinout.EnderecoExpansor;
|
||||
|
||||
//Funcoes.ForEach(x => Pinos.Add(Enum.GetName(typeof(FuncoesPinout), x)));
|
||||
|
||||
foreach (var Dispositivo in Dispositivos)
|
||||
{
|
||||
|
|
@ -160,18 +168,23 @@ namespace AgroBase.Forms
|
|||
}
|
||||
|
||||
List<ComboBox> cmbs = this.Controls.OfType<ComboBox>().Where(x => x.Name.Contains("cmb")).ToList();
|
||||
cmbs.AddRange(gpbMCP1.Controls.OfType<ComboBox>().ToList());
|
||||
foreach (var cmb in cmbs)
|
||||
{
|
||||
if (cmb.Name.Contains("A"))
|
||||
{
|
||||
|
||||
}
|
||||
cmb.SelectedIndexChanged -= Cmb_SelectedIndexChanged;
|
||||
cmb.SelectedIndexChanged += Cmb_SelectedIndexChanged;
|
||||
cmb.Items.Clear();
|
||||
Pinos.ForEach(x => cmb.Items.Add(x));
|
||||
cmb.SelectedIndex = 0;
|
||||
|
||||
var Selecionado = Pinout.FirstOrDefault(x => x.Descricao == cmb.Name.Replace("cmb", ""));
|
||||
var Selecionado = Pinout.Pinos.FirstOrDefault(x => x.Descricao == cmb.Name.Replace("cmb", ""));
|
||||
if (Selecionado != null)
|
||||
{
|
||||
cmb.Enabled = Selecionado.Habilitado;
|
||||
cmb.Enabled = (Selecionado.Barramento == TiposBarramentos.CONTROLADOR && Selecionado.Habilitado) || (Selecionado.Barramento == TiposBarramentos.EXPANSORI2C && chbMCP1.Checked);
|
||||
if (Selecionado.Habilitado)
|
||||
{
|
||||
cmb.SelectedItem = (Selecionado.Funcao != FuncoesPinout.Geral ? Selecionado.ComponenteID + " " : "") + Enum.GetName(typeof(FuncoesPinout), Selecionado.Funcao);
|
||||
|
|
@ -179,7 +192,7 @@ namespace AgroBase.Forms
|
|||
}
|
||||
}
|
||||
|
||||
AtualizaTipoControlador(Pinout.FirstOrDefault().Tipo, false);
|
||||
AtualizaTipoControlador(Pinout.Pinos.FirstOrDefault().Controlador, false);
|
||||
}
|
||||
|
||||
private void frmPinout_FormClosing(object sender, FormClosingEventArgs e)
|
||||
|
|
@ -195,39 +208,44 @@ namespace AgroBase.Forms
|
|||
|
||||
private void btnSalvar_Click(object sender, EventArgs e)
|
||||
{
|
||||
Pinout.ForEach(x =>
|
||||
Pinout.Pinos.ForEach(x =>
|
||||
{
|
||||
x.ComponenteID = "";
|
||||
x.Funcao = FuncoesPinout.NaoConectado;
|
||||
});
|
||||
|
||||
List<ComboBox> cmbs = this.Controls.OfType<ComboBox>().Where(x => x.Name.Contains("cmb") && x.Enabled && x.Visible).ToList();
|
||||
cmbs.AddRange(gpbMCP1.Controls.OfType<ComboBox>().ToList());
|
||||
foreach (var cmb in cmbs)
|
||||
{
|
||||
string ComponenteID = cmb.SelectedItem.ToString().Split(' ').Length > 1 ? cmb.SelectedItem.ToString().Split(' ')[0] : "";
|
||||
FuncoesPinout Funcao = (FuncoesPinout)Enum.Parse(typeof(FuncoesPinout), ComponenteID != "" ? (cmb.SelectedItem.ToString().Split(' ')[1]) : cmb.SelectedItem.ToString());
|
||||
if (Pinout.Any(x => x.Descricao == cmb.Name.Replace("cmb", "")))
|
||||
if (Pinout.Pinos.Any(x => x.Descricao == cmb.Name.Replace("cmb", "")))
|
||||
{
|
||||
Pinout.FirstOrDefault(x => x.Descricao == cmb.Name.Replace("cmb", "")).Funcao = Funcao;
|
||||
Pinout.FirstOrDefault(x => x.Descricao == cmb.Name.Replace("cmb", "")).ComponenteID = ComponenteID;
|
||||
Pinout.Pinos.FirstOrDefault(x => x.Descricao == cmb.Name.Replace("cmb", "")).Funcao = Funcao;
|
||||
Pinout.Pinos.FirstOrDefault(x => x.Descricao == cmb.Name.Replace("cmb", "")).ComponenteID = ComponenteID;
|
||||
Pinout.Pinos.FirstOrDefault(x => x.Descricao == cmb.Name.Replace("cmb", "")).Barramento = cmb.Name.Contains("A") || cmb.Name.Contains("B") ? TiposBarramentos.EXPANSORI2C : TiposBarramentos.CONTROLADOR;
|
||||
}
|
||||
}
|
||||
|
||||
Pinout.ExpansorGPIO = chbMCP1.Checked;
|
||||
Pinout.EnderecoExpansor = txtMCP1.Text;
|
||||
|
||||
PinoutModel.SalvarPinout(Pinout, "pinout" + Enum.GetName(typeof(T_Code), TipoDisp) + ".pin");
|
||||
|
||||
switch (TipoDisp)
|
||||
{
|
||||
case T_Code.Mov:
|
||||
MovimentacaoModel.Pinout = Pinout.ToList();
|
||||
MovimentacaoModel.Pinout = Pinout;
|
||||
break;
|
||||
case T_Code.Dir:
|
||||
DirecionalModel.Pinout = Pinout.ToList();
|
||||
DirecionalModel.Pinout = Pinout;
|
||||
break;
|
||||
case T_Code.Sen:
|
||||
SensoriamentoModel.Pinout = Pinout.ToList();
|
||||
SensoriamentoModel.Pinout = Pinout;
|
||||
break;
|
||||
case T_Code.Atu:
|
||||
AtuadorModel.Pinout = Pinout.ToList();
|
||||
AtuadorModel.Pinout = Pinout;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -235,7 +253,7 @@ namespace AgroBase.Forms
|
|||
private void cbTipo_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
TiposControladores Tipo = (TiposControladores)(((ComboBox)sender).SelectedIndex);
|
||||
if (Pinout.FirstOrDefault().Tipo != Tipo)
|
||||
if (Pinout.Pinos.FirstOrDefault().Controlador != Tipo)
|
||||
{
|
||||
AtualizaTipoControlador(Tipo, true);
|
||||
}
|
||||
|
|
@ -250,26 +268,60 @@ namespace AgroBase.Forms
|
|||
imgESP32.Size = new Size(304, 688);
|
||||
imgESP32.Location = new Point(130, 2);
|
||||
if (Novo)
|
||||
Pinout = PinoutModel.CarregarPinoutPadrao_S3();
|
||||
Pinout = new PinoutDataModel()
|
||||
{
|
||||
ExpansorGPIO = false,
|
||||
EnderecoExpansor = "",
|
||||
Pinos = PinoutModel.CarregarPinoutPadrao_S3(),
|
||||
};
|
||||
break;
|
||||
case TiposControladores.ESP32_WROVER:
|
||||
imgESP32.Image = Properties.Resources.esp32_wrover;
|
||||
imgESP32.Size = new Size(304, 540);
|
||||
imgESP32.Location = new Point(130, 40);
|
||||
if (Novo)
|
||||
Pinout = PinoutModel.CarregarPinoutPadrao_Wrover();
|
||||
Pinout = new PinoutDataModel()
|
||||
{
|
||||
ExpansorGPIO = false,
|
||||
EnderecoExpansor = "",
|
||||
Pinos = PinoutModel.CarregarPinoutPadrao_Wrover(),
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
List<ComboBox> cmbs = this.Controls.OfType<ComboBox>().Where(x => x.Name.Contains("cmb")).ToList();
|
||||
foreach (var cmb in cmbs)
|
||||
{
|
||||
cmb.Visible = Pinout.Any(x => x.Descricao == cmb.Name.Replace("cmb", ""));
|
||||
cmb.Visible = Pinout.Pinos.Any(x => x.Descricao == cmb.Name.Replace("cmb", ""));
|
||||
}
|
||||
|
||||
|
||||
cbTipo.SelectedIndex = (int)TipoControlador;
|
||||
|
||||
chbMCP1.Checked = Pinout.ExpansorGPIO;
|
||||
}
|
||||
|
||||
private void chbMCP_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
CheckBox chb = (CheckBox)sender;
|
||||
AtualizarCombosMCP(chb);
|
||||
}
|
||||
|
||||
private void AtualizarCombosMCP(CheckBox chb)
|
||||
{
|
||||
if (chb.Checked && !Pinout.Pinos.Any(x => x.Barramento == TiposBarramentos.EXPANSORI2C))
|
||||
{
|
||||
Pinout.Pinos.AddRange(PinoutModel.CarregarPinoutPadrao_MCP());
|
||||
}
|
||||
string ID = chb.Name.Replace("chbMCP", "");
|
||||
GroupBox gpb = this.Controls.OfType<GroupBox>().FirstOrDefault(x => x.Name == "gpbMCP" + ID);
|
||||
foreach (var cmb in gpb.Controls.OfType<ComboBox>())
|
||||
{
|
||||
cmb.Enabled = chb.Checked;
|
||||
}
|
||||
TextBox txt = gpb.Controls.OfType<TextBox>().FirstOrDefault(x => x.Name == "txtMCP" + ID);
|
||||
txt.Enabled = chb.Checked;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class DispositivoDataModel
|
||||
|
|
|
|||
|
|
@ -78,6 +78,8 @@ namespace AgroBase
|
|||
this.gpbJoystick = new System.Windows.Forms.GroupBox();
|
||||
this.gpbControleDirecional = new System.Windows.Forms.GroupBox();
|
||||
this.gpbAtalhos = new System.Windows.Forms.GroupBox();
|
||||
this.btnSonar = new System.Windows.Forms.Button();
|
||||
this.btnAtuCalibragem = new System.Windows.Forms.Button();
|
||||
this.btnContornos = new System.Windows.Forms.Button();
|
||||
this.btnGPS = new System.Windows.Forms.Button();
|
||||
this.gpbOperacao = new System.Windows.Forms.GroupBox();
|
||||
|
|
@ -87,7 +89,7 @@ namespace AgroBase
|
|||
this.btnIniciarOperacao = new System.Windows.Forms.Button();
|
||||
this.lblModoOperacao = new System.Windows.Forms.Label();
|
||||
this.cmbModoOperacao = new System.Windows.Forms.ComboBox();
|
||||
this.btnAtuCalibragem = new System.Windows.Forms.Button();
|
||||
this.btnSimulador = new System.Windows.Forms.Button();
|
||||
this.gpbAcoes.SuspendLayout();
|
||||
this.erroStrip.SuspendLayout();
|
||||
this.pnlLateral.SuspendLayout();
|
||||
|
|
@ -160,7 +162,7 @@ namespace AgroBase
|
|||
//
|
||||
this.chbConexaoautomatica.AutoSize = true;
|
||||
this.chbConexaoautomatica.Location = new System.Drawing.Point(229, 34);
|
||||
this.chbConexaoautomatica.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.chbConexaoautomatica.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.chbConexaoautomatica.Name = "chbConexaoautomatica";
|
||||
this.chbConexaoautomatica.Size = new System.Drawing.Size(152, 20);
|
||||
this.chbConexaoautomatica.TabIndex = 21;
|
||||
|
|
@ -616,6 +618,8 @@ namespace AgroBase
|
|||
//
|
||||
// gpbAtalhos
|
||||
//
|
||||
this.gpbAtalhos.Controls.Add(this.btnSimulador);
|
||||
this.gpbAtalhos.Controls.Add(this.btnSonar);
|
||||
this.gpbAtalhos.Controls.Add(this.btnAtuCalibragem);
|
||||
this.gpbAtalhos.Controls.Add(this.btnContornos);
|
||||
this.gpbAtalhos.Controls.Add(this.btnGPS);
|
||||
|
|
@ -633,6 +637,28 @@ namespace AgroBase
|
|||
this.gpbAtalhos.TabStop = false;
|
||||
this.gpbAtalhos.Text = "Atalhos";
|
||||
//
|
||||
// btnSonar
|
||||
//
|
||||
this.btnSonar.Location = new System.Drawing.Point(5, 262);
|
||||
this.btnSonar.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.btnSonar.Name = "btnSonar";
|
||||
this.btnSonar.Size = new System.Drawing.Size(112, 25);
|
||||
this.btnSonar.TabIndex = 22;
|
||||
this.btnSonar.Text = "Sonar";
|
||||
this.btnSonar.UseVisualStyleBackColor = true;
|
||||
this.btnSonar.Click += new System.EventHandler(this.btnSonar_Click);
|
||||
//
|
||||
// btnAtuCalibragem
|
||||
//
|
||||
this.btnAtuCalibragem.Location = new System.Drawing.Point(6, 233);
|
||||
this.btnAtuCalibragem.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.btnAtuCalibragem.Name = "btnAtuCalibragem";
|
||||
this.btnAtuCalibragem.Size = new System.Drawing.Size(112, 25);
|
||||
this.btnAtuCalibragem.TabIndex = 21;
|
||||
this.btnAtuCalibragem.Text = "Atuador";
|
||||
this.btnAtuCalibragem.UseVisualStyleBackColor = true;
|
||||
this.btnAtuCalibragem.Click += new System.EventHandler(this.btnAtuCalibragem_Click);
|
||||
//
|
||||
// btnContornos
|
||||
//
|
||||
this.btnContornos.Location = new System.Drawing.Point(5, 204);
|
||||
|
|
@ -736,16 +762,16 @@ namespace AgroBase
|
|||
this.cmbModoOperacao.TabIndex = 13;
|
||||
this.cmbModoOperacao.SelectedIndexChanged += new System.EventHandler(this.cmbModoOperacao_SelectedIndexChanged);
|
||||
//
|
||||
// btnAtuCalibragem
|
||||
// btnSimulador
|
||||
//
|
||||
this.btnAtuCalibragem.Location = new System.Drawing.Point(6, 233);
|
||||
this.btnAtuCalibragem.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.btnAtuCalibragem.Name = "btnAtuCalibragem";
|
||||
this.btnAtuCalibragem.Size = new System.Drawing.Size(112, 25);
|
||||
this.btnAtuCalibragem.TabIndex = 21;
|
||||
this.btnAtuCalibragem.Text = "Calibrar Atuador";
|
||||
this.btnAtuCalibragem.UseVisualStyleBackColor = true;
|
||||
this.btnAtuCalibragem.Click += new System.EventHandler(this.btnAtuCalibragem_Click);
|
||||
this.btnSimulador.Location = new System.Drawing.Point(5, 291);
|
||||
this.btnSimulador.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.btnSimulador.Name = "btnSimulador";
|
||||
this.btnSimulador.Size = new System.Drawing.Size(112, 25);
|
||||
this.btnSimulador.TabIndex = 23;
|
||||
this.btnSimulador.Text = "Simulador";
|
||||
this.btnSimulador.UseVisualStyleBackColor = true;
|
||||
this.btnSimulador.Click += new System.EventHandler(this.btnSimulador_Click);
|
||||
//
|
||||
// frmPrincipal
|
||||
//
|
||||
|
|
@ -858,6 +884,8 @@ namespace AgroBase
|
|||
public System.Windows.Forms.CheckBox chbConexaoautomatica;
|
||||
public System.Windows.Forms.CheckBox chbDebugMode;
|
||||
private System.Windows.Forms.Button btnAtuCalibragem;
|
||||
private System.Windows.Forms.Button btnSonar;
|
||||
private System.Windows.Forms.Button btnSimulador;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ namespace AgroBase
|
|||
SerialService.DispositivosMapeados
|
||||
.Select(x => new ListViewItem()
|
||||
{
|
||||
Text = x.PortaCOM + " - " + Enum.GetName(typeof(T_Code), x.Dispositivo) + " - " +
|
||||
Text = x.PortaCOM + " - " + Enum.GetName(typeof(T_Code), x.Dispositivo) + " v" + x.Versao + " - " +
|
||||
(x.Dispositivo == T_Code.Gps ? (GPSService.PortaGPS != null && GPSService.PortaGPS.IsOpen ? "Conectado" : "Desconectado") :
|
||||
x.Dispositivo == T_Code.Pzm ? (PZEMService.PortaPZEM != null && PZEMService.PortaPZEM.IsOpen ? "Conectado" : "Desconectado") :
|
||||
(Variaveis.DispositivosConectados.FirstOrDefault(y => y.PortaCOM() == x.PortaCOM)?.StatusPorta() ?? "Desconectado"))
|
||||
|
|
@ -170,7 +170,6 @@ namespace AgroBase
|
|||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -278,19 +277,7 @@ namespace AgroBase
|
|||
}
|
||||
else
|
||||
{
|
||||
if (Variaveis.OperacaoEmAndamento.OperacaoLiberada)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.frmOperacao = (Form)Activator.CreateInstance(Variaveis.OperacaoEmAndamento.frmOperacao.GetType());
|
||||
/*if (Variaveis.OperacaoEmAndamento.Modo == ModoOperacao.Manual)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Iniciado = true;
|
||||
}*/
|
||||
Variaveis.OperacaoEmAndamento.frmOperacao.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(Variaveis.OperacaoEmAndamento.ErroOperacaoLiberada, "Conexão de módulos pendentes", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
Variaveis.OperacaoEmAndamento.AbrirForm();
|
||||
}
|
||||
|
||||
lblStripOperacao.Text = "Operação: " + Enum.GetName(typeof(ModoOperacao), Variaveis.OperacaoEmAndamento.Modo);
|
||||
|
|
@ -320,5 +307,17 @@ namespace AgroBase
|
|||
frmAtuCalibragem frm = new frmAtuCalibragem();
|
||||
frm.Show();
|
||||
}
|
||||
|
||||
private void btnSonar_Click(object sender, EventArgs e)
|
||||
{
|
||||
frmSonar frm = new frmSonar();
|
||||
frm.Show();
|
||||
}
|
||||
|
||||
private void btnSimulador_Click(object sender, EventArgs e)
|
||||
{
|
||||
frmSimulacaoMapaGPS frm = new frmSimulacaoMapaGPS();
|
||||
frm.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,468 @@
|
|||
namespace AgroBase.Forms
|
||||
{
|
||||
partial class frmSimulacaoMapaGPS
|
||||
{
|
||||
/// <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.pnlOpcoes = new System.Windows.Forms.Panel();
|
||||
this.lblDistanciaFinal = new System.Windows.Forms.Label();
|
||||
this.btnCarregarMapa = new System.Windows.Forms.Button();
|
||||
this.lblDistanciaOperacao = new System.Windows.Forms.Label();
|
||||
this.btnIniciarSimulacao = new System.Windows.Forms.Button();
|
||||
this.gpbSonar = new System.Windows.Forms.GroupBox();
|
||||
this.btnAdicionarDeteccao = new System.Windows.Forms.Button();
|
||||
this.lblAnguloFinal = new System.Windows.Forms.Label();
|
||||
this.txtAnguloFinal = new System.Windows.Forms.TextBox();
|
||||
this.lblDistanciaSonar = new System.Windows.Forms.Label();
|
||||
this.txtDistanciaSonar = new System.Windows.Forms.TextBox();
|
||||
this.lblAnguloI = new System.Windows.Forms.Label();
|
||||
this.txtAnguloInicial = new System.Windows.Forms.TextBox();
|
||||
this.lblDirecao = new System.Windows.Forms.Label();
|
||||
this.lblStatus = new System.Windows.Forms.Label();
|
||||
this.gpbGPS = new System.Windows.Forms.GroupBox();
|
||||
this.btnAcrescentarGPS = new System.Windows.Forms.Button();
|
||||
this.lblDistancia = new System.Windows.Forms.Label();
|
||||
this.txtDistanciaGPS = new System.Windows.Forms.TextBox();
|
||||
this.lblAnguloGPS = new System.Windows.Forms.Label();
|
||||
this.txtAnguloGPS = new System.Windows.Forms.TextBox();
|
||||
this.lblLongitude = new System.Windows.Forms.Label();
|
||||
this.lblLatitude = new System.Windows.Forms.Label();
|
||||
this.txtLongitude = new System.Windows.Forms.TextBox();
|
||||
this.txtLatitude = new System.Windows.Forms.TextBox();
|
||||
this.btnIniciarGPS = new System.Windows.Forms.Button();
|
||||
this.pnlMapa = new System.Windows.Forms.Panel();
|
||||
this.pnlOrientacaoTrajeto = new System.Windows.Forms.Panel();
|
||||
this.pnlSonar = new System.Windows.Forms.Panel();
|
||||
this.picSonar = new System.Windows.Forms.PictureBox();
|
||||
this.chbSonarVirando = new System.Windows.Forms.CheckBox();
|
||||
this.chbMoverObstaculo = new System.Windows.Forms.CheckBox();
|
||||
this.pnlOpcoes.SuspendLayout();
|
||||
this.gpbSonar.SuspendLayout();
|
||||
this.gpbGPS.SuspendLayout();
|
||||
this.pnlMapa.SuspendLayout();
|
||||
this.pnlSonar.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picSonar)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pnlOpcoes
|
||||
//
|
||||
this.pnlOpcoes.Controls.Add(this.lblDistanciaFinal);
|
||||
this.pnlOpcoes.Controls.Add(this.btnCarregarMapa);
|
||||
this.pnlOpcoes.Controls.Add(this.lblDistanciaOperacao);
|
||||
this.pnlOpcoes.Controls.Add(this.btnIniciarSimulacao);
|
||||
this.pnlOpcoes.Controls.Add(this.gpbSonar);
|
||||
this.pnlOpcoes.Controls.Add(this.lblDirecao);
|
||||
this.pnlOpcoes.Controls.Add(this.lblStatus);
|
||||
this.pnlOpcoes.Controls.Add(this.gpbGPS);
|
||||
this.pnlOpcoes.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.pnlOpcoes.Location = new System.Drawing.Point(0, 590);
|
||||
this.pnlOpcoes.Name = "pnlOpcoes";
|
||||
this.pnlOpcoes.Size = new System.Drawing.Size(1371, 123);
|
||||
this.pnlOpcoes.TabIndex = 0;
|
||||
//
|
||||
// lblDistanciaFinal
|
||||
//
|
||||
this.lblDistanciaFinal.AutoSize = true;
|
||||
this.lblDistanciaFinal.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F);
|
||||
this.lblDistanciaFinal.Location = new System.Drawing.Point(9, 85);
|
||||
this.lblDistanciaFinal.Name = "lblDistanciaFinal";
|
||||
this.lblDistanciaFinal.Size = new System.Drawing.Size(146, 16);
|
||||
this.lblDistanciaFinal.TabIndex = 21;
|
||||
this.lblDistanciaFinal.Text = "Distância Final: 00,00 m";
|
||||
//
|
||||
// btnCarregarMapa
|
||||
//
|
||||
this.btnCarregarMapa.Location = new System.Drawing.Point(12, 8);
|
||||
this.btnCarregarMapa.Name = "btnCarregarMapa";
|
||||
this.btnCarregarMapa.Size = new System.Drawing.Size(161, 23);
|
||||
this.btnCarregarMapa.TabIndex = 20;
|
||||
this.btnCarregarMapa.Text = "Carregar Mapa";
|
||||
this.btnCarregarMapa.UseVisualStyleBackColor = true;
|
||||
this.btnCarregarMapa.Click += new System.EventHandler(this.btnCarregarMapa_Click);
|
||||
//
|
||||
// lblDistanciaOperacao
|
||||
//
|
||||
this.lblDistanciaOperacao.AutoSize = true;
|
||||
this.lblDistanciaOperacao.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F);
|
||||
this.lblDistanciaOperacao.Location = new System.Drawing.Point(9, 66);
|
||||
this.lblDistanciaOperacao.Name = "lblDistanciaOperacao";
|
||||
this.lblDistanciaOperacao.Size = new System.Drawing.Size(178, 16);
|
||||
this.lblDistanciaOperacao.TabIndex = 19;
|
||||
this.lblDistanciaOperacao.Text = "Distância Operação: 00,00 m";
|
||||
//
|
||||
// btnIniciarSimulacao
|
||||
//
|
||||
this.btnIniciarSimulacao.Location = new System.Drawing.Point(12, 37);
|
||||
this.btnIniciarSimulacao.Name = "btnIniciarSimulacao";
|
||||
this.btnIniciarSimulacao.Size = new System.Drawing.Size(161, 25);
|
||||
this.btnIniciarSimulacao.TabIndex = 18;
|
||||
this.btnIniciarSimulacao.Text = "Iniciar Simulação";
|
||||
this.btnIniciarSimulacao.UseVisualStyleBackColor = true;
|
||||
this.btnIniciarSimulacao.Click += new System.EventHandler(this.btnIniciarSimulacao_Click);
|
||||
//
|
||||
// gpbSonar
|
||||
//
|
||||
this.gpbSonar.Controls.Add(this.chbMoverObstaculo);
|
||||
this.gpbSonar.Controls.Add(this.chbSonarVirando);
|
||||
this.gpbSonar.Controls.Add(this.btnAdicionarDeteccao);
|
||||
this.gpbSonar.Controls.Add(this.lblAnguloFinal);
|
||||
this.gpbSonar.Controls.Add(this.txtAnguloFinal);
|
||||
this.gpbSonar.Controls.Add(this.lblDistanciaSonar);
|
||||
this.gpbSonar.Controls.Add(this.txtDistanciaSonar);
|
||||
this.gpbSonar.Controls.Add(this.lblAnguloI);
|
||||
this.gpbSonar.Controls.Add(this.txtAnguloInicial);
|
||||
this.gpbSonar.Location = new System.Drawing.Point(811, 3);
|
||||
this.gpbSonar.Name = "gpbSonar";
|
||||
this.gpbSonar.Size = new System.Drawing.Size(309, 117);
|
||||
this.gpbSonar.TabIndex = 17;
|
||||
this.gpbSonar.TabStop = false;
|
||||
this.gpbSonar.Text = "Sonar";
|
||||
//
|
||||
// btnAdicionarDeteccao
|
||||
//
|
||||
this.btnAdicionarDeteccao.Location = new System.Drawing.Point(93, 79);
|
||||
this.btnAdicionarDeteccao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.btnAdicionarDeteccao.Name = "btnAdicionarDeteccao";
|
||||
this.btnAdicionarDeteccao.Size = new System.Drawing.Size(60, 28);
|
||||
this.btnAdicionarDeteccao.TabIndex = 25;
|
||||
this.btnAdicionarDeteccao.Text = "Add";
|
||||
this.btnAdicionarDeteccao.UseVisualStyleBackColor = true;
|
||||
this.btnAdicionarDeteccao.Click += new System.EventHandler(this.btnAdicionarDeteccao_Click);
|
||||
//
|
||||
// lblAnguloFinal
|
||||
//
|
||||
this.lblAnguloFinal.AutoSize = true;
|
||||
this.lblAnguloFinal.Location = new System.Drawing.Point(90, 22);
|
||||
this.lblAnguloFinal.Name = "lblAnguloFinal";
|
||||
this.lblAnguloFinal.Size = new System.Drawing.Size(67, 16);
|
||||
this.lblAnguloFinal.TabIndex = 27;
|
||||
this.lblAnguloFinal.Text = "Angulo Fn";
|
||||
//
|
||||
// txtAnguloFinal
|
||||
//
|
||||
this.txtAnguloFinal.Location = new System.Drawing.Point(93, 41);
|
||||
this.txtAnguloFinal.Name = "txtAnguloFinal";
|
||||
this.txtAnguloFinal.Size = new System.Drawing.Size(60, 22);
|
||||
this.txtAnguloFinal.TabIndex = 23;
|
||||
this.txtAnguloFinal.Text = "0";
|
||||
this.txtAnguloFinal.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// lblDistanciaSonar
|
||||
//
|
||||
this.lblDistanciaSonar.AutoSize = true;
|
||||
this.lblDistanciaSonar.Location = new System.Drawing.Point(12, 66);
|
||||
this.lblDistanciaSonar.Name = "lblDistanciaSonar";
|
||||
this.lblDistanciaSonar.Size = new System.Drawing.Size(63, 16);
|
||||
this.lblDistanciaSonar.TabIndex = 25;
|
||||
this.lblDistanciaSonar.Text = "Distancia";
|
||||
//
|
||||
// txtDistanciaSonar
|
||||
//
|
||||
this.txtDistanciaSonar.Location = new System.Drawing.Point(15, 85);
|
||||
this.txtDistanciaSonar.Name = "txtDistanciaSonar";
|
||||
this.txtDistanciaSonar.Size = new System.Drawing.Size(60, 22);
|
||||
this.txtDistanciaSonar.TabIndex = 24;
|
||||
this.txtDistanciaSonar.Text = "0";
|
||||
this.txtDistanciaSonar.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// lblAnguloI
|
||||
//
|
||||
this.lblAnguloI.AutoSize = true;
|
||||
this.lblAnguloI.Location = new System.Drawing.Point(12, 22);
|
||||
this.lblAnguloI.Name = "lblAnguloI";
|
||||
this.lblAnguloI.Size = new System.Drawing.Size(62, 16);
|
||||
this.lblAnguloI.TabIndex = 23;
|
||||
this.lblAnguloI.Text = "Angulo In";
|
||||
//
|
||||
// txtAnguloInicial
|
||||
//
|
||||
this.txtAnguloInicial.Location = new System.Drawing.Point(15, 41);
|
||||
this.txtAnguloInicial.Name = "txtAnguloInicial";
|
||||
this.txtAnguloInicial.Size = new System.Drawing.Size(60, 22);
|
||||
this.txtAnguloInicial.TabIndex = 22;
|
||||
this.txtAnguloInicial.Text = "0";
|
||||
this.txtAnguloInicial.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// lblDirecao
|
||||
//
|
||||
this.lblDirecao.AutoSize = true;
|
||||
this.lblDirecao.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F);
|
||||
this.lblDirecao.Location = new System.Drawing.Point(9, 104);
|
||||
this.lblDirecao.Name = "lblDirecao";
|
||||
this.lblDirecao.Size = new System.Drawing.Size(106, 16);
|
||||
this.lblDirecao.TabIndex = 16;
|
||||
this.lblDirecao.Text = "Direção: Parado";
|
||||
//
|
||||
// lblStatus
|
||||
//
|
||||
this.lblStatus.AutoSize = true;
|
||||
this.lblStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F);
|
||||
this.lblStatus.Location = new System.Drawing.Point(205, 85);
|
||||
this.lblStatus.Name = "lblStatus";
|
||||
this.lblStatus.Size = new System.Drawing.Size(125, 16);
|
||||
this.lblStatus.TabIndex = 15;
|
||||
this.lblStatus.Text = "Status: Aguardando";
|
||||
//
|
||||
// gpbGPS
|
||||
//
|
||||
this.gpbGPS.Controls.Add(this.btnAcrescentarGPS);
|
||||
this.gpbGPS.Controls.Add(this.lblDistancia);
|
||||
this.gpbGPS.Controls.Add(this.txtDistanciaGPS);
|
||||
this.gpbGPS.Controls.Add(this.lblAnguloGPS);
|
||||
this.gpbGPS.Controls.Add(this.txtAnguloGPS);
|
||||
this.gpbGPS.Controls.Add(this.lblLongitude);
|
||||
this.gpbGPS.Controls.Add(this.lblLatitude);
|
||||
this.gpbGPS.Controls.Add(this.txtLongitude);
|
||||
this.gpbGPS.Controls.Add(this.txtLatitude);
|
||||
this.gpbGPS.Controls.Add(this.btnIniciarGPS);
|
||||
this.gpbGPS.Location = new System.Drawing.Point(385, 3);
|
||||
this.gpbGPS.Name = "gpbGPS";
|
||||
this.gpbGPS.Size = new System.Drawing.Size(420, 117);
|
||||
this.gpbGPS.TabIndex = 14;
|
||||
this.gpbGPS.TabStop = false;
|
||||
this.gpbGPS.Text = "GPS";
|
||||
//
|
||||
// btnAcrescentarGPS
|
||||
//
|
||||
this.btnAcrescentarGPS.Enabled = false;
|
||||
this.btnAcrescentarGPS.Location = new System.Drawing.Point(307, 82);
|
||||
this.btnAcrescentarGPS.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.btnAcrescentarGPS.Name = "btnAcrescentarGPS";
|
||||
this.btnAcrescentarGPS.Size = new System.Drawing.Size(99, 28);
|
||||
this.btnAcrescentarGPS.TabIndex = 22;
|
||||
this.btnAcrescentarGPS.Text = "Acrescentar";
|
||||
this.btnAcrescentarGPS.UseVisualStyleBackColor = true;
|
||||
this.btnAcrescentarGPS.Click += new System.EventHandler(this.btnAcrescentarGPS_Click);
|
||||
//
|
||||
// lblDistancia
|
||||
//
|
||||
this.lblDistancia.AutoSize = true;
|
||||
this.lblDistancia.Location = new System.Drawing.Point(212, 66);
|
||||
this.lblDistancia.Name = "lblDistancia";
|
||||
this.lblDistancia.Size = new System.Drawing.Size(63, 16);
|
||||
this.lblDistancia.TabIndex = 21;
|
||||
this.lblDistancia.Text = "Distancia";
|
||||
//
|
||||
// txtDistanciaGPS
|
||||
//
|
||||
this.txtDistanciaGPS.Enabled = false;
|
||||
this.txtDistanciaGPS.Location = new System.Drawing.Point(215, 85);
|
||||
this.txtDistanciaGPS.Name = "txtDistanciaGPS";
|
||||
this.txtDistanciaGPS.Size = new System.Drawing.Size(71, 22);
|
||||
this.txtDistanciaGPS.TabIndex = 20;
|
||||
this.txtDistanciaGPS.Text = "0";
|
||||
this.txtDistanciaGPS.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// lblAnguloGPS
|
||||
//
|
||||
this.lblAnguloGPS.AutoSize = true;
|
||||
this.lblAnguloGPS.Location = new System.Drawing.Point(212, 22);
|
||||
this.lblAnguloGPS.Name = "lblAnguloGPS";
|
||||
this.lblAnguloGPS.Size = new System.Drawing.Size(49, 16);
|
||||
this.lblAnguloGPS.TabIndex = 19;
|
||||
this.lblAnguloGPS.Text = "Angulo";
|
||||
//
|
||||
// txtAnguloGPS
|
||||
//
|
||||
this.txtAnguloGPS.Enabled = false;
|
||||
this.txtAnguloGPS.Location = new System.Drawing.Point(215, 41);
|
||||
this.txtAnguloGPS.Name = "txtAnguloGPS";
|
||||
this.txtAnguloGPS.Size = new System.Drawing.Size(71, 22);
|
||||
this.txtAnguloGPS.TabIndex = 18;
|
||||
this.txtAnguloGPS.Text = "0";
|
||||
this.txtAnguloGPS.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// lblLongitude
|
||||
//
|
||||
this.lblLongitude.AutoSize = true;
|
||||
this.lblLongitude.Location = new System.Drawing.Point(9, 66);
|
||||
this.lblLongitude.Name = "lblLongitude";
|
||||
this.lblLongitude.Size = new System.Drawing.Size(66, 16);
|
||||
this.lblLongitude.TabIndex = 17;
|
||||
this.lblLongitude.Text = "Longitude";
|
||||
//
|
||||
// lblLatitude
|
||||
//
|
||||
this.lblLatitude.AutoSize = true;
|
||||
this.lblLatitude.Location = new System.Drawing.Point(9, 22);
|
||||
this.lblLatitude.Name = "lblLatitude";
|
||||
this.lblLatitude.Size = new System.Drawing.Size(54, 16);
|
||||
this.lblLatitude.TabIndex = 16;
|
||||
this.lblLatitude.Text = "Latitude";
|
||||
//
|
||||
// txtLongitude
|
||||
//
|
||||
this.txtLongitude.Location = new System.Drawing.Point(12, 85);
|
||||
this.txtLongitude.Name = "txtLongitude";
|
||||
this.txtLongitude.Size = new System.Drawing.Size(179, 22);
|
||||
this.txtLongitude.TabIndex = 15;
|
||||
this.txtLongitude.Text = "-47.26406713810977";
|
||||
this.txtLongitude.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// txtLatitude
|
||||
//
|
||||
this.txtLatitude.Location = new System.Drawing.Point(12, 41);
|
||||
this.txtLatitude.Name = "txtLatitude";
|
||||
this.txtLatitude.Size = new System.Drawing.Size(179, 22);
|
||||
this.txtLatitude.TabIndex = 14;
|
||||
this.txtLatitude.Text = "-22.339442335994334";
|
||||
this.txtLatitude.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// btnIniciarGPS
|
||||
//
|
||||
this.btnIniciarGPS.Location = new System.Drawing.Point(307, 38);
|
||||
this.btnIniciarGPS.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.btnIniciarGPS.Name = "btnIniciarGPS";
|
||||
this.btnIniciarGPS.Size = new System.Drawing.Size(99, 28);
|
||||
this.btnIniciarGPS.TabIndex = 13;
|
||||
this.btnIniciarGPS.Text = "Iniciar";
|
||||
this.btnIniciarGPS.UseVisualStyleBackColor = true;
|
||||
this.btnIniciarGPS.Click += new System.EventHandler(this.btnIniciarGPS_Click);
|
||||
//
|
||||
// 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.Controls.Add(this.pnlOrientacaoTrajeto);
|
||||
this.pnlMapa.Location = new System.Drawing.Point(12, 12);
|
||||
this.pnlMapa.Name = "pnlMapa";
|
||||
this.pnlMapa.Size = new System.Drawing.Size(674, 572);
|
||||
this.pnlMapa.TabIndex = 1;
|
||||
//
|
||||
// pnlOrientacaoTrajeto
|
||||
//
|
||||
this.pnlOrientacaoTrajeto.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.pnlOrientacaoTrajeto.BackColor = System.Drawing.Color.White;
|
||||
this.pnlOrientacaoTrajeto.BackgroundImage = global::AgroBase.Properties.Resources.rosa_dos_ventos;
|
||||
this.pnlOrientacaoTrajeto.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||
this.pnlOrientacaoTrajeto.Location = new System.Drawing.Point(567, 2);
|
||||
this.pnlOrientacaoTrajeto.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.pnlOrientacaoTrajeto.Name = "pnlOrientacaoTrajeto";
|
||||
this.pnlOrientacaoTrajeto.Size = new System.Drawing.Size(104, 103);
|
||||
this.pnlOrientacaoTrajeto.TabIndex = 12;
|
||||
this.pnlOrientacaoTrajeto.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlOrientacaoTrajeto_Paint);
|
||||
//
|
||||
// pnlSonar
|
||||
//
|
||||
this.pnlSonar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.pnlSonar.Controls.Add(this.picSonar);
|
||||
this.pnlSonar.Location = new System.Drawing.Point(692, 12);
|
||||
this.pnlSonar.Name = "pnlSonar";
|
||||
this.pnlSonar.Size = new System.Drawing.Size(667, 572);
|
||||
this.pnlSonar.TabIndex = 2;
|
||||
//
|
||||
// picSonar
|
||||
//
|
||||
this.picSonar.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.picSonar.Location = new System.Drawing.Point(0, 0);
|
||||
this.picSonar.Name = "picSonar";
|
||||
this.picSonar.Size = new System.Drawing.Size(667, 572);
|
||||
this.picSonar.TabIndex = 0;
|
||||
this.picSonar.TabStop = false;
|
||||
//
|
||||
// chbSonarVirando
|
||||
//
|
||||
this.chbSonarVirando.AutoSize = true;
|
||||
this.chbSonarVirando.Location = new System.Drawing.Point(165, 84);
|
||||
this.chbSonarVirando.Name = "chbSonarVirando";
|
||||
this.chbSonarVirando.Size = new System.Drawing.Size(117, 20);
|
||||
this.chbSonarVirando.TabIndex = 28;
|
||||
this.chbSonarVirando.Text = "Sonar atuando";
|
||||
this.chbSonarVirando.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chbMoverObstaculo
|
||||
//
|
||||
this.chbMoverObstaculo.AutoSize = true;
|
||||
this.chbMoverObstaculo.Location = new System.Drawing.Point(165, 43);
|
||||
this.chbMoverObstaculo.Name = "chbMoverObstaculo";
|
||||
this.chbMoverObstaculo.Size = new System.Drawing.Size(129, 20);
|
||||
this.chbMoverObstaculo.TabIndex = 29;
|
||||
this.chbMoverObstaculo.Text = "Mover obstáculo";
|
||||
this.chbMoverObstaculo.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// frmSimulacaoMapaGPS
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1371, 713);
|
||||
this.Controls.Add(this.pnlSonar);
|
||||
this.Controls.Add(this.pnlMapa);
|
||||
this.Controls.Add(this.pnlOpcoes);
|
||||
this.Name = "frmSimulacaoMapaGPS";
|
||||
this.Text = "frmSimulacaoMapaGPS";
|
||||
this.Load += new System.EventHandler(this.frmSimulacaoMapaGPS_Load);
|
||||
this.pnlOpcoes.ResumeLayout(false);
|
||||
this.pnlOpcoes.PerformLayout();
|
||||
this.gpbSonar.ResumeLayout(false);
|
||||
this.gpbSonar.PerformLayout();
|
||||
this.gpbGPS.ResumeLayout(false);
|
||||
this.gpbGPS.PerformLayout();
|
||||
this.pnlMapa.ResumeLayout(false);
|
||||
this.pnlSonar.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.picSonar)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel pnlOpcoes;
|
||||
private System.Windows.Forms.Panel pnlMapa;
|
||||
private System.Windows.Forms.Panel pnlSonar;
|
||||
private System.Windows.Forms.GroupBox gpbGPS;
|
||||
private System.Windows.Forms.TextBox txtLatitude;
|
||||
private System.Windows.Forms.Button btnIniciarGPS;
|
||||
private System.Windows.Forms.Label lblLongitude;
|
||||
private System.Windows.Forms.Label lblLatitude;
|
||||
private System.Windows.Forms.TextBox txtLongitude;
|
||||
private System.Windows.Forms.Button btnAcrescentarGPS;
|
||||
private System.Windows.Forms.Label lblDistancia;
|
||||
private System.Windows.Forms.TextBox txtDistanciaGPS;
|
||||
private System.Windows.Forms.Label lblAnguloGPS;
|
||||
private System.Windows.Forms.TextBox txtAnguloGPS;
|
||||
private System.Windows.Forms.Label lblDirecao;
|
||||
private System.Windows.Forms.Label lblStatus;
|
||||
private System.Windows.Forms.GroupBox gpbSonar;
|
||||
private System.Windows.Forms.Button btnAdicionarDeteccao;
|
||||
private System.Windows.Forms.Label lblAnguloFinal;
|
||||
private System.Windows.Forms.TextBox txtAnguloFinal;
|
||||
private System.Windows.Forms.Label lblDistanciaSonar;
|
||||
private System.Windows.Forms.TextBox txtDistanciaSonar;
|
||||
private System.Windows.Forms.Label lblAnguloI;
|
||||
private System.Windows.Forms.TextBox txtAnguloInicial;
|
||||
private System.Windows.Forms.Button btnIniciarSimulacao;
|
||||
private System.Windows.Forms.Label lblDistanciaOperacao;
|
||||
private System.Windows.Forms.Button btnCarregarMapa;
|
||||
private System.Windows.Forms.Panel pnlOrientacaoTrajeto;
|
||||
private System.Windows.Forms.Label lblDistanciaFinal;
|
||||
private System.Windows.Forms.PictureBox picSonar;
|
||||
private System.Windows.Forms.CheckBox chbMoverObstaculo;
|
||||
private System.Windows.Forms.CheckBox chbSonarVirando;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,289 @@
|
|||
using AgroBase.Models;
|
||||
using AgroBase.Services;
|
||||
using CefSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static AgroBase.Models.Enuns;
|
||||
|
||||
namespace AgroBase.Forms
|
||||
{
|
||||
public partial class frmSimulacaoMapaGPS : Form
|
||||
{
|
||||
Timer tmrSonar;
|
||||
|
||||
public frmSimulacaoMapaGPS()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Timer tmr = new Timer() { Interval = 500 };
|
||||
tmr.Tick += Tmr_Tick;
|
||||
tmr.Start();
|
||||
|
||||
tmrSonar = new Timer() { Interval = 100 };
|
||||
tmrSonar.Tick += tmrSonar_Tick;
|
||||
tmrSonar.Start();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void Tmr_Tick(object sender, EventArgs e)
|
||||
{
|
||||
lblStatus.Text = "Status: " + Enum.GetName(typeof(StatusCarroMapa), Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.StatusAtual);
|
||||
lblDirecao.Text = "Direção: " + Enum.GetName(typeof(DirecaoCarroRua), Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.Direcao);
|
||||
lblDistanciaOperacao.Text = "Distância Operação: " + (Variaveis.OperacaoEmAndamento.Mapa == null ? 0 : Variaveis.OperacaoEmAndamento.Mapa.DistanciaTotal).ToString("00.00") + " m";
|
||||
lblDistanciaFinal.Text = "Distância Final: " + (GPSService.DistanciaDoTrecho(Variaveis.OperacaoEmAndamento.Mapa.TrajetoriaDinamica)).ToString("00.00") + " m";
|
||||
|
||||
if (Variaveis.OperacaoEmAndamento.Iniciado)
|
||||
{
|
||||
var StatusCarro = Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.StatusAtual;
|
||||
if (StatusCarro == StatusCarroMapa.Direcionando)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Mapa.GerarCaminhoEntreDoisPontos(Variaveis.OperacaoEmAndamento.Mapa.Trajetoria[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual].First());
|
||||
}
|
||||
else if (StatusCarro == StatusCarroMapa.Manobrando)
|
||||
{
|
||||
//Variaveis.OperacaoEmAndamento.Mapa.GerarCaminhoEntreDoisPontos(Variaveis.OperacaoEmAndamento.Mapa.Trajetoria[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual].First());
|
||||
}
|
||||
|
||||
pnlOrientacaoTrajeto.Invalidate();
|
||||
}
|
||||
else
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.AtualizarRuasSelecionadas();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void frmSimulacaoMapaGPS_Load(object sender, EventArgs e)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Mapa = new MapasModel()
|
||||
{
|
||||
pnlMapa = pnlMapa,
|
||||
};
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal = new SonarModel(picSonar);
|
||||
}
|
||||
|
||||
private void btnCarregar_Click(object sender, EventArgs e)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Mapa.btnCarregar_Click((Control) sender, e);
|
||||
}
|
||||
|
||||
private void btnIniciarGPS_Click(object sender, EventArgs e)
|
||||
{
|
||||
AtualizarPosicaoGPS();
|
||||
btnAcrescentarGPS.Enabled = true;
|
||||
txtAnguloGPS.Enabled = true;
|
||||
txtDistanciaGPS.Enabled = true;
|
||||
btnIniciarGPS.Enabled = false;
|
||||
txtLatitude.Enabled = false;
|
||||
txtLongitude.Enabled = false;
|
||||
}
|
||||
|
||||
private void AtualizarPosicaoGPS()
|
||||
{
|
||||
GPSService.PenultimaLeitura = new GPSModel()
|
||||
{
|
||||
DataHora = GPSService.UltimaLeitura.DataHora,
|
||||
Longitude = GPSService.UltimaLeitura.Longitude,
|
||||
Latitude = GPSService.UltimaLeitura.Latitude,
|
||||
};
|
||||
|
||||
GPSService.UltimaLeitura = new GPSModel()
|
||||
{
|
||||
DataHora = DateTime.Now,
|
||||
Longitude = double.Parse(txtLongitude.Text.Replace(".", ",")),
|
||||
Latitude = double.Parse(txtLatitude.Text.Replace(".", ",")),
|
||||
};
|
||||
|
||||
GPSService.AtualizarCoordenadasGPS();
|
||||
}
|
||||
|
||||
private void btnAcrescentarGPS_Click(object sender, EventArgs e)
|
||||
{
|
||||
double angulo = Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.AnguloCaminho;
|
||||
if (txtAnguloGPS.Text != "")
|
||||
{
|
||||
angulo = double.Parse(txtAnguloGPS.Text);
|
||||
}
|
||||
double distancia = double.Parse(txtDistanciaGPS.Text); // Distância em metros
|
||||
angulo -= 180; // Ângulo em graus
|
||||
|
||||
double latitude = GPSService.UltimaLeitura.Latitude;
|
||||
double longitude = GPSService.UltimaLeitura.Longitude;
|
||||
|
||||
// Conversão de ângulo de graus para radianos
|
||||
double anguloRad = angulo * (Math.PI / 180);
|
||||
|
||||
// Raio da Terra em metros
|
||||
double raioTerra = 6371000;
|
||||
|
||||
// Calcular deslocamento de latitude em radianos
|
||||
double deltaLat = distancia * Math.Cos(anguloRad) / raioTerra;
|
||||
// Converter de radianos para graus
|
||||
double latAtt = latitude + deltaLat * (180 / Math.PI);
|
||||
|
||||
// Calcular deslocamento de longitude em radianos
|
||||
double deltaLong = distancia * Math.Sin(anguloRad) / (raioTerra * Math.Cos(latitude * (Math.PI / 180)));
|
||||
// Converter de radianos para graus
|
||||
double longAtt = longitude + deltaLong * (180 / Math.PI);
|
||||
|
||||
// Atualizar os TextBoxes com as novas coordenadas
|
||||
txtLatitude.Text = latAtt.ToString();
|
||||
txtLongitude.Text = longAtt.ToString();
|
||||
|
||||
AtualizarPosicaoGPS();
|
||||
|
||||
if (chbMoverObstaculo.Checked && ObjetoDetectado && double.TryParse(txtDistanciaSonar.Text, out double distSonar))
|
||||
{
|
||||
distSonar -= (distancia * 100);
|
||||
txtDistanciaSonar.Text = distSonar.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnIniciarSimulacao_Click(object sender, EventArgs e)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Iniciado = !Variaveis.OperacaoEmAndamento.Iniciado;
|
||||
btnIniciarSimulacao.Text = Variaveis.OperacaoEmAndamento.Iniciado ? "Parar Simulação" : "Iniciar Simulação";
|
||||
}
|
||||
|
||||
private void btnCarregarMapa_Click(object sender, EventArgs e)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Mapa.btnCarregar_Click((Control)sender, e);
|
||||
}
|
||||
|
||||
private void pnlOrientacaoTrajeto_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
double angulo = Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.AnguloCaminho;
|
||||
DesenharInclinacao((Panel)sender, e, (float)angulo, -90);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void DesenharInclinacao(Panel pnlBussola, PaintEventArgs e, float anguloInclinacao, float anguloSub)
|
||||
{
|
||||
if (!(anguloInclinacao >= 0 || anguloInclinacao <= 0))
|
||||
{
|
||||
anguloInclinacao = 0;
|
||||
}
|
||||
|
||||
Graphics g = e.Graphics;
|
||||
// Desenha o círculo da bússola
|
||||
int diameter = Math.Min(pnlBussola.Width - 1, pnlBussola.Height - 1);
|
||||
Point centro = new Point((pnlBussola.Width - 1) / 2, (pnlBussola.Height - 1) / 2);
|
||||
//g.DrawEllipse(Pens.Black, centro.X - diameter / 2, centro.Y - diameter / 2, diameter, diameter);
|
||||
|
||||
// Escreve o ângulo no centro do círculo
|
||||
string anguloTexto = $"{anguloInclinacao.ToString("0")}°";
|
||||
Font fonteAngulo = new Font("Arial", 7); // Ajuste o tamanho da fonte conforme necessário
|
||||
SizeF textSize = e.Graphics.MeasureString(anguloTexto, fonteAngulo);
|
||||
|
||||
// Calcula a posição para o texto ser centralizado no círculo
|
||||
float textX = 0;
|
||||
float textY = 0;
|
||||
|
||||
// Define a cor do texto
|
||||
Brush textBrush = Brushes.Black;
|
||||
|
||||
// Desenha o texto no Graphics do painel
|
||||
g.DrawString(anguloTexto, fonteAngulo, textBrush, textX, textY);
|
||||
|
||||
// A linha será desenhada do centro do círculo
|
||||
PointF pontoCentral = new PointF(centro.X, centro.Y);
|
||||
// O comprimento da linha será metade do diâmetro do círculo (raio)
|
||||
float comprimentoLinha = diameter / 3;
|
||||
|
||||
// Ajustar o ângulo para que 0 graus esteja para cima e aumente no sentido horário
|
||||
//float anguloRadianos = (anguloInclinacao - 90) * (float)(Math.PI / 180.0);
|
||||
float anguloRadianos = (anguloInclinacao - anguloSub) * (float)(Math.PI / 180.0);
|
||||
|
||||
// Calcular o ponto final da linha baseado no ângulo de inclinação
|
||||
PointF pontoFinal = new PointF(
|
||||
pontoCentral.X + comprimentoLinha * (float)Math.Cos(anguloRadianos),
|
||||
pontoCentral.Y + comprimentoLinha * (float)Math.Sin(anguloRadianos)
|
||||
);
|
||||
|
||||
// Desenhar a linha de inclinação
|
||||
g.DrawLine(Pens.Red, pontoCentral, pontoFinal);
|
||||
|
||||
// Opcional: Desenhar uma ponta de seta na linha para indicar direção
|
||||
using (AdjustableArrowCap bigArrow = new AdjustableArrowCap(4, 4))
|
||||
{
|
||||
using (Pen pen = new Pen(Color.Red, 2))
|
||||
{
|
||||
pen.CustomEndCap = bigArrow;
|
||||
g.DrawLine(pen, pontoCentral, pontoFinal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool ObjetoDetectado = false;
|
||||
Direcao dirSonar = Direcao.Esquerda;
|
||||
int angulo = 0;
|
||||
int posicao = 1;
|
||||
int distanciaMaxima = 356;
|
||||
private void tmrSonar_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (Variaveis.OperacaoEmAndamento.DispSen.Dados.Conectado && Variaveis.OperacaoEmAndamento.DispSen.Dados.Sensores.Any(x => x.Componente == S_Code.sSNR && x.Inicializado) || !chbSonarVirando.Checked)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int.TryParse(txtAnguloInicial.Text, out int anguloInicial);
|
||||
int.TryParse(txtAnguloFinal.Text, out int anguloFinal);
|
||||
int distancia = ObjetoDetectado && angulo >= anguloInicial && angulo <= anguloFinal ? int.Parse(txtDistanciaSonar.Text) : distanciaMaxima;
|
||||
|
||||
var posArr = Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.Deteccoes.FirstOrDefault(x => x.Posicao == posicao);
|
||||
if (posArr == null)
|
||||
{
|
||||
posArr = new SonarRegistroModel()
|
||||
{
|
||||
Posicao = posicao,
|
||||
Leituras = new List<SonarLeituraModel>()
|
||||
};
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.Deteccoes.Add(posArr);
|
||||
}
|
||||
var leituras = posArr.Leituras;
|
||||
if (leituras.Any(x => x.Angulo == angulo))
|
||||
{
|
||||
leituras.First(x => x.Angulo == angulo).Momento = DateTime.Now;
|
||||
leituras.First(x => x.Angulo == angulo).Distancia = distancia;
|
||||
}
|
||||
else
|
||||
{
|
||||
leituras.Add(new SonarLeituraModel(angulo, distancia));
|
||||
}
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.PosicaoAtual = posicao;
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.AtualizarSonar();
|
||||
|
||||
angulo += dirSonar == Direcao.Esquerda ? SonarModel.anguloAcrescentar : -SonarModel.anguloAcrescentar;
|
||||
|
||||
if (angulo >= 180)
|
||||
{
|
||||
dirSonar = Direcao.Direita;
|
||||
//posArr.Leituras.Clear();
|
||||
}
|
||||
else if (angulo <= 0)
|
||||
{
|
||||
dirSonar = Direcao.Esquerda;
|
||||
//posArr.Leituras.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdicionarDeteccao_Click(object sender, EventArgs e)
|
||||
{
|
||||
ObjetoDetectado = !ObjetoDetectado;
|
||||
btnAdicionarDeteccao.Text = ObjetoDetectado ? "Del" : "Add";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 102 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 220 KiB |
|
|
@ -62,6 +62,7 @@ namespace AgroBase.Models
|
|||
Cfg = 258,
|
||||
Tst = 288,
|
||||
Cmd = 293,
|
||||
Err = 404,
|
||||
}
|
||||
|
||||
public enum S_Code
|
||||
|
|
@ -81,6 +82,7 @@ namespace AgroBase.Models
|
|||
sMAG = 855,
|
||||
sBMB = 325,
|
||||
sLED = 445,
|
||||
sSNR = 532,
|
||||
}
|
||||
|
||||
public enum BotoesJoystick
|
||||
|
|
@ -122,15 +124,22 @@ namespace AgroBase.Models
|
|||
|
||||
public enum StatusOperacao
|
||||
{
|
||||
Parado,
|
||||
NaoIniciado,
|
||||
Parametrizando,
|
||||
Aguardando,
|
||||
Aguardando,
|
||||
EmAndamento,
|
||||
Parado,
|
||||
Concluido
|
||||
}
|
||||
|
||||
public enum StatusCarroMapa
|
||||
{
|
||||
Parado,
|
||||
EntrandoRua,
|
||||
CaminhandoRua,
|
||||
SaindoRua,
|
||||
Manobrando,
|
||||
Retornando,
|
||||
Concluida
|
||||
Manobrando,
|
||||
Direcionando
|
||||
}
|
||||
|
||||
public enum DirecaoCarroRua
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@ namespace AgroBase
|
|||
new DeParaComandos() { key = Keys.Down, Dispositivo = T_Code.Mov, botaoJoy = BotoesJoystick.X, PararAoSoltar = true },
|
||||
new DeParaComandos() { key = Keys.Subtract, Dispositivo = T_Code.Mov, botaoJoy = BotoesJoystick.L1, PararAoSoltar = false },
|
||||
new DeParaComandos() { key = Keys.Add, Dispositivo = T_Code.Mov, botaoJoy = BotoesJoystick.R1, PararAoSoltar = false },
|
||||
new DeParaComandos() { key = Keys.D1, Dispositivo = T_Code.Atu, botaoJoy = BotoesJoystick.L2, PararAoSoltar = true, IDcontrolar = "B01" },
|
||||
new DeParaComandos() { key = Keys.D2, Dispositivo = T_Code.Atu, botaoJoy = BotoesJoystick.L2, PararAoSoltar = true, IDcontrolar = "B02" },
|
||||
new DeParaComandos() { key = Keys.D3, Dispositivo = T_Code.Atu, botaoJoy = BotoesJoystick.R2, PararAoSoltar = true, IDcontrolar = "B03" },
|
||||
new DeParaComandos() { key = Keys.D4, Dispositivo = T_Code.Atu, botaoJoy = BotoesJoystick.R2, PararAoSoltar = true, IDcontrolar = "B04" },
|
||||
};
|
||||
public static List<BotoesJoystick> BotoesJoyPressionados = new List<BotoesJoystick>() { };
|
||||
|
||||
|
|
@ -438,11 +442,6 @@ namespace AgroBase
|
|||
BotoesJoyPressionados.Add(botao.botao);
|
||||
if (DeParaComandos.Any(x => x.botaoJoy == botao.botao))
|
||||
{
|
||||
if (botao.botao == BotoesJoystick.AEEsquerda || botao.botao == BotoesJoystick.AEDireita)
|
||||
{
|
||||
int _Angulo = (int)DeParaAnanlogico(botao.valor, 0, MaximoAnalogico, -Angulo, Angulo);
|
||||
Console.WriteLine(_Angulo);
|
||||
}
|
||||
EnviaComandoMotor(DeParaComandos.FirstOrDefault(x => x.botaoJoy == botao.botao).key);
|
||||
}
|
||||
});
|
||||
|
|
@ -458,7 +457,7 @@ namespace AgroBase
|
|||
|
||||
public static void EnviaComandoMotor(Keys Tecla, T_Code? Disp = null)
|
||||
{
|
||||
if (DispCon.Count == 0 || Variaveis.OperacaoEmAndamento.Modo != ModoOperacao.Manual || !Variaveis.OperacaoEmAndamento.Iniciado)
|
||||
if ((DispCon.Count == 0 || Variaveis.OperacaoEmAndamento.Modo != ModoOperacao.Manual || !Variaveis.OperacaoEmAndamento.Iniciado))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -466,19 +465,24 @@ namespace AgroBase
|
|||
ComandosDispositivo Comando = new ComandosDispositivo()
|
||||
{
|
||||
Momento = DateTime.Now,
|
||||
Comando = Tecla
|
||||
Comando = Tecla,
|
||||
IDcontrolar = DeParaComandos.FirstOrDefault(x => x.key == Tecla)?.IDcontrolar ?? "",
|
||||
};
|
||||
|
||||
Direcao DirecaoAtual = Direcao.Parado;
|
||||
|
||||
// Cancelar Comando Anterior
|
||||
if (Comando.Comando == Keys.Escape)
|
||||
{
|
||||
Comando.Dispositivo = Disp ?? Comandos[Comandos.Count - 1].Dispositivo;
|
||||
var ComandosDisp = Disp == null ? Comandos : Comandos.Where(x => x.Dispositivo == Disp).ToList();
|
||||
Comando.Dispositivo = ComandosDisp[ComandosDisp.Count - 1].Dispositivo;
|
||||
Comando.IDcontrolar = ComandosDisp[ComandosDisp.Count - 1].IDcontrolar;
|
||||
DirecaoAtual = Direcao.Parado;
|
||||
Pressionado = true;
|
||||
|
||||
DispCon.FirstOrDefault(x => x.Dispositivo == Comando.Dispositivo).LimparBufferSerial(true);
|
||||
}
|
||||
// Controle de Velocidade (MOV RPM SP)
|
||||
else if (Comando.Comando == Keys.Add)
|
||||
{
|
||||
Comando.Dispositivo = T_Code.Mov;
|
||||
|
|
@ -493,6 +497,7 @@ namespace AgroBase
|
|||
frmInstancial.frmPrincipal.AtualizaRPM(frmInstancial.frmPrincipal.trkRPM.Value - 1);
|
||||
Pressionado = true;
|
||||
}
|
||||
// Controle Direcao dos Motores BLDC (MOV)
|
||||
else if (Comando.Comando == Keys.Up && UltimaDirecao != Direcao.Frente)
|
||||
{
|
||||
Comando.Dispositivo = T_Code.Mov;
|
||||
|
|
@ -517,6 +522,7 @@ namespace AgroBase
|
|||
DirecaoAtual = Direcao.Direita;
|
||||
Pressionado = true;
|
||||
}
|
||||
// Controle de Rotação dos Motores de Passo (DIR)
|
||||
else if (Comando.Comando == Keys.A && UltimaDirecao != Direcao.Cima)
|
||||
{
|
||||
Comando.Dispositivo = T_Code.Dir;
|
||||
|
|
@ -529,6 +535,13 @@ namespace AgroBase
|
|||
DirecaoAtual = Direcao.Baixo;
|
||||
Pressionado = true;
|
||||
}
|
||||
// Controle dos Bicos Pulverizadores (ATU)
|
||||
else if ((Comando.Comando == Keys.D1 || Comando.Comando == Keys.D2 || Comando.Comando == Keys.D3 || Comando.Comando == Keys.D4) && !Variaveis.OperacaoEmAndamento.DispAtu.Dados.BicosPulverizadores.FirstOrDefault(x => x.ID == Comando.IDcontrolar).Atuado)
|
||||
{
|
||||
Comando.Dispositivo = T_Code.Atu;
|
||||
Pressionado = true;
|
||||
}
|
||||
// Soltar o Botão
|
||||
else
|
||||
{
|
||||
Pressionado = false;
|
||||
|
|
@ -538,7 +551,7 @@ namespace AgroBase
|
|||
{
|
||||
Comandos.Add(Comando);
|
||||
|
||||
for (int i = 0; i < 1; i++)
|
||||
/*for (int i = 0; i < 1; i++)
|
||||
{
|
||||
var Dispositivo = DispCon.FirstOrDefault(x => x.Dispositivo == Comando.Dispositivo);
|
||||
if (Dispositivo != null)
|
||||
|
|
@ -554,6 +567,43 @@ namespace AgroBase
|
|||
}
|
||||
}
|
||||
|
||||
Task.Delay(100);
|
||||
}*/
|
||||
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
List<string> Protocolos = new List<string>();
|
||||
IDispositivosService Dispositivo = default(IDispositivosService);
|
||||
switch (Comando.Dispositivo)
|
||||
{
|
||||
case T_Code.Mov:
|
||||
{
|
||||
Protocolos = Variaveis.OperacaoEmAndamento.DispMov.Dados.Motores.Select(x => x.ProtocoloComando(DirecaoAtual)).ToList();
|
||||
Dispositivo = Variaveis.OperacaoEmAndamento.DispMov;
|
||||
break;
|
||||
}
|
||||
case T_Code.Dir:
|
||||
{
|
||||
Protocolos = Variaveis.OperacaoEmAndamento.DispDir.Dados.Motores.Select(x => x.ProtocoloComando(DirecaoAtual)).ToList();
|
||||
Dispositivo = Variaveis.OperacaoEmAndamento.DispDir;
|
||||
break;
|
||||
}
|
||||
case T_Code.Atu:
|
||||
{
|
||||
var Bico = Variaveis.OperacaoEmAndamento.DispAtu.Dados.BicosPulverizadores.FirstOrDefault(x => x.ID == Comando.IDcontrolar);
|
||||
Bico.Atuado = Comando.Comando == Keys.Escape ? false : true;
|
||||
Protocolos.Add(Bico.ProtocoloComando());
|
||||
Dispositivo = Variaveis.OperacaoEmAndamento.DispAtu;
|
||||
break;
|
||||
}
|
||||
}
|
||||
foreach (var ProtocoloMotor in Protocolos)
|
||||
{
|
||||
Dispositivo.EnviarDadosSerial(ProtocoloMotor);
|
||||
Task.Delay(10);
|
||||
Console.WriteLine(ProtocoloMotor);
|
||||
}
|
||||
|
||||
Task.Delay(100);
|
||||
}
|
||||
|
||||
|
|
@ -576,6 +626,7 @@ namespace AgroBase
|
|||
public DateTime Momento { get; set; }
|
||||
public Keys Comando { get; set; }
|
||||
public T_Code Dispositivo { get; set; }
|
||||
public string IDcontrolar { get; set; }
|
||||
}
|
||||
|
||||
public class DeParaComandos
|
||||
|
|
@ -584,6 +635,7 @@ namespace AgroBase
|
|||
public Keys key { get; set; }
|
||||
public T_Code Dispositivo { get; set; }
|
||||
public bool PararAoSoltar { get; set; }
|
||||
public string IDcontrolar { get; set; }
|
||||
}
|
||||
|
||||
public enum ComparativoAnalogico
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
using AgroBase.Properties;
|
||||
using AgroBase.Services;
|
||||
using CefSharp.WinForms;
|
||||
using Emgu.CV.Features2D;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static AgroBase.Models.Enuns;
|
||||
|
||||
namespace AgroBase.Models
|
||||
{
|
||||
|
|
@ -19,6 +22,7 @@ namespace AgroBase.Models
|
|||
public Label lblMapa { get; set; }
|
||||
public MapasService mapaService { get; set; } = new MapasService();
|
||||
public List<List<GPSModel>> Trajetoria { get; set; } = new List<List<GPSModel>>();
|
||||
public List<GPSModel> TrajetoriaDinamica { get; set; } = new List<GPSModel>();
|
||||
public List<string> RuasPercorrer { get; set; } = new List<string>();
|
||||
public int IdxRuaAtual { get; set; } = 0;
|
||||
public double DistanciaTotal { get; set; } = 0;
|
||||
|
|
@ -94,10 +98,10 @@ namespace AgroBase.Models
|
|||
{
|
||||
double OrientacaoRuas = -999;
|
||||
DistanciaTotal = 0;
|
||||
if (!RuasPercorrer.Any())
|
||||
/*if (!RuasPercorrer.Any())
|
||||
{
|
||||
RuasPercorrer = mapaService.DadosMapa.features.Select(x => x.geometry.id).ToList();
|
||||
}
|
||||
}*/
|
||||
Trajetoria = new List<List<GPSModel>>();
|
||||
|
||||
foreach (var ID in RuasPercorrer)
|
||||
|
|
@ -155,8 +159,271 @@ namespace AgroBase.Models
|
|||
APIService.Parar();
|
||||
GPSService.PararRecepcaoDados();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Método para gerar o caminho entre dois pontos
|
||||
public void GerarCaminhoEntreDoisPontos(GPSModel destino)
|
||||
{
|
||||
//PopularTrajetoriaComOffset(destino);
|
||||
//return;
|
||||
// Inicialização do caminho com o ponto de início
|
||||
GPSModel inicio = GPSService.UltimaLeitura;
|
||||
|
||||
// Gera waypoints intermediários
|
||||
var caminho = GPSService.InterpolarPontos(inicio, destino, 1.0); // 1 metro de distância entre os pontos
|
||||
|
||||
// Limpa a trajetória dinâmica existente e adiciona os novos pontos
|
||||
TrajetoriaDinamica.Clear();
|
||||
caminho.ForEach(x => TrajetoriaDinamica.Add(x));
|
||||
|
||||
if (Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.DesvioNecessario)
|
||||
{
|
||||
AjustarTrajetoriaParaDesvio(Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.ObstaculosDetectados.OrderBy(x => x.DistanciaMedia).First(x => x.DeslocamentoNecessarioDesvio > 0));
|
||||
}
|
||||
|
||||
GPSService.AtualizarTrajetoriaDinamica();
|
||||
}
|
||||
|
||||
public void AjustarTrajetoriaParaDesvio(SonarObstaculoDetectadoModel obstaculo)
|
||||
{
|
||||
GPSModel posicaoAtual = GPSService.UltimaLeitura;
|
||||
|
||||
// Identificar o waypoint mais próximo para iniciar o desvio
|
||||
int indiceInicioDesvio = EncontrarIndiceInicioDesvio(TrajetoriaDinamica, posicaoAtual, ((double)obstaculo.DistanciaMedia / 100));
|
||||
|
||||
// Calcular os waypoints de desvio
|
||||
var waypointsDesvio = CalcularWaypointsDesvio(posicaoAtual, obstaculo, indiceInicioDesvio);
|
||||
|
||||
Console.WriteLine(obstaculo);
|
||||
|
||||
// Determinar o intervalo de waypoints a serem removidos
|
||||
int indiceFinalDesvio = EncontrarIndiceFinalDesvio(TrajetoriaDinamica, waypointsDesvio.Last(), ((double)obstaculo.DistanciaMedia / 100) + ((double)obstaculo.DeslocamentoNecessarioDesvio * 2 / 100));
|
||||
int quantidadeWaypointsRemover = indiceFinalDesvio - indiceInicioDesvio;
|
||||
|
||||
// Remover waypoints obsoletos
|
||||
if (quantidadeWaypointsRemover > 0)
|
||||
{
|
||||
TrajetoriaDinamica.RemoveRange(indiceInicioDesvio + 1, quantidadeWaypointsRemover);
|
||||
}
|
||||
|
||||
// Inserir waypoints de desvio na trajetória
|
||||
TrajetoriaDinamica.InsertRange(indiceInicioDesvio + 1, waypointsDesvio);
|
||||
}
|
||||
|
||||
private int EncontrarIndiceFinalDesvio(List<GPSModel> trajetoria, GPSModel ultimoWaypointDesvio, double distanciaSeguranca)
|
||||
{
|
||||
// Encontrar o índice do waypoint que está imediatamente após o retorno do desvio
|
||||
// Este é um método simplificado. A lógica exata pode variar dependendo da precisão necessária.
|
||||
double distanciaAnterior = 0;
|
||||
for (int i = 0; i < trajetoria.Count; i++)
|
||||
{
|
||||
double distancia = GPSService.DistanciaEntrePontos(trajetoria[i], ultimoWaypointDesvio);
|
||||
bool aumentando = distancia > distanciaAnterior;
|
||||
distanciaAnterior = distancia;
|
||||
if (distancia < distanciaSeguranca)
|
||||
{
|
||||
if (aumentando)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0; // Se não encontrar, assuma o último waypoint
|
||||
}
|
||||
|
||||
private int EncontrarIndiceInicioDesvio(List<GPSModel> trajetoria, GPSModel posicaoAtual, double distanciaObstaculo)
|
||||
{
|
||||
// Este é um método simplificado. Você precisará implementar a lógica para encontrar o waypoint mais adequado.
|
||||
return trajetoria.FindIndex(wp => GPSService.DistanciaEntrePontos(wp, posicaoAtual) < distanciaObstaculo);
|
||||
}
|
||||
|
||||
private List<GPSModel> CalcularWaypointsDesvio(GPSModel posicaoAtual, SonarObstaculoDetectadoModel obstaculo, int indiceInicioDesvio)
|
||||
{
|
||||
List<GPSModel> waypointsDesvio = new List<GPSModel>();
|
||||
|
||||
// Calcular o ângulo e distância para o desvio
|
||||
double anguloDesvio = Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.AnguloCaminho + ((obstaculo.DirecaoDesvio == Enuns.Direcao.Direita ? 270 : 90) + obstaculo.AnguloParaDesvio);
|
||||
double deslocamento = (double)obstaculo.DistanciaMedia / 100; // Math.Sqrt(Math.Pow(((double)obstaculo.DeslocamentoNecessarioDesvio / 100), 2) + Math.Pow(((double)obstaculo.DistanciaMedia / 100), 2));
|
||||
|
||||
// Waypoint de início do desvio
|
||||
GPSModel waypointInicioDesvio = CalcularNovoWaypoint(posicaoAtual, anguloDesvio, deslocamento);
|
||||
waypointsDesvio.Add(waypointInicioDesvio);
|
||||
|
||||
// Waypoint de contorno do obstáculo
|
||||
double anguloContorno = 270 - Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.AnguloCaminho; // Ajustar conforme a orientação do desvio
|
||||
GPSModel waypointContornoObstaculo = CalcularNovoWaypoint(waypointInicioDesvio, anguloContorno, ((double)obstaculo.Largura / 100)); //((double)obstaculo.Largura / 100)
|
||||
waypointsDesvio.Add(waypointContornoObstaculo);
|
||||
|
||||
// Waypoint de retorno à trajetória
|
||||
double anguloRetorno = Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.AnguloCaminho + ((obstaculo.DirecaoDesvio == Enuns.Direcao.Direita ? 90 : 270) - obstaculo.AnguloParaDesvio); //anguloDesvio - obstaculo.AnguloParaDesvio - 180;// Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.AnguloCaminho + (obstaculo.AnguloParaDesvio); // Pode precisar ajustar baseado na orientação do desvio
|
||||
GPSModel waypointRetorno = CalcularNovoWaypoint(waypointContornoObstaculo, anguloRetorno, deslocamento);
|
||||
waypointsDesvio.Add(waypointRetorno);
|
||||
|
||||
return waypointsDesvio;
|
||||
}
|
||||
|
||||
private GPSModel CalcularNovoWaypoint(GPSModel posicaoAtual, double angulo, double distancia)
|
||||
{
|
||||
double anguloRad = FuncoesGlobais.ConvertDegreesToRadians(angulo);
|
||||
double deltaLatitude = Math.Cos(anguloRad) * distancia / 111111; // Conversão para graus
|
||||
double deltaLongitude = Math.Sin(anguloRad) * distancia / (111111 * Math.Cos(FuncoesGlobais.ConvertDegreesToRadians(posicaoAtual.Latitude)));
|
||||
|
||||
return new GPSModel
|
||||
{
|
||||
Latitude = posicaoAtual.Latitude + deltaLatitude,
|
||||
Longitude = posicaoAtual.Longitude + deltaLongitude
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void PopularTrajetoriaComOffset(GPSModel destino)
|
||||
{
|
||||
if (mapaService.DadosMapa != null)
|
||||
{
|
||||
GPSModel inicio = GPSService.UltimaLeitura;
|
||||
|
||||
// Coleta os primeiros pontos de cada rua com base na orientação e posição atual do robô
|
||||
var pontosExtremosComOffset = new List<GPSModel>();
|
||||
|
||||
foreach (var rua in mapaService.DadosMapa.features)
|
||||
{
|
||||
var primeiroPonto = new GPSModel()
|
||||
{
|
||||
Latitude = rua.geometry.coordinates.First()[1],
|
||||
Longitude = rua.geometry.coordinates.First()[0]
|
||||
};
|
||||
var ultimoPonto = new GPSModel()
|
||||
{
|
||||
Latitude = rua.geometry.coordinates.Last()[1],
|
||||
Longitude = rua.geometry.coordinates.Last()[0]
|
||||
};
|
||||
GPSModel pontoInicial = new GPSModel();
|
||||
GPSModel pontoSecundario = new GPSModel();
|
||||
|
||||
if (GPSService.DistanciaEntrePontos(inicio, primeiroPonto) < GPSService.DistanciaEntrePontos(inicio, ultimoPonto))
|
||||
{
|
||||
pontoInicial = primeiroPonto;
|
||||
pontoSecundario = new GPSModel()
|
||||
{
|
||||
Latitude = rua.geometry.coordinates.Skip(1).First()[1],
|
||||
Longitude = rua.geometry.coordinates.Skip(1).First()[0]
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
pontoInicial = ultimoPonto;
|
||||
pontoSecundario = new GPSModel()
|
||||
{
|
||||
Latitude = rua.geometry.coordinates.Skip(rua.geometry.coordinates.Count - 2).First()[1],
|
||||
Longitude = rua.geometry.coordinates.Skip(rua.geometry.coordinates.Count - 2).First()[0]
|
||||
};
|
||||
}
|
||||
|
||||
var orientacaoRua = GPSService.CalcularOrientacao(pontoInicial, pontoSecundario);
|
||||
|
||||
// Calcula o ponto com offset baseado no ângulo oposto à orientação da rua
|
||||
var anguloOffset = (orientacaoRua + 180) % 360;
|
||||
var distanciaOffset = 10; // Defina o offset desejado aqui
|
||||
|
||||
// Adiciona o ponto com offset à lista
|
||||
pontosExtremosComOffset.Add(new GPSModel
|
||||
{
|
||||
Latitude = pontoInicial.Latitude,// + (Math.Cos(anguloOffset * (Math.PI / 180)) * distanciaOffset),
|
||||
Longitude = pontoInicial.Longitude// + (Math.Sin(anguloOffset * (Math.PI / 180)) * distanciaOffset),
|
||||
});
|
||||
}
|
||||
|
||||
var pontosRelevantes = FiltrarPontosRelevantes(inicio, destino, pontosExtremosComOffset);
|
||||
|
||||
// Ordena os pontos com offset pela proximidade com a posição atual
|
||||
var pontosOrdenados = pontosRelevantes.OrderBy(p => GPSService.DistanciaEntrePontos(inicio, p)).ToList();
|
||||
|
||||
// Agora, conecta os pontos ordenados para formar a trajetória
|
||||
TrajetoriaDinamica.Clear();
|
||||
GPSModel pontoAnterior = inicio;
|
||||
foreach (var ponto in pontosOrdenados)
|
||||
{
|
||||
//var caminho = GPSService.InterpolarPontos(pontoAnterior, ponto, 1.0);
|
||||
//caminho.ForEach(x => TrajetoriaDinamica.Add(x));
|
||||
//pontoAnterior = ponto;
|
||||
TrajetoriaDinamica.Add(ponto);
|
||||
}
|
||||
|
||||
// Atualiza a trajetória dinâmica
|
||||
GPSService.AtualizarTrajetoriaDinamica();
|
||||
}
|
||||
}
|
||||
private List<GPSModel> FiltrarPontosRelevantes(GPSModel inicio, GPSModel destino, List<GPSModel> todasRuas)
|
||||
{
|
||||
var ruasRelevantes = new List<GPSModel>();
|
||||
|
||||
// Define os limites do quadrante
|
||||
double minLatitude = Math.Min(inicio.Latitude, destino.Latitude);
|
||||
double maxLatitude = Math.Max(inicio.Latitude, destino.Latitude);
|
||||
double minLongitude = Math.Min(inicio.Longitude, destino.Longitude);
|
||||
double maxLongitude = Math.Max(inicio.Longitude, destino.Longitude);
|
||||
|
||||
// Filtra previamente os pontos que estão dentro do quadrante definido
|
||||
var pontosNoQuadrante = todasRuas.Where(ponto => ponto.Latitude >= minLatitude && ponto.Latitude <= maxLatitude
|
||||
&& ponto.Longitude >= minLongitude && ponto.Longitude <= maxLongitude).ToList();
|
||||
|
||||
// Continua a filtragem dos pontos relevantes como antes, mas agora apenas com os pontos dentro do quadrante
|
||||
GPSModel pontoMaisProximoInicio = IdentificarPontoMaisProximo(inicio, pontosNoQuadrante);
|
||||
if (pontoMaisProximoInicio != null && !ruasRelevantes.Contains(pontoMaisProximoInicio))
|
||||
{
|
||||
ruasRelevantes.Add(pontoMaisProximoInicio);
|
||||
}
|
||||
|
||||
GPSModel ultimoPontoRelevante = pontoMaisProximoInicio;
|
||||
|
||||
foreach (var ponto in pontosNoQuadrante)
|
||||
{
|
||||
if (ponto.Equals(inicio) || ponto.Equals(pontoMaisProximoInicio)) continue;
|
||||
|
||||
double margem = 20;
|
||||
double distanciaPontoAnterior = GPSService.DistanciaEntrePontos(ultimoPontoRelevante, destino);
|
||||
double distanciaPontoAtual = GPSService.DistanciaEntrePontos(ponto, destino);
|
||||
double diferenca = (distanciaPontoAnterior - distanciaPontoAtual);
|
||||
bool relevante = diferenca > 0 && diferenca < margem;
|
||||
|
||||
if (relevante || distanciaPontoAtual == 0 || true)
|
||||
{
|
||||
ruasRelevantes.Add(ponto);
|
||||
ultimoPontoRelevante = ponto;
|
||||
}
|
||||
|
||||
if (distanciaPontoAtual == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ruasRelevantes;
|
||||
}
|
||||
|
||||
// Método auxiliar para identificar o ponto mais próximo a um dado ponto de referência
|
||||
private GPSModel IdentificarPontoMaisProximo(GPSModel referencia, List<GPSModel> pontos)
|
||||
{
|
||||
GPSModel pontoMaisProximo = null;
|
||||
double distanciaMinima = double.MaxValue;
|
||||
|
||||
foreach (var ponto in pontos)
|
||||
{
|
||||
double distancia = GPSService.DistanciaEntrePontos(referencia, ponto);
|
||||
if (distancia < distanciaMinima)
|
||||
{
|
||||
distanciaMinima = distancia;
|
||||
pontoMaisProximo = ponto;
|
||||
}
|
||||
}
|
||||
|
||||
return pontoMaisProximo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class MapaFeatureCollectionModel
|
||||
|
|
|
|||
|
|
@ -14,10 +14,9 @@ namespace AgroBase.Models.Modules
|
|||
{
|
||||
public static int _TaxaAmostragem { get; set; } = 500;
|
||||
public bool Conectado { get; set; } = false;
|
||||
public static List<PinoutModel> Pinout { get; set; }
|
||||
public static PinoutDataModel Pinout { get; set; }
|
||||
public static List<FuncoesPinout> Funcoes { get; set; } = new List<FuncoesPinout>()
|
||||
{
|
||||
FuncoesPinout.Geral,
|
||||
{
|
||||
FuncoesPinout.SDA,
|
||||
FuncoesPinout.SCL,
|
||||
};
|
||||
|
|
@ -239,8 +238,7 @@ namespace AgroBase.Models.Modules
|
|||
"MD".PadRight(5, ' ') + ";" + // 0 ~ 4
|
||||
(Conectar ? "1" : "0") + ";" + // 6
|
||||
_TaxaAmostragem.ToString("00000") + ";" + // 8 ~ 12
|
||||
(Pinout.Any(x => x.Funcao == FuncoesPinout.Geral) ? Pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.Geral).Pino.ToString("00") : "-1") + ";" + // 14 ~ 15
|
||||
(AtuacaoNivelAlto ? "1" : "0"); // 17
|
||||
(AtuacaoNivelAlto ? "1" : "0"); // 14
|
||||
Config.Add(ProtocoloMOD);
|
||||
return Config;
|
||||
}
|
||||
|
|
@ -324,7 +322,7 @@ namespace AgroBase.Models.Modules
|
|||
double periodoAtual = Sensor.Leituras.Any() ? (double)_LeituraPeriodo - Sensor.Leituras[1] : (double)_LeituraPeriodo;
|
||||
VolumeVazaoML += (VazaoFluxoMLpS) * (periodoAtual / 1000);
|
||||
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.HerbicidaConsumido = (VolumeVazaoML / 1000);
|
||||
Variaveis.OperacaoEmAndamento.OpMapaGPS.Sensoriamento.HerbicidaConsumido = (VolumeVazaoML / 1000);
|
||||
}
|
||||
|
||||
Sensor.Leituras = new List<double>()
|
||||
|
|
@ -419,23 +417,6 @@ namespace AgroBase.Models.Modules
|
|||
|
||||
}
|
||||
|
||||
public List<PinoutModel> CarregarPinout(string nomeArquivo)
|
||||
{
|
||||
if (!File.Exists(nomeArquivo))
|
||||
{
|
||||
var newPinout = PinoutModel.CarregarPinoutPadrao_S3();
|
||||
File.WriteAllText(nomeArquivo, JsonConvert.SerializeObject(newPinout));
|
||||
}
|
||||
var pinoutText = File.ReadAllText(nomeArquivo);
|
||||
Pinout = JsonConvert.DeserializeObject<PinoutModel[]>(pinoutText).ToList();
|
||||
return Pinout;
|
||||
}
|
||||
|
||||
public void SalvarPinout(List<PinoutModel> newPinout, string nomeArquivo)
|
||||
{
|
||||
File.WriteAllText(nomeArquivo, JsonConvert.SerializeObject(newPinout));
|
||||
}
|
||||
|
||||
public void IniciarRegistrador()
|
||||
{
|
||||
|
||||
|
|
@ -457,13 +438,19 @@ namespace AgroBase.Models.Modules
|
|||
|
||||
public string ProtocoloConfiguracaoBico(bool Conectar)
|
||||
{
|
||||
var _pinout = AtuadorModel.Pinout.Where(x => x.ComponenteID == ID).ToList();
|
||||
var _pinout = new PinoutDataModel()
|
||||
{
|
||||
ExpansorGPIO = AtuadorModel.Pinout.ExpansorGPIO,
|
||||
EnderecoExpansor = AtuadorModel.Pinout.EnderecoExpansor,
|
||||
Pinos = AtuadorModel.Pinout.Pinos.ToList(),
|
||||
};
|
||||
_pinout.Pinos = _pinout.Pinos.Where(x => x.ComponenteID == ID).ToList();
|
||||
return ((int)F_Code.Cfg).ToString() +
|
||||
ID.PadRight(5, ' ') + ";" + // 0 ~ 2
|
||||
(Conectar ? "1" : "0") + ";" + // 4
|
||||
(Comandar ? "1" : "0") + ";" + // 6
|
||||
Posicao.ToString("00") + ";" + // 8 ~ 9
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.Solenoide) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.Solenoide).Pino.ToString("00") : "-1"); // 11 ~ 12
|
||||
PinoutModel.PinoProtocolo(_pinout, Funcoes); // 11 ~ 13
|
||||
}
|
||||
|
||||
public string ProtocoloComando()
|
||||
|
|
@ -527,17 +514,19 @@ namespace AgroBase.Models.Modules
|
|||
|
||||
public string ProtocoloConfiguracaoBomba(bool Conectar)
|
||||
{
|
||||
var _pinout = AtuadorModel.Pinout.Where(x => x.ComponenteID == ID).ToList();
|
||||
var _pinout = new PinoutDataModel()
|
||||
{
|
||||
ExpansorGPIO = AtuadorModel.Pinout.ExpansorGPIO,
|
||||
EnderecoExpansor = AtuadorModel.Pinout.EnderecoExpansor,
|
||||
Pinos = AtuadorModel.Pinout.Pinos.ToList(),
|
||||
};
|
||||
_pinout.Pinos = _pinout.Pinos.Where(x => x.ComponenteID == ID).ToList();
|
||||
return ((int)F_Code.Cfg).ToString() +
|
||||
ID.PadRight(5, ' ') + ";" + // 0 ~ 4
|
||||
(Conectar ? "1" : "0") + ";" + // 6
|
||||
(Comandar ? "1" : "0") + ";" + // 8
|
||||
PressaoSP.ToString("000") + ";" + // 10 ~ 12
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.ENA) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.ENA).Pino.ToString("00") : "-1") + ";" + // 14 ~ 15
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.CS) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.CS).Pino.ToString("00") : "-1") + ";" + // 17 ~ 18
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.INA) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.INA).Pino.ToString("00") : "-1") + ";" + // 20 ~ 21
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.INB) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.INB).Pino.ToString("00") : "-1") + ";" + // 23 ~ 24
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.PWM) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.PWM).Pino.ToString("00") : "-1"); // 26 ~ 27
|
||||
PinoutModel.PinoProtocolo(_pinout, Funcoes); // 14 ~ 32
|
||||
}
|
||||
|
||||
public string ProtocoloComando()
|
||||
|
|
|
|||
|
|
@ -21,8 +21,12 @@ namespace AgroBase.Models.Modules
|
|||
public bool AA_Ref090 { get; set; } = false;
|
||||
public bool AA_Ref270 { get; set; } = false;
|
||||
public static int LogsManter { get; set; } = 60;
|
||||
public static List<PinoutModel> Pinout { get; set; }
|
||||
public static List<FuncoesPinout> Funcoes { get; set; } = new List<FuncoesPinout>() { FuncoesPinout.Geral };
|
||||
public static PinoutDataModel Pinout { get; set; }
|
||||
public static List<FuncoesPinout> Funcoes { get; set; } = new List<FuncoesPinout>()
|
||||
{
|
||||
FuncoesPinout.SDA,
|
||||
FuncoesPinout.SCL
|
||||
};
|
||||
public List<DirSensoriamentoMotor> Motores { get; set; }
|
||||
|
||||
|
||||
|
|
@ -128,10 +132,9 @@ namespace AgroBase.Models.Modules
|
|||
"MD" + ";" + // 0 ~ 1
|
||||
(Conectar ? "1" : "0") + ";" + // 3
|
||||
_TaxaAmostragem.ToString("00000") + ";" + // 5 ~ 9
|
||||
(Pinout.Any(x => x.Funcao == FuncoesPinout.Geral) ? Pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.Geral).Pino.ToString("00") : "-1") + ";" + // 11 ~ 12
|
||||
(AA_Ref000 ? "1" : "0") + ";" + // 14
|
||||
(AA_Ref090 ? "1" : "0") + ";" + // 16
|
||||
(AA_Ref270 ? "1" : "0"); // 18
|
||||
(AA_Ref000 ? "1" : "0") + ";" + // 11
|
||||
(AA_Ref090 ? "1" : "0") + ";" + // 13
|
||||
(AA_Ref270 ? "1" : "0"); // 15
|
||||
Config.Add(ProtocoloMOD);
|
||||
return Config;
|
||||
}
|
||||
|
|
@ -275,19 +278,24 @@ namespace AgroBase.Models.Modules
|
|||
|
||||
}
|
||||
|
||||
public List<PinoutModel> CarregarPinout(string nomeArquivo)
|
||||
public PinoutDataModel CarregarPinout(string nomeArquivo)
|
||||
{
|
||||
if (!File.Exists(nomeArquivo))
|
||||
{
|
||||
var newPinout = PinoutModel.CarregarPinoutPadrao_S3();
|
||||
var newPinout = new PinoutDataModel()
|
||||
{
|
||||
ExpansorGPIO = false,
|
||||
EnderecoExpansor = "",
|
||||
Pinos = PinoutModel.CarregarPinoutPadrao_S3(),
|
||||
};
|
||||
File.WriteAllText(nomeArquivo, JsonConvert.SerializeObject(newPinout));
|
||||
}
|
||||
var pinoutText = File.ReadAllText(nomeArquivo);
|
||||
Pinout = JsonConvert.DeserializeObject<PinoutModel[]>(pinoutText).ToList();
|
||||
Pinout = JsonConvert.DeserializeObject<PinoutDataModel>(pinoutText);
|
||||
return Pinout;
|
||||
}
|
||||
|
||||
public void SalvarPinout(List<PinoutModel> newPinout, string nomeArquivo)
|
||||
public void SalvarPinout(PinoutDataModel newPinout, string nomeArquivo)
|
||||
{
|
||||
File.WriteAllText(nomeArquivo, JsonConvert.SerializeObject(newPinout));
|
||||
}
|
||||
|
|
@ -330,7 +338,13 @@ namespace AgroBase.Models.Modules
|
|||
|
||||
public string ProtocoloConfiguracaoMotor(bool Conectar)
|
||||
{
|
||||
var _pinout = DirecionalModel.Pinout.Where(x => x.ComponenteID == ID).ToList();
|
||||
var _pinout = new PinoutDataModel()
|
||||
{
|
||||
ExpansorGPIO = DirecionalModel.Pinout.ExpansorGPIO,
|
||||
EnderecoExpansor = DirecionalModel.Pinout.EnderecoExpansor,
|
||||
Pinos = DirecionalModel.Pinout.Pinos.ToList(),
|
||||
};
|
||||
_pinout.Pinos = _pinout.Pinos.Where(x => x.ComponenteID == ID).ToList();
|
||||
return ((int)F_Code.Cfg).ToString() +
|
||||
ID + ";" + // 0 ~ 1
|
||||
(Conectar ? "1" : "0") + ";" + // 3
|
||||
|
|
@ -338,20 +352,13 @@ namespace AgroBase.Models.Modules
|
|||
(Comandar ? "1" : "0") + ";" + // 7
|
||||
(Estabilizar ? "1" : "0") + ";" + // 9
|
||||
(Referenciar ? "1" : "0") + ";" + // 11
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.PUL) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.PUL).Pino.ToString("00") : "-1") + "," + // 13 ~ 14
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.DIR) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.DIR).Pino.ToString("00") : "-1") + "," + // 16 ~ 17
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.ENA) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.ENA).Pino.ToString("00") : "-1") + "," + // 19 ~ 20
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.EncoderA) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.EncoderA).Pino.ToString("00") : "-1") + "," + // 22 ~ 23
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.EncoderB) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.EncoderB).Pino.ToString("00") : "-1") + "," + // 25 ~ 26
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.REF000) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.REF000).Pino.ToString("00") : "-1") + "," + // 28 ~ 29
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.REF090) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.REF090).Pino.ToString("00") : "-1") + "," + // 31 ~ 32
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.REF270) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.REF270).Pino.ToString("00") : "-1") + ";" + // 34 ~ 35
|
||||
Angulo_Offset.ToString(Angulo_Offset < 0 ? "000" : "0000"); // 37 ~ 40
|
||||
Angulo_Offset.ToString(Angulo_Offset < 0 ? "000" : "0000") + ";" + // 13 ~ 16
|
||||
PinoutModel.PinoProtocolo(_pinout, Funcoes); // 18 ~ 48
|
||||
}
|
||||
|
||||
public string ProtocoloComando(Direcao Direcao, bool _Ref = false)
|
||||
{
|
||||
if (Comandar && Controlar)
|
||||
if (Comandar && (Controlar))
|
||||
{
|
||||
Sentido_SP =
|
||||
Direcao == Direcao.Cima ? ConfigSentidos.Direita :
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ namespace AgroBase.Models
|
|||
List<string> ProtocoloConfiguracao(bool Conectar);
|
||||
void PopulaGridSensoriamento();
|
||||
void AtualizaGridSensoriamento();
|
||||
List<PinoutModel> CarregarPinout(string nomeArquivo);
|
||||
void SalvarPinout(List<PinoutModel> newPinout, string nomeArquivo);
|
||||
void IniciarRegistrador();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ namespace AgroBase.Models
|
|||
public static double DiametroRoda { get; set; } = 0.3556;
|
||||
public bool Conectado { get; set; } = false;
|
||||
public static int LogsManter { get; set; } = 60;
|
||||
public static List<PinoutModel> Pinout { get; set; }
|
||||
public static List<FuncoesPinout> Funcoes { get; set; } = new List<FuncoesPinout>() { FuncoesPinout.Geral };
|
||||
public static PinoutDataModel Pinout { get; set; }
|
||||
public static List<FuncoesPinout> Funcoes { get; set; } = new List<FuncoesPinout>();
|
||||
public List<MovSensoriamentoMotor> Motores { get; set; }
|
||||
public static Direcao UltimaDirecao { get; set; } = Direcao.Parado;
|
||||
public int TempoEmAtividade { get; set; } = 0;
|
||||
|
|
@ -59,12 +59,12 @@ namespace AgroBase.Models
|
|||
},
|
||||
Funcoes = new List<FuncoesPinout>() {
|
||||
FuncoesPinout.PWM,
|
||||
FuncoesPinout.HallA,
|
||||
FuncoesPinout.HallB,
|
||||
FuncoesPinout.HallC,
|
||||
FuncoesPinout.DIR,
|
||||
FuncoesPinout.BRK,
|
||||
FuncoesPinout.STP,
|
||||
FuncoesPinout.HallA,
|
||||
FuncoesPinout.HallB,
|
||||
FuncoesPinout.HallC,
|
||||
FuncoesPinout.TMP,
|
||||
}
|
||||
},
|
||||
|
|
@ -80,12 +80,12 @@ namespace AgroBase.Models
|
|||
},
|
||||
Funcoes = new List<FuncoesPinout>() {
|
||||
FuncoesPinout.PWM,
|
||||
FuncoesPinout.HallA,
|
||||
FuncoesPinout.HallB,
|
||||
FuncoesPinout.HallC,
|
||||
FuncoesPinout.DIR,
|
||||
FuncoesPinout.BRK,
|
||||
FuncoesPinout.STP,
|
||||
FuncoesPinout.HallA,
|
||||
FuncoesPinout.HallB,
|
||||
FuncoesPinout.HallC,
|
||||
FuncoesPinout.TMP,
|
||||
}
|
||||
},
|
||||
|
|
@ -101,12 +101,12 @@ namespace AgroBase.Models
|
|||
},
|
||||
Funcoes = new List<FuncoesPinout>() {
|
||||
FuncoesPinout.PWM,
|
||||
FuncoesPinout.HallA,
|
||||
FuncoesPinout.HallB,
|
||||
FuncoesPinout.HallC,
|
||||
FuncoesPinout.DIR,
|
||||
FuncoesPinout.BRK,
|
||||
FuncoesPinout.STP,
|
||||
FuncoesPinout.HallA,
|
||||
FuncoesPinout.HallB,
|
||||
FuncoesPinout.HallC,
|
||||
FuncoesPinout.TMP,
|
||||
}
|
||||
},
|
||||
|
|
@ -122,12 +122,12 @@ namespace AgroBase.Models
|
|||
},
|
||||
Funcoes = new List<FuncoesPinout>() {
|
||||
FuncoesPinout.PWM,
|
||||
FuncoesPinout.HallA,
|
||||
FuncoesPinout.HallB,
|
||||
FuncoesPinout.HallC,
|
||||
FuncoesPinout.DIR,
|
||||
FuncoesPinout.BRK,
|
||||
FuncoesPinout.STP,
|
||||
FuncoesPinout.HallA,
|
||||
FuncoesPinout.HallB,
|
||||
FuncoesPinout.HallC,
|
||||
FuncoesPinout.TMP,
|
||||
}
|
||||
}
|
||||
|
|
@ -142,13 +142,12 @@ namespace AgroBase.Models
|
|||
"MD" + ";" + // 0 ~ 1
|
||||
(Conectar ? "1" : "0") + ";" + // 3
|
||||
_TaxaAmostragem.ToString("00000") + ";" + // 5 ~ 9
|
||||
(Pinout.Any(x => x.Funcao == FuncoesPinout.Geral) ? Pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.Geral).Pino.ToString("00") : "-1") + ";" + // 11 ~ 12
|
||||
RampaMin.ToString("0000") + ";" + // 14 ~ 17
|
||||
RampaMax.ToString("0000") + ";" + // 19 ~ 22
|
||||
PulsosPorRevolucao.ToString("000") + ";" + // 24 ~ 26
|
||||
_DelayBalanceamento.ToString("00000") + ";" + // 28 ~ 32
|
||||
_MargemRPM.ToString("00") + ";" + // 34 ~ 35
|
||||
_MaxOffsetRPM.ToString("00"); // 37 ~ 38
|
||||
RampaMin.ToString("0000") + ";" + // 11 ~ 14
|
||||
RampaMax.ToString("0000") + ";" + // 16 ~ 19
|
||||
PulsosPorRevolucao.ToString("000") + ";" + // 21 ~ 23
|
||||
_DelayBalanceamento.ToString("00000") + ";" + // 25 ~ 29
|
||||
_MargemRPM.ToString("00") + ";" + // 31 ~ 32
|
||||
_MaxOffsetRPM.ToString("00"); // 34 ~ 35
|
||||
Config.Add(ProtocoloMOD);
|
||||
return Config;
|
||||
}
|
||||
|
|
@ -365,23 +364,6 @@ namespace AgroBase.Models
|
|||
}
|
||||
}
|
||||
|
||||
public List<PinoutModel> CarregarPinout(string nomeArquivo)
|
||||
{
|
||||
if (!File.Exists(nomeArquivo))
|
||||
{
|
||||
var newPinout = PinoutModel.CarregarPinoutPadrao_S3();
|
||||
File.WriteAllText(nomeArquivo, JsonConvert.SerializeObject(newPinout));
|
||||
}
|
||||
var pinoutText = File.ReadAllText(nomeArquivo);
|
||||
Pinout = JsonConvert.DeserializeObject<PinoutModel[]>(pinoutText).ToList();
|
||||
return Pinout;
|
||||
}
|
||||
|
||||
public void SalvarPinout(List<PinoutModel> newPinout, string nomeArquivo)
|
||||
{
|
||||
File.WriteAllText(nomeArquivo, JsonConvert.SerializeObject(newPinout));
|
||||
}
|
||||
|
||||
public void IniciarRegistrador()
|
||||
{
|
||||
tmrRegistrador = new Timer()
|
||||
|
|
@ -417,6 +399,10 @@ namespace AgroBase.Models
|
|||
return RPM;
|
||||
}
|
||||
|
||||
public static double ConverteKmhParaMs(double Velocidade)
|
||||
{
|
||||
return Velocidade / 3.6;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -455,7 +441,13 @@ namespace AgroBase.Models
|
|||
|
||||
public string ProtocoloConfiguracaoMotor(bool Conectar)
|
||||
{
|
||||
var _pinout = MovimentacaoModel.Pinout.Where(x => x.ComponenteID == ID).ToList();
|
||||
var _pinout = new PinoutDataModel()
|
||||
{
|
||||
ExpansorGPIO = MovimentacaoModel.Pinout.ExpansorGPIO,
|
||||
EnderecoExpansor = MovimentacaoModel.Pinout.EnderecoExpansor,
|
||||
Pinos = MovimentacaoModel.Pinout.Pinos.ToList(),
|
||||
};
|
||||
_pinout.Pinos = _pinout.Pinos.Where(x => x.ComponenteID == ID).ToList();
|
||||
return ((int)F_Code.Cfg).ToString() +
|
||||
ID + ";" + // 0 ~ 1
|
||||
(Conectar ? "1" : "0") + ";" + // 3
|
||||
|
|
@ -465,14 +457,7 @@ namespace AgroBase.Models
|
|||
MovimentacaoModel.Kp.ToString("0.000").Replace(",", ".") + "," + // 11 ~ 15
|
||||
MovimentacaoModel.Ki.ToString("0.000").Replace(",", ".") + "," + // 17 ~ 21
|
||||
MovimentacaoModel.Kd.ToString("0.000").Replace(",", ".") + "," + // 23 ~ 27
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.PWM) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.PWM).Pino.ToString("00") : "-1") + "," + // 29 ~ 30
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.DIR) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.DIR).Pino.ToString("00") : "-1") + "," + // 32 ~ 33
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.BRK) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.BRK).Pino.ToString("00") : "-1") + "," + // 35 ~ 36
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.STP) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.STP).Pino.ToString("00") : "-1") + "," + // 38 ~ 39
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.HallA) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.HallA).Pino.ToString("00") : "-1") + "," + // 41 ~ 42
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.HallB) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.HallB).Pino.ToString("00") : "-1") + "," + // 44 ~ 45
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.HallC) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.HallC).Pino.ToString("00") : "-1") + "," + // 47 ~ 48
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.TMP) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.TMP).Pino.ToString("00") : "-1"); // 50 ~ 51
|
||||
PinoutModel.PinoProtocolo(_pinout, Funcoes); // 29 ~ 51
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,9 +8,17 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace AgroBase.Models.Modules
|
||||
{
|
||||
public class PinoutDataModel
|
||||
{
|
||||
public bool ExpansorGPIO { get; set; }
|
||||
public string EnderecoExpansor { get; set; }
|
||||
public List<PinoutModel> Pinos { get; set; }
|
||||
}
|
||||
|
||||
public class PinoutModel
|
||||
{
|
||||
public TiposControladores Tipo { get;set; }
|
||||
public TiposControladores Controlador { get;set; }
|
||||
public TiposBarramentos Barramento { get;set; }
|
||||
public int Pino { get; set; }
|
||||
public string Descricao { get; set; }
|
||||
public FuncoesPinout Funcao { get; set; }
|
||||
|
|
@ -122,50 +130,50 @@ namespace AgroBase.Models.Modules
|
|||
{
|
||||
List<PinoutModel> Pinout = new List<PinoutModel>()
|
||||
{
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 99, ComponenteID = "", Descricao = "1", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 98, ComponenteID = "", Descricao = "2", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 97, ComponenteID = "", Descricao = "3", Funcao = FuncoesPinout.NaoConectado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 4, ComponenteID = "", Descricao = "4", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 5, ComponenteID = "", Descricao = "5", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 6, ComponenteID = "", Descricao = "6", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 7, ComponenteID = "", Descricao = "7", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 15, ComponenteID = "", Descricao = "8", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 16, ComponenteID = "", Descricao = "9", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 17, ComponenteID = "", Descricao = "10", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 18, ComponenteID = "", Descricao = "11", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 8, ComponenteID = "", Descricao = "12", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 3, ComponenteID = "", Descricao = "13", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 46, ComponenteID = "", Descricao = "14", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 9, ComponenteID = "", Descricao = "15", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 10, ComponenteID = "", Descricao = "16", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 11, ComponenteID = "", Descricao = "17", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 12, ComponenteID = "", Descricao = "18", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 13, ComponenteID = "", Descricao = "19", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 14, ComponenteID = "", Descricao = "20", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 96, ComponenteID = "", Descricao = "21", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 95, ComponenteID = "", Descricao = "22", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 94, ComponenteID = "", Descricao = "23", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 93, ComponenteID = "", Descricao = "24", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 19, ComponenteID = "", Descricao = "25", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 20, ComponenteID = "", Descricao = "26", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 21, ComponenteID = "", Descricao = "27", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 47, ComponenteID = "", Descricao = "28", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 48, ComponenteID = "", Descricao = "29", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 45, ComponenteID = "", Descricao = "30", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 0, ComponenteID = "", Descricao = "31", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 35, ComponenteID = "", Descricao = "32", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 36, ComponenteID = "", Descricao = "33", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 37, ComponenteID = "", Descricao = "34", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 38, ComponenteID = "", Descricao = "35", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 39, ComponenteID = "", Descricao = "36", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 40, ComponenteID = "", Descricao = "37", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 41, ComponenteID = "", Descricao = "38", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 42, ComponenteID = "", Descricao = "39", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 2, ComponenteID = "", Descricao = "40", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 1, ComponenteID = "", Descricao = "41", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 44, ComponenteID = "", Descricao = "42", Funcao = FuncoesPinout.RX, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 43, ComponenteID = "", Descricao = "43", Funcao = FuncoesPinout.TX, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_S3, Pino = 92, ComponenteID = "", Descricao = "44", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 99, ComponenteID = "", Descricao = "1", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 98, ComponenteID = "", Descricao = "2", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 97, ComponenteID = "", Descricao = "3", Funcao = FuncoesPinout.NaoConectado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 4, ComponenteID = "", Descricao = "4", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 5, ComponenteID = "", Descricao = "5", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 6, ComponenteID = "", Descricao = "6", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 7, ComponenteID = "", Descricao = "7", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 15, ComponenteID = "", Descricao = "8", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 16, ComponenteID = "", Descricao = "9", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 17, ComponenteID = "", Descricao = "10", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 18, ComponenteID = "", Descricao = "11", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 8, ComponenteID = "", Descricao = "12", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 3, ComponenteID = "", Descricao = "13", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 46, ComponenteID = "", Descricao = "14", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 9, ComponenteID = "", Descricao = "15", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 10, ComponenteID = "", Descricao = "16", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 11, ComponenteID = "", Descricao = "17", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 12, ComponenteID = "", Descricao = "18", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 13, ComponenteID = "", Descricao = "19", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 14, ComponenteID = "", Descricao = "20", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 96, ComponenteID = "", Descricao = "21", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 95, ComponenteID = "", Descricao = "22", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 94, ComponenteID = "", Descricao = "23", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 93, ComponenteID = "", Descricao = "24", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 19, ComponenteID = "", Descricao = "25", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 20, ComponenteID = "", Descricao = "26", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 21, ComponenteID = "", Descricao = "27", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 47, ComponenteID = "", Descricao = "28", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 48, ComponenteID = "", Descricao = "29", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 45, ComponenteID = "", Descricao = "30", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 0, ComponenteID = "", Descricao = "31", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 35, ComponenteID = "", Descricao = "32", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 36, ComponenteID = "", Descricao = "33", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 37, ComponenteID = "", Descricao = "34", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 38, ComponenteID = "", Descricao = "35", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 39, ComponenteID = "", Descricao = "36", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 40, ComponenteID = "", Descricao = "37", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 41, ComponenteID = "", Descricao = "38", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 42, ComponenteID = "", Descricao = "39", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 2, ComponenteID = "", Descricao = "40", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 1, ComponenteID = "", Descricao = "41", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 44, ComponenteID = "", Descricao = "42", Funcao = FuncoesPinout.RX, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 43, ComponenteID = "", Descricao = "43", Funcao = FuncoesPinout.TX, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_S3, Barramento = TiposBarramentos.CONTROLADOR, Pino = 92, ComponenteID = "", Descricao = "44", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
};
|
||||
|
||||
return Pinout;
|
||||
|
|
@ -175,72 +183,151 @@ namespace AgroBase.Models.Modules
|
|||
{
|
||||
List<PinoutModel> Pinout = new List<PinoutModel>()
|
||||
{
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 99, ComponenteID = "", Descricao = "1", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 98, ComponenteID = "", Descricao = "2", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 36, ComponenteID = "", Descricao = "3", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 39, ComponenteID = "", Descricao = "4", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 34, ComponenteID = "", Descricao = "5", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 35, ComponenteID = "", Descricao = "6", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 32, ComponenteID = "", Descricao = "7", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 33, ComponenteID = "", Descricao = "8", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 25, ComponenteID = "", Descricao = "9", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 26, ComponenteID = "", Descricao = "10", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 27, ComponenteID = "", Descricao = "11", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 14, ComponenteID = "", Descricao = "12", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 12, ComponenteID = "", Descricao = "13", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 97, ComponenteID = "", Descricao = "14", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 13, ComponenteID = "", Descricao = "15", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 9, ComponenteID = "", Descricao = "16", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 10, ComponenteID = "", Descricao = "17", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 11, ComponenteID = "", Descricao = "18", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 96, ComponenteID = "", Descricao = "19", Funcao = FuncoesPinout.Desabilitado, Habilitado = false},
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 6, ComponenteID = "", Descricao = "26", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 7, ComponenteID = "", Descricao = "27", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 8, ComponenteID = "", Descricao = "28", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 15, ComponenteID = "", Descricao = "29", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 2, ComponenteID = "", Descricao = "30", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 0, ComponenteID = "", Descricao = "31", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 4, ComponenteID = "", Descricao = "32", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 16, ComponenteID = "", Descricao = "33", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 17, ComponenteID = "", Descricao = "34", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 5, ComponenteID = "", Descricao = "35", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 18, ComponenteID = "", Descricao = "36", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 19, ComponenteID = "", Descricao = "37", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 95, ComponenteID = "", Descricao = "38", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 21, ComponenteID = "", Descricao = "39", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 3, ComponenteID = "", Descricao = "40", Funcao = FuncoesPinout.RX, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 1, ComponenteID = "", Descricao = "41", Funcao = FuncoesPinout.TX, Habilitado = false },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 22, ComponenteID = "", Descricao = "42", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 23, ComponenteID = "", Descricao = "43", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Tipo = TiposControladores.ESP32_WROVER, Pino = 94, ComponenteID = "", Descricao = "44", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 99, ComponenteID = "", Descricao = "1", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 98, ComponenteID = "", Descricao = "2", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 36, ComponenteID = "", Descricao = "3", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 39, ComponenteID = "", Descricao = "4", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 34, ComponenteID = "", Descricao = "5", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 35, ComponenteID = "", Descricao = "6", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 32, ComponenteID = "", Descricao = "7", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 33, ComponenteID = "", Descricao = "8", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 25, ComponenteID = "", Descricao = "9", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 26, ComponenteID = "", Descricao = "10", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 27, ComponenteID = "", Descricao = "11", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 14, ComponenteID = "", Descricao = "12", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 12, ComponenteID = "", Descricao = "13", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 97, ComponenteID = "", Descricao = "14", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 13, ComponenteID = "", Descricao = "15", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 9, ComponenteID = "", Descricao = "16", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 10, ComponenteID = "", Descricao = "17", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 11, ComponenteID = "", Descricao = "18", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 96, ComponenteID = "", Descricao = "19", Funcao = FuncoesPinout.Desabilitado, Habilitado = false},
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 6, ComponenteID = "", Descricao = "26", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 7, ComponenteID = "", Descricao = "27", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 8, ComponenteID = "", Descricao = "28", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 15, ComponenteID = "", Descricao = "29", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 2, ComponenteID = "", Descricao = "30", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 0, ComponenteID = "", Descricao = "31", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 4, ComponenteID = "", Descricao = "32", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 16, ComponenteID = "", Descricao = "33", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 17, ComponenteID = "", Descricao = "34", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 5, ComponenteID = "", Descricao = "35", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 18, ComponenteID = "", Descricao = "36", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 19, ComponenteID = "", Descricao = "37", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 95, ComponenteID = "", Descricao = "38", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 21, ComponenteID = "", Descricao = "39", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 3, ComponenteID = "", Descricao = "40", Funcao = FuncoesPinout.RX, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 1, ComponenteID = "", Descricao = "41", Funcao = FuncoesPinout.TX, Habilitado = false },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 22, ComponenteID = "", Descricao = "42", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 23, ComponenteID = "", Descricao = "43", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.ESP32_WROVER, Barramento = TiposBarramentos.CONTROLADOR, Pino = 94, ComponenteID = "", Descricao = "44", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
};
|
||||
|
||||
return Pinout;
|
||||
}
|
||||
|
||||
public static List<PinoutModel> CarregarPinout(string nomeArquivo)
|
||||
public static List<PinoutModel> CarregarPinoutPadrao_MCP()
|
||||
{
|
||||
if (!File.Exists(nomeArquivo))
|
||||
{
|
||||
var newPinout = PinoutModel.CarregarPinoutPadrao_Wrover();
|
||||
File.WriteAllText(nomeArquivo, JsonConvert.SerializeObject(newPinout));
|
||||
}
|
||||
var pinoutText = File.ReadAllText(nomeArquivo);
|
||||
var Pinout = JsonConvert.DeserializeObject<PinoutModel[]>(pinoutText).ToList();
|
||||
List<PinoutModel> Pinout = new List<PinoutModel>()
|
||||
{
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 0, ComponenteID = "", Descricao = "A0", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 1, ComponenteID = "", Descricao = "A1", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 2, ComponenteID = "", Descricao = "A2", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 3, ComponenteID = "", Descricao = "A3", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 4, ComponenteID = "", Descricao = "A4", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 5, ComponenteID = "", Descricao = "A5", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 6, ComponenteID = "", Descricao = "A6", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 7, ComponenteID = "", Descricao = "A7", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 8, ComponenteID = "", Descricao = "B0", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 9, ComponenteID = "", Descricao = "B1", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 10, ComponenteID = "", Descricao = "B2", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 11, ComponenteID = "", Descricao = "B3", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 12, ComponenteID = "", Descricao = "B4", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 13, ComponenteID = "", Descricao = "B5", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 14, ComponenteID = "", Descricao = "B6", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Controlador = TiposControladores.TODOS, Barramento = TiposBarramentos.EXPANSORI2C, Pino = 15, ComponenteID = "", Descricao = "B7", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
};
|
||||
|
||||
return Pinout;
|
||||
}
|
||||
|
||||
public static void SalvarPinout(List<PinoutModel> newPinout, string nomeArquivo)
|
||||
|
||||
public static PinoutDataModel CarregarPinout(string nomeArquivo)
|
||||
{
|
||||
if (!File.Exists(nomeArquivo))
|
||||
{
|
||||
var newPinout = new PinoutDataModel()
|
||||
{
|
||||
ExpansorGPIO = false,
|
||||
EnderecoExpansor = "",
|
||||
Pinos = CarregarPinoutPadrao_S3(),
|
||||
};
|
||||
File.WriteAllText(nomeArquivo, JsonConvert.SerializeObject(newPinout));
|
||||
}
|
||||
var pinoutText = File.ReadAllText(nomeArquivo);
|
||||
var Pinout = JsonConvert.DeserializeObject<PinoutDataModel>(pinoutText);
|
||||
return Pinout;
|
||||
}
|
||||
|
||||
public static void SalvarPinout(PinoutDataModel newPinout, string nomeArquivo)
|
||||
{
|
||||
File.WriteAllText(nomeArquivo, JsonConvert.SerializeObject(newPinout));
|
||||
}
|
||||
|
||||
public static string PinoProtocolo(PinoutDataModel _pinout, List<FuncoesPinout> _funcoes)
|
||||
{
|
||||
string Pinos = "";
|
||||
int i = 0;
|
||||
foreach (FuncoesPinout funcao in _funcoes)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
Pinos += ",";
|
||||
}
|
||||
var pino = _pinout.Pinos.FirstOrDefault(x => x.Funcao == funcao);
|
||||
if (pino != null && (pino.Barramento == TiposBarramentos.CONTROLADOR || (pino.Barramento == TiposBarramentos.EXPANSORI2C && _pinout.ExpansorGPIO)))
|
||||
{
|
||||
Pinos += (int)pino.Barramento + pino.Pino.ToString("00");
|
||||
}
|
||||
else
|
||||
{
|
||||
Pinos += "0-1";
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return Pinos;
|
||||
}
|
||||
|
||||
public static string PinoSensorProtocolo2(PinoutDataModel _pinout)
|
||||
{
|
||||
string pin = "0-1";
|
||||
string pin2 = "0-1";
|
||||
var comp = _pinout.Pinos.FirstOrDefault(x => x.Funcao != FuncoesPinout.NaoConectado);
|
||||
var p2 = _pinout.Pinos.FirstOrDefault(x => PinoutUtils.PinosSecundarios.Any(y => y == x.Funcao));
|
||||
if (comp != null && (comp.Barramento == TiposBarramentos.CONTROLADOR || (comp.Barramento == TiposBarramentos.EXPANSORI2C && _pinout.ExpansorGPIO)))
|
||||
{
|
||||
pin = (int)comp.Barramento + comp.Pino.ToString("00");
|
||||
}
|
||||
if (p2 != null && (p2.Barramento == TiposBarramentos.CONTROLADOR || (p2.Barramento == TiposBarramentos.EXPANSORI2C && _pinout.ExpansorGPIO)))
|
||||
{
|
||||
pin2 = (int)p2.Barramento + p2.Pino.ToString("00");
|
||||
}
|
||||
return pin + ";" + pin2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public enum TiposControladores
|
||||
{
|
||||
ESP32_S3,
|
||||
ESP32_WROVER,
|
||||
TODOS,
|
||||
}
|
||||
|
||||
public enum TiposBarramentos
|
||||
{
|
||||
CONTROLADOR = 0,
|
||||
EXPANSORI2C = 1
|
||||
}
|
||||
|
||||
public enum FuncoesPinout
|
||||
|
|
@ -284,6 +371,8 @@ namespace AgroBase.Models.Modules
|
|||
INA,
|
||||
INB,
|
||||
Sinaleiro,
|
||||
ServoX,
|
||||
ServoY,
|
||||
}
|
||||
|
||||
public static class PinoutUtils
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using AgroBase.Forms;
|
||||
using AgroBase.Services;
|
||||
using Emgu.CV.Structure;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
@ -16,7 +17,8 @@ namespace AgroBase.Models.Modules
|
|||
public static int _TaxaAmostragem { get; set; } = 500;
|
||||
public bool Conectado { get; set; } = false;
|
||||
public static int LogsManter { get; set; } = 60;
|
||||
public static List<PinoutModel> Pinout { get; set; }
|
||||
public static PinoutDataModel Pinout { get; set; }
|
||||
public static bool ExpansorGPIO { get; set; } = false;
|
||||
public static List<FuncoesPinout> Funcoes { get; set; } = new List<FuncoesPinout>()
|
||||
{
|
||||
FuncoesPinout.SDA,
|
||||
|
|
@ -150,111 +152,9 @@ namespace AgroBase.Models.Modules
|
|||
},
|
||||
new SensorModel()
|
||||
{
|
||||
ID = "VBAT",
|
||||
Descricao = "Tensão da bateria",
|
||||
Prioridade = 20,
|
||||
Componente = S_Code.sTEN,
|
||||
Aferir = true,
|
||||
Inicializado = false,
|
||||
Testando = false,
|
||||
Funcoes = new List<FuncoesPinout>()
|
||||
{
|
||||
FuncoesPinout.Tensao,
|
||||
},
|
||||
DelayAmostragem = 500,
|
||||
UnidadeMedida = "V",
|
||||
Parametros = new List<string[]>()
|
||||
{
|
||||
new string[] { "V offset", "000.85" },
|
||||
new string[] { "R1", "120000" },
|
||||
new string[] { "R2", "010000" },
|
||||
},
|
||||
},
|
||||
new SensorModel()
|
||||
{
|
||||
ID = "AMVET",
|
||||
ID = "AB3V",
|
||||
Prioridade = 10,
|
||||
Descricao = "Corrente do Motor BLDC ET",
|
||||
Componente = S_Code.sCOR,
|
||||
Aferir = true,
|
||||
Inicializado = false,
|
||||
Testando = false,
|
||||
Funcoes = new List<FuncoesPinout>()
|
||||
{
|
||||
FuncoesPinout.I2C,
|
||||
},
|
||||
DelayAmostragem = 500,
|
||||
UnidadeMedida = "A",
|
||||
Parametros = new List<string[]>()
|
||||
{
|
||||
new string[] { "Endereço I2C", "0x40" },
|
||||
},
|
||||
},
|
||||
new SensorModel()
|
||||
{
|
||||
ID = "AMVEF",
|
||||
Prioridade = 10,
|
||||
Descricao = "Corrente do Motor BLDC EF",
|
||||
Componente = S_Code.sCOR,
|
||||
Aferir = true,
|
||||
Inicializado = false,
|
||||
Testando = false,
|
||||
Funcoes = new List<FuncoesPinout>()
|
||||
{
|
||||
FuncoesPinout.I2C,
|
||||
},
|
||||
DelayAmostragem = 500,
|
||||
UnidadeMedida = "A",
|
||||
Parametros = new List<string[]>()
|
||||
{
|
||||
new string[] { "Endereço I2C", "0x41" },
|
||||
},
|
||||
},
|
||||
new SensorModel()
|
||||
{
|
||||
ID = "AMVDT",
|
||||
Prioridade = 10,
|
||||
Descricao = "Corrente do Motor BLDC DT",
|
||||
Componente = S_Code.sCOR,
|
||||
Aferir = true,
|
||||
Inicializado = false,
|
||||
Testando = false,
|
||||
Funcoes = new List<FuncoesPinout>()
|
||||
{
|
||||
FuncoesPinout.I2C,
|
||||
},
|
||||
DelayAmostragem = 500,
|
||||
UnidadeMedida = "A",
|
||||
Parametros = new List<string[]>()
|
||||
{
|
||||
new string[] { "Endereço I2C", "0x42" },
|
||||
},
|
||||
},
|
||||
new SensorModel()
|
||||
{
|
||||
ID = "AMVDF",
|
||||
Prioridade = 10,
|
||||
Descricao = "Corrente do Motor BLDC DF",
|
||||
Componente = S_Code.sCOR,
|
||||
Aferir = true,
|
||||
Inicializado = false,
|
||||
Testando = false,
|
||||
Funcoes = new List<FuncoesPinout>()
|
||||
{
|
||||
FuncoesPinout.I2C,
|
||||
},
|
||||
DelayAmostragem = 500,
|
||||
UnidadeMedida = "A",
|
||||
Parametros = new List<string[]>()
|
||||
{
|
||||
new string[] { "Endereço I2C", "0x43" },
|
||||
},
|
||||
},
|
||||
new SensorModel()
|
||||
{
|
||||
ID = "AMP",
|
||||
Prioridade = 10,
|
||||
Descricao = "Corrente dos Motores de Passo",
|
||||
Descricao = "Corrente no Barramento 3V",
|
||||
Componente = S_Code.sCOR,
|
||||
Aferir = true,
|
||||
Inicializado = false,
|
||||
|
|
@ -268,13 +168,14 @@ namespace AgroBase.Models.Modules
|
|||
Parametros = new List<string[]>()
|
||||
{
|
||||
new string[] { "Endereço I2C", "0x44" },
|
||||
new string[] { "CI", "219" }
|
||||
},
|
||||
},
|
||||
new SensorModel()
|
||||
{
|
||||
ID = "AAT",
|
||||
ID = "AB5V",
|
||||
Prioridade = 10,
|
||||
Descricao = "Corrente do Módulo Atuador",
|
||||
Descricao = "Corrente no Barramento 5V",
|
||||
Componente = S_Code.sCOR,
|
||||
Aferir = true,
|
||||
Inicializado = false,
|
||||
|
|
@ -287,14 +188,15 @@ namespace AgroBase.Models.Modules
|
|||
UnidadeMedida = "A",
|
||||
Parametros = new List<string[]>()
|
||||
{
|
||||
new string[] { "Endereço I2C", "0x45" },
|
||||
new string[] { "Endereço I2C", "0x41" },
|
||||
new string[] { "CI", "219" }
|
||||
},
|
||||
},
|
||||
new SensorModel()
|
||||
{
|
||||
ID = "APC",
|
||||
ID = "AB7V2",
|
||||
Prioridade = 10,
|
||||
Descricao = "Corrente do Computador",
|
||||
Descricao = "Corrente no Barramento 7,2V",
|
||||
Componente = S_Code.sCOR,
|
||||
Aferir = true,
|
||||
Inicializado = false,
|
||||
|
|
@ -307,7 +209,29 @@ namespace AgroBase.Models.Modules
|
|||
UnidadeMedida = "A",
|
||||
Parametros = new List<string[]>()
|
||||
{
|
||||
new string[] { "Endereço I2C", "0x46" },
|
||||
new string[] { "Endereço I2C", "0x40" },
|
||||
new string[] { "CI", "219" }
|
||||
},
|
||||
},
|
||||
new SensorModel()
|
||||
{
|
||||
ID = "AB12V",
|
||||
Prioridade = 10,
|
||||
Descricao = "Corrente no Barramento 12V",
|
||||
Componente = S_Code.sCOR,
|
||||
Aferir = true,
|
||||
Inicializado = false,
|
||||
Testando = false,
|
||||
Funcoes = new List<FuncoesPinout>()
|
||||
{
|
||||
FuncoesPinout.I2C,
|
||||
},
|
||||
DelayAmostragem = 500,
|
||||
UnidadeMedida = "A",
|
||||
Parametros = new List<string[]>()
|
||||
{
|
||||
new string[] { "Endereço I2C", "0x43" },
|
||||
new string[] { "CI", "226" }
|
||||
},
|
||||
},
|
||||
new SensorModel()
|
||||
|
|
@ -383,6 +307,31 @@ namespace AgroBase.Models.Modules
|
|||
UnidadeMedida = "º",
|
||||
Parametros = new List<string[]>(),
|
||||
},
|
||||
new SensorModel()
|
||||
{
|
||||
ID = "SNR_F",
|
||||
Descricao = "Sensor Sonar Frontal",
|
||||
Prioridade = 20,
|
||||
Componente = S_Code.sSNR,
|
||||
Aferir = true,
|
||||
Inicializado = false,
|
||||
Testando = false,
|
||||
Funcoes = new List<FuncoesPinout>()
|
||||
{
|
||||
FuncoesPinout.Echo,
|
||||
FuncoesPinout.Trigger,
|
||||
FuncoesPinout.ServoX,
|
||||
FuncoesPinout.ServoY,
|
||||
},
|
||||
DelayAmostragem = 1000,
|
||||
UnidadeMedida = "cm/º",
|
||||
Parametros = new List<string[]>()
|
||||
{
|
||||
new string[] { "Angulo X Acrescentar", "5" },
|
||||
new string[] { "Angulo Y Acrescentar", "30" },
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
@ -395,8 +344,8 @@ namespace AgroBase.Models.Modules
|
|||
"MD".PadRight(5, ' ') + ";" + // 0 ~ 4
|
||||
(Conectar ? "1" : "0") + ";" + // 6
|
||||
_TaxaAmostragem.ToString("00000") + // 8 ~ 12
|
||||
(Pinout.Any(x => x.Funcao == FuncoesPinout.SDA) ? Pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.SDA).Pino.ToString("00") : "-1") + ";" + // 14 ~ 15
|
||||
(Pinout.Any(x => x.Funcao == FuncoesPinout.SCL) ? Pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.SCL).Pino.ToString("00") : "-1"); // 17 ~ 18
|
||||
(Pinout.Pinos.Any(x => x.Funcao == FuncoesPinout.SDA) ? Pinout.Pinos.FirstOrDefault(x => x.Funcao == FuncoesPinout.SDA).Pino.ToString("00") : "-1") + ";" + // 14 ~ 15
|
||||
(Pinout.Pinos.Any(x => x.Funcao == FuncoesPinout.SCL) ? Pinout.Pinos.FirstOrDefault(x => x.Funcao == FuncoesPinout.SCL).Pino.ToString("00") : "-1"); // 17 ~ 18
|
||||
Config.Add(ProtocoloMOD);
|
||||
return Config;
|
||||
}
|
||||
|
|
@ -434,115 +383,201 @@ namespace AgroBase.Models.Modules
|
|||
Sensor.Inicializado = Dados[2] == "1";
|
||||
break;
|
||||
case S_Code.sCOR:
|
||||
double vBarramento = -1;
|
||||
double.TryParse(Dados[2].Replace(".", ","), out vBarramento);
|
||||
double vShunt = -1;
|
||||
double.TryParse(Dados[3].Replace(".", ","), out vShunt);
|
||||
double corrente = -1;
|
||||
double.TryParse(Dados[4].Replace(".", ","), out corrente);
|
||||
double potencia = -1;
|
||||
double.TryParse(Dados[5].Replace(".", ","), out potencia);
|
||||
{
|
||||
double vBarramento = -1;
|
||||
double.TryParse(Dados[2].Replace(".", ","), out vBarramento);
|
||||
double vShunt = -1;
|
||||
double.TryParse(Dados[3].Replace(".", ","), out vShunt);
|
||||
double corrente = -1;
|
||||
double.TryParse(Dados[4].Replace(".", ","), out corrente);
|
||||
double potencia = -1;
|
||||
double.TryParse(Dados[5].Replace(".", ","), out potencia);
|
||||
|
||||
Sensor.Leituras = new List<double>()
|
||||
{
|
||||
corrente,
|
||||
vBarramento,
|
||||
potencia,
|
||||
vShunt,
|
||||
};
|
||||
|
||||
if (Sensor.Descricao.ToLower().Contains("bateria"))
|
||||
{
|
||||
frmInstancial.frmAcompanhamento.AtualizarSensores("Corrente atual: " + corrente.ToString("0.00") + "A - Mín: " + Sensor.ValorMinimo.ToString("0.00") + "A - Máx: " + Sensor.ValorMaximo.ToString("0.00") + "A");
|
||||
}
|
||||
|
||||
AtualizaGrafico = true;
|
||||
break;
|
||||
case S_Code.sTEN:
|
||||
double leituraV = -1;
|
||||
double.TryParse(Dados[2].Replace(".", ","), out leituraV);
|
||||
double vPinV = -1;
|
||||
double.TryParse(Dados[3].Replace(".", ","), out vPinV);
|
||||
double tensao = -1;
|
||||
double.TryParse(Dados[4].Replace(".", ","), out tensao);
|
||||
|
||||
Sensor.Leituras = new List<double>()
|
||||
{
|
||||
tensao,
|
||||
leituraV,
|
||||
vPinV,
|
||||
};
|
||||
|
||||
if (Sensor.Descricao.ToLower().Contains("bateria"))
|
||||
{
|
||||
frmInstancial.frmAcompanhamento.AtualizarSensores("Tensão atual: " + tensao.ToString("0.00") + "V - Mín: " + Sensor.ValorMinimo.ToString("0.00") + "V - Máx: " + Sensor.ValorMaximo.ToString("0.00") + "V");
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria = (tensao / Sensor.LimiteMaximo) * 100;
|
||||
if (Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria < 0)
|
||||
Sensor.Leituras = new List<double>()
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria = 0;
|
||||
corrente,
|
||||
vBarramento,
|
||||
potencia,
|
||||
vShunt,
|
||||
};
|
||||
|
||||
if (Sensor.ID.Contains("AB"))
|
||||
{
|
||||
frmInstancial.frmAcompanhamento.AtualizarSensores(Sensor.ID.Replace("AB", "Barramento ") + ": " + vBarramento.ToString("0.00") + " V " + corrente.ToString("0.00") + " mA");
|
||||
}
|
||||
|
||||
AtualizaGrafico = true;
|
||||
break;
|
||||
}
|
||||
case S_Code.sTEN:
|
||||
{
|
||||
double leitura = -1;
|
||||
double.TryParse(Dados[2].Replace(".", ","), out leitura);
|
||||
|
||||
AtualizaGrafico = true;
|
||||
double Vcc = 3.3;
|
||||
double Voffset = double.Parse(Sensor.Parametros[0][1]);
|
||||
double R1 = double.Parse(Sensor.Parametros[1][1].Replace(".", ","));
|
||||
double R2 = double.Parse(Sensor.Parametros[2][1].Replace(".", ","));
|
||||
double Razao = (R1 + R2) / (double)R2;
|
||||
double voltageV = (leitura * (Vcc / 4095.0)) + (Voffset / Razao); // Convertendo o valor ADC para tensão
|
||||
double realVoltage = voltageV * Razao;
|
||||
|
||||
break;
|
||||
Sensor.Leituras = new List<double>()
|
||||
{
|
||||
realVoltage,
|
||||
leitura,
|
||||
voltageV,
|
||||
};
|
||||
|
||||
if (Sensor.Descricao.ToLower().Contains("bateria"))
|
||||
{
|
||||
frmInstancial.frmAcompanhamento.AtualizarSensores("Tensão atual: " + realVoltage.ToString("0.00") + "V - Mín: " + Sensor.ValorMinimo.ToString("0.00") + "V - Máx: " + Sensor.ValorMaximo.ToString("0.00") + "V");
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria = (realVoltage / Sensor.LimiteMaximo) * 100;
|
||||
if (Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria < 0)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria = 0;
|
||||
}
|
||||
}
|
||||
|
||||
AtualizaGrafico = true;
|
||||
|
||||
break;
|
||||
}
|
||||
case S_Code.sTMP:
|
||||
double temp = -1;
|
||||
double.TryParse(Dados[2].Replace(".", ","), out temp);
|
||||
Sensor.Leituras = new List<double>() { temp };
|
||||
|
||||
if (Sensor.Descricao.ToLower().Contains("bateria"))
|
||||
{
|
||||
frmInstancial.frmAcompanhamento.AtualizarSensores("Temp atual: " + temp.ToString("0.00") + "ºC - Mín: " + Sensor.ValorMinimo.ToString("0.00") + "ºC - Máx: " + Sensor.ValorMaximo.ToString("0.00") + "ºC");
|
||||
}
|
||||
double temp = -1;
|
||||
double.TryParse(Dados[2].Replace(".", ","), out temp);
|
||||
|
||||
AtualizaGrafico = true;
|
||||
break;
|
||||
double Vs = 3.3; // TENSÃO DE SAIDA DO ESP32
|
||||
double R1 = 10000; //RESISTOR UTILIZADO NO DIVISOR DE TENSÃO
|
||||
double Beta = 3950; // VALOR DE BETA
|
||||
double To = 298.15; // VALOR EM KELVIN REFERENTE A 25° CELSIUS
|
||||
double Ro = 10000;
|
||||
double adcMax = 4095.0;
|
||||
double Vout, Rt = 0;
|
||||
double T, Tc, Tf, adc = 0;
|
||||
//CALCULOS PARA CONVERSÃO DA LEITURA RECEBIDA PELO ESP32 EM TEMPERATURA EM °C
|
||||
double Voffset = double.Parse(Sensor.Parametros[0][1].Replace(".", ","));
|
||||
Vout = (temp * Vs / adcMax) + Voffset;
|
||||
Rt = R1 * Vout / (Vs - Vout);
|
||||
T = 1 / (1 / To + Math.Log(Rt / Ro) / Beta);
|
||||
Tc = T - 273.15;
|
||||
Tf = Tc * 9 / 5 + 32;
|
||||
|
||||
Tc = Math.Round(Tc, 2);
|
||||
|
||||
Sensor.Leituras = new List<double>() { Tc };
|
||||
|
||||
if (Sensor.Descricao.ToLower().Contains("bateria"))
|
||||
{
|
||||
frmInstancial.frmAcompanhamento.AtualizarSensores(Tc.ToString("0.00") + " ºC");
|
||||
}
|
||||
|
||||
AtualizaGrafico = true;
|
||||
break;
|
||||
}
|
||||
case S_Code.sULT:
|
||||
double distancia = -1;
|
||||
double.TryParse(Dados[2].Replace(".", ","), out distancia);
|
||||
int duracao = -1;
|
||||
int.TryParse(Dados[3], out duracao);
|
||||
|
||||
Sensor.Leituras = new List<double>()
|
||||
{
|
||||
distancia,
|
||||
duracao,
|
||||
};
|
||||
double distancia = -1;
|
||||
double.TryParse(Dados[2].Replace(".", ","), out distancia);
|
||||
int duracao = -1;
|
||||
int.TryParse(Dados[3], out duracao);
|
||||
|
||||
if (Sensor.ID == "SUESQ")
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaEsquerda = distancia;
|
||||
}
|
||||
else if (Sensor.ID == "SUDIR")
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaDireita = distancia;
|
||||
}
|
||||
Sensor.Leituras = new List<double>()
|
||||
{
|
||||
distancia,
|
||||
duracao,
|
||||
};
|
||||
|
||||
AtualizaGrafico = true;
|
||||
break;
|
||||
if (Sensor.ID == "SUESQ")
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaEsquerda = distancia;
|
||||
}
|
||||
else if (Sensor.ID == "SUDIR")
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaDireita = distancia;
|
||||
}
|
||||
|
||||
AtualizaGrafico = true;
|
||||
break;
|
||||
}
|
||||
case S_Code.sMAG:
|
||||
int x = -1;
|
||||
int.TryParse(Dados[2], out x);
|
||||
int y = -1;
|
||||
int.TryParse(Dados[3], out y);
|
||||
int z = -1;
|
||||
int.TryParse(Dados[4], out z);
|
||||
double angulo = -1;
|
||||
double.TryParse(Dados[5].Replace(".", ","), out angulo);
|
||||
|
||||
Sensor.Leituras = new List<double>()
|
||||
{
|
||||
angulo,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
};
|
||||
int x = -1;
|
||||
int.TryParse(Dados[2], out x);
|
||||
int y = -1;
|
||||
int.TryParse(Dados[3], out y);
|
||||
int z = -1;
|
||||
int.TryParse(Dados[4], out z);
|
||||
double angulo = -1;
|
||||
double.TryParse(Dados[5].Replace(".", ","), out angulo);
|
||||
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarroBussola = angulo;
|
||||
Sensor.Leituras = new List<double>()
|
||||
{
|
||||
angulo,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
};
|
||||
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarroBussola = angulo;
|
||||
|
||||
AtualizaGrafico = true;
|
||||
break;
|
||||
}
|
||||
case S_Code.sSNR:
|
||||
{
|
||||
int distancia = -1;
|
||||
int.TryParse(Dados[2], out distancia);
|
||||
int angulo = -1;
|
||||
int.TryParse(Dados[3], out angulo);
|
||||
int posicao = -1;
|
||||
int.TryParse(Dados[4], out posicao);
|
||||
|
||||
Sensor.Leituras = new List<double>()
|
||||
{
|
||||
distancia,
|
||||
angulo,
|
||||
posicao,
|
||||
};
|
||||
|
||||
if (Sensor.ID == "SNR_F")
|
||||
{
|
||||
var posArr = Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.Deteccoes.FirstOrDefault(x => x.Posicao == posicao);
|
||||
if (posArr == null)
|
||||
{
|
||||
posArr = new SonarRegistroModel()
|
||||
{
|
||||
Posicao = posicao,
|
||||
Leituras = new List<SonarLeituraModel>()
|
||||
};
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.Deteccoes.Add(posArr);
|
||||
}
|
||||
var leituras = posArr.Leituras;
|
||||
|
||||
if (false && posicao != Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.PosicaoAtual && Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.Deteccoes.Any(x => x.Posicao == posicao))
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.Deteccoes.First(x => x.Posicao == posicao).Leituras.Clear();
|
||||
}
|
||||
|
||||
if (leituras.Any(x => x.Angulo == angulo))
|
||||
{
|
||||
leituras.First(x => x.Angulo == angulo).Momento = DateTime.Now;
|
||||
leituras.First(x => x.Angulo == angulo).Distancia = distancia;
|
||||
}
|
||||
else
|
||||
{
|
||||
leituras.Add(new SonarLeituraModel(angulo, distancia));
|
||||
}
|
||||
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.PosicaoAtual = posicao;
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.AtualizarSonar();
|
||||
}
|
||||
|
||||
AtualizaGrafico = true;
|
||||
break;
|
||||
}
|
||||
|
||||
AtualizaGrafico = true;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -571,10 +606,10 @@ namespace AgroBase.Models.Modules
|
|||
Momento = DateTime.Now,
|
||||
ComponenteID = Sensor.ID,
|
||||
Componente = Sensor.Componente,
|
||||
Leitura1 = Sensor.Leituras[0],
|
||||
Leitura2 = Sensor.Leituras[1],
|
||||
Leitura3 = Sensor.Leituras[2],
|
||||
Leitura4 = Sensor.Leituras[3],
|
||||
Leitura1 = Sensor.Leituras.Count() > 0 ? Sensor.Leituras[0] : -1,
|
||||
Leitura2 = Sensor.Leituras.Count() > 1 ? Sensor.Leituras[1] : -1,
|
||||
Leitura3 = Sensor.Leituras.Count() > 2 ? Sensor.Leituras[2] : -1,
|
||||
Leitura4 = Sensor.Leituras.Count() > 3 ? Sensor.Leituras[3] : -1,
|
||||
AlarmeMinima = Sensor.Leituras[0] < Sensor.LimiteMinimo,
|
||||
AlarmeMaxima = Sensor.Leituras[0] > Sensor.LimiteMaximo,
|
||||
});
|
||||
|
|
@ -656,23 +691,6 @@ namespace AgroBase.Models.Modules
|
|||
}
|
||||
}
|
||||
|
||||
public List<PinoutModel> CarregarPinout(string nomeArquivo)
|
||||
{
|
||||
if (!File.Exists(nomeArquivo))
|
||||
{
|
||||
var newPinout = PinoutModel.CarregarPinoutPadrao_Wrover();
|
||||
File.WriteAllText(nomeArquivo, JsonConvert.SerializeObject(newPinout));
|
||||
}
|
||||
var pinoutText = File.ReadAllText(nomeArquivo);
|
||||
Pinout = JsonConvert.DeserializeObject<PinoutModel[]>(pinoutText).ToList();
|
||||
return Pinout;
|
||||
}
|
||||
|
||||
public void SalvarPinout(List<PinoutModel> newPinout, string nomeArquivo)
|
||||
{
|
||||
File.WriteAllText(nomeArquivo, JsonConvert.SerializeObject(newPinout));
|
||||
}
|
||||
|
||||
public void IniciarRegistrador()
|
||||
{
|
||||
|
||||
|
|
@ -701,9 +719,15 @@ namespace AgroBase.Models.Modules
|
|||
|
||||
public List<SenSensorimanetoGrafico> LogGrafico = new List<SenSensorimanetoGrafico>();
|
||||
|
||||
public string ProtocoloConfiguracaoSensor(List<PinoutModel> Pinout, bool Conectar)
|
||||
public string ProtocoloConfiguracaoSensor(PinoutDataModel Pinout, bool Conectar)
|
||||
{
|
||||
var _pinout = Pinout.Where(x => x.ComponenteID == ID).ToList();
|
||||
var _pinout = new PinoutDataModel()
|
||||
{
|
||||
ExpansorGPIO = Pinout.ExpansorGPIO,
|
||||
EnderecoExpansor = Pinout.EnderecoExpansor,
|
||||
Pinos = Pinout.Pinos.ToList(),
|
||||
};
|
||||
_pinout.Pinos = _pinout.Pinos.Where(x => x.ComponenteID == ID).ToList();
|
||||
string Protocolo = ((int)F_Code.Cfg).ToString() +
|
||||
ID.PadRight(5, ' ') + ";" + // 0 ~ 4
|
||||
(Conectar ? "1" : "0") + ";" + // 6
|
||||
|
|
@ -711,11 +735,10 @@ namespace AgroBase.Models.Modules
|
|||
(Aferir ? "1" : "0") + ";" + // 12
|
||||
DelayAmostragem.ToString("00000") + ";" + // 14 ~ 18
|
||||
Prioridade.ToString("00") + ";" + // 20 ~ 21
|
||||
(_pinout.Any(x => x.Funcao != FuncoesPinout.NaoConectado) ? _pinout.FirstOrDefault(x => x.Funcao != FuncoesPinout.NaoConectado).Pino.ToString("00") : "-1") + ";" + // 23 ~ 24
|
||||
(_pinout.Any(x => PinoutUtils.PinosSecundarios.Any(y => y == x.Funcao)) ? _pinout.FirstOrDefault(x => PinoutUtils.PinosSecundarios.Any(y => y == x.Funcao)).Pino.ToString("00") : "-1"); // 26 ~ 27
|
||||
PinoutModel.PinoProtocolo(_pinout, Funcoes); // 23 ~ 25 / 27 ~ 29
|
||||
foreach (var Parametro in Parametros)
|
||||
{
|
||||
Protocolo += ";" + Parametro[1];
|
||||
Protocolo += ";" + Parametro[1].PadRight(6, ' ');
|
||||
}
|
||||
return Protocolo;
|
||||
}
|
||||
|
|
@ -729,13 +752,19 @@ namespace AgroBase.Models.Modules
|
|||
public List<FuncoesPinout> Funcoes { get; set; }
|
||||
public SensorSinaleiroComportamentoModel Comportamento { get; set; }
|
||||
|
||||
public string ProtocoloConfiguracaoSinaleiro(List<PinoutModel> Pinout, bool Conectar)
|
||||
public string ProtocoloConfiguracaoSinaleiro(PinoutDataModel Pinout, bool Conectar)
|
||||
{
|
||||
var _pinout = Pinout.Where(x => x.ComponenteID == ID).ToList();
|
||||
var _pinout = new PinoutDataModel()
|
||||
{
|
||||
ExpansorGPIO = Pinout.ExpansorGPIO,
|
||||
EnderecoExpansor = Pinout.EnderecoExpansor,
|
||||
Pinos = Pinout.Pinos.ToList(),
|
||||
};
|
||||
_pinout.Pinos = _pinout.Pinos.Where(x => x.ComponenteID == ID).ToList();
|
||||
string Protocolo = ((int)F_Code.Cfg).ToString() +
|
||||
ID.PadRight(5, ' ') + ";" + // 0 ~ 4
|
||||
(Conectar ? "1" : "0") + ";" + // 6
|
||||
(_pinout.Any(x => x.Funcao != FuncoesPinout.NaoConectado) ? _pinout.FirstOrDefault(x => x.Funcao != FuncoesPinout.NaoConectado).Pino.ToString("00") : "-1"); // 8 ~ 9
|
||||
PinoutModel.PinoProtocolo(_pinout, Funcoes); // 8 ~ 10
|
||||
return Protocolo;
|
||||
}
|
||||
|
||||
|
|
@ -775,4 +804,6 @@ namespace AgroBase.Models.Modules
|
|||
public bool AlarmeMaxima { get; set; }
|
||||
public bool AlarmeMinima { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
using AgroBase.Forms.Operacoes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AgroBase.Models.Operacoes
|
||||
{
|
||||
public class OperacaoManualModel
|
||||
{
|
||||
public Form frmOperacao { get; set; } = new frmOperacaoManual();
|
||||
public string frmOperacaoNome { get; set; } = "frmOperacaoManual";
|
||||
public OperacaoControleModel Controle { get; set; } = new OperacaoControleModel();
|
||||
public OperacaoControleModel ControleAnterior { get; set; } = new OperacaoControleModel();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,842 @@
|
|||
using AgroBase.Forms.Operacoes;
|
||||
using AgroBase.Models.Modules;
|
||||
using AgroBase.Services;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static AgroBase.Models.Enuns;
|
||||
|
||||
namespace AgroBase.Models.Operacoes
|
||||
{
|
||||
public class OperacaoMapaGPSModel
|
||||
{
|
||||
public Form frmOperacao { get; set; } = new frmOperacaoMapaGPS();
|
||||
public string frmOperacaoNome { get; set; } = "frmOperacaoMapaGPS";
|
||||
public bool Concluido
|
||||
{
|
||||
get
|
||||
{
|
||||
return Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual >= Variaveis.OperacaoEmAndamento.Mapa.Trajetoria.Count - 1;
|
||||
}
|
||||
}
|
||||
public OperacaoRefRuaGPS ReferencialRuaGPS { get; set; } = new OperacaoRefRuaGPS();
|
||||
public OperacaoMapaGPSSensoriamentoModel Sensoriamento { get; set; } = new OperacaoMapaGPSSensoriamentoModel();
|
||||
public OperacaoControleModel Controle { get; set; } = new OperacaoControleModel();
|
||||
public OperacaoControleModel ControleAnterior { get; set; } = new OperacaoControleModel();
|
||||
public List<OperacaoMapaGPSSensoriamentoModel> Logs { get; set; } = new List<OperacaoMapaGPSSensoriamentoModel>();
|
||||
|
||||
|
||||
public void AtualizarDadosControle()
|
||||
{
|
||||
DateTime Agora = DateTime.Now;
|
||||
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;
|
||||
OperacaoControleTipoModel ControleAtu = Controle.TiposControle != null ? Controle.TiposControle.FirstOrDefault(x => x.Tipo == T_Code.Atu) : null;
|
||||
|
||||
if (ControleMov != null && Controle.RPM != ControleAnterior.RPM && (Agora - ControleMov.UltimoComando).TotalMilliseconds > ControleMov.DelayEnvioComando)
|
||||
{
|
||||
// Enviar comando MOV
|
||||
var Protocolos = EnviarProtocoloComando(Variaveis.OperacaoEmAndamento.DispMov);
|
||||
ControleMov.UltimoComando = Agora;
|
||||
ControleMov.Comandos.AddRange(Protocolos);
|
||||
|
||||
ControleAnterior.RPM = Controle.RPM;
|
||||
}
|
||||
if (ControleDir != null && Convert.ToInt32(Controle.Angulo) != Convert.ToInt32(ControleAnterior.Angulo) && (Agora - ControleDir.UltimoComando).TotalMilliseconds > ControleDir.DelayEnvioComando)
|
||||
{
|
||||
// Enviar comando DIR
|
||||
var Protocolos = EnviarProtocoloComando(Variaveis.OperacaoEmAndamento.DispDir);
|
||||
ControleDir.UltimoComando = Agora;
|
||||
ControleDir.Comandos.AddRange(Protocolos);
|
||||
|
||||
ControleAnterior.Angulo = Controle.Angulo;
|
||||
}
|
||||
if (ControleAtu != null && !Controle.BicosAtuados.Select(x => x.Atuado).SequenceEqual(ControleAnterior.BicosAtuados.Select(x => x.Atuado)) && (Agora - ControleAtu.UltimoComando).TotalMilliseconds > ControleAtu.DelayEnvioComando)
|
||||
{
|
||||
// Enviar comando ATU
|
||||
var Protocolos = EnviarProtocoloComando(Variaveis.OperacaoEmAndamento.DispAtu);
|
||||
ControleAtu.UltimoComando = Agora;
|
||||
ControleAtu.Comandos.AddRange(Protocolos);
|
||||
|
||||
ControleAnterior.BicosAtuados = new List<AtuadorBicoModel>();
|
||||
foreach (var bico in Controle.BicosAtuados)
|
||||
{
|
||||
ControleAnterior.BicosAtuados.Add(bico.Clone());
|
||||
}
|
||||
}
|
||||
|
||||
AtualizarDadosOperacao();
|
||||
}
|
||||
|
||||
public List<string> EnviarProtocoloComando(IDispositivosService Dispositivo)
|
||||
{
|
||||
if (Dispositivo == null)
|
||||
{
|
||||
return new List<string>();
|
||||
}
|
||||
|
||||
if (Dispositivo.Dispositivo == T_Code.Mov)
|
||||
{
|
||||
GeneralJoystick.RPM = Controle.RPM;
|
||||
if (Controle.RPM == 0)
|
||||
{
|
||||
Controle.Direcao = Direcao.Parado;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Controle.RPM < 0)
|
||||
{
|
||||
GeneralJoystick.RPM *= -1;
|
||||
Controle.Direcao = Direcao.Tras;
|
||||
}
|
||||
else
|
||||
{
|
||||
Controle.Direcao = Direcao.Frente;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Dispositivo.Dispositivo == T_Code.Dir)
|
||||
{
|
||||
GeneralJoystick.Angulo = Controle.Angulo;
|
||||
if (Controle.Angulo < 0)
|
||||
{
|
||||
GeneralJoystick.Angulo *= -1;
|
||||
if (ControleAnterior.Angulo < Controle.Angulo)
|
||||
{
|
||||
Controle.Direcao = Direcao.Parado;
|
||||
}
|
||||
else
|
||||
{
|
||||
Controle.Direcao = Direcao.Baixo;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ControleAnterior.Angulo > Controle.Angulo)
|
||||
{
|
||||
Controle.Direcao = Direcao.Parado;
|
||||
}
|
||||
else
|
||||
{
|
||||
Controle.Direcao = Direcao.Cima;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var Protocolos =
|
||||
Dispositivo.Dados is MovimentacaoModel ? ((MovimentacaoModel)Dispositivo.Dados).Motores.Select(x => x.ProtocoloComando(Controle.Direcao)) :
|
||||
Dispositivo.Dados is DirecionalModel ? ((DirecionalModel)Dispositivo.Dados).Motores.Select(x => x.ProtocoloComando(Controle.Direcao)) :
|
||||
Dispositivo.Dados is AtuadorModel ? ((AtuadorModel)Dispositivo.Dados).BicosPulverizadores.Select(x => x.ProtocoloComando()) :
|
||||
null;
|
||||
foreach (var ProtocoloMotor in Protocolos)
|
||||
{
|
||||
Dispositivo.EnviarDadosSerial(ProtocoloMotor);
|
||||
Task.Delay(10);
|
||||
}
|
||||
|
||||
return Protocolos.ToList();
|
||||
}
|
||||
|
||||
private void AtualizarDadosOperacao()
|
||||
{
|
||||
if (Variaveis.OperacaoEmAndamento.DispMov == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
//Sensoriamento.DistanciaPercorrida = DispMov.Dados.DistanciaPercorridaOperacao;
|
||||
Sensoriamento.ProgressoTrajeto = Variaveis.OperacaoEmAndamento.Mapa.mapaService.pythonProcess == null ? 0 : Variaveis.OperacaoEmAndamento.Sensoriamento.DistanciaPercorrida.Sum() / Variaveis.OperacaoEmAndamento.Mapa.DistanciaTotal * 100;
|
||||
if (Sensoriamento.ProgressoTrajeto < 0 && Sensoriamento.ProgressoTrajeto >= 0)
|
||||
{
|
||||
Sensoriamento.ProgressoTrajeto = 0;
|
||||
}
|
||||
Sensoriamento.ProgressoRua =
|
||||
Variaveis.OperacaoEmAndamento.Mapa == null || Variaveis.OperacaoEmAndamento.Mapa.pnlMapa == null ? 0 :
|
||||
(ReferencialRuaGPS.Direcao == DirecaoCarroRua.Ida ? ((double)ReferencialRuaGPS.IdxPontoAproximadoRua / (double)(Variaveis.OperacaoEmAndamento.Mapa.Trajetoria[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual].Count - 1)) :
|
||||
ReferencialRuaGPS.Direcao == DirecaoCarroRua.Volta ? ((double)(Variaveis.OperacaoEmAndamento.Mapa.Trajetoria[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual].Count - 1 - ReferencialRuaGPS.IdxPontoAproximadoRua) / (double)(Variaveis.OperacaoEmAndamento.Mapa.Trajetoria[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual].Count - 1)) :
|
||||
0) * 100;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void SalvarLog(bool Fim)
|
||||
{
|
||||
Logs.Add(new OperacaoMapaGPSSensoriamentoModel()
|
||||
{
|
||||
Momento = DateTime.Now,
|
||||
AtuacoesPorBico = new List<int>(Sensoriamento.AtuacoesPorBico),
|
||||
ErvasNoRadar = Sensoriamento.ErvasNoRadar,
|
||||
HerbicidaConsumido = Sensoriamento.HerbicidaConsumido,
|
||||
HerbicidaPorErva = Sensoriamento.HerbicidaPorErva,
|
||||
ProgressoTrajeto = Sensoriamento.ProgressoTrajeto,
|
||||
ProgressoRua = Sensoriamento.ProgressoRua,
|
||||
Status = ReferencialRuaGPS.StatusAtual,
|
||||
Direcao = ReferencialRuaGPS.Direcao,
|
||||
AnguloCarro = ReferencialRuaGPS.AnguloCarro,
|
||||
AnguloRua = ReferencialRuaGPS.AnguloCaminho,
|
||||
DentroDaRua = ReferencialRuaGPS.DentroDaRua,
|
||||
IdxPontoAproximadoRua = ReferencialRuaGPS.IdxPontoAproximadoRua,
|
||||
IdxRuaAtual = Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual,
|
||||
AnguloDif = Sensoriamento.AnguloDif,
|
||||
AnguloRuaCamera = Sensoriamento.AnguloRuaCamera,
|
||||
});
|
||||
if (!Directory.Exists(Variaveis.CaminhoOperacoes + Variaveis.OperacaoEmAndamento.ID))
|
||||
{
|
||||
Directory.CreateDirectory(Variaveis.CaminhoOperacoes + Variaveis.OperacaoEmAndamento.ID);
|
||||
}
|
||||
if (!File.Exists(Variaveis.CaminhoOperacoes + Variaveis.OperacaoEmAndamento.ID + "/logs.json"))
|
||||
{
|
||||
string jsonLog = JsonConvert.SerializeObject(Logs, Formatting.None);
|
||||
File.WriteAllText(Variaveis.CaminhoOperacoes + Variaveis.OperacaoEmAndamento.ID + "/logs.json", jsonLog.Substring(0, jsonLog.Length - 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
string jsonLog = JsonConvert.SerializeObject(Logs[Logs.Count - 1], Formatting.None);
|
||||
File.AppendAllText(Variaveis.CaminhoOperacoes + Variaveis.OperacaoEmAndamento.ID + "/logs.json", "," + jsonLog + (Fim ? "]" : ""));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void AtualizarControleAtuadores()
|
||||
{
|
||||
Controle.BicosAtuados = Variaveis.OperacaoEmAndamento.DispAtu.Dados.BicosPulverizadores;
|
||||
}
|
||||
|
||||
public void CalcularAnguloInclinacao()
|
||||
{
|
||||
double erroOrientacao = 0.0;
|
||||
double anguloCarro = ReferencialRuaGPS.AnguloCarro;
|
||||
double anguloOposto = (anguloCarro + 180) % 360;
|
||||
double anguloRua = ReferencialRuaGPS.AnguloCaminho;
|
||||
double anguloCamera = Sensoriamento.AnguloRuaCamera;
|
||||
|
||||
// Calcula o erro de orientação
|
||||
if ((anguloCarro + ReferencialRuaGPS.MargemErroAngulo) >= anguloRua && (anguloCarro - ReferencialRuaGPS.MargemErroAngulo) <= anguloRua)
|
||||
{
|
||||
erroOrientacao = anguloCarro - anguloRua;
|
||||
}
|
||||
else if ((anguloOposto + ReferencialRuaGPS.MargemErroAngulo) >= anguloRua && (anguloOposto - ReferencialRuaGPS.MargemErroAngulo) <= anguloRua)
|
||||
{
|
||||
erroOrientacao = anguloOposto - anguloRua;
|
||||
}
|
||||
Sensoriamento.AnguloDif = erroOrientacao;
|
||||
|
||||
// Assume-se que o anguloCamera reflete o desvio lateral.
|
||||
// Isso pode precisar de ajuste dependendo de como o ângulo é medido.
|
||||
double erroPosicaoLateral = anguloCamera;
|
||||
|
||||
// Combina os erros. Ajuste os pesos conforme necessário para o seu caso específico.
|
||||
double pesoOrientacao = 0.3;
|
||||
double pesoPosicaoLateral = 0.7;
|
||||
double erroCombinado = (erroOrientacao * pesoOrientacao) + (erroPosicaoLateral * pesoPosicaoLateral);
|
||||
|
||||
var statusAtual = ReferencialRuaGPS.StatusAtual;
|
||||
// Atualiza o PID com o erro combinado
|
||||
if (statusAtual != StatusCarroMapa.Parado && statusAtual != StatusCarroMapa.Manobrando)
|
||||
{
|
||||
Controle.PIDdirecional.Atualizar(erroCombinado);
|
||||
}
|
||||
double correcaoAngulo = Controle.PIDdirecional.Saida;
|
||||
|
||||
// Aplica a correção. Isso pode incluir limites para evitar comandos excessivos.
|
||||
Controle.Angulo = correcaoAngulo;
|
||||
}
|
||||
|
||||
public void CalculaDadosMovimentacaoAutonoma()
|
||||
{
|
||||
CalcularAnguloInclinacao();
|
||||
|
||||
var statusAtual = ReferencialRuaGPS.StatusAtual;
|
||||
|
||||
if (statusAtual == StatusCarroMapa.Parado)
|
||||
{
|
||||
var BicosNaoAtuados = new List<AtuadorBicoModel>(Variaveis.OperacaoEmAndamento.DispAtu.Dados.BicosPulverizadores);
|
||||
BicosNaoAtuados.ForEach(x => x.Atuado = false);
|
||||
Controle.BicosAtuados = BicosNaoAtuados.ToList();
|
||||
Controle.RPM = 0;
|
||||
Controle.Angulo = 0;
|
||||
}
|
||||
else if (statusAtual == StatusCarroMapa.Direcionando)
|
||||
{
|
||||
Controle.RPM = Controle.RPM_Max;
|
||||
}
|
||||
else if (statusAtual == StatusCarroMapa.EntrandoRua)
|
||||
{
|
||||
Controle.RPM = Controle.RPM_Min;
|
||||
}
|
||||
else if (statusAtual == StatusCarroMapa.SaindoRua)
|
||||
{
|
||||
Controle.RPM = Controle.RPM_Min;
|
||||
}
|
||||
else if (statusAtual == StatusCarroMapa.CaminhandoRua)
|
||||
{
|
||||
if (Sensoriamento.ErvasNoRadar == 0)
|
||||
{
|
||||
Controle.RPM = Controle.RPM_Max;
|
||||
}
|
||||
else
|
||||
{
|
||||
Controle.RPM = Convert.ToInt32(Controle.RPM_Max * 0.85);
|
||||
}
|
||||
|
||||
double margemAngulo = 5;
|
||||
if (Controle.Angulo > margemAngulo || Controle.Angulo < (margemAngulo * -1))
|
||||
{
|
||||
Controle.RPM = Controle.RPM_Min;
|
||||
}
|
||||
}
|
||||
else if (statusAtual == StatusCarroMapa.Manobrando)
|
||||
{
|
||||
Controle.RPM = 0;
|
||||
CalcularManobra();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void CalcularManobra()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void AtualizarRuasSelecionadas()
|
||||
{
|
||||
List<string> ids = new List<string>();
|
||||
var Topico = Variaveis.MqttService.Topicos.FirstOrDefault(x => x.Topico == MapasVariaveisModel.TopicoSelecaoRuasMapa);
|
||||
var Mensagem = Topico.Mensagens.LastOrDefault();
|
||||
if (Mensagem != null && !Mensagem.Mensagem.Contains("[]"))
|
||||
{
|
||||
Mensagem.Mensagem = Mensagem.Mensagem.Replace("\n", "");
|
||||
Mensagem.Mensagem = Mensagem.Mensagem.Replace("\"", "");
|
||||
ids = JsonConvert.DeserializeObject<int[]>(Mensagem.Mensagem).Select(x => x.ToString()).ToList();
|
||||
}
|
||||
if (ids.Count != Variaveis.OperacaoEmAndamento.Mapa.RuasPercorrer.Count)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Mapa.RuasPercorrer = ids;
|
||||
Variaveis.OperacaoEmAndamento.Mapa.PopularTrajetoria();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class OperacaoRefRuaGPS
|
||||
{
|
||||
public bool ManobraConcluida { get; set; } = false;
|
||||
private StatusCarroMapa _EtapaAtual;
|
||||
public StatusCarroMapa StatusAtual
|
||||
{
|
||||
get
|
||||
{
|
||||
StatusCarroMapa etapaAtual = _EtapaAtual;
|
||||
|
||||
// Se o status da operação não estiver Em Andamento
|
||||
if (Variaveis.OperacaoEmAndamento.StatusAtual != StatusOperacao.EmAndamento)
|
||||
{
|
||||
etapaAtual = StatusCarroMapa.Parado;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Robô está manobrando para seguir a próxima rota do mapa
|
||||
if (_EtapaAtual == StatusCarroMapa.Manobrando)
|
||||
{
|
||||
// Aguarda a mudança de rua até que o robô tenha terminado a manobra e tenha ficado parado em frente à rua
|
||||
if (ManobraConcluida && Direcao == DirecaoCarroRua.Parado)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual++;
|
||||
ManobraConcluida = false;
|
||||
etapaAtual = StatusCarroMapa.EntrandoRua;
|
||||
GPSService.AtualizaLeituraSimulacao();
|
||||
Task.Delay(500);
|
||||
}
|
||||
}
|
||||
// Se o robô não estiver dentro da entrelinha de cana
|
||||
else if (!DentroDaRua)
|
||||
{
|
||||
// Está próximo o bastante e alinhado para entrar na rua
|
||||
if (NaMargemEntradaRua)
|
||||
{
|
||||
// Está mais próximo do ponto inicial da rota, e a direção do carro é IDA ou então PARADO, logo está entrando na rua, do começo para o final
|
||||
if (ExtremoMaisProximo == 0 && (Direcao == DirecaoCarroRua.Ida || Direcao == DirecaoCarroRua.Parado) && etapaAtual != StatusCarroMapa.SaindoRua)
|
||||
{
|
||||
etapaAtual = StatusCarroMapa.EntrandoRua;
|
||||
}
|
||||
// Está mais próximo do ponto final da rota, e a direção do carro é VOLTA ou então PARADO, logo está entrando na rua, do final para o começo
|
||||
else if (ExtremoMaisProximo == 1 && (Direcao == DirecaoCarroRua.Volta || Direcao == DirecaoCarroRua.Parado) && etapaAtual != StatusCarroMapa.SaindoRua)
|
||||
{
|
||||
etapaAtual = StatusCarroMapa.EntrandoRua;
|
||||
}
|
||||
// Robô não está entrando na rua do começo para o fim, nem do fim para o começo
|
||||
else
|
||||
{
|
||||
// Se a etapa anterior era CaminhandoRua, ou seja, robô estava na rua e agora não está mais, então esta saindo da rua
|
||||
if (_EtapaAtual == StatusCarroMapa.CaminhandoRua)
|
||||
{
|
||||
etapaAtual = StatusCarroMapa.SaindoRua;
|
||||
}
|
||||
// Se a etapa anterior não for CaminhandoRua, então significa que ele já iniciou a etapa de sair da rua
|
||||
else
|
||||
{
|
||||
// Ainda tem ruas a serem percorridas, logo, o robô precisa realizar a manobra para seguir para a próxima rua
|
||||
if (!Variaveis.OperacaoEmAndamento.OpMapaGPS.Concluido)
|
||||
{
|
||||
etapaAtual = StatusCarroMapa.Manobrando;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Estará se direcionando para o ponto inicial
|
||||
else
|
||||
{
|
||||
etapaAtual = StatusCarroMapa.Direcionando;
|
||||
}
|
||||
}
|
||||
// Se o robô estiver dentro da entrelinha da cana
|
||||
else if (DentroDaRua)
|
||||
{
|
||||
etapaAtual = StatusCarroMapa.CaminhandoRua;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_EtapaAtual = etapaAtual;
|
||||
|
||||
_EtapaAtual = StatusCarroMapa.Direcionando;
|
||||
|
||||
return _EtapaAtual;
|
||||
}
|
||||
}
|
||||
/*public StatusOperacaoMapaGPS StatusAtual
|
||||
{
|
||||
get
|
||||
{
|
||||
StatusOperacaoMapaGPS etapaAtual = _EtapaAtual;
|
||||
|
||||
// Se a operação não estiver iniciada
|
||||
if (!Variaveis.OperacaoEmAndamento.Iniciado)
|
||||
{
|
||||
// Etapa atual não é Finalizado, então a etapa é Parametrizando
|
||||
if (_EtapaAtual != StatusOperacaoMapaGPS.Concluida)
|
||||
{
|
||||
etapaAtual = StatusOperacaoMapaGPS.Parametrizando;
|
||||
}
|
||||
}
|
||||
// Operação em andamento
|
||||
else
|
||||
{
|
||||
// Se a operação tiver algum item mandatório interrompido
|
||||
if (!Variaveis.OperacaoEmAndamento.OperacaoLiberada)
|
||||
{
|
||||
// Da primeira vez, salva a etapa atual anterior à parada para possível retomada
|
||||
if (etapaAtual != StatusOperacaoMapaGPS.Parado)
|
||||
{
|
||||
_EtapaAnteriorParada = etapaAtual;
|
||||
}
|
||||
etapaAtual = StatusOperacaoMapaGPS.Parado;
|
||||
}
|
||||
// Se a etapa atual for parado, mas a operação foi liberada, retoma de onde parou
|
||||
else if (etapaAtual == StatusOperacaoMapaGPS.Parado && Variaveis.OperacaoEmAndamento.OperacaoLiberada)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.TempoAguardando = DateTime.Now;
|
||||
etapaAtual = StatusOperacaoMapaGPS.Aguardando;
|
||||
}
|
||||
// Etapa atual é finalizada, então finaliza a operação
|
||||
else if (_EtapaAtual == StatusOperacaoMapaGPS.Concluida)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.FinalizarOperacao();
|
||||
}
|
||||
// Contagem regressiva para iniciar a operação
|
||||
else if (Variaveis.OperacaoEmAndamento.TempoAguardando.AddSeconds(Variaveis.OperacaoEmAndamento.TempoIniciarOperacao) > DateTime.Now)
|
||||
{
|
||||
etapaAtual = StatusOperacaoMapaGPS.Aguardando;
|
||||
}
|
||||
else if (_EtapaAnteriorParada != StatusOperacaoMapaGPS.Parado)
|
||||
{
|
||||
etapaAtual = _EtapaAnteriorParada;
|
||||
_EtapaAnteriorParada = StatusOperacaoMapaGPS.Parado;
|
||||
}
|
||||
// Robô está manobrando para seguir a próxima rota do mapa
|
||||
else if (_EtapaAtual == StatusOperacaoMapaGPS.Manobrando)
|
||||
{
|
||||
// Aguarda a mudança de rua até que o robô tenha terminado a manobra e tenha ficado parado em frente à rua
|
||||
if (ManobraConcluida && Direcao == DirecaoCarroRua.Parado)
|
||||
{
|
||||
Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual++;
|
||||
ManobraConcluida = false;
|
||||
etapaAtual = StatusOperacaoMapaGPS.EntrandoRua;
|
||||
GPSService.AtualizaLeituraSimulacao();
|
||||
Task.Delay(500);
|
||||
}
|
||||
}
|
||||
// Se o robô não estiver dentro da entrelinha de cana
|
||||
else if (!DentroDaRua)
|
||||
{
|
||||
// Está mais próximo do ponto inicial da rota, e a direção do carro é IDA ou então PARADO, logo está entrando na rua, do começo para o final
|
||||
if (ExtremoMaisProximo == 0 && (Direcao == DirecaoCarroRua.Ida || Direcao == DirecaoCarroRua.Parado) && etapaAtual != StatusOperacaoMapaGPS.SaindoRua)
|
||||
{
|
||||
etapaAtual = StatusOperacaoMapaGPS.EntrandoRua;
|
||||
}
|
||||
// Está mais próximo do ponto final da rota, e a direção do carro é VOLTA ou então PARADO, logo está entrando na rua, do final para o começo
|
||||
else if (ExtremoMaisProximo == 1 && (Direcao == DirecaoCarroRua.Volta || Direcao == DirecaoCarroRua.Parado) && etapaAtual != StatusOperacaoMapaGPS.SaindoRua)
|
||||
{
|
||||
etapaAtual = StatusOperacaoMapaGPS.EntrandoRua;
|
||||
}
|
||||
// Robô não está entrando na rua do começo para o fim, nem do fim para o começo
|
||||
else
|
||||
{
|
||||
// Se a etapa anterior era CaminhandoRua, ou seja, robô estava na rua e agora não está mais, então esta saindo da rua
|
||||
if (_EtapaAtual == StatusOperacaoMapaGPS.CaminhandoRua)
|
||||
{
|
||||
etapaAtual = StatusOperacaoMapaGPS.SaindoRua;
|
||||
}
|
||||
// Se a etapa anterior não for CaminhandoRua, então significa que ele já iniciou a etapa de sair da rua
|
||||
else
|
||||
{
|
||||
// O índice de rua para realizar o trabalho já ultrapassou a quantidade de ruas definidas pelo operador, então a operação foi concluída
|
||||
if (Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual >= Variaveis.OperacaoEmAndamento.Mapa.Trajetoria.Count - 1)
|
||||
{
|
||||
etapaAtual = StatusOperacaoMapaGPS.Concluida;
|
||||
}
|
||||
// Ainda tem ruas a serem percorridas, logo, o robô precisa realizar a manobra para seguir para a próxima rua
|
||||
else
|
||||
{
|
||||
etapaAtual = StatusOperacaoMapaGPS.Manobrando;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Se o robô estiver dentro da entrelinha da cana
|
||||
else if (DentroDaRua)
|
||||
{
|
||||
etapaAtual = StatusOperacaoMapaGPS.CaminhandoRua;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_EtapaAtual = etapaAtual;
|
||||
|
||||
return etapaAtual;
|
||||
}
|
||||
}*/
|
||||
public int PontosConsiderarAngulo { get; set; } = 2;
|
||||
public double Distancia { get; set; } = 0;
|
||||
public double AnguloCarro
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Variaveis.OperacaoEmAndamento.DispSen._Porta.IsOpen && Variaveis.OperacaoEmAndamento.DispSen.Dados.Sensores.Any(x => x.Componente == S_Code.sMAG && x.Inicializado))
|
||||
{
|
||||
return Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarroBussola;
|
||||
}
|
||||
else
|
||||
{
|
||||
return AnguloCarroGPS;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double AnguloCarroGPS
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
double somaAngulo = 0;
|
||||
var Pontos = !Variaveis.OperacaoEmAndamento.GPSTrajetoriaRua.Any() || Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual >= Variaveis.OperacaoEmAndamento.GPSTrajetoriaRua.Count() ? new List<GPSModel>() :
|
||||
Variaveis.OperacaoEmAndamento.GPSTrajetoriaRua[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual].Count > PontosConsiderarAngulo ?
|
||||
Variaveis.OperacaoEmAndamento.GPSTrajetoriaRua[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual].OrderByDescending(x => x.DataHora).Take(PontosConsiderarAngulo).ToList() :
|
||||
Variaveis.OperacaoEmAndamento.GPSTrajetoriaRua[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual].OrderByDescending(x => x.DataHora).ToList();
|
||||
Pontos = Pontos.OrderBy(x => x.DataHora).ToList();
|
||||
for (int i = 0; i < Pontos.Count - 1; i++)
|
||||
{
|
||||
somaAngulo += GPSService.CalcularOrientacao(Pontos[i + 1], Pontos[i]);
|
||||
}
|
||||
double mediaAngulo = somaAngulo / (Pontos.Count - 1);
|
||||
|
||||
return (!(mediaAngulo >= 0 || mediaAngulo <= 0)) ? 0 : mediaAngulo;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double AnguloCaminho
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_EtapaAtual == StatusCarroMapa.Direcionando)
|
||||
{
|
||||
/*GPSModel PontoRua = ExtremoMaisProximo == 0 ? PrimeiroPontoRua : UltimoPontoRua;
|
||||
double anguloCaminho = GPSService.CalcularOrientacao(GPSService.UltimaLeitura, PontoRua);
|
||||
return anguloCaminho;*/
|
||||
double somaAnguloRua = 0;
|
||||
var Rua = Variaveis.OperacaoEmAndamento.Mapa.TrajetoriaDinamica;
|
||||
|
||||
|
||||
var PontosRua = PontosConsiderarAngulo < Rua.Count ?
|
||||
Rua.Take(PontosConsiderarAngulo).ToList() :
|
||||
Rua.Skip(PontosConsiderarAngulo).ToList();
|
||||
|
||||
for (int i = 0; i < PontosRua.Count - 1; i++)
|
||||
{
|
||||
somaAnguloRua += GPSService.CalcularOrientacao(PontosRua[i + 1], PontosRua[i]);
|
||||
}
|
||||
double mediaAnguloRua = somaAnguloRua / (PontosRua.Count - 1);
|
||||
|
||||
return (!(mediaAnguloRua >= 0 || mediaAnguloRua <= 0)) ? 0 : mediaAnguloRua;
|
||||
}
|
||||
else
|
||||
{
|
||||
double somaAnguloRua = 0;
|
||||
var Rua = Variaveis.OperacaoEmAndamento.Mapa.Trajetoria.Skip(Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual).First();
|
||||
|
||||
|
||||
var PontosRua = IdxPontoAproximadoRua + PontosConsiderarAngulo < Rua.Count ?
|
||||
Rua.Skip(IdxPontoAproximadoRua).Take(PontosConsiderarAngulo).ToList() :
|
||||
Rua.Skip(IdxPontoAproximadoRua - PontosConsiderarAngulo).ToList();
|
||||
|
||||
/*var Pontos = Rua.Count > PontosConsiderarAngulo ?
|
||||
Rua.OrderByDescending(x => x.DataHora).Take(PontosConsiderarAngulo).ToList() :
|
||||
Rua.OrderByDescending(x => x.DataHora).ToList();*/
|
||||
|
||||
|
||||
for (int i = 0; i < PontosRua.Count - 1; i++)
|
||||
{
|
||||
somaAnguloRua += GPSService.CalcularOrientacao(PontosRua[i + 1], PontosRua[i]);
|
||||
}
|
||||
double mediaAnguloRua = somaAnguloRua / (PontosRua.Count - 1);
|
||||
|
||||
return (!(mediaAnguloRua >= 0 || mediaAnguloRua <= 0)) ? 0 : mediaAnguloRua;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double MargemErroAngulo { get; set; } = 45;
|
||||
public DirecaoCarroRua Direcao
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
if (GPSService.UltimaLeitura.Latitude == GPSService.PenultimaLeitura.Latitude && GPSService.UltimaLeitura.Longitude == GPSService.PenultimaLeitura.Longitude && GPSService.UltimaLeitura.DataHora > GPSService.PenultimaLeitura.DataHora)
|
||||
{
|
||||
return DirecaoCarroRua.Parado;
|
||||
}
|
||||
double mediaAngulo = AnguloCarro;
|
||||
double anguloOposto = (mediaAngulo + 180) % 360;
|
||||
double mediaAnguloRua = AnguloCaminho;
|
||||
|
||||
if ((mediaAngulo + MargemErroAngulo) >= mediaAnguloRua && (mediaAngulo - MargemErroAngulo) <= mediaAnguloRua)
|
||||
{
|
||||
return DirecaoCarroRua.Ida;
|
||||
}
|
||||
else if ((anguloOposto + MargemErroAngulo) >= mediaAnguloRua && (anguloOposto - MargemErroAngulo) <= mediaAnguloRua)
|
||||
{
|
||||
return DirecaoCarroRua.Volta;
|
||||
}
|
||||
else
|
||||
{
|
||||
return DirecaoCarroRua.Parado;
|
||||
}
|
||||
}
|
||||
}
|
||||
public GPSModel PrimeiroPontoRua
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
var primeiroPontoRua = Variaveis.OperacaoEmAndamento.Mapa.Trajetoria.Skip(Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual).First().First();
|
||||
return primeiroPontoRua;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new GPSModel();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public GPSModel UltimoPontoRua
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
var ultimoPontoRua = Variaveis.OperacaoEmAndamento.Mapa.Trajetoria.Skip(Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual).First().Last();
|
||||
return ultimoPontoRua;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new GPSModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
public bool DentroDaRua
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Variaveis.OperacaoEmAndamento.Mapa.RuasPercorrer.Count() > Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual)
|
||||
{
|
||||
try
|
||||
{
|
||||
string IDruaAtual = Variaveis.OperacaoEmAndamento.Mapa.RuasPercorrer[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual];
|
||||
var Rua = Variaveis.OperacaoEmAndamento.Mapa.mapaService.DadosMapa.features.Where(x => x.geometry.id == IDruaAtual).FirstOrDefault();
|
||||
if (Rua != null)
|
||||
{
|
||||
bool dentro = false;
|
||||
List<GPSModel> Trecho = new List<GPSModel>();
|
||||
var PontosRua = Variaveis.OperacaoEmAndamento.Mapa.Trajetoria[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual].ToList();
|
||||
int idx = Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.IdxPontoAproximadoRua;
|
||||
if (Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual % 2 != 0)
|
||||
{
|
||||
PontosRua.Reverse();
|
||||
idx = idx != (PontosRua.Count - 1) ? (PontosRua.Count - 1) - idx : idx;
|
||||
}
|
||||
for (int i = 0; i <= idx; i++)
|
||||
{
|
||||
Trecho.Add(PontosRua[i]);
|
||||
}
|
||||
double distTrecho = GPSService.DistanciaDoTrecho(Trecho);
|
||||
dentro = distTrecho > 0 && distTrecho < Rua.properties.Length;
|
||||
|
||||
return dentro;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
public int ExtremoMaisProximo
|
||||
{
|
||||
get
|
||||
{
|
||||
double distPP = GPSService.DistanciaEntrePontos(GPSService.UltimaLeitura, PrimeiroPontoRua);
|
||||
double distUP = GPSService.DistanciaEntrePontos(GPSService.UltimaLeitura, UltimoPontoRua);
|
||||
|
||||
// 0 para mais próximo do primeiro ponto da rua (ENTRANDO)
|
||||
// 1 para mais próximo do último ponto da rua (SAINDO)
|
||||
return (distPP < distUP) ? 0 : 1;
|
||||
}
|
||||
}
|
||||
private DateTime UltimaLeituraDistancia;
|
||||
private int idxPontoAproximadoRua = 0;
|
||||
public int IdxPontoAproximadoRua
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
if (UltimaLeituraDistancia == null)
|
||||
{
|
||||
UltimaLeituraDistancia = DateTime.Now.Add(new TimeSpan(0, 0, -10));
|
||||
}
|
||||
else if (UltimaLeituraDistancia.Add(new TimeSpan(0, 0, 5)) < DateTime.Now)
|
||||
{
|
||||
int idx = -1;
|
||||
double menorDistancia = 9999;
|
||||
double distanciaAnterior = 9999;
|
||||
|
||||
var Rua = Variaveis.OperacaoEmAndamento.Mapa.Trajetoria[Variaveis.OperacaoEmAndamento.Mapa.IdxRuaAtual];
|
||||
|
||||
foreach (var Ponto in Rua)
|
||||
{
|
||||
double dist = GPSService.DistanciaEntrePontos(GPSService.UltimaLeitura, Ponto);
|
||||
if (dist < menorDistancia)
|
||||
{
|
||||
menorDistancia = dist;
|
||||
idx = Rua.IndexOf(Ponto);
|
||||
}
|
||||
else if (dist > distanciaAnterior)
|
||||
{
|
||||
break;
|
||||
}
|
||||
distanciaAnterior = dist;
|
||||
}
|
||||
idxPontoAproximadoRua = idx;
|
||||
|
||||
UltimaLeituraDistancia = DateTime.Now;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
return idxPontoAproximadoRua;
|
||||
}
|
||||
}
|
||||
public double MargemLimiteEntradaRua { get; } = 2.0;
|
||||
public bool NaMargemEntradaRua
|
||||
{
|
||||
get
|
||||
{
|
||||
bool NaMargem = false;
|
||||
GPSModel PontoRua = ExtremoMaisProximo == 0 ? PrimeiroPontoRua : UltimoPontoRua;
|
||||
double Distancia = GPSService.DistanciaEntrePontos(GPSService.UltimaLeitura, PontoRua);
|
||||
|
||||
if (Distancia <= MargemLimiteEntradaRua)
|
||||
{
|
||||
NaMargem = true;
|
||||
}
|
||||
|
||||
return NaMargem;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class OperacaoMapaGPSSensoriamentoModel
|
||||
{
|
||||
public DateTime Momento { get; set; }
|
||||
public int ErvasNoRadar { get; set; } = 0;
|
||||
public double HerbicidaConsumido { get; set; } = 0;
|
||||
public double HerbicidaPorErva { get; set; } = 0;
|
||||
public int ErvasIdentificadas
|
||||
{
|
||||
get
|
||||
{
|
||||
return AtuacoesPorBico.Sum();
|
||||
}
|
||||
}
|
||||
public List<int> AtuacoesPorBico { get; set; } = new List<int>();
|
||||
public double ProgressoTrajeto { get; set; } = 0;
|
||||
public double ProgressoRua { get; set; } = 0;
|
||||
public StatusCarroMapa Status { get; set; } = StatusCarroMapa.Parado;
|
||||
public double AnguloCarro { get; set; } = 0;
|
||||
public double AnguloRua { get; set; } = 0;
|
||||
public double AnguloRuaCamera { get; set; } = 0;
|
||||
public double AnguloDif { get; set; } = 0;
|
||||
public DirecaoCarroRua Direcao { get; set; } = DirecaoCarroRua.Parado;
|
||||
public bool DentroDaRua { get; set; } = false;
|
||||
public int IdxPontoAproximadoRua { get; set; } = 0;
|
||||
public int IdxRuaAtual { get; set; } = 0;
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,643 @@
|
|||
using AgroBase.Models.Modules;
|
||||
using AgroBase.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static AgroBase.Models.Enuns;
|
||||
|
||||
namespace AgroBase.Models
|
||||
{
|
||||
public class SonarModel
|
||||
{
|
||||
public SonarModel(PictureBox pictureSonar)
|
||||
{
|
||||
picSonar = pictureSonar;
|
||||
}
|
||||
|
||||
|
||||
public List<SonarRegistroModel> Deteccoes { get; set; } = new List<SonarRegistroModel>();
|
||||
public List<SonarObstaculoDetectadoModel> ObstaculosDetectados { get; set; } = new List<SonarObstaculoDetectadoModel>();
|
||||
public int maxDistanceCm { get; set; } = 200;
|
||||
public static int anguloAcrescentar { get; set; } = 5;
|
||||
public int PosicaoAtual { get; set; } = 0;
|
||||
public static int AnguloDesvioMaximo { get; set; } = 60;
|
||||
public static double MargemSegurancaDesvio { get; set; } = 5;
|
||||
private int LarguraMinimaObstaculo { get; set; } = 10;
|
||||
public bool DesvioNecessario { get; set;} = false;
|
||||
public double DistanciaEsquerda { get; set; }
|
||||
public double DistanciaDireita { get; set; }
|
||||
|
||||
|
||||
#region Informacoes Visiais
|
||||
|
||||
PictureBox picSonar;
|
||||
int radarRadiusPixels = 0; // Raio do radar em pixels
|
||||
double pixelsPerCm = 0; // Calcula pixels por cm
|
||||
int leiturasManter = 20;
|
||||
|
||||
public void AtualizarSonar()
|
||||
{
|
||||
// Atualiza o desenho do radar
|
||||
DrawRadar();
|
||||
ProcessarDados();
|
||||
}
|
||||
private void DrawRadar()
|
||||
{
|
||||
radarRadiusPixels = ((picSonar.Height < picSonar.Width ? picSonar.Height : picSonar.Width) / 2) - 50; // Raio do radar em pixels
|
||||
pixelsPerCm = radarRadiusPixels / (double)maxDistanceCm; // Calcula pixels por cm
|
||||
|
||||
Bitmap bmp = new Bitmap(picSonar.Width, picSonar.Height);
|
||||
Graphics g = Graphics.FromImage(bmp);
|
||||
g.Clear(Color.Black);
|
||||
|
||||
int centerX = picSonar.Width / 2;
|
||||
int centerY = picSonar.Height / 2;
|
||||
|
||||
// Desenha a grade e os ângulos
|
||||
DrawGrid(g, centerX, centerY);
|
||||
DrawAngles(g, centerX, centerY);
|
||||
|
||||
var detections = Deteccoes.First(x => x.Posicao == PosicaoAtual).Leituras.OrderByDescending(d => d.Momento);
|
||||
// Aqui continua o código para desenhar as detecções e o arco do sonar...
|
||||
// Filtra e mantém apenas as últimas 2 detecções de cada ângulo
|
||||
var recentDetections = detections.ToList();
|
||||
int i = 0;
|
||||
foreach (var detection in recentDetections)
|
||||
{
|
||||
// Ajusta a distância para a escala do display
|
||||
double scaledDistance = (i == 0 ? maxDistanceCm : detection.Distancia) * pixelsPerCm;
|
||||
|
||||
// Calcula as posições finais ajustadas para a escala
|
||||
int x = (int)(Math.Cos(detection.Angulo * Math.PI / 180) * scaledDistance);
|
||||
int y = (int)(Math.Sin(detection.Angulo * Math.PI / 180) * scaledDistance);
|
||||
|
||||
// Desenha uma linha do centro até o ponto detectado, ajustado para a escala
|
||||
g.DrawLine(i == 0 ? new Pen(Color.Red, 7) : Pens.Red, centerX, centerY, centerX + x, centerY - y);
|
||||
i++;
|
||||
}
|
||||
|
||||
// Desenha os obstáculos detectados
|
||||
DrawObstacles(g, centerX, centerY);
|
||||
|
||||
// Adiciona as novas informações visuais aqui
|
||||
DrawAdditionalInfo(g, detections.First().Angulo, detections.First().Distancia);
|
||||
|
||||
// Desenha a trajetória de desvio
|
||||
DrawTrajectory(g, centerX, centerY);
|
||||
|
||||
// Ao final, atribui o bitmap ao PictureBox
|
||||
picSonar.Image?.Dispose(); // Libera o recurso da imagem anterior
|
||||
picSonar.Image = bmp;
|
||||
}
|
||||
|
||||
private void DrawGrid(Graphics g, int centerX, int centerY)
|
||||
{
|
||||
int scaleDistanceCm = 50; // Distância em cm que cada círculo da grade representa
|
||||
|
||||
// Calcula o espaçamento entre as linhas da grade em pixels
|
||||
int stepPixels = (int)(scaleDistanceCm * pixelsPerCm);
|
||||
|
||||
// Desenha linhas circulares baseadas na escala
|
||||
for (int r = stepPixels; r <= radarRadiusPixels; r += stepPixels)
|
||||
{
|
||||
g.DrawEllipse(Pens.Gray, centerX - r, centerY - r, 2 * r, 2 * r);
|
||||
|
||||
// Calcula a posição da legenda
|
||||
int legendX = centerX + 5; // Um pequeno deslocamento à direita do centro
|
||||
int legendY = centerY + r - 10; // Posiciona acima da linha da grade
|
||||
|
||||
// Desenha a legenda de distância
|
||||
string legendText = $"{(r / pixelsPerCm).ToString("0")} cm";
|
||||
g.DrawString(legendText, new Font("Arial", 8), Brushes.White, legendX, legendY);
|
||||
}
|
||||
|
||||
// Desenha linhas radiais (Opcional: ajuste conforme necessário)
|
||||
for (int angle = 0; angle < 360; angle += 30)
|
||||
{
|
||||
double radian = angle * Math.PI / 180;
|
||||
int x = (int)(Math.Cos(radian) * radarRadiusPixels);
|
||||
int y = (int)(Math.Sin(radian) * radarRadiusPixels);
|
||||
g.DrawLine(Pens.Gray, centerX, centerY, centerX + x, centerY - y);
|
||||
}
|
||||
|
||||
// Desenha o arco do sonar
|
||||
g.DrawEllipse(Pens.Green, centerX - radarRadiusPixels, centerY - radarRadiusPixels, radarRadiusPixels * 2, radarRadiusPixels * 2);
|
||||
}
|
||||
|
||||
private void DrawAngles(Graphics g, int centerX, int centerY)
|
||||
{
|
||||
int radius = radarRadiusPixels + 10; // Posiciona o texto um pouco fora do radar para não sobrepor as linhas
|
||||
using (Font font = new Font("Arial", 8))
|
||||
{
|
||||
for (int angle = 0; angle <= 180; angle += 30) // Ajuste o passo conforme necessário
|
||||
{
|
||||
// Ajuste aqui para o sentido anti-horário
|
||||
double radian = (360 - angle) * Math.PI / 180;
|
||||
int x = (int)(Math.Cos(radian) * radius) + centerX;
|
||||
int y = (int)(Math.Sin(radian) * radius) + centerY;
|
||||
|
||||
// Ajusta a posição do texto para melhor alinhamento
|
||||
SizeF textSize = g.MeasureString(angle.ToString(), font);
|
||||
g.DrawString(angle.ToString(), font, Brushes.White, x - textSize.Width / 2, y - textSize.Height / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawObstacles(Graphics g, int centerX, int centerY)
|
||||
{
|
||||
// Desenha obstáculos detectados
|
||||
foreach (var obstaculo in ObstaculosDetectados)
|
||||
{
|
||||
// Calcula a posição e o tamanho do obstáculo no radar
|
||||
double anguloInicialRad = obstaculo.AnguloInicial * Math.PI / 180;
|
||||
double anguloFinalRad = obstaculo.AnguloFinal * Math.PI / 180;
|
||||
|
||||
// Calcula a largura do obstáculo no radar em pixels
|
||||
double larguraObstaculoPixels = obstaculo.Largura * pixelsPerCm;
|
||||
int posicaoAtual = Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.PosicaoAtual;
|
||||
var deteccoes = Variaveis.OperacaoEmAndamento.Sensoriamento.SonarFrontal.Deteccoes.First(x => x.Posicao == posicaoAtual).Leituras.OrderBy(x => x.Angulo).ToList();
|
||||
var leituraInicial = deteccoes.First(x => x.Angulo == obstaculo.AnguloInicial);
|
||||
var leituraFinal = deteccoes.First(x => x.Angulo == obstaculo.AnguloFinal);
|
||||
int idxPontoInicial = deteccoes.IndexOf(leituraInicial);
|
||||
int idxPontoFinal = deteccoes.IndexOf(leituraFinal);
|
||||
|
||||
List<Point> pontos = new List<Point>();
|
||||
for (int i = idxPontoInicial; i <= idxPontoFinal; i++)
|
||||
{
|
||||
double anguloRad = deteccoes[i].Angulo * Math.PI / 180;
|
||||
var ponto = new Point(centerX + (int)(Math.Cos(anguloRad) * deteccoes[i].Distancia),
|
||||
centerY - (int)(Math.Sin(anguloRad) * deteccoes[i].Distancia));
|
||||
pontos.Add(ponto);
|
||||
}
|
||||
|
||||
pontos.Add(new Point(
|
||||
pontos[pontos.Count - 1].X + (int)(Math.Cos(anguloFinalRad) * larguraObstaculoPixels),
|
||||
pontos[pontos.Count - 1].Y - (int)(Math.Sin(anguloFinalRad) * larguraObstaculoPixels))
|
||||
);
|
||||
pontos.Add(new Point(
|
||||
pontos[0].X + (int)(Math.Cos(anguloInicialRad) * larguraObstaculoPixels),
|
||||
pontos[0].Y - (int)(Math.Sin(anguloInicialRad) * larguraObstaculoPixels))
|
||||
);
|
||||
|
||||
g.FillPolygon(Brushes.Yellow, pontos.ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawAdditionalInfo(Graphics g, double angulo, double distancia)
|
||||
{
|
||||
// Adiciona a informação de ângulo e distância atuais
|
||||
string infoText = $"Posição: {PosicaoAtual}, Ângulo: {angulo}°, Distância: {distancia} cm";
|
||||
// Escolha a posição onde deseja que o texto apareça. Exemplo: canto superior esquerdo.
|
||||
int infoPosX = 10; // 10 pixels do canto esquerdo
|
||||
int infoPosY = 10; // 10 pixels do topo
|
||||
g.DrawString(infoText, new Font("Arial", 10), Brushes.White, infoPosX, infoPosY);
|
||||
string distText = $"DE: {DistanciaEsquerda.ToString("0.0")} cm, DD: {DistanciaDireita.ToString("0.0")} cm";
|
||||
g.DrawString(distText, new Font("Arial", 7), Brushes.White, picSonar.Width - 180, picSonar.Height - 20);
|
||||
|
||||
// Verifica se há obstáculos detectados para evitar erros
|
||||
if (ObstaculosDetectados.Any())
|
||||
{
|
||||
SonarObstaculoDetectadoModel obstaculoCritico = ObstaculosDetectados.OrderBy(o => o.DistanciaMedia).First();
|
||||
|
||||
string anguloDesvioText = $"Ângulo de Desvio: {obstaculoCritico.AnguloParaDesvio.ToString("0.00")}°";
|
||||
string distanciaObstaculoText = $"Distância até Obstáculo: {obstaculoCritico.DistanciaMedia.ToString("0.00")} cm";
|
||||
string larguraObstaculoText = $"Largura do Obstáculo: {obstaculoCritico.Largura.ToString("0.00")} cm";
|
||||
string tempoColisaoText = $"Tempo até Colisão: {obstaculoCritico.TempoAteColisao.ToString("0.00")} s";
|
||||
string direcaoDesvioText = $"Direção para Desvio: {obstaculoCritico.DirecaoDesvio.ToString()}";
|
||||
|
||||
// Define a posição inicial para as informações adicionais
|
||||
int startX = 10;
|
||||
int startY = picSonar.Height - 100; // Ajuste conforme necessário para não sobrepor outros elementos
|
||||
|
||||
// Desenha o texto no radar
|
||||
g.DrawString(anguloDesvioText, new Font("Arial", 10), Brushes.White, startX, startY);
|
||||
g.DrawString(distanciaObstaculoText, new Font("Arial", 10), Brushes.White, startX, startY + 20);
|
||||
g.DrawString(larguraObstaculoText, new Font("Arial", 10), Brushes.White, startX, startY + 40);
|
||||
g.DrawString(tempoColisaoText, new Font("Arial", 10), Brushes.White, startX, startY + 60);
|
||||
g.DrawString(direcaoDesvioText, new Font("Arial", 10), Brushes.White, startX, startY + 80);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawTrajectory(Graphics g, int centerX, int centerY)
|
||||
{
|
||||
if (DesvioNecessario)
|
||||
{
|
||||
SonarObstaculoDetectadoModel obstaculoCritico = ObstaculosDetectados.OrderBy(o => o.DistanciaMedia).First();
|
||||
|
||||
// Calcula o ângulo final considerando o ângulo de desvio
|
||||
double anguloDesvioRad = (obstaculoCritico.AnguloParaDesvio + 90) * (Math.PI / 180); // +90 para ajustar a referência
|
||||
|
||||
// Calcula a posição final da trajetória
|
||||
double distanciaObstaculo = maxDistanceCm * pixelsPerCm;
|
||||
int desvioX = (int)(Math.Cos(anguloDesvioRad) * distanciaObstaculo);
|
||||
int desvioY = (int)(Math.Sin(anguloDesvioRad) * distanciaObstaculo);
|
||||
|
||||
// Cria um Pen tracejado azul
|
||||
Pen penTrajectory = new Pen(Color.Blue, 3) { DashPattern = new float[] { 4, 2 } }; // Ajuste o padrão de traço conforme necessário
|
||||
|
||||
// Desenha a linha de trajetória
|
||||
g.DrawLine(penTrajectory, centerX, centerY, centerX + desvioX, centerY - desvioY);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Processamento de Dados
|
||||
|
||||
public void ProcessarDados()
|
||||
{
|
||||
DesvioNecessario = false;
|
||||
|
||||
// Limpa a lista de obstáculos para o novo processamento
|
||||
ObstaculosDetectados.Clear();
|
||||
|
||||
// Agrupa leituras por proximidade
|
||||
var grupos = AgruparLeiturasPorProximidade(Deteccoes.First(x => x.Posicao == PosicaoAtual).Leituras);
|
||||
|
||||
foreach (var grupo in grupos)
|
||||
{
|
||||
var leiturasGrupo = grupo.OrderBy(x => x.Angulo).ToList();
|
||||
var primeiraLeitura = leiturasGrupo.First();
|
||||
var ultimaLeitura = leiturasGrupo.Last();
|
||||
|
||||
// Calcula a largura aproximada do obstáculo
|
||||
//double larguraObstaculo = CalcularLarguraObstaculo(primeiraLeitura, ultimaLeitura);
|
||||
double distanciaMedia = leiturasGrupo.Average(x => x.Distancia);
|
||||
var Objeto = new SonarObstaculoDetectadoModel(primeiraLeitura.Angulo, ultimaLeitura.Angulo, distanciaMedia);
|
||||
|
||||
// Verifica se a largura do obstáculo é significativa
|
||||
if (Objeto.Largura > LarguraMinimaObstaculo)
|
||||
{
|
||||
// Adiciona o obstáculo detectado à lista
|
||||
ObstaculosDetectados.Add(Objeto);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
CalcularDirecaoDesvio();
|
||||
}
|
||||
|
||||
private List<List<SonarLeituraModel>> AgruparLeiturasPorProximidade(List<SonarLeituraModel> leituras)
|
||||
{
|
||||
int maxAnguloDiferenca = anguloAcrescentar * 3; // Diferença máxima de ângulo (em graus) para considerar leituras no mesmo grupo
|
||||
const int maxDistanciaDiferenca = 20; // Diferença máxima de distância (em cm) para considerar leituras no mesmo grupo
|
||||
|
||||
List<List<SonarLeituraModel>> grupos = new List<List<SonarLeituraModel>>();
|
||||
List<SonarLeituraModel> grupoAtual = new List<SonarLeituraModel>();
|
||||
|
||||
// Ordena as leituras por ângulo para processamento sequencial
|
||||
var leiturasOrdenadas = leituras.OrderBy(l => l.Angulo).ToList();
|
||||
|
||||
foreach (var leitura in leiturasOrdenadas)
|
||||
{
|
||||
if (grupoAtual.Count == 0)
|
||||
{
|
||||
// Se o grupo atual está vazio, simplesmente adiciona a leitura atual ao grupo
|
||||
grupoAtual.Add(leitura);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Compara a leitura atual com a última leitura do grupo atual
|
||||
var ultimaLeitura = grupoAtual.Last();
|
||||
if (Math.Abs(leitura.Angulo - ultimaLeitura.Angulo) <= maxAnguloDiferenca &&
|
||||
Math.Abs(leitura.Distancia - ultimaLeitura.Distancia) <= maxDistanciaDiferenca)
|
||||
{
|
||||
// Se a leitura atual está próxima da última leitura, adiciona ao mesmo grupo
|
||||
grupoAtual.Add(leitura);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Se a leitura atual está longe da última leitura, considera como um novo grupo
|
||||
grupos.Add(new List<SonarLeituraModel>(grupoAtual)); // Adiciona o grupo atual aos grupos
|
||||
grupoAtual.Clear(); // Limpa o grupo atual
|
||||
grupoAtual.Add(leitura); // Inicia um novo grupo com a leitura atual
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (grupoAtual.Count > 0)
|
||||
{
|
||||
// Adiciona o último grupo aos grupos, se não estiver vazio
|
||||
grupos.Add(grupoAtual);
|
||||
}
|
||||
|
||||
return grupos.Where(x => x.All(y => y.Distancia <= maxDistanceCm)).ToList();
|
||||
}
|
||||
|
||||
|
||||
// Método para calcular a média de distâncias nas laterais do robô
|
||||
private void CalcularDistanciasLaterais()
|
||||
{
|
||||
// Filtra leituras correspondentes aos ângulos de interesse
|
||||
//var leiturasDireita = Deteccoes.SelectMany(d => d.Leituras.Where(l => l.Angulo <= 4)).ToList();
|
||||
//var leiturasEsquerda = Deteccoes.SelectMany(d => d.Leituras.Where(l => l.Angulo >= 176)).ToList();
|
||||
var leiturasDireita = Deteccoes.Where(d => d.Posicao == 1).SelectMany(d => d.Leituras.Where(l => l.Angulo <= anguloAcrescentar)).ToList();
|
||||
var leiturasEsquerda = Deteccoes.Where(d => d.Posicao == 1).SelectMany(d => d.Leituras.Where(l => l.Angulo >= 180 - anguloAcrescentar)).ToList();
|
||||
|
||||
// Calcula as médias
|
||||
if (leiturasDireita.Any() && leiturasEsquerda.Any())
|
||||
{
|
||||
DistanciaDireita = leiturasDireita.Any() ? leiturasDireita.Average(l => l.Distancia) : 0;
|
||||
DistanciaEsquerda = leiturasEsquerda.Any() ? leiturasEsquerda.Average(l => l.Distancia) : 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Método para decidir a direção do desvio
|
||||
public void CalcularDirecaoDesvio()
|
||||
{
|
||||
// Calcula distâncias médias laterais
|
||||
CalcularDistanciasLaterais();
|
||||
|
||||
foreach (var obstaculo in ObstaculosDetectados)
|
||||
{
|
||||
// Inicializa variáveis para determinar a melhor direção de desvio
|
||||
double espacoLivreDireita = DistanciaDireita - obstaculo.DeslocamentoNecessarioDireita;
|
||||
double espacoLivreEsquerda = DistanciaEsquerda - obstaculo.DeslocamentoNecessarioEsquerda;
|
||||
|
||||
// Decisão de direção baseada no espaço livre ajustado
|
||||
if (espacoLivreDireita > espacoLivreEsquerda && espacoLivreDireita > 0)
|
||||
{
|
||||
obstaculo.DirecaoDesvio = Direcao.Direita;
|
||||
}
|
||||
else if (espacoLivreEsquerda > 0)
|
||||
{
|
||||
obstaculo.DirecaoDesvio = Direcao.Esquerda;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Não há espaço suficiente para desviar
|
||||
obstaculo.DirecaoDesvio = Direcao.Parado;
|
||||
}
|
||||
}
|
||||
|
||||
DesvioNecessario = ObstaculosDetectados.Any(obstaculo => obstaculo.DeslocamentoNecessarioDesvio > 0);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
public class SonarRegistroModel
|
||||
{
|
||||
public int Posicao { get; set; }
|
||||
public List<SonarLeituraModel> Leituras { get; set; }
|
||||
}
|
||||
|
||||
public class SonarLeituraModel
|
||||
{
|
||||
public int Angulo { get; set; }
|
||||
public int Distancia { get; set; }
|
||||
public DateTime Momento { get; set; }
|
||||
|
||||
public SonarLeituraModel(int angle, int distance)
|
||||
{
|
||||
Angulo = angle;
|
||||
Distancia = distance;
|
||||
Momento = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
public class SonarObstaculoDetectadoModel
|
||||
{
|
||||
public double AnguloInicial { get; set; }
|
||||
public double AnguloFinal { get; set; }
|
||||
public double Largura
|
||||
{
|
||||
get
|
||||
{
|
||||
double largura = 0;
|
||||
if ((Aesquerda && !Adireita) || (!Aesquerda && Adireita))
|
||||
{
|
||||
largura = DistanciaInicial - DistanciaFinal;
|
||||
}
|
||||
else if (Aesquerda && Adireita)
|
||||
{
|
||||
largura = DistanciaInicial + DistanciaFinal;
|
||||
}
|
||||
if (largura < 0)
|
||||
{
|
||||
largura *= -1;
|
||||
}
|
||||
return largura;
|
||||
}
|
||||
}
|
||||
public double DistanciaMedia { get; set; }
|
||||
public double DistanciaInicial
|
||||
{
|
||||
get
|
||||
{
|
||||
// Cálculo simplificado, assumindo que podemos determinar a distância direta até o ponto inicial do obstáculo.
|
||||
// Esta fórmula precisa ser adaptada com base na geometria específica e na localização do obstáculo.
|
||||
double anguloRelativo = AnguloInicial - 0; // Calculando o ângulo relativo ao centro do robô
|
||||
// Convertendo o ângulo para radianos para uso em funções trigonométricas
|
||||
double anguloRad = anguloRelativo * (Math.PI / 180);
|
||||
|
||||
// Usando trigonometria para calcular a componente da distância na direção do obstáculo
|
||||
// Esta é uma simplificação e pode não refletir a distância exata sem mais contextos
|
||||
double distanciaInicial = Math.Cos(anguloRad) * DistanciaMedia;
|
||||
if (distanciaInicial < 0)
|
||||
{
|
||||
distanciaInicial *= -1;
|
||||
}
|
||||
|
||||
return distanciaInicial;
|
||||
}
|
||||
}
|
||||
public double DistanciaFinal
|
||||
{
|
||||
get
|
||||
{
|
||||
// Cálculo simplificado, assumindo que podemos determinar a distância direta até o ponto inicial do obstáculo.
|
||||
// Esta fórmula precisa ser adaptada com base na geometria específica e na localização do obstáculo.
|
||||
double anguloRelativo = AnguloFinal - 0; // Calculando o ângulo relativo ao centro do robô
|
||||
// Convertendo o ângulo para radianos para uso em funções trigonométricas
|
||||
double anguloRad = anguloRelativo * (Math.PI / 180);
|
||||
|
||||
// Usando trigonometria para calcular a componente da distância na direção do obstáculo
|
||||
// Esta é uma simplificação e pode não refletir a distância exata sem mais contextos
|
||||
double distanciaFinal = Math.Cos(anguloRad) * DistanciaMedia;
|
||||
if (distanciaFinal < 0)
|
||||
{
|
||||
distanciaFinal *= -1;
|
||||
}
|
||||
|
||||
return distanciaFinal;
|
||||
}
|
||||
}
|
||||
public double TempoAteColisao
|
||||
{
|
||||
get
|
||||
{
|
||||
return DistanciaMedia / MovimentacaoModel.ConverteKmhParaMs(Variaveis.OperacaoEmAndamento.Sensoriamento.VelocidadeMedia);
|
||||
}
|
||||
}
|
||||
public double DeslocamentoNecessarioDesvio
|
||||
{
|
||||
get
|
||||
{
|
||||
if (DirecaoDesvio == Direcao.Direita)
|
||||
{
|
||||
return DeslocamentoNecessarioDireita;
|
||||
}
|
||||
else if (DirecaoDesvio == Direcao.Esquerda)
|
||||
{
|
||||
return DeslocamentoNecessarioEsquerda;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double DeslocamentoNecessarioEsquerda
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Adireita && !Aesquerda)
|
||||
{
|
||||
//return DistanciaInicial + SonarModel.MargemSegurancaDesvio;
|
||||
double deslocamento = (VariaveisEquipamento.Largura / 2) - DistanciaFinal + SonarModel.MargemSegurancaDesvio;
|
||||
if (deslocamento < 0)
|
||||
{
|
||||
deslocamento = 0;
|
||||
}
|
||||
return deslocamento;
|
||||
}
|
||||
else if (Aesquerda && !Adireita)
|
||||
{
|
||||
//return DistanciaFinal + SonarModel.MargemSegurancaDesvio + (VariaveisEquipamento.Largura / 2);
|
||||
double deslocamento = (VariaveisEquipamento.Largura / 2) + DistanciaFinal + SonarModel.MargemSegurancaDesvio;
|
||||
if (deslocamento < 0)
|
||||
{
|
||||
deslocamento = 0;
|
||||
}
|
||||
return deslocamento;
|
||||
}
|
||||
else if (Adireita && Aesquerda)
|
||||
{
|
||||
double deslocamento = (VariaveisEquipamento.Largura / 2) + DistanciaFinal + SonarModel.MargemSegurancaDesvio;
|
||||
if (deslocamento < 0)
|
||||
{
|
||||
deslocamento = 0;
|
||||
}
|
||||
return deslocamento;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double DeslocamentoNecessarioDireita
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Adireita && !Aesquerda)
|
||||
{
|
||||
//return DistanciaInicial + SonarModel.MargemSegurancaDesvio + (VariaveisEquipamento.Largura / 2);
|
||||
double deslocamento = (VariaveisEquipamento.Largura / 2) + DistanciaInicial + SonarModel.MargemSegurancaDesvio;
|
||||
if(deslocamento < 0)
|
||||
{
|
||||
deslocamento = 0;
|
||||
}
|
||||
return deslocamento;
|
||||
}
|
||||
else if (Aesquerda && !Adireita)
|
||||
{
|
||||
//return DistanciaFinal + SonarModel.MargemSegurancaDesvio;
|
||||
double deslocamento = (VariaveisEquipamento.Largura / 2) - DistanciaInicial + SonarModel.MargemSegurancaDesvio;
|
||||
if (deslocamento < 0)
|
||||
{
|
||||
deslocamento = 0;
|
||||
}
|
||||
return deslocamento;
|
||||
}
|
||||
else if (Adireita && Aesquerda)
|
||||
{
|
||||
double deslocamento = (VariaveisEquipamento.Largura / 2) + DistanciaInicial + SonarModel.MargemSegurancaDesvio;
|
||||
if (deslocamento < 0)
|
||||
{
|
||||
deslocamento = 0;
|
||||
}
|
||||
return deslocamento;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
public double AnguloParaDesvio
|
||||
{
|
||||
get
|
||||
{
|
||||
// Usando trigonometria para calcular o ângulo necessário
|
||||
// Nota: Assegure-se de converter o resultado de arco seno para graus, se necessário
|
||||
double anguloRad = Math.Atan(DistanciaMedia / DeslocamentoNecessarioDesvio);
|
||||
double anguloDesvio = (anguloRad * (180 / Math.PI)); // Convertendo radianos para graus
|
||||
|
||||
Direcao direcaoDesvio = DirecaoDesvio;
|
||||
|
||||
if (direcaoDesvio == Direcao.Esquerda)
|
||||
{
|
||||
anguloDesvio = 90 - anguloDesvio;
|
||||
}
|
||||
else if (direcaoDesvio == Direcao.Direita)
|
||||
{
|
||||
anguloDesvio = anguloDesvio - 90;
|
||||
}
|
||||
|
||||
// Atribuição do ângulo calculado ao ângulo de desvio, com verificação de limites
|
||||
return Math.Min(anguloDesvio, SonarModel.AnguloDesvioMaximo);
|
||||
}
|
||||
}
|
||||
public Direcao DirecaoDesvio { get; set; }
|
||||
public bool Adireita
|
||||
{
|
||||
get
|
||||
{
|
||||
return AnguloInicial < 90 || AnguloFinal > 270;
|
||||
}
|
||||
}
|
||||
public bool Aesquerda
|
||||
{
|
||||
get
|
||||
{
|
||||
return AnguloFinal > 90 && AnguloInicial < 270;
|
||||
}
|
||||
}
|
||||
public GPSModel Coordenadas
|
||||
{
|
||||
get
|
||||
{
|
||||
double anguloAbsolutoObstaculo = (Variaveis.OperacaoEmAndamento.Sensoriamento.AnguloCarro + AnguloInicial + AnguloFinal) / 2;
|
||||
double anguloRad = anguloAbsolutoObstaculo * (Math.PI / 180);
|
||||
|
||||
// Supondo que a distância seja em metros e utilizando uma aproximação simples da Terra como esfera
|
||||
// para converter distância e ângulo em mudança de latitude/longitude.
|
||||
double deltaLatitude = (DistanciaMedia * Math.Cos(anguloRad)) / 111111; // Dividindo por 111111 para converter metros em graus
|
||||
double deltaLongitude = (DistanciaMedia * Math.Sin(anguloRad)) / (111111 * Math.Cos(GPSService.UltimaLeitura.Latitude * (Math.PI / 180)));
|
||||
|
||||
return new GPSModel
|
||||
{
|
||||
Latitude = GPSService.UltimaLeitura.Latitude + deltaLatitude,
|
||||
Longitude = GPSService.UltimaLeitura.Longitude + deltaLongitude
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public SonarObstaculoDetectadoModel(double anguloInicial, double anguloFinal, double distanciaMedia)
|
||||
{
|
||||
AnguloInicial = anguloInicial;
|
||||
AnguloFinal = anguloFinal;
|
||||
DistanciaMedia = distanciaMedia;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static AgroBase.Models.Enuns;
|
||||
|
||||
namespace AgroBase.Models
|
||||
|
|
@ -13,6 +14,8 @@ namespace AgroBase.Models
|
|||
public class Variaveis
|
||||
{
|
||||
public static string CaminhoSistema { get; set; } = AppDomain.CurrentDomain.BaseDirectory;
|
||||
public static string CaminhoLogsDispositivos { get; } = "Logs/";
|
||||
public static string CaminhoOperacoes { get; } = "Operacoes/";
|
||||
public static List<IDispositivosService> DispositivosConectados { get; set; } = new List<IDispositivosService>();
|
||||
public static OperacaoModel OperacaoEmAndamento { get; set; } = new OperacaoModel(ModoOperacao.Manual);
|
||||
public static MqttService MqttService { get; set; } = new MqttService("localhost", 1883);
|
||||
|
|
@ -21,7 +24,7 @@ namespace AgroBase.Models
|
|||
{
|
||||
if (_status == null)
|
||||
{
|
||||
_status = OperacaoEmAndamento.ReferencialRuaGPS.StatusAtual;
|
||||
_status = OperacaoEmAndamento.StatusAtual;
|
||||
}
|
||||
|
||||
SensorSinaleiroComportamentoModel comportamento = new SensorSinaleiroComportamentoModel()
|
||||
|
|
@ -45,7 +48,8 @@ namespace AgroBase.Models
|
|||
};
|
||||
break;
|
||||
}
|
||||
case StatusOperacao.Concluida:
|
||||
case StatusOperacao.NaoIniciado:
|
||||
case StatusOperacao.Concluido:
|
||||
{
|
||||
comportamento = new SensorSinaleiroComportamentoModel()
|
||||
{
|
||||
|
|
@ -57,7 +61,6 @@ namespace AgroBase.Models
|
|||
break;
|
||||
}
|
||||
case StatusOperacao.Aguardando:
|
||||
case StatusOperacao.Retornando:
|
||||
{
|
||||
comportamento = new SensorSinaleiroComportamentoModel()
|
||||
{
|
||||
|
|
@ -79,26 +82,13 @@ namespace AgroBase.Models
|
|||
};
|
||||
break;
|
||||
}
|
||||
case StatusOperacao.CaminhandoRua:
|
||||
case StatusOperacao.EmAndamento:
|
||||
{
|
||||
comportamento = new SensorSinaleiroComportamentoModel()
|
||||
{
|
||||
statusLED = StatusLED.Piscando,
|
||||
QtdPiscadas = 3,
|
||||
TempoMs = 400,
|
||||
PausaMs = 1000,
|
||||
};
|
||||
break;
|
||||
}
|
||||
case StatusOperacao.EntrandoRua:
|
||||
case StatusOperacao.SaindoRua:
|
||||
case StatusOperacao.Manobrando:
|
||||
{
|
||||
comportamento = new SensorSinaleiroComportamentoModel()
|
||||
{
|
||||
statusLED = StatusLED.Piscando,
|
||||
QtdPiscadas = 2,
|
||||
TempoMs = 500,
|
||||
TempoMs = 200,
|
||||
PausaMs = 1000,
|
||||
};
|
||||
break;
|
||||
|
|
@ -132,6 +122,29 @@ namespace AgroBase.Models
|
|||
{
|
||||
return paraMin + (valor - deMin) * (paraMax - paraMin) / (deMax - deMin);
|
||||
}
|
||||
|
||||
public static T FindControlRecursive<T>(Control parent, string controlName) where T : Control
|
||||
{
|
||||
foreach (Control child in parent.Controls)
|
||||
{
|
||||
if (child is T foundControl && child.Name == controlName)
|
||||
{
|
||||
return foundControl; // Retorna o controle se encontrado
|
||||
}
|
||||
else
|
||||
{
|
||||
T foundInChildren = FindControlRecursive<T>(child, controlName);
|
||||
if (foundInChildren != null) return foundInChildren; // Retorna o controle se encontrado em controles filhos
|
||||
}
|
||||
}
|
||||
return null; // Retorna null se o controle não for encontrado
|
||||
}
|
||||
|
||||
public static double ConvertDegreesToRadians(double degrees)
|
||||
{
|
||||
double radians = (Math.PI / 180) * degrees;
|
||||
return (radians);
|
||||
}
|
||||
}
|
||||
|
||||
public static class VariaveisPortas
|
||||
|
|
@ -143,5 +156,9 @@ namespace AgroBase.Models
|
|||
public static int SocketCaminho { get; } = 6588;
|
||||
}
|
||||
|
||||
public static class VariaveisEquipamento
|
||||
{
|
||||
public static double Largura { get; } = 80;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
// O código foi gerado por uma ferramenta.
|
||||
// Versão de Tempo de Execução:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// As alterações ao arquivo poderão causar comportamento incorreto e serão perdidas se
|
||||
// o código for gerado novamente.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
|
@ -13,12 +13,12 @@ namespace AgroBase.Properties {
|
|||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// Uma classe de recurso de tipo de alta segurança, para pesquisar cadeias de caracteres localizadas etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
// Essa classe foi gerada automaticamente pela classe StronglyTypedResourceBuilder
|
||||
// através de uma ferramenta como ResGen ou Visual Studio.
|
||||
// Para adicionar ou remover um associado, edite o arquivo .ResX e execute ResGen novamente
|
||||
// com a opção /str, ou recrie o projeto do VS.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
|
|
@ -33,7 +33,7 @@ namespace AgroBase.Properties {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// Retorna a instância de ResourceManager armazenada em cache usada por essa classe.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
|
|
@ -47,8 +47,8 @@ namespace AgroBase.Properties {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// Substitui a propriedade CurrentUICulture do thread atual para todas as
|
||||
/// pesquisas de recursos que usam essa classe de recurso de tipo de alta segurança.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
|
|
@ -61,7 +61,7 @@ namespace AgroBase.Properties {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap esp32_s3 {
|
||||
get {
|
||||
|
|
@ -71,7 +71,7 @@ namespace AgroBase.Properties {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap esp32_wrover {
|
||||
get {
|
||||
|
|
@ -81,7 +81,7 @@ namespace AgroBase.Properties {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap loading {
|
||||
get {
|
||||
|
|
@ -91,7 +91,27 @@ namespace AgroBase.Properties {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap mcp {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("mcp", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap robo_superior {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("robo_superior", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap rosa_dos_ventos {
|
||||
get {
|
||||
|
|
@ -101,7 +121,7 @@ namespace AgroBase.Properties {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// Consulta um recurso localizado do tipo System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap transferidor {
|
||||
get {
|
||||
|
|
|
|||
|
|
@ -127,6 +127,12 @@
|
|||
<data name="loading" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Imagens\loading.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="mcp" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Imagens\mcp.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="robo_superior" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Imagens\robo_superior.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="rosa_dos_ventos" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Imagens\rosa_dos_ventos.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ pathFiles = sys.argv[1]
|
|||
fileName = sys.argv[2]
|
||||
outputName = sys.argv[3]
|
||||
outputMapName = sys.argv[4]
|
||||
apiEndpoit = sys.argv[5]
|
||||
topico_gps = sys.argv[5]
|
||||
pastaSaida = 'Python/Output/'
|
||||
|
||||
center = [0, 0]
|
||||
|
|
@ -54,7 +54,7 @@ with open(caminho_completo_html, 'r+') as arquivo_html:
|
|||
raise ValueError("Não foi possível encontrar o ID do mapa no arquivo HTML.")
|
||||
|
||||
# Script JavaScript para adicionar ao HTML, com o ID do mapa substituído
|
||||
script_atualizacao_marcador = f"""
|
||||
script_desenha_trajeotria = f"""
|
||||
<script>
|
||||
function trajeto_json_onEachFeature(feature, layer) {{
|
||||
layer.on({{
|
||||
|
|
@ -112,7 +112,11 @@ with open(caminho_completo_html, 'r+') as arquivo_html:
|
|||
}});
|
||||
|
||||
</script>
|
||||
"""
|
||||
|
||||
# Script JavaScript para adicionar ao HTML, com o ID do mapa substituído
|
||||
script_atualizacao_marcador = f"""
|
||||
<script src="folium/mqtt.min.js"></script>
|
||||
<script>
|
||||
var marcadorDinamico = L.marker([0, 0], {{
|
||||
icon: L.AwesomeMarkers.icon({{
|
||||
|
|
@ -122,30 +126,40 @@ with open(caminho_completo_html, 'r+') as arquivo_html:
|
|||
}})
|
||||
}}).addTo({id_mapa});
|
||||
|
||||
function atualizarMarcador() {{
|
||||
fetch('{apiEndpoit}')
|
||||
.then(function(response) {{
|
||||
return response.json();
|
||||
}})
|
||||
.then(function(dados) {{
|
||||
var novaLatitude = dados.latitude;
|
||||
var novaLongitude = dados.longitude;
|
||||
var novaPosicao = [novaLatitude, novaLongitude];
|
||||
marcadorDinamico.setLatLng(novaPosicao);
|
||||
adicionarCoordenada("Tj", [novaLongitude, novaLatitude]);
|
||||
}})
|
||||
.catch(function(error) {{
|
||||
console.error('Erro ao atualizar o marcador:', error);
|
||||
}});
|
||||
}}
|
||||
|
||||
// Atualiza o marcador a cada 2 segundos
|
||||
setInterval(atualizarMarcador, 2000);
|
||||
// Conectar ao broker MQTT
|
||||
const client = mqtt.connect('ws://localhost:9001'); // Use wss para conexão segura
|
||||
|
||||
// Quando conectado, inscreva-se no tópico desejado
|
||||
client.on('connect', function () {{
|
||||
console.log('Conectado ao broker MQTT');
|
||||
|
||||
// Inscrever-se no tópico
|
||||
client.subscribe('{topico_gps}', function (err) {{
|
||||
if (!err) {{
|
||||
console.log("Inscrição bem-sucedida no tópico");
|
||||
}} else {{
|
||||
console.error("Falha na inscrição do tópico", err);
|
||||
}}
|
||||
}});
|
||||
}});
|
||||
|
||||
// Lidar com mensagens recebidas para o tópico inscrito
|
||||
client.on('message', function (topic, message) {{
|
||||
// A mensagem é um Buffer, converta para string ou objeto conforme necessário
|
||||
//console.log(`Mensagem recebida no tópico '${{topic}}': ${{message.toString()}}`);
|
||||
var dados = JSON.parse(message);
|
||||
var novaLatitude = dados.latitude;
|
||||
var novaLongitude = dados.longitude;
|
||||
var novaPosicao = [novaLatitude, novaLongitude];
|
||||
marcadorDinamico.setLatLng(novaPosicao);
|
||||
adicionarCoordenada("Tj", [novaLongitude, novaLatitude]);
|
||||
{id_mapa}.setView(novaPosicao, {id_mapa}.getZoom());
|
||||
}});
|
||||
</script>
|
||||
"""
|
||||
|
||||
# Inserir o script no conteúdo HTML
|
||||
conteudo_atualizado = conteudo_html.replace('</html>', script_atualizacao_marcador + '</html>')
|
||||
conteudo_atualizado = conteudo_html.replace('</html>', script_desenha_trajeotria + script_atualizacao_marcador + '</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:
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ outputName = sys.argv[3]
|
|||
outputMapName = sys.argv[4]
|
||||
topico_gps = sys.argv[5]
|
||||
topico_ruas = sys.argv[6]
|
||||
topico_trajeto_dinamico = sys.argv[7]
|
||||
pastaSaida = 'Python/Output/'
|
||||
|
||||
# Carregar o arquivo shapefile contendo a geometria
|
||||
|
|
@ -67,6 +68,57 @@ with open(caminho_completo_html, 'r+') as arquivo_html:
|
|||
else:
|
||||
raise ValueError("Não foi possível encontrar o ID do mapa no arquivo HTML.")
|
||||
|
||||
# Script para representar a trajetoria que o robô deve fazer até iniciar o trabalho
|
||||
script_desenha_trajetoria_dinamica = f"""
|
||||
<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({id_mapa});
|
||||
|
||||
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 para desenhar o trajo percorrido no mapa
|
||||
script_desenha_trajeotria = f"""
|
||||
<script>
|
||||
|
|
@ -150,24 +202,37 @@ with open(caminho_completo_html, 'r+') as arquivo_html:
|
|||
// Inscrever-se no tópico
|
||||
client.subscribe('{topico_gps}', function (err) {{
|
||||
if (!err) {{
|
||||
console.log("Inscrição bem-sucedida no tópico");
|
||||
console.log("Inscricao bem-sucedida no topico");
|
||||
}} else {{
|
||||
console.error("Falha na inscrição do tópico", err);
|
||||
console.error("Falha na inscricao do topico", err);
|
||||
}}
|
||||
}});
|
||||
client.subscribe('{topico_trajeto_dinamico}', 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 tópico inscrito
|
||||
// Lidar com mensagens recebidas para o topico inscrito
|
||||
client.on('message', function (topic, message) {{
|
||||
// A mensagem é um Buffer, converta para string ou objeto conforme necessário
|
||||
//console.log(`Mensagem recebida no tópico '${{topic}}': ${{message.toString()}}`);
|
||||
var dados = JSON.parse(message);
|
||||
var novaLatitude = dados.latitude;
|
||||
var novaLongitude = dados.longitude;
|
||||
var novaPosicao = [novaLatitude, novaLongitude];
|
||||
marcadorDinamico.setLatLng(novaPosicao);
|
||||
adicionarCoordenada("Tj", [novaLongitude, novaLatitude]);
|
||||
{id_mapa}.setView(novaPosicao, {id_mapa}.getZoom());
|
||||
if (topic === "{topico_trajeto_dinamico}") {{
|
||||
adicionarCoordenadaDinamica("TjD", dados); // "Tj" é o ID da feature no GeoJSON
|
||||
}}
|
||||
else if (topic === "{topico_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;
|
||||
var novaLongitude = dados.longitude;
|
||||
var novaPosicao = [novaLatitude, novaLongitude];
|
||||
marcadorDinamico.setLatLng(novaPosicao);
|
||||
adicionarCoordenada("Tj", [novaLongitude, novaLatitude]);
|
||||
{id_mapa}.setView(novaPosicao, {id_mapa}.getZoom());
|
||||
}}
|
||||
|
||||
}});
|
||||
</script>
|
||||
"""
|
||||
|
|
@ -235,7 +300,7 @@ conteudo_html = conteudo_html.replace('https://cdnjs.cloudflare.com/ajax/libs/Le
|
|||
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_desenha_trajeotria + script_atualizacao_marcador + '</html>')
|
||||
conteudo_atualizado = conteudo_html.replace('</html>', script_desenha_trajeotria + script_desenha_trajetoria_dinamica + script_atualizacao_marcador + '</html>')
|
||||
# Encontrar a posição onde inserir o novo trecho de JavaScript
|
||||
indice_inicio_funcao = conteudo_atualizado.find("function geo_json_")
|
||||
# Inserir o novo trecho de JavaScript antes da função
|
||||
|
|
|
|||
|
|
@ -68,6 +68,11 @@ def decifrar_resposta_aquisicao(resposta):
|
|||
# Certifique-se de que a resposta é do tipo bytes
|
||||
if isinstance(resposta, str):
|
||||
resposta = bytes.fromhex(resposta)
|
||||
|
||||
print(resposta.hex())
|
||||
print(len(resposta))
|
||||
print(resposta[1])
|
||||
print(CodigosFuncoes["AquisicaoDados"])
|
||||
|
||||
# Verifica o comprimento da resposta e o código da função
|
||||
if len(resposta) >= 5 and resposta[1] == CodigosFuncoes["AquisicaoDados"]:
|
||||
|
|
@ -90,17 +95,17 @@ def decifrar_resposta_aquisicao(resposta):
|
|||
energia = energia_raw * 1
|
||||
|
||||
# Decodificação dos estados de alarme
|
||||
alarme_alta_tensao = "Ativo" if high_alarm_raw == 0xFFFF else "Não Ativo"
|
||||
alarme_baixa_tensao = "Ativo" if low_alarm_raw == 0xFFFF else "Não Ativo"
|
||||
alarme_alta_tensao = "Ativo" if high_alarm_raw == 0xFFFF else "Nao Ativo"
|
||||
alarme_baixa_tensao = "Ativo" if low_alarm_raw == 0xFFFF else "Nao Ativo"
|
||||
|
||||
# Retorno formatado com todos os valores
|
||||
resultado = {
|
||||
"Tensão": f"{tensao} V",
|
||||
"Tensao": f"{tensao} V",
|
||||
"Corrente": f"{corrente} A",
|
||||
"Potência": f"{potencia} W",
|
||||
"Potencia": f"{potencia} W",
|
||||
"Energia": f"{energia} Wh",
|
||||
"Alarme de Alta Tensão": alarme_alta_tensao,
|
||||
"Alarme de Baixa Tensão": alarme_baixa_tensao
|
||||
"Alarme de Alta Tensao": alarme_alta_tensao,
|
||||
"Alarme de Baixa Tensao": alarme_baixa_tensao
|
||||
}
|
||||
|
||||
mqtt_client.publish(mqtt_topic, json.dumps(resultado).encode('utf-8'))
|
||||
|
|
@ -191,14 +196,14 @@ def main():
|
|||
#com_set = comando_set_parametro(Parametros["EscalaCorrenteAtual"], 0)
|
||||
#enviar_comando(com_set)
|
||||
#time.sleep(1)
|
||||
#vmax = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["AlarmeTensaoMaxima"])).hex())
|
||||
#vmin = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["AlarmeTensaoMinima"])).hex())
|
||||
#addr = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["EnderecoRTU"])).hex())
|
||||
#rang = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["EscalaCorrenteAtual"])).hex())
|
||||
#print(f"Alarme tensao maxima: {vmax}")
|
||||
#print(f"Alarme tensao minima: {vmin}")
|
||||
#print(f"Endereco RTU: {addr}")
|
||||
#print(f"Escala de corrente: {rang}")
|
||||
vmax = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["AlarmeTensaoMaxima"])).hex())
|
||||
vmin = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["AlarmeTensaoMinima"])).hex())
|
||||
addr = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["EnderecoRTU"])).hex())
|
||||
rang = decifrar_resposta_get_parametro(enviar_comando(comando_get_parametro(Parametros["EscalaCorrenteAtual"])).hex())
|
||||
print(f"Alarme tensao maxima: {vmax}")
|
||||
print(f"Alarme tensao minima: {vmin}")
|
||||
print(f"Endereco RTU: {addr}")
|
||||
print(f"Escala de corrente: {rang}")
|
||||
|
||||
try:
|
||||
while True:
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ namespace AgroBase.Comum
|
|||
public T_Code Dispositivo { get; set; } = T_Code.Vzo;
|
||||
public string _Nome { get; set; }
|
||||
public string _Descricao { get; set; }
|
||||
public DateTime _CriadoEm { get; set; }
|
||||
public SerialPort _Porta { get; set; }
|
||||
public GroupBox gpbItem { get; set; }
|
||||
public ComboBox cmbPorta { get; set; }
|
||||
|
|
@ -35,8 +36,7 @@ namespace AgroBase.Comum
|
|||
public RichTextBox txaConsole { get; set; }
|
||||
public Timer tmrConexao { get; set; }
|
||||
public int _index { get; set; }
|
||||
public List<string> DadosEnviados { get; set; } = new List<string>();
|
||||
public List<string> DadosRecebidos { get; set; } = new List<string>();
|
||||
public List<DispositivoLogModel> Logs { get; set; } = new List<DispositivoLogModel>();
|
||||
public T Dados { get; set; } = new T();
|
||||
DispositivoBaseModel IDispositivosService.Dados
|
||||
{
|
||||
|
|
@ -176,17 +176,20 @@ namespace AgroBase.Comum
|
|||
|
||||
public void EnviarDadosSerial(string Dados)
|
||||
{
|
||||
AtualizarConsole(Dados);
|
||||
if (!_Porta.IsOpen || string.IsNullOrEmpty(Dados))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Ticks = 0;
|
||||
AtualizarConsole("> " + DateTime.Now.ToString("HH:mm:ss:fff") + " - " + Dados);
|
||||
|
||||
_Porta.Write(Dados + SerialService.EndLine);
|
||||
DadosEnviados.Add("> " + DateTime.Now.ToString("HH:mm:ss:fff") + " - " + Dados);
|
||||
AtualizarConsole(DadosEnviados[DadosEnviados.Count - 1]);
|
||||
Logs.Add(new DispositivoLogModel()
|
||||
{
|
||||
Momento = DateTime.Now,
|
||||
Enviado = true,
|
||||
Protocolo = Dados,
|
||||
});
|
||||
}
|
||||
|
||||
public Control InstanciarDispositivo(int index)
|
||||
|
|
@ -198,20 +201,28 @@ namespace AgroBase.Comum
|
|||
frmPlot = new frmMovPlot();
|
||||
frmConfig = new frmMovConfig();
|
||||
Dados.IniciarRegistrador();
|
||||
|
||||
MovimentacaoModel.Pinout = PinoutModel.CarregarPinout("pinout" + Enum.GetName(typeof(T_Code), Dispositivo) + ".pin");
|
||||
break;
|
||||
case T_Code.Dir:
|
||||
Dados = CarregarParametros(DirecionalModel.CarregarParametrosIniciais());
|
||||
frmPlot = new frmDirPlot();
|
||||
frmConfig = new frmDirConfig();
|
||||
|
||||
DirecionalModel.Pinout = PinoutModel.CarregarPinout("pinout" + Enum.GetName(typeof(T_Code), Dispositivo) + ".pin");
|
||||
break;
|
||||
case T_Code.Sen:
|
||||
Dados = CarregarParametros(SensoriamentoModel.CarregarParametrosIniciais());
|
||||
frmConfig = new frmSenConfig();
|
||||
((frmSenConfig)frmConfig).Dispositivo = T_Code.Sen;
|
||||
|
||||
SensoriamentoModel.Pinout = PinoutModel.CarregarPinout("pinout" + Enum.GetName(typeof(T_Code), Dispositivo) + ".pin");
|
||||
break;
|
||||
case T_Code.Atu:
|
||||
Dados = CarregarParametros(AtuadorModel.CarregarParametrosIniciais());
|
||||
frmConfig = new frmAtuConfig();
|
||||
|
||||
AtuadorModel.Pinout = PinoutModel.CarregarPinout("pinout" + Enum.GetName(typeof(T_Code), Dispositivo) + ".pin");
|
||||
break;
|
||||
default:
|
||||
Dados = default(T);
|
||||
|
|
@ -223,7 +234,6 @@ namespace AgroBase.Comum
|
|||
if (!EqualityComparer<T>.Default.Equals(Dados, default(T)))
|
||||
{
|
||||
Dados.PopulaGridSensoriamento();
|
||||
Dados.CarregarPinout("pinout" + Enum.GetName(typeof(T_Code), Dispositivo) + ".pin");
|
||||
}
|
||||
|
||||
_Porta.DataReceived -= _Porta_DataReceived;
|
||||
|
|
@ -523,15 +533,47 @@ namespace AgroBase.Comum
|
|||
|
||||
private void TmrLimpeza_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (Ticks > 5)
|
||||
if (Ticks % 5 == 0)
|
||||
{
|
||||
LimparBufferSerial(true);
|
||||
}
|
||||
if (Ticks >= 30)
|
||||
{
|
||||
SalvarLog();
|
||||
|
||||
Ticks = -1;
|
||||
}
|
||||
Ticks++;
|
||||
TempoConectado++;
|
||||
}
|
||||
|
||||
private void SalvarLog()
|
||||
{
|
||||
if (Logs.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
string Caminho = Variaveis.CaminhoLogsDispositivos + Dispositivo;
|
||||
string NomeLog = _CriadoEm.ToString("dd_MM_yyyy_mm_ss") + ".json";
|
||||
if (!Directory.Exists(Caminho))
|
||||
{
|
||||
Directory.CreateDirectory(Caminho);
|
||||
}
|
||||
if (!File.Exists(Caminho + "/" + NomeLog))
|
||||
{
|
||||
string jsonLog = JsonConvert.SerializeObject(Logs, Formatting.None);
|
||||
File.WriteAllText(Caminho + "/" + NomeLog, jsonLog.Substring(0, jsonLog.Length - 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
string jsonLog = JsonConvert.SerializeObject(Logs, Formatting.None);
|
||||
jsonLog = jsonLog.Substring(1, jsonLog.Length - 2);
|
||||
File.AppendAllText(Caminho + "/" + NomeLog, "," + jsonLog);
|
||||
}
|
||||
Logs = new List<DispositivoLogModel>();
|
||||
}
|
||||
|
||||
private void clbDispositivos_ItemCheck(object sender, ItemCheckEventArgs e)
|
||||
{
|
||||
((CheckedListBox)sender).ItemCheck -= clbDispositivos_ItemCheck;
|
||||
|
|
@ -610,15 +652,22 @@ namespace AgroBase.Comum
|
|||
|
||||
public void LimparBufferSerial(bool LimparConsole)
|
||||
{
|
||||
if (LimparConsole)
|
||||
try
|
||||
{
|
||||
txaConsole.Text = "";
|
||||
if (LimparConsole)
|
||||
{
|
||||
txaConsole.Text = "";
|
||||
}
|
||||
|
||||
if (_Porta.IsOpen)
|
||||
{
|
||||
_Porta.DiscardInBuffer();
|
||||
_Porta.DiscardOutBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
if (_Porta.IsOpen)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_Porta.DiscardInBuffer();
|
||||
_Porta.DiscardOutBuffer();
|
||||
Console.WriteLine("Erro ao limpar buffer da porta " + _Porta.PortName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -659,8 +708,15 @@ namespace AgroBase.Comum
|
|||
Dispositivo = (T_Code)(int.Parse(Recebido.Substring(0, 3)));
|
||||
lblStatus.Invoke((Action)(() => lblStatus.Text = StatusPorta() + " - " + Enum.GetName(typeof(T_Code), Dispositivo)));
|
||||
}
|
||||
DadosRecebidos.Add("< " + DateTime.Now.ToString("HH:mm:ss:fff") + " - " + Recebido);
|
||||
AtualizarConsole(DadosRecebidos[DadosRecebidos.Count - 1]);
|
||||
|
||||
Logs.Add(new DispositivoLogModel()
|
||||
{
|
||||
Momento = DateTime.Now,
|
||||
Enviado = false,
|
||||
Protocolo = Recebido,
|
||||
});
|
||||
|
||||
AtualizarConsole("< " + DateTime.Now.ToString("HH:mm:ss:fff") + " - " + Recebido);
|
||||
|
||||
if (Recebido[0].ToString() == SerialService.BeginSensor && !EqualityComparer<T>.Default.Equals(Dados, default(T)))
|
||||
{
|
||||
|
|
@ -734,6 +790,8 @@ namespace AgroBase.Comum
|
|||
btnConectar.Text = "Conectar";
|
||||
|
||||
tmrLimpeza.Enabled = false;
|
||||
|
||||
SalvarLog();
|
||||
}
|
||||
|
||||
public void AcaoConectar()
|
||||
|
|
@ -790,5 +848,12 @@ namespace AgroBase.Comum
|
|||
|
||||
}
|
||||
|
||||
public class DispositivoLogModel
|
||||
{
|
||||
public DateTime Momento { get; set; }
|
||||
public string Protocolo { get; set; }
|
||||
public bool Enviado { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ namespace AgroBase.Services
|
|||
_Nome = nome,
|
||||
_Descricao = descricao,
|
||||
_Porta = porta,
|
||||
_CriadoEm = DateTime.Now,
|
||||
};
|
||||
case T_Code.Dir:
|
||||
return new DispositivosService<DirecionalModel>
|
||||
|
|
@ -32,6 +33,7 @@ namespace AgroBase.Services
|
|||
_Nome = nome,
|
||||
_Descricao = descricao,
|
||||
_Porta = porta,
|
||||
_CriadoEm = DateTime.Now,
|
||||
};
|
||||
case T_Code.Sen:
|
||||
return new DispositivosService<SensoriamentoModel>
|
||||
|
|
@ -40,6 +42,7 @@ namespace AgroBase.Services
|
|||
_Nome = nome,
|
||||
_Descricao = descricao,
|
||||
_Porta = porta,
|
||||
_CriadoEm = DateTime.Now,
|
||||
};
|
||||
case T_Code.Atu:
|
||||
return new DispositivosService<AtuadorModel>
|
||||
|
|
@ -48,6 +51,7 @@ namespace AgroBase.Services
|
|||
_Nome = nome,
|
||||
_Descricao = descricao,
|
||||
_Porta = porta,
|
||||
_CriadoEm = DateTime.Now,
|
||||
};
|
||||
default:
|
||||
throw new ArgumentException("Tipo de dispositivo não reconhecido.");
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ namespace AgroBase.Services
|
|||
return Math.PI / 180 * angle;
|
||||
}
|
||||
|
||||
private static void AtualizarCoordenadasGPS()
|
||||
public static void AtualizarCoordenadasGPS()
|
||||
{
|
||||
var Coordenadas = new
|
||||
{
|
||||
|
|
@ -254,6 +254,34 @@ namespace AgroBase.Services
|
|||
).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public static void AtualizarTrajetoriaDinamica()
|
||||
{
|
||||
var Trajetoria = Variaveis.OperacaoEmAndamento.Mapa.TrajetoriaDinamica.Select(x => new
|
||||
{
|
||||
latitude = x.Latitude,
|
||||
longitude = x.Longitude
|
||||
}).ToArray();
|
||||
Variaveis.MqttService.PublishAsync(
|
||||
Variaveis.MqttService.Topicos.First(x => x.Topico == MapasVariaveisModel.TopicoTrajetoriaDinamica),
|
||||
JsonConvert.SerializeObject(Trajetoria)
|
||||
).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public static List<GPSModel> InterpolarPontos(GPSModel inicio, GPSModel destino, double distanciaPasso)
|
||||
{
|
||||
List<GPSModel> pontos = new List<GPSModel>();
|
||||
var distanciaTotal = DistanciaEntrePontos(inicio, destino);
|
||||
var passos = distanciaTotal / distanciaPasso;
|
||||
for (int i = 0; i <= passos; i++)
|
||||
{
|
||||
var frac = i / passos;
|
||||
var lat = inicio.Latitude + (destino.Latitude - inicio.Latitude) * frac;
|
||||
var lon = inicio.Longitude + (destino.Longitude - inicio.Longitude) * frac;
|
||||
pontos.Add(new GPSModel { Latitude = lat, Longitude = lon });
|
||||
}
|
||||
return pontos;
|
||||
}
|
||||
|
||||
|
||||
private static MapaFeatureCollectionModel TrajetoFake = new MapaFeatureCollectionModel();
|
||||
private static int idxPonto = 0;
|
||||
|
|
@ -318,7 +346,8 @@ namespace AgroBase.Services
|
|||
//APIService.AtualizarCoordenadasGPS(UltimaLeitura, APIService.GPS_IDcoordenadasRobo);
|
||||
AtualizarCoordenadasGPS();
|
||||
|
||||
if (Variaveis.OperacaoEmAndamento.StatusOperacoesPararCarro.Contains(Variaveis.OperacaoEmAndamento.ReferencialRuaGPS.StatusAtual))
|
||||
var StatusCarro = Variaveis.OperacaoEmAndamento.OpMapaGPS.ReferencialRuaGPS.StatusAtual;
|
||||
if (StatusCarro == Enuns.StatusCarroMapa.Parado || StatusCarro == Enuns.StatusCarroMapa.Direcionando)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ namespace AgroBase.Services
|
|||
public static string NomeArquivoMapaGPS = "mapa_gps.html";
|
||||
public static string TopicoCoordenadasGPS = "coordenadas_gps";
|
||||
public static string TopicoSelecaoRuasMapa = "selecao_ruas_mapa";
|
||||
public static string TopicoTrajetoriaDinamica = "trajetoria_dinamica";
|
||||
}
|
||||
|
||||
public class MapasService
|
||||
|
|
@ -56,7 +57,8 @@ namespace AgroBase.Services
|
|||
ArquivoSaida,
|
||||
NomeArquivoMapa,
|
||||
MapasVariaveisModel.TopicoCoordenadasGPS,
|
||||
MapasVariaveisModel.TopicoSelecaoRuasMapa
|
||||
MapasVariaveisModel.TopicoSelecaoRuasMapa,
|
||||
MapasVariaveisModel.TopicoTrajetoriaDinamica,
|
||||
});
|
||||
|
||||
MapaUrl = new Uri(CaminhoSaida + NomeArquivoMapa).AbsoluteUri;
|
||||
|
|
@ -73,8 +75,7 @@ namespace AgroBase.Services
|
|||
NomeArquivos,
|
||||
ArquivoSaida,
|
||||
NomeArquivoMapa,
|
||||
MapasVariaveisModel.TopicoCoordenadasGPS,
|
||||
MapasVariaveisModel.TopicoSelecaoRuasMapa
|
||||
MapasVariaveisModel.TopicoCoordenadasGPS
|
||||
});
|
||||
|
||||
MapaUrl = new Uri(CaminhoSaida + NomeArquivoMapa).AbsoluteUri;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,13 @@ public class MqttService
|
|||
Topico = MapasVariaveisModel.TopicoSelecaoRuasMapa,
|
||||
Mensagens = new List < MqttTopicosMensagensModel>(),
|
||||
Inscrever = true
|
||||
}
|
||||
},
|
||||
new MqttTopicosModel()
|
||||
{
|
||||
Topico = MapasVariaveisModel.TopicoTrajetoriaDinamica,
|
||||
Mensagens = new List<MqttTopicosMensagensModel>(),
|
||||
Inscrever = false
|
||||
},
|
||||
};
|
||||
|
||||
public MqttService(string brokerAddress, int brokerPort)
|
||||
|
|
@ -95,7 +101,14 @@ public class MqttService
|
|||
|
||||
public async Task ConnectAsync()
|
||||
{
|
||||
await _client.ConnectAsync(_options);
|
||||
try
|
||||
{
|
||||
await _client.ConnectAsync(_options);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Erro ao tentar se conectar ao MQTT Broker: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task DisconnectAsync()
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ using Newtonsoft.Json;
|
|||
using Emgu.CV.CvEnum;
|
||||
using Emgu.CV.Aruco;
|
||||
using static AgroBase.Services.SerialService;
|
||||
using System.Threading.Tasks;
|
||||
using AgroBase.Forms;
|
||||
|
||||
namespace AgroBase.Services
|
||||
{
|
||||
|
|
@ -47,7 +49,10 @@ namespace AgroBase.Services
|
|||
Porta.BaudRate = 9600;
|
||||
Porta.DataReceived -= PortaPZEM_DataReceived;
|
||||
Porta.DataReceived += PortaPZEM_DataReceived;
|
||||
Porta.Open();
|
||||
if (!Porta.IsOpen)
|
||||
{
|
||||
Porta.Open();
|
||||
}
|
||||
var Comando = ComandoCalibragem();
|
||||
string comandoHex = BitConverter.ToString(Comando).Replace("-", "");
|
||||
EnviarComando(Porta, Comando);
|
||||
|
|
@ -87,21 +92,38 @@ namespace AgroBase.Services
|
|||
byte[] buffer = new byte[bytesToRead];
|
||||
Porta.Read(buffer, 0, bytesToRead);
|
||||
var Res = DecifrarRespostaAquisicao(buffer);
|
||||
if (Res != null)
|
||||
if (Res != null && Res.Tensao > 0)
|
||||
{
|
||||
PortaPZEM = Porta;
|
||||
Iniciado = true;
|
||||
}
|
||||
|
||||
SerialService.DispositivosMapeados.Add(new DispositivoDetalhesModel()
|
||||
SerialService.DispositivosMapeados.Add(new DispositivoDetalhesModel()
|
||||
{
|
||||
PortaCOM = Porta.PortName,
|
||||
Dispositivo = Enuns.T_Code.Pzm,
|
||||
Erro = !Iniciado,
|
||||
Versao = 17
|
||||
});
|
||||
|
||||
ReceberDados().ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
PortaCOM = Porta.PortName,
|
||||
Dispositivo = Enuns.T_Code.Pzm
|
||||
});
|
||||
Porta.DataReceived -= PortaPZEM_DataReceived;
|
||||
Porta.Close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static async Task<bool> ReceberDados()
|
||||
{
|
||||
EnviarComando(PortaPZEM, ComandoAquisicaoDados());
|
||||
await Task.Delay(5000);
|
||||
|
||||
return await ReceberDados();
|
||||
}
|
||||
|
||||
#region Comandos
|
||||
|
||||
public static byte[] ComandoAquisicaoDados()
|
||||
|
|
@ -262,15 +284,19 @@ namespace AgroBase.Services
|
|||
modelo.Potencia = Convert.ToInt32(potencia_raw, 16) * 0.1;
|
||||
var energia_raw = "0x" + resposta[11].ToString("X") + resposta[12].ToString("X") + resposta[13].ToString("X") + resposta[14].ToString("X");
|
||||
modelo.Energia = Convert.ToInt32(energia_raw, 16) * 1.0;
|
||||
var almMax_raw = "0x" + resposta[15].ToString("X") + resposta[16].ToString("00").Substring(0, 2);
|
||||
var almMax_raw = "0x" + resposta[15].ToString("X") + resposta[16].ToString("X");
|
||||
modelo.AlarmeTensaoMax = almMax_raw == "0xFFFF";
|
||||
var almMin_raw = "0x" + resposta[17].ToString("X") + resposta[18].ToString("X");
|
||||
modelo.AlarmeTensaoMin = almMin_raw == "0xFFFF";
|
||||
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria = (modelo.Tensao / 42) * 100;
|
||||
double percent = FuncoesGlobais.Map(modelo.Tensao, 36, 42, 0, 100);
|
||||
Variaveis.OperacaoEmAndamento.Sensoriamento.PorcentagemBateria = percent;
|
||||
frmInstancial.frmAcompanhamento.AtualizarSensores("Bateria: " + modelo.Tensao.ToString("0.00") + " V - " + modelo.Corrente.ToString("0.00") + " A - " + modelo.Potencia.ToString("0.00") + " W");
|
||||
|
||||
UltimaLeitura = modelo;
|
||||
|
||||
Console.WriteLine("PZEM Tensão: " + modelo.Tensao.ToString("0.00"));
|
||||
|
||||
return modelo;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ namespace AgroBase.Services
|
|||
{
|
||||
public string PortaCOM { get; set; }
|
||||
public T_Code Dispositivo { get; set; }
|
||||
public bool Erro { get; set; }
|
||||
public int Versao { get; set; }
|
||||
}
|
||||
|
||||
public static List<DispositivoDetalhesModel> DispositivosMapeados = new List<DispositivoDetalhesModel>();
|
||||
|
|
@ -36,6 +38,7 @@ namespace AgroBase.Services
|
|||
Porta.Close();
|
||||
PortasComErro.Add(Porta);
|
||||
});
|
||||
List<SerialPort> PortasSucesso = new List<SerialPort>();
|
||||
PortasComErro.ForEach(Porta =>
|
||||
{
|
||||
Porta.DataReceived -= _Porta_DataReceived;
|
||||
|
|
@ -53,13 +56,15 @@ namespace AgroBase.Services
|
|||
TentativasPortas.Add(Porta.PortName, 1);
|
||||
}
|
||||
|
||||
if (TentativasPortas[Porta.PortName] > 2)
|
||||
if (TentativasPortas[Porta.PortName] > 5)
|
||||
{
|
||||
Porta.Close();
|
||||
PortasComErro.Remove(Porta);
|
||||
PortasSucesso.Add(Porta);
|
||||
TentativasPortas.Remove(Porta.PortName);
|
||||
Porta.DataReceived += _Porta_DataReceived;
|
||||
}
|
||||
});
|
||||
PortasSucesso.ForEach(x => PortasComErro.Remove(x));
|
||||
|
||||
var Portas = SerialPort.GetPortNames();
|
||||
var PortasNaoMapeadas = Portas.Where(x => !DispositivosMapeados.Select(y => y.PortaCOM).Contains(x) && !PortasComErro.Select(y => y.PortName).Contains(x)).ToList();
|
||||
|
|
@ -79,7 +84,7 @@ namespace AgroBase.Services
|
|||
SerialPort _Porta = new SerialPort() { PortName = PortaCom, BaudRate = 115200 };
|
||||
_Porta.DataReceived -= _Porta_DataReceived;
|
||||
_Porta.DataReceived += _Porta_DataReceived;
|
||||
string CodigoTest = ((int)F_Code.Chk).ToString() + "check";
|
||||
string CodigoTest = ((int)F_Code.Chk).ToString() + "check" + EndLine;
|
||||
try
|
||||
{
|
||||
_Porta.Open();
|
||||
|
|
@ -90,6 +95,7 @@ namespace AgroBase.Services
|
|||
{
|
||||
_Porta.Close();
|
||||
Console.WriteLine(ex.Message.ToString());
|
||||
PortasComErro.Add(_Porta);
|
||||
}
|
||||
}
|
||||
var DispositivosRemovidos = DispositivosMapeados.Where(x => !Portas.Contains(x.PortaCOM)).ToList();
|
||||
|
|
@ -154,40 +160,57 @@ namespace AgroBase.Services
|
|||
{
|
||||
var Porta = ((SerialPort)sender);
|
||||
string Recebido = Porta.ReadLine();
|
||||
if (Recebido.Length > 2)
|
||||
try
|
||||
{
|
||||
T_Code Dispositivo = T_Code.Vzo;
|
||||
if (Recebido.Length > 2)
|
||||
{
|
||||
T_Code Dispositivo = T_Code.Vzo;
|
||||
F_Code Verificacao = F_Code.Nda;
|
||||
int Versao = 0;
|
||||
|
||||
if (Recebido.Contains("$GPTXT"))
|
||||
{
|
||||
GPSService.AtualizarPortaGPS(Porta);
|
||||
Dispositivo = T_Code.Gps;
|
||||
}
|
||||
else
|
||||
{
|
||||
var Dados = Recebido.Split(';');
|
||||
int code = 0;
|
||||
int.TryParse(Dados[0], out code);
|
||||
if (code == 0)
|
||||
if (Recebido.Contains("$GPTXT"))
|
||||
{
|
||||
//Porta.Close();
|
||||
return;
|
||||
GPSService.AtualizarPortaGPS(Porta);
|
||||
Dispositivo = T_Code.Gps;
|
||||
}
|
||||
else
|
||||
{
|
||||
var Dados = Recebido.Split(';');
|
||||
int code = 0;
|
||||
int.TryParse(Dados[0], out code);
|
||||
if (code == 0)
|
||||
{
|
||||
//Porta.Close();
|
||||
return;
|
||||
}
|
||||
|
||||
Dispositivo = (T_Code)(int.Parse(Dados[0]));
|
||||
|
||||
int.TryParse(Dados[1], out int check);
|
||||
Verificacao = (F_Code)check;
|
||||
|
||||
int.TryParse(Dados[2], out int versao);
|
||||
Versao = versao;
|
||||
}
|
||||
|
||||
Dispositivo = (T_Code)(int.Parse(Dados[0]));
|
||||
}
|
||||
|
||||
if (Dispositivo != T_Code.Vzo)
|
||||
{
|
||||
DispositivosMapeados.Add(new DispositivoDetalhesModel()
|
||||
if (Dispositivo != T_Code.Vzo)
|
||||
{
|
||||
PortaCOM = Porta.PortName,
|
||||
Dispositivo = Dispositivo
|
||||
});
|
||||
}
|
||||
DispositivosMapeados.Add(new DispositivoDetalhesModel()
|
||||
{
|
||||
PortaCOM = Porta.PortName,
|
||||
Dispositivo = Dispositivo,
|
||||
Erro = Verificacao == F_Code.Err,
|
||||
Versao = Versao,
|
||||
});
|
||||
}
|
||||
|
||||
Porta.Close();
|
||||
PortasAguardandoResposta.Remove(Porta);
|
||||
Porta.Close();
|
||||
PortasAguardandoResposta.Remove(Porta);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Erro ao receber dados da porta " + Porta.PortName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
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
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
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
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
|
|
@ -0,0 +1 @@
|
|||
[{"Momento":"2024-04-10T13:48:02.1959501-03:00","Protocolo":"258TMVET;1;411;0;00200;00;0-1;-1.038","Enviado":true},{"Momento":"2024-04-10T13:48:02.1959501-03:00","Protocolo":"258TMVEF;1;411;0;00200;00;0-1;-1.038","Enviado":true},{"Momento":"2024-04-10T13:48:02.1959501-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.1959501-03:00","Protocolo":"258TMVDT;1;411;0;00200;00;0-1;-1.038","Enviado":true},{"Momento":"2024-04-10T13:48:02.1959501-03:00","Protocolo":"258TMVDF;1;411;0;00200;00;0-1;-1.038","Enviado":true},{"Momento":"2024-04-10T13:48:02.1959501-03:00","Protocolo":"258AB3V ;1;322;0;00500;10;0-1;0x44 ;219 ","Enviado":true},{"Momento":"2024-04-10T13:48:02.1959501-03:00","Protocolo":"258AB5V ;1;322;0;00500;10;0-1;0x41 ;219 ","Enviado":true},{"Momento":"2024-04-10T13:48:02.1959501-03:00","Protocolo":"258AB7V2;1;322;0;00500;10;0-1;0x40 ;219 ","Enviado":true},{"Momento":"2024-04-10T13:48:02.1959501-03:00","Protocolo":"258AB12V;1;322;0;00500;10;0-1;0x43 ;226 ","Enviado":true},{"Momento":"2024-04-10T13:48:02.2038116-03:00","Protocolo":"258TBAT ;1;411;0;00500;05;0-1;0.0000","Enviado":true},{"Momento":"2024-04-10T13:48:02.2058182-03:00","Protocolo":"258SUESQ;1;531;0;01000;02;0-1,0-1","Enviado":true},{"Momento":"2024-04-10T13:48:02.2058182-03:00","Protocolo":"258SUDIR;1;531;0;01000;02;0-1,0-1","Enviado":true},{"Momento":"2024-04-10T13:48:02.2058182-03:00","Protocolo":"258SMAG ;1;855;0;00500;15;0-1","Enviado":true},{"Momento":"2024-04-10T13:48:02.2058182-03:00","Protocolo":"258SNR_F;1;532;1;01000;20;016,016,017","Enviado":true},{"Momento":"2024-04-10T13:48:02.2058182-03:00","Protocolo":"258LEDMN;1;013","Enviado":true},{"Momento":"2024-04-10T13:48:02.2058182-03:00","Protocolo":"258LEDAT;1;012","Enviado":true},{"Momento":"2024-04-10T13:48:02.2559372-03:00","Protocolo":"258LEDOP;1;014","Enviado":true},{"Momento":"2024-04-10T13:48:02.2559372-03:00","Protocolo":"258MD ;1;0050021;22","Enviado":true},{"Momento":"2024-04-10T13:48:02.2756336-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.2756336-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.2756336-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.2756336-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.2858451-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.2858451-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.2858451-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.2858451-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.2997621-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.3057915-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.3164369-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.3313015-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.3500474-03:00","Protocolo":"This pin can not be a servo: 0\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.3629077-03:00","Protocolo":"Servo available on: 2,4,5,12-19,21-23,25-27,32-33\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.3705787-03:00","Protocolo":"SNR_F Iniciado\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.3856513-03:00","Protocolo":"#211;SNR_F;1$\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.4473667-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.4485846-03:00","Protocolo":"LEDMN Iniciado\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.4502544-03:00","Protocolo":"#211;LEDMN;1$\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.4514867-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.4514867-03:00","Protocolo":"LEDAT Iniciado\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.4589371-03:00","Protocolo":"#211;LEDAT;1$\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.4656086-03:00","Protocolo":"OK\r","Enviado":false},{"Momento":"2024-04-10T13:48:02.5757772-03:00","Protocolo":"LEDOP Iniciado\r","Enviado":false},{"Momento":"2024-04-10T13:48:04.4906119-03:00","Protocolo":"#211;LEDOP;1$\r","Enviado":false}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue