diff --git a/CMakeLists.txt b/CMakeLists.txt index 32b356daa0..a56800925b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,8 @@ project(cura) cmake_minimum_required(VERSION 2.8.12) +include(GNUInstallDirs) + set(URANIUM_SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/../uranium/scripts" CACHE DIRECTORY "The location of the scripts directory of the Uranium repository") if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "") @@ -10,13 +12,14 @@ if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "") # Build Translations find_package(Gettext) - include(${URANIUM_SCRIPTS_DIR}/ECMPoQmTools.cmake) + find_package(Qt5LinguistTools QUIET CONFIG) + if(GETTEXT_FOUND AND Qt5LinguistTools_FOUND) + include(${URANIUM_SCRIPTS_DIR}/ECMPoQmTools.cmake) - if(GETTEXT_FOUND) # translations target will convert .po files into .mo and .qm as needed. # The files are checked for a _qt suffix and if it is found, converted to # qm, otherwise they are converted to .po. - add_custom_target(translations) + add_custom_target(translations ALL) # copy-translations can be used to copy the built translation files from the # build directory to the source resources directory. This is mostly a convenience # during development, normally you want to simply use the install target to install @@ -51,11 +54,12 @@ if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "") foreach(file ${qm_files} ${mo_files}) add_custom_command(TARGET copy-translations POST_BUILD COMMAND mkdir ARGS -p ${CMAKE_SOURCE_DIR}/resources/i18n/${lang}/LC_MESSAGES/ COMMAND cp ARGS ${file} ${CMAKE_SOURCE_DIR}/resources/i18n/${lang}/LC_MESSAGES/ COMMENT "Copying ${file}...") endforeach() + + install(FILES ${qm_files} ${mo_files} DESTINATION ${CMAKE_INSTALL_DATADIR}/uranium/resources/i18n/${lang}/LC_MESSAGES/) endforeach() endif() endif() -include(GNUInstallDirs) find_package(PythonInterp 3.4.0 REQUIRED) install(DIRECTORY resources DESTINATION ${CMAKE_INSTALL_DATADIR}/cura) diff --git a/README.md b/README.md index 2fb2d6f682..f118fa66d5 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,8 @@ Please checkout [cura-build](https://github.com/Ultimaker/cura-build) Third party plugins ------------- -[Print time calculator](https://github.com/nallath/PrintCostCalculator) +* [Print time calculator](https://github.com/nallath/PrintCostCalculator) +* [Post processing plugin](https://github.com/nallath/PostProcessingPlugin) Making profiles for other printers ---------------------------------- diff --git a/cura.desktop b/cura.desktop index d325dde621..9ce843be93 100644 --- a/cura.desktop +++ b/cura.desktop @@ -5,7 +5,7 @@ GenericName=3D Printing Software Comment= Exec=/usr/bin/cura_app.py TryExec=/usr/bin/cura_app.py -Icon=/usr/share/cura/resources/images/cura_icon.png +Icon=/usr/share/cura/resources/images/cura-icon.png Terminal=false Type=Application Categories=Graphics; diff --git a/cura/ConvexHullJob.py b/cura/ConvexHullJob.py index 0399148025..1e87892504 100644 --- a/cura/ConvexHullJob.py +++ b/cura/ConvexHullJob.py @@ -25,20 +25,21 @@ class ConvexHullJob(Job): child_hull = child.callDecoration("getConvexHull") if child_hull: hull.setPoints(numpy.append(hull.getPoints(), child_hull.getPoints(), axis = 0)) - + if hull.getPoints().size < 3: self._node.callDecoration("setConvexHull", None) self._node.callDecoration("setConvexHullJob", None) return - + else: if not self._node.getMeshData(): return mesh = self._node.getMeshData() vertex_data = mesh.getTransformed(self._node.getWorldTransformation()).getVertices() - + # Don't use data below 0. TODO; We need a better check for this as this gives poor results for meshes with long edges. + vertex_data = vertex_data[vertex_data[:,1]>0] hull = Polygon(numpy.rint(vertex_data[:, [0, 2]]).astype(int)) - + # First, calculate the normal convex hull around the points hull = hull.getConvexHull() @@ -57,7 +58,7 @@ class ConvexHullJob(Job): self._node.callDecoration("setConvexHullNode", hull_node) self._node.callDecoration("setConvexHull", hull) self._node.callDecoration("setConvexHullJob", None) - + if self._node.getParent().callDecoration("isGroup"): job = self._node.getParent().callDecoration("getConvexHullJob") if job: diff --git a/cura/ConvexHullNode.py b/cura/ConvexHullNode.py index 7de28e777e..3ea148dce8 100644 --- a/cura/ConvexHullNode.py +++ b/cura/ConvexHullNode.py @@ -33,14 +33,14 @@ class ConvexHullNode(SceneNode): self._hull = hull hull_points = self._hull.getPoints() - center = (hull_points.min(0) + hull_points.max(0)) / 2.0 - mesh = MeshData() - mesh.addVertex(center[0], 0.1, center[1]) - + if len(hull_points) > 3: + center = (hull_points.min(0) + hull_points.max(0)) / 2.0 + mesh.addVertex(center[0], 0.1, center[1]) + else: #Hull has not enough points + return for point in hull_points: mesh.addVertex(point[0], 0.1, point[1]) - indices = [] for i in range(len(hull_points) - 1): indices.append([0, i + 1, i + 2]) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index b6ecd34a63..a0e02874de 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -38,7 +38,11 @@ from . import PrintInformation from . import CuraActions from . import MultiMaterialDecorator +<<<<<<< HEAD from PyQt5.QtCore import pyqtSlot, QUrl, Qt, pyqtSignal, pyqtProperty, Q_ENUMS +======= +from PyQt5.QtCore import pyqtSlot, QUrl, Qt, pyqtSignal, pyqtProperty, QEvent +>>>>>>> 3cb3cce31c821a56d2395607a90b51030fdf0916 from PyQt5.QtGui import QColor, QIcon import platform @@ -84,6 +88,7 @@ class CuraApplication(QtApplication): self._platform_activity = False self.getMachineManager().activeMachineInstanceChanged.connect(self._onActiveMachineChanged) + self.getController().getScene().sceneChanged.connect(self.updatePlatformActivity) Resources.addType(self.ResourceTypes.QmlFiles, "qml") Resources.addType(self.ResourceTypes.Firmware, "firmware") @@ -92,6 +97,7 @@ class CuraApplication(QtApplication): Preferences.getInstance().addPreference("cura/active_mode", "simple") Preferences.getInstance().addPreference("cura/recent_files", "") Preferences.getInstance().addPreference("cura/categories_expanded", "") + Preferences.getInstance().addPreference("view/center_on_select", True) JobQueue.getInstance().jobFinished.connect(self._onJobFinished) @@ -123,6 +129,11 @@ class CuraApplication(QtApplication): def run(self): self._i18n_catalog = i18nCatalog("cura"); + i18nCatalog.setTagReplacements({ + "filename": "font color=\"black\"", + "message": "font color=UM.Theme.colors.message_text;", + }) + self.showSplashMessage(self._i18n_catalog.i18nc("Splash screen message", "Setting up scene...")) controller = self.getController() @@ -133,7 +144,7 @@ class CuraApplication(QtApplication): t = controller.getTool("TranslateTool") if t: - t.setEnabledAxis([ToolHandle.XAxis, ToolHandle.ZAxis]) + t.setEnabledAxis([ToolHandle.XAxis, ToolHandle.YAxis,ToolHandle.ZAxis]) Selection.selectionChanged.connect(self.onSelectionChanged) @@ -181,12 +192,17 @@ class CuraApplication(QtApplication): self.closeSplash() for file in self.getCommandLineOption("file", []): - job = ReadMeshJob(os.path.abspath(file)) - job.finished.connect(self._onFileLoaded) - job.start() + self._openFile(file) self.exec_() + # Handle Qt events + def event(self, event): + if event.type() == QEvent.FileOpen: + self._openFile(event.file()) + + return super().event(event) + def registerObjects(self, engine): engine.rootContext().setContextProperty("Printer", self) self._print_information = PrintInformation.PrintInformation() @@ -202,10 +218,10 @@ class CuraApplication(QtApplication): self._previous_active_tool = None else: self.getController().setActiveTool("TranslateTool") - - self._camera_animation.setStart(self.getController().getTool("CameraTool").getOrigin()) - self._camera_animation.setTarget(Selection.getSelectedObject(0).getWorldPosition()) - self._camera_animation.start() + if Preferences.getInstance().getValue("view/center_on_select"): + self._camera_animation.setStart(self.getController().getTool("CameraTool").getOrigin()) + self._camera_animation.setTarget(Selection.getSelectedObject(0).getWorldPosition()) + self._camera_animation.start() else: if self.getController().getActiveTool(): self._previous_active_tool = self.getController().getActiveTool().getPluginId() @@ -220,24 +236,15 @@ class CuraApplication(QtApplication): def getPlatformActivity(self): return self._platform_activity - @pyqtSlot(bool) - def setPlatformActivity(self, activity): - ##Sets the _platform_activity variable on true or false depending on whether there is a mesh on the platform - if activity == True: - self._platform_activity = activity - elif activity == False: - nodes = [] - for node in DepthFirstIterator(self.getController().getScene().getRoot()): - if type(node) is not SceneNode or not node.getMeshData(): - continue - nodes.append(node) - i = 0 - for node in nodes: - if not node.getMeshData(): - continue - i += 1 - if i <= 1: ## i == 0 when the meshes are removed using the deleteAll function; i == 1 when the last remaining mesh is removed using the deleteObject function - self._platform_activity = activity + def updatePlatformActivity(self, node = None): + count = 0 + for node in DepthFirstIterator(self.getController().getScene().getRoot()): + if type(node) is not SceneNode or not node.getMeshData(): + continue + + count += 1 + + self._platform_activity = True if count > 0 else False self.activityChanged.emit() ## Remove an object from the scene @@ -258,8 +265,7 @@ class CuraApplication(QtApplication): group_node = group_node.getParent() op = RemoveSceneNodeOperation(group_node) op.push() - self.setPlatformActivity(False) - + ## Create a number of copies of existing object. @pyqtSlot("quint64", int) def multiplyObject(self, object_id, count): @@ -306,8 +312,7 @@ class CuraApplication(QtApplication): op.addOperation(RemoveSceneNodeOperation(node)) op.push() - self.setPlatformActivity(False) - + ## Reset all translation on nodes with mesh data. @pyqtSlot() def resetAllTranslation(self): @@ -490,12 +495,9 @@ class CuraApplication(QtApplication): self._platform.setPosition(Vector(0.0, 0.0, 0.0)) def _onFileLoaded(self, job): - mesh = job.getResult() - if mesh != None: - node = SceneNode() - + node = job.getResult() + if node != None: node.setSelectable(True) - node.setMeshData(mesh) node.setName(os.path.basename(job.getFileName())) op = AddSceneNodeOperation(node, self.getController().getScene().getRoot()) @@ -521,4 +523,10 @@ class CuraApplication(QtApplication): self.recentFilesChanged.emit() def _reloadMeshFinished(self, job): - job._node.setMeshData(job.getResult()) + job._node = job.getResult() + + def _openFile(self, file): + job = ReadMeshJob(os.path.abspath(file)) + job.finished.connect(self._onFileLoaded) + job.start() + diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index 7f6c1df3b9..f96c81abce 100644 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -12,6 +12,8 @@ from UM.Math.Vector import Vector from UM.Math.AxisAlignedBox import AxisAlignedBox from UM.Application import Application from UM.Scene.Selection import Selection +from UM.Preferences import Preferences + from cura.ConvexHullDecorator import ConvexHullDecorator from . import PlatformPhysicsOperation @@ -19,6 +21,7 @@ from . import ConvexHullJob import time import threading +import copy class PlatformPhysics: def __init__(self, controller, volume): @@ -36,6 +39,8 @@ class PlatformPhysics: self._change_timer.setSingleShot(True) self._change_timer.timeout.connect(self._onChangeTimerFinished) + Preferences.getInstance().addPreference("physics/automatic_push_free", True) + def _onSceneChanged(self, source): self._change_timer.start() @@ -53,16 +58,21 @@ class PlatformPhysics: self._change_timer.start() continue + build_volume_bounding_box = copy.deepcopy(self._build_volume.getBoundingBox()) + build_volume_bounding_box.setBottom(-9001) # Ignore intersections with the bottom + # Mark the node as outside the build volume if the bounding box test fails. - if self._build_volume.getBoundingBox().intersectsBox(bbox) != AxisAlignedBox.IntersectionResult.FullIntersection: + if build_volume_bounding_box.intersectsBox(bbox) != AxisAlignedBox.IntersectionResult.FullIntersection: node._outside_buildarea = True else: node._outside_buildarea = False - # Move the node upwards if the bottom is below the build platform. + # Move it downwards if bottom is above platform move_vector = Vector() - if not Float.fuzzyCompare(bbox.bottom, 0.0): + if bbox.bottom > 0: move_vector.setY(-bbox.bottom) + #if not Float.fuzzyCompare(bbox.bottom, 0.0): + # pass#move_vector.setY(-bbox.bottom) # If there is no convex hull for the node, start calculating it and continue. if not node.getDecorator(ConvexHullDecorator): @@ -76,7 +86,7 @@ class PlatformPhysics: elif Selection.isSelected(node): pass - else: + elif Preferences.getInstance().getValue("physics/automatic_push_free"): # Check for collisions between convex hulls for other_node in BreadthFirstIterator(root): # Ignore root, ourselves and anything that is not a normal SceneNode. @@ -107,8 +117,10 @@ class PlatformPhysics: move_vector.setX(overlap[0] * 1.1) move_vector.setZ(overlap[1] * 1.1) - convex_hull = node.callDecoration("getConvexHull") + convex_hull = node.callDecoration("getConvexHull") if convex_hull: + if not convex_hull.isValid(): + return # Check for collisions between disallowed areas and the object for area in self._build_volume.getDisallowedAreas(): overlap = convex_hull.intersectsPolygon(area) diff --git a/plugins/3MFReader/ThreeMFReader.py b/plugins/3MFReader/ThreeMFReader.py new file mode 100644 index 0000000000..ca3904bc4e --- /dev/null +++ b/plugins/3MFReader/ThreeMFReader.py @@ -0,0 +1,124 @@ +# Copyright (c) 2015 Ultimaker B.V. +# Cura is released under the terms of the AGPLv3 or higher. + +from UM.Mesh.MeshReader import MeshReader +from UM.Mesh.MeshData import MeshData +from UM.Logger import Logger +from UM.Math.Matrix import Matrix +from UM.Math.Vector import Vector +from UM.Scene.SceneNode import SceneNode +from UM.Scene.GroupDecorator import GroupDecorator +from UM.Math.Quaternion import Quaternion + + +import os +import struct +import math +from os import listdir +import zipfile + +import xml.etree.ElementTree as ET + +## Base implementation for reading 3MF files. Has no support for textures. Only loads meshes! +class ThreeMFReader(MeshReader): + def __init__(self): + super(ThreeMFReader, self).__init__() + self._supported_extension = ".3mf" + + self._namespaces = { + "3mf": "http://schemas.microsoft.com/3dmanufacturing/core/2015/02", + "cura": "http://software.ultimaker.com/xml/cura/3mf/2015/10" + } + + def read(self, file_name): + result = None + extension = os.path.splitext(file_name)[1] + if extension.lower() == self._supported_extension: + result = SceneNode() + # The base object of 3mf is a zipped archive. + archive = zipfile.ZipFile(file_name, 'r') + try: + root = ET.parse(archive.open("3D/3dmodel.model")) + + # There can be multiple objects, try to load all of them. + objects = root.findall("./3mf:resources/3mf:object", self._namespaces) + for object in objects: + mesh = MeshData() + node = SceneNode() + vertex_list = [] + #for vertex in object.mesh.vertices.vertex: + for vertex in object.findall(".//3mf:vertex", self._namespaces): + vertex_list.append([vertex.get("x"), vertex.get("y"), vertex.get("z")]) + + triangles = object.findall(".//3mf:triangle", self._namespaces) + + mesh.reserveFaceCount(len(triangles)) + + #for triangle in object.mesh.triangles.triangle: + for triangle in triangles: + v1 = int(triangle.get("v1")) + v2 = int(triangle.get("v2")) + v3 = int(triangle.get("v3")) + mesh.addFace(vertex_list[v1][0],vertex_list[v1][1],vertex_list[v1][2],vertex_list[v2][0],vertex_list[v2][1],vertex_list[v2][2],vertex_list[v3][0],vertex_list[v3][1],vertex_list[v3][2]) + #TODO: We currently do not check for normals and simply recalculate them. + mesh.calculateNormals() + node.setMeshData(mesh) + node.setSelectable(True) + + transformation = root.findall("./3mf:build/3mf:item[@objectid='{0}']".format(object.get("id")), self._namespaces) + if transformation: + transformation = transformation[0] + + if transformation.get("transform"): + splitted_transformation = transformation.get("transform").split() + ## Transformation is saved as: + ## M00 M01 M02 0.0 + ## M10 M11 M12 0.0 + ## M20 M21 M22 0.0 + ## M30 M31 M32 1.0 + ## We switch the row & cols as that is how everyone else uses matrices! + temp_mat = Matrix() + # Rotation & Scale + temp_mat._data[0,0] = splitted_transformation[0] + temp_mat._data[1,0] = splitted_transformation[1] + temp_mat._data[2,0] = splitted_transformation[2] + temp_mat._data[0,1] = splitted_transformation[3] + temp_mat._data[1,1] = splitted_transformation[4] + temp_mat._data[2,1] = splitted_transformation[5] + temp_mat._data[0,2] = splitted_transformation[6] + temp_mat._data[1,2] = splitted_transformation[7] + temp_mat._data[2,2] = splitted_transformation[8] + + # Translation + temp_mat._data[0,3] = splitted_transformation[9] + temp_mat._data[1,3] = splitted_transformation[10] + temp_mat._data[2,3] = splitted_transformation[11] + + node.setPosition(Vector(temp_mat.at(0,3), temp_mat.at(1,3), temp_mat.at(2,3))) + + temp_quaternion = Quaternion() + temp_quaternion.setByMatrix(temp_mat) + node.setOrientation(temp_quaternion) + + # Magical scale extraction + S2 = temp_mat.getTransposed().multiply(temp_mat) + scale_x = math.sqrt(S2.at(0,0)) + scale_y = math.sqrt(S2.at(1,1)) + scale_z = math.sqrt(S2.at(2,2)) + node.setScale(Vector(scale_x,scale_y,scale_z)) + + # We use a different coordinate frame, so rotate. + rotation = Quaternion.fromAngleAxis(-0.5 * math.pi, Vector(1,0,0)) + node.rotate(rotation) + result.addChild(node) + + #If there is more then one object, group them. + try: + if len(objects) > 1: + group_decorator = GroupDecorator() + result.addDecorator(group_decorator) + except: + pass + except Exception as e: + Logger.log("e" ,"exception occured in 3mf reader: %s" , e) + return result diff --git a/plugins/3MFReader/__init__.py b/plugins/3MFReader/__init__.py new file mode 100644 index 0000000000..04bf2decf5 --- /dev/null +++ b/plugins/3MFReader/__init__.py @@ -0,0 +1,25 @@ +# Copyright (c) 2015 Ultimaker B.V. +# Cura is released under the terms of the AGPLv3 or higher. + +from UM.i18n import i18nCatalog +catalog = i18nCatalog("cura") + +from . import ThreeMFReader + +def getMetaData(): + return { + "plugin": { + "name": "3MF Reader", + "author": "Ultimaker", + "version": "1.0", + "description": catalog.i18nc("3MF Reader plugin description", "Provides support for reading 3MF files."), + "api": 2 + }, + "mesh_reader": { + "extension": "3mf", + "description": catalog.i18nc("3MF Reader plugin file type", "3MF File") + } + } + +def register(app): + return { "mesh_reader": ThreeMFReader.ThreeMFReader() } diff --git a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py index 2728dfd90b..9c9afa4246 100644 --- a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py +++ b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py @@ -17,8 +17,8 @@ class RemovableDriveOutputDevice(OutputDevice): super().__init__(device_id) self.setName(device_name) - self.setShortDescription(catalog.i18nc("", "Save to Removable Drive")) - self.setDescription(catalog.i18nc("", "Save to Removable Drive {0}").format(device_name)) + self.setShortDescription(catalog.i18nc("@action:button", "Save to Removable Drive")) + self.setDescription(catalog.i18nc("@info:tooltip", "Save to Removable Drive {0}").format(device_name)) self.setIconName("save_sd") self.setPriority(1) @@ -49,7 +49,7 @@ class RemovableDriveOutputDevice(OutputDevice): job.progress.connect(self._onProgress) job.finished.connect(self._onFinished) - message = Message(catalog.i18nc("", "Saving to Removable Drive {0}").format(self.getName()), 0, False, -1) + message = Message(catalog.i18nc("@info:status", "Saving to Removable Drive {0}").format(self.getName()), 0, False, -1) message.show() job._message = message diff --git a/plugins/USBPrinting/FirmwareUpdateWindow.qml b/plugins/USBPrinting/FirmwareUpdateWindow.qml index 5217e59aa1..12f4931697 100644 --- a/plugins/USBPrinting/FirmwareUpdateWindow.qml +++ b/plugins/USBPrinting/FirmwareUpdateWindow.qml @@ -22,7 +22,7 @@ UM.Dialog Column { anchors.fill: parent; - + Text { anchors { diff --git a/plugins/USBPrinting/PrinterConnection.py b/plugins/USBPrinting/PrinterConnection.py index cc4a04c275..1ac1cb1b89 100644 --- a/plugins/USBPrinting/PrinterConnection.py +++ b/plugins/USBPrinting/PrinterConnection.py @@ -8,96 +8,156 @@ import time import queue import re import functools +import os +import os.path from UM.Application import Application from UM.Signal import Signal, SignalEmitter from UM.Resources import Resources from UM.Logger import Logger +from UM.OutputDevice.OutputDevice import OutputDevice +from UM.OutputDevice import OutputDeviceError +from UM.PluginRegistry import PluginRegistry + +from PyQt5.QtQuick import QQuickView +from PyQt5.QtQml import QQmlComponent, QQmlContext +from PyQt5.QtCore import QUrl, QObject, pyqtSlot, pyqtProperty, pyqtSignal, Qt + +from UM.i18n import i18nCatalog +catalog = i18nCatalog("cura") + +class PrinterConnection(OutputDevice, QObject, SignalEmitter): + def __init__(self, serial_port, parent = None): + QObject.__init__(self, parent) + OutputDevice.__init__(self, serial_port) + SignalEmitter.__init__(self) + #super().__init__(serial_port) + self.setName(catalog.i18nc("@item:inmenu", "USB printing")) + self.setShortDescription(catalog.i18nc("@action:button", "Print with USB")) + self.setDescription(catalog.i18nc("@info:tooltip", "Print with USB")) + self.setIconName("print") -class PrinterConnection(SignalEmitter): - def __init__(self, serial_port): - super().__init__() - self._serial = None self._serial_port = serial_port self._error_state = None - + self._connect_thread = threading.Thread(target = self._connect) self._connect_thread.daemon = True - + + self._end_stop_thread = threading.Thread(target = self._pollEndStop) + self._end_stop_thread.deamon = True + # Printer is connected self._is_connected = False - + # Printer is in the process of connecting self._is_connecting = False - + # The baud checking is done by sending a number of m105 commands to the printer and waiting for a readable # response. If the baudrate is correct, this should make sense, else we get giberish. - self._required_responses_auto_baud = 10 - + self._required_responses_auto_baud = 3 + self._progress = 0 - + self._listen_thread = threading.Thread(target=self._listen) self._listen_thread.daemon = True - + self._update_firmware_thread = threading.Thread(target= self._updateFirmware) - self._update_firmware_thread.demon = True + self._update_firmware_thread.deamon = True self._heatup_wait_start_time = time.time() - + ## Queue for commands that need to be send. Used when command is sent when a print is active. self._command_queue = queue.Queue() - + self._is_printing = False - + ## Set when print is started in order to check running time. self._print_start_time = None self._print_start_time_100 = None - + ## Keep track where in the provided g-code the print is self._gcode_position = 0 - + # List of gcode lines to be printed self._gcode = [] - + # Number of extruders self._extruder_count = 1 - + # Temperatures of all extruders self._extruder_temperatures = [0] * self._extruder_count - + # Target temperatures of all extruders self._target_extruder_temperatures = [0] * self._extruder_count - + #Target temperature of the bed self._target_bed_temperature = 0 - + # Temperature of the bed self._bed_temperature = 0 - + # Current Z stage location self._current_z = 0 - + + self._x_min_endstop_pressed = False + self._y_min_endstop_pressed = False + self._z_min_endstop_pressed = False + + self._x_max_endstop_pressed = False + self._y_max_endstop_pressed = False + self._z_max_endstop_pressed = False + # In order to keep the connection alive we request the temperature every so often from a different extruder. # This index is the extruder we requested data from the last time. self._temperature_requested_extruder_index = 0 - + self._updating_firmware = False - + self._firmware_file_name = None - + + self._control_view = None + + onError = pyqtSignal() + progressChanged = pyqtSignal() + extruderTemperatureChanged = pyqtSignal() + bedTemperatureChanged = pyqtSignal() + + endstopStateChanged = pyqtSignal(str ,bool, arguments = ["key","state"]) + + @pyqtProperty(float, notify = progressChanged) + def progress(self): + return self._progress + + @pyqtProperty(float, notify = extruderTemperatureChanged) + def extruderTemperature(self): + return self._extruder_temperatures[0] + + @pyqtProperty(float, notify = bedTemperatureChanged) + def bedTemperature(self): + return self._bed_temperature + + @pyqtProperty(str, notify = onError) + def error(self): + return self._error_state + # TODO: Might need to add check that extruders can not be changed when it started printing or loading these settings from settings object def setNumExtuders(self, num): self._extruder_count = num self._extruder_temperatures = [0] * self._extruder_count self._target_extruder_temperatures = [0] * self._extruder_count - + ## Is the printer actively printing def isPrinting(self): if not self._is_connected or self._serial is None: return False return self._is_printing + @pyqtSlot() + def startPrint(self): + gcode_list = getattr( Application.getInstance().getController().getScene(), "gcode_list") + self.printGCode(gcode_list) + ## Start a print based on a g-code. # \param gcode_list List with gcode (strings). def printGCode(self, gcode_list): @@ -115,20 +175,20 @@ class PrinterConnection(SignalEmitter): self._print_start_time_100 = None self._is_printing = True self._print_start_time = time.time() - + for i in range(0, 4): #Push first 4 entries before accepting other inputs self._sendNextGcodeLine() - + ## Get the serial port string of this connection. # \return serial port def getSerialPort(self): return self._serial_port - + ## Try to connect the serial. This simply starts the thread, which runs _connect. def connect(self): if not self._updating_firmware and not self._connect_thread.isAlive(): self._connect_thread.start() - + ## Private fuction (threaded) that actually uploads the firmware. def _updateFirmware(self): if self._is_connecting or self._is_connected: @@ -162,6 +222,8 @@ class PrinterConnection(SignalEmitter): self.setProgress(100, 100) + self.firmwareUpdateComplete.emit() + ## Upload new firmware to machine # \param filename full path of firmware file to be uploaded def updateFirmware(self, file_name): @@ -169,14 +231,28 @@ class PrinterConnection(SignalEmitter): self._firmware_file_name = file_name self._update_firmware_thread.start() + @pyqtSlot() + def startPollEndstop(self): + self._poll_endstop = True + self._end_stop_thread.start() + + @pyqtSlot() + def stopPollEndstop(self): + self._poll_endstop = False + + def _pollEndStop(self): + while self._is_connected and self._poll_endstop: + self.sendCommand("M119") + time.sleep(0.5) + ## Private connect function run by thread. Can be started by calling connect. def _connect(self): Logger.log("d", "Attempting to connect to %s", self._serial_port) self._is_connecting = True - programmer = stk500v2.Stk500v2() + programmer = stk500v2.Stk500v2() try: programmer.connect(self._serial_port) # Connect with the serial, if this succeeds, it"s an arduino based usb device. - self._serial = programmer.leaveISP() + self._serial = programmer.leaveISP() except ispBase.IspError as e: Logger.log("i", "Could not establish connection on %s: %s. Device is not arduino based." %(self._serial_port,str(e))) except Exception as e: @@ -186,25 +262,23 @@ class PrinterConnection(SignalEmitter): self._is_connecting = False Logger.log("i", "Could not establish connection on %s, unknown reasons.", self._serial_port) return - + # If the programmer connected, we know its an atmega based version. Not all that usefull, but it does give some debugging information. for baud_rate in self._getBaudrateList(): # Cycle all baud rates (auto detect) - if self._serial is None: try: - self._serial = serial.Serial(str(self._serial_port), baud_rate, timeout=3, writeTimeout=10000) + self._serial = serial.Serial(str(self._serial_port), baud_rate, timeout = 3, writeTimeout = 10000) except serial.SerialException: Logger.log("i", "Could not open port %s" % self._serial_port) return - else: + else: if not self.setBaudRate(baud_rate): continue # Could not set the baud rate, go to the next time.sleep(1.5) # Ensure that we are not talking to the bootloader. 1.5 sec seems to be the magic number sucesfull_responses = 0 - timeout_time = time.time() + 15 + timeout_time = time.time() + 5 self._serial.write(b"\n") self._sendCommand("M105") # Request temperature, as this should (if baudrate is correct) result in a command with "T:" in it - while timeout_time > time.time(): line = self._readline() if line is None: @@ -213,7 +287,6 @@ class PrinterConnection(SignalEmitter): if b"T:" in line: self._serial.timeout = 0.5 - self._sendCommand("M105") sucesfull_responses += 1 if sucesfull_responses >= self._required_responses_auto_baud: self._serial.timeout = 2 #Reset serial timeout @@ -221,6 +294,8 @@ class PrinterConnection(SignalEmitter): Logger.log("i", "Established printer connection on port %s" % self._serial_port) return + self._sendCommand("M105") # Send M105 as long as we are listening, otherwise we end up in an undefined state + Logger.log("e", "Baud rate detection for %s failed", self._serial_port) self.close() # Unable to connect, wrap up. self.setIsConnected(False) @@ -240,21 +315,12 @@ class PrinterConnection(SignalEmitter): self.connectionStateChanged.emit(self._serial_port) if self._is_connected: self._listen_thread.start() #Start listening - #Application.getInstance().addOutputDevice(self._serial_port, { - #"id": self._serial_port, - #"function": self.printGCode, - #"shortDescription": "Print with USB", - #"description": "Print with USB {0}".format(self._serial_port), - #"icon": "save", - #"priority": 1 - #}) - else: Logger.log("w", "Printer connection state was not changed") - - connectionStateChanged = Signal() - - ## Close the printer connection + + connectionStateChanged = Signal() + + ## Close the printer connection def close(self): if self._connect_thread.isAlive(): try: @@ -262,6 +328,9 @@ class PrinterConnection(SignalEmitter): except Exception as e: pass # This should work, but it does fail sometimes for some reason + self._connect_thread = threading.Thread(target=self._connect) + self._connect_thread.daemon = True + if self._serial is not None: self.setIsConnected(False) try: @@ -269,12 +338,31 @@ class PrinterConnection(SignalEmitter): except: pass self._serial.close() - + + self._listen_thread = threading.Thread(target=self._listen) + self._listen_thread.daemon = True self._serial = None - + def isConnected(self): return self._is_connected - + + @pyqtSlot(int) + def heatupNozzle(self, temperature): + self._sendCommand("M104 S%s" % temperature) + + @pyqtSlot(int) + def heatupBed(self, temperature): + self._sendCommand("M140 S%s" % temperature) + + @pyqtSlot("long", "long","long") + def moveHead(self, x, y, z): + print("Moving head" , x , " ", y , " " , z) + self._sendCommand("G0 X%s Y%s Z%s"%(x,y,z)) + + @pyqtSlot() + def homeHead(self): + self._sendCommand("G28") + ## Directly send the command, withouth checking connection state (eg; printing). # \param cmd string with g-code def _sendCommand(self, cmd): @@ -296,10 +384,9 @@ class PrinterConnection(SignalEmitter): self._target_bed_temperature = float(re.search("S([0-9]+)", cmd).group(1)) except: pass - #Logger.log("i","Sending: %s" % (cmd)) try: command = (cmd + "\n").encode() - #self._serial.write(b"\n") + self._serial.write(b"\n") self._serial.write(command) except serial.SerialTimeoutException: Logger.log("w","Serial timeout while writing to serial port, trying again.") @@ -314,11 +401,26 @@ class PrinterConnection(SignalEmitter): Logger.log("e","Unexpected error while writing serial port %s" % e) self._setErrorState("Unexpected error while writing serial port %s " % e) self.close() - + ## Ensure that close gets called when object is destroyed def __del__(self): self.close() - + + def createControlInterface(self): + if self._control_view is None: + path = QUrl.fromLocalFile(os.path.join(PluginRegistry.getInstance().getPluginPath("USBPrinting"), "ControlWindow.qml")) + component = QQmlComponent(Application.getInstance()._engine, path) + self._control_context = QQmlContext(Application.getInstance()._engine.rootContext()) + self._control_context.setContextProperty("manager", self) + self._control_view = component.create(self._control_context) + + ## Show control interface. + # This will create the view if its not already created. + def showControlInterface(self): + if self._control_view is None: + self.createControlInterface() + self._control_view.show() + ## Send a command to printer. # \param cmd string with g-code def sendCommand(self, cmd): @@ -326,37 +428,47 @@ class PrinterConnection(SignalEmitter): self._command_queue.put(cmd) elif self.isConnected(): self._sendCommand(cmd) - + ## Set the error state with a message. # \param error String with the error message. def _setErrorState(self, error): self._error_state = error - self.onError.emit(error) - - onError = Signal() - + self.onError.emit() + ## Private function to set the temperature of an extruder # \param index index of the extruder # \param temperature recieved temperature def _setExtruderTemperature(self, index, temperature): try: self._extruder_temperatures[index] = temperature - self.onExtruderTemperatureChange.emit(self._serial_port, index, temperature) + self.extruderTemperatureChanged.emit() except Exception as e: pass - - onExtruderTemperatureChange = Signal() - + ## Private function to set the temperature of the bed. # As all printers (as of time of writing) only support a single heated bed, # these are not indexed as with extruders. def _setBedTemperature(self, temperature): self._bed_temperature = temperature - self.onBedTemperatureChange.emit(self._serial_port,temperature) - - onBedTemperatureChange = Signal() - - + self.bedTemperatureChanged.emit() + + def requestWrite(self, node): + self.showControlInterface() + + def _setEndstopState(self, endstop_key, value): + if endstop_key == b'x_min': + if self._x_min_endstop_pressed != value: + self.endstopStateChanged.emit('x_min', value) + self._x_min_endstop_pressed = value + elif endstop_key == b'y_min': + if self._y_min_endstop_pressed != value: + self.endstopStateChanged.emit('y_min', value) + self._y_min_endstop_pressed = value + elif endstop_key == b'z_min': + if self._z_min_endstop_pressed != value: + self.endstopStateChanged.emit('z_min', value) + self._z_min_endstop_pressed = value + ## Listen thread function. def _listen(self): Logger.log("i", "Printer connection listen thread started for %s" % self._serial_port) @@ -364,10 +476,18 @@ class PrinterConnection(SignalEmitter): ok_timeout = time.time() while self._is_connected: line = self._readline() - + if line is None: break # None is only returned when something went wrong. Stop listening - + + if time.time() > temperature_request_timeout: + if self._extruder_count > 0: + self._temperature_requested_extruder_index = (self._temperature_requested_extruder_index + 1) % self._extruder_count + self.sendCommand("M105 T%d" % (self._temperature_requested_extruder_index)) + else: + self.sendCommand("M105") + temperature_request_timeout = time.time() + 5 + if line.startswith(b"Error:"): # Oh YEAH, consistency. # Marlin reports an MIN/MAX temp error as "Error:x\n: Extruder switched off. MAXTEMP triggered !\n" @@ -392,19 +512,14 @@ class PrinterConnection(SignalEmitter): except Exception as e: pass #TODO: temperature changed callback + elif b"_min" in line or b"_max" in line: + tag, value = line.split(b':', 1) + self._setEndstopState(tag,(b'H' in value or b'TRIGGERED' in value)) if self._is_printing: - if time.time() > temperature_request_timeout: # When printing, request temperature every 5 seconds. - if self._extruder_count > 0: - self._temperature_requested_extruder_index = (self._temperature_requested_extruder_index + 1) % self._extruder_count - self.sendCommand("M105 T%d" % (self._temperature_requested_extruder_index)) - else: - self.sendCommand("M105") - temperature_request_timeout = time.time() + 5 - if line == b"" and time.time() > ok_timeout: line = b"ok" # Force a timeout (basicly, send next command) - + if b"ok" in line: ok_timeout = time.time() + 5 if not self._command_queue.empty(): @@ -449,26 +564,25 @@ class PrinterConnection(SignalEmitter): Logger.log("e", "Unexpected error with printer connection: %s" % e) self._setErrorState("Unexpected error: %s" %e) checksum = functools.reduce(lambda x,y: x^y, map(ord, "N%d%s" % (self._gcode_position, line))) - + self._sendCommand("N%d%s*%d" % (self._gcode_position, line, checksum)) self._gcode_position += 1 self.setProgress(( self._gcode_position / len(self._gcode)) * 100) - self.progressChanged.emit(self._progress, self._serial_port) - - progressChanged = Signal() - + self.progressChanged.emit() + ## Set the progress of the print. # It will be normalized (based on max_progress) to range 0 - 100 def setProgress(self, progress, max_progress = 100): self._progress = (progress / max_progress) * 100 #Convert to scale of 0-100 - self.progressChanged.emit(self._progress, self._serial_port) - + self.progressChanged.emit() + ## Cancel the current print. Printer connection wil continue to listen. + @pyqtSlot() def cancelPrint(self): self._gcode_position = 0 self.setProgress(0) self._gcode = [] - + # Turn of temperatures self._sendCommand("M140 S0") self._sendCommand("M104 S0") @@ -477,7 +591,7 @@ class PrinterConnection(SignalEmitter): ## Check if the process did not encounter an error yet. def hasError(self): return self._error_state != None - + ## private read line used by printer connection to listen for data on serial port. def _readline(self): if self._serial is None: @@ -490,9 +604,16 @@ class PrinterConnection(SignalEmitter): self.close() return None return ret - + ## Create a list of baud rates at which we can communicate. # \return list of int def _getBaudrateList(self): ret = [250000, 230400, 115200, 57600, 38400, 19200, 9600] return ret + + def _onFirmwareUpdateComplete(self): + self._update_firmware_thread.join() + self._update_firmware_thread = threading.Thread(target= self._updateFirmware) + self._update_firmware_thread.deamon = True + + self.connect() diff --git a/plugins/USBPrinting/USBPrinterManager.py b/plugins/USBPrinting/USBPrinterManager.py index 066ae585da..bae5099610 100644 --- a/plugins/USBPrinting/USBPrinterManager.py +++ b/plugins/USBPrinting/USBPrinterManager.py @@ -9,6 +9,8 @@ from UM.Scene.SceneNode import SceneNode from UM.Resources import Resources from UM.Logger import Logger from UM.PluginRegistry import PluginRegistry +from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin +from UM.Qt.ListModel import ListModel import threading import platform @@ -26,34 +28,48 @@ from PyQt5.QtCore import QUrl, QObject, pyqtSlot, pyqtProperty, pyqtSignal, Qt from UM.i18n import i18nCatalog i18n_catalog = i18nCatalog("cura") -class USBPrinterManager(QObject, SignalEmitter, Extension): +class USBPrinterManager(QObject, SignalEmitter, OutputDevicePlugin, Extension): def __init__(self, parent = None): - super().__init__(parent) + QObject.__init__(self, parent) + SignalEmitter.__init__(self) + OutputDevicePlugin.__init__(self) + Extension.__init__(self) self._serial_port_list = [] - self._printer_connections = [] - self._check_ports_thread = threading.Thread(target = self._updateConnectionList) - self._check_ports_thread.daemon = True - self._check_ports_thread.start() - - self._progress = 0 + self._printer_connections = {} + self._printer_connections_model = None + self._update_thread = threading.Thread(target = self._updateThread) + self._update_thread.setDaemon(True) - self._control_view = None + self._check_updates = True self._firmware_view = None - self._extruder_temp = 0 - self._bed_temp = 0 - self._error_message = "" - + ## Add menu item to top menu of the application. self.setMenuName("Firmware") self.addMenuItem(i18n_catalog.i18n("Update Firmware"), self.updateAllFirmware) - Application.getInstance().applicationShuttingDown.connect(self._onApplicationShuttingDown) - - pyqtError = pyqtSignal(str, arguments = ["error"]) - processingProgress = pyqtSignal(float, arguments = ["amount"]) - pyqtExtruderTemperature = pyqtSignal(float, arguments = ["amount"]) - pyqtBedTemperature = pyqtSignal(float, arguments = ["amount"]) - + Application.getInstance().applicationShuttingDown.connect(self.stop) + self.addConnectionSignal.connect(self.addConnection) #Because the model needs to be created in the same thread as the QMLEngine, we use a signal. + + addConnectionSignal = Signal() + printerConnectionStateChanged = pyqtSignal() + + def start(self): + self._check_updates = True + self._update_thread.start() + + def stop(self): + self._check_updates = False + try: + self._update_thread.join() + except RuntimeError: + pass + + def _updateThread(self): + while self._check_updates: + result = self.getSerialPortList(only_list_usb = True) + self._addRemovePorts(result) + time.sleep(5) + ## Show firmware interface. # This will create the view if its not already created. def spawnFirmwareInterface(self, serial_port): @@ -66,79 +82,37 @@ class USBPrinterManager(QObject, SignalEmitter, Extension): self._firmware_view = component.create(self._firmware_context) self._firmware_view.show() - - ## Show control interface. - # This will create the view if its not already created. - def spawnControlInterface(self,serial_port): - if self._control_view is None: - path = QUrl.fromLocalFile(os.path.join(PluginRegistry.getInstance().getPluginPath("USBPrinting"), "ControlWindow.qml")) - component = QQmlComponent(Application.getInstance()._engine, path) - self._control_context = QQmlContext(Application.getInstance()._engine.rootContext()) - self._control_context.setContextProperty("manager", self) - - self._control_view = component.create(self._control_context) - - self._control_view.show() - - @pyqtProperty(float,notify = processingProgress) - def progress(self): - return self._progress - - @pyqtProperty(float,notify = pyqtExtruderTemperature) - def extruderTemperature(self): - return self._extruder_temp - - @pyqtProperty(float,notify = pyqtBedTemperature) - def bedTemperature(self): - return self._bed_temp - - @pyqtProperty(str,notify = pyqtError) - def error(self): - return self._error_message - - ## Check all serial ports and create a PrinterConnection object for them. - # Note that this does not validate if the serial ports are actually usable! - # This (the validation) is only done when the connect function is called. - def _updateConnectionList(self): - while True: - temp_serial_port_list = self.getSerialPortList(only_list_usb = True) - if temp_serial_port_list != self._serial_port_list: # Something changed about the list since we last changed something. - disconnected_ports = [port for port in self._serial_port_list if port not in temp_serial_port_list ] - self._serial_port_list = temp_serial_port_list - for serial_port in self._serial_port_list: - if self.getConnectionByPort(serial_port) is None: # If it doesn't already exist, add it - if not os.path.islink(serial_port): # Only add the connection if it's a non symbolic link - connection = PrinterConnection.PrinterConnection(serial_port) - connection.connect() - connection.connectionStateChanged.connect(self.serialConectionStateCallback) - connection.progressChanged.connect(self.onProgress) - connection.onExtruderTemperatureChange.connect(self.onExtruderTemperature) - connection.onBedTemperatureChange.connect(self.onBedTemperature) - connection.onError.connect(self.onError) - self._printer_connections.append(connection) - - for serial_port in disconnected_ports: # Close connections and remove them from list. - connection = self.getConnectionByPort(serial_port) - if connection != None: - self._printer_connections.remove(connection) - connection.close() - time.sleep(5) # Throttle, as we don"t need this information to be updated every single second. - def updateAllFirmware(self): self.spawnFirmwareInterface("") for printer_connection in self._printer_connections: try: - printer_connection.updateFirmware(Resources.getPath(Resources.FirmwareLocation, self._getDefaultFirmwareName())) + self._printer_connections[printer_connection].updateFirmware(Resources.getPath(Resources.FirmwareLocation, self._getDefaultFirmwareName())) except FileNotFoundError: continue - + + @pyqtSlot(str, result = bool) def updateFirmwareBySerial(self, serial_port): - printer_connection = self.getConnectionByPort(serial_port) - if printer_connection is not None: - self.spawnFirmwareInterface(printer_connection.getSerialPort()) - printer_connection.updateFirmware(Resources.getPath(Resources.FirmwareLocation, self._getDefaultFirmwareName())) - + if serial_port in self._printer_connections: + self.spawnFirmwareInterface(self._printer_connections[serial_port].getSerialPort()) + try: + self._printer_connections[serial_port].updateFirmware(Resources.getPath(Resources.FirmwareLocation, self._getDefaultFirmwareName())) + except FileNotFoundError: + self._firmware_view.close() + Logger.log("e", "Could not find firmware required for this machine") + return False + return True + return False + + ## Return the singleton instance of the USBPrinterManager + @classmethod + def getInstance(cls, engine = None, script_engine = None): + # Note: Explicit use of class name to prevent issues with inheritance. + if USBPrinterManager._instance is None: + USBPrinterManager._instance = cls() + + return USBPrinterManager._instance + def _getDefaultFirmwareName(self): machine_type = Application.getInstance().getActiveMachine().getTypeID() firmware_name = "" @@ -160,120 +134,46 @@ class USBPrinterManager(QObject, SignalEmitter, Extension): return "MarlinUltimaker2.hex" ##TODO: Add check for multiple extruders - + if firmware_name != "": firmware_name += ".hex" return firmware_name - ## Callback for extruder temperature change - def onExtruderTemperature(self, serial_port, index, temperature): - self._extruder_temp = temperature - self.pyqtExtruderTemperature.emit(temperature) - - ## Callback for bed temperature change - def onBedTemperature(self, serial_port,temperature): - self._bed_temp = temperature - self.pyqtBedTemperature.emit(temperature) - - ## Callback for error - def onError(self, error): - self._error_message = error if type(error) is str else error.decode("utf-8") - self.pyqtError.emit(self._error_message) - - ## Callback for progress change - def onProgress(self, progress, serial_port): - self._progress = progress - self.processingProgress.emit(progress) + def _addRemovePorts(self, serial_ports): + # First, find and add all new or changed keys + for serial_port in list(serial_ports): + if serial_port not in self._serial_port_list: + self.addConnectionSignal.emit(serial_port) #Hack to ensure its created in main thread + continue + self._serial_port_list = list(serial_ports) - ## Attempt to connect with all possible connections. - def connectAllConnections(self): + ## Because the model needs to be created in the same thread as the QMLEngine, we use a signal. + def addConnection(self, serial_port): + connection = PrinterConnection.PrinterConnection(serial_port) + connection.connect() + connection.connectionStateChanged.connect(self._onPrinterConnectionStateChanged) + self._printer_connections[serial_port] = connection + + def _onPrinterConnectionStateChanged(self, serial_port): + if self._printer_connections[serial_port].isConnected(): + self.getOutputDeviceManager().addOutputDevice(self._printer_connections[serial_port]) + else: + self.getOutputDeviceManager().removeOutputDevice(serial_port) + self.printerConnectionStateChanged.emit() + + @pyqtProperty(QObject , notify = printerConnectionStateChanged) + def connectedPrinterList(self): + self._printer_connections_model = ListModel() + self._printer_connections_model.addRoleName(Qt.UserRole + 1,"name") + self._printer_connections_model.addRoleName(Qt.UserRole + 2, "printer") for connection in self._printer_connections: - connection.connect() - - ## Send gcode to printer and start printing - def sendGCodeByPort(self, serial_port, gcode_list): - printer_connection = self.getConnectionByPort(serial_port) - if printer_connection is not None: - printer_connection.printGCode(gcode_list) - return True - return False - - @pyqtSlot() - def cancelPrint(self): - for printer_connection in self.getActiveConnections(): - printer_connection.cancelPrint() - - ## Send gcode to all active printers. - # \return True if there was at least one active connection. - def sendGCodeToAllActive(self, gcode_list): - for printer_connection in self.getActiveConnections(): - printer_connection.printGCode(gcode_list) - if len(self.getActiveConnections()): - return True - else: - return False - - ## Send a command to a printer indentified by port - # \param serial port String indentifieing the port - # \param command String with the g-code command to send. - # \return True if connection was found, false otherwise - def sendCommandByPort(self, serial_port, command): - printer_connection = self.getConnectionByPort(serial_port) - if printer_connection is not None: - printer_connection.sendCommand(command) - return True - return False - - ## Send a command to all active (eg; connected) printers - # \param command String with the g-code command to send. - # \return True if at least one connection was found, false otherwise - def sendCommandToAllActive(self, command): - for printer_connection in self.getActiveConnections(): - printer_connection.sendCommand(command) - if len(self.getActiveConnections()): - return True - else: - return False - - ## Callback if the connection state of a connection is changed. - # This adds or removes the connection as a possible output device. - def serialConectionStateCallback(self, serial_port): - connection = self.getConnectionByPort(serial_port) - if connection.isConnected(): - Application.getInstance().addOutputDevice(serial_port, { - "id": serial_port, - "function": self.spawnControlInterface, - "description": "Print with USB {0}".format(serial_port), - "shortDescription": "Print with USB", - "icon": "save", - "priority": 1 - }) - else: - Application.getInstance().removeOutputDevice(serial_port) - - @pyqtSlot() - def startPrint(self): - gcode_list = getattr(Application.getInstance().getController().getScene(), "gcode_list", None) - if gcode_list: - final_list = [] - for gcode in gcode_list: - final_list += gcode.split("\n") - self.sendGCodeToAllActive(gcode_list) - - ## Get a list of printer connection objects that are connected. - def getActiveConnections(self): - return [connection for connection in self._printer_connections if connection.isConnected()] - - ## Get a printer connection object by serial port - def getConnectionByPort(self, serial_port): - for printer_connection in self._printer_connections: - if serial_port == printer_connection.getSerialPort(): - return printer_connection - return None + if self._printer_connections[connection].isConnected(): + self._printer_connections_model.appendItem({"name":connection, "printer": self._printer_connections[connection]}) + return self._printer_connections_model ## Create a list of serial ports on the system. # \param only_list_usb If true, only usb ports are listed - def getSerialPortList(self,only_list_usb=False): + def getSerialPortList(self, only_list_usb = False): base_list = [] if platform.system() == "Windows": import winreg @@ -293,8 +193,6 @@ class USBPrinterManager(QObject, SignalEmitter, Extension): base_list = filter(lambda s: "Bluetooth" not in s, base_list) # Filter because mac sometimes puts them in the list else: base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.*") + glob.glob("/dev/tty.usb*") + glob.glob("/dev/rfcomm*") + glob.glob("/dev/serial/by-id/*") - return base_list + return list(base_list) - def _onApplicationShuttingDown(self): - for connection in self._printer_connections: - connection.close() + _instance = None \ No newline at end of file diff --git a/plugins/USBPrinting/__init__.py b/plugins/USBPrinting/__init__.py index 1afa25c8a2..7ee8290e12 100644 --- a/plugins/USBPrinting/__init__.py +++ b/plugins/USBPrinting/__init__.py @@ -2,7 +2,7 @@ # Cura is released under the terms of the AGPLv3 or higher. from . import USBPrinterManager - +from PyQt5.QtQml import qmlRegisterType, qmlRegisterSingletonType from UM.i18n import i18nCatalog i18n_catalog = i18nCatalog("cura") @@ -13,9 +13,11 @@ def getMetaData(): "name": "USB printing", "author": "Ultimaker", "version": "1.0", + "api": 2, "description": i18n_catalog.i18nc("USB Printing plugin description","Accepts G-Code and sends them to a printer. Plugin can also update firmware") } } - + def register(app): - return {"extension":USBPrinterManager.USBPrinterManager()} + qmlRegisterSingletonType(USBPrinterManager.USBPrinterManager, "UM", 1, 0, "USBPrinterManager", USBPrinterManager.USBPrinterManager.getInstance) + return {"extension":USBPrinterManager.USBPrinterManager.getInstance(),"output_device": USBPrinterManager.USBPrinterManager.getInstance() } diff --git a/resources/images/MakerStarterbackplate.png b/resources/images/MakerStarterbackplate.png new file mode 100644 index 0000000000..5dcbb8502b Binary files /dev/null and b/resources/images/MakerStarterbackplate.png differ diff --git a/resources/machines/fdmprinter.json b/resources/machines/fdmprinter.json index a9c8be3e5d..01bb97a5ac 100644 --- a/resources/machines/fdmprinter.json +++ b/resources/machines/fdmprinter.json @@ -6,7 +6,7 @@ "author": "Ultimaker B.V.", "manufacturer": "Ultimaker", - "add_pages": [{"page": "AddMachine", "title": "Add new printer"}], + "add_pages": [], "machine_settings": { "machine_start_gcode": { @@ -30,78 +30,14 @@ "machine_center_is_zero": { "default": false }, - "machine_head_shape_min_x": { - "default": 40 - }, - "machine_head_shape_min_y": { - "default": 10 - }, - "machine_head_shape_max_x": { - "default": 60 - }, - "machine_head_shape_max_y": { - "default": 30 - }, - "machine_nozzle_gantry_distance": { - "default": 55 - }, "machine_extruder_count": { "default": 1 }, - "machine_extruder_trains": { - "default": [ - { - "extruder_nr": { - "label": "Extruder", - "description": "The extruder train used for printing. This is used in multi-extrusion.", - "type": "int", - "default": 0, - "min_value": 0, - "max_value": 16, - "inherit_function": "extruder_nr" - }, - "machine_nozzle_offset_x": { - "default": 0 - }, - "machine_nozzle_offset_y": { - "default": 0 - }, - "machine_nozzle_size": { - "default": 0.4 - }, - "machine_nozzle_tip_outer_diameter": { - "default": 1 - }, - "machine_nozzle_head_distance": { - "default": 3 - }, - "machine_nozzle_expansion_angle": { - "default": 45 - }, - "machine_extruder_start_code": { - "default": "" - }, - "machine_extruder_end_code": { - "default": "" - }, - "machine_switch_extruder_retraction_amount": { - "default": 16 - }, - "machine_switch_extruder_retraction_speed": { - "default": 20 - }, - "machine_switch_extruder_prime_speed": { - "default": 20 - } - } - ] - }, - "machine_nozzle_offset_x_1": { - "default": 0 - }, - "machine_nozzle_offset_y_1": { - "default": 0 - }, + "machine_nozzle_size": { "default": 0.4, "SEE_machine_extruder_trains": true }, + "machine_nozzle_tip_outer_diameter": { "default": 1, "SEE_machine_extruder_trains": true }, + "machine_nozzle_head_distance": { "default": 3, "SEE_machine_extruder_trains": true }, + "machine_nozzle_expansion_angle": { "default": 45, "SEE_machine_extruder_trains": true }, + "machine_heat_zone_length": { "default": 16, "SEE_machine_extruder_trains": true }, "machine_gcode_flavor": { "default": "RepRap" }, @@ -118,20 +54,20 @@ "machine_head_polygon": { "default": [ [ - -10, - 10 + -1, + 1 ], [ - 10, - 10 + -1, + -1 ], [ - 10, - -10 + 1, + -1 ], [ - -10, - -10 + 1, + 1 ] ] }, @@ -162,8 +98,8 @@ } }, "categories": { - "layer_height": { - "label": "Line dimensions", + "resolution": { + "label": "Quality", "visible": true, "icon": "category_layer_height", "settings": { @@ -295,103 +231,11 @@ "setting": "support_roof_enable", "value": true } - }, - "prime_tower_line_width": { - "label": "Prime Tower Line Width", - "description": "Width of a single prime tower line.", - "unit": "mm", - "min_value": 0.0001, - "min_value_warning": 0.2, - "max_value_warning": 5, - "default": 0.4, - "type": "float", - "visible": false, - "active_if": { - "setting": "prime_tower_enable", - "value": true - } } } } } }, - "dual": { - "label": "Dual Extrusion", - "visible": false, - "icon": "category_dual", - "settings": { - "prime_tower_enable": { - "label": "Enable Prime Tower", - "description": "Print a tower next to the print which serves to prime the material after each nozzle switch.", - "type": "boolean", - "default": false - }, - "prime_tower_size": { - "label": "Prime Tower Size", - "description": "The width of the prime tower.", - "visible": false, - "type": "float", - "unit": "mm", - "default": 15, - "min_value": 0, - "max_value_warning": 20, - "inherit_function": "0 if prime_tower_enable else 15", - "active_if": { - "setting": "prime_tower_enable", - "value": true - } - }, - "prime_tower_position_x": { - "label": "Prime Tower X Position", - "description": "The x position of the prime tower.", - "visible": false, - "type": "float", - "unit": "mm", - "default": 200, - "active_if": { - "setting": "prime_tower_enable", - "value": true - } - }, - "prime_tower_position_y": { - "label": "Prime Tower Y Position", - "description": "The y position of the prime tower.", - "visible": false, - "type": "float", - "unit": "mm", - "default": 200, - "active_if": { - "setting": "prime_tower_enable", - "value": true - } - }, - "prime_tower_flow": { - "label": "Prime Tower Flow", - "description": "Flow compensation: the amount of material extruded is multiplied by this value.", - "visible": false, - "unit": "%", - "default": 100, - "type": "float", - "min_value": 5, - "min_value_warning": 50, - "max_value_warning": 150, - "active_if": { - "setting": "prime_tower_enable", - "value": true - } - }, - "prime_tower_wipe_enabled": { - "label": "Wipe Nozzle on Prime tower", - "description": "After printing the prime tower with the one nozzle, wipe the oozed material from the other nozzle off on the prime tower.", - "type": "boolean", - "default": false, - "active_if": { - "setting": "prime_tower_enable", - "value": true - } - } - } - }, "shell": { "label": "Shell", "visible": true, @@ -443,7 +287,7 @@ "default": 0.8, "min_value": 0, "max_value": 5, - "min_value_warning": 0.4, + "min_value_warning": 0.6, "max_value_warning": 1, "type": "float", "visible": false, @@ -461,7 +305,7 @@ "label": "Top Layers", "description": "This controls the amount of top layers.", "min_value": 0, - "default": 8, + "default": 6, "type": "int", "visible": false, "inherit_function": "math.ceil(parent_value / layer_height)" @@ -473,7 +317,7 @@ "description": "This controls the thickness of the bottom layers. The number of solid layers printed is calculated from the layer thickness and this value. Having this value be a multiple of the layer thickness makes sense. And keep it near to your wall thickness to make an evenly strong part.", "unit": "mm", "min_value": 0, - "default": 0.8, + "default": 0.6, "type": "float", "visible": false, "children": { @@ -481,7 +325,7 @@ "label": "Bottom Layers", "description": "This controls the amount of bottom layers.", "min_value": 0, - "default": 8, + "default": 6, "type": "int", "visible": false, "inherit_function": "math.ceil(parent_value / layer_height)" @@ -584,14 +428,14 @@ "visible": true, "icon": "category_infill", "settings": { - "fill_sparse_density": { + "infill_sparse_density": { "label": "Infill Density", "description": "This controls how densely filled the insides of your print will be. For a solid part use 100%, for an hollow part use 0%. A value around 20% is usually enough. This won't affect the outside of the print and only adjusts how strong the part becomes.", "unit": "%", "type": "float", "default": 20, "children": { - "fill_pattern": { + "infill_pattern": { "label": "Infill Pattern", "description": "Cura defaults to switching between grid and line infill. But with this setting visible you can control this yourself. The line infill swaps direction on alternate layers of infill, while the grid prints the full cross-hatching on each layer of infill.", "type": "enum", @@ -616,12 +460,13 @@ } } }, - "fill_overlap": { + "infill_overlap": { "label": "Infill Overlap", "description": "The amount of overlap between the infill and the walls. A slight overlap allows the walls to connect firmly to the infill.", "unit": "%", "type": "float", "default": 10, + "inherit_function": "10 if infill_sparse_density < 95 else 0", "visible": false }, "infill_wipe_dist": { @@ -632,7 +477,7 @@ "default": 0.04, "visible": false }, - "fill_sparse_thickness": { + "infill_sparse_thickness": { "label": "Infill Thickness", "description": "The thickness of the sparse infill. This is rounded to a multiple of the layerheight and used to print the sparse-infill in fewer, thicker layers to save printing time.", "unit": "mm", @@ -640,7 +485,7 @@ "default": 0.1, "visible": false, "children": { - "fill_sparse_combine": { + "infill_sparse_combine": { "label": "Infill Layers", "description": "Amount of layers that are combined together to form sparse infill.", "type": "int", @@ -693,6 +538,128 @@ "min_value": 5, "min_value_warning": 50, "max_value_warning": 150 + }, + "retraction_enable": { + "label": "Enable Retraction", + "description": "Retract the filament when the nozzle is moving over a non-printed area. Details about the retraction can be configured in the advanced tab.", + "type": "boolean", + "default": true + }, + "retraction_amount": { + "label": "Retraction Distance", + "description": "The amount of retraction: Set at 0 for no retraction at all. A value of 4.5mm seems to generate good results for 3mm filament in Bowden-tube fed printers.", + "unit": "mm", + "type": "float", + "default": 4.5, + "visible": false, + "inherit": false, + "active_if": { + "setting": "retraction_enable", + "value": true + } + }, + "retraction_speed": { + "label": "Retraction Speed", + "description": "The speed at which the filament is retracted. A higher retraction speed works better, but a very high retraction speed can lead to filament grinding.", + "unit": "mm/s", + "type": "float", + "default": 25, + "visible": false, + "inherit": false, + "active_if": { + "setting": "retraction_enable", + "value": true + }, + "children": { + "retraction_retract_speed": { + "label": "Retraction Retract Speed", + "description": "The speed at which the filament is retracted. A higher retraction speed works better, but a very high retraction speed can lead to filament grinding.", + "unit": "mm/s", + "type": "float", + "default": 25, + "visible": false, + "active_if": { + "setting": "retraction_enable", + "value": true + } + }, + "retraction_prime_speed": { + "label": "Retraction Prime Speed", + "description": "The speed at which the filament is pushed back after retraction.", + "unit": "mm/s", + "type": "float", + "default": 25, + "visible": false, + "active_if": { + "setting": "retraction_enable", + "value": true + } + } + } + }, + "retraction_extra_prime_amount": { + "label": "Retraction Extra Prime Amount", + "description": "The amount of material extruded after unretracting. During a retracted travel material might get lost and so we need to compensate for this.", + "unit": "mm", + "type": "float", + "default": 0, + "visible": false, + "inherit": false, + "active_if": { + "setting": "retraction_enable", + "value": true + } + }, + "retraction_min_travel": { + "label": "Retraction Minimum Travel", + "description": "The minimum distance of travel needed for a retraction to happen at all. This helps ensure you do not get a lot of retractions in a small area.", + "unit": "mm", + "type": "float", + "default": 4.5, + "visible": false, + "inherit": false, + "active_if": { + "setting": "retraction_enable", + "value": true + } + }, + "retraction_count_max": { + "label": "Maximal Retraction Count", + "description": "This settings limits the number of retractions occuring within the Minimal Extrusion Distance Window. Further retractions within this window will be ignored. This avoids retracting repeatedly on the same piece of filament as that can flatten the filament and cause grinding issues.", + "default": 6, + "type": "int", + "visible": false, + "inherit": false, + "active_if": { + "setting": "retraction_enable", + "value": true + } + }, + "retraction_extrusion_window": { + "label": "Minimal Extrusion Distance Window", + "description": "The window in which the Maximal Retraction Count is enforced. This window should be approximately the size of the Retraction distance, so that effectively the number of times a retraction passes the same patch of material is limited.", + "unit": "mm", + "type": "float", + "default": 4.5, + "visible": false, + "inherit_function": "retraction_amount", + "active_if": { + "setting": "retraction_enable", + "value": true + } + }, + "retraction_hop": { + "label": "Z Hop when Retracting", + "description": "Whenever a retraction is done, the head is lifted by this amount to travel over the print. A value of 0.075 works well. This feature has a lot of positive effect on delta towers.", + "unit": "mm", + "type": "float", + "default": 0, + "visible": false, + "inherit": false, + "active_if": { + "setting": "retraction_enable", + "value": true + } } } }, @@ -804,20 +771,6 @@ } } } - }, - "speed_prime_tower": { - "label": "Prime Tower Speed", - "description": "The speed at which the prime tower is printed. Printing the prime tower slower can make it more stable when the adhesion between the different filaments is suboptimal.", - "unit": "mm/s", - "type": "float", - "min_value": 0.1, - "max_value_warning": 150, - "default": 50, - "visible": false, - "active_if": { - "setting": "prime_tower_enable", - "value": true - } } } }, @@ -865,139 +818,6 @@ "visible": true, "icon": "category_travel", "settings": { - "retraction_enable": { - "label": "Enable Retraction", - "description": "Retract the filament when the nozzle is moving over a non-printed area. Details about the retraction can be configured in the advanced tab.", - "type": "boolean", - "default": true - }, - "print_sequence": { - "label": "Print sequence", - "description": "TODO", - "type": "enum", - "options": [ - "All at once", - "One at a time" - ], - "default": "All at once", - "visible": true - }, - "retraction_speed": { - "label": "Retraction Speed", - "description": "The speed at which the filament is retracted. A higher retraction speed works better, but a very high retraction speed can lead to filament grinding.", - "unit": "mm/s", - "type": "float", - "default": 25, - "visible": false, - "inherit": false, - "active_if": { - "setting": "retraction_enable", - "value": true - }, - "children": { - "retraction_retract_speed": { - "label": "Retraction Retract Speed", - "description": "The speed at which the filament is retracted. A higher retraction speed works better, but a very high retraction speed can lead to filament grinding.", - "unit": "mm/s", - "type": "float", - "default": 25, - "visible": false, - "active_if": { - "setting": "retraction_enable", - "value": true - } - }, - "retraction_prime_speed": { - "label": "Retraction Prime Speed", - "description": "The speed at which the filament is pushed back after retraction.", - "unit": "mm/s", - "type": "float", - "default": 25, - "visible": false, - "active_if": { - "setting": "retraction_enable", - "value": true - } - } - } - }, - "retraction_amount": { - "label": "Retraction Distance", - "description": "The amount of retraction: Set at 0 for no retraction at all. A value of 4.5mm seems to generate good results for 3mm filament in Bowden-tube fed printers.", - "unit": "mm", - "type": "float", - "default": 4.5, - "visible": false, - "inherit": false, - "active_if": { - "setting": "retraction_enable", - "value": true - } - }, - "retraction_extra_prime_amount": { - "label": "Retraction Extra Prime Amount", - "description": "The amount of material extruded after unretracting. During a retracted travel material might get lost and so we need to compensate for this.", - "unit": "mm", - "type": "float", - "default": 0, - "visible": false, - "inherit": false, - "active_if": { - "setting": "retraction_enable", - "value": true - } - }, - "retraction_min_travel": { - "label": "Retraction Minimum Travel", - "description": "The minimum distance of travel needed for a retraction to happen at all. This helps ensure you do not get a lot of retractions in a small area.", - "unit": "mm", - "type": "float", - "default": 4.5, - "visible": false, - "inherit": false, - "active_if": { - "setting": "retraction_enable", - "value": true - } - }, - "retraction_count_max": { - "label": "Maximal Retraction Count", - "description": "This settings limits the number of retractions occuring within the Minimal Extrusion Distance Window. Further retractions within this window will be ignored. This avoids retracting repeatedly on the same piece of filament as that can flatten the filament and cause grinding issues.", - "default": 6, - "type": "int", - "visible": false, - "inherit": false, - "active_if": { - "setting": "retraction_enable", - "value": true - } - }, - "retraction_extrusion_window": { - "label": "Minimal Extrusion Distance Window", - "description": "The window in which the Maximal Retraction Count is enforced. This window should be approximately the size of the Retraction distance, so that effectively the number of times a retraction passes the same patch of material is limited.", - "unit": "mm", - "type": "float", - "default": 4.5, - "visible": false, - "inherit_function": "retraction_amount", - "active_if": { - "setting": "retraction_enable", - "value": true - } - }, - "retraction_hop": { - "label": "Z Hop when Retracting", - "description": "Whenever a retraction is done, the head is lifted by this amount to travel over the print. A value of 0.075 works well. This feature has a lot of positive effect on delta towers.", - "unit": "mm", - "type": "float", - "default": 0, - "visible": false, - "inherit": false, - "active_if": { - "setting": "retraction_enable", - "value": true - } - }, "retraction_combing": { "label": "Enable Combing", "description": "Combing keeps the head within the interior of the print whenever possible when traveling from one part of the print to another, and does not use retraction. If combing is disabled the printer head moves straight from the start point to the end point and it will always retract.", @@ -1035,7 +855,7 @@ "label": "Enable Coasting", "description": "Coasting replaces the last part of an extrusion path with a travel path. The oozed material is used to lay down the last piece of the extrusion path in order to reduce stringing.", "type": "boolean", - "default": true, + "default": false, "visible": true }, "coasting_volume": { @@ -1056,7 +876,7 @@ "description": "The volume otherwise oozed in a travel move with retraction.", "unit": "mm³", "type": "float", - "default": 0.096, + "default": 0.064, "visible": false, "inherit": true, "active_if": { @@ -1069,7 +889,7 @@ "description": "The volume otherwise oozed in a travel move without retraction.", "unit": "mm³", "type": "float", - "default": 0.064, + "default": 0.096, "visible": false, "inherit": true, "active_if": { @@ -1264,6 +1084,294 @@ } } }, + "support": { + "label": "Support", + "visible": true, + "icon": "category_support", + "settings": { + "support_enable": { + "label": "Enable Support", + "description": "Enable exterior support structures. This will build up supporting structures below the model to prevent the model from sagging or printing in mid air.", + "type": "boolean", + "default": true + }, + "support_type": { + "label": "Placement", + "description": "Where to place support structures. The placement can be restricted such that the support structures won't rest on the model, which could otherwise cause scarring.", + "type": "enum", + "options": [ + "Touching Buildplate", + "Everywhere" + ], + "default": "Everywhere", + "visible": true, + "inherit_function": "'Everywhere' if support_enable else 'None'", + "active_if": { + "setting": "support_enable", + "value": true + } + }, + "support_angle": { + "label": "Overhang Angle", + "description": "The maximum angle of overhangs for which support will be added. With 0 degrees being vertical, and 90 degrees being horizontal. A smaller overhang angle leads to more support.", + "unit": "°", + "type": "float", + "min_value": 0, + "max_value": 90, + "default": 60, + "visible": false, + "active_if": { + "setting": "support_enable", + "value": true + } + }, + "support_xy_distance": { + "label": "X/Y Distance", + "description": "Distance of the support structure from the print, in the X/Y directions. 0.7mm typically gives a nice distance from the print so the support does not stick to the surface.", + "unit": "mm", + "type": "float", + "min_value": 0, + "max_value_warning": 10, + "default": 0.7, + "visible": false, + "active_if": { + "setting": "support_enable", + "value": true + } + }, + "support_z_distance": { + "label": "Z Distance", + "description": "Distance from the top/bottom of the support to the print. A small gap here makes it easier to remove the support but makes the print a bit uglier. 0.15mm allows for easier separation of the support structure.", + "unit": "mm", + "type": "float", + "min_value": 0, + "max_value_warning": 10, + "default": 0.15, + "visible": false, + "active_if": { + "setting": "support_enable", + "value": true + }, + "children": { + "support_top_distance": { + "label": "Top Distance", + "description": "Distance from the top of the support to the print.", + "unit": "mm", + "min_value": 0, + "max_value_warning": 10, + "default": 0.15, + "type": "float", + "visible": false + }, + "support_bottom_distance": { + "label": "Bottom Distance", + "description": "Distance from the print to the bottom of the support.", + "unit": "mm", + "min_value": 0, + "max_value_warning": 10, + "default": 0.15, + "type": "float", + "visible": false + } + } + }, + "support_conical_enabled": { + "label": "Conical Support", + "description": "Experimental feature: Make support areas smaller at the bottom than at the overhang.", + "type": "boolean", + "default": false, + "visible": false, + "active_if": { + "setting": "support_enable", + "value": true + } + }, + "support_conical_angle": { + "label": "Cone Angle", + "description": "The angle of the tilt of conical support. With 0 degrees being vertical, and 90 degrees being horizontal. Smaller angles cause the support to be more sturdy, but consist of more material. Negative angles cause the base of the support to be wider than the top.", + "unit": "°", + "type": "float", + "min_value": -90, + "max_value": 90, + "default": 30, + "visible": false, + "active_if": { + "setting": "support_conical_enabled", + "value": true + } + }, + "support_conical_min_width": { + "label": "Minimal Width", + "description": "Minimal width to which conical support reduces the support areas. Small widths can cause the base of the support to not act well as fundament for support above.", + "unit": "mm", + "min_value": 0, + "default": 3.0, + "type": "float", + "visible": false, + "active_if": { + "setting": "support_conical_enabled", + "value": true + } + }, + "support_bottom_stair_step_height": { + "label": "Stair Step Height", + "description": "The height of the steps of the stair-like bottom of support resting on the model. Small steps can cause the support to be hard to remove from the top of the model.", + "unit": "mm", + "type": "float", + "default": 2, + "visible": false, + "active_if": { + "setting": "support_type", + "value": "Everywhere" + } + }, + "support_join_distance": { + "label": "Join Distance", + "description": "The maximum distance between support blocks, in the X/Y directions, such that the blocks will merge into a single block.", + "unit": "mm", + "type": "float", + "default": 2, + "visible": false + }, + "support_offset": { + "label": "Horizontal Expansion", + "description": "Amount of offset applied to all support polygons in each layer. Positive values can smooth out the support areas and result in more sturdy support.", + "unit": "mm", + "type": "float", + "default": 0.2, + "visible": false + }, + "support_area_smoothing": { + "label": "Area Smoothing", + "description": "Maximal distance in the X/Y directions of a line segment which is to be smoothed out. Ragged lines are introduced by the join distance and support bridge, which cause the machine to resonate. Smoothing the support areas won't cause them to break with the constraints, except it might change the overhang.", + "unit": "mm", + "type": "float", + "default": 0.6, + "visible": false + }, + "support_roof_enable": { + "label": "Enable Hammock", + "description": "Generate a solid support roof on which the model sits.", + "type": "boolean", + "default": false, + "visible": true + }, + "support_roof_height": { + "label": "Hammock Thickness", + "description": "The height of the support roofs. ", + "unit": "mm", + "type": "float", + "default": 1, + "visible": false, + "active_if": { + "setting": "support_roof_enable", + "value": true + } + }, + "support_use_towers": { + "label": "Use towers.", + "description": "Use specialized towers to support tiny overhang areas. These towers have a larger diameter than the region they support. Near the overhang the towers' diameter decreases, forming a roof.", + "type": "boolean", + "default": true, + "visible": true + }, + "support_minimal_diameter": { + "label": "Minimal Diameter", + "description": "Maximal diameter in the X/Y directions of a small area which is to be supported by a specialized support tower. ", + "unit": "mm", + "type": "float", + "default": 1, + "visible": false, + "active_if": { + "setting": "support_use_towers", + "value": true + } + }, + "support_tower_diameter": { + "label": "Tower Diameter", + "description": "The diameter of a special tower. ", + "unit": "mm", + "type": "float", + "default": 1, + "visible": false, + "active_if": { + "setting": "support_use_towers", + "value": true + } + }, + "support_tower_roof_angle": { + "label": "Tower Roof Angle", + "description": "The angle of the rooftop of a tower. Larger angles mean more pointy towers. ", + "unit": "°", + "type": "int", + "min_value": 0, + "max_value": 90, + "default": 65, + "visible": false, + "active_if": { + "setting": "support_use_towers", + "value": true + } + }, + "support_pattern": { + "label": "Pattern", + "description": "Cura supports 3 distinct types of support structure. First is a grid based support structure which is quite solid and can be removed as 1 piece. The second is a line based support structure which has to be peeled off line by line. The third is a structure in between the other two; it consists of lines which are connected in an accordeon fashion.", + "type": "enum", + "options": [ + "Grid", + "Lines", + "ZigZag" + ], + "default": "ZigZag", + "visible": true, + "active_if": { + "setting": "support_enable", + "value": true + } + }, + "support_connect_zigzags": { + "label": "Connect ZigZags", + "description": "Connect the ZigZags. Makes them harder to remove, but prevents stringing of disconnected zigzags.", + "type": "boolean", + "default": true, + "visible": false, + "active_if": { + "setting": "support_pattern", + "value": "ZigZag" + } + }, + "support_infill_rate": { + "label": "Fill Amount", + "description": "The amount of infill structure in the support, less infill gives weaker support which is easier to remove.", + "unit": "%", + "type": "float", + "min_value": 0, + "max_value": 100, + "default": 15, + "visible": false, + "active_if": { + "setting": "support_enable", + "value": true + }, + "children": { + "support_line_distance": { + "label": "Line distance", + "description": "Distance between the printed support lines.", + "unit": "mm", + "type": "float", + "min_value": 0, + "default": 2.66, + "visible": false, + "active_if": { + "setting": "support_enable", + "value": true + }, + "inherit_function": "(support_line_width * 100) / parent_value" + } + } + } + } + }, "platform_adhesion": { "label": "Platform Adhesion", "visible": true, @@ -1280,15 +1388,6 @@ ], "default": "Skirt" }, - "adhesion_extruder_nr": { - "label": "Platform Adhesion Extruder", - "description": "The extruder train to use for printing the skirt/brim/raft. This is used in multi-extrusion.", - "type": "int", - "default": 0, - "min_value": 0, - "max_value": 16, - "inherit_function": "extruder_nr" - }, "skirt_line_count": { "label": "Skirt Line Count", "description": "The skirt is a line drawn around the first layer of the. This helps to prime your extruder, and to see if the object fits on your platform. Setting this to 0 will disable the skirt. Multiple skirt lines can help to prime your extruder better for small objects.", @@ -1557,47 +1656,6 @@ "inherit": true } } - } - } - }, - "shield": { - "label": "Shielding", - "visible": true, - "icon": "category_shield", - "settings": { - "ooze_shield_enabled": { - "label": "Enable Ooze Shield", - "description": "Enable exterior ooze shield. This will create a shell around the object which is likely to wipe a second nozzle if it's at the same height as the first nozzle.", - "type": "boolean", - "default": false - }, - "ooze_shield_angle": { - "label": "Ooze Shield Angle", - "description": "The maximum angle a part in the ooze shield will have. With 0 degrees being vertical, and 90 degrees being horizontal. A smaller angle leads to less failed ooze shields, but more material.", - "unit": "°", - "type": "float", - "min_value": 0, - "max_value": 90, - "default": 60, - "visible": false, - "active_if": { - "setting": "ooze_shield_enabled", - "value": true - } - }, - "ooze_shield_dist": { - "label": "Ooze Shields Distance", - "description": "Distance of the ooze shield from the print, in the X/Y directions.", - "unit": "mm", - "type": "float", - "min_value": 0, - "max_value_warning": 30, - "default": 2, - "visible": false, - "active_if": { - "setting": "ooze_shield_enabled", - "value": true - } }, "draft_shield_enabled": { "label": "Enable Draft Shield", @@ -1652,274 +1710,8 @@ } } }, - "support": { - "label": "Support", - "visible": true, - "icon": "category_support", - "settings": { - "support_enable": { - "label": "Enable Support", - "description": "Enable exterior support structures. This will build up supporting structures below the model to prevent the model from sagging or printing in mid air.", - "type": "boolean", - "default": true - }, - "support_extruder_nr": { - "label": "Support Extruder", - "description": "The extruder train to use for printing the support. This is used in multi-extrusion.", - "type": "int", - "default": 0, - "min_value": 0, - "max_value": 16, - "inherit_function": "extruder_nr", - "children": { - "support_roof_extruder_nr": { - "label": "Hammock Extruder", - "description": "The extruder train to use for printing the hammock. This is used in multi-extrusion.", - "type": "int", - "default": 0, - "min_value": 0, - "max_value": 16, - "inherit": true, - "active_if": { - "setting": "support_roof_enable", - "value": true - } - } - } - }, - "support_type": { - "label": "Placement", - "description": "Where to place support structures. The placement can be restricted such that the support structures won't rest on the model, which could otherwise cause scarring.", - "type": "enum", - "options": [ - "Touching Buildplate", - "Everywhere" - ], - "default": "Everywhere", - "visible": true, - "inherit_function": "'Everywhere' if support_enable else 'None'", - "active_if": { - "setting": "support_enable", - "value": true - } - }, - "support_angle": { - "label": "Overhang Angle", - "description": "The maximum angle of overhangs for which support will be added. With 0 degrees being vertical, and 90 degrees being horizontal. A smaller overhang angle leads to more support.", - "unit": "°", - "type": "float", - "min_value": 0, - "max_value": 90, - "default": 60, - "visible": false, - "active_if": { - "setting": "support_enable", - "value": true - } - }, - "support_xy_distance": { - "label": "X/Y Distance", - "description": "Distance of the support structure from the print, in the X/Y directions. 0.7mm typically gives a nice distance from the print so the support does not stick to the surface.", - "unit": "mm", - "type": "float", - "min_value": 0, - "max_value_warning": 10, - "default": 0.7, - "visible": false, - "active_if": { - "setting": "support_enable", - "value": true - } - }, - "support_z_distance": { - "label": "Z Distance", - "description": "Distance from the top/bottom of the support to the print. A small gap here makes it easier to remove the support but makes the print a bit uglier. 0.15mm allows for easier separation of the support structure.", - "unit": "mm", - "type": "float", - "min_value": 0, - "max_value_warning": 10, - "default": 0.15, - "visible": false, - "active_if": { - "setting": "support_enable", - "value": true - }, - "children": { - "support_top_distance": { - "label": "Top Distance", - "description": "Distance from the top of the support to the print.", - "unit": "mm", - "min_value": 0, - "max_value_warning": 10, - "default": 0.15, - "type": "float", - "visible": false - }, - "support_bottom_distance": { - "label": "Bottom Distance", - "description": "Distance from the print to the bottom of the support.", - "unit": "mm", - "min_value": 0, - "max_value_warning": 10, - "default": 0.15, - "type": "float", - "visible": false - } - } - }, - "support_bottom_stair_step_height": { - "label": "Stair Step Height", - "description": "The height of the steps of the stair-like bottom of support resting on the model. Small steps can cause the support to be hard to remove from the top of the model.", - "unit": "mm", - "type": "float", - "default": 1, - "visible": false, - "active_if": { - "setting": "support_type", - "value": "Everywhere" - } - }, - "support_join_distance": { - "label": "Join Distance", - "description": "The maximum distance between support blocks, in the X/Y directions, such that the blocks will merge into a single block.", - "unit": "mm", - "type": "float", - "default": 2, - "visible": false - }, - "support_area_smoothing": { - "label": "Area Smoothing", - "description": "Maximal distance in the X/Y directions of a line segment which is to be smoothed out. Ragged lines are introduced by the join distance and support bridge, which cause the machine to resonate. Smoothing the support areas won't cause them to break with the constraints, except it might change the overhang.", - "unit": "mm", - "type": "float", - "default": 0.6, - "visible": false - }, - "support_roof_enable": { - "label": "Enable Hammock", - "description": "Generate a solid support roof on which the model sits.", - "type": "boolean", - "default": false, - "visible": true - }, - "support_roof_height": { - "label": "Hammock Thickness", - "description": "The height of the support roofs. ", - "unit": "mm", - "type": "float", - "default": 1, - "visible": false, - "active_if": { - "setting": "support_roof_enable", - "value": true - } - }, - "support_use_towers": { - "label": "Use towers.", - "description": "Use specialized towers to support tiny overhang areas. These towers have a larger diameter than the region they support. Near the overhang the towers' diameter decreases, forming a roof.", - "type": "boolean", - "default": true, - "visible": true - }, - "support_minimal_diameter": { - "label": "Minimal Diameter", - "description": "Maximal diameter in the X/Y directions of a small area which is to be supported by a specialized support tower. ", - "unit": "mm", - "type": "float", - "default": 1, - "visible": false, - "active_if": { - "setting": "support_use_towers", - "value": true - } - }, - "support_tower_diameter": { - "label": "Tower Diameter", - "description": "The diameter of a special tower. ", - "unit": "mm", - "type": "float", - "default": 1, - "visible": false, - "active_if": { - "setting": "support_use_towers", - "value": true - } - }, - "support_tower_roof_angle": { - "label": "Tower Roof Angle", - "description": "The angle of the rooftop of a tower. Larger angles mean more pointy towers. ", - "unit": "°", - "type": "int", - "min_value": 0, - "max_value": 90, - "default": 65, - "visible": false, - "active_if": { - "setting": "support_use_towers", - "value": true - } - }, - "support_pattern": { - "label": "Pattern", - "description": "Cura supports 3 distinct types of support structure. First is a grid based support structure which is quite solid and can be removed as 1 piece. The second is a line based support structure which has to be peeled off line by line. The third is a structure in between the other two; it consists of lines which are connected in an accordeon fashion.", - "type": "enum", - "options": [ - "Grid", - "Lines", - "ZigZag" - ], - "default": "ZigZag", - "visible": true, - "active_if": { - "setting": "support_enable", - "value": true - } - }, - "support_connect_zigzags": { - "label": "Connect ZigZags", - "description": "Connect the ZigZags. Makes them harder to remove, but prevents stringing of disconnected zigzags.", - "type": "boolean", - "default": true, - "visible": false, - "active_if": { - "setting": "support_pattern", - "value": "ZigZag" - } - }, - "support_fill_rate": { - "label": "Fill Amount", - "description": "The amount of infill structure in the support, less infill gives weaker support which is easier to remove.", - "unit": "%", - "type": "float", - "min_value": 0, - "max_value": 100, - "default": 15, - "visible": false, - "active_if": { - "setting": "support_enable", - "value": true - }, - "children": { - "support_line_distance": { - "label": "Line distance", - "description": "Distance between the printed support lines.", - "unit": "mm", - "type": "float", - "min_value": 0, - "default": 2.66, - "visible": false, - "active_if": { - "setting": "support_enable", - "value": true - }, - "inherit_function": "(support_line_width * 100) / parent_value" - } - } - } - } - }, "meshfix": { - "label": "Fixes", + "label": "Mesh Fixes", "visible": true, "icon": "category_fixes", "settings": { @@ -1958,6 +1750,17 @@ "visible": true, "icon": "category_blackmagic", "settings": { + "print_sequence": { + "label": "Print sequence", + "description": "Whether to print all objects one layer at a time or to wait for one object to finish, before moving on to the next. One at a time mode is only possible if all models are separated such that the whole print head can move between and all models are lower than the distance between the nozzle and the X/Y axles.", + "type": "enum", + "options": [ + "All at once", + "One at a time" + ], + "default": "All at once", + "visible": true + }, "magic_mesh_surface_mode": { "label": "Surface Mode", "description": "Print the surface instead of the volume. No infill, no top/bottom skin, just a single wall of which the middle coincides with the surface of the mesh.", diff --git a/resources/machines/grr_neo.json b/resources/machines/grr_neo.json index 66b1248017..fdebfbd95e 100644 --- a/resources/machines/grr_neo.json +++ b/resources/machines/grr_neo.json @@ -2,7 +2,7 @@ "id": "grr_neo", "version": 1, "name": "German RepRap Neo", - "manufacturer": "German RepRap", + "manufacturer": "Other", "author": "other", "icon": "icon_ultimaker.png", "platform": "grr_neo_platform.stl", @@ -21,8 +21,6 @@ "machine_head_shape_max_x": { "default": 18 }, "machine_head_shape_max_y": { "default": 35 }, "machine_nozzle_gantry_distance": { "default": 55 }, - "machine_nozzle_offset_x_1": { "default": 18.0 }, - "machine_nozzle_offset_y_1": { "default": 0.0 }, "machine_gcode_flavor": { "default": "RepRap (Marlin/Sprinter)" }, "machine_start_gcode": { @@ -33,13 +31,7 @@ } }, - "categories": { - "material": { - "settings": { - "material_bed_temperature": { - "visible": false - } - } - } + "overrides": { + "material_bed_temperature": { "visible": false } } } diff --git a/resources/machines/hephestos.json b/resources/machines/hephestos.json index 4158ddaf53..5ff301b07c 100644 --- a/resources/machines/hephestos.json +++ b/resources/machines/hephestos.json @@ -9,7 +9,7 @@ "machine_settings": { "machine_start_gcode": { - "default": "; -- START GCODE --\n;Sliced at: {day} {date} {time}\n;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}\n;Print time: {print_time}\n;Filament used: {filament_amount}m {filament_weight}g\n;Filament cost: {filament_cost}\nG21 ;set units to millimetres\nG90 ;set to absolute positioning\nM106 S0 ;set fan speed to zero (turned off)\nG28 X0 Y0 ;move to the X/Y origin (Home)\nG28 Z0 ;move to the Z origin (Home)\nG1 Z15.0 F1200 ;move Z to position 15.0 mm\nG92 E0 ;zero the extruded length\nG1 E20 F200 ;extrude 20mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F7200 ;set feedrate to 120 mm/sec\n; -- end of START GCODE --" + "default": "; -- START GCODE --\n;Sliced at: {day} {date} {time}\n;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {infill_density}\n;Print time: {print_time}\n;Filament used: {filament_amount}m {filament_weight}g\n;Filament cost: {filament_cost}\nG21 ;set units to millimetres\nG90 ;set to absolute positioning\nM106 S0 ;set fan speed to zero (turned off)\nG28 X0 Y0 ;move to the X/Y origin (Home)\nG28 Z0 ;move to the Z origin (Home)\nG1 Z15.0 F1200 ;move Z to position 15.0 mm\nG92 E0 ;zero the extruded length\nG1 E20 F200 ;extrude 20mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F7200 ;set feedrate to 120 mm/sec\n; -- end of START GCODE --" }, "machine_end_gcode": { "default": "; -- END GCODE --\nM104 S0 ;set extruder temperature to zero (turned off)\nG91 ;set to relative positioning\nG1 E-20 F300 ;retract the filament a bit to release some of the pressure\nG1 Z10 ;move extruder up 10 mm\nG90 ;set to absolute positioning\nG1 X0 Y180 F1200 ;expose the platform\nM84 ;turn off steppers\n; -- end of END GCODE --" @@ -36,152 +36,36 @@ "default": [0.0, 100.0, 0.0] } }, - "categories": { - "layer_height": { - "settings": { - "layer_height": { - "default": 0.2 - }, - "layer_height_0": { - "default": 0.2, - "visible": true - } - } - }, - "shell": { - "settings": { - "shell_thickness": { - "default": 1.2, - "children": { - "wall_thickness": { - "default": 1.2, - "visible": false - }, - "top_bottom_thickness": { - "default": 0.8, - "visible": false, - "children": { - "bottom_thickness": { - "default": 0.4, - "visible": false - } - } - } - } - } - } - }, - "material": { - "settings": { - "material_print_temperature": { - "default": 220, - "visible": true - }, - "material_bed_temperature": { - "default": 0, - "visible": false - }, - "material_diameter": { - "default": 1.75, - "visible": true - } - } - }, - "speed": { - "settings": { - "speed_print": { - "default": 40.0, - "children": { - "speed_infill": { - "default": 40.0, - "visible": false - }, - "speed_wall": { - "default":35.0, - "visible": false, - "children": { - "speed_wall_0": { - "default": 35.0, - "visible": false - }, - "speed_wall_x": { - "default": 35.0, - "visible": false - } - } - }, - "speed_topbottom": { - "default": 35.0, - "visible": false - }, - "speed_support": { - "default": 35.0, - "visible": false - } - } - }, - "speed_travel": { - "default": 110.0 - }, - "speed_layer_0": { - "default": 20.0, - "visible": false - } - } - }, - "travel": { - "settings": { - "retraction_speed": { - "default": 30.0, - "visible": true, - "children": { - "retraction_retract_speed": { - "default": 30.0, - "visible": true - }, - "retraction_prime_speed": { - "default": 30.0, - "visible": true - } - } - }, - "retraction_amount": { - "default": 2.0, - "visible": true - }, - "retraction_hop": { - "default": 0.75, - "visible": false - } - } - }, - "platform_adhesion": { - "settings": { - "skirt_minimal_length": { - "default": 150 - }, - "raft_base_line_width": { - "default": 0.7 - }, - "raft_interface_thickness": { - "default": 0.2 - } - } - }, - "support": { - "settings": { - "support_enable": { - "default": true - }, - "support_z_distance": { - "default": 0.2, - "visible": false - }, - "support_fill_rate": { - "default": 10, - "visible": false - } - } - } + + "overrides": { + "layer_height": { "default": 0.2 }, + "layer_height_0": { "default": 0.2, "visible": true }, + "shell_thickness": { "default": 1.2 }, + "wall_thickness": { "default": 1.2, "visible": false }, + "top_bottom_thickness": { "default": 0.8, "visible": false }, + "bottom_thickness": { "default": 0.4, "visible": false }, + "material_print_temperature": { "default": 220, "visible": true }, + "material_bed_temperature": { "default": 0, "visible": false }, + "material_diameter": { "default": 1.75, "visible": true }, + "speed_print": { "default": 40.0 }, + "speed_infill": { "default": 40.0, "visible": false }, + "speed_wall": { "default":35.0, "visible": false }, + "speed_wall_0": { "default": 35.0, "visible": false }, + "speed_wall_x": { "default": 35.0, "visible": false }, + "speed_topbottom": { "default": 35.0, "visible": false }, + "speed_support": { "default": 35.0, "visible": false }, + "speed_travel": { "default": 110.0 }, + "speed_layer_0": { "default": 20.0, "visible": false }, + "retraction_speed": { "default": 30.0, "visible": true }, + "retraction_retract_speed": { "default": 30.0, "visible": true }, + "retraction_prime_speed": { "default": 30.0, "visible": true }, + "retraction_amount": { "default": 2.0, "visible": true }, + "retraction_hop": { "default": 0.75, "visible": false }, + "skirt_minimal_length": { "default": 150 }, + "raft_base_line_width": { "default": 0.7 }, + "raft_interface_thickness": { "default": 0.2 }, + "support_enable": { "default": true }, + "support_z_distance": { "default": 0.2, "visible": false }, + "support_infill_rate": { "default": 10, "visible": false } } } diff --git a/resources/machines/hephestos_xl.json b/resources/machines/hephestos_xl.json index 74583d55d2..8e52bc03b4 100644 --- a/resources/machines/hephestos_xl.json +++ b/resources/machines/hephestos_xl.json @@ -9,7 +9,7 @@ "machine_settings": { "machine_start_gcode": { - "default": "; -- START GCODE --\n;Sliced at: {day} {date} {time}\n;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}\n;Print time: {print_time}\n;Filament used: {filament_amount}m {filament_weight}g\n;Filament cost: {filament_cost}\nG21 ;set units to millimetres\nG90 ;set to absolute positioning\nM106 S0 ;set fan speed to zero (turned off)\nG28 X0 Y0 ;move to the X/Y origin (Home)\nG28 Z0 ;move to the Z origin (Home)\nG1 Z15.0 F1200 ;move Z to position 15.0 mm\nG92 E0 ;zero the extruded length\nG1 E20 F200 ;extrude 20mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F7200 ;set feedrate to 120 mm/sec\n; -- end of START GCODE --" + "default": "; -- START GCODE --\n;Sliced at: {day} {date} {time}\n;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {infill_density}\n;Print time: {print_time}\n;Filament used: {filament_amount}m {filament_weight}g\n;Filament cost: {filament_cost}\nG21 ;set units to millimetres\nG90 ;set to absolute positioning\nM106 S0 ;set fan speed to zero (turned off)\nG28 X0 Y0 ;move to the X/Y origin (Home)\nG28 Z0 ;move to the Z origin (Home)\nG1 Z15.0 F1200 ;move Z to position 15.0 mm\nG92 E0 ;zero the extruded length\nG1 E20 F200 ;extrude 20mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F7200 ;set feedrate to 120 mm/sec\n; -- end of START GCODE --" }, "machine_end_gcode": { "default": "; -- END GCODE --\nM104 S0 ;set extruder temperature to zero (turned off)\nG91 ;set to relative positioning\nG1 E-20 F300 ;retract the filament a bit to release some of the pressure\nG1 Z10 ;move extruder up 10 mm\nG90 ;set to absolute positioning\nG1 X0 Y180 F1200 ;expose the platform\nM84 ;turn off steppers\n; -- end of END GCODE --" @@ -36,152 +36,36 @@ "default": [0.0, 100.0, 0.0] } }, - "categories": { - "layer_height": { - "settings": { - "layer_height": { - "default": 0.2 - }, - "layer_height_0": { - "default": 0.2, - "visible": true - } - } - }, - "shell": { - "settings": { - "shell_thickness": { - "default": 1.2, - "children": { - "wall_thickness": { - "default": 1.2, - "visible": false - }, - "top_bottom_thickness": { - "default": 0.8, - "visible": false, - "children": { - "bottom_thickness": { - "default": 0.4, - "visible": false - } - } - } - } - } - } - }, - "material": { - "settings": { - "material_print_temperature": { - "default": 220, - "visible": true - }, - "material_bed_temperature": { - "default": 0, - "visible": false - }, - "material_diameter": { - "default": 1.75, - "visible": true - } - } - }, - "speed": { - "settings": { - "speed_print": { - "default": 40.0, - "children": { - "speed_infill": { - "default": 40.0, - "visible": false - }, - "speed_wall": { - "default":35.0, - "visible": false, - "children": { - "speed_wall_0": { - "default": 35.0, - "visible": false - }, - "speed_wall_x": { - "default": 35.0, - "visible": false - } - } - }, - "speed_topbottom": { - "default": 35.0, - "visible": false - }, - "speed_support": { - "default": 35.0, - "visible": false - } - } - }, - "speed_travel": { - "default": 110.0 - }, - "speed_layer_0": { - "default": 20.0, - "visible": false - } - } - }, - "travel": { - "settings": { - "retraction_speed": { - "default": 30.0, - "visible": true, - "children": { - "retraction_retract_speed": { - "default": 30.0, - "visible": true - }, - "retraction_prime_speed": { - "default": 30.0, - "visible": true - } - } - }, - "retraction_amount": { - "default": 2.0, - "visible": true - }, - "retraction_hop": { - "default": 0.75, - "visible": false - } - } - }, - "platform_adhesion": { - "settings": { - "skirt_minimal_length": { - "default": 150 - }, - "raft_base_line_width": { - "default": 0.7 - }, - "raft_interface_thickness": { - "default": 0.2 - } - } - }, - "support": { - "settings": { - "support_enable": { - "default": true - }, - "support_z_distance": { - "default": 0.2, - "visible": false - }, - "support_fill_rate": { - "default": 10, - "visible": false - } - } - } + + "overrides": { + "layer_height": { "default": 0.2 }, + "layer_height_0": { "default": 0.2, "visible": true }, + "shell_thickness": { "default": 1.2 }, + "wall_thickness": { "default": 1.2, "visible": false }, + "top_bottom_thickness": { "default": 0.8, "visible": false }, + "bottom_thickness": { "default": 0.4, "visible": false }, + "material_print_temperature": { "default": 220, "visible": true }, + "material_bed_temperature": { "default": 0, "visible": false }, + "material_diameter": { "default": 1.75, "visible": true }, + "speed_print": { "default": 40.0 }, + "speed_infill": { "default": 40.0, "visible": false }, + "speed_wall": { "default":35.0, "visible": false }, + "speed_wall_0": { "default": 35.0, "visible": false }, + "speed_wall_x": { "default": 35.0, "visible": false }, + "speed_topbottom": { "default": 35.0, "visible": false }, + "speed_support": { "default": 35.0, "visible": false }, + "speed_travel": { "default": 110.0 }, + "speed_layer_0": { "default": 20.0, "visible": false }, + "retraction_speed": { "default": 30.0, "visible": true }, + "retraction_retract_speed": { "default": 30.0, "visible": true }, + "retraction_prime_speed": { "default": 30.0, "visible": true }, + "retraction_amount": { "default": 2.0, "visible": true }, + "retraction_hop": { "default": 0.75, "visible": false }, + "skirt_minimal_length": { "default": 150 }, + "raft_base_line_width": { "default": 0.7 }, + "raft_interface_thickness": { "default": 0.2 }, + "support_enable": { "default": true }, + "support_z_distance": { "default": 0.2, "visible": false }, + "support_infill_rate": { "default": 10, "visible": false } } } diff --git a/resources/machines/prusa_i3.json b/resources/machines/prusa_i3.json index e0ff59c073..e328721b71 100644 --- a/resources/machines/prusa_i3.json +++ b/resources/machines/prusa_i3.json @@ -20,8 +20,6 @@ "machine_head_shape_max_x": { "default": 18 }, "machine_head_shape_max_y": { "default": 35 }, "machine_nozzle_gantry_distance": { "default": 55 }, - "machine_nozzle_offset_x_1": { "default": 0.0 }, - "machine_nozzle_offset_y_1": { "default": 0.0 }, "machine_gcode_flavor": { "default": "RepRap (Marlin/Sprinter)" }, "machine_start_gcode": { @@ -32,13 +30,7 @@ } }, - "categories": { - "material": { - "settings": { - "material_bed_temperature": { - "visible": true - } - } - } + "overrides": { + "material_bed_temperature": { "visible": true } } } diff --git a/resources/machines/ultimaker2.json b/resources/machines/ultimaker2.json index 6810a9a3d6..598a9327c1 100644 --- a/resources/machines/ultimaker2.json +++ b/resources/machines/ultimaker2.json @@ -10,6 +10,35 @@ "inherits": "fdmprinter.json", + + "machine_extruder_trains": [ + { + "extruder_nr": { + "label": "Extruder", + "description": "The extruder train used for printing. This is used in multi-extrusion.", + "type": "int", + "default": 0, + "min_value": 0, + "max_value": 16, + "inherit_function": "extruder_nr" + }, + "machine_nozzle_size": { + "default": 0.4 + }, + "machine_nozzle_tip_outer_diameter": { + "default": 1 + }, + "machine_nozzle_head_distance": { + "default": 3 + }, + "machine_nozzle_expansion_angle": { + "default": 45 + }, + "machine_heat_zone_length": { + "default": 16 + } + } + ], "machine_settings": { "machine_start_gcode" : { "default": "" }, "machine_end_gcode" : { "default": "" }, @@ -18,15 +47,31 @@ "machine_height": { "default": 205 }, "machine_heated_bed": { "default": true }, + "machine_head_with_fans_polygon": + { + "default": [ + [ + -40, + 30 + ], + [ + -40, + -10 + ], + [ + 60, + -10 + ], + [ + 60, + 30 + ] + ] + }, "machine_center_is_zero": { "default": false }, "machine_nozzle_size": { "default": 0.4 }, - "machine_head_shape_min_x": { "default": 40 }, - "machine_head_shape_min_y": { "default": 10 }, - "machine_head_shape_max_x": { "default": 60 }, - "machine_head_shape_max_y": { "default": 30 }, - "machine_nozzle_gantry_distance": { "default": 55 }, - "machine_nozzle_offset_x_1": { "default": 18.0 }, - "machine_nozzle_offset_y_1": { "default": 0.0 }, + "gantry_height": { "default": 55 }, + "machine_use_extruder_offset_to_offset_coords": { "default": true }, "machine_gcode_flavor": { "default": "UltiGCode" }, "machine_disallowed_areas": { "default": [ [[-115.0, 112.5], [ -82.0, 112.5], [ -84.0, 104.5], [-115.0, 104.5]], @@ -41,22 +86,10 @@ "machine_nozzle_expansion_angle": { "default": 45 } }, - "categories": { - "material": { - "settings": { - "material_print_temperature": { - "visible": false - }, - "material_bed_temperature": { - "visible": false - }, - "material_diameter": { - "visible": false - }, - "material_flow": { - "visible": false - } - } - } + "overrides": { + "material_print_temperature": { "visible": false }, + "material_bed_temperature": { "visible": false }, + "material_diameter": { "visible": false }, + "material_flow": { "visible": false } } } diff --git a/resources/machines/ultimaker_original.json b/resources/machines/ultimaker_original.json index 81bb2bf178..9b34404c54 100644 --- a/resources/machines/ultimaker_original.json +++ b/resources/machines/ultimaker_original.json @@ -16,36 +16,74 @@ {"page": "Bedleveling", "title": "Bedleveling Wizard"} ], + "machine_extruder_trains": [ + { + "extruder_nr": { + "label": "Extruder", + "description": "The extruder train used for printing. This is used in multi-extrusion.", + "type": "int", + "default": 0, + "min_value": 0, + "max_value": 16, + "inherit_function": "extruder_nr" + }, + "machine_nozzle_size": { + "default": 0.4 + }, + "machine_nozzle_tip_outer_diameter": { + "default": 1 + }, + "machine_nozzle_head_distance": { + "default": 3 + }, + "machine_nozzle_expansion_angle": { + "default": 45 + }, + "machine_heat_zone_length": { + "default": 16 + } + } + ], "machine_settings": { "machine_width": { "default": 205 }, "machine_height": { "default": 200 }, "machine_depth": { "default": 205 }, "machine_center_is_zero": { "default": false }, "machine_nozzle_size": { "default": 0.4 }, - "machine_head_shape_min_x": { "default": 75 }, - "machine_head_shape_min_y": { "default": 18 }, - "machine_head_shape_max_x": { "default": 18 }, - "machine_head_shape_max_y": { "default": 35 }, - "machine_nozzle_gantry_distance": { "default": 55 }, - "machine_nozzle_offset_x_1": { "default": 18.0 }, - "machine_nozzle_offset_y_1": { "default": 0.0 }, + "machine_head_with_fans_polygon": + { + "default": [ + [ + -75, + 35 + ], + [ + -75, + -18 + ], + [ + 18, + 35 + ], + [ + 18, + -18 + ] + ] + }, + "gantry_height": { "default": 55 }, + "machine_use_extruder_offset_to_offset_coords": { "default": true }, "machine_gcode_flavor": { "default": "RepRap (Marlin/Sprinter)" }, "machine_start_gcode": { - "default": "G21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nG1 Z15.0 F9000 ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E3 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F9000\n;Put printing message on LCD screen\nM117 Printing..." + "default": "G21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nG1 Z15.0 F9000 ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E6 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F9000\n;Put printing message on LCD screen\nM117 Printing..." }, "machine_end_gcode": { "default": "M104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nM84 ;steppers off\nG90 ;absolute positioning" } }, - "categories": { - "material": { - "settings": { - "material_bed_temperature": { - "visible": false - } - } - } + "overrides": { + "material_bed_temperature": { "visible": false } } } diff --git a/resources/machines/witbox.json b/resources/machines/witbox.json index c79ee169b2..4e27b5886d 100644 --- a/resources/machines/witbox.json +++ b/resources/machines/witbox.json @@ -9,7 +9,7 @@ "machine_settings": { "machine_start_gcode": { - "default": "; -- START GCODE --\n;Sliced at: {day} {date} {time}\n;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}\n;Print time: {print_time}\n;Filament used: {filament_amount}m {filament_weight}g\n;Filament cost: {filament_cost}\nG21 ;set units to millimetres\nG90 ;set to absolute positioning\nM106 S0 ;set fan speed to zero (turned off)\nG28 X0 Y0 ;move to the X/Y origin (Home)\nG28 Z0 ;move to the Z origin (Home)\nG1 Z15.0 F1200 ;move Z to position 15.0 mm\nG92 E0 ;zero the extruded length\nG1 E20 F200 ;extrude 20mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F7200 ;set feedrate to 120 mm/sec\n; -- end of START GCODE --" + "default": "; -- START GCODE --\n;Sliced at: {day} {date} {time}\n;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {infill_density}\n;Print time: {print_time}\n;Filament used: {filament_amount}m {filament_weight}g\n;Filament cost: {filament_cost}\nG21 ;set units to millimetres\nG90 ;set to absolute positioning\nM106 S0 ;set fan speed to zero (turned off)\nG28 X0 Y0 ;move to the X/Y origin (Home)\nG28 Z0 ;move to the Z origin (Home)\nG1 Z15.0 F1200 ;move Z to position 15.0 mm\nG92 E0 ;zero the extruded length\nG1 E20 F200 ;extrude 20mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F7200 ;set feedrate to 120 mm/sec\n; -- end of START GCODE --" }, "machine_end_gcode": { "default": "; -- END GCODE --\nM104 S0 ;set extruder temperature to zero (turned off)\nG91 ;set to relative positioning\nG1 E-20 F300 ;retract the filament a bit to release some of the pressure\nG90 ;set to absolute positioning\nG1 Z200 ;move the platform to the bottom\nG28 X0 Y0 ;move to the X/Y origin (Home)\nM84 ;turn off steppers\n; -- end of END GCODE --" @@ -36,152 +36,35 @@ "default": [0, -145, -38] } }, - "categories": { - "layer_height": { - "settings": { - "layer_height": { - "default": 0.2 - }, - "layer_height_0": { - "default": 0.2, - "visible": true - } - } - }, - "shell": { - "settings": { - "shell_thickness": { - "default": 1.2, - "children": { - "wall_thickness": { - "default": 1.2, - "visible": false - }, - "top_bottom_thickness": { - "default": 0.8, - "visible": false, - "children": { - "bottom_thickness": { - "default": 0.4, - "visible": false - } - } - } - } - } - } - }, - "material": { - "settings": { - "material_print_temperature": { - "default": 220, - "visible": true - }, - "material_bed_temperature": { - "default": 0, - "visible": false - }, - "material_diameter": { - "default": 1.75, - "visible": true - } - } - }, - "speed": { - "settings": { - "speed_print": { - "default": 40.0, - "children": { - "speed_infill": { - "default": 40.0, - "visible": false - }, - "speed_wall": { - "default":35.0, - "visible": false, - "children": { - "speed_wall_0": { - "default": 35.0, - "visible": false - }, - "speed_wall_x": { - "default": 35.0, - "visible": false - } - } - }, - "speed_topbottom": { - "default": 35.0, - "visible": false - }, - "speed_support": { - "default": 35.0, - "visible": false - } - } - }, - "speed_travel": { - "default": 120.0 - }, - "speed_layer_0": { - "default": 20.0, - "visible": false - } - } - }, - "travel": { - "settings": { - "retraction_speed": { - "default": 30.0, - "visible": true, - "children": { - "retraction_retract_speed": { - "default": 30.0, - "visible": true - }, - "retraction_prime_speed": { - "default": 30.0, - "visible": true - } - } - }, - "retraction_amount": { - "default": 2.0, - "visible": true - }, - "retraction_hop": { - "default": 0.75, - "visible": false - } - } - }, - "platform_adhesion": { - "settings": { - "skirt_minimal_length": { - "default": 150 - }, - "raft_base_line_width": { - "default": 0.7 - }, - "raft_interface_thickness": { - "default": 0.2 - } - } - }, - "support": { - "settings": { - "support_enable": { - "default": true - }, - "support_z_distance": { - "default": 0.2, - "visible": false - }, - "support_fill_rate": { - "default": 10, - "visible": false - } - } - } + "overrides": { + "layer_height": { "default": 0.2 }, + "layer_height_0": { "default": 0.2, "visible": true }, + "shell_thickness": { "default": 1.2}, + "wall_thickness": { "default": 1.2, "visible": false }, + "top_bottom_thickness": { "default": 0.8, "visible": false}, + "bottom_thickness": { "default": 0.4, "visible": false }, + "material_print_temperature": { "default": 220, "visible": true }, + "material_bed_temperature": { "default": 0, "visible": false }, + "material_diameter": { "default": 1.75, "visible": true }, + "speed_print": { "default": 40.0}, + "speed_infill": { "default": 40.0, "visible": false }, + "speed_wall": { "default":35.0, "visible": false}, + "speed_wall_0": { "default": 35.0, "visible": false }, + "speed_wall_x": { "default": 35.0, "visible": false }, + "speed_topbottom": { "default": 35.0, "visible": false }, + "speed_support": { "default": 35.0, "visible": false }, + "speed_travel": { "default": 120.0 }, + "speed_layer_0": { "default": 20.0, "visible": false }, + "retraction_speed": { "default": 30.0, "visible": true}, + "retraction_retract_speed": { "default": 30.0, "visible": true }, + "retraction_prime_speed": { "default": 30.0, "visible": true }, + "retraction_amount": { "default": 2.0, "visible": true }, + "retraction_hop": { "default": 0.75, "visible": false }, + "skirt_minimal_length": { "default": 150 }, + "raft_base_line_width": { "default": 0.7 }, + "raft_interface_thickness": { "default": 0.2 }, + "support_enable": { "default": true }, + "support_z_distance": { "default": 0.2, "visible": false }, + "support_infill_rate": { "default": 10, "visible": false } } } diff --git a/resources/meshes/makerstarter_platform.stl b/resources/meshes/makerstarter_platform.stl new file mode 100644 index 0000000000..bbd9f02d6e Binary files /dev/null and b/resources/meshes/makerstarter_platform.stl differ diff --git a/resources/meshes/rigidbot_platform.stl b/resources/meshes/rigidbot_platform.stl new file mode 100644 index 0000000000..a1491c6d49 Binary files /dev/null and b/resources/meshes/rigidbot_platform.stl differ diff --git a/resources/meshes/rigidbotbig_platform.stl b/resources/meshes/rigidbotbig_platform.stl new file mode 100644 index 0000000000..7c7859aa38 Binary files /dev/null and b/resources/meshes/rigidbotbig_platform.stl differ diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index d364b462b6..29bd573d12 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -40,10 +40,18 @@ Item { property alias reportBug: reportBugAction; property alias about: aboutAction; + property alias toggleFullScreen: toggleFullScreenAction; + + Action + { + id:toggleFullScreenAction + shortcut: StandardKey.FullScreen; + } + Action { id: undoAction; //: Undo action - text: qsTr("&Undo"); + text: qsTr("Undo"); iconName: "edit-undo"; shortcut: StandardKey.Undo; } @@ -51,7 +59,7 @@ Item { Action { id: redoAction; //: Redo action - text: qsTr("&Redo"); + text: qsTr("Redo"); iconName: "edit-redo"; shortcut: StandardKey.Redo; } @@ -59,7 +67,7 @@ Item { Action { id: quitAction; //: Quit action - text: qsTr("&Quit"); + text: qsTr("Quit"); iconName: "application-exit"; shortcut: StandardKey.Quit; } @@ -67,20 +75,20 @@ Item { Action { id: preferencesAction; //: Preferences action - text: qsTr("&Preferences..."); + text: qsTr("Preferences..."); iconName: "configure"; } Action { id: addMachineAction; //: Add Printer action - text: qsTr("&Add Printer..."); + text: qsTr("Add Printer..."); } Action { id: settingsAction; //: Configure Printers action - text: qsTr("&Configure Printers"); + text: qsTr("Configure Printers"); iconName: "configure"; } @@ -102,7 +110,7 @@ Item { Action { id: aboutAction; //: About action - text: qsTr("&About..."); + text: qsTr("About..."); iconName: "help-about"; } @@ -119,6 +127,7 @@ Item { //: Delete object action text: qsTr("Delete Object"); iconName: "edit-delete"; + shortcut: StandardKey.Backspace; } Action { @@ -126,7 +135,7 @@ Item { //: Center object action text: qsTr("Center Object on Platform"); } - + Action { id: groupObjectsAction @@ -189,7 +198,7 @@ Item { Action { id: openAction; //: Open file action - text: qsTr("&Open..."); + text: qsTr("Load file"); iconName: "document-open"; shortcut: StandardKey.Open; } @@ -197,7 +206,7 @@ Item { Action { id: saveAction; //: Save file action - text: qsTr("&Save..."); + text: qsTr("Save..."); iconName: "document-save"; shortcut: StandardKey.Save; } diff --git a/resources/qml/AddMachineWizard.qml b/resources/qml/AddMachineWizard.qml index 5d6608a7da..c236c6a19d 100644 --- a/resources/qml/AddMachineWizard.qml +++ b/resources/qml/AddMachineWizard.qml @@ -8,9 +8,19 @@ import QtQuick.Window 2.1 import UM 1.0 as UM -UM.Wizard{ - id: base +UM.Wizard +{ + //: Add Printer dialog title + wizardTitle: qsTr("Add Printer") + wizardPages: [ + { + title: "Add Printer", + page: "AddMachine.qml" + } + ] + + // This part is optional + // This part checks whether there is a printer -> if not: some of the functions (delete for example) are disabled property bool printer: true - file: "ultimaker2.json" firstRun: printer ? false : true } diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 5a11538763..0a3373d964 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -12,7 +12,6 @@ import UM 1.1 as UM UM.MainWindow { id: base visible: true - //: Cura application window title title: qsTr("Cura"); @@ -229,10 +228,8 @@ UM.MainWindow { UM.MessageStack { anchors { - left: toolbar.right; - leftMargin: UM.Theme.sizes.window_margin.width; - right: sidebar.left; - rightMargin: UM.Theme.sizes.window_margin.width; + horizontalCenter: parent.horizontalCenter + horizontalCenterOffset: -(UM.Theme.sizes.logo.width/ 2) top: parent.verticalCenter; bottom: parent.bottom; } @@ -259,25 +256,25 @@ UM.MainWindow { Button { id: openFileButton; - - iconSource: UM.Theme.icons.open; - style: UM.Backend.progress < 0 ? UM.Theme.styles.open_file_button : UM.Theme.styles.tool_button; + //style: UM.Backend.progress < 0 ? UM.Theme.styles.open_file_button : UM.Theme.styles.tool_button; + style: UM.Theme.styles.open_file_button tooltip: ''; anchors { top: parent.top; - topMargin: UM.Theme.sizes.window_margin.height; + topMargin: UM.Theme.sizes.loadfile_margin.height left: parent.left; - leftMargin: UM.Theme.sizes.window_margin.width; + leftMargin: UM.Theme.sizes.loadfile_margin.width } - action: actions.open; } Image { + id: logo anchors { - verticalCenter: openFileButton.verticalCenter; - left: openFileButton.right; - leftMargin: UM.Theme.sizes.window_margin.width; + left: parent.left + leftMargin: UM.Theme.sizes.default_margin.width; + bottom: parent.bottom + bottomMargin: UM.Theme.sizes.default_margin.height; } source: UM.Theme.images.logo; @@ -289,13 +286,12 @@ UM.MainWindow { } Button { + id: viewModeButton anchors { top: parent.top; - topMargin: UM.Theme.sizes.window_margin.height; right: sidebar.left; rightMargin: UM.Theme.sizes.window_margin.width; } - id: viewModeButton //: View Mode toolbar button text: qsTr("View Mode"); iconSource: UM.Theme.icons.viewmode; @@ -325,10 +321,9 @@ UM.MainWindow { id: toolbar; anchors { - left: parent.left; - leftMargin: UM.Theme.sizes.window_margin.width; - bottom: parent.bottom; - bottomMargin: UM.Theme.sizes.window_margin.height; + horizontalCenter: parent.horizontalCenter + horizontalCenterOffset: -(UM.Theme.sizes.panel.width / 2) + top: parent.top; } } @@ -366,8 +361,15 @@ UM.MainWindow { id: preferences Component.onCompleted: { + //; Remove & re-add the general page as we want to use our own instead of uranium standard. + removePage(0); + insertPage(0, qsTr("General") , "" , Qt.resolvedUrl("./GeneralPage.qml")); + //: View preferences page title insertPage(1, qsTr("View"), "view-preview", Qt.resolvedUrl("./ViewPage.qml")); + + //Force refresh + setPage(0) } } @@ -440,6 +442,8 @@ UM.MainWindow { reportBug.onTriggered: CuraActions.openBugReportPage(); showEngineLog.onTriggered: engineLog.visible = true; about.onTriggered: aboutDialog.visible = true; + toggleFullScreen.onTriggered: base.toggleFullscreen() + } Menu { @@ -498,7 +502,6 @@ UM.MainWindow { onAccepted: { UM.MeshFileHandler.readLocalFile(fileUrl) - Printer.setPlatformActivity(true) } } diff --git a/resources/qml/GeneralPage.qml b/resources/qml/GeneralPage.qml new file mode 100644 index 0000000000..9f7203702f --- /dev/null +++ b/resources/qml/GeneralPage.qml @@ -0,0 +1,130 @@ +// Copyright (c) 2015 Ultimaker B.V. +// Uranium is released under the terms of the AGPLv3 or higher. + +import QtQuick 2.1 +import QtQuick.Controls 1.1 +import QtQuick.Layouts 1.1 +import QtQuick.Controls.Styles 1.1 + +import UM 1.0 as UM + +UM.PreferencesPage +{ + //: General configuration page title + title: qsTr("General"); + + function reset() + { + UM.Preferences.resetPreference("general/language") + UM.Preferences.resetPreference("physics/automatic_push_free") + } + GridLayout + { + columns: 2; + //: Language selection label + Label + { + id: languageLabel + text: qsTr("Language") + } + + ComboBox + { + id: languageComboBox + model: ListModel + { + id: languageList + //: English language combo box option + ListElement { text: QT_TR_NOOP("English"); code: "en" } + //: German language combo box option + ListElement { text: QT_TR_NOOP("German"); code: "de" } + //: French language combo box option + // ListElement { text: QT_TR_NOOP("French"); code: "fr" } + //: Spanish language combo box option + ListElement { text: QT_TR_NOOP("Spanish"); code: "es" } + //: Italian language combo box option + // ListElement { text: QT_TR_NOOP("Italian"); code: "it" } + //: Finnish language combo box option + ListElement { text: QT_TR_NOOP("Finnish"); code: "fi" } + //: Russian language combo box option + ListElement { text: QT_TR_NOOP("Russian"); code: "ru" } + } + + currentIndex: + { + var code = UM.Preferences.getValue("general/language"); + for(var i = 0; i < languageList.count; ++i) + { + if(model.get(i).code == code) + { + return i + } + } + } + onActivated: UM.Preferences.setValue("general/language", model.get(index).code) + + anchors.left: languageLabel.right + anchors.top: languageLabel.top + anchors.leftMargin: 20 + + Component.onCompleted: + { + // Because ListModel is stupid and does not allow using qsTr() for values. + for(var i = 0; i < languageList.count; ++i) + { + languageList.setProperty(i, "text", qsTr(languageList.get(i).text)); + } + + // Glorious hack time. ComboBox does not update the text properly after changing the + // model. So change the indices around to force it to update. + currentIndex += 1; + currentIndex -= 1; + } + } + + Label + { + id: languageCaption; + Layout.columnSpan: 2 + + //: Language change warning + text: qsTr("You will need to restart the application for language changes to have effect.") + wrapMode: Text.WordWrap + font.italic: true + } + + CheckBox + { + id: pushFreeCheckbox + checked: UM.Preferences.getValue("physics/automatic_push_free") + onCheckedChanged: UM.Preferences.setValue("physics/automatic_push_free", checked) + } + Button + { + id: pushFreeText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox + + //: Display Overhang preference checkbox + text: qsTr("Automatic push free"); + onClicked: pushFreeCheckbox.checked = !pushFreeCheckbox.checked + + //: Display Overhang preference tooltip + tooltip: "Are objects on the platform automatically moved so they no longer intersect" + + style: ButtonStyle + { + background: Rectangle + { + border.width: 0 + color: "transparent" + } + label: Text + { + renderType: Text.NativeRendering + horizontalAlignment: Text.AlignLeft + text: control.text + } + } + } + Item { Layout.fillHeight: true; Layout.columnSpan: 2 } + } +} diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index ec7a6bd839..e14dfdc99d 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -12,33 +12,14 @@ Item { id: base; width: buttons.width; - height: buttons.height + panel.height; - - Rectangle { - id: activeItemBackground; - - anchors.bottom: parent.bottom; - anchors.bottomMargin: UM.Theme.sizes.default_margin.height; - - width: UM.Theme.sizes.button.width; - height: UM.Theme.sizes.button.height * 2; - - opacity: panelBackground.opacity; - - color: UM.Theme.colors.tool_panel_background - - function setActive(new_x) { - x = new_x; - } - } + height: buttons.height RowLayout { id: buttons; anchors.bottom: parent.bottom; anchors.left: parent.left; - - spacing: UM.Theme.sizes.default_margin.width * 2; + spacing: UM.Theme.sizes.default_lining.width Repeater { id: repeat @@ -51,7 +32,6 @@ Item { checkable: true; checked: model.active; - onCheckedChanged: if (checked) activeItemBackground.setActive(x); style: UM.Theme.styles.tool_button; @@ -65,21 +45,30 @@ Item { } } - UM.AngledCornerRectangle { + Rectangle { + width: base.width - 10 + height: base.height + z: parent.z - 1 + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + color: UM.Theme.colors.button_lining + } + + Rectangle { id: panelBackground; anchors.left: parent.left; - anchors.bottom: buttons.top; - anchors.bottomMargin: UM.Theme.sizes.default_margin.height; + anchors.top: buttons.bottom; - width: panel.item ? Math.max(panel.width + 2 * UM.Theme.sizes.default_margin.width, activeItemBackground.x + activeItemBackground.width) : 0; + width: panel.item ? Math.max(panel.width + 2 * UM.Theme.sizes.default_margin.width) : 0; height: panel.item ? panel.height + 2 * UM.Theme.sizes.default_margin.height : 0; opacity: panel.item ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 100 } } color: UM.Theme.colors.tool_panel_background; - cornerSize: width > 0 ? UM.Theme.sizes.default_margin.width : 0; + border.width: UM.Theme.sizes.default_lining.width + border.color: UM.Theme.colors.button_lining Loader { id: panel diff --git a/resources/qml/ViewPage.qml b/resources/qml/ViewPage.qml index 172ddad8d8..ed00eacca0 100644 --- a/resources/qml/ViewPage.qml +++ b/resources/qml/ViewPage.qml @@ -8,7 +8,8 @@ import QtQuick.Controls.Styles 1.1 import UM 1.0 as UM -UM.PreferencesPage { +UM.PreferencesPage +{ id: preferencesPage //: View configuration page title @@ -17,22 +18,26 @@ UM.PreferencesPage { function reset() { UM.Preferences.resetPreference("view/show_overhang"); + UM.Preferences.resetPreferences("view/center_on_select"); } - GridLayout { + GridLayout + { columns: 2; - CheckBox { - id: viewCheckbox + CheckBox + { + id: overhangCheckbox checked: UM.Preferences.getValue("view/show_overhang") onCheckedChanged: UM.Preferences.setValue("view/show_overhang", checked) } - Button { + Button + { id: viewText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox //: Display Overhang preference checkbox text: qsTr("Display Overhang"); - onClicked: viewCheckbox.checked = !viewCheckbox.checked + onClicked: overhangCheckbox.checked = !overhangCheckbox.checked //: Display Overhang preference tooltip tooltip: "Highlight unsupported areas of the model in red. Without support these areas will nog print properly." @@ -49,6 +54,39 @@ UM.PreferencesPage { } } } + + CheckBox + { + id: centerCheckbox + checked: UM.Preferences.getValue("view/center_on_select") + onCheckedChanged: UM.Preferences.setValue("view/center_on_select", checked) + } + Button + { + id: centerText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox + + //: Display Overhang preference checkbox + text: qsTr("Center camera when item is selected"); + onClicked: centerCheckbox.checked = !centerCheckbox.checked + + //: Display Overhang preference tooltip + tooltip: "Moves the camera so the object is in the center of the view when an object is selected" + + style: ButtonStyle + { + background: Rectangle + { + border.width: 0 + color: "transparent" + } + label: Text + { + renderType: Text.NativeRendering + horizontalAlignment: Text.AlignLeft + text: control.text + } + } + } Item { Layout.fillHeight: true; Layout.columnSpan: 2 } } } diff --git a/resources/qml/WizardPages/AddMachine.qml b/resources/qml/WizardPages/AddMachine.qml index 7e69c06366..39dfd2414d 100644 --- a/resources/qml/WizardPages/AddMachine.qml +++ b/resources/qml/WizardPages/AddMachine.qml @@ -5,103 +5,274 @@ import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 import QtQuick.Window 2.1 +import QtQuick.Controls.Styles 1.1 import UM 1.0 as UM import ".." -ColumnLayout { +ColumnLayout +{ id: wizardPage property string title - signal openFile(string fileName) - signal closeWizard() + property int pageWidth + property int pageHeight + property var manufacturers: wizardPage.lineManufacturers() + property int manufacturerIndex: 0 - Connections { - target: rootElement - onFinalClicked: {//You can add functions here that get triggered when the final button is clicked in the wizard-element + SystemPalette{id: palette} + signal reloadModel(var newModel) + + width: wizardPage.pageWidth + height: wizardPage.pageHeight + + Connections + { + target: elementRoot + onNextClicked: //You can add functions here that get triggered when the final button is clicked in the wizard-element + { saveMachine() } } - Label { + function lineManufacturers(manufacturer) + { + var manufacturers = [] + for (var i = 0; i < UM.Models.availableMachinesModel.rowCount(); i++) + { + if (UM.Models.availableMachinesModel.getItem(i).manufacturer != manufacturers[manufacturers.length - 1]) + { + manufacturers.push(UM.Models.availableMachinesModel.getItem(i).manufacturer) + } + } + return manufacturers + } + + Label + { + id: title + anchors.left: parent.left + anchors.top: parent.top text: parent.title font.pointSize: 18; } - Label { + Label + { + id: subTitle + anchors.left: parent.left + anchors.top: title.bottom //: Add Printer wizard page description text: qsTr("Please select the type of printer:"); } - ScrollView { - ListView { - id: machineList; + ScrollView + { + id: machinesHolder + anchors.left: parent.left + anchors.top: subTitle.bottom + implicitWidth: wizardPage.width- UM.Theme.sizes.default_margin.width + implicitHeight: wizardPage.height - subTitle.height - title.height - (machineNameHolder.height * 2) + + Component + { + id: machineDelegate + ColumnLayout + { + id: machineLayout + spacing: 0 + anchors.left: parent.left + anchors.leftMargin: UM.Theme.sizes.standard_list_lineheight.width + function showManufacturer() + { + if (model.manufacturer == UM.Models.availableMachinesModel.getItem(index - 1).manufacturer){ + return false + } + else{ + return true + } + } + height: + { + if (machineLayout.showManufacturer() & wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer) + return UM.Theme.sizes.standard_list_lineheight.height * 2 + if (wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer | machineLayout.showManufacturer()) + return UM.Theme.sizes.standard_list_lineheight.height * 1 + else + return 0 + } + Behavior on height + { + NumberAnimation { target: machineLayout; property: "height"; duration: 200} + } + Button + { + id: manufacturer + property color backgroundColor: "transparent" + height: UM.Theme.sizes.standard_list_lineheight.height + visible: machineLayout.showManufacturer() + anchors.top: machineLayout.top + anchors.topMargin: 0 + text: + { + if (wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer) + return model.manufacturer + " ▼" + else + return model.manufacturer + " ►" + } + style: ButtonStyle + { + background: Rectangle + { + id: manufacturerBackground + opacity: 0.3 + border.width: 0 + color: manufacturer.backgroundColor + height: UM.Theme.sizes.standard_list_lineheight.height + } + label: Text + { + renderType: Text.NativeRendering + horizontalAlignment: Text.AlignLeft + text: control.text + color: palette.windowText + font.bold: true + } + } + MouseArea + { + id: mousearea + hoverEnabled: true + anchors.fill: parent + onEntered: manufacturer.backgroundColor = palette.light + onExited: manufacturer.backgroundColor = "transparent" + onClicked: + { + wizardPage.manufacturerIndex = wizardPage.manufacturers.indexOf(model.manufacturer) + machineList.currentIndex = index + } + } + } + + RadioButton + { + id: machineButton + opacity: wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer ? 1 : 0 + height: wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer ? UM.Theme.sizes.standard_list_lineheight.height : 0 + anchors.top: parent.top + anchors.topMargin: machineLayout.showManufacturer() ? manufacturer.height - 5 : 0 + anchors.left: parent.left + anchors.leftMargin: UM.Theme.sizes.standard_list_lineheight.width + checked: machineList.currentIndex == index ? true : false + exclusiveGroup: printerGroup; + text: model.name + onClicked: machineList.currentIndex = index; + function getAnimationTime(time) + { + if (machineButton.opacity == 0) + return time + else + return 0 + } + Label + { + id: author + visible: model.author != "Ultimaker" ? true : false + height: wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer ? UM.Theme.sizes.standard_list_lineheight.height : 0 + //: Printer profile caption meaning: this profile is supported by the community + text: qsTr("community supported profile"); + opacity: wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer ? 1 : 0 + anchors.left: machineButton.right + anchors.leftMargin: UM.Theme.sizes.standard_list_lineheight.height/2 + anchors.verticalCenter: machineButton.verticalCenter + anchors.verticalCenterOffset: UM.Theme.sizes.standard_list_lineheight.height / 4 + font: UM.Theme.fonts.caption; + color: palette.mid + } + Behavior on opacity + { + SequentialAnimation + { + PauseAnimation { duration: machineButton.getAnimationTime(100) } + NumberAnimation { properties:"opacity"; duration: machineButton.getAnimationTime(200) } + } + } + } + + } + } + + ListView + { + id: machineList + property int currentIndex: 0 + property int otherMachinesIndex: + { + for (var i = 0; i < UM.Models.availableMachinesModel.rowCount(); i++) + { + if (UM.Models.availableMachinesModel.getItem(i).manufacturer != "Ultimaker") + { + return i + } + } + } + anchors.fill: parent model: UM.Models.availableMachinesModel - delegate: RadioButton { - id:machine_button - exclusiveGroup: printerGroup; - checked: ListView.view.currentIndex == index ? true : false - text: model.name; - onClicked: { - ListView.view.currentIndex = index; - - } - } + delegate: machineDelegate + focus: true } } - Label { - text: qsTr("Variation:"); + Item + { + id: machineNameHolder + height: childrenRect.height + anchors.top: machinesHolder.bottom + Label + { + id: insertNameLabel + //: Add Printer wizard field label + text: qsTr("Printer Name:"); } - - ScrollView { - ListView { - id: variations_list - model: machineList.model.getItem(machineList.currentIndex).variations - delegate: RadioButton { - id: variation_radio_button - checked: ListView.view.currentIndex == index ? true : false - exclusiveGroup: variationGroup; - text: model.name; - onClicked: ListView.view.currentIndex = index; - } + TextField + { + id: machineName; + anchors.top: insertNameLabel.bottom + text: machineList.model.getItem(machineList.currentIndex).name + implicitWidth: UM.Theme.sizes.standard_list_input.width } } - Label { - //: Add Printer wizard field label - text: qsTr("Printer Name:"); - } - - TextField { id: machineName; Layout.fillWidth: true; text: machineList.model.getItem(machineList.currentIndex).name } - Item { Layout.fillWidth: true; Layout.fillHeight: true; } ExclusiveGroup { id: printerGroup; } - ExclusiveGroup { id: variationGroup; } - function getSpecialMachineType(machineId){ - for (var i = 0; i < UM.Models.addMachinesModel.rowCount(); i++) { - if (UM.Models.addMachinesModel.getItem(i).name == machineId){ - return UM.Models.addMachinesModel.getItem(i).name + + function saveMachine() + { + if(machineList.currentIndex != -1) + { + UM.Models.availableMachinesModel.createMachine(machineList.currentIndex, machineName.text) + var pages = UM.Models.availableMachinesModel.getItem(machineList.currentIndex).pages + var old_page_count = elementRoot.getPageCount() + for(var i = 0; i < UM.Models.count; i++) + { + print(UM.Models.getItem(i)) } - } - } - - function saveMachine(){ - if(machineList.currentIndex != -1) { - UM.Models.availableMachinesModel.createMachine(machineList.currentIndex, variations_list.currentIndex, machineName.text) - - var originalString = "Ultimaker Original" - var originalPlusString = "Ultimaker Original+" - var originalMachineType = getSpecialMachineType(originalString) - - if (UM.Models.availableMachinesModel.getItem(machineList.currentIndex).name == originalMachineType){ - var variation = UM.Models.availableMachinesModel.getItem(machineList.currentIndex).variations.getItem(variations_list.currentIndex).name - if (variation == originalString || variation == originalPlusString){ - console.log(UM.Models.availableMachinesModel.getItem(machineList.currentIndex).variations.getItem(variations_list.currentIndex).type) - wizardPage.openFile(UM.Models.availableMachinesModel.getItem(machineList.currentIndex).variations.getItem(variations_list.currentIndex).type) - } + // Delete old pages (if any) + for (var i = old_page_count - 1; i > 0; i--) + { + elementRoot.removePage(i) + elementRoot.currentPage = 0 } - else { - wizardPage.closeWizard() + + // Insert new pages (if any) + for(var i = 0; i < pages.count; i++) + { + elementRoot.insertPage(pages.getItem(i).page + ".qml",pages.getItem(i).title,i + 1) + } + + // Hack to ensure the current page is set correctly + if(old_page_count == 1) + { + elementRoot.currentPage += 1 } } } diff --git a/resources/qml/WizardPages/Bedleveling.qml b/resources/qml/WizardPages/Bedleveling.qml index eb8207b37d..3c1dcea552 100644 --- a/resources/qml/WizardPages/Bedleveling.qml +++ b/resources/qml/WizardPages/Bedleveling.qml @@ -8,45 +8,47 @@ import QtQuick.Window 2.1 import UM 1.0 as UM -ColumnLayout { - property string title +Column +{ + id: wizardPage + property int leveling_state: 0 + property bool three_point_leveling: true + property int platform_width: UM.Models.settingsModel.getMachineSetting("machine_width") + property int platform_height: UM.Models.settingsModel.getMachineSetting("machine_depth") anchors.fill: parent; - - Label { - text: parent.title - font.pointSize: 18; + property variant printer_connection: UM.USBPrinterManager.connectedPrinterList.getItem(0).printer + Component.onCompleted: printer_connection.homeHead() + Label + { + text: "" + //Component.onCompleted:console.log(UM.Models.settingsModel.getMachineSetting("machine_width")) } - - Label { - //: Add Printer wizard page description - text: qsTr("Please select the type of printer:"); - } - - ScrollView { - Layout.fillWidth: true; - - ListView { - id: machineList; - model: UM.Models.availableMachinesModel - delegate: RadioButton { - exclusiveGroup: printerGroup; - text: model.name; - onClicked: { - ListView.view.currentIndex = index; - - } + Button + { + text: "Move to next position" + onClicked: + { + if(wizardPage.leveling_state == 0) + { + printer_connection.moveHead(platform_width /2 , platform_height,0) } + if(wizardPage.leveling_state == 1) + { + printer_connection.moveHead(platform_width , 0,0) + } + if(wizardPage.leveling_state == 2) + { + printer_connection.moveHead(0, 0 ,0) + } + + wizardPage.leveling_state++ + } } - Label { - //: Add Printer wizard field label - text: qsTr("Printer Name:"); + function threePointLeveling(width, height) + { } - TextField { id: machineName; Layout.fillWidth: true; text: machineList.model.getItem(machineList.currentIndex).name } - Item { Layout.fillWidth: true; Layout.fillHeight: true; } - - ExclusiveGroup { id: printerGroup; } } \ No newline at end of file diff --git a/resources/qml/WizardPages/SelectUpgradedParts.qml b/resources/qml/WizardPages/SelectUpgradedParts.qml index eb8207b37d..46fdd876af 100644 --- a/resources/qml/WizardPages/SelectUpgradedParts.qml +++ b/resources/qml/WizardPages/SelectUpgradedParts.qml @@ -8,45 +8,76 @@ import QtQuick.Window 2.1 import UM 1.0 as UM -ColumnLayout { +Item +{ + id: wizardPage property string title - anchors.fill: parent; - Label { - text: parent.title - font.pointSize: 18; - } + SystemPalette{id: palette} - Label { - //: Add Printer wizard page description - text: qsTr("Please select the type of printer:"); - } + ScrollView + { + height: parent.height + width: parent.width + Column + { + width: wizardPage.width + Label + { + id: pageTitle + width: parent.width + text: wizardPage.title + wrapMode: Text.WordWrap + font.pointSize: 18 + } + Label + { + id: pageDescription + //: Add UM Original wizard page description + width: parent.width + wrapMode: Text.WordWrap + text: qsTr("To assist you in having better default settings for your Ultimaker. Cura would like to know which upgrades you have in your machine:") + } - ScrollView { - Layout.fillWidth: true; - - ListView { - id: machineList; - model: UM.Models.availableMachinesModel - delegate: RadioButton { - exclusiveGroup: printerGroup; - text: model.name; - onClicked: { - ListView.view.currentIndex = index; + Column + { + id: pageCheckboxes + width: parent.width + CheckBox + { + text: qsTr("Extruder driver ugrades") } + CheckBox + { + text: qsTr("Heated printer bed (kit)") + } + CheckBox + { + text: qsTr("Heated printer bed (self built)") + } + CheckBox + { + text: qsTr("Dual extrusion (experimental)") + checked: true + } + } + + Label + { + width: parent.width + wrapMode: Text.WordWrap + text: qsTr("If you have an Ultimaker bought after october 2012 you will have the Extruder drive upgrade. If you do not have this upgrade, it is highly recommended to improve reliability."); + } + + Label + { + width: parent.width + wrapMode: Text.WordWrap + text: qsTr("This upgrade can be bought from the Ultimaker webshop or found on thingiverse as thing:26094"); } } } - Label { - //: Add Printer wizard field label - text: qsTr("Printer Name:"); - } - - TextField { id: machineName; Layout.fillWidth: true; text: machineList.model.getItem(machineList.currentIndex).name } - - Item { Layout.fillWidth: true; Layout.fillHeight: true; } - ExclusiveGroup { id: printerGroup; } } \ No newline at end of file diff --git a/resources/qml/WizardPages/UltimakerCheckup.qml b/resources/qml/WizardPages/UltimakerCheckup.qml index eb8207b37d..acfe288e14 100644 --- a/resources/qml/WizardPages/UltimakerCheckup.qml +++ b/resources/qml/WizardPages/UltimakerCheckup.qml @@ -8,45 +8,173 @@ import QtQuick.Window 2.1 import UM 1.0 as UM -ColumnLayout { +Column +{ + id: wizardPage property string title anchors.fill: parent; + property bool x_min_pressed: false + property bool y_min_pressed: false + property bool z_min_pressed: false + property bool heater_works: false + property int extruder_target_temp: 0 + property int bed_target_temp: 0 + property variant printer_connection: UM.USBPrinterManager.connectedPrinterList.getItem(0).printer - Label { + Component.onCompleted: printer_connection.startPollEndstop() + Component.onDestruction: printer_connection.stopPollEndstop() + + Label + { text: parent.title font.pointSize: 18; } - Label { + Label + { //: Add Printer wizard page description - text: qsTr("Please select the type of printer:"); + text: qsTr("It's a good idea to do a few sanity checks on your Ultimaker. \n You can skip these if you know your machine is functional"); } - ScrollView { - Layout.fillWidth: true; + Row + { + Label + { + text: qsTr("Connection: ") + } + Label + { + text: UM.USBPrinterManager.connectedPrinterList.count ? "Done":"Incomplete" + } + } + Row + { + Label + { + text: qsTr("Min endstop X: ") + } + Label + { + text: x_min_pressed ? qsTr("Works") : qsTr("Not checked") + } + } + Row + { + Label + { + text: qsTr("Min endstop Y: ") + } + Label + { + text: y_min_pressed ? qsTr("Works") : qsTr("Not checked") + } + } - ListView { - id: machineList; - model: UM.Models.availableMachinesModel - delegate: RadioButton { - exclusiveGroup: printerGroup; - text: model.name; - onClicked: { - ListView.view.currentIndex = index; + Row + { + Label + { + text: qsTr("Min endstop Z: ") + } + Label + { + text: z_min_pressed ? qsTr("Works") : qsTr("Not checked") + } + } - } + Row + { + Label + { + text: qsTr("Nozzle temperature check: ") + } + Label + { + text: printer_connection.extruderTemperature + } + Button + { + text: "Start heating" + onClicked: + { + heater_status_label.text = qsTr("Checking") + printer_connection.heatupNozzle(190) + wizardPage.extruder_target_temp = 190 + } + } + Label + { + id: heater_status_label + text: qsTr("Not checked") + } + } + + Row + { + Label + { + text: qsTr("bed temperature check: ") + } + Label + { + text: printer_connection.bedTemperature + } + Button + { + text: "Start heating" + onClicked: + { + bed_status_label.text = qsTr("Checking") + printer_connection.printer.heatupBed(60) + wizardPage.bed_target_temp = 60 + } + } + Label + { + id: bed_status_label + text: qsTr("Not checked") + } + } + + + Connections + { + target: printer_connection + onEndstopStateChanged: + { + if(key == "x_min") + { + x_min_pressed = true + } + if(key == "y_min") + { + y_min_pressed = true + } + if(key == "z_min") + { + z_min_pressed = true + } + } + onExtruderTemperatureChanged: + { + if(printer_connection.extruderTemperature > wizardPage.extruder_target_temp - 10 && printer_connection.extruderTemperature < wizardPage.extruder_target_temp + 10) + { + heater_status_label.text = qsTr("Works") + printer_connection.heatupNozzle(0) + } + } + onBedTemperatureChanged: + { + if(printer_connection.bedTemperature > wizardPage.bed_target_temp - 5 && printer_connection.bedTemperature < wizardPage.bed_target_temp + 5) + { + bed_status_label.text = qsTr("Works") + printer_connection.heatupBed(0) } } } - Label { - //: Add Printer wizard field label - text: qsTr("Printer Name:"); + ExclusiveGroup + { + id: printerGroup; } - - TextField { id: machineName; Layout.fillWidth: true; text: machineList.model.getItem(machineList.currentIndex).name } - - Item { Layout.fillWidth: true; Layout.fillHeight: true; } - - ExclusiveGroup { id: printerGroup; } } \ No newline at end of file diff --git a/resources/qml/WizardPages/UpgradeFirmware.qml b/resources/qml/WizardPages/UpgradeFirmware.qml index 9369df6e42..9bb7152931 100644 --- a/resources/qml/WizardPages/UpgradeFirmware.qml +++ b/resources/qml/WizardPages/UpgradeFirmware.qml @@ -8,45 +8,61 @@ import QtQuick.Window 2.1 import UM 1.0 as UM -ColumnLayout { +Column +{ + id: wizardPage property string title anchors.fill: parent; - signal openFile(string fileName) - - Label { + Label + { text: parent.title font.pointSize: 18; } - Label { - //: Add Printer wizard page description - text: qsTr("Please select the type of printer:"); - } - - ScrollView { - Layout.fillWidth: true; - - ListView { + ScrollView + { + height: parent.height - 50 + width: parent.width + ListView + { id: machineList; - model: UM.Models.availableMachinesModel - delegate: RadioButton { - exclusiveGroup: printerGroup; - text: model.name; - onClicked: { - ListView.view.currentIndex = index; + model: UM.USBPrinterManager.connectedPrinterList + + delegate:Row + { + id: derp + Text + { + id: text_area + text: model.name + } + Button + { + text: "Update"; + onClicked: + { + if(!UM.USBPrinterManager.updateFirmwareBySerial(text_area.text)) + { + status_text.text = "ERROR" + } + } } } } } - Label { - //: Add Printer wizard field label - text: qsTr("Printer Name:"); + Label + { + id: status_text + text: "" } - TextField { id: machineName; Layout.fillWidth: true; text: machineList.model.getItem(machineList.currentIndex).name } - Item { Layout.fillWidth: true; Layout.fillHeight: true; } + Item + { + Layout.fillWidth: true; + Layout.fillHeight: true; + } + - ExclusiveGroup { id: printerGroup; } } \ No newline at end of file diff --git a/resources/settings/RigidBot.json b/resources/settings/RigidBot.json new file mode 100644 index 0000000000..68eaea6bbf --- /dev/null +++ b/resources/settings/RigidBot.json @@ -0,0 +1,60 @@ +{ + "id": "rigidbotbig", + "version": 1, + "name": "RigidBot", + "manufacturer": "Invent-A-Part", + "author": "RBC", + "platform": "rigidbot_platform.stl", + + "inherits": "fdmprinter.json", + + "machine_settings": { + + "machine_width": { "default": 254 }, + "machine_depth": { "default": 254 }, + "machine_height": { "default": 254 }, + "machine_heated_bed": { "default": true }, + + "machine_nozzle_size": { "default": 0.4, + "visible": true + }, + "machine_head_shape_min_x": { "default": 0 }, + "machine_head_shape_min_y": { "default": 0 }, + "machine_head_shape_max_x": { "default": 0 }, + "machine_head_shape_max_y": { "default": 0 }, + "machine_nozzle_gantry_distance": { "default": 0 }, + "machine_gcode_flavor": { "default": "RepRap (Marlin/Sprinter)" }, + + "machine_start_gcode": { + "default": ";Sliced at: {day} {date} {time}\n;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {infill_density}\n;Print time: {print_time}\n;Filament used: {filament_amount}m {filament_weight}g\n;Filament cost: {filament_cost}\n;M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line\n;M109 S{print_temperature} ;Uncomment to add your own temperature line\nG21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nM205 X8 ;X/Y Jerk settings\nG1 Z15.0 F{travel_speed} ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E7 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F{travel_speed}\n;Put printing message on LCD screen\nM117 Rigibot Printing..." + }, + "machine_end_gcode": { + "default": ";End GCode\nM104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+10 E-1 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nG1 Y230 F3000 ;move Y so the head is out of the way and Plate is moved forward\nM84 ;steppers off\nG90 ;absolute positioning\n;{profile_string}" + } + }, + + "overrides": { + "layer_height": { "default": 0.2 }, + "shell_thickness": { "default": 0.8 }, + "wall_thickness": { "default": 0.8 }, + "top_bottom_thickness": { "default": 0.3, "visible": true }, + "material_print_temperature": { "default": 195, "visible": true }, + "material_bed_temperature": { "default": 60, "visible": true }, + "material_diameter": { "default": 1.75, "visible": true }, + "retraction_enable": { "default": true, "always_visible": true }, + "retraction_speed": { "default": 50.0, "visible": false }, + "retraction_amount": { "default": 0.8, "visible": false }, + "retraction_hop": { "default": 0.075, "visible": false }, + "speed_print": { "default": 60.0, "visible": true }, + "speed_infill": { "default": 100.0, "visible": true }, + "speed_topbottom": { "default": 15.0, "visible": true }, + "speed_travel": { "default": 150.0, "visible": true }, + "speed_layer_0": { "min_value": 0.1, "default": 15.0, "visible": true }, + "infill_overlap": { "default": 10.0 }, + "cool_fan_enabled": { "default": false, "visible": true }, + "cool_fan_speed": { "default": 0.0, "visible": true }, + "skirt_line_count": { "default": 3, "active_if": { "setting": "adhesion_type", "value": "None" } }, + "skirt_gap": { "default": 4.0, "active_if": { "setting": "adhesion_type", "value": "None" } }, + "skirt_minimal_length": { "default": 200.0, "active_if": { "setting": "adhesion_type", "value": "None" } } + } +} diff --git a/resources/settings/RigidBotBig.json b/resources/settings/RigidBotBig.json new file mode 100644 index 0000000000..034ec0b921 --- /dev/null +++ b/resources/settings/RigidBotBig.json @@ -0,0 +1,58 @@ +{ + "id": "rigidbotbig", + "version": 1, + "name": "RigidBotBig", + "manufacturer": "Invent-A-Part", + "author": "RBC", + "platform": "rigidbotbig_platform.stl", + + "inherits": "fdmprinter.json", + + "machine_settings": { + + "machine_width": { "default": 400 }, + "machine_depth": { "default": 300 }, + "machine_height": { "default": 254 }, + "machine_heated_bed": { "default": true }, + + "machine_nozzle_size": { "default": 0.4}, + "machine_head_shape_min_x": { "default": 0 }, + "machine_head_shape_min_y": { "default": 0 }, + "machine_head_shape_max_x": { "default": 0 }, + "machine_head_shape_max_y": { "default": 0 }, + "machine_nozzle_gantry_distance": { "default": 0 }, + "machine_gcode_flavor": { "default": "RepRap (Marlin/Sprinter)" }, + + "machine_start_gcode": { + "default": ";Sliced at: {day} {date} {time}\n;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {infill_density}\n;Print time: {print_time}\n;Filament used: {filament_amount}m {filament_weight}g\n;Filament cost: {filament_cost}\n;M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line\n;M109 S{print_temperature} ;Uncomment to add your own temperature line\nG21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nM205 X8 ;X/Y Jerk settings\nG1 Z15.0 F{travel_speed} ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E7 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F{travel_speed}\n;Put printing message on LCD screen\nM117 Rigibot Printing..." + }, + "machine_end_gcode": { + "default": ";End GCode\nM104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+10 E-1 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nG1 Y230 F3000 ;move Y so the head is out of the way and Plate is moved forward\nM84 ;steppers off\nG90 ;absolute positioning\n;{profile_string}" + } + }, + + "overrides": { + "layer_height": { "default": 0.2 }, + "shell_thickness": { "default": 0.8}, + "wall_thickness": { "default": 0.8 }, + "top_bottom_thickness": { "default": 0.3, "visible": true }, + "material_print_temperature": { "default": 195, "visible": true }, + "material_bed_temperature": { "default": 60, "visible": true }, + "material_diameter": { "default": 1.75, "visible": true }, + "retraction_enable": { "default": true, "always_visible": true}, + "retraction_speed": { "default": 50.0, "visible": false }, + "retraction_amount": { "default": 0.8, "visible": false }, + "retraction_hop": { "default": 0.075, "visible": false }, + "speed_print": { "default": 60.0, "visible": true}, + "speed_infill": { "default": 100.0, "visible": true }, + "speed_topbottom": { "default": 15.0, "visible": true }, + "speed_travel": { "default": 150.0, "visible": true }, + "speed_layer_0": { "min_value": 0.1, "default": 15.0, "visible": true }, + "infill_overlap": { "default": 10.0 }, + "cool_fan_enabled": { "default": false, "visible": true}, + "cool_fan_speed": { "default": 0.0, "visible": true }, + "skirt_line_count": { "default": 3, "active_if": { "setting": "adhesion_type", "value": "None" } }, + "skirt_gap": { "default": 4.0, "active_if": { "setting": "adhesion_type", "value": "None" } }, + "skirt_minimal_length": { "default": 200.0, "active_if": { "setting": "adhesion_type", "value": "None" } } + } +} diff --git a/resources/settings/dual_extrusion_printer.json b/resources/settings/dual_extrusion_printer.json new file mode 100644 index 0000000000..64e9060c76 --- /dev/null +++ b/resources/settings/dual_extrusion_printer.json @@ -0,0 +1,280 @@ +{ + "version": 1, + + "inherits": "fdmprinter.json", + + "machine_settings": { + "extruder_nr": { "default": 0 }, + + "machine_use_extruder_offset_to_offset_coords": { "default": false }, + + "machine_nozzle_offset_x": { "default": 0, "SEE_machine_extruder_trains": true }, + "machine_nozzle_offset_y": { "default": 0, "SEE_machine_extruder_trains": true }, + "machine_extruder_start_code": { "default": "", "SEE_machine_extruder_trains": true }, + "machine_extruder_start_pos_abs": { "default": false, "SEE_machine_extruder_trains": true }, + "machine_extruder_start_pos_x": { "default": 0, "SEE_machine_extruder_trains": true }, + "machine_extruder_start_pos_y": { "default": 0, "SEE_machine_extruder_trains": true }, + "machine_extruder_end_pos_abs": { "default": false, "SEE_machine_extruder_trains": true }, + "machine_extruder_end_pos_x": { "default": 0, "SEE_machine_extruder_trains": true }, + "machine_extruder_end_pos_y": { "default": 0, "SEE_machine_extruder_trains": true }, + "machine_extruder_end_code": { "default": "", "SEE_machine_extruder_trains": true } + }, + "overrides": { + "speed_print": { + "children": { + "speed_prime_tower": { + "label": "Prime Tower Speed", + "description": "The speed at which the prime tower is printed. Printing the prime tower slower can make it more stable when the adhesion between the different filaments is suboptimal.", + "unit": "mm/s", + "type": "float", + "min_value": 0.1, + "max_value_warning": 150, + "default": 50, + "visible": false, + "active_if": { + "setting": "prime_tower_enable", + "value": true + } + } + } + }, + "line_width": { + "children": { + "prime_tower_line_width": { + "label": "Prime Tower Line Width", + "description": "Width of a single prime tower line.", + "unit": "mm", + "min_value": 0.0001, + "min_value_warning": 0.2, + "max_value_warning": 5, + "default": 0.4, + "type": "float", + "visible": false, + "active_if": { + "setting": "prime_tower_enable", + "value": true + } + } + } + } + }, + "categories": { + "dual": { + "label": "Dual Extrusion", + "visible": false, + "icon": "category_dual", + "settings": { + "prime_tower_enable": { + "label": "Enable Prime Tower", + "description": "Print a tower next to the print which serves to prime the material after each nozzle switch.", + "type": "boolean", + "default": false + }, + "prime_tower_size": { + "label": "Prime Tower Size", + "description": "The width of the prime tower.", + "visible": false, + "type": "float", + "unit": "mm", + "default": 15, + "min_value": 0, + "max_value_warning": 20, + "inherit_function": "0 if prime_tower_enable else 15", + "active_if": { + "setting": "prime_tower_enable", + "value": true + } + }, + "prime_tower_position_x": { + "label": "Prime Tower X Position", + "description": "The x position of the prime tower.", + "visible": false, + "type": "float", + "unit": "mm", + "default": 200, + "active_if": { + "setting": "prime_tower_enable", + "value": true + } + }, + "prime_tower_position_y": { + "label": "Prime Tower Y Position", + "description": "The y position of the prime tower.", + "visible": false, + "type": "float", + "unit": "mm", + "default": 200, + "active_if": { + "setting": "prime_tower_enable", + "value": true + } + }, + "prime_tower_flow": { + "label": "Prime Tower Flow", + "description": "Flow compensation: the amount of material extruded is multiplied by this value.", + "visible": false, + "unit": "%", + "default": 100, + "type": "float", + "min_value": 5, + "min_value_warning": 50, + "max_value_warning": 150, + "active_if": { + "setting": "prime_tower_enable", + "value": true + } + }, + "prime_tower_wipe_enabled": { + "label": "Wipe Nozzle on Prime tower", + "description": "After printing the prime tower with the one nozzle, wipe the oozed material from the other nozzle off on the prime tower.", + "type": "boolean", + "default": false, + "active_if": { + "setting": "prime_tower_enable", + "value": true + } + }, + "ooze_shield_enabled": { + "label": "Enable Ooze Shield", + "description": "Enable exterior ooze shield. This will create a shell around the object which is likely to wipe a second nozzle if it's at the same height as the first nozzle.", + "type": "boolean", + "default": false + }, + "ooze_shield_angle": { + "label": "Ooze Shield Angle", + "description": "The maximum angle a part in the ooze shield will have. With 0 degrees being vertical, and 90 degrees being horizontal. A smaller angle leads to less failed ooze shields, but more material.", + "unit": "°", + "type": "float", + "min_value": 0, + "max_value": 90, + "default": 60, + "visible": false, + "active_if": { + "setting": "ooze_shield_enabled", + "value": true + } + }, + "ooze_shield_dist": { + "label": "Ooze Shields Distance", + "description": "Distance of the ooze shield from the print, in the X/Y directions.", + "unit": "mm", + "type": "float", + "min_value": 0, + "max_value_warning": 30, + "default": 2, + "visible": false, + "active_if": { + "setting": "ooze_shield_enabled", + "value": true + } + } + } + }, + "platform_adhesion": { + "settings": { + "adhesion_extruder_nr": { + "label": "Platform Adhesion Extruder", + "description": "The extruder train to use for printing the skirt/brim/raft. This is used in multi-extrusion.", + "type": "int", + "default": 0, + "min_value": 0, + "max_value": 16, + "inherit_function": "extruder_nr" + } + } + }, + "material": { + "settings": { + "switch_extruder_retraction_amount": { + "label": "Nozzle Switch Retraction Distance", + "description": "The amount of retraction: Set at 0 for no retraction at all. This should generally be the same as the length of the heat zone.", + "unit": "mm", + "type": "float", + "default": 16, + "visible": false, + "inherit_function": "machine_heat_zone_length", + "active_if": { + "setting": "retraction_enable", + "value": true + } + }, + "switch_extruder_retraction_speeds": { + "label": "Nozzle Switch Retraction Speed", + "description": "The speed at which the filament is retracted. A higher retraction speed works better, but a very high retraction speed can lead to filament grinding.", + "unit": "mm/s", + "type": "float", + "default": 20, + "visible": false, + "inherit": false, + "active_if": { + "setting": "retraction_enable", + "value": true + }, + "children": { + "switch_extruder_retraction_speed": { + "label": "Nozzle Switch Retract Speed", + "description": "The speed at which the filament is retracted during a nozzle switch retract. ", + "unit": "mm/s", + "type": "float", + "default": 20, + "visible": false, + "active_if": { + "setting": "retraction_enable", + "value": true + } + }, + "switch_extruder_prime_speed": { + "label": "Nozzle Switch Prime Speed", + "description": "The speed at which the filament is pushed back after a nozzle switch retraction.", + "unit": "mm/s", + "type": "float", + "default": 20, + "visible": false, + "active_if": { + "setting": "retraction_enable", + "value": true + } + } + } + } + } + }, + "support": { + "settings": { + "support_extruder_nr": { + "label": "Support Extruder", + "description": "The extruder train to use for printing the support. This is used in multi-extrusion.", + "type": "int", + "default": 0, + "min_value": 0, + "max_value": 16, + "inherit_function": "extruder_nr", + "children": { + "support_extruder_nr_layer_0": { + "label": "First Layer Support Extruder", + "description": "The extruder train to use for printing the first layer of support. This is used in multi-extrusion.", + "type": "int", + "default": 0, + "min_value": 0, + "max_value": 16, + "inherit": true + }, + "support_roof_extruder_nr": { + "label": "Hammock Extruder", + "description": "The extruder train to use for printing the hammock. This is used in multi-extrusion.", + "type": "int", + "default": 0, + "min_value": 0, + "max_value": 16, + "inherit": true, + "active_if": { + "setting": "support_roof_enable", + "value": true + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/resources/settings/maker_starter.json b/resources/settings/maker_starter.json new file mode 100644 index 0000000000..8ff7bbd7c0 --- /dev/null +++ b/resources/settings/maker_starter.json @@ -0,0 +1,82 @@ +{ + "id": "maker_starter", + "version": 1, + "name": "3DMaker Starter", + "manufacturer": "Other", + "author": "Other", + "icon": "icon_ultimaker2.png", + "platform": "makerstarter_platform.stl", + + "inherits": "fdmprinter.json", + + "machine_settings": { + "machine_width": { "default": 210 }, + "machine_depth": { "default": 185 }, + "machine_height": { "default": 200 }, + "machine_heated_bed": { "default": false }, + + "machine_center_is_zero": { "default": false }, + "machine_nozzle_size": { "default": 0.4 }, + "machine_head_shape_min_x": { "default": 0 }, + "machine_head_shape_min_y": { "default": 0 }, + "machine_head_shape_max_x": { "default": 0 }, + "machine_head_shape_max_y": { "default": 0 }, + "machine_nozzle_gantry_distance": { "default": 55 }, + "machine_gcode_flavor": { "default": "RepRap" }, + "machine_disallowed_areas": { "default": []}, + "machine_platform_offset": { "default": [0.0, 0.0, 0.0] }, + + "machine_nozzle_tip_outer_diameter": { "default": 1.0 }, + "machine_nozzle_head_distance": { "default": 3.0 }, + "machine_nozzle_expansion_angle": { "default": 45 } + }, + + "overrides": { + "layer_height": { "default": 0.2 }, + "layer_height_0": { "default": 0.2, "visible": false }, + "wall_line_count": { "default": 2, "visible": true }, + "top_layers": { "default": 4, "visible": true }, + "bottom_layers": { "default": 4, "visible": true }, + "material_print_temperature": { "visible": false }, + "material_bed_temperature": { "visible": false }, + "material_diameter": { "default": 1.75, "visible": false }, + "material_flow": { "visible": false }, + "retraction_hop": { "default": 0.2 }, + "speed_print": { "default": 50.0 }, + "speed_wall": { "default": 30.0 }, + "speed_wall_0": { "default": 30.0 }, + "speed_wall_x": { "default": 30.0 }, + "speed_topbottom": { "default": 50.0 }, + "speed_support": { "default": 50.0 }, + "speed_travel": { "default": 120.0 }, + "speed_layer_0": { "default": 20.0 }, + "skirt_speed": { "default": 15.0 }, + "speed_slowdown_layers": { "default": 4 }, + "infill_sparse_density": { "default": 20.0 }, + "cool_fan_speed_min": { "default": 50.0 }, + "cool_fan_speed_max": { "default": 100.0 }, + "cool_fan_full_layer": { "default": 4, "visible": true }, + "cool_min_layer_time": { "default": 5.0 }, + "cool_min_layer_time_fan_speed_max": { "default": 10.0 }, + "support_type": { "default": "Everywhere" }, + "support_angle": { "default": 45.0, "visible": true }, + "support_xy_distance": { "default": 1 }, + "support_z_distance": { "default": 0.2 }, + "support_top_distance": { "default": 0.2 }, + "support_bottom_distance": { "default": 0.24 }, + "support_pattern": { "default": "ZigZag" }, + "support_infill_rate": { "default": 15, "visible": true }, + "adhesion_type": { "default": "Raft" }, + "skirt_minimal_length": { "default": 100.0 }, + "raft_base_line_spacing": { "default": 2.0 }, + "raft_base_thickness": { "default": 0.3 }, + "raft_base_line_width": { "default": 2.0 }, + "raft_base_speed": { "default": 15.0 }, + "raft_interface_thickness": { "default": 0.24 }, + "raft_interface_line_width": { "default": 0.6 }, + "raft_airgap": { "default": 0.2 }, + "raft_surface_layers": { "default": 2 } + } +} + + diff --git a/resources/themes/cura/fonts/ProximaNova-Black.otf b/resources/themes/cura/fonts/ProximaNova-Black.otf new file mode 100644 index 0000000000..ec4d45f178 Binary files /dev/null and b/resources/themes/cura/fonts/ProximaNova-Black.otf differ diff --git a/resources/themes/cura/fonts/ProximaNova-Bold.otf b/resources/themes/cura/fonts/ProximaNova-Bold.otf new file mode 100644 index 0000000000..4df9e17140 Binary files /dev/null and b/resources/themes/cura/fonts/ProximaNova-Bold.otf differ diff --git a/resources/themes/cura/fonts/ProximaNova-BoldIt.otf b/resources/themes/cura/fonts/ProximaNova-BoldIt.otf new file mode 100644 index 0000000000..60188efbff Binary files /dev/null and b/resources/themes/cura/fonts/ProximaNova-BoldIt.otf differ diff --git a/resources/themes/cura/fonts/ProximaNova-Extrabold.otf b/resources/themes/cura/fonts/ProximaNova-Extrabold.otf new file mode 100644 index 0000000000..bd8e650ff9 Binary files /dev/null and b/resources/themes/cura/fonts/ProximaNova-Extrabold.otf differ diff --git a/resources/themes/cura/fonts/ProximaNova-Light.otf b/resources/themes/cura/fonts/ProximaNova-Light.otf new file mode 100644 index 0000000000..d8f5338d21 Binary files /dev/null and b/resources/themes/cura/fonts/ProximaNova-Light.otf differ diff --git a/resources/themes/cura/fonts/ProximaNova-LightItalic.otf b/resources/themes/cura/fonts/ProximaNova-LightItalic.otf new file mode 100644 index 0000000000..f779115b97 Binary files /dev/null and b/resources/themes/cura/fonts/ProximaNova-LightItalic.otf differ diff --git a/resources/themes/cura/fonts/ProximaNova-Regular.otf b/resources/themes/cura/fonts/ProximaNova-Regular.otf new file mode 100644 index 0000000000..27c8d8f7bf Binary files /dev/null and b/resources/themes/cura/fonts/ProximaNova-Regular.otf differ diff --git a/resources/themes/cura/fonts/ProximaNova-RegularItalic.otf b/resources/themes/cura/fonts/ProximaNova-RegularItalic.otf new file mode 100644 index 0000000000..20ffc1fcdd Binary files /dev/null and b/resources/themes/cura/fonts/ProximaNova-RegularItalic.otf differ diff --git a/resources/themes/cura/fonts/ProximaNovaCond-Light.otf b/resources/themes/cura/fonts/ProximaNovaCond-Light.otf new file mode 100644 index 0000000000..0b27849cd0 Binary files /dev/null and b/resources/themes/cura/fonts/ProximaNovaCond-Light.otf differ diff --git a/resources/themes/cura/fonts/ProximaNovaCond-LightIt.otf b/resources/themes/cura/fonts/ProximaNovaCond-LightIt.otf new file mode 100644 index 0000000000..a7dd085cf1 Binary files /dev/null and b/resources/themes/cura/fonts/ProximaNovaCond-LightIt.otf differ diff --git a/resources/themes/cura/fonts/ProximaNovaCond-Regular.otf b/resources/themes/cura/fonts/ProximaNovaCond-Regular.otf new file mode 100644 index 0000000000..7356c3b88b Binary files /dev/null and b/resources/themes/cura/fonts/ProximaNovaCond-Regular.otf differ diff --git a/resources/themes/cura/fonts/Roboto-Black.ttf b/resources/themes/cura/fonts/Roboto-Black.ttf deleted file mode 100644 index 9002aab5d4..0000000000 Binary files a/resources/themes/cura/fonts/Roboto-Black.ttf and /dev/null differ diff --git a/resources/themes/cura/fonts/Roboto-BlackItalic.ttf b/resources/themes/cura/fonts/Roboto-BlackItalic.ttf deleted file mode 100644 index b87e025dff..0000000000 Binary files a/resources/themes/cura/fonts/Roboto-BlackItalic.ttf and /dev/null differ diff --git a/resources/themes/cura/fonts/Roboto-Bold.ttf b/resources/themes/cura/fonts/Roboto-Bold.ttf deleted file mode 100644 index 072b842925..0000000000 Binary files a/resources/themes/cura/fonts/Roboto-Bold.ttf and /dev/null differ diff --git a/resources/themes/cura/fonts/Roboto-BoldItalic.ttf b/resources/themes/cura/fonts/Roboto-BoldItalic.ttf deleted file mode 100644 index 74919ff649..0000000000 Binary files a/resources/themes/cura/fonts/Roboto-BoldItalic.ttf and /dev/null differ diff --git a/resources/themes/cura/fonts/Roboto-Italic.ttf b/resources/themes/cura/fonts/Roboto-Italic.ttf deleted file mode 100644 index bd57775e44..0000000000 Binary files a/resources/themes/cura/fonts/Roboto-Italic.ttf and /dev/null differ diff --git a/resources/themes/cura/fonts/Roboto-Light.ttf b/resources/themes/cura/fonts/Roboto-Light.ttf deleted file mode 100644 index 13bf13af00..0000000000 Binary files a/resources/themes/cura/fonts/Roboto-Light.ttf and /dev/null differ diff --git a/resources/themes/cura/fonts/Roboto-LightItalic.ttf b/resources/themes/cura/fonts/Roboto-LightItalic.ttf deleted file mode 100644 index 130672a907..0000000000 Binary files a/resources/themes/cura/fonts/Roboto-LightItalic.ttf and /dev/null differ diff --git a/resources/themes/cura/fonts/Roboto-Medium.ttf b/resources/themes/cura/fonts/Roboto-Medium.ttf deleted file mode 100644 index d0f6e2b64f..0000000000 Binary files a/resources/themes/cura/fonts/Roboto-Medium.ttf and /dev/null differ diff --git a/resources/themes/cura/fonts/Roboto-MediumItalic.ttf b/resources/themes/cura/fonts/Roboto-MediumItalic.ttf deleted file mode 100644 index 6153d48b49..0000000000 Binary files a/resources/themes/cura/fonts/Roboto-MediumItalic.ttf and /dev/null differ diff --git a/resources/themes/cura/fonts/Roboto-Regular.ttf b/resources/themes/cura/fonts/Roboto-Regular.ttf deleted file mode 100644 index 0ba95c98c4..0000000000 Binary files a/resources/themes/cura/fonts/Roboto-Regular.ttf and /dev/null differ diff --git a/resources/themes/cura/fonts/Roboto-Thin.ttf b/resources/themes/cura/fonts/Roboto-Thin.ttf deleted file mode 100644 index 309c22d358..0000000000 Binary files a/resources/themes/cura/fonts/Roboto-Thin.ttf and /dev/null differ diff --git a/resources/themes/cura/fonts/Roboto-ThinItalic.ttf b/resources/themes/cura/fonts/Roboto-ThinItalic.ttf deleted file mode 100644 index 0b53ba4d38..0000000000 Binary files a/resources/themes/cura/fonts/Roboto-ThinItalic.ttf and /dev/null differ diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index e7794746f5..0810989304 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -35,54 +35,26 @@ QtObject { } } - property Component open_file_button: Component { + property Component open_file_button: Component { ButtonStyle { - background: Item { - implicitWidth: UM.Theme.sizes.button.width; - implicitHeight: UM.Theme.sizes.button.height; - + background: Item{ + implicitWidth: UM.Theme.sizes.loadfile_button.width + implicitHeight: UM.Theme.sizes.loadfile_button.height Rectangle { - anchors.bottom: parent.verticalCenter; - width: parent.width; - height: control.hovered ? parent.height / 2 + label.height : 0; - Behavior on height { NumberAnimation { duration: 100; } } - - opacity: control.hovered ? 1.0 : 0.0; - Behavior on opacity { NumberAnimation { duration: 100; } } - - Label { - id: label; - anchors.horizontalCenter: parent.horizontalCenter; - text: control.text.replace("&", ""); - font: UM.Theme.fonts.button_tooltip; - color: UM.Theme.colors.button_tooltip_text; - } - } - - UM.AngledCornerRectangle { - anchors.fill: parent; - color: { - if(control.hovered) { - return UM.Theme.colors.button_active_hover; - } else { - return UM.Theme.colors.button_active; - } - } + width: parent.width + height: parent.height + color: control.hovered ? UM.Theme.colors.load_save_button_hover : UM.Theme.colors.load_save_button Behavior on color { ColorAnimation { duration: 50; } } - cornerSize: UM.Theme.sizes.default_margin.width; + } + Label { + anchors.centerIn: parent + text: control.text + color: UM.Theme.colors.load_save_button_text + font: UM.Theme.fonts.default } } - - label: Item { - Image { - anchors.centerIn: parent; - - source: control.iconSource; - width: UM.Theme.sizes.button_icon.width; - height: UM.Theme.sizes.button_icon.height; - - sourceSize: UM.Theme.sizes.button_icon; - } + label: Label{ + visible: false } } } @@ -94,7 +66,8 @@ QtObject { implicitHeight: UM.Theme.sizes.button.height; Rectangle { - anchors.bottom: parent.verticalCenter; + id: tool_button_background + anchors.top: parent.verticalCenter; width: parent.width; height: control.hovered ? parent.height / 2 + label.height : 0; @@ -103,21 +76,16 @@ QtObject { opacity: control.hovered ? 1.0 : 0.0; Behavior on opacity { NumberAnimation { duration: 100; } } - Rectangle { - anchors.horizontalCenter: parent.horizontalCenter; - width: childrenRect.width; - height: childrenRect.height; - - Label { - id: label - text: control.text.replace("&", ""); - font: UM.Theme.fonts.button_tooltip; - color: UM.Theme.colors.button_tooltip_text; - } + Label { + id: label + anchors.bottom: parent.bottom + text: control.text + font: UM.Theme.fonts.button_tooltip; + color: UM.Theme.colors.button_tooltip_text; } } - UM.AngledCornerRectangle { + Rectangle { id: buttonFace; anchors.fill: parent; @@ -138,16 +106,16 @@ QtObject { } } Behavior on color { ColorAnimation { duration: 50; } } - cornerSize: UM.Theme.sizes.default_margin.width; Label { + id: tool_button_arrow anchors.right: parent.right; - anchors.rightMargin: UM.Theme.sizes.default_margin.width / 2; + anchors.rightMargin: (UM.Theme.sizes.button.width - UM.Theme.sizes.button_icon.width - tool_button_arrow.width) / 2 anchors.verticalCenter: parent.verticalCenter; text: "▼"; font: UM.Theme.fonts.small; visible: control.menu != null; - color: "white"; + color: UM.Theme.colors.button_text } } } @@ -165,34 +133,98 @@ QtObject { } } } + property Component tool_button_panel: Component { + ButtonStyle { + background: Item { + implicitWidth: UM.Theme.sizes.button.width; + implicitHeight: UM.Theme.sizes.button.height; + + Rectangle { + id: tool_button_background + anchors.top: parent.verticalCenter; + + width: parent.width; + height: control.hovered ? parent.height / 2 + label.height : 0; + Behavior on height { NumberAnimation { duration: 100; } } + + opacity: control.hovered ? 1.0 : 0.0; + Behavior on opacity { NumberAnimation { duration: 100; } } + + Label { + id: label + anchors.bottom: parent.bottom + text: control.text + width: UM.Theme.sizes.button.width; + wrapMode: Text.WordWrap + font: UM.Theme.fonts.button_tooltip; + color: UM.Theme.colors.button_tooltip_text; + } + } + + Rectangle { + id: buttonFace; + + anchors.fill: parent; + + property bool down: control.pressed || (control.checkable && control.checked); + + color: { + if(!control.enabled) { + return UM.Theme.colors.button_disabled; + } else if(control.checkable && control.checked && control.hovered) { + return UM.Theme.colors.button_active_hover; + } else if(control.pressed || (control.checkable && control.checked)) { + return UM.Theme.colors.button_active; + } else if(control.hovered) { + return UM.Theme.colors.button_hover; + } else { + return UM.Theme.colors.button; + } + } + Behavior on color { ColorAnimation { duration: 50; } } + } + } + + label: Item { + Image { + anchors.centerIn: parent; + + source: control.iconSource; + width: UM.Theme.sizes.button_icon.width; + height: UM.Theme.sizes.button_icon.height; + + sourceSize: UM.Theme.sizes.button_icon; + } + } + } + } property Component progressbar: Component{ ProgressBarStyle { - background: UM.AngledCornerRectangle { - cornerSize: UM.Theme.sizes.progressbar_control.height - implicitWidth: UM.Theme.sizes.progressbar.width + background:Rectangle { + implicitWidth: UM.Theme.sizes.message.width - (UM.Theme.sizes.default_margin.width * 2) implicitHeight: UM.Theme.sizes.progressbar.height + x: UM.Theme.sizes.default_margin.width color: UM.Theme.colors.progressbar_background } - progress: UM.AngledCornerRectangle { - cornerSize: UM.Theme.sizes.progressbar_control.height + progress: Rectangle { color: control.indeterminate ? "transparent" : UM.Theme.colors.progressbar_control - UM.AngledCornerRectangle { - cornerSize: UM.Theme.sizes.progressbar_control.height + Rectangle{ color: UM.Theme.colors.progressbar_control width: UM.Theme.sizes.progressbar_control.width height: UM.Theme.sizes.progressbar_control.height + x: UM.Theme.sizes.default_margin.width visible: control.indeterminate SequentialAnimation on x { id: xAnim - property int animEndPoint: UM.Theme.sizes.progressbar.width - UM.Theme.sizes.progressbar_control.width + property int animEndPoint: UM.Theme.sizes.message.width - UM.Theme.sizes.default_margin.width - UM.Theme.sizes.progressbar_control.width running: control.indeterminate loops: Animation.Infinite - NumberAnimation { from: 0; to: xAnim.animEndPoint; duration: 2000;} - NumberAnimation { from: xAnim.animEndPoint; to: 0; duration: 2000;} + NumberAnimation { from: UM.Theme.sizes.default_margin.width; to: xAnim.animEndPoint; duration: 2000;} + NumberAnimation { from: xAnim.animEndPoint; to: UM.Theme.sizes.default_margin.width; duration: 2000;} } } } diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index 5b247045b8..413a653d3c 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -3,47 +3,52 @@ "large": { "size": 1.5, "bold": true, - "family": "Roboto" + "family": "ProximaNova" }, "default": { "size": 1, - "family": "Roboto" + "family": "ProximaNova" }, "default_allcaps": { "size": 1, "capitalize": true, - "family": "Roboto" + "family": "ProximaNova" }, "small": { "size": 0.75, - "family": "Roboto" + "family": "ProximaNova" }, "tiny": { "size": 0.5, - "family": "Roboto" + "family": "ProximaNova" + }, + "caption": { + "size": 0.75, + "italic": true, + "family": "ProximaNova" }, "sidebar_header": { "size": 0.75, "capitalize": true, - "family": "Roboto" + "family": "ProximaNova" }, "sidebar_save_to": { "size": 1.0, - "family": "Roboto" + "family": "ProximaNova" }, "timeslider_time": { "size": 1.0, "bold": true, - "family": "Roboto" + "family": "ProximaNova" }, "button_tooltip": { "size": 0.75, "capitalize": true, - "family": "Roboto" + "family": "ProximaNova" }, "setting_category": { "size": 1.5, - "family": "Roboto" + "family": "ProximaNova" } }, @@ -61,14 +66,20 @@ "text_hover": [35, 35, 35, 255], "text_pressed": [12, 169, 227, 255], - "button": [160, 163, 171, 255], - "button_hover": [140, 144, 154, 255], + "button": [139, 143, 153, 255], + "button_hover": [116, 120, 127, 255], "button_active": [12, 169, 227, 255], - "button_active_hover": [34, 150, 199, 255], + "button_active_hover": [77, 184, 226, 255], + "button_lining": [208, 210, 211, 255], "button_text": [255, 255, 255, 255], "button_disabled": [245, 245, 245, 255], "button_tooltip_text": [35, 35, 35, 255], + "load_save_button": [0, 0, 0, 255], + "load_save_button_text": [255, 255, 255, 255], + "load_save_button_hover": [43, 45, 46, 255], + "load_save_button_active": [43, 45, 46, 255], + "scrollbar_background": [245, 245, 245, 255], "scrollbar_handle": [205, 202, 201, 255], "scrollbar_handle_hover": [174, 174, 174, 255], @@ -92,7 +103,7 @@ "setting_validation_warning": [255, 186, 15, 255], "setting_validation_ok": [255, 255, 255, 255], - "progressbar_background": [245, 245, 245, 255], + "progressbar_background": [208, 210, 211, 255], "progressbar_control": [12, 169, 227, 255], "slider_groove": [245, 245, 245, 255], @@ -120,8 +131,8 @@ "save_button_printtime_text": [12, 169, 227, 255], "save_button_background": [249, 249, 249, 255], - "message": [205, 202, 201, 255], - "message_text": [35, 35, 35, 255], + "message_background": [255, 255, 255, 255], + "message_text": [12, 169, 227, 255], "tool_panel_background": [255, 255, 255, 255] }, @@ -129,11 +140,15 @@ "sizes": { "window_margin": [2.0, 2.0], "default_margin": [1.0, 1.0], + "default_lining": [0.1, 0.1], "panel": [22.0, 10.0], "logo": [9.5, 2.0], "toolbar_button": [2.0, 2.0], "toolbar_spacing": [1.0, 1.0], + "loadfile_button": [11.0, 2.4], + "loadfile_margin": [0.8, 0.4], + "section": [22.0, 3.0], "section_icon": [2.14, 2.14], "section_text_margin": [0.33, 0.33], @@ -144,11 +159,14 @@ "setting_unit_margin": [0.5, 0.5], "setting_text_maxwidth": [40.0, 0.0], - "button": [4.25, 4.25], - "button_icon": [2.9, 2.9], + "standard_list_lineheight": [1.5, 1.5], + "standard_list_input": [20.0, 25.0], - "progressbar": [26.0, 0.5], - "progressbar_control": [8.0, 0.5], + "button": [3.2, 3.2], + "button_icon": [2.5, 2.5], + + "progressbar": [26.0, 0.8], + "progressbar_control": [8.0, 0.8], "progressbar_padding": [0.0, 1.0], "scrollbar": [0.5, 0.5], @@ -171,7 +189,11 @@ "save_button_label_margin": [0.5, 0.5], "save_button_save_to_button": [0.3, 2.7], + "modal_window_minimum": [30.0, 30.0], + "wizard_progress": [10.0, 0.0], + "message": [30.0, 5.0], - "message_close": [1.25, 1.25] + "message_close": [1.25, 1.25], + "message_button": [6.0, 1.8] } }