mirror of
https://github.com/uhi22/pyPLC.git
synced 2024-11-10 01:05:42 +00:00
feature: EvseMode: simulate decreasing voltage during WeldingDetection
This commit is contained in:
parent
7014d1c2d2
commit
bce3b40fdd
1 changed files with 5 additions and 1 deletions
|
@ -290,7 +290,11 @@ class fsmEvse():
|
||||||
self.enterState(stateWaitForFlexibleRequest) # todo: not clear, what is specified in DIN
|
self.enterState(stateWaitForFlexibleRequest) # todo: not clear, what is specified in DIN
|
||||||
if (strConverterResult.find("WeldingDetectionReq")>0):
|
if (strConverterResult.find("WeldingDetectionReq")>0):
|
||||||
# todo: check the request content, and fill response parameters
|
# todo: check the request content, and fill response parameters
|
||||||
msg = addV2GTPHeader(exiEncode("EDj")) # EDj for Encode, Din, WeldingDetectionRes
|
# simulate the decreasing voltage during the weldingDetection:
|
||||||
|
self.simulatedPresentVoltage = self.simulatedPresentVoltage*0.8 + 3*random()
|
||||||
|
strPresentVoltage = str(self.simulatedPresentVoltage)
|
||||||
|
self.callbackShowStatus(strPresentVoltage, "EVSEPresentVoltage")
|
||||||
|
msg = addV2GTPHeader(exiEncode("EDj_"+strPresentVoltage)) # EDj for Encode, Din, WeldingDetectionRes
|
||||||
self.addToTrace("responding " + prettyHexMessage(msg))
|
self.addToTrace("responding " + prettyHexMessage(msg))
|
||||||
self.publishStatus("WeldingDetection")
|
self.publishStatus("WeldingDetection")
|
||||||
self.Tcp.transmit(msg)
|
self.Tcp.transmit(msg)
|
||||||
|
|
Loading…
Reference in a new issue