Skip to content

Commit

Permalink
Fir write heading
Browse files Browse the repository at this point in the history
  • Loading branch information
0xRe1nk0 committed Jul 27, 2023
1 parent 7d12f31 commit a2649bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,11 @@ private void collectDBTracks(@NonNull SQLiteDatabase db, @NonNull Map<String, GP
pt.hdop = query.getDouble(4);
pt.time = query.getLong(5);

float heading = query.getFloat(6);
pt.heading = heading == NO_HEADING ? Float.NaN : heading;
if (query.isNull(6)) {
pt.heading = Float.NaN;
} else {
pt.heading = query.getFloat(6);
}

Map<String, String> extensions = getPluginsExtensions(query.getString(7));
pt.getExtensionsToWrite().putAll(extensions);
Expand Down Expand Up @@ -764,7 +767,7 @@ private void executeInsertTrackQuery(double lat, double lon, double alt, double
rowsMap.put(TRACK_COL_SPEED, speed);
rowsMap.put(TRACK_COL_HDOP, hdop);
rowsMap.put(TRACK_COL_DATE, time);
rowsMap.put(TRACK_COL_HEADING, heading);
rowsMap.put(TRACK_COL_HEADING, Float.isNaN(heading) ? null : heading);
rowsMap.put(TRACK_COL_PLUGINS_INFO, pluginsInfo);
execWithClose(AndroidUtils.createDbInsertQuery(TRACK_NAME, rowsMap.keySet()), rowsMap.values().toArray());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ private void onRadioButtonClick(@NonNull View view, @NonNull SwitchPreferenceEx
}
}
}
dismiss();
}

private void updatePreferenceButtons(boolean checked) {
Expand Down

0 comments on commit a2649bc

Please sign in to comment.