def __init__(self, patches, db, parent=None): QThread.__init__(self, parent) self.logger = logging.getLogger(__name__) self.process = None self.patches = patches self.parentDb = db
def __init__(self): QThread.__init__(self) Bin.exporter = JupiterExporter() BinPacking.bin_packing_progress = self self.directory = None self.images = [] self.method = BinPackingThread.METHODS[0] self.bin_size = BinPackingThread.SIZES[0] self.bin_parameter = { "next_fit_shelf": {}, "first_fit_shelf": { "selection_variant": FirstFitShelfBin.BEST_VARIANTS, "selection_heuristic": FirstFitShelfBin.SHORT_SIDE_FIT, }, "guillotine": { "selection_variant": GuillotineBin.BEST_VARIANTS, "selection_heuristic": GuillotineBin.SHORT_SIDE_FIT, "split_rule": Rect.RULE_SAS, }, "max_rects": {}, }
def __init__(self): QThread.__init__(self) self.running = True self.queue = queue.Queue() # If we have internet connetction we can receive dat from server self.data_from_server = True # Offsets period self.p_offsets = config['p_offsets'] # Offsets stack size self.n_samples = config['o_buffer'] # Offsets list self.offsets = None # Socket self.sock_con = None # Graph density. Send to pipeline every n-th sample self.density = calculateDensity(config['time_axe_range']) # self.calculateDensity(2) # Data server if self.data_from_server: self.host = config['host'] # self.host = 'localhost' self.port = config['port']
def __init__(self): QThread.__init__(self) self.camera = CameraFixe() self.imageCount = 1 self.nombreDImage = 3 self.nombreDeForme = 4 self.localisationIles = LocalisationIle() self.localisationRobot = LocalisationRobot() self.localisationRepere = LocalisationRepere() self.localisationTresor = LocalisationTresor() self.afficheurImage = AfficheurImage() self.couleurCarreTrouvee = "" self.xPositionCarreTrouvee = 0 self.yPositionCarreTrouvee = 0 self.couleurTriangleTrouvee = "" self.xPositionTriangleTrouvee = 0 self.yPositionTriangleTrouvee = 0 self.couleurCercleTrouvee = "" self.xPositionCercleTrouvee = 0 self.yPositionCercleTrouvee = 0 self.couleurPentagoneTrouvee = "" self.xPositionPentagoneTrouvee = 0 self.yPositionPentagoneTrouvee = 0 self.xPositionRobotTrouvee = 0 self.yPositionRobotTrouvee = 0 self.carreIndex = 0 self.triangleIndex = 0 self.cercleIndex = 0 self.pentagoneIndex = 0 self.detectionIlesTimeout = 10 self.ratioMaximum = 0.14 self.listeFormesThread = [] self.listeCouleursThread = [] self.listePositionsThread = [] self.positionRobotThread = [] self.conteurDetectionIles = 0 self.conteurDetectionTresor = 0 self.conteurDetectionRepere = 0 self.time = None self.timeImage = time.time() self.estVerouillee = False self.sauvegardePath = "C:\Users\phili_000\Desktop\Design 3\Design3\Code\Projet\photos\\table_iles_robot_MOD.jpg" self.photo = None self.reset = False self.startCycle = False
def __init__(self, quitNetclient, name="NetClient"): # Call the thread's constructor QThread.__init__(self) # Initialize the net client. Variables to keep track of glance counts self.On = True # self.glance = [] # self.frame = [] self.oneCount = 0 self.zeroCount = 0 self.maxOnes = 0 self.lowCount = 0 self.warnCount = 0 self.dangerCount = 0 self.resetCount = 0 # self.duration = [] # self.listOfDict = [] # Not sure if this is going to work. This might not even be used... self.usage = __doc__ self.parser = optparse.OptionParser(self.usage) self.options, self.args = self.parser.parse_args() quitNetclient.connect(self.exitAll, Qt.QueuedConnection)
def __init__( self, account, call, #dbus_handler, ): """ account: An account. call is one of 'HomeTimeline': Fetch the home time line 'Mentions': Fetch user mentions 'DMs': Fetch direct messages 'Search:*': Fetch search results where * is the terms to search for 'RetrieveLists': Retrive lists 'List:*:*': The first * should be replace with the user and the second with the id 'Near:*:*': Fetch tweets near (1km) a the specified location. The first start is the the first geocode and the second * is the second geocode. """ QThread.__init__(self) self.account = account self.call = call #self.dbus_handler = dbus_handler socket.setdefaulttimeout(60)
def __init__(self): QThread.__init__(self) self.code = "" self.carte = Carte() self.planification = Cheminement(self.carte) self.voltageRestant = "" self.ileCible = -1 self.positionTresor = [] self.destination = [] self.pause = True self.reset = False self.startCycle = False self.demiCercle = 180 self.tempAttenteRotation = 9 self.delaiAjustement = 4.5 self.metreSeconde = 15 self.metre = 100 self.actionPrecedente = "" self.actionCourrante = "" self.nouvelleAction = False self.finCycle = False self.connected = False self.noPathFound = False self.aIle = False self.diametreIle = 2.125 self.deltaPosition = 15 self.deltaAngle = 4 self.deltaDiametreIle = 0.125
def __init__(self, scripts, name=None, settings=None, log_output=None, timeout=1000000000): self._recording = False self._timeout = timeout Script.__init__(self, name, settings, scripts=scripts, log_output=log_output) QThread.__init__(self) self.data = deque() # todo: clean this up! and plot data in gui! self._sweep_values = { 'frequency': [], 'x': [], 'y': [], 'phase': [], 'r': [] }.keys()
def __init__(self, instruments, name=None, settings=None, log_output=None, timeout=1000000000): self._recording = False self._timeout = timeout Script.__init__(self, name, settings, instruments, log_output=log_output) QThread.__init__(self) self.sweeper = self.instruments['zihf2'].daq.sweep(self._timeout) self.sweeper.set('sweep/device', self.instruments['zihf2'].device) self.data = deque() # todo: clean this up! and plot data in gui! self._sweep_values = { 'frequency': [], 'x': [], 'y': [], 'phase': [], 'r': [] }.keys()
def __init__(self, inp=None, dur=None, thr_counter=0): QThread.__init__(self) self.inp = inp self.dur = dur self.outp = None self.abo = None self.thr_counter = thr_counter
def __init__(self, user, parent=None): QThread.__init__(self, parent) self.exiting = False self.refreshed = MySignal() self.dumpuser = MySignal() self.newcourses = CoursesSignal() self.removable = CoursesSignal() self.user = user
def __init__(self): QThread.__init__(self) self.grblWriter = None self.gcode = None self.stopFlag = False self.pauseFlag = False self.currentLine = 0 self.waitForPause = False
def __init__(self, instruments, name = None, settings = None, log_output = None): self._recording = False Script.__init__(self, name, settings, instruments, log_output = log_output) QThread.__init__(self) self.data = deque()
def __init__(self, maximum, parent=None): QThread.__init__(self, parent) self.maximum = maximum # this semaphore is used to stop the thread from outside. As long # as the thread is permitted to run, it has yet a single resource # available. If the thread is stopped, this resource is acquired, # and the thread breaks its counting loop at the next iteration. self._run_semaphore = QSemaphore(1)
def __init__(self, todo=None, dur=None, ip=None, vidl=None): QThread.__init__(self) self.todo = todo self.dur = dur self.ip = ip self.vidl = vidl self.outp = None self.abo = None
def __init__(self, *params): QThread.__init__(self) self.parms = params self.ret_code = None self.output = StringIO() self.procs = [] self.procs_str = '' Logger.getLoggerFor(self.__class__)
def __init__(self, port): QThread.__init__(self) self._port = port self._serial = None self._parser = Parser() self._cancel = False self._timeout = None
def __init__(self): QThread.__init__(self) self.__service = RunDefService() self.__pid = None self.__id = None
def __init__(self, monitorable, args=(), kwargs=None): QThread.__init__(self) self._monitorable = monitorable self._args = args if kwargs is None: kwargs = {} self._kwargs = kwargs self._is_cancelled = False
def __init__(self, network, logLevel=None, **kwargs): assert (isinstance(network, Network)) self._network = network self.sim_start = self.sim_end = None self.stepsLeft = 0 self.logger = logging.getLogger('pymote.simulation') self.logger.level = logLevel or logging.DEBUG QThread.__init__(self)
def __init__(self, network, logLevel=None, **kwargs): assert(isinstance(network, Network)) self._network = network self.stepsLeft = 0 self.logger = logging.getLogger('pymote.simulation') self.logger.level = logLevel or logging.DEBUG self.logger.debug('Simulation %s created successfully.' % (hex(id(self)))) QThread.__init__(self)
def __init__(self, instruments, scripts, name = None, settings = None, log_output = None): """ Example of a script that emits a QT signal for the gui Args: name (optional): name of script, if empty same as class name settings (optional): settings for this script, if empty same as default settings """ Script.__init__(self, name, settings = settings,scripts =scripts, instruments = instruments, log_output = log_output) QThread.__init__(self)
def __init__(self, script): """ This is a wrapper for scripts that are not QThread, to execute them on a different thread than the gui Args: script: script to be executed """ self.script = script QThread.__init__(self)
def __init__(self, network, logLevel=None, **kwargs): assert (isinstance(network, Network)) self._network = network self.stepsLeft = 0 self.logger = logging.getLogger('pymote.simulation') self.logger.level = logLevel or logging.DEBUG self.logger.debug('Simulation %s created successfully.' % (hex(id(self)))) QThread.__init__(self)
def __init__(self): QThread.__init__(self) self.grblWriter = None self.gcode = None self.stopFlag = False self.pauseFlag = False self.currentLine = 0 self.waitForPause = False self.errorStatus = False
def __init__(self, app, *args, **kwargs): QThread.__init__(self, *args, **kwargs) self.app = app self.status = STATUS_NONE self.last_sync = datetime.now() self.timer = QTimer() self.timer.timeout.connect(self.sync) self.update_timer() self.wait_condition = QWaitCondition() self.mutex = QMutex()
def __init__(self, url): QThread.__init__(self) self.url = url self.new_version = None self.frozenapp = esky.Esky(sys.executable, self.url) try: log.Debug('Checking for new version at {0}'.format(self.url)) self.new_version = self.frozenapp.find_update() except Exception, e: log.Error(str(e))
def __init__(self, name, readTimeout=1000, dev = None, parent=None): Keithley.__init__(self,dev) QThread.__init__(self) self.name = name self.readTimeout = readTimeout self.connectInstrument() self.selectCurrent() self.zeroCorrect() self.sr = SignalReceiver(self) self.sr.moveToThread(self)
def __init__(self, name=None, settings=None, log_output=None): """ Example of a script that emits a QT signal for the gui Args: name (optional): name of script, if empty same as class name settings (optional): settings for this script, if empty same as default settings """ Script.__init__(self, name, settings, log_output=log_output) # QtCore.QThread.__init__(self) QThread.__init__(self)
def __init__(self, netclient, parID_Signal, name="Receiver"): # Call the thread's constructor QThread.__init__(self) # Set the thread's data self.name = name # Initialize the variables self.netFileData = [] self.recFileData = [] self.receiverData = { "FRAME": '0', "GAZE": '0', "OneCount": '0', "ZeroCount": '0', "MaxCount": '0', "WarnCount": '0', "DangerCount": '0', "RstCount": '0', "GlanceCount": '0', "LowCount": '0' } self.frameValue = 0 self.logStream = 0 self.laneDepart = 0.0 self.laneDeviation = 0.0 self.distance = 0.0 self.bumperTime = 0.0 self.bumperDist = 0.0 self.collisionTime = 0.0 self.leadVehVel = 0.0 self.numCollision = 0 self.chassisAccel = 0.0 self.participantID = 'Default' # Connecting to the netclient signal netclient.receiverDataSignal.connect(self.setReceiverVars, Qt.QueuedConnection) parID_Signal.connect(self.setReceiverParID, Qt.QueuedConnection) try: # Create a new socket, use IPv4 and UDP # Then bind the socket to localhost and the port self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.socket.bind(('', 1224)) except socket.error as err: # Could not create the socket, bind it, or listen on the port. # Print the error message print "Could not create the socket:", err self.socket = None
def __init__(self, *args, **kwargs): QThread.__init__(self, *args, **kwargs) self.app = AppClass.instance() self.status = STATUS_NONE self.last_sync = datetime.now() self.update_count = 0 self.timer = QTimer() self.timer.timeout.connect(self.sync) self.update_timer() self.wait_condition = QWaitCondition() self.mutex = QMutex()
def __init__(self, path=None, db=[], key=None): QThread.__init__(self) self.path = path self.session = db[2] self.File = db[3] self.Folder = db[4] self.key = key self.estmf = self.session.query(self.Folder).count() self.estm = self.session.query(self.File).count() self.abo = None self.err = None
def __init__(self): QThread.__init__(self) self.code = "" self.carte = Carte() self.planification = Cheminement(self.carte) self.voltageRestant = 0 self.ileCible = -1 self.positionTresor = [] self.destination = [] self.pause = True self.reset = False
def __init__(self, name=None, target=None, args=None, kwargs=None): self._target = target if args is None: args = tuple() if kwargs is None: kwargs = dict() self._args = args self._kwargs = kwargs QThread.__init__(self) self.setObjectName(name)
def __init__(self, scripts, name = None, settings = None, log_output = None, timeout = 1000000000): self._recording = False self._timeout = timeout Script.__init__(self, name, settings, scripts = scripts, log_output = log_output) QThread.__init__(self) self.data = deque() # todo: clean this up! and plot data in gui! self._sweep_values = {'frequency' : [], 'x' : [], 'y' : [], 'phase': [], 'r':[]}.keys()
def __init__(self, parameters=None): QThread.__init__(self) self.interrupt_flag = False self.pause_flag = False self.pause_time = 10 if parameters is None: self.parameters = None else: self.set_parameters(parameters)
def __init__(self): QThread.__init__(self) self.running = True self.data_from_server = False self.queue = queue.Queue() # Data server if self.data_from_server: self.host = '188.244.51.15' self.port = 5000
def __init__(self): QThread.__init__(self) self.killMe = False pygame.init() pygame.joystick.init() #print "Number of joysticks:", pygame.joystick.get_count() if pygame.joystick.get_count() == 0: print "No Joystick available" self.joystick = None else: self.joystick = pygame.joystick.Joystick(0) self.joystick.init()
def __init__(self, *args, **kwargs): QThread.__init__(self, *args, **kwargs) self.input_buffer = "" # по этой ссылке храниться все входящие данные от последовательного порта self.out_cmd_queue = Queue( ) # в очередь кладутся словари формата {"command": комманда, "expected_regexp": RegExp ожидаемого ответа, # "additionTimeout": дополнительный таймут между ответами, по умоличани это 0} self.standart_timeout = 0.1 # self._config_object = config_object self.last_answer = None # последний ответ, на случай если произошла ошибка в процессе запросов self.last_request = None # последний запрос, на случай если произошла ошибка в процессе запросов self.debug_msg = None # debug сообщение, в случае неудачного запроса self.steps = 0 # шаги, которые нужно выполнить self.total_cmd_commands = 0 # полное количество последовательных команд
def __init__(self, probes, refresh_interval=0.5): """ probes: dictionary of probes where keys are names and values are Probe objects refresh_interval: time between reads in s """ assert isinstance(probes, dict) assert isinstance(refresh_interval, float) self.refresh_interval = refresh_interval self._running = False self.probes = probes self.probes_values = None QThread.__init__(self)
def __init__(self, probes, refresh_interval = 0.5): """ probes: dictionary of probes where keys are names and values are Probe objects refresh_interval: time between reads in s """ assert isinstance(probes, dict) assert isinstance(refresh_interval, float) self.refresh_interval = refresh_interval self._running = False self.probes = probes self.probes_values = None QThread.__init__(self)
def __init__(self, instruments, name = None, settings = None, log_output = None, timeout = 1000000000): self._recording = False self._timeout = timeout Script.__init__(self, name, settings, instruments, log_output = log_output) QThread.__init__(self) self.sweeper = self.instruments['zihf2'].daq.sweep(self._timeout) self.sweeper.set('sweep/device', self.instruments['zihf2'].device) self.data = deque() # todo: clean this up! and plot data in gui! self._sweep_values = {'frequency' : [], 'x' : [], 'y' : [], 'phase': [], 'r':[]}.keys()
def __init__(self, dir_from, dir_to, some): QThread.__init__(self, None) box = Communicate() box.mBox.connect(m_box_exec) try: self.processo = subprocess.Popen( ["rsync", "-av", "--progress", "--size-only", "%s" % dir_from, "%s" % dir_to], shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) self.some = some except Exception as e: box.mBox.emit(u"Error invoking rsync, please check if you have rsync installed.\n:= %s" % e.message) print(e)
def __init__(self, parent, func, args, ncores=1, progressText=None, pb_widget=None, redirect_stdout=False): QThread.__init__(self, parent) self.func = func self.args = args self.ncores = ncores self.progressText = progressText self.pb_widget = pb_widget self.redirect_stdout = redirect_stdout self.finished.connect(self.hideProgressbar) self.showProgressbar()
def __init__(self, parent, func, arg=None, progressText=None, pb_widget=None, redirect_stdout=False, abortButton=False): QThread.__init__(self, parent) self.func = func self.arg = arg self.progressText = progressText self.pb_widget = pb_widget self.redirect_stdout = redirect_stdout self.abortButton = abortButton self.finished.connect(self.hideProgressbar) self.showProgressbar()
def __init__(self,nm,user,password,anonuser,certPass,ptext,pbar): ''' Constructor ''' QThread.__init__(self) self.triumph = True self.user = user self.nm_iface = nm.applet self.anonuser = anonuser self.password = password self.passphrase = certPass self.certLocation = os.path.expanduser(CERT_LOCATION) self.certFolder = os.path.split(self.certLocation)[0] self.bro = Browser() if PROXY: self.bro.set_proxies({"http":PROXY,"https":PROXY}) self.bro.set_handle_robots(0)
def __init__(self, instruments = None, name = None, settings = None, log_output = None, timeout = 1000000000): self._recording = False self._timeout = timeout self.clockAdjust = int((self.settings['time_per_pt'] + self.settings['settle_time'] ) / self.settings['settle_time'] ) Script.__init__(self, name, settings=settings, instruments=instruments, log_output=log_output) QThread.__init__(self) xVmin = min(self.settings['point_a'][0], self.settings['point_b'][0]) xVmax = max(self.settings['point_a'][0], self.settings['point_b'][0]) yVmin = min(self.settings['point_a'][1], self.settings['point_b'][1]) yVmax = max(self.settings['point_a'][1], self.settings['point_b'][1]) self.x_array = np.repeat(np.linspace(xVmin, xVmax, self.settings['num_points'[0]]), self.clockAdjust) self.y_array = np.linspace(yVmin, yVmax, self.settings['num_points'[1]]) self.dt = (self.settings['time_per_pt']+self.settings['settle_time'])/self.clockAdjust self.image_data = np.zeros((self.settings['num_points'[1]],self.settings['num_points'[0]]))
def __init__(self,parent,key): QThread.__init__(self,parent) self.parent=parent self.key=key self.winKeyMap={ ",":188, ".":190, "/":191, ";":186, "'":221, "[":219, "]":220, "\\":187, "-":189, "=":187} self.show.connect(parent.toggle) self.error.connect(parent.hoyKeyError) self.setTerminationEnabled(True) self.start()
def __init__(self, inp=[], db=[], key=None): QThread.__init__(self) self.inp = inp self.session = db[2] self.File = db[3] self.Folder = db[4] self.key = key self.estm = 0 for p in self.inp: if path.isdir(p): for sd, d, f in walk(p): for fd in f: if path.isfile(path.join(sd, fd)): self.estm += 1 else: self.estm += 1 self.somesignal.emit("%% Loading files : " + str(self.estm)) self.abo = None self.err = None
def __init__(self, controller, model): """ This is the constructor of the class :param file: The json file where the packets are defined :param model: The model of the application """ QThread.__init__(self) self.model = model self.controller = controller self.add_table_signal = AddTableSignal() self.add_table_signal.signal.connect(self.model.add) self.filter_table_signal = AddTableSignal() self.filter_table_signal.signal.connect( self.controller.open_filter_callback) self.json_file = None self.timer = QTimer(self) self.timer.timeout.connect(self.update_packets) self.json_file_loaded = QWaitCondition() self.mutex = QMutex()
def __init__(self, sim): QThread.__init__(self) self._sim = sim self._running = self._starting = self._stopping = False self._stop = False
def __init__(self, source, destination, parent = None): QThread.__init__(self, parent) self.source = source self.destination = destination