Helper Scripts¶
These scripts assist in the generation of pages or recurring GUI components, as well as facilitate common background processes.
QT_Helpers.py¶
- class QT_Helpers.DelayAction(duration, *funcs)¶
- __init__(duration, *funcs)¶
funcs format: [function,argument]
- run()¶
Method representing the thread’s activity.
You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.
WMsgWindow.py¶
This file is responsible for replacing QMessageBox, allowing more flexibility, especially with threads.
- class WMsgWindow.MsgWindow(*args: Any, **kwargs: Any)¶
This class will enable a small, temporary, window to circumvent issues with using QMessageBoxes from threads
- __init__(width=500, height=150)¶
This function initializes the pop-up message window
- Parameters
width – Width of the window
height – Height of the window
- showMsg(title='Title', text='text', color='yellow', duration=2, callback=[None, None])¶
This function can be called to show the pop-up window to display a message
- Parameters
title – Title of the pop-up window
text – Message content of the pop-up window
color – Background color of the pop-up window (in CSS format: ‘background-color: <color>’)
duration – Pop-up window duration in seconds
callback – Function to call at the end of pop-up duration [function,parameter]
StateClass.py¶
This file defines the states available to the Wheelchir
- class StateClass.State(value)¶
This class contains enumerations representing each of the wheelchair states
Cross-platform (Wheelchair/Charger) States: CHARGER_UNAVAILABLE = 0 CHARGER_AVAILABLE = 1 CONNECTED_TO_CHARGER = 2 CHARGER_COMPATIBLE = 3 CHARGER_INCOMPATIBLE = 4 AWAITING_CONNECTION= 5 READY_TO_CHARGE = 6 CHARGING_IN_PROGRESS = 7 CHARGER_FAULTY = 8 WC_FULLY_CHARGED = 9 BATTERY_FAULTY = 10 TERMINATED_BY_USER = 11 (12 is missing because it is not an active state on the Wheelchair side) CONNECTING_TO_CHARGER = 13 REQUESTED = 14 AWAITING_DISCONNECTION = 15 Waiting states: STARTING_CHARGE = 16 DISCONNECTING = 17