Example #1
0
 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)
Example #3
0
 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)
Example #5
0
 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)
Example #7
0
 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)
Example #8
0
 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)
Example #10
0
 def endComputationHandler(self,computation):
     signalLogger.debug(computation.status)
     self.__updateStatus(computation.status)
     self.__updateTime(computation.accTime,computation.accGcTime)
     self.__updateMode(computation.symbolic)
Example #11
0
 def startComputationHandler(self,computation):
     signalLogger.debug(computation.command)
     signalLogger.debug(computation.status)
     self.__updateStatus(computation.status)
Example #12
0
 def currentSizeChangedHandler(self,size):
     signalLogger.debug("size=%s" % size)
     self.controller.view.currentSizeChangedHandler(size, self.isFullScreen())
Example #13
0
 def currentFontChangedHandler(self,font):
     signalLogger.debug("font=%s" % font)
     self.controller.view.currentFontChangedHandler(font)
     self.__setWidthByFont(QtReduceDefaults.WIDTH,True)
Example #14
0
 def signal(self,c):
     signalLogger.debug("c=%s" % c)
     os.system('/bin/kill -' + c + ' ' + str(self.__processId))