コード例 #1
0
ファイル: mod_plotthread.py プロジェクト: andayy/pycubesat
	def __init__(self, rightVal, topVal, mainWinObj):
		QWidget.__init__(self)
		self.ui = Ui_plotWidget()
		self.ui.setupUi(self)
		self.setGeometry(QRect(rightVal + 1, topVal, varlisting.PLOT_WIDTH, varlisting.PLOT_HEIGHT))
		self.setWindowFlags(Qt.FramelessWindowHint)
		self.setAttribute(Qt.WA_TranslucentBackground)
		self.ui.bg_plotthread.setPixmap(QPixmap(getcwd() + '/lib/images/bg_plotthread.png'))

		self.mainWinObj = mainWinObj
		
		self.mplwidget = matplotlibWidget(self)
		self.mplwidget.setGeometry(QRect(30, 20, 541, 411))
		self.mplwidget.setObjectName('mplwidget')

		#self.threadPool.append(GenericThread(matplotlibWidget(self)))
		#self.threadPool[len(self.threadPool)-1].start()

		#self.mplwidget.axes = self.mplwidget.figure.add_subplot(1, 1, 1)
		#self.mplwidget.axes.plot([1,2,3],[1,2,3], color='#00ff00')

		#self.mplwidget.figure.figurePatch.set_alpha(0.0)		
		#self.mplwidget.axes.patch.set_alpha(0.0)

		self.mplwidget.figure.patch.set_facecolor('#2679ae')
		self.mplwidget.axes.patch.set_facecolor('#000000')

		self.plotIn()
コード例 #2
0
ファイル: QxtSpanSlider.py プロジェクト: javipalanca/simso
    def __init__(self, low, upp, parent=None):
        QWidget.__init__(self, parent)
        self.layout = QHBoxLayout(self)
        self._spin_start = QSpinBox(self)
        self._spin_end = QSpinBox(self)
        self.layout.addWidget(self._spin_start)

        self._slider = QxtSpanSlider(self)
        self._slider.setHandleMovementMode(QxtSpanSlider.NoOverlapping)

        self._slider.lowerPositionChanged.connect(lambda x: self._spin_start.setValue(x))
        self._slider.upperPositionChanged.connect(lambda x: self._spin_end.setValue(x))
        self._spin_start.valueChanged.connect(
            lambda x: self._slider.setLowerPosition(x)
            if x < self._slider.upperValue
            else self._spin_start.setValue(self._slider.upperValue - 1))
        self._spin_end.valueChanged.connect(
            lambda x: self._slider.setUpperPosition(x)
            if x > self._slider.lowerValue
            else self._spin_end.setValue(self._slider.lowerValue + 1))

        self.layout.addWidget(self._slider)
        self.layout.addWidget(self._spin_end)

        self.setRange(low, upp)
        self.setSpan(low, upp)
コード例 #3
0
    def __init__(self, parent=None, **kwargs):
        QWidget.__init__(self, parent, **kwargs)
        layout = QVBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(0)
        self.setLayout(layout)

        self.setSizePolicy(QSizePolicy.Fixed,
                           QSizePolicy.Expanding)
        self.__tabs = []

        self.__currentIndex = -1
        self.__changeOnHover = False

        self.__iconSize = QSize(26, 26)

        self.__group = QButtonGroup(self, exclusive=True)
        self.__group.buttonPressed[QAbstractButton].connect(
            self.__onButtonPressed
        )
        self.setMouseTracking(True)

        self.__sloppyButton = None
        self.__sloppyRegion = QRegion()
        self.__sloppyTimer = QTimer(self, singleShot=True)
        self.__sloppyTimer.timeout.connect(self.__onSloppyTimeout)
コード例 #4
0
ファイル: tab_widget.py プロジェクト: jamzo/ninja-ide
    def __init__(self):
        QWidget.__init__(self)
        self.setContextMenuPolicy(Qt.DefaultContextMenu)
        self.setMinimumHeight(38)
        hbox = QHBoxLayout(self)
        self.btnPrevious = QPushButton(QIcon(resources.IMAGES["nav-code-left"]), "")
        self.btnPrevious.setObjectName("navigation_button")
        self.btnPrevious.setToolTip(self.tr("Right click to change navigation options"))
        self.btnNext = QPushButton(QIcon(resources.IMAGES["nav-code-right"]), "")
        self.btnNext.setObjectName("navigation_button")
        self.btnNext.setToolTip(self.tr("Right click to change navigation options"))
        hbox.addWidget(self.btnPrevious)
        hbox.addWidget(self.btnNext)
        self.setContentsMargins(0, 0, 0, 0)

        self.menuNavigate = QMenu(self.tr("Navigate"))
        self.codeAction = self.menuNavigate.addAction(self.tr("Code Jumps"))
        self.codeAction.setCheckable(True)
        self.codeAction.setChecked(True)
        self.bookmarksAction = self.menuNavigate.addAction(self.tr("Bookmarks"))
        self.bookmarksAction.setCheckable(True)
        self.breakpointsAction = self.menuNavigate.addAction(self.tr("Breakpoints"))
        self.breakpointsAction.setCheckable(True)

        # 0 = Code Jumps
        # 1 = Bookmarks
        # 2 = Breakpoints
        self.operation = 0

        self.connect(self.codeAction, SIGNAL("triggered()"), self._show_code_nav)
        self.connect(self.breakpointsAction, SIGNAL("triggered()"), self._show_breakpoints)
        self.connect(self.bookmarksAction, SIGNAL("triggered()"), self._show_bookmarks)
コード例 #5
0
ファイル: timeline.py プロジェクト: halbbob/dff
 def __init__(self):
   Script.__init__(self, 'timeline')
   QWidget.__init__(self, None)
   self.type = 'timeline'
   self.nodeCount = 0
   self.timesCount = 0
   self.timeMap = {}
   self.m = 40 # Padding
   self.lineHeight = 4 # Pixel height of line
   self.metricOk = False
   self.colors = [['blue', Qt.blue], ['red', Qt.red],
                  ['green', Qt.green], ['yellow', Qt.yellow],
                  ['magenta', Qt.magenta], ['cyan', Qt.cyan]]
   self.stateinfo = 'Initialized'
   self.dateMin = long(0xffffffffffffffff)
   self.dateMax = long(0)
   self.baseDateMin = self.dateMin
   self.baseDateMax = self.dateMax
   self.selDateMin = None
   self.selDateMax = None
   self.maxOcc = 0
   self.maxOccZoom = 0
   self.xHop = 0
   self.xRange = 0
   self.dataListsCreated = False
コード例 #6
0
ファイル: pyioview.py プロジェクト: sti87/ricodebug
    def __init__(self, debug_controller, parent=None):
        QWidget.__init__(self, parent)

        self.gridLayout = QtGui.QGridLayout(self)
        self.gridLayout.setMargin(0)

        self.pyIoEdit = QtGui.QTextEdit(self)
        self.pyIoEdit.setReadOnly(True)
        self.gridLayout.addWidget(self.pyIoEdit, 0, 0, 1, 2)

        self.pyInputEdit = QtGui.QComboBox(self)
        self.pyInputEdit.setEditable(True)
        self.gridLayout.addWidget(self.pyInputEdit, 1, 0, 1, 1)

        self.pySendButton = QtGui.QPushButton(self)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.pySendButton.sizePolicy().hasHeightForWidth())
        self.pySendButton.setSizePolicy(sizePolicy)
        self.pySendButton.setText("Send")
        self.gridLayout.addWidget(self.pySendButton, 1, 1, 1, 1)

        QtCore.QMetaObject.connectSlotsByName(self)

        self.debugController = debug_controller

        self.pyInputEdit.lineEdit().returnPressed.connect(self.pySendButton.click)
        self.pySendButton.clicked.connect(self.executePythonCode)
コード例 #7
0
    def __init__(self, IP, PORT, CameraID, parent=None):
        """
        Initialization.
        """
        QWidget.__init__(self, parent)
        self._image = QImage()
        self.setWindowTitle('Nao')

        self._imgWidth = 320
        self._imgHeight = 240
        self._cameraID = CameraID
        self.resize(self._imgWidth, self._imgHeight)

        # Proxy to ALVideoDevice.
        self._videoProxy = None

        # Our video module name.
        self._imgClient = ""

        # This will contain this alImage we get from Nao.
        self._alImage = None

        self._registerImageClient(IP, PORT)

        # Trigget 'timerEvent' every 100 ms.
        self.startTimer(100)
コード例 #8
0
    def __init__(self, text_items, abstract, menu, parent=None):
        QWidget.__init__(self, parent)
        self.row_layout = QHBoxLayout(self)
        self.row_layout.setMargin(0)
        self.row_layout.setAlignment(Qt.AlignLeft)
        self.details_button = DetailsButton()
        self.row_layout.addWidget(self.details_button)

        for widget in (self.details_button, self):
            self.connect(widget, SIGNAL('clicked()'), self.updateView)

        for text in text_items:
            label = QLabel()
            label.setText("<h2>%s</h2>" % text)
            self.row_layout.addWidget(label)

        self.abstract = abstract

        if abstract is None:
            return

        self.row_layout.addWidget(abstract)
        self.row_layout.addStretch()

        self.edit_button = EditButton(menu)
        self.row_layout.addWidget(self.edit_button)
コード例 #9
0
    def __init__(self, project, content, itemRelated, parent=None):
        QWidget.__init__(self, parent)
        self.__content = content.toMap()
        self.__project = project
        self.__favorite = QPushButton(self)
        self.__delete = QPushButton(self)
        self.__delete.setIcon(QIcon(resources.IMAGES['delProj']))
        self.__name = QLineEdit(self)
        self.__itemRelated = itemRelated
        self.setMouseTracking(True)
        self.__name.setText(self.__content[QString("name")].toString())

        if QString("description") in self.__content:
            description = self.__content[QString("description")].toString()
        else:
            description = self.tr("no description available")
        self.__name.setToolTip(self.tr(self.__project) + '\n\n' + description)
        self.__delete.setToolTip(self.tr("Click to delete from the list"))
        self.__favorite.setToolTip(self.tr("Click to dock on the list"))
        hbox = QHBoxLayout()
        self.setLayout(hbox)
        hbox.setContentsMargins(0, 0, 0, 0)
        hbox.addWidget(self.__favorite)
        hbox.addWidget(self.__name)
        hbox.addWidget(self.__delete)
        self.__name.setCursor(QCursor(Qt.ArrowCursor))
        self.__name.setReadOnly(True)
        self.connect(self.__favorite, SIGNAL("clicked(bool)"),
            self.__on_click_on_favorite)
        self.connect(self.__delete, SIGNAL("clicked(bool)"),
            self.__on_click_on_delete)
        #TODO: Change this click listen it doesn't work with ReadOnly = True
        self.connect(self.__name,
            SIGNAL("cursorPositionChanged(int, int)"), self.__on_click_on_name)
        self._set_favorite(self.__content[QString("isFavorite")].toBool())
コード例 #10
0
ファイル: legend.py プロジェクト: Ensembles/ert
    def __init__(self, color):
        QWidget.__init__(self)

        self.setMaximumSize(QSize(12, 12))
        self.setMinimumSize(QSize(12, 12))

        self.color = color
コード例 #11
0
ファイル: ignore_box.py プロジェクト: hsoft/musicguru
 def __init__(self, app):
     QWidget.__init__(self, None)
     self.app = app
     self.boxModel = IgnoreBoxModel(app)
     self._setupUi()
     
     self.connect(self.browserView.selectionModel(), SIGNAL('selectionChanged(QItemSelection,QItemSelection)'), self.browserSelectionChanged)
コード例 #12
0
ファイル: composer_chart_config.py プロジェクト: gltn/stdm
    def __init__(self, composer_wrapper, parent=None):
        QWidget.__init__(self, parent)
        self.setupUi(self)

        self._composer_wrapper = composer_wrapper

        self._notif_bar = NotificationBar(self.vl_notification)

        self.cbo_chart_type.currentIndexChanged[int].connect(self._on_chart_type_changed)

        '''
        Register chartname to the positional index of the corresponding editor
        '''
        self._short_name_idx = {}

        #Add registered chart types
        self._load_chart_type_settings()

        #Load legend positions
        self._load_legend_positions()

        self.groupBox_2.setCollapsed(True)
        self.groupBox_2.collapsedStateChanged.connect(self._on_series_properties_collapsed)

        #Load fields if the data source has been specified
        ds_name = self._composer_wrapper.selectedDataSource()
        self.ref_table.load_data_source_fields(ds_name)

        #Load referenced table list
        self.ref_table.load_link_tables()

        #Connect signals
        self._composer_wrapper.dataSourceSelected.connect(self.ref_table.on_data_source_changed)
        self.ref_table.referenced_table_changed.connect(self.on_referenced_table_changed)
コード例 #13
0
ファイル: doRgbPct.py プロジェクト: Ariki/QGIS
  def __init__(self, iface):
      QWidget.__init__(self)
      self.iface = iface

      self.setupUi(self)
      BaseBatchWidget.__init__(self, self.iface, "rgb2pct.py")

      self.outSelector.setType( self.outSelector.FILE )

      # set the default QSpinBoxes and QProgressBar value
      self.colorsSpin.setValue(2)
      self.progressBar.setValue(0)

      self.progressBar.hide()
      self.outputFormat = Utils.fillRasterOutputFormat()

      self.setParamsStatus([
          (self.inSelector, SIGNAL("filenameChanged()")),
          (self.outSelector, SIGNAL("filenameChanged()")),
          (self.colorsSpin, SIGNAL("valueChanged(int)"), self.colorsCheck),
          (self.bandSpin, SIGNAL("valueChanged(int)"), self.bandCheck, "-1")   # hide this option
      ])

      self.connect(self.inSelector, SIGNAL("selectClicked()"), self.fillInputFile)
      self.connect(self.outSelector, SIGNAL("selectClicked()"), self.fillOutputFileEdit)
      self.connect( self.batchCheck, SIGNAL( "stateChanged( int )" ), self.switchToolMode )
コード例 #14
0
ファイル: proprietes_objets.py プロジェクト: Grahack/geophar
    def __init__(self, parent):
        QWidget.__init__(self, parent)
        self.parent = parent
        self.objets = parent.objets
        self.panel = self.parent.parent.panel
        self.canvas = self.parent.parent.canvas
        self.islabel = self.parent.parent.islabel

        self.sizer = QVBoxLayout()
        if len(self.objets) is 1:
            self.objet = self.objets[0]

            style = QVBoxLayout()
            style_box = QGroupBox(u"Style de l'objet")
            style_box.setLayout(style)
            style.addWidget(QLabel(u"Attention, ne modifiez ce contenu que si vous savez ce que vous faites."))
            self.avance = QTextEdit()
            self.avance.setMinimumSize(350, 200)
            self.actualiser()
            style.addWidget(self.avance)
            self.sizer.addWidget(style_box)

            ok = QPushButton('OK')
            appliquer = QPushButton(u"Appliquer")
            actualiser = QPushButton(u"Actualiser")
            ok.clicked.connect(self.EvtOk)
            appliquer.clicked.connect(self.EvtAppliquer)
            actualiser.clicked.connect(self.actualiser)
            boutons = QHBoxLayout()
            boutons.addWidget(ok)
            boutons.addWidget(appliquer)
            boutons.addWidget(actualiser)
            self.sizer.addLayout(boutons)

        self.setLayout(self.sizer)
コード例 #15
0
ファイル: pylintviewer.py プロジェクト: eaglexmw/codimension
    def __init__( self, parent = None ):
        QWidget.__init__( self, parent )

        self.__reportUUID = ""
        self.__reportFileName = ""
        self.__reportOption = -1
        self.__reportShown = False
        self.__report = None

        self.__widgets = []

        # Prepare members for reuse
        if GlobalData().pylintAvailable:
            self.__noneLabel = QLabel( "\nNo results available" )
        else:
            self.__noneLabel = QLabel( "\nPylint is not available" )
        self.__noneLabel.setAutoFillBackground( True )
        noneLabelPalette = self.__noneLabel.palette()
        noneLabelPalette.setColor( QPalette.Background,
                                   GlobalData().skin.nolexerPaper )
        self.__noneLabel.setPalette( noneLabelPalette )

        self.__noneLabel.setFrameShape( QFrame.StyledPanel )
        self.__noneLabel.setAlignment( Qt.AlignHCenter )
        self.__headerFont = self.__noneLabel.font()
        self.__headerFont.setPointSize( self.__headerFont.pointSize() + 4 )
        self.__noneLabel.setFont( self.__headerFont )

        self.__createLayout( parent )

        self.__updateButtonsStatus()
        self.resizeEvent()
        return
コード例 #16
0
ファイル: run_workflow_widget.py プロジェクト: blattms/ert
    def __init__(self):
        QWidget.__init__(self)

        layout = QHBoxLayout()
        layout.addSpacing(10)

        workflow_model = WorkflowsModel()

        # workflow_model.observable().attach(WorkflowsModel.CURRENT_CHOICE_CHANGED_EVENT, self.showWorkflow)
        workflow_combo = ComboChoice(workflow_model, "Select Workflow", "run/workflow")
        layout.addWidget(QLabel(workflow_combo.getLabel()), 0, Qt.AlignVCenter)
        layout.addWidget(workflow_combo, 0, Qt.AlignVCenter)

        # simulation_mode_layout.addStretch()
        layout.addSpacing(20)

        self.run_button = QToolButton()
        self.run_button.setIconSize(QSize(32, 32))
        self.run_button.setText("Start Workflow")
        self.run_button.setIcon(util.resourceIcon("ide/gear_in_play"))
        self.run_button.clicked.connect(self.startWorkflow)
        self.run_button.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)

        layout.addWidget(self.run_button)
        layout.addStretch(1)

        self.setLayout(layout)

        self.__running_workflow_dialog = None

        self.workflowSucceeded.connect(self.workflowFinished)
        self.workflowFailed.connect(self.workflowFinishedWithFail)
コード例 #17
0
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        self.setupUi()

        self.cbo_ref_table.setInsertPolicy(QComboBox.InsertAlphabetically)

        self.cbo_ref_table.currentIndexChanged[str].connect(self._on_ref_table_changed)
コード例 #18
0
    def __init__(self):
        QWidget.__init__(self)

        self.__filter_popup = FilterPopup(self)
        self.__filter_popup.filterSettingsChanged.connect(self.onItemChanged)

        layout = QVBoxLayout()

        self.model = DataTypeKeysListModel()
        self.filter_model = DataTypeProxyModel(self.model)

        filter_layout = QHBoxLayout()

        self.search_box = SearchBox()
        self.search_box.filterChanged.connect(self.setSearchString)
        filter_layout.addWidget(self.search_box)

        filter_popup_button = QToolButton()
        filter_popup_button.setIcon(util.resourceIcon("ide/cog_edit.png"))
        filter_popup_button.clicked.connect(self.showFilterPopup)
        filter_layout.addWidget(filter_popup_button)
        layout.addLayout(filter_layout)

        self.data_type_keys_widget = QListView()
        self.data_type_keys_widget.setModel(self.filter_model)
        self.data_type_keys_widget.selectionModel().selectionChanged.connect(self.itemSelected)

        layout.addSpacing(15)
        layout.addWidget(self.data_type_keys_widget, 2)
        layout.addStretch()

        # layout.addWidget(Legend("Default types", DataTypeKeysListModel.DEFAULT_DATA_TYPE))
        layout.addWidget(Legend("Observations available", DataTypeKeysListModel.HAS_OBSERVATIONS))

        self.setLayout(layout)
コード例 #19
0
ファイル: proprietes_objets.py プロジェクト: Grahack/geophar
    def __init__(self, parent):
        QWidget.__init__(self, parent)
        self.parent = parent
        self.objets = parent.objets
        self.sizer = QVBoxLayout()
        self.infos = infos = QVBoxLayout()
        if len(self.objets) == 1:
            self.objet = self.objets[0]
        else:
            self.objet = None # cela n'a pas vraiment de sens d'afficher une longueur pour 3 segments differents par exemple...

        self.textes = []
        proprietes = ("aire", "centre", "coordonnees", "rayon", "longueur", "perimetre", "norme", "sens")

        for propriete in proprietes:
            try:
                self.ajouter(infos, propriete)
            except:
                debug(u"Erreur lors de la lecture de la propriété '%s' de l'objet %s." %(propriete, self.objet.nom))
                print_error()

        self.ajouter(infos, "equation_formatee", u"Equation cartésienne")


        if self.textes:
            infos_box = QGroupBox(u"Informations")
            infos_box.setLayout(infos)
            self.sizer.addWidget(infos_box)
            actualiser = QPushButton(u"Actualiser")
            actualiser.clicked.connect(self.EvtActualiser)
            self.sizer.addWidget(actualiser)
        else:
            self.sizer.addWidget(QLabel(str(len(self.objets)) + u" objets sélectionnés."))

        self.setLayout(self.sizer)
コード例 #20
0
ファイル: layerwidget.py プロジェクト: DerThorsten/volumina
 def __init__(self, parent = None):
     QWidget.__init__(self, parent)
     self.lmbDown = False
     self.setMouseTracking(True)
     self.setAutoFillBackground(True)
     self._layerPainter = LayerPainter()
     self._layer = None
コード例 #21
0
    def __init__(self, parent = None):
        QWidget.__init__(self, parent)
        self.setStyleSheet(SHARED)
        self.layout = QVBoxLayout(self)

        disk1 = Block(self, 'Western Digital ATA', 2220)#, layout = VERTICAL)
        disk1.addPartition(Partition(disk1, 'sda1', EXT, 800))
        disk1.addPartition(Partition(disk1, 'sda2', MS, 400))
        disk1.addPartition(Partition(disk1, 'sda3', UK, 620))
        disk1.addPartition(Partition(disk1, 'free', FREE))
        self.layout.addWidget(disk1)

        disk2 = Block(self, 'Seagate Falan Filan', 5330)#, layout = VERTICAL)
        disk2.addPartition(Partition(disk2, 'sdb1', UK, 120))
        disk2.addPartition(Partition(disk2, 'sdb2', EXT, 530))
        disk2.addPartition(Partition(disk2, 'sdb3', EXT, 2830))
        disk2.addPartition(Partition(disk2, 'free', FREE))
        self.layout.addWidget(disk2)

        disk3 = Block(self, 'Super USB Disk', 4330)#, layout = VERTICAL)
        disk3.addPartition(Partition(disk3, 'free', FREE, 2220))
        disk3.addPartition(Partition(disk3, 'sdc1', EXT, 1000))
        disk3.addPartition(Partition(disk3, 'sdc2', MS, 620))
        disk3.addPartition(Partition(disk3, 'free', FREE))
        self.layout.addWidget(disk3)

        disk1.connectToBlock(disk2)
        disk1.connectToBlock(disk3)
        disk2.connectToBlock(disk3)
コード例 #22
0
ファイル: doContour.py プロジェクト: Ariki/QGIS
  def __init__(self, iface):
      QWidget.__init__(self)
      self.iface = iface

      self.setupUi(self)
      BasePluginWidget.__init__(self, self.iface, "gdal_contour")

      gdalVersion = Utils.GdalConfig.versionNum()
      self.useDirAsOutput = gdalVersion < 1700
      if self.useDirAsOutput:
          self.label_2.setText( QApplication.translate("GdalToolsWidget", "&Output directory for contour lines (shapefile)") )

      self.outSelector.setType( self.outSelector.FILE )

      # set the default QSpinBoxes value
      self.intervalDSpinBox.setValue(10.0)

      self.setParamsStatus([
          (self.inSelector, SIGNAL("filenameChanged()") ),
          (self.outSelector, SIGNAL("filenameChanged()")),
          (self.intervalDSpinBox, SIGNAL("valueChanged(double)")),
          (self.attributeEdit, SIGNAL("textChanged(const QString &)"), self.attributeCheck)
      ])

      self.connect(self.inSelector, SIGNAL("selectClicked()"), self.fillInputFileEdit)
      self.connect(self.outSelector, SIGNAL("selectClicked()"), self.fillOutputFileEdit)
コード例 #23
0
    def __init__(self, current_case):
        QWidget.__init__(self)

        self.__model = PlotCaseModel()

        self.__signal_mapper = QSignalMapper(self)
        self.__case_selectors = {}
        self.__case_selectors_order = []

        layout = QVBoxLayout()

        add_button_layout = QHBoxLayout()
        button = QPushButton(util.resourceIcon("ide/small/add"), "Add case to plot")
        button.clicked.connect(self.addCaseSelector)

        add_button_layout.addStretch()
        add_button_layout.addWidget(button)
        add_button_layout.addStretch()

        layout.addLayout(add_button_layout)

        self.__case_layout = QVBoxLayout()
        self.__case_layout.setMargin(0)
        layout.addLayout(self.__case_layout)

        self.addCaseSelector(disabled=True, current_case=current_case)
        layout.addStretch()

        self.setLayout(layout)

        self.__signal_mapper.mapped[QWidget].connect(self.removeWidget)
コード例 #24
0
ファイル: listeditbox.py プロジェクト: berland/ert
    def __init__(self, possible_items):
        QWidget.__init__(self)

        self._editing = True
        self._possible_items = possible_items

        self._list_edit_line = AutoCompleteLineEdit(possible_items, self)
        self._list_edit_line.setMinimumWidth(350)

        layout = QHBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)

        layout.addWidget(self._list_edit_line)

        dialog_button = QToolButton(self)
        dialog_button.setIcon(resourceIcon("ide/small/add"))
        dialog_button.setIconSize(QSize(16, 16))
        dialog_button.clicked.connect(self.addChoice)

        layout.addWidget(dialog_button)

        self.setLayout(layout)

        self._validation_support = ValidationSupport(self)
        self._valid_color = self._list_edit_line.palette().color(self._list_edit_line.backgroundRole())

        self._list_edit_line.setText("")
        self._editing = False

        self._list_edit_line.editingFinished.connect(self.validateList)
        self._list_edit_line.textChanged.connect(self.validateList)

        self.validateList()
コード例 #25
0
 def __init__(self, parent):
     QWidget.__init__(self, parent)
     vbox = QVBoxLayout(self)
     self._webInspector = QWebInspector(self)
     vbox.addWidget(self._webInspector)
     self.btnDock = QPushButton(self.tr("Undock"))
     vbox.addWidget(self.btnDock)
コード例 #26
0
ファイル: termwidget.py プロジェクト: Denvi/FlatCAM
    def __init__(self, *args):
        QWidget.__init__(self, *args)

        self._browser = QTextEdit(self)
        self._browser.setStyleSheet("font: 9pt \"Courier\";")
        self._browser.setReadOnly(True)
        self._browser.document().setDefaultStyleSheet(
            self._browser.document().defaultStyleSheet() +
            "span {white-space:pre;}")

        self._edit = _ExpandableTextEdit(self, self)
        self._edit.historyNext.connect(self._on_history_next)
        self._edit.historyPrev.connect(self._on_history_prev)
        self.setFocusProxy(self._edit)

        layout = QVBoxLayout(self)
        layout.setSpacing(0)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(self._browser)
        layout.addWidget(self._edit)

        self._history = ['']  # current empty line
        self._historyIndex = 0

        self._edit.setFocus()
コード例 #27
0
ファイル: pref_editor.py プロジェクト: EricRahm/mozregression
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        self.ui = Ui_PrefEditor()
        self.ui.setupUi(self)

        self.pref_model = PreferencesModel()
        self.ui.pref_view.setModel(self.pref_model)
コード例 #28
0
ファイル: QArrow.py プロジェクト: PeterRyder/Chordial
 def __init__(self, direction, parent=None):
     """Create a new instance."""
     QWidget.__init__(self, parent)
     if not direction in (QArrow.UP, QArrow.DOWN,
               QArrow.LEFT, QArrow.RIGHT):
         raise ValueError('Wrong arrow direction.')
     self._direction = direction
コード例 #29
0
ファイル: termwidget.py プロジェクト: daffodil/enki
    def __init__(self, *args):
        QWidget.__init__(self, *args)
        self._browser = QTextEdit(self)
        self._browser.setReadOnly(True)
        self._browser.document().setDefaultStyleSheet(self._browser.document().defaultStyleSheet() + 
                                                      "span {white-space:pre;}")

        editorClass = self._makeEditorClass()
        self._edit = editorClass(self, None, terminalWidget=True)
        
        lowLevelWidget = self._edit.focusProxy()
        if lowLevelWidget is None:
            lowLevelWidget = self._edit
        lowLevelWidget.installEventFilter(self)
        
        self._edit.newLineInserted.connect(self._onEditNewLine)
        self._edit.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Maximum)
        self.setFocusProxy(self._edit)

        layout = QVBoxLayout(self)
        layout.setSpacing(0)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(self._browser)
        layout.addWidget(self._edit)
        
        self._history = ['']  # current empty line
        self._historyIndex = 0
        
        self._edit.setFocus()
コード例 #30
0
 def __init__(self, parent):
     QWidget.__init__(self,parent)
     self.ui = gui.settingsUi()
     self.ui.setupUi(self)  
     self.parent = parent      
     
     # Load current settings in dialog
     # output settings
     self.ui.generateARFFCheckBox.setChecked(self.parent.settings.generateARFF) 
     self.ui.generateCSVCheckBox.setChecked(self.parent.settings.generateCSV)
     self.ui.saveRawEEGCheckBox.setChecked(self.parent.settings.saveRawEEG)
     self.ui.comboBox.setCurrentIndex(self.ui.comboBox.findText(\
                             self.parent.settings.CSVseparator)) 
     self.ui.lineEdit_2.setText(self.parent.settings.outputPrefix)  
     self.ui.lineEdit.setText(self.parent.settings.outputFolder)    
     
     # masking settings
     self.ui.comboBox_3.setCurrentIndex(self.ui.comboBox_3.findText(\
                             self.parent.settings.masking) )
     self.ui.comboBox_2.setCurrentIndex(self.ui.comboBox_2.findText(\
                             self.parent.settings.masklength))
     self.ui.lineEdit_3.setText(self.parent.settings.maskfolder) 
     self.ui.checkBox_4.setChecked(self.parent.settings.keysDuringMasks) 
     self.ui.checkBox_5.setChecked(self.parent.settings.randomizeMasks)
     # processing settings
     # nothing yet
     
     # misc settings
     self.ui.spinBox.setValue(self.parent.settings.countdownFrom)
     self.ui.calibrateButton.setEnabled(self.parent.settings.haveEyeTracker)
     self.ui.eyetrackCheckBox.setChecked(self.parent.settings.enableEyeTracker)
     self.ui.eyetrackCheckBox.setEnabled(self.parent.settings.haveCalibrated)
     self.ui.wallTimeCheckBox.setChecked(self.parent.settings.wallTime)
コード例 #31
0
 def __init__(self, parent=None):
     QWidget.__init__(self, parent)
コード例 #32
0
    def __init__(self, sr785, parent=None):
        QWidget.__init__(self, parent)
        SR785_FFTUi.Ui_Form.__init__(self)
        self.sr785 = sr785
        self.setupUi(self)
        self.dlg = fileGeneratorDialog.fileGenerator(self)

        inputLayout = QVBoxLayout(self.inputPage)
        self.inputA = SR785_GUI.SR785_InputChannelGroupBox(self.sr785, 'A')
#        self.inputB = SR785_GUI.SR785_InputChannelGroupBox(self.sr785, 'B')
        inputLayout.addWidget(self.inputA)
#        inputLayout.addWidget(self.inputB)

        sourceLayout = QVBoxLayout(self.sourcePage)
        self.sourceGroupBox = SR785_GUI.SR785_SourceGroupBox(self.sr785)
        sourceLayout.addWidget(self.sourceGroupBox)

        # Frequency Menu
        self.sr785.fft.lines.bindToEnumComboBox(self.linesCombo)
        self.linesCombo.currentIndexChanged.connect(self.setForceLengthMax)
        self.sr785.fft.baseFrequency.bindToEnumComboBox(self.baseFrequencyCombo)
        self.baseFrequencyCombo.currentIndexChanged.connect(self.getFrequencySpan)
        self.sr785.fft.centerFrequency.bindToSpinBox(self.centerFrequencySb)
        self.frequencySpanCombo.setToolTip(self.sr785.fft.frequencySpanToolTip())
        self.frequencySpanCombo.currentIndexChanged.connect(self.setFreqSpan)
        self.settlePb.clicked.connect(self.sr785.fft.settleMeasurement)

        # Average Menu
        self.sr785.fft.computeAverage.bindToCheckBox(self.computeAverageCheck)
        self.sr785.fft.averageType.bindToEnumComboBox(self.averageTypeCombo)
        self.sr785.fft.fftAverageType.bindToEnumComboBox(self.fftAverageTypeCombo)
        self.sr785.fft.numberOfAverages.bindToSpinBox(self.numberOfAveragesSb)
        self.sr785.fft.fftTimeRecordIncrement.bindToSpinBox(self.fftTimeRecordIncrementSb)
        self.sr785.fft.overloadReject.bindToEnumComboBox(self.overloadRejectCombo)
        self.sr785.fft.triggerAverageMode.bindToEnumComboBox(self.triggerAverageModeCombo)
        self.averageTypeCombo.currentIndexChanged.connect(self.setTimeRecord)
#        self.computeAverageCheck.setToolTip(self.sr785.fft.computeAverageToolTip())
#        self.sr785.fft.averagePreview.bindToEnumComboBox(self.averagePreviewCombo)

        # Windowing Menu
        self.sr785.fft.windowType.bindToEnumComboBox(self.windowTypeCombo)
        self.windowTypeCombo.currentIndexChanged.connect(self.forceOrExponentialEnable)
        self.forceOrExponentialCombo.currentIndexChanged.connect(self.forceOrExponentialChoice)
        self.sr785.fft.forceOrExponential1.bindToEnumComboBox(self.forceOrExponentialCombo)
        self.sr785.fft.expoWindowTimeConstant.bindToSpinBox(self.expoWindowTimeConstantSb)
        self.expoWindowTimeConstantSb.setEnabled(False)
        self.forceOrExponentialCombo.setEnabled(False)
        self.sr785.fft.forceLength.bindToSpinBox(self.forceLengthSb)

#        self.computeAverageCheck.stateChanged.connect(self.computeAverage)

        self.display1Plot
#        self.display2Plot

        self.startPb.clicked.connect(self.startMeasurement)
        self.pausePb.clicked.connect(self.pauseMeasurement)
        self.sampleInfoPb.clicked.connect(self.sampleInfo)

        self.pathnameLe.setReadOnly(True)
        self.fileNameLe.setReadOnly(True)

        self.startPb.setEnabled(False)
        self.pausePb.setEnabled(False)
#        self.sampleInfoPb.setEnabled(False)
        self.restoreSettings()


        self.ownFilenameCheck.stateChanged.connect(self.filenameNeeded) # One issue is that the file type might not be what we want if people generate their own. Is this a concern?
# Might not need includeSampleInfoCheck box how it is currently setup
#        self.includeSampleInfoCheck.stateChanged.connect(self.sampleInfoNeeded)
# Still need to include the sample information dialog but I think I want to make sure that is works and that it works in the other one before doing that.

        self.fileDialog = QtGui.QFileDialog()
        self.fileDialogPb.setEnabled(False)
        self.fileDialogPb.clicked.connect(self.fileInfo)
コード例 #33
0
 def __init__(self, parent=None):
     QWidget.__init__(self, parent)
     self.canvas = MplCanvas()
     self.vbl = QVBoxLayout()
     self.vbl.addWidget(self.canvas)
     self.setLayout(self.vbl)
コード例 #34
0
 def __init__(self, parent, name=None):
     QWidget.__init__(self, parent)
     self.setupUi(self)
     self.setName(name)
コード例 #35
0
 def __init__(self, parent):
     QWidget.__init__(self, parent)
     uicLoad("ffado/panelmanagerstatus", self)
コード例 #36
0
    def __init__( self, scriptName, params, reportTime,
                        dataFile, stats, parent = None ):
        QWidget.__init__( self, parent )

        self.__table = ProfilerTreeWidget( self )
        self.__table.escapePressed.connect( self.__onEsc )

        self.__script = scriptName
        self.__stats = stats
        project = GlobalData().project
        if project.isLoaded():
            self.__projectPrefix = os.path.dirname( project.fileName )
        else:
            self.__projectPrefix = os.path.dirname( scriptName )
        if not self.__projectPrefix.endswith( os.path.sep ):
            self.__projectPrefix += os.path.sep

        self.__table.setAlternatingRowColors( True )
        self.__table.setRootIsDecorated( False )
        self.__table.setItemsExpandable( False )
        self.__table.setSortingEnabled( True )
        self.__table.setItemDelegate( NoOutlineHeightDelegate( 4 ) )
        self.__table.setUniformRowHeights( True )
        self.__table.setSelectionMode( QAbstractItemView.SingleSelection )
        self.__table.setSelectionBehavior( QAbstractItemView.SelectRows )

        headerLabels = [ "", "Calls", "Total time", "Per call",
                         "Cum. time", "Per call", "File name:line",
                         "Function", "Callers", "Callees" ]
        self.__table.setHeaderLabels( headerLabels )

        headerItem = self.__table.headerItem()
        headerItem.setToolTip( 0, "Indication if it is an outside function" )
        headerItem.setToolTip( 1, "Actual number of calls/primitive calls "
                                  "(not induced via recursion)" )
        headerItem.setToolTip( 2, "Total time spent in function "
                                  "(excluding time made in calls "
                                  "to sub-functions)" )
        headerItem.setToolTip( 3, "Total time divided by number "
                                  "of actual calls" )
        headerItem.setToolTip( 4, "Total time spent in function and all "
                                  "subfunctions (from invocation till exit)" )
        headerItem.setToolTip( 5, "Cumulative time divided by number "
                                  "of primitive calls" )
        headerItem.setToolTip( 6, "Function location" )
        headerItem.setToolTip( 7, "Function name" )
        headerItem.setToolTip( 8, "Function callers" )
        headerItem.setToolTip( 9, "Function callees" )

        self.__table.itemActivated.connect( self.__activated )

        totalCalls = self.__stats.total_calls
        totalPrimitiveCalls = self.__stats.prim_calls  # The calls were not induced via recursion
        totalTime = self.__stats.total_tt

        txt = "<b>Script:</b> " + self.__script + " " + params.arguments + "<br>" \
              "<b>Run at:</b> " + reportTime + "<br>" + \
              str( totalCalls ) + " function calls (" + \
              str( totalPrimitiveCalls ) + " primitive calls) in " + \
              FLOAT_FORMAT % totalTime + " CPU seconds"
        summary = QLabel( txt )
        summary.setToolTip( txt )
        summary.setSizePolicy( QSizePolicy.Ignored, QSizePolicy.Fixed )
        summary.setFrameStyle( QFrame.StyledPanel )
        summary.setAutoFillBackground( True )
        summaryPalette = summary.palette()
        summaryBackground = summaryPalette.color( QPalette.Background )
        summaryBackground.setRgb( min( summaryBackground.red() + 30, 255 ),
                                  min( summaryBackground.green() + 30, 255 ),
                                  min( summaryBackground.blue() + 30, 255 ) )
        summaryPalette.setColor( QPalette.Background, summaryBackground )
        summary.setPalette( summaryPalette )

        vLayout = QVBoxLayout()
        vLayout.setContentsMargins( 0, 0, 0, 0 )
        vLayout.setSpacing( 0 )
        vLayout.addWidget( summary )
        vLayout.addWidget( self.__table )

        self.setLayout( vLayout )
        self.__createContextMenu()

        self.__populate( totalTime )
        return
コード例 #37
0
    def __init__(self, parameter, parent=None):
        """Constructor.

        :param parameter: A GroupSelectParameter object.
        :type parameter: GroupSelectParameter
        """
        QWidget.__init__(self, parent)
        self._parameter = parameter

        # Store spin box
        self.spin_boxes = {}

        # Create elements
        # Label (name)
        self.label = QLabel(self._parameter.name)

        # Layouts
        self.main_layout = QVBoxLayout()
        self.input_layout = QVBoxLayout()

        # _inner_input_layout must be filled with widget in the child class
        self.inner_input_layout = QVBoxLayout()

        self.radio_button_layout = QGridLayout()

        # Create radio button group
        self.input_button_group = QButtonGroup()

        # List widget
        self.list_widget = QListWidget()
        self.list_widget.setSelectionMode(QAbstractItemView.ExtendedSelection)
        self.list_widget.setDragDropMode(QAbstractItemView.DragDrop)
        self.list_widget.setDefaultDropAction(Qt.MoveAction)
        self.list_widget.setEnabled(False)
        self.list_widget.setSizePolicy(QSizePolicy.Maximum,
                                       QSizePolicy.Expanding)

        for i, key in enumerate(self._parameter.options):
            value = self._parameter.options[key]
            radio_button = QRadioButton(value.get('label'))
            self.radio_button_layout.addWidget(radio_button, i, 0)
            if value.get('type') == SINGLE_DYNAMIC:
                double_spin_box = QDoubleSpinBox()
                self.radio_button_layout.addWidget(double_spin_box, i, 1)
                double_spin_box.setValue(value.get('value', 0))
                double_spin_box.setMinimum(
                    value.get('constraint', {}).get('min', 0))
                double_spin_box.setMaximum(
                    value.get('constraint', {}).get('max', 1))
                double_spin_box.setSingleStep(
                    value.get('constraint', {}).get('step', 0.01))
                step = double_spin_box.singleStep()
                if step > 1:
                    precision = 0
                else:
                    precision = len(str(step).split('.')[1])
                    if precision > 3:
                        precision = 3
                double_spin_box.setDecimals(precision)
                self.spin_boxes[key] = double_spin_box

                # Enable spin box depends on the selected option
                if self._parameter.selected == key:
                    double_spin_box.setEnabled(True)
                else:
                    double_spin_box.setEnabled(False)

            elif value.get('type') == STATIC:
                static_value = value.get('value', 0)
                if static_value is not None:
                    self.radio_button_layout.addWidget(
                        QLabel(str(static_value)), i, 1)
            elif value.get('type') == MULTIPLE_DYNAMIC:
                selected_fields = value.get('value', [])
                if self._parameter.selected == key:
                    self.list_widget.setEnabled(True)
                else:
                    self.list_widget.setEnabled(False)

            self.input_button_group.addButton(radio_button, i)
            if self._parameter.selected == key:
                radio_button.setChecked(True)

        # Help text
        self.help_label = QLabel(self._parameter.help_text)
        self.help_label.setSizePolicy(QSizePolicy.Maximum,
                                      QSizePolicy.Expanding)
        self.help_label.setWordWrap(True)
        self.help_label.setAlignment(Qt.AlignTop)

        self.inner_input_layout.addLayout(self.radio_button_layout)
        self.inner_input_layout.addWidget(self.list_widget)

        # Put elements into layouts
        self.input_layout.addWidget(self.label)
        self.input_layout.addLayout(self.inner_input_layout)

        self.help_layout = QVBoxLayout()
        self.help_layout.addWidget(self.help_label)

        self.main_layout.addLayout(self.input_layout)
        self.main_layout.addLayout(self.help_layout)

        self.setLayout(self.main_layout)

        self.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Expanding)

        # Update list widget
        self.update_list_widget()

        # Connect signal
        self.input_button_group.buttonClicked.connect(
            self.radio_buttons_clicked)
コード例 #38
0
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)

        self.setFixedWidth(500)
        self.setFixedHeight(400)
        self.setStyleSheet("font-size:20px;")

        self.vLayout = QVBoxLayout()
        self.setLayout(self.vLayout)

        settingsLabel = QLabel(self)
        settingsLabel.setText("Default settings")
        settingsLabel.setStyleSheet("font-size:25px;")
        settingsLabel.setFixedWidth(500)
        settingsLabel.setAlignment(Qt.AlignCenter)
        self.vLayout.addWidget(settingsLabel)

        sectionColorLabel = QLabel(self)
        sectionColorLabel.setText("Section colors:")
        self.sectionColorChooser = ColorChooser()
        self.sectionColorChooser.setMaximumWidth(50)
        self.sectionSecondColorChooser = ColorChooser()
        self.sectionSecondColorChooser.setMaximumWidth(50)
        self.putInHorizontalLayout(sectionColorLabel, self.sectionColorChooser,
                                   self.sectionSecondColorChooser)

        subsectionColorLabel = QLabel(self)
        subsectionColorLabel.setText("Subsection colors: ")
        self.subsectionColorChooser = ColorChooser(self)
        self.subsectionColorChooser.setMaximumWidth(50)
        self.subsectionSecondColorChooser = ColorChooser(self)
        self.subsectionSecondColorChooser.setMaximumWidth(50)
        self.putInHorizontalLayout(subsectionColorLabel,
                                   self.subsectionColorChooser,
                                   self.subsectionSecondColorChooser)

        linacSectionSizeLabel = QLabel(self)
        linacSectionSizeLabel.setText("Linac section size: ")
        self.linacSectionSizeSpinBox = QDoubleSpinBox(self)
        self.linacSectionSizeSpinBox.setFixedWidth(100)
        self.linacSectionSizeSpinBox.setMaximum(100.0)
        self.putInHorizontalLayout(linacSectionSizeLabel,
                                   self.linacSectionSizeSpinBox)

        linacSubsectionSizeLabel = QLabel(self)
        linacSubsectionSizeLabel.setText("Linac subsection size: ")
        self.linacSubsectionSizeSpinBox = QDoubleSpinBox(self)
        self.linacSubsectionSizeSpinBox.setFixedWidth(100)
        self.linacSubsectionSizeSpinBox.setMaximum(100.0)
        self.putInHorizontalLayout(linacSubsectionSizeLabel,
                                   self.linacSubsectionSizeSpinBox)

        ringSectionSizeLabel = QLabel(self)
        ringSectionSizeLabel.setText("Ring section size: ")
        self.ringSectionSizeSpinBox = QDoubleSpinBox(self)
        self.ringSectionSizeSpinBox.setFixedWidth(100)
        self.ringSectionSizeSpinBox.setMaximum(100.0)
        self.putInHorizontalLayout(ringSectionSizeLabel,
                                   self.ringSectionSizeSpinBox)

        ringSubectionSizeLabel = QLabel(self)
        ringSubectionSizeLabel.setText("Ring subsection size: ")
        self.ringSubsectionSizeSpinBox = QDoubleSpinBox(self)
        self.ringSubsectionSizeSpinBox.setFixedWidth(100)
        self.ringSubsectionSizeSpinBox.setMaximum(100.0)
        self.putInHorizontalLayout(ringSubectionSizeLabel,
                                   self.ringSubsectionSizeSpinBox)

        centerCoordinatesLabel = QLabel(self)
        centerCoordinatesLabel.setText("Real coordinates of ring center:")
        self.centerCoordinatesEditX = QLineEdit()
        self.centerCoordinatesEditX.setPlaceholderText("X")
        self.centerCoordinatesEditX.setFixedWidth(80)
        self.centerCoordinatesEditY = QLineEdit()
        self.centerCoordinatesEditY.setPlaceholderText("Y")
        self.centerCoordinatesEditY.setFixedWidth(80)
        self.putInHorizontalLayout(centerCoordinatesLabel,
                                   self.centerCoordinatesEditX,
                                   self.centerCoordinatesEditY)

        showDeviceCaptionsLabel = QLabel(self)
        showDeviceCaptionsLabel.setText("Show device captions:")
        showDeviceCaptionsLabel.setFixedWidth(500)
        self.showDeviceCaptionsCheckBox = QCheckBox(self)
        self.putInHorizontalLayout(showDeviceCaptionsLabel,
                                   self.showDeviceCaptionsCheckBox)

        useDbParametersLabel = QLabel(self)
        useDbParametersLabel.setText("Use parameters from database")
        useDbParametersLabel.setFixedWidth(500)
        self.useDbParametersCheckBox = QCheckBox(self)
        self.putInHorizontalLayout(useDbParametersLabel,
                                   self.useDbParametersCheckBox)

        tangoHostLabel = QLabel(self)
        tangoHostLabel.setText("Tango Host")
        self.tangoHostEdit = QLineEdit(self)
        self.tangoHostEdit.setFixedHeight(25)
        self.tangoHostEdit.setText("127.0.0.1:10000")
        self.tangoHostEdit.setStyleSheet("font-size:18px;")
        self.putInHorizontalLayout(tangoHostLabel, self.tangoHostEdit)

        self.setDefaultSettings()
コード例 #39
0
ファイル: canvastooldock.py プロジェクト: riccotti/Tesi
    def __init__(self, parent=None, **kwargs):
        QWidget.__init__(self, parent, **kwargs)

        self.__setupUi()
コード例 #40
0
 def __init__(self, parent=None):
     QWidget.__init__(self, parent)
     print os.getcwd()
     self.ui = uic.loadUi("DelayStage.ui", self)
     self.delaystage = DelayStage(self)
コード例 #41
0
    def __init__(self, parent, resoution=None):
        QWidget.__init__(self, parent)
        while not isinstance(parent, QDialog):
            parent = parent.parent()
        self.setObjectName(
            "AngleGradientBoxPanel" +
            str(len(parent.findChildren(AngleGradientBoxPanel))))
        sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
        self.setSizePolicy(sizePolicy)

        self.hLayoutBoxPanel = QHBoxLayout(self)
        self.hLayoutBoxPanel.setSpacing(0)
        self.hLayoutBoxPanel.setContentsMargins(0, 0, 0, 0)
        self.hLayoutBoxPanel.setObjectName(("hLayoutBoxPanel"))
        self.frameBoxPanel = QFrame(self)
        sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.frameBoxPanel.sizePolicy().hasHeightForWidth())
        self.frameBoxPanel.setSizePolicy(sizePolicy)
        self.frameBoxPanel.setFrameShape(QFrame.NoFrame)
        self.frameBoxPanel.setFrameShadow(QFrame.Raised)
        self.frameBoxPanel.setObjectName(("frameBoxPanel"))
        self.hLayoutframeBoxPanel = QHBoxLayout(self.frameBoxPanel)
        self.hLayoutframeBoxPanel.setSpacing(0)
        self.hLayoutframeBoxPanel.setMargin(0)
        self.hLayoutframeBoxPanel.setObjectName(("hLayoutframeBoxPanel"))
        self.captionLabel = QLabel(self.frameBoxPanel)
        sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.captionLabel.sizePolicy().hasHeightForWidth())
        self.captionLabel.setSizePolicy(sizePolicy)
        self.captionLabel.setMinimumSize(QSize(200, 0))
        self.captionLabel.setMaximumSize(QSize(200, 16777215))
        font = QFont()
        font.setBold(False)
        font.setWeight(50)
        self.captionLabel.setFont(font)
        self.captionLabel.setObjectName(("captionLabel"))
        self.hLayoutframeBoxPanel.addWidget(self.captionLabel)

        self.frameBoxPanelIn = QFrame(self.frameBoxPanel)
        self.frameBoxPanelIn.setFrameShape(QFrame.StyledPanel)
        self.frameBoxPanelIn.setFrameShadow(QFrame.Raised)
        self.frameBoxPanelIn.setObjectName(("frameBoxPanelIn"))
        self.hLayoutframeBoxPanelIn = QHBoxLayout(self.frameBoxPanelIn)
        self.hLayoutframeBoxPanelIn.setSpacing(0)
        self.hLayoutframeBoxPanelIn.setMargin(0)
        self.hLayoutframeBoxPanelIn.setObjectName(("hLayoutframeBoxPanelIn"))

        self.txtDegree = QLineEdit(self.frameBoxPanelIn)
        self.txtDegree.setEnabled(True)
        font = QFont()
        font.setBold(False)
        font.setWeight(50)
        self.txtDegree.setFont(font)
        self.txtDegree.setObjectName(self.objectName() + "_txtDegree")
        self.txtDegree.setText("0.0")
        self.txtDegree.setMinimumWidth(70)
        self.txtDegree.setMaximumWidth(70)
        self.hLayoutframeBoxPanelIn.addWidget(self.txtDegree)

        self.labelDegree = QLabel(self.frameBoxPanelIn)
        self.labelDegree.setObjectName(("labelDegree"))
        self.labelDegree.setText(" " + define._degreeStr + " ")
        self.hLayoutframeBoxPanelIn.addWidget(self.labelDegree)

        self.txtPercent = QLineEdit(self.frameBoxPanelIn)
        self.txtPercent.setEnabled(True)
        font = QFont()
        font.setBold(False)
        font.setWeight(50)
        self.txtPercent.setFont(font)
        self.txtPercent.setObjectName(self.objectName() + "_txtPercent")
        self.txtPercent.setText("0.0")
        self.txtPercent.setMinimumWidth(70)
        self.txtPercent.setMaximumWidth(70)
        self.hLayoutframeBoxPanelIn.addWidget(self.txtPercent)

        self.labelPercent = QLabel(self.frameBoxPanelIn)
        self.labelPercent.setObjectName(("labelPercent"))
        self.labelPercent.setText(" %")
        self.hLayoutframeBoxPanelIn.addWidget(self.labelPercent)

        self.hLayoutframeBoxPanel.addWidget(self.frameBoxPanelIn)

        # self.angleGradientBox = QLineEdit(self.frameBoxPanel)
        # self.angleGradientBox.setEnabled(True)
        # font = QFont()
        # font.setBold(False)
        # font.setWeight(50)
        # self.angleGradientBox.setFont(font)
        # self.angleGradientBox.setObjectName(("angleGradientBox"))
        # self.angleGradientBox.setText("0.0")
        # self.angleGradientBox.setMinimumWidth(70)
        # self.angleGradientBox.setMaximumWidth(70)
        # self.hLayoutframeBoxPanel.addWidget(self.angleGradientBox)

        self.imageButton = QPushButton(self.frameBoxPanel)
        self.imageButton.setText((""))
        icon = QIcon()
        icon.addPixmap(QPixmap(("Resource/convex_hull.png")), QIcon.Normal,
                       QIcon.Off)
        self.imageButton.setIcon(icon)
        self.imageButton.setObjectName(("imageButton"))
        self.imageButton.setVisible(False)
        self.hLayoutframeBoxPanel.addWidget(self.imageButton)

        self.hLayoutBoxPanel.addWidget(self.frameBoxPanel)

        spacerItem = QSpacerItem(0, 0, QSizePolicy.Minimum,
                                 QSizePolicy.Minimum)
        self.hLayoutBoxPanel.addItem(spacerItem)

        self.txtDegree.textChanged.connect(self.txtDegreeChanged)
        self.txtPercent.textChanged.connect(self.txtPercentChanged)
        self.imageButton.clicked.connect(self.imageButtonClicked)

        self.numberResolution = resoution
        str0 = String.Number2String(6.6788, "0.00000")

        self.captionUnits = ""
        self.hidePercentBox()
        self.flag = 0
コード例 #42
0
    def __init__(self, only_promo=False):

        QWidget.__init__(self)
        
        # set up User Interface (widgets, layout...)
        self.setupUi(self)

        handler = WebserviceHandler()
        travel_packs = handler.get_travel_packs()

        ids = []
        origins = []
        destinations = []
        departure_dates = []
        arrival_dates = []
        number_of_rooms = []
        are_promo = []
        self.guest_ages = {}

        for travel_pack in travel_packs:

            if only_promo:

                if travel_pack.isPromo:

                    ids.append(str(travel_pack.id))
                    origins.append(travel_pack.origin)
                    destinations.append(travel_pack.destination)
                    departure_dates.append("%d/%d/%d" % (travel_pack.departureDay, travel_pack.departureMonth, travel_pack.departureYear))
                    arrival_dates.append("%d/%d/%d" % (travel_pack.arrivalDay, travel_pack.arrivalMonth, travel_pack.arrivalYear))
                    number_of_rooms.append(str(travel_pack.numberOfRooms))
                    are_promo.append("yes" if travel_pack.isPromo else "no")
                    self.guest_ages[str(travel_pack.id)] = travel_pack.guestAges

            else:

                ids.append(str(travel_pack.id))
                origins.append(travel_pack.origin)
                destinations.append(travel_pack.destination)
                departure_dates.append("%d/%d/%d" % (travel_pack.departureDay, travel_pack.departureMonth, travel_pack.departureYear))
                arrival_dates.append("%d/%d/%d" % (travel_pack.arrivalDay, travel_pack.arrivalMonth, travel_pack.arrivalYear))
                number_of_rooms.append(str(travel_pack.numberOfRooms))
                are_promo.append("yes" if travel_pack.isPromo else "no")
                self.guest_ages[str(travel_pack.id)] = travel_pack.guestAges


        data = OrderedDict([('id', ids),
                            ('origin', origins), 
                            ('destination', destinations), 
                            ('departure date', departure_dates), 
                            ('arrival date', arrival_dates),
                            ('rooms', number_of_rooms),
                            ("is promo", are_promo)])

        self.table_packs = MyTable(data, len(origins), 7)
        self.vlayout_table_content.addWidget(self.table_packs)

        data = OrderedDict([('id', []),
                            ('origin', []), 
                            ('destination', []), 
                            ('departure date', []), 
                            ('arrival date', []),
                            ('rooms', []),
                            ("is promo", [])])
        self.table_chosen_package = MyTable(data, 0, 7)
        self.vlayout_chosen_package.addWidget(self.table_chosen_package)

        data = OrderedDict([('Guest age', [])])
        self.table_guests = MyTable(data, 0, 1)
        self.vlayout_guest_ages.addWidget(self.table_guests)

        # event handling
        self.button_choose_package.clicked.connect(self.choose_package)
        self.button_remove_package.clicked.connect(self.remove_package)
        self.table_packs.clicked.connect(self.display_ages)
        self.button_buy.clicked.connect(self.buy)
コード例 #43
0
 def __init__(self, parent):
     QWidget.__init__(self)
     self.init(parent)
     self.initShape()
コード例 #44
0
ファイル: oweditdomain.py プロジェクト: tojojames/orange3
 def __init__(self, parent=None):
     QWidget.__init__(self, parent)
     self.setup_gui()
コード例 #45
0
 def __init__(self, parent, name=None):
     QWidget.__init__(self, parent)
     uicLoad("ffado/mixer/globalmixer", self)
     self.setName(name)
コード例 #46
0
    def __init__(self, dataDir="", parent=None):
        QWidget.__init__(self, parent)
        self.renderer = QSvgRenderer(dataDir + "poker.svg")
        self.scene = QGraphicsScene()
        self.chat = QGraphicsSimpleTextItem()
        self.table = QGraphicsSvgItem(dataDir + "poker.svg")
        self.table.setSharedRenderer(self.renderer)
        self.table.setElementId("table")
        self.table.setMatrix(self.renderer.matrixForElement("transform_table"))
        self.scene.addItem(self.chat)
        self.scene.addItem(self.table)
        self.board = []
        for i in range(5):
            card = AnimatedGraphicsSvgItem(dataDir + "svg-cards.svg",
                                           self.table)
            card.setElementId("back")
            parent = self.renderer.matrixForElement("transform_table")
            child = self.renderer.matrixForElement("transform_card%i" % i)
            cardMatrix = child.translate(-parent.dx(), -parent.dy())
            card.setMatrix(cardMatrix)
            #card.setFlag(QGraphicsSvgItem.ItemIsMovable, True)
            card.scale(0.5, 0.5)
            card.hide()
            self.scene.addItem(card)
            self.board.append(card)
        self.seats = []
        self.names = []
        self.moneys = []
        self.bets = []
        for i in range(10):
            seat = SeatItem()

            def seatClickedEvent(seat=i):
                seatClickedCallback = self.seatClicked
                seatClickedCallback(seat)

            seat.event = seatClickedEvent
            seat.setSharedRenderer(self.renderer)
            seat.setElementId("seat")
            seat.setMatrix(
                self.renderer.matrixForElement("transform_seat%i" % i))
            self.scene.addItem(seat)
            self.seats.append(seat)
            name = QGraphicsSimpleTextItem(seat)
            name.setMatrix(self.renderer.matrixForElement("seat_name"))
            self.scene.addItem(name)
            self.names.append(name)
            money = QGraphicsSimpleTextItem(seat)
            money.setMatrix(self.renderer.matrixForElement("seat_money"))
            self.scene.addItem(money)
            self.moneys.append(money)
            bet = QGraphicsSimpleTextItem()
            bet.setMatrix(self.renderer.matrixForElement("transform_bet%i" %
                                                         i))
            self.scene.addItem(bet)
            self.bets.append(bet)
        self.pots = []
        for i in range(9):
            pot = QGraphicsSimpleTextItem()
            pot.setMatrix(self.renderer.matrixForElement("transform_pot%i" %
                                                         i))
            self.scene.addItem(pot)
            self.pots.append(pot)
        self.view = QGraphicsView(self)
        self.view.setScene(self.scene)
        self.view.resize(800, 600)
        self.fold = ActionItem()
        self.fold.setText("fold")
        self.fold.setPos(0, 550)
        self.scene.addItem(self.fold)
        self.fold.event = lambda: self.foldClicked()
        self.check = ActionItem()
        self.check.setText("check")
        self.check.setPos(50, 550)
        self.scene.addItem(self.check)
        self.check.event = lambda: self.checkClicked()
        self.call = ActionItem()
        self.call.setText("call")
        self.call.setPos(100, 550)
        self.scene.addItem(self.call)
        self.call.event = lambda: self.callClicked()
        self.bet = ActionItem()
        self.bet.setText("bet")
        self.bet.setPos(150, 550)
        self.scene.addItem(self.bet)
        self.bet.event = lambda: self.betClicked()
コード例 #47
0
 def __init__(self, parent=None, model=None):
     QWidget.__init__(self, parent)
     localDir = os.path.split(__file__)[0]
     uic.loadUi(os.path.join(localDir, "viewerControls.ui"), self)
コード例 #48
0
ファイル: ui_tools.py プロジェクト: sbellem/ninja-ide
 def __init__(self, parent=None):
     QWidget.__init__(self, parent)
     palette = QPalette(self.palette())
     palette.setColor(palette.Background, Qt.transparent)
     self.setPalette(palette)
コード例 #49
0
ファイル: rme.py プロジェクト: nphilipp/ffado.svn
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        uicLoad("ffado/mixer/rme", self)

        self.init()
コード例 #50
0
 def __init__(self, parent, num):
     QWidget.__init__(self, parent)
     self.setupUi(self)
     self.num = num
     self.initui()
コード例 #51
0
 def __init__(self, parent):
     QWidget.__init__(self, parent)
     self.setupUi(self)
コード例 #52
0
 def __init__(self, parent=None, mainWidget=None):
     QWidget.__init__(self, parent)
     self.parent = parent
     self.mainWidget = mainWidget
     self.create_main_frame()
     self.pcm = None
コード例 #53
0
ファイル: layout_editor.py プロジェクト: OSUser/quickpanel
 def __init__(self, parent):
     QWidget.__init__(self, parent)
     self.name = self.description = ""
     self.setMouseTracking(True)
     self.moving = False
     self.edge = 8
コード例 #54
0
ファイル: fileschart.py プロジェクト: vertrex/DFF
 def __init__(self):
     #super(QWidget, self).__init__()
     QWidget.__init__(self)
     self.setupModel()
     self.setupViews()
コード例 #55
0
ファイル: stackedwidget.py プロジェクト: yisuax11/orange2
 def __init__(self, parent=None, pixmap1=None, pixmap2=None):
     QWidget.__init__(self, parent)
     self.setPixmap(pixmap1)
     self.setPixmap2(pixmap2)
     self.blendingFactor_ = 0.0
     self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
コード例 #56
0
ファイル: GraphCanvas.py プロジェクト: DanielZorin/movepoint
 def __init__(self, parent=None):
     QWidget.__init__(self, parent)
     self.setSizePolicy(QtGui.QSizePolicy.Expanding,
                        QtGui.QSizePolicy.Expanding)
     self.setFocusPolicy(QtCore.Qt.StrongFocus)
コード例 #57
0
    def __init__(self, parent=None):
        self.my_parent = parent
        QWidget.__init__(self, parent)
        self.setupUi(self)
        SaffireMixerBase.__init__(self)

        log.debug("Init large Saffire LE mixer window")

        self.VolumeControls = {
            self.sldIN1Out1: ['/Mixer/LEMix48', 0, 0],
            self.sldIN1Out2: ['/Mixer/LEMix48', 0, 1],
            self.sldIN1Out3: ['/Mixer/LEMix48', 0, 2],
            self.sldIN1Out4: ['/Mixer/LEMix48', 0, 3],
            self.sldIN2Out1: ['/Mixer/LEMix48', 1, 0],
            self.sldIN2Out2: ['/Mixer/LEMix48', 1, 1],
            self.sldIN2Out3: ['/Mixer/LEMix48', 1, 2],
            self.sldIN2Out4: ['/Mixer/LEMix48', 1, 3],
            self.sldIN3Out1: ['/Mixer/LEMix48', 2, 0],
            self.sldIN3Out2: ['/Mixer/LEMix48', 2, 1],
            self.sldIN3Out3: ['/Mixer/LEMix48', 2, 2],
            self.sldIN3Out4: ['/Mixer/LEMix48', 2, 3],
            self.sldIN4Out1: ['/Mixer/LEMix48', 3, 0],
            self.sldIN4Out2: ['/Mixer/LEMix48', 3, 1],
            self.sldIN4Out3: ['/Mixer/LEMix48', 3, 2],
            self.sldIN4Out4: ['/Mixer/LEMix48', 3, 3],
            self.sldSPDIF1Out1: ['/Mixer/LEMix48', 4, 0],
            self.sldSPDIF1Out2: ['/Mixer/LEMix48', 4, 1],
            self.sldSPDIF1Out3: ['/Mixer/LEMix48', 4, 2],
            self.sldSPDIF1Out4: ['/Mixer/LEMix48', 4, 3],
            self.sldSPDIF2Out1: ['/Mixer/LEMix48', 5, 0],
            self.sldSPDIF2Out2: ['/Mixer/LEMix48', 5, 1],
            self.sldSPDIF2Out3: ['/Mixer/LEMix48', 5, 2],
            self.sldSPDIF2Out4: ['/Mixer/LEMix48', 5, 3],
            self.sldPC1Out1: ['/Mixer/LEMix48', 6, 0],
            self.sldPC1Out2: ['/Mixer/LEMix48', 6, 1],
            self.sldPC1Out3: ['/Mixer/LEMix48', 6, 2],
            self.sldPC1Out4: ['/Mixer/LEMix48', 6, 3],
            self.sldPC2Out1: ['/Mixer/LEMix48', 7, 0],
            self.sldPC2Out2: ['/Mixer/LEMix48', 7, 1],
            self.sldPC2Out3: ['/Mixer/LEMix48', 7, 2],
            self.sldPC2Out4: ['/Mixer/LEMix48', 7, 3],
            self.sldPC3Out1: ['/Mixer/LEMix48', 8, 0],
            self.sldPC3Out2: ['/Mixer/LEMix48', 8, 1],
            self.sldPC3Out3: ['/Mixer/LEMix48', 8, 2],
            self.sldPC3Out4: ['/Mixer/LEMix48', 8, 3],
            self.sldPC4Out1: ['/Mixer/LEMix48', 9, 0],
            self.sldPC4Out2: ['/Mixer/LEMix48', 9, 1],
            self.sldPC4Out3: ['/Mixer/LEMix48', 9, 2],
            self.sldPC4Out4: ['/Mixer/LEMix48', 9, 3],
            self.sldPC5Out1: ['/Mixer/LEMix48', 10, 0],
            self.sldPC5Out2: ['/Mixer/LEMix48', 10, 1],
            self.sldPC5Out3: ['/Mixer/LEMix48', 10, 2],
            self.sldPC5Out4: ['/Mixer/LEMix48', 10, 3],
            self.sldPC6Out1: ['/Mixer/LEMix48', 11, 0],
            self.sldPC6Out2: ['/Mixer/LEMix48', 11, 1],
            self.sldPC6Out3: ['/Mixer/LEMix48', 11, 2],
            self.sldPC6Out4: ['/Mixer/LEMix48', 11, 3],
            self.sldPC7Out1: ['/Mixer/LEMix48', 12, 0],
            self.sldPC7Out2: ['/Mixer/LEMix48', 12, 1],
            self.sldPC7Out3: ['/Mixer/LEMix48', 12, 2],
            self.sldPC7Out4: ['/Mixer/LEMix48', 12, 3],
            self.sldPC8Out1: ['/Mixer/LEMix48', 13, 0],
            self.sldPC8Out2: ['/Mixer/LEMix48', 13, 1],
            self.sldPC8Out3: ['/Mixer/LEMix48', 13, 2],
            self.sldPC8Out4: ['/Mixer/LEMix48', 13, 3],
        }

        self.SelectorControls = {
            self.chkOut12Mute: ['/Mixer/Out12Mute'],
            self.chkOut12HwCtrl: ['/Mixer/Out12HwCtrl'],
            self.chkOut34Mute: ['/Mixer/Out34Mute'],
            self.chkOut34HwCtrl: ['/Mixer/Out34HwCtrl'],
            self.chkOut56Mute: ['/Mixer/Out56Mute'],
            self.chkOut56HwCtrl: ['/Mixer/Out56HwCtrl'],
            self.chkSPDIFTransparent: ['/Mixer/SpdifTransparent'],
            self.chkMIDITru: ['/Mixer/MidiThru'],
            self.chkHighGain3: ['/Mixer/HighGainLine3'],
            self.chkHighGain4: ['/Mixer/HighGainLine4'],
        }

        self.VolumeControlsLowRes = {
            self.sldOut12Level: ['/Mixer/Out12Level'],
            self.sldOut34Level: ['/Mixer/Out34Level'],
            self.sldOut56Level: ['/Mixer/Out56Level'],
        }

        self.TriggerButtonControls = {
            self.btnSaveSettings: ['/Mixer/SaveSettings'],
        }

        self.TextControls = {}

        self.saveTextControls = {}

        self.ComboControls = {}
コード例 #58
0
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        """ Groups of ui commonents """
        self.error_lcds = [
            self.ui.rdoutBaseErrors, self.ui.rdoutShoulderErrors,
            self.ui.rdoutElbowErrors, self.ui.rdoutWristErrors,
            self.ui.rdoutWrist2Errors, self.ui.rdoutWrist3Errors
        ]
        self.joint_readouts = [
            self.ui.rdoutBaseJC, self.ui.rdoutShoulderJC, self.ui.rdoutElbowJC,
            self.ui.rdoutWristJC, self.ui.rdoutWrist2JC, self.ui.rdoutWrist3JC
        ]
        self.joint_slider_rdouts = [
            self.ui.rdoutBase, self.ui.rdoutShoulder, self.ui.rdoutElbow,
            self.ui.rdoutWrist, self.ui.rdoutWrist2, self.ui.rdoutWrist3
        ]
        self.joint_sliders = [
            self.ui.sldrBase, self.ui.sldrShoulder, self.ui.sldrElbow,
            self.ui.sldrWrist, self.ui.sldrWrist2, self.ui.sldrWrist3
        ]
        """Objects Using Other Classes"""
        self.kinect = Kinect()
        self.rexarm = Rexarm()
        self.tp = TrajectoryPlanner(self.rexarm)
        self.sm = StateMachine(self.rexarm, self.tp, self.kinect)
        self.sm.is_logging = False
        """
        Attach Functions to Buttons & Sliders
        TODO: NAME AND CONNECT BUTTONS AS NEEDED
        """
        # Video
        self.ui.videoDisplay.setMouseTracking(True)
        self.ui.videoDisplay.mouseMoveEvent = self.trackMouse
        self.ui.videoDisplay.mousePressEvent = self.calibrateMousePress
        # Buttons
        # Handy lambda function that can be used with Partial to only set the new state if the rexarm is initialized
        nxt_if_arm_init = lambda next_state: self.sm.set_next_state(
            next_state if self.rexarm.initialized else None)
        self.ui.btn_estop.clicked.connect(self.estop)
        self.ui.btn_init_arm.clicked.connect(self.initRexarm)
        self.ui.btnUser1.setText("Calibrate")
        self.ui.btnUser1.clicked.connect(partial(nxt_if_arm_init, 'calibrate'))
        ##OUR_CODE
        self.ui.btn_exec.clicked.connect(self.execute)
        self.ui.btnUser2.clicked.connect(self.record)
        self.ui.btnUser3.clicked.connect(self.playback)
        self.ui.btnUser4.clicked.connect(self.execute_tp)
        self.ui.btnUser5.clicked.connect(self.toggle_logging)
        self.ui.btnUser1.clicked.connect(self.calibrate)
        self.ui.btnUser6.clicked.connect(self.blockDetect)
        self.ui.btnUser7.clicked.connect(self.openGripper)
        self.ui.btnUser8.clicked.connect(self.closeGripper)
        self.ui.btnUser9.clicked.connect(self.clickGrab)
        # Sliders
        for sldr in self.joint_sliders:
            sldr.valueChanged.connect(self.sliderChange)
        self.ui.sldrMaxTorque.valueChanged.connect(self.sliderChange)
        self.ui.sldrSpeed.valueChanged.connect(self.sliderChange)
        # Direct Control
        self.ui.chk_directcontrol.stateChanged.connect(self.directControlChk)
        # Status
        self.ui.rdoutStatus.setText("Waiting for input")
        # Auto exposure
        self.ui.chkAutoExposure.stateChanged.connect(self.autoExposureChk)
        """initalize manual control off"""
        self.ui.SliderFrame.setEnabled(False)
        """Setup Threads"""
        # Rexarm runs its own thread

        # Video
        self.videoThread = VideoThread(self.kinect)
        self.videoThread.updateFrame.connect(self.setImage)
        self.videoThread.start()

        # State machine
        self.logicThread = LogicThread(self.sm)
        self.logicThread.start()

        # Display
        self.displayThread = DisplayThread(self.rexarm, self.sm)
        self.displayThread.updateJointReadout.connect(self.updateJointReadout)
        self.displayThread.updateEndEffectorReadout.connect(
            self.updateEndEffectorReadout)
        self.displayThread.updateStatusMessage.connect(
            self.updateStatusMessage)
        self.displayThread.updateJointErrors.connect(self.updateJointErrors)
        self.displayThread.start()
コード例 #59
0
    def __init__(self, parent=None):
        self.my_parent = parent
        QWidget.__init__(self, parent)
        self.setupUi(self)
        SaffireMixerBase.__init__(self)
        QObject.connect(self.btnRefresh, SIGNAL('clicked()'),
                        self.updateValues)
        QObject.connect(self.btnSwitchStereoMode, SIGNAL('clicked()'),
                        self.switchStereoMode)

        self.VolumeControls = {
            self.sldIN1Out910: ['/Mixer/MatrixMixerMono', 0, 0],
            self.sldIN1Out12: ['/Mixer/MatrixMixerMono', 0, 1],
            self.sldIN1Out34: ['/Mixer/MatrixMixerMono', 0, 2],
            self.sldIN1Out56: ['/Mixer/MatrixMixerMono', 0, 3],
            self.sldIN1Out78: ['/Mixer/MatrixMixerMono', 0, 4],
            self.sldIN3Out910: ['/Mixer/MatrixMixerMono', 1, 0],
            self.sldIN3Out12: ['/Mixer/MatrixMixerMono', 1, 1],
            self.sldIN3Out34: ['/Mixer/MatrixMixerMono', 1, 2],
            self.sldIN3Out56: ['/Mixer/MatrixMixerMono', 1, 3],
            self.sldIN3Out78: ['/Mixer/MatrixMixerMono', 1, 4],
            self.sldFX1Out910: ['/Mixer/MatrixMixerMono', 2, 0],
            self.sldFX1Out12: ['/Mixer/MatrixMixerMono', 2, 1],
            self.sldFX1Out34: ['/Mixer/MatrixMixerMono', 2, 2],
            self.sldFX1Out56: ['/Mixer/MatrixMixerMono', 2, 3],
            self.sldFX1Out78: ['/Mixer/MatrixMixerMono', 2, 4],
            self.sldIN2Out910: ['/Mixer/MatrixMixerMono', 3, 0],
            self.sldIN2Out12: ['/Mixer/MatrixMixerMono', 3, 1],
            self.sldIN2Out34: ['/Mixer/MatrixMixerMono', 3, 2],
            self.sldIN2Out56: ['/Mixer/MatrixMixerMono', 3, 3],
            self.sldIN2Out78: ['/Mixer/MatrixMixerMono', 3, 4],
            self.sldIN4Out910: ['/Mixer/MatrixMixerMono', 4, 0],
            self.sldIN4Out12: ['/Mixer/MatrixMixerMono', 4, 1],
            self.sldIN4Out34: ['/Mixer/MatrixMixerMono', 4, 2],
            self.sldIN4Out56: ['/Mixer/MatrixMixerMono', 4, 3],
            self.sldIN4Out78: ['/Mixer/MatrixMixerMono', 4, 4],
            self.sldFX2Out910: ['/Mixer/MatrixMixerMono', 5, 0],
            self.sldFX2Out12: ['/Mixer/MatrixMixerMono', 5, 1],
            self.sldFX2Out34: ['/Mixer/MatrixMixerMono', 5, 2],
            self.sldFX2Out56: ['/Mixer/MatrixMixerMono', 5, 3],
            self.sldFX2Out78: ['/Mixer/MatrixMixerMono', 5, 4],
            self.sldPC910Out910: ['/Mixer/MatrixMixerMono', 6, 0],
            self.sldPC910Out12: ['/Mixer/MatrixMixerMono', 6, 1],
            self.sldPC910Out34: ['/Mixer/MatrixMixerMono', 6, 2],
            self.sldPC910Out56: ['/Mixer/MatrixMixerMono', 6, 3],
            self.sldPC910Out78: ['/Mixer/MatrixMixerMono', 6, 4],
            self.sldPC12Out910: ['/Mixer/MatrixMixerMono', 7, 0],
            self.sldPC12Out12: ['/Mixer/MatrixMixerMono', 7, 1],
            self.sldPC12Out34: ['/Mixer/MatrixMixerMono', 7, 2],
            self.sldPC12Out56: ['/Mixer/MatrixMixerMono', 7, 3],
            self.sldPC12Out78: ['/Mixer/MatrixMixerMono', 7, 4],
            self.sldPC34Out910: ['/Mixer/MatrixMixerMono', 8, 0],
            self.sldPC34Out12: ['/Mixer/MatrixMixerMono', 8, 1],
            self.sldPC34Out34: ['/Mixer/MatrixMixerMono', 8, 2],
            self.sldPC34Out56: ['/Mixer/MatrixMixerMono', 8, 3],
            self.sldPC34Out78: ['/Mixer/MatrixMixerMono', 8, 4],
            self.sldPC56Out910: ['/Mixer/MatrixMixerMono', 9, 0],
            self.sldPC56Out12: ['/Mixer/MatrixMixerMono', 9, 1],
            self.sldPC56Out34: ['/Mixer/MatrixMixerMono', 9, 2],
            self.sldPC56Out56: ['/Mixer/MatrixMixerMono', 9, 3],
            self.sldPC56Out78: ['/Mixer/MatrixMixerMono', 9, 4],
            self.sldPC78Out910: ['/Mixer/MatrixMixerMono', 10, 0],
            self.sldPC78Out12: ['/Mixer/MatrixMixerMono', 10, 1],
            self.sldPC78Out34: ['/Mixer/MatrixMixerMono', 10, 2],
            self.sldPC78Out56: ['/Mixer/MatrixMixerMono', 10, 3],
            self.sldPC78Out78: ['/Mixer/MatrixMixerMono', 10, 4],
        }

        # First column is the DBUS subpath of the control.
        # Second column is a list of linked controls that should
        # be rewritten whenever this control is updated
        self.SelectorControls = {
            self.chkSpdifSwitch: ['/Mixer/SpdifSwitch'],
            self.chkOut12Mute: ['/Mixer/Out12Mute', [self.chkOut12HwCtrl]],
            self.chkOut12HwCtrl: ['/Mixer/Out12HwCtrl'],
            self.chkOut12Dim: ['/Mixer/Out12Dim'],
            self.chkOut34Mute: ['/Mixer/Out34Mute', [self.chkOut34HwCtrl]],
            self.chkOut34HwCtrl: ['/Mixer/Out34HwCtrl'],
            self.chkOut56Mute: ['/Mixer/Out56Mute', [self.chkOut56HwCtrl]],
            self.chkOut56HwCtrl: ['/Mixer/Out56HwCtrl'],
            self.chkOut78Mute: ['/Mixer/Out78Mute', [self.chkOut78HwCtrl]],
            self.chkOut78HwCtrl: ['/Mixer/Out78HwCtrl'],
            self.chkOut910Mute: ['/Mixer/Out910Mute'],
        }

        self.VolumeControlsLowRes = {
            self.sldOut12Level: ['/Mixer/Out12Level'],
            self.sldOut34Level: ['/Mixer/Out34Level'],
            self.sldOut56Level: ['/Mixer/Out56Level'],
            self.sldOut78Level: ['/Mixer/Out78Level'],
        }

        self.TriggerButtonControls = {
            self.btnSaveSettings: ['/Mixer/SaveSettings'],
        }

        self.TextControls = {}

        self.saveTextControls = {}

        self.ComboControls = {}
コード例 #60
0
 def __init__(self):
     QWidget.__init__(self)