Beispiel #1
0
    def matrix2ctrl(self):
        try:
            matrix = self.matrix
            if self.matrix == None: return

            widget = self.widget

            widget.nameEdit.setText(matrix.name)
            widget.addrEdit.setText(matrix.addr)
            widget.countXEdit.setText(matrix.axisX.count)
            widget.countYEdit.setText(matrix.axisY.count)
            widget.sizeComboBox.setCurrentIndex(
                widget.sizeComboBox.findText(matrix.el_size))
            widget.axisXComboBox.setCurrentIndex(
                widget.axisXComboBox.findText(matrix.axisX.id))
            widget.axisYComboBox.setCurrentIndex(
                widget.axisYComboBox.findText(matrix.axisY.id))
            widget.axisXAddrEdit.setText(matrix.axisX.addr)
            widget.axisYAddrEdit.setText(matrix.axisY.addr)
            widget.commentEdit.setText(matrix.comment)
            widget.funcEdit.setText(matrix.func)
            firmware_helper().selectTreeWidgetNode(widget.categoryTree,
                                                   matrix.category)
        except Exception as e:
            print e
Beispiel #2
0
    def calibr2ctrl(self):
        try:
            calibr = self.calibr
            if self.calibr == None: return

            widget = self.widget

            widget.nameEdit.setText(calibr.name)
            widget.addrEdit.setText(calibr.addr)
            widget.typeComboBox.setCurrentIndex(
                widget.typeComboBox.findText(calibr.type))
            widget.commentEdit.setText(calibr.comment)
            widget.funcEdit.setText(calibr.func)
            firmware_helper().selectTreeWidgetNode(widget.categoryTree,
                                                   calibr.category)
        except Exception as e:
            print e
Beispiel #3
0
    def __init__(self):
        try:
            widget = self.widget = Ui_calibr_editor()
            self.window = QtGui.QWidget()
            self.widget.setupUi(self.window)

            for value in calibr_types:
                widget.typeComboBox.addItem(value)

            widget.categoryTree.setColumnCount(2)
            widget.categoryTree.hideColumn(1)
            firmware_helper().fillTreeWidget(widget.categoryTree,
                                             calibr_categories)
            widget.categoryTree.expandAll()
            widget.okButton.clicked.connect(self.ok_click)
            widget.cancelButton.clicked.connect(self.cancel_click)
        except Exception as e:
            print e
Beispiel #4
0
    def vector2ctrl(self):
        try:
            vector = self.vector
            if self.vector == None: return

            widget = self.widget

            widget.nameEdit.setText(vector.name)
            widget.addrEdit.setText(vector.addr)
            widget.countXEdit.setText(vector.axis.count)
            widget.sizeComboBox.setCurrentIndex(
                widget.sizeComboBox.findText(vector.el_size))
            widget.axisXComboBox.setCurrentIndex(
                widget.axisXComboBox.findText(vector.axis.id))
            widget.axisXAddrEdit.setText(vector.axis.addr)
            widget.commentEdit.setText(vector.comment)
            widget.funcEdit.setText(vector.func)
            firmware_helper().selectTreeWidgetNode(widget.categoryTree,
                                                   vector.category)
        except Exception as e:
            print e
Beispiel #5
0
    def __init__(self):
        try:
            widget = self.widget = Ui_matrix_editor()
            self.window = QtGui.QWidget()
            self.widget.setupUi(self.window)

            for key, value in calibr_axis.iteritems():
                widget.axisXComboBox.addItem(key, value)
                widget.axisYComboBox.addItem(key, value)

            for value in element_sizes:
                widget.sizeComboBox.addItem(value)

            widget.categoryTree.setColumnCount(2)
            widget.categoryTree.hideColumn(1)
            firmware_helper().fillTreeWidget(widget.categoryTree,
                                             calibr_categories)
            widget.categoryTree.expandAll()
            widget.okButton.clicked.connect(self.ok_click)
            widget.cancelButton.clicked.connect(self.window.close)
        except Exception as e:
            print e