def launchTask(self,taskcommand, form): self.form=form self.connect(self.form, SIGNAL("finished(int)"), self.abort) self.task=taskcommand.split()[0].upper() if not taskcommand: # empty input: return # ignore #Initially ID_POLL=['TASKCOM0=', 'TASKCOM1=','TASKCOM2='] if len(ID_POLL)==0: self.form.showStatus('Cannot run %s. Maximum 3 GUIpsy tasks simultaneously'%self.task) return else: notifykey=ID_POLL.pop() #self.log="gipsy.xeq(\"%s\",\"%s\")\n"%(taskcommand, notifykey) self.log="gipsy.xeq(\"%s\")\n"%(taskcommand) dcb=[] try: gipsy.xeq(taskcommand, notifykey) # start task gipsy.KeyCallback(self.finished, notifykey, task=taskcommand, notifykey=notifykey, others=dcb) # register callback #gipsy.KeyCallback(self.finished, notifykey=notifykey, task=taskcommand, others=dcb) # register callback dcb.append(gipsy.KeyCallback(self.taskrequest, 'K_'+notifykey,task=self.task, notifykey=notifykey)) dcb.append(gipsy.KeyCallback(self.show_status, 'S_'+notifykey , notifykey=notifykey)) except XeqError as e: self.form.showStatus('Cannot run %s. Probably Hermes has not a free task slot' % self.task) # failed to start
def launchTask(self,task): self.form = dynamicalForm(task) self.connect(self.form, SIGNAL("finished(int)"), self.abort) self.form.show() self.taskname = task if not self.taskname: # empty input: return # ignore notifykey = 'TASKCOM=' self.log="#The next task might have been executed from two places: \n#1)From the task help tab, in this case the keywords used have not been recovered in this log\n#2)From python/cola tab\n gipsy.xeq(\"%s\",\"%s\")\n"%(self.taskname, notifykey) try: gipsy.xeq(self.taskname, notifykey) # start task gipsy.KeyCallback(self.finished, notifykey, task=self.taskname) # register callback gipsy.KeyCallback(self.taskrequest, 'K_'+notifykey,task=self.taskname, notifykey=notifykey) gipsy.KeyCallback(self.show_status, 'S_'+notifykey) self.form.lineedit.setDisabled(True) except: self.form.statusLabel.setText('Cannot run %s' % self.taskname) # failed to start
def launchTask(self,task): self.form = dynamicalForm(task) self.connect(self.form, SIGNAL("finished(int)"), self.abort) self.form.show() self.taskname = task if not self.taskname: # empty input: return # ignore notifykey = 'TASKCOM=' self.log="xeq(\"%s\",\"%s\")\n"%(self.taskname, notifykey) try: gipsy.xeq(self.taskname, notifykey) # start task gipsy.KeyCallback(self.finished, notifykey, task=self.taskname) # register callback gipsy.KeyCallback(self.taskrequest, 'K_'+notifykey,task=self.taskname, notifykey=notifykey) gipsy.KeyCallback(self.show_status, 'S_'+notifykey) self.form.lineedit.setDisabled(True) except: self.form.statusLabel.setText('Cannot run %s' % self.taskname) # failed to start