mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Merge branch 'master' into layer_view3_cleanup
This commit is contained in:
commit
78de5412a2
95 changed files with 3279 additions and 683 deletions
|
@ -2,6 +2,7 @@
|
|||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
from UM.i18n import i18nCatalog
|
||||
from UM.Scene.Platform import Platform
|
||||
from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator
|
||||
|
@ -25,9 +26,6 @@ import numpy
|
|||
import copy
|
||||
import math
|
||||
|
||||
import UM.Settings.ContainerRegistry
|
||||
|
||||
|
||||
# Setting for clearance around the prime
|
||||
PRIME_CLEARANCE = 6.5
|
||||
|
||||
|
@ -796,7 +794,7 @@ class BuildVolume(SceneNode):
|
|||
stack = self._global_container_stack
|
||||
else:
|
||||
extruder_stack_id = ExtruderManager.getInstance().extruderIds[str(extruder_index)]
|
||||
stack = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = extruder_stack_id)[0]
|
||||
stack = ContainerRegistry.getInstance().findContainerStacks(id = extruder_stack_id)[0]
|
||||
|
||||
value = stack.getProperty(setting_key, property)
|
||||
setting_type = stack.getProperty(setting_key, "type")
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
# Copyright (c) 2016 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
|
||||
from UM.Application import Application
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
from UM.Math.Polygon import Polygon
|
||||
from . import ConvexHullNode
|
||||
from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
|
||||
import UM.Settings.ContainerRegistry
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
from . import ConvexHullNode
|
||||
|
||||
import numpy
|
||||
|
||||
|
@ -308,11 +308,11 @@ class ConvexHullDecorator(SceneNodeDecorator):
|
|||
extruder_stack_id = self._node.callDecoration("getActiveExtruder")
|
||||
if not extruder_stack_id: #Decoration doesn't exist.
|
||||
extruder_stack_id = ExtruderManager.getInstance().extruderIds["0"]
|
||||
extruder_stack = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = extruder_stack_id)[0]
|
||||
extruder_stack = ContainerRegistry.getInstance().findContainerStacks(id = extruder_stack_id)[0]
|
||||
return extruder_stack.getProperty(setting_key, property)
|
||||
else: #Limit_to_extruder is set. Use that one.
|
||||
extruder_stack_id = ExtruderManager.getInstance().extruderIds[str(extruder_index)]
|
||||
stack = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = extruder_stack_id)[0]
|
||||
stack = ContainerRegistry.getInstance().findContainerStacks(id = extruder_stack_id)[0]
|
||||
return stack.getProperty(setting_key, property)
|
||||
|
||||
## Returns true if node is a descendant or the same as the root node.
|
||||
|
|
|
@ -12,6 +12,10 @@ from UM.Logger import Logger
|
|||
from UM.i18n import i18nCatalog
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
MYPY = False
|
||||
if MYPY:
|
||||
CuraDebugMode = False
|
||||
else:
|
||||
try:
|
||||
from cura.CuraVersion import CuraDebugMode
|
||||
except ImportError:
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Copyright (c) 2015 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
from PyQt5.QtNetwork import QLocalServer
|
||||
from PyQt5.QtNetwork import QLocalSocket
|
||||
|
||||
from UM.Qt.QtApplication import QtApplication
|
||||
from UM.Scene.SceneNode import SceneNode
|
||||
|
@ -26,7 +28,6 @@ from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
|
|||
from UM.Operations.RemoveSceneNodeOperation import RemoveSceneNodeOperation
|
||||
from UM.Operations.GroupedOperation import GroupedOperation
|
||||
from UM.Operations.SetTransformOperation import SetTransformOperation
|
||||
from UM.Operations.TranslateOperation import TranslateOperation
|
||||
from cura.SetParentOperation import SetParentOperation
|
||||
from cura.SliceableObjectDecorator import SliceableObjectDecorator
|
||||
from cura.BlockSlicingDecorator import BlockSlicingDecorator
|
||||
|
@ -34,6 +35,11 @@ from cura.BlockSlicingDecorator import BlockSlicingDecorator
|
|||
from UM.Settings.SettingDefinition import SettingDefinition, DefinitionPropertyType
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
from UM.Settings.SettingFunction import SettingFunction
|
||||
from cura.Settings.MachineNameValidator import MachineNameValidator
|
||||
from cura.Settings.ProfilesModel import ProfilesModel
|
||||
from cura.Settings.QualityAndUserProfilesModel import QualityAndUserProfilesModel
|
||||
from cura.Settings.SettingInheritanceManager import SettingInheritanceManager
|
||||
from cura.Settings.UserProfilesModel import UserProfilesModel
|
||||
|
||||
from . import PlatformPhysics
|
||||
from . import BuildVolume
|
||||
|
@ -45,7 +51,14 @@ from . import CuraSplashScreen
|
|||
from . import CameraImageProvider
|
||||
from . import MachineActionManager
|
||||
|
||||
import cura.Settings
|
||||
from cura.Settings.MachineManager import MachineManager
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
from cura.Settings.CuraContainerRegistry import CuraContainerRegistry
|
||||
from cura.Settings.ExtrudersModel import ExtrudersModel
|
||||
from cura.Settings.ContainerSettingsModel import ContainerSettingsModel
|
||||
from cura.Settings.MaterialSettingsVisibilityHandler import MaterialSettingsVisibilityHandler
|
||||
from cura.Settings.QualitySettingsModel import QualitySettingsModel
|
||||
from cura.Settings.ContainerManager import ContainerManager
|
||||
|
||||
from PyQt5.QtCore import QUrl, pyqtSignal, pyqtProperty, QEvent, Q_ENUMS
|
||||
from UM.FlameProfiler import pyqtSlot
|
||||
|
@ -59,10 +72,13 @@ import numpy
|
|||
import copy
|
||||
import urllib.parse
|
||||
import os
|
||||
|
||||
import argparse
|
||||
import json
|
||||
|
||||
numpy.seterr(all="ignore")
|
||||
|
||||
MYPY = False
|
||||
if not MYPY:
|
||||
try:
|
||||
from cura.CuraVersion import CuraVersion, CuraBuildType
|
||||
except ImportError:
|
||||
|
@ -83,6 +99,7 @@ class CuraApplication(QtApplication):
|
|||
Q_ENUMS(ResourceTypes)
|
||||
|
||||
def __init__(self):
|
||||
|
||||
Resources.addSearchPath(os.path.join(QtApplication.getInstallPrefix(), "share", "cura", "resources"))
|
||||
if not hasattr(sys, "frozen"):
|
||||
Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "resources"))
|
||||
|
@ -107,9 +124,9 @@ class CuraApplication(QtApplication):
|
|||
|
||||
SettingDefinition.addSettingType("extruder", None, str, Validator)
|
||||
|
||||
SettingFunction.registerOperator("extruderValues", cura.Settings.ExtruderManager.getExtruderValues)
|
||||
SettingFunction.registerOperator("extruderValue", cura.Settings.ExtruderManager.getExtruderValue)
|
||||
SettingFunction.registerOperator("resolveOrValue", cura.Settings.ExtruderManager.getResolveOrValue)
|
||||
SettingFunction.registerOperator("extruderValues", ExtruderManager.getExtruderValues)
|
||||
SettingFunction.registerOperator("extruderValue", ExtruderManager.getExtruderValue)
|
||||
SettingFunction.registerOperator("resolveOrValue", ExtruderManager.getResolveOrValue)
|
||||
|
||||
## Add the 4 types of profiles to storage.
|
||||
Resources.addStorageType(self.ResourceTypes.QualityInstanceContainer, "quality")
|
||||
|
@ -128,13 +145,14 @@ class CuraApplication(QtApplication):
|
|||
|
||||
## Initialise the version upgrade manager with Cura's storage paths.
|
||||
import UM.VersionUpgradeManager #Needs to be here to prevent circular dependencies.
|
||||
|
||||
UM.VersionUpgradeManager.VersionUpgradeManager.getInstance().setCurrentVersions(
|
||||
{
|
||||
("quality", UM.Settings.InstanceContainer.Version): (self.ResourceTypes.QualityInstanceContainer, "application/x-uranium-instancecontainer"),
|
||||
("machine_stack", UM.Settings.ContainerStack.Version): (self.ResourceTypes.MachineStack, "application/x-uranium-containerstack"),
|
||||
("extruder_train", UM.Settings.ContainerStack.Version): (self.ResourceTypes.ExtruderStack, "application/x-uranium-extruderstack"),
|
||||
("preferences", UM.Preferences.Version): (Resources.Preferences, "application/x-uranium-preferences"),
|
||||
("user", UM.Settings.InstanceContainer.Version): (self.ResourceTypes.UserInstanceContainer, "application/x-uranium-instancecontainer")
|
||||
("quality", UM.Settings.InstanceContainer.InstanceContainer.Version): (self.ResourceTypes.QualityInstanceContainer, "application/x-uranium-instancecontainer"),
|
||||
("machine_stack", UM.Settings.ContainerStack.ContainerStack.Version): (self.ResourceTypes.MachineStack, "application/x-uranium-containerstack"),
|
||||
("extruder_train", UM.Settings.ContainerStack.ContainerStack.Version): (self.ResourceTypes.ExtruderStack, "application/x-uranium-extruderstack"),
|
||||
("preferences", Preferences.Version): (Resources.Preferences, "application/x-uranium-preferences"),
|
||||
("user", UM.Settings.InstanceContainer.InstanceContainer.Version): (self.ResourceTypes.UserInstanceContainer, "application/x-uranium-instancecontainer")
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -401,7 +419,11 @@ class CuraApplication(QtApplication):
|
|||
|
||||
@pyqtSlot(str, str)
|
||||
def setDefaultPath(self, key, default_path):
|
||||
Preferences.getInstance().setValue("local_file/%s" % key, default_path)
|
||||
Preferences.getInstance().setValue("local_file/%s" % key, QUrl(default_path).toLocalFile())
|
||||
|
||||
@classmethod
|
||||
def getStaticVersion(cls):
|
||||
return CuraVersion
|
||||
|
||||
## Handle loading of all plugin types (and the backend explicitly)
|
||||
# \sa PluginRegistery
|
||||
|
@ -421,13 +443,107 @@ class CuraApplication(QtApplication):
|
|||
|
||||
self._plugins_loaded = True
|
||||
|
||||
@classmethod
|
||||
def addCommandLineOptions(self, parser):
|
||||
super().addCommandLineOptions(parser)
|
||||
parser.add_argument("file", nargs="*", help="Files to load after starting the application.")
|
||||
parser.add_argument("--single-instance", action="store_true", default=False)
|
||||
|
||||
# Set up a local socket server which listener which coordinates single instances Curas and accepts commands.
|
||||
def _setUpSingleInstanceServer(self):
|
||||
if self.getCommandLineOption("single_instance", False):
|
||||
self.__single_instance_server = QLocalServer()
|
||||
self.__single_instance_server.newConnection.connect(self._singleInstanceServerNewConnection)
|
||||
self.__single_instance_server.listen("ultimaker-cura")
|
||||
|
||||
def _singleInstanceServerNewConnection(self):
|
||||
Logger.log("i", "New connection recevied on our single-instance server")
|
||||
remote_cura_connection = self.__single_instance_server.nextPendingConnection()
|
||||
|
||||
if remote_cura_connection is not None:
|
||||
def readCommands():
|
||||
line = remote_cura_connection.readLine()
|
||||
while len(line) != 0: # There is also a .canReadLine()
|
||||
try:
|
||||
payload = json.loads(str(line, encoding="ASCII").strip())
|
||||
command = payload["command"]
|
||||
|
||||
# Command: Remove all models from the build plate.
|
||||
if command == "clear-all":
|
||||
self.deleteAll()
|
||||
|
||||
# Command: Load a model file
|
||||
elif command == "open":
|
||||
self._openFile(payload["filePath"])
|
||||
# WARNING ^ this method is async and we really should wait until
|
||||
# the file load is complete before processing more commands.
|
||||
|
||||
# Command: Activate the window and bring it to the top.
|
||||
elif command == "focus":
|
||||
# Operating systems these days prevent windows from moving around by themselves.
|
||||
# 'alert' or flashing the icon in the taskbar is the best thing we do now.
|
||||
self.getMainWindow().alert(0)
|
||||
|
||||
# Command: Close the socket connection. We're done.
|
||||
elif command == "close-connection":
|
||||
remote_cura_connection.close()
|
||||
|
||||
else:
|
||||
Logger.log("w", "Received an unrecognized command " + str(command))
|
||||
except json.decoder.JSONDecodeError as ex:
|
||||
Logger.log("w", "Unable to parse JSON command in _singleInstanceServerNewConnection(): " + repr(ex))
|
||||
line = remote_cura_connection.readLine()
|
||||
|
||||
remote_cura_connection.readyRead.connect(readCommands)
|
||||
|
||||
## Perform any checks before creating the main application.
|
||||
#
|
||||
# This should be called directly before creating an instance of CuraApplication.
|
||||
# \returns \type{bool} True if the whole Cura app should continue running.
|
||||
@classmethod
|
||||
def preStartUp(cls):
|
||||
# Peek the arguments and look for the 'single-instance' flag.
|
||||
parser = argparse.ArgumentParser(prog="cura") # pylint: disable=bad-whitespace
|
||||
CuraApplication.addCommandLineOptions(parser)
|
||||
parsed_command_line = vars(parser.parse_args())
|
||||
|
||||
if "single_instance" in parsed_command_line and parsed_command_line["single_instance"]:
|
||||
Logger.log("i", "Checking for the presence of an ready running Cura instance.")
|
||||
single_instance_socket = QLocalSocket()
|
||||
Logger.log("d", "preStartUp(): full server name: " + single_instance_socket.fullServerName())
|
||||
single_instance_socket.connectToServer("ultimaker-cura")
|
||||
single_instance_socket.waitForConnected()
|
||||
if single_instance_socket.state() == QLocalSocket.ConnectedState:
|
||||
Logger.log("i", "Connection has been made to the single-instance Cura socket.")
|
||||
|
||||
# Protocol is one line of JSON terminated with a carriage return.
|
||||
# "command" field is required and holds the name of the command to execute.
|
||||
# Other fields depend on the command.
|
||||
|
||||
payload = {"command": "clear-all"}
|
||||
single_instance_socket.write(bytes(json.dumps(payload) + "\n", encoding="ASCII"))
|
||||
|
||||
payload = {"command": "focus"}
|
||||
single_instance_socket.write(bytes(json.dumps(payload) + "\n", encoding="ASCII"))
|
||||
|
||||
if len(parsed_command_line["file"]) != 0:
|
||||
for filename in parsed_command_line["file"]:
|
||||
payload = {"command": "open", "filePath": filename}
|
||||
single_instance_socket.write(bytes(json.dumps(payload) + "\n", encoding="ASCII"))
|
||||
|
||||
payload = {"command": "close-connection"}
|
||||
single_instance_socket.write(bytes(json.dumps(payload) + "\n", encoding="ASCII"))
|
||||
|
||||
single_instance_socket.flush()
|
||||
single_instance_socket.waitForDisconnected()
|
||||
return False
|
||||
return True
|
||||
|
||||
def run(self):
|
||||
self.showSplashMessage(self._i18n_catalog.i18nc("@info:progress", "Setting up scene..."))
|
||||
|
||||
self._setUpSingleInstanceServer()
|
||||
|
||||
controller = self.getController()
|
||||
|
||||
controller.setActiveView("SolidView")
|
||||
|
@ -464,9 +580,11 @@ class CuraApplication(QtApplication):
|
|||
self.showSplashMessage(self._i18n_catalog.i18nc("@info:progress", "Loading interface..."))
|
||||
|
||||
# Initialise extruder so as to listen to global container stack changes before the first global container stack is set.
|
||||
cura.Settings.ExtruderManager.getInstance()
|
||||
qmlRegisterSingletonType(cura.Settings.MachineManager, "Cura", 1, 0, "MachineManager", self.getMachineManager)
|
||||
qmlRegisterSingletonType(cura.Settings.SettingInheritanceManager, "Cura", 1, 0, "SettingInheritanceManager", self.getSettingInheritanceManager)
|
||||
ExtruderManager.getInstance()
|
||||
qmlRegisterSingletonType(MachineManager, "Cura", 1, 0, "MachineManager", self.getMachineManager)
|
||||
qmlRegisterSingletonType(SettingInheritanceManager, "Cura", 1, 0, "SettingInheritanceManager",
|
||||
self.getSettingInheritanceManager)
|
||||
|
||||
qmlRegisterSingletonType(MachineActionManager.MachineActionManager, "Cura", 1, 0, "MachineActionManager", self.getMachineActionManager)
|
||||
self.setMainQml(Resources.getPath(self.ResourceTypes.QmlFiles, "Cura.qml"))
|
||||
self._qml_import_paths.append(Resources.getPath(self.ResourceTypes.QmlFiles))
|
||||
|
@ -486,12 +604,12 @@ class CuraApplication(QtApplication):
|
|||
|
||||
def getMachineManager(self, *args):
|
||||
if self._machine_manager is None:
|
||||
self._machine_manager = cura.Settings.MachineManager.createMachineManager()
|
||||
self._machine_manager = MachineManager.createMachineManager()
|
||||
return self._machine_manager
|
||||
|
||||
def getSettingInheritanceManager(self, *args):
|
||||
if self._setting_inheritance_manager is None:
|
||||
self._setting_inheritance_manager = cura.Settings.SettingInheritanceManager.createSettingInheritanceManager()
|
||||
self._setting_inheritance_manager = SettingInheritanceManager.createSettingInheritanceManager()
|
||||
return self._setting_inheritance_manager
|
||||
|
||||
## Get the machine action manager
|
||||
|
@ -527,23 +645,23 @@ class CuraApplication(QtApplication):
|
|||
|
||||
qmlRegisterUncreatableType(CuraApplication, "Cura", 1, 0, "ResourceTypes", "Just an Enum type")
|
||||
|
||||
qmlRegisterType(cura.Settings.ExtrudersModel, "Cura", 1, 0, "ExtrudersModel")
|
||||
qmlRegisterType(ExtrudersModel, "Cura", 1, 0, "ExtrudersModel")
|
||||
|
||||
qmlRegisterType(cura.Settings.ContainerSettingsModel, "Cura", 1, 0, "ContainerSettingsModel")
|
||||
qmlRegisterSingletonType(cura.Settings.ProfilesModel, "Cura", 1, 0, "ProfilesModel", cura.Settings.ProfilesModel.createProfilesModel)
|
||||
qmlRegisterType(cura.Settings.QualityAndUserProfilesModel, "Cura", 1, 0, "QualityAndUserProfilesModel")
|
||||
qmlRegisterType(cura.Settings.UserProfilesModel, "Cura", 1, 0, "UserProfilesModel")
|
||||
qmlRegisterType(cura.Settings.MaterialSettingsVisibilityHandler, "Cura", 1, 0, "MaterialSettingsVisibilityHandler")
|
||||
qmlRegisterType(cura.Settings.QualitySettingsModel, "Cura", 1, 0, "QualitySettingsModel")
|
||||
qmlRegisterType(cura.Settings.MachineNameValidator, "Cura", 1, 0, "MachineNameValidator")
|
||||
qmlRegisterType(ContainerSettingsModel, "Cura", 1, 0, "ContainerSettingsModel")
|
||||
qmlRegisterSingletonType(ProfilesModel, "Cura", 1, 0, "ProfilesModel", ProfilesModel.createProfilesModel)
|
||||
qmlRegisterType(QualityAndUserProfilesModel, "Cura", 1, 0, "QualityAndUserProfilesModel")
|
||||
qmlRegisterType(UserProfilesModel, "Cura", 1, 0, "UserProfilesModel")
|
||||
qmlRegisterType(MaterialSettingsVisibilityHandler, "Cura", 1, 0, "MaterialSettingsVisibilityHandler")
|
||||
qmlRegisterType(QualitySettingsModel, "Cura", 1, 0, "QualitySettingsModel")
|
||||
qmlRegisterType(MachineNameValidator, "Cura", 1, 0, "MachineNameValidator")
|
||||
|
||||
qmlRegisterSingletonType(cura.Settings.ContainerManager, "Cura", 1, 0, "ContainerManager", cura.Settings.ContainerManager.createContainerManager)
|
||||
qmlRegisterSingletonType(ContainerManager, "Cura", 1, 0, "ContainerManager", ContainerManager.createContainerManager)
|
||||
|
||||
# As of Qt5.7, it is necessary to get rid of any ".." in the path for the singleton to work.
|
||||
actions_url = QUrl.fromLocalFile(os.path.abspath(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, "Actions.qml")))
|
||||
qmlRegisterSingletonType(actions_url, "Cura", 1, 0, "Actions")
|
||||
|
||||
engine.rootContext().setContextProperty("ExtruderManager", cura.Settings.ExtruderManager.getInstance())
|
||||
engine.rootContext().setContextProperty("ExtruderManager", ExtruderManager.getInstance())
|
||||
|
||||
for path in Resources.getAllResourcesOfType(CuraApplication.ResourceTypes.QmlFiles):
|
||||
type_name = os.path.splitext(os.path.basename(path))[0]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from UM.Math.Color import Color
|
||||
from UM.Application import Application
|
||||
|
||||
from typing import Any
|
||||
import numpy
|
||||
|
||||
|
||||
|
@ -198,7 +198,7 @@ class LayerPolygon:
|
|||
|
||||
return normals
|
||||
|
||||
__color_map = None
|
||||
__color_map = None # type: numpy.ndarray[Any]
|
||||
|
||||
## Gets the instance of the VersionUpgradeManager, or creates one.
|
||||
@classmethod
|
||||
|
|
|
@ -7,9 +7,9 @@ from UM.FlameProfiler import pyqtSlot
|
|||
from UM.Application import Application
|
||||
from UM.Qt.Duration import Duration
|
||||
from UM.Preferences import Preferences
|
||||
from UM.Settings import ContainerRegistry
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
|
||||
import cura.Settings.ExtruderManager
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
||||
import math
|
||||
import os.path
|
||||
|
@ -124,7 +124,7 @@ class PrintInformation(QObject):
|
|||
|
||||
material_preference_values = json.loads(Preferences.getInstance().getValue("cura/material_settings"))
|
||||
|
||||
extruder_stacks = list(cura.Settings.ExtruderManager.getInstance().getMachineExtruders(Application.getInstance().getGlobalContainerStack().getId()))
|
||||
extruder_stacks = list(ExtruderManager.getInstance().getMachineExtruders(Application.getInstance().getGlobalContainerStack().getId()))
|
||||
for index, amount in enumerate(self._material_amounts):
|
||||
## Find the right extruder stack. As the list isn't sorted because it's a annoying generator, we do some
|
||||
# list comprehension filtering to solve this for us.
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
# Copyright (c) 2017 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
from UM.OutputDevice.OutputDevice import OutputDevice
|
||||
from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject
|
||||
from PyQt5.QtWidgets import QMessageBox
|
||||
import UM.Settings.ContainerRegistry
|
||||
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
|
||||
from enum import IntEnum # For the connection state tracking.
|
||||
from UM.Logger import Logger
|
||||
from UM.Application import Application
|
||||
from UM.Signal import signalemitter
|
||||
|
||||
i18n_catalog = i18nCatalog("cura")
|
||||
|
@ -25,7 +28,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||
def __init__(self, device_id, parent = None):
|
||||
super().__init__(device_id = device_id, parent = parent)
|
||||
|
||||
self._container_registry = UM.Settings.ContainerRegistry.getInstance()
|
||||
self._container_registry = ContainerRegistry.getInstance()
|
||||
self._target_bed_temperature = 0
|
||||
self._bed_temperature = 0
|
||||
self._num_extruders = 1
|
||||
|
@ -45,6 +48,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||
self._job_name = ""
|
||||
self._error_text = ""
|
||||
self._accepts_commands = True
|
||||
self._preheat_bed_timeout = 900 #Default time-out for pre-heating the bed, in seconds.
|
||||
|
||||
self._printer_state = ""
|
||||
self._printer_type = "unknown"
|
||||
|
@ -161,6 +165,17 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||
self._job_name = name
|
||||
self.jobNameChanged.emit()
|
||||
|
||||
## Gives a human-readable address where the device can be found.
|
||||
@pyqtProperty(str, constant = True)
|
||||
def address(self):
|
||||
Logger.log("w", "address is not implemented by this output device.")
|
||||
|
||||
## A human-readable name for the device.
|
||||
@pyqtProperty(str, constant = True)
|
||||
def name(self):
|
||||
Logger.log("w", "name is not implemented by this output device.")
|
||||
return ""
|
||||
|
||||
@pyqtProperty(str, notify = errorTextChanged)
|
||||
def errorText(self):
|
||||
return self._error_text
|
||||
|
@ -199,6 +214,13 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||
self._target_bed_temperature = temperature
|
||||
self.targetBedTemperatureChanged.emit()
|
||||
|
||||
## The duration of the time-out to pre-heat the bed, in seconds.
|
||||
#
|
||||
# \return The duration of the time-out to pre-heat the bed, in seconds.
|
||||
@pyqtProperty(int)
|
||||
def preheatBedTimeout(self):
|
||||
return self._preheat_bed_timeout
|
||||
|
||||
## Time the print has been printing.
|
||||
# Note that timeTotal - timeElapsed should give time remaining.
|
||||
@pyqtProperty(float, notify = timeElapsedChanged)
|
||||
|
@ -254,6 +276,22 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||
def _setTargetBedTemperature(self, temperature):
|
||||
Logger.log("w", "_setTargetBedTemperature is not implemented by this output device")
|
||||
|
||||
## Pre-heats the heated bed of the printer.
|
||||
#
|
||||
# \param temperature The temperature to heat the bed to, in degrees
|
||||
# Celsius.
|
||||
# \param duration How long the bed should stay warm, in seconds.
|
||||
@pyqtSlot(float, float)
|
||||
def preheatBed(self, temperature, duration):
|
||||
Logger.log("w", "preheatBed is not implemented by this output device.")
|
||||
|
||||
## Cancels pre-heating the heated bed of the printer.
|
||||
#
|
||||
# If the bed is not pre-heated, nothing happens.
|
||||
@pyqtSlot()
|
||||
def cancelPreheatBed(self):
|
||||
Logger.log("w", "cancelPreheatBed is not implemented by this output device.")
|
||||
|
||||
## Protected setter for the current bed temperature.
|
||||
# This simply sets the bed temperature, but ensures that a signal is emitted.
|
||||
# /param temperature temperature of the bed.
|
||||
|
@ -323,6 +361,28 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||
result.append(i18n_catalog.i18nc("@item:material", "Unknown material"))
|
||||
return result
|
||||
|
||||
## List of the colours of the currently loaded materials.
|
||||
#
|
||||
# The list is in order of extruders. If there is no material in an
|
||||
# extruder, the colour is shown as transparent.
|
||||
#
|
||||
# The colours are returned in hex-format AARRGGBB or RRGGBB
|
||||
# (e.g. #800000ff for transparent blue or #00ff00 for pure green).
|
||||
@pyqtProperty("QVariantList", notify = materialIdChanged)
|
||||
def materialColors(self):
|
||||
result = []
|
||||
for material_id in self._material_ids:
|
||||
if material_id is None:
|
||||
result.append("#00000000") #No material.
|
||||
continue
|
||||
|
||||
containers = self._container_registry.findInstanceContainers(type = "material", GUID = material_id)
|
||||
if containers:
|
||||
result.append(containers[0].getMetaDataEntry("color_code"))
|
||||
else:
|
||||
result.append("#00000000") #Unknown material.
|
||||
return result
|
||||
|
||||
## Protected setter for the current material id.
|
||||
# /param index Index of the extruder
|
||||
# /param material_id id of the material
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
# Copyright (c) 2016 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import UM.Application
|
||||
import cura.Settings.ExtruderManager
|
||||
import UM.Settings.ContainerRegistry
|
||||
|
||||
# This collects a lot of quality and quality changes related code which was split between ContainerManager
|
||||
# and the MachineManager and really needs to usable from both.
|
||||
from typing import List
|
||||
|
||||
from UM.Application import Application
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
from UM.Settings.DefinitionContainer import DefinitionContainer
|
||||
from UM.Settings.InstanceContainer import InstanceContainer
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
||||
|
||||
class QualityManager:
|
||||
|
||||
|
@ -18,7 +22,7 @@ class QualityManager:
|
|||
QualityManager.__instance = cls()
|
||||
return QualityManager.__instance
|
||||
|
||||
__instance = None
|
||||
__instance = None # type: "QualityManager"
|
||||
|
||||
## Find a quality by name for a specific machine definition and materials.
|
||||
#
|
||||
|
@ -121,14 +125,14 @@ class QualityManager:
|
|||
#
|
||||
# \param machine_definition \type{DefinitionContainer} the machine definition.
|
||||
# \return \type{List[InstanceContainer]} the list of quality changes
|
||||
def findAllQualityChangesForMachine(self, machine_definition):
|
||||
def findAllQualityChangesForMachine(self, machine_definition: DefinitionContainer) -> List[InstanceContainer]:
|
||||
if machine_definition.getMetaDataEntry("has_machine_quality"):
|
||||
definition_id = machine_definition.getId()
|
||||
else:
|
||||
definition_id = "fdmprinter"
|
||||
|
||||
filter_dict = { "type": "quality_changes", "extruder": None, "definition": definition_id }
|
||||
quality_changes_list = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(**filter_dict)
|
||||
quality_changes_list = ContainerRegistry.getInstance().findInstanceContainers(**filter_dict)
|
||||
return quality_changes_list
|
||||
|
||||
## Find all usable qualities for a machine and extruders.
|
||||
|
@ -177,7 +181,7 @@ class QualityManager:
|
|||
if base_material:
|
||||
# There is a basic material specified
|
||||
criteria = { "type": "material", "name": base_material, "definition": definition_id }
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(**criteria)
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(**criteria)
|
||||
containers = [basic_material for basic_material in containers if
|
||||
basic_material.getMetaDataEntry("variant") == material_container.getMetaDataEntry(
|
||||
"variant")]
|
||||
|
@ -191,13 +195,13 @@ class QualityManager:
|
|||
def _getFilteredContainersForStack(self, machine_definition=None, material_containers=None, **kwargs):
|
||||
# Fill in any default values.
|
||||
if machine_definition is None:
|
||||
machine_definition = UM.Application.getInstance().getGlobalContainerStack().getBottom()
|
||||
machine_definition = Application.getInstance().getGlobalContainerStack().getBottom()
|
||||
quality_definition_id = machine_definition.getMetaDataEntry("quality_definition")
|
||||
if quality_definition_id is not None:
|
||||
machine_definition = UM.Settings.ContainerRegistry.getInstance().findDefinitionContainers(id=quality_definition_id)[0]
|
||||
machine_definition = ContainerRegistry.getInstance().findDefinitionContainers(id=quality_definition_id)[0]
|
||||
|
||||
if material_containers is None:
|
||||
active_stacks = cura.Settings.ExtruderManager.getInstance().getActiveGlobalAndExtruderStacks()
|
||||
active_stacks = ExtruderManager.getInstance().getActiveGlobalAndExtruderStacks()
|
||||
material_containers = [stack.findContainer(type="material") for stack in active_stacks]
|
||||
|
||||
criteria = kwargs
|
||||
|
@ -225,7 +229,7 @@ class QualityManager:
|
|||
material_ids.add(basic_material.getId())
|
||||
material_ids.add(material_instance.getId())
|
||||
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(**criteria)
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(**criteria)
|
||||
|
||||
result = []
|
||||
for container in containers:
|
||||
|
@ -241,8 +245,8 @@ class QualityManager:
|
|||
# an extruder definition.
|
||||
# \return \type{DefinitionContainer} the parent machine definition. If the given machine
|
||||
# definition doesn't have a parent then it is simply returned.
|
||||
def getParentMachineDefinition(self, machine_definition):
|
||||
container_registry = UM.Settings.ContainerRegistry.getInstance()
|
||||
def getParentMachineDefinition(self, machine_definition: DefinitionContainer) -> DefinitionContainer:
|
||||
container_registry = ContainerRegistry.getInstance()
|
||||
|
||||
machine_entry = machine_definition.getMetaDataEntry("machine")
|
||||
if machine_entry is None:
|
||||
|
@ -277,6 +281,6 @@ class QualityManager:
|
|||
# This already is a 'global' machine definition.
|
||||
return machine_definition
|
||||
else:
|
||||
container_registry = UM.Settings.ContainerRegistry.getInstance()
|
||||
container_registry = ContainerRegistry.getInstance()
|
||||
whole_machine = container_registry.findDefinitionContainers(id=machine_entry)[0]
|
||||
return whole_machine
|
||||
|
|
|
@ -8,19 +8,25 @@ from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal, QUrl, QVariant
|
|||
from UM.FlameProfiler import pyqtSlot
|
||||
from PyQt5.QtWidgets import QMessageBox
|
||||
|
||||
import UM.PluginRegistry
|
||||
import UM.Settings
|
||||
from UM.PluginRegistry import PluginRegistry
|
||||
import UM.SaveFile
|
||||
import UM.Platform
|
||||
import UM.MimeTypeDatabase
|
||||
import UM.Logger
|
||||
|
||||
import cura.Settings
|
||||
from UM.Logger import Logger
|
||||
from UM.Application import Application
|
||||
from UM.Settings.ContainerStack import ContainerStack
|
||||
from UM.Settings.DefinitionContainer import DefinitionContainer
|
||||
from UM.Settings.InstanceContainer import InstanceContainer
|
||||
from cura.QualityManager import QualityManager
|
||||
|
||||
from UM.MimeTypeDatabase import MimeTypeNotFoundError
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
## Manager class that contains common actions to deal with containers in Cura.
|
||||
|
@ -32,9 +38,8 @@ class ContainerManager(QObject):
|
|||
def __init__(self, parent = None):
|
||||
super().__init__(parent)
|
||||
|
||||
self._container_registry = UM.Settings.ContainerRegistry.getInstance()
|
||||
self._machine_manager = UM.Application.getInstance().getMachineManager()
|
||||
|
||||
self._container_registry = ContainerRegistry.getInstance()
|
||||
self._machine_manager = Application.getInstance().getMachineManager()
|
||||
self._container_name_filters = {}
|
||||
|
||||
## Create a duplicate of the specified container
|
||||
|
@ -49,7 +54,7 @@ class ContainerManager(QObject):
|
|||
def duplicateContainer(self, container_id):
|
||||
containers = self._container_registry.findContainers(None, id = container_id)
|
||||
if not containers:
|
||||
UM.Logger.log("w", "Could duplicate container %s because it was not found.", container_id)
|
||||
Logger.log("w", "Could duplicate container %s because it was not found.", container_id)
|
||||
return ""
|
||||
|
||||
container = containers[0]
|
||||
|
@ -81,7 +86,7 @@ class ContainerManager(QObject):
|
|||
def renameContainer(self, container_id, new_id, new_name):
|
||||
containers = self._container_registry.findContainers(None, id = container_id)
|
||||
if not containers:
|
||||
UM.Logger.log("w", "Could rename container %s because it was not found.", container_id)
|
||||
Logger.log("w", "Could rename container %s because it was not found.", container_id)
|
||||
return False
|
||||
|
||||
container = containers[0]
|
||||
|
@ -109,7 +114,7 @@ class ContainerManager(QObject):
|
|||
def removeContainer(self, container_id):
|
||||
containers = self._container_registry.findContainers(None, id = container_id)
|
||||
if not containers:
|
||||
UM.Logger.log("w", "Could remove container %s because it was not found.", container_id)
|
||||
Logger.log("w", "Could remove container %s because it was not found.", container_id)
|
||||
return False
|
||||
|
||||
self._container_registry.removeContainer(containers[0].getId())
|
||||
|
@ -129,20 +134,20 @@ class ContainerManager(QObject):
|
|||
def mergeContainers(self, merge_into_id, merge_id):
|
||||
containers = self._container_registry.findContainers(None, id = merge_into_id)
|
||||
if not containers:
|
||||
UM.Logger.log("w", "Could merge into container %s because it was not found.", merge_into_id)
|
||||
Logger.log("w", "Could merge into container %s because it was not found.", merge_into_id)
|
||||
return False
|
||||
|
||||
merge_into = containers[0]
|
||||
|
||||
containers = self._container_registry.findContainers(None, id = merge_id)
|
||||
if not containers:
|
||||
UM.Logger.log("w", "Could not merge container %s because it was not found", merge_id)
|
||||
Logger.log("w", "Could not merge container %s because it was not found", merge_id)
|
||||
return False
|
||||
|
||||
merge = containers[0]
|
||||
|
||||
if not isinstance(merge, type(merge_into)):
|
||||
UM.Logger.log("w", "Cannot merge two containers of different types")
|
||||
Logger.log("w", "Cannot merge two containers of different types")
|
||||
return False
|
||||
|
||||
self._performMerge(merge_into, merge)
|
||||
|
@ -158,11 +163,11 @@ class ContainerManager(QObject):
|
|||
def clearContainer(self, container_id):
|
||||
containers = self._container_registry.findContainers(None, id = container_id)
|
||||
if not containers:
|
||||
UM.Logger.log("w", "Could clear container %s because it was not found.", container_id)
|
||||
Logger.log("w", "Could clear container %s because it was not found.", container_id)
|
||||
return False
|
||||
|
||||
if containers[0].isReadOnly():
|
||||
UM.Logger.log("w", "Cannot clear read-only container %s", container_id)
|
||||
Logger.log("w", "Cannot clear read-only container %s", container_id)
|
||||
return False
|
||||
|
||||
containers[0].clear()
|
||||
|
@ -173,7 +178,7 @@ class ContainerManager(QObject):
|
|||
def getContainerMetaDataEntry(self, container_id, entry_name):
|
||||
containers = self._container_registry.findContainers(None, id=container_id)
|
||||
if not containers:
|
||||
UM.Logger.log("w", "Could not get metadata of container %s because it was not found.", container_id)
|
||||
Logger.log("w", "Could not get metadata of container %s because it was not found.", container_id)
|
||||
return ""
|
||||
|
||||
result = containers[0].getMetaDataEntry(entry_name)
|
||||
|
@ -198,13 +203,13 @@ class ContainerManager(QObject):
|
|||
def setContainerMetaDataEntry(self, container_id, entry_name, entry_value):
|
||||
containers = self._container_registry.findContainers(None, id = container_id)
|
||||
if not containers:
|
||||
UM.Logger.log("w", "Could not set metadata of container %s because it was not found.", container_id)
|
||||
Logger.log("w", "Could not set metadata of container %s because it was not found.", container_id)
|
||||
return False
|
||||
|
||||
container = containers[0]
|
||||
|
||||
if container.isReadOnly():
|
||||
UM.Logger.log("w", "Cannot set metadata of read-only container %s.", container_id)
|
||||
Logger.log("w", "Cannot set metadata of read-only container %s.", container_id)
|
||||
return False
|
||||
|
||||
entries = entry_name.split("/")
|
||||
|
@ -232,13 +237,13 @@ class ContainerManager(QObject):
|
|||
def setContainerName(self, container_id, new_name):
|
||||
containers = self._container_registry.findContainers(None, id = container_id)
|
||||
if not containers:
|
||||
UM.Logger.log("w", "Could not set name of container %s because it was not found.", container_id)
|
||||
Logger.log("w", "Could not set name of container %s because it was not found.", container_id)
|
||||
return False
|
||||
|
||||
container = containers[0]
|
||||
|
||||
if container.isReadOnly():
|
||||
UM.Logger.log("w", "Cannot set name of read-only container %s.", container_id)
|
||||
Logger.log("w", "Cannot set name of read-only container %s.", container_id)
|
||||
return False
|
||||
|
||||
container.setName(new_name)
|
||||
|
@ -262,11 +267,11 @@ class ContainerManager(QObject):
|
|||
|
||||
@pyqtSlot(str, result = bool)
|
||||
def isContainerUsed(self, container_id):
|
||||
UM.Logger.log("d", "Checking if container %s is currently used", container_id)
|
||||
Logger.log("d", "Checking if container %s is currently used", container_id)
|
||||
containers = self._container_registry.findContainerStacks()
|
||||
for stack in containers:
|
||||
if container_id in [child.getId() for child in stack.getContainers()]:
|
||||
UM.Logger.log("d", "The container is in use by %s", stack.getId())
|
||||
Logger.log("d", "The container is in use by %s", stack.getId())
|
||||
return True
|
||||
return False
|
||||
|
||||
|
@ -382,7 +387,7 @@ class ContainerManager(QObject):
|
|||
except MimeTypeNotFoundError:
|
||||
return { "status": "error", "message": "Could not determine mime type of file" }
|
||||
|
||||
container_type = UM.Settings.ContainerRegistry.getContainerForMimeType(mime_type)
|
||||
container_type = self._container_registry.getContainerForMimeType(mime_type)
|
||||
if not container_type:
|
||||
return { "status": "error", "message": "Could not find a container to handle the specified file."}
|
||||
|
||||
|
@ -411,17 +416,17 @@ class ContainerManager(QObject):
|
|||
# \return \type{bool} True if successful, False if not.
|
||||
@pyqtSlot(result = bool)
|
||||
def updateQualityChanges(self):
|
||||
global_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if not global_stack:
|
||||
return False
|
||||
|
||||
self._machine_manager.blurSettings.emit()
|
||||
|
||||
for stack in cura.Settings.ExtruderManager.getInstance().getActiveGlobalAndExtruderStacks():
|
||||
for stack in ExtruderManager.getInstance().getActiveGlobalAndExtruderStacks():
|
||||
# Find the quality_changes container for this stack and merge the contents of the top container into it.
|
||||
quality_changes = stack.findContainer(type = "quality_changes")
|
||||
if not quality_changes or quality_changes.isReadOnly():
|
||||
UM.Logger.log("e", "Could not update quality of a nonexistant or read only quality profile in stack %s", stack.getId())
|
||||
Logger.log("e", "Could not update quality of a nonexistant or read only quality profile in stack %s", stack.getId())
|
||||
continue
|
||||
|
||||
self._performMerge(quality_changes, stack.getTop())
|
||||
|
@ -438,7 +443,7 @@ class ContainerManager(QObject):
|
|||
send_emits_containers = []
|
||||
|
||||
# Go through global and extruder stacks and clear their topmost container (the user settings).
|
||||
for stack in cura.Settings.ExtruderManager.getInstance().getActiveGlobalAndExtruderStacks():
|
||||
for stack in ExtruderManager.getInstance().getActiveGlobalAndExtruderStacks():
|
||||
container = stack.getTop()
|
||||
container.clear()
|
||||
send_emits_containers.append(container)
|
||||
|
@ -455,13 +460,13 @@ class ContainerManager(QObject):
|
|||
# \return \type{bool} True if the operation was successfully, False if not.
|
||||
@pyqtSlot(str, result = bool)
|
||||
def createQualityChanges(self, base_name):
|
||||
global_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if not global_stack:
|
||||
return False
|
||||
|
||||
active_quality_name = self._machine_manager.activeQualityName
|
||||
if active_quality_name == "":
|
||||
UM.Logger.log("w", "No quality container found in stack %s, cannot create profile", global_stack.getId())
|
||||
Logger.log("w", "No quality container found in stack %s, cannot create profile", global_stack.getId())
|
||||
return False
|
||||
|
||||
self._machine_manager.blurSettings.emit()
|
||||
|
@ -470,17 +475,17 @@ class ContainerManager(QObject):
|
|||
unique_name = self._container_registry.uniqueName(base_name)
|
||||
|
||||
# Go through the active stacks and create quality_changes containers from the user containers.
|
||||
for stack in cura.Settings.ExtruderManager.getInstance().getActiveGlobalAndExtruderStacks():
|
||||
for stack in ExtruderManager.getInstance().getActiveGlobalAndExtruderStacks():
|
||||
user_container = stack.getTop()
|
||||
quality_container = stack.findContainer(type = "quality")
|
||||
quality_changes_container = stack.findContainer(type = "quality_changes")
|
||||
if not quality_container or not quality_changes_container:
|
||||
UM.Logger.log("w", "No quality or quality changes container found in stack %s, ignoring it", stack.getId())
|
||||
Logger.log("w", "No quality or quality changes container found in stack %s, ignoring it", stack.getId())
|
||||
continue
|
||||
|
||||
extruder_id = None if stack is global_stack else QualityManager.getInstance().getParentMachineDefinition(stack.getBottom()).getId()
|
||||
new_changes = self._createQualityChanges(quality_container, unique_name,
|
||||
UM.Application.getInstance().getGlobalContainerStack().getBottom(),
|
||||
Application.getInstance().getGlobalContainerStack().getBottom(),
|
||||
extruder_id)
|
||||
self._performMerge(new_changes, quality_changes_container, clear_settings = False)
|
||||
self._performMerge(new_changes, user_container)
|
||||
|
@ -502,7 +507,7 @@ class ContainerManager(QObject):
|
|||
# \return \type{bool} True if successful, False if not.
|
||||
@pyqtSlot(str, result = bool)
|
||||
def removeQualityChanges(self, quality_name):
|
||||
UM.Logger.log("d", "Attempting to remove the quality change containers with name %s", quality_name)
|
||||
Logger.log("d", "Attempting to remove the quality change containers with name %s", quality_name)
|
||||
containers_found = False
|
||||
|
||||
if not quality_name:
|
||||
|
@ -512,7 +517,7 @@ class ContainerManager(QObject):
|
|||
activate_quality = quality_name == self._machine_manager.activeQualityName
|
||||
activate_quality_type = None
|
||||
|
||||
global_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if not global_stack or not quality_name:
|
||||
return ""
|
||||
machine_definition = global_stack.getBottom()
|
||||
|
@ -524,7 +529,7 @@ class ContainerManager(QObject):
|
|||
self._container_registry.removeContainer(container.getId())
|
||||
|
||||
if not containers_found:
|
||||
UM.Logger.log("d", "Unable to remove quality containers, as we did not find any by the name of %s", quality_name)
|
||||
Logger.log("d", "Unable to remove quality containers, as we did not find any by the name of %s", quality_name)
|
||||
|
||||
elif activate_quality:
|
||||
definition_id = "fdmprinter" if not self._machine_manager.filterQualityByMachine else self._machine_manager.activeDefinitionId
|
||||
|
@ -547,15 +552,15 @@ class ContainerManager(QObject):
|
|||
# \return True if successful, False if not.
|
||||
@pyqtSlot(str, str, result = bool)
|
||||
def renameQualityChanges(self, quality_name, new_name):
|
||||
UM.Logger.log("d", "User requested QualityChanges container rename of %s to %s", quality_name, new_name)
|
||||
Logger.log("d", "User requested QualityChanges container rename of %s to %s", quality_name, new_name)
|
||||
if not quality_name or not new_name:
|
||||
return False
|
||||
|
||||
if quality_name == new_name:
|
||||
UM.Logger.log("w", "Unable to rename %s to %s, because they are the same.", quality_name, new_name)
|
||||
Logger.log("w", "Unable to rename %s to %s, because they are the same.", quality_name, new_name)
|
||||
return True
|
||||
|
||||
global_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if not global_stack:
|
||||
return False
|
||||
|
||||
|
@ -572,7 +577,7 @@ class ContainerManager(QObject):
|
|||
container_registry.renameContainer(container.getId(), new_name, self._createUniqueId(stack_id, new_name))
|
||||
|
||||
if not containers_to_rename:
|
||||
UM.Logger.log("e", "Unable to rename %s, because we could not find the profile", quality_name)
|
||||
Logger.log("e", "Unable to rename %s, because we could not find the profile", quality_name)
|
||||
|
||||
self._machine_manager.activeQualityChanged.emit()
|
||||
return True
|
||||
|
@ -588,12 +593,12 @@ class ContainerManager(QObject):
|
|||
# \return A string containing the name of the duplicated containers, or an empty string if it failed.
|
||||
@pyqtSlot(str, str, result = str)
|
||||
def duplicateQualityOrQualityChanges(self, quality_name, base_name):
|
||||
global_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if not global_stack or not quality_name:
|
||||
return ""
|
||||
machine_definition = global_stack.getBottom()
|
||||
|
||||
active_stacks = cura.Settings.ExtruderManager.getInstance().getActiveGlobalAndExtruderStacks()
|
||||
active_stacks = ExtruderManager.getInstance().getActiveGlobalAndExtruderStacks()
|
||||
material_containers = [stack.findContainer(type="material") for stack in active_stacks]
|
||||
|
||||
result = self._duplicateQualityOrQualityChangesForMachineType(quality_name, base_name,
|
||||
|
@ -609,16 +614,16 @@ class ContainerManager(QObject):
|
|||
# \param material_instances \type{List[InstanceContainer]}
|
||||
# \return \type{str} the name of the newly created container.
|
||||
def _duplicateQualityOrQualityChangesForMachineType(self, quality_name, base_name, machine_definition, material_instances):
|
||||
UM.Logger.log("d", "Attempting to duplicate the quality %s", quality_name)
|
||||
Logger.log("d", "Attempting to duplicate the quality %s", quality_name)
|
||||
|
||||
if base_name is None:
|
||||
base_name = quality_name
|
||||
# Try to find a Quality with the name.
|
||||
container = QualityManager.getInstance().findQualityByName(quality_name, machine_definition, material_instances)
|
||||
if container:
|
||||
UM.Logger.log("d", "We found a quality to duplicate.")
|
||||
Logger.log("d", "We found a quality to duplicate.")
|
||||
return self._duplicateQualityForMachineType(container, base_name, machine_definition)
|
||||
UM.Logger.log("d", "We found a quality_changes to duplicate.")
|
||||
Logger.log("d", "We found a quality_changes to duplicate.")
|
||||
# Assume it is a quality changes.
|
||||
return self._duplicateQualityChangesForMachineType(quality_name, base_name, machine_definition)
|
||||
|
||||
|
@ -665,11 +670,11 @@ class ContainerManager(QObject):
|
|||
def duplicateMaterial(self, material_id):
|
||||
containers = self._container_registry.findInstanceContainers(id=material_id)
|
||||
if not containers:
|
||||
UM.Logger.log("d", "Unable to duplicate the material with id %s, because it doesn't exist.", material_id)
|
||||
Logger.log("d", "Unable to duplicate the material with id %s, because it doesn't exist.", material_id)
|
||||
return ""
|
||||
|
||||
# Ensure all settings are saved.
|
||||
UM.Application.getInstance().saveSettings()
|
||||
Application.getInstance().saveSettings()
|
||||
|
||||
# Create a new ID & container to hold the data.
|
||||
new_id = self._container_registry.uniqueName(material_id)
|
||||
|
@ -692,7 +697,7 @@ class ContainerManager(QObject):
|
|||
ContainerManager.__instance = cls()
|
||||
return ContainerManager.__instance
|
||||
|
||||
__instance = None
|
||||
__instance = None # type: "ContainerManager"
|
||||
|
||||
# Factory function, used by QML
|
||||
@staticmethod
|
||||
|
@ -713,14 +718,14 @@ class ContainerManager(QObject):
|
|||
|
||||
def _updateContainerNameFilters(self):
|
||||
self._container_name_filters = {}
|
||||
for plugin_id, container_type in UM.Settings.ContainerRegistry.getContainerTypes():
|
||||
for plugin_id, container_type in self._container_registry.getContainerTypes():
|
||||
# Ignore default container types since those are not plugins
|
||||
if container_type in (UM.Settings.InstanceContainer, UM.Settings.ContainerStack, UM.Settings.DefinitionContainer):
|
||||
if container_type in (InstanceContainer, ContainerStack, DefinitionContainer):
|
||||
continue
|
||||
|
||||
serialize_type = ""
|
||||
try:
|
||||
plugin_metadata = UM.PluginRegistry.getInstance().getMetaData(plugin_id)
|
||||
plugin_metadata = PluginRegistry.getInstance().getMetaData(plugin_id)
|
||||
if plugin_metadata:
|
||||
serialize_type = plugin_metadata["settings_container"]["type"]
|
||||
else:
|
||||
|
@ -728,7 +733,7 @@ class ContainerManager(QObject):
|
|||
except KeyError as e:
|
||||
continue
|
||||
|
||||
mime_type = UM.Settings.ContainerRegistry.getMimeTypeForContainer(container_type)
|
||||
mime_type = self._container_registry.getMimeTypeForContainer(container_type)
|
||||
|
||||
entry = {
|
||||
"type": serialize_type,
|
||||
|
@ -791,7 +796,7 @@ class ContainerManager(QObject):
|
|||
base_id = machine_definition.getId() if extruder_id is None else extruder_id
|
||||
|
||||
# Create a new quality_changes container for the quality.
|
||||
quality_changes = UM.Settings.InstanceContainer(self._createUniqueId(base_id, new_name))
|
||||
quality_changes = InstanceContainer(self._createUniqueId(base_id, new_name))
|
||||
quality_changes.setName(new_name)
|
||||
quality_changes.addMetaDataEntry("type", "quality_changes")
|
||||
quality_changes.addMetaDataEntry("quality_type", quality_container.getMetaDataEntry("quality_type"))
|
||||
|
@ -826,7 +831,7 @@ class ContainerManager(QObject):
|
|||
if not path.endswith(".curaprofile"):
|
||||
continue
|
||||
|
||||
single_result = UM.Settings.ContainerRegistry.getInstance().importProfile(path)
|
||||
single_result = self._container_registry.importProfile(path)
|
||||
if single_result["status"] == "error":
|
||||
status = "error"
|
||||
results[single_result["status"]].append(single_result["message"])
|
||||
|
@ -843,7 +848,7 @@ class ContainerManager(QObject):
|
|||
path = file_url.toLocalFile()
|
||||
if not path:
|
||||
return
|
||||
return UM.Settings.ContainerRegistry.getInstance().importProfile(path)
|
||||
return self._container_registry.importProfile(path)
|
||||
|
||||
@pyqtSlot("QVariantList", QUrl, str)
|
||||
def exportProfile(self, instance_id, file_url, file_type):
|
||||
|
@ -852,4 +857,4 @@ class ContainerManager(QObject):
|
|||
path = file_url.toLocalFile()
|
||||
if not path:
|
||||
return
|
||||
UM.Settings.ContainerRegistry.getInstance().exportProfile(instance_id, path, file_type)
|
||||
self._container_registry.exportProfile(instance_id, path, file_type)
|
||||
|
|
|
@ -4,13 +4,16 @@
|
|||
from PyQt5.QtCore import pyqtSignal, pyqtProperty, QObject, QVariant #For communicating data and events to Qt.
|
||||
from UM.FlameProfiler import pyqtSlot
|
||||
|
||||
import UM.Application #To get the global container stack to find the current machine.
|
||||
import UM.Logger
|
||||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator #To find which extruders are used in the scene.
|
||||
from UM.Scene.SceneNode import SceneNode #To find which extruders are used in the scene.
|
||||
import UM.Settings.ContainerRegistry #Finding containers by ID.
|
||||
import UM.Settings.SettingFunction
|
||||
|
||||
from UM.Application import Application #To get the global container stack to find the current machine.
|
||||
from UM.Logger import Logger
|
||||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||
from UM.Scene.SceneNode import SceneNode
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry #Finding containers by ID.
|
||||
from UM.Settings.InstanceContainer import InstanceContainer
|
||||
from UM.Settings.SettingFunction import SettingFunction
|
||||
from UM.Settings.ContainerStack import ContainerStack
|
||||
from UM.Settings.DefinitionContainer import DefinitionContainer
|
||||
from typing import Optional
|
||||
|
||||
## Manages all existing extruder stacks.
|
||||
#
|
||||
|
@ -31,7 +34,7 @@ class ExtruderManager(QObject):
|
|||
super().__init__(parent)
|
||||
self._extruder_trains = { } #Per machine, a dictionary of extruder container stack IDs.
|
||||
self._active_extruder_index = 0
|
||||
UM.Application.getInstance().globalContainerStackChanged.connect(self.__globalContainerStackChanged)
|
||||
Application.getInstance().globalContainerStackChanged.connect(self.__globalContainerStackChanged)
|
||||
self._global_container_stack_definition_id = None
|
||||
self._addCurrentMachineExtruders()
|
||||
|
||||
|
@ -42,35 +45,35 @@ class ExtruderManager(QObject):
|
|||
#
|
||||
# \return The unique ID of the currently active extruder stack.
|
||||
@pyqtProperty(str, notify = activeExtruderChanged)
|
||||
def activeExtruderStackId(self):
|
||||
if not UM.Application.getInstance().getGlobalContainerStack():
|
||||
def activeExtruderStackId(self) -> Optional[str]:
|
||||
if not Application.getInstance().getGlobalContainerStack():
|
||||
return None # No active machine, so no active extruder.
|
||||
try:
|
||||
return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][str(self._active_extruder_index)].getId()
|
||||
return self._extruder_trains[Application.getInstance().getGlobalContainerStack().getId()][str(self._active_extruder_index)].getId()
|
||||
except KeyError: # Extruder index could be -1 if the global tab is selected, or the entry doesn't exist if the machine definition is wrong.
|
||||
return None
|
||||
|
||||
## Return extruder count according to extruder trains.
|
||||
@pyqtProperty(int, notify = extrudersChanged)
|
||||
def extruderCount(self):
|
||||
if not UM.Application.getInstance().getGlobalContainerStack():
|
||||
if not Application.getInstance().getGlobalContainerStack():
|
||||
return 0 # No active machine, so no extruders.
|
||||
try:
|
||||
return len(self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()])
|
||||
return len(self._extruder_trains[Application.getInstance().getGlobalContainerStack().getId()])
|
||||
except KeyError:
|
||||
return 0
|
||||
|
||||
@pyqtProperty("QVariantMap", notify=extrudersChanged)
|
||||
def extruderIds(self):
|
||||
map = {}
|
||||
for position in self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()]:
|
||||
map[position] = self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][position].getId()
|
||||
for position in self._extruder_trains[Application.getInstance().getGlobalContainerStack().getId()]:
|
||||
map[position] = self._extruder_trains[Application.getInstance().getGlobalContainerStack().getId()][position].getId()
|
||||
return map
|
||||
|
||||
@pyqtSlot(str, result = str)
|
||||
def getQualityChangesIdByExtruderStackId(self, id):
|
||||
for position in self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()]:
|
||||
extruder = self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][position]
|
||||
def getQualityChangesIdByExtruderStackId(self, id: str) -> str:
|
||||
for position in self._extruder_trains[Application.getInstance().getGlobalContainerStack().getId()]:
|
||||
extruder = self._extruder_trains[Application.getInstance().getGlobalContainerStack().getId()][position]
|
||||
if extruder.getId() == id:
|
||||
return extruder.findContainer(type = "quality_changes").getId()
|
||||
|
||||
|
@ -87,7 +90,7 @@ class ExtruderManager(QObject):
|
|||
#
|
||||
# \return The extruder manager.
|
||||
@classmethod
|
||||
def getInstance(cls):
|
||||
def getInstance(cls) -> "ExtruderManager":
|
||||
if not cls.__instance:
|
||||
cls.__instance = ExtruderManager()
|
||||
return cls.__instance
|
||||
|
@ -96,16 +99,27 @@ class ExtruderManager(QObject):
|
|||
#
|
||||
# \param index The index of the new active extruder.
|
||||
@pyqtSlot(int)
|
||||
def setActiveExtruderIndex(self, index):
|
||||
def setActiveExtruderIndex(self, index: int) -> None:
|
||||
self._active_extruder_index = index
|
||||
self.activeExtruderChanged.emit()
|
||||
|
||||
@pyqtProperty(int, notify = activeExtruderChanged)
|
||||
def activeExtruderIndex(self):
|
||||
def activeExtruderIndex(self) -> int:
|
||||
return self._active_extruder_index
|
||||
|
||||
def getActiveExtruderStack(self):
|
||||
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
## Gets the extruder name of an extruder of the currently active machine.
|
||||
#
|
||||
# \param index The index of the extruder whose name to get.
|
||||
@pyqtSlot(int, result = str)
|
||||
def getExtruderName(self, index):
|
||||
try:
|
||||
return list(self.getActiveExtruderStacks())[index].getName()
|
||||
except IndexError:
|
||||
return ""
|
||||
|
||||
def getActiveExtruderStack(self) -> ContainerStack:
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
|
||||
if global_container_stack:
|
||||
if global_container_stack.getId() in self._extruder_trains:
|
||||
if str(self._active_extruder_index) in self._extruder_trains[global_container_stack.getId()]:
|
||||
|
@ -114,7 +128,7 @@ class ExtruderManager(QObject):
|
|||
|
||||
## Get an extruder stack by index
|
||||
def getExtruderStack(self, index):
|
||||
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if global_container_stack:
|
||||
if global_container_stack.getId() in self._extruder_trains:
|
||||
if str(index) in self._extruder_trains[global_container_stack.getId()]:
|
||||
|
@ -126,19 +140,19 @@ class ExtruderManager(QObject):
|
|||
#
|
||||
# \param machine_definition The machine definition to add the extruders for.
|
||||
# \param machine_id The machine_id to add the extruders for.
|
||||
def addMachineExtruders(self, machine_definition, machine_id):
|
||||
def addMachineExtruders(self, machine_definition: DefinitionContainer, machine_id: str) -> None:
|
||||
changed = False
|
||||
machine_definition_id = machine_definition.getId()
|
||||
if machine_id not in self._extruder_trains:
|
||||
self._extruder_trains[machine_id] = { }
|
||||
changed = True
|
||||
container_registry = UM.Settings.ContainerRegistry.getInstance()
|
||||
container_registry = ContainerRegistry.getInstance()
|
||||
if container_registry:
|
||||
# Add the extruder trains that don't exist yet.
|
||||
for extruder_definition in container_registry.findDefinitionContainers(machine = machine_definition_id):
|
||||
position = extruder_definition.getMetaDataEntry("position", None)
|
||||
if not position:
|
||||
UM.Logger.log("w", "Extruder definition %s specifies no position metadata entry.", extruder_definition.getId())
|
||||
Logger.log("w", "Extruder definition %s specifies no position metadata entry.", extruder_definition.getId())
|
||||
if not container_registry.findContainerStacks(machine = machine_id, position = position): # Doesn't exist yet.
|
||||
self.createExtruderTrain(extruder_definition, machine_definition, position, machine_id)
|
||||
changed = True
|
||||
|
@ -149,7 +163,7 @@ class ExtruderManager(QObject):
|
|||
self._extruder_trains[machine_id][extruder_train.getMetaDataEntry("position")] = extruder_train
|
||||
|
||||
# regardless of what the next stack is, we have to set it again, because of signal routing.
|
||||
extruder_train.setNextStack(UM.Application.getInstance().getGlobalContainerStack())
|
||||
extruder_train.setNextStack(Application.getInstance().getGlobalContainerStack())
|
||||
changed = True
|
||||
if changed:
|
||||
self.extrudersChanged.emit(machine_id)
|
||||
|
@ -178,14 +192,15 @@ class ExtruderManager(QObject):
|
|||
# \param machine_definition The machine that the extruder train belongs to.
|
||||
# \param position The position of this extruder train in the extruder slots of the machine.
|
||||
# \param machine_id The id of the "global" stack this extruder is linked to.
|
||||
def createExtruderTrain(self, extruder_definition, machine_definition, position, machine_id):
|
||||
def createExtruderTrain(self, extruder_definition: DefinitionContainer, machine_definition: DefinitionContainer,
|
||||
position, machine_id: str) -> None:
|
||||
# Cache some things.
|
||||
container_registry = UM.Settings.ContainerRegistry.getInstance()
|
||||
machine_definition_id = UM.Application.getInstance().getMachineManager().getQualityDefinitionId(machine_definition)
|
||||
container_registry = ContainerRegistry.getInstance()
|
||||
machine_definition_id = Application.getInstance().getMachineManager().getQualityDefinitionId(machine_definition)
|
||||
|
||||
# Create a container stack for this extruder.
|
||||
extruder_stack_id = container_registry.uniqueName(extruder_definition.getId())
|
||||
container_stack = UM.Settings.ContainerStack(extruder_stack_id)
|
||||
container_stack = ContainerStack(extruder_stack_id)
|
||||
container_stack.setName(extruder_definition.getName()) # Take over the display name to display the stack with.
|
||||
container_stack.addMetaDataEntry("type", "extruder_train")
|
||||
container_stack.addMetaDataEntry("machine", machine_id)
|
||||
|
@ -205,7 +220,7 @@ class ExtruderManager(QObject):
|
|||
if len(preferred_variants) >= 1:
|
||||
variant = preferred_variants[0]
|
||||
else:
|
||||
UM.Logger.log("w", "The preferred variant \"%s\" of machine %s doesn't exist or is not a variant profile.", preferred_variant_id, machine_id)
|
||||
Logger.log("w", "The preferred variant \"%s\" of machine %s doesn't exist or is not a variant profile.", preferred_variant_id, machine_id)
|
||||
# And leave it at the default variant.
|
||||
container_stack.addContainer(variant)
|
||||
|
||||
|
@ -235,7 +250,7 @@ class ExtruderManager(QObject):
|
|||
if len(preferred_materials) >= 1:
|
||||
material = preferred_materials[0]
|
||||
else:
|
||||
UM.Logger.log("w", "The preferred material \"%s\" of machine %s doesn't exist or is not a material profile.", preferred_material_id, machine_id)
|
||||
Logger.log("w", "The preferred material \"%s\" of machine %s doesn't exist or is not a material profile.", preferred_material_id, machine_id)
|
||||
# And leave it at the default material.
|
||||
container_stack.addContainer(material)
|
||||
|
||||
|
@ -254,11 +269,11 @@ class ExtruderManager(QObject):
|
|||
if preferred_quality:
|
||||
search_criteria["id"] = preferred_quality
|
||||
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(**search_criteria)
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(**search_criteria)
|
||||
if not containers and preferred_quality:
|
||||
UM.Logger.log("w", "The preferred quality \"%s\" of machine %s doesn't exist or is not a quality profile.", preferred_quality, machine_id)
|
||||
Logger.log("w", "The preferred quality \"%s\" of machine %s doesn't exist or is not a quality profile.", preferred_quality, machine_id)
|
||||
search_criteria.pop("id", None)
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(**search_criteria)
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(**search_criteria)
|
||||
if containers:
|
||||
quality = containers[0]
|
||||
|
||||
|
@ -271,7 +286,7 @@ class ExtruderManager(QObject):
|
|||
if user_profile: # There was already a user profile, loaded from settings.
|
||||
user_profile = user_profile[0]
|
||||
else:
|
||||
user_profile = UM.Settings.InstanceContainer(extruder_stack_id + "_current_settings") # Add an empty user profile.
|
||||
user_profile = InstanceContainer(extruder_stack_id + "_current_settings") # Add an empty user profile.
|
||||
user_profile.addMetaDataEntry("type", "user")
|
||||
user_profile.addMetaDataEntry("extruder", extruder_stack_id)
|
||||
user_profile.setDefinition(machine_definition)
|
||||
|
@ -279,7 +294,7 @@ class ExtruderManager(QObject):
|
|||
container_stack.addContainer(user_profile)
|
||||
|
||||
# regardless of what the next stack is, we have to set it again, because of signal routing.
|
||||
container_stack.setNextStack(UM.Application.getInstance().getGlobalContainerStack())
|
||||
container_stack.setNextStack(Application.getInstance().getGlobalContainerStack())
|
||||
|
||||
container_registry.addContainer(container_stack)
|
||||
|
||||
|
@ -292,14 +307,14 @@ class ExtruderManager(QObject):
|
|||
# \param property \type{str} The property to get.
|
||||
# \return \type{List} the list of results
|
||||
def getAllExtruderSettings(self, setting_key, property):
|
||||
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if global_container_stack.getProperty("machine_extruder_count", "value") <= 1:
|
||||
return [global_container_stack.getProperty(setting_key, property)]
|
||||
|
||||
result = []
|
||||
for index in self.extruderIds:
|
||||
extruder_stack_id = self.extruderIds[str(index)]
|
||||
stack = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = extruder_stack_id)[0]
|
||||
stack = ContainerRegistry.getInstance().findContainerStacks(id = extruder_stack_id)[0]
|
||||
result.append(stack.getProperty(setting_key, property))
|
||||
return result
|
||||
|
||||
|
@ -314,8 +329,8 @@ class ExtruderManager(QObject):
|
|||
#
|
||||
# \return A list of extruder stacks.
|
||||
def getUsedExtruderStacks(self):
|
||||
global_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
container_registry = UM.Settings.ContainerRegistry.getInstance()
|
||||
global_stack = Application.getInstance().getGlobalContainerStack()
|
||||
container_registry = ContainerRegistry.getInstance()
|
||||
|
||||
if global_stack.getProperty("machine_extruder_count", "value") <= 1: #For single extrusion.
|
||||
return [global_stack]
|
||||
|
@ -325,7 +340,7 @@ class ExtruderManager(QObject):
|
|||
#Get the extruders of all meshes in the scene.
|
||||
support_enabled = False
|
||||
support_interface_enabled = False
|
||||
scene_root = UM.Application.getInstance().getController().getScene().getRoot()
|
||||
scene_root = Application.getInstance().getController().getScene().getRoot()
|
||||
meshes = [node for node in DepthFirstIterator(scene_root) if type(node) is SceneNode and node.isSelectable()] #Only use the nodes that will be printed.
|
||||
for mesh in meshes:
|
||||
extruder_stack_id = mesh.callDecoration("getActiveExtruder")
|
||||
|
@ -356,7 +371,7 @@ class ExtruderManager(QObject):
|
|||
try:
|
||||
return [container_registry.findContainerStacks(id = stack_id)[0] for stack_id in used_extruder_stack_ids]
|
||||
except IndexError: # One or more of the extruders was not found.
|
||||
UM.Logger.log("e", "Unable to find one or more of the extruders in %s", used_extruder_stack_ids)
|
||||
Logger.log("e", "Unable to find one or more of the extruders in %s", used_extruder_stack_ids)
|
||||
return []
|
||||
|
||||
## Removes the container stack and user profile for the extruders for a specific machine.
|
||||
|
@ -364,27 +379,26 @@ class ExtruderManager(QObject):
|
|||
# \param machine_id The machine to remove the extruders for.
|
||||
def removeMachineExtruders(self, machine_id):
|
||||
for extruder in self.getMachineExtruders(machine_id):
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(type = "user", extruder = extruder.getId())
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(type = "user", extruder = extruder.getId())
|
||||
for container in containers:
|
||||
UM.Settings.ContainerRegistry.getInstance().removeContainer(container.getId())
|
||||
UM.Settings.ContainerRegistry.getInstance().removeContainer(extruder.getId())
|
||||
ContainerRegistry.getInstance().removeContainer(container.getId())
|
||||
ContainerRegistry.getInstance().removeContainer(extruder.getId())
|
||||
|
||||
## Returns extruders for a specific machine.
|
||||
#
|
||||
# \param machine_id The machine to get the extruders of.
|
||||
def getMachineExtruders(self, machine_id):
|
||||
if machine_id not in self._extruder_trains:
|
||||
UM.Logger.log("w", "Tried to get the extruder trains for machine %s, which doesn't exist.", machine_id)
|
||||
return
|
||||
for name in self._extruder_trains[machine_id]:
|
||||
yield self._extruder_trains[machine_id][name]
|
||||
Logger.log("w", "Tried to get the extruder trains for machine %s, which doesn't exist.", machine_id)
|
||||
return []
|
||||
return [self._extruder_trains[machine_id][name] for name in self._extruder_trains[machine_id]]
|
||||
|
||||
## Returns a list containing the global stack and active extruder stacks.
|
||||
#
|
||||
# The first element is the global container stack, followed by any extruder stacks.
|
||||
# \return \type{List[ContainerStack]}
|
||||
def getActiveGlobalAndExtruderStacks(self):
|
||||
global_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if not global_stack:
|
||||
return None
|
||||
|
||||
|
@ -396,7 +410,7 @@ class ExtruderManager(QObject):
|
|||
#
|
||||
# \return \type{List[ContainerStack]} a list of
|
||||
def getActiveExtruderStacks(self):
|
||||
global_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_stack = Application.getInstance().getGlobalContainerStack()
|
||||
|
||||
result = []
|
||||
if global_stack:
|
||||
|
@ -404,17 +418,17 @@ class ExtruderManager(QObject):
|
|||
result.append(self._extruder_trains[global_stack.getId()][extruder])
|
||||
return result
|
||||
|
||||
def __globalContainerStackChanged(self):
|
||||
def __globalContainerStackChanged(self) -> None:
|
||||
self._addCurrentMachineExtruders()
|
||||
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if global_container_stack and global_container_stack.getBottom() and global_container_stack.getBottom().getId() != self._global_container_stack_definition_id:
|
||||
self._global_container_stack_definition_id = global_container_stack.getBottom().getId()
|
||||
self.globalContainerStackDefinitionChanged.emit()
|
||||
self.activeExtruderChanged.emit()
|
||||
|
||||
## Adds the extruders of the currently active machine.
|
||||
def _addCurrentMachineExtruders(self):
|
||||
global_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
def _addCurrentMachineExtruders(self) -> None:
|
||||
global_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if global_stack and global_stack.getBottom():
|
||||
self.addMachineExtruders(global_stack.getBottom(), global_stack.getId())
|
||||
|
||||
|
@ -428,7 +442,7 @@ class ExtruderManager(QObject):
|
|||
# If no extruder has the value, the list will contain the global value.
|
||||
@staticmethod
|
||||
def getExtruderValues(key):
|
||||
global_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_stack = Application.getInstance().getGlobalContainerStack()
|
||||
|
||||
result = []
|
||||
for extruder in ExtruderManager.getInstance().getMachineExtruders(global_stack.getId()):
|
||||
|
@ -437,7 +451,7 @@ class ExtruderManager(QObject):
|
|||
if value is None:
|
||||
continue
|
||||
|
||||
if isinstance(value, UM.Settings.SettingFunction):
|
||||
if isinstance(value, SettingFunction):
|
||||
value = value(extruder)
|
||||
|
||||
result.append(value)
|
||||
|
@ -473,10 +487,10 @@ class ExtruderManager(QObject):
|
|||
|
||||
if extruder:
|
||||
value = extruder.getRawProperty(key, "value")
|
||||
if isinstance(value, UM.Settings.SettingFunction):
|
||||
if isinstance(value, SettingFunction):
|
||||
value = value(extruder)
|
||||
else: #Just a value from global.
|
||||
value = UM.Application.getInstance().getGlobalContainerStack().getProperty(key, "value")
|
||||
value = Application.getInstance().getGlobalContainerStack().getProperty(key, "value")
|
||||
|
||||
return value
|
||||
|
||||
|
@ -489,7 +503,7 @@ class ExtruderManager(QObject):
|
|||
# \return The effective value
|
||||
@staticmethod
|
||||
def getResolveOrValue(key):
|
||||
global_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_stack = Application.getInstance().getGlobalContainerStack()
|
||||
|
||||
resolved_value = global_stack.getProperty(key, "resolve")
|
||||
if resolved_value is not None:
|
||||
|
|
|
@ -4,8 +4,9 @@
|
|||
from PyQt5.QtCore import Qt, pyqtSignal, pyqtProperty
|
||||
|
||||
import UM.Qt.ListModel
|
||||
from UM.Application import Application
|
||||
|
||||
from . import ExtruderManager
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
||||
## Model that holds extruders.
|
||||
#
|
||||
|
@ -55,7 +56,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
|||
self._active_extruder_stack = None
|
||||
|
||||
#Listen to changes.
|
||||
UM.Application.getInstance().globalContainerStackChanged.connect(self._updateExtruders)
|
||||
Application.getInstance().globalContainerStackChanged.connect(self._updateExtruders)
|
||||
manager = ExtruderManager.getInstance()
|
||||
|
||||
self._updateExtruders()
|
||||
|
@ -105,7 +106,6 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
|||
|
||||
def _onExtruderStackContainersChanged(self, container):
|
||||
# The ExtrudersModel needs to be updated when the material-name or -color changes, because the user identifies extruders by material-name
|
||||
if container.getMetaDataEntry("type") == "material":
|
||||
self._updateExtruders()
|
||||
|
||||
modelChanged = pyqtSignal()
|
||||
|
@ -121,7 +121,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
|||
|
||||
items = []
|
||||
|
||||
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if global_container_stack:
|
||||
if self._add_global:
|
||||
material = global_container_stack.findContainer({ "type": "material" })
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# Copyright (c) 2016 Ultimaker B.V.
|
||||
# Copyright (c) 2017 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
from typing import Union
|
||||
|
||||
from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal
|
||||
from UM.FlameProfiler import pyqtSlot
|
||||
|
@ -11,11 +12,17 @@ from UM.Preferences import Preferences
|
|||
from UM.Logger import Logger
|
||||
from UM.Message import Message
|
||||
|
||||
import UM.Settings
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
from UM.Settings.ContainerStack import ContainerStack
|
||||
from UM.Settings.InstanceContainer import InstanceContainer
|
||||
from UM.Settings.SettingDefinition import SettingDefinition
|
||||
from UM.Settings.SettingFunction import SettingFunction
|
||||
from UM.Settings.Validator import ValidatorState
|
||||
from UM.Signal import postponeSignals
|
||||
|
||||
from cura.QualityManager import QualityManager
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice
|
||||
from . import ExtruderManager
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
catalog = i18nCatalog("cura")
|
||||
|
@ -26,8 +33,8 @@ class MachineManager(QObject):
|
|||
def __init__(self, parent = None):
|
||||
super().__init__(parent)
|
||||
|
||||
self._active_container_stack = None
|
||||
self._global_container_stack = None
|
||||
self._active_container_stack = None # type: ContainerStack
|
||||
self._global_container_stack = None # type: ContainerStack
|
||||
|
||||
Application.getInstance().globalContainerStackChanged.connect(self._onGlobalContainerChanged)
|
||||
## When the global container is changed, active material probably needs to be updated.
|
||||
|
@ -36,10 +43,10 @@ class MachineManager(QObject):
|
|||
self.globalContainerChanged.connect(self.activeQualityChanged)
|
||||
|
||||
self._stacks_have_errors = None
|
||||
self._empty_variant_container = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id="empty_variant")[0]
|
||||
self._empty_material_container = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id="empty_material")[0]
|
||||
self._empty_quality_container = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id="empty_quality")[0]
|
||||
self._empty_quality_changes_container = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id="empty_quality_changes")[0]
|
||||
self._empty_variant_container = ContainerRegistry.getInstance().findInstanceContainers(id="empty_variant")[0]
|
||||
self._empty_material_container = ContainerRegistry.getInstance().findInstanceContainers(id="empty_material")[0]
|
||||
self._empty_quality_container = ContainerRegistry.getInstance().findInstanceContainers(id="empty_quality")[0]
|
||||
self._empty_quality_changes_container = ContainerRegistry.getInstance().findInstanceContainers(id="empty_quality_changes")[0]
|
||||
self._onGlobalContainerChanged()
|
||||
|
||||
ExtruderManager.getInstance().activeExtruderChanged.connect(self._onActiveExtruderStackChanged)
|
||||
|
@ -91,7 +98,7 @@ class MachineManager(QObject):
|
|||
|
||||
outputDevicesChanged = pyqtSignal()
|
||||
|
||||
def _onOutputDevicesChanged(self):
|
||||
def _onOutputDevicesChanged(self) -> None:
|
||||
for printer_output_device in self._printer_output_devices:
|
||||
printer_output_device.hotendIdChanged.disconnect(self._onHotendIdChanged)
|
||||
printer_output_device.materialIdChanged.disconnect(self._onMaterialIdChanged)
|
||||
|
@ -112,16 +119,17 @@ class MachineManager(QObject):
|
|||
|
||||
@pyqtProperty(int, constant=True)
|
||||
def totalNumberOfSettings(self):
|
||||
return len(UM.Settings.ContainerRegistry.getInstance().findDefinitionContainers(id="fdmprinter")[0].getAllKeys())
|
||||
return len(ContainerRegistry.getInstance().findDefinitionContainers(id="fdmprinter")[0].getAllKeys())
|
||||
|
||||
def _onHotendIdChanged(self, index, hotend_id):
|
||||
def _onHotendIdChanged(self, index: Union[str, int], hotend_id: str) -> None:
|
||||
if not self._global_container_stack:
|
||||
return
|
||||
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(type="variant", definition=self._global_container_stack.getBottom().getId(), name=hotend_id)
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(type="variant", definition=self._global_container_stack.getBottom().getId(), name=hotend_id)
|
||||
if containers: # New material ID is known
|
||||
extruder_manager = ExtruderManager.getInstance()
|
||||
extruders = list(extruder_manager.getMachineExtruders(self.activeMachineId))
|
||||
machine_id = self.activeMachineId
|
||||
extruders = extruder_manager.getMachineExtruders(machine_id)
|
||||
matching_extruder = None
|
||||
for extruder in extruders:
|
||||
if str(index) == extruder.getMetaDataEntry("position"):
|
||||
|
@ -142,7 +150,7 @@ class MachineManager(QObject):
|
|||
if self._global_container_stack.getMetaDataEntry("has_machine_materials", False):
|
||||
definition_id = self.activeQualityDefinitionId
|
||||
extruder_manager = ExtruderManager.getInstance()
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(type = "material", definition = definition_id, GUID = material_id)
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(type = "material", definition = definition_id, GUID = material_id)
|
||||
if containers: # New material ID is known
|
||||
extruders = list(extruder_manager.getMachineExtruders(self.activeMachineId))
|
||||
matching_extruder = None
|
||||
|
@ -220,6 +228,11 @@ class MachineManager(QObject):
|
|||
quality = self._global_container_stack.findContainer({"type": "quality"})
|
||||
quality.nameChanged.disconnect(self._onQualityNameChanged)
|
||||
|
||||
if self._global_container_stack.getProperty("machine_extruder_count", "value") > 1:
|
||||
for extruder_stack in ExtruderManager.getInstance().getActiveExtruderStacks():
|
||||
extruder_stack.propertyChanged.disconnect(self._onPropertyChanged)
|
||||
extruder_stack.containersChanged.disconnect(self._onInstanceContainersChanged)
|
||||
|
||||
self._global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
self._active_container_stack = self._global_container_stack
|
||||
|
||||
|
@ -243,6 +256,10 @@ class MachineManager(QObject):
|
|||
if global_material != self._empty_material_container:
|
||||
self._global_container_stack.replaceContainer(self._global_container_stack.getContainerIndex(global_material), self._empty_material_container)
|
||||
|
||||
for extruder_stack in ExtruderManager.getInstance().getActiveExtruderStacks(): #Listen for changes on all extruder stacks.
|
||||
extruder_stack.propertyChanged.connect(self._onPropertyChanged)
|
||||
extruder_stack.containersChanged.connect(self._onInstanceContainersChanged)
|
||||
|
||||
else:
|
||||
material = self._global_container_stack.findContainer({"type": "material"})
|
||||
material.nameChanged.connect(self._onMaterialNameChanged)
|
||||
|
@ -263,14 +280,8 @@ class MachineManager(QObject):
|
|||
self.blurSettings.emit() # Ensure no-one has focus.
|
||||
old_active_container_stack = self._active_container_stack
|
||||
|
||||
if self._active_container_stack and self._active_container_stack != self._global_container_stack:
|
||||
self._active_container_stack.containersChanged.disconnect(self._onInstanceContainersChanged)
|
||||
self._active_container_stack.propertyChanged.disconnect(self._onPropertyChanged)
|
||||
self._active_container_stack = ExtruderManager.getInstance().getActiveExtruderStack()
|
||||
if self._active_container_stack:
|
||||
self._active_container_stack.containersChanged.connect(self._onInstanceContainersChanged)
|
||||
self._active_container_stack.propertyChanged.connect(self._onPropertyChanged)
|
||||
else:
|
||||
if not self._active_container_stack:
|
||||
self._active_container_stack = self._global_container_stack
|
||||
|
||||
self._updateStacksHaveErrors()
|
||||
|
@ -283,11 +294,8 @@ class MachineManager(QObject):
|
|||
def _onInstanceContainersChanged(self, container):
|
||||
container_type = container.getMetaDataEntry("type")
|
||||
|
||||
if container_type == "material":
|
||||
self.activeMaterialChanged.emit()
|
||||
elif container_type == "variant":
|
||||
self.activeVariantChanged.emit()
|
||||
elif container_type == "quality":
|
||||
self.activeMaterialChanged.emit()
|
||||
self.activeQualityChanged.emit()
|
||||
|
||||
self._updateStacksHaveErrors()
|
||||
|
@ -297,24 +305,29 @@ class MachineManager(QObject):
|
|||
# Notify UI items, such as the "changed" star in profile pull down menu.
|
||||
self.activeStackValueChanged.emit()
|
||||
|
||||
if property_name == "validationState":
|
||||
elif property_name == "validationState":
|
||||
if not self._stacks_have_errors:
|
||||
# fast update, we only have to look at the current changed property
|
||||
if self._active_container_stack.getProperty(key, "settable_per_extruder"):
|
||||
changed_validation_state = self._active_container_stack.getProperty(key, property_name)
|
||||
if self._global_container_stack.getProperty("machine_extruder_count", "value") > 1 and self._active_container_stack.getProperty(key, "settable_per_extruder"):
|
||||
extruder_index = int(self._active_container_stack.getProperty(key, "limit_to_extruder"))
|
||||
if extruder_index >= 0: #We have to look up the value from a different extruder.
|
||||
stack = ExtruderManager.getInstance().getExtruderStack(str(extruder_index))
|
||||
else:
|
||||
changed_validation_state = self._global_container_stack.getProperty(key, property_name)
|
||||
stack = self._active_container_stack
|
||||
else:
|
||||
stack = self._global_container_stack
|
||||
changed_validation_state = stack.getProperty(key, property_name)
|
||||
|
||||
if changed_validation_state is None:
|
||||
# Setting is not validated. This can happen if there is only a setting definition.
|
||||
# We do need to validate it, because a setting defintions value can be set by a function, which could
|
||||
# be an invalid setting.
|
||||
definition = self._active_container_stack.getSettingDefinition(key)
|
||||
validator_type = UM.Settings.SettingDefinition.getValidatorForType(definition.type)
|
||||
validator_type = SettingDefinition.getValidatorForType(definition.type)
|
||||
if validator_type:
|
||||
validator = validator_type(key)
|
||||
changed_validation_state = validator(self._active_container_stack)
|
||||
if changed_validation_state in (UM.Settings.ValidatorState.Exception, UM.Settings.ValidatorState.MaximumError, UM.Settings.ValidatorState.MinimumError):
|
||||
if changed_validation_state in (ValidatorState.Exception, ValidatorState.MaximumError, ValidatorState.MinimumError):
|
||||
self._stacks_have_errors = True
|
||||
self.stacksValidationChanged.emit()
|
||||
else:
|
||||
|
@ -322,20 +335,20 @@ class MachineManager(QObject):
|
|||
self._updateStacksHaveErrors()
|
||||
|
||||
@pyqtSlot(str)
|
||||
def setActiveMachine(self, stack_id):
|
||||
def setActiveMachine(self, stack_id: str) -> None:
|
||||
self.blurSettings.emit() # Ensure no-one has focus.
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = stack_id)
|
||||
containers = ContainerRegistry.getInstance().findContainerStacks(id = stack_id)
|
||||
if containers:
|
||||
Application.getInstance().setGlobalContainerStack(containers[0])
|
||||
|
||||
@pyqtSlot(str, str)
|
||||
def addMachine(self, name, definition_id):
|
||||
container_registry = UM.Settings.ContainerRegistry.getInstance()
|
||||
def addMachine(self, name: str, definition_id: str) -> None:
|
||||
container_registry = ContainerRegistry.getInstance()
|
||||
definitions = container_registry.findDefinitionContainers(id = definition_id)
|
||||
if definitions:
|
||||
definition = definitions[0]
|
||||
name = self._createUniqueName("machine", "", name, definition.getName())
|
||||
new_global_stack = UM.Settings.ContainerStack(name)
|
||||
new_global_stack = ContainerStack(name)
|
||||
new_global_stack.addMetaDataEntry("type", "machine")
|
||||
container_registry.addContainer(new_global_stack)
|
||||
|
||||
|
@ -343,7 +356,7 @@ class MachineManager(QObject):
|
|||
material_instance_container = self._updateMaterialContainer(definition, variant_instance_container)
|
||||
quality_instance_container = self._updateQualityContainer(definition, variant_instance_container, material_instance_container)
|
||||
|
||||
current_settings_instance_container = UM.Settings.InstanceContainer(name + "_current_settings")
|
||||
current_settings_instance_container = InstanceContainer(name + "_current_settings")
|
||||
current_settings_instance_container.addMetaDataEntry("machine", name)
|
||||
current_settings_instance_container.addMetaDataEntry("type", "user")
|
||||
current_settings_instance_container.setDefinition(definitions[0])
|
||||
|
@ -371,17 +384,16 @@ class MachineManager(QObject):
|
|||
# \param new_name \type{string} Base name, which may not be unique
|
||||
# \param fallback_name \type{string} Name to use when (stripped) new_name is empty
|
||||
# \return \type{string} Name that is unique for the specified type and name/id
|
||||
def _createUniqueName(self, container_type, current_name, new_name, fallback_name):
|
||||
return UM.Settings.ContainerRegistry.getInstance().createUniqueName(container_type, current_name, new_name, fallback_name)
|
||||
def _createUniqueName(self, container_type: str, current_name: str, new_name: str, fallback_name: str) -> str:
|
||||
return ContainerRegistry.getInstance().createUniqueName(container_type, current_name, new_name, fallback_name)
|
||||
|
||||
def _checkStacksHaveErrors(self):
|
||||
if self._global_container_stack is not None and self._global_container_stack.hasErrors():
|
||||
return True
|
||||
|
||||
if self._global_container_stack is None:
|
||||
if self._global_container_stack is None: #No active machine.
|
||||
return False
|
||||
stacks = list(ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()))
|
||||
for stack in stacks:
|
||||
|
||||
if self._global_container_stack.hasErrors():
|
||||
return True
|
||||
for stack in ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()):
|
||||
if stack.hasErrors():
|
||||
return True
|
||||
|
||||
|
@ -463,35 +475,35 @@ class MachineManager(QObject):
|
|||
return bool(self._stacks_have_errors)
|
||||
|
||||
@pyqtProperty(str, notify = activeStackChanged)
|
||||
def activeUserProfileId(self):
|
||||
def activeUserProfileId(self) -> str:
|
||||
if self._active_container_stack:
|
||||
return self._active_container_stack.getTop().getId()
|
||||
|
||||
return ""
|
||||
|
||||
@pyqtProperty(str, notify = globalContainerChanged)
|
||||
def activeMachineName(self):
|
||||
def activeMachineName(self) -> str:
|
||||
if self._global_container_stack:
|
||||
return self._global_container_stack.getName()
|
||||
|
||||
return ""
|
||||
|
||||
@pyqtProperty(str, notify = globalContainerChanged)
|
||||
def activeMachineId(self):
|
||||
def activeMachineId(self) -> str:
|
||||
if self._global_container_stack:
|
||||
return self._global_container_stack.getId()
|
||||
|
||||
return ""
|
||||
|
||||
@pyqtProperty(str, notify = activeStackChanged)
|
||||
def activeStackId(self):
|
||||
def activeStackId(self) -> str:
|
||||
if self._active_container_stack:
|
||||
return self._active_container_stack.getId()
|
||||
|
||||
return ""
|
||||
|
||||
@pyqtProperty(str, notify = activeMaterialChanged)
|
||||
def activeMaterialName(self):
|
||||
def activeMaterialName(self) -> str:
|
||||
if self._active_container_stack:
|
||||
material = self._active_container_stack.findContainer({"type":"material"})
|
||||
if material:
|
||||
|
@ -521,7 +533,7 @@ class MachineManager(QObject):
|
|||
return result
|
||||
|
||||
@pyqtProperty(str, notify=activeMaterialChanged)
|
||||
def activeMaterialId(self):
|
||||
def activeMaterialId(self) -> str:
|
||||
if self._active_container_stack:
|
||||
material = self._active_container_stack.findContainer({"type": "material"})
|
||||
if material:
|
||||
|
@ -559,13 +571,13 @@ class MachineManager(QObject):
|
|||
quality_changes = self._global_container_stack.findContainer({"type": "quality_changes"})
|
||||
if quality_changes:
|
||||
value = self._global_container_stack.getRawProperty("layer_height", "value", skip_until_container = quality_changes.getId())
|
||||
if isinstance(value, UM.Settings.SettingFunction):
|
||||
if isinstance(value, SettingFunction):
|
||||
value = value(self._global_container_stack)
|
||||
return value
|
||||
quality = self._global_container_stack.findContainer({"type": "quality"})
|
||||
if quality:
|
||||
value = self._global_container_stack.getRawProperty("layer_height", "value", skip_until_container = quality.getId())
|
||||
if isinstance(value, UM.Settings.SettingFunction):
|
||||
if isinstance(value, SettingFunction):
|
||||
value = value(self._global_container_stack)
|
||||
return value
|
||||
|
||||
|
@ -574,7 +586,7 @@ class MachineManager(QObject):
|
|||
## Get the Material ID associated with the currently active material
|
||||
# \returns MaterialID (string) if found, empty string otherwise
|
||||
@pyqtProperty(str, notify=activeQualityChanged)
|
||||
def activeQualityMaterialId(self):
|
||||
def activeQualityMaterialId(self) -> str:
|
||||
if self._active_container_stack:
|
||||
quality = self._active_container_stack.findContainer({"type": "quality"})
|
||||
if quality:
|
||||
|
@ -664,8 +676,8 @@ class MachineManager(QObject):
|
|||
|
||||
## Check if a container is read_only
|
||||
@pyqtSlot(str, result = bool)
|
||||
def isReadOnly(self, container_id):
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = container_id)
|
||||
def isReadOnly(self, container_id) -> bool:
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(id = container_id)
|
||||
if not containers or not self._active_container_stack:
|
||||
return True
|
||||
return containers[0].isReadOnly()
|
||||
|
@ -687,7 +699,8 @@ class MachineManager(QObject):
|
|||
# Depending on from/to material+current variant, a quality profile is chosen and set.
|
||||
@pyqtSlot(str)
|
||||
def setActiveMaterial(self, material_id):
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = material_id)
|
||||
with postponeSignals(*self._getContainerChangedSignals(), compress = True):
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(id = material_id)
|
||||
if not containers or not self._active_container_stack:
|
||||
return
|
||||
material_container = containers[0]
|
||||
|
@ -745,7 +758,8 @@ class MachineManager(QObject):
|
|||
|
||||
@pyqtSlot(str)
|
||||
def setActiveVariant(self, variant_id):
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = variant_id)
|
||||
with postponeSignals(*self._getContainerChangedSignals(), compress = True):
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(id = variant_id)
|
||||
if not containers or not self._active_container_stack:
|
||||
return
|
||||
Logger.log("d", "Attempting to change the active variant to %s", variant_id)
|
||||
|
@ -768,9 +782,10 @@ class MachineManager(QObject):
|
|||
# \param quality_id The quality_id of either a quality or a quality_changes
|
||||
@pyqtSlot(str)
|
||||
def setActiveQuality(self, quality_id):
|
||||
with postponeSignals(*self._getContainerChangedSignals(), compress = True):
|
||||
self.blurSettings.emit()
|
||||
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = quality_id)
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(id = quality_id)
|
||||
if not containers or not self._global_container_stack:
|
||||
return
|
||||
|
||||
|
@ -799,8 +814,8 @@ class MachineManager(QObject):
|
|||
|
||||
name_changed_connect_stacks.append(stack_quality)
|
||||
name_changed_connect_stacks.append(stack_quality_changes)
|
||||
self._replaceQualityOrQualityChangesInStack(stack, stack_quality, postpone_emit = True)
|
||||
self._replaceQualityOrQualityChangesInStack(stack, stack_quality_changes, postpone_emit = True)
|
||||
self._replaceQualityOrQualityChangesInStack(stack, stack_quality)
|
||||
self._replaceQualityOrQualityChangesInStack(stack, stack_quality_changes)
|
||||
|
||||
# Send emits that are postponed in replaceContainer.
|
||||
# Here the stacks are finished replacing and every value can be resolved based on the current state.
|
||||
|
@ -1057,7 +1072,7 @@ class MachineManager(QObject):
|
|||
|
||||
@pyqtSlot(str, str)
|
||||
def renameMachine(self, machine_id, new_name):
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = machine_id)
|
||||
containers = ContainerRegistry.getInstance().findContainerStacks(id = machine_id)
|
||||
if containers:
|
||||
new_name = self._createUniqueName("machine", containers[0].getName(), new_name, containers[0].getBottom().getName())
|
||||
containers[0].setName(new_name)
|
||||
|
@ -1070,13 +1085,13 @@ class MachineManager(QObject):
|
|||
|
||||
ExtruderManager.getInstance().removeMachineExtruders(machine_id)
|
||||
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(type = "user", machine = machine_id)
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(type = "user", machine = machine_id)
|
||||
for container in containers:
|
||||
UM.Settings.ContainerRegistry.getInstance().removeContainer(container.getId())
|
||||
UM.Settings.ContainerRegistry.getInstance().removeContainer(machine_id)
|
||||
ContainerRegistry.getInstance().removeContainer(container.getId())
|
||||
ContainerRegistry.getInstance().removeContainer(machine_id)
|
||||
|
||||
if activate_new_machine:
|
||||
stacks = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(type = "machine")
|
||||
stacks = ContainerRegistry.getInstance().findContainerStacks(type = "machine")
|
||||
if stacks:
|
||||
Application.getInstance().setGlobalContainerStack(stacks[0])
|
||||
|
||||
|
@ -1117,7 +1132,7 @@ class MachineManager(QObject):
|
|||
# \returns DefinitionID (string) if found, None otherwise
|
||||
@pyqtSlot(str, result = str)
|
||||
def getDefinitionByMachineId(self, machine_id):
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id=machine_id)
|
||||
containers = ContainerRegistry.getInstance().findContainerStacks(id=machine_id)
|
||||
if containers:
|
||||
return containers[0].getBottom().getId()
|
||||
|
||||
|
@ -1128,13 +1143,13 @@ class MachineManager(QObject):
|
|||
def _updateVariantContainer(self, definition):
|
||||
if not definition.getMetaDataEntry("has_variants"):
|
||||
return self._empty_variant_container
|
||||
machine_definition_id = UM.Application.getInstance().getMachineManager().getQualityDefinitionId(definition)
|
||||
machine_definition_id = Application.getInstance().getMachineManager().getQualityDefinitionId(definition)
|
||||
containers = []
|
||||
preferred_variant = definition.getMetaDataEntry("preferred_variant")
|
||||
if preferred_variant:
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(type = "variant", definition = machine_definition_id, id = preferred_variant)
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(type = "variant", definition = machine_definition_id, id = preferred_variant)
|
||||
if not containers:
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(type = "variant", definition = machine_definition_id)
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(type = "variant", definition = machine_definition_id)
|
||||
|
||||
if containers:
|
||||
return containers[0]
|
||||
|
@ -1162,23 +1177,23 @@ class MachineManager(QObject):
|
|||
if preferred_material:
|
||||
search_criteria["id"] = preferred_material
|
||||
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(**search_criteria)
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(**search_criteria)
|
||||
if containers:
|
||||
return containers[0]
|
||||
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(**search_criteria)
|
||||
if "variant" in search_criteria or "id" in search_criteria:
|
||||
# If a material by this name can not be found, try a wider set of search criteria
|
||||
search_criteria.pop("variant", None)
|
||||
search_criteria.pop("id", None)
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(**search_criteria)
|
||||
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(**search_criteria)
|
||||
if containers:
|
||||
return containers[0]
|
||||
Logger.log("w", "Unable to find a material container with provided criteria, returning an empty one instead.")
|
||||
return self._empty_material_container
|
||||
|
||||
def _updateQualityContainer(self, definition, variant_container, material_container = None, preferred_quality_name = None):
|
||||
container_registry = UM.Settings.ContainerRegistry.getInstance()
|
||||
container_registry = ContainerRegistry.getInstance()
|
||||
search_criteria = { "type": "quality" }
|
||||
|
||||
if definition.getMetaDataEntry("has_machine_quality"):
|
||||
|
@ -1261,7 +1276,7 @@ class MachineManager(QObject):
|
|||
# \param preferred_quality_changes_name The name of the quality-changes to
|
||||
# pick, if any such quality-changes profile is available.
|
||||
def _updateQualityChangesContainer(self, quality_type, preferred_quality_changes_name = None):
|
||||
container_registry = UM.Settings.ContainerRegistry.getInstance() # Cache.
|
||||
container_registry = ContainerRegistry.getInstance() # Cache.
|
||||
search_criteria = { "type": "quality_changes" }
|
||||
|
||||
search_criteria["quality"] = quality_type
|
||||
|
@ -1289,3 +1304,8 @@ class MachineManager(QObject):
|
|||
|
||||
def _onQualityNameChanged(self):
|
||||
self.activeQualityChanged.emit()
|
||||
|
||||
def _getContainerChangedSignals(self):
|
||||
stacks = ExtruderManager.getInstance().getActiveExtruderStacks()
|
||||
stacks.append(self._global_container_stack)
|
||||
return [ s.containersChanged for s in stacks ]
|
||||
|
|
|
@ -7,8 +7,8 @@ import os #For statvfs.
|
|||
import urllib #To escape machine names for how they're saved to file.
|
||||
|
||||
import UM.Resources
|
||||
import UM.Settings.ContainerRegistry
|
||||
import UM.Settings.InstanceContainer
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
from UM.Settings.InstanceContainer import InstanceContainer
|
||||
|
||||
## Are machine names valid?
|
||||
#
|
||||
|
@ -22,7 +22,7 @@ class MachineNameValidator(QObject):
|
|||
filename_max_length = os.statvfs(UM.Resources.getDataStoragePath()).f_namemax
|
||||
except AttributeError: #Doesn't support statvfs. Probably because it's not a Unix system.
|
||||
filename_max_length = 255 #Assume it's Windows on NTFS.
|
||||
machine_name_max_length = filename_max_length - len("_current_settings.") - len(UM.Settings.ContainerRegistry.getMimeTypeForContainer(UM.Settings.InstanceContainer).preferredSuffix)
|
||||
machine_name_max_length = filename_max_length - len("_current_settings.") - len(ContainerRegistry.getMimeTypeForContainer(InstanceContainer).preferredSuffix)
|
||||
# Characters that urllib.parse.quote_plus escapes count for 12! So now
|
||||
# we must devise a regex that allows only 12 normal characters or 1
|
||||
# special character, and that up to [machine_name_max_length / 12] times.
|
||||
|
@ -45,7 +45,7 @@ class MachineNameValidator(QObject):
|
|||
except AttributeError: #Doesn't support statvfs. Probably because it's not a Unix system.
|
||||
filename_max_length = 255 #Assume it's Windows on NTFS.
|
||||
escaped_name = urllib.parse.quote_plus(name)
|
||||
current_settings_filename = escaped_name + "_current_settings." + UM.Settings.ContainerRegistry.getMimeTypeForContainer(UM.Settings.InstanceContainer).preferredSuffix
|
||||
current_settings_filename = escaped_name + "_current_settings." + ContainerRegistry.getMimeTypeForContainer(InstanceContainer).preferredSuffix
|
||||
if len(current_settings_filename) > filename_max_length:
|
||||
return QValidator.Invalid
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# Copyright (c) 2016 Ultimaker B.V.
|
||||
# Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import UM.Settings.Models
|
||||
from UM.Settings.Models.SettingVisibilityHandler import SettingVisibilityHandler
|
||||
|
||||
class MaterialSettingsVisibilityHandler(UM.Settings.Models.SettingVisibilityHandler):
|
||||
class MaterialSettingsVisibilityHandler(SettingVisibilityHandler):
|
||||
def __init__(self, parent = None, *args, **kwargs):
|
||||
super().__init__(parent = parent, *args, **kwargs)
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class ProfilesModel(InstanceContainersModel):
|
|||
ProfilesModel.__instance = cls()
|
||||
return ProfilesModel.__instance
|
||||
|
||||
__instance = None
|
||||
__instance = None # type: "ProfilesModel"
|
||||
|
||||
## Fetch the list of containers to display.
|
||||
#
|
||||
|
|
|
@ -5,15 +5,14 @@ import collections
|
|||
|
||||
from PyQt5.QtCore import pyqtProperty, pyqtSignal, Qt
|
||||
|
||||
import UM.Application
|
||||
import UM.Logger
|
||||
import UM.Qt
|
||||
import UM.Settings
|
||||
from UM.i18n import i18nCatalog
|
||||
from UM.Application import Application
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
|
||||
import os
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
|
||||
|
||||
class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
||||
KeyRole = Qt.UserRole + 1
|
||||
|
@ -27,7 +26,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
|||
def __init__(self, parent = None):
|
||||
super().__init__(parent = parent)
|
||||
|
||||
self._container_registry = UM.Settings.ContainerRegistry.getInstance()
|
||||
self._container_registry = ContainerRegistry.getInstance()
|
||||
|
||||
self._extruder_id = None
|
||||
self._extruder_definition_id = None
|
||||
|
@ -94,7 +93,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
|||
items = []
|
||||
|
||||
settings = collections.OrderedDict()
|
||||
definition_container = UM.Application.getInstance().getGlobalContainerStack().getBottom()
|
||||
definition_container = Application.getInstance().getGlobalContainerStack().getBottom()
|
||||
|
||||
containers = self._container_registry.findInstanceContainers(id = self._quality_id)
|
||||
if not containers:
|
||||
|
@ -122,7 +121,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
|||
quality_container = quality_container[0]
|
||||
|
||||
quality_type = quality_container.getMetaDataEntry("quality_type")
|
||||
definition_id = UM.Application.getInstance().getMachineManager().getQualityDefinitionId(quality_container.getDefinition())
|
||||
definition_id = Application.getInstance().getMachineManager().getQualityDefinitionId(quality_container.getDefinition())
|
||||
definition = quality_container.getDefinition()
|
||||
|
||||
# Check if the definition container has a translation file.
|
||||
|
@ -169,7 +168,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
|||
if self._extruder_definition_id != "":
|
||||
extruder_definitions = self._container_registry.findDefinitionContainers(id = self._extruder_definition_id)
|
||||
if extruder_definitions:
|
||||
criteria["extruder"] = UM.Application.getInstance().getMachineManager().getQualityDefinitionId(extruder_definitions[0])
|
||||
criteria["extruder"] = Application.getInstance().getMachineManager().getQualityDefinitionId(extruder_definitions[0])
|
||||
criteria["name"] = quality_changes_container.getName()
|
||||
else:
|
||||
criteria["extruder"] = None
|
||||
|
@ -178,7 +177,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
|||
if changes:
|
||||
containers.extend(changes)
|
||||
|
||||
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
is_multi_extrusion = global_container_stack.getProperty("machine_extruder_count", "value") > 1
|
||||
|
||||
current_category = ""
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
|
||||
from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal
|
||||
from UM.FlameProfiler import pyqtSlot
|
||||
import UM.Settings
|
||||
from UM.Application import Application
|
||||
import cura.Settings
|
||||
from UM.Logger import Logger
|
||||
|
||||
|
||||
|
@ -14,6 +12,12 @@ from UM.Logger import Logger
|
|||
# because some profiles tend to have 'hardcoded' values that break our inheritance. A good example of that are the
|
||||
# speed settings. If all the children of print_speed have a single value override, changing the speed won't
|
||||
# actually do anything, as only the 'leaf' settings are used by the engine.
|
||||
from UM.Settings.ContainerStack import ContainerStack
|
||||
from UM.Settings.SettingFunction import SettingFunction
|
||||
from UM.Settings.SettingInstance import InstanceState
|
||||
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
||||
class SettingInheritanceManager(QObject):
|
||||
def __init__(self, parent = None):
|
||||
super().__init__(parent)
|
||||
|
@ -23,7 +27,7 @@ class SettingInheritanceManager(QObject):
|
|||
self._active_container_stack = None
|
||||
self._onGlobalContainerChanged()
|
||||
|
||||
cura.Settings.ExtruderManager.getInstance().activeExtruderChanged.connect(self._onActiveExtruderChanged)
|
||||
ExtruderManager.getInstance().activeExtruderChanged.connect(self._onActiveExtruderChanged)
|
||||
self._onActiveExtruderChanged()
|
||||
|
||||
settingsWithIntheritanceChanged = pyqtSignal()
|
||||
|
@ -46,7 +50,7 @@ class SettingInheritanceManager(QObject):
|
|||
multi_extrusion = self._global_container_stack.getProperty("machine_extruder_count", "value") > 1
|
||||
if not multi_extrusion:
|
||||
return self._settings_with_inheritance_warning
|
||||
extruder = cura.Settings.ExtruderManager.getInstance().getExtruderStack(extruder_index)
|
||||
extruder = ExtruderManager.getInstance().getExtruderStack(extruder_index)
|
||||
if not extruder:
|
||||
Logger.log("w", "Unable to find extruder for current machine with index %s", extruder_index)
|
||||
return []
|
||||
|
@ -73,7 +77,7 @@ class SettingInheritanceManager(QObject):
|
|||
self._update()
|
||||
|
||||
def _onActiveExtruderChanged(self):
|
||||
new_active_stack = cura.Settings.ExtruderManager.getInstance().getActiveExtruderStack()
|
||||
new_active_stack = ExtruderManager.getInstance().getActiveExtruderStack()
|
||||
if not new_active_stack:
|
||||
new_active_stack = self._global_container_stack
|
||||
|
||||
|
@ -139,14 +143,14 @@ class SettingInheritanceManager(QObject):
|
|||
return self._settings_with_inheritance_warning
|
||||
|
||||
## Check if a setting has an inheritance function that is overwritten
|
||||
def _settingIsOverwritingInheritance(self, key, stack = None):
|
||||
def _settingIsOverwritingInheritance(self, key: str, stack: ContainerStack = None) -> bool:
|
||||
has_setting_function = False
|
||||
if not stack:
|
||||
stack = self._active_container_stack
|
||||
containers = []
|
||||
|
||||
## Check if the setting has a user state. If not, it is never overwritten.
|
||||
has_user_state = stack.getProperty(key, "state") == UM.Settings.InstanceState.User
|
||||
has_user_state = stack.getProperty(key, "state") == InstanceState.User
|
||||
if not has_user_state:
|
||||
return False
|
||||
|
||||
|
@ -155,7 +159,7 @@ class SettingInheritanceManager(QObject):
|
|||
return False
|
||||
|
||||
## Also check if the top container is not a setting function (this happens if the inheritance is restored).
|
||||
if isinstance(stack.getTop().getProperty(key, "value"), UM.Settings.SettingFunction):
|
||||
if isinstance(stack.getTop().getProperty(key, "value"), SettingFunction):
|
||||
return False
|
||||
|
||||
## Mash all containers for all the stacks together.
|
||||
|
@ -170,7 +174,7 @@ class SettingInheritanceManager(QObject):
|
|||
continue
|
||||
if value is not None:
|
||||
# If a setting doesn't use any keys, it won't change it's value, so treat it as if it's a fixed value
|
||||
has_setting_function = isinstance(value, UM.Settings.SettingFunction)
|
||||
has_setting_function = isinstance(value, SettingFunction)
|
||||
if has_setting_function:
|
||||
for setting_key in value.getUsedSettingKeys():
|
||||
if setting_key in self._active_container_stack.getAllKeys():
|
||||
|
|
|
@ -10,10 +10,10 @@ from UM.Settings.InstanceContainer import InstanceContainer
|
|||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
import UM.Logger
|
||||
|
||||
import cura.Settings
|
||||
|
||||
from UM.Application import Application
|
||||
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
||||
## A decorator that adds a container stack to a Node. This stack should be queried for all settings regarding
|
||||
# the linked node. The Stack in question will refer to the global stack (so that settings that are not defined by
|
||||
# this stack still resolve.
|
||||
|
@ -29,8 +29,8 @@ class SettingOverrideDecorator(SceneNodeDecorator):
|
|||
self._instance = InstanceContainer(container_id = "SettingOverrideInstanceContainer")
|
||||
self._stack.addContainer(self._instance)
|
||||
|
||||
if cura.Settings.ExtruderManager.getInstance().extruderCount > 1:
|
||||
self._extruder_stack = cura.Settings.ExtruderManager.getInstance().getExtruderStack(0).getId()
|
||||
if ExtruderManager.getInstance().extruderCount > 1:
|
||||
self._extruder_stack = ExtruderManager.getInstance().getExtruderStack(0).getId()
|
||||
else:
|
||||
self._extruder_stack = None
|
||||
|
||||
|
|
|
@ -1,18 +1,2 @@
|
|||
# Copyright (c) 2016 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
from .MaterialSettingsVisibilityHandler import MaterialSettingsVisibilityHandler
|
||||
from .ContainerManager import ContainerManager
|
||||
from .ContainerSettingsModel import ContainerSettingsModel
|
||||
from .CuraContainerRegistry import CuraContainerRegistry
|
||||
from .ExtruderManager import ExtruderManager
|
||||
from .ExtrudersModel import ExtrudersModel
|
||||
from .MachineManager import MachineManager
|
||||
from .MachineNameValidator import MachineNameValidator
|
||||
from .MaterialSettingsVisibilityHandler import MaterialSettingsVisibilityHandler
|
||||
from .SettingOverrideDecorator import SettingOverrideDecorator
|
||||
from .QualitySettingsModel import QualitySettingsModel
|
||||
from .SettingInheritanceManager import SettingInheritanceManager
|
||||
from .ProfilesModel import ProfilesModel
|
||||
from .QualityAndUserProfilesModel import QualityAndUserProfilesModel
|
||||
from .UserProfilesModel import UserProfilesModel
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
# Copyright (c) 2015 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
|
@ -56,7 +55,11 @@ if Platform.isWindows() and hasattr(sys, "frozen"):
|
|||
sys.stderr = open(os.path.join(dirpath, "stderr.log"), "w")
|
||||
|
||||
# Force an instance of CuraContainerRegistry to be created and reused later.
|
||||
cura.Settings.CuraContainerRegistry.getInstance()
|
||||
cura.Settings.CuraContainerRegistry.CuraContainerRegistry.getInstance()
|
||||
|
||||
# This prestart up check is needed to determine if we should start the application at all.
|
||||
if not cura.CuraApplication.CuraApplication.preStartUp():
|
||||
sys.exit(0)
|
||||
|
||||
app = cura.CuraApplication.CuraApplication.getInstance()
|
||||
app.run()
|
||||
|
|
|
@ -11,14 +11,15 @@ from UM.Math.Vector import Vector
|
|||
from UM.Mesh.MeshBuilder import MeshBuilder
|
||||
from UM.Mesh.MeshReader import MeshReader
|
||||
from UM.Scene.GroupDecorator import GroupDecorator
|
||||
import UM.Application
|
||||
from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
|
||||
from UM.Application import Application
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
from cura.QualityManager import QualityManager
|
||||
from UM.Scene.SceneNode import SceneNode
|
||||
|
||||
MYPY = False
|
||||
try:
|
||||
if not MYPY:
|
||||
import xml.etree.cElementTree as ET
|
||||
except ImportError:
|
||||
Logger.log("w", "Unable to load cElementTree, switching to slower version")
|
||||
|
@ -201,7 +202,7 @@ class ThreeMFReader(MeshReader):
|
|||
|
||||
build_item_node.setTransformation(transform_matrix)
|
||||
|
||||
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
|
||||
# Create a transformation Matrix to convert from 3mf worldspace into ours.
|
||||
# First step: flip the y and z axis.
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
# Copyright (c) 2015 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
from typing import Dict
|
||||
|
||||
from . import ThreeMFReader
|
||||
from . import ThreeMFWorkspaceReader
|
||||
from UM.i18n import i18nCatalog
|
||||
import UM.Platform
|
||||
from UM.Platform import Platform
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
|
||||
def getMetaData():
|
||||
def getMetaData() -> Dict:
|
||||
# Workarround for osx not supporting double file extensions correclty.
|
||||
if UM.Platform.isOSX():
|
||||
if Platform.isOSX():
|
||||
workspace_extension = "3mf"
|
||||
else:
|
||||
workspace_extension = "curaproject.3mf"
|
||||
|
|
|
@ -7,7 +7,9 @@ from UM.Logger import Logger
|
|||
from UM.Math.Matrix import Matrix
|
||||
from UM.Application import Application
|
||||
|
||||
MYPY = False
|
||||
try:
|
||||
if not MYPY:
|
||||
import xml.etree.cElementTree as ET
|
||||
except ImportError:
|
||||
Logger.log("w", "Unable to load cElementTree, switching to slower version")
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
[2.5.0]
|
||||
*Included PauseBackendPlugin. This enables pausing the backend and manually start the backend. Thanks to community member Aldo Hoeben for this feature.
|
||||
|
||||
[2.4.0]
|
||||
*Project saving & opening
|
||||
You can now save your build plate configuration - with all your active machine’s meshes and settings. When you reopen the project file, you’ll find that the build plate configuration and all settings will be exactly as you last left them when you saved the project.
|
||||
|
@ -24,7 +27,7 @@ When slicing is blocked by settings with error values, a message now appears, cl
|
|||
The initial and final printing temperatures reduce the amount of oozing during PLA-PLA, PLA-PVA and Nylon-PVA prints. This means printing a prime tower is now optional (except for CPE and ABS at the moment). The new Ultimaker 3 printing profiles ensure increased reliability and shorter print time.
|
||||
|
||||
*Initial Layer Printing Temperature
|
||||
Initial and final printing temperature settings have been tuned for higher quality results.
|
||||
Initial and final printing temperature settings have been tuned for higher quality results. For all materials the initial print temperature is 5 degrees above the default value.
|
||||
|
||||
*Printing temperature of the materials
|
||||
The printing temperature of the materials in the material profiles is now the same as the printing temperature for the Normal Quality profile.
|
||||
|
|
|
@ -15,12 +15,8 @@ from UM.Platform import Platform
|
|||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||
|
||||
|
||||
import cura.Settings
|
||||
|
||||
from cura.OneAtATimeIterator import OneAtATimeIterator
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
from . import ProcessSlicedLayersJob
|
||||
from . import ProcessGCodeJob
|
||||
from . import StartSliceJob
|
||||
|
||||
import os
|
||||
|
@ -72,6 +68,7 @@ class CuraEngineBackend(Backend):
|
|||
self._scene.sceneChanged.connect(self._onSceneChanged)
|
||||
|
||||
self._pause_slicing = False
|
||||
self._block_slicing = False # continueSlicing does not have effect if True
|
||||
|
||||
# Workaround to disable layer view processing if layer view is not active.
|
||||
self._layer_view_active = False
|
||||
|
@ -86,7 +83,7 @@ class CuraEngineBackend(Backend):
|
|||
self._onGlobalStackChanged()
|
||||
|
||||
self._active_extruder_stack = None
|
||||
cura.Settings.ExtruderManager.getInstance().activeExtruderChanged.connect(self._onActiveExtruderChanged)
|
||||
ExtruderManager.getInstance().activeExtruderChanged.connect(self._onActiveExtruderChanged)
|
||||
self._onActiveExtruderChanged()
|
||||
|
||||
# When you update a setting and other settings get changed through inheritance, many propertyChanged signals are fired.
|
||||
|
@ -154,7 +151,7 @@ class CuraEngineBackend(Backend):
|
|||
## Perform a slice of the scene.
|
||||
def slice(self):
|
||||
Logger.log("d", "Starting slice job...")
|
||||
if self._pause_slicing:
|
||||
if self._pause_slicing or self._block_slicing:
|
||||
return
|
||||
self._slice_start_time = time()
|
||||
if not self._enabled or not self._global_container_stack: # We shouldn't be slicing.
|
||||
|
@ -191,12 +188,13 @@ class CuraEngineBackend(Backend):
|
|||
|
||||
|
||||
def pauseSlicing(self):
|
||||
if not self._pause_slicing:
|
||||
self.close()
|
||||
self._pause_slicing = True
|
||||
self.backendStateChange.emit(BackendState.Disabled)
|
||||
|
||||
def continueSlicing(self):
|
||||
if self._pause_slicing:
|
||||
if self._pause_slicing and not self._block_slicing:
|
||||
self._pause_slicing = False
|
||||
self.backendStateChange.emit(BackendState.NotStarted)
|
||||
|
||||
|
@ -315,15 +313,19 @@ class CuraEngineBackend(Backend):
|
|||
if source is self._scene.getRoot():
|
||||
return
|
||||
|
||||
should_pause = False
|
||||
should_pause = self._pause_slicing
|
||||
block_slicing = False
|
||||
for node in DepthFirstIterator(self._scene.getRoot()):
|
||||
if node.callDecoration("isBlockSlicing"):
|
||||
should_pause = True
|
||||
block_slicing = True
|
||||
gcode_list = node.callDecoration("getGCodeList")
|
||||
if gcode_list is not None:
|
||||
self._scene.gcode_list = gcode_list
|
||||
|
||||
if should_pause:
|
||||
self._block_slicing = block_slicing
|
||||
|
||||
if should_pause or self._block_slicing:
|
||||
self.pauseSlicing()
|
||||
else:
|
||||
self.continueSlicing()
|
||||
|
@ -515,7 +517,7 @@ class CuraEngineBackend(Backend):
|
|||
if self._active_extruder_stack:
|
||||
self._active_extruder_stack.containersChanged.disconnect(self._onChanged)
|
||||
|
||||
self._active_extruder_stack = cura.Settings.ExtruderManager.getInstance().getActiveExtruderStack()
|
||||
self._active_extruder_stack = ExtruderManager.getInstance().getActiveExtruderStack()
|
||||
if self._active_extruder_stack:
|
||||
self._active_extruder_stack.containersChanged.connect(self._onChanged)
|
||||
|
||||
|
|
|
@ -16,8 +16,7 @@ from UM.Settings.Validator import ValidatorState
|
|||
from UM.Settings.SettingRelation import RelationType
|
||||
|
||||
from cura.OneAtATimeIterator import OneAtATimeIterator
|
||||
|
||||
import cura.Settings
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
||||
class StartJobResult(IntEnum):
|
||||
Finished = 1
|
||||
|
@ -84,7 +83,7 @@ class StartSliceJob(Job):
|
|||
self.setResult(StartJobResult.BuildPlateError)
|
||||
return
|
||||
|
||||
for extruder_stack in cura.Settings.ExtruderManager.getInstance().getMachineExtruders(stack.getId()):
|
||||
for extruder_stack in ExtruderManager.getInstance().getMachineExtruders(stack.getId()):
|
||||
material = extruder_stack.findContainer({"type": "material"})
|
||||
if material:
|
||||
if material.getMetaDataEntry("compatible") == False:
|
||||
|
@ -149,7 +148,7 @@ class StartSliceJob(Job):
|
|||
self._buildGlobalSettingsMessage(stack)
|
||||
self._buildGlobalInheritsStackMessage(stack)
|
||||
|
||||
for extruder_stack in cura.Settings.ExtruderManager.getInstance().getMachineExtruders(stack.getId()):
|
||||
for extruder_stack in ExtruderManager.getInstance().getMachineExtruders(stack.getId()):
|
||||
self._buildExtruderMessage(extruder_stack)
|
||||
|
||||
for group in object_groups:
|
||||
|
|
|
@ -4,13 +4,10 @@
|
|||
from UM.Mesh.MeshWriter import MeshWriter
|
||||
from UM.Logger import Logger
|
||||
from UM.Application import Application
|
||||
import UM.Settings.ContainerRegistry
|
||||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
||||
from UM.Settings.InstanceContainer import InstanceContainer
|
||||
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
||||
import re #For escaping characters in the settings.
|
||||
import json
|
||||
import copy
|
||||
|
|
|
@ -6,11 +6,13 @@ from UM.FlameProfiler import pyqtSlot
|
|||
|
||||
from cura.MachineAction import MachineAction
|
||||
|
||||
import UM.Application
|
||||
import UM.Settings.InstanceContainer
|
||||
import UM.Settings.DefinitionContainer
|
||||
import UM.Settings.ContainerRegistry
|
||||
import UM.Logger
|
||||
from UM.Application import Application
|
||||
from UM.Settings.InstanceContainer import InstanceContainer
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
from UM.Settings.DefinitionContainer import DefinitionContainer
|
||||
from UM.Logger import Logger
|
||||
|
||||
from cura.Settings.CuraContainerRegistry import CuraContainerRegistry
|
||||
|
||||
import UM.i18n
|
||||
catalog = UM.i18n.i18nCatalog("cura")
|
||||
|
@ -25,11 +27,11 @@ class MachineSettingsAction(MachineAction):
|
|||
|
||||
self._container_index = 0
|
||||
|
||||
self._container_registry = UM.Settings.ContainerRegistry.getInstance()
|
||||
self._container_registry = ContainerRegistry.getInstance()
|
||||
self._container_registry.containerAdded.connect(self._onContainerAdded)
|
||||
|
||||
def _reset(self):
|
||||
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if not global_container_stack:
|
||||
return
|
||||
|
||||
|
@ -45,7 +47,7 @@ class MachineSettingsAction(MachineAction):
|
|||
self.containerIndexChanged.emit()
|
||||
|
||||
def _createDefinitionChangesContainer(self, global_container_stack, container_index = None):
|
||||
definition_changes_container = UM.Settings.InstanceContainer(global_container_stack.getName() + "_settings")
|
||||
definition_changes_container = InstanceContainer(global_container_stack.getName() + "_settings")
|
||||
definition = global_container_stack.getBottom()
|
||||
definition_changes_container.setDefinition(definition)
|
||||
definition_changes_container.addMetaDataEntry("type", "definition_changes")
|
||||
|
@ -64,24 +66,24 @@ class MachineSettingsAction(MachineAction):
|
|||
|
||||
def _onContainerAdded(self, container):
|
||||
# Add this action as a supported action to all machine definitions
|
||||
if isinstance(container, UM.Settings.DefinitionContainer) and container.getMetaDataEntry("type") == "machine":
|
||||
if isinstance(container, DefinitionContainer) and container.getMetaDataEntry("type") == "machine":
|
||||
if container.getProperty("machine_extruder_count", "value") > 1:
|
||||
# Multiextruder printers are not currently supported
|
||||
UM.Logger.log("d", "Not attaching MachineSettingsAction to %s; Multi-extrusion printers are not supported", container.getId())
|
||||
Logger.log("d", "Not attaching MachineSettingsAction to %s; Multi-extrusion printers are not supported", container.getId())
|
||||
return
|
||||
|
||||
UM.Application.getInstance().getMachineActionManager().addSupportedAction(container.getId(), self.getKey())
|
||||
Application.getInstance().getMachineActionManager().addSupportedAction(container.getId(), self.getKey())
|
||||
|
||||
@pyqtSlot()
|
||||
def forceUpdate(self):
|
||||
# Force rebuilding the build volume by reloading the global container stack.
|
||||
# This is a bit of a hack, but it seems quick enough.
|
||||
UM.Application.getInstance().globalContainerStackChanged.emit()
|
||||
Application.getInstance().globalContainerStackChanged.emit()
|
||||
|
||||
@pyqtSlot()
|
||||
def updateHasMaterialsMetadata(self):
|
||||
# Updates the has_materials metadata flag after switching gcode flavor
|
||||
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if global_container_stack:
|
||||
definition = global_container_stack.getBottom()
|
||||
if definition.getProperty("machine_gcode_flavor", "value") == "UltiGCode" and not definition.getMetaDataEntry("has_materials", False):
|
||||
|
@ -111,4 +113,4 @@ class MachineSettingsAction(MachineAction):
|
|||
empty_material = self._container_registry.findInstanceContainers(id = "empty_material")[0]
|
||||
global_container_stack.replaceContainer(material_index, empty_material)
|
||||
|
||||
UM.Application.getInstance().globalContainerStackChanged.emit()
|
||||
Application.getInstance().globalContainerStackChanged.emit()
|
||||
|
|
13
plugins/PauseBackendPlugin/CMakeLists.txt
Normal file
13
plugins/PauseBackendPlugin/CMakeLists.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
project(PauseBackendPlugin)
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
install(FILES
|
||||
__init__.py
|
||||
PauseBackend.py
|
||||
PauseBackend.qml
|
||||
pause.svg
|
||||
play.svg
|
||||
LICENSE
|
||||
README.md
|
||||
DESTINATION lib/cura/plugins/PauseBackendPlugin
|
||||
)
|
661
plugins/PauseBackendPlugin/LICENSE
Normal file
661
plugins/PauseBackendPlugin/LICENSE
Normal file
|
@ -0,0 +1,661 @@
|
|||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
53
plugins/PauseBackendPlugin/PauseBackend.py
Normal file
53
plugins/PauseBackendPlugin/PauseBackend.py
Normal file
|
@ -0,0 +1,53 @@
|
|||
# Copyright ;(c) 2016 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
from PyQt5.QtCore import QTimer
|
||||
|
||||
from UM.Extension import Extension
|
||||
from UM.Application import Application
|
||||
from UM.PluginRegistry import PluginRegistry
|
||||
from UM.Logger import Logger
|
||||
|
||||
from UM.Backend.Backend import BackendState
|
||||
|
||||
from PyQt5.QtQml import QQmlComponent, QQmlContext
|
||||
from PyQt5.QtCore import QUrl, pyqtSlot, QObject
|
||||
|
||||
import os.path
|
||||
|
||||
class PauseBackend(QObject, Extension):
|
||||
def __init__(self, parent = None):
|
||||
super().__init__(parent = parent)
|
||||
|
||||
self._additional_component = None
|
||||
self._additional_components_view = None
|
||||
|
||||
Application.getInstance().engineCreatedSignal.connect(self._createAdditionalComponentsView)
|
||||
|
||||
def _createAdditionalComponentsView(self):
|
||||
Logger.log("d", "Creating additional ui components for Pause Backend plugin.")
|
||||
|
||||
path = QUrl.fromLocalFile(os.path.join(PluginRegistry.getInstance().getPluginPath("PauseBackendPlugin"), "PauseBackend.qml"))
|
||||
self._additional_component = QQmlComponent(Application.getInstance()._engine, path)
|
||||
|
||||
# We need access to engine (although technically we can't)
|
||||
self._additional_components_context = QQmlContext(Application.getInstance()._engine.rootContext())
|
||||
self._additional_components_context.setContextProperty("manager", self)
|
||||
|
||||
self._additional_components_view = self._additional_component.create(self._additional_components_context)
|
||||
if not self._additional_components_view:
|
||||
Logger.log("w", "Could not create additional components for Pause Backend plugin.")
|
||||
return
|
||||
|
||||
Application.getInstance().addAdditionalComponent("saveButton", self._additional_components_view.findChild(QObject, "pauseResumeButton"))
|
||||
|
||||
@pyqtSlot()
|
||||
def pauseBackend(self):
|
||||
backend = Application.getInstance().getBackend()
|
||||
backend.pauseSlicing()
|
||||
|
||||
@pyqtSlot()
|
||||
def resumeBackend(self):
|
||||
backend = Application.getInstance().getBackend()
|
||||
backend.continueSlicing()
|
||||
backend.forceSlice()
|
72
plugins/PauseBackendPlugin/PauseBackend.qml
Normal file
72
plugins/PauseBackendPlugin/PauseBackend.qml
Normal file
|
@ -0,0 +1,72 @@
|
|||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Window 2.1
|
||||
|
||||
Item
|
||||
{
|
||||
id: base
|
||||
|
||||
Button
|
||||
{
|
||||
id: pauseResumeButton
|
||||
objectName: "pauseResumeButton"
|
||||
|
||||
property bool paused: false
|
||||
|
||||
height: UM.Theme.getSize("save_button_save_to_button").height
|
||||
width: height
|
||||
|
||||
tooltip: paused ? catalog.i18nc("@info:tooltip", "Resume automatic slicing") : catalog.i18nc("@info:tooltip", "Pause automatic slicing")
|
||||
|
||||
style: ButtonStyle {
|
||||
background: Rectangle {
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: !control.enabled ? UM.Theme.getColor("action_button_disabled_border") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active_border") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border")
|
||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("save_button_text_margin").width / 2;
|
||||
width: parent.height
|
||||
height: parent.height
|
||||
|
||||
UM.RecolorImage {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width / 2
|
||||
height: parent.height / 2
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active_text") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_text") : UM.Theme.getColor("action_button_text");
|
||||
source: pauseResumeButton.paused ? "play.svg" : "pause.svg"
|
||||
}
|
||||
}
|
||||
label: Label{ }
|
||||
}
|
||||
|
||||
onClicked:
|
||||
{
|
||||
paused = !paused
|
||||
if(paused)
|
||||
{
|
||||
manager.pauseBackend()
|
||||
}
|
||||
else
|
||||
{
|
||||
manager.resumeBackend()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UM.I18nCatalog{id: catalog; name:"cura"}
|
||||
}
|
21
plugins/PauseBackendPlugin/__init__.py
Normal file
21
plugins/PauseBackendPlugin/__init__.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
# Copyright (c) 2016 Aldo Hoeben / fieldOfView.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
from . import PauseBackend
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
def getMetaData():
|
||||
return {
|
||||
"plugin": {
|
||||
"name": catalog.i18nc("@label", "Auto Save"),
|
||||
"author": "Ultimaker",
|
||||
"version": "2.3",
|
||||
"description": catalog.i18nc("@info:whatsthis", "Adds a button to pause automatic background slicing."),
|
||||
"api": 3
|
||||
},
|
||||
}
|
||||
|
||||
def register(app):
|
||||
return { "extension": PauseBackend.PauseBackend() }
|
1
plugins/PauseBackendPlugin/pause.svg
Normal file
1
plugins/PauseBackendPlugin/pause.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1664 192v1408q0 26-19 45t-45 19h-512q-26 0-45-19t-19-45v-1408q0-26 19-45t45-19h512q26 0 45 19t19 45zm-896 0v1408q0 26-19 45t-45 19h-512q-26 0-45-19t-19-45v-1408q0-26 19-45t45-19h512q26 0 45 19t19 45z"/></svg>
|
After Width: | Height: | Size: 309 B |
1
plugins/PauseBackendPlugin/play.svg
Normal file
1
plugins/PauseBackendPlugin/play.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1576 927l-1328 738q-23 13-39.5 3t-16.5-36v-1472q0-26 16.5-36t39.5 3l1328 738q23 13 23 31t-23 31z"/></svg>
|
After Width: | Height: | Size: 206 B |
|
@ -4,16 +4,17 @@
|
|||
from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal
|
||||
|
||||
from UM.Application import Application
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
from UM.Settings.SettingInstance import SettingInstance
|
||||
from UM.Logger import Logger
|
||||
import UM.Settings.Models
|
||||
import UM.Settings.Models.SettingVisibilityHandler
|
||||
|
||||
from cura.Settings.ExtruderManager import ExtruderManager #To get global-inherits-stack setting values from different extruders.
|
||||
from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
|
||||
|
||||
## The per object setting visibility handler ensures that only setting
|
||||
# definitions that have a matching instance Container are returned as visible.
|
||||
class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHandler):
|
||||
class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHandler.SettingVisibilityHandler):
|
||||
def __init__(self, parent = None, *args, **kwargs):
|
||||
super().__init__(parent = parent, *args, **kwargs)
|
||||
|
||||
|
@ -72,7 +73,7 @@ class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHand
|
|||
|
||||
# Use the found stack number to get the right stack to copy the value from.
|
||||
if stack_nr in ExtruderManager.getInstance().extruderIds:
|
||||
stack = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = ExtruderManager.getInstance().extruderIds[stack_nr])[0]
|
||||
stack = ContainerRegistry.getInstance().findContainerStacks(id = ExtruderManager.getInstance().extruderIds[stack_nr])[0]
|
||||
|
||||
# Use the raw property to set the value (so the inheritance doesn't break)
|
||||
if stack is not None:
|
||||
|
|
|
@ -8,7 +8,7 @@ catalog = i18nCatalog("cura")
|
|||
from . import RemovableDrivePlugin
|
||||
|
||||
import string
|
||||
import ctypes
|
||||
import ctypes # type: ignore
|
||||
from ctypes import wintypes # Using ctypes.wintypes in the code below does not seem to work
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# Copyright (c) 2015 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
from typing import Any
|
||||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
|
||||
|
@ -26,8 +27,8 @@ import json
|
|||
catalog = i18nCatalog("cura")
|
||||
|
||||
class SliceInfoJob(Job):
|
||||
data = None
|
||||
url = None
|
||||
data = None # type: Any
|
||||
url = None # type: str
|
||||
|
||||
def __init__(self, url, data):
|
||||
super().__init__()
|
||||
|
|
|
@ -12,12 +12,13 @@ from UM.Settings.Validator import ValidatorState
|
|||
from UM.Math.Color import Color
|
||||
from UM.View.GL.OpenGL import OpenGL
|
||||
|
||||
import cura.Settings
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
from cura.Settings.ExtrudersModel import ExtrudersModel
|
||||
|
||||
import math
|
||||
|
||||
## Standard view for mesh models.
|
||||
|
||||
class SolidView(View):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
@ -27,7 +28,7 @@ class SolidView(View):
|
|||
self._enabled_shader = None
|
||||
self._disabled_shader = None
|
||||
|
||||
self._extruders_model = cura.Settings.ExtrudersModel()
|
||||
self._extruders_model = ExtrudersModel()
|
||||
|
||||
def beginRendering(self):
|
||||
scene = self.getController().getScene()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2016 Ultimaker B.V.
|
||||
# Copyright (c) 2017 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
|
@ -8,7 +8,8 @@ from UM.Signal import signalemitter
|
|||
|
||||
from UM.Message import Message
|
||||
|
||||
import UM.Settings
|
||||
import UM.Settings.ContainerRegistry
|
||||
import UM.Version #To compare firmware version numbers.
|
||||
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice, ConnectionState
|
||||
import cura.Settings.ExtruderManager
|
||||
|
@ -97,6 +98,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
|
||||
self._material_ids = [""] * self._num_extruders
|
||||
self._hotend_ids = [""] * self._num_extruders
|
||||
self._target_bed_temperature = 0
|
||||
|
||||
self.setPriority(2) # Make sure the output device gets selected above local file output
|
||||
self.setName(key)
|
||||
|
@ -197,11 +199,11 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
|
||||
def _onAuthenticationRequired(self, reply, authenticator):
|
||||
if self._authentication_id is not None and self._authentication_key is not None:
|
||||
Logger.log("d", "Authentication was required. Setting up authenticator.")
|
||||
Logger.log("d", "Authentication was required. Setting up authenticator with ID %s",self._authentication_id )
|
||||
authenticator.setUser(self._authentication_id)
|
||||
authenticator.setPassword(self._authentication_key)
|
||||
else:
|
||||
Logger.log("d", "No authentication was required. The id is: %s", self._authentication_id)
|
||||
Logger.log("d", "No authentication was required. The ID is: %s", self._authentication_id)
|
||||
|
||||
def getProperties(self):
|
||||
return self._properties
|
||||
|
@ -220,12 +222,17 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
def getKey(self):
|
||||
return self._key
|
||||
|
||||
## Name of the printer (as returned from the zeroConf properties)
|
||||
## The IP address of the printer.
|
||||
@pyqtProperty(str, constant = True)
|
||||
def address(self):
|
||||
return self._properties.get(b"address", b"").decode("utf-8")
|
||||
|
||||
## Name of the printer (as returned from the ZeroConf properties)
|
||||
@pyqtProperty(str, constant = True)
|
||||
def name(self):
|
||||
return self._properties.get(b"name", b"").decode("utf-8")
|
||||
|
||||
## Firmware version (as returned from the zeroConf properties)
|
||||
## Firmware version (as returned from the ZeroConf properties)
|
||||
@pyqtProperty(str, constant=True)
|
||||
def firmwareVersion(self):
|
||||
return self._properties.get(b"firmware_version", b"").decode("utf-8")
|
||||
|
@ -235,6 +242,49 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
def ipAddress(self):
|
||||
return self._address
|
||||
|
||||
## Pre-heats the heated bed of the printer.
|
||||
#
|
||||
# \param temperature The temperature to heat the bed to, in degrees
|
||||
# Celsius.
|
||||
# \param duration How long the bed should stay warm, in seconds.
|
||||
@pyqtSlot(float, float)
|
||||
def preheatBed(self, temperature, duration):
|
||||
temperature = round(temperature) #The API doesn't allow floating point.
|
||||
duration = round(duration)
|
||||
if UM.Version.Version(self.firmwareVersion) < UM.Version.Version("3.5.92"): #Real bed pre-heating support is implemented from 3.5.92 and up.
|
||||
self.setTargetBedTemperature(temperature = temperature) #No firmware-side duration support then.
|
||||
return
|
||||
url = QUrl("http://" + self._address + self._api_prefix + "printer/bed/pre_heat")
|
||||
if duration > 0:
|
||||
data = """{"temperature": "%i", "timeout": "%i"}""" % (temperature, duration)
|
||||
else:
|
||||
data = """{"temperature": "%i"}""" % temperature
|
||||
put_request = QNetworkRequest(url)
|
||||
put_request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json")
|
||||
self._manager.put(put_request, data.encode())
|
||||
|
||||
## Cancels pre-heating the heated bed of the printer.
|
||||
#
|
||||
# If the bed is not pre-heated, nothing happens.
|
||||
@pyqtSlot()
|
||||
def cancelPreheatBed(self):
|
||||
self.preheatBed(temperature = 0, duration = 0)
|
||||
|
||||
## Changes the target bed temperature on the printer.
|
||||
#
|
||||
# /param temperature The new target temperature of the bed.
|
||||
def _setTargetBedTemperature(self, temperature):
|
||||
if self._target_bed_temperature == temperature:
|
||||
return
|
||||
self._target_bed_temperature = temperature
|
||||
self.targetBedTemperatureChanged.emit()
|
||||
|
||||
url = QUrl("http://" + self._address + self._api_prefix + "printer/bed/temperature/target")
|
||||
data = str(temperature)
|
||||
put_request = QNetworkRequest(url)
|
||||
put_request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json")
|
||||
self._manager.put(put_request, data.encode())
|
||||
|
||||
def _stopCamera(self):
|
||||
self._camera_timer.stop()
|
||||
if self._image_reply:
|
||||
|
@ -271,14 +321,14 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
if auth_state == AuthState.AuthenticationRequested:
|
||||
Logger.log("d", "Authentication state changed to authentication requested.")
|
||||
self.setAcceptsCommands(False)
|
||||
self.setConnectionText(i18n_catalog.i18nc("@info:status", "Connected over the network to {0}. Please approve the access request on the printer.").format(self.name))
|
||||
self.setConnectionText(i18n_catalog.i18nc("@info:status", "Connected over the network. Please approve the access request on the printer."))
|
||||
self._authentication_requested_message.show()
|
||||
self._authentication_request_active = True
|
||||
self._authentication_timer.start() # Start timer so auth will fail after a while.
|
||||
elif auth_state == AuthState.Authenticated:
|
||||
Logger.log("d", "Authentication state changed to authenticated")
|
||||
self.setAcceptsCommands(True)
|
||||
self.setConnectionText(i18n_catalog.i18nc("@info:status", "Connected over the network to {0}.").format(self.name))
|
||||
self.setConnectionText(i18n_catalog.i18nc("@info:status", "Connected over the network."))
|
||||
self._authentication_requested_message.hide()
|
||||
if self._authentication_request_active:
|
||||
self._authentication_succeeded_message.show()
|
||||
|
@ -291,7 +341,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
self.sendMaterialProfiles()
|
||||
elif auth_state == AuthState.AuthenticationDenied:
|
||||
self.setAcceptsCommands(False)
|
||||
self.setConnectionText(i18n_catalog.i18nc("@info:status", "Connected over the network to {0}. No access to control the printer.").format(self.name))
|
||||
self.setConnectionText(i18n_catalog.i18nc("@info:status", "Connected over the network. No access to control the printer."))
|
||||
self._authentication_requested_message.hide()
|
||||
if self._authentication_request_active:
|
||||
if self._authentication_timer.remainingTime() > 0:
|
||||
|
@ -466,6 +516,8 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
|
||||
bed_temperature = self._json_printer_state["bed"]["temperature"]["current"]
|
||||
self._setBedTemperature(bed_temperature)
|
||||
target_bed_temperature = self._json_printer_state["bed"]["temperature"]["target"]
|
||||
self._setTargetBedTemperature(target_bed_temperature)
|
||||
|
||||
head_x = self._json_printer_state["heads"][0]["position"]["x"]
|
||||
head_y = self._json_printer_state["heads"][0]["position"]["y"]
|
||||
|
@ -581,7 +633,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
remote_material_guid,
|
||||
material.getMetaDataEntry("GUID"))
|
||||
|
||||
remote_materials = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(type = "material", GUID = remote_material_guid, read_only = True)
|
||||
remote_materials = UM.Settings.ContainerRegistry.ContainerRegistry.getInstance().findInstanceContainers(type = "material", GUID = remote_material_guid, read_only = True)
|
||||
remote_material_name = "Unknown"
|
||||
if remote_materials:
|
||||
remote_material_name = remote_materials[0].getName()
|
||||
|
@ -643,9 +695,8 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
## Check if this machine was authenticated before.
|
||||
self._authentication_id = Application.getInstance().getGlobalContainerStack().getMetaDataEntry("network_authentication_id", None)
|
||||
self._authentication_key = Application.getInstance().getGlobalContainerStack().getMetaDataEntry("network_authentication_key", None)
|
||||
|
||||
Logger.log("d", "Loaded authentication id %s from the metadata entry", self._authentication_id)
|
||||
self._update_timer.start()
|
||||
#self.startCamera()
|
||||
|
||||
## Stop requesting data from printer
|
||||
def disconnect(self):
|
||||
|
@ -760,7 +811,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
|
||||
## Check if the authentication request was allowed by the printer.
|
||||
def _checkAuthentication(self):
|
||||
Logger.log("d", "Checking if authentication is correct.")
|
||||
Logger.log("d", "Checking if authentication is correct for id %", self._authentication_id)
|
||||
self._manager.get(QNetworkRequest(QUrl("http://" + self._address + self._api_prefix + "auth/check/" + str(self._authentication_id))))
|
||||
|
||||
## Request a authentication key from the printer so we can be authenticated
|
||||
|
@ -773,7 +824,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
|
||||
## Send all material profiles to the printer.
|
||||
def sendMaterialProfiles(self):
|
||||
for container in UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(type = "material"):
|
||||
for container in UM.Settings.ContainerRegistry.ContainerRegistry.getInstance().findInstanceContainers(type = "material"):
|
||||
try:
|
||||
xml_data = container.serialize()
|
||||
if xml_data == "" or xml_data is None:
|
||||
|
@ -907,7 +958,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
if status_code == 401:
|
||||
if self._authentication_state != AuthState.AuthenticationRequested:
|
||||
# Only request a new authentication when we have not already done so.
|
||||
Logger.log("i", "Not authenticated. Attempting to request authentication")
|
||||
Logger.log("i", "Not authenticated (Current auth state is %s). Attempting to request authentication", self._authentication_state )
|
||||
self._requestAuthentication()
|
||||
elif status_code == 403:
|
||||
# If we already had an auth (eg; didn't request one), we only need a single 403 to see it as denied.
|
||||
|
@ -917,6 +968,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
elif status_code == 200:
|
||||
self.setAuthenticationState(AuthState.Authenticated)
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
|
||||
## Save authentication details.
|
||||
if global_container_stack:
|
||||
if "network_authentication_key" in global_container_stack.getMetaData():
|
||||
|
@ -928,9 +980,9 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
else:
|
||||
global_container_stack.addMetaDataEntry("network_authentication_id", self._authentication_id)
|
||||
Application.getInstance().saveStack(global_container_stack) # Force save so we are sure the data is not lost.
|
||||
Logger.log("i", "Authentication succeeded")
|
||||
Logger.log("i", "Authentication succeeded for id %s", self._authentication_id)
|
||||
else: # Got a response that we didn't expect, so something went wrong.
|
||||
Logger.log("w", "While trying to authenticate, we got an unexpected response: %s", reply.attribute(QNetworkRequest.HttpStatusCodeAttribute))
|
||||
Logger.log("e", "While trying to authenticate, we got an unexpected response: %s", reply.attribute(QNetworkRequest.HttpStatusCodeAttribute))
|
||||
self.setAuthenticationState(AuthState.NotAuthenticated)
|
||||
|
||||
elif "auth/check" in reply_url: # Check if we are authenticated (user can refuse this!)
|
||||
|
@ -951,6 +1003,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if global_container_stack: # Remove any old data.
|
||||
Logger.log("d", "Removing old network authentication data as a new one was requested.")
|
||||
global_container_stack.removeMetaDataEntry("network_authentication_key")
|
||||
global_container_stack.removeMetaDataEntry("network_authentication_id")
|
||||
Application.getInstance().saveStack(global_container_stack) # Force saving so we don't keep wrong auth data.
|
||||
|
@ -973,10 +1026,20 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
self._progress_message.hide()
|
||||
|
||||
elif reply.operation() == QNetworkAccessManager.PutOperation:
|
||||
if status_code == 204:
|
||||
if status_code in [200, 201, 202, 204]:
|
||||
pass # Request was successful!
|
||||
else:
|
||||
Logger.log("d", "Something went wrong when trying to update data of API (%s). Message: %s Statuscode: %s", reply_url, reply.readAll(), status_code)
|
||||
operation_type = "Unknown"
|
||||
if reply.operation() == QNetworkAccessManager.GetOperation:
|
||||
operation_type = "Get"
|
||||
elif reply.operation() == QNetworkAccessManager.PutOperation:
|
||||
operation_type = "Put"
|
||||
elif reply.operation() == QNetworkAccessManager.PostOperation:
|
||||
operation_type = "Post"
|
||||
elif reply.operation() == QNetworkAccessManager.DeleteOperation:
|
||||
operation_type = "Delete"
|
||||
|
||||
Logger.log("d", "Something went wrong when trying to update data of API (%s). Message: %s Statuscode: %s, operation: %s", reply_url, reply.readAll(), status_code, operation_type)
|
||||
else:
|
||||
Logger.log("d", "NetworkPrinterOutputDevice got an unhandled operation %s", reply.operation())
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
# Copyright (c) 2017 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
|
||||
from . import NetworkPrinterOutputDevice
|
||||
|
||||
from zeroconf import Zeroconf, ServiceBrowser, ServiceStateChange, ServiceInfo
|
||||
from zeroconf import Zeroconf, ServiceBrowser, ServiceStateChange, ServiceInfo # type: ignore
|
||||
from UM.Logger import Logger
|
||||
from UM.Signal import Signal, signalemitter
|
||||
from UM.Application import Application
|
||||
|
@ -75,9 +78,13 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
|
|||
self._manual_instances.append(address)
|
||||
self._preferences.setValue("um3networkprinting/manual_instances", ",".join(self._manual_instances))
|
||||
|
||||
name = address
|
||||
instance_name = "manual:%s" % address
|
||||
properties = { b"name": name.encode("utf-8"), b"manual": b"true", b"incomplete": b"true" }
|
||||
properties = {
|
||||
b"name": address.encode("utf-8"),
|
||||
b"address": address.encode("utf-8"),
|
||||
b"manual": b"true",
|
||||
b"incomplete": b"true"
|
||||
}
|
||||
|
||||
if instance_name not in self._printers:
|
||||
# Add a preliminary printer instance
|
||||
|
@ -112,10 +119,14 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
|
|||
if status_code == 200:
|
||||
system_info = json.loads(bytes(reply.readAll()).decode("utf-8"))
|
||||
address = reply.url().host()
|
||||
name = ("%s (%s)" % (system_info["name"], address))
|
||||
|
||||
instance_name = "manual:%s" % address
|
||||
properties = { b"name": name.encode("utf-8"), b"firmware_version": system_info["firmware"].encode("utf-8"), b"manual": b"true" }
|
||||
properties = {
|
||||
b"name": system_info["name"].encode("utf-8"),
|
||||
b"address": address.encode("utf-8"),
|
||||
b"firmware_version": system_info["firmware"].encode("utf-8"),
|
||||
b"manual": b"true"
|
||||
}
|
||||
if instance_name in self._printers:
|
||||
# Only replace the printer if it is still in the list of (manual) printers
|
||||
self.removePrinter(instance_name)
|
||||
|
@ -196,8 +207,9 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
|
|||
info = zeroconf.get_service_info(service_type, name)
|
||||
|
||||
if info:
|
||||
type_of_device = info.properties.get(b"type", None).decode("utf-8")
|
||||
if type_of_device == "printer":
|
||||
type_of_device = info.properties.get(b"type", None)
|
||||
if type_of_device:
|
||||
if type_of_device == b"printer":
|
||||
address = '.'.join(map(lambda n: str(n), info.address))
|
||||
self.addPrinterSignal.emit(str(name), address, info.properties)
|
||||
else:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
from .avr_isp import stk500v2, ispBase, intelHex
|
||||
import serial
|
||||
import serial # type: ignore
|
||||
import threading
|
||||
import time
|
||||
import queue
|
||||
|
@ -124,6 +124,16 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||
def _homeBed(self):
|
||||
self._sendCommand("G28 Z")
|
||||
|
||||
## A name for the device.
|
||||
@pyqtProperty(str, constant = True)
|
||||
def name(self):
|
||||
return self.getName()
|
||||
|
||||
## The address of the device.
|
||||
@pyqtProperty(str, constant = True)
|
||||
def address(self):
|
||||
return self._serial_port
|
||||
|
||||
def startPrint(self):
|
||||
self.writeStarted.emit(self)
|
||||
gcode_list = getattr( Application.getInstance().getController().getScene(), "gcode_list")
|
||||
|
@ -631,3 +641,20 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||
self._update_firmware_thread.daemon = True
|
||||
|
||||
self.connect()
|
||||
|
||||
## Pre-heats the heated bed of the printer, if it has one.
|
||||
#
|
||||
# \param temperature The temperature to heat the bed to, in degrees
|
||||
# Celsius.
|
||||
# \param duration How long the bed should stay warm, in seconds. This is
|
||||
# ignored because there is no g-code to set this.
|
||||
@pyqtSlot(float, float)
|
||||
def preheatBed(self, temperature, duration):
|
||||
self._setTargetBedTemperature(temperature)
|
||||
|
||||
## Cancels pre-heating the heated bed of the printer.
|
||||
#
|
||||
# If the bed is not pre-heated, nothing happens.
|
||||
@pyqtSlot()
|
||||
def cancelPreheatBed(self):
|
||||
self._setTargetBedTemperature(0)
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2015 Ultimaker B.V.
|
||||
# Copyright (c) 2017 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
from UM.Signal import Signal, signalemitter
|
||||
|
@ -79,10 +79,6 @@ class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin, Extension):
|
|||
|
||||
def stop(self):
|
||||
self._check_updates = False
|
||||
try:
|
||||
self._update_thread.join()
|
||||
except RuntimeError:
|
||||
pass
|
||||
|
||||
def _updateThread(self):
|
||||
while self._check_updates:
|
||||
|
@ -258,7 +254,7 @@ class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin, Extension):
|
|||
def getSerialPortList(self, only_list_usb = False):
|
||||
base_list = []
|
||||
if platform.system() == "Windows":
|
||||
import winreg #@UnresolvedImport
|
||||
import winreg # type: ignore @UnresolvedImport
|
||||
try:
|
||||
key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE,"HARDWARE\\DEVICEMAP\\SERIALCOMM")
|
||||
i = 0
|
||||
|
@ -271,10 +267,10 @@ class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin, Extension):
|
|||
pass
|
||||
else:
|
||||
if only_list_usb:
|
||||
base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.usb*")
|
||||
base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.usb*") + glob.glob("/dev/tty.wchusb*") + glob.glob("/dev/cu.wchusb*")
|
||||
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/*")
|
||||
base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.*") + glob.glob("/dev/tty.usb*") + glob.glob("/dev/tty.wchusb*") + glob.glob("/dev/cu.wchusb*") + glob.glob("/dev/rfcomm*") + glob.glob("/dev/serial/by-id/*")
|
||||
return list(base_list)
|
||||
|
||||
_instance = None
|
||||
_instance = None # type: "USBPrinterOutputDeviceManager"
|
||||
|
|
|
@ -7,7 +7,7 @@ import struct
|
|||
import sys
|
||||
import time
|
||||
|
||||
from serial import Serial
|
||||
from serial import Serial # type: ignore
|
||||
from serial import SerialException
|
||||
from serial import SerialTimeoutException
|
||||
from UM.Logger import Logger
|
||||
|
@ -184,7 +184,7 @@ class Stk500v2(ispBase.IspBase):
|
|||
|
||||
def portList():
|
||||
ret = []
|
||||
import _winreg
|
||||
import _winreg # type: ignore
|
||||
key=_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,"HARDWARE\\DEVICEMAP\\SERIALCOMM") #@UndefinedVariable
|
||||
i=0
|
||||
while True:
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
# Copyright (c) 2017 Ultimaker B.V.
|
||||
# Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
from UM.Settings.InstanceContainer import InstanceContainer
|
||||
from cura.MachineAction import MachineAction
|
||||
from PyQt5.QtCore import pyqtSlot, pyqtSignal, pyqtProperty
|
||||
|
||||
|
@ -45,7 +50,7 @@ class UMOUpgradeSelection(MachineAction):
|
|||
definition_changes_container.setDefinition(definition)
|
||||
definition_changes_container.addMetaDataEntry("type", "definition_changes")
|
||||
|
||||
UM.Settings.ContainerRegistry.getInstance().addContainer(definition_changes_container)
|
||||
UM.Settings.ContainerRegistry.ContainerRegistry.getInstance().addContainer(definition_changes_container)
|
||||
# Insert definition_changes between the definition and the variant
|
||||
global_container_stack.insertContainer(-1, definition_changes_container)
|
||||
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
from UM.Application import Application
|
||||
from UM.Settings.DefinitionContainer import DefinitionContainer
|
||||
from cura.MachineAction import MachineAction
|
||||
from UM.i18n import i18nCatalog
|
||||
import cura.Settings.CuraContainerRegistry
|
||||
import UM.Settings.DefinitionContainer
|
||||
catalog = i18nCatalog("cura")
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
## Upgrade the firmware of a machine by USB with this action.
|
||||
class UpgradeFirmwareMachineAction(MachineAction):
|
||||
def __init__(self):
|
||||
super().__init__("UpgradeFirmware", catalog.i18nc("@action", "Upgrade Firmware"))
|
||||
self._qml_url = "UpgradeFirmwareMachineAction.qml"
|
||||
cura.Settings.CuraContainerRegistry.getInstance().containerAdded.connect(self._onContainerAdded)
|
||||
ContainerRegistry.getInstance().containerAdded.connect(self._onContainerAdded)
|
||||
|
||||
def _onContainerAdded(self, container):
|
||||
# Add this action as a supported action to all machine definitions if they support USB connection
|
||||
if isinstance(container, UM.Settings.DefinitionContainer) and container.getMetaDataEntry("type") == "machine" and container.getMetaDataEntry("supports_usb_connection"):
|
||||
UM.Application.getInstance().getMachineActionManager().addSupportedAction(container.getId(), self.getKey())
|
||||
if isinstance(container, DefinitionContainer) and container.getMetaDataEntry("type") == "machine" and container.getMetaDataEntry("supports_usb_connection"):
|
||||
Application.getInstance().getMachineActionManager().addSupportedAction(container.getId(), self.getKey())
|
||||
|
|
|
@ -26,7 +26,7 @@ class Profile:
|
|||
#
|
||||
# \param serialised A string with the contents of a profile.
|
||||
# \param filename The supposed filename of the profile, without extension.
|
||||
def __init__(self, serialised, filename):
|
||||
def __init__(self, serialised: str, filename: str) -> None:
|
||||
self._filename = filename
|
||||
|
||||
parser = configparser.ConfigParser(interpolation = None)
|
||||
|
@ -58,17 +58,17 @@ class Profile:
|
|||
self._material_name = None
|
||||
|
||||
# Parse the settings.
|
||||
self._settings = {}
|
||||
self._settings = {} # type: Dict[str,str]
|
||||
if parser.has_section("settings"):
|
||||
for key, value in parser["settings"].items():
|
||||
self._settings[key] = value
|
||||
|
||||
# Parse the defaults and the disabled defaults.
|
||||
self._changed_settings_defaults = {}
|
||||
self._changed_settings_defaults = {} # type: Dict[str,str]
|
||||
if parser.has_section("defaults"):
|
||||
for key, value in parser["defaults"].items():
|
||||
self._changed_settings_defaults[key] = value
|
||||
self._disabled_settings_defaults = []
|
||||
self._disabled_settings_defaults = [] # type: List[str]
|
||||
if parser.has_section("disabled_defaults"):
|
||||
disabled_defaults_string = parser.get("disabled_defaults", "values")
|
||||
self._disabled_settings_defaults = [item for item in disabled_defaults_string.split(",") if item != ""] # Split by comma.
|
||||
|
|
|
@ -6,7 +6,7 @@ import os
|
|||
import os.path
|
||||
import io
|
||||
|
||||
from UM import Resources
|
||||
from UM.Resources import Resources
|
||||
from UM.VersionUpgrade import VersionUpgrade # Superclass of the plugin.
|
||||
import UM.VersionUpgrade
|
||||
|
||||
|
|
|
@ -13,7 +13,9 @@ from UM.Mesh.MeshBuilder import MeshBuilder
|
|||
from UM.Mesh.MeshReader import MeshReader
|
||||
from UM.Scene.SceneNode import SceneNode
|
||||
|
||||
MYPY = False
|
||||
try:
|
||||
if not MYPY:
|
||||
import xml.etree.cElementTree as ET
|
||||
except ImportError:
|
||||
import xml.etree.ElementTree as ET
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
# Copyright (c) 2016 Ultimaker B.V.
|
||||
# Copyright (c) 2017 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import math
|
||||
import copy
|
||||
import io
|
||||
import xml.etree.ElementTree as ET
|
||||
import uuid
|
||||
|
||||
from UM.Resources import Resources
|
||||
from UM.Logger import Logger
|
||||
|
@ -13,11 +11,11 @@ from UM.Util import parseBool
|
|||
from cura.CuraApplication import CuraApplication
|
||||
|
||||
import UM.Dictionary
|
||||
|
||||
import UM.Settings
|
||||
from UM.Settings.InstanceContainer import InstanceContainer
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
|
||||
## Handles serializing and deserializing material containers from an XML file
|
||||
class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
||||
class XmlMaterialProfile(InstanceContainer):
|
||||
def __init__(self, container_id, *args, **kwargs):
|
||||
super().__init__(container_id, *args, **kwargs)
|
||||
self._inherited_files = []
|
||||
|
@ -30,7 +28,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
super().setReadOnly(read_only)
|
||||
|
||||
basefile = self.getMetaDataEntry("base_file", self._id) # if basefile is self.id, this is a basefile.
|
||||
for container in UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(base_file = basefile):
|
||||
for container in ContainerRegistry.getInstance().findInstanceContainers(base_file = basefile):
|
||||
container._read_only = read_only # prevent loop instead of calling setReadOnly
|
||||
|
||||
## Overridden from InstanceContainer
|
||||
|
@ -46,7 +44,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
|
||||
basefile = self.getMetaDataEntry("base_file", self._id) #if basefile is self.id, this is a basefile.
|
||||
# Update all containers that share GUID and basefile
|
||||
for container in UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(base_file = basefile):
|
||||
for container in ContainerRegistry.getInstance().findInstanceContainers(base_file = basefile):
|
||||
container.setMetaDataEntry(key, value)
|
||||
|
||||
## Overridden from InstanceContainer, similar to setMetaDataEntry.
|
||||
|
@ -65,7 +63,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
basefile = self.getMetaDataEntry("base_file", self._id) # if basefile is self.id, this is a basefile.
|
||||
# Update the basefile as well, this is actually what we're trying to do
|
||||
# Update all containers that share GUID and basefile
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(base_file = basefile)
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(base_file = basefile)
|
||||
for container in containers:
|
||||
container.setName(new_name)
|
||||
|
||||
|
@ -74,7 +72,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
super().setDirty(dirty)
|
||||
base_file = self.getMetaDataEntry("base_file", None)
|
||||
if base_file is not None and base_file != self._id:
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findContainers(id=base_file)
|
||||
containers = ContainerRegistry.getInstance().findContainers(id=base_file)
|
||||
if containers:
|
||||
base_container = containers[0]
|
||||
if not base_container.isReadOnly():
|
||||
|
@ -88,7 +86,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
# super().setProperty(key, property_name, property_value)
|
||||
#
|
||||
# basefile = self.getMetaDataEntry("base_file", self._id) #if basefile is self.id, this is a basefile.
|
||||
# for container in UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(base_file = basefile):
|
||||
# for container in UM.Settings.ContainerRegistry.ContainerRegistry.getInstance().findInstanceContainers(base_file = basefile):
|
||||
# if not container.isReadOnly():
|
||||
# container.setDirty(True)
|
||||
|
||||
|
@ -96,7 +94,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
# base file: global settings + supported machines
|
||||
# machine / variant combination: only changes for itself.
|
||||
def serialize(self):
|
||||
registry = UM.Settings.ContainerRegistry.getInstance()
|
||||
registry = ContainerRegistry.getInstance()
|
||||
|
||||
base_file = self.getMetaDataEntry("base_file", "")
|
||||
if base_file and self.id != base_file:
|
||||
|
@ -376,12 +374,10 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
|
||||
# Reset previous metadata
|
||||
self.clearData() # Ensure any previous data is gone.
|
||||
|
||||
self.addMetaDataEntry("type", "material")
|
||||
self.addMetaDataEntry("base_file", self.id)
|
||||
|
||||
# TODO: Add material verfication
|
||||
self.addMetaDataEntry("status", "unknown")
|
||||
meta_data = {}
|
||||
meta_data["type"] = "material"
|
||||
meta_data["base_file"] = self.id
|
||||
meta_data["status"] = "unknown" # TODO: Add material verfication
|
||||
|
||||
inherits = data.find("./um:inherits", self.__namespaces)
|
||||
if inherits is not None:
|
||||
|
@ -399,23 +395,20 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
label = entry.find("./um:label", self.__namespaces)
|
||||
|
||||
if label is not None:
|
||||
self.setName(label.text)
|
||||
self._name = label.text
|
||||
else:
|
||||
self.setName(self._profile_name(material.text, color.text))
|
||||
|
||||
self.addMetaDataEntry("brand", brand.text)
|
||||
self.addMetaDataEntry("material", material.text)
|
||||
self.addMetaDataEntry("color_name", color.text)
|
||||
|
||||
self._name = self._profile_name(material.text, color.text)
|
||||
meta_data["brand"] = brand.text
|
||||
meta_data["material"] = material.text
|
||||
meta_data["color_name"] = color.text
|
||||
continue
|
||||
meta_data[tag_name] = entry.text
|
||||
|
||||
self.addMetaDataEntry(tag_name, entry.text)
|
||||
if not "description" in meta_data:
|
||||
meta_data["description"] = ""
|
||||
|
||||
if not "description" in self.getMetaData():
|
||||
self.addMetaDataEntry("description", "")
|
||||
|
||||
if not "adhesion_info" in self.getMetaData():
|
||||
self.addMetaDataEntry("adhesion_info", "")
|
||||
if not "adhesion_info" in meta_data:
|
||||
meta_data["adhesion_info"] = ""
|
||||
|
||||
property_values = {}
|
||||
properties = data.iterfind("./um:properties/*", self.__namespaces)
|
||||
|
@ -425,10 +418,9 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
|
||||
diameter = float(property_values.get("diameter", 2.85)) # In mm
|
||||
density = float(property_values.get("density", 1.3)) # In g/cm3
|
||||
meta_data["properties"] = property_values
|
||||
|
||||
self.addMetaDataEntry("properties", property_values)
|
||||
|
||||
self.setDefinition(UM.Settings.ContainerRegistry.getInstance().findDefinitionContainers(id = "fdmprinter")[0])
|
||||
self.setDefinition(ContainerRegistry.getInstance().findDefinitionContainers(id = "fdmprinter")[0])
|
||||
|
||||
global_compatibility = True
|
||||
global_setting_values = {}
|
||||
|
@ -436,16 +428,16 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
for entry in settings:
|
||||
key = entry.get("key")
|
||||
if key in self.__material_property_setting_map:
|
||||
self.setProperty(self.__material_property_setting_map[key], "value", entry.text)
|
||||
global_setting_values[self.__material_property_setting_map[key]] = entry.text
|
||||
elif key in self.__unmapped_settings:
|
||||
if key == "hardware compatible":
|
||||
global_compatibility = parseBool(entry.text)
|
||||
else:
|
||||
Logger.log("d", "Unsupported material setting %s", key)
|
||||
self._cached_values = global_setting_values
|
||||
|
||||
self.addMetaDataEntry("compatible", global_compatibility)
|
||||
|
||||
meta_data["compatible"] = global_compatibility
|
||||
self.setMetaData(meta_data)
|
||||
self._dirty = False
|
||||
|
||||
machines = data.iterfind("./um:settings/um:machine", self.__namespaces)
|
||||
|
@ -463,6 +455,9 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
else:
|
||||
Logger.log("d", "Unsupported material setting %s", key)
|
||||
|
||||
cached_machine_setting_properties = global_setting_values.copy()
|
||||
cached_machine_setting_properties.update(machine_setting_values)
|
||||
|
||||
identifiers = machine.iterfind("./um:machine_identifier", self.__namespaces)
|
||||
for identifier in identifiers:
|
||||
machine_id = self.__product_id_map.get(identifier.get("product"), None)
|
||||
|
@ -470,7 +465,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
# Lets try again with some naive heuristics.
|
||||
machine_id = identifier.get("product").replace(" ", "").lower()
|
||||
|
||||
definitions = UM.Settings.ContainerRegistry.getInstance().findDefinitionContainers(id = machine_id)
|
||||
definitions = ContainerRegistry.getInstance().findDefinitionContainers(id = machine_id)
|
||||
if not definitions:
|
||||
Logger.log("w", "No definition found for machine ID %s", machine_id)
|
||||
continue
|
||||
|
@ -480,29 +475,20 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
if machine_compatibility:
|
||||
new_material_id = self.id + "_" + machine_id
|
||||
|
||||
# It could be that we are overwriting, so check if the ID already exists.
|
||||
materials = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id=new_material_id)
|
||||
if materials:
|
||||
new_material = materials[0]
|
||||
new_material.clearData()
|
||||
else:
|
||||
new_material = XmlMaterialProfile(new_material_id)
|
||||
|
||||
new_material.setName(self.getName())
|
||||
# Update the private directly, as we want to prevent the lookup that is done when using setName
|
||||
new_material._name = self.getName()
|
||||
new_material.setMetaData(copy.deepcopy(self.getMetaData()))
|
||||
new_material.setDefinition(definition)
|
||||
# Don't use setMetadata, as that overrides it for all materials with same base file
|
||||
new_material.getMetaData()["compatible"] = machine_compatibility
|
||||
|
||||
for key, value in global_setting_values.items():
|
||||
new_material.setProperty(key, "value", value)
|
||||
|
||||
for key, value in machine_setting_values.items():
|
||||
new_material.setProperty(key, "value", value)
|
||||
new_material.setCachedValues(cached_machine_setting_properties)
|
||||
|
||||
new_material._dirty = False
|
||||
if not materials:
|
||||
UM.Settings.ContainerRegistry.getInstance().addContainer(new_material)
|
||||
|
||||
ContainerRegistry.getInstance().addContainer(new_material)
|
||||
|
||||
hotends = machine.iterfind("./um:hotend", self.__namespaces)
|
||||
for hotend in hotends:
|
||||
|
@ -510,10 +496,10 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
if hotend_id is None:
|
||||
continue
|
||||
|
||||
variant_containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = hotend_id)
|
||||
variant_containers = ContainerRegistry.getInstance().findInstanceContainers(id = hotend_id)
|
||||
if not variant_containers:
|
||||
# It is not really properly defined what "ID" is so also search for variants by name.
|
||||
variant_containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(definition = definition.id, name = hotend_id)
|
||||
variant_containers = ContainerRegistry.getInstance().findInstanceContainers(definition = definition.id, name = hotend_id)
|
||||
|
||||
if not variant_containers:
|
||||
Logger.log("d", "No variants found with ID or name %s for machine %s", hotend_id, definition.id)
|
||||
|
@ -532,34 +518,26 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||
else:
|
||||
Logger.log("d", "Unsupported material setting %s", key)
|
||||
|
||||
# It could be that we are overwriting, so check if the ID already exists.
|
||||
new_hotend_id = self.id + "_" + machine_id + "_" + hotend_id.replace(" ", "_")
|
||||
materials = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id=new_hotend_id)
|
||||
if materials:
|
||||
new_hotend_material = materials[0]
|
||||
new_hotend_material.clearData()
|
||||
else:
|
||||
|
||||
new_hotend_material = XmlMaterialProfile(new_hotend_id)
|
||||
|
||||
new_hotend_material.setName(self.getName())
|
||||
# Update the private directly, as we want to prevent the lookup that is done when using setName
|
||||
new_hotend_material._name = self.getName()
|
||||
new_hotend_material.setMetaData(copy.deepcopy(self.getMetaData()))
|
||||
new_hotend_material.setDefinition(definition)
|
||||
new_hotend_material.addMetaDataEntry("variant", variant_containers[0].id)
|
||||
# Don't use setMetadata, as that overrides it for all materials with same base file
|
||||
new_hotend_material.getMetaData()["compatible"] = hotend_compatibility
|
||||
|
||||
for key, value in global_setting_values.items():
|
||||
new_hotend_material.setProperty(key, "value", value)
|
||||
cached_hotend_setting_properties = cached_machine_setting_properties.copy()
|
||||
cached_hotend_setting_properties.update(hotend_setting_values)
|
||||
|
||||
for key, value in machine_setting_values.items():
|
||||
new_hotend_material.setProperty(key, "value", value)
|
||||
|
||||
for key, value in hotend_setting_values.items():
|
||||
new_hotend_material.setProperty(key, "value", value)
|
||||
new_hotend_material.setCachedValues(cached_hotend_setting_properties)
|
||||
|
||||
new_hotend_material._dirty = False
|
||||
if not materials: # It was not added yet, do so now.
|
||||
UM.Settings.ContainerRegistry.getInstance().addContainer(new_hotend_material)
|
||||
|
||||
ContainerRegistry.getInstance().addContainer(new_hotend_material)
|
||||
|
||||
def _addSettingElement(self, builder, instance):
|
||||
try:
|
||||
|
|
84
resources/definitions/abax_pri3.def.json
Normal file
84
resources/definitions/abax_pri3.def.json
Normal file
|
@ -0,0 +1,84 @@
|
|||
{
|
||||
"id": "PRi3",
|
||||
"name": "ABAX PRi3",
|
||||
"version": 2,
|
||||
"inherits": "fdmprinter",
|
||||
"metadata": {
|
||||
"visible": true,
|
||||
"author": "ABAX 3d Technologies",
|
||||
"manufacturer": "ABAX 3d Technologies",
|
||||
"category": "Other",
|
||||
"file_formats": "text/x-gcode"
|
||||
},
|
||||
"overrides": {
|
||||
"machine_start_gcode": {
|
||||
"default_value": "; -- START GCODE --\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 Z5.0 F200 ;move Z to position 5.0 mm\nG92 E0 ;zero the extruded length\n; -- end of START GCODE --"
|
||||
},
|
||||
"machine_end_gcode": {
|
||||
"default_value": "; -- END GCODE --\nM104 S0 ;set extruder temperature to zero (turned off)\nM140 S0 ;set temp of bed to Zero \nG91 ;set to relative positioning\nG1 E-10 F300 ;retract the filament a bit to release some of the pressure\nG1 F2000 X0 Y215 ;move X to min and Y to max \nG90 ;set to absolute positioning\nM84 ;turn off steppers\n; -- end of END GCODE --"
|
||||
},
|
||||
"machine_width": {
|
||||
"default_value": 225
|
||||
},
|
||||
"machine_depth": {
|
||||
"default_value": 220
|
||||
},
|
||||
"machine_height": {
|
||||
"default_value": 200
|
||||
},
|
||||
"machine_heated_bed": {
|
||||
"default_value": false
|
||||
},
|
||||
"machine_center_is_zero": {
|
||||
"default_value": false
|
||||
},
|
||||
"machine_gcode_flavor": {
|
||||
"default_value": "RepRap"
|
||||
},
|
||||
"layer_height": {
|
||||
"default_value": 0.2
|
||||
},
|
||||
"layer_height_0": {
|
||||
"default_value": 0.2
|
||||
},
|
||||
"wall_thickness": {
|
||||
"default_value": 1
|
||||
},
|
||||
"top_bottom_thickness": {
|
||||
"default_value": 1
|
||||
},
|
||||
"bottom_thickness": {
|
||||
"default_value": 1
|
||||
},
|
||||
"material_print_temperature": {
|
||||
"default_value": 200
|
||||
},
|
||||
"material_bed_temperature": {
|
||||
"default_value": 0
|
||||
},
|
||||
"material_diameter": {
|
||||
"default_value": 1.75
|
||||
},
|
||||
"speed_print": {
|
||||
"default_value": 40
|
||||
},
|
||||
"speed_infill": {
|
||||
"default_value": 70
|
||||
},
|
||||
"speed_wall": {
|
||||
"default_value": 25
|
||||
},
|
||||
"speed_topbottom": {
|
||||
"default_value": 15
|
||||
},
|
||||
"speed_travel": {
|
||||
"default_value": 150
|
||||
},
|
||||
"speed_layer_0": {
|
||||
"default_value": 30
|
||||
},
|
||||
"support_enable": {
|
||||
"default_value": true
|
||||
}
|
||||
}
|
||||
}
|
84
resources/definitions/abax_pri5.def.json
Normal file
84
resources/definitions/abax_pri5.def.json
Normal file
|
@ -0,0 +1,84 @@
|
|||
{
|
||||
"id": "PRi5",
|
||||
"name": "ABAX PRi5",
|
||||
"version": 2,
|
||||
"inherits": "fdmprinter",
|
||||
"metadata": {
|
||||
"visible": true,
|
||||
"author": "ABAX 3d Technologies",
|
||||
"manufacturer": "ABAX 3d Technologies",
|
||||
"category": "Other",
|
||||
"file_formats": "text/x-gcode"
|
||||
},
|
||||
"overrides": {
|
||||
"machine_start_gcode": {
|
||||
"default_value": "; -- START GCODE --\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 Z5.0 F200 ;move Z to position 5.0 mm\nG92 E0 ;zero the extruded length\n; -- end of START GCODE --"
|
||||
},
|
||||
"machine_end_gcode": {
|
||||
"default_value": "; -- END GCODE --\nM104 S0 ;set extruder temperature to zero (turned off)\nM140 S0 ;set temp of bed to Zero \nG91 ;set to relative positioning\nG1 E-10 F300 ;retract the filament a bit to release some of the pressure\nG1 F2000 X0 Y300 ;move X to min and Y to max \nG90 ;set to absolute positioning\nM84 ;turn off steppers\n; -- end of END GCODE --"
|
||||
},
|
||||
"machine_width": {
|
||||
"default_value": 310
|
||||
},
|
||||
"machine_depth": {
|
||||
"default_value": 310
|
||||
},
|
||||
"machine_height": {
|
||||
"default_value": 300
|
||||
},
|
||||
"machine_heated_bed": {
|
||||
"default_value": false
|
||||
},
|
||||
"machine_center_is_zero": {
|
||||
"default_value": false
|
||||
},
|
||||
"machine_gcode_flavor": {
|
||||
"default_value": "RepRap"
|
||||
},
|
||||
"layer_height": {
|
||||
"default_value": 0.2
|
||||
},
|
||||
"layer_height_0": {
|
||||
"default_value": 0.2
|
||||
},
|
||||
"wall_thickness": {
|
||||
"default_value": 1
|
||||
},
|
||||
"top_bottom_thickness": {
|
||||
"default_value": 1
|
||||
},
|
||||
"bottom_thickness": {
|
||||
"default_value": 1
|
||||
},
|
||||
"material_print_temperature": {
|
||||
"default_value": 200
|
||||
},
|
||||
"material_bed_temperature": {
|
||||
"default_value": 0
|
||||
},
|
||||
"material_diameter": {
|
||||
"default_value": 1.75
|
||||
},
|
||||
"speed_print": {
|
||||
"default_value": 40
|
||||
},
|
||||
"speed_infill": {
|
||||
"default_value": 70
|
||||
},
|
||||
"speed_wall": {
|
||||
"default_value": 25
|
||||
},
|
||||
"speed_topbottom": {
|
||||
"default_value": 15
|
||||
},
|
||||
"speed_travel": {
|
||||
"default_value": 150
|
||||
},
|
||||
"speed_layer_0": {
|
||||
"default_value": 30
|
||||
},
|
||||
"support_enable": {
|
||||
"default_value": true
|
||||
}
|
||||
}
|
||||
}
|
84
resources/definitions/abax_titan.def.json
Normal file
84
resources/definitions/abax_titan.def.json
Normal file
|
@ -0,0 +1,84 @@
|
|||
{
|
||||
"id": "Titan",
|
||||
"name": "ABAX Titan",
|
||||
"version": 2,
|
||||
"inherits": "fdmprinter",
|
||||
"metadata": {
|
||||
"visible": true,
|
||||
"author": "ABAX 3d Technologies",
|
||||
"manufacturer": "ABAX 3d Technologies",
|
||||
"category": "Other",
|
||||
"file_formats": "text/x-gcode"
|
||||
},
|
||||
"overrides": {
|
||||
"machine_start_gcode": {
|
||||
"default_value": "; -- START GCODE --\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 Z5.0 F200 ;move Z to position 5.0 mm\nG92 E0 ;zero the extruded length\n; -- end of START GCODE --"
|
||||
},
|
||||
"machine_end_gcode": {
|
||||
"default_value": "; -- END GCODE --\nM104 S0 ;set extruder temperature to zero (turned off)\nM140 S0 ;set temp of bed to Zero \nG91 ;set to relative positioning\nG1 E-10 F300 ;retract the filament a bit to release some of the pressure\nG1 F2000 X0 Y300 ;move X to min and Y to max \nG90 ;set to absolute positioning\nM84 ;turn off steppers\n; -- end of END GCODE --"
|
||||
},
|
||||
"machine_width": {
|
||||
"default_value": 310
|
||||
},
|
||||
"machine_depth": {
|
||||
"default_value": 310
|
||||
},
|
||||
"machine_height": {
|
||||
"default_value": 300
|
||||
},
|
||||
"machine_heated_bed": {
|
||||
"default_value": false
|
||||
},
|
||||
"machine_center_is_zero": {
|
||||
"default_value": false
|
||||
},
|
||||
"machine_gcode_flavor": {
|
||||
"default_value": "RepRap"
|
||||
},
|
||||
"layer_height": {
|
||||
"default_value": 0.2
|
||||
},
|
||||
"layer_height_0": {
|
||||
"default_value": 0.2
|
||||
},
|
||||
"wall_thickness": {
|
||||
"default_value": 1
|
||||
},
|
||||
"top_bottom_thickness": {
|
||||
"default_value": 1
|
||||
},
|
||||
"bottom_thickness": {
|
||||
"default_value": 1
|
||||
},
|
||||
"material_print_temperature": {
|
||||
"default_value": 200
|
||||
},
|
||||
"material_bed_temperature": {
|
||||
"default_value": 0
|
||||
},
|
||||
"material_diameter": {
|
||||
"default_value": 1.75
|
||||
},
|
||||
"speed_print": {
|
||||
"default_value": 40
|
||||
},
|
||||
"speed_infill": {
|
||||
"default_value": 70
|
||||
},
|
||||
"speed_wall": {
|
||||
"default_value": 25
|
||||
},
|
||||
"speed_topbottom": {
|
||||
"default_value": 15
|
||||
},
|
||||
"speed_travel": {
|
||||
"default_value": 150
|
||||
},
|
||||
"speed_layer_0": {
|
||||
"default_value": 30
|
||||
},
|
||||
"support_enable": {
|
||||
"default_value": true
|
||||
}
|
||||
}
|
||||
}
|
48
resources/definitions/cartesio.def.json
Normal file
48
resources/definitions/cartesio.def.json
Normal file
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"id": "cartesio",
|
||||
"name": "Cartesio",
|
||||
"version": 2,
|
||||
"inherits": "fdmprinter",
|
||||
"metadata": {
|
||||
"visible": true,
|
||||
"author": "Scheepers",
|
||||
"manufacturer": "Cartesio bv",
|
||||
"category": "Other",
|
||||
"file_formats": "text/x-gcode",
|
||||
"has_materials": true,
|
||||
"has_machine_materials": true,
|
||||
"has_variants": true,
|
||||
"variants_name": "Nozzle size",
|
||||
"machine_extruder_trains":
|
||||
{
|
||||
"0": "cartesio_extruder_0",
|
||||
"1": "cartesio_extruder_1",
|
||||
"2": "cartesio_extruder_2",
|
||||
"3": "cartesio_extruder_3"
|
||||
},
|
||||
"platform": "cartesio_platform.stl",
|
||||
"platform_offset": [ -120, -1.5, 130],
|
||||
"first_start_actions": ["MachineSettingsAction"],
|
||||
"supported_actions": ["MachineSettingsAction"]
|
||||
},
|
||||
|
||||
"overrides": {
|
||||
"machine_extruder_count": { "default_value": 4 },
|
||||
"machine_heated_bed": { "default_value": true },
|
||||
"machine_center_is_zero": { "default_value": false },
|
||||
"machine_height": { "default_value": 400 },
|
||||
"machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" },
|
||||
"machine_depth": { "default_value": 270 },
|
||||
"machine_width": { "default_value": 430 },
|
||||
"machine_name": { "default_value": "Cartesio" },
|
||||
"machine_start_gcode": {
|
||||
"default_value": "M92 E162\nG21\nG90\nM42 S255 P13;chamber lights\nM42 S255 P12;fume extraction\nM140 S{material_bed_temperature}\n\nM117 Homing Y ......\nG28 Y\nM117 Homing X ......\nG28 X\nM117 Homing Z ......\nG28 Z F100\nG1 Z10 F600\nG1 X70 Y20 F9000;go to wipe point\n\nM190 S{material_bed_temperature}\nM104 S120 T1\nM109 S{material_print_temperature} T0\nM104 S21 T1\n\nM117 purging nozzle....\n\nT0\nG92 E0;set E\nG1 E10 F100\nG92 E0\nG1 E-{retraction_amount} F600\nG92 E0\n\nM117 wiping nozzle....\n\nG1 X1 Y24 F3000\nG1 X70 F9000\n\nM117 Printing .....\n\nG1 E1 F100\nG92 E-1\n"
|
||||
},
|
||||
"machine_end_gcode": {
|
||||
"default_value": "; -- END GCODE --\nM106 S255\nM140 S5\nM104 S5 T0\nM104 S5 T1\nG1 X20.0 Y260.0 F6000\nG4 S7\nM84\nG4 S90\nM107\nM42 P12 S0\nM42 P13 S0\nM84\n; -- end of END GCODE --"
|
||||
},
|
||||
"machine_nozzle_heat_up_speed": {"default_value": 20},
|
||||
"machine_nozzle_cool_down_speed": {"default_value": 20},
|
||||
"machine_min_cool_heat_time_window": {"default_value": 5}
|
||||
}
|
||||
}
|
|
@ -219,8 +219,11 @@
|
|||
{
|
||||
"label": "Nozzle angle",
|
||||
"description": "The angle between the horizontal plane and the conical part right above the tip of the nozzle.",
|
||||
"default_value": 45,
|
||||
"unit": "°",
|
||||
"type": "int",
|
||||
"default_value": 45,
|
||||
"maximum_value": "89",
|
||||
"minimum_value": "1",
|
||||
"settable_per_mesh": false,
|
||||
"settable_per_extruder": false,
|
||||
"settable_per_meshgroup": false
|
||||
|
@ -615,7 +618,7 @@
|
|||
"label": "Line Width",
|
||||
"description": "Width of a single line. Generally, the width of each line should correspond to the width of the nozzle. However, slightly reducing this value could produce better prints.",
|
||||
"unit": "mm",
|
||||
"minimum_value": "0.0001",
|
||||
"minimum_value": "0.001",
|
||||
"minimum_value_warning": "0.5 * machine_nozzle_size",
|
||||
"maximum_value_warning": "2 * machine_nozzle_size",
|
||||
"default_value": 0.4,
|
||||
|
@ -629,7 +632,7 @@
|
|||
"label": "Wall Line Width",
|
||||
"description": "Width of a single wall line.",
|
||||
"unit": "mm",
|
||||
"minimum_value": "0.0001",
|
||||
"minimum_value": "0.001",
|
||||
"minimum_value_warning": "0.75 * machine_nozzle_size",
|
||||
"maximum_value_warning": "2 * machine_nozzle_size",
|
||||
"value": "line_width",
|
||||
|
@ -643,7 +646,7 @@
|
|||
"label": "Outer Wall Line Width",
|
||||
"description": "Width of the outermost wall line. By lowering this value, higher levels of detail can be printed.",
|
||||
"unit": "mm",
|
||||
"minimum_value": "0.0001",
|
||||
"minimum_value": "0.001",
|
||||
"minimum_value_warning": "0.75 * machine_nozzle_size if outer_inset_first else 0.1 * machine_nozzle_size",
|
||||
"maximum_value_warning": "2 * machine_nozzle_size",
|
||||
"default_value": 0.4,
|
||||
|
@ -656,7 +659,7 @@
|
|||
"label": "Inner Wall(s) Line Width",
|
||||
"description": "Width of a single wall line for all wall lines except the outermost one.",
|
||||
"unit": "mm",
|
||||
"minimum_value": "0.0001",
|
||||
"minimum_value": "0.001",
|
||||
"minimum_value_warning": "0.5 * machine_nozzle_size",
|
||||
"maximum_value_warning": "2 * machine_nozzle_size",
|
||||
"default_value": 0.4,
|
||||
|
@ -671,7 +674,7 @@
|
|||
"label": "Top/Bottom Line Width",
|
||||
"description": "Width of a single top/bottom line.",
|
||||
"unit": "mm",
|
||||
"minimum_value": "0.0001",
|
||||
"minimum_value": "0.001",
|
||||
"minimum_value_warning": "0.1 * machine_nozzle_size",
|
||||
"maximum_value_warning": "2 * machine_nozzle_size",
|
||||
"default_value": 0.4,
|
||||
|
@ -684,7 +687,7 @@
|
|||
"label": "Infill Line Width",
|
||||
"description": "Width of a single infill line.",
|
||||
"unit": "mm",
|
||||
"minimum_value": "0.0001",
|
||||
"minimum_value": "0.001",
|
||||
"minimum_value_warning": "0.75 * machine_nozzle_size",
|
||||
"maximum_value_warning": "3 * machine_nozzle_size",
|
||||
"default_value": 0.4,
|
||||
|
@ -698,7 +701,7 @@
|
|||
"label": "Skirt/Brim Line Width",
|
||||
"description": "Width of a single skirt or brim line.",
|
||||
"unit": "mm",
|
||||
"minimum_value": "0.0001",
|
||||
"minimum_value": "0.001",
|
||||
"minimum_value_warning": "0.75 * machine_nozzle_size",
|
||||
"maximum_value_warning": "3 * machine_nozzle_size",
|
||||
"default_value": 0.4,
|
||||
|
@ -713,7 +716,7 @@
|
|||
"label": "Support Line Width",
|
||||
"description": "Width of a single support structure line.",
|
||||
"unit": "mm",
|
||||
"minimum_value": "0.0001",
|
||||
"minimum_value": "0.001",
|
||||
"minimum_value_warning": "0.75 * machine_nozzle_size",
|
||||
"maximum_value_warning": "3 * machine_nozzle_size",
|
||||
"default_value": 0.4,
|
||||
|
@ -730,7 +733,7 @@
|
|||
"description": "Width of a single support interface line.",
|
||||
"unit": "mm",
|
||||
"default_value": 0.4,
|
||||
"minimum_value": "0.0001",
|
||||
"minimum_value": "0.001",
|
||||
"minimum_value_warning": "0.4 * machine_nozzle_size",
|
||||
"maximum_value_warning": "2 * machine_nozzle_size",
|
||||
"type": "float",
|
||||
|
@ -749,7 +752,7 @@
|
|||
"enabled": "resolveOrValue('prime_tower_enable')",
|
||||
"default_value": 0.4,
|
||||
"value": "line_width",
|
||||
"minimum_value": "0.0001",
|
||||
"minimum_value": "0.001",
|
||||
"minimum_value_warning": "0.75 * machine_nozzle_size",
|
||||
"maximum_value_warning": "2 * machine_nozzle_size",
|
||||
"settable_per_mesh": false,
|
||||
|
@ -3347,7 +3350,7 @@
|
|||
"type": "float",
|
||||
"default_value": 0.4,
|
||||
"value": "line_width",
|
||||
"minimum_value": "0.0001",
|
||||
"minimum_value": "0.001",
|
||||
"minimum_value_warning": "extruderValue(adhesion_extruder_nr, 'machine_nozzle_size') * 0.1",
|
||||
"maximum_value_warning": "extruderValue(adhesion_extruder_nr, 'machine_nozzle_size') * 2",
|
||||
"enabled": "resolveOrValue('adhesion_type') == 'raft'",
|
||||
|
@ -3362,7 +3365,7 @@
|
|||
"unit": "mm",
|
||||
"type": "float",
|
||||
"default_value": 0.4,
|
||||
"minimum_value": "0.0001",
|
||||
"minimum_value": "0",
|
||||
"minimum_value_warning": "extruderValue(adhesion_extruder_nr, 'raft_surface_line_width')",
|
||||
"maximum_value_warning": "extruderValue(adhesion_extruder_nr, 'raft_surface_line_width') * 3",
|
||||
"enabled": "resolveOrValue('adhesion_type') == 'raft'",
|
||||
|
@ -3395,7 +3398,7 @@
|
|||
"type": "float",
|
||||
"default_value": 0.7,
|
||||
"value": "line_width * 2",
|
||||
"minimum_value": "0.0001",
|
||||
"minimum_value": "0.001",
|
||||
"minimum_value_warning": "extruderValue(adhesion_extruder_nr, 'machine_nozzle_size') * 0.5",
|
||||
"maximum_value_warning": "extruderValue(adhesion_extruder_nr, 'machine_nozzle_size') * 3",
|
||||
"enabled": "resolveOrValue('adhesion_type') == 'raft'",
|
||||
|
@ -3442,7 +3445,7 @@
|
|||
"unit": "mm",
|
||||
"type": "float",
|
||||
"default_value": 0.8,
|
||||
"minimum_value": "0.0001",
|
||||
"minimum_value": "0.001",
|
||||
"value": "extruderValue(adhesion_extruder_nr, 'machine_nozzle_size') * 2",
|
||||
"minimum_value_warning": "extruderValue(adhesion_extruder_nr, 'machine_nozzle_size') * 0.5",
|
||||
"maximum_value_warning": "extruderValue(adhesion_extruder_nr, 'machine_nozzle_size') * 3",
|
||||
|
@ -3459,7 +3462,7 @@
|
|||
"type": "float",
|
||||
"default_value": 1.6,
|
||||
"value": "raft_base_line_width * 2",
|
||||
"minimum_value": "0.0001",
|
||||
"minimum_value": "0",
|
||||
"minimum_value_warning": "extruderValue(adhesion_extruder_nr, 'raft_base_line_width')",
|
||||
"maximum_value_warning": "100",
|
||||
"enabled": "resolveOrValue('adhesion_type') == 'raft'",
|
||||
|
@ -3816,8 +3819,6 @@
|
|||
"default_value": 200,
|
||||
"minimum_value_warning": "-1000",
|
||||
"maximum_value_warning": "1000",
|
||||
"maximum_value": "machine_depth - resolveOrValue('prime_tower_size')",
|
||||
"minimum_value": "0",
|
||||
"maximum_value": "machine_depth / 2 - resolveOrValue('prime_tower_size') if machine_center_is_zero else machine_depth - resolveOrValue('prime_tower_size')",
|
||||
"minimum_value": "machine_depth / -2 if machine_center_is_zero else 0",
|
||||
"settable_per_mesh": false,
|
||||
|
|
205
resources/definitions/renkforce_rf100.def.json
Normal file
205
resources/definitions/renkforce_rf100.def.json
Normal file
|
@ -0,0 +1,205 @@
|
|||
{
|
||||
"id": "RF100",
|
||||
"version": 2,
|
||||
"name": "Renkforce RF100",
|
||||
"inherits": "fdmprinter",
|
||||
"metadata": {
|
||||
"author": "Simon Peter (based on RF100.ini by Conrad Electronic SE)",
|
||||
"category": "Other",
|
||||
"file_formats": "text/x-gcode",
|
||||
"manufacturer": "Renkforce",
|
||||
"visible": true
|
||||
},
|
||||
|
||||
"overrides": {
|
||||
"adhesion_type": {
|
||||
"default_value": "skirt"
|
||||
},
|
||||
"bottom_thickness": {
|
||||
"value": "0.5"
|
||||
},
|
||||
"brim_line_count": {
|
||||
"value": "20.0"
|
||||
},
|
||||
"cool_fan_enabled": {
|
||||
"value": "True"
|
||||
},
|
||||
"cool_fan_full_at_height": {
|
||||
"value": "0.5"
|
||||
},
|
||||
"cool_fan_speed_max": {
|
||||
"value": "100.0"
|
||||
},
|
||||
"cool_fan_speed_min": {
|
||||
"value": "100.0"
|
||||
},
|
||||
"cool_lift_head": {
|
||||
"value": "True"
|
||||
},
|
||||
"cool_min_layer_time": {
|
||||
"value": "5.0"
|
||||
},
|
||||
"cool_min_speed": {
|
||||
"value": "10.0"
|
||||
},
|
||||
"infill_before_walls": {
|
||||
"value": "True"
|
||||
},
|
||||
"infill_overlap": {
|
||||
"value": "15.0"
|
||||
},
|
||||
"layer_0_z_overlap": {
|
||||
"value": "0.22"
|
||||
},
|
||||
"layer_height_0": {
|
||||
"value": "0.3"
|
||||
},
|
||||
"machine_depth": {
|
||||
"value": "100"
|
||||
},
|
||||
"machine_end_gcode": {
|
||||
"default_value": ";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+0.5 E-5 X-20 Y-20 F{speed_travel} ;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"
|
||||
},
|
||||
"machine_gcode_flavor": {
|
||||
"default_value": "RepRap (Marlin/Sprinter)"
|
||||
},
|
||||
"machine_height": {
|
||||
"value": "100"
|
||||
},
|
||||
"machine_name": {
|
||||
"default_value": "Renkforce RF100"
|
||||
},
|
||||
"machine_start_gcode": {
|
||||
"default_value": ";Sliced at: {day} {date} {time}\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\nG1 Z15.0 F{speed_travel} ;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 F{speed_travel}\nM117 Printing..."
|
||||
},
|
||||
"machine_width": {
|
||||
"value": "100"
|
||||
},
|
||||
"material_bed_temperature": {
|
||||
"visible": "False"
|
||||
},
|
||||
"material_diameter": {
|
||||
"value": "1.75"
|
||||
},
|
||||
"material_print_temperature": {
|
||||
"value": "210.0"
|
||||
},
|
||||
"ooze_shield_enabled": {
|
||||
"value": "True"
|
||||
},
|
||||
"raft_airgap": {
|
||||
"value": "0.22"
|
||||
},
|
||||
"raft_base_line_spacing": {
|
||||
"value": "3.0"
|
||||
},
|
||||
"raft_base_line_width": {
|
||||
"value": "1.0"
|
||||
},
|
||||
"raft_base_thickness": {
|
||||
"value": "0.3"
|
||||
},
|
||||
"raft_interface_line_spacing": {
|
||||
"value": "3.0"
|
||||
},
|
||||
"raft_interface_line_width": {
|
||||
"value": "0.4"
|
||||
},
|
||||
"raft_interface_thickness": {
|
||||
"value": "0.27"
|
||||
},
|
||||
"raft_margin": {
|
||||
"value": "5.0"
|
||||
},
|
||||
"raft_surface_layers": {
|
||||
"value": "2.0"
|
||||
},
|
||||
"raft_surface_line_spacing": {
|
||||
"value": "3.0"
|
||||
},
|
||||
"raft_surface_line_width": {
|
||||
"value": "0.4"
|
||||
},
|
||||
"raft_surface_thickness": {
|
||||
"value": "0.27"
|
||||
},
|
||||
"retraction_amount": {
|
||||
"value": "2.0"
|
||||
},
|
||||
"retraction_combing": {
|
||||
"default_value": "all"
|
||||
},
|
||||
"retraction_enable": {
|
||||
"value": "True"
|
||||
},
|
||||
"retraction_hop_enabled": {
|
||||
"value": "1.0"
|
||||
},
|
||||
"retraction_min_travel": {
|
||||
"value": "1.5"
|
||||
},
|
||||
"retraction_speed": {
|
||||
"value": "40.0"
|
||||
},
|
||||
"skin_overlap": {
|
||||
"value": "15.0"
|
||||
},
|
||||
"skirt_brim_minimal_length": {
|
||||
"value": "150.0"
|
||||
},
|
||||
"skirt_gap": {
|
||||
"value": "3.0"
|
||||
},
|
||||
"skirt_line_count": {
|
||||
"value": "1.0"
|
||||
},
|
||||
"speed_infill": {
|
||||
"value": "50.0"
|
||||
},
|
||||
"speed_layer_0": {
|
||||
"value": "30.0"
|
||||
},
|
||||
"speed_print": {
|
||||
"value": "50.0"
|
||||
},
|
||||
"speed_topbottom": {
|
||||
"value": "30.0"
|
||||
},
|
||||
"speed_travel": {
|
||||
"value": "50.0"
|
||||
},
|
||||
"speed_wall_0": {
|
||||
"value": "25.0"
|
||||
},
|
||||
"speed_wall_x": {
|
||||
"value": "35.0"
|
||||
},
|
||||
"support_angle": {
|
||||
"value": "60.0"
|
||||
},
|
||||
"support_enable": {
|
||||
"value": "False"
|
||||
},
|
||||
"support_infill_rate": {
|
||||
"value": "15.0"
|
||||
},
|
||||
"support_pattern": {
|
||||
"default_value": "lines"
|
||||
},
|
||||
"support_type": {
|
||||
"default_value": "everywhere"
|
||||
},
|
||||
"support_xy_distance": {
|
||||
"value": "0.5"
|
||||
},
|
||||
"support_z_distance": {
|
||||
"value": "0.1"
|
||||
},
|
||||
"top_thickness": {
|
||||
"value": "0.5"
|
||||
},
|
||||
"wall_thickness": {
|
||||
"value": "0.8"
|
||||
}
|
||||
}
|
||||
}
|
25
resources/extruders/cartesio_extruder_0.def.json
Normal file
25
resources/extruders/cartesio_extruder_0.def.json
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"id": "cartesio_extruder_0",
|
||||
"version": 2,
|
||||
"name": "Extruder 0",
|
||||
"inherits": "fdmextruder",
|
||||
"metadata": {
|
||||
"machine": "cartesio",
|
||||
"position": "0"
|
||||
},
|
||||
|
||||
"overrides": {
|
||||
"extruder_nr": {
|
||||
"default_value": 0,
|
||||
"maximum_value": "3"
|
||||
},
|
||||
"machine_nozzle_offset_x": { "default_value": 0.0 },
|
||||
"machine_nozzle_offset_y": { "default_value": 0.0 },
|
||||
"machine_extruder_start_code": {
|
||||
"default_value": "M117 Heating nozzles....\nM104 S190 T0\nG1 X70 Y20 F9000\nM109 S270 T0 ;wait for nozzle to heat up\nT0\n\nM117 purging nozzle\nG92 E0\nG1 E6 F90\nG92 E0\nG1 E-2 F300\nG92 E0\nM117 wiping nozzle\nG1 X1 Y28 F3000\nG1 X70 F6000\n\nM117 printing\n"
|
||||
},
|
||||
"machine_extruder_end_code": {
|
||||
"default_value": "\nM104 S160 T0\n;end extruder_0\nM117 temp is {material_print_temp}"
|
||||
}
|
||||
}
|
||||
}
|
25
resources/extruders/cartesio_extruder_1.def.json
Normal file
25
resources/extruders/cartesio_extruder_1.def.json
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"id": "cartesio_extruder_1",
|
||||
"version": 2,
|
||||
"name": "Extruder 1",
|
||||
"inherits": "fdmextruder",
|
||||
"metadata": {
|
||||
"machine": "cartesio",
|
||||
"position": "1"
|
||||
},
|
||||
|
||||
"overrides": {
|
||||
"extruder_nr": {
|
||||
"default_value": 1,
|
||||
"maximum_value": "3"
|
||||
},
|
||||
"machine_nozzle_offset_x": { "default_value": 24.0 },
|
||||
"machine_nozzle_offset_y": { "default_value": 0.0 },
|
||||
"machine_extruder_start_code": {
|
||||
"default_value": "\n;start extruder_1\nM117 Heating nozzles....\nM104 S190 T1\nG1 X70 Y20 F9000\nM109 S190 T1 ;wait for nozzle to heat up\n\nM117 purging nozzle\nG92 E0\nG1 E6 F90\nG92 E0\nG1 E-2 F300\nG92 E0\n\nM117 wiping nozzle\nG1 X1 Y28 F3000\nG1 X70 F6000\n\nM117 printing\n"
|
||||
},
|
||||
"machine_extruder_end_code": {
|
||||
"default_value": "\nM104 T0 S120\n;end extruder_1\n"
|
||||
}
|
||||
}
|
||||
}
|
25
resources/extruders/cartesio_extruder_2.def.json
Normal file
25
resources/extruders/cartesio_extruder_2.def.json
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"id": "cartesio_extruder_2",
|
||||
"version": 2,
|
||||
"name": "Extruder 2",
|
||||
"inherits": "fdmextruder",
|
||||
"metadata": {
|
||||
"machine": "cartesio",
|
||||
"position": "2"
|
||||
},
|
||||
|
||||
"overrides": {
|
||||
"extruder_nr": {
|
||||
"default_value": 2,
|
||||
"maximum_value": "3"
|
||||
},
|
||||
"machine_nozzle_offset_x": { "default_value": 0.0 },
|
||||
"machine_nozzle_offset_y": { "default_value": 60.0 },
|
||||
"machine_extruder_start_code": {
|
||||
"default_value": "\n;start extruder_2\nM117 Heating nozzles....\nM104 S190 T2\nG1 X70 Y20 F9000\nM109 S190 T2\n\nM117 purging nozzle\nG92 E0\nG1 E6 F90\nG92 E0\nG1 E-2 F300\nG92 E0\n\nM117 wiping nozzle\nG1 X1 Y28 F3000\nG1 X70 F6000\n\nM117 printing\n"
|
||||
},
|
||||
"machine_extruder_end_code": {
|
||||
"default_value": "\nM104 T2 S120\n;end extruder_2\n"
|
||||
}
|
||||
}
|
||||
}
|
25
resources/extruders/cartesio_extruder_3.def.json
Normal file
25
resources/extruders/cartesio_extruder_3.def.json
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"id": "cartesio_extruder_3",
|
||||
"version": 2,
|
||||
"name": "Extruder 3",
|
||||
"inherits": "fdmextruder",
|
||||
"metadata": {
|
||||
"machine": "cartesio",
|
||||
"position": "3"
|
||||
},
|
||||
|
||||
"overrides": {
|
||||
"extruder_nr": {
|
||||
"default_value": 3,
|
||||
"maximum_value": "3"
|
||||
},
|
||||
"machine_nozzle_offset_x": { "default_value": 24.0 },
|
||||
"machine_nozzle_offset_y": { "default_value": 60.0 },
|
||||
"machine_extruder_start_code": {
|
||||
"default_value": "\n;start extruder_3\nM117 Heating nozzles....\nM104 S190 T3\nG1 X70 Y20 F9000\nM109 S190 T3\n\nM117 purging nozzle\nG92 E0\nG1 E6 F90\nG92 E0\nG1 E-2 F300\nG92 E0\n\nM117 wiping nozzle\nG1 X1 Y28 F3000\nG1 X70 F6000\n\nM117 printing\n"
|
||||
},
|
||||
"machine_extruder_end_code": {
|
||||
"default_value": "\nM104 T3 S120\n;end extruder_3\n"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1425,7 +1425,7 @@ msgstr "X min"
|
|||
#: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.qml:278
|
||||
msgctxt "@label"
|
||||
msgid "Y min"
|
||||
msgstr "X min"
|
||||
msgstr "Y min"
|
||||
|
||||
#: /home/ruben/Projects/Cura/plugins/MachineSettingsAction/MachineSettingsAction.qml:294
|
||||
msgctxt "@label"
|
||||
|
|
|
@ -3010,7 +3010,7 @@ msgstr "Engine-&logboek Weergeven..."
|
|||
#: /home/ruben/Projects/Cura/resources/qml/Actions.qml:307
|
||||
msgctxt "@action:inmenu menubar:help"
|
||||
msgid "Show Configuration Folder"
|
||||
msgstr "Configuratiemap Weergeven"
|
||||
msgstr "Open Configuratiemap"
|
||||
|
||||
#: /home/ruben/Projects/Cura/resources/qml/Actions.qml:314
|
||||
msgctxt "@action:menu"
|
||||
|
|
BIN
resources/meshes/cartesio_platform.stl
Normal file
BIN
resources/meshes/cartesio_platform.stl
Normal file
Binary file not shown.
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2016 Ultimaker B.V.
|
||||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
|
@ -12,7 +12,7 @@ import Cura 1.0 as Cura
|
|||
Column
|
||||
{
|
||||
id: printMonitor
|
||||
property var connectedPrinter: printerConnected ? Cura.MachineManager.printerOutputDevices[0] : null
|
||||
property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
|
||||
|
||||
Cura.ExtrudersModel
|
||||
{
|
||||
|
@ -20,48 +20,477 @@ Column
|
|||
simpleNames: true
|
||||
}
|
||||
|
||||
Item
|
||||
Rectangle
|
||||
{
|
||||
width: base.width - 2 * UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height + UM.Theme.getSize("default_margin").height
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
id: connectedPrinterHeader
|
||||
width: parent.width
|
||||
height: childrenRect.height + UM.Theme.getSize("default_margin").height * 2
|
||||
color: UM.Theme.getColor("setting_category")
|
||||
|
||||
Label
|
||||
{
|
||||
text: printerConnected ? connectedPrinter.connectionText : catalog.i18nc("@info:status", "The printer is not connected.")
|
||||
color: printerConnected && printerAcceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
id: connectedPrinterNameLabel
|
||||
text: connectedPrinter != null ? connectedPrinter.name : catalog.i18nc("@info:status", "No printer connected")
|
||||
font: UM.Theme.getFont("large")
|
||||
color: UM.Theme.getColor("text")
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
Label
|
||||
{
|
||||
id: connectedPrinterAddressLabel
|
||||
text: (connectedPrinter != null && connectedPrinter.address != null) ? connectedPrinter.address : ""
|
||||
font: UM.Theme.getFont("small")
|
||||
color: UM.Theme.getColor("text_inactive")
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: connectedPrinter != null ? connectedPrinter.connectionText : catalog.i18nc("@info:status", "The printer is not connected.")
|
||||
color: connectedPrinter != null && connectedPrinter.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
font: UM.Theme.getFont("very_small")
|
||||
wrapMode: Text.WordWrap
|
||||
width: parent.width
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.top: connectedPrinterNameLabel.bottom
|
||||
}
|
||||
}
|
||||
|
||||
Loader
|
||||
Rectangle
|
||||
{
|
||||
sourceComponent: monitorSection
|
||||
property string label: catalog.i18nc("@label", "Temperatures")
|
||||
}
|
||||
color: UM.Theme.getColor("sidebar_lining")
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
|
||||
Flow
|
||||
{
|
||||
id: extrudersGrid
|
||||
spacing: UM.Theme.getSize("sidebar_lining_thin").width
|
||||
width: parent.width
|
||||
|
||||
Repeater
|
||||
{
|
||||
id: extrudersRepeater
|
||||
model: machineExtruderCount.properties.value
|
||||
delegate: Loader
|
||||
|
||||
delegate: Rectangle
|
||||
{
|
||||
sourceComponent: monitorItem
|
||||
property string label: machineExtruderCount.properties.value > 1 ? extrudersModel.getItem(index).name : catalog.i18nc("@label", "Hotend")
|
||||
property string value: printerConnected ? Math.round(connectedPrinter.hotendTemperatures[index]) + "°C" : ""
|
||||
id: extruderRectangle
|
||||
color: UM.Theme.getColor("sidebar")
|
||||
width: index == machineExtruderCount.properties.value - 1 && index % 2 == 0 ? extrudersGrid.width : extrudersGrid.width / 2 - UM.Theme.getSize("sidebar_lining_thin").width / 2
|
||||
height: UM.Theme.getSize("sidebar_extruder_box").height
|
||||
|
||||
Label //Extruder name.
|
||||
{
|
||||
text: ExtruderManager.getExtruderName(index) != "" ? ExtruderManager.getExtruderName(index) : catalog.i18nc("@label", "Hotend")
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("default")
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
Label //Temperature indication.
|
||||
{
|
||||
text: (connectedPrinter != null && connectedPrinter.hotendTemperatures[index] != null) ? Math.round(connectedPrinter.hotendTemperatures[index]) + "°C" : ""
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("large")
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
Rectangle //Material colour indication.
|
||||
{
|
||||
id: materialColor
|
||||
width: materialName.height * 0.75
|
||||
height: materialName.height * 0.75
|
||||
color: (connectedPrinter != null && connectedPrinter.materialColors[index] != null && connectedPrinter.materialIds[index] != "") ? connectedPrinter.materialColors[index] : "#00000000"
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
visible: connectedPrinter != null && connectedPrinter.materialColors[index] != null && connectedPrinter.materialIds[index] != ""
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.verticalCenter: materialName.verticalCenter
|
||||
}
|
||||
Label //Material name.
|
||||
{
|
||||
id: materialName
|
||||
text: (connectedPrinter != null && connectedPrinter.materialNames[index] != null && connectedPrinter.materialIds[index] != "") ? connectedPrinter.materialNames[index] : ""
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
anchors.left: materialColor.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
Label //Variant name.
|
||||
{
|
||||
text: (connectedPrinter != null && connectedPrinter.hotendIds[index] != null) ? connectedPrinter.hotendIds[index] : ""
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
}
|
||||
Repeater
|
||||
{
|
||||
model: machineHeatedBed.properties.value == "True" ? 1 : 0
|
||||
delegate: Loader
|
||||
{
|
||||
sourceComponent: monitorItem
|
||||
property string label: catalog.i18nc("@label", "Build plate")
|
||||
property string value: printerConnected ? Math.round(connectedPrinter.bedTemperature) + "°C" : ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
color: UM.Theme.getColor("sidebar_lining")
|
||||
width: parent.width
|
||||
height: UM.Theme.getSize("sidebar_lining_thin").width
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
color: UM.Theme.getColor("sidebar")
|
||||
width: parent.width
|
||||
height: machineHeatedBed.properties.value == "True" ? UM.Theme.getSize("sidebar_extruder_box").height : 0
|
||||
visible: machineHeatedBed.properties.value == "True"
|
||||
|
||||
Label //Build plate label.
|
||||
{
|
||||
text: catalog.i18nc("@label", "Build plate")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
Label //Target temperature.
|
||||
{
|
||||
id: bedTargetTemperature
|
||||
text: connectedPrinter != null ? connectedPrinter.targetBedTemperature + "°C" : ""
|
||||
font: UM.Theme.getFont("small")
|
||||
color: UM.Theme.getColor("text_inactive")
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.bottom: bedCurrentTemperature.bottom
|
||||
}
|
||||
Label //Current temperature.
|
||||
{
|
||||
id: bedCurrentTemperature
|
||||
text: connectedPrinter != null ? connectedPrinter.bedTemperature + "°C" : ""
|
||||
font: UM.Theme.getFont("large")
|
||||
color: UM.Theme.getColor("text")
|
||||
anchors.right: bedTargetTemperature.left
|
||||
anchors.top: parent.top
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
Rectangle //Input field for pre-heat temperature.
|
||||
{
|
||||
id: preheatTemperatureControl
|
||||
color: UM.Theme.getColor("setting_validation_ok")
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: mouseArea.containsMouse ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border")
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
|
||||
width: UM.Theme.getSize("setting_control").width
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
|
||||
Rectangle //Highlight of input field.
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.margins: UM.Theme.getSize("default_lining").width
|
||||
color: UM.Theme.getColor("setting_control_highlight")
|
||||
opacity: preheatTemperatureControl.hovered ? 1.0 : 0
|
||||
}
|
||||
Label //Maximum temperature indication.
|
||||
{
|
||||
text: (bedTemperature.properties.maximum_value != "None" ? bedTemperature.properties.maximum_value : "") + "°C"
|
||||
color: UM.Theme.getColor("setting_unit")
|
||||
font: UM.Theme.getFont("default")
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("setting_unit_margin").width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
MouseArea //Change cursor on hovering.
|
||||
{
|
||||
id: mouseArea
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.IBeamCursor
|
||||
}
|
||||
TextInput
|
||||
{
|
||||
id: preheatTemperatureInput
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
selectByMouse: true
|
||||
maximumLength: 10
|
||||
validator: RegExpValidator { regExp: /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ } //Floating point regex.
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
Binding
|
||||
{
|
||||
target: preheatTemperatureInput
|
||||
property: "text"
|
||||
value:
|
||||
{
|
||||
// Stacklevels
|
||||
// 0: user -> unsaved change
|
||||
// 1: quality changes -> saved change
|
||||
// 2: quality
|
||||
// 3: material -> user changed material in materialspage
|
||||
// 4: variant
|
||||
// 5: machine_changes
|
||||
// 6: machine
|
||||
if ((bedTemperature.resolve != "None" && bedTemperature.resolve) && (bedTemperature.stackLevels[0] != 0) && (bedTemperature.stackLevels[0] != 1))
|
||||
{
|
||||
// We have a resolve function. Indicates that the setting is not settable per extruder and that
|
||||
// we have to choose between the resolved value (default) and the global value
|
||||
// (if user has explicitly set this).
|
||||
return bedTemperature.resolve;
|
||||
}
|
||||
else
|
||||
{
|
||||
return bedTemperature.properties.value;
|
||||
}
|
||||
}
|
||||
when: !preheatTemperatureInput.activeFocus
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: preheatCountdownIcon
|
||||
width: UM.Theme.getSize("save_button_specs_icons").width
|
||||
height: UM.Theme.getSize("save_button_specs_icons").height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
color: UM.Theme.getColor("text")
|
||||
visible: preheatCountdown.visible
|
||||
source: UM.Theme.getIcon("print_time")
|
||||
anchors.right: preheatCountdown.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width / 2
|
||||
anchors.verticalCenter: preheatCountdown.verticalCenter
|
||||
}
|
||||
|
||||
Timer
|
||||
{
|
||||
id: preheatCountdownTimer
|
||||
interval: 100 //Update every 100ms. You want to update every 1s, but then you have one timer for the updating running out of sync with the actual date timer and you might skip seconds.
|
||||
running: false
|
||||
repeat: true
|
||||
onTriggered: update()
|
||||
property var endTime: new Date() //Set initial endTime to be the current date, so that the endTime has initially already passed and the timer text becomes invisible if you were to update.
|
||||
function update()
|
||||
{
|
||||
var now = new Date();
|
||||
if (now.getTime() < endTime.getTime())
|
||||
{
|
||||
var remaining = endTime - now; //This is in milliseconds.
|
||||
var minutes = Math.floor(remaining / 60 / 1000);
|
||||
var seconds = Math.floor((remaining / 1000) % 60);
|
||||
preheatCountdown.text = minutes + ":" + (seconds < 10 ? "0" + seconds : seconds);
|
||||
preheatCountdown.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
preheatCountdown.visible = false;
|
||||
running = false;
|
||||
if (connectedPrinter != null)
|
||||
{
|
||||
connectedPrinter.cancelPreheatBed()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Label
|
||||
{
|
||||
id: preheatCountdown
|
||||
text: "0:00"
|
||||
visible: false //It only becomes visible when the timer is running.
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
anchors.right: preheatButton.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.verticalCenter: preheatButton.verticalCenter
|
||||
}
|
||||
|
||||
Button //The pre-heat button.
|
||||
{
|
||||
id: preheatButton
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
enabled:
|
||||
{
|
||||
if (connectedPrinter == null)
|
||||
{
|
||||
return false; //Can't preheat if not connected.
|
||||
}
|
||||
if (!connectedPrinter.acceptsCommands)
|
||||
{
|
||||
return false; //Not allowed to do anything.
|
||||
}
|
||||
if (connectedPrinter.jobState == "printing" || connectedPrinter.jobState == "pre_print" || connectedPrinter.jobState == "resuming" || connectedPrinter.jobState == "error" || connectedPrinter.jobState == "offline")
|
||||
{
|
||||
return false; //Printer is in a state where it can't react to pre-heating.
|
||||
}
|
||||
if (preheatCountdownTimer.running)
|
||||
{
|
||||
return true; //Can always cancel if the timer is running.
|
||||
}
|
||||
if (bedTemperature.properties.minimum_value != "None" && parseInt(preheatTemperatureInput.text) < parseInt(bedTemperature.properties.minimum_value))
|
||||
{
|
||||
return false; //Target temperature too low.
|
||||
}
|
||||
if (bedTemperature.properties.maximum_value != "None" && parseInt(preheatTemperatureInput.text) > parseInt(bedTemperature.properties.maximum_value))
|
||||
{
|
||||
return false; //Target temperature too high.
|
||||
}
|
||||
return true; //Preconditions are met.
|
||||
}
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
style: ButtonStyle {
|
||||
background: Rectangle
|
||||
{
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2)
|
||||
border.color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled_border");
|
||||
}
|
||||
else if(control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_active_border");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_hovered_border");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("action_button_border");
|
||||
}
|
||||
}
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled");
|
||||
}
|
||||
else if(control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_active");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_hovered");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("action_button");
|
||||
}
|
||||
}
|
||||
Behavior on color
|
||||
{
|
||||
ColorAnimation
|
||||
{
|
||||
duration: 50
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
id: actualLabel
|
||||
anchors.centerIn: parent
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled_text");
|
||||
}
|
||||
else if(control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_active_text");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_hovered_text");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("action_button_text");
|
||||
}
|
||||
}
|
||||
font: UM.Theme.getFont("action_button")
|
||||
text: preheatCountdownTimer.running ? catalog.i18nc("@button Cancel pre-heating", "Cancel") : catalog.i18nc("@button", "Pre-heat")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onClicked:
|
||||
{
|
||||
if (!preheatCountdownTimer.running)
|
||||
{
|
||||
connectedPrinter.preheatBed(preheatTemperatureInput.text, connectedPrinter.preheatBedTimeout);
|
||||
var now = new Date();
|
||||
var end_time = new Date();
|
||||
end_time.setTime(now.getTime() + connectedPrinter.preheatBedTimeout * 1000); //*1000 because time is in milliseconds here.
|
||||
preheatCountdownTimer.endTime = end_time;
|
||||
preheatCountdownTimer.start();
|
||||
preheatCountdownTimer.update(); //Update once before the first timer is triggered.
|
||||
}
|
||||
else
|
||||
{
|
||||
connectedPrinter.cancelPreheatBed();
|
||||
preheatCountdownTimer.endTime = new Date();
|
||||
preheatCountdownTimer.update();
|
||||
}
|
||||
}
|
||||
|
||||
onHoveredChanged:
|
||||
{
|
||||
if (hovered)
|
||||
{
|
||||
base.showTooltip(
|
||||
base,
|
||||
{x: 0, y: preheatButton.mapToItem(base, 0, 0).y},
|
||||
catalog.i18nc("@tooltip of pre-heat", "Heat the bed in advance before printing. You can continue adjusting your print while it is heating, and you won't have to wait for the bed to heat up when you're ready to print.")
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.hideTooltip();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: bedTemperature
|
||||
containerStackId: Cura.MachineManager.activeMachineId
|
||||
key: "material_bed_temperature"
|
||||
watchedProperties: ["value", "minimum_value", "maximum_value", "resolve"]
|
||||
storeIndex: 0
|
||||
|
||||
property var resolve: Cura.MachineManager.activeStackId != Cura.MachineManager.activeMachineId ? properties.resolve : "None"
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: machineExtruderCount
|
||||
containerStackId: Cura.MachineManager.activeMachineId
|
||||
key: "machine_extruder_count"
|
||||
watchedProperties: ["value"]
|
||||
}
|
||||
|
||||
Loader
|
||||
{
|
||||
|
@ -72,19 +501,19 @@ Column
|
|||
{
|
||||
sourceComponent: monitorItem
|
||||
property string label: catalog.i18nc("@label", "Job Name")
|
||||
property string value: printerConnected ? connectedPrinter.jobName : ""
|
||||
property string value: connectedPrinter != null ? connectedPrinter.jobName : ""
|
||||
}
|
||||
Loader
|
||||
{
|
||||
sourceComponent: monitorItem
|
||||
property string label: catalog.i18nc("@label", "Printing Time")
|
||||
property string value: printerConnected ? getPrettyTime(connectedPrinter.timeTotal) : ""
|
||||
property string value: connectedPrinter != null ? getPrettyTime(connectedPrinter.timeTotal) : ""
|
||||
}
|
||||
Loader
|
||||
{
|
||||
sourceComponent: monitorItem
|
||||
property string label: catalog.i18nc("@label", "Estimated time left")
|
||||
property string value: printerConnected ? getPrettyTime(connectedPrinter.timeTotal - connectedPrinter.timeElapsed) : ""
|
||||
property string value: connectedPrinter != null ? getPrettyTime(connectedPrinter.timeTotal - connectedPrinter.timeElapsed) : ""
|
||||
}
|
||||
|
||||
Component
|
||||
|
@ -103,7 +532,7 @@ Column
|
|||
width: parent.width * 0.4
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: label
|
||||
color: printerConnected && printerAcceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
color: connectedPrinter != null && connectedPrinter.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
@ -112,7 +541,7 @@ Column
|
|||
width: parent.width * 0.6
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: value
|
||||
color: printerConnected && printerAcceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
color: connectedPrinter != null && connectedPrinter.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
@ -125,7 +554,7 @@ Column
|
|||
Rectangle
|
||||
{
|
||||
color: UM.Theme.getColor("setting_category")
|
||||
width: base.width - 2 * UM.Theme.getSize("default_margin").width
|
||||
width: base.width
|
||||
height: UM.Theme.getSize("section").height
|
||||
|
||||
Label
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
|
@ -455,19 +455,6 @@ Rectangle
|
|||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
id: monitorLabel
|
||||
text: catalog.i18nc("@label","Printer Monitor");
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width;
|
||||
anchors.top: headerSeparator.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
width: parent.width * 0.45
|
||||
font: UM.Theme.getFont("large")
|
||||
color: UM.Theme.getColor("text")
|
||||
visible: monitoringPrint
|
||||
}
|
||||
|
||||
StackView
|
||||
{
|
||||
id: sidebarContents
|
||||
|
@ -511,10 +498,8 @@ Rectangle
|
|||
Loader
|
||||
{
|
||||
anchors.bottom: footerSeparator.top
|
||||
anchors.top: monitorLabel.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.top: headerSeparator.bottom
|
||||
anchors.left: base.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.right: base.right
|
||||
source: monitoringPrint ? "PrintMonitor.qml": "SidebarContents.qml"
|
||||
}
|
||||
|
|
22
resources/quality/abax_pri3/apri3_pla_fast.inst.cfg
Normal file
22
resources/quality/abax_pri3/apri3_pla_fast.inst.cfg
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
[general]
|
||||
version = 2
|
||||
name = Normal Quality
|
||||
definition = abax_pri3
|
||||
|
||||
[metadata]
|
||||
type = quality
|
||||
material = generic_pla
|
||||
weight = 0
|
||||
quality_type = normal
|
||||
|
||||
[values]
|
||||
layer_height = 0.2
|
||||
wall_thickness = 1.05
|
||||
top_bottom_thickness = 0.8
|
||||
infill_sparse_density = 20
|
||||
speed_print = 80
|
||||
speed_layer_0 = =round(speed_print * 30 / 50)
|
||||
speed_topbottom = 20
|
||||
cool_min_layer_time = 5
|
||||
cool_min_speed = 10
|
22
resources/quality/abax_pri3/apri3_pla_high.inst.cfg
Normal file
22
resources/quality/abax_pri3/apri3_pla_high.inst.cfg
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
[general]
|
||||
version = 2
|
||||
name = High Quality
|
||||
definition = abax_pri3
|
||||
|
||||
[metadata]
|
||||
type = quality
|
||||
material = generic_pla
|
||||
weight = 1
|
||||
quality_type = high
|
||||
|
||||
[values]
|
||||
layer_height = 0.1
|
||||
wall_thickness = 1.05
|
||||
top_bottom_thickness = 0.8
|
||||
infill_sparse_density = 20
|
||||
speed_print = 50
|
||||
speed_layer_0 = =round(speed_print * 30 / 50)
|
||||
speed_topbottom = 20
|
||||
cool_min_layer_time = 5
|
||||
cool_min_speed = 10
|
22
resources/quality/abax_pri3/apri3_pla_normal.inst.cfg
Normal file
22
resources/quality/abax_pri3/apri3_pla_normal.inst.cfg
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
[general]
|
||||
version = 2
|
||||
name = Normal Quality
|
||||
definition = abax_pri3
|
||||
|
||||
[metadata]
|
||||
type = quality
|
||||
material = generic_pla
|
||||
weight = 0
|
||||
quality_type = normal
|
||||
|
||||
[values]
|
||||
layer_height = 0.2
|
||||
wall_thickness = 1.05
|
||||
top_bottom_thickness = 0.8
|
||||
infill_sparse_density = 20
|
||||
speed_print = 50
|
||||
speed_layer_0 = =round(speed_print * 30 / 50)
|
||||
speed_topbottom = 20
|
||||
cool_min_layer_time = 5
|
||||
cool_min_speed = 10
|
22
resources/quality/abax_pri5/apri5_pla_fast.inst.cfg
Normal file
22
resources/quality/abax_pri5/apri5_pla_fast.inst.cfg
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
[general]
|
||||
version = 2
|
||||
name = Normal Quality
|
||||
definition = abax_pri5
|
||||
|
||||
[metadata]
|
||||
type = quality
|
||||
material = generic_pla
|
||||
weight = 0
|
||||
quality_type = normal
|
||||
|
||||
[values]
|
||||
layer_height = 0.2
|
||||
wall_thickness = 1.05
|
||||
top_bottom_thickness = 0.8
|
||||
infill_sparse_density = 20
|
||||
speed_print = 80
|
||||
speed_layer_0 = =round(speed_print * 30 / 50)
|
||||
speed_topbottom = 20
|
||||
cool_min_layer_time = 5
|
||||
cool_min_speed = 10
|
22
resources/quality/abax_pri5/apri5_pla_high.inst.cfg
Normal file
22
resources/quality/abax_pri5/apri5_pla_high.inst.cfg
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
[general]
|
||||
version = 2
|
||||
name = High Quality
|
||||
definition = abax_pri5
|
||||
|
||||
[metadata]
|
||||
type = quality
|
||||
material = generic_pla
|
||||
weight = 1
|
||||
quality_type = high
|
||||
|
||||
[values]
|
||||
layer_height = 0.1
|
||||
wall_thickness = 1.05
|
||||
top_bottom_thickness = 0.8
|
||||
infill_sparse_density = 20
|
||||
speed_print = 50
|
||||
speed_layer_0 = =round(speed_print * 30 / 50)
|
||||
speed_topbottom = 20
|
||||
cool_min_layer_time = 5
|
||||
cool_min_speed = 10
|
22
resources/quality/abax_pri5/apri5_pla_normal.inst.cfg
Normal file
22
resources/quality/abax_pri5/apri5_pla_normal.inst.cfg
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
[general]
|
||||
version = 2
|
||||
name = Normal Quality
|
||||
definition = abax_pri5
|
||||
|
||||
[metadata]
|
||||
type = quality
|
||||
material = generic_pla
|
||||
weight = 0
|
||||
quality_type = normal
|
||||
|
||||
[values]
|
||||
layer_height = 0.2
|
||||
wall_thickness = 1.05
|
||||
top_bottom_thickness = 0.8
|
||||
infill_sparse_density = 20
|
||||
speed_print = 50
|
||||
speed_layer_0 = =round(speed_print * 30 / 50)
|
||||
speed_topbottom = 20
|
||||
cool_min_layer_time = 5
|
||||
cool_min_speed = 10
|
22
resources/quality/abax_titan/atitan_pla_fast.inst.cfg
Normal file
22
resources/quality/abax_titan/atitan_pla_fast.inst.cfg
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
[general]
|
||||
version = 2
|
||||
name = Normal Quality
|
||||
definition = abax_titan
|
||||
|
||||
[metadata]
|
||||
type = quality
|
||||
material = generic_pla
|
||||
weight = 0
|
||||
quality_type = normal
|
||||
|
||||
[values]
|
||||
layer_height = 0.2
|
||||
wall_thickness = 1.05
|
||||
top_bottom_thickness = 0.8
|
||||
infill_sparse_density = 20
|
||||
speed_print = 80
|
||||
speed_layer_0 = =round(speed_print * 30 / 50)
|
||||
speed_topbottom = 20
|
||||
cool_min_layer_time = 5
|
||||
cool_min_speed = 10
|
21
resources/quality/abax_titan/atitan_pla_high.inst.cfg
Normal file
21
resources/quality/abax_titan/atitan_pla_high.inst.cfg
Normal file
|
@ -0,0 +1,21 @@
|
|||
|
||||
[general]
|
||||
version = 2
|
||||
name = High Quality
|
||||
definition = abax_titan
|
||||
[metadata]
|
||||
type = quality
|
||||
material = generic_pla
|
||||
weight = 1
|
||||
quality_type = high
|
||||
|
||||
[values]
|
||||
layer_height = 0.1
|
||||
wall_thickness = 1.05
|
||||
top_bottom_thickness = 0.8
|
||||
infill_sparse_density = 20
|
||||
speed_print = 50
|
||||
speed_layer_0 = =round(speed_print * 30 / 50)
|
||||
speed_topbottom = 20
|
||||
cool_min_layer_time = 5
|
||||
cool_min_speed = 10
|
22
resources/quality/abax_titan/atitan_pla_normal.inst.cfg
Normal file
22
resources/quality/abax_titan/atitan_pla_normal.inst.cfg
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
[general]
|
||||
version = 2
|
||||
name = Normal Quality
|
||||
definition = abax_titan
|
||||
|
||||
[metadata]
|
||||
type = quality
|
||||
material = generic_pla
|
||||
weight = 0
|
||||
quality_type = normal
|
||||
|
||||
[values]
|
||||
layer_height = 0.2
|
||||
wall_thickness = 1.05
|
||||
top_bottom_thickness = 0.8
|
||||
infill_sparse_density = 20
|
||||
speed_print = 50
|
||||
speed_layer_0 = =round(speed_print * 30 / 50)
|
||||
speed_topbottom = 20
|
||||
cool_min_layer_time = 5
|
||||
cool_min_speed = 10
|
|
@ -18,7 +18,7 @@ material_final_print_temperature = =material_print_temperature - 10
|
|||
prime_tower_size = 16
|
||||
skin_overlap = 20
|
||||
speed_print = 60
|
||||
speed_layer_0 = =round(speed_print * 30 / 60)
|
||||
speed_layer_0 = 20
|
||||
speed_topbottom = =math.ceil(speed_print * 35 / 60)
|
||||
speed_wall = =math.ceil(speed_print * 45 / 60)
|
||||
speed_wall_0 = =math.ceil(speed_wall * 35 / 45)
|
||||
|
|
|
@ -19,7 +19,7 @@ material_final_print_temperature = =material_print_temperature - 10
|
|||
material_standby_temperature = 100
|
||||
prime_tower_size = 16
|
||||
speed_print = 60
|
||||
speed_layer_0 = =round(speed_print * 30 / 60)
|
||||
speed_layer_0 = 20
|
||||
speed_topbottom = =math.ceil(speed_print * 30 / 60)
|
||||
speed_wall = =math.ceil(speed_print * 40 / 60)
|
||||
speed_wall_0 = =math.ceil(speed_wall * 30 / 40)
|
||||
|
|
|
@ -19,7 +19,7 @@ material_initial_print_temperature = =material_print_temperature - 5
|
|||
material_final_print_temperature = =material_print_temperature - 10
|
||||
prime_tower_size = 16
|
||||
speed_print = 50
|
||||
speed_layer_0 = =round(speed_print * 30 / 50)
|
||||
speed_layer_0 = 20
|
||||
speed_topbottom = =math.ceil(speed_print * 30 / 50)
|
||||
speed_wall = =math.ceil(speed_print * 30 / 50)
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ material_final_print_temperature = =material_print_temperature - 10
|
|||
material_standby_temperature = 100
|
||||
prime_tower_size = 16
|
||||
speed_print = 55
|
||||
speed_layer_0 = =round(speed_print * 30 / 55)
|
||||
speed_layer_0 = 20
|
||||
speed_topbottom = =math.ceil(speed_print * 30 / 55)
|
||||
speed_wall = =math.ceil(speed_print * 30 / 55)
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ material_standby_temperature = 100
|
|||
prime_tower_size = 17
|
||||
skin_overlap = 20
|
||||
speed_print = 60
|
||||
speed_layer_0 = =round(speed_print * 30 / 60)
|
||||
speed_layer_0 = 20
|
||||
speed_topbottom = =math.ceil(speed_print * 35 / 60)
|
||||
speed_wall = =math.ceil(speed_print * 45 / 60)
|
||||
speed_wall_0 = =math.ceil(speed_wall * 35 / 45)
|
||||
|
|
|
@ -17,7 +17,7 @@ material_final_print_temperature = =material_print_temperature - 10
|
|||
material_standby_temperature = 100
|
||||
prime_tower_size = 17
|
||||
speed_print = 60
|
||||
speed_layer_0 = =round(speed_print * 30 / 60)
|
||||
speed_layer_0 = 20
|
||||
speed_topbottom = =math.ceil(speed_print * 30 / 60)
|
||||
speed_wall = =math.ceil(speed_print * 40 / 60)
|
||||
speed_wall_0 = =math.ceil(speed_wall * 30 / 40)
|
||||
|
|
|
@ -19,7 +19,7 @@ material_final_print_temperature = =material_print_temperature - 10
|
|||
material_standby_temperature = 100
|
||||
prime_tower_size = 17
|
||||
speed_print = 50
|
||||
speed_layer_0 = =round(speed_print * 30 / 50)
|
||||
speed_layer_0 = 20
|
||||
speed_topbottom = =math.ceil(speed_print * 30 / 50)
|
||||
speed_wall = =math.ceil(speed_print * 30 / 50)
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ material_final_print_temperature = =material_print_temperature - 10
|
|||
material_standby_temperature = 100
|
||||
prime_tower_size = 17
|
||||
speed_print = 55
|
||||
speed_layer_0 = =round(speed_print * 30 / 55)
|
||||
speed_layer_0 = 20
|
||||
speed_topbottom = =math.ceil(speed_print * 30 / 55)
|
||||
speed_wall = =math.ceil(speed_print * 30 / 55)
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ material_print_temperature = =default_material_print_temperature + 5
|
|||
material_standby_temperature = 100
|
||||
prime_tower_enable = False
|
||||
skin_overlap = 20
|
||||
speed_layer_0 = 20
|
||||
speed_topbottom = =math.ceil(speed_print * 35 / 70)
|
||||
speed_wall = =math.ceil(speed_print * 50 / 70)
|
||||
speed_wall_0 = =math.ceil(speed_wall * 35 / 50)
|
||||
|
|
|
@ -17,7 +17,7 @@ machine_nozzle_heat_up_speed = 1.6
|
|||
material_standby_temperature = 100
|
||||
prime_tower_enable = False
|
||||
speed_print = 80
|
||||
speed_layer_0 = =round(speed_print * 30 / 80)
|
||||
speed_layer_0 = 20
|
||||
speed_topbottom = =math.ceil(speed_print * 30 / 80)
|
||||
speed_wall = =math.ceil(speed_print * 40 / 80)
|
||||
speed_wall_0 = =math.ceil(speed_wall * 30 / 40)
|
||||
|
|
|
@ -20,7 +20,7 @@ material_standby_temperature = 100
|
|||
prime_tower_enable = False
|
||||
skin_overlap = 10
|
||||
speed_print = 60
|
||||
speed_layer_0 = =round(speed_print * 30 / 60)
|
||||
speed_layer_0 = 20
|
||||
speed_topbottom = =math.ceil(speed_print * 30 / 60)
|
||||
speed_wall = =math.ceil(speed_print * 30 / 60)
|
||||
top_bottom_thickness = 1
|
||||
|
|
|
@ -18,6 +18,7 @@ machine_nozzle_heat_up_speed = 1.6
|
|||
material_standby_temperature = 100
|
||||
prime_tower_enable = False
|
||||
skin_overlap = 10
|
||||
speed_layer_0 = 20
|
||||
top_bottom_thickness = 1
|
||||
wall_thickness = 1
|
||||
|
||||
|
|
|
@ -12,13 +12,15 @@ material = generic_pva_ultimaker3_BB_0.4
|
|||
[values]
|
||||
acceleration_support = =math.ceil(acceleration_print * 500 / 4000)
|
||||
acceleration_support_infill = =acceleration_support
|
||||
acceleration_support_interface = =acceleration_support
|
||||
jerk_support = =math.ceil(jerk_print * 5 / 25)
|
||||
jerk_support_infill = =jerk_support
|
||||
jerk_support_interface = =jerk_support
|
||||
material_print_temperature = =default_material_print_temperature + 10
|
||||
material_standby_temperature = 100
|
||||
skin_overlap = 20
|
||||
support_interface_height = 0.8
|
||||
prime_tower_enable = False
|
||||
speed_support_interface = =math.ceil(speed_support * 20 / 25)
|
||||
jerk_support_interface = =math.ceil(jerk_support * 1 / 5)
|
||||
acceleration_support_interface = =math.ceil(acceleration_support * 100 / 500 )
|
||||
support_xy_distance = =round(line_width * 1.5, 2)
|
||||
|
||||
|
|
|
@ -12,13 +12,14 @@ material = generic_pva_ultimaker3_BB_0.4
|
|||
[values]
|
||||
acceleration_support = =math.ceil(acceleration_print * 500 / 4000)
|
||||
acceleration_support_infill = =acceleration_support
|
||||
acceleration_support_interface = =acceleration_support
|
||||
jerk_support = =math.ceil(jerk_print * 5 / 25)
|
||||
jerk_support_infill = =jerk_support
|
||||
jerk_support_interface = =jerk_support
|
||||
material_print_temperature = =default_material_print_temperature + 5
|
||||
material_standby_temperature = 100
|
||||
skin_overlap = 15
|
||||
support_interface_height = 0.8
|
||||
prime_tower_enable = False
|
||||
|
||||
speed_support_interface = =math.ceil(speed_support * 20 / 25)
|
||||
jerk_support_interface = =math.ceil(jerk_support * 1 / 5)
|
||||
acceleration_support_interface = =math.ceil(acceleration_support * 100 / 500 )
|
||||
support_xy_distance = =round(line_width * 1.5, 2)
|
||||
|
|
|
@ -12,12 +12,14 @@ material = generic_pva_ultimaker3_BB_0.4
|
|||
[values]
|
||||
acceleration_support = =math.ceil(acceleration_print * 500 / 4000)
|
||||
acceleration_support_infill = =acceleration_support
|
||||
acceleration_support_interface = =acceleration_support
|
||||
jerk_support = =math.ceil(jerk_print * 5 / 25)
|
||||
jerk_support_infill = =jerk_support
|
||||
jerk_support_interface = =jerk_support
|
||||
support_infill_rate = 25
|
||||
support_interface_height = 0.8
|
||||
material_standby_temperature = 100
|
||||
prime_tower_enable = False
|
||||
speed_support_interface = =math.ceil(speed_support * 20 / 25)
|
||||
jerk_support_interface = =math.ceil(jerk_support * 1 / 5)
|
||||
acceleration_support_interface = =math.ceil(acceleration_support * 100 / 500 )
|
||||
support_xy_distance = =round(line_width * 1.5, 2)
|
||||
|
||||
|
|
|
@ -12,12 +12,13 @@ material = generic_pva_ultimaker3_BB_0.4
|
|||
[values]
|
||||
acceleration_support = =math.ceil(acceleration_print * 500 / 4000)
|
||||
acceleration_support_infill = =acceleration_support
|
||||
acceleration_support_interface = =acceleration_support
|
||||
jerk_support = =math.ceil(jerk_print * 5 / 25)
|
||||
jerk_support_infill = =jerk_support
|
||||
jerk_support_interface = =jerk_support
|
||||
support_infill_rate = 25
|
||||
support_interface_height = 0.8
|
||||
material_standby_temperature = 100
|
||||
prime_tower_enable = False
|
||||
|
||||
speed_support_interface = =math.ceil(speed_support * 20 / 25)
|
||||
jerk_support_interface = =math.ceil(jerk_support * 1 / 5)
|
||||
acceleration_support_interface = =math.ceil(acceleration_support * 100 / 500 )
|
||||
support_xy_distance = =round(line_width * 1.5, 2)
|
||||
|
|
|
@ -24,6 +24,10 @@
|
|||
"bold": true,
|
||||
"family": "Open Sans"
|
||||
},
|
||||
"very_small": {
|
||||
"size": 1.0,
|
||||
"family": "Open Sans"
|
||||
},
|
||||
"button_tooltip": {
|
||||
"size": 1.0,
|
||||
"family": "Open Sans"
|
||||
|
@ -247,9 +251,11 @@
|
|||
"sidebar_header_mode_toggle": [0.0, 2.0],
|
||||
"sidebar_header_mode_tabs": [0.0, 3.0],
|
||||
"sidebar_lining": [0.5, 0.5],
|
||||
"sidebar_lining_thin": [0.2, 0.2],
|
||||
"sidebar_setup": [0.0, 2.0],
|
||||
"sidebar_tabs": [0.0, 3.5],
|
||||
"sidebar_inputfields": [0.0, 2.0],
|
||||
"sidebar_extruder_box": [0.0, 6.0],
|
||||
"simple_mode_infill_caption": [0.0, 5.0],
|
||||
"simple_mode_infill_height": [0.0, 8.0],
|
||||
|
||||
|
|
59
resources/variants/cartesio_0.25.inst.cfg
Normal file
59
resources/variants/cartesio_0.25.inst.cfg
Normal file
|
@ -0,0 +1,59 @@
|
|||
[general]
|
||||
name = 0.25 mm
|
||||
version = 2
|
||||
definition = cartesio
|
||||
|
||||
[metadata]
|
||||
author = Cartesio
|
||||
type = variant
|
||||
|
||||
[values]
|
||||
machine_nozzle_size = 0.25
|
||||
machine_nozzle_tip_outer_diameter = 1.05
|
||||
|
||||
wall_0_inset = -0.05
|
||||
fill_perimeter_gaps = nowhere
|
||||
travel_compensate_overlapping_walls_enabled =
|
||||
|
||||
infill_sparse_density = 25
|
||||
infill_overlap = -50
|
||||
skin_overlap = -40
|
||||
|
||||
material_print_temperature_layer_0 = =round(material_print_temperature)
|
||||
material_initial_print_temperature = =round(material_print_temperature)
|
||||
material_diameter = 1.75
|
||||
retraction_amount = 1
|
||||
retraction_speed = 40
|
||||
retraction_prime_speed = =round(retraction_speed / 4)
|
||||
retraction_min_travel = =round(line_width * 10)
|
||||
switch_extruder_retraction_amount = 2
|
||||
switch_extruder_retraction_speeds = 40
|
||||
switch_extruder_prime_speed = =round(switch_extruder_retraction_speeds / 4)
|
||||
|
||||
speed_print = =50 if layer_height < 0.4 else 30
|
||||
speed_infill = =round(speed_print)
|
||||
speed_layer_0 = =round(speed_print / 5 * 4)
|
||||
speed_wall = =round(speed_print / 2)
|
||||
speed_wall_0 = =10 if speed_wall < 11 else (speed_print / 5 *3)
|
||||
speed_topbottom = =round(speed_print / 5 * 4)
|
||||
speed_slowdown_layers = 1
|
||||
speed_travel = =round(speed_print if magic_spiralize else 150)
|
||||
speed_travel_layer_0 = =round(speed_travel)
|
||||
speed_support_interface = =round(speed_topbottom)
|
||||
|
||||
retraction_combing = off
|
||||
retraction_hop_enabled = true
|
||||
|
||||
support_z_distance = 0
|
||||
support_xy_distance = 0.5
|
||||
support_join_distance = 10
|
||||
support_interface_enable = true
|
||||
|
||||
adhesion_type = skirt
|
||||
skirt_gap = 0.5
|
||||
skirt_brim_minimal_length = 50
|
||||
|
||||
coasting_enable = true
|
||||
coasting_volume = 0.1
|
||||
coasting_min_volume = 0.17
|
||||
coasting_speed = 90
|
60
resources/variants/cartesio_0.4.inst.cfg
Normal file
60
resources/variants/cartesio_0.4.inst.cfg
Normal file
|
@ -0,0 +1,60 @@
|
|||
|
||||
[general]
|
||||
name = 0.4 mm
|
||||
version = 2
|
||||
definition = cartesio
|
||||
|
||||
[metadata]
|
||||
author = Scheepers
|
||||
type = variant
|
||||
|
||||
[values]
|
||||
machine_nozzle_size = 0.4
|
||||
machine_nozzle_tip_outer_diameter = 0.8
|
||||
|
||||
wall_0_inset = -0.05
|
||||
fill_perimeter_gaps = nowhere
|
||||
travel_compensate_overlapping_walls_enabled =
|
||||
|
||||
infill_sparse_density = 25
|
||||
infill_overlap = -50
|
||||
skin_overlap = -40
|
||||
|
||||
|
||||
material_print_temperature_layer_0 = =round(material_print_temperature)
|
||||
material_initial_print_temperature = =round(material_print_temperature)
|
||||
material_diameter = 1.75
|
||||
retraction_amount = 1
|
||||
retraction_speed = 40
|
||||
retraction_prime_speed = =round(retraction_speed /4)
|
||||
retraction_min_travel = =round(line_width * 10)
|
||||
switch_extruder_retraction_amount = 2
|
||||
switch_extruder_retraction_speeds = 40
|
||||
switch_extruder_prime_speed = =round(switch_extruder_retraction_speeds /4)
|
||||
|
||||
speed_print = 50
|
||||
speed_layer_0 = =round(speed_print / 5 * 4)
|
||||
speed_wall = =round(speed_print / 2, 1)
|
||||
speed_wall_0 = =10 if speed_wall < 11 else (speed_print / 5 *3)
|
||||
speed_topbottom = =round(speed_print / 5 * 4)
|
||||
speed_slowdown_layers = 1
|
||||
speed_travel = =round(speed_print if magic_spiralize else 150)
|
||||
speed_travel_layer_0 = =round(speed_travel)
|
||||
speed_support_interface = =round(speed_topbottom)
|
||||
|
||||
retraction_combing = off
|
||||
retraction_hop_enabled = true
|
||||
|
||||
support_z_distance = 0
|
||||
support_xy_distance = 0.5
|
||||
support_join_distance = 10
|
||||
support_interface_enable = true
|
||||
|
||||
adhesion_type = skirt
|
||||
skirt_gap = 0.5
|
||||
skirt_brim_minimal_length = 50
|
||||
|
||||
coasting_enable = true
|
||||
coasting_volume = 0.1
|
||||
coasting_min_volume = 0.17
|
||||
coasting_speed = 90
|
59
resources/variants/cartesio_0.8.inst.cfg
Normal file
59
resources/variants/cartesio_0.8.inst.cfg
Normal file
|
@ -0,0 +1,59 @@
|
|||
[general]
|
||||
name = 0.8 mm
|
||||
version = 2
|
||||
definition = cartesio
|
||||
|
||||
[metadata]
|
||||
author = Cartesio
|
||||
type = variant
|
||||
|
||||
[values]
|
||||
machine_nozzle_size = 0.8
|
||||
machine_nozzle_tip_outer_diameter = 1.05
|
||||
|
||||
wall_0_inset = -0.05
|
||||
fill_perimeter_gaps = nowhere
|
||||
travel_compensate_overlapping_walls_enabled =
|
||||
|
||||
infill_sparse_density = 25
|
||||
infill_overlap = -50
|
||||
skin_overlap = -40
|
||||
|
||||
material_print_temperature_layer_0 = =round(material_print_temperature)
|
||||
material_initial_print_temperature = =round(material_print_temperature)
|
||||
material_diameter = 1.75
|
||||
retraction_amount = 2
|
||||
retraction_speed = 40
|
||||
retraction_prime_speed = =round(retraction_speed / 4)
|
||||
retraction_min_travel = =round(line_width * 10)
|
||||
switch_extruder_retraction_amount = 2
|
||||
switch_extruder_retraction_speeds = 40
|
||||
switch_extruder_prime_speed = =round(switch_extruder_retraction_speeds / 4)
|
||||
|
||||
speed_print = =50 if layer_height < 0.4 else 30
|
||||
speed_infill = =round(speed_print)
|
||||
speed_layer_0 = =round(speed_print / 5 * 4)
|
||||
speed_wall = =round(speed_print / 2)
|
||||
speed_wall_0 = =10 if speed_wall < 11 else (speed_print / 5 *3)
|
||||
speed_topbottom = =round(speed_print / 5 * 4)
|
||||
speed_slowdown_layers = 1
|
||||
speed_travel = =round(speed_print if magic_spiralize else 150)
|
||||
speed_travel_layer_0 = =round(speed_travel)
|
||||
speed_support_interface = =round(speed_topbottom)
|
||||
|
||||
retraction_combing = off
|
||||
retraction_hop_enabled = true
|
||||
|
||||
support_z_distance = 0
|
||||
support_xy_distance = 0.5
|
||||
support_join_distance = 10
|
||||
support_interface_enable = true
|
||||
|
||||
adhesion_type = skirt
|
||||
skirt_gap = 0.5
|
||||
skirt_brim_minimal_length = 50
|
||||
|
||||
coasting_enable = true
|
||||
coasting_volume = 0.1
|
||||
coasting_min_volume = 0.17
|
||||
coasting_speed = 90
|
59
run_mypy.py
Normal file
59
run_mypy.py
Normal file
|
@ -0,0 +1,59 @@
|
|||
#!env python
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
# A quick Python implementation of unix 'where' command.
|
||||
def where(exeName, searchPath=os.getenv("PATH")):
|
||||
paths = searchPath.split(";" if sys.platform == "win32" else ":")
|
||||
for path in paths:
|
||||
candidatePath = os.path.join(path, exeName)
|
||||
if os.path.exists(candidatePath):
|
||||
return candidatePath
|
||||
return None
|
||||
|
||||
def findModules(path):
|
||||
result = []
|
||||
for entry in os.scandir(path):
|
||||
if entry.is_dir() and os.path.exists(os.path.join(path, entry.name, "__init__.py")):
|
||||
result.append(entry.name)
|
||||
return result
|
||||
|
||||
def main():
|
||||
# Find Uranium via the PYTHONPATH var
|
||||
uraniumUMPath = where("UM", os.getenv("PYTHONPATH"))
|
||||
if uraniumUMPath is None:
|
||||
uraniumUMPath = os.path.join("..", "Uranium")
|
||||
uraniumPath = os.path.dirname(uraniumUMPath)
|
||||
|
||||
mypyPathParts = [".", os.path.join(".", "plugins"), os.path.join(".", "plugins", "VersionUpgrade"),
|
||||
uraniumPath, os.path.join(uraniumPath, "stubs")]
|
||||
if sys.platform == "win32":
|
||||
os.putenv("MYPYPATH", ";".join(mypyPathParts))
|
||||
else:
|
||||
os.putenv("MYPYPATH", ":".join(mypyPathParts))
|
||||
|
||||
# Mypy really needs to be run via its Python script otherwise it can't find its data files.
|
||||
mypyExe = where("mypy.bat" if sys.platform == "win32" else "mypy")
|
||||
mypyModule = os.path.join(os.path.dirname(mypyExe), "mypy")
|
||||
|
||||
plugins = findModules("plugins")
|
||||
plugins.sort()
|
||||
|
||||
mods = ["cura"] + plugins + findModules("plugins/VersionUpgrade")
|
||||
|
||||
for mod in mods:
|
||||
print("------------- Checking module {mod}".format(**locals()))
|
||||
result = subprocess.run([sys.executable, mypyModule, "-p", mod])
|
||||
if result.returncode != 0:
|
||||
print("""
|
||||
Module {mod} failed checking. :(
|
||||
""".format(**locals()))
|
||||
break
|
||||
else:
|
||||
print("""
|
||||
|
||||
Done checking. All is good.
|
||||
""")
|
||||
return 0
|
||||
sys.exit(main())
|
Loading…
Add table
Add a link
Reference in a new issue