Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-slice STLs in queue #166

Merged
merged 11 commits into from
Jan 18, 2023
Merged

Auto-slice STLs in queue #166

merged 11 commits into from
Jan 18, 2023

Conversation

smartin015
Copy link
Owner

@smartin015 smartin015 commented Nov 30, 2022

This PR targets #147 by repeating the .resolve() method implemented by LANSetView instances to regular Set instances. In both cases, this is called to resolve any indirection in the set's path into a .gcode file before beginning a print.

When resolve() detects a path ending in .stl, it fails with a named exception that is caught by the ScriptRunner instance. The runner then looks for and invokes a slicer to produce a runnable .gcode file, before starting the print.

This also required changes to the Driver state machine to wait on a callback if the slicer needed to be invoked.

Also anticipate FILE_ADDED changes upstream, to close out #107 once OctoPrint/OctoPrint#4687 is landed.

Remaining work:

  • Write howto doc for setting up an auto-slicer
  • Enable adding STLs to the print queue in JS
  • Modify PPS to write back directly, rather than delayed POST to file API (fixes initial blank file issue, also printing behavior probably)
    • Compare against other slicer plugin to better understand the post-write analysis flow
    • Update docs to point to forked repository until changes are merged
  • Add a settings option for setting the slicer via CPQ settings
  • Fix broken tests
  • Unit test settings changes for slicer/profile
  • Unit test driver start_print_callback with error / successful
  • Unit test state_printing receipt of successful blah.stl.gcode comparing to resolved SetView is WAI
  • Unit test script_runner.py call out to slicing_manager when stl file received - using full dest path with .stl.gcode suffix
  • Unit test script_runner.py slicing callback success/failure/SlicingException
  • Unit test settings fetch of all slicers/profiles for dropdown box selection
  • Remove debug print() and console.log() statements
  • Fix integration, driver, and script_runner tests
  • Update docs and verify that new PrePrintService release works (see here)
  • Separate octoprint FILE_ADDED handling into separate PR targeting octoprint 1.9.0
  • Verify .gcode and .stl files can both be added without a slicer configured, but .stl files error when attempted
  • Verify .gcode files can still be printed normally, even when slicer is configured.
  • Verify .stl files are converted to gcode and run when a slicer is configured
  • Verify .stl files can be packed/unpacked from .gjob files and still run fine

Future:

  • Contribute kubernetes config for preprint service
  • Contribute belt printer support for preprintservice

@smartin015 smartin015 marked this pull request as draft January 18, 2023 13:39
@smartin015 smartin015 marked this pull request as ready for review January 18, 2023 23:39
@smartin015 smartin015 merged commit ef498ed into rc Jan 18, 2023
smartin015 added a commit that referenced this pull request Mar 8, 2023
* Suppress core OctoPrint GCODE scripts when running CPQ scripts of our own

* Also protect the patchComms() function from exceptions e.g. due to OctoPrint refactors

* Also return original script values in passthru

* Configurable GCODE override in print files

* Properly order sets by rank

* Preprocessor simulator and preview (#194)

* Partial commit - extended CustomEvents to include sim stuff, added sim api endpoint, split out settings JS into a separate _event.js file

* Fixed simulation execution events, added styling, plus modifiable symtable and display of mutations

* Pluralize simulation summary, separate asteval code into automation.py from storage/queries.py, set up tests

* Fix tests

* Add tests for CPSettingsEvent

* Make simulator UI more friendly/helpful and well formatted

* Remove todo lines

* Tighten spoolmanager integration (#195)

* Tighten spoolmanager integration, including validation checks and print-start adjustments

* Add tests, improve set_status behavior, add spoolmanager.py files

* Fix tests, eliminate stack overflow

* Increase idle timeout seconds

* Add preprocessor basics to docs (#196)

* Add S3D processor (#197)

* Compute stats for whole queues (#198)

* Extract stats calculations from continuousprint_jobs.js, make also usable on whole queues

* Add HTML for viewing queue rollups, make selectively visible

* Fix tests, fix batch selection, auto-hide mass estimates when zero

* Auto-slice STLs in queue (#166)

* First attempt at integrating OctoPrint configured slicers into queue automation; also anticipate FILE_ADDED changes upstream

* Added auto-slicing docs and fixed small bug in octoprint version detection

* Add working auto-slicer implementation; unit tests TBD

* Fix tests

* Add driver test

* Add tests for slicer profiles in JS, remove extra debug logging

* Remove unused driver state, improve verbosity of slicing errors, and fixed slicer output path in tmp folder

* Get working enough to verify STL and gcode handled correctly, plus update docs

* Fix tests, remove octoprint version req thing and reduce DB noise in testing

* Cleanup

* 2.4.0rc1

* Creality Ender 3 S1 Pro added (#207)

* Ender 3 S1 Pro bed cleaning (#208)

* Update gcode_scripts.yaml

* Update gcode_scripts.yaml

* Add safety temp directory creation, fixed YAML data files

* Appease linter

* Fix tests and broken links

---------

Co-authored-by: UdDReX <44963788+UdDReX@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant