Yeah, so for the API. I’ve just never heard it called an architecture before unless it dealt with instructions and layout on the hardware level of a device. I just normally hear it as framework or API.
Anyways, this is what I’ve discovered so far:
Relating to the OLED display, there are two folders of significance. First and foremost is the
Within this folder are the scripts that control the menu from button press to the “widgets”… not a bad name for an OLED applet that runs in the OLED. I’ll refer to this as the main folder.
The other one that we need to be concerned with is:
In this folder is the system service file that tells the system how to start the scripts, when to start them, and what they need to run. In this folder, the particular service is “pt-sys-oled.service”. We will use this file to stop and restart the service when we make changes to the first folder’s files, instead of rebooting every single time we want a change applied.
Here is a proof of concept tutorial:
Open an explorer window and navigate to our main folder and open the “components” folder. In here, open a terminal by using the “Tools” menu and open a terminal here. Then open the “Menu.py” by typing
sudo nano ./Menu.py
Now use the arrow keys to scroll down into “Class pageHelper” and to the definition “def get_pages_for_menu”. Go to the cpu item and change the “interval” attribute to one tenth of a second instead of half a second so it shows:
Hit CTRL+S, then CTRL+X to save and close nano. Now we stop the service and restart it. Enter:
sudo systemctl stop pt-sys-oled.service
You will see the OLED freeze for a couple seconds and then go blank. Then enter:
sudo systemctl start pt-sys-oled.service
The service will restart. Now, when you go down to the CPU load menu option, look how much faster it now updates. Even as I’m typing this proof of concept, I’m watching all of the cores jump every time I press a new key as the browser updates the screen and performs spell checking and the likes
I might make a new thread to go over this and play with some of the widgets as well as figure out how to create new ones until the framework makes menu item creation easier.
I also discovered other hidden widgets in the scripts and folders but haven’t explored these yet. I’ve literally been watching the kiddo most of this morning and got back to this about an hour and a half ago and this is what I’ve managed to come up with