* Don't crash if template is set to None
* In general catch any error while processing plugin template
configs and ignore plugin completely.
Closes#4453
If we strip \r from \r\n, our line length and thus file position
calculation will be off by one. We'll just leave it in as it
doesn't influence our parsing and makes things way easier.
Thanks to @JoveToo for the heads-up on Discord.
If we run into a timeout with `M400` and never receive
the requested position data in time, don't keep
the recording flags set or we will record an
outdated position first time we see another
`M114` response.
See #4440
* Demo Github Token Settings
* 🚸 swu: explain where and why to get a GitHub PAT
* 🐛 swu: Only set GH PAT if it's been provided
Co-authored-by: Gina Häußge <gina@octoprint.org>
Adds a "downloading" and a "splitting lines" step so
it's clear that something IS happening, even though
the progress bar isn't yet showing a percentage.
* Replace AVLTree with double binary search
* Remove unused variable
* reader.js
* Best return the correct variables
* Better compare with percentage of next layer.
* Fix several bugs and edge conditions
* Implement iterative binary search
* No point in going through the math if it can be only 1 layer.
* Add last position cache
* Remove AVLTree from repository
* Must be lower than percentage of next level.
* Look up the percentage value in the correct model.
* If we add extra zlifted element, we need to sort the layer.
* Remove caching and add lookup array to simplify code.
* Restore change.
* Also clear layerPercentageLookup on clear()
* Fix pre-commit issues.
* Fix pre-commit issues.
* 🔥 Remove now disabled sortLayers
* 🐛 Fix layer split in gcoded viewer
We now create a layer each per z-height, even if we
encounter the same z-height several times in a print.
This might also solve #2243, though I have not tested it yet.
Co-authored-by: Gina Häußge <gina@octoprint.org>
* Support two-digit flavors for G00 G01 G02 G03
Many CAM processors generate two-digit movement commands. These are legal movement commands but the viewer is currently blind to them. (Evidently slicers never generate these, or this would have already been an issue.)
This does not fully solve rendering of non-extruding toolpaths, but it enables a workaround in combination with M101 added to the preamble.
* 🥅 Support G00, G01, G02, G03 in backend as well
Co-authored-by: Gina Häußge <gina@octoprint.org>
Ever since the needed upgrade, the e2e tests have
been very shaky. Let's try to up the retry count
to get this under control.
Long term I need to find out what's going on,
but currently I'm not able to even reproduce the
issue (jquery not loading). And/or maybe switch
to PlayWright if I can't get it to work reliably
anymore.
* adds an update queue to allow starting updates while printing, #3320, #3589, #3585
* change to 202 status code instead of abort for queued installs
* remove commented code
* fix formatting
* UI improvements
proper list merging, without duplicates
* add countdown timer on print completion prior to update
don't automatically update on print fail
add ability to cancel queued updates
* UI tweaks and fixes
* minor bugfix
* if logic adjustment to prevent sending messages to front end when no updates queued
* add timer abort on print start in case he update is in process
* added wait for timelapse completion to avoid interrupting that process due to resstart at the end of updates.
* ♻️ Get rid of some data duplication
...and a TODO
* API adjustments as requested, removed PNotify hack for singleButtonNotify change (broken)
* added print_cancelled flag to deal with changes related to waiting for timelapse
switched PNotify back from singleButtonNotify and added class hidden to button instead to avoid Pnotify.update issue
* 💄 minify CSS
Implements #3320
Implements #3585
Implements #3589
Implements #4431
Co-authored-by: Gina Häußge <gina@octoprint.org>
* Add support for changing hook order
Default hook value changed from None to 1000
* ♻️ Refactor sorting override logic
* fetch settings during platform initialization instead of in plugin core
* rename from hook order to sorting order as it's also used for the
sorting context of implementations
* make sure settings are initialized empty in defaults
* 📝 Add missing docs for sorting order overrides
* ✨ Fully support reordering of implementations too
Co-authored-by: Gina Häußge <gina@octoprint.org>
* Use json for annoucements cache
Parsing this XML file is very slow, so there's no reason to do it more
than we have to.
See 4480-2021-12-11T13:23:48-05:00.json, MainThread -> parse
On my system, this reduces the time for /plugin/announcements/channels
from 250ms CPU time to 50ms.
The rough improvment in this specific function call is from 8% to 0.32%
of total runtime.
* ♻️ Refactor json serializer
* Move back to octoprint.util.json
* Leave old encoding helper as is but add additional
one focused on serialization (with full roundtrips).
Use each as needed (primarily encoding one).
octoprint.util.encoding -> old one
octoprint.util.serializing -> new one
Each serves different purpose, we don't want
to end up with `__jsonclass__` stuff in our
API output at some point, so separate the
concerns here and allow different handling.
* Ensure wrappers are in place for backwards
compatibility (e.g. dump vs dumps).
* 🐛 Fix handling of invalid cache
We get different exceptions now and in any case just throw
*anything* away that we can't parse.
* 🎨 Use fallback typing annotation for Py3.7.{0,1}
Better solution than getting stuck to Dict only, thanks
@flaviut for the suggestion!
* 🐛 Fix bytes encoding
bytes objects are explicitly not always UTF-8, so encode them in a way
that doesn't lead to errors and encoding/decoding problems when they are
actually binary data.
Co-authored-by: Gina Häußge <gina@octoprint.org>