mirror of
https://github.com/uhi22/pyPLC.git
synced 2024-11-10 01:05:42 +00:00
feature: EvseMode: show EVTargetVoltage and EVTargetCurrent in the GUI
This commit is contained in:
parent
b74521d8e0
commit
701ab1b492
2 changed files with 10 additions and 0 deletions
|
@ -267,11 +267,15 @@ class fsmEvse():
|
|||
if (strConverterResult.find("CurrentDemandReq")>0):
|
||||
# check the request content, and fill response parameters
|
||||
uTarget = 220 # default in case we cannot decode the requested voltage
|
||||
iTarget = 1 # default...
|
||||
try:
|
||||
jsondict = json.loads(strConverterResult)
|
||||
strEVTargetVoltageValue = jsondict["EVTargetVoltage.Value"]
|
||||
strEVTargetVoltageMultiplier = jsondict["EVTargetVoltage.Multiplier"]
|
||||
uTarget = combineValueAndMultiplier(strEVTargetVoltageValue, strEVTargetVoltageMultiplier)
|
||||
strEVTargetCurrentValue = jsondict["EVTargetCurrent.Value"]
|
||||
strEVTargetCurrentMultiplier = jsondict["EVTargetCurrent.Multiplier"]
|
||||
iTarget = combineValueAndMultiplier(strEVTargetCurrentValue, strEVTargetCurrentMultiplier)
|
||||
self.addToTrace("EV wants EVTargetVoltage " + str(uTarget))
|
||||
current_soc = int(jsondict.get("DC_EVStatus.EVRESSSOC", -1))
|
||||
full_soc = int(jsondict.get("FullSOC", -1))
|
||||
|
@ -281,6 +285,7 @@ class fsmEvse():
|
|||
self.publishSoCs(current_soc, full_soc, energy_capacity, energy_request, origin="CurrentDemandReq")
|
||||
|
||||
self.callbackShowStatus(str(current_soc), "soc")
|
||||
self.callbackShowStatus(str(uTarget) + "V, " + str(iTarget) + "A", "UandI")
|
||||
|
||||
except:
|
||||
self.addToTrace("ERROR: Could not decode the CurrentDemandReq")
|
||||
|
|
5
pyPlc.py
5
pyPlc.py
|
@ -57,6 +57,9 @@ def cbShowStatus(s, selection=""):
|
|||
if (selection == "soc"):
|
||||
lblSoc['text']= "SOC " + s + "%"
|
||||
s=""
|
||||
if (selection == "UandI"):
|
||||
lblRequestedUandI['text']= "Target " + s + ""
|
||||
s=""
|
||||
if (len(s)>0):
|
||||
lblStatus['text']=s
|
||||
root.update()
|
||||
|
@ -108,6 +111,8 @@ lblState.config(font=('Helvetica bold', 20))
|
|||
lblState.pack()
|
||||
lblSoc = tk.Label(root, text="(soc)")
|
||||
lblSoc.pack()
|
||||
lblRequestedUandI = tk.Label(root, text="(U and I)")
|
||||
lblRequestedUandI.pack()
|
||||
lblUInlet = tk.Label(root, text="(U Inlet)")
|
||||
lblUInlet.config(font=('Helvetica bold', 26))
|
||||
lblUInlet.pack()
|
||||
|
|
Loading…
Reference in a new issue