interface

master
frederic wagner 2022-11-07 14:08:39 +01:00
parent 769ced85e4
commit 10d42bae2e
11 changed files with 2 additions and 82 deletions

View File

@ -50,8 +50,8 @@ Once you have your gpx file you need to convert it to *gpc* which is my custom f
They are smaller than gpx and reduce the number of computations left to be done on the watch. They are smaller than gpx and reduce the number of computations left to be done on the watch.
Two possibilities here : Two possibilities here :
- easy : use [gipy uploader](../gipy_uploader) - easy : upload from here
- hard : use [gpconv](https://github.com/wagnerf42/gpconv) - hard : use an external tool : [gpconv](https://github.com/wagnerf42/gpconv)
* you need to compile *gpconv* yourself (it is some rust code) * you need to compile *gpconv* yourself (it is some rust code)
* you can download additional openstreetmap data to get interest points along the path * you can download additional openstreetmap data to get interest points along the path
* you need to upload the obtained *gpc* file manually for example with the [ide](https://www.espruino.com/ide/) * you need to upload the obtained *gpc* file manually for example with the [ide](https://www.espruino.com/ide/)

View File

@ -1 +0,0 @@
0.01: Initial Release

View File

@ -1,7 +0,0 @@
# Gipy Uploader
Uploads and convert a gpx file to the watch for use with [gipy](../gipy).
## Creator
Made by [Frederic Wagner](mailto:frederic.wagner@imag.fr)

View File

@ -1,58 +0,0 @@
<html>
<head>
<link rel="stylesheet" href="../../css/spectre.min.css">
</head>
<body>
<p>Please select a gpx file to be converted to gpc and loaded.</p>
<input type="file" is="gpx_file" id="fileInput" accept=".gpx">
<script src="../../core/lib/customize.js"></script>
<script type="module">
import init, { convert_gpx_strings } from "./pkg/gpconv.js";
console.log("imported wasm");
document.getElementById('fileInput').addEventListener('change', function selectedFileChanged() {
if (this.files.length === 0) {
console.log('No file selected.');
return;
}
let gpx_filename = this.files[0].name;
let gpc_filename = gpx_filename.slice(0, gpx_filename.length-4) + ".gpc";
while (gpc_filename.length > 28) {
let new_name = prompt("enter a shorter destination filename than '" + gpc_filename + "' (28 chars max)", gpc_filename);
if (new_name != null && new_name.slice(new_name.length-4) == ".gpc") {
gpc_filename = new_name;
} else {
return;
}
}
const reader = new FileReader();
reader.onload = function fileReadCompleted() {
console.log("reading file completed");
init().then(() => {
let gpc_file = convert_gpx_strings(reader.result);
let gpc_string = String.fromCharCode.apply(String, gpc_file);
console.log("uploading");
sendCustomizedApp({
storage:[
{name:gpc_filename, url:'test.gpc', content:gpc_string},
]
});
});
}
reader.readAsText(this.files[0]);
});
</script>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,14 +0,0 @@
{
"id": "gipy_uploader",
"name": "Gipy uploader",
"version": "0.01",
"description": "uploads and convert gpx files for use with gipy",
"icon": "gipy.png",
"type": "app",
"tags": "tool,outdoors,gps",
"supports": ["BANGLEJS2"],
"readme": "README.md",
"storage": [],
"custom": "custom.html",
"allow_emulator": false
}