This commit is contained in:
2017-03-16 12:02:35 +01:00
parent a0c34c2359
commit ccf9724dc3

View File

@@ -541,7 +541,7 @@ class RevPiPyLoad(proginit.ProgInit):
proginit.logger.info("stopping revpipyload") proginit.logger.info("stopping revpipyload")
self._exit = True self._exit = True
if self.plc is not None: if self.plc is not None and self.plc.is_alive():
proginit.logger.debug("stopping revpiplc-thread") proginit.logger.debug("stopping revpiplc-thread")
self.plc.stop() self.plc.stop()
self.plc.join() self.plc.join()
@@ -616,17 +616,24 @@ class RevPiPyLoad(proginit.ProgInit):
fh.close() fh.close()
os.remove(file) os.remove(file)
return xmldata return xmldata
return Binary()
def xml_plcexitcode(self): def xml_plcexitcode(self):
"""Gibt den aktuellen exitcode vom PLC Programm zurueck. """Gibt den aktuellen exitcode vom PLC Programm zurueck.
@returns: int() exitcode oder -1 laeuft noch -2 lief nie"""
@returns: int() exitcode oder:
-1 laeuft noch
-2 Datei nicht gefunden
-3 Lief nie
"""
proginit.logger.debug("xmlrpc call plcexitcode") proginit.logger.debug("xmlrpc call plcexitcode")
if self.plc is None: if self.plc is None:
return -2 return -2
elif self.plc.is_alive(): elif self.plc.is_alive():
return -1 return -1
else: else:
return self.plc.exitcode return -3 if self.plc.exitcode is None else self.plc.exitcode
def xml_plcrunning(self): def xml_plcrunning(self):
"""Prueft ob das PLC Programm noch lauft. """Prueft ob das PLC Programm noch lauft.
@@ -639,7 +646,7 @@ class RevPiPyLoad(proginit.ProgInit):
@returns: int() Status: @returns: int() Status:
-1 Programm lauft noch -1 Programm lauft noch
100 Fehler -2 Datei nicht gefunden
""" """
proginit.logger.debug("xmlrpc call plcstart") proginit.logger.debug("xmlrpc call plcstart")
@@ -648,7 +655,7 @@ class RevPiPyLoad(proginit.ProgInit):
else: else:
self.plc = self._plcthread() self.plc = self._plcthread()
if self.plc is None: if self.plc is None:
return 100 return -2
else: else:
self.plc.start() self.plc.start()
return 0 return 0