Exemplo n.º 1
0
def runGui(filename=None, debug=False):

	print "Starting Monkeyprint with GUI."
	# Create a debug console text buffer.
	console = monkeyprintGuiHelper.consoleText()

	# Create settings dictionary object for machine and program settings.
	programSettings = monkeyprintSettings.programSettings(console)
	
	# Create version message.
	console.addLine("You are using Monkeyprint " + str(programSettings['versionMajor'].value) + "." + str(programSettings['versionMinor'].value) + "." + str(programSettings['revision'].value))

	# Update settings from file.	
	programSettings.readFile()
	
	# Set debug mode if specified.
	if debug:
		print "Debug mode active."
		programSettings['Debug'].value = True
	else:
		programSettings['Debug'].value = False

	# Create model collection object.
	# This object contains model data and settings data for each model.
	# Pass program settings.
	modelCollection = monkeyprintModelHandling.modelCollection(programSettings, console)

	# Create gui.
	gui = monkeyprintGui.gui(modelCollection, programSettings, console, filename)

	# Start the gui main loop.
	gui.main()
Exemplo n.º 2
0
def runGui(filename=None, debug=False):

    # Create a debug console text buffer.
    console = monkeyprintGuiHelper.consoleText()
    #	console = None

    # Create settings dictionary object for machine and program settings.
    programSettings = monkeyprintSettings.programSettings(console)

    # Create version message.
    print "Starting Monkeyprint " + str(
        programSettings['versionMajor'].getValue()) + "." + str(
            programSettings['versionMinor'].getValue()) + "." + str(
                programSettings['revision'].getValue()) + " with GUI."
    console.addLine("You are using Monkeyprint " +
                    str(programSettings['versionMajor'].getValue()) + "." +
                    str(programSettings['versionMinor'].getValue()) + "." +
                    str(programSettings['revision'].getValue()))

    # Get current working directory and set paths.
    # Is this still relevant?
    cwd = os.getcwd()
    programSettings['localMkpPath'].setValue(cwd + "/currentPrint.mkp")

    base_path = programSettings.getInstallDir()

    # Update settings from file.
    programSettings.readFile(base_path)

    # Get cwd for exe
    programSettings['installDir'].setValue(getInstallDir())
    print "Running from " + programSettings['installDir'].getValue()
    # Set debug mode if specified.
    if debug:
        print "Debug mode active."
        programSettings['debug'].setValue(True)
    else:
        programSettings['debug'].setValue(False)

    # Create model collection object.
    # This object contains model data and settings data for each model.
    # Pass program settings.
    modelCollection = monkeyprintModelHandling.modelCollection(
        programSettings, console)

    # Create splash screen for given interval.
    # Get version string first.
    versionString = "Monkeyprint version " + str(
        programSettings['versionMajor'].getValue()) + "." + str(
            programSettings['versionMinor'].getValue()) + "." + str(
                programSettings['revision'].getValue())

    # Create gui.
    gui = monkeyprintGui.gui(modelCollection, programSettings, console,
                             filename)

    # Start the gui main loop.
    gui.main()
Exemplo n.º 3
0
def runGui(filename=None, debug=False):

    print "Starting Monkeyprint with GUI."
    # Create a debug console text buffer.
    console = monkeyprintGuiHelper.consoleText()

    # Create settings dictionary object for machine and program settings.
    programSettings = monkeyprintSettings.programSettings(console)

    # Create version message.
    console.addLine("You are using Monkeyprint " +
                    str(programSettings['versionMajor'].value) + "." +
                    str(programSettings['versionMinor'].value) + "." +
                    str(programSettings['revision'].value))

    # Update settings from file.
    programSettings.readFile()

    # Set debug mode if specified.
    if debug:
        print "Debug mode active."
        programSettings['debug'].value = True
    else:
        programSettings['debug'].value = False

    # Create model collection object.
    # This object contains model data and settings data for each model.
    # Pass program settings.
    modelCollection = monkeyprintModelHandling.modelCollection(
        programSettings, console)

    # Create splash screen for given interval.
    # Get version string first.
    versionString = "Monkeyprint version " + str(
        programSettings['versionMajor'].value) + "." + str(
            programSettings['versionMinor'].value) + "." + str(
                programSettings['revision'].value)
    print versionString
    splash = monkeyprintGuiHelper.splashWindow(imageFile='./logo.png',
                                               duration=1,
                                               infoString=versionString)

    # Create gui.
    gui = monkeyprintGui.gui(modelCollection, programSettings, console,
                             filename)

    # Start the gui main loop.
    gui.main()
Exemplo n.º 4
0
import monkeyprintGui
import monkeyprintGuiHelper


# Test if this file is executed as the main application contrary to being executed as a model from inside another file.
if __name__ == "__main__":

	# Create a debug console text buffer.
	console = monkeyprintGuiHelper.consoleText()

	# Create settings dictionary object for machine and program settings.
	programSettings = monkeyprintSettings.programSettings(console)

	# Create version message.
	console.addLine("You are using Monkeyprint " + str(programSettings['versionMajor'].value) + "." + str(programSettings['versionMinor'].value) + "." + str(programSettings['revision'].value))

	# Update settings from file.	
	programSettings.readFile()

	# Create model collection object.
	# This object contains model data and settings data for each model.
	# Pass printer and program settings.
	modelCollection = monkeyprintModelHandling.modelCollection(programSettings, console)

	# Create gui.
	gui = monkeyprintGui.gui(modelCollection, programSettings, console)

	# Start the gui main loop.
	gui.main()