waypoints: use GPS heading when available
parent
f462f87e11
commit
d482d7134f
|
|
@ -137,7 +137,7 @@ let gps = {
|
||||||
init: function(x) {
|
init: function(x) {
|
||||||
this.emulator = (process.env.BOARD=="EMSCRIPTEN"
|
this.emulator = (process.env.BOARD=="EMSCRIPTEN"
|
||||||
|| process.env.BOARD=="EMSCRIPTEN2")?1:0;
|
|| process.env.BOARD=="EMSCRIPTEN2")?1:0;
|
||||||
this.emulator = 1; // FIXME
|
//this.emulator = 1; // FIXME
|
||||||
},
|
},
|
||||||
state: {},
|
state: {},
|
||||||
on_gps: function(f) {
|
on_gps: function(f) {
|
||||||
|
|
@ -199,6 +199,7 @@ let arrow = {
|
||||||
|
|
||||||
// Display function to show arrows for waypoint, north, and sun
|
// Display function to show arrows for waypoint, north, and sun
|
||||||
draw: function(currentPos) {
|
draw: function(currentPos) {
|
||||||
|
let fix = currentPos;
|
||||||
let currentHeading = currentPos.course;
|
let currentHeading = currentPos.course;
|
||||||
g.clear().setFont("Vector", 22).setFontAlign(0, 0);
|
g.clear().setFont("Vector", 22).setFontAlign(0, 0);
|
||||||
|
|
||||||
|
|
@ -214,6 +215,9 @@ let arrow = {
|
||||||
this.drawArrow(c, "Up", 1);
|
this.drawArrow(c, "Up", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fix.speed && fix.speed > 3)
|
||||||
|
this.north = fix.course;
|
||||||
|
|
||||||
// Draw compass arrow for north
|
// Draw compass arrow for north
|
||||||
this.drawArrow(0, "N", 1);
|
this.drawArrow(0, "N", 1);
|
||||||
|
|
||||||
|
|
@ -680,8 +684,8 @@ function testArrow() {
|
||||||
Bangle.setCompassPower(1, "waypoints");
|
Bangle.setCompassPower(1, "waypoints");
|
||||||
|
|
||||||
arrow.name = "test";
|
arrow.name = "test";
|
||||||
arrow.waypoint.lat = 49;
|
arrow.waypoint.lat = 50;
|
||||||
arrow.waypoint.lon = 12;
|
arrow.waypoint.lon = 14.75;
|
||||||
goTo();
|
goTo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue