def __init__(self, Celda, FilaPlot, parent=None): # QtCore.QThread.__init__(self) super(PLOTEOTR, self).__init__() self.Celda = Celda self.CONTENEDOR = FilaPlot self.mutex = QMutex() self.Active = True
def __init__(self, parent, db): QObject.__init__(self, parent) self.internet_connection_failed = False self._parent = parent self.no_internet_msg = _('Cannot download news as no internet connection ' 'is active') self.no_internet_dialog = d = error_dialog(self._parent, self.no_internet_msg, _('No internet connection'), show_copy_button=False) d.setModal(False) self.recipe_model = RecipeModel() self.db = db self.lock = QMutex(QMutex.Recursive) self.download_queue = set([]) self.news_menu = QMenu() self.news_icon = QIcon(I('news.png')) self.scheduler_action = QAction(QIcon(I('scheduler.png')), _('Schedule news download'), self) self.news_menu.addAction(self.scheduler_action) self.scheduler_action.triggered[bool].connect(self.show_dialog) self.cac = QAction(QIcon(I('user_profile.png')), _('Add a custom news source'), self) self.cac.triggered[bool].connect(self.customize_feeds) self.news_menu.addAction(self.cac) self.news_menu.addSeparator() self.all_action = self.news_menu.addAction( _('Download all scheduled news sources'), self.download_all_scheduled) self.timer = QTimer(self) self.timer.start(int(self.INTERVAL * 60 * 1000)) self.timer.timeout.connect(self.check) self.oldest = gconf['oldest_news'] QTimer.singleShot(5 * 1000, self.oldest_check)
def shown(self): # Disable mouse handler ctx.mainScreen.dontAskCmbAgain = True ctx.mainScreen.theme_shortcut.setEnabled(False) ctx.mainScreen.ui.system_menu.setEnabled(False) # start installer thread ctx.logger.debug("Copy system thread is creating...") self.mutex = QMutex() self.wait_condition = QWaitCondition() self.queue = Queue() self.sys_copier = SystemCopy(self.queue, self.mutex, self.wait_condition, self.retry_answer) self.poll_timer.start(500) # start installer polling ctx.logger.debug("Calling SystemCopy.start...") self.sys_copier.start() ctx.mainScreen.disableNext() ctx.mainScreen.disableBack() # start 30 seconds self.timer.start(1000 * 30) self.installProgress.showInstallProgress()
def __init__(self): QtCore.QObject.__init__(self) #Read from Penning_trap_cxn_dictionaries relevant information mapping ISEG units to trap #surfaces in order to start the relevant sessions. self.trap_surfaces = iseg_controlled_trap_surfaces.keys() self.num_trap_surfs = len(self.trap_surfaces) self.INST_IDs_4_TRAP_SURFs = [ trap_surf_dict[self.trap_surfaces[i]]['INST_ID'] for i in range(len(self.trap_surfaces)) ] self.VISA_IDs_4_TRAP_SURFs = [ trap_surf_dict[self.trap_surfaces[i]]['VISA_ID'] for i in range(len(self.trap_surfaces)) ] # Setup connections to individual iseg units assigned to trap surface control self.iseg_modules = ISEG_Command(self.VISA_IDs_4_TRAP_SURFs) self.running = True self.temp_volt_dict = deepcopy(volt_config_dict) self.create_thread_shuttling() self.mutex = QMutex() self.colours = [ trap_surf_dict[c]['COLOUR'] for c in self.trap_surfaces ] self.num_completed_shuttling_cycles = 0 self.reinitialize_shuttling_sequence = True
def __init__( self, dequePLOT, dequeIN, dequeOUT, port_num='/dev/ttyUSB0', #port_num='/dev/ttyACM0', port_baud=115200, port_stopbits=serial.STOPBITS_ONE, port_parity=serial.PARITY_NONE, port_timeout=0.1, parent=None): QtCore.QThread.__init__(self) self.daemon = True self.mutex = QMutex() self.serial_port = None self.serial_arg = dict(port=port_num, baudrate=port_baud, stopbits=port_stopbits, parity=port_parity, timeout=port_timeout) self.signal = QtCore.SIGNAL("signal") self.CONTENEDORplot = dequePLOT self.dequeIN = dequeIN self.dequeOUT = dequeOUT
def __init__(self, parent=None): locale = unicode(QtCore.QLocale.system().name()) QtGui.QWidget.__init__(self, parent) self.ui = loadUi(GraphicInterface, self) self.flagVTR = False self.flagPLOTVTR = False self.Ploteo1 = self.ui.plot.addPlot( row=0, col=0, axisItems={'left': NonScientific(orientation='left')}) self.Ploteo2 = self.ui.plot.addPlot( row=1, col=0, axisItems={'left': NonScientific(orientation='left')}) self.threadPool = [] self.threadOne = [] #DatosIndependietes DatosCompartidos self.threadTwo = [] #PLOTEOTR self.mutex = QMutex() self.filaPloteo = deque(maxlen=16000) self.filaDatos = deque(maxlen=16000) self.dequeSetting = deque(maxlen=100) self.threadOne.append( DatosIndependientes.DatosCompartidos(self.dequeSetting, self.filaPloteo)) print("valor de len de thread one menos 1 es " + str(len(self.threadOne) - 1), file=log) self.threadOne[len(self.threadOne) - 1].start() self.connect(self.threadOne[len(self.threadOne) - 1], self.threadOne[len(self.threadOne) - 1].signal, self.ActualValores) self.connect(self.threadOne[len(self.threadOne) - 1], self.threadOne[len(self.threadOne) - 1].signalSingleShot, self.LlenoCamposCondGuardado) #QObject.connect(QObject, SIGNAL(), QObject, SLOT(), Qt.ConnectionType = Qt.AutoConnection) -> bool self.connect(self.threadOne[len(self.threadOne) - 1], self.threadOne[len(self.threadOne) - 1].parocelda, self.PararCelda) self.ui.BotActivo.setCheckable(True) self.ui.BotSetearC.setCheckable(True) self.ui.BotSetearV.setCheckable(True) self.ui.BotParaPlot.setCheckable(True) self.ui.AYUDA.append('<a href="ayuda/readme.html"> AYUDA </a>') self.CargoCorrecionDeI()
def __init__(self, conf): self.path = conf.getAttribute("loc") self.max_wrong = int(conf.getAttribute("max_fails")) temp_re = re.compile(conf.getAttribute("re")) if (not re): temp_re = ".*" self.re = re.compile(temp_re) self.log = logging.getLogger("umati.UmatiUserDirectory.UserDirectory") if (self.path == ""): self.path = UserDirectory.FILE_LOC if (os.path.exists(self.path)): p = pickle.Unpickler(open(self.path, 'rb')) self.db = p.load() else: self.db = {} self.__lock = QMutex() self.__last_updated = time.time() self.__hasChanged = False self.updater = UpdaterThread(self) self.updater.start()
def __init__(self, dequeSettings, dequePLOT, parent=None): print("[" + str(datetime.datetime.now()) + "][DCOMP] initing", file=log) self.a = DatosCelda("a") self.b = DatosCelda("b") #2 self.c = DatosCelda("c") #3 self.d = DatosCelda("d") #4 self.e = DatosCelda("e") #5 self.f = DatosCelda("f") #6 self.g = DatosCelda("g") #7 self.h = DatosCelda("h") #8 self.i = DatosCelda("i") #9 self.j = DatosCelda("j") #10 self.k = DatosCelda("k") #11 self.l = DatosCelda("l") #12 self.m = DatosCelda("m") #13 self.n = DatosCelda("n") #14 self.o = DatosCelda("o") #15 self.p = DatosCelda("p") #16 QtCore.QThread.__init__(self) self.mutex = QMutex() self.daemon = True self.signal = QtCore.SIGNAL("realTimeData") self.signalSingleShot = QtCore.SIGNAL("UIConditions") self.parocelda = QtCore.SIGNAL("parocelda") self.celdaEnTiempoReal = None self.celdaCondUI = None self.celdaPLOTTR = None """DEQUES de comunicacion""" self.dequeSettings = dequeSettings #desde UI self.dequePLOT = dequePLOT #hacia UI?? self.dequeOUT = deque(maxlen=16000) #seteos de celdas a puerto self.dequeIN = deque(maxlen=16000) #desde puerto crudo """""" #print( "arranco thread de lectura desde DatosIndependientes", file=log) self.PoolThread.append( ProcesoPuerto.LECTURA(self.dequePLOT, self.dequeOUT, self.dequeIN))
def __init__(self, ISEG_VISA_IDs): QtCore.QObject.__init__(self) self.ISEG_VISA_IDs = ISEG_VISA_IDs self.num_channels = len(self.ISEG_VISA_IDs) print self.ISEG_VISA_IDs #iseg module parameters self.num_time_segs = None self.V_ramp_list_array = None self.ramp_speed_list_array = None self.tau = None self.repetition_time_delay = None self.V_initial_list = None self.V_final_list = None self.running = True self.connect(self.ISEG_VISA_IDs) self.mutex = QMutex() self.micro = 10**(-6)
def __init__(self): QtCore.QObject.__init__(self) self.egun1_surfs_iseg = iseg_controlled_egun_surfaces.keys() self.egun1_surfs_MX100TP = MX100TP_controlled_egun_surfaces.keys() self.egun1_surfs_all = self.egun1_surfs_MX100TP + self.egun1_surfs_iseg self.INST_IDs_iseg_egun1 = [ egun1_surf_dict[self.egun1_surfs_iseg[i]]['INST_ID'] for i in range(len(self.egun1_surfs_iseg)) ] self.VISA_IDs_iseg_egun1 = [ egun1_surf_dict[self.egun1_surfs_iseg[i]]['VISA_ID'] for i in range(len(self.egun1_surfs_iseg)) ] self.INST_IDs_MX100TP_egun1 = [ egun1_surf_dict[self.egun1_surfs_MX100TP[i]]['INST_ID'] for i in range(len(self.egun1_surfs_MX100TP)) ] self.VISA_IDs_MX100TP_egun1 = [ egun1_surf_dict[self.egun1_surfs_MX100TP[i]]['VISA_ID'] for i in range(len(self.egun1_surfs_MX100TP)) ] self.VISA_ID_MX100TP_egun1 = self.VISA_IDs_MX100TP_egun1[0] # create iseg modele objects for egun control self.iseg_modules_egun1 = ISEG_Command(self.VISA_IDs_iseg_egun1) # create MX100TP modele object for egun control self.MX100TP_module_egun1 = MX100TP_Command(self.VISA_ID_MX100TP_egun1) self.execute_default_settings() self.running = True self.update_MX100TP_voltages = None self.temp_volt_dict = None self.mutex = QMutex()
def __init__(self, maxSize=10): self.maxSize = maxSize self._q = deque() self.mutex = QMutex()
from PyQt4.Qt import QSettings, QVariant, QThread, QMutex, QTimer from PyQt4.QtCore import pyqtSignal as Signal from PyQt4.QtGui import QApplication, QMainWindow, QLabel, QComboBox import AboutDialog import Settings import Temperature import convertFahrenheit import time APP_VERSION = '1.0.0' APP_NAME = 'PerlustroC' ORG_NAME = 'Gatituz Inc' ORG_DOMAIN = 'www.gatituz.duckdns.org' mutex = QMutex() class MainWindow(Temperature.Ui_MainWindow, QMainWindow): def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.setupUi(self) self.setWindowTitle(APP_NAME) self.array_values = array.array('h') self.list_x = [x for x in xrange(0, 60)] self.load_save_settings() self.label_usb = QLabel('USB Port:')