made GPS a static class

This commit is contained in:
2023-07-30 15:42:02 +02:00
parent 97c906e013
commit 5a9d463192
6 changed files with 37 additions and 39 deletions

View File

@@ -16,13 +16,13 @@ class GPS extends CLIAppBase {
var pos: Pos3 = new Vec3<Float>(x, y, z);
kernel.gps.GPS.instance.setManualPosition(pos);
kernel.gps.GPS.setManualPosition(pos);
return true;
},"<x> <y> <z>");
registerSyncSubcommand("status",(args)->{
var pos = kernel.gps.GPS.instance.getPosition();
var pos = kernel.gps.GPS.getPosition();
if (pos != null) {
handle.writeLine('Position x:${pos.x} y:${pos.y} z:${pos.z}');
} else {
@@ -30,7 +30,7 @@ class GPS extends CLIAppBase {
return true;
}
var acc = kernel.gps.GPS.instance.getAccuracy();
var acc = kernel.gps.GPS.getAccuracy();
if (acc == 1){
handle.writeLine("Accuracy: Low");
} else if (acc == 2){
@@ -50,7 +50,7 @@ class GPS extends CLIAppBase {
});
registerAsyncSubcommand("locate",(args)->{
return kernel.gps.GPS.instance.locate().map((pos)->{
return kernel.gps.GPS.locate().map((pos)->{
if (pos != null) {
handle.writeLine('Position x:${pos.x} y:${pos.y} z:${pos.z}');
} else {