예제 #1
0
    def __init__(self, mprx):
        super(GenericWorker, self).__init__()

        self.agmexecutive_proxy = mprx["AGMExecutiveProxy"]

        self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive)
        self.Period = 30
        self.timer = QtCore.QTimer(self)
예제 #2
0
    def __init__(self, mprx):
        super(GenericWorker, self).__init__()

        self.camerasimple_proxy = mprx["CameraSimpleProxy"]

        self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive)
        self.Period = 30
        self.timer = QtCore.QTimer(self)
예제 #3
0
    def __init__(self, parent=None):
        super(FortuneThread, self).__init__(parent)

        self.quit = False
        self.hostName = ''
        self.cond = QtCore.QWaitCondition()
        self.mutex = QtCore.QMutex()
        self.port = 0
예제 #4
0
    def __init__(self):
        super(MainWindow, self).__init__()

        self.guiMutex = QtCore.QMutex()

        self.setWindowTitle("mEDI's Elite Tools")
        self.setDockOptions(QtGui.QMainWindow.AnimatedDocks
                            | QtGui.QMainWindow.AllowNestedDocks
                            | QtGui.QMainWindow.AllowTabbedDocks)

        self.setStatusBar("Welcome to mEDI's Elite Tools (Version: %s, %s)" %
                          (__version__, __builddate__))
        self.setMinimumSize(600, 400)

        self.setWindowIcon(QtGui.QIcon(QtGui.QPixmap("img/logo.png")))

        self.addProgressBarStatusBar()

        self.clipboard = QtGui.QClipboard()

        self.mydb = elite.db(guiMode=True)
        self.mydb.cleanIgnorePriceTemp()
        self.mydb.startStreamUpdater()

        self.dbworker = gui.dbworker.new(self)

        self.location = elite.location(self.mydb)

        self.createActions()
        self.createMenus()
        self.createTimer()

        self.myPlugins = [
            gui.multihoproute, gui.deals_from_to, gui.commodities_finder,
            gui.shipyard_finder, gui.power_control_finder, gui.flylog,
            gui.bookmarks, gui.rares_finder, gui.profit_calculator,
            gui.outfitting_finder, gui.data_status
        ]

        self.addTool(gui.multihoproute, self.multiHopRouteWidget)
        self.addTool(gui.deals_from_to, self.dealsFromToWidget)
        self.addTool(gui.commodities_finder, self.commoditiesFinderWidget)
        self.addTool(gui.shipyard_finder, self.shipyardFinderWidget)
        self.addTool(gui.power_control_finder, self.powerControlFinderWidget)
        self.addTool(gui.flylog, self.flyLogWidget)
        self.addTool(gui.bookmarks, self.BookmarksWidget)
        self.addTool(gui.rares_finder, self.raresFinderWidget)
        self.addTool(gui.profit_calculator, self.profitCalculatorWidget)
        self.addTool(gui.outfitting_finder, self.outfittingFinderWidget)
        self.addTool(gui.data_status, self.dataStatusWidget)

        gui.statistics.initRun(self)
        gui.edit_permit.initRun(self)
        gui.add_edit_items.initRun(self)

        self.show()

        self.loadLastWindowsOptions()
예제 #5
0
 def __init__(self, filename=None):
     self.convert_mutex = QtCore.QMutex()
     self.progress_mutex = QtCore.QMutex()
     self.threadPool = []
     self.convert_mutex = QtCore.QMutex()
     self.stop_convert = False
     if filename == None:
         dialog = QtGui.QFileDialog()
         dialog.setFileMode(QtGui.QFileDialog.ExistingFiles)
         dialog.setNameFilter('MF1 (*.mf1);; All Files (*.*)')
         self.filefilter = 'MF1 (*.mf1)'
         dialog.filterSelected.connect(self.filterSelected)
         if dialog.exec_():
             filenames = dialog.selectedFiles()
         if self.filefilter == 'MF1 (*.mf1)':
             self.convert_mf1_to_cubereader(filenames)
     else:
         self.convert_mf1_to_cubereader(filename)      
예제 #6
0
    def __init__(self, mprx):
        super(GenericWorker, self).__init__()

        self.openposeserver_proxy = mprx["OpenposeServerProxy"]
        self.openposepublishpeople_proxy = mprx["OpenposePublishPeoplePub"]

        self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive)
        self.Period = 30
        self.timer = QtCore.QTimer(self)
예제 #7
0
    def __init__(self):
        super(MainWidget, self).__init__()

        self._lock = QtCore.QMutex()
        self._controller = ControllerWatcher()
        self._build_ui()
        self._controller.on_found(self._refresh_controller, True)
        self._controller.on_lost(self._no_controller)
        self._no_controller()
예제 #8
0
    def __init__(self, mprx):
        super(GenericWorker, self).__init__()

        self.laser_proxy = mprx["LaserProxy"]
        self.differentialrobot_proxy = mprx["DifferentialRobotProxy"]

        self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive)
        self.Period = 30
        self.timer = QtCore.QTimer(self)
	def __init__(self, mprx):
		super(GenericWorker, self).__init__()




		self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive)
		self.Period = 30
		self.timer = QtCore.QTimer(self)
예제 #10
0
파일: agent.py 프로젝트: MikeyG/gevernote
 def _init_locks(self):
     """Init locks"""
     
     # provides a condition variable for synchronizing threads
     # http://srinikom.github.io/pyside-docs/PySide/QtCore/QWaitCondition.html
     self.wait_condition = QtCore.QWaitCondition()
     
     # class provides access serialization between threads
     # http://srinikom.github.io/pyside-docs/PySide/QtCore/QMutex.html
     self.mutex = QtCore.QMutex()
예제 #11
0
	def __init__(self, mprx):
		super(GenericWorker, self).__init__()


		self.asrpublish_proxy = mprx["ASRPublishPub"]


		self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive)
		self.Period = 30
		self.timer = QtCore.QTimer(self)
    def __init__(self, mprx):
        super(GenericWorker, self).__init__()

        self.activityrecognition_proxy = mprx["ActivityRecognitionProxy"]
        self.camerasimple_proxy = mprx["CameraSimpleProxy"]
        self.poseestimation_proxy = mprx["PoseEstimationProxy"]

        self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive)
        self.Period = 30
        self.timer = QtCore.QTimer(self)
예제 #13
0
    def __init__(self, mprx):
        super(GenericWorker, self).__init__()

        self.ui = Ui_guiDlg()
        self.ui.setupUi(self)
        self.show()

        self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive)
        self.Period = 30
        self.timer = QtCore.QTimer(self)
예제 #14
0
    def __init__(self, netIndex, netArgs):
        """
        Constructor for worker thread

        Arguments
            netArgs:    python dictionary, contains parameters for the
                        network instance
        """
        # Initialize the thread using its base constructor
        QtCore.QThread.__init__(self)

        # network is the actual mlmvn simulator object
        self.network = None

        # Keep processing flag is used to loop the next command until some
        # condition is met (e.g. learning process is completed)
        self.keepProcessing = False

        # Index is the same as the net Instance index: an integer key that
        # identifies a unique network instance
        self.index = netIndex
        # Initialize queue that holds commands to be processed
        self.simQueue = deque()
        # Status flag reflects the current state of the simulation
        self.status = 'stopped'
        # nextCommand holds the next simulator command to be executed, as well
        # as a filename if it's the export weights command
        self.nextCommand = None

        # commandAdded and mutex are used to synchronize this thread with the
        # main GUI thread
        self.commandAdded = QtCore.QWaitCondition()
        self.mutex = QtCore.QMutex()

        # Initialize the mlmvn simulator object
        self.initNet(netArgs)

        self.finished.connect(self.deleteLater)

        # If a time limit was passed
        if netArgs['timeLimit']:
            # Convert passed time limit to milliseconds
            timeLimit = QtCore.QTime(0, 0, 0, 0).msecsTo(
                QtCore.QTime.fromString(netArgs['timeLimit'], 'hh:mm'))

            # QTimer is used if a time limit was passed as a network parameter
            self.stopTimer = QtCore.QTimer()
            self.stopTimer.setInterval(self.timeLimit)

            # Connect the timer to the stopProcess method
            self.stopTimer.timeout.connect(self.stopProcess)

            print 'created timer'
        else:
            self.stopTimer = None
예제 #15
0
 def __init__(self, index, lock, files, filenamesForWords,
              commonWords, parent=None):
     super(Walker, self).__init__(parent)
     self.index = index
     self.lock = lock
     self.files = files
     self.filenamesForWords = filenamesForWords
     self.commonWords = commonWords
     self.stopped = False
     self.mutex = QtCore.QMutex()
     self.completed = False
    def __init__(self, mprx):
        super(GenericWorker, self).__init__()

        self.differentialrobot_proxy = mprx["DifferentialRobotProxy"]
        self.ui = Ui_guiDlg()
        self.ui.setupUi(self)
        self.show()

        self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive)
        self.Period = 30
        self.timer = QtCore.QTimer(self)
예제 #17
0
    def __init__(self):
        super(ControllerWatcher, self).__init__()

        self._waiters = Queue()
        self._controller = None

        self._lock = QtCore.QMutex()
        self._lock.lock()
        self._worker = QtCore.QCoreApplication.instance().worker
        self._worker.post_bg(self._poll, self._release, True)

        self.startTimer(2000)
예제 #18
0
 def __init__(self, spectrum_holder, parent=None):
     #super(SpectrumViewer, self).__init__()
     QtGui.QMainWindow.__init__(self, parent)
     self.filename = spectrum_holder.filename
     basename = analysis.get_file_basename(spectrum_holder.filename)
     self.setWindowTitle('Spectrum Holder for %s' % basename)
     self.resize(600, 300)
     self.spectrum_holder = spectrum_holder
     spectrum_box = spectrum_holder.spectrum_box
     self.cube_mutex = QtCore.QMutex()
     self.inputs()
     self.textbox_spectrum_box.setText(spectrum_box)
예제 #19
0
    def __init__(self, device):
        super(YubiKeyNeo, self).__init__()

        self._mutex = QtCore.QMutex(QtCore.QMutex.Recursive)

        self._serial = device.serial
        self._version = device.version
        self._apps = None

        self._group = self._serial if self._serial else "NOSERIAL"

        self._set_device(device)
예제 #20
0
파일: tab.py 프로젝트: jgrebel1/cubereader
 def __init__(self, filename, parent=None):
     QtGui.QWidget.__init__(self, parent)
     self.filename = filename
     print self.filename
     self.cube = h_cubereader.load_data(filename)
     self.basename = analysis.get_file_basename(self.filename)
     self.data = self.cube[0]
     self.dataview = self.cube[1]
     self.convert_mutex = QtCore.QMutex()
     self.bool_press = False
     self.make_spectrum_holder()
     self.make_frame()
     self.connect_buttons()
예제 #21
0
    def __init__(self, source_list, dest_folder):
        """Initialize single file copy worker thread.

        Args:
            source_list (list): List of single file.
            dest_folder (str): Destionation root folder path.

        """
        super(SingleCopyThread, self).__init__()
        self.source_list = source_list
        self.dest_folder = '{}/sources'.format(dest_folder)
        self.running_flag = True
        self._mutex = QtCore.QMutex()
예제 #22
0
    def __init__(self, *args):
        super(OCUploader, self).__init__(*args)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        # add some pretty icons
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(
            resource_path('icons/fa-folder-open.png')))
        self.ui.fileButton.setIcon(icon)
        self.ui.fileButton.setIconSize(QtCore.QSize(16, 16))
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(resource_path('icons/fa-upload.png')))
        self.ui.uploadButton.setIcon(icon)
        self.ui.uploadButton.setIconSize(QtCore.QSize(16, 16))
        icon = QtGui.QIcon()
        icon.addFile(resource_path('icons/mac_logo.iconset/icon_16x16.png'),
                     QtCore.QSize(16, 16))
        icon.addFile(resource_path('icons/mac_logo.iconset/icon_32x32.png'),
                     QtCore.QSize(32, 32))
        icon.addFile(resource_path('icons/mac_logo.iconset/icon_128x128.png'),
                     QtCore.QSize(128, 128))
        icon.addFile(resource_path('icons/mac_logo.iconset/icon_512x512.png'),
                     QtCore.QSize(512, 512))
        self.setWindowIcon(icon)
        icon = QtGui.QPixmap(resource_path('icons/plain_logo.png'))
        self.ui.logoLabel.setPixmap(icon.scaled(64, 64))

        # set up the file list
        self.files_model = FileListModel(self)
        view = FileViewer(self)
        view.setModel(self.files_model)
        view.file_dropped.connect(self.files_model.add_file)
        self.ui.fileListLayout.addWidget(view)

        # set up the ui
        self.ui.fileButton.clicked.connect(self.select_file_button)
        self.ui.uploadButton.clicked.connect(self.upload_button)
        self.reset()

        # set some globals
        self.lock = QtCore.QMutex()
        self.worker = None

        # version check
        should_quit, error_msg = check_version(__version__, OC_SERVER, 'gui')
        if error_msg is not None:
            QtGui.QMessageBox.warning(self, 'Error!', error_msg,
                                      QtGui.QMessageBox.Ok)
        if should_quit:
            QtGui.QApplication.instance().quit()
예제 #23
0
 def __init__(self, parent=None):
     QtGui.QWidget.__init__(self, parent)
     self.setLayout(QtGui.QGridLayout(self))
     self.layout().setContentsMargins(0, 0, 0, 0)
     self.out = QtGui.QTextEdit(self)
     self.layout().addWidget(self.out, 0, 0)
     self.out.setStyleSheet(
         "QTextEdit { background-color: white; color: black; font-weight: normal; }"
     )
     self.out.setReadOnly(True)
     self.input = inputLine()
     self.layout().addWidget(self.input, 1, 0)
     self.input.commandEntered.connect(self.commandEntered)
     self.consoleAccessMutex = QtCore.QMutex()
예제 #24
0
    def __init__(self):
        super(MainWindow, self).__init__()
        self.setWindowTitle("supervisor Interface")
        self.__mutex__ = QtCore.QMutex()

        self.__log__()
        self.__setting__()
        self.createActions()
        self.createMenus()
        self.__rpc__ = None
        self.centralWidget = CentralWidget(None,
                                           (self.settings, self.__mutex__))

        self.statusBar().showMessage("Ready")
예제 #25
0
    def __init__(self, app, settings):
        super(GuiController, self).__init__()
        self._app = app
        self._settings = settings
        self._needs_read = False
        self._reader = None
        self._creds = None
        self._lock = QtCore.QMutex()
        self._keystore = get_keystore()
        self.timer = Timer()

        self.watcher = observe_reader(self.reader_name, self._on_reader)

        self.startTimer(3000)
        self.timer.time_changed.connect(self.refresh_codes)
예제 #26
0
 def __init__(self, endpoint):
     threading.Thread.__init__(self)
     self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive)
     self.daemon = True
     self.reset()
     self.exit = False
     self.alive = False
     self.aPrx = None
     try:
         self.aPrx = global_ic.stringToProxy(endpoint)
         self.aPrx.ice_timeout(1)
     except:
         print "Error creating proxy to " + endpoint
         if len(endpoint) == 0:
             print 'please, provide an endpoint'
         raise
예제 #27
0
 def __init__(self, filename, dimension1, dimension2):
     self.filename = filename
     self.data = {}
     self.dimension1 = dimension1
     self.dimension2 = dimension2
     self.spectrum_box = ''
     self.cube_peaks = []
     self.amplitudes = []
     self.mu = []
     self.sigma = []
     self.m = []
     self.widths = []
     self.cube_residuals = []
     self.cube_fitted = False
     self.cube_fitting = False
     self.cube_mutex = QtCore.QMutex()
예제 #28
0
 def __init__(self, filename=None, parent=None):
     super(RebinHDF5, self).__init__(parent)
     self.stop_rebin = False
     self.rebin_mutex = QtCore.QMutex()
     self.threadPool = []
     if filename==None:
         dialog = QtGui.QFileDialog()
         dialog.setFileMode(QtGui.QFileDialog.ExistingFiles)
         dialog.setNameFilter('HDF5 (*.hdf5);; All Files (*.*)')
         self.filefilter = 'HDF5 (*.hdf5)'
         dialog.filterSelected.connect(self.filterSelected)
         if dialog.exec_():
             filenames = dialog.selectedFiles()
         for filename in filenames:
             self.rebin_hdf5_process(filename)
     else:
         self.rebin_hdf5_process(filename) 
예제 #29
0
 def __init__(self, min_lat, min_lon, max_lat, max_lon, hgts_folder, tasks):
     QtCore.QThread.__init__(self)
     self.hgts_folder = hgts_folder
     handler = util.SpecificFolderFileHandler(hgts_folder)
     self.min_lat = min_lat
     self.max_lat = max_lat
     self.min_lon = min_lon
     self.max_lon = max_lon
     self.elevation_data = srtm.get_data(file_handler=handler)
     self.hgt_names = self.get_hgt_names()
     self.percent_per_file = 100.0 / len(self.hgt_names)
     self.stopped = False
     self.paused = False
     self.mutex = QtCore.QMutex()
     self.merged_tif = os.path.join(self.hgts_folder, 'result.tif')
     self.full_hgt_names = ''
     self.tasks = tasks
예제 #30
0
    def __init__(self, parent=None):
        QtCore.QThread.__init__(self, parent)

        self.mutex = QtCore.QMutex()
        self.condition = QtCore.QWaitCondition()
        self.centerX = 0.0
        self.centerY = 0.0
        self.scaleFactor = 0.0
        self.resultSize = QtCore.QSize()
        self.colormap = []

        self.restart = False
        self.abort = False

        for i in range(RenderThread.ColormapSize):
            self.colormap.append(
                self.rgbFromWaveLength(380.0 + (i * 400.0 /
                                                RenderThread.ColormapSize)))