From 231f3b6fdd531b1f3fcec927bc297f4c89853aec Mon Sep 17 00:00:00 2001 From: Daniel Thompson Date: Sun, 3 Jan 2021 14:54:34 +0000 Subject: [PATCH] apps: software: Add an apps to enable/disable other apps Currently wasp-os enables a narrow set of applications because we don't want to consume RAM by importing the module and constructing the application. We can improve on this situation by providing a small (stateless) application that can be used to enable or diable applications. This allows all the ROMed applications to be enabled using the GUI without compromising on the ability to develop applications. In fact this application significantlly reduces the RAM consumed in the default case becasue the Self Test app does not need to maintain its state. Signed-off-by: Daniel Thompson --- res/app_icon.png | Bin 6996 -> 7442 bytes res/software_icon.png | Bin 0 -> 6996 bytes wasp/apps/flashlight.py | 2 +- wasp/apps/software.py | 80 ++++++++++++++++++++++++++++++++++++++++ wasp/apps/testapp.py | 2 +- wasp/icons.py | 71 ++++++++++++++++++++++------------- 6 files changed, 128 insertions(+), 27 deletions(-) create mode 100644 res/software_icon.png create mode 100644 wasp/apps/software.py diff --git a/res/app_icon.png b/res/app_icon.png index 438cded3db82a24de8fa3c8994bd4c69d248e1cf..48a31dbc8c235a486c717ce5b7c5fa8273376654 100644 GIT binary patch literal 7442 zcmeHMc{tQ-`xl~ULAERzLy^p43}%KQdsE4pEy^t4VKDoQK~Y3hPAZfooRYMl#nz(D znk^B^R#K>xHpJ=3?>nQ@(eFL)d4K1+e(!&|u9^8h&-1xI_x*gH`+mO9bJ_2*#c`>O znv9s3*iymR)GGNXnf3+OhY1TzUXAWYac<^y%HR{=-%l zyFT2PBw&xJE?;#rZqNYnk!{&y*`xF3d34PvtT?yM>FUjAsvl3xMELZXSgsr?yII^+ zmUy#&ch<|vD$nf=z3OG#pTCW$^j~rPcU)WionGz`*-z{0nvY{PJnMHVr@T3lJv}cU zH9k{oWX|5zQ(4`kh>;SUR+PP1Vs2BFV;fUE)|j(l%ibr_j7JsQG}HUWyRj z+xvAoN0;qBblXYs-H4tq^SS5tx|yhm&vE)s8SD}D3ic#2XY%(uuYGkcntX0q(;?T* ztu*EL4o27h;#5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ti-?o5%fA?Ku9AB?j zzv9gqR}Es@4no=mm70!PA-2TlkP2~R4b7&YJnHlH)^vn9`Kw>wNH2+F(gEqx(q)os zw&a$gTyl*W2S|xc@0Xk)B{sc};Dpcu`4SPN`Ius#WE?pm8J z!bm&RniI156r{a9p(=oXq_^)m{ahwM%}J7m2(>fAl^8V1--;09IU-0S8)at{rUu+u zl##ZjPv4CDV+6ON<2H}~s%A)ThD__L44PrnX0TC8fw{}wf3 zHR%BFebqdW$j_tth)|N~o~EaprYD3G^mjum$Uh5-cmyW|YviMU)dBNekhTkgcJx~p zLEQlw=?5tdaS*dAK#F|LRFqPWrW5D@%PFYV1*NvNwzo%!eyAe+p9qqfK`H_Y`OX3T zKVU1so+#3eDHq_AFcR|bIFP~mgT{^vj<%|MPLM{vIRQ#;IAh4FO*v)-KmpH$*@hAn zfC3O#;+8}Co*rFA(~JXJ?R@TDOKA1Rdm#VPIiU44)XhWt2!JA-1M$JF&gncqI#^jK g>OFA|;2>rjzwD_He`=?=F8}}l07*qoM6N<$f|0RCDgXcg diff --git a/res/software_icon.png b/res/software_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..438cded3db82a24de8fa3c8994bd4c69d248e1cf GIT binary patch literal 6996 zcmb7pRZ|=cud~r9YXj7VY z%Q%vFDjFUDg8KIh|M(~JE*FR8ekjw_^7ThuyRIAg#wo3C;oR7VgSXMz=Es-56S}U> zEicAPl04y)ReJ7PpSXwGKL;m*xqs%A>1|%_1|J`#{Bwu@{6RFR?bc^#IRLtMD$N_x zga5hhX+`X~?ftcR@&cXMBi!A|ed~(#>sRqrT239FI<#kOz4E!^#@n}NoQ8axJDByH zygAv}KT}aw@I%Hwefyfv(08-;r1ZM$7Ux=cto zk8H-}uCL(a<$%Q{a zv~6FI@e5nqUYo$+*~=I#nV@*1>+1bj zBHC5Kj8=4Q`B?lm7_BAcl}d(Oe0VpEZgVzl3fCk4ZbY~?ILVAElmy&bC@QNN6ZyXr_H$jZ7XzvP*r=8QY7M*x$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i92>z#$e^$ngmx$d|sBGkX(9y@H7~p)hWgo%{ zfl?n`H}>}P>Yvt#?xv=3(>nnG;6km%#Z_d*#sAm;{?GN!`Iaao({`7 z0T*goE&Se{6}Fm9C~4sZ*B~PM<5gj>O}6p3fP*$MBa(}gi=tB=_0_DfcSwhXIvzUN zJvQL}d1qEy3=tIAq$SGrhbp*hfI6un46@V-5;H2NB294ec23B?bZrcHrg^O87we8> zqFti&*DLU_Y@=@W|k;*Z14eb6T2$P)qT1DU(p*f$dqE zKQR+AUC}s0Rk=nVEcG;b9i27DG!{GP{f&9ct65xg7b$SG`*9>d396DP=GqZ6HHjuv zk_XP1?*TjbBecm?2vTu~&;l`+*G>P+_GSw|lfR1Kp}@^(dw(>zLj3~O`m+nuRfilv zpyj5V?Gv+`(SGu+j(jv3oX~2|fSY{sL%;q^)I(obq51@YM-u!gJI zal$p{3&8qV;~I&V7afW9p)Iv8|#SmLTOwEeZp=|0uNB}#Vp-+?*2p-?uEy6Zp6g_@ z^~wm$XMOnfgj>=nRLB%i(tN@9rbj0-A)6EiYJ~Kq5^#=eL}BglQOQsfn_J?RA^rWD zlGs$Lyb<%V8$gD!*S-ODj^TTHN9goX| z>j-f1Z9y<$c&hk0LM7=iudF<~j6USUt%o@CurO+*Cjvc!?QZb`+>L%h6KatAtuDUk z8XVCPG9$V(Ry~tQlMU!y#adv0@Riw5hSFSvtb6g6cINl$0sT1Oz`#!o3L_ zG56##%*HX|Zzgl#Twm}e{C*A|j6;oU`tGBYAl1bOC+EOxI{aOc&jL{dZYpFs3eg1Gy%63gGFyoLS0-2%u;DoNCc83p|hZlpw# literal 0 HcmV?d00001 diff --git a/wasp/apps/flashlight.py b/wasp/apps/flashlight.py index 95c44b2..f5b8684 100644 --- a/wasp/apps/flashlight.py +++ b/wasp/apps/flashlight.py @@ -11,7 +11,7 @@ import wasp import icons -class FlashlightApp(object): +class TorchApp(object): """Trivial flashlight application. .. figure:: res/TorchApp.png diff --git a/wasp/apps/software.py b/wasp/apps/software.py new file mode 100644 index 0000000..2c7869c --- /dev/null +++ b/wasp/apps/software.py @@ -0,0 +1,80 @@ +# SPDX-License-Identifier: LGPL-3.0-or-later +# Copyright (C) 2020 Daniel Thompson +"""Wizard to generate main.py.""" + +import wasp +import icons + +class SoftwareApp(): + """Enable and disable applications.""" + NAME = 'Software' + ICON = icons.software + + def foreground(self): + """Activate the application.""" + self.db = ( + ('alarm', wasp.widgets.Checkbox(0, 0, 'Alarm')), + ('calc', wasp.widgets.Checkbox(0, 40, 'Calculator')), + ('chrono', wasp.widgets.Checkbox(0, 80, 'Chrono')), + ('fibonacci_clock', wasp.widgets.Checkbox(0, 120, 'Fibonacci Clock')), + ('gameoflife', wasp.widgets.Checkbox(0, 160, 'Game Of Life')), + ('musicplayer', wasp.widgets.Checkbox(0, 0, 'Music Player')), + ('snake', wasp.widgets.Checkbox(0, 40, 'Snake Game')), + ('flashlight', wasp.widgets.Checkbox(0, 80, 'Torch')), + ('testapp', wasp.widgets.Checkbox(0, 120, 'Test')), + ) + self.si = wasp.widgets.ScrollIndicator() + self.page = 0 + + # Get the initial state for the checkboxes + for _, checkbox in self.db: + label = checkbox.label.replace(' ', '') + for app in wasp.system.launcher_ring: + if type(app).__name__.startswith(label): + checkbox.state = True + break + + self._draw() + wasp.system.request_event(wasp.EventMask.TOUCH | + wasp.EventMask.SWIPE_UPDOWN) + + def get_page(self): + i = self.page * 5 + return self.db[i:i+5] + + def swipe(self, event): + """Notify the application of a touchscreen swipe event.""" + page = self.page + pages = 1 + if event[0] == wasp.EventType.UP: + page = page - 1 if page > 0 else pages + if event[0] == wasp.EventType.DOWN: + page = page + 1 if page < pages else 0 + self.page = page + + mute = wasp.watch.display.mute + mute(True) + self._draw() + mute(False) + + def touch(self, event): + """Notify the application of a touchscreen touch event.""" + for module, checkbox in self.get_page(): + if checkbox.touch(event): + label = checkbox.label.replace(' ', '') + if checkbox.state: + exec('import apps.{}'.format(module)) + exec('wasp.system.register(apps.{}.{}App())'.format(module, label)) + else: + for app in wasp.system.launcher_ring: + if type(app).__name__.startswith(label): + wasp.system.launcher_ring.remove(app) + break + break + + def _draw(self): + """Draw the display from scratch.""" + wasp.watch.drawable.fill() + self.si.draw() + for _, checkbox in self.get_page(): + checkbox.draw() diff --git a/wasp/apps/testapp.py b/wasp/apps/testapp.py index 8b8ff67..acd1735 100644 --- a/wasp/apps/testapp.py +++ b/wasp/apps/testapp.py @@ -133,7 +133,7 @@ class TestApp(): t = machine.Timer(id=1, period=8000000) t.start() for i in range(0, 128, 16): - draw.blit(self.ICON, i+16, i+32) + draw.blit(icons.software, i+16, i+32) elapsed = t.time() t.stop() del t diff --git a/wasp/icons.py b/wasp/icons.py index 7eb2e22..2ccd140 100644 --- a/wasp/icons.py +++ b/wasp/icons.py @@ -27,8 +27,52 @@ bomb = ( b'\x0e' ) -# 2-bit RLE, generated from res/app_icon.png, 460 bytes +# 2-bit RLE, generated from res/app_icon.png, 224 bytes app = ( + b'\x02' + b'`@' + b'\x1e@\x81d