We implemented a new feature for our PASSDORA Box. Passdora is a Raspberry Pi based system which hosts the Sequry password-manager.
New Features (Reason)
What feature(s) did you add?
The Passdora-system has multiple scripts running in the background. These scripts need to write information to a small connected display.
When a foreground script, which needs the user's attention, outputs text to the display, the background scripts running in intervals, overwrite the foreground script's output which causes confusion.
A central instance is required which makes sure that only one script at a time is able to output text, without overwriting another scripts content. It should also take care of a uniform output formatting (e.g. centering the output text and placing the Passdora-logo in the first row). To indicate that a script is busy it should also provide functions that display a loading animation and/or a countdown. It should also be possible to clear the displays content completely or to show the default content.
Reasons
- prevent scripts from overwriting their output
- uniform output formatting
- loading animations and countdowns
How did you implement it/them?
- only one central Display instance should be usable -> Singleton: [4653c0e0]
- implement functions that allow an object to (un-)lock the display (only the object locking the display should be allowed to unlock it): [4653c0e0] [8ec98cbd]
- provide functions to output text to the display which formats the output in the same way: [4653c0e0]
- implement functions that asynchronously write a countdown or a loading animation to the display [3a4693f4] [5d53947f]
- implement a function to clear the display or display the default content [68a5ec62]
Preview
Thanks for reading
Jan, for PCSG Developers
Posted on Utopian.io - Rewarding Open Source Contributors