Skip to content

Commit

Permalink
generic improvement in position difference checks, part deux.
Browse files Browse the repository at this point in the history
  • Loading branch information
stronnag committed Dec 29, 2024
1 parent 0006218 commit ae90593
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/mwp/mwp-flysky_processing.vala
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ namespace Flysky {

var cse = Mwp.calc_cse_dist_delta(dlat, dlon, out ddm);
var spd = (double)(rg.gps_speed/100.0);

if(Math.fabs(ser.td.gps.lat - dlat) > 1e-6) {
var pdiff = Mwp.pos_diff(dlat, dlon, ser.td.gps.lat, ser.td.gps.lon);
if (Mwp.PosDiff.LAT in pdiff) {
fvup |= FlightBox.Update.LAT;
ttup |= TelemTracker.Fields.LAT;
ser.td.gps.lat = dlat;
}

if (Math.fabs(ser.td.gps.lon - dlon) > 1e-6) {
if (Mwp.PosDiff.LON in pdiff) {
fvup |= FlightBox.Update.LON;
ttup |= TelemTracker.Fields.LON;
ser.td.gps.lon = dlon;
Expand Down
2 changes: 1 addition & 1 deletion src/mwp/mwp-ltm_message.vala
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace Mwp {
ttup |= TelemTracker.Fields.LAT;
ser.td.gps.lat = lat;
}
if (PosDiff.LAT in pdiff) {
if (PosDiff.LON in pdiff) {
fvup |= FlightBox.Update.LON;
ttup |= TelemTracker.Fields.LON;
ser.td.gps.lon = lon;
Expand Down

0 comments on commit ae90593

Please sign in to comment.