Skip to content

Commit

Permalink
v0.3 with New GUI
Browse files Browse the repository at this point in the history
Old and New
  • Loading branch information
farmerbriantee committed Nov 10, 2019
1 parent a1b6902 commit f93ecb5
Show file tree
Hide file tree
Showing 124 changed files with 3,168 additions and 4,137 deletions.
23 changes: 14 additions & 9 deletions SourceCode/GPS/AgOpenGPS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
<PropertyGroup />
<PropertyGroup />
<ItemGroup>
<Reference Include="Control.Draggable, Version=1.0.7235.37687, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>References\Control.Draggable.dll</HintPath>
</Reference>
<Reference Include="Keypad, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>References\Keypad.dll</HintPath>
Expand Down Expand Up @@ -146,12 +150,6 @@
<Compile Include="Forms\FormMakeBndCon.Designer.cs">
<DependentUpon>FormMakeBndCon.cs</DependentUpon>
</Compile>
<Compile Include="Forms\FormElev.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\FormElev.Designer.cs">
<DependentUpon>FormElev.cs</DependentUpon>
</Compile>
<Compile Include="Forms\FormNtrip.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -389,9 +387,6 @@
<EmbeddedResource Include="Forms\FormMakeBndCon.resx">
<DependentUpon>FormMakeBndCon.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\FormElev.resx">
<DependentUpon>FormElev.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\FormNtrip.resx">
<DependentUpon>FormNtrip.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -559,6 +554,16 @@
<None Include="btnImages\AddNew.png" />
<None Include="btnImages\FileNewAndGo.png" />
<None Include="btnImages\OK64.png" />
<None Include="btnImages\ABLineSave.png" />
<None Include="btnImages\UTurnLeft.png" />
<None Include="btnImages\UTurnRight.png" />
<None Include="btnImages\GPSSignalGood.png" />
<None Include="btnImages\GPSSignalPoor.png" />
<None Include="btnImages\AutoManualIsAuto.png" />
<None Include="btnImages\AutoManualIsManual.png" />
<None Include="btnImages\HandSnap.png" />
<None Include="btnImages\handUturnPanel.png" />
<None Include="btnImages\MakeBoundaryContour.png" />
<Content Include="Dependencies\Audio\Boundary.wav">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down
33 changes: 29 additions & 4 deletions SourceCode/GPS/Classes/CABCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,24 @@ public void SnapABCurve()
double headingAt90;

//calculate the heading 90 degrees to ref ABLine heading
if (isOnRightSideCurrentLine) headingAt90 = glm.PIBy2;
else headingAt90 = -glm.PIBy2;
if (isOnRightSideCurrentLine)
{
headingAt90 = glm.PIBy2;
}
else
{
headingAt90 = -glm.PIBy2;
}

if (isABSameAsVehicleHeading)
{
moveDistance += distanceFromCurrentLine * 0.001;
}
else
{
moveDistance -= distanceFromCurrentLine * 0.001;
}


int cnt = refList.Count;
vec3[] arr = new vec3[cnt];
Expand All @@ -630,8 +646,17 @@ public void MoveABCurve(double dist)
double headingAt90;

//calculate the heading 90 degrees to ref ABLine heading
if (isABSameAsVehicleHeading) headingAt90 = glm.PIBy2;
else headingAt90 = -glm.PIBy2;

if (isABSameAsVehicleHeading)
{
headingAt90 = glm.PIBy2;
moveDistance += dist;
}
else
{
headingAt90 = -glm.PIBy2;
moveDistance -= dist;
}

int cnt = refList.Count;
vec3[] arr = new vec3[cnt];
Expand Down
107 changes: 67 additions & 40 deletions SourceCode/GPS/Classes/CABLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,43 +215,43 @@ public void DrawABLines()
GL.End();
}

if (mf.camera.gridZoom < 150)
{

toolWidth = (mf.vehicle.toolWidth) / 2;
toolOffset = mf.vehicle.toolOffset;
GL.Color3(0.0f, 0.90f, 0.50f);
GL.LineWidth(2);
GL.Enable(EnableCap.LineStipple);
GL.LineStipple(1, 0x0001);

GL.Begin(PrimitiveType.Lines);

if (!isABSameAsVehicleHeading)
{
GL.Vertex3((cosHeading * (toolWidth - toolOffset)) + currentABLineP1.easting,
(sinHeading * (toolWidth - toolOffset)) + currentABLineP1.northing, 0);
GL.Vertex3((cosHeading * (toolWidth - toolOffset)) + currentABLineP2.easting,
(sinHeading * (toolWidth - toolOffset)) + currentABLineP2.northing, 0);
GL.Vertex3((cosHeading * (-toolWidth - toolOffset)) + currentABLineP1.easting,
(sinHeading * (-toolWidth - toolOffset)) + currentABLineP1.northing, 0);
GL.Vertex3((cosHeading * (-toolWidth - toolOffset)) + currentABLineP2.easting,
(sinHeading * (-toolWidth - toolOffset)) + currentABLineP2.northing, 0);
}
else
{
GL.Vertex3((cosHeading * (toolWidth + toolOffset)) + currentABLineP1.easting,
(sinHeading * (toolWidth + toolOffset)) + currentABLineP1.northing, 0);
GL.Vertex3((cosHeading * (toolWidth + toolOffset)) + currentABLineP2.easting,
(sinHeading * (toolWidth + toolOffset)) + currentABLineP2.northing, 0);
GL.Vertex3((cosHeading * (-toolWidth + toolOffset)) + currentABLineP1.easting,
(sinHeading * (-toolWidth + toolOffset)) + currentABLineP1.northing, 0);
GL.Vertex3((cosHeading * (-toolWidth + toolOffset)) + currentABLineP2.easting,
(sinHeading * (-toolWidth + toolOffset)) + currentABLineP2.northing, 0);
}
GL.End();
GL.Disable(EnableCap.LineStipple);
}
//if (mf.camera.gridZoom < 150)
//{

// toolWidth = (mf.vehicle.toolWidth) / 2;
// toolOffset = mf.vehicle.toolOffset;
// GL.Color3(0.0f, 0.90f, 0.50f);
// GL.LineWidth(2);
// GL.Enable(EnableCap.LineStipple);
// GL.LineStipple(1, 0x0001);

// GL.Begin(PrimitiveType.Lines);

// if (!isABSameAsVehicleHeading)
// {
// GL.Vertex3((cosHeading * (toolWidth - toolOffset)) + currentABLineP1.easting,
// (sinHeading * (toolWidth - toolOffset)) + currentABLineP1.northing, 0);
// GL.Vertex3((cosHeading * (toolWidth - toolOffset)) + currentABLineP2.easting,
// (sinHeading * (toolWidth - toolOffset)) + currentABLineP2.northing, 0);
// GL.Vertex3((cosHeading * (-toolWidth - toolOffset)) + currentABLineP1.easting,
// (sinHeading * (-toolWidth - toolOffset)) + currentABLineP1.northing, 0);
// GL.Vertex3((cosHeading * (-toolWidth - toolOffset)) + currentABLineP2.easting,
// (sinHeading * (-toolWidth - toolOffset)) + currentABLineP2.northing, 0);
// }
// else
// {
// GL.Vertex3((cosHeading * (toolWidth + toolOffset)) + currentABLineP1.easting,
// (sinHeading * (toolWidth + toolOffset)) + currentABLineP1.northing, 0);
// GL.Vertex3((cosHeading * (toolWidth + toolOffset)) + currentABLineP2.easting,
// (sinHeading * (toolWidth + toolOffset)) + currentABLineP2.northing, 0);
// GL.Vertex3((cosHeading * (-toolWidth + toolOffset)) + currentABLineP1.easting,
// (sinHeading * (-toolWidth + toolOffset)) + currentABLineP1.northing, 0);
// GL.Vertex3((cosHeading * (-toolWidth + toolOffset)) + currentABLineP2.easting,
// (sinHeading * (-toolWidth + toolOffset)) + currentABLineP2.northing, 0);
// }
// GL.End();
// GL.Disable(EnableCap.LineStipple);
//}


if (mf.isPureDisplayOn && !mf.isStanleyUsed)
Expand Down Expand Up @@ -622,8 +622,18 @@ double goalPointDistanceDSquared

public void MoveABLine(double dist)
{
double headingCalc;
//calculate the heading 90 degrees to ref ABLine heading
double headingCalc = isABSameAsVehicleHeading ? abHeading + glm.PIBy2 : abHeading - glm.PIBy2;
if (isABSameAsVehicleHeading)
{
headingCalc = abHeading + glm.PIBy2;
moveDistance += dist;
}
else
{
headingCalc = abHeading - glm.PIBy2;
moveDistance -= dist;
}

//calculate the new points for the reference line and points
refPoint1.easting = (Math.Sin(headingCalc) * dist) + refPoint1.easting;
Expand Down Expand Up @@ -678,9 +688,26 @@ public void SetABLineByHeading()
public void SnapABLine()
{
double headingCalc;

//calculate the heading 90 degrees to ref ABLine heading
if (isOnRightSideCurrentLine) headingCalc = abHeading + glm.PIBy2;
else headingCalc = abHeading - glm.PIBy2;
if (isOnRightSideCurrentLine)
{
headingCalc = abHeading + glm.PIBy2;
}
else
{
headingCalc = abHeading - glm.PIBy2;
}

if (isABSameAsVehicleHeading)
{
moveDistance += (distanceFromCurrentLine * 0.001);
}
else
{
moveDistance -= (distanceFromCurrentLine * 0.001);
}


//calculate the new points for the reference line and points
refPoint1.easting = (Math.Sin(headingCalc) * Math.Abs(distanceFromCurrentLine) * 0.001) + refPoint1.easting;
Expand Down
17 changes: 2 additions & 15 deletions SourceCode/GPS/Classes/CCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class CCamera
public double previousZoom = 25;

public bool camFollowing;
public int camMode = 0;

//private double camDelta = 0;

Expand Down Expand Up @@ -59,21 +60,7 @@ public void SetWorldCam(double _fixPosX, double _fixPosY, double _fixHeading)
if (camFollowing)
{
GL.Rotate(camYaw, 0.0, 0.0, 1.0);

if (camPitch > -45)
{
offset = (45.0 + camPitch) / 45.0;

offset = (offset * offset * offset * offset * 0.015) + 0.02;

GL.Translate(-camPosX + (offset * camSetDistance * Math.Sin(glm.toRadians(fixHeading))),
-camPosY + (offset * camSetDistance * Math.Cos(glm.toRadians(fixHeading))), -camPosZ);
}
else
{
GL.Translate(-camPosX + (0.02 * camSetDistance * Math.Sin(glm.toRadians(fixHeading))),
-camPosY + (0.02 * camSetDistance * Math.Cos(glm.toRadians(fixHeading))), -camPosZ);
}
GL.Translate(-camPosX, -camPosY, -camPosZ);
}
else
{
Expand Down
5 changes: 4 additions & 1 deletion SourceCode/GPS/Forms/FormABCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,13 @@ private void textBox1_Enter(object sender, EventArgs e)

private void btnCancel_Click(object sender, System.EventArgs e)
{
mf.curve.moveDistance = 0;
mf.curve.isOkToAddPoints = false;
mf.curve.isCurveSet = false;
mf.curve.refList?.Clear();
mf.curve.isCurveSet = false;
mf.DisableYouTurnButtons();
mf.btnContourPriority.Enabled = false;
//mf.btnContourPriority.Enabled = false;
//mf.curve.ResetCurveLine();
mf.curve.isCurveBtnOn = false;
mf.btnCurve.Image = Properties.Resources.CurveOff;
Expand All @@ -319,6 +320,8 @@ private void btnCancel_Click(object sender, System.EventArgs e)

private void btnListDelete_Click(object sender, EventArgs e)
{
mf.curve.moveDistance = 0;

if (lvLines.SelectedItems.Count > 0)
{
int num = lvLines.SelectedIndices[0];
Expand Down
Loading

0 comments on commit f93ecb5

Please sign in to comment.