Skip to content

Commit

Permalink
Refy curve (#356)
Browse files Browse the repository at this point in the history
* Section on/off in config

* Line Select

* First Viz line, Start AgIO gfx

* Put in vehicle in Draw and headlines

* 2 size AB Draw

* AB Draw fixes

* Add Boundary Tool

* Finish up MapToBnd

* MapBnd Fixes - simplify

* Map2Boundary complete

* AB Draw and Headline Zoom

* More zoom fixes

* reorder left menu

* Maximize AB Draw

* Size ABDraw
  • Loading branch information
farmerbriantee authored Feb 5, 2024
1 parent c7a70c1 commit c0e54da
Show file tree
Hide file tree
Showing 37 changed files with 4,473 additions and 932 deletions.
8 changes: 7 additions & 1 deletion SourceCode/AgIO/Source/Forms/UDP.designer.cs

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

25 changes: 25 additions & 0 deletions SourceCode/GPS/AgOpenGPS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@
<Compile Include="Forms\Field\FormEnterFlag.Designer.cs">
<DependentUpon>FormEnterFlag.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Field\FormMapBnd.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\Field\FormMapBnd.Designer.cs">
<DependentUpon>FormMapBnd.cs</DependentUpon>
</Compile>
<Compile Include="Forms\FormPan.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -210,6 +216,12 @@
<Compile Include="Forms\FormYes.designer.cs">
<DependentUpon>FormYes.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Guidance\FormABDraw2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\Guidance\FormABDraw2.Designer.cs">
<DependentUpon>FormABDraw2.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Guidance\FormRecordName.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -488,6 +500,7 @@
<Compile Include="Forms\Settings\FormSteerWiz.Designer.cs">
<DependentUpon>FormSteerWiz.cs</DependentUpon>
</Compile>
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="gStr.da.Designer.cs">
<DependentUpon>gStr.da.resx</DependentUpon>
<AutoGen>True</AutoGen>
Expand Down Expand Up @@ -617,6 +630,9 @@
<EmbeddedResource Include="Forms\Field\FormEnterFlag.resx">
<DependentUpon>FormEnterFlag.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Field\FormMapBnd.resx">
<DependentUpon>FormMapBnd.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\FormPan.resx">
<DependentUpon>FormPan.cs</DependentUpon>
<SubType>Designer</SubType>
Expand All @@ -637,6 +653,9 @@
<EmbeddedResource Include="Forms\FormYes.resx">
<DependentUpon>FormYes.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Guidance\FormABDraw2.resx">
<DependentUpon>FormABDraw2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Guidance\FormRecordName.resx">
<DependentUpon>FormRecordName.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -998,6 +1017,12 @@
<None Include="btnImages\BoundaryCenter.png" />
<None Include="btnImages\AutoTrackOff.png" />
<None Include="btnImages\Images\z_TramOnOff.png" />
<None Include="btnImages\ZoomOGL.png" />
<None Include="btnImages\BoundaryReduce.png" />
<None Include="btnImages\BoundarySmooth.png" />
<None Include="btnImages\BoundaryMakeLine.png" />
<None Include="btnImages\APlusPlusA.png" />
<None Include="btnImages\APlusPlusB.png" />
<Content Include="Resources\rtk_lost.wav" />
<None Include="btnImages\BrightnessDn.png" />
<None Include="btnImages\BrightnessUp.png" />
Expand Down
47 changes: 34 additions & 13 deletions SourceCode/GPS/Classes/CABCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class CABCurve

public double howManyPathsAway;
public vec2 refPoint1 = new vec2(1, 1), refPoint2 = new vec2(2, 2);

private int A, B, C;
private int rA, rB;

Expand Down Expand Up @@ -157,7 +157,7 @@ public void BuildCurveCurrentList(vec3 pivot)
distanceFromRefLine -= (0.5 * widthMinusOverlap);

double RefDist = (distanceFromRefLine + (isHeadingSameWay ? mf.tool.offset : -mf.tool.offset)) / widthMinusOverlap;

if (RefDist < 0) howManyPathsAway = (int)(RefDist - 0.5);
else howManyPathsAway = (int)(RefDist + 0.5);

Expand All @@ -167,7 +167,7 @@ public void BuildCurveCurrentList(vec3 pivot)
//build the current line
curList?.Clear();

double distAway = widthMinusOverlap * howManyPathsAway + (isHeadingSameWay ? -mf.tool.offset : mf.tool.offset ) + mf.trk.gArr[idx].nudgeDistance;
double distAway = widthMinusOverlap * howManyPathsAway + (isHeadingSameWay ? -mf.tool.offset : mf.tool.offset) + mf.trk.gArr[idx].nudgeDistance;

distAway += (0.5 * widthMinusOverlap);

Expand Down Expand Up @@ -485,7 +485,7 @@ public void GetCurrentCurveLine(vec3 pivot, vec3 steer)
return;
}

SegmentFound:
SegmentFound:

//get the distance from currently active AB line

Expand Down Expand Up @@ -671,11 +671,12 @@ public void DrawCurveNew()

public void DrawProposed(int i)
{
GL.LineWidth(4);
GL.LineWidth(8);
GL.Color3(0.3, 0.92f, 0.42f);
GL.Begin(PrimitiveType.LineStrip);
GL.Begin(PrimitiveType.LineStrip);

for (int h = 0; h < mf.trk.gArr[i].curvePts.Count; h++)

GL.Vertex3(
mf.trk.gArr[i].curvePts[h].easting,
mf.trk.gArr[i].curvePts[h].northing,
Expand Down Expand Up @@ -706,12 +707,12 @@ public void DrawCurve()
GL.Begin(PrimitiveType.Lines);

for (int h = 0; h < ptCount; h++) GL.Vertex3(
mf.trk.gArr[mf.trk.idx].curvePts[h].easting,
mf.trk.gArr[mf.trk.idx].curvePts[h].northing,
mf.trk.gArr[mf.trk.idx].curvePts[h].easting,
mf.trk.gArr[mf.trk.idx].curvePts[h].northing,
0);

GL.End();

if (mf.font.isFontOn)
{
GL.Color3(0.40f, 0.90f, 0.95f);
Expand Down Expand Up @@ -1011,8 +1012,8 @@ public void MakePointMinimumSpacing(ref List<vec3> xList, double minDistance)
}


//turning the visual line into the real reference line to use
public void SaveSmoothList()
//turning the visual line into the real reference line to use
public void SaveSmoothList()
{
//oops no smooth list generated
if (smooList == null) return;
Expand Down Expand Up @@ -1070,7 +1071,7 @@ public void AddFirstLastPoints(ref List<vec3> xList)
//end
while (mf.bnd.bndList[0].fenceLineEar.IsPointInPolygon(xList[xList.Count - 1]))
{
for (int i = 1; i < 10; i++)
for (int i = 1; i < 100; i++)
{
vec3 pt = new vec3(xList[ptCnt]);
pt.easting += (Math.Sin(pt.heading) * i);
Expand All @@ -1085,7 +1086,7 @@ public void AddFirstLastPoints(ref List<vec3> xList)

while (mf.bnd.bndList[0].fenceLineEar.IsPointInPolygon(xList[0]))
{
for (int i = 1; i < 10; i++)
for (int i = 1; i < 100; i++)
{
vec3 pt = new vec3(start);
pt.easting -= (Math.Sin(pt.heading) * i);
Expand All @@ -1094,6 +1095,26 @@ public void AddFirstLastPoints(ref List<vec3> xList)
}
start = new vec3(xList[0]);
}

for (int i = 1; i < 100; i++)
{
vec3 pt = new vec3(xList[ptCnt]);
pt.easting += (Math.Sin(pt.heading) * i);
pt.northing += (Math.Cos(pt.heading) * i);
xList.Add(pt);
}

//and the beginning
start = new vec3(xList[0]);

for (int i = 1; i < 100; i++)
{
vec3 pt = new vec3(start);
pt.easting -= (Math.Sin(pt.heading) * i);
pt.northing -= (Math.Cos(pt.heading) * i);
xList.Insert(0, pt);
}

}
else
{
Expand Down
2 changes: 1 addition & 1 deletion SourceCode/GPS/Classes/CABLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ public void DrawProposed(int i)
{
GL.LineWidth(4);
//GL.Enable(EnableCap.LineStipple);
GL.Begin(PrimitiveType.Lines);
GL.Color3(0.30f, 0.972f, 0.32f);
GL.Begin(PrimitiveType.Lines);
{
GL.Vertex3(mf.trk.gArr[i].endPtA.easting, mf.trk.gArr[i].endPtA.northing, 0);
GL.Vertex3(mf.trk.gArr[i].endPtB.easting, mf.trk.gArr[i].endPtB.northing, 0);
Expand Down
61 changes: 56 additions & 5 deletions SourceCode/GPS/Forms/Controls.Designer.cs

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

Loading

0 comments on commit c0e54da

Please sign in to comment.