diff --git a/apps/gipy/ChangeLog b/apps/gipy/ChangeLog index 8646ba11a..9e9654fd0 100644 --- a/apps/gipy/ChangeLog +++ b/apps/gipy/ChangeLog @@ -87,3 +87,8 @@ * Reduce framerate if locked * Stroke to move around in the map * Fix for missing paths in display + +0.20: + * Large display for instant speed + * Bugfix for negative coordinates + * Disable menu while the map is not loaded diff --git a/apps/gipy/TODO b/apps/gipy/TODO index 266a1c5c9..c94211c1d 100644 --- a/apps/gipy/TODO +++ b/apps/gipy/TODO @@ -1,19 +1,15 @@ ++ disable backlight during day ? ++ put back foot only ways ++ disable bluetooth ++ disable lcd completely ++ try fiddling with jit ++ put back street names ++ put back shortest paths but with points cache this time and jit ++ how to display paths from shortest path ? + + +misc: + use Bangle.project(latlong) -* additional features -- config screen - - are we on foot (and should use compass) - -- we need to buzz 200m before sharp turns (or even better, 30seconds) -(and look at more than next point) - -- display distance to next water/toilet ? -- display scale (100m) - -- compress path ? - -* misc - -- code is becoming messy diff --git a/apps/gipy/app.js b/apps/gipy/app.js index 60e4bb5af..d34cb75fe 100644 --- a/apps/gipy/app.js +++ b/apps/gipy/app.js @@ -152,7 +152,7 @@ class Map { color_array[2] / 255, ]; offset += 3; - this.first_tile = Uint32Array(buffer, offset, 2); // absolute tile id of first tile + this.first_tile = Int32Array(buffer, offset, 2); // absolute tile id of first tile offset += 2 * 4; this.grid_size = Uint32Array(buffer, offset, 2); // tiles width and height offset += 2 * 4; @@ -471,7 +471,7 @@ class Map { class Interests { constructor(buffer, offset) { - this.first_tile = Uint32Array(buffer, offset, 2); // absolute tile id of first tile + this.first_tile = Int32Array(buffer, offset, 2); // absolute tile id of first tile offset += 2 * 4; this.grid_size = Uint32Array(buffer, offset, 2); // tiles width and height offset += 2 * 4; @@ -971,12 +971,18 @@ class Status { .drawString( "" + approximate_speed + - "km/h (in." + - approximate_instant_speed + - ")", + "km/h", 0, g.getHeight() - 15 ); + + g.setFont("6x8:3") + .setFontAlign(1, -1, 0) + .drawString( + ""+approximate_instant_speed, + g.getWidth(), + g.getHeight() - 22 + ); } if (this.path === null || this.position === null) { @@ -1374,6 +1380,46 @@ function start_gipy(path, maps, interests) { console.log("starting"); status = new Status(path, maps, interests); + setWatch( + function () { + if (in_menu) { + return; + } + in_menu = true; + const menu = { + "": { title: "choose action" }, + "Go Backward": { + value: go_backwards, + format: (v) => (v ? "On" : "Off"), + onchange: (v) => { + go_backwards = v; + }, + }, + Zoom: { + value: zoomed, + format: (v) => (v ? "In" : "Out"), + onchange: (v) => { + status.invalidate_caches(); + zoomed = v; + }, + }, + "back to map": function () { + in_menu = false; + E.showMenu(); + g.clear(); + g.flip(); + if (status !== null) { + status.display(); + } + }, + }; + E.showMenu(menu); + }, + BTN1, + { repeat: true } + ); + + if (status.path !== null) { let start = status.path.point(0); status.displayed_position = start; @@ -1455,44 +1501,6 @@ function start_gipy(path, maps, interests) { } } -setWatch( - function () { - if (in_menu) { - return; - } - in_menu = true; - const menu = { - "": { title: "choose action" }, - "Go Backward": { - value: go_backwards, - format: (v) => (v ? "On" : "Off"), - onchange: (v) => { - go_backwards = v; - }, - }, - Zoom: { - value: zoomed, - format: (v) => (v ? "In" : "Out"), - onchange: (v) => { - status.invalidate_caches(); - zoomed = v; - }, - }, - "back to map": function () { - in_menu = false; - E.showMenu(); - g.clear(); - g.flip(); - if (status !== null) { - status.display(); - } - }, - }; - E.showMenu(menu); - }, - BTN1, - { repeat: true } -); let files = s.list(".gps"); if (files.length <= 1) { diff --git a/apps/gipy/pkg/gps.d.ts b/apps/gipy/pkg/gps.d.ts index 15a90b1e8..c881052f4 100644 --- a/apps/gipy/pkg/gps.d.ts +++ b/apps/gipy/pkg/gps.d.ts @@ -67,11 +67,11 @@ export interface InitOutput { readonly __wbindgen_malloc: (a: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number) => number; readonly __wbindgen_export_2: WebAssembly.Table; - readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hab13c10d53cd1c5a: (a: number, b: number, c: number) => void; + readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__heb2f4d39a212d7d1: (a: number, b: number, c: number) => void; readonly __wbindgen_add_to_stack_pointer: (a: number) => number; readonly __wbindgen_free: (a: number, b: number) => void; readonly __wbindgen_exn_store: (a: number) => void; - readonly wasm_bindgen__convert__closures__invoke2_mut__h26ce002f44a5439b: (a: number, b: number, c: number, d: number) => void; + readonly wasm_bindgen__convert__closures__invoke2_mut__h362f82c7669db137: (a: number, b: number, c: number, d: number) => void; } export type SyncInitInput = BufferSource | WebAssembly.Module; diff --git a/apps/gipy/pkg/gps.js b/apps/gipy/pkg/gps.js index ce9ebe5f8..39c2a6804 100644 --- a/apps/gipy/pkg/gps.js +++ b/apps/gipy/pkg/gps.js @@ -205,7 +205,7 @@ function makeMutClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_24(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hab13c10d53cd1c5a(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__heb2f4d39a212d7d1(arg0, arg1, addHeapObject(arg2)); } function _assertClass(instance, klass) { @@ -369,7 +369,7 @@ function handleError(f, args) { } } function __wbg_adapter_84(arg0, arg1, arg2, arg3) { - wasm.wasm_bindgen__convert__closures__invoke2_mut__h26ce002f44a5439b(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); + wasm.wasm_bindgen__convert__closures__invoke2_mut__h362f82c7669db137(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); } /** @@ -460,6 +460,21 @@ function getImports() { const ret = getObject(arg0).fetch(getObject(arg1)); return addHeapObject(ret); }; + imports.wbg.__wbg_signal_31753ac644b25fbb = function(arg0) { + const ret = getObject(arg0).signal; + return addHeapObject(ret); + }; + imports.wbg.__wbg_new_6396e586b56e1dff = function() { return handleError(function () { + const ret = new AbortController(); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_abort_064ae59cda5cd244 = function(arg0) { + getObject(arg0).abort(); + }; + imports.wbg.__wbg_newwithstrandinit_05d7180788420c40 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2)); + return addHeapObject(ret); + }, arguments) }; imports.wbg.__wbg_new_2d0053ee81e4dd2a = function() { return handleError(function () { const ret = new Headers(); return addHeapObject(ret); @@ -496,21 +511,6 @@ function getImports() { const ret = getObject(arg0).text(); return addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_signal_31753ac644b25fbb = function(arg0) { - const ret = getObject(arg0).signal; - return addHeapObject(ret); - }; - imports.wbg.__wbg_new_6396e586b56e1dff = function() { return handleError(function () { - const ret = new AbortController(); - return addHeapObject(ret); - }, arguments) }; - imports.wbg.__wbg_abort_064ae59cda5cd244 = function(arg0) { - getObject(arg0).abort(); - }; - imports.wbg.__wbg_newwithstrandinit_05d7180788420c40 = function() { return handleError(function (arg0, arg1, arg2) { - const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2)); - return addHeapObject(ret); - }, arguments) }; imports.wbg.__wbg_new_abda76e883ba8a5f = function() { const ret = new Error(); return addHeapObject(ret); @@ -675,8 +675,8 @@ function getImports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2298 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 260, __wbg_adapter_24); + imports.wbg.__wbindgen_closure_wrapper2245 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 267, __wbg_adapter_24); return addHeapObject(ret); }; diff --git a/apps/gipy/pkg/gps_bg.wasm b/apps/gipy/pkg/gps_bg.wasm index 6999cb946..8e0fbc07e 100644 Binary files a/apps/gipy/pkg/gps_bg.wasm and b/apps/gipy/pkg/gps_bg.wasm differ diff --git a/apps/gipy/pkg/gps_bg.wasm.d.ts b/apps/gipy/pkg/gps_bg.wasm.d.ts index df9a024fa..b4303ee30 100644 --- a/apps/gipy/pkg/gps_bg.wasm.d.ts +++ b/apps/gipy/pkg/gps_bg.wasm.d.ts @@ -12,8 +12,8 @@ export function gps_from_area(a: number, b: number, c: number, d: number): numbe export function __wbindgen_malloc(a: number): number; export function __wbindgen_realloc(a: number, b: number, c: number): number; export const __wbindgen_export_2: WebAssembly.Table; -export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hab13c10d53cd1c5a(a: number, b: number, c: number): void; +export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__heb2f4d39a212d7d1(a: number, b: number, c: number): void; export function __wbindgen_add_to_stack_pointer(a: number): number; export function __wbindgen_free(a: number, b: number): void; export function __wbindgen_exn_store(a: number): void; -export function wasm_bindgen__convert__closures__invoke2_mut__h26ce002f44a5439b(a: number, b: number, c: number, d: number): void; +export function wasm_bindgen__convert__closures__invoke2_mut__h362f82c7669db137(a: number, b: number, c: number, d: number): void;