From 647d4b290ff3034b6840d7dc7e372eb792831922 Mon Sep 17 00:00:00 2001 From: Dione Batista Date: Sun, 5 Jun 2022 15:52:10 -0400 Subject: [PATCH] Update Rocket Sequences Scope to not use memory all time --- apps/cassioWatch/ChangeLog | 3 +- apps/cassioWatch/app.js | 62 ++++++++++++++++++---------------- apps/cassioWatch/metadata.json | 2 +- 3 files changed, 35 insertions(+), 32 deletions(-) diff --git a/apps/cassioWatch/ChangeLog b/apps/cassioWatch/ChangeLog index 6cf283649..0f217bb56 100644 --- a/apps/cassioWatch/ChangeLog +++ b/apps/cassioWatch/ChangeLog @@ -4,4 +4,5 @@ 0.3: Minor Fixes. 0.4: Clear Old Time on Screen Before Draw new Time 0.5: Update Date and Time to use Native date Funcions -0.6: Add Settings Page \ No newline at end of file +0.6: Add Settings Page +0.7: Update Rocket Sequences Scope to not use memory all time \ No newline at end of file diff --git a/apps/cassioWatch/app.js b/apps/cassioWatch/app.js index d789003cc..851b5aa12 100644 --- a/apps/cassioWatch/app.js +++ b/apps/cassioWatch/app.js @@ -30,6 +30,37 @@ let background = require("heatshrink").decompress( ) ); +let rocket_sequence = 1; + +let settings = require('Storage').readJSON("cassioWatch.settings.json", true) || {}; +let rocketSpeed = settings.rocketSpeed || 700; +delete settings; + +g.clear(); + +function DrawClock() { + g.setFont("7x11Numeric7Seg", 3); + g.clearRect(80, 57, 170, 96); + g.setColor(0, 255, 255); + g.drawRect(80, 57, 170, 96); + g.fillRect(80, 57, 170, 96); + g.setColor(0, 0, 0); + g.drawString(require("locale").time(new Date(), 1), 70, 60); + g.setFont("8x12", 2); + g.drawString(require("locale").dow(new Date(), 2).toUpperCase(), 18, 130); + g.setFont("8x12"); + g.drawString(require("locale").month(new Date(), 2).toUpperCase(), 80, 126); + g.setFont("8x12", 2); + const time = new Date().getDate(); + g.drawString(time < 10 ? "0" + time : time, 78, 137); +} + +function DrawBattery() { + bigThenSmall(E.getBattery(), "%", 135, 21); +} + +function DrawRocket() { + let Rocket = { 1: require("heatshrink").decompress( atob( @@ -71,37 +102,8 @@ let Rocket = { "qFGwkCkQA/ABBSEJ8MgE4kBEsBPFE7xMCOIJ3hOYgFEE7rCGE70gE4pQBiAndYQwjBUohOZD4ZQFE7YkBE5AICYbZ2GE7sggJRCAA8iYzZOITroALE7EhExh4CAC0QExpPXOponZExx2XJ24nWdh52XdhzF/Yu5O/J35O0E55OXOx5O/J2omXE5x1XO54mYgQnMJrR4LOrciiAmiJgR4KEzIjDPBAlYiAiEeI51YkEBE4J5CD4KceTQQcBJgRQFdTZDCJIjDcNIqhGdTQmCkByFTTInDKgoAEE7ZEEJwhPdE1R1FE0InEE0R3DEwTGcDwomEE7hKFPYqafE8ROCE5DJbE5B/IEqh2ED4gnCJrMCJwgnEiB2bE4qeFEzUggQmIBQLEaEQImHLIImaE4YfcOw4lEFMLECS7onJO8wmkE4QljAAIA==" ) ), -}; -let rocket_sequence = 1; + }; -let settings = require('Storage').readJSON("cassioWatch.settings.json", true) || {}; -let rocketSpeed = settings.rocketSpeed || 700; -delete settings; - -g.clear(); - -function DrawClock() { - g.setFont("7x11Numeric7Seg", 3); - g.clearRect(80, 57, 170, 96); - g.setColor(0, 255, 255); - g.drawRect(80, 57, 170, 96); - g.fillRect(80, 57, 170, 96); - g.setColor(0, 0, 0); - g.drawString(require("locale").time(new Date(), 1), 70, 60); - g.setFont("8x12", 2); - g.drawString(require("locale").dow(new Date(), 2).toUpperCase(), 18, 130); - g.setFont("8x12"); - g.drawString(require("locale").month(new Date(), 2).toUpperCase(), 80, 126); - g.setFont("8x12", 2); - const time = new Date().getDate(); - g.drawString(time < 10 ? "0" + time : time, 78, 137); -} - -function DrawBattery() { - bigThenSmall(E.getBattery(), "%", 135, 21); -} - -function DrawRocket() { g.clearRect(5, 62, 63, 115); g.setColor(0, 255, 255); g.drawRect(5, 62, 63, 115); diff --git a/apps/cassioWatch/metadata.json b/apps/cassioWatch/metadata.json index eb7bcdc4e..95489e21f 100644 --- a/apps/cassioWatch/metadata.json +++ b/apps/cassioWatch/metadata.json @@ -4,7 +4,7 @@ "description": "Animated Clock with Space Cassio Watch Style", "screenshots": [{ "url": "screens/screen_night.png" },{ "url": "screens/screen_day.png" }], "icon": "app.png", - "version": "0.6", + "version": "0.7", "type": "clock", "tags": "clock, weather, cassio, retro", "supports": ["BANGLEJS2"],