Commit 4b0f6e3e authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Find DLL properly

parent c57a21db
...@@ -214,7 +214,7 @@ def gui(): ...@@ -214,7 +214,7 @@ def gui():
# Load and run the startup transition of the shared library (Ada only?) # Load and run the startup transition of the shared library (Ada only?)
msgQ = False msgQ = False
try: try:
dll = CDLL('lib{}.so'.format(datamodel.FVname)) dll = CDLL('./lib{}.so'.format(datamodel.FVname))
dll_init = getattr(dll, 'lib{}init'.format(datamodel.FVname)) dll_init = getattr(dll, 'lib{}init'.format(datamodel.FVname))
dll_init() dll_init()
except OSError as err: except OSError as err:
......
...@@ -403,10 +403,12 @@ class sdlHandler(QObject): ...@@ -403,10 +403,12 @@ class sdlHandler(QObject):
if not prop_file: if not prop_file:
return return
try: try:
self.prop_dll = ctypes.CDLL('lib{}_stop_conditions.so' # Property file must be in the current directory
self.prop_dll = ctypes.CDLL('./lib{}_stop_conditions.so'
.format(self.proc.processName)) .format(self.proc.processName))
except OSError as err: except OSError as err:
self.log_area.addItem('lib{}_stop_conditions.so not found' self.log_area.addItem('lib{}_stop_conditions.so not found '
'in current directory'
.format(self.proc.processName)) .format(self.proc.processName))
return return
properties = [] properties = []
...@@ -686,16 +688,21 @@ class sdlHandler(QObject): ...@@ -686,16 +688,21 @@ class sdlHandler(QObject):
arg = compute_random_value(asn1_ty, self.proc.dataview) arg = compute_random_value(asn1_ty, self.proc.dataview)
self.click_tc(name, arg) self.click_tc(name, arg)
# Select randomly an active TC and call it # Select randomly an active TC and call it
random_tc = random.choice(list(self.active_tc)) #random_tc = random.choice(list(self.active_tc))
for inp in self.proc.input_signals: try:
if inp['name'].lower() == random_tc.lower(): random_tc, asn1_ty = random.choice(list(self.sim_param['random']))
sort = inp.get('type', None) except IndexError:
if sort: pass
typename = sort.ReferencedTypeName.replace('-', '_') else:
ty = self.proc.dataview[sort.ReferencedTypeName] for inp in self.proc.input_signals:
arg = compute_random_value(ty, self.proc.dataview) if inp['name'].lower() == random_tc.lower():
break sort = inp.get('type', None)
self.click_tc(random_tc, arg) if sort:
typename = sort.ReferencedTypeName.replace('-', '_')
ty = self.proc.dataview[sort.ReferencedTypeName]
arg = compute_random_value(ty, self.proc.dataview)
break
self.click_tc(random_tc, arg)
QTimer().singleShot(1000, self.random_step) QTimer().singleShot(1000, self.random_step)
......
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