Bugfix for offset check in piCtory file

This commit is contained in:
2021-08-22 17:10:31 +02:00
parent 0edfb4ef85
commit 8607f25b37
2 changed files with 4 additions and 3 deletions

View File

@@ -161,12 +161,13 @@ class Device(object):
self._producttype = int(dict_device.get("productType")) self._producttype = int(dict_device.get("productType"))
# Offset-Check for broken piCtory configuration # Offset-Check for broken piCtory configuration
if self._offset != parentmodio.length: if self._offset < parentmodio.length:
warnings.warn( warnings.warn(
"Device offset ERROR in piCtory configuration! Offset of '{0}' " "Device offset ERROR in piCtory configuration! Offset of '{0}' "
"must be {1} but is {2} - Overlapping devices overwrite the " "must be {1} but is {2} - Overlapping devices overwrite the "
"same memory, which has unpredictable effects!!!" "same memory, which has unpredictable effects!!!"
"".format(self._name, parentmodio.length, self._offset) "".format(self._name, parentmodio.length, self._offset),
Warning
) )
# IOM-Objekte erstellen und Adressen in SLCs speichern # IOM-Objekte erstellen und Adressen in SLCs speichern
if simulator: if simulator:

View File

@@ -968,7 +968,7 @@ class RevPiNetIOSelected(RevPiNetIO):
for vdev in self._lst_devselect: for vdev in self._lst_devselect:
if type(vdev) != int and type(vdev) != str: if type(vdev) != int and type(vdev) != str:
raise TypeError( raise ValueError(
"need device position as <class 'int'> or device name as " "need device position as <class 'int'> or device name as "
"<class 'str'>" "<class 'str'>"
) )