diff --git a/.versioneer-lookup b/.versioneer-lookup index 0c8f361a3..352649440 100644 --- a/.versioneer-lookup +++ b/.versioneer-lookup @@ -10,10 +10,10 @@ # master shall not use the lookup table, only tags master -# maintenance is currently the branch for preparation of maintenance release 1.2.4 +# maintenance is currently the branch for preparation of maintenance release 1.2.5 # so are any fix/... branches -maintenance 1.2.4 3761995aff94acf32495556730f133a1626245b3 -fix/.* 1.2.4 3761995aff94acf32495556730f133a1626245b3 +maintenance 1.2.5 9a6099ffc2982455d631c9d68a3273d9eb55885c +fix/.* 1.2.5 9a6099ffc2982455d631c9d68a3273d9eb55885c # every other branch is a development branch and thus gets resolved to 1.3.0-dev for now .* 1.3.0 198d3450d94be1a2 pep440-dev diff --git a/AUTHORS.md b/AUTHORS.md index 26198382f..0309fdf53 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -51,6 +51,8 @@ date of first contribution): * [Mark Walker](https://github.com/markwal) * [Lucas Clemente](https://github.com/lucas-clemente) * [Andrew Erickson](https://github.com/aerickson) + * [Nicanor Romero Venier](https://github.com/nicanor-romero) + * [Thomas Hou](https://github.com/masterhou) OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by [Daid Braam](https://github.com/daid). Parts of its communication layer and diff --git a/CHANGELOG.md b/CHANGELOG.md index 5563d0c47..eabc7b996 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,11 +11,69 @@ Manager install and uninstall dialog. * Allow hiding plugins from Plugin Manager via ``config.yaml``. * Cura Plugin: "Test" button to check if path to cura engine is valid. +* Cura Plugin: Now also supports 15.06 version of CuraEngine. +* New central configuration option for commands to restart OctoPrint and to + restart and shut down the system OctoPrint is running on. This allows plugins + (like the Software Update Plugin or the Plugin Manager) and core functionality + to perform these common administrative tasks without the user needing to define + everything redundantly. +* `pip` helper now adjusts `pip install` parameters corresponding to detected + `pip` version: + * Removes `--process-dependency-links` when it's not needed + * Adds `--no-use-wheel` when it's needed + * Detects and reports on completely broken versions +* Better tracking of printer connection state for plugins and scripts: + * Introduced three new Events `Connecting`, `Disconnecting` and + `PrinterStateChanged`. + * Introduced new GCODE script `beforePrinterDisconnected` which will get sent + before a (controlled) disconnect from the printer. This can be used to send + some final commands to the printer before the connection goes down, e.g. + `M117 Bye from OctoPrint`. + * The communication layer will now wait for the send queue to be fully processed + before disconnecting from the printer for good. This way it is ensured that + the `beforePrinterDisconnected` script or any further GCODE injected into it + will actually get sent. +* Additional baud rates to allow for connecting can now be specified along side + additional serial ports via the settings dialog and the configuration file. +* Documentation improvements ### Bug Fixes * It's not possible anymore to select files that are not machinecode files (e.g. GCODE) for printing on the file API. +* Changes to a user's personal settings via the UI now propagate across sessions. + +## 1.2.4 (2015-07-23) + +### Improvements + + * `RepeatedTimer` now defaults to `daemon` set to `True`. This makes sure + plugins using it don't have to remember to set that flag themselves in + order for the server to properly shut down when timers are still active. + * Fixed a typo in the docs about `logging.yaml` (top level element is + `loggers`, not `logger`). + * Support for plugins with external dependencies (`dependency_links` in + setuptools), interesting for plugin authors who need to depend on Python + libraries that are (not yet) available on PyPI. + * Better resilience against errors within plugins. + +### Bug Fixes + + * Do not cache web page when running for the first time, to avoid caching + the first run dialog popup along side with it. This should solve issues + people were having when configuring OctoPrint for the first time, then + reloading the page without clearing the cache, being again prompted with + the dialog with no chance to clear it. + * Fix/workaround for occasional white panes in settings dialog on Safari 8, + which appears to have an issue with fixed positioning. + * Fixed form field truncation in upload requests that could lead to problems + when trying to import Cura profiles with names longer than 28 characters. + * Fixed webcam rotation for timelapse rendering. + * Fixed user settings not reaching the editor in the frontend. + * Notifications that are in process of being closed don't open again on + mouse over (that was actually more of an unwanted feature). + +([Commits](https://github.com/foosel/OctoPrint/compare/1.2.3...1.2.4)) ## 1.2.3 (2015-07-09) @@ -225,7 +283,7 @@ changed under "Temperatures" in the Settings ([#343](https://github.com/foosel/OctoPrint/issues/343)). * High-DPI support for the GCode viewer ([#837](https://github.com/foosel/OctoPrint/issues/837)). * Stop websocket connections from multiplying ([#888](https://github.com/foosel/OctoPrint/pull/888)). -* New setting to rotate webcam by 90° counter clockwise ([#895](https://github.com/foosel/OctoPrint/issues/895) and +* New setting to rotate webcam by 90° counter clockwise ([#895](https://github.com/foosel/OctoPrint/issues/895) and [#906](https://github.com/foosel/OctoPrint/pull/906)) * System commands now be set to a) run asynchronized by setting their `async` property to `true` and b) to ignore their result by setting their `ignore` property to `true`. diff --git a/README.md b/README.md index ac80de2e2..190f1e759 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,35 @@ OctoPrint ========= -[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=foosel&url=https://github.com/foosel/OctoPrint&title=OctoPrint&language=&tags=github&category=software) - -OctoPrint provides a responsive web interface for controlling a 3D printer (RepRap, Ultimaker, ...). It is Free Software +OctoPrint provides a snappy web interface for controlling a 3D printer (RepRap, Ultimaker, ...). It is Free Software and released under the [GNU Affero General Public License V3](http://www.gnu.org/licenses/agpl.html). Its website can be found at [octoprint.org](http://octoprint.org). +The documentation is located at [docs.octoprint.org](http://docs.octoprint.org). + +You are currently looking at the source code repository of OctoPrint. If you already installed it +(e.g. by using the Raspberry Pi targeted distribution [OctoPi](https://github.com/guysoft/OctoPi)) and only +want to find out how to use it, [the documentation](http://docs.octoprint.org/) and [the public wiki](https://github.com/foosel/OctoPrint/wiki) +might be of more interest for you. You might also want to subscribe to [the mailing list](https://groups.google.com/group/octoprint) +or the [G+ Community](https://plus.google.com/communities/102771308349328485741) where there are other active users who might be +able to help you with any questions you might have. + Contributing ------------ -Please see the project's [Contribution Guidelines](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md). +Contributions of all kinds are welcome, not only in the form of code but also with regards to the +[official documentation](http://docs.octoprint.org/) or [the public wiki](https://github.com/foosel/OctoPrint/wiki), support +of other users in the [bug tracker](https://github.com/foosel/OctoPrint/issues), +[the Mailinglist](https://groups.google.com/group/octoprint) or +[the G+ Community](https://plus.google.com/communities/102771308349328485741). + +If you think something is bad as it is about OctoPrint or its documentation the way it is, please help +in any way to make it better instead of just complaining about it -- this is an Open Source Project +after all :) + +For information about how to go about contributions of any kind, please see the project's +[Contribution Guidelines](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md). Installation ------------ @@ -21,6 +39,11 @@ Installation instructions for installing from source for different operating sys If you want to run OctoPrint on a Raspberry Pi you might want to take a look at [OctoPi](https://github.com/guysoft/OctoPi) which is a custom SD card image that includes OctoPrint plus dependencies. +After installation, please make sure you follow the first-run wizard and set up +access control as necessary. If you want to not only be notified about new +releases but also be able to automatically upgrade to them from within +OctoPrint, take a look [at the documentation of the Software Update Plugin](https://github.com/foosel/OctoPrint/wiki/Plugin:-Software-Update#making-octoprint-updateable-on-existing-installations). + Dependencies ------------ @@ -36,7 +59,11 @@ OctoPrint currently only supports Python 2.7. Usage ----- -Running the `setup.py` script installs the `octoprint` script in your Python installation's scripts folder +Running the `setup.py` script via + + python setup.py install + +installs the `octoprint` script in your Python installation's scripts folder (which depending on whether you installed OctoPrint globally or into a virtual env will be on your `PATH` or not). The following usage examples assume that said `octoprint` script is on your `PATH`. @@ -77,5 +104,12 @@ which is located at `~/.octoprint` on Linux, at `%APPDATA%/OctoPrint` on Windows at `~/Library/Application Support/OctoPrint` on MacOS. A comprehensive overview of all available configuration settings can be found -[on the wiki](https://github.com/foosel/OctoPrint/wiki/Configuration). Please note that the most commonly used -configuration settings can also easily be edited from OctoPrint's settings dialog. +[in the docs](http://docs.octoprint.org/en/master/configuration/config_yaml.html). +Please note that the most commonly used configuration settings can also easily +be edited from OctoPrint's settings dialog. + +Special Thanks +-------------- + +The development of OctoPrint is sponsored and maintained by [BQ](http://www.bq.com/). +Cross-browser testing services are kindly provided by [BrowserStack](http://www.browserstack.com/). diff --git a/docs/configuration/config_yaml.rst b/docs/configuration/config_yaml.rst index 15cfbbbf4..27a20352f 100644 --- a/docs/configuration/config_yaml.rst +++ b/docs/configuration/config_yaml.rst @@ -611,6 +611,32 @@ Use the following settings to configure the serial connection to the printer: additionalPorts: - /dev/myPrinterSymlink + # Use this to define additional baud rates to offer for connecting to serial ports. Must be a + # valid integer. Defaults to not set + additionalBaudrates: + - 123456 + + # Commands which are known to take a long time to be acknowledged by the firmware. E.g. + # homing, dwelling, auto leveling etc. Defaults to the below commands. + longRunningCommands: + - G4 + - G28 + - G29 + - G30 + - G32 + - M400 + - M226 + + # Commands which need to always be send with a checksum. Defaults to only M110 + checksumRequiringCommands: + - M110 + + # Command to send in order to initiate a handshake with the printer. + # Defaults to "M110 N0" which simply resets the line numbers in the firmware and which + # should be acknowledged with a simple "ok". + helloCommand: + - M110 N0 + .. _sec-configuration-config_yaml-server: Server @@ -621,7 +647,8 @@ Use the following settings to configure the server: .. code-block:: yaml server: - # Use this option to define the host to which to bind the server, defaults to "0.0.0.0" (= all interfaces) + # Use this option to define the host to which to bind the server, defaults to "0.0.0.0" (= all + # interfaces) host: 0.0.0.0 # Use this option to define the port to which to bind the server, defaults to 5000 @@ -691,6 +718,18 @@ Use the following settings to configure the server: # Maximum size of requests other than file uploads in bytes, defaults to 100KB. maxSize: 102400 + # Commands to restart/shutdown octoprint or the system it's running on + commands: + + # Command to restart OctoPrint, defaults to being unset + serverRestartCommand: sudo service octoprint restart + + # Command to restart the system OctoPrint is running on, defaults to being unset + systemRestartCommand: sudo shutdown -r now + + # Command to shut down the system OctoPrint is running on, defaults to being unset + systemShutdownCommand: sudo shutdown -h now + .. note:: diff --git a/docs/configuration/logging_yaml.rst b/docs/configuration/logging_yaml.rst index daf8b462d..549611884 100644 --- a/docs/configuration/logging_yaml.rst +++ b/docs/configuration/logging_yaml.rst @@ -17,7 +17,7 @@ Changing log levels If you need to change the default logging level within OctoPrint, create the file with a text editor of your choice (it's usually not there). The general format is this:: - logger: + loggers: : level: @@ -27,7 +27,7 @@ new log level to set. An example for increasing the log level of the events and .. code-block:: yaml - logger: + loggers: octoprint.events: level: DEBUG octoprint.filemanager: @@ -97,4 +97,4 @@ expressed in YAML as follows: format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s" The possible keys for the logging format can be found in the -`Python documentation on LogRecord attributes `_. \ No newline at end of file +`Python documentation on LogRecord attributes `_. diff --git a/docs/events/index.rst b/docs/events/index.rst index 1dfde9007..70aa5d2f9 100644 --- a/docs/events/index.rst +++ b/docs/events/index.rst @@ -106,6 +106,9 @@ ClientClosed Printer communication --------------------- +Connecting + The server is attempting to connect to the printer. + Connected The server has connected to the printer. @@ -114,6 +117,11 @@ Connected * ``port``: the connected serial port * ``baudrate``: the baud rate +Disconnecting + The server is going to disconnect from the printer. Note that this + event might not always be sent when the server and printer get disconnected + from each other. Do not depend on this for critical life cycle management. + Disconnected The server has disconnected from the printer @@ -124,6 +132,15 @@ Error * ``error``: the error string +PrinterStateChanged + The state of the printer changed. + + Payload: + + * ``state_id``: Id of the new state. See + :func:`~octoprint.printer.PrinterInterface.get_state_id` for possible values. + * ``state_string``: Text representation of the new state. + File handling ------------- diff --git a/docs/features/gcode_scripts.rst b/docs/features/gcode_scripts.rst index 011e15c36..22ad482b7 100644 --- a/docs/features/gcode_scripts.rst +++ b/docs/features/gcode_scripts.rst @@ -26,6 +26,10 @@ Predefined Scripts The following GCODE scripts are sent by OctoPrint automatically: * ``afterPrinterConnected``: Sent after OctoPrint successfully connected to a printer. Defaults to an empty script. + * ``beforePrinterDisconnected``: Sent just before OctoPrint (actively) closes the connection to the printer. Defaults + to an empty script. Note that this will *not* be sent for unexpected connection cut offs, e.g. in case of errors + on the serial line, only when the user clicks the "Disconnect" button or the printer requests a disconnect via an + :ref:`action command ` . * ``beforePrintStarted``: Sent just before a print job is started. Defaults to an empty script. * ``afterPrintCancelled``: Sent just after a print job was cancelled. Defaults to the :ref:`bundled script listed below `. diff --git a/scripts/octoprint.init b/scripts/octoprint.init index b0916fae9..be66b6a89 100644 --- a/scripts/octoprint.init +++ b/scripts/octoprint.init @@ -116,6 +116,9 @@ case "$1" in 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; + status) + status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? + ;; restart) log_daemon_msg "Restarting $DESC" "$NAME" do_stop @@ -135,8 +138,7 @@ case "$1" in esac ;; *) - echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2 exit 3 ;; esac - diff --git a/src/octoprint/events.py b/src/octoprint/events.py index 828862336..33fc04cbc 100644 --- a/src/octoprint/events.py +++ b/src/octoprint/events.py @@ -28,9 +28,14 @@ class Events(object): STARTUP = "Startup" # connect/disconnect to printer + CONNECTING = "Connecting" CONNECTED = "Connected" + DISCONNECTING = "Disconnecting" DISCONNECTED = "Disconnected" + # State changes + PRINTER_STATE_CHANGED = "PrinterStateChanged" + # connect/disconnect by client CLIENT_OPENED = "ClientOpened" CLIENT_CLOSED = "ClientClosed" @@ -74,6 +79,9 @@ class Events(object): # Timelapse CAPTURE_START = "CaptureStart" CAPTURE_DONE = "CaptureDone" + CAPTURE_FAILED = "CaptureFailed" + POSTROLL_START = "PostRollStart" + POSTROLL_END = "PostRollEnd" MOVIE_RENDERING = "MovieRendering" MOVIE_DONE = "MovieDone" MOVIE_FAILED = "MovieFailed" diff --git a/src/octoprint/plugins/cura/__init__.py b/src/octoprint/plugins/cura/__init__.py index 9e9b1501e..600e91ff2 100644 --- a/src/octoprint/plugins/cura/__init__.py +++ b/src/octoprint/plugins/cura/__init__.py @@ -19,6 +19,8 @@ import octoprint.settings from octoprint.util.paths import normalize as normalize_path from .profile import Profile +from .profile import GcodeFlavors +from .profile import parse_gcode_flavor class CuraPlugin(octoprint.plugin.SlicerPlugin, octoprint.plugin.SettingsPlugin, @@ -260,15 +262,29 @@ class CuraPlugin(octoprint.plugin.SlicerPlugin, self._cura_logger.info(u"### Slicing %s to %s using profile stored at %s" % (model_path, machinecode_path, profile_path)) - engine_settings = self._convert_to_engine(profile_path, printer_profile, posX, posY) - executable = normalize_path(self._settings.get(["cura_engine"])) if not executable: return False, "Path to CuraEngine is not configured " - working_dir, _ = os.path.split(executable) + working_dir = os.path.dirname(executable) + + # Start building the argument list for the CuraEngine command execution args = [executable, '-v', '-p'] - for k, v in engine_settings.items(): + + # Get the CuraEngine version out of the "usage" line that is gotten when calling the CuraEngine with the -h argument + new_engine = self._is_new_engine_version(executable) + + # If the CuraEngine is the new version, add the JSON file path as argument + if new_engine: + args += ['-j', os.path.join(self._basefolder, "profiles", "fdmprinter.json")] + + profile = Profile(self._load_profile(profile_path), printer_profile, posX, posY) + + engine_settings = self._convert_to_engine(profile, new_engine=new_engine) + + # Add the settings (sorted alphabetically) to the command + + for k, v in sorted(engine_settings.items(), key=lambda s: s[0]): args += ["-s", "%s=%s" % (k, str(v))] args += ["-o", machinecode_path, model_path] @@ -351,6 +367,8 @@ class CuraPlugin(octoprint.plugin.SlicerPlugin, except: pass + # Get the filament usage + elif line.startswith(u"Filament:") or line.startswith(u"Filament2:"): if line.startswith(u"Filament:"): filament_str = line[len(u"Filament:"):].strip() @@ -361,17 +379,25 @@ class CuraPlugin(octoprint.plugin.SlicerPlugin, try: filament = int(filament_str) + if analysis is None: analysis = dict() if not "filament" in analysis: analysis["filament"] = dict() if not tool_key in analysis["filament"]: analysis["filament"][tool_key] = dict() - analysis["filament"][tool_key]["length"] = filament - if "filamentDiameter" in engine_settings: - radius_in_cm = float(int(engine_settings["filamentDiameter"]) / 10000.0) / 2.0 - filament_in_cm = filament / 10.0 - analysis["filament"][tool_key]["volume"] = filament_in_cm * math.pi * radius_in_cm * radius_in_cm + + if profile.get_float("filament_diameter") != None: + # The new CuraEngine outputs the "Filament" value as volume independently from the Gcode flavor + if new_engine: + analysis["filament"][tool_key] = _get_usage_from_volume(filament, profile.get_float("filament_diameter")) + # The old CuraEngine outputs the "Filament" value as volume only for ULTIGCODE and REPRAP_VOLUME + else: + if profile.get("gcode_flavor") == GcodeFlavors.ULTIGCODE or profile.get("gcode_flavor") == GcodeFlavors.REPRAP_VOLUME: + analysis["filament"][tool_key] = _get_usage_from_volume(filament, profile.get_float("filament_diameter")) + else: + analysis["filament"][tool_key] = _get_usage_from_length(filament, profile.get_float("filament_diameter")) + except: pass finally: @@ -421,6 +447,11 @@ class CuraPlugin(octoprint.plugin.SlicerPlugin, profile_dict = yaml.safe_load(f) except: raise IOError("Couldn't read profile from {path}".format(path=path)) + + if "gcode_flavor" in profile_dict and not isinstance(profile_dict["gcode_flavor"], (list, tuple)): + profile_dict["gcode_flavor"] = parse_gcode_flavor(profile_dict["gcode_flavor"]) + self._save_profile(path, profile_dict) + return profile_dict def _save_profile(self, path, profile, allow_overwrite=True): @@ -428,9 +459,28 @@ class CuraPlugin(octoprint.plugin.SlicerPlugin, with open(path, "wb") as f: yaml.safe_dump(profile, f, default_flow_style=False, indent=" ", allow_unicode=True) - def _convert_to_engine(self, profile_path, printer_profile, posX, posY): - profile = Profile(self._load_profile(profile_path), printer_profile, posX, posY) - return profile.convert_to_engine() + def _convert_to_engine(self, profile, new_engine): + if new_engine: + return profile.convert_to_new_engine() + else: + return profile.convert_to_engine() + + def _is_new_engine_version(self, executable): + import sarge + + command = [executable, "-j", os.path.join(self._basefolder, "profiles", "fdmprinter.json")] + p = sarge.run(command, stdout=sarge.Capture(), stderr=sarge.Capture()) + if p.returncode != 0: + self._logger.warn("Could not run {} -j, returned {}".format(executable, p.returncode)) + self._logger.info(u"Assuming pre 15.06 version of CuraEngine.") + return False + + for line in p.stderr.read().split('\n'): + if "unknown option: j" in line.strip().lower(): + self._logger.info(u"Using pre 15.06 version of CuraEngine.") + return False + self._logger.info(u"Using post 15.06 version of CuraEngine.") + return True def _sanitize_name(name): if name is None: @@ -445,9 +495,39 @@ def _sanitize_name(name): sanitized_name = sanitized_name.replace(" ", "_") return sanitized_name.lower() +def _get_usage_from_volume(filament_volume, filament_diameter): + + # filament_volume is expressed in mm^3 + # usage["volume"] is in cm^3 and usage["length"] is in mm + + usage = dict() + usage["volume"] = filament_volume / 1000.0 + + radius_in_mm = filament_diameter / 2.0 + usage["length"] = filament_volume / (math.pi * radius_in_mm * radius_in_mm) + + return usage + +def _get_usage_from_length(filament_length, filament_diameter): + + # filament_length is expressed in mm + # usage["volume"] is in cm^3 and usage["length"] is in mm + + usage = dict() + usage["length"] = filament_length + + radius_in_cm = (filament_diameter / 10.0) / 2.0 + length_in_cm = filament_length / 10.0 + usage["volume"] = length_in_cm * math.pi * radius_in_cm * radius_in_cm + + return usage + __plugin_name__ = "CuraEngine" __plugin_author__ = "Gina Häußge" __plugin_url__ = "https://github.com/foosel/OctoPrint/wiki/Plugin:-Cura" __plugin_description__ = "Adds support for slicing via CuraEngine from within OctoPrint" __plugin_license__ = "AGPLv3" __plugin_implementation__ = CuraPlugin() + + + diff --git a/src/octoprint/plugins/cura/profile.py b/src/octoprint/plugins/cura/profile.py index 59a0ee152..6ab7b6b38 100644 --- a/src/octoprint/plugins/cura/profile.py +++ b/src/octoprint/plugins/cura/profile.py @@ -32,12 +32,12 @@ class MachineShapeTypes(object): CIRCULAR = "circular" class GcodeFlavors(object): - REPRAP = "reprap" - REPRAP_VOLUME = "reprap_volume" - ULTIGCODE = "ultigcode" - MAKERBOT = "makerbot" - BFB = "bfb" - MACH3 = "mach3" + REPRAP = (0, "reprap") + ULTIGCODE = (1, "ultigcode") + MAKERBOT = (2, "makerbot") + BFB = (3, "bfb") + MACH3 = (4, "mach3") + REPRAP_VOLUME = (5, "reprap_volume") defaults = dict( @@ -393,15 +393,45 @@ class Profile(object): } ) + # Translation dict for new CuraEngine option names + new_engine_options = dict( + fill_sparse_density="fill_density", + machine_nozzle_size="nozzle_size", + material_print_temperature="print_temperature", + #support_type="support", # In conflict with "support_type" from old CuraEngine + support_pattern="support_type", + adhesion_type="platform_adhesion", + material_diameter="filament_diameter", + material_flow="filament_flow", + speed_travel="travel_speed", + speed_layer_0="bottom_layer_speed", + speed_print="print_speed", + speed_infill="infill_speed", + speed_wall_0="outer_shell_speed", + speed_wall_x="inner_shell_speed", + cool_fan_enabled="fan_enabled", + cool_fan_full_at_height="fan_full_height", + cool_fan_speed="fan_speed", + cool_fan_speed_max="fan_speed_max", + cool_lift_head="cool_head_lift", + cool_min_speed="cool_min_feedrate", + machine_start_gcode="start_gcode", + machine_end_gcode="end_gcode", + machine_gcode_flavor="gcode_flavor") + result = dict() for section in config.sections(): - if not section in ("profile", "alterations"): + + if not section in ("profile", "alterations", "machine"): continue for option in config.options(section): ignored = False key = option + if section == "machine" and key != "gcode_flavor": + continue + # try to fetch the value in the correct type try: value = config.getboolean(section, option) @@ -438,9 +468,16 @@ class Profile(object): # if the key has to be translated to a new value, do that now key = translated_options[key] + if key in new_engine_options: + # if the key has to be translated from the new CuraEngine versions, do that now + key = new_engine_options[key] + if key in value_conversions and value in value_conversions[key]: value = value_conversions[key][value] + if key == "gcode_flavor": + value = parse_gcode_flavor(value) + if index is not None: # if we have an array to fill, make sure the target array exists and has the right size if not key in result: @@ -710,61 +747,70 @@ class Profile(object): return pre + str(f) - def get_gcode(self, key): - extruder_count = self.get_int("extruder_amount") - + def get_gcode(self, key, new_engine=False): prefix = "" postfix = "" if self.get("gcode_flavor") == GcodeFlavors.ULTIGCODE: if key == "end_gcode": - return "M25 ;Stop reading from this point on.\n;CURA_PROFILE_STRING:%s\n" % (self.get_profile_string()) + return "M25 ;Stop reading from this point on.\n;CURA_OCTO_PROFILE_STRING:%s\n" % (self.get_profile_string()) return "" if key == "start_gcode": contents = self.get_gcode_template("start_gcode") - e_steps = self.get_float("steps_per_e") - if e_steps > 0: - prefix += "M92 E{e_steps}\n" % (e_steps) - temp = self.get_float("print_temperature") - - bed_temp = 0 - if self.get_boolean("has_heated_bed"): - bed_temp = self.get_float("print_bed_temperature") - include_bed_temp = bed_temp > 0 and not "{print_bed_temperature}" in Profile.regex_strip_comments.sub("", contents) - - if include_bed_temp: - prefix += "M140 S{bed_temp}\n".format(bed_temp=bed_temp) - - if temp > 0 and not "{print_temperature}" in Profile.regex_strip_comments.sub("", contents): - if extruder_count > 0: - def temp_line(temp, extruder, template): - t = temp - if extruder > 0: - print_temp = self.get_float("print_temperature%d" % (extruder + 1)) - if print_temp > 0: - t = print_temp - return template.format(extruder=extruder, temp=t) - - prefix_preheat = "" - prefix_waitheat = "" - for n in xrange(0, extruder_count): - if n > 0: - prefix_preheat += temp_line(temp, n, "M104 T{extruder} S{temp}\n") - prefix_waitheat += temp_line(temp, n, "M109 T{extruder} S{temp}\n") - prefix += prefix_preheat + prefix_waitheat + "T0\n" - else: - prefix += "M109 S{temp}\n".format(temp=temp) - - if include_bed_temp: - prefix += "M190 S{bed_temp}\n".format(bed_temp=bed_temp) + # If using the new CuraEngine, there is no need to extend the start_gcode + if not new_engine: + prefix += self.get_start_gcode_prefix(contents) else: contents = self.get_gcode_template(key) return unicode(prefix + re.sub("(.)\{([^\}]*)\}", self.replaceTagMatch, contents).rstrip() + '\n' + postfix).strip().encode('utf-8') + '\n' + def get_start_gcode_prefix(self, contents): + extruder_count = self.get_int("extruder_amount") + + prefix = "" + + e_steps = self.get_float("steps_per_e") + if e_steps > 0: + prefix += "M92 E{e_steps}\n" % (e_steps) + temp = self.get_float("print_temperature") + + bed_temp = 0 + if self.get_boolean("has_heated_bed"): + bed_temp = self.get_float("print_bed_temperature") + include_bed_temp = bed_temp > 0 and not "{print_bed_temperature}" in Profile.regex_strip_comments.sub("", contents) + + if include_bed_temp: + prefix += "M140 S{bed_temp}\n".format(bed_temp=bed_temp) + + if temp > 0 and not "{print_temperature}" in Profile.regex_strip_comments.sub("", contents): + if extruder_count > 0: + def temp_line(temp, extruder, template): + t = temp + if extruder > 0: + print_temp = self.get_float("print_temperature%d" % (extruder + 1)) + if print_temp > 0: + t = print_temp + return template.format(extruder=extruder, temp=t) + + prefix_preheat = "" + prefix_waitheat = "" + for n in xrange(0, extruder_count): + if n > 0: + prefix_preheat += temp_line(temp, n, "M104 T{extruder} S{temp}\n") + prefix_waitheat += temp_line(temp, n, "M109 T{extruder} S{temp}\n") + prefix += prefix_preheat + prefix_waitheat + "T0\n" + else: + prefix += "M109 S{temp}\n".format(temp=temp) + + if include_bed_temp: + prefix += "M190 S{bed_temp}\n".format(bed_temp=bed_temp) + + return prefix + def calculate_edge_width_and_line_count(self): wall_thickness = self.get_float("wall_thickness") nozzle_size = self._printer_profile["extruder"]["nozzleDiameter"] @@ -810,20 +856,20 @@ class Profile(object): def get_pos_x(self): if self._posX: try: - return int(float(self._posX) * 1000) + return int(float(self._posX)) except ValueError: pass - return int(self.get_float("machine_width") / 2.0 * 1000) if not self.get_boolean("machine_center_is_zero") else 0.0 + return int(self.get_float("machine_width") / 2.0 ) if not self.get_boolean("machine_center_is_zero") else 0.0 def get_pos_y(self): if self._posY: try: - return int(float(self._posY) * 1000) + return int(float(self._posY)) except ValueError: pass - return int(self.get_float("machine_depth") / 2.0 * 1000) if not self.get_boolean("machine_center_is_zero") else 0.0 + return int(self.get_float("machine_depth") / 2.0) if not self.get_boolean("machine_center_is_zero") else 0.0 def convert_to_engine(self): @@ -873,8 +919,8 @@ class Profile(object): "coolHeadLift": 1 if self.get_boolean("cool_head_lift") else 0, # model positioning - "posx": self.get_pos_x(), - "posy": self.get_pos_y(), + "posx": self.get_pos_x() * 1000, # in microns + "posy": self.get_pos_y() * 1000, # in microns # gcodes "startCode": self.get_gcode("start_gcode"), @@ -953,16 +999,7 @@ class Profile(object): settings["layerThickness"] = 1000 # gcode flavor - if self.get("gcode_flavor") == GcodeFlavors.ULTIGCODE: - settings["gcodeFlavor"] = 1 - elif self.get("gcode_flavor") == GcodeFlavors.MAKERBOT: - settings["gcodeFlavor"] = 2 - elif self.get("gcode_flavor") == GcodeFlavors.BFB: - settings["gcodeFlavor"] = 3 - elif self.get("gcode_flavor") == GcodeFlavors.MACH3: - settings["gcodeFlavor"] = 4 - elif self.get("gcode_flavor") == GcodeFlavors.REPRAP_VOLUME: - settings["gcodeFlavor"] = 5 + settings["gcodeFlavor"] = self.get("gcode_flavor")[0] # extras if self.get_boolean("spiralize"): @@ -978,3 +1015,132 @@ class Profile(object): settings["enableOozeShield"] = 1 return settings + + def convert_to_new_engine(self): + + settings = { + "layer_height": self.get_float("layer_height"), + "wall_thickness": self.get_float("wall_thickness"), + "retraction_enable": self.get_boolean("retraction_enable"), + "top_bottom_thickness": self.get_float("solid_layer_thickness"), + "fill_sparse_density": self.get_float("fill_density"), + "machine_nozzle_size": self.get_float("nozzle_size"), + "speed_print": self.get_float("print_speed"), + "material_print_temperature": self.get_float("print_temperature"), + "material_diameter": self.get_float("filament_diameter"), + "material_flow": self.get_float("filament_flow"), + "retraction_speed": self.get_float("retraction_speed"), + "retraction_amount": self.get_float("retraction_amount") if self.get_boolean("retraction_enable") else 0, + "retraction_min_travel": self.get_float("retraction_min_travel"), + "retraction_combing": self.get_boolean("retraction_combing"), + "retraction_hop": self.get_float("retraction_hop"), + "bottom_thickness": self.get_float("bottom_thickness"), + "top_layers": self.calculate_solid_layer_count(), + "bottom_layers": self.calculate_solid_layer_count(), + "speed_travel": self.get_float("travel_speed"), + "speed_layer_0": self.get_float("bottom_layer_speed"), + "speed_infill": self.get_float("infill_speed") if self.get_float("infill_speed") > 0 else self.get_float("print_speed"), + "speed_wall_0": self.get_float("outer_shell_speed") if self.get_float("outer_shell_speed") > 0 else self.get_float("print_speed"), # Translated from "inset0_speed" + "speed_wall_x": self.get_float("inner_shell_speed") if self.get_float("inner_shell_speed") > 0 else self.get_float("print_speed"), # Translated from "insetx_speed" + "cool_min_layer_time": self.get_float("cool_min_layer_time"), + "cool_fan_enabled": self.get_boolean("fan_enabled"), + "cool_fan_full_at_height": self.get_int("fan_full_height"), + "cool_fan_speed": self.get_float("fan_speed"), + "cool_fan_speed_max": self.get_float("fan_speed_max") if self.get_boolean("fan_enabled") else 0, + "cool_lift_head": self.get_boolean("cool_head_lift"), + "cool_min_speed": self.get_float("cool_min_feedrate"), + "skirt_line_count": self.get_int("skirt_line_count"), + "fill_overlap": self.get_float("fill_overlap"), + "magic_spiralize": self.get_boolean("spiralize"), + + # machine settings + + "machine_width": self.get_float("machine_width"), + "machine_depth": self.get_float("machine_depth"), + "machine_center_is_zero": self.get_boolean("machine_center_is_zero"), + "machine_heated_bed": self.get_boolean("has_heated_bed"), + + # gcodes + + "machine_start_gcode": self.get_gcode("start_gcode", new_engine=True), + "machine_end_gcode": self.get_gcode("end_gcode", new_engine=True), + } + + # gcode flavor + + settings["machine_gcode_flavor"] = self.get("gcode_flavor")[0] + + # heated bed - The new CuraEngine uses the integer "material_bed_temperature" instead of the boolean "machine_heated_bed" + + if self.get_boolean("has_heated_bed"): + settings["material_bed_temperature"] = self.get_float("print_bed_temperature") + else: + settings["material_bed_temperature"] = 0 + + # support + + if self.get("support") == SupportLocationTypes.NONE: + settings["support_enable"] = False + else: + settings["support_enable"] = True + settings["support_angle"] = self.get_float("support_angle") + settings["support_fill_rate"] = self.get_float("support_fill_rate") + settings["support_xy_distance"] = self.get_float("support_xy_distance") + settings["support_z_distance"] = self.get_float("support_z_distance") + + # support type + + if self.get("support") == SupportLocationTypes.TOUCHING_BUILDPLATE: + settings["support_type"] = "Touching Buildplate" + elif self.get("support") == SupportLocationTypes.EVERYWHERE: + settings["support_type"] = "Everywhere" + + # support pattern + + if self.get("support_type") == SupportTypes.GRID: + settings["support_pattern"] = "Grid" + elif self.get("support_type") == SupportTypes.LINES: + settings["support_pattern"] = "Lines" + + # adhesion type + + if self.get("platform_adhesion") == PlatformAdhesionTypes.NONE: + settings["adhesion_type"] = "None" + elif self.get("platform_adhesion") == PlatformAdhesionTypes.BRIM: + settings["adhesion_type"] = "Brim" + settings["brim_line_count"] = self.get_int("brim_line_count") + elif self.get("platform_adhesion") == PlatformAdhesionTypes.RAFT: + settings["adhesion_type"] = "Raft" + settings["raft_margin"] = self.get_int("raft_margin") + settings["raft_line_spacing"] = self.get_float("raft_line_spacing") + settings["raft_base_thickness"] = self.get_float("raft_base_thickness") + settings["raft_base_linewidth"] = self.get_float("raft_base_linewidth") + settings["raft_interface_thickness"] = self.get_float("raft_interface_thickness") + settings["raft_interface_linewidth"] = self.get_float("raft_interface_linewidth") + settings["raft_airgap"] = self.get_float("raft_airgap") + settings["raft_surface_layers"] = self.get_int("raft_surface_layers") + + # skirt + + if self.get_int("skirt_line_count") != 0: + settings["skirt_gap"] = self.get_float("skirt_gap") + settings["skirt_minimal_length"] = self.get_float("skirt_minimal_length") + + return settings + +def parse_gcode_flavor(value): + + value = value.lower() + + if "reprap" in value and ("volume" in value or "volumatric" in value): + return GcodeFlavors.REPRAP_VOLUME + elif "ultigcode" in value: + return GcodeFlavors.ULTIGCODE + elif "makerbot" in value: + return GcodeFlavors.MAKERBOT + elif "bfb" in value: + return GcodeFlavors.BFB + elif "mach3" in value: + return GcodeFlavors.MACH3 + else: + return GcodeFlavors.REPRAP diff --git a/src/octoprint/plugins/cura/profiles/fdmprinter.json b/src/octoprint/plugins/cura/profiles/fdmprinter.json new file mode 100644 index 000000000..366149b9c --- /dev/null +++ b/src/octoprint/plugins/cura/profiles/fdmprinter.json @@ -0,0 +1,1325 @@ +{ + "visible": false, + "machine_settings": { + "machine_start_gcode": { + "default": "G28 ; Home\nG1 Z15.0 F6000 ;move the platform down 15mm\n;Prime the extruder\nG92 E0\nG1 F200 E3\nG92 E0" + }, + "machine_end_gcode": { + "default": "M104 S0\nM140 S0\n;Retract the filament\nG92 E1\nG1 E-1 F300\nG28 X0 Y0\nM84" + }, + "machine_width": { "default": 230 }, + "machine_depth": { "default": 225 }, + "machine_height": { "default": 205 }, + "machine_heated_bed": { "default": true }, + + "machine_center_is_zero": { "default": false }, + "machine_nozzle_size": { "default": 0.4 }, + "machine_head_shape_min_x": { "default": 40 }, + "machine_head_shape_min_y": { "default": 10 }, + "machine_head_shape_max_x": { "default": 60 }, + "machine_head_shape_max_y": { "default": 30 }, + "machine_nozzle_gantry_distance": { "default": 55 }, + "machine_nozzle_offset_x_1": { "default": 18.0 }, + "machine_nozzle_offset_y_1": { "default": 0.0 }, + "machine_gcode_flavor": { "default": "UltiGCode" }, + "machine_disallowed_areas": { "default": [ + [[-115.0, 112.5], [ -82.0, 112.5], [ -84.0, 104.5], [-115.0, 104.5]], + [[ 115.0, 112.5], [ 115.0, 104.5], [ 110.0, 104.5], [ 108.0, 112.5]], + [[-115.0, -112.5], [-115.0, -104.5], [ -84.0, -104.5], [ -82.0, -112.5]], + [[ 115.0, -112.5], [ 108.0, -112.5], [ 110.0, -104.5], [ 115.0, -104.5]] + ]}, + "machine_platform_offset": { "default": [9.0, 0.0, 0.0] }, + + "machine_nozzle_tip_outer_diameter": { "default": 1.0 }, + "machine_nozzle_head_distance": { "default": 3.0 }, + "machine_nozzle_expansion_angle": { "default": 45 } + }, + "categories": { + "resolution": { + "label": "Quality", + "visible": true, + "icon": "category_quality", + "settings": { + "layer_height": { + "label": "Layer Height", + "description": "The height of each layer, in mm. Normal quality prints are 0.1mm, high quality is 0.06mm. You can go up to 0.25mm with an Ultimaker for very fast prints at low quality. For most purposes, layer heights between 0.1 and 0.2mm give a good tradeoff of speed and surface finish.", + "unit": "mm", + "type": "float", + "default": 0.1, + "min_value": 0.06, + "max_value": 2.0, + "always_visible": true, + "children": { + "layer_height_0": { + "label": "Initial Layer Thickness", + "description": "The layer thickness of the bottom layer. A thicker bottom layer makes sticking to the bed easier.", + "unit": "mm", + "type": "float", + "default": 0.2, + "min_value": 0.06, + "max_value": 2.0, + "visible": false + } + } + }, + "shell_thickness": { + "label": "Shell Thickness", + "description": "The thickness of the outside shell in the horizontal and vertical direction. This is used in combination with the nozzle size to define the number of perimeter lines and the thickness of those perimeter lines. This is also used to define the number of solid top and bottom layers.", + "unit": "mm", + "type": "float", + "default": 0.8, + "min_value": 0.0, + "max_value": 5.0, + "children": { + "wall_thickness": { + "label": "Wall Thickness", + "description": "The thickness of the outside walls in the horizontal direction. This is used in combination with the nozzle size to define the number of perimeter lines and the thickness of those perimeter lines.", + "unit": "mm", + "default": 0.8, + "min_value": 0.0, + "max_value": 5.0, + "min_value_warning": 0.4, + "max_value_warning": 2.0, + "type": "float", + "visible": false, + + "children": { + "wall_line_count": { + "label": "Wall Line Count", + "description": "Number of shell lines. This these lines are called perimeter lines in other tools and impact the strength and structural integrity of your print.", + "default": 2, + "type": "int", + "visible": false, + "inherit_function": "max(1, (int(parent_value / (machine_nozzle_size - 0.0001) + 1) if (parent_value / max(1, int(parent_value / (machine_nozzle_size - 0.0001))) > machine_nozzle_size) * 1.5 else int(parent_value / (machine_nozzle_size - 0.0001))))" + }, + "wall_line_width": { + "label": "Wall Line Width", + "description": "Width of a single shell line. Each line of the shell will be printed with this width in mind.", + "unit": "mm", + "default": 0.4, + "type": "float", + "visible": false, + "inherit_function": "max(machine_nozzle_size, (parent_value / (int(parent_value / (machine_nozzle_size - 0.0001) + 1))) if (parent_value / (int(parent_value / (machine_nozzle_size - 0.0001))) > machine_nozzle_size * 1.5) else (parent_value / int(parent_value / (machine_nozzle_size - 0.0001))))", + + "children": { + "wall_line_width_0": { + "label": "First Wall Line Width", + "description": "Width of the outermost shell line. By printing a thinner outermost wall line you can print higher details with a larger nozzle.", + "unit": "mm", + "default": 0.4, + "type": "float", + "visible": false + }, + "wall_line_width_x": { + "label": "Other Walls Line Width", + "description": "Width of a single shell line for all shell lines except the outermost one.", + "unit": "mm", + "default": 0.4, + "type": "float", + "visible": false + }, + "skirt_line_width": { + "label": "Skirt line width", + "description": "Width of a single skirt line.", + "unit": "mm", + "default": 0.4, + "type": "float", + "visible": false + }, + "skin_line_width": { + "label": "Top/bottom line width", + "description": "Width of a single top/bottom printed line. Which are used to fill up the top/bottom areas of a print.", + "unit": "mm", + "default": 0.4, + "type": "float", + "visible": false + }, + "infill_line_width": { + "label": "Infill line width", + "description": "Width of the inner infill printed lines.", + "unit": "mm", + "default": 0.4, + "type": "float", + "visible": false + }, + "support_line_width": { + "label": "Support line width", + "description": "Width of the printed support structures lines.", + "unit": "mm", + "default": 0.4, + "type": "float", + "visible": false + } + } + } + } + }, + "alternate_extra_perimeter": { + "label": "Alternate Extra Wall", + "description": "Make an extra wall at every second layer, so that infill will be caught between an extra wall above and one below. This results in a better cohesion between infill and walls, but might have an impact on the surface quality.", + "type": "boolean", + "default": false, + "visible": false + }, + "top_bottom_thickness": { + "label": "Bottom/Top Thickness", + "description": "This controls the thickness of the bottom and top layers, the amount of solid layers put down is calculated by the layer thickness and this value. Having this value a multiple of the layer thickness makes sense. And keep it near your wall thickness to make an evenly strong part.", + "unit": "mm", + "default": 0.8, + "min_value": 0.0, + "max_value": 5.0, + "min_value_warning": 0.4, + "max_value_warning": 1.0, + "type": "float", + "visible": false, + + "children": { + "top_thickness": { + "label": "Top Thickness", + "description": "This controls the thickness of the top layers. The number of solid layers printed is calculated from the layer thickness and this value. Having this value be a multiple of the layer thickness makes sense. And keep it nearto your wall thickness to make an evenly strong part.", + "unit": "mm", + "default": 0.8, + "type": "float", + "visible": false, + + "children": { + "top_layers": { + "label": "Top Layers", + "description": "This controls the amount of top layers.", + "default": 8, + "type": "int", + "visible": false, + "inherit_function": "math.ceil(parent_value / layer_height)" + } + } + }, + "bottom_thickness": { + "label": "Bottom Thickness", + "description": "This controls the thickness of the bottom layers. The number of solid layers printed is calculated from the layer thickness and this value. Having this value be a multiple of the layer thickness makes sense. And keep it near to your wall thickness to make an evenly strong part.", + "unit": "mm", + "default": 0.8, + "type": "float", + "visible": false, + + "children": { + "bottom_layers": { + "label": "Bottom Layers", + "description": "This controls the amount of bottom layers.", + "default": 8, + "type": "int", + "visible": false, + "inherit_function": "math.ceil(parent_value / layer_height)" + } + } + } + } + } + } + }, + "wall_overlap_avoid_enabled": { + "label": "Avoid Overlapping Walls", + "description": "Remove parts of a wall which share an overlap which would result in overextrusion in some places. These overlaps occur in thin pieces in a model and sharp corners.", + "type": "boolean", + "default": true, + "visible": false + }, + "fill_perimeter_gaps":{ + "label": "Fill Gaps Between Walls", + "description": "Fill the gaps created by walls where they would otherwise be overlapping. This will also fill thin walls. Optionally only the gaps occurring within the top and bottom skin can be filled.", + "type": "enum", + "options": [ + "Nowhere", + "Everywhere", + "Skin" + ], + "default": "Everywhere", + "visible": false, + "active_if": { + "setting": "wall_overlap_avoid_enabled", + "value": true + } + }, + "top_bottom_pattern": { + "label": "Bottom/Top Pattern", + "description": "Pattern of the top/bottom solid fill. This normally is done with lines to get the best possible finish, but in some cases a concentric fill gives a nicer end result.", + "type": "enum", + "options": [ + "Lines", + "Concentric" + ], + "default": "Lines", + "visible": false + }, + "skin_outline_count": { + "label": "Skin Perimeter Line Count", + "description": "Number of lines around skin regions. Using one or two skin perimeter lines can greatly improve on roofs which would start in the middle of infill cells.", + "default": 0, + "type": "int", + "visible": false, + "active_if": { + "setting": "top_bottom_pattern", + "value": "Lines" + } + }, + "xy_offset": { + "label": "Horizontal expansion", + "description": "Amount of offset applied all polygons in each layer. Positive values can compensate for too big holes; negative values can compensate for too small holes.", + "unit": "mm", + "type": "float", + "default": 0.0, + "visible": false + + } + } + }, + + "material": { + "label": "Material", + "visible": true, + "icon": "category_material", + "settings": { + "material_print_temperature": { + "label": "Printing Temperature", + "description": "The temperature used for printing. Set at 0 to pre-heat yourself. For PLA a value of 210C is usually used.\nFor ABS a value of 230C or higher is required.", + "unit": "°C", + "type": "float", + "default": 220, + "min_value": 10, + "max_value": 340 + }, + "material_bed_temperature": { + "label": "Bed Temperature", + "description": "The temperature used for the heated printer bed. Set at 0 to pre-heat it yourself.", + "unit": "°C", + "type": "float", + "default": 70, + "min_value": 0, + "max_value": 340 + }, + "material_diameter": { + "label": "Diameter", + "description": "The diameter of your filament needs to be measured as accurately as possible.\nIf you cannot measure this value you will have to calibrate it, a higher number means less extrusion, a smaller number generates more extrusion.", + "unit": "mm", + "type": "float", + "default": 2.85, + "min_value": 0.4, + "max_value": 5.0 + }, + "material_flow": { + "label": "Flow", + "description": "Flow compensation: the amount of material extruded is multiplied by this value.", + "unit": "%", + "default": 100.0, + "type": "float", + "min_value": 5.0, + "max_value": 300.0 + }, + "retraction_enable": { + "label": "Enable Retraction", + "description": "Retract the filament when the nozzle is moving over a non-printed area. Details about the retraction can be configured in the advanced tab.", + "type": "boolean", + "default": true, + + "children": { + "retraction_speed": { + "label": "Retraction Speed", + "description": "The speed at which the filament is retracted. A higher retraction speed works better, but a very high retraction speed can lead to filament grinding.", + "unit": "mm/s", + "type": "float", + "default": 25.0, + "visible": false, + "inherit": false, + + "children": { + "retraction_retract_speed": { + "label": "Retraction Retract Speed", + "description": "The speed at which the filament is retracted. A higher retraction speed works better, but a very high retraction speed can lead to filament grinding.", + "unit": "mm/s", + "type": "float", + "default": 25.0, + "visible": false + }, + "retraction_prime_speed": { + "label": "Retraction Prime Speed", + "description": "The speed at which the filament is pushed back after retraction.", + "unit": "mm/s", + "type": "float", + "default": 25.0, + "visible": false + } + } + }, + "retraction_amount": { + "label": "Retraction Distance", + "description": "The amount of retraction: Set at 0 for no retraction at all. A value of 4.5mm seems to generate good results for 3mm filament in Bowden-tube fed printers.", + "unit": "mm", + "type": "float", + "default": 4.5, + "visible": false, + "inherit": false + }, + "retraction_min_travel": { + "label": "Retraction Minimum Travel", + "description": "The minimum distance of travel needed for a retraction to happen at all. This helps ensure you do not get a lot of retractions in a small area.", + "unit": "mm", + "type": "float", + "default": 4.5, + "visible": false, + "inherit": false + }, + "retraction_combing": { + "label": "Enable Combing", + "description": "Combing keeps the head within the interior of the print whenever possible when traveling from one part of the print to another, and does not use retraction. If combing is disabled the printer head moves straight from the start point to the end point and it will always retract.", + "type": "boolean", + "default": true, + "visible": false, + "inherit": false + }, + "retraction_count_max": { + "label": "Maximal Retraction Count", + "description": "This settings limits the number of retractions occuring within the Minimal Extrusion Distance Window. Further retractions within this window will be ignored. This avoids retracting repeatedly on the same piece of filament as that can flatten the filament and cause grinding issues.", + "default": 6, + "type": "int", + "visible": false, + "inherit": false + }, + "retraction_extrusion_window": { + "label": "Minimal Extrusion Distance Window", + "description": "The window in which the Maximal Retraction Count is enforced. This window should be approximately the size of the Retraction distance, so that effectively the number of times a retraction passes the same patch of material is limited.", + "unit": "mm", + "type": "float", + "default": 4.5, + "visible": false, + "inherit_function": "retraction_amount" + }, + "retraction_hop": { + "label": "Z Hop when Retracting", + "description": "Whenever a retraction is done, the head is lifted by this amount to travel over the print. A value of 0.075 works well. This feature has a lot of positive effect on delta towers.", + "unit": "mm", + "type": "float", + "default": 0.0, + "visible": false, + "inherit": false + } + } + } + } + }, + "speed": { + "label": "Speed", + "visible": true, + "icon": "category_speed", + "settings": { + "speed_print": { + "label": "Print Speed", + "description": "The speed at which printing happens. A well-adjusted Ultimaker can reach 150mm/s, but for good quality prints you will want to print slower. Printing speed depends on a lot of factors, so you will need to experiment with optimal settings for this.", + "unit": "mm/s", + "type": "float", + "default": 50.0, + + "children": { + "speed_infill": { + "label": "Infill Speed", + "description": "The speed at which infill parts are printed. Printing the infill faster can greatly reduce printing time, but this can negatively affect print quality.", + "unit": "mm/s", + "type": "float", + "default": 50.0, + "visible": false + }, + "speed_wall": { + "label": "Shell Speed", + "description": "The speed at which shell is printed. Printing the outer shell at a lower speed improves the final skin quality.", + "unit": "mm/s", + "type": "float", + "default": 50.0, + "visible": false, + + "children": { + "speed_wall_0": { + "label": "Outer Shell Speed", + "description": "The speed at which outer shell is printed. Printing the outer shell at a lower speed improves the final skin quality. However, having a large difference between the inner shell speed and the outer shell speed will effect quality in a negative way.", + "unit": "mm/s", + "type": "float", + "default": 50.0, + "visible": false + }, + "speed_wall_x": { + "label": "Inner Shell Speed", + "description": "The speed at which all inner shells are printed. Printing the inner shell fasster than the outer shell will reduce printing time. It is good to set this in between the outer shell speed and the infill speed.", + "unit": "mm/s", + "type": "float", + "default": 50.0, + "visible": false + } + } + }, + "speed_topbottom": { + "label": "Top/Bottom Speed", + "description": "Speed at which top/bottom parts are printed. Printing the top/bottom faster can greatly reduce printing time, but this can negatively affect print quality.", + "unit": "mm/s", + "type": "float", + "default": 50.0, + "visible": false + }, + "speed_support": { + "label": "Support Speed", + "description": "The speed at which exterior support is printed. Printing exterior supports at higher speeds can greatly improve printing time. And the surface quality of exterior support is usually not important, so higher speeds can be used.", + "unit": "mm/s", + "type": "float", + "default": 50.0, + "visible": false, + "inherit_function": "speed_wall_0" + } + } + }, + "speed_travel": { + "label": "Travel Speed", + "description": "The speed at which travel moves are done. A well-built Ultimaker can reach speeds of 250mm/s. But some machines might have misaligned layers then.", + "unit": "mm/s", + "type": "float", + "default": 150.0 + }, + "speed_layer_0": { + "label": "Bottom Layer Speed", + "description": "The print speed for the bottom layer: You want to print the first layer slower so it sticks to the printer bed better.", + "unit": "mm/s", + "type": "float", + "default": 15.0, + "visible": false, + + "children": { + "skirt_speed": { + "label": "Skirt Speed", + "description": "The speed at which the skirt and brim are printed. Normally this is done at the initial layer speed. But sometimes you want to print the skirt at a different speed.", + "unit": "mm/s", + "type": "float", + "default": 15.0, + "visible": false + } + } + }, + "speed_slowdown_layers": { + "label": "Amount of Slower Layers", + "description": "The first few layers are printed slower then the rest of the object, this to get better adhesion to the printer bed and improve the overall success rate of prints. The speed is gradually increased over these layers. 4 layers of speed-up is generally right for most materials and printers.", + "type": "int", + "default": 4, + "visible": false + } + } + }, + "infill": { + "label": "Infill", + "visible": true, + "icon": "category_infill", + "settings": { + "fill_sparse_density": { + "label": "Infill Density", + "description": "This controls how densely filled the insides of your print will be. For a solid part use 100%, for an hollow part use 0%. A value around 20% is usually enough. This won't affect the outside of the print and only adjusts how strong the part becomes.", + "unit": "%", + "type": "float", + "default": 20.0, + + "children": { + "fill_pattern": { + "label": "Infill Pattern", + "description": "Cura defaults to switching between grid and line infill. But with this setting visible you can control this yourself. The line infill swaps direction on alternate layers of infill, while the grid prints the full cross-hatching on each layer of infill.", + "type": "enum", + "visible": false, + "options": [ + "Grid", + "Lines", + "Concentric", + "ZigZag" + ], + "default": "Grid", + "inherit_function": "'Lines' if parent_value > 25 else 'Grid'" + }, + "infill_line_distance": { + "label": "Line distance", + "description": "Distance between the printed infill lines.", + "unit": "mm", + "type": "float", + "default": 2.0, + "visible": false, + "inherit_function": "(infill_line_width * 100) / parent_value" + } + } + }, + "fill_overlap": { + "label": "Infill Overlap", + "description": "The amount of overlap between the infill and the walls. A slight overlap allows the walls to connect firmly to the infill.", + "unit": "%", + "type": "float", + "default": 15.0, + "visible": false + }, + "fill_sparse_thickness": { + "label": "Infill Thickness", + "description": "The thickness of the sparse infill. This is rounded to a multiple of the layerheight and used to print the sparse-infill in fewer, thicker layers to save printing time.", + "unit": "mm", + "type": "float", + "default": 0.1, + "visible": false, + + "children": { + "fill_sparse_combine": { + "label": "Infill Layers", + "description": "Amount of layers that are combined together to form sparse infill.", + "type": "int", + "default": 1, + "visible": false, + "inherit_function": "math.floor((parent_value + 0.001) / layer_height)" + } + } + } + } + }, + "cooling": { + "label": "Cooling", + "visible": true, + "icon": "category_cool", + "settings": { + "cool_fan_enabled": { + "label": "Enable Cooling Fan", + "description": "Enable the cooling fan during the print. The extra cooling from the cooling fan helps parts with small cross sections that print each layer quickly.", + "type": "boolean", + "default": true, + + "children": { + "cool_fan_speed": { + "label": "Fan Speed", + "description": "Fan speed used for the print cooling fan on the printer head.", + "unit": "%", + "type": "float", + "default": 100.0, + "visible": false, + "inherit_function": "100.0 if parent_value else 0.0", + + "children": { + "cool_fan_speed_min": { + "label": "Minimum Fan Speed", + "description": "Normally the fan runs at the minimum fan speed. If the layer is slowed down due to minimum layer time, the fan speed adjusts between minimum and maximum fan speed.", + "unit": "%", + "type": "float", + "default": 100.0, + "visible": false + }, + "cool_fan_speed_max": { + "label": "Maximum Fan Speed", + "description": "Normally the fan runs at the minimum fan speed. If the layer is slowed down due to minimum layer time, the fan speed adjusts between minimum and maximum fan speed.", + "unit": "%", + "type": "float", + "default": 100.0, + "visible": false + } + } + } + } + }, + "cool_fan_full_at_height": { + "label": "Fan Full on at Height", + "description": "The height at which the fan is turned on completely. For the layers below this the fan speed is scaled linearly with the fan off for the first layer.", + "unit": "mm", + "type": "float", + "default": 0.5, + "visible": false, + + "children": { + "cool_fan_full_layer": { + "label": "Fan Full on at Layer", + "description": "The layer number at which the fan is turned on completely. For the layers below this the fan speed is scaled linearly with the fan off for the first layer.", + "type": "int", + "default": 4, + "visible": false, + "inherit_function": "int((parent_value - layer_height_0 + 0.001) / layer_height)" + } + } + }, + "cool_min_layer_time": { + "label": "Minimal Layer Time", + "description": "The minimum time spent in a layer: Gives the layer time to cool down before the next one is put on top. If a layer would print in less time, then the printer will slow down to make sure it has spent at least this many seconds printing the layer.", + "unit": "sec", + "type": "float", + "default": 5.0, + "visible": false + }, + "cool_min_layer_time_fan_speed_max": { + "label": "Minimal Layer Time Full Fan Speed", + "description": "The minimum time spent in a layer which will cause the fan to be at minmum speed. The fan speed increases linearly from maximal fan speed for layers taking minimal layer time to minimal fan speed for layers taking the time specified here.", + "unit": "sec", + "type": "float", + "default": 10.0, + "visible": false + }, + "cool_min_speed": { + "label": "Minimum Speed", + "description": "The minimum layer time can cause the print to slow down so much it starts to droop. The minimum feedrate protects against this. Even if a print gets slowed down it will never be slower than this minimum speed.", + "unit": "mm/s", + "type": "float", + "default": 10.0, + "visible": false + }, + "cool_lift_head": { + "label": "Lift Head", + "description": "Lift the head away from the print if the minimum speed is hit because of cool slowdown, and wait the extra time away from the print surface until the minimum layer time is used up.", + "type": "boolean", + "default": false, + "visible": false + } + } + }, + "support": { + "label": "Support", + "visible": true, + "icon": "category_support", + "settings": { + "support_enable": { + "label": "Enable Support", + "description": "Enable exterior support structures. This will build up supporting structures below the model to prevent the model from sagging or printing in mid air.", + "type": "boolean", + "default": true + }, + "support_type": { + "label": "Placement", + "description": "Where to place support structures. The placement can be restricted such that the support structures won't rest on the model, which could otherwise cause scarring.", + "type": "enum", + "options": [ + "Touching Buildplate", + "Everywhere" + ], + "default": "Touching Buildplate", + "visible": true, + "inherit_function": "'Everywhere' if support_enable else 'None'", + "active_if": { + "setting": "support_enable", + "value": true + } + }, + "support_angle": { + "label": "Overhang Angle", + "description": "The maximum angle of overhangs for which support will be added. With 0 degrees being horizontal, and 90 degrees being vertical.", + "unit": "°", + "type": "float", + "default": 60.0, + "visible": false, + "active_if": { + "setting": "support_enable", + "value": true + } + }, + "support_xy_distance": { + "label": "X/Y Distance", + "description": "Distance of the support structure from the print, in the X/Y directions. 0.7mm typically gives a nice distance from the print so the support does not stick to the surface.", + "unit": "mm", + "type": "float", + "default": 0.7, + "visible": false, + "active_if": { + "setting": "support_enable", + "value": true + } + }, + "support_z_distance": { + "label": "Z Distance", + "description": "Distance from the top/bottom of the support to the print. A small gap here makes it easier to remove the support but makes the print a bit uglier. 0.15mm allows for easier separation of the support structure.", + "unit": "mm", + "type": "float", + "default": 0.15, + "visible": false, + "active_if": { + "setting": "support_enable", + "value": true + }, + + "children": { + "support_top_distance": { + "label": "Top Distance", + "description": "Distance from the top of the support to the print.", + "unit": "mm", + "default": 0.15, + "type": "float", + "visible": false + }, + "support_bottom_distance": { + "label": "Bottom Distance", + "description": "Distance from the print to the bottom of the support.", + "unit": "mm", + "default": 0.15, + "type": "float", + "visible": false + } + } + }, + "support_bottom_stair_step_height": { + "label": "Stair Step Height", + "description": "The height of the steps of the stair-like bottom of support resting on the model. Small steps can cause the support to be hard to remove from the top of the model.", + "unit": "mm", + "type": "float", + "default": 0.5, + "visible": false, + "active_if": { + "setting": "support_type", + "value": "Everywhere" + } + }, + "support_join_distance": { + "label": "Join Distance", + "description": "The maximum distance between support blocks, in the X/Y directions, such that the blocks will merge into a single block.", + "unit": "mm", + "type": "float", + "default": 0.7, + "visible": false + }, + "support_area_smoothing": { + "label": "Area Smoothing", + "description": "Maximal distance in the X/Y directions of a line segment which is to be smoothed out. Ragged lines are introduced by the join distance and support bridge, which cause the machine to resonate. Smoothing the support areas won't cause them to break with the constraints, except it might change the overhang.", + "unit": "mm", + "type": "float", + "default": 0.6, + "visible": false + }, + "support_use_towers": { + "label": "Use towers.", + "description": "Use specialized towers to support tiny overhang areas. These towers have a larger diameter than the region they support. Near the overhang the towers' diameter decreases, forming a roof.", + "type": "boolean", + "default": true, + "visible": true + }, + "support_minimal_diameter": { + "label": "Minimal Diameter", + "description": "Maximal diameter in the X/Y directions of a small area which is to be supported by a specialized support tower. ", + "unit": "mm", + "type": "float", + "default": 1.0, + "visible": false, + "active_if": { + "setting": "support_use_towers", + "value": true + } + }, + "support_tower_diameter": { + "label": "Tower Diameter", + "description": "The diameter of a special tower. ", + "unit": "mm", + "type": "float", + "default": 1.0, + "visible": false, + "active_if": { + "setting": "support_use_towers", + "value": true + } + }, + "support_tower_roof_angle": { + "label": "Tower Roof Angle", + "description": "The angle of the rooftop of a tower. Larger angles mean more pointy towers. ", + "unit": "°", + "type": "int", + "default": 65, + "visible": false, + "active_if": { + "setting": "support_use_towers", + "value": true + } + }, + "support_pattern": { + "label": "Pattern", + "description": "Cura supports 3 distinct types of support structure. First is a grid based support structure which is quite solid and can be removed as 1 piece. The second is a line based support structure which has to be peeled off line by line. The third is a structure in between the other two; it consists of lines which are connected in an accordeon fashion.", + "type": "enum", + "options": [ + "Grid", + "Lines", + "ZigZag" + ], + "default": "ZigZag", + "visible": true, + "active_if": { + "setting": "support_enable", + "value": true + } + }, + "support_connect_zigzags": { + "label": "Connect ZigZags", + "description": "Connect the ZigZags. Makes them harder to remove, but prevents stringing of disconnected zigzags.", + "type": "boolean", + "default": true, + "visible": false, + "active_if": { + "setting": "support_pattern", + "value": "ZigZag" + } + }, + "support_fill_rate": { + "label": "Fill Amount", + "description": "The amount of infill structure in the support, less infill gives weaker support which is easier to remove.", + "unit": "%", + "type": "float", + "default": 15, + "visible": false, + "active_if": { + "setting": "support_enable", + "value": true + }, + + "children": { + "support_line_distance": { + "label": "Line distance", + "description": "Distance between the printed support lines.", + "unit": "mm", + "type": "float", + "default": 2.66, + "visible": false, + "active_if": { + "setting": "support_enable", + "value": true + }, + "inherit_function": "(support_line_width * 100) / parent_value" + } + } + } + } + }, + "platform_adhesion": { + "label": "Platform Adhesion", + "visible": true, + "icon": "category_adhesion", + "settings": { + "adhesion_type": { + "label": "Type", + "description": "Different options that help in preventing corners from lifting due to warping. Brim adds a single-layer-thick flat area around your object which is easy to cut off afterwards, and it is the recommended option. Raft adds a thick grid below the object and a thin interface between this and your object. (Note that enabling the brim or raft disables the skirt.)", + "type": "enum", + "options": [ + "None", + "Brim", + "Raft" + ], + "default": "None" + }, + "skirt_line_count": { + "label": "Skirt Line Count", + "description": "The skirt is a line drawn around the first layer of the. This helps to prime your extruder, and to see if the object fits on your platform. Setting this to 0 will disable the skirt. Multiple skirt lines can help to prime your extruder better for small objects.", + "type": "int", + "default": 1, + "active_if": { + "setting": "adhesion_type", + "value": "None" + } + }, + "skirt_gap": { + "label": "Skirt Distance", + "description": "The horizontal distance between the skirt and the first layer of the print.\nThis is the minimum distance, multiple skirt lines will extend outwards from this distance.", + "unit": "mm", + "type": "float", + "default": 3.0, + "active_if": { + "setting": "adhesion_type", + "value": "None" + } + }, + "skirt_minimal_length": { + "label": "Skirt Minimum Length", + "description": "The minimum length of the skirt. If this minimum length is not reached, more skirt lines will be added to reach this minimum length. Note: If the line count is set to 0 this is ignored.", + "unit": "mm", + "type": "float", + "default": 250, + "active_if": { + "setting": "adhesion_type", + "value": "None" + } + }, + "brim_line_count": { + "label": "Brim Line Count", + "description": "The amount of lines used for a brim: More lines means a larger brim which sticks better, but this also makes your effective print area smaller.", + "type": "int", + "default": 1, + "active_if": { + "setting": "adhesion_type", + "value": "Brim" + } + }, + "raft_margin": { + "label": "Raft Extra Margin", + "description": "If the raft is enabled, this is the extra raft area around the object which is also given a raft. Increasing this margin will create a stronger raft while using more material and leaving less area for your print.", + "unit": "mm", + "type": "float", + "default": 5.0, + "active_if": { + "setting": "adhesion_type", + "value": "Raft" + } + }, + "raft_line_spacing": { + "label": "Raft Line Spacing", + "description": "The distance between the raft lines. The first 2 layers of the raft have this amount of spacing between the raft lines.", + "unit": "mm", + "type": "float", + "default": 5.0, + "active_if": { + "setting": "adhesion_type", + "value": "Raft" + } + }, + "raft_base_thickness": { + "label": "Raft Base Thickness", + "description": "Layer thickness of the first raft layer. This should be a thick layer which sticks firmly to the printer bed.", + "unit": "mm", + "type": "float", + "default": 0.3, + "active_if": { + "setting": "adhesion_type", + "value": "Raft" + } + }, + "raft_base_linewidth": { + "label": "Raft Base Line Width", + "description": "Width of the lines in the first raft layer. These should be thick lines to assist in bed adhesion.", + "unit": "mm", + "type": "float", + "default": 1.0, + "active_if": { + "setting": "adhesion_type", + "value": "Raft" + } + }, + "raft_base_speed": { + "label": "Raft Base Print Speed", + "description": "The speed at which the first raft layer is printed. This should be printed quite slowly, as the amount of material coming out of the nozzle is quite high.", + "unit": "mm/s", + "type": "float", + "default": 15.0, + "active_if": { + "setting": "adhesion_type", + "value": "Raft" + } + }, + "raft_interface_thickness": { + "label": "Raft Interface Thickness", + "description": "Thickness of the 2nd raft layer.", + "unit": "mm", + "type": "float", + "default": 0.27, + "active_if": { + "setting": "adhesion_type", + "value": "Raft" + } + }, + "raft_interface_linewidth": { + "label": "Raft Interface Line Width", + "description": "Width of the 2nd raft layer lines. These lines should be thinner than the first layer, but strong enough to attach the object to.", + "unit": "mm", + "type": "float", + "default": 0.4, + "active_if": { + "setting": "adhesion_type", + "value": "Raft" + } + }, + "raft_airgap": { + "label": "Raft Air-gap", + "description": "The gap between the final raft layer and the first layer of the object. Only the first layer is raised by this amount to lower the bonding between the raft layer and the object. Makes it easier to peel off the raft.", + "unit": "mm", + "type": "float", + "default": 0.22, + "active_if": { + "setting": "adhesion_type", + "value": "Raft" + } + }, + "raft_surface_layers": { + "label": "Raft Surface Layers", + "description": "The number of surface layers on top of the 2nd raft layer. These are fully filled layers that the object sits on. 2 layers usually works fine.", + "type": "int", + "default": 2, + "active_if": { + "setting": "adhesion_type", + "value": "Raft" + } + } + } + }, + "blackmagic": { + "label": "Fixes", + "visible": true, + "icon": "category_fixes", + "settings": { + "magic_spiralize": { + "label": "Spiralize the Outer Contour", + "description": "Spiralize smooths out the Z move of the outer edge. This will create a steady Z increase over the whole print. This feature turns a solid object into a single walled print with a solid bottom. This feature used to be called ‘Joris’ in older versions.", + "type": "boolean", + "default": false, + "visible": false + }, + "wireframe_enabled": { + "label": "Wireframe Printing", + "description": "Print only the outside surface with a sparse webbed structure, printing 'in thin air'. This is realized by horizontally printing the contours of the model at given Z intervals which are connected via upward and diagonally downward lines.", + "type": "boolean", + "default": false, + "visible": false + }, + "wireframe_printspeed": { + "label": "Printing speed", + "description": "Speed at which the nozzle moves when extruding material.", + "unit": "mm/s", + "type": "float", + "default": 5.0, + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + }, + "children": { + "wireframe_printspeed_bottom": { + "label": "Bottom printing speed", + "description": "Speed of printing the first layer, which is the only layer touching the bluidplatform.", + "unit": "mm/s", + "type": "float", + "default": 5.0, + "visible": false, + "inherit":true + }, + "wireframe_printspeed_up": { + "label": "Upward printing speed", + "description": "Speed of printing a line upward 'in thin air'.", + "unit": "mm/s", + "type": "float", + "default": 5.0, + "visible": false, + "inherit":true + }, + "wireframe_printspeed_down": { + "label": "Downward printing speed", + "description": "Speed of printing a line diagonally downward.", + "unit": "mm/s", + "type": "float", + "default": 5.0, + "visible": false, + "inherit":true + }, + "wireframe_printspeed_flat": { + "label": "Horizontal printing speed", + "description": "Speed of printing the horizontal contours of the object.", + "unit": "mm/s", + "type": "float", + "default": 5.0, + "visible": false, + "inherit":true + } + } + }, + "wireframe_flow": { + "label": "Flow", + "description": "Flow compensation: the amount of material extruded is multiplied by this value.", + "unit": "%", + "default": 100.0, + "type": "float", + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + }, + "children": { + "wireframe_flow_connection": { + "label": "Connection flow", + "description": "Flow compensation when going up or down.", + "unit": "%", + "default": 100.0, + "type": "float", + "visible": false + }, + "wireframe_flow_flat": { + "label": "Flat flow", + "description": "Flow compensation when printing flat lines.", + "unit": "%", + "default": 100.0, + "type": "float", + "visible": false + } + } + }, + "wireframe_top_delay": { + "label": "Top delay", + "description": "Delay time after an upward move, so that the upward line can harden.", + "unit": "sec", + "type": "float", + "default": 0.0, + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + } + }, + "wireframe_bottom_delay": { + "label": "Bottom delay", + "description": "Delay time after a downward move.", + "unit": "sec", + "type": "float", + "default": 0.0, + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + } + }, + "wireframe_flat_delay": { + "label": "Flat delay", + "description": "Delay time between two horizontal segments. Introducing such a delay can cause better adhesion to previous layers at the connection points, while too large delay times cause sagging.", + "unit": "sec", + "type": "float", + "default": 0.1, + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + } + }, + "wireframe_up_half_speed": { + "label": "Ease upward", + "description": "Distance of an upward move which is extruded with half speed.\nThis can cause better adhesion to previous layers, while not heating the material in those layers too much.", + "type": "float", + "unit": "mm", + "default": 0.3, + "visible": false + }, + "wireframe_top_jump": { + "label": "Knot size", + "description": "Creates a small knot at the top of an upward line, so that the consecutive horizontal layer has a better chance to connect to it.", + "type": "float", + "unit": "mm", + "default": 0.6, + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + } + }, + "wireframe_fall_down": { + "label": "Fall down", + "description": "Distance with which the material falls down after an upward extrusion. This distance is compensated for.", + "type": "float", + "unit": "mm", + "default": 0.5, + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + } + }, + "wireframe_drag_along": { + "label": "Drag along", + "description": "Distance with which the material of an upward extrusion is dragged along with the diagonally downward extrusion. This distance is compensated for.", + "type": "float", + "unit": "mm", + "default": 0.6, + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + } + }, + "wireframe_strategy": { + "label": "Strategy", + "description": "Strategy for making sure two consecutive layers connect at each connection point. Retraction lets the upward lines harden in the right position, but may cause filament grinding. A knot can be made at the end of an upward line to heighten the chance of connecting to it and to let the line cool; however it may require slow printing speeds. Another strategy is to compensate for the sagging of the top of an upward line; however, the lines won't always fall down as predicted.", + "type": "enum", + "options": [ + "Compensate", + "Knot", + "Retract" + ], + "default": "Compensate", + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + } + }, + "wireframe_straight_before_down": { + "label": "Straighten downward lines", + "description": "Percentage of a diagonally downward line which is covered by a horizontal line piece. This can prevent sagging of the top most point of upward lines.", + "type": "float", + "unit": "%", + "default": 20.0, + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + } + }, + "wireframe_roof_fall_down": { + "label": "Roof fall down", + "description": "The distance which horizontal roof lines printed 'in thin air' fall down when being printed. This distance is compensated for.", + "type": "float", + "unit": "mm", + "default": 2.0, + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + } + }, + "wireframe_roof_drag_along": { + "label": "Roof drag along", + "description": "The distance of the end piece of an inward line which gets dragged along when going back to the outer outline of the roof. This distance is compensated for.", + "type": "float", + "unit": "mm", + "default": 0.8, + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + } + }, + "wireframe_roof_outer_delay": { + "label": "Roof outer delay", + "description": "Time spent at the outer perimeters of hole which is to become a roof. Larger times can ensure a better connection.", + "type": "boolean", + "unit": "sec", + "type": "float", + "default": 0.2, + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + } + }, + "wireframe_height": { + "label": "Connection height.", + "description": "The height of the upward and diagonally downward lines between two horizontal parts.", + "type": "float", + "unit": "mm", + "default": 3.0, + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + } + }, + "wireframe_roof_inset": { + "label": "Roof inset distance", + "description": "The distance covered when making a connection from a roof outline inward.", + "type": "float", + "unit": "mm", + "default": 3.0, + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + }, + "inherit_function": "wireframe_height" + }, + "wireframe_nozzle_clearance": { + "label": "Nozzle clearance", + "description": "Distance between the nozzle and horizontally downward lines. Larger clearance results in diagonally downward lines with a less steep angle, which in turn results in less upward connections with the next layer.", + "type": "float", + "unit": "mm", + "default": 1.0, + "visible": false, + "active_if": { + "setting": "wireframe", + "value": true + } + } + } + } + } +} + + diff --git a/src/octoprint/plugins/pluginmanager/__init__.py b/src/octoprint/plugins/pluginmanager/__init__.py index 04c2f1fe1..4e086a70e 100644 --- a/src/octoprint/plugins/pluginmanager/__init__.py +++ b/src/octoprint/plugins/pluginmanager/__init__.py @@ -83,6 +83,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin, repository="http://plugins.octoprint.org/plugins.json", repository_ttl=24*60, pip=None, + dependency_links=False, hidden=[] ) @@ -187,6 +188,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin, plugin_name = data["plugin"] if "plugin" in data else None return self.command_install(url=url, force="force" in data and data["force"] in valid_boolean_trues, + dependency_links="dependency_links" in data and data["dependency_links"] in valid_boolean_trues, reinstall=plugin_name) elif command == "uninstall": @@ -205,7 +207,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin, plugin = self._plugin_manager.plugins[plugin_name] return self.command_toggle(plugin, command) - def command_install(self, url=None, path=None, force=False, reinstall=None): + def command_install(self, url=None, path=None, force=False, reinstall=None, dependency_links=False): if url is not None: pip_args = ["install", sarge.shell_quote(url)] elif path is not None: @@ -213,6 +215,9 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin, else: raise ValueError("Either url or path must be provided") + if dependency_links or self._settings.get_boolean(["dependency_links"]): + pip_args.append("--process-dependency-links") + all_plugins_before = self._plugin_manager.find_plugins() success_string = "Successfully installed" @@ -421,8 +426,15 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin, def _call_pip(self, args): if self._pip_caller is None or not self._pip_caller.available: raise RuntimeError(u"No pip available, can't operate".format(**locals())) + + if "--process-dependency-links" in args: + self._log_message(u"Installation needs to process external dependencies, that might make it take a bit longer than usual depending on the pip version") + return self._pip_caller.execute(*args) + def _log_message(self, *lines): + self._log(lines, prefix=u"*", stream="message") + def _log_call(self, *lines): self._log(lines, prefix=u" ", stream="call") @@ -519,6 +531,12 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin, def map_repository_entry(entry): result = dict(entry) + if not "follow_dependency_links" in result: + result["follow_dependency_links"] = False + + if not "follow_dependency_links" in result: + result["follow_dependency_links"] = False + result["is_compatible"] = dict( octoprint=True, os=True diff --git a/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js b/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js index eba85fade..7c5265ff5 100644 --- a/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js +++ b/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js @@ -70,6 +70,8 @@ $(function() { self.loglines = ko.observableArray([]); self.installedPlugins = ko.observableArray([]); + self.followDependencyLinks = ko.observable(false); + self.working = ko.observable(false); self.workingTitle = ko.observable(); self.workingDialog = undefined; @@ -125,6 +127,9 @@ $(function() { self.uploadButton.unbind("click"); self.uploadButton.bind("click", function() { self._markWorking(gettext("Installing plugin..."), gettext("Installing plugin from uploaded archive...")); + data.formData = { + dependency_links: self.followDependencyLinks() + }; data.submit(); return false; }); @@ -240,13 +245,13 @@ $(function() { } if (self.installed(data)) { - self.installPlugin(data.archive, data.title, data.id); + self.installPlugin(data.archive, data.title, data.id, data.follow_dependency_links || self.followDependencyLinks()); } else { - self.installPlugin(data.archive, data.title, undefined); + self.installPlugin(data.archive, data.title, undefined, data.follow_dependency_links || self.followDependencyLinks()); } }; - self.installPlugin = function(url, name, reinstall) { + self.installPlugin = function(url, name, reinstall, followDependencyLinks) { if (!self.loginState.isAdmin()) { return; } @@ -260,6 +265,10 @@ $(function() { } if (!url) return; + if (followDependencyLinks === undefined) { + followDependencyLinks = self.followDependencyLinks(); + } + var workTitle, workText; if (!reinstall) { workTitle = gettext("Installing plugin..."); @@ -275,7 +284,7 @@ $(function() { self._markWorking(workTitle, workText); var command = "install"; - var payload = {url: url}; + var payload = {url: url, dependency_links: followDependencyLinks}; if (reinstall) { payload["plugin"] = reinstall; payload["force"] = true; diff --git a/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 b/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 index 559817c06..b855dc81f 100644 --- a/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 +++ b/src/octoprint/plugins/pluginmanager/templates/pluginmanager_settings.jinja2 @@ -147,6 +147,21 @@ {{ _('This does not look like a valid plugin archive. Valid plugin archives should be either zip files or tarballs and have the extension ".zip", ".tar.gz", ".tgz" or ".tar"') }} + +
+ +
+
+
+
+ +
+
+
+
+