Commit 34271366 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Check properties while simulating

parent 4928b26f
......@@ -2,7 +2,7 @@
# Resource object code
#
# Created: Fri Mar 20 19:48:59 2015
# Created: Fri Mar 20 20:00:31 2015
# by: The Resource Compiler for PySide (Qt v4.8.6)
#
# WARNING! All changes made in this file will be lost!
......
......@@ -223,7 +223,7 @@ class sdlHandler(QObject):
while True:
try:
prop = getattr(self.prop_dll, '_property_{}'.format(idx))
prop.restype = ctypes.c_char
prop.restype = ctypes.c_uint
self.properties.append(prop)
except AttributeError:
break
......@@ -231,20 +231,17 @@ class sdlHandler(QObject):
idx +=1
self.log_area.addItem('Loaded {} properties'.format(idx))
def check_properties(self):
def check_properties(self, statehash):
''' Check the properties at runtime
First copy the running system state to the property system state,
then execute each property and check the return value '''
if not self.prop_dll:
return
self.restore_global_state(self.current_hash, dll=self.prop_dll)
self.restore_global_state(statehash, dll=self.prop_dll)
for idx, check in enumerate(self.properties):
if not check():
if check():
self.log_area.addItem('Property {} was violated'.format(idx))
@Slot()
def startStop(self):
''' Trigger or stop the SDL display '''
......@@ -384,6 +381,7 @@ class sdlHandler(QObject):
# Log all TC sent
self.log_area.addItem('Sent {}({})'.format(tc_name,
param or ''))
self.check_properties(new_hash)
return new_hash
def update_button_state(self, tc_name=None):
......
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