Proper support of Bambu LAN printers (#8256)

**The latest download link can be found from the "Checks" tab above or
[here](https://github.com/SoftFever/OrcaSlicer/pull/8256/checks). There
should be an "artifact" dropdown on top of that page once the build is
completed.**

This PR solves the following problems:

- Bind printers in different subnet
- Binded LAN printers are not automatically connected when switching to
Device tab


![32217e0ea2ed5434d8916ad5c46e69c4](https://github.com/user-attachments/assets/a9189d74-c9b4-466c-9839-15cb79cf89bc)

![2fc422ddd3a89ae675de426953e44c1b](https://github.com/user-attachments/assets/2768c46c-c992-46a5-bb32-caa3aacfa62b)

![image](https://github.com/user-attachments/assets/0a65fffa-401a-4aa4-ba46-7681b642f1d1)


Few improtant things to know:

The automatic printer info detection (ie, the step in the first image)
doesn't work on MacOS, when you click "Connect" you will immediately be
prompted to the second image to enter the printer details. (I don't know
why but Bambu does not provide this capability on MacOS for their
network plugin)

AFAIK, P1 series do not support automatic printer info detection (as
tested by @SoftFever and myself), so the first step is gauranteed to
fail, which is unfortunate but expected. Simply click the "Manual Setup"
button (which will appear after clicking the "Connect" button then wait
for a while) and enter the printer detail and you should be good to go.
If anything entered wrong, you could simply unbind the printer and do it
all over again.

I know current binding flow is not very user-friendly, but consider how
rare this will be used, I think it's OK. Given the current situation
this is the best I could do with the closed-source Bambu network plugin.

I only have a P1 so I couldn't throughly test this PR. Please if you
have different printers and home network configurations, your feedback
are valuable to help validating and improving this PR, thanks in
advance!

Fix #6169
Fix #8097
This commit is contained in:
Noisyfox 2025-02-05 12:42:35 +08:00 committed by GitHub
commit 658c4f096e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 249 additions and 59 deletions

View file

@ -741,6 +741,11 @@ void SelectMachinePopup::update_user_devices()
op->Bind(EVT_UNBIND_MACHINE, [this, dev, mobj](wxCommandEvent& e) {
dev->set_selected_machine("");
if (mobj) {
AppConfig* config = wxGetApp().app_config;
if (config) {
config->erase_local_machine(mobj->dev_id);
}
mobj->set_access_code("");
mobj->erase_user_access_code();
}