gipy: fix for large files + size opt for prefix

master
frederic wagner 2023-12-11 14:27:17 +01:00
parent 371345b861
commit ae784dc4f1
4 changed files with 11 additions and 13 deletions

View File

@ -128,3 +128,6 @@
* Touching the screen when sleeping will wake up but not change screen * Touching the screen when sleeping will wake up but not change screen
* Removing footways (if bicycles not allowed) to reduce resource usage * Removing footways (if bicycles not allowed) to reduce resource usage
* Switching screen will clear the screen immediately so you can know your screen touch has been received * Switching screen will clear the screen immediately so you can know your screen touch has been received
0.24:
* Fix for loading very large files (> 65kb)

View File

@ -1,5 +1,8 @@
urgent TODO: urgent TODO:
- check why there is a very large path on files extracted from maps2gpx
medium TODO:
- prefetch tiles ? - prefetch tiles ?
- update documentation to reflect new display ? - update documentation to reflect new display ?

View File

@ -320,12 +320,7 @@ class Interests {
let end = this.offsets.end_offset(); let end = this.offsets.end_offset();
this.binary_interests = new Uint8Array(end); this.binary_interests = new Uint8Array(end);
let buffer = E.toArrayBuffer(s.read(filename, offset, end)); let buffer = E.toArrayBuffer(s.read(filename, offset, end));
let binary_interests = Uint8Array(buffer, offset, end); this.binary_interests = Uint8Array(buffer);
this.binary_interests = binary_interests;
//TODO: check we don't need copy anymore
// for (let i = 0; i < end; i++) {
// this.binary_interests[i] = binary_interests[i];
// }
offset += end; offset += end;
return [this, offset]; return [this, offset];
} }
@ -803,9 +798,7 @@ class Status {
displaying = true; displaying = true;
g.clear(); g.clear();
if (this.screen == MAP) { if (this.screen == MAP) {
console.log("displaying map");
this.display_map(); this.display_map();
console.log("done displaying map");
if (this.position !== null) { if (this.position !== null) {
// start_profiling(); // start_profiling();
this.display_path(); this.display_path();
@ -1186,7 +1179,6 @@ function load_gps(filename) {
interests = res[0]; interests = res[0];
offset = res[1]; offset = res[1];
} else if (block_type == 4) { } else if (block_type == 4) {
console.log("loading heights");
let heights_number = path.points.length / 2; let heights_number = path.points.length / 2;
let buffer = E.toArrayBuffer(s.read(filename, offset, heights_number*2)); let buffer = E.toArrayBuffer(s.read(filename, offset, heights_number*2));
heights = Int16Array(buffer); heights = Int16Array(buffer);
@ -1204,10 +1196,10 @@ class Path {
let points_number = Uint16Array(E.toArrayBuffer(s.read(filename, offset, 2)))[0]; let points_number = Uint16Array(E.toArrayBuffer(s.read(filename, offset, 2)))[0];
offset += 2; offset += 2;
let waypoints_len = Math.ceil(points_number / 8.0); let waypoints_len = Math.ceil(points_number / 8.0);
let buffer = E.toArrayBuffer(s.read(filename, offset, points_number * 2 + waypoints_len)); let buffer = E.toArrayBuffer(s.read(filename, offset, points_number * 16 + waypoints_len));
// path points // path points
this.points = Float64Array(buffer, 0, points_number); this.points = Float64Array(buffer, 0, 2 * points_number);
offset += 8 * points_number * 2; offset += 8 * points_number * 2;
// path waypoints // path waypoints

View File

@ -2,7 +2,7 @@
"id": "gipy", "id": "gipy",
"name": "Gipy", "name": "Gipy",
"shortName": "Gipy", "shortName": "Gipy",
"version": "0.23", "version": "0.24",
"description": "Follow gpx files using the gps. Don't get lost in your bike trips and hikes.", "description": "Follow gpx files using the gps. Don't get lost in your bike trips and hikes.",
"allow_emulator":false, "allow_emulator":false,
"icon": "gipy.png", "icon": "gipy.png",