Skip to content

Commit

Permalink
Merge pull request #409 from farmerbriantee/Kiosk
Browse files Browse the repository at this point in the history
Kiosk
  • Loading branch information
farmerbriantee authored May 31, 2024
2 parents b7fe294 + 58d8fd0 commit f0a84a3
Show file tree
Hide file tree
Showing 13 changed files with 497 additions and 234 deletions.
619 changes: 431 additions & 188 deletions SourceCode/GPS/Classes/CABCurve.cs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions SourceCode/GPS/Classes/CTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ public void DrawTool()
//draw the sections
GL.LineWidth(2);

double hite = mf.camera.camSetDistance / -200;
if (hite > 0.5) hite = 0.5;
if (hite < 0.3) hite = 0.3;
double hite = mf.camera.camSetDistance / -150;
if (hite > 12) hite = 12;
if (hite < 1) hite = 1;

{
for (int j = 0; j < numOfSections; j++)
Expand Down Expand Up @@ -340,7 +340,7 @@ public void DrawTool()
}
GL.End();

if (mf.camera.camSetDistance > -150)
if (mf.camera.camSetDistance > -width * 200)
{
GL.Begin(PrimitiveType.LineLoop);
{
Expand Down
4 changes: 4 additions & 0 deletions SourceCode/GPS/Classes/CTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public void NudgeTrack(double dist)
else
{
mf.curve.isCurveValid = false;
mf.curve.lastHowManyPathsAway = 98888;
mf.curve.lastSecond = 0;
gArr[idx].nudgeDistance += mf.curve.isHeadingSameWay ? dist : -dist;

Expand All @@ -161,6 +162,7 @@ public void NudgeDistanceReset()
else
{
mf.curve.isCurveValid = false;
mf.curve.lastHowManyPathsAway = 98888;
mf.curve.lastSecond = 0;
}

Expand Down Expand Up @@ -201,6 +203,7 @@ public void NudgeRefTrack(double dist)
else
{
mf.curve.isCurveValid = false;
mf.curve.lastHowManyPathsAway = 98888;
mf.curve.lastSecond = 0;
NudgeRefCurve( mf.curve.isHeadingSameWay ? dist : -dist);
}
Expand All @@ -221,6 +224,7 @@ public void NudgeRefABLine(double dist)
public void NudgeRefCurve(double distAway)
{
mf.curve.isCurveValid = false;
mf.curve.lastHowManyPathsAway = 98888;
mf.curve.lastSecond = 0;

List<vec3> curList = new List<vec3>();
Expand Down
82 changes: 41 additions & 41 deletions SourceCode/GPS/Classes/CVehicle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -523,47 +523,47 @@ public void DrawVehicle()
}
GL.LineWidth(1);

if (mf.camera.camSetDistance < -500)
{
GL.Color4(0.5f, 0.5f, 1.2f, 0.25);
double theta = glm.twoPI / 20;
double c = Math.Cos(theta);//precalculate the sine and cosine
double s = Math.Sin(theta);

double x = mf.camera.camSetDistance * -.015;//we start at angle = 0
double y = 0;
GL.LineWidth(1);
GL.Begin(PrimitiveType.TriangleFan);
GL.Vertex3(x, y, 0.0);
for (int ii = 0; ii < 20; ii++)
{
//output vertex
GL.Vertex3(x, y, 0.0);

//apply the rotation matrix
double t = x;
x = (c * x) - (s * y);
y = (s * t) + (c * y);
// GL.Vertex3(x, y, 0.0);
}
GL.End();
GL.Color3(0.5f, 1.2f, 0.2f);
GL.LineWidth(2);
GL.Begin(PrimitiveType.LineLoop);

for (int ii = 0; ii < 20; ii++)
{
//output vertex
GL.Vertex3(x, y, 0.0);

//apply the rotation matrix
double t = x;
x = (c * x) - (s * y);
y = (s * t) + (c * y);
// GL.Vertex3(x, y, 0.0);
}
GL.End();
}
//if (mf.camera.camSetDistance < -500)
//{
// GL.Color4(0.5f, 0.5f, 1.2f, 0.25);
// double theta = glm.twoPI / 20;
// double c = Math.Cos(theta);//precalculate the sine and cosine
// double s = Math.Sin(theta);

// double x = mf.camera.camSetDistance * -.015;//we start at angle = 0
// double y = 0;
// GL.LineWidth(1);
// GL.Begin(PrimitiveType.TriangleFan);
// GL.Vertex3(x, y, 0.0);
// for (int ii = 0; ii < 20; ii++)
// {
// //output vertex
// GL.Vertex3(x, y, 0.0);

// //apply the rotation matrix
// double t = x;
// x = (c * x) - (s * y);
// y = (s * t) + (c * y);
// // GL.Vertex3(x, y, 0.0);
// }
// GL.End();
// GL.Color3(0.5f, 1.2f, 0.2f);
// GL.LineWidth(2);
// GL.Begin(PrimitiveType.LineLoop);

// for (int ii = 0; ii < 20; ii++)
// {
// //output vertex
// GL.Vertex3(x, y, 0.0);

// //apply the rotation matrix
// double t = x;
// x = (c * x) - (s * y);
// y = (s * t) + (c * y);
// // GL.Vertex3(x, y, 0.0);
// }
// GL.End();
//}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions SourceCode/GPS/Classes/CYouTurn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2500,6 +2500,7 @@ public void YouTurnTrigger()
if (!isGoingStraightThrough)
mf.curve.isLateralTriggered = true;
mf.curve.isCurveValid = false;
mf.curve.lastHowManyPathsAway = 98888;
}
}
}
Expand Down Expand Up @@ -2601,6 +2602,7 @@ public void BuildManualYouLateral(bool isTurnLeft)

mf.ABLine.isABValid = false;
mf.curve.isCurveValid = false;
mf.curve.lastHowManyPathsAway = 98888;
}

//build the points and path of youturn to be scaled and transformed
Expand Down Expand Up @@ -2697,6 +2699,7 @@ public void BuildManualYouTurn(bool isTurnLeft, bool isTurnButtonTriggered)

mf.ABLine.isABValid = false;
mf.curve.isCurveValid = false;
mf.curve.lastHowManyPathsAway = 98888;
}

public int onA;
Expand Down
6 changes: 5 additions & 1 deletion SourceCode/GPS/Forms/Controls.Designer.cs

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

1 change: 1 addition & 0 deletions SourceCode/GPS/Forms/Guidance/FormABDraw.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ private void FormABDraw_FormClosing(object sender, FormClosingEventArgs e)
}

mf.curve.isCurveValid = false;
mf.curve.lastHowManyPathsAway = 98888;
mf.ABLine.isABValid = false;

mf.twoSecondCounter = 100;
Expand Down
2 changes: 2 additions & 0 deletions SourceCode/GPS/Forms/Guidance/FormBuildTracks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ private void btnCancelMain_Click(object sender, EventArgs e)
mf.trk.idx = originalLine;

mf.curve.isCurveValid = false;
mf.curve.lastHowManyPathsAway = 98888;
mf.ABLine.isABValid = false;

mf.twoSecondCounter = 100;
Expand All @@ -156,6 +157,7 @@ private void btnListUse_Click(object sender, EventArgs e)
isClosing = true;
//reset to generate new reference
mf.curve.isCurveValid = false;
mf.curve.lastHowManyPathsAway = 98888;
mf.ABLine.isABValid = false;
mf.curve.desList?.Clear();

Expand Down
1 change: 1 addition & 0 deletions SourceCode/GPS/Forms/Guidance/FormGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ private void FormABDraw_Load(object sender, EventArgs e)
private void FormABDraw_FormClosing(object sender, FormClosingEventArgs e)
{
mf.curve.isCurveValid = false;
mf.curve.lastHowManyPathsAway = 98888;
mf.ABLine.isABValid = false;

mf.twoSecondCounter = 100;
Expand Down
2 changes: 2 additions & 0 deletions SourceCode/GPS/Forms/Guidance/FormNudge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ private void btnCycleLines_Click(object sender, EventArgs e)
//reset to generate new reference
mf.ABLine.isABValid = false;
mf.curve.isCurveValid = false;
mf.curve.lastHowManyPathsAway = 98888;

if (mf.isBtnAutoSteerOn) mf.btnAutoSteer.PerformClick();

Expand Down Expand Up @@ -134,6 +135,7 @@ private void btnCycleLinesBk_Click(object sender, EventArgs e)
//reset to generate new reference
mf.ABLine.isABValid = false;
mf.curve.isCurveValid = false;
mf.curve.lastHowManyPathsAway = 98888;

if (mf.isBtnAutoSteerOn) mf.btnAutoSteer.PerformClick();

Expand Down
1 change: 1 addition & 0 deletions SourceCode/GPS/Forms/Guidance/FormRefNudge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ private void btnCancelMain_Click(object sender, EventArgs e)

mf.ABLine.isABValid = false;
mf.curve.isCurveValid = false;
mf.curve.lastHowManyPathsAway = 98888;

//mf.FileSaveTracks();
Close();
Expand Down
1 change: 1 addition & 0 deletions SourceCode/GPS/Forms/Position.designer.cs

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

1 change: 1 addition & 0 deletions SourceCode/GPS/Forms/UDPComm.Designer.cs

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

0 comments on commit f0a84a3

Please sign in to comment.