feature: show pev status on display

This commit is contained in:
uhi22 2023-02-13 21:34:13 +01:00
parent f0e39833b1
commit 8493daeb56

View file

@ -28,8 +28,8 @@ class pyPlcWorker():
self.callbackShowStatus = callbackShowStatus self.callbackShowStatus = callbackShowStatus
self.oldAvlnStatus = 0 self.oldAvlnStatus = 0
self.isSimulationMode = isSimulationMode self.isSimulationMode = isSimulationMode
self.hp = pyPlcHomeplug.pyPlcHomeplug(self.workerAddToTrace, self.callbackShowStatus, self.mode, self.addressManager, self.callbackReadyForTcp, self.isSimulationMode) self.hp = pyPlcHomeplug.pyPlcHomeplug(self.workerAddToTrace, self.showStatus, self.mode, self.addressManager, self.callbackReadyForTcp, self.isSimulationMode)
self.hardwareInterface = hardwareInterface.hardwareInterface(self.workerAddToTrace, self.callbackShowStatus) self.hardwareInterface = hardwareInterface.hardwareInterface(self.workerAddToTrace, self.showStatus)
self.hp.printToUdp("pyPlcWorker init") self.hp.printToUdp("pyPlcWorker init")
# Find out the version number, using git. # Find out the version number, using git.
# see https://stackoverflow.com/questions/14989858/get-the-current-git-hash-in-a-python-script # see https://stackoverflow.com/questions/14989858/get-the-current-git-hash-in-a-python-script
@ -39,9 +39,9 @@ class pyPlcWorker():
strLabel = "(unknown version. 'git describe --tags' failed.)" strLabel = "(unknown version. 'git describe --tags' failed.)"
self.workerAddToTrace("[pyPlcWorker] Software version " + strLabel) self.workerAddToTrace("[pyPlcWorker] Software version " + strLabel)
if (self.mode == C_EVSE_MODE): if (self.mode == C_EVSE_MODE):
self.evse = fsmEvse.fsmEvse(self.addressManager, self.workerAddToTrace, self.hardwareInterface, self.callbackShowStatus) self.evse = fsmEvse.fsmEvse(self.addressManager, self.workerAddToTrace, self.hardwareInterface, self.showStatus)
if (self.mode == C_PEV_MODE): if (self.mode == C_PEV_MODE):
self.pev = fsmPev.fsmPev(self.addressManager, self.workerAddToTrace, self.hardwareInterface, self.callbackShowStatus) self.pev = fsmPev.fsmPev(self.addressManager, self.workerAddToTrace, self.hardwareInterface, self.showStatus)
def __del__(self): def __del__(self):
if (self.mode == C_PEV_MODE): if (self.mode == C_PEV_MODE):
print("worker: deleting pev") print("worker: deleting pev")
@ -56,6 +56,8 @@ class pyPlcWorker():
def showStatus(self, s, selection = ""): def showStatus(self, s, selection = ""):
self.callbackShowStatus(s, selection) self.callbackShowStatus(s, selection)
if (selection == "pevState"):
self.hardwareInterface.showOnDisplay(s, "", "")
def callbackReadyForTcp(self, status): def callbackReadyForTcp(self, status):
if (status==1): if (status==1):