Example #1
0
            #print "Updating new Max"
            self.progress.setMaximum(newMax)
        
    def iterationClicked(self, event):
        iterations, ok = QtGui.QInputDialog.getInt(self, "Iterations", "Enter new Iterations",
                                                    value=self.fractalServer.iterations, min=1)
        if ok:
            self.fractalServer.iterations = iterations
            self.fractalDisplay.newFractal()
            self.iterationsButton.setText("Max Iterations: {0}".format(iterations))
            


if __name__ == "__main__":
    app = QtGui.QApplication([])
    display = FractalDisplay()
    server = FractalServer()
    display.startGenerator = server.startGenerator
    server.onFinishedPoints = display.onFinishedPoints
    server.newFractal = display.newFractal
    window = Window(display, server)
    app.exec_()








Example #2
0
            self.clientLock.acquire()
            thread = threading.currentThread()
            self.clientPipes.remove(resultsPipe)
            self.clients -= 1
            self.clientNumber.emit(self.clients)
            self.clientLock.release()
                
class QueueManager(BaseManager): pass




if __name__ == "__main__":
    from display import FractalDisplay
    from PyQt4 import QtGui
    
    # setup Server    
    server = FractalServer()
    
    # setup GUI
    app = QtGui.QApplication([])
    display = FractalDisplay()
    
    # link canvas and server
    display.startGenerator = server.startGenerator   
    server.onFinishedPoints = display.onFinishedPoints
    display.newFractal()
    
    # open GUI will call spark resize event that will kick off the generators
    app.exec_()