Commit 085b2a16 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Complete support of timer symbols

parent dfe6ea79
...@@ -143,6 +143,10 @@ inst {fv};'''.format(fv=fv_name)] ...@@ -143,6 +143,10 @@ inst {fv};'''.format(fv=fv_name)]
self.msc_scene.addResetTimer(self.taste_instance, self.msc_scene.addResetTimer(self.taste_instance,
self.next_y, self.next_y,
message) message)
elif direction == 'timeout':
self.msc_scene.addTimeout(self.taste_instance,
self.next_y,
message)
# This is how to add a comment on the graph: # This is how to add a comment on the graph:
# comment = self.msc_scene.addComment(msg) # comment = self.msc_scene.addComment(msg)
#comment.setCommentText("Hello!") #comment.setCommentText("Hello!")
......
...@@ -208,7 +208,11 @@ class sdlHandler(QObject): ...@@ -208,7 +208,11 @@ class sdlHandler(QObject):
def send_tc(self, name, tc_func_ptr): def send_tc(self, name, tc_func_ptr):
''' Send a parameterless TC ''' ''' Send a parameterless TC '''
self.msc.emit('out', name) if name in self.timers:
self.buttons[name].setEnabled(False)
self.msc.emit('timeout', name)
else:
self.msc.emit('out', name)
tc_func_ptr() tc_func_ptr()
self.on_event() self.on_event()
...@@ -222,12 +226,14 @@ class sdlHandler(QObject): ...@@ -222,12 +226,14 @@ class sdlHandler(QObject):
self.msc.emit('set', 'SET_{}({})'.format(name, duration)) self.msc.emit('set', 'SET_{}({})'.format(name, duration))
self.log_area.addItem('Received event "SET_{}({})"' self.log_area.addItem('Received event "SET_{}({})"'
.format(name, duration)) .format(name, duration))
self.buttons[name].setEnabled(True)
def reset_timer(self, name): def reset_timer(self, name):
''' Callback function when the SDL model resets a timer ''' ''' Callback function when the SDL model resets a timer '''
self.msc.emit('reset', 'RESET_{}'.format(name)) self.msc.emit('reset', 'RESET_{}'.format(name))
self.log_area.addItem('Received event "RESET_{}"' self.log_area.addItem('Received event "RESET_{}"'
.format(name)) .format(name))
self.buttons[name].setEnabled(False)
def set_paramless_tc(self): def set_paramless_tc(self):
''' Once the DLL is loaded set the buttons to send paramless TC ''' ''' Once the DLL is loaded set the buttons to send paramless TC '''
......
Supports Markdown
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