Skip to content

Commit

Permalink
Merge pull request #374 from farmerbriantee/ABLine
Browse files Browse the repository at this point in the history
Ab line
  • Loading branch information
farmerbriantee authored Feb 16, 2024
2 parents 7b4811e + f938dd3 commit c942df1
Show file tree
Hide file tree
Showing 11 changed files with 2,449 additions and 2,400 deletions.
2 changes: 2 additions & 0 deletions SourceCode/GPS/AgOpenGPS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,8 @@
<ItemGroup>
<Content Include="AOG.ico" />
<Content Include="aChangeLog.txt" />
<None Include="btnImages\VR.png" />
<None Include="btnImages\Background.png" />
<Content Include="Resources\TF012.WAV" />
<None Include="Resources\SectionOn.wav" />
<None Include="Resources\SectionOff.wav" />
Expand Down
11 changes: 9 additions & 2 deletions SourceCode/GPS/Classes/CABLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,27 @@ public void BuildCurrentABLineList(vec3 pivot)

//move the curline as well.
vec2 nudgePtA = new vec2(mf.trk.gArr[idx].ptA);
vec2 nudgePtB = new vec2(mf.trk.gArr[idx].ptB);

nudgePtA.easting += (Math.Sin(abHeading + glm.PIBy2) * mf.trk.gArr[idx].nudgeDistance);
nudgePtA.northing += (Math.Cos(abHeading + glm.PIBy2) * mf.trk.gArr[idx].nudgeDistance);

nudgePtB.easting += (Math.Sin(abHeading + glm.PIBy2) * mf.trk.gArr[idx].nudgeDistance);
nudgePtB.northing += (Math.Cos(abHeading + glm.PIBy2) * mf.trk.gArr[idx].nudgeDistance);

//depending which way you are going, the offset can be either side
vec2 point1 = new vec2((Math.Cos(-abHeading) * (distAway + (isHeadingSameWay ? -mf.tool.offset : mf.tool.offset))) + nudgePtA.easting,
(Math.Sin(-abHeading) * (distAway + (isHeadingSameWay ? -mf.tool.offset : mf.tool.offset))) + nudgePtA.northing);

vec2 point2 = new vec2((Math.Cos(-abHeading) * (distAway + (isHeadingSameWay ? -mf.tool.offset : mf.tool.offset))) + nudgePtB.easting,
(Math.Sin(-abHeading) * (distAway + (isHeadingSameWay ? -mf.tool.offset : mf.tool.offset))) + nudgePtB.northing);

//create the new line extent points for current ABLine based on original heading of AB line
currentLinePtA.easting = point1.easting - (Math.Sin(abHeading) * abLength);
currentLinePtA.northing = point1.northing - (Math.Cos(abHeading) * abLength);

currentLinePtB.easting = point1.easting + (Math.Sin(abHeading) * abLength);
currentLinePtB.northing = point1.northing + (Math.Cos(abHeading) * abLength);
currentLinePtB.easting = point2.easting + (Math.Sin(abHeading) * abLength);
currentLinePtB.northing = point2.northing + (Math.Cos(abHeading) * abLength);

currentLinePtA.heading = abHeading;
currentLinePtB.heading = abHeading;
Expand Down
4,407 changes: 2,204 additions & 2,203 deletions SourceCode/GPS/Forms/FormGPS.Designer.cs

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions SourceCode/GPS/Forms/FormGPS.resx
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1050, 16</value>
</metadata>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1050, 16</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>54</value>
</metadata>
Expand Down
266 changes: 133 additions & 133 deletions SourceCode/GPS/Forms/FormMap.Designer.cs

Large diffs are not rendered by default.

42 changes: 29 additions & 13 deletions SourceCode/GPS/Forms/FormRateMap.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion SourceCode/GPS/Forms/Guidance/FormABDraw.cs
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ private void DrawBuiltLines()
GL.Begin(PrimitiveType.Lines);

GL.Vertex3(gTemp[i].ptA.easting - (Math.Sin(gTemp[i].heading) * mf.ABLine.abLength), gTemp[i].ptA.northing - (Math.Cos(gTemp[i].heading) * mf.ABLine.abLength), 0);
GL.Vertex3(gTemp[i].ptA.easting + (Math.Sin(gTemp[i].heading) * mf.ABLine.abLength), gTemp[i].ptA.northing + (Math.Cos(gTemp[i].heading) * mf.ABLine.abLength), 0);
GL.Vertex3(gTemp[i].ptB.easting + (Math.Sin(gTemp[i].heading) * mf.ABLine.abLength), gTemp[i].ptB.northing + (Math.Cos(gTemp[i].heading) * mf.ABLine.abLength), 0);

GL.End();

Expand Down
20 changes: 20 additions & 0 deletions SourceCode/GPS/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c942df1

Please sign in to comment.