Beispiel #1
0
 def __init__(self, parent = None):
     super(LConditionTableWidget, self).__init__(parent)
     self.dataContainer = LMyDataContainer(self)
     self.actions = LMyActions(self.dataContainer, self)
     self.setupUi()
     self.tableView.setItemDelegate(LItemDelegate(self))
     self.tableModel = LMyTableModel(self.dataContainer, self)
     self.tableView.setModel(self.tableModel)
     self.setName(WIDGET_NAME)
Beispiel #2
0
class LConditionTableWidget(LWidget):

    def __init__(self, parent = None):
        super(LConditionTableWidget, self).__init__(parent)
        self.dataContainer = LMyDataContainer(self)
        self.actions = LMyActions(self.dataContainer, self)
        self.setupUi()
        self.tableView.setItemDelegate(LItemDelegate(self))
        self.tableModel = LMyTableModel(self.dataContainer, self)
        self.tableView.setModel(self.tableModel)
        self.setName(WIDGET_NAME)

    @LInAndOut(DEBUG & WIDGETS)
    def setupUi(self):
        #self.resize(647, 221)
        self.verticalLayout = QVBoxLayout(self)
        self.tableView = QTableView()
        self.tableView.setAlternatingRowColors(True)
        self.tableView.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.tableView.setShowGrid(False)
        self.tableView.horizontalHeader().setStretchLastSection(True)
        self.verticalLayout.addWidget(self.tableView)

    @LInAndOut(DEBUG & WIDGETS)
    def updateUi(self):
        self.tableModel.signalLayoutChanged()
        for column in range(self.tableModel.columnCount(self)+1):
            self.tableView.resizeColumnToContents(column)

    #----------------------------------------------------------------------
    # Interface

    @LInAndOut(DEBUG & WIDGETS)
    def getArguments(self, commandId = None):
        s = ""
        for item in self.dataContainer.items:
            #Beware of spaces in description
            #s += " --condition %s,%f,%f,'%s' " % (condition.pvName, condition.minimum, condition.maximum, condition.description))
            s += " --condition %s,%f,%f,%s" % (item.pvName, item.minimum, item.maximum, item.action)
        return s

    @LInAndOut(DEBUG & WIDGETS)
    def getItem(self, *args, **kwargs):
        return LMyItem()
 def __init__(self, parent = None):
     super(LPvExperimentKnobTableWidget, self).__init__(parent)
     self.setupUi()
     self.tableView.setItemDelegate(LItemDelegate(self))
     self.dataContainer = LMyDataContainer(self)
     self.tableModel = LMyTableModel(self.dataContainer, self)
     #self.tableModel.setDebugLevel(1)
     self.tableView.setModel(self.tableModel)
     self.actions = LMyActions(self.dataContainer, self)
     self.setName(WIDGET_NAME)
class LPvExperimentKnobTableWidget(LWidget):

    def __init__(self, parent = None):
        super(LPvExperimentKnobTableWidget, self).__init__(parent)
        self.setupUi()
        self.tableView.setItemDelegate(LItemDelegate(self))
        self.dataContainer = LMyDataContainer(self)
        self.tableModel = LMyTableModel(self.dataContainer, self)
        #self.tableModel.setDebugLevel(1)
        self.tableView.setModel(self.tableModel)
        self.actions = LMyActions(self.dataContainer, self)
        self.setName(WIDGET_NAME)

    @LInAndOut(DEBUG & WIDGET)
    def setupUi(self):
        self.resize(400, 200)
        self.verticalLayout = QVBoxLayout(self)
        self.tableView = QTableView()
        self.tableView.setAlternatingRowColors(True)
        self.tableView.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.tableView.setShowGrid(False)
        self.tableView.horizontalHeader().setStretchLastSection(True)
        self.verticalLayout.addWidget(self.tableView)

    @LInAndOut(DEBUG & WIDGET)
    def updateUi(self):
        self.tableModel.signalLayoutChanged()
        # ResizeColumnToContents
        for column in range(self.tableModel.columnCount(self)+1):
            self.tableView.resizeColumnToContents(column)

    #----------------------------------------------------------------------
    # Interface (Get)

    @LInAndOut(DEBUG & WIDGET)
    def getArguments(self, commandId):
        s = ""
        for item in self.dataContainer.items:
            s+= " --knob %s" % item.toCsv()
        return s