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

Find DLL properly

parent c57a21db
......@@ -214,7 +214,7 @@ def gui():
# Load and run the startup transition of the shared library (Ada only?)
msgQ = False
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()
except OSError as err:
......
......@@ -403,10 +403,12 @@ class sdlHandler(QObject):
if not prop_file:
return
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))
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))
return
properties = []
......@@ -686,16 +688,21 @@ class sdlHandler(QObject):
arg = compute_random_value(asn1_ty, self.proc.dataview)
self.click_tc(name, arg)
# Select randomly an active TC and call it
random_tc = random.choice(list(self.active_tc))
for inp in self.proc.input_signals:
if inp['name'].lower() == random_tc.lower():
sort = inp.get('type', None)
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)
#random_tc = random.choice(list(self.active_tc))
try:
random_tc, asn1_ty = random.choice(list(self.sim_param['random']))
except IndexError:
pass
else:
for inp in self.proc.input_signals:
if inp['name'].lower() == random_tc.lower():
sort = inp.get('type', None)
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)
......
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