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

Support for SimplyPrint cloud integration #4783

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

Ocraftyone
Copy link

@Ocraftyone Ocraftyone commented Sep 8, 2024

  • Port new UI Jobs and related commits from PrusaSlicer

  • Make httpserver more generic and reusable

  • Add OAuthJob

  • Add support for cloud-based print hosts

  • Add SimplyPrint as a print host

  • Allow BBL printers to use 3rd party print hosts (via an option under Printer settings/Basic Information/Advanced)

Noisyfox and others added 20 commits August 21, 2024 10:55
* Make httpserver more generic and reusable

* Add OAuthJob

* Fix issue caused by the fact that the backing widget of the `TextCtrl` is no longer `wxTextCtrl`

* Implement login and token refresh

* Implement file upload

* Try fix build error

* Support BBL printers

* Show error message if user hasn't done OAuth

* Fix typo

* Update error message

* Disable unsupported options when SimplyPrint is selected

(cherry picked from commit e29bbac1933b9b10b24421757c5165d9b1702d06)
Co-authored-by: Ocraftyone <[email protected]>
* Allow using BBL's device tab when 3rd party print host is used

* Add option to open SimplyPrint panel in device tab after uploading

* Fix default print host for prusa connect

* Do not set api key in device view when SimplyPrint is used

* Sending 3mf file to SimplyPrint when using BBL printers

* Fix file extension when uploading 3mf

* Prepare for large file uploading

* Implement chunk upload

* Fix file uploading exceeding content size

* Fix wrong field type

* Add `temp=true` to all chunk upload calls

* Add macro to enable test api

* Merge branch 'main' into dev/simplyprint-improve

* Fix another missing `temp=true`

* Add delete token

* Try fixing build error on *nix systems

* Merge branch 'main' into dev/simplyprint-improve

* Merge branch 'main' into dev/simplyprint-improve

* Merge remote-tracking branch 'remote/main' into dev/simplyprint-improve

# Conflicts:
#	src/slic3r/GUI/BackgroundSlicingProcess.cpp

* Move the `bbl_use_print_host_webui` option to print host dialog. Also make it a derived option of `print_host_webui` instead.

* Merge branch 'main' into dev/simplyprint-improve

# Conflicts:
#	src/slic3r/GUI/MainFrame.cpp
#	src/slic3r/GUI/Plater.cpp

* Merge branch 'main' into dev/simplyprint-improve

# Conflicts:
#	src/slic3r/GUI/Plater.cpp

* Use a more generic option instead of SimplyPrint specific

* Merge branch 'main' into dev/simplyprint-improve

* Merge branch 'main' into dev/simplyprint-improve

(cherry picked from commit cd6cd0786fc494d2f1e2fd2123e791f65fbcc97a)
Co-authored-by: Ocraftyone <[email protected]>
Cherry-picked commits from prusa3d/PrusaSlicer related to the new system for UI Jobs

OrcaSlicer's port of this rework by noisyfox was also used at times as a reference to help with the BBL specific changes needed for the port. The OrcaSlicer port is part of commit 933aa3050bf5297b3714fb59575b3ec86e017112.

Commits included:

Add comments, remove some redundant template fiddling

Also make ThreadSafeQueueSPSC not copyable and non movable

(cherry picked from commit 7975dfab26e7cc0d1d5c0070e369a4f0777131b7)

Log time for loading fonts

(cherry picked from commit fe90a88b4d3b6c51e28161ff06bc8f8deb6fb592)

log as info job processing time

(cherry picked from commit 2d66607440b3ae821bd0559d84a3308e4296045f)

Fix crash in gcc on Linux

(cherry picked from commit 155b152637b843fac06c8c71300b6e2da793ff5c)

Trying to fix hanging job tests on windows

The issue might be that the worker's m_running flag is not set atomically. It is possible that the finalize message is pushed and is consumed before setting the running flag to false. See the loop in BoostThreadWorker::run

(cherry picked from commit ca824e095e9a0ead367b3f1929c49d40cc21e7e0)

Fix return value when create job

(cherry picked from commit 95178a2ba3943e20cfd56d1dd6fbb71d2027064c)

Let's not call yield in PlaterWorker

Not worth the risk, needs further investigation

(cherry picked from commit 345ee7cf28442980009ed790edc44c7bf40e7a11)

Fix PlaterWorker not calling yield from main thread

Also fix UIThreadWorker not setting busy cursor

(cherry picked from commit cf16dafad943b6869cc93ffa4b8c7440b6b21a09)

Add UIThreadWorker for debugging and profiling purposes

(cherry picked from commit 98928935877b3ec25a62c8fec1fc28642fff6b23)

Clarify comments for thread safe queue

Cleanup

(cherry picked from commit 3a1eee0f219a1cafebae37ea5107fa7af45397ab)

Add possibility to wait for current job to stop.

(cherry picked from commit 43f5e61b5f602e0bc33a3b4a1724123768871614)

Replace std::variant with boost::variant

Unavailable on MacOS < 1.14

(cherry picked from commit 4d0088e72f029c1dcafec99a1306ef0fc601bda6)

Rename start_next() to push

PlaterJob refinements

(cherry picked from commit 583c123c9703d95a4ae944c981554e7fda3a57d0)

Fix issue with non atomic transition to running state

After popping a job from input queue

(cherry picked from commit 7e070d393ec536682bfa34fbd6bd7cf661353f8f)

Avoid issue with invisible status indication.

(cherry picked from commit 17f4b1bea317a0cf59762ce830cc6439c18058c1)

Make a PlaterWorker to handle PlaterJobs

(cherry picked from commit 3be7d5f0dc864a54ba646d643f397c6e67790dfd)

Prevent accidental stopping of BoostThreadWorker before destruction

(cherry picked from commit a802bdc764d4319af2aaaaca3d9adaa7c2aa9dd4)

Rework UI jobs to make them more understandable and flexible.

(cherry picked from commit b53ff75cf460d0bc5404729c1d02dddf3a6224d5)

Co-authored-by: Filip Sykala - NTB T15p <[email protected]>
Co-authored-by: Noisyfox <[email protected]>
Co-authored-by: Ocraftyone <[email protected]>
Reimplements `clear_percent()` and `show_error_info()` from the old job system into the new job Ctl interface
Update UpgradeNetworkJob to reworked job system

Update SendJob to reworked job system

Update OrientJob to reworked job system

Update PrintJob to reworked job system

Update BindJob to reworked job system
(cherry picked from commit adec6b7ebdd91a71c61505dd4e1cc5ee9e17afcc)
One of the commits from SoftFever/OrcaSlicer#2819 (933aa3050bf5297b3714fb59575b3ec86e017112)

Co-authored-by: Ocraftyone <[email protected]>
One of the commits from SoftFever/OrcaSlicer#2819 (933aa3050bf5297b3714fb59575b3ec86e017112)
…egration

# Conflicts:
#	src/slic3r/GUI/Plater.cpp
@AlbertMN
Copy link

AlbertMN commented Sep 8, 2024

Albert from SimplyPrint here. Let me know if there are any questions to us as a company about this integration!

@ziehmon
Copy link

ziehmon commented Sep 10, 2024

What will this PR actually add? Send a job to the SimplyPrint cloud?

Would be nice for everyone if you'd add some UI Screenshots and an extensive functional description.

@AlbertMN
Copy link

What will this PR actually add? Send a job to the SimplyPrint cloud?

Would be nice for everyone if you'd add some UI Screenshots and an extensive functional description.

Agreed! Good idea! We'll add some screenshots and a better description of what exactly our integration does.

In short, you're right in the assumption that it'll simply let you send your prints through the SimplyPrint Cloud, the same way as other "Print host" services such as the OctoPrint or AstroPrint service works.

@Ocraftyone
Copy link
Author

Ocraftyone commented Sep 17, 2024

Using the service:

Logging into SimplyPrint
image
image
image

After Login
image

Slice model as normal then select print

Send to print dialog has a new option Switch to device tab after upload. This also determines if the next SimplyPrint step is done in you default browser or in the device tab
image

After selecting print, the next step will be opened either in your browser or in the device tab based on previous step. If it is your first time using the device tab with SimplyPrint, you will need to login again. You can then choose what to do with the uploaded file via SimplyPrint's interface
image

It should also be mentioned that this PR also adds an option called "Use 3rd-party print host" to BBL printers under Printer settings/Basic Information/Advanced. This is what enables SimplyPrint functionality on BBL printers.

@Ocraftyone
Copy link
Author

@lanewei120 @MklBambu Please feel free to ping me if you have any questions during review

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.

5 participants