made GPS a static class
This commit is contained in:
@@ -75,9 +75,9 @@ class INS {
|
||||
|
||||
private function move(dir: Null<Pos3>) {
|
||||
Log.debug('INS move: $dir');
|
||||
var pos = GPS.instance.getPosition();
|
||||
var pos = GPS.getPosition();
|
||||
var newPos = pos + dir;
|
||||
GPS.instance.setINSPosition(newPos);
|
||||
GPS.setINSPosition(newPos);
|
||||
}
|
||||
|
||||
public function getHeading():Null<Pos3> {
|
||||
@@ -94,7 +94,7 @@ class INS {
|
||||
return null;
|
||||
}
|
||||
|
||||
GPS.instance.locate().handle((pos1)->{
|
||||
GPS.locate().handle((pos1)->{
|
||||
Log.debug('pos1: $pos1');
|
||||
if (pos1 == null) {
|
||||
Log.warn("GPS not available for 1st position");
|
||||
@@ -110,7 +110,7 @@ class INS {
|
||||
return;
|
||||
}
|
||||
|
||||
GPS.instance.locate().handle((pos2)->{
|
||||
GPS.locate().handle((pos2)->{
|
||||
Log.debug('pos2: $pos2');
|
||||
if (pos2 == null) {
|
||||
Log.warn("GPS not available for 2nd position");
|
||||
@@ -127,7 +127,7 @@ class INS {
|
||||
|
||||
this.heading = heading;
|
||||
moveBack(moved);
|
||||
GPS.instance.setINSPosition(pos1);
|
||||
GPS.setINSPosition(pos1);
|
||||
|
||||
resolve(Noise);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user