2023-03-14 22:08:30 +00:00
|
|
|
/* Thanks to pinsafe from BangleApps repository */
|
|
|
|
|
|
|
|
var Layout = require("Layout");
|
2023-11-17 03:09:45 +00:00
|
|
|
const BANGLEJS2 = process.env.HWVERSION == 2; // check for bangle 2
|
2023-03-14 22:08:30 +00:00
|
|
|
|
2024-07-01 20:25:20 +00:00
|
|
|
/* fmt library v0.1.1 */
|
2024-06-24 17:31:45 +00:00
|
|
|
let fmt = {
|
|
|
|
icon_alt : "\0\x08\x1a\1\x00\x00\x00\x20\x30\x78\x7C\xFE\xFF\x00\xC3\xE7\xFF\xDB\xC3\xC3\xC3\xC3\x00\x00\x00\x00\x00\x00\x00\x00",
|
|
|
|
icon_m : "\0\x08\x1a\1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC3\xE7\xFF\xDB\xC3\xC3\xC3\xC3\x00\x00\x00\x00\x00\x00\x00\x00",
|
|
|
|
icon_km : "\0\x08\x1a\1\xC3\xC6\xCC\xD8\xF0\xD8\xCC\xC6\xC3\x00\xC3\xE7\xFF\xDB\xC3\xC3\xC3\xC3\x00\x00\x00\x00\x00\x00\x00\x00",
|
|
|
|
icon_kph : "\0\x08\x1a\1\xC3\xC6\xCC\xD8\xF0\xD8\xCC\xC6\xC3\x00\xC3\xE7\xFF\xDB\xC3\xC3\xC3\xC3\x00\xFF\x00\xC3\xC3\xFF\xC3\xC3",
|
|
|
|
icon_c : "\0\x08\x1a\1\x00\x00\x60\x90\x90\x60\x00\x7F\xFF\xC0\xC0\xC0\xC0\xC0\xFF\x7F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
|
|
|
|
|
|
|
|
/* 0 .. DD.ddddd
|
|
|
|
1 .. DD MM.mmm'
|
|
|
|
2 .. DD MM'ss"
|
|
|
|
*/
|
|
|
|
geo_mode : 1,
|
|
|
|
|
|
|
|
init: function() {},
|
|
|
|
fmtDist: function(km) { return km.toFixed(1) + this.icon_km; },
|
|
|
|
fmtSteps: function(n) { return fmtDist(0.001 * 0.719 * n); },
|
|
|
|
fmtAlt: function(m) { return m.toFixed(0) + this.icon_alt; },
|
|
|
|
fmtTimeDiff: function(d) {
|
|
|
|
if (d < 180)
|
|
|
|
return ""+d.toFixed(0);
|
|
|
|
d = d/60;
|
|
|
|
return ""+d.toFixed(0)+"m";
|
|
|
|
},
|
|
|
|
fmtAngle: function(x) {
|
|
|
|
switch (this.geo_mode) {
|
|
|
|
case 0:
|
|
|
|
return "" + x;
|
|
|
|
case 1: {
|
|
|
|
let d = Math.floor(x);
|
|
|
|
let m = x - d;
|
|
|
|
m = m*60;
|
|
|
|
return "" + d + " " + m.toFixed(3) + "'";
|
|
|
|
}
|
|
|
|
case 2: {
|
|
|
|
let d = Math.floor(x);
|
|
|
|
let m = x - d;
|
|
|
|
m = m*60;
|
|
|
|
let mf = Math.floor(m);
|
|
|
|
let s = m - mf;
|
|
|
|
s = s*60;
|
|
|
|
return "" + d + " " + mf + "'" + s.toFixed(0) + '"';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return "bad mode?";
|
|
|
|
},
|
|
|
|
fmtPos: function(pos) {
|
|
|
|
let x = pos.lat;
|
|
|
|
let c = "N";
|
|
|
|
if (x<0) {
|
|
|
|
c = "S";
|
|
|
|
x = -x;
|
|
|
|
}
|
2024-06-24 20:56:39 +00:00
|
|
|
let s = c+this.fmtAngle(x) + "\n";
|
2024-06-24 17:31:45 +00:00
|
|
|
c = "E";
|
|
|
|
if (x<0) {
|
|
|
|
c = "W";
|
|
|
|
x = -x;
|
|
|
|
}
|
2024-06-24 20:56:39 +00:00
|
|
|
return s + c + this.fmtAngle(x);
|
2024-06-24 17:31:45 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* gps library v0.1 */
|
|
|
|
let gps = {
|
|
|
|
emulator: -1,
|
|
|
|
init: function(x) {
|
|
|
|
this.emulator = (process.env.BOARD=="EMSCRIPTEN"
|
|
|
|
|| process.env.BOARD=="EMSCRIPTEN2")?1:0;
|
|
|
|
},
|
|
|
|
state: {},
|
|
|
|
on_gps: function(f) {
|
|
|
|
let fix = this.getGPSFix();
|
|
|
|
f(fix);
|
|
|
|
|
|
|
|
/*
|
|
|
|
"lat": number, // Latitude in degrees
|
|
|
|
"lon": number, // Longitude in degrees
|
|
|
|
"alt": number, // altitude in M
|
|
|
|
"speed": number, // Speed in kph
|
|
|
|
"course": number, // Course in degrees
|
|
|
|
"time": Date, // Current Time (or undefined if not known)
|
|
|
|
"satellites": 7, // Number of satellites
|
|
|
|
"fix": 1 // NMEA Fix state - 0 is no fix
|
|
|
|
"hdop": number, // Horizontal Dilution of Precision
|
|
|
|
*/
|
|
|
|
this.state.timeout = setTimeout(this.on_gps, 1000, f);
|
|
|
|
},
|
|
|
|
off_gps: function() {
|
|
|
|
clearTimeout(gps_state.timeout);
|
|
|
|
},
|
|
|
|
getGPSFix: function() {
|
|
|
|
if (!this.emulator)
|
|
|
|
return Bangle.getGPSFix();
|
|
|
|
let fix = {};
|
|
|
|
fix.fix = 1;
|
|
|
|
fix.lat = 50;
|
|
|
|
fix.lon = 14;
|
|
|
|
fix.alt = 200;
|
|
|
|
fix.speed = 5;
|
|
|
|
fix.course = 30;
|
|
|
|
fix.time = Date();
|
|
|
|
fix.satellites = 5;
|
|
|
|
fix.hdop = 12;
|
|
|
|
return fix;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2023-03-14 22:08:30 +00:00
|
|
|
var wp = require('Storage').readJSON("waypoints.json", true) || [];
|
|
|
|
// Use this with corrupted waypoints
|
|
|
|
//var wp = [];
|
2023-10-12 12:30:30 +00:00
|
|
|
var key; /* Shared between functions, typically wp name */
|
|
|
|
var fix; /* GPS fix */
|
|
|
|
var cancel_gps;
|
|
|
|
var gps_start;
|
2023-03-14 22:08:30 +00:00
|
|
|
|
|
|
|
function writeWP() {
|
|
|
|
require('Storage').writeJSON("waypoints.json", wp);
|
|
|
|
}
|
|
|
|
|
|
|
|
function mainMenu() {
|
2023-11-16 20:39:37 +00:00
|
|
|
let textInputInstalled = true;
|
|
|
|
try {
|
|
|
|
require("textinput")
|
|
|
|
} catch(err) {
|
|
|
|
textInputInstalled = false;
|
|
|
|
}
|
2023-03-14 22:08:30 +00:00
|
|
|
var menu = {
|
2023-11-16 20:39:37 +00:00
|
|
|
"< Back" : () => load()
|
2023-03-14 22:08:30 +00:00
|
|
|
};
|
2023-11-17 03:09:45 +00:00
|
|
|
if (textInputInstalled && BANGLEJS2) {
|
2023-11-16 20:39:37 +00:00
|
|
|
menu["Add"]=addCard;
|
|
|
|
}
|
2024-06-24 20:56:39 +00:00
|
|
|
menu["Show"]=showCard;
|
2023-03-14 22:08:30 +00:00
|
|
|
menu["Remove"]=removeCard;
|
|
|
|
menu["Format"]=setFormat;
|
2024-06-03 20:09:28 +00:00
|
|
|
if (textInputInstalled && BANGLEJS2) {
|
2023-11-16 20:39:37 +00:00
|
|
|
menu["Mark GPS"]=markGps;
|
|
|
|
}
|
2023-03-14 22:08:30 +00:00
|
|
|
g.clear();
|
|
|
|
E.showMenu(menu);
|
|
|
|
}
|
|
|
|
|
2023-10-12 12:30:30 +00:00
|
|
|
function updateGps() {
|
2024-06-24 17:31:45 +00:00
|
|
|
let have = false, lat = "lat ", alt = "?",
|
|
|
|
speed = "speed ", hdop = "?", adelta = "adelta ",
|
|
|
|
tdelta = "tdelta ";
|
|
|
|
|
|
|
|
if (cancel_gps)
|
|
|
|
return;
|
|
|
|
fix = gps.getGPSFix();
|
2023-10-12 12:30:30 +00:00
|
|
|
|
2024-06-24 17:31:45 +00:00
|
|
|
if (fix && fix.fix && fix.lat) {
|
|
|
|
lat = "" + fmt.fmtPos(fix);
|
|
|
|
alt = "" + fix.alt.toFixed(0);
|
|
|
|
speed = "" + fix.speed.toFixed(1);
|
|
|
|
hdop = "" + fix.hdop.toFixed(0);
|
|
|
|
have = true;
|
|
|
|
} else {
|
|
|
|
lat = "NO FIX\n"
|
|
|
|
+ "" + (getTime() - gps_start).toFixed(0) + "s ";
|
|
|
|
}
|
|
|
|
|
|
|
|
let msg = "";
|
|
|
|
msg = lat + "\n"+ alt + "m";
|
|
|
|
g.reset().setFont("Vector", 31)
|
|
|
|
.setColor(1,1,1)
|
|
|
|
.fillRect(0, 24, 176, 100)
|
|
|
|
.setColor(0,0,0)
|
|
|
|
.drawString(msg, 3, 25);
|
|
|
|
setTimeout(updateGps, 1000);
|
2023-10-12 12:30:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function stopGps() {
|
|
|
|
cancel_gps=true;
|
2024-06-24 21:20:23 +00:00
|
|
|
Bangle.setGPSPower(0, "waypoints");
|
2023-10-12 12:30:30 +00:00
|
|
|
}
|
|
|
|
|
2023-11-01 10:36:59 +00:00
|
|
|
function confirmGps(s) {
|
2024-06-24 21:20:23 +00:00
|
|
|
key = s;
|
|
|
|
var la = new Layout (
|
|
|
|
{type:"v", c: [
|
|
|
|
{type:"txt", font:"15%", pad:1, fillx:1, filly:1, label:""},
|
|
|
|
{type:"txt", font:"15%", pad:1, fillx:1, filly:1, label:""},
|
|
|
|
{type:"txt", font:"15%", pad:1, fillx:1, filly:1, label:""},
|
|
|
|
{type:"h", c: [
|
|
|
|
{type:"btn", font:"15%", pad:1, fillx:1, filly:1, label: "YES", cb:l=>{
|
|
|
|
print("should mark", key, fix); createWP(fix.lat, fix.lon, key); cancel_gps=true; mainMenu();
|
|
|
|
}},
|
|
|
|
{type:"btn", font:"15%", pad:1, fillx:1, filly:1, label: " NO", cb:l=>{ cancel_gps=true; mainMenu(); }}
|
|
|
|
]}
|
|
|
|
], lazy:true});
|
|
|
|
g.clear();
|
|
|
|
la.render();
|
|
|
|
updateGps();
|
2023-10-12 12:30:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function markGps() {
|
|
|
|
cancel_gps = false;
|
2024-06-24 21:20:23 +00:00
|
|
|
Bangle.setGPSPower(1, "waypoints");
|
2023-10-12 12:30:30 +00:00
|
|
|
gps_start = getTime();
|
2023-11-01 10:36:59 +00:00
|
|
|
require("textinput").input({text:"wp"}).then(key => {
|
|
|
|
confirmGps(key);
|
|
|
|
});
|
2023-10-12 12:30:30 +00:00
|
|
|
}
|
|
|
|
|
2023-03-14 22:08:30 +00:00
|
|
|
function setFormat() {
|
2023-10-12 12:30:30 +00:00
|
|
|
var la = new Layout (
|
2023-11-03 20:56:10 +00:00
|
|
|
{type:"v", c: [
|
|
|
|
{type:"txt", font:"15%", pad:1, fillx:1, filly:1, label:"Format"},
|
2024-06-24 17:31:45 +00:00
|
|
|
{type:"btn", font:"15%", pad:1, fillx:1, filly:1, label: "DD.dddd", cb:l=>{ fmt.geo_mode = 0; mainMenu(); }},
|
|
|
|
{type:"btn", font:"15%", pad:1, fillx:1, filly:1, label: "DD MM.mmm'", cb:l=>{ fmt.geo_mode = 1; mainMenu(); }},
|
|
|
|
{type:"btn", font:"15%", pad:1, fillx:1, filly:1, label: "DD MM'ss"+'"', cb:l=>{ fmt.geo_mode = 2; mainMenu(); }},
|
2023-11-03 20:56:10 +00:00
|
|
|
], lazy:true});
|
2023-03-14 22:08:30 +00:00
|
|
|
g.clear();
|
2023-10-12 12:30:30 +00:00
|
|
|
la.render();
|
2023-03-14 22:08:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function showNumpad(text, key_, callback) {
|
|
|
|
key = key_;
|
|
|
|
E.showMenu();
|
|
|
|
function addDigit(digit) {
|
|
|
|
key+=digit;
|
|
|
|
if (1) {
|
|
|
|
l = text[key.length];
|
|
|
|
switch (l) {
|
|
|
|
case '.': case ' ': case "'":
|
|
|
|
key+=l;
|
|
|
|
break;
|
|
|
|
case 'd': case 'D': default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Bangle.buzz(20);
|
|
|
|
update();
|
|
|
|
}
|
|
|
|
function update() {
|
|
|
|
g.reset();
|
|
|
|
g.clearRect(0,0,g.getWidth(),23);
|
|
|
|
s = key + text.substr(key.length, 999);
|
|
|
|
g.setFont("Vector:24").setFontAlign(1,0).drawString(s,g.getWidth(),12);
|
|
|
|
}
|
|
|
|
ds="12%";
|
|
|
|
var numPad = new Layout ({
|
|
|
|
type:"v", c: [{
|
|
|
|
type:"v", c: [
|
|
|
|
{type:"", height:24},
|
|
|
|
{type:"h",filly:1, c: [
|
|
|
|
{type:"btn", font:ds, width:58, label:"7", cb:l=>{addDigit("7");}},
|
|
|
|
{type:"btn", font:ds, width:58, label:"8", cb:l=>{addDigit("8");}},
|
|
|
|
{type:"btn", font:ds, width:58, label:"9", cb:l=>{addDigit("9");}}
|
|
|
|
]},
|
|
|
|
{type:"h",filly:1, c: [
|
|
|
|
{type:"btn", font:ds, width:58, label:"4", cb:l=>{addDigit("4");}},
|
|
|
|
{type:"btn", font:ds, width:58, label:"5", cb:l=>{addDigit("5");}},
|
|
|
|
{type:"btn", font:ds, width:58, label:"6", cb:l=>{addDigit("6");}}
|
|
|
|
]},
|
|
|
|
{type:"h",filly:1, c: [
|
|
|
|
{type:"btn", font:ds, width:58, label:"1", cb:l=>{addDigit("1");}},
|
|
|
|
{type:"btn", font:ds, width:58, label:"2", cb:l=>{addDigit("2");}},
|
|
|
|
{type:"btn", font:ds, width:58, label:"3", cb:l=>{addDigit("3");}}
|
|
|
|
]},
|
|
|
|
{type:"h",filly:1, c: [
|
|
|
|
{type:"btn", font:ds, width:58, label:"0", cb:l=>{addDigit("0");}},
|
|
|
|
{type:"btn", font:ds, width:58, label:"C", cb:l=>{key=key.slice(0,-1); update();}},
|
|
|
|
{type:"btn", font:ds, width:58, id:"OK", label:"OK", cb:callback}
|
|
|
|
]}
|
|
|
|
]}
|
|
|
|
], lazy:true});
|
|
|
|
g.clear();
|
|
|
|
numPad.render();
|
|
|
|
update();
|
|
|
|
}
|
|
|
|
|
2024-06-24 21:20:23 +00:00
|
|
|
function show(pin) {
|
|
|
|
var i = wp[pin];
|
|
|
|
var l = fmt.fmtPos(i);
|
|
|
|
E.showPrompt(l,{
|
|
|
|
title:i["name"],
|
|
|
|
buttons : {"Ok":true}
|
|
|
|
}).then(function(v) {
|
|
|
|
mainMenu();
|
2024-06-24 20:56:39 +00:00
|
|
|
});
|
2024-06-24 21:20:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function showCard() {
|
|
|
|
var menu = {
|
|
|
|
"" : {title : "Select WP"},
|
|
|
|
"< Back" : mainMenu
|
|
|
|
};
|
|
|
|
if (Object.keys(wp).length==0) Object.assign(menu, {"No WPs":""});
|
|
|
|
else {
|
|
|
|
wp.forEach((val, card) => {
|
|
|
|
const name = wp[card].name;
|
|
|
|
menu[name]= () => show(card);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
E.showMenu(menu);
|
2024-06-24 20:56:39 +00:00
|
|
|
}
|
|
|
|
|
2024-06-24 21:07:31 +00:00
|
|
|
function remove(pin)
|
|
|
|
{
|
2024-06-24 21:20:23 +00:00
|
|
|
let card = wp[pin];
|
|
|
|
let name = card["name"];
|
|
|
|
print("Remove?", card, name);
|
2024-06-24 20:56:39 +00:00
|
|
|
|
2024-06-24 21:20:23 +00:00
|
|
|
E.showPrompt(name,{
|
|
|
|
title:"Delete",
|
|
|
|
}).then(function(v) {
|
|
|
|
if (v) {
|
2024-06-24 21:07:31 +00:00
|
|
|
wp.splice(pin, 1);
|
2024-06-24 20:56:39 +00:00
|
|
|
writeWP();
|
|
|
|
mainMenu();
|
2024-06-24 21:20:23 +00:00
|
|
|
} else {
|
2024-06-24 20:56:39 +00:00
|
|
|
mainMenu();
|
2024-06-24 21:07:31 +00:00
|
|
|
}
|
2024-06-24 21:20:23 +00:00
|
|
|
});
|
|
|
|
}
|
2024-06-24 20:56:39 +00:00
|
|
|
|
2023-03-14 22:08:30 +00:00
|
|
|
function removeCard() {
|
2024-06-24 21:20:23 +00:00
|
|
|
var menu = {
|
|
|
|
"" : {title : "Select WP"},
|
|
|
|
"< Back" : mainMenu
|
|
|
|
};
|
|
|
|
if (Object.keys(wp).length==0) Object.assign(menu, {"No WPs":""});
|
|
|
|
else {
|
|
|
|
wp.forEach((val, card) => {
|
|
|
|
const name = wp[card].name;
|
|
|
|
menu[name]=()=> remove(card);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
E.showMenu(menu);
|
2023-03-14 22:08:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function ask01(t, cb) {
|
2023-10-12 12:30:30 +00:00
|
|
|
var la = new Layout (
|
2023-03-14 22:08:30 +00:00
|
|
|
{type:"v", c: [
|
2023-10-12 12:30:30 +00:00
|
|
|
{type:"txt", font:"15%", pad:1, fillx:1, filly:1, label:"Select"},
|
2023-03-14 22:08:30 +00:00
|
|
|
{type:"btn", font:"15%", pad:1, fillx:1, filly:1, label: t[0], cb:l=>{ cb(1); }},
|
|
|
|
{type:"btn", font:"15%", pad:1, fillx:1, filly:1, label: t[1], cb:l=>{ cb(-1); }},
|
|
|
|
], lazy:true});
|
|
|
|
g.clear();
|
2023-10-12 12:30:30 +00:00
|
|
|
la.render();
|
2023-03-14 22:08:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function askCoordinate(t1, t2, callback) {
|
2024-03-04 20:34:50 +00:00
|
|
|
//let sign = 1;
|
2023-03-14 22:08:30 +00:00
|
|
|
ask01(t1, function(sign) {
|
2024-06-24 17:31:45 +00:00
|
|
|
switch (fmt.geo_mode) {
|
2023-03-14 22:08:30 +00:00
|
|
|
case 0: s = "DDD.dddd"; break;
|
|
|
|
case 1: s = "DDD MM.mmm"; break;
|
|
|
|
case 2: s = "DDD MM'ss"+'"'; break;
|
|
|
|
}
|
|
|
|
showNumpad(s, t2, function() {
|
2024-06-24 17:31:45 +00:00
|
|
|
switch (fmt.geo_mode) {
|
2023-03-14 22:08:30 +00:00
|
|
|
case 0:
|
|
|
|
res = parseFloat(key);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
d = parseInt(key.substr(0, 3));
|
|
|
|
m = parseFloat(key.substr(3,99));
|
|
|
|
res = d + m/60.0;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
d = parseInt(key.substr(0, 3));
|
|
|
|
m = parseInt(key.substr(4, 2));
|
|
|
|
s = parseInt(key.substr(7, 2));
|
|
|
|
res = d + m/60.0 + s/3600.0;
|
|
|
|
}
|
|
|
|
res = sign * res;
|
|
|
|
print("Coordinate", res);
|
|
|
|
callback(res);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function askPosition(callback) {
|
|
|
|
askCoordinate("NS", "0", function(lat) {
|
|
|
|
askCoordinate("EW", "", function(lon) {
|
|
|
|
callback(lat, lon);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-10-12 12:30:30 +00:00
|
|
|
function createWP(lat, lon, name) {
|
2023-11-03 20:56:10 +00:00
|
|
|
let n = {};
|
|
|
|
n["name"] = name;
|
|
|
|
n["lat"] = lat;
|
|
|
|
n["lon"] = lon;
|
|
|
|
wp.push(n);
|
|
|
|
print("add -- waypoints", wp);
|
|
|
|
writeWP();
|
2023-10-12 12:30:30 +00:00
|
|
|
}
|
|
|
|
|
2023-11-01 10:36:59 +00:00
|
|
|
function addCardName(name) {
|
2023-11-03 20:56:10 +00:00
|
|
|
g.clear();
|
|
|
|
askPosition(function(lat, lon) {
|
|
|
|
print("position -- ", lat, lon);
|
|
|
|
createWP(lat, lon, result);
|
|
|
|
mainMenu();
|
|
|
|
});
|
2023-11-01 10:36:59 +00:00
|
|
|
}
|
|
|
|
|
2023-03-14 22:08:30 +00:00
|
|
|
function addCard() {
|
2023-11-01 10:36:59 +00:00
|
|
|
require("textinput").input({text:"wp"}).then(key => {
|
2023-03-14 22:08:30 +00:00
|
|
|
result = key;
|
|
|
|
if (wp[result]!=undefined) {
|
|
|
|
E.showMenu();
|
|
|
|
var alreadyExists = new Layout (
|
|
|
|
{type:"v", c: [
|
|
|
|
{type:"txt", font:Math.min(15,100/result.length)+"%", pad:1, fillx:1, filly:1, label:result},
|
|
|
|
{type:"txt", font:"12%", pad:1, fillx:1, filly:1, label:"already exists."},
|
|
|
|
{type:"h", c: [
|
2023-11-01 10:36:59 +00:00
|
|
|
{type:"btn", font:"10%", pad:1, fillx:1, filly:1, label: "REPLACE", cb:l=>{addCardName(result);}},
|
2023-03-14 22:08:30 +00:00
|
|
|
{type:"btn", font:"10%", pad:1, fillx:1, filly:1, label: "CANCEL", cb:l=>{mainMenu();}}
|
|
|
|
]}
|
|
|
|
], lazy:true});
|
|
|
|
g.clear();
|
|
|
|
alreadyExists.render();
|
2023-11-01 10:36:59 +00:00
|
|
|
}
|
|
|
|
addCardName(result);
|
2023-03-14 22:08:30 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-06-24 17:31:45 +00:00
|
|
|
fmt.init();
|
|
|
|
gps.init();
|
|
|
|
|
2023-03-14 22:08:30 +00:00
|
|
|
g.reset();
|
|
|
|
mainMenu();
|