Skip to content

Commit

Permalink
update some more
Browse files Browse the repository at this point in the history
  • Loading branch information
Indriði Einarsson committed Jan 1, 2024
1 parent b85643e commit 1a828b0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
28 changes: 18 additions & 10 deletions apps/ieclock/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ sunrise.compactTime = function(t) {

sunrise.draw = function(x, y, Radius, Settings) {
loadLocation();
updateSunRiseSunSet(new Date(), location.lat, location.lon);
//updateSunRiseSunSet(new Date(), location.lat, location.lon);
let halfScreenWidth = g.getWidth() / 2;
let largeComplication = (x === halfScreenWidth);
auxdial = require("https://raw.githubusercontent.com/indridieinarsson/espruino_sandbox/master/24hAuxDial.js");
let rmult = (largeComplication?1.7:1.35);
let h1 = sunRise.getHours();
let m1 = sunRise.getMinutes();
let h2 = sunSet.getHours();
let m2 = sunSet.getMinutes();
auxdial.draw(Settings, x, y, Math.round(Radius*rmult), h1 ,m1 , true);
let h1 = tidesrv.sunrise.getHours();
let m1 = tidesrv.sunrise.getMinutes();
let h2 = tidesrv.sunset.getHours();
let m2 = tidesrv.sunset.getMinutes();
auxdial.draw(Settings, x, y, Math.round(Radius*rmult), h1 ,m1 , h2, m2);

// let Text = this.compactTime(sunRise);
// g.setColor(Settings.Foreground === 'Theme' ? g.theme.fg : Settings.Foreground || '#000000');
Expand Down Expand Up @@ -89,11 +89,19 @@ tide.draw = function(x, y, Radius, Settings) {
{
return;
}
let h = ieclock.tides.time.getHours();
let m = ieclock.tides.time.getMinutes();
auxdial.draw(Settings, x, y, Math.round(Radius*rmult),h ,m , true);
let h1 = tidesrv.tides.time.getHours();
let m1 = tidesrv.tides.time.getMinutes();
let tlast = Date(tidesrv.tides.timelast);
let h2 = tlast.getHours();
let m2 = tlast.getMinutes();

if (tidesrv.tides.high) {
auxdial.draw(Settings, x, y, Math.round(Radius*rmult),h2 ,m2 , h1, m1);

Check failure on line 99 in apps/ieclock/app.js

View workflow job for this annotation

GitHub Actions / build

Mixed spaces and tabs
}else {
auxdial.draw(Settings, x, y, Math.round(Radius*rmult),h1 ,m1 , h2, m2);

Check failure on line 101 in apps/ieclock/app.js

View workflow job for this annotation

GitHub Actions / build

Mixed spaces and tabs
}
// if (largeComplication){
let th = ieclock.tides.height;
let th = tidesrv.tides.height;
let t1=th.toFixed(0);
let t2=((Math.abs(th)%1)*10).toFixed();
g.setColor(Settings.Foreground === 'Theme' ? g.theme.fg : Settings.Foreground || '#000000');
Expand Down
2 changes: 1 addition & 1 deletion apps/ieclock/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ "id": "ieclock",

Check warning on line 1 in apps/ieclock/metadata.json

View workflow job for this annotation

GitHub Actions / build

App ieclock has no ChangeLog
"name": "Analog Clock with barometer info",
"shortName":"IE Clock",
"version":"0.39",
"version":"0.40",
"description": "a simple analog clock with tidal information",
"icon": "app-icon.png",
"type": "clock",
Expand Down

0 comments on commit 1a828b0

Please sign in to comment.