From 12dd7fbff673a4defb690236577af69bcd853713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 17 Apr 2023 16:45:23 +0200 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=91=B7=20Switch=20to=20tag=20for=20py?= =?UTF-8?q?pi=20publish=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05abded34..50fcc7cf8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -209,7 +209,7 @@ jobs: name: dist path: dist - name: 📦 Publish to index - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 continue-on-error: true with: password: ${{ secrets.testpypi_password }} @@ -227,7 +227,7 @@ jobs: name: dist path: dist - name: 📦 Publish to index - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.pypi_password }} From ff28dd9f2677e3675c1f45e5c083ecff7db51a90 Mon Sep 17 00:00:00 2001 From: jneilliii Date: Mon, 17 Apr 2023 11:14:00 -0400 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=90=9B=20Fix=20missing=20event=20name?= =?UTF-8?q?=20causing=20issues=20on=20the=20UI=20(#4796)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #4795 --- src/octoprint/plugins/eventmanager/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/octoprint/plugins/eventmanager/__init__.py b/src/octoprint/plugins/eventmanager/__init__.py index f631d6ecc..a8a43eb31 100644 --- a/src/octoprint/plugins/eventmanager/__init__.py +++ b/src/octoprint/plugins/eventmanager/__init__.py @@ -16,6 +16,9 @@ class EventManagerPlugin( "subscriptions": [], } events = self._settings.global_get(["events"]) + for event in events.get("subscriptions", []): + if "name" not in event: + event["name"] = event["command"] if events: my_settings["subscriptions"] = sorted( events.get("subscriptions", []), key=(lambda x: x["event"]) From ea28a4d902cbd916a32f796ad001241da530fbf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 4 May 2023 17:34:58 +0200 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=90=9B=20Enable=20CORS=20on=20asset?= =?UTF-8?q?=20plugins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/server/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py index f0da8dc83..e09714a50 100644 --- a/src/octoprint/server/__init__.py +++ b/src/octoprint/server/__init__.py @@ -2040,6 +2040,10 @@ class Server: url_prefix = f"/plugin/{name}" blueprint = Blueprint(name, name, static_folder=plugin.get_asset_folder()) + + blueprint.before_request(corsRequestHandler) + blueprint.after_request(corsResponseHandler) + return blueprint, url_prefix def _add_plugin_request_handlers_to_blueprints(self, *blueprints): From 67719d98b369cdcce5b0a9190d4a2e0e63fa1381 Mon Sep 17 00:00:00 2001 From: Orel <37673727+0r31@users.noreply.github.com> Date: Thu, 4 May 2023 19:01:20 +0200 Subject: [PATCH 4/6] =?UTF-8?q?=E2=9C=A8=20virtual=20printer:=20Support=20?= =?UTF-8?q?generating=20M115=20area=20report=20(#4799)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Handles M115 GEOMETRY capability report * No need to use a separate format string... * Origin has no effect on machine height... * ♻️ virtual: refactor area report Now depends on a single config setting `m115ReportArea`. If true, the virtual printer will generate an area report from the current printer profile and include it in the M115 reponse. Ships as false by default. --------- Co-authored-by: Gina Häußge --- docs/development/virtual_printer.rst | 11 ++- .../plugins/virtual_printer/__init__.py | 2 + .../plugins/virtual_printer/virtual.py | 84 ++++++++++++++++++- 3 files changed, 94 insertions(+), 3 deletions(-) diff --git a/docs/development/virtual_printer.rst b/docs/development/virtual_printer.rst index d7222b14c..d90817f9b 100644 --- a/docs/development/virtual_printer.rst +++ b/docs/development/virtual_printer.rst @@ -198,11 +198,20 @@ There many configuration options via ``config.yaml`` for the virtual printer tha m115FormatString: "FIRMWARE_NAME: {firmware_name} PROTOCOL_VERSION:1.0" # Whether to include capability report in M115 output - m115ReportCapabilites: false + m115ReportCapabilities: true # Capabilities to report if capability report is enabled capabilities: AUTOREPORT_TEMP: true + AUTOREPORT_TEMP: true + AUTOREPORT_SD_STATUS: true + AUTOREPORT_POS: false + EMERGENCY_PARSER: true + EXTENDED_M20: false + LFN_WRITE: false + + # Whether to include area report in the M115 output (M115_GEOMETRY_REPORT in Marlin) + m115ReportArea: false # Simulated ambient temperature in °C ambientTemperature: 21.3 diff --git a/src/octoprint/plugins/virtual_printer/__init__.py b/src/octoprint/plugins/virtual_printer/__init__.py index a6bd86cb5..e10fd6e0a 100644 --- a/src/octoprint/plugins/virtual_printer/__init__.py +++ b/src/octoprint/plugins/virtual_printer/__init__.py @@ -56,6 +56,7 @@ class VirtualPrinterPlugin( "EXTENDED_M20": False, "LFN_WRITE": False, }, + "m115ReportArea": False, "m114FormatString": "X:{x} Y:{y} Z:{z} E:{e[current]} Count: A:{a} B:{b} C:{c}", "m105TargetFormatString": "{heater}:{actual:.2f}/ {target:.2f}", "m105NoTargetFormatString": "{heater}:{actual:.2f}", @@ -114,6 +115,7 @@ class VirtualPrinterPlugin( serial_obj = virtual.VirtualPrinter( self._settings, + self._printer_profile_manager, data_folder=self.get_plugin_data_folder(), seriallog_handler=seriallog_handler, read_timeout=float(read_timeout), diff --git a/src/octoprint/plugins/virtual_printer/virtual.py b/src/octoprint/plugins/virtual_printer/virtual.py index 8f70762ef..28db7ad3e 100644 --- a/src/octoprint/plugins/virtual_printer/virtual.py +++ b/src/octoprint/plugins/virtual_printer/virtual.py @@ -36,6 +36,7 @@ class VirtualPrinter: def __init__( self, settings, + printer_profile_manager, data_folder, seriallog_handler=None, read_timeout=5.0, @@ -49,6 +50,7 @@ class VirtualPrinter: ) self._settings = settings + self._printer_profile_manager = printer_profile_manager self._faked_baudrate = faked_baudrate self._plugin_data_folder = data_folder @@ -693,8 +695,86 @@ class VirtualPrinter: self._send(output) if self._settings.get_boolean(["m115ReportCapabilities"]): - for cap, enabled in self._capabilities.items(): - self._send("Cap:{}:{}".format(cap.upper(), "1" if enabled else "0")) + for cap, value in self._capabilities.items(): + self._send("Cap:{}:{}".format(cap.upper(), "1" if value else "0")) + + if self._settings.get_boolean(["m115ReportArea"]): + area_report = self._generate_area_report( + self._printer_profile_manager.get_current_or_default() + ) + if area_report: + self._send(area_report) + + @staticmethod + def _generate_area_report(profile: Dict) -> str: + """ + Generate a string with the area of the printer volume. + + See https://marlinfw.org/docs/gcode/M115.html + + Example:: + + >>> VirtualPrinter._generate_area_report({"volume": {"width": 200, "depth": 200, "height": 200, "origin": "lowerleft"}}) + 'area:{full:{min:{x:0,y:0,z:0},max:{x:200,y:200,z:200}},work:{min:{x:0,y:0,z:0},max:{x:200,y:200,z:200}}}' + >>> VirtualPrinter._generate_area_report({"volume": {"width": 200, "depth": 200, "height": 200, "origin": "center"}}) + 'area:{full:{min:{x:-100.0,y:-100.0,z:0},max:{x:100.0,y:100.0,z:200}},work:{min:{x:-100.0,y:-100.0,z:0},max:{x:100.0,y:100.0,z:200}}}' + >>> VirtualPrinter._generate_area_report({"volume": {"width": 200, "depth": 200, "height": 200, "custom_box": {"x_min": -3, "y_min": -3, "z_min": 0, "x_max": 200, "y_max": 200, "z_max": 200}, "origin": "lowerleft"}}) + 'area:{full:{min:{x:-3,y:-3,z:0},max:{x:200,y:200,z:200}},work:{min:{x:0,y:0,z:0},max:{x:200,y:200,z:200}}}' + >>> VirtualPrinter._generate_area_report({}) + '' + >>> VirtualPrinter._generate_area_report({"foo": "bar"}) + '' + >>> VirtualPrinter._generate_area_report({"volume": {}}) + '' + + We use printer profile data here, with the full volume being defined by a custom bounding box, if defined. + Based on the docs it's currently unclear on whether this matches the actual behaviour of the implementation + of this part of the M115 command in Marlin, however for testing purposes as part of the virtual printer + it should be sufficient. + """ + + if not profile or "volume" not in profile: + return "" + + volume = profile["volume"] + if any([x not in volume for x in ["width", "depth", "height", "origin"]]): + return "" + + origin_ll = volume["origin"] == "lowerleft" + + work_bounds = { + "min": { + "x": 0 if origin_ll else -volume["width"] / 2, + "y": 0 if origin_ll else -volume["depth"] / 2, + "z": 0, + }, + "max": { + "x": volume["width"] if origin_ll else volume["width"] / 2, + "y": volume["depth"] if origin_ll else volume["depth"] / 2, + "z": volume["height"], + }, + } + + full_bounds = work_bounds + custom = volume.get("custom_box") + if custom: + full_bounds = { + "min": { + "x": custom["x_min"], + "y": custom["y_min"], + "z": custom["z_min"], + }, + "max": { + "x": custom["x_max"], + "y": custom["y_max"], + "z": custom["z_max"], + }, + } + + # we'll just use json.dumps to generate the string, and then remove the quotes and spaces + return "area:" + json.dumps({"full": full_bounds, "work": work_bounds}).replace( + '"', "" + ).replace(" ", "") def _gcode_M117(self, data: str) -> None: # we'll just use this to echo a message, to allow playing around with pause triggers From 9ba981a2ea789030927fc49b6ad166bc68f6b5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 8 May 2023 14:37:06 +0200 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=94=96=20Preparing=20release=20of=201?= =?UTF-8?q?.9.0rc6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SUPPORTERS.md | 4 +++- src/octoprint/plugins/errortracking/__init__.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/SUPPORTERS.md b/SUPPORTERS.md index 1cb8ed752..78f122c09 100644 --- a/SUPPORTERS.md +++ b/SUPPORTERS.md @@ -21,6 +21,7 @@ thanks to everyone who contributed! * Creality3D * DeltaMaker 3D Printers * Dennis Breining + * Dima Gorbenko * Douglas Floyd * Ed Crump * Ernesto Martinez @@ -46,6 +47,7 @@ thanks to everyone who contributed! * Mark Walker * Michael Aumock * Michael Badagliacco + * Mike Labanov * Mosaic Manufacturing * Norman Jaffe * Obico @@ -65,4 +67,4 @@ thanks to everyone who contributed! * Steve Thompson * Ulrich Kempken -and 2025 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [GitHub Sponsors](https://github.com/users/foosel/sponsorship)! +and 2008 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [GitHub Sponsors](https://github.com/users/foosel/sponsorship)! diff --git a/src/octoprint/plugins/errortracking/__init__.py b/src/octoprint/plugins/errortracking/__init__.py index a421323dc..f3ccc9def 100644 --- a/src/octoprint/plugins/errortracking/__init__.py +++ b/src/octoprint/plugins/errortracking/__init__.py @@ -18,10 +18,10 @@ from octoprint.util.version import ( ) SENTRY_URL_SERVER = ( - "https://4045f26d0af548729d66d42330513f84@o118517.ingest.sentry.io/1373987" + "https://9456b5f2ea6848a1aefd9f721b255e24@o118517.ingest.sentry.io/1373987" ) SENTRY_URL_COREUI = ( - "https://547ae711243d408e86fdee27cca233f8@o118517.ingest.sentry.io/1374096" + "https://ba606129a1da4ffe87907db5283e47a3@o118517.ingest.sentry.io/1374096" ) SETTINGS_DEFAULTS = { From ec4e75e672292c09730bdcc861906a0b79502485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 8 May 2023 16:15:12 +0200 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=94=96=20staging/maintenance=20is=20n?= =?UTF-8?q?ow=201.9.0rc7.dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .versioneer-lookup | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.versioneer-lookup b/.versioneer-lookup index fc69115ad..6d8e5e065 100644 --- a/.versioneer-lookup +++ b/.versioneer-lookup @@ -29,10 +29,10 @@ improve/.* 1.9.0 fa2c4680cca0d1d6b46e6c1ed68ceea4d9b79afb pep440-dev staging/bugfix 1.8.8 8e4c1f5246c4245b839ccdcdabf2beee671b08d7 pep440-dev bug/.* 1.8.8 8e4c1f5246c4245b839ccdcdabf2beee671b08d7 pep440-dev -# staging/maintenance is currently the branch for preparation of 1.9.0rc6 +# staging/maintenance is currently the branch for preparation of 1.9.0rc7 # so is regressionfix/... -staging/maintenance 1.9.0rc6 2596a99a2497e53e3f73399941bda7822bb1ef6f pep440-dev -regressionfix/.* 1.9.0rc6 2596a99a2497e53e3f73399941bda7822bb1ef6f pep440-dev +staging/maintenance 1.9.0rc7 9ba981a2ea789030927fc49b6ad166bc68f6b5f9 pep440-dev +regressionfix/.* 1.9.0rc7 9ba981a2ea789030927fc49b6ad166bc68f6b5f9 pep440-dev # staging/devel is currently inactive (but has the 1.4.1rc4 namespace) staging/devel 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev