Add setting to enable uploads to abnormal Storage; improve sd_card_state error reporting (#10981)

* Add option to allow upload to SD-Cards marked as abnormal, also add better error description

+ Adds the options under the Network Settings to allow upload to abnormal SD-Card.
+ If not enabled user will now see why the upload is stuck at 10% depending on the sd_card_state (Readonly/Abnormal)

* Merging with current branch, and updateing "sd-card" to "storage"

* Generate localization and also change remaining sd_card_abnormal states to _storage_abnormal

* Fix issues from merge, and other bugfixes.

* Regenerate localization files.

* Improve Missing Storage Message, Add skip for abnormal storage in printer select dialog
This commit is contained in:
Seref
2025-10-29 13:32:38 +01:00
committed by GitHub
parent dedfd9d4ed
commit 4b7b81a0a2
33 changed files with 7555 additions and 4844 deletions

View File

@@ -560,15 +560,32 @@ void PrintJob::process(Ctl &ctl)
ctl.update_status(curr_percent, _u8L("Sending print job through cloud service"));
result = m_agent->start_print(params, update_fn, cancel_fn, wait_fn);
}
}
} else {
if (this->has_sdcard) {
ctl.update_status(curr_percent, _u8L("Sending print job over LAN"));
result = m_agent->start_local_print(params, update_fn, cancel_fn);
} else {
ctl.update_status(curr_percent, _u8L("Storage needs to be inserted before printing via LAN."));
return;
}
}
} else {
switch(this->sdcard_state) {
case DevStorage::SdcardState::NO_SDCARD:
ctl.update_status(curr_percent, _u8L("A Storage needs to be inserted before printing via LAN."));
return;
case DevStorage::SdcardState::HAS_SDCARD_ABNORMAL:
if(this->has_sdcard) {
// means the storage is abnormal but can be used option is enabled
ctl.update_status(curr_percent, _u8L("Sending print job over LAN, but the Storage in the printer is abnormal and print-issues may be caused by this."));
result = m_agent->start_local_print(params, update_fn, cancel_fn);
break;
}
ctl.update_status(curr_percent, _u8L("The Storage in the printer is abnormal. Please replace it with a normal Storage before sending print job to printer."));
return;
case DevStorage::SdcardState::HAS_SDCARD_READONLY:
ctl.update_status(curr_percent, _u8L("The Storage in the printer is read-only. Please replace it with a normal Storage before sending print job to printer."));
return;
case DevStorage::SdcardState::HAS_SDCARD_NORMAL:
ctl.update_status(curr_percent, _u8L("Sending print job over LAN"));
result = m_agent->start_local_print(params, update_fn, cancel_fn);
break;
default:
ctl.update_status(curr_percent, _u8L("Encountered an unknown error with the Storage status. Please try again."));
return;
}
}
if (result < 0) {

View File

@@ -5,6 +5,7 @@
#include <boost/filesystem/operations.hpp>
#include "libslic3r/PrintConfig.hpp"
#include "Job.hpp"
#include "slic3r/GUI/DeviceCore/DevStorage.h"
namespace fs = boost::filesystem;
@@ -82,6 +83,8 @@ public:
bool cloud_print_only { false };
bool has_sdcard { false };
bool task_use_ams { true };
DevStorage::SdcardState sdcard_state = DevStorage::SdcardState::NO_SDCARD;
bool task_ext_change_assist { false };
int auto_bed_leveling{0};

View File

@@ -297,13 +297,30 @@ void SendJob::process(Ctl &ctl)
ctl.update_status(curr_percent, _u8L("Sending G-code file over LAN"));
}
} else {
if (this->has_sdcard) {
ctl.update_status(curr_percent, _u8L("Sending G-code file over LAN"));
result = m_agent->start_send_gcode_to_sdcard(params, update_fn, cancel_fn, nullptr);
} else {
ctl.update_status(curr_percent, _u8L("Storage needs to be inserted before sending to printer."));
return;
}
switch(this->sdcard_state) {
case DevStorage::SdcardState::NO_SDCARD:
ctl.update_status(curr_percent, _u8L("Storage needs to be inserted before sending to printer."));
return;
case DevStorage::SdcardState::HAS_SDCARD_ABNORMAL:
if(this->has_sdcard) {
// means the sdcard is abnormal but can be used option is enabled
ctl.update_status(curr_percent, _u8L("Sending G-code file over LAN, but the Storage in the printer is abnormal and print-issues may be caused by this."));
result = m_agent->start_send_gcode_to_sdcard(params, update_fn, cancel_fn, nullptr);
break;
}
ctl.update_status(curr_percent, _u8L("The Storage in the printer is abnormal. Please replace it with a normal Storage before sending to printer."));
return;
case DevStorage::SdcardState::HAS_SDCARD_READONLY:
ctl.update_status(curr_percent, _u8L("The Storage in the printer is read-only. Please replace it with a normal Storage before sending to printer."));
return;
case DevStorage::SdcardState::HAS_SDCARD_NORMAL:
ctl.update_status(curr_percent, _u8L("Sending G-code file over LAN"));
result = m_agent->start_send_gcode_to_sdcard(params, update_fn, cancel_fn, nullptr);
break;
default:
ctl.update_status(curr_percent, _u8L("Encountered an unknown error with the Storage status. Please try again."));
return;
}
}
if (ctl.was_canceled()) {

View File

@@ -3,6 +3,7 @@
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
#include "slic3r/GUI/DeviceCore/DevStorage.h"
#include "Job.hpp"
#include "PrintJob.hpp"
@@ -45,6 +46,8 @@ public:
bool cloud_print_only { false };
bool has_sdcard { false };
bool task_use_ams { true };
DevStorage::SdcardState sdcard_state = DevStorage::SdcardState::NO_SDCARD;
wxWindow* m_parent{nullptr};