mirror of
https://github.com/naruxde/revpimodio2.git
synced 2025-11-08 22:03:53 +01:00
Wenn RevPiPyLoad falsche replace_ios Datei hat, wird Fehler geworfen
IO-Prüfung bei replace wird nicht für Selected/Driver durchgeführt
This commit is contained in:
@@ -12,7 +12,7 @@ RevPiModIO Hauptklasse fuer Netzwerkzugriff.
|
||||
<h3 style="background-color:#FFFFFF;color:#FF0000">
|
||||
Global Attributes</h3>
|
||||
<table>
|
||||
<tr><td>__author__</td></tr><tr><td>__copyright__</td></tr><tr><td>__license__</td></tr><tr><td>_sysdeldirty</td></tr><tr><td>_sysexit</td></tr><tr><td>_sysflush</td></tr><tr><td>_syspictory</td></tr><tr><td>_syspictoryh</td></tr><tr><td>_sysreplaceio</td></tr><tr><td>_sysreplaceioh</td></tr><tr><td>_syssync</td></tr>
|
||||
<tr><td>HASH_FAIL</td></tr><tr><td>__author__</td></tr><tr><td>__copyright__</td></tr><tr><td>__license__</td></tr><tr><td>_sysdeldirty</td></tr><tr><td>_sysexit</td></tr><tr><td>_sysflush</td></tr><tr><td>_syspictory</td></tr><tr><td>_syspictoryh</td></tr><tr><td>_sysreplaceio</td></tr><tr><td>_sysreplaceioh</td></tr><tr><td>_syssync</td></tr>
|
||||
</table>
|
||||
<h3 style="background-color:#FFFFFF;color:#FF0000">
|
||||
Classes</h3>
|
||||
|
||||
@@ -185,6 +185,7 @@ revpimodio2.modio.RevPiModIO.writeprocimg?4(device=None)
|
||||
revpimodio2.modio.RevPiModIO?1(autorefresh=False, monitoring=False, syncoutputs=True, procimg=None, configrsc=None, simulator=False, debug=False, replace_io_file=None, direct_output=False)
|
||||
revpimodio2.modio.RevPiModIODriver?1(virtdev, autorefresh=False, monitoring=False, syncoutputs=True, procimg=None, configrsc=None, debug=False, replace_io_file=None, direct_output=False)
|
||||
revpimodio2.modio.RevPiModIOSelected?1(deviceselection, autorefresh=False, monitoring=False, syncoutputs=True, procimg=None, configrsc=None, simulator=False, debug=False, replace_io_file=None, direct_output=False)
|
||||
revpimodio2.netio.HASH_FAIL?7
|
||||
revpimodio2.netio.NetFH._connect?5()
|
||||
revpimodio2.netio.NetFH._direct_send?5(send_bytes, recv_count)
|
||||
revpimodio2.netio.NetFH.clear_dirtybytes?4(position=None)
|
||||
|
||||
@@ -359,10 +359,12 @@ class RevPiModIO(object):
|
||||
try:
|
||||
self.io[parentio].replace_io(name=io, **dict_replace)
|
||||
except Exception as e:
|
||||
raise RuntimeError(
|
||||
"replace_io_file: can not replace '{0}' with '{1}' "
|
||||
"| RevPiModIO message: {2}".format(parentio, io, e)
|
||||
)
|
||||
# NOTE: Bei Selected/Driver kann nicht geprüft werden
|
||||
if len(self._lst_devselect) == 0:
|
||||
raise RuntimeError(
|
||||
"replace_io_file: can not replace '{0}' with '{1}' "
|
||||
"| RevPiModIO message: {2}".format(parentio, io, e)
|
||||
)
|
||||
|
||||
def _create_myfh(self):
|
||||
"""Erstellt FileObject mit Pfad zum procimg.
|
||||
|
||||
@@ -28,6 +28,8 @@ _sysreplaceio = b'\x01RP\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17'
|
||||
_sysreplaceioh = b'\x01RH\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17'
|
||||
# Übertragene Bytes schreiben
|
||||
_sysflush = b'\x01SD\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x17'
|
||||
# Hashvalues
|
||||
HASH_FAIL = b'\xff' * 16
|
||||
|
||||
|
||||
class AclException(Exception):
|
||||
@@ -452,6 +454,11 @@ class NetFH(Thread):
|
||||
if self.__sockend.is_set():
|
||||
raise ValueError("read of closed file")
|
||||
|
||||
if self.__replace_ios_h == HASH_FAIL:
|
||||
raise RuntimeError(
|
||||
"replace_io_file: could not read/parse over network"
|
||||
)
|
||||
|
||||
with self.__socklock:
|
||||
self._slavesock.send(_sysreplaceio)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user