def compute(self,row,count=1): traceLogger.debug("row=%d, count=%d" % (row, count)) for i in range(row,row+count): computation = self.data(self.index(i,0),QtReduceModel.RawDataRole) signalLogger.debug("Emmitting %s" % computation.command) #self.startComputation.emit(computation) self.reduce.compute(computation)
def endComputationM(self,computation): signalLogger.debug("catching computation.statCounter = %s," "status=%s" % (computation.statCounter,computation.status)) self.view.setReadOnly(False) self.acceptAbort.emit(False) self.endComputation.emit(computation)
def startedHandler(self): l = len(self.startedComputations) if l != 1: traceLogger.warning("queue of %d started computations" % l) while self.startedComputations: c = self.startedComputations.pop(0) signalLogger.debug("emitting startComputation %s" % c.command) self.startComputation.emit(c)
def computationRequestV(self,row): signalLogger.debug("catching row = %d" % row) if not self.view.input(row): return index = self.model.index(row,0) computation = self.model.data(index,QtReduceModel.RawDataRole) computation.command = self.view.input(row) self.model.setData(index,computation,QtReduceModel.RawDataRole) self.model.compute(row)
def finishedHandler(self): self.isComputing = False l = len(self.finishedComputations) if l != 1: traceLogger.warning("queue of %d finished computations" % l) while self.finishedComputations: c = self.finishedComputations.pop(0) signalLogger.debug("emitting endComputation %s" % c.command) self.endComputation.emit(c) self.resumeBatch()
def dataChangedM(self,topLeft,bottomRight): if self.updatingModel: return start = topLeft.row() end = bottomRight.row() signalLogger.debug("start = %d, end = %d" % (start,end)) for row in range(start,end+1): index = self.model.index(row,0) computation = self.model.data(index,QtReduceModel.RawDataRole) self.setCell(row,computation) if computation.status in [QtReduceComputation.Error, QtReduceComputation.Aborted]: return if row < self.model.rowCount() - 1: self.view.gotoRow(row + 1)
def keyPressEvent(self,e): if e.key() == Qt.Key_Tab: self.gotoNextOtherPosition() return if e.key() == Qt.Key_Backtab: self.gotoPreviousOtherPosition() return if self.__isReadOnlyPosition(): if e.key() not in [Qt.Key_Left,Qt.Key_Right,Qt.Key_Up,Qt.Key_Down]: return if self.__isInputPosition(): if (e.key() == Qt.Key_Return or e.key() == Qt.Key_Enter) and \ not (e.modifiers() & Qt.ShiftModifier): signalLogger.debug("emitting computationRequest") self.computationRequest.emit(self.row()) return super(QtReduceTextEdit,self).keyPressEvent(e)
def keyPressEvent(self, e): if e.key() == Qt.Key_Tab: self.gotoNextOtherPosition() return if e.key() == Qt.Key_Backtab: self.gotoPreviousOtherPosition() return if self.__isReadOnlyPosition(): if e.key() not in [ Qt.Key_Left, Qt.Key_Right, Qt.Key_Up, Qt.Key_Down ]: return if self.__isInputPosition(): if (e.key() == Qt.Key_Return or e.key() == Qt.Key_Enter) and \ not (e.modifiers() & Qt.ShiftModifier): signalLogger.debug("emitting computationRequest") self.computationRequest.emit(self.row()) return super(QtReduceTextEdit, self).keyPressEvent(e)
def startComputationM(self,computation): signalLogger.debug("catching computation.command = %s" % computation.command) self.view.setReadOnly(True) self.acceptAbort.emit(True) self.startComputation.emit(computation)
def endComputationHandler(self,computation): signalLogger.debug(computation.status) self.__updateStatus(computation.status) self.__updateTime(computation.accTime,computation.accGcTime) self.__updateMode(computation.symbolic)
def startComputationHandler(self,computation): signalLogger.debug(computation.command) signalLogger.debug(computation.status) self.__updateStatus(computation.status)
def currentSizeChangedHandler(self,size): signalLogger.debug("size=%s" % size) self.controller.view.currentSizeChangedHandler(size, self.isFullScreen())
def currentFontChangedHandler(self,font): signalLogger.debug("font=%s" % font) self.controller.view.currentFontChangedHandler(font) self.__setWidthByFont(QtReduceDefaults.WIDTH,True)
def signal(self,c): signalLogger.debug("c=%s" % c) os.system('/bin/kill -' + c + ' ' + str(self.__processId))