Skip to content

Commit

Permalink
starting to add various record types to breadcrumb trail
Browse files Browse the repository at this point in the history
  • Loading branch information
barry-ha committed Apr 7, 2023
1 parent cca512d commit 93cda4e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions model_breadcrumbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ class Breadcrumbs {
// Constructor - create and initialize member variables
Breadcrumbs() {}

// todo: 1. refactor "class Location" into this file
// todo: 2. refactor "makeLocation()" into ctor (or public member) of "class Location"
// todo: 3. replace remember(Location) with remember(a,b,c,d,e,f)
// todo: 4. add rememberPUP(), rememberPDN(), rememberTOD()

void remember(Location vLoc) {
// save this GPS location and timestamp in internal array
// so that we can display it as a breadcrumb trail
Expand Down
2 changes: 1 addition & 1 deletion model_gps.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class Model {
Location makeLocation() {
// collect GPS information from the Model into an object that can be saved in the history[] buffer
PointGPS whereAmI{gLatitude, gLongitude};
Location loc{whereAmI, gTimestamp, gSatellites, gSpeed, gAngle, gAltitude};
Location loc{rGPS, whereAmI, gTimestamp, gSatellites, gSpeed, gAngle, gAltitude};
return loc;
}

Expand Down
4 changes: 2 additions & 2 deletions unit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ int verifyBreadCrumbTrail1() {
model->gLongitude = lon + (ii * stepSize * 5 / 4)}; // "plus" goes rightward (east)
time_t stamp = now();
// doesn't matter what timestamp/sats/speed/direction/altitude is actually stored during tests
Location loc{latLong, stamp, 5, 10.0, 45.0, 123.0};
Location loc{rGPS, latLong, stamp, 5, 10.0, 45.0, 123.0};
trail.remember(loc);
}

Expand Down Expand Up @@ -577,7 +577,7 @@ void generateSineWave(Model *pModel) {
PointGPS latLong{latitude, longitude};
time_t stamp = now();
// doesn't matter what timestamp/sats/speed/direction/altitude is actually stored during tests
Location loc{latLong, stamp, 5, 10.0, 45.0, 123.0};
Location loc{rGPS, latLong, stamp, 5, 10.0, 45.0, 123.0};
trail.remember(loc);
}
// Serial.println("---History as known by generateSineWave()...");
Expand Down

0 comments on commit 93cda4e

Please sign in to comment.