コード例 #1
0
ファイル: acercade.py プロジェクト: emilianox/Fragmentos
 def __init__(self):
     FILENAME = 'uis/wAcercaDe.ui'
     QtGui.QMainWindow.__init__(self)
 #cargamos la interfaz desde el archivo .ui
     uifile = os.path.join(os.path.abspath(os.path.dirname(__file__)),FILENAME)
     uic.loadUi(uifile, self)    
     self.__centerOnScreen()
コード例 #2
0
ファイル: browser.py プロジェクト: dmych/Qreole
    def __init__(self, notesPath, curDir, parent=None):
	QDialog.__init__(self)
	uic.loadUi("browser.ui", self)
	self.setWindowTitle('Wiki Browser')
	self.parent = parent
	self.buttonOpen = QPushButton("&Open file");
	self.buttonOpen.setDefault(True)
	self.buttonNewFile = QPushButton("&New file");
	self.buttonNewFolder = QPushButton("New &folder");
	self.buttonDelete = QPushButton("&Remove");
	self.buttonClose = QPushButton("&Close");
	self.buttonBox.addButton(self.buttonOpen, QDialogButtonBox.AcceptRole)
	self.buttonBox.addButton(self.buttonNewFile, QDialogButtonBox.ActionRole)
	self.buttonBox.addButton(self.buttonNewFolder, QDialogButtonBox.ActionRole)
	self.buttonBox.addButton(self.buttonDelete, QDialogButtonBox.ActionRole)
	self.buttonBox.addButton(self.buttonClose, QDialogButtonBox.RejectRole)
	self.connect(self.buttonBox, SIGNAL("accepted()"), self, SLOT("accept()"))
	self.connect(self.buttonBox, SIGNAL("rejected()"), self, SLOT("reject()"))
	self.notesPath = notesPath
	self.model = QFileSystemModel()
	self.model.setRootPath(notesPath)
	self.model.setNameFilters(['*.txt'])
	self.model.setNameFilterDisables(False)
	self.treeView.setModel(self.model)
	self.treeView.setRootIndex(self.model.index(notesPath))
	self.treeView.header().setResizeMode(QHeaderView.ResizeToContents)
	self.treeView.setExpandsOnDoubleClick(True)
	self.connect(self.treeView, SIGNAL("doubleClicked(const QModelIndex&)"), self.doubleClick)
	self.connect(self.buttonNewFolder, SIGNAL("clicked()"), self.mkDir)
	self.connect(self.buttonDelete, SIGNAL("clicked()"), self.rmDir)
	self.connect(self.buttonNewFile, SIGNAL("clicked()"), self.newNote)
	print 'NOTES DIR:', notesPath
	print 'CUR DIR:', curDir
	self.selectItem(curDir)
コード例 #3
0
ファイル: PMT_CONTROL.py プロジェクト: CampbellGroup/Qsim
 def __init__(self, reactor, parent=None):
     super(pmtWidget, self).__init__(parent)
     self.reactor = reactor
     basepath =  os.path.dirname(__file__)
     path = os.path.join(basepath, "pmtfrontend.ui")
     uic.loadUi(path,self)
     self.connect()
コード例 #4
0
ファイル: aboutdialog.py プロジェクト: jessedsmith/Arcte
    def __init__(self,mainDirectory,parent=None):
        super(AboutWin,self).__init__(parent)

        uic.loadUi('about.ui',self)
        
        self.verticalLayout_3.addStretch()
        self.buttonBox.accepted.connect(self.ACCEPT)
コード例 #5
0
ファイル: spectrax.py プロジェクト: limu007/Charlay
    def __init__(self, nx=3,ny=3,r=30,*args,**kwargs):
        from PyQt4 import uic
        QtGui.QWidget.__init__(self, *args)
        uic.loadUi(rc.inst_dir+"scanning.ui", self)
        self.setWindowTitle('Scanning sample')
        self.xsize.setValue(nx)
        self.ysize.setValue(ny)
        if 'polar' in kwargs:
            self.ystep.setSingleStep(5)
            self.xstep.setValue(rc.rad_step)
            self.ystep.setValue(rc.theta_step)
            self.ch_centerf.setChecked(1)
            self.ch_anal.setChecked(rc.scan_start_analysis)
            rc.ystepsize=1.
        else:
            if r>0: self.ch_circle.setChecked(1)
            self.xstep.setValue(rc.cart_step)
            self.ystep.setValue(rc.cart_step)
            self.xsize.setSingleStep(2)
            self.ysize.setSingleStep(2)
        self.ch_return.setChecked(rc.scan_home_ret)
        if 'oname' in kwargs: self.outname.setText(kwargs['oname'])
        elif len(self.outname.text())==0: self.buttonBox.buttons()[0].setDisabled(1)
        self.radius.setValue(r)
        self.radius.setSingleStep(10)
        if rc.scan_axes_order==1 : self.ch_swap.setChecked(1)
        self.connect(self.outname, QtCore.SIGNAL("editingFinished()"),self.can_start)
#        self.connect(self.outname, QtCore.SIGNAL("textChanged()"),self.can_start)
        if 'parent' in kwargs: self.parent=kwargs['parent']
コード例 #6
0
 def main(self):
     self.mainui = uic.loadUi(maingui)
     self.configui = uic.loadUi(configui)
     
     self.mainui.show()
     
     ## main gui actions ##
     self.mainui.lcdNumber.value = int(self.timerCountDown) * 60
     
     self.connect(self.mainui.resetTimerButton,
                  QtCore.SIGNAL("clicked()"),
                  self.resetDisplay)
     self.connect(self.mainui.startTimerButton,
                  QtCore.SIGNAL("clicked()"),
                  self.startAction)
     self.connect(self.mainui.configureButton,
                  QtCore.SIGNAL("clicked()"),
                  self.configui.show)
     self.connect(self.configui.saveButton,
                  QtCore.SIGNAL("clicked()"),
                  self.configureSettings)
     self.connect(self.configui.chooseFileButton,
                  QtCore.SIGNAL("clicked()"),
                  self.chooseFile)
     
     self.mainui.lcdNumber.value = int(self.timerCountDown) * 60
     self.mainui.lcdNumber.display(self.mainui.lcdNumber.value)
     
     self.configui.testDirLineEdit.text = self.testDirectory
コード例 #7
0
ファイル: statisticsview.py プロジェクト: abalijepalli/mosaic
	def __init__(self, parent = None):
		self.v=[]

		super(StatisticsWindow, self).__init__(parent)

		# uic.loadUi(os.path.join(os.path.dirname(os.path.abspath(__file__)),"statisticsview.ui"), self)
		uic.loadUi(resource_path("statisticsview.ui"), self)
		
		self._positionWindow()

		self.idleTimer=QtCore.QTimer()
		self.idleTimer.start(3000)

		self.queryString="select AbsEventStart from metadata where ProcessingStatus='normal' order by AbsEventStart ASC"
		self.queryData=[]
		self.totalEvents=0
		self.elapsedTime=0.0

		self.qWorker=None
		self.qThread=QtCore.QThread()

		# Set QLabel properties
		self.neventsLabel.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
		self.errorrateLabel.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
		self.caprateLabel.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
コード例 #8
0
ファイル: searchwidget.py プロジェクト: rolandschulz/enki
    def __init__(self, plugin):
        QFrame.__init__(self, core.workspace())
        self._mode = None
        self.plugin = plugin
        from PyQt4 import uic  # lazy import for better startup performance

        uic.loadUi(os.path.join(os.path.dirname(__file__), "SearchWidget.ui"), self)

        self.cbSearch.setCompleter(None)
        self.cbReplace.setCompleter(None)
        self.cbMask.setCompleter(None)

        self.fsModel = QDirModel(self.cbPath.lineEdit())
        self.fsModel.setFilter(QDir.AllDirs | QDir.NoDotAndDotDot)
        self.cbPath.lineEdit().setCompleter(QCompleter(self.fsModel, self.cbPath.lineEdit()))
        # TODO QDirModel is deprecated but QCompleter does not yet handle
        # QFileSystemodel - please update when possible."""
        self.cbSearch.setCompleter(None)
        self.pbSearchStop.setVisible(False)
        self.pbReplaceCheckedStop.setVisible(False)

        self._progress = QProgressBar(self)
        self._progress.setAlignment(Qt.AlignCenter)
        self._progress.setToolTip(self.tr("Search in progress..."))
        self._progress.setMaximumSize(QSize(80, 16))
        core.mainWindow().statusBar().insertPermanentWidget(1, self._progress)
        self._progress.setVisible(False)

        # cd up action
        self.tbCdUp = QToolButton(self.cbPath.lineEdit())
        self.tbCdUp.setIcon(QIcon(":/enkiicons/go-up.png"))
        self.tbCdUp.setCursor(Qt.ArrowCursor)
        self.tbCdUp.installEventFilter(self)  # for drawing button

        self.cbSearch.installEventFilter(self)  # for catching Tab and Shift+Tab
        self.cbReplace.installEventFilter(self)  # for catching Tab and Shift+Tab
        self.cbPath.installEventFilter(self)  # for catching Tab and Shift+Tab
        self.cbMask.installEventFilter(self)  # for catching Tab and Shift+Tab

        self._closeShortcut = QShortcut(QKeySequence("Esc"), self)
        self._closeShortcut.setContext(Qt.WidgetWithChildrenShortcut)
        self._closeShortcut.activated.connect(self.hide)

        # connections
        self.cbSearch.lineEdit().textChanged.connect(self._onSearchRegExpChanged)

        self.cbSearch.lineEdit().returnPressed.connect(self._onReturnPressed)
        self.cbReplace.lineEdit().returnPressed.connect(self._onReturnPressed)
        self.cbPath.lineEdit().returnPressed.connect(self._onReturnPressed)
        self.cbMask.lineEdit().returnPressed.connect(self._onReturnPressed)

        self.cbRegularExpression.stateChanged.connect(self._onSearchRegExpChanged)
        self.cbCaseSensitive.stateChanged.connect(self._onSearchRegExpChanged)

        self.tbCdUp.clicked.connect(self._onCdUpPressed)

        core.mainWindow().hideAllWindows.connect(self.hide)
        core.workspace().currentDocumentChanged.connect(
            lambda old, new: self.setVisible(self.isVisible() and new is not None)
        )
コード例 #9
0
 def __init__(self, obj = None, prop = None):
     "Initializes, optionally with an object name and a material property name to edit"
     QtGui.QDialog.__init__(self)
     self.obj = obj
     self.prop = prop
     self.customprops = []
     # load the UI file from the same directory as this script
     uic.loadUi(os.path.dirname(__file__)+os.sep+"materials-editor.ui",self)
     self.ui = self
     # additional UI fixes and tweaks
     self.ButtonURL.setIcon(QtGui.QIcon(":/icons/internet-web-browser.svg"))
     self.ButtonDeleteProperty.setEnabled(False)
     self.standardButtons.button(QtGui.QDialogButtonBox.Ok).setAutoDefault(False)
     self.standardButtons.button(QtGui.QDialogButtonBox.Cancel).setAutoDefault(False)
     self.updateCards()
     self.Editor.header().resizeSection(0,200)
     self.Editor.expandAll()
     self.Editor.setFocus()
     # TODO allow to enter a custom property by pressing Enter in the lineedit (currently closes the dialog)
     self.Editor.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
     QtCore.QObject.connect(self.ComboMaterial, QtCore.SIGNAL("currentIndexChanged(QString)"), self.updateContents)
     QtCore.QObject.connect(self.ButtonURL, QtCore.SIGNAL("clicked()"), self.openProductURL)
     QtCore.QObject.connect(self.standardButtons, QtCore.SIGNAL("accepted()"), self.accept)
     QtCore.QObject.connect(self.standardButtons, QtCore.SIGNAL("rejected()"), self.reject)
     QtCore.QObject.connect(self.ButtonAddProperty, QtCore.SIGNAL("clicked()"), self.addCustomProperty)
     QtCore.QObject.connect(self.EditProperty, QtCore.SIGNAL("returnPressed()"), self.addCustomProperty)
     QtCore.QObject.connect(self.ButtonDeleteProperty, QtCore.SIGNAL("clicked()"), self.deleteCustomProperty)
     QtCore.QObject.connect(self.Editor, QtCore.SIGNAL("itemDoubleClicked(QTreeWidgetItem*,int)"), self.itemClicked)
     QtCore.QObject.connect(self.Editor, QtCore.SIGNAL("currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)"), self.checkDeletable)
     QtCore.QObject.connect(self.ButtonOpen, QtCore.SIGNAL("clicked()"), self.openfile)
     QtCore.QObject.connect(self.ButtonSave, QtCore.SIGNAL("clicked()"), self.savefile)
     # update the editor with the contents of the property, if we have one
     if self.prop and self.obj:
         d = FreeCAD.ActiveDocument.getObject(self.obj).getPropertyByName(self.prop)
         self.updateContents(d)
コード例 #10
0
    def __init__(self, MainWin_Link, status_id, Status_Window_Link):
        QtGui.QWidget.__init__(self)
        uic.loadUi("ui/Order_Status_Edit_ui.ui", self)

        self.setWindowFlags(QtCore.Qt.WindowTitleHint)

        # Link to Main Form
        self.MainWin_Link = MainWin_Link
        # Link to Zone Window
        self.Status_Window_Link = Status_Window_Link

        # Database Zone ID
        self.status_id = status_id

        # Signal handlers
        self.btn_Save_and_Exit.clicked.connect(self.Save_And_Close)
        self.btn_Exit.clicked.connect(self.close_tab)

        # Hotkeys
        self.enterHotkey, self.escHotkey = QtGui.QAction(self), QtGui.QAction(self)

        self.enterHotkey.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Return))
        self.escHotkey.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Escape))

        self.enterHotkey.triggered.connect(self.Save_And_Close)
        self.escHotkey.triggered.connect(self.close_tab)

        self.addAction(self.enterHotkey)
        self.addAction(self.escHotkey)

        self.initialize()
コード例 #11
0
    def initCentralUic(self):
        """
        Load the GUI from the ui file into this class and connect it with event handlers.
        """
        # Load the ui file into this class (find it in our own directory)
        localDir = os.path.split(__file__)[0]
        uic.loadUi(localDir+"/dataExport.ui", self)

        self.batchOutputTableWidget.resizeRowsToContents()
        self.batchOutputTableWidget.resizeColumnsToContents()
        self.batchOutputTableWidget.setAlternatingRowColors(True)
        self.batchOutputTableWidget.setShowGrid(False)
        self.batchOutputTableWidget.horizontalHeader().setResizeMode(0, QHeaderView.Interactive)
        
        self.batchOutputTableWidget.horizontalHeader().resizeSection(Column.Dataset, 200)
        self.batchOutputTableWidget.horizontalHeader().resizeSection(Column.ExportLocation, 250)
        self.batchOutputTableWidget.horizontalHeader().resizeSection(Column.Action, 100)

        self.batchOutputTableWidget.verticalHeader().hide()

        # Set up handlers
        self.batchOutputTableWidget.itemSelectionChanged.connect(self.handleTableSelectionChange)

        # Set up the viewer area
        self.initViewerStack()
        self.splitter.setSizes([150, 850])
コード例 #12
0
    def __init__(self, title,channelNames, levelRange,tiltRange, parent=None):
        QtGui.QWidget.__init__(self, parent)
        basepath = os.environ.get('LABRADPATH',None)
        if not basepath:
            raise Exception('Please set your LABRADPATH environment variable')
        path = os.path.join(basepath,'lattice/clients/qtui/leveltiltslidernew.ui')
        uic.loadUi(path,self)
        self.title.setText(title)
        self.labelLeft.setText(channelNames[0])
        self.labelRight.setText(channelNames[1])
        self.levelRange = levelRange
        #connect functions
    	self.sliderLevel.valueChanged.connect(self.sliderChanged)
    	self.sliderTilt.valueChanged.connect(self.sliderChanged)
    	self.spinLevel.valueChanged.connect(self.spinChanged)
    	self.spinTilt.valueChanged.connect(self.spinChanged)
        self.valueLeft.valueChanged.connect(self.lcdChanged)
        self.valueRight.valueChanged.connect(self.lcdChanged)
	#set widget properties
    	self.spinLevel.setRange(*levelRange)
    	self.sliderLevel.setRange(100*levelRange[0],100*levelRange[1])
    	self.spinTilt.setRange(*tiltRange)
    	self.sliderTilt.setRange(100.*tiltRange[0],100.*tiltRange[1])
    	self.valueLeft.setRange(*levelRange)
    	self.valueRight.setRange(*levelRange)
	#set LCDs initially
        self.spinChanged() 
コード例 #13
0
    def _initUi(self):
        # Load the ui file into this class (find it in our own directory)
        localDir = os.path.split(__file__)[0]
        uiFilePath = os.path.join( localDir, 'bodySplitInfoWidget.ui' )
        uic.loadUi(uiFilePath, self)
        
        self.setWindowTitle("Body Split Info")
        
        self.bodyTreeWidget.setHeaderLabels( ['Body ID', 'Progress', ''] )
        self.bodyTreeWidget.header().setResizeMode( QHeaderView.ResizeToContents )
        self.bodyTreeWidget.header().setStretchLastSection(False)
        self.bodyTreeWidget.itemDoubleClicked.connect( self._handleBodyTreeDoubleClick )
        self.bodyTreeWidget.setExpandsOnDoubleClick(False) # We want to use double-click for auto-navigation
        
        
        self.annotationTableWidget.setColumnCount(3)
        self._initAnnotationTableHeader()
        self.annotationTableWidget.itemDoubleClicked.connect( self._handleAnnotationDoubleClick )
        self.annotationTableWidget.setSelectionBehavior( QTableView.SelectRows )
        self.annotationTableWidget.horizontalHeader().setResizeMode( QHeaderView.ResizeToContents )
        
        self.loadSplitAnnoationFileButton.pressed.connect( self._loadNewAnnotationFile )
        self.loadSplitAnnoationFileButton.setIcon( QIcon(ilastikIcons.Open) )

        self.refreshButton.pressed.connect( self._refreshAnnotations )
        self.refreshButton.setIcon( QIcon(ilastikIcons.Refresh) )
コード例 #14
0
ファイル: assetpage.py プロジェクト: kazcw/NGCCCBase
    def __init__(self, parent):
        QtGui.QDialog.__init__(self, parent)
        uic.loadUi(uic.getUiPath('addassetdialog.ui'), self)

        for wname in ['edtMoniker', 'edtColorDesc', 'edtUnit']:
            getattr(self, wname).focusInEvent = \
                lambda e, name=wname: getattr(self, name).setStyleSheet('')
コード例 #15
0
    def __init__(self, parent, opDataExport):
        """
        Constructor.
        
        :param parent: The parent widget
        :param opDataExport: The operator to configure.  The operator is manipulated LIVE, so supply a 
                             temporary operator that can be discarded in case the user clicked 'cancel'.
                             If the user clicks 'OK', then copy the slot settings from the temporary op to your real one.
        """
        global _has_lazyflow
        assert _has_lazyflow, "This widget requires lazyflow."
        super( DataExportOptionsDlg, self ).__init__(parent)
        uic.loadUi( os.path.splitext(__file__)[0] + '.ui', self )

        self._opDataExport = opDataExport
        assert isinstance( opDataExport, ExportOperatorABC ), \
            "Cannot use {} as an export operator.  "\
            "It doesn't match the required interface".format( type(opDataExport) )

        self._okay_conditions = {}

        # Connect the 'transaction slot'.
        # All slot changes will occur immediately
        opDataExport.TransactionSlot.setValue(True)

        # Init child widgets
        self._initMetaInfoWidgets()
        self._initSubregionWidget()
        self._initDtypeConversionWidgets()
        self._initRenormalizationWidgets()
        self._initAxisOrderWidgets()
        self._initFileOptionsWidget()

        # See self.eventFilter()
        self.installEventFilter(self)
コード例 #16
0
ファイル: integrate_ui.py プロジェクト: amundhov/pyFAI
    def __init__(self, input_data=None):
        self.ai = pyFAI.AzimuthalIntegrator()
        self.input_data = input_data
        self._sem = threading.Semaphore()
        QtGui.QWidget.__init__(self)
        uic.loadUi('integration.ui', self)
        self.all_detectors = pyFAI.detectors.ALL_DETECTORS.keys()
        self.all_detectors.sort()
        self.detector.addItems([i.capitalize() for i in self.all_detectors])
        self.detector.setCurrentIndex(self.all_detectors.index("detector"))
        #connect file selection windows
        self.connect(self.file_poni, SIGNAL("clicked()"), self.select_ponifile)
        self.connect(self.file_splinefile, SIGNAL("clicked()"), self.select_splinefile)
        self.connect(self.file_mask_file, SIGNAL("clicked()"), self.select_maskfile)
        self.connect(self.file_dark_current, SIGNAL("clicked()"), self.select_darkcurrent)
        self.connect(self.file_flat_field, SIGNAL("clicked()"), self.select_flatfield)
        # connect button bar
        self.okButton = self.buttonBox.button(QtGui.QDialogButtonBox.Ok)
        self.saveButton = self.buttonBox.button(QtGui.QDialogButtonBox.Save)
        self.resetButton = self.buttonBox.button(QtGui.QDialogButtonBox.Reset)
        self.connect(self.okButton, SIGNAL("clicked()"), self.proceed)
        self.connect(self.saveButton, SIGNAL("clicked()"), self.dump)
        self.connect(self.buttonBox, SIGNAL("helpRequested()"), self.help)
        self.connect(self.buttonBox, SIGNAL("rejected()"), self.die)
        self.connect(self.resetButton, SIGNAL("clicked()"), self.restore)

        self.connect(self.detector, SIGNAL("currentIndexChanged(int)"), self.detector_changed)
        self.connect(self.do_OpenCL, SIGNAL("clicked()"), self.openCL_changed)
        self.connect(self.platform, SIGNAL("currentIndexChanged(int)"), self.platform_changed)

        self.restore()
        self.progressBar.setValue(0)
コード例 #17
0
ファイル: uisettings.py プロジェクト: polovik/enki
    def __init__(self, parent):
        QDialog.__init__(self, parent)
        self._createdObjects = []
        self._pageForItem = {}

        from PyQt4 import uic  # lazy import for better startup performance
        uic.loadUi(os.path.join(DATA_FILES_PATH, 'ui/UISettings.ui'), self)
        self.swPages.setCurrentIndex(0)
        
        self.setAttribute( Qt.WA_DeleteOnClose )

        # Expand all tree widget items
        self._pageForItem.update (  {u"General": self.pGeneral,
                                     u"File associations": self.pAssociations,
                                     u"Editor": self.pEditorGeneral,
                                     u"Editor/Auto completion": self.pAutoCompletion,
                                     u"Editor/Colours": self.pColours,
                                     u"Editor/Indentation": self.pIndentation,
                                     u"Editor/Brace matching": self.pBraceMatching,
                                     u"Editor/Edge": self.pEdgeMode,
                                     u"Editor/Caret": self.pCaret,
                                     u"Editor/EOL": self.pEditorVisibility,
                                     u"Modes": self.pModes})
        
        # resize to minimum size
        self.resize( self.sizeHint() )
コード例 #18
0
ファイル: kde_ui.py プロジェクト: AlfredArouna/ubiquity
    def excepthook(self, exctype, excvalue, exctb):
        """Crash handler."""

        if (issubclass(exctype, KeyboardInterrupt) or
            issubclass(exctype, SystemExit)):
            return

        tbtext = ''.join(traceback.format_exception(exctype, excvalue, exctb))
        syslog.syslog(syslog.LOG_ERR,
                      "Exception in KDE frontend (invoking crash handler):")
        for line in tbtext.split('\n'):
            syslog.syslog(syslog.LOG_ERR, line)
        print >>sys.stderr, ("Exception in KDE frontend"
                             " (invoking crash handler):")
        print >>sys.stderr, tbtext

        self.post_mortem(exctype, excvalue, exctb)

        if os.path.exists('/usr/share/apport/apport-qt'):
            self.previous_excepthook(exctype, excvalue, exctb)
        else:
            dialog = QDialog(self.ui)
            uic.loadUi("%s/crashdialog.ui" % UIDIR, dialog)
            dialog.beastie_url.setOpenExternalLinks(True)
            dialog.crash_detail.setText(tbtext)
            dialog.exec_()
            sys.exit(1)
コード例 #19
0
ファイル: kde_ui.py プロジェクト: AlfredArouna/ubiquity
    def __init__(self, parent = None):
        QMainWindow.__init__(self, parent)
        uic.loadUi(os.path.join(UIDIR, "app.ui"), self)

        distro_name = "Kubuntu"
        distro_release = ""

        ## setup the release and codename
        fp = open("/etc/lsb-release", 'r')

        for line in fp:
            if "DISTRIB_ID=" in line:
                name = str.strip(line.split("=")[1], '\n')
                if name != "Ubuntu":
                    distro_name = name
            elif "DISTRIB_RELEASE=" in line:
                distro_release = str.strip(line.split("=")[1], '\n')

        fp.close()

        self.distro_name_label.setText(distro_name)
        self.distro_release_label.setText(distro_release)

        self.minimize_button.clicked.connect(self.showMinimized)

        self.setWindowTitle("%s %s" % (distro_name, distro_release))

        # don't use stylesheet cause we want to scale the wallpaper for various
        # screen sizes as well as support larger screens
        self.bgImage = QImage("/usr/share/wallpapers/Ethais/contents/images/1920x1200.png")
        self.scaledBgImage = self.bgImage
コード例 #20
0
		def __init__(self, MainWin_Link, client_id) :
				QtGui.QWidget.__init__(self)
				uic.loadUi("ui/EmployeesList_ui.ui", self)

				self.setWindowFlags(QtCore.Qt.WindowTitleHint)

				# Link to Main Form
				self.MainWin_Link = MainWin_Link
				# Database Client ID
				self.client_id = client_id

				# Setting window title
				self.Getting_Noncache_Client_Name()

				self.initialize()

				# Hotkeys
				self.enterHotkey, self.escHotkey = QtGui.QAction(self), QtGui.QAction(self)

				self.enterHotkey.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Return))
				self.escHotkey.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Escape))

				self.enterHotkey.triggered.connect(self.Add_New_Value)
				self.escHotkey.triggered.connect(self.close)

				self.addAction(self.enterHotkey)
				self.addAction(self.escHotkey)

				self.btn_Add.clicked.connect(self.Add_New_Value)
				self.btn_Del.clicked.connect(self.Delete_Value)
				self.btn_Close.clicked.connect(self.close)
コード例 #21
0
    def __init__(self, parent, sourceslist, source_entry, datadir):
        QDialog.__init__(self, parent)
        self.sourceslist = sourceslist
        self.source_entry = source_entry
        uic.loadUi("%s/designer/dialog_edit.ui" % datadir, self)

        self.combobox_type.addItem(utf8(_("Binary")))
        self.combobox_type.addItem(utf8(_("Source code")))
        if source_entry.type == "deb":
            self.combobox_type.setCurrentIndex(0)
        elif source_entry.type == "deb-src":
            self.combobox_type.setCurrentIndex(1)
        else:
            print "Error, unknown source type: '%s'" % source_enrty.type

        # uri
        self.entry_uri.setText(source_entry.uri)
        self.entry_dist.setText(source_entry.dist)

        comps = ""
        for c in source_entry.comps:
            if len(comps) > 0:
                comps = comps + " " + c
            else:
                comps = c
        self.entry_comps.setText(comps)

        self.entry_comment.setText(utf8(source_entry.comment))

        translate_widget(self)

        self.connect(self.entry_uri, SIGNAL("textChanged(const QString&)"), self.check_line)
        self.connect(self.entry_dist, SIGNAL("textChanged(const QString&)"), self.check_line)
        self.connect(self.entry_comps, SIGNAL("textChanged(const QString&)"), self.check_line)
        self.connect(self.entry_comment, SIGNAL("textChanged(const QString&)"), self.check_line)
コード例 #22
0
    def __init__(self):
        super(MainForm, self).__init__()

        # динамически загружает визуальное представление формы
        uic.loadUi("ui/mainform.ui", self)

        # dbase = QtSql.QSqlDatabase.addDatabase('QSQLITE')
        # #файл базы
        # dbase.setDatabaseName('database.db')
        # dbase.open()
        # view = self.tV_contacts()
        # model = QtSql.QSqlTableModel()
        # model.setTable('contacts')
        # model.select()
        # model.setEditStrategy(QtSql.QSqlTableModel.OnFieldChange)
        # self.tV_contacts.setModel(model)
        self.logger = logging.getLogger(__name__)
        self.logger.debug("START!")

        self.google_thread = GoogleThread()
        self.add_to_db_thread = Add_to_DBThread()
        self.get_contacts_into_db_thread = Get_Contacts_into_DB()
        # self.get_contacts_into_db_thread.start()

        self.connect_all_slots()
コード例 #23
0
ファイル: loadform.py プロジェクト: ZoneL/Photoloader
    def __init__(self, args, api, parent):
        super(LoadForm, self).__init__()
        uic.loadUi("resources\\loadform.ui", self)
        self.setFixedSize(self.size())

        self.tree = self.set_childs(self)
        self.timer = Timer()

        self.parent = parent
        self.parent.main_form.setDisabled(True)
        self.api = api
        self.stop_load = False
        self.pause_load = False
        self.moreInfoShowed = False
        self.count = 0
        self.loaded = 0
        self.failed = 0
        self.total = 0
        self.totalsize = 0

        self.set_connections()

        if 'albums' in args:
            self.loadAlbums(args['albums'])
        if 'photos' in args:
            self.loadPhotos(args['photos'])
コード例 #24
0
ファイル: widget.py プロジェクト: rexMingla/my-renamer
  def __init__(self, mode, manager, parent=None):
    super(BaseWorkBenchWidget, self).__init__("workBench/{}".format(mode), parent)
    uic.loadUi("ui/ui_WorkBench.ui", self)
    self._model = None
    self._manager = manager
    self.selectAllCheckBox.clicked.connect(self._setOverallCheckedState)
    
    #images
    self.openButton.setIcon(QtGui.QIcon("img/open.png"))
    self.launchButton.setIcon(QtGui.QIcon("img/launch.png"))
    self.deleteButton.setIcon(QtGui.QIcon("img/delete.png"))
    self.editEpisodeButton.setIcon(QtGui.QIcon("img/edit.png"))
    self.editSeasonButton.setIcon(QtGui.QIcon("img/edit.png"))
    self.editMovieButton.setIcon(QtGui.QIcon("img/edit.png"))
    
    def createAction(actions, button, cb, shortcut=None):
      holder = _ActionHolder(button, self, cb, shortcut, len(actions))
      actions[holder.name] = holder

    self._actions = {}
    createAction(self._actions, self.openButton, self._open, QtCore.Qt.ControlModifier + QtCore.Qt.Key_O)
    createAction(self._actions, self.launchButton, self._launch, QtCore.Qt.ControlModifier + QtCore.Qt.Key_L)
    createAction(self._actions, self.editEpisodeButton, self._editEpisode)
    createAction(self._actions, self.editSeasonButton, self._editSeason)
    createAction(self._actions, self.editMovieButton, self._editMovie)
    createAction(self._actions, self.deleteButton, self._delete, QtCore.Qt.Key_Delete)
    
    self._currentIndex = QtCore.QModelIndex()
    self._view = self.tvView if mode == interfaces.Mode.TV_MODE else self.movieView #HACK. yuck
    self._view.viewport().installEventFilter(self) #filter out double right click
    self._view.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
コード例 #25
0
ファイル: main.py プロジェクト: marioferreyra/Calculadora
    def __init__(self):
        QWidget.__init__(self)
        uic.loadUi("calculadora.ui", self)

        # Conexiones de los botones
        self.btn0.clicked.connect(lambda: self.agregar("0"))
        self.btn1.clicked.connect(lambda: self.agregar("1"))
        self.btn2.clicked.connect(lambda: self.agregar("2"))
        self.btn3.clicked.connect(lambda: self.agregar("3"))
        self.btn4.clicked.connect(lambda: self.agregar("4"))
        self.btn5.clicked.connect(lambda: self.agregar("5"))
        self.btn6.clicked.connect(lambda: self.agregar("6"))
        self.btn7.clicked.connect(lambda: self.agregar("7"))
        self.btn8.clicked.connect(lambda: self.agregar("8"))
        self.btn9.clicked.connect(lambda: self.agregar("9"))
        self.btnPunto.clicked.connect(lambda: self.agregar("."))
        self.btnSuma.clicked.connect(lambda: self.agregar("+"))
        self.btnResta.clicked.connect(lambda: self.agregar("-"))
        self.btnMulti.clicked.connect(lambda: self.agregar("*"))
        self.btnDiv.clicked.connect(lambda: self.agregar("/"))
        self.btnCuadrado.clicked.connect(lambda: self.parcial("Cuadrado"))
        self.btnRaiz.clicked.connect(lambda: self.parcial("Raiz"))
        self.btnParOpen.clicked.connect(lambda: self.agregar("("))
        self.btnParClose.clicked.connect(lambda: self.agregar(")"))
        self.btnAC.clicked.connect(lambda: self.expre.clear())
        self.btnDEL.clicked.connect(self.delete)
        self.btnIgual.clicked.connect(self.evaluar)
コード例 #26
0
ファイル: widget.py プロジェクト: rexMingla/my-renamer
 def __init__(self, mode, holder, parent=None):
   super(InputWidget, self).__init__("input/{}".format(mode), parent)
   uic.loadUi("ui/ui_Input.ui", self)
   
   self._holder = holder
   self.folderButton.clicked.connect(self._showFolderSelectionDialog)
   self.searchButton.clicked.connect(self.exploreSignal)
   self.searchButton.setIcon(QtGui.QIcon("img/search.png"))
   self.folderEdit.returnPressed.connect(self.exploreSignal)
   self.fileExtensionEdit.returnPressed.connect(self.exploreSignal)
   self.stopButton.clicked.connect(self.stopSignal)
   self.stopButton.setIcon(QtGui.QIcon("img/stop.png"))
   self.restrictedExtRadioButton.toggled.connect(self.fileExtensionEdit.setEnabled)
   self.restrictedSizeRadioButton.toggled.connect(self.sizeSpinBox.setEnabled)
   self.restrictedSizeRadioButton.toggled.connect(self.sizeComboBox.setEnabled)
   self.sourceButton.clicked.connect(self.showEditSourcesSignal.emit)
   searchAction = QtGui.QAction(self.searchButton.text(), self)
   searchAction.setIcon(self.searchButton.icon())
   searchAction.setShortcut(QtCore.Qt.ControlModifier + QtCore.Qt.Key_F)
   searchAction.triggered.connect(self.exploreSignal.emit)
   self.addAction(searchAction)
   
   completer = QtGui.QCompleter(self)
   fsModel = QtGui.QFileSystemModel(completer)
   fsModel.setRootPath("")
   completer.setModel(fsModel)
   self.folderEdit.setCompleter(completer)
   
   self.stopActioning()
   self.stop_exploring()
コード例 #27
0
ファイル: widget.py プロジェクト: rexMingla/my-renamer
 def __init__(self, mode, nameFormatHelper, parent=None):
   super(OutputWidget, self).__init__("output/{}".format(mode), parent)    
   uic.loadUi("ui/ui_Output.ui", self)
   
   self._helper = nameFormatHelper
   self._initFormat()
   
   self.renameButton.clicked.connect(self.renameSignal)
   self.renameButton.setIcon(QtGui.QIcon("img/rename.png"))
   self.stopButton.clicked.connect(self.stopSignal)
   self.stopButton.setIcon(QtGui.QIcon("img/stop.png"))
       
   self.specificDirectoryButton.clicked.connect(self._showFolderSelectionDialog)
   
   self.useSpecificDirectoryRadio.toggled.connect(self.specificDirectoryEdit.setEnabled)
   self.useSpecificDirectoryRadio.toggled.connect(self.specificDirectoryButton.setEnabled)
   self.formatEdit.textChanged.connect(self._updatePreviewText)
   self.showHelpLabel.linkActivated.connect(self._showHelp)
   self.hideHelpLabel.linkActivated.connect(self._hideHelp)
   self.subtitleCheckBox.toggled.connect(self.subtitleExtensionsEdit.setEnabled)
   
   completer = QtGui.QCompleter(self)
   fsModel = QtGui.QFileSystemModel(completer)
   fsModel.setRootPath("")
   completer.setModel(fsModel)
   self.specificDirectoryEdit.setCompleter(completer)
   
   self._isActioning = False
   self.stopActioning()
   self.renameButton.setEnabled(False)
   self._showHelp()
コード例 #28
0
    def __init__(self, parent, settings):
        super(FileSelectionList, self).__init__(parent)

        uic.loadUi(ComicTaggerSettings.getUIFile('fileselectionlist.ui'), self)

        self.settings = settings

        reduceWidgetFontSize(self.twList)

        self.twList.setColumnCount(6)
        #self.twlist.setHorizontalHeaderLabels (["File", "Folder", "CR", "CBL", ""])
        # self.twList.horizontalHeader().setStretchLastSection(True)
        self.twList.currentItemChanged.connect(self.currentItemChangedCB)

        self.currentItem = None
        self.setContextMenuPolicy(Qt.ActionsContextMenu)
        self.modifiedFlag = False

        selectAllAction = QAction("Select All", self)
        removeAction = QAction("Remove Selected Items", self)
        self.separator = QAction("", self)
        self.separator.setSeparator(True)

        selectAllAction.setShortcut('Ctrl+A')
        removeAction.setShortcut('Ctrl+X')

        selectAllAction.triggered.connect(self.selectAll)
        removeAction.triggered.connect(self.removeSelection)

        self.addAction(selectAllAction)
        self.addAction(removeAction)
        self.addAction(self.separator)
コード例 #29
0
ファイル: opciones.py プロジェクト: informaticameg/Fragmentos
    def __init__(self, parent, configs, dbutils):
        # carga la interfaz desded el archivo ui
        FILENAME = 'uis/wOpciones.ui'
        uifile = os.path.join(os.path.abspath(os.path.dirname(__file__)),FILENAME)
        QtGui.QMainWindow.__init__(self)
        uic.loadUi(uifile, self)
        self.setWindowIcon(QtGui.QIcon(':/toolbar/gear32.png'))

        # centra la ventana
        self.__centerOnScreen()

        # instancias desde la clase fragmentos
        self.__Config = configs
        self.__DBU = dbutils
        self.__PT = PathTools()
        self.__Padre = parent

        # usado para saber si hay que refrescar el combo
        # de bds de la interfaz principal, en caso
        # de que se haya agregado alguna
        self.__countBdsIsChanged = False
        #
        self.__cargarValoresEnGUI()

        self.tabWidget.setCurrentIndex(0)

        self.cbBDsCargaInicio.setEnabled(False)
コード例 #30
0
ファイル: uitests.py プロジェクト: CrearAyT/proyecto-anahi
    def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        uifile = 'main.ui'
        uic.loadUi(uifile, self)

        self.adsrw = adsrWidget()
        self.adsrWidgetContainer.addWidget(self.adsrw)
コード例 #31
0
    def __init__(self):
        QtGui.QDialog.__init__(self)
        geo = QtGui.QDesktopWidget().availableGeometry()
        self.maxHeight = geo.height() - 100
        self.maxWidth = geo.width() - 50

        self.sessionHasBeenLoaded = False
        self.lastSavedSessionFilename = ""
        self.selectedDirectory = ""
        self.outputDirectory = ""
        self.methodUsed = ""
        self.columnSeparator = ","
        self.signalsHeader = []
        self.filesSelected = []
        self.nFilesSelected = 0
        self.signalsSelected = []
        self.nSignalsSelected = 0
        self.signalsRefreshed = False
        self.signals = []
        self.dataFiles = []
        self.recreateMethodList = False
        self.firstFile = ""
        self.filesHasHeaders = False
        self.outputBaseName = None

        self.syncpyplatform = ""
        self.plotImgPath = ""
        self.headerMap = OrderedDict()
        if sys.platform == 'darwin':
            os.system("export LC_ALL=en_US.UTF-8")
            os.system("export LANG=en_US.UTF-8")
            self.syncpyplatform = "m"
        elif sys.platform == 'win32':
            self.syncpyplatform = "w"
        elif sys.platform == 'linux2':
            self.syncpyplatform = "u"

        #load config file
        self.config = ConfigParser.RawConfigParser()
        self.config.read('conf.ini')
        self.appVersion = self.getFromConfig('app.version')
        self.appName = self.getFromConfig('app.name')
        self.syncpyver = self.getFromConfig('sessionVersion')
        self.lastUpdate = self.getFromConfig('lastUpdate')

        self.plotImgPath = self.getFromConfig("plotImgPath")

        self.ui = uic.loadUi(self.getFromConfig("uiFile"), self)
        QtCore.QMetaObject.connectSlotsByName(self)

        table = self.ui.inputSignalsWidget
        table.setColumnCount(3)
        headers = QtCore.QStringList("Name")
        headers.append("Type")
        headers.append("Plot")
        table.setHorizontalHeaderLabels(headers)

        # --------- Add standards icons to main button ---------
        self.ui.startPushButton.setEnabled(False)
        self.ui.stopPushButton.setEnabled(False)
        self.ui.startPushButton.setIcon(QtGui.qApp.style().standardIcon(
            QStyle.SP_CommandLink))
        self.ui.stopPushButton.setIcon(QtGui.qApp.style().standardIcon(
            QStyle.SP_BrowserStop))
        self.ui.openOutputPushButton.setIcon(QtGui.qApp.style().standardIcon(
            QStyle.SP_DirIcon))
        self.ui.headerWizardButton.setIcon(QtGui.qApp.style().standardIcon(
            QStyle.SP_FileDialogContentsView))

        # --------- redirect outputs to log widget ---------
        sys.stdout = OutLog(self.ui.outputPrintEdit, sys.stdout)
        sys.stderr = OutLog(self.ui.outputPrintEdit, sys.stderr, QtCore.Qt.red)

        # --------- Add Method widget ---------
        self.ui.methodWidget = MethodWidget(self.ui.methodsArgsGroupBox)

        # --------- Events connections ---------
        QtCore.QObject.connect(
            self.ui.methodsTreeWidget,
            QtCore.SIGNAL('itemClicked(QTreeWidgetItem*, int)'),
            self.treeItemSelected)
        self.ui.openOutputPushButton.clicked.connect(self.openOutputFolder)
        self.ui.plotSignalsButton.clicked.connect(self.plotSignals)
        self.ui.startPushButton.clicked.connect(self.computeBtnEvent)
        self.ui.stopPushButton.clicked.connect(
            self.ui.methodWidget.stopComputeProcess)
        self.ui.actionSaveSession.triggered.connect(self.saveSession)
        self.ui.actionGIT.triggered.connect(self.openGIT)
        self.ui.actionAbout.triggered.connect(self.openAbout)
        self.ui.actionUpdate.triggered.connect(self.checkUpdates)
        self.ui.actionSaveSessionOver.triggered.connect(self.resaveSession)
        self.ui.actionLoadSession.triggered.connect(self.loadSession)
        self.ui.clearLogPushButton.clicked.connect(self.clearLogBtnEvent)
        self.ui.inputFolderToolButton.clicked.connect(self.setInputFolder)
        self.ui.outputFolderToolButton.clicked.connect(
            self.outputFolderButtonEvent)
        self.ui.toolBox.currentChanged.connect(self.changeSelectedTab)
        self.ui.headerWizardButton.clicked.connect(self.headerWizardEvent)
        self.ui.exportSignalsButton.clicked.connect(self.exportSelectedSignals)

        #QtCore.QObject.connect(self.ui.inputFileslistView, QtCore.SIGNAL('pressed(QModelIndex)'), self.checkFileItemFromRowClick)
        QtCore.QObject.connect(self.ui.inputSignalsWidget,
                               QtCore.SIGNAL('pressed(QModelIndex)'),
                               self.checkSignalItemFromCellClick)
        #QtCore.QObject.connect(self.ui.inputSignalsWidget, QtCore.SIGNAL('pressed(QModelIndex)'), self.selectItem)
        # right click menu on toolbox
        #self.ui.toolBox.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        #QtCore.QObject.connect(self.ui.toolBox, QtCore.SIGNAL("customContextMenuRequested(QPoint)"),self.openMenuToolbox)
        self.ui.inputFileslistView.setContextMenuPolicy(
            QtCore.Qt.CustomContextMenu)
        QtCore.QObject.connect(
            self.ui.inputFileslistView,
            QtCore.SIGNAL("customContextMenuRequested(QPoint)"),
            self.openMenuToolbox)

        self.ui.inputSignalsWidget.setContextMenuPolicy(
            QtCore.Qt.CustomContextMenu)
        QtCore.QObject.connect(
            self.ui.inputSignalsWidget,
            QtCore.SIGNAL("customContextMenuRequested(QPoint)"),
            self.openMenuToolbox)

        #self.ui.methodWidget.currentMethod.finished.connect(self.enableButtons)

        QtCore.QObject.connect(self.ui.methodWidget,
                               QtCore.SIGNAL('computationFinished()'),
                               self.enableButtons)

        self.ui.inputSignalsWidget.horizontalHeader().setResizeMode(
            QtGui.QHeaderView.Stretch)

        self.ui.show()
        self.ui.toolBox.setCurrentIndex(0)
        self.warnForGoingBack(False)

        self.showStatus("{0} (v {1}) successfully loaded".format(
            self.appName, self.appVersion))

        #To-Do finish implementing Tools.plotSignals()
        self.ui.signalsStackedCheckBox.hide()
コード例 #32
0
    def __init__(self, *args):
        """
        Descript. :
        """
        BlissWidget.__init__(self, *args)

        # Internal variables ------------------------------------------------
        self.sample = queue_model_objects.Sample()
        self.crystal = self.sample.crystals[0]
        self.sample_mib = DataModelInputBinder(self.sample)
        self.crystal_mib = DataModelInputBinder(self.crystal)

        # Signals ------------------------------------------------------------

        # Slots --------------------------------------------------------------
        self.defineSlot("populate_sample_details", ({}))

        # Graphic elements ----------------------------------------------------
        _info_widget = QtGui.QWidget(self)
        self.crystal_widget = uic.loadUi(\
             os.path.join(os.path.dirname(__file__),
             "widgets/ui_files/Qt4_crystal_widget_layout.ui"))
        self.sample_info_widget = uic.loadUi(
            os.path.join(os.path.dirname(__file__),
                         "widgets/ui_files/Qt4_sample_info_widget_layout.ui"))
        #self.ispyb_sample_info_widget = ISPyBSampleInfoWidget(self)

        # Layout --------------------------------------------------------------
        _info_widget_hlayout = QtGui.QHBoxLayout(_info_widget)
        _info_widget_hlayout.addWidget(self.sample_info_widget)
        _info_widget_hlayout.addWidget(self.crystal_widget)
        _info_widget_hlayout.addStretch(0)
        _info_widget_hlayout.setSpacing(0)
        _info_widget_hlayout.setContentsMargins(2, 2, 2, 2)

        _main_hlayout = QtGui.QVBoxLayout(self)
        _main_hlayout.addWidget(_info_widget)
        #_main_hlayout.addWidget(self.ispyb_sample_info_widget)
        _main_hlayout.addStretch(0)
        _main_hlayout.setSpacing(0)
        _main_hlayout.setContentsMargins(2, 2, 2, 2)

        # SizePolicies --------------------------------------------------------

        # Qt signal/slot connections ------------------------------------------

        # Other ---------------------------------------------------------------
        self.crystal_mib.bind_value_update(
            'space_group', self.crystal_widget.space_group_value_label, str,
            None)

        self.crystal_mib.bind_value_update(
            'protein_acronym', self.crystal_widget.protein_acronym_value_label,
            str, None)

        self.crystal_mib.bind_value_update('cell_a',
                                           self.crystal_widget.a_value_label,
                                           str, None)

        self.crystal_mib.bind_value_update(
            'cell_alpha', self.crystal_widget.alpha_value_label, str, None)

        self.crystal_mib.bind_value_update('cell_b',
                                           self.crystal_widget.b_value_label,
                                           str, None)

        self.crystal_mib.bind_value_update(
            'cell_beta', self.crystal_widget.beta_value_label, str, None)

        self.crystal_mib.bind_value_update('cell_c',
                                           self.crystal_widget.c_value_label,
                                           str, None)

        self.crystal_mib.bind_value_update(
            'cell_gamma', self.crystal_widget.gamma_value_label, str, None)

        self.sample_mib.bind_value_update(
            'name', self.sample_info_widget.name_value_label, str, None)

        self.sample_mib.bind_value_update(
            'code', self.sample_info_widget.data_matrix_value_label, str, None)

        self.sample_mib.bind_value_update(
            'holder_length', self.sample_info_widget.holder_length_value_label,
            str, None)

        self.sample_mib.bind_value_update(
            'lims_sample_location',
            self.sample_info_widget.sample_location_value_label, str, None)

        self.sample_mib.bind_value_update(
            'lims_container_location',
            self.sample_info_widget.basket_location_value_label, str, None)
コード例 #33
0
ファイル: pyns.py プロジェクト: amattana/NS-Pointing
    def __init__(self, uiFile):
        """ Initialise main window """
        super(ImageDialog, self).__init__()
        # Set up the user interface from Designer.
        self.ui = uic.loadUi(uiFile)
        self.setCentralWidget(self.ui)
        self.resize(802, 740)
        self.show()

        self.connected = False
        self.status = "UNDEFINED"
        self.armed = False

        self.ramo = 0

        self.status_string = "  +56.0  +44.5   +44.5  +44.5   +44.5 0 1 0"
        self.target_type = "arb"
        self.actual_dec = [0, 0, 0, 0]  # quella disegnata
        self.target_dec = [None, None, None, None]  # quella da raggiungere
        self.current_dec = [90, 90, 90, 90]  # quella letta nello status

        self.image = QtGui.QImage("small_bg.png")
        self.image2 = QtGui.QImage("small_fg.png")

        self.overlay = Image.open("small_arrow.png")
        ov = self.overlay.rotate(0).tobytes("raw", "RGBA")
        self.qov = QtGui.QImage(ov, self.overlay.size[0], self.overlay.size[1],
                                QtGui.QImage.Format_ARGB32)

        # self.ui.comboBox.setEnabled(False)
        self.ui.arbitrary_dec.setEnabled(False)
        self.ui.button_move_arb.setEnabled(False)
        # self.ui.button_move_src.setEnabled(False)
        #self.ui.cb_sel_ramo.setEnabled(False)

        self.process_antenna_status = Thread(target=self.antenna_check)
        self.process_time_left = Thread(target=self.rs_time_left)
        self.process_time_left.start()
        self.stopThreads = False

        painter = QtGui.QPainter()
        painter.begin(self.image)
        painter.drawImage(0, 0, self.qov)
        painter.drawImage(0, 0, self.image2)
        painter.end()

        font = QtGui.QFont()
        font.setPointSize(22)
        font.setBold(True)
        font.setWeight(75)

        self.ant_pics = []
        self.ant_pos = []
        for i in xrange(4):
            self.ant_pics += [QtGui.QLabel(self.ui.tab_dec)]
            self.ant_pics[i].setGeometry(30 + (190 * i), 70, 140, 140)
            self.ant_pics[i].setPixmap(QtGui.QPixmap.fromImage(self.image))
            self.ant_pos += [QtGui.QLabel(self.ui.tab_dec)]
            self.ant_pos[i].setGeometry(30 + (190 * i), 20, 140, 40)
            self.ant_pos[i].setAlignment(QtCore.Qt.AlignHCenter
                                         | QtCore.Qt.AlignVCenter)
            self.ant_pos[i].setStyleSheet(
                "background-color: rgb(255, 255, 255)")
            self.ant_pos[i].setFont(font)
            self.ant_pos[i].setText("44.5")

        self.initPics()
        self.ui.cb_1n.setEnabled(False)
        self.ui.cb_2n.setEnabled(False)
        self.ui.cb_1s.setEnabled(False)
        self.ui.cb_2s.setEnabled(False)

        self.ui.show()

        try:
            self.create_rs_table()
            for i in range(len(self.rs_records)):
                self.rs_records[i]['button_move'].clicked.connect(
                    lambda: self.point_antenna(self.rs_records[i]['name'] + ","
                                               + self.rs_records[i]['dec']))
        except:
            print "\nError: Unable to find a radio source catalogue file!\n"

        self.server_ip = "127.0.0.1"
        self.server_port = 7000
        self.server_polling = 5
        self.client = None
        self.client_buff_len = 1024

        # Connect up the buttons.
        self.ui.button_move_arb.clicked.connect(
            lambda: self.point_antenna('arb'))
        # self.ui.button_move_src.clicked.connect(lambda: self.point_antenna('src'))
        clickable(self.ui.label_enabled).connect(lambda: self.action_enable())
        clickable(
            self.ui.label_connected).connect(lambda: self.action_connect())
コード例 #34
0
ファイル: layerDialog.py プロジェクト: thanujadax/volumina
    def __init__(self, layer, parent=None):
        QDialog.__init__(self, parent)
        p = os.path.split(os.path.abspath(__file__))[0]
        uic.loadUi(p + "/ui/rgbaLayerDialog.ui", self)
        self.setLayername(layer.name)

        if layer.datasources[0] == None:
            self.showRedThresholds(False)
        if layer.datasources[1] == None:
            self.showGreenThresholds(False)
        if layer.datasources[2] == None:
            self.showBlueThresholds(False)
        if layer.datasources[3] == None:
            self.showAlphaThresholds(False)

        def dbgPrint(layerIdx, a, b):
            layer.set_normalize(layerIdx, (a, b))
            print "normalization changed for channel=%d to [%d, %d]" % (
                layerIdx, a, b)

        self.redChannelThresholdingWidget.setRange(layer.range[0][0],
                                                   layer.range[0][1])
        self.greenChannelThresholdingWidget.setRange(layer.range[1][0],
                                                     layer.range[1][1])
        self.blueChannelThresholdingWidget.setRange(layer.range[2][0],
                                                    layer.range[2][1])
        self.alphaChannelThresholdingWidget.setRange(layer.range[3][0],
                                                     layer.range[3][1])

        self.redChannelThresholdingWidget.setValue(layer.normalize[0][0],
                                                   layer.normalize[0][1])
        self.greenChannelThresholdingWidget.setValue(layer.normalize[1][0],
                                                     layer.normalize[1][1])
        self.blueChannelThresholdingWidget.setValue(layer.normalize[2][0],
                                                    layer.normalize[2][1])
        self.alphaChannelThresholdingWidget.setValue(layer.normalize[3][0],
                                                     layer.normalize[3][1])

        self.redChannelThresholdingWidget.valueChanged.connect(
            partial(dbgPrint, 0))
        self.greenChannelThresholdingWidget.valueChanged.connect(
            partial(dbgPrint, 1))
        self.blueChannelThresholdingWidget.valueChanged.connect(
            partial(dbgPrint, 2))
        self.alphaChannelThresholdingWidget.valueChanged.connect(
            partial(dbgPrint, 3))

        def redAutoRange(state):
            if state == 2:
                self.redChannelThresholdingWidget.setValue(
                    layer.normalize[0][0], layer.normalize[0][1])  #update gui
                layer.set_normalize(0, None)  # set to auto
                self.redChannelThresholdingWidget.setEnabled(False)
            if state == 0:
                self.redChannelThresholdingWidget.setEnabled(True)
                layer.set_normalize(0, layer.normalize[0])

        def greenAutoRange(state):
            if state == 2:
                self.greenChannelThresholdingWidget.setValue(
                    layer.normalize[1][0], layer.normalize[1][1])  #update gui
                layer.set_normalize(1, None)  # set to auto
                self.greenChannelThresholdingWidget.setEnabled(False)
            if state == 0:
                self.greenChannelThresholdingWidget.setEnabled(True)
                layer.set_normalize(1, layer.normalize[1])

        def blueAutoRange(state):
            if state == 2:
                self.blueChannelThresholdingWidget.setValue(
                    layer.normalize[2][0], layer.normalize[2][1])  #update gui
                layer.set_normalize(2, None)  # set to auto
                self.blueChannelThresholdingWidget.setEnabled(False)
            if state == 0:
                self.blueChannelThresholdingWidget.setEnabled(True)
                layer.set_normalize(2, layer.normalize[2])

        def alphaAutoRange(state):
            if state == 2:
                self.alphaChannelThresholdingWidget.setValue(
                    layer.normalize[3][0], layer.normalize[3][1])  #update gui
                layer.set_normalize(3, None)  # set to auto
                self.alphaChannelThresholdingWidget.setEnabled(False)
            if state == 0:
                self.alphaChannelThresholdingWidget.setEnabled(True)
                layer.set_normalize(3, layer.normalize[3])

        self.redAutoRange.stateChanged.connect(redAutoRange)
        self.redAutoRange.setCheckState(layer._autoMinMax[0] * 2)
        self.greenAutoRange.stateChanged.connect(greenAutoRange)
        self.greenAutoRange.setCheckState(layer._autoMinMax[1] * 2)
        self.blueAutoRange.stateChanged.connect(blueAutoRange)
        self.blueAutoRange.setCheckState(layer._autoMinMax[2] * 2)
        self.alphaAutoRange.stateChanged.connect(alphaAutoRange)
        self.alphaAutoRange.setCheckState(layer._autoMinMax[3] * 2)

        self.resize(self.minimumSize())
コード例 #35
0
    def __init__(self, parent=None):
        self.v = []

        super(BlockDepthWindow, self).__init__(parent)

        uic.loadUi(resource_path("blockdepthview.ui"), self)

        self._positionWindow()

        self.time = mosaicTiming.mosaicTiming()

        self.queryInterval = 5
        self.lastQueryTime = round(self.time.time())

        self.idleTimer = QtCore.QTimer()
        self.idleTimer.start(3000)

        self.queryString = "select BlockDepth from metadata where ProcessingStatus='normal'and ResTime > 0.025"
        self.queryData = []
        self.queryError = False
        self.lastGoodQueryString = ""
        self.queryRunning = False

        self.qWorker = None
        self.qThread = QtCore.QThread()

        self.queryCompleter = None

        self.updateDataOnIdle = True

        self.nBins = 500
        self.binsSpinBox.setValue(self.nBins)

        # Set the default text in the Filter LineEdit
        self.sqlQueryLineEdit.setCompleterValues([])
        self.sqlQueryLineEdit.setText("ResTime > 0.025")

        self.maxLevel = 5
        self.levelHorizontalSlider.setValue(self.maxLevel)

        # add a status bar
        sb = QtGui.QStatusBar()
        self.statusBarHorizontalLayout.addWidget(sb)
        self.statusBarHorizontalLayout.setMargin(0)
        self.statusBarHorizontalLayout.setSpacing(0)

        self.statusbarLine.hide()

        QtCore.QObject.connect(self.updateButton, QtCore.SIGNAL('clicked()'),
                               self.OnUpdateButton)
        QtCore.QObject.connect(
            self.sqlQueryLineEdit,
            QtCore.SIGNAL('textChanged ( const QString & )'),
            self.OnQueryTextChange)
        QtCore.QObject.connect(self.binsSpinBox,
                               QtCore.SIGNAL('valueChanged ( int )'),
                               self.OnBinsChange)
        QtCore.QObject.connect(self.levelHorizontalSlider,
                               QtCore.SIGNAL('valueChanged ( int )'),
                               self.OnlevelSliderChange)
        QtCore.QObject.connect(self.peakDetectCheckBox,
                               QtCore.SIGNAL('clicked(bool)'),
                               self.OnPeakDetect)
コード例 #36
0
    def __init__(self, parent=None):
        QWidget.__init__(self, parent, QtCore.Qt.WindowStaysOnTopHint)
        # GUI
        rp = rospkg.RosPack()
        w_path = rp.get_path(
            'instructor_plugins') + '/ui/waypoint_manager_2.ui'
        uic.loadUi(w_path, self)
        self.waypoint_page_widget = QWidget()
        self.relative_page_widget = QWidget()
        waypoint_path = rp.get_path(
            'instructor_plugins') + '/ui/waypoint_inner_frame.ui'
        uic.loadUi(waypoint_path, self.waypoint_page_widget)
        relative_path = rp.get_path(
            'instructor_plugins') + '/ui/relative_inner_frame.ui'
        uic.loadUi(relative_path, self.relative_page_widget)
        self.waypoint_layout.addWidget(self.waypoint_page_widget)
        self.relative_layout.addWidget(self.relative_page_widget)

        self.waypoint_page_btn = InterfaceButton('FIXED WAYPOINTS',
                                                 colors['blue'])
        self.waypoint_page_btn.clicked.connect(self.show_waypoint_page)
        self.relative_page_btn = InterfaceButton('RELATIVE WAYPOINTS',
                                                 colors['green'])
        self.relative_page_btn.clicked.connect(self.show_relative_page)
        self.page_button_layout.addWidget(self.waypoint_page_btn)
        self.page_button_layout.addWidget(self.relative_page_btn)

        # INFO #
        self.info_textbox = TextEdit(self, '', '', color=colors['gray_light'])
        self.info_textbox.setReadOnly(True)
        #self.info_textbox.hide()
        self.info_textbox.setMaximumSize(QtCore.QSize(16777215, 200))
        self.button_layout.addWidget(self.info_textbox)

        # BUTTONS #
        self.add_waypoint_btn = InterfaceButton('ADD WAYPOINT', colors['blue'])
        self.button_layout.addWidget(self.add_waypoint_btn)
        self.add_waypoint_btn.clicked.connect(self.add_waypoint)

        self.add_waypoint_seq_btn = InterfaceButton('ADD WAYPOINT SEQUENCE',
                                                    colors['blue'])
        self.button_layout.addWidget(self.add_waypoint_seq_btn)
        self.add_waypoint_seq_btn.clicked.connect(self.add_waypoint_seq)

        self.add_waypoint_btn = InterfaceButton('REMOVE WAYPOINT',
                                                colors['red'])
        self.button_layout.addWidget(self.add_waypoint_btn)
        self.add_waypoint_btn.clicked.connect(self.remove_waypoint)

        self.servo_to_waypoint_btn = InterfaceButton('SERVO TO WAYPOINT',
                                                     colors['purple'])
        self.button_layout.addWidget(self.servo_to_waypoint_btn)
        self.servo_to_waypoint_btn.clicked.connect(self.servo_to_waypoint)

        self.waypoint_page_widget.waypoint_list.itemClicked.connect(
            self.fixed_waypoint_selected)
        self.relative_page_widget.waypoint_list.itemClicked.connect(
            self.relative_waypoint_selected)

        self.waypoint_page_widget.name_field.textChanged.connect(
            self.waypoint_name_cb)
        self.relative_page_widget.name_field.textChanged.connect(
            self.waypoint_name_cb)

        self.relative_page_widget.landmark_list.itemClicked.connect(
            self.landmark_selected)
        self.relative_page_widget.landmark_field.setText('NONE')
        self.relative_page_widget.landmark_field.setStyleSheet(
            'background-color:' + colors['gray'].normal + ';color:#ffffff')

        # Members
        self.landmarks = {}
        self.new_fixed_name = None
        self.new_relative_name = None
        self.selected_landmark = None
        self.waypoint_selected = False
        self.listener_ = tf.TransformListener()
        self.mode = 'FIXED'
        self.found_waypoints = []
        self.found_rel_waypoints = []
        # Initialize
        self.update_waypoints()
        self.show_waypoint_page()
コード例 #37
0
ファイル: controls.py プロジェクト: malei-pku/neuronvisio
    def __init__(self):
        dynamic_neuron_home()
        app = QtGui.QApplication.instance()
        self.ui_dir = 'ui'
        # Loading the UI
        self.ui = uic.loadUi(
            os.path.join(os.path.dirname(__file__), self.ui_dir,
                         "neuronvisio.ui"))

        # Connecting
        self.ui.Plot3D.connect(self.ui.Plot3D, QtCore.SIGNAL('clicked()'),
                               self.launch_visio)
        self.ui.plot_vector_btn.connect(self.ui.plot_vector_btn,
                                        QtCore.SIGNAL('clicked()'),
                                        self.plot_vector)
        self.ui.init_btn.connect(self.ui.init_btn, QtCore.SIGNAL('clicked()'),
                                 self.init)
        self.ui.run_btn.connect(self.ui.run_btn, QtCore.SIGNAL('clicked()'),
                                self.run)
        self.ui.dtSpinBox.connect(self.ui.dtSpinBox,
                                  QtCore.SIGNAL('valueChanged(double)'),
                                  self.dt_changed)
        self.ui.tstopSpinBox.connect(self.ui.tstopSpinBox,
                                     QtCore.SIGNAL('valueChanged(double)'),
                                     self.tstop_changed)
        self.ui.vSpinBox.connect(self.ui.vSpinBox,
                                 QtCore.SIGNAL('valueChanged(double)'),
                                 self.v_changed)
        self.ui.create_vector.connect(self.ui.create_vector,
                                      QtCore.SIGNAL('clicked()'),
                                      self.create_vector)
        self.ui.actionAbout.connect(self.ui.actionAbout,
                                    QtCore.SIGNAL('triggered()'), self.about)
        self.ui.timelineSlider.connect(self.ui.timelineSlider,
                                       QtCore.SIGNAL("valueChanged(int)"),
                                       self.on_timeline_value_changed)
        self.ui.animationTime.connect(self.ui.animationTime,
                                      QtCore.SIGNAL('returnPressed()'),
                                      self.on_animation_time_return_pressed)
        self.ui.actionLoad.connect(self.ui.actionLoad,
                                   QtCore.SIGNAL("triggered()"), self.load)
        self.ui.actionSave.connect(self.ui.actionSave,
                                   QtCore.SIGNAL("triggered()"), self.save_hdf)
        self.ui.tabWidget.connect(self.ui.tabWidget,
                                  QtCore.SIGNAL('currentChanged(int)'),
                                  self.populate_treeview_model)
        self.ui.tree_models.connect(self.ui.tree_models,
                                    QtCore.SIGNAL('itemSelectionChanged ()'),
                                    self.select_model_treeview)
        self.ui.load_model_btn.connect(self.ui.load_model_btn,
                                       QtCore.SIGNAL('clicked()'),
                                       self.load_selected_model)
        self.ui.load_model_btn.connect(self.ui.filter_list_btn,
                                       QtCore.SIGNAL('clicked()'),
                                       self.filter_list)
        self.ui.filter_input.connect(self.ui.filter_input,
                                     QtCore.SIGNAL('returnPressed()'),
                                     self.filter_list)

        ### Connection with the console
        widgetDic = {
            'dt': self.ui.dtSpinBox,
            'tstop': self.ui.tstopSpinBox,
            'v_init': self.ui.vSpinBox,
            'time_label': self.ui.time_label
        }
        self.timeLoop = Timeloop(widgetDic)
        app.connect(self.timeLoop, QtCore.SIGNAL("updateDt(double)"),
                    self.update_dt)
        app.connect(self.timeLoop, QtCore.SIGNAL("updateTstop(double)"),
                    self.update_tstop)
        app.connect(self.timeLoop, QtCore.SIGNAL("updateVInit(double)"),
                    self.update_v_init)
        self.timeLoop.start()

        ### Manager class
        self.manager = manager.Manager()
        self.path_to_hdf = None
        self.visio = None
        self.tab_model_already_populated = False
        self.ui.show()
        # Start the main event loop.
        #app.exec_()

        self.AUTHORS = 1
        self.YEAR = 0
        self.TITLE = 2
        self.ID = 3
        # Dictionary to hold the models class for the ModelDb integration
        self.models = Models()
コード例 #38
0
ファイル: DlgSettings.py プロジェクト: jplozf/pyng
    def __init__(self, parent=None):
        QDialog.__init__(self, parent)
        setattr(self, "parent", parent)
        uic.loadUi(resource_path('DlgSettings.ui'), self)

        self.spbTimerPing.setMinimum(0)
        self.spbTimerPing.setMaximum(settings.db['TIMER_PING'] * 1000)
        self.spbTimerPing.setValue(settings.db['TIMER_PING'])

        self.spbTimerStatus.setMinimum(0)
        self.spbTimerStatus.setMaximum(settings.db['TIMER_STATUS'] * 1000)
        self.spbTimerStatus.setValue(settings.db['TIMER_STATUS'])

        self.spbUnreachablePing.setMinimum(0)
        self.spbUnreachablePing.setMaximum(settings.db['UNREACHABLE_PING'] *
                                           1000)
        self.spbUnreachablePing.setValue(settings.db['UNREACHABLE_PING'])

        self.spbGreenStatus.setMinimum(0)
        self.spbGreenStatus.setMaximum(settings.db['STATUS_GREEN'] * 1000)
        self.spbGreenStatus.setValue(settings.db['STATUS_GREEN'])

        self.spbYellowStatus.setMinimum(0)
        self.spbYellowStatus.setMaximum(settings.db['STATUS_YELLOW'] * 1000)
        self.spbYellowStatus.setValue(settings.db['STATUS_YELLOW'])

        self.spbGreenStatus.valueChanged.connect(self.greenValueChanged)
        self.spbYellowStatus.valueChanged.connect(self.yellowValueChanged)

        self.txtSMTPServer.setText(settings.db['SMTP_SERVER'])
        self.txtSMTPPort.setText(str(settings.db['SMTP_PORT']))
        self.chkSMTPTLS.setChecked(settings.db['SMTP_TLS'])
        self.txtSMTPUser.setText(settings.db['SMTP_USER'])
        self.txtSMTPPassword.setText(settings.db['SMTP_PASSWORD'])
        self.txtSMTPRecipients.setText(settings.db['SMTP_RECIPIENTS'])

        self.txtAlternateCommand.setText(settings.db['ALT_PING_COMMAND'])
        self.txtAlternateRegex.setText(settings.db['ALT_PING_REGEX'])
        self.txtAlternateGroup.setText(str(settings.db['ALT_REGEX_GROUP']))
        self.txtAlternateCodepage.setText(settings.db['ALT_PING_CODEPAGE'])
        self.chkEnableAlternate.setChecked(settings.db['ALT_PING_ENABLED'])
        self.txtTestTarget.setText("8.8.8.8")

        self.btnTestMail.clicked.connect(self.testMail)
        self.btnOK.clicked.connect(self.saveSettingsClose)
        self.btnCancel.clicked.connect(self.reject)
        self.btnTestAlternate.clicked.connect(self.testAlternate)
        self.btnClearOutput.clicked.connect(self.clearOutput)

        infoHost = "<center><table cellpadding='0' cellspacing='5'>"

        infoHost = infoHost + "<tr bgcolor='#6992c2'><td colspan = 2><center><b>" + const.APPLICATION_NAME + "</b></center></td></tr>"

        infoHost = infoHost + "<tr><td colspan = 2><center><i>" + const.BLAHBLAH_01 + "</i></center></td></tr>"
        infoHost = infoHost + "<tr><td colspan = 2><center><i>" + const.BLAHBLAH_02 + "</i></center></td></tr>"
        infoHost = infoHost + "<tr><td colspan = 2><center><i>" + const.BLAHBLAH_03 + "</i></center></td></tr>"
        infoHost = infoHost + "<tr><td colspan = 2><center><i>" + const.BLAHBLAH_04 + "</i></center></td></tr>"
        infoHost = infoHost + "<tr><td colspan = 2><center><i>" + const.BLAHBLAH_05 + "</i></center></td></tr>"
        infoHost = infoHost + "<tr><td colspan = 2>&nbsp;</td></tr>"

        infoHost = infoHost + "<tr><td><b>Author</b></td><td>" + const.AUTHOR + "</td></tr>"
        infoHost = infoHost + "<tr><td><b>Copyright</b></td><td>" + const.COPYRIGHT + "</td></tr>"
        infoHost = infoHost + "<tr><td><b>License</b></td><td>" + const.LICENSE + "</td></tr>"
        infoHost = infoHost + "<tr><td><b>Version</b></td><td>" + const.VERSION + "</td></tr>"
        infoHost = infoHost + "<tr><td><b>Email</b></td><td>" + const.EMAIL + "</td></tr>"
        infoHost = infoHost + "<tr><td><b>Organization Name</b></td><td>" + const.ORGANIZATION_NAME + "</td></tr>"
        infoHost = infoHost + "<tr><td><b>Organization Domain</b></td><td>" + const.ORGANIZATION_DOMAIN + "</td></tr>"
        infoHost = infoHost + "<tr><td colspan = 2>&nbsp;</td></tr>"

        infoHost = infoHost + "<tr bgcolor='#6992c2'><td colspan = 2><center><b>Host</b></center></td></tr>"

        infoHost = infoHost + "<tr><td><b>Hostname</b></td><td>" + socket.gethostname(
        ) + "</td></tr>"
        infoHost = infoHost + "<tr><td><b>Machine</b></td><td>" + platform.machine(
        ) + "</td></tr>"
        infoHost = infoHost + "<tr><td><b>Version</b></td><td>" + platform.version(
        ) + "</td></tr>"
        infoHost = infoHost + "<tr><td><b>Platform</b></td><td>" + platform.platform(
        ) + "</td></tr>"
        infoHost = infoHost + "<tr><td><b>System</b></td><td>" + platform.system(
        ) + "</td></tr>"
        infoHost = infoHost + "<tr><td><b>Processor</b></td><td>" + platform.processor(
        ) + "</td></tr>"
        infoHost = infoHost + "<tr><td colspan = 2>&nbsp;</td></tr>"
        infoHost = infoHost + "<tr><td><b>Python version</b></td><td>" + sys.version + "</td></tr>"
        infoHost = infoHost + "<tr><td colspan = 2>&nbsp;</td></tr>"

        infoHost = infoHost + "</table></center>"
        self.txtAbout.setText(infoHost)

        self.btnSaveTemplates.clicked.connect(self.saveTemplates)
        self.dirtyFlag = False
        parent.checkTemplatesFile()
        with open(const.TEMPLATES_FILE) as xmlFile:
            self.txtEditTemplates.setPlainText(str(xmlFile.read()))
        self.txtEditTemplates.textChanged.connect(self.changedText)
        self.txtEditTemplates.cursorPositionChanged.connect(
            self.cursorPosition)

        file_path = os.path.abspath(
            os.path.join(os.path.dirname(__file__), const.HELP_FILE))
        local_url = QUrl.fromLocalFile(file_path)
        self.webHelp.load(local_url)
        self.webHelp.show()
コード例 #39
0
 def __init__(self, datadir):
     QWidget.__init__(self)
     uic.loadUi("%s/designer/main.ui" % datadir, self)
コード例 #40
0
    def __init__(self, options, parent=None):
        QtGui.QMainWindow.__init__(self, parent)

        self.options = options

        # load and uic the file right away, no additional step necessary
        self.gui = uic.loadUi(
            os.path.join(os.path.dirname(__file__), 'ofdm_rx_gui_window.ui'),
            self)

        # GUI update timer
        self.update_timer = Qt.QTimer()

        # ZeroMQ
        self.probe_manager = zeromq.probe_manager()
        self.probe_manager.add_socket(
            "tcp://" + self.options.rx_hostname + ":5555", 'float32',
            self.plot_snr)
        self.probe_manager.add_socket(
            "tcp://" + self.options.rx_hostname + ":5556", 'float32',
            self.plot_ber)
        if options.measurement:
            self.probe_manager.add_socket(
                "tcp://" + self.options.rx_hostname + ":5556", 'float32',
                self.take_measurement)
        self.probe_manager.add_socket(
            "tcp://" + self.options.rx_hostname + ":5557", 'float32',
            self.plot_freqoffset)
        self.probe_manager.add_socket(
            "tcp://" + self.options.tx_hostname + ":4445", 'uint8',
            self.plot_rate)
        self.probe_manager.add_socket(
            "tcp://" + self.options.rx_hostname + ":5559", 'float32',
            self.plot_csi)
        self.probe_manager.add_socket(
            "tcp://" + self.options.rx_hostname + ":5560", 'complex64',
            self.plot_scatter)
        self.rpc_mgr_tx = zeromq.rpc_manager()
        self.rpc_mgr_tx.set_request_socket("tcp://" +
                                           self.options.tx_hostname + ":6660")
        self.rpc_mgr_rx = zeromq.rpc_manager()
        self.rpc_mgr_rx.set_request_socket("tcp://" +
                                           self.options.rx_hostname + ":5550")

        # Window Title
        self.gui.setWindowTitle("Receiver")

        #Plots
        self.gui.qwtPlotSNR.setAxisTitle(Qwt.QwtPlot.yLeft, "SNR[dB]")
        self.gui.qwtPlotSNR.setAxisScale(Qwt.QwtPlot.xBottom, 0, 127)
        self.gui.qwtPlotSNR.enableAxis(Qwt.QwtPlot.xBottom, False)
        self.gui.qwtPlotSNR.setAxisScale(Qwt.QwtPlot.yLeft, 0, 30)
        self.gui.qwtPlotSNR.setCanvasBackground(Qt.Qt.white)
        self.grid_snr = Qwt.QwtPlotGrid()
        self.grid_snr.setPen(Qt.QPen(Qt.Qt.black, 1, Qt.Qt.DotLine))
        self.grid_snr.attach(self.gui.qwtPlotSNR)
        self.snr_x = range(0, 128)
        self.snr_y = [0.0]
        self.curve_snr = Qwt.QwtPlotCurve()
        self.curve_snr.setPen(Qt.QPen(Qt.Qt.red, 1))
        self.curve_snr.setBrush(Qt.Qt.red)
        self.curve_snr.setStyle(Qwt.QwtPlotCurve.Steps)
        self.curve_snr.attach(self.gui.qwtPlotSNR)

        self.gui.qwtPlotBER.setAxisTitle(Qwt.QwtPlot.yLeft, "BER")
        self.gui.qwtPlotBER.setAxisScale(Qwt.QwtPlot.xBottom, 0, 127)
        self.gui.qwtPlotBER.enableAxis(Qwt.QwtPlot.xBottom, False)
        self.gui.qwtPlotBER.setAxisScale(Qwt.QwtPlot.yLeft, 0.0001, 0.5)
        self.gui.qwtPlotBER.setCanvasBackground(Qt.Qt.white)
        self.grid_ber = Qwt.QwtPlotGrid()
        self.grid_ber.setPen(Qt.QPen(Qt.Qt.black, 1, Qt.Qt.DotLine))
        self.grid_ber.attach(self.gui.qwtPlotBER)
        scale_engine = Qwt.QwtLog10ScaleEngine()
        self.gui.qwtPlotBER.setAxisScaleEngine(Qwt.QwtPlot.yLeft, scale_engine)
        self.ber_x = range(0, 128)
        self.ber_y = [0.0]
        self.curve_ber = Qwt.QwtPlotCurve()
        self.curve_ber.setBaseline(1e-100)
        self.curve_ber.setPen(Qt.QPen(Qt.Qt.green, 1))
        self.curve_ber.setBrush(Qt.Qt.green)
        self.curve_ber.setStyle(Qwt.QwtPlotCurve.Steps)
        self.curve_ber.attach(self.gui.qwtPlotBER)

        self.gui.qwtPlotFreqoffset.setAxisTitle(Qwt.QwtPlot.yLeft,
                                                "Frequency Offset")
        self.gui.qwtPlotFreqoffset.setAxisScale(Qwt.QwtPlot.xBottom, 0, 127)
        self.gui.qwtPlotFreqoffset.enableAxis(Qwt.QwtPlot.xBottom, False)
        self.gui.qwtPlotFreqoffset.setAxisScale(Qwt.QwtPlot.yLeft, -1, 1)
        self.gui.qwtPlotFreqoffset.setCanvasBackground(Qt.Qt.white)
        self.grid_freqoffset = Qwt.QwtPlotGrid()
        self.grid_freqoffset.setPen(Qt.QPen(Qt.Qt.black, 1, Qt.Qt.DotLine))
        self.grid_freqoffset.attach(self.gui.qwtPlotFreqoffset)
        self.freqoffset_x = range(0, 128)
        self.freqoffset_y = [0.0]
        self.curve_freqoffset = Qwt.QwtPlotCurve()
        self.curve_freqoffset.setPen(Qt.QPen(Qt.Qt.black, 1))
        self.curve_freqoffset.attach(self.gui.qwtPlotFreqoffset)

        self.gui.qwtPlotRate.setAxisTitle(Qwt.QwtPlot.yLeft,
                                          "Datarate[Mbits/s]")
        self.gui.qwtPlotRate.setAxisScale(Qwt.QwtPlot.xBottom, 0, 127)
        self.gui.qwtPlotRate.enableAxis(Qwt.QwtPlot.xBottom, False)
        self.gui.qwtPlotRate.setAxisScale(Qwt.QwtPlot.yLeft, 0, 10)
        self.gui.qwtPlotRate.setCanvasBackground(Qt.Qt.white)
        self.grid_rate = Qwt.QwtPlotGrid()
        self.grid_rate.setPen(Qt.QPen(Qt.Qt.black, 1, Qt.Qt.DotLine))
        self.grid_rate.attach(self.gui.qwtPlotRate)
        self.rate_x = range(0, 128)
        self.rate_y = [0] * len(self.rate_x)
        self.curve_rate = Qwt.QwtPlotCurve()
        self.curve_rate.setPen(Qt.QPen(Qt.Qt.lightGray, 1))
        self.curve_rate.setBrush(Qt.Qt.lightGray)
        self.curve_rate.setStyle(Qwt.QwtPlotCurve.Steps)
        self.curve_rate.attach(self.gui.qwtPlotRate)

        self.gui.qwtPlotCSI.setTitle("Normalized Channel State Information")
        self.gui.qwtPlotCSI.setAxisTitle(Qwt.QwtPlot.xBottom, "Subcarrier")
        self.gui.qwtPlotCSI.setAxisScale(Qwt.QwtPlot.xBottom, -99, 100)
        self.gui.qwtPlotCSI.setAxisScale(Qwt.QwtPlot.yLeft, 0, 2)
        self.gui.qwtPlotCSI.setCanvasBackground(Qt.Qt.white)
        self.grid_csi = Qwt.QwtPlotGrid()
        self.grid_csi.enableXMin(True)
        self.grid_csi.setPen(Qt.QPen(Qt.Qt.black, 1, Qt.Qt.DotLine))
        self.grid_csi.attach(self.gui.qwtPlotCSI)
        self.csi_x = range(-99, 101)
        self.csi_y = [0] * len(self.csi_x)
        self.curve_csi = Qwt.QwtPlotCurve()
        self.curve_csi.setPen(Qt.QPen(Qt.Qt.blue, 1))
        self.curve_csi.setBrush(Qt.Qt.blue)
        self.curve_csi.setStyle(Qwt.QwtPlotCurve.Steps)
        self.curve_csi.attach(self.gui.qwtPlotCSI)

        self.gui.qwtPlotScatter.setTitle("Scatterplot (Subcarrier -99)")
        self.gui.qwtPlotScatter.setAxisTitle(Qwt.QwtPlot.xBottom, "I")
        self.gui.qwtPlotScatter.setAxisTitle(Qwt.QwtPlot.yLeft, "Q")
        self.gui.qwtPlotScatter.setAxisScale(Qwt.QwtPlot.xBottom, -1.5, 1.5)
        self.gui.qwtPlotScatter.setAxisScale(Qwt.QwtPlot.yLeft, -1.5, 1.5)
        self.gui.qwtPlotScatter.setCanvasBackground(Qt.Qt.white)
        self.grid_scatter = Qwt.QwtPlotGrid()
        self.grid_scatter.setPen(Qt.QPen(Qt.Qt.black, 1, Qt.Qt.DotLine))
        self.grid_scatter.attach(self.gui.qwtPlotScatter)
        self.scatter_buffer = numpy.complex64([0 + 0j])
        self.curve_scatter = Qwt.QwtPlotCurve()
        self.curve_scatter.setPen(Qt.QPen(Qt.Qt.blue, 1))
        self.curve_scatter.setStyle(Qwt.QwtPlotCurve.Dots)
        self.curve_scatter.attach(self.gui.qwtPlotScatter)
        self.marker = Qwt.QwtSymbol()
        self.marker.setStyle(Qwt.QwtSymbol.XCross)
        self.marker.setSize(Qt.QSize(3, 3))
        self.curve_scatter.setSymbol(self.marker)

        # plot picker
        self.plot_picker = Qwt.QwtPlotPicker(Qwt.QwtPlot.xBottom,
                                             Qwt.QwtPlot.yLeft,
                                             Qwt.QwtPicker.PointSelection,
                                             Qwt.QwtPlotPicker.VLineRubberBand,
                                             Qwt.QwtPicker.AlwaysOff,
                                             self.gui.qwtPlotCSI.canvas())

        #Signals
        self.connect(self.update_timer, QtCore.SIGNAL("timeout()"),
                     self.probe_manager.watcher)
        self.connect(self.gui.pushButtonMeasure, QtCore.SIGNAL("clicked()"),
                     self.measure_average)
        #self.connect(self.gui.pushButtonUpdate, QtCore.SIGNAL("clicked()"), self.update_modulation)
        self.connect(self.gui.horizontalSliderAmplitude,
                     QtCore.SIGNAL("valueChanged(int)"), self.slide_amplitude)
        self.connect(self.gui.lineEditAmplitude,
                     QtCore.SIGNAL("editingFinished()"), self.edit_amplitude)
        self.connect(self.gui.horizontalSliderOffset,
                     QtCore.SIGNAL("valueChanged(int)"),
                     self.slide_freq_offset)
        self.connect(self.gui.lineEditOffset,
                     QtCore.SIGNAL("editingFinished()"), self.edit_freq_offset)
        self.connect(self.plot_picker,
                     QtCore.SIGNAL("selected(const QwtDoublePoint &)"),
                     self.subcarrier_selected)
        self.connect(self.gui.comboBoxChannelModel,
                     QtCore.SIGNAL("currentIndexChanged(QString)"),
                     self.set_channel_profile)
        self.connect(self.gui.horizontalSliderTxGain,
                     QtCore.SIGNAL("valueChanged(int)"), self.slide_tx_gain)
        self.connect(self.gui.horizontalSliderRxGain,
                     QtCore.SIGNAL("valueChanged(int)"), self.slide_rx_gain)
        self.connect(self.gui.comboBoxScheme,
                     QtCore.SIGNAL("currentIndexChanged(QString)"),
                     self.set_allocation_scheme)
        self.connect(self.gui.horizontalSliderDataRate,
                     QtCore.SIGNAL("valueChanged(int)"), self.slide_data_rate)
        self.connect(self.gui.lineEditDataRate,
                     QtCore.SIGNAL("editingFinished()"), self.edit_data_rate)
        self.connect(self.gui.horizontalSliderGap,
                     QtCore.SIGNAL("valueChanged(int)"), self.slide_target_ber)
        self.connect(self.gui.lineEditGap, QtCore.SIGNAL("editingFinished()"),
                     self.edit_target_ber)
        self.connect(self.gui.horizontalSliderResourceBlockSize,
                     QtCore.SIGNAL("valueChanged(int)"),
                     self.slide_resource_block_size)
        self.connect(self.gui.lineEditResourceBlockSize,
                     QtCore.SIGNAL("editingFinished()"),
                     self.edit_resource_block_size)
        self.connect(self.gui.comboBoxResourceBlocksScheme,
                     QtCore.SIGNAL("currentIndexChanged(QString)"),
                     self.set_resource_block_scheme)
        self.connect(self.gui.comboBoxModulation,
                     QtCore.SIGNAL("currentIndexChanged(QString)"),
                     self.set_modulation_scheme)

        if options.measurement:
            self.rpc_mgr_tx.request("set_amplitude", [0.018])
            self.rpc_mgr_tx.request("set_amplitude_ideal", [0.018])
            self.i = 0
            self.ii = 0
            self.iii = 1
            self.ber = 0.0
            self.snr = 0.0
            self.snrsum = 0.0
            self.datarate = 0.0
            self.ratesum = 0.0
            self.dirname = "Simulation_" + strftime("%Y_%m_%d_%H_%M_%S",
                                                    gmtime()) + "/"
            print self.dirname
            if not os.path.isdir("./" + self.dirname):
                os.mkdir("./" + self.dirname + "/")
            self.iter_points = 60
            self.snr_points = 30
            amp_min_log = numpy.log10(0.018**2)
            amp_max_log = numpy.log10(0.7**2)
            self.txpow_range = numpy.logspace(amp_min_log, amp_max_log,
                                              self.snr_points)
            self.meas_ber = 0.5
            self.change_mod = 1

        # start GUI update timer (33ms for 30 FPS)
        self.update_timer.start(33)

        # get transmitter settings
        self.update_tx_params()
コード例 #41
0
 def __init__(self):
     super(MyWindow, self).__init__()
     uic.loadUi('updater_qt/updater.ui', self)
     self.show()
コード例 #42
0
    def __init__(self, pathToLogs, trayIcon, backGroundColor):

        QtGui.QMainWindow.__init__(self)
        self.cache = Cache()

        if backGroundColor:
            self.setStyleSheet("QWidget { background-color: %s; }" %
                               backGroundColor)
        uic.loadUi(resourcePath('vi/ui/MainWindow.ui'), self)
        self.setWindowTitle("Vintel " + vi.version.VERSION + "{dev}".format(
            dev="-SNAPSHOT" if vi.version.SNAPSHOT else ""))
        self.taskbarIconQuiescent = QtGui.QIcon(
            resourcePath("vi/ui/res/logo_small.png"))
        self.taskbarIconWorking = QtGui.QIcon(
            resourcePath("vi/ui/res/logo_small_green.png"))
        self.setWindowIcon(self.taskbarIconQuiescent)
        self.setFocusPolicy(QtCore.Qt.StrongFocus)

        self.pathToLogs = pathToLogs
        self.mapTimer = QtCore.QTimer(self)
        self.connect(self.mapTimer, SIGNAL("timeout()"), self.updateMapView)
        self.clipboardTimer = QtCore.QTimer(self)
        self.oldClipboardContent = ""
        self.trayIcon = trayIcon
        self.trayIcon.activated.connect(self.systemTrayActivated)
        self.clipboard = QtGui.QApplication.clipboard()
        self.clipboard.clear(mode=self.clipboard.Clipboard)
        self.alarmDistance = 0
        self.lastStatisticsUpdate = 0
        self.chatEntries = []
        self.frameButton.setVisible(False)
        self.scanIntelForKosRequestsEnabled = True
        self.initialMapPosition = None
        self.mapPositionsDict = {}

        # Load user's toon names
        self.knownPlayerNames = self.cache.getFromCache("known_player_names")
        if self.knownPlayerNames:
            self.knownPlayerNames = set(self.knownPlayerNames.split(","))
        else:
            self.knownPlayerNames = set()
            diagText = "Vintel scans EVE system logs and remembers your characters as they change systems.\n\nSome features (clipboard KOS checking, alarms, etc.) may not work until your character(s) have been registered. Change systems, with each character you want to monitor, while Vintel is running to remedy this."
            QMessageBox.warning(None, "Known Characters not Found", diagText,
                                "Ok")

        # Set up user's intel rooms
        roomnames = self.cache.getFromCache("room_names")
        if roomnames:
            roomnames = roomnames.split(",")
        else:
            roomnames = (u"TheCitadel", u"North Provi Intel",
                         u"North Catch Intel", "North Querious Intel")
            self.cache.putIntoCache("room_names", u",".join(roomnames),
                                    60 * 60 * 24 * 365 * 5)
        self.roomnames = roomnames

        # Disable the sound UI if sound is not available
        if not SoundManager().soundAvailable:
            self.changeSound(disable=True)
        else:
            self.changeSound()

        # Set up Transparency menu - fill in opacity values and make connections
        self.opacityGroup = QActionGroup(self.menu)
        for i in (100, 80, 60, 40, 20):
            action = QAction("Opacity {0}%".format(i), None, checkable=True)
            if i == 100:
                action.setChecked(True)
            action.opacity = i / 100.0
            self.connect(action, SIGNAL("triggered()"), self.changeOpacity)
            self.opacityGroup.addAction(action)
            self.menuTransparency.addAction(action)

        #
        # Platform specific UI resizing - we size items in the resource files to look correct on the mac,
        # then resize other platforms as needed
        #
        if sys.platform.startswith("win32") or sys.platform.startswith(
                "cygwin"):
            font = self.statisticsButton.font()
            font.setPointSize(8)
            self.statisticsButton.setFont(font)
            self.jumpbridgesButton.setFont(font)
        elif sys.platform.startswith("linux"):
            pass

        self.wireUpUIConnections()
        self.recallCachedSettings()
        self.setupThreads()
        self.setupMap(True)
コード例 #43
0
 def __init__(self):
     super(Proje, self).__init__()
     uic.loadUi('Proje.ui', self)
     self.connect(self.pushButton, SIGNAL("pressed()"), self.hesapla)
     self.show()
コード例 #44
0
ファイル: valueRangeWidget.py プロジェクト: burcin/volumina
 def _initUic(self):
     p = os.path.split(__file__)[0] + '/'
     if p == "/": p = "." + p
     uic.loadUi(p + "ui/valueRangeWidget.ui", self)
コード例 #45
0
 def __init__(self):
     QtGui.QWidget.__init__(self)
     uic.loadUi(uic.getUiPath('sendcoins.ui'), self)
コード例 #46
0
ファイル: MDK2QT.py プロジェクト: lixuyongmt/MDK2QT
    def __init__(self, parent=None):
        super(MDK2QT, self).__init__(parent)
        
        uic.loadUi('MDK2QT.ui', self)

        self.initSetting()
コード例 #47
0
    def __init__(self, i, variables, limits, nodename):
        super(EditMember, self).__init__(None, QtCore.Qt.WindowStaysOnTopHint)
        uic.loadUi('memberEdit.ui', self)
        self.setModal(True)

        ## Puntatore alla variabile di classe MyWindow del modulo maingui.py
        self.main_ref = None
        ## @var _main_ref

        ##Lista di dizionari, dove ogni dizionario corrisponde ad un singolo aggettivo della variabile linguistica
        self.nodeVariables = variables
        ## @var _nodeVariables

        ##Lista di booleani usata per verificare che i campi dell' aggettivo corrente siano accettabili
        self.checkList = [False, False, False, False, False, False, False, False, False]
        ## @var _checkList

        ## Nome del nodo di cui stiamo modificando l'aggettivo
        self.nodename = nodename
        ## @var _nodename

        ## Lista che contiene i valori dei campi temporanei dell'aggetivo corrente 
        self.values = [0, 0, 0, 0, 0, 0, 0, 0, 0]
        ## @var _values
        
        ## Puntatore alla variabile di classe Membership del modulo membership.py
        self.member = None 
        ## @var _member
        
        #variabile che contiene il valore minimo che una coordinata x di un punto può avere
        self.min = limits[0]
        ## @var _min

        #variabile che contiene il valore massimo che una coordinata x di un punto può avere
        self.max = limits[1]
        ## @var _max

        #collegamenti segnali slot
        self.cbType.currentIndexChanged.connect(self.cbChange)
        self.leName.textChanged.connect(self.checkName)
        self.leX1.textChanged.connect(self.checkX1)
        self.leY1.textChanged.connect(self.checkY1)
        self.leX2.textChanged.connect(self.checkX2)
        self.leY2.textChanged.connect(self.checkY2)
        self.leX3.textChanged.connect(self.checkX3)
        self.leY3.textChanged.connect(self.checkY3)
        self.leX4.textChanged.connect(self.checkX4)
        self.leY4.textChanged.connect(self.checkY4)
        self.btnCancel.clicked.connect(self.cancel)
        self.btnAdd.clicked.connect(self.updateAdj)

        #inserimento dati nelle lineEdit
        variable = self.nodeVariables[i]
        self.index = i
        self.leName.setText(variable['name'])
        self.leX1.setText(str(variable['P1'][0]))
        self.leY1.setText(str(variable['P1'][1]))
        self.leX2.setText(str(variable['P2'][0]))
        self.leY2.setText(str(variable['P2'][1]))
        self.leX3.setText(str(variable['P3'][0]))
        self.leY3.setText(str(variable['P3'][1]))
        
        if variable['type'] == 'Trapeze':
            self.cbType.setCurrentIndex(1)
            self.leX4.setText(str(variable['P4'][0]))
            self.leY4.setText(str(variable['P4'][1]))
コード例 #48
0
ファイル: qtutil.py プロジェクト: tpkalman/glue
def _load_ui_pyqt4(path, parent):
    from PyQt4.uic import loadUi
    return loadUi(path, parent)
コード例 #49
0
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)

        # Set the default name of the ini file; used to load/save GUI settings
        self.ini_name = 'pySecMaster_gui.ini'

        # Load the GUI structure from the ui file
        uic.loadUi('main_gui.ui', self)

        # Establish all menu bar connections
        self.actionLoad_Settings.triggered.connect(lambda: self.select_restore())
        self.actionSave_Settings.triggered.connect(lambda: self.save_settings(self.ini_name))
        self.actionStart.triggered.connect(self.process)
        self.actionExit.triggered.connect(lambda: self.confirm_close(self.ini_name))
        self.actionPySecMaster.triggered.connect(lambda: self.open_url('https://github.com/camisatx/pySecMaster'))
        self.actionCSI_Data.triggered.connect(lambda: self.open_url('http://www.csidata.com/'))
        self.actionGoogle_Finance.triggered.connect(lambda: self.open_url('https://www.google.com/finance'))
        self.actionQuandl.triggered.connect(lambda: self.open_url('https://www.quandl.com/'))
        self.actionInstall_PostgreSQL.triggered.connect(lambda: self.open_url('http://www.postgresql.org/download/'))
        self.actionInstall_Psycopg.triggered.connect(lambda: self.open_url('http://initd.org/psycopg/docs/install.html'))
        self.actionJosh_Schertz.triggered.connect(lambda: self.open_url('https://joshschertz.com/'))

        # Establish all form button connections
        self.toolbtn_details.clicked.connect(self.txtbrwsr_details_toggle)
        self.btnbox_action.button(self.btnbox_action.Ok).\
            clicked.connect(self.process)
        self.btnbox_action.button(self.btnbox_action.Abort).\
            clicked.connect(self.worker_finished)
        self.btnbox_action.button(self.btnbox_action.Cancel).\
            clicked.connect(lambda: self.confirm_close(self.ini_name))

        # Set the default items for 'Quandl Databases'
        quandl_databases_index = self.cmb_tickers_quandl_db.findText('WIKI')
        self.cmb_tickers_quandl_db.setCurrentIndex(quandl_databases_index)

        # Hide the data fields if data won't be downloaded for them
        self.data_provider_toggle()
        # If 'Download Source' (Data tab) is changed, re-run the
        # data_provider_toggle method to re-process items
        self.cmb_data_source.currentIndexChanged.\
            connect(self.data_provider_toggle)
        self.cmb_data_source.currentIndexChanged.\
            connect(self.data_selection_toggle)

        # Modify the combobox items of 'Selection' (Data tab) to make sure it
        # only shows valid options.
        self.data_selection_toggle()

        # Hide the details text browser by default
        # ToDo: Doesn't hide at startup; .isVisible() always returned 'False'
        self.txtbrwsr_details_toggle()

        # Hide the Abort button; only show when pySecMaster function is running
        self.btnbox_action.button(self.btnbox_action.Abort).hide()
        # Change the default name from 'Abort' to 'Stop'
        self.btnbox_action.button(self.btnbox_action.Abort).setText('Stop')

        # ToDo: Integrate the progress bar
        self.progressBar.hide()

        # Load the prior settings if a ini files exists
        if os.path.isfile(self.ini_name):
            self.restore_settings(self.ini_name)
コード例 #50
0
ファイル: ProjectUi.py プロジェクト: yuanjianye/seascope
	def __init__(self):
		QDialog.__init__(self)

		self.ui = uic.loadUi('ui/project_settings.ui', self)
コード例 #51
0
    def __init__(self):
        print os.getcwd()

        print "arguments(%d):" % len(sys.argv)
        for argument in sys.argv:
            print argument

        QtGui.QMainWindow.__init__(self)
        uic.loadUi('ui/MainWindow.ui', self)

        # load ini
        self.settings = QtCore.QSettings("linuxac.org", "TuxCut")
        if self.settings.value("Language") == "English":
            self.actionArabic.setChecked(False)
            self.actionEnglish.setChecked(True)

        if not len(sys.argv) == 2:
            self.actionHideTrayIcon.triggered.connect(self.toggle_tray_icon)
        else:
            self.actionHideTrayIcon.setVisible(False)

        # List Available network interfaces
        ifaces_names = []
        ifaces_macs = []
        ifaces = QtNetwork.QNetworkInterface.allInterfaces()
        for i in ifaces:
            ifaces_names.append(str(i.name()))
            ifaces_macs.append(str(i.hardwareAddress()))
        Result, ok = QtGui.QInputDialog.getItem(
            self, self.tr("Network Interfaces"),
            self.tr("Select your Interface:"), ifaces_names, 0, True)
        if ok:
            self._iface = Result
            self._my_mac = ifaces_macs[ifaces_names.index(Result)]
            for j in ifaces_names:
                self.comboIfaces.addItem(j)
            self.comboIfaces.setCurrentIndex(
                ifaces_names.index(Result)
            )  # Set the selected interface card in the main windows comboBox
        else:
            self.msg(
                self.tr(
                    "You must select an interface card , TuxCut Will close"))
            exit(0)

        self._args_len = len(sys.argv)
        self.hide_tray_icon = False
        self._trayMessageTimeout = 1000
        self._gwMAC = None
        self._isProtected = False
        self._isFedora = False
        self.check_fedora()
        self._isQuit = False
        self._cutted_hosts = {}
        self._killed_hosts = {}
        self.table_hosts.setSelectionMode(
            QtGui.QAbstractItemView.ExtendedSelection)
        self.show_Window()
        self._gwIP = self.default_gw()
        self._sudo = 'sudo'
        if self._gwIP == None:
            self.msg(self.tr("TuxCut couldn't detect the gateway IP address"))
        self._gwMAC = self.gw_mac(self._gwIP)
        if self._my_mac == None:
            self.msg(self.tr("TuxCut couldn't detect your MAC address"))
        else:
            self.lbl_mac.setText(self._my_mac)

        if not self._gwMAC == None:
            self.enable_protection()
        else:
            self.msg(
                self.
                tr("TuxCut couldn't detect the gateway MAC address\nThe protection mode couldn't be enabled"
                   ))
        self.list_hosts(self._gwIP)
コード例 #52
0
    def __init__(self):
        super(Membership, self).__init__(None, QtCore.Qt.WindowStaysOnTopHint)
        uic.loadUi('membershipeditor.ui', self)
        
        #finestra MODALE
        self.setModal(True)

        ## Puntatore alla variabile di classe MyWindow del modulo maingui.py
        self.main_ref = None
        ## @var _main_ref
        
        ## Variabile booleana che stabilisce se è la prima apertura della dialog o meno
        self.firstOpen = True
        ## @var _firstOpen
        
        ## Variabile booleana che stabilisce se ci sono state modifica da salvare e rilanciare simulazione
        self.changeSomething = False
        ## @var _changeSomething 
        
        ##lista di dizionari, dove ogni dizionario corrisponde ad un singolo aggettivo della variabile linguistica
        self.nodeVariables = []
        ## @var _nodeVariables

        ##Lista di booleani usata per verificare che i campi dell' aggettivo corrente siano accettabili
        self.checkList = [False, False, False, False, False, False, False, False, False]
        ## @var _checkList
        
        ##contiene i valori dei campi temporanei dell'aggetivo corrente prima che venga cliccato add
        self.values = [0, 0, 0, 0, 0, 0, 0, 0, 0]
        ## @var _values

        ##lista di plot di Membership che saranno da riplottare dopo aver chiuso la Dialog Membership
        self.toReplot = None
        ## @var _toReplo

        ##lista di plot di Gruppi che saranno da riplottare dopo aver chiuso la Dialog Membership
        self.toReplotGroups = None
        ## @var _toReplotGroups

        #settaggio default bottoni
        self.btnAdd.setEnabled(False)
        self.btnEdit.setEnabled(False)
        self.btnDelete.setEnabled(False)
        self.btn_load2.setEnabled(False)
        self.btn_load3.setEnabled(False)

        #collegamenti segnali slot
        self.btnDelete.clicked.connect(self.removeItem)
        self.cbType.currentIndexChanged.connect(self.cbChange)
        self.btnAdd.clicked.connect(self.addItem)
        self.btnEdit.clicked.connect(self.editItem)
        self.node_box.activated.connect(self.updateLingset)
        self.leName.textChanged.connect(self.checkName)
        self.leX1.textChanged.connect(self.checkX1)
        self.leY1.textChanged.connect(self.checkY1)
        self.leX2.textChanged.connect(self.checkX2)
        self.leY2.textChanged.connect(self.checkY2)
        self.leX3.textChanged.connect(self.checkX3)
        self.leY3.textChanged.connect(self.checkY3)
        self.leX4.textChanged.connect(self.checkX4)
        self.leY4.textChanged.connect(self.checkY4)
        self.listItem.currentRowChanged.connect(self.ableEditDelete)
        self.btnSet.clicked.connect(self.setMaxMinValue)
        self.finished.connect(self.close)
        self.btn_load2.clicked.connect(lambda: self.addSample(2))
        self.btn_load3.clicked.connect(lambda: self.addSample(3))
コード例 #53
0
 def __init__(self):
     super(SIRwbadGroupBox, self).__init__()
     loadUi(cwd + '/sirwbadgroupbox.ui', self)
コード例 #54
0
	def __init__(self, name,  *args, **keys):
		super(OTModuleProjectItem, self).__init__(name)
		
		self._iconFile = keys['iconFile']
		self._parentModule = None
		if 'uiFile' in keys.keys(): self._form = uic.loadUi( keys['uiFile'] )
コード例 #55
0
 def dialog(self, filename):
     D = QDialog(self.window)
     uic.loadUi(filename, D)
     return D
コード例 #56
0
 def __init__(self):
     super(SIRvaccineGroupBox, self).__init__()
     loadUi(cwd + '/sirvaccinegroupbox.ui', self)
コード例 #57
0
ファイル: fast-gui.py プロジェクト: karpov-sv/fast
    def __init__(self):
        super(FastGUI, self).__init__()

        ## UI
        self.ui = uic.loadUi("gui/mainwindow.ui", self)

        ## Timer for periodic request of daemon state
        self.timer = QTimer()
        self.timer.setSingleShot(True)
        self.connect(self.timer, SIGNAL("timeout()"), self.slotTimerEvent)

        ## Timer for periodic request of current image
        self.timerImage = QTimer()
        self.timerImage.setSingleShot(True);
        self.connect(self.timerImage, SIGNAL("timeout()"), self.slotTimerImageEvent)

        ## Socket connection to daemon
        self.socket = QTcpSocket()
        self.hw_host = "localhost"
        self.hw_port = 5555
        self.connect(self.socket, SIGNAL("connected()"), self.slotConnected)
        self.connect(self.socket, SIGNAL("disconnected()"), self.slotDisconnected)
        self.connect(self.socket, SIGNAL("readyRead()"), self.slotReadyRead)
        self.connect(self.socket, SIGNAL("error(QAbstractSocket::SocketError)"), self.slotSocketError)
        self.binaryMode = False
        self.binaryLength = 0
        self.binaryType = ""
        self.socketBuffer = ""

        ## Current image view
        self.currentImage = Frame()
        self.currentImage.setWindowTitle("Current Frame")
        self.connect(self.currentImage, SIGNAL("roiChanged"), self.slotRoiChanged)
        self.connect(self.currentImage, SIGNAL("roiReset"), self.slotRoiReset)

        ## Running image view
        self.runningImage = Frame()
        self.runningImage.setWindowTitle("Running Average Frame")
        self.connect(self.runningImage, SIGNAL("roiChanged"), self.slotRoiChanged)
        self.connect(self.runningImage, SIGNAL("roiReset"), self.slotRoiReset)

        ## Total image view
        self.totalImage = Frame()
        self.totalImage.setWindowTitle("Cumulative Frame")
        self.connect(self.totalImage, SIGNAL("roiChanged"), self.slotRoiChanged)
        self.connect(self.totalImage, SIGNAL("roiReset"), self.slotRoiReset)

        ## Flux plot
        self.fluxPlot = Plot()
        self.fluxPlot.setWindowTitle("Full Frame Flux / 1000 frames")
        self.fluxPlot.maxLength = 1000

        self.totalPlot = Plot()
        self.totalPlot.setWindowTitle("Full Frame Flux / complete")

        ## Buttons
        self.connect(self.ui.pushButtonAcquisitionStart, SIGNAL("clicked()"),
                     lambda : self.sendCommand("start"))
        self.connect(self.ui.pushButtonAcquisitionStop, SIGNAL("clicked()"),
                     lambda : self.sendCommand("stop"))
        self.connect(self.ui.pushButtonStorageStart, SIGNAL("clicked()"),
                     lambda: self.sendCommand("storage_start object=" + self.ui.lineEditObject.text()))
        self.connect(self.ui.pushButtonStorageStop, SIGNAL("clicked()"),
                     lambda: self.sendCommand("storage_stop"))

        ## Countdown
        self.ui.lineEditCountdown.setValidator(QIntValidator(0, 1000000))
        self.connect(self.ui.lineEditCountdown, SIGNAL("returnPressed()"),
                     lambda: self.sendCommand("set_countdown " + str(self.ui.lineEditCountdown.text())))

        ## Command line
        self.connect(self.ui.lineEditCommand, SIGNAL("returnPressed()"),
                     lambda: self.sendCommand(self.ui.lineEditCommand.text()))

        ## Check boxes
        self.connect(self.ui.checkBoxCurrentImage, SIGNAL("stateChanged(int)"),
                     lambda i: self.currentImage.show() if i else self.currentImage.hide())
        self.connect(self.currentImage, SIGNAL("closed()"),
                     lambda : self.ui.checkBoxCurrentImage.setCheckState(False))

        self.connect(self.ui.checkBoxRunningImage, SIGNAL("stateChanged(int)"),
                     lambda i: self.runningImage.show() if i else self.runningImage.hide())
        self.connect(self.runningImage, SIGNAL("closed()"),
                     lambda : self.ui.checkBoxRunningImage.setCheckState(False))

        self.connect(self.ui.checkBoxTotalImage, SIGNAL("stateChanged(int)"),
                     lambda i: self.totalImage.show() if i else self.totalImage.hide())
        self.connect(self.totalImage, SIGNAL("closed()"),
                     lambda : self.ui.checkBoxTotalImage.setCheckState(False))

        self.connect(self.ui.checkBoxFlux, SIGNAL("stateChanged(int)"),
                     lambda i: self.fluxPlot.show() if i else self.fluxPlot.hide())
        self.connect(self.fluxPlot, SIGNAL("closed()"),
                     lambda : self.ui.checkBoxFlux.setCheckState(False))

        self.connect(self.ui.checkBoxTotalFlux, SIGNAL("stateChanged(int)"),
                     lambda i: self.totalPlot.show() if i else self.totalPlot.hide())
        self.connect(self.totalPlot, SIGNAL("closed()"),
                     lambda : self.ui.checkBoxTotalFlux.setCheckState(False))

        self.connect(self.ui.actionReconnectToDaemon, SIGNAL("activated()"), self.slotReconnect)
        self.connect(self.ui.actionRestartImageTimer, SIGNAL("activated()"), self.slotTimerImageEvent)

        self.connect(self.ui.actionCommandsExit, SIGNAL("activated()"), lambda: self.sendCommand("exit"))

        self.connect(self.ui.spinBoxPostprocess, SIGNAL("valueChanged(int)"),
                     lambda i: self.sendCommand("set_postprocess %d" % (i)))
        #self.connect(self.ui.doubleSpinBoxExposure, SIGNAL("valueChanged(double)"),
        #             lambda d: self.sendCommand("set_grabber exposure=%g" % (d)))
        self.connect(self.ui.doubleSpinBoxExposure, SIGNAL("editingFinished()"),
                     lambda : self.sendCommand("set_grabber exposure=%g" % (self.ui.doubleSpinBoxExposure.value())))

        ## Initial focus to command line
        self.ui.lineEditCommand.setFocus()
        self.ui.lineEditCommand.history = []
        self.ui.lineEditCommand.historyPos = 0
        self.ui.lineEditCommand.keyPressEvent = types.MethodType(lineKeyPressEvent, self.ui.lineEditCommand)
コード例 #58
0
 def __init__(self):
     super(SIRsimpleGroupBox, self).__init__()
     loadUi(cwd + '/sirsimplegroupbox.ui', self)
コード例 #59
0
    def __init__(self, mmc):
        #QtGui.QWidget.__init__(self)
        super(ASI_AutoFocus, self).__init__()
        currpath = os.path.split(os.path.realpath(__file__))[0]
        filename = os.path.join(currpath, 'ASI_Interface.ui')
        uic.loadUi(filename, self)
        self.show()
        # loader = QtUiTools.QUiLoader()
        #file = QtCore.QFile(filename)
        #file.open(QtCore.QFile.ReadOnly)
        # self.Alfred = loader.load(file,self)
        #file.close()

        #QtGui.QWidget.__init__(self)
        # Ui_MainWindow.__init__(self)
        self.mmc = mmc

        self.XY_label = 'XYStage:XY:31'
        self.Z_label = 'ZStage:Z:32'
        self.PIEZO_label = 'PiezoStage:P:34'
        self.CRISP_label = 'CRISPAFocus:P:34'
        self.TIGER_label = 'TigerCommHub'
        self.TIGER_port = self.mmc.getProperty(self.TIGER_label,
                                               'SerialComPort')

        # self.setupUi(self)
        self.cam = self.mmc.getCameraDevice()
        #self.get_position.clicked.connect(self.UpdatePos) #connects to the position button named GetPos
        self.take_picture.clicked.connect(
            self.TakePic)  #connects to the camera button
        self.start_vid.clicked.connect(self.StartVideo)
        self.stop_vid.clicked.connect(self.StopVideo)
        self.get_focus.clicked.connect(self.GetFocus)
        self.get_exposure.clicked.connect(self.GetExposure)
        self.inc_exposure.clicked.connect(self.IncExposure)
        self.dec_exposure.clicked.connect(self.DecExposure)
        self.prop_browser.clicked.connect(self.GetProperties)
        self.idle_button.clicked.connect(self.Idle)
        self.dither_button.clicked.connect(self.Dither)
        self.lock_button.clicked.connect(self.Lock)
        self.unlock_button.clicked.connect(self.Unlock)
        self.reset_offset_button.clicked.connect(self.ResetOffset)
        self.log_cal_button.clicked.connect(self.LogCal)
        self.obj_NA.returnPressed.connect(self.GetObjNA)
        self.LED_spinbox.editingFinished.connect(self.SetLEDIntensity)
        self.set_gain_button.clicked.connect(self.SetGain)
        self.home_button.clicked.connect(self.GoHome)
        self.map_surface_button.clicked.connect(self.MapSurface2_0)
        self.reset_piezo.clicked.connect(self.ResetPiezo)
        self.center_xy.clicked.connect(self.CenterXY)
        self.define_home.clicked.connect(self.DefineHome)
        self.Z_stack.clicked.connect(self.TakeZstack)
        self.z_map.clicked.connect(self.ZMap)
        self.start_pos_timer.clicked.connect(self.startPosTimer)
        self.hw_center_x.clicked.connect(self.CenterX)
        self.hw_center_y.clicked.connect(self.CenterY)
        self.array_map.clicked.connect(self.ArrayMap)

        self.get_xy_speed.clicked.connect(self.GetXYSpeed)

        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)

        self.PosTimer = QtCore.QTimer(self)
        self.connect(self.PosTimer, QtCore.SIGNAL("timeout()"), self.UpdatePos)
        self.PosTimer.start(200)

        self.VideoTimer = QtCore.QTimer(self)
        self.connect(self.VideoTimer, QtCore.SIGNAL("timeout()"),
                     self.UpdateVideo)
        self.ChannelsComboBox.addItems(
            self.mmc.getAvailableConfigs('Channels'))
        self.ChannelsComboBox.currentIndexChanged[str].connect(
            self.changeChannel)

        self.ended = False
コード例 #60
0
    def __init__(self, app, params):
        QtGui.QMainWindow.__init__(self)
        self.params = params
        self.app = app
        ui_file = pkg_resources.resource_filename(__name__, 'gui.ui')
        self.ui = uic.loadUi(ui_file, self)
        self.ui.show()
        self.ui.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.ui.tab_widget.setCurrentIndex(0)
        self.ui.slice_dock.setVisible(False)
        self.ui.volume_dock.setVisible(False)
        self.ui.axis_view_widget.setVisible(False)
        self.slice_viewer = None
        self.volume_viewer = None
        self.overlap_viewer = tofu.vis.qt.OverlapViewer()
        self.get_values_from_params()

        log_handler = CallableHandler(self.on_log_record)
        log_handler.setLevel(logging.DEBUG)
        log_handler.setFormatter(logging.Formatter('%(name)s: %(message)s'))
        root_logger = logging.getLogger('')
        root_logger.setLevel(logging.DEBUG)
        root_logger.handlers = [log_handler]

        self.ui.input_path_button.setToolTip(
            'Path to projections or sinograms')
        self.ui.proj_button.setToolTip('Denote if path contains projections')
        self.ui.y_step.setToolTip(self.get_help('reading', 'y-step'))
        self.ui.method_box.setToolTip(
            self.get_help('tomographic-reconstruction', 'method'))
        self.ui.axis_spin.setToolTip(
            self.get_help('tomographic-reconstruction', 'axis'))
        self.ui.angle_step.setToolTip(self.get_help('reconstruction', 'angle'))
        self.ui.angle_offset.setToolTip(
            self.get_help('tomographic-reconstruction', 'offset'))
        self.ui.oversampling.setToolTip(self.get_help('dfi', 'oversampling'))
        self.ui.iterations_sart.setToolTip(
            self.get_help('ir', 'num-iterations'))
        self.ui.relaxation.setToolTip(
            self.get_help('sart', 'relaxation-factor'))
        self.ui.output_path_button.setToolTip(
            self.get_help('general', 'output'))
        self.ui.ffc_box.setToolTip(self.get_help('gui', 'ffc-correction'))
        self.ui.interpolate_button.setToolTip(
            'Interpolate between two sets of flat fields')
        self.ui.darks_path_button.setToolTip(
            self.get_help('flat-correction', 'darks'))
        self.ui.flats_path_button.setToolTip(
            self.get_help('flat-correction', 'flats'))
        self.ui.flats2_path_button.setToolTip(
            self.get_help('flat-correction', 'flats2'))
        self.ui.path_button_0.setToolTip(self.get_help('gui', 'deg0'))
        self.ui.path_button_180.setToolTip(self.get_help('gui', 'deg180'))

        self.ui.input_path_button.clicked.connect(self.on_input_path_clicked)
        self.ui.sino_button.clicked.connect(self.on_sino_button_clicked)
        self.ui.proj_button.clicked.connect(self.on_proj_button_clicked)
        self.ui.region_box.clicked.connect(self.on_region_box_clicked)
        self.ui.method_box.currentIndexChanged.connect(self.change_method)
        self.ui.axis_spin.valueChanged.connect(self.change_axis_spin)
        self.ui.angle_step.valueChanged.connect(self.change_angle_step)
        self.ui.output_path_button.clicked.connect(self.on_output_path_clicked)
        self.ui.ffc_box.clicked.connect(self.on_ffc_box_clicked)
        self.ui.interpolate_button.clicked.connect(
            self.on_interpolate_button_clicked)
        self.ui.darks_path_button.clicked.connect(self.on_darks_path_clicked)
        self.ui.flats_path_button.clicked.connect(self.on_flats_path_clicked)
        self.ui.flats2_path_button.clicked.connect(self.on_flats2_path_clicked)
        self.ui.ffc_options.currentIndexChanged.connect(
            self.change_ffc_options)
        self.ui.reco_button.clicked.connect(self.on_reconstruct)
        self.ui.path_button_0.clicked.connect(self.on_path_0_clicked)
        self.ui.path_button_180.clicked.connect(self.on_path_180_clicked)
        self.ui.show_slices_button.clicked.connect(self.on_show_slices_clicked)
        self.ui.show_volume_button.clicked.connect(self.on_show_volume_clicked)
        self.ui.run_button.clicked.connect(self.on_compute_center)
        self.ui.save_action.triggered.connect(self.on_save_as)
        self.ui.clear_action.triggered.connect(self.on_clear)
        self.ui.clear_output_dir_action.triggered.connect(
            self.on_clear_output_dir_clicked)
        self.ui.open_action.triggered.connect(self.on_open_from)
        self.ui.close_action.triggered.connect(self.close)
        self.ui.about_action.triggered.connect(self.on_about)
        self.ui.extrema_checkbox.clicked.connect(
            self.on_remove_extrema_clicked)
        self.ui.overlap_opt.currentIndexChanged.connect(
            self.on_overlap_opt_changed)
        self.ui.input_path_line.textChanged.connect(self.on_input_path_changed)

        self.ui.y_step.valueChanged.connect(
            lambda value: self.change_value('y_step', value))
        self.ui.angle_offset.valueChanged.connect(
            lambda value: self.change_value('offset', value))
        self.ui.oversampling.valueChanged.connect(
            lambda value: self.change_value('oversampling', value))
        self.ui.iterations_sart.valueChanged.connect(
            lambda value: self.change_value('num_iterations', value))
        self.ui.relaxation.valueChanged.connect(
            lambda value: self.change_value('relaxation_factor', value))
        self.ui.output_path_line.textChanged.connect(
            lambda value: self.change_value(
                'output', str(self.ui.output_path_line.text())))
        self.ui.darks_path_line.textChanged.connect(
            lambda value: self.change_value(
                'darks', str(self.ui.darks_path_line.text())))
        self.ui.flats_path_line.textChanged.connect(
            lambda value: self.change_value(
                'flats', str(self.ui.flats_path_line.text())))
        self.ui.flats2_path_line.textChanged.connect(
            lambda value: self.change_value(
                'flats2', str(self.ui.flats2_path_line.text())))
        self.ui.fix_naninf_box.clicked.connect(lambda value: self.change_value(
            'fix_nan_and_inf', self.ui.fix_naninf_box.isChecked()))
        self.ui.absorptivity_box.clicked.connect(
            lambda value: self.change_value(
                'absorptivity', self.ui.absorptivity_box.isChecked()))
        self.ui.path_line_0.textChanged.connect(
            lambda value: self.change_value('deg0',
                                            str(self.ui.path_line_0.text())))
        self.ui.path_line_180.textChanged.connect(
            lambda value: self.change_value('deg180',
                                            str(self.ui.path_line_180.text())))

        self.ui.overlap_layout.addWidget(self.overlap_viewer)
        self.overlap_viewer.slider.valueChanged.connect(
            self.on_axis_slider_changed)