Commit d168082e authored by Maxime Perrotin's avatar Maxime Perrotin

Update support of opengeode simulator

parent 35635d1f
......@@ -34,6 +34,7 @@ LICENSE: LGPL - see LICENSE file
CHANGELOG:
1.7.4 - Bugfix for opengeode simulator
1.7.3 - Support optionality in standalone editor too
1.7.2 - Enable support for always Present/always Absent fields
1.7.1 - Enable support for optional fields
......
......@@ -16,7 +16,7 @@
__author__ = "Maxime Perrotin"
__license__ = "LGPLv3"
__version__ = "1.7.3"
__version__ = "1.7.4"
__url__ = "https://taste.tools"
import sys
......@@ -954,13 +954,19 @@ class asn1Editor(QTreeView):
val.setData(elem["valuesInt"], INTMAP) # mapping name - value
constraint = QStandardItem()
present = QStandardItem()
if elem['isOptional'] and not elem['alwaysPresent'] \
and not elem['alwaysAbsent']:
# use elem.get because isOptional may not be present, for example
# the opengeode simulator created enums on the fly and omits this
# attribute
isOptional = elem.get('isOptional', False)
alwaysPresent = elem.get('alwaysPresent', True)
alwaysAbsent = elem.get('alwaysAbsent', False)
if isOptional and not alwaysPresent and not alwaysAbsent:
present.setCheckState (Qt.Checked)
present.setCheckable(True)
present.setData (elem['isOptional'], OPTIONAL)
present.setData (elem['alwaysPresent'], ALWAYS_PRESENT)
present.setData (elem['alwaysAbsent'], ALWAYS_ABSENT)
present.setData (isOptional, OPTIONAL)
present.setData (alwaysPresent, ALWAYS_PRESENT)
present.setData (alwaysAbsent, ALWAYS_ABSENT)
return {"value": val, "constraint": constraint, "present" : present}
def addString(self, elem):
......
......@@ -225,12 +225,11 @@ def gui():
msgQ = False
try:
dll = CDLL('./lib{}.so'.format(datamodel.FVname.lower()))
dll_init = getattr(dll, 'lib{}init'.format(datamodel.FVname.lower()))
dll_init = getattr(dll, '{}init'.format(datamodel.FVname.lower()))
dll_init()
except OSError as err:
log.error('Issue with shared library lib{}.so:'
.format(datamodel.FVname))
log.error(str(err))
except (AttributeError, OSError) as err:
log.error('Issue with shared library lib{}.so: {}'
.format(datamodel.FVname, str(err)))
return -1
# Define a Qt application (mandatory)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment