mirror of https://github.com/espruino/BangleApps
commit
ce13da02d5
|
@ -5,7 +5,7 @@
|
|||
"" : { "title" : "Altimeter Widget" },
|
||||
"< Back" : () => back(),
|
||||
'QNH: ': {
|
||||
value: 1013 | o.seaLevelPressure, // 0| converts undefined to 0
|
||||
value: o.seaLevelPressure,
|
||||
min: 100, max: 10000,
|
||||
format: v=>(v+"hPa\nAlt: "+(44330 * (1.0 - Math.pow(p.pressure/v, 0.1903))).toFixed(0)+"m"),
|
||||
onchange: v => {
|
||||
|
|
|
@ -11,15 +11,16 @@
|
|||
lastAlt=Math.floor(p.altitude);
|
||||
alt=p.altitude.toFixed(0);
|
||||
var w = WIDGETS["widalt"].width;
|
||||
WIDGETS["widalt"].width = 1 + (alt.length)*12+6;
|
||||
WIDGETS["widalt"].width = 1 + (alt.length)*12+16;
|
||||
if (w!=WIDGETS["widalt"].width) Bangle.drawWidgets();
|
||||
WIDGETS["widalt"].draw();
|
||||
setTimeout(readAltitude,60000);
|
||||
}
|
||||
});}
|
||||
catch(err) {
|
||||
print("ERROR");
|
||||
setTimeout(readAltitude,1000);
|
||||
}
|
||||
setTimeout(readAltitude,60000);
|
||||
}
|
||||
|
||||
readAltitude();
|
||||
|
@ -33,10 +34,10 @@
|
|||
g.setColor(g.theme.bg);
|
||||
g.fillRect(this.x, this.y, this.x + this.width, this.y + 23);
|
||||
g.setColor(g.theme.fg);
|
||||
g.drawImage(atob("BRaBACO3H8YghCEIfB8hCEIQ"), this.x+1, this.y);
|
||||
g.drawImage(atob("EBCBAAAAAAAIAAwgFXAX0BCYIIggTD/EYPZADkACf/4AAAAA"), this.x, this.y+4);
|
||||
g.setFontCustom(atob("AAAAABwAAOAAAgAAHAADwAD4AB8AB8AA+AAeAADAAAAOAAP+AH/8B4DwMAGBgAwMAGBgAwOAOA//gD/4AD4AAAAAAAABgAAcAwDAGAwAwP/+B//wAAGAAAwAAGAAAAAAAAIAwHgOA4DwMA+BgOwMDmBg4wOeGA/gwDwGAAAAAAAAAGAHA8A4DwMAGBhAwMMGBjgwOcOA+/gDj4AAAAABgAAcAAHgADsAA5gAOMAHBgBwMAP/+B//wABgAAMAAAAAAAgD4OB/AwOYGBjAwMYGBjBwMe8Bh/AIHwAAAAAAAAAfAAP8AHxwB8GAdgwPMGBxgwMOOAB/gAH4AAAAAAABgAAMAABgAwMAeBgPgMHwBj4AN8AB+AAPAABAAAAAAAMfAH38B/xwMcGBhgwMMGBjgwP+OA+/gDj4AAAAAAAAOAAH4AA/gQMMGBgzwME8BhvAOPgA/4AD8AAEAAAAAAGAwA4OAHBwAAA="), 46, atob("BAgMDAwMDAwMDAwMBQ=="), 21+(1<<8)+(1<<16));
|
||||
g.setFontAlign(-1, 0);
|
||||
g.drawString(alt, this.x+6, this.y + 12);
|
||||
g.drawString(alt, this.x+16, this.y + 12);
|
||||
}
|
||||
WIDGETS["widalt"] = {
|
||||
area: "tr",
|
||||
|
|
Loading…
Reference in New Issue