Commit 1f28a173 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Populate the checker list with TC and combobox

parent 511a9056
......@@ -26,7 +26,8 @@ from functools import partial
from itertools import chain
from PySide.QtGui import (QDockWidget, QPushButton, QGridLayout, QListWidget,
QUndoStack, QUndoCommand, QToolButton)
QUndoStack, QUndoCommand, QToolButton, QTableWidget,
QTableWidgetItem, QComboBox)
from PySide.QtCore import QObject, Signal, Slot, Qt, QFile
from PySide.QtUiTools import QUiLoader
......@@ -306,6 +307,8 @@ class sdlHandler(QObject):
# In the simulation panel, set the buttons to send paramless TC/timers
self.set_paramless_tc()
self.set_paramless_tm()
# Fill in data in the checker panel
self.set_checker_dock()
# Add handler to callback functions for SDL external procedure calls
self.register_external_procedures()
self.get_sdl_state = getattr(value,
......@@ -555,27 +558,18 @@ class sdlHandler(QObject):
This panel handles parameterless signals and
the simulation console
'''
ui = QFile(':/simulation.ui')
loader = QUiLoader()
widgets = loader.load(ui, parent=self.parent)
dock = QDockWidget('Simulation bay', self.parent)
dock.setFloating(False)
dock.setObjectName('Simulation')
self.parent.addDockWidget(Qt.RightDockWidgetArea, dock)
dock.setWidget(widgets)
dock.show()
loader = QUiLoader()
checker_widgets = loader.load(QFile(':/checker.ui'),
parent=self.parent)
checker_dock = QDockWidget('Checker bay', self.parent)
checker_dock.setFloating(False)
checker_dock.setObjectName('Checker')
self.parent.addDockWidget(Qt.RightDockWidgetArea, checker_dock)
checker_dock.setWidget(checker_widgets)
checker_dock.show()
return dock, checker_dock
docks = []
for each in ('Simulation', 'Checker'):
widgets = QUiLoader().load(QFile(':/{}.ui'.format(each.lower())),
parent=self.parent)
dock = QDockWidget('{} bay'.format(each), self.parent)
dock.setFloating(False)
dock.setObjectName(each)
self.parent.addDockWidget(Qt.RightDockWidgetArea, dock)
dock.setWidget(widgets)
dock.show()
docks.append(dock)
return docks
@Slot()
def add_to_msc(self, direction, msg):
......@@ -722,6 +716,25 @@ class sdlHandler(QObject):
.format(name))
self.buttons[name].setEnabled(False)
def set_checker_dock(self):
''' Once the DLL is loaded, fill in the checker tab with the list of
TCs to allow user configuring the behaviour of the random and
exhaustive simulators. Each TC trigger can be configured as periodic,
random, or manual. If the TC has parameters, the feedlist can be
customised to limit the range of values used in the simulator
(this feature is not implemented yet) '''
widget = self.dock_checker.widget()
self.checker_table = widget.findChild(QTableWidget, 'tableWidget')
self.checker_table.setRowCount(len(self.proc.input_signals))
for idx, inp in enumerate(self.proc.input_signals):
name = inp['name']
item = QTableWidgetItem(name)
item.setFlags(Qt.ItemIsEnabled)
combo = QComboBox()
combo.addItems(('Manual', 'Random', 'Periodic'))
self.checker_table.setItem(idx, 0, item)
self.checker_table.setCellWidget(idx, 1, combo)
def set_paramless_tc(self):
''' Once the DLL is loaded set the buttons to send paramless TC '''
# tc_area and buttons have to be in self because of known pyside bug
......
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