Skip to content

Commit

Permalink
Merge pull request #3702 from NoobEjby/bttfclock
Browse files Browse the repository at this point in the history
bttfclock: add charging screen
  • Loading branch information
bobrippling authored Dec 24, 2024
2 parents bb1ac19 + e0adbd3 commit f76b9e8
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 8 deletions.
3 changes: 2 additions & 1 deletion apps/bttfclock/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
0.01: Back to the future clock first version.
0.02: Added more icons to the status field. Made it posible to custemize the step goal thrue the Health Tracking app.
0.02: Added more icons to the status field. Made it posible to custemize the step goal thrue the Health Tracking app.
0.03: Added charging screen.
4 changes: 3 additions & 1 deletion apps/bttfclock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ A watchface inspierd by <a target="_blank" href="https://apps.garmin.com/apps/d1

## Screenshots
Clock:<br/>

![](screenshot.png)<br/>
Clock when charging:<br/>
![](screenshotCharging.png)<br/>

## Usage
Install it and enjoy
Expand Down
79 changes: 74 additions & 5 deletions apps/bttfclock/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ const statusDataY = statusTextY+19;
let stepGoal = (require("Storage").readJSON("health.json",1)||10000).stepGoal;
let steps = 0;
let alarmStatus = (require('Storage').readJSON('sched.json',1)||[]).some(alarm=>alarm.on);
let charching = Bangle.isCharging();
let chargeAniFrame= 0;

const chargeAni =[require("heatshrink").decompress(atob("2GwgcEiFBAX4CbhEgwQC/ATeAUP4CegSh/ATyh/AT0AUP4CeUP4CeoCh/AT0BUP4CeUP4CewCh/AT0CUP4CeUP4CegCh/ATyh/AT1AUP4CegKh/ATyh/AT2AUP4CJgUBgAXSoBxNgEgaLUAAAMCCh8kKB4kCgKDXgAuBwAdLiRBCAoJEOgEEyFAAYJBVoECpMkyUIIJWChJEBAQJEBI4ZlIoIjBpJBQXI0AiRBCDoK/HQYQ+EyFIkiMBQxBlDpLuBQasADQIdDYRA4BIJAICKwsIMokkgB0GAR0EIIg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SAQwmNO4JBCmiDFC5aDHgJBSExpBKTZiDpkGSZAJBGC5uQIOMSTZsSYQQCXFJ1BkkQm3QgTOCIK8BQbwICwE2QYI7LYr8QFiJBCQBwICYrSDQYoJBBCiKDvINiwQwE2zDFVgKDomiDcfxACIFiJBXHaICGQcY7XIP4CIVpYICwE26ECYRoICiFAINiDBIJyAcAQYvNiBBCYp1BQYICdQcWAIPqAeAQbFOzDFOfzACJQZs0QbECIOyDjOJpBCYpj+aARKDqgJBim3QIJiDliDFLmzFNfzgCKIL2AQ0K2KIJrCkAQiDXDQMAZEyDKzBBJHcoCEGQKDImiDJYVICDQZBB0gSGCAoKDQYVICHIJzCsZBWAm3QgTCuARZ6DmyDFH2aGFiEAgBBCiTsZIj8gIAIABHzICjgMkyUAgMEgRB5gFJIINIgAskYqtAiRBCpMgdLoCcoA+BIIUkgBB5gBBrbqkEIIuAgT+ZATxB/kGAHwYCCyBBlbSZBHgD+aATpB/IP5B/IP4CHghBFwAskoEgwUIASBBHgQaRAU0AIIsAIP5BBFkeAbSsSIIcgfzgCegBBCpEAIPkBIIIDBFMMCbrMAAAT+cAUJABL7QC/AQbghAXlAUP4CegKh/ATyh/AT2AOJ4="))
];

const bluetoothOnIcon = require("heatshrink").decompress(atob("iEQwYROg3AAokYAgUMg0DAoUBwwFDgE2CIYdHAogREDoopFGoodGABI="));

Expand All @@ -30,12 +38,15 @@ const notificationIcon = require("heatshrink").decompress(atob("iEQyBC/AB3/8ABBD
var drawTimeout;

// schedule a draw for the next minute
function queueDraw() {
function queueDraw(time) {
if (drawTimeout) clearTimeout(drawTimeout);
drawTimeout = setTimeout(function() {
drawTimeout = undefined;
draw();
}, 60000 - (Date.now() % 60000));
//draw;
//console.log(drawTimeout);
}, time - (Date.now() % time));

}

function getSteps() {
Expand Down Expand Up @@ -75,6 +86,20 @@ function drawBlackBox() {
//Status
g.fillRect(62, statusDataY-1, 62+49, statusDataY+15);
}


function draw(){
let time = 60000;
if(charching){
drawCharging();
time = 500;
}else{
drawWatchface();
}
//console.log(charching);
queueDraw(time);
}

function drawGoal() {
var goal = stepGoal <= steps;
g.reset();
Expand Down Expand Up @@ -113,7 +138,43 @@ function drawRedkBox() {
g.fillRect(62, statusTextY,62+49, statusTextY+15);
}

function draw(){
function drawCharging(){
g.drawImage(chargeAni[chargeAniFrame], 0, 0);
chargeAniFrame+=1;
if(chargeAniFrame>=chargeAni.length){
chargeAniFrame=0;
}


var date = new Date();
var h = date.getHours(), m = date.getMinutes();

if (h<10) {
h = ("0"+h).substr(-2);
}
if (m<10) {
m = ("0"+m).substr(-2);
}

//time
g.reset();
g.setBgColor(0,0,0);
g.setColor(1,0,0);
g.setFont("7x11Numeric7Seg",3);
g.drawString(h, 40, 105);
g.drawString(m, 95, 105);


var bat = E.getBattery();
var batl = bat.toString().length-1;
var batDrawX = 80-(11*batl);
//80 69 58
g.drawString(bat, batDrawX, 20);
//g.drawLine(77,18,94,18);

}

function drawWatchface(){
drawBackground();
getSteps();
drawBlackBox();
Expand Down Expand Up @@ -209,7 +270,6 @@ function draw(){
g.setFont("4x5");
g.drawString('Present day', 62, 88);

queueDraw();
}

/**
Expand All @@ -221,19 +281,28 @@ function draw(){
g.setTheme({bg:"#000",fg:"#fff",dark:true}).clear();
//draw();
//the following section is from waveclk
Bangle.on('lcdPower',on=>{
Bangle.on('lcdPower',function(on) {
if (on) {
draw(); // draw immediately, queue redraw
console.log(drawTimeout);
} else { // stop draw timer
if (drawTimeout) clearTimeout(drawTimeout);
drawTimeout = undefined;
}
});

Bangle.on('charging', function(charging) {
Bangle.setLCDTimeout(!charging);
Bangle.setLCDPower(1);
charching = charging;
draw();
});


Bangle.setUI("clock");
// Load widgets, but don't show them
Bangle.loadWidgets();
require("widget_utils").swipeOn(); // hide widgets, make them visible with a swipe
g.clear(1);
//queueDraw();
draw();
2 changes: 1 addition & 1 deletion apps/bttfclock/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "bttfclock",
"name": "Back To The Future",
"version": "0.02",
"version": "0.03",
"description": "The watch of Marty McFly",
"readme": "README.md",
"icon": "app.png",
Expand Down
Binary file added apps/bttfclock/screenshotCharging.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f76b9e8

Please sign in to comment.