class documentation

class Screen:

Constructor: Screen()

View In Hierarchy

This class provides the screen application.

It deals with the application events that require display on the screen or other actions (e.g. UI menu/data)

It's a singleton.

Class Method get_instance Return the singleton instance
Method __init__ Screen Initialiser
Method clear_screen Clear the screen
Method show_event Show an event report
Method show_line Show a screen line.
Method show_screen Show the screen with the given lines.
Method _handle_blk_ch1 Undocumented
Method _handle_blk_empty Undocumented
Method _handle_cv_val Undocumented
Method _handle_mqtt_closed Undocumented
Method _handle_mqtt_connected Undocumented
Method _handle_mqtt_os_err Undocumented
Method _handle_pom_nak Undocumented
Method _handle_pom_to Undocumented
Method _handle_un_enc Undocumented
Method _handle_wifi_connected Undocumented
Method _handle_wifi_discon Undocumented
Method _handle_wifi_start Undocumented
Constant _CV_LU Translation table for CV number, value tuples into text. Initial contents decode CV 8 values into manufacturer text.
Class Variable _event_handler Undocumented
Class Variable _scrn Undocumented
Instance Variable _oled Undocumented
@classmethod
def get_instance(cls):

Return the singleton instance

The singleton is created on the first call.

Parameters
cls
def __init__(self):

Screen Initialiser

Initialise the oled and clear screen.

def clear_screen(self):

Clear the screen

This clears the screen by filling it with black.

def show_event(self, report):

Show an event report

This updates the screen with the event. Other application actions on events are dealt with elsewhere.

Parameters
reporta tuple containing the reference to the source object, the unique event code see: display and additional information - format and content event specific
def show_line(self, pgn, text, x):

Show a screen line.

This loads the screen page with the given line and then displays it. Each line is described by page number, text and x position.

Parameters
pgnpage number (1 page per line)
texttext to be displayed
xhorizontal offset
def show_screen(self, lines):

Show the screen with the given lines.

This loads the screen with the given lines and then displays it. Each line is a tuple of (page number, text, x position). If the same page number appears multiple times in lines, only the last entry for that page will be displayed.

Parameters
linesA list of tuples, each containing (page number, text, x position).
def _handle_blk_ch1(self, src, data):

Undocumented

def _handle_blk_empty(self, src, _):

Undocumented

def _handle_cv_val(self, src, data):

Undocumented

def _handle_mqtt_closed(self, src, data):

Undocumented

def _handle_mqtt_connected(self, src, data):

Undocumented

def _handle_mqtt_os_err(self, src, data):

Undocumented

def _handle_pom_nak(self, src, data):

Undocumented

def _handle_pom_to(self, src, data):

Undocumented

def _handle_un_enc(self, src, data):

Undocumented

def _handle_wifi_connected(self, src, data):

Undocumented

def _handle_wifi_discon(self, src, data):

Undocumented

def _handle_wifi_start(self, src, data):

Undocumented

_CV_LU: dict =

Translation table for CV number, value tuples into text. Initial contents decode CV 8 values into manufacturer text.

Value
{(8, 151): 'ESU', (8, 145): 'ZIMO', (8, 78): 'TOM'}
_event_handler =

Undocumented

_scrn =

Undocumented

_oled =

Undocumented