Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recorder: add clockinfo #2900

Merged
merged 9 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/clock_info/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
0.04: On 2v18+ firmware, we can now stop swipe events from being handled by other apps
eg. when a clockinfo is selected, swipes won't affect swipe-down widgets
0.05: Reported image for battery is now transparent (2v18+)
0.06: When >1 clockinfo, swiping one back tries to ensure they don't display the same thing
0.06: When >1 clockinfo, swiping one back tries to ensure they don't display the same thing
0.07: Developer tweak: clkinfo load errors are emitted
2 changes: 1 addition & 1 deletion apps/clock_info/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ exports.load = function() {
if(b) b.items = b.items.concat(a.items);
else menu = menu.concat(a);
} catch(e){
console.log("Could not load clock info "+E.toJS(fn));
console.log("Could not load clock info "+E.toJS(fn)+": "+e);
}
});

Expand Down
2 changes: 1 addition & 1 deletion apps/clock_info/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ "id": "clock_info",
"name": "Clock Info Module",
"shortName": "Clock Info",
"version":"0.06",
"version":"0.07",
"description": "A library used by clocks to provide extra information on the clock face (Altitude, BPM, etc)",
"icon": "app.png",
"type": "module",
Expand Down
1 change: 1 addition & 0 deletions apps/recorder/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@
0.27: Fix first ever recorded filename being log0 (now all are dated)
0.28: Automatically create new track if the filename is different
0.29: When plotting with OpenStMap scale map to track width & height
0.30: Add clock info for showing and toggling recording state
38 changes: 38 additions & 0 deletions apps/recorder/clkinfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
(function () {
const recimg = () =>
atob("GBiBAAAAABwAAD4MAH8eAH8OAH8AAD4QABx8AAD8AAH+AAE+AAM/AAN7wAN4wAB4AAB8AAD8AADOAAHGAAOHAAMDAAIBAAAAAAAAAA==");

const pauseimg = () =>
atob("GBiBAAAAAAAAAAAAAAAAAAHDgAPnwAPjwAPnwAPnwAPnwAPnwAPnwAPnwAPnwAPnwAPnwAPnwAPjwAPnwAHDgAAAAAAAAAAAAAAAAA==");

return {
name: "Bangle",
items: require("Storage").readJSON("recorder.json") ? [
{
name: "Toggle",
get: () => {
const w = WIDGETS && WIDGETS["recorder"];

return w && w.isRecording() ? {
text: "Recording",
short: "Rec",
img: recimg(),
} : {
text: w ? "Paused" : "No rec",
short: w ? "Paused" : "No rec",
img: pauseimg(),
};
},
run: () => {
const w = WIDGETS && WIDGETS["recorder"];
if(w){
Bangle.buzz();
w.setRecording(!w.isRecording(), { force: "append" });
}
},
show: () => {},
hide: () => {},
},
] : [],
};
});
5 changes: 3 additions & 2 deletions apps/recorder/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
"id": "recorder",
"name": "Recorder",
"shortName": "Recorder",
"version": "0.29",
"version": "0.30",
"description": "Record GPS position, heart rate and more in the background, then download to your PC.",
"icon": "app.png",
"tags": "tool,outdoors,gps,widget",
"tags": "tool,outdoors,gps,widget,clkinfo",
"supports": ["BANGLEJS","BANGLEJS2"],
"readme": "README.md",
"interface": "interface.html",
"storage": [
{"name":"recorder.app.js","url":"app.js"},
{"name":"recorder.img","url":"app-icon.js","evaluate":true},
{"name":"recorder.wid.js","url":"widget.js"},
{"name":"recorder.clkinfo.js","url":"clkinfo.js"},
{"name":"recorder.settings.js","url":"settings.js"}
],
"data": [
Expand Down