mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 10:32:20 +00:00
ENH:change SD card to external storage
jira:[none ] Change-Id: Ia8fb38151f75433344a085196728752d2fe6f159 (cherry picked from commit 6c7b61fcd8aefd9ad9da56da8b55e0c06865a677)
This commit is contained in:
@@ -1568,12 +1568,12 @@ void CalibrationPresetPage::show_status(CaliPresetPageStatus status)
|
||||
Enable_Send_Button(false);
|
||||
}
|
||||
else if (status == CaliPresetPageStatus::CaliPresetStatusLanModeNoSdcard) {
|
||||
wxString msg_text = _L("An SD card needs to be inserted before printing via LAN.");
|
||||
wxString msg_text = _L("Storage needs to be inserted before printing via LAN.");
|
||||
update_print_status_msg(msg_text, true);
|
||||
Enable_Send_Button(true);
|
||||
}
|
||||
else if (status == CaliPresetPageStatus::CaliPresetStatusNoSdcard) {
|
||||
wxString msg_text = _L("An SD card needs to be inserted before printing.");
|
||||
wxString msg_text = _L("Storage needs to be inserted before printing.");
|
||||
update_print_status_msg(msg_text, true);
|
||||
Enable_Send_Button(false);
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ wxString PrintJob::get_http_error_msg(unsigned int status, std::string body)
|
||||
;
|
||||
}
|
||||
return wxEmptyString;
|
||||
}
|
||||
}
|
||||
|
||||
void PrintJob::process(Ctl &ctl)
|
||||
{
|
||||
@@ -269,8 +269,8 @@ void PrintJob::process(Ctl &ctl)
|
||||
params.preset_name = profile_name->second;
|
||||
}
|
||||
catch (...) {}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
auto model_name = model_info->metadata_items.find(BBL_DESIGNER_MODEL_TITLE_TAG);
|
||||
if (model_name != model_info->metadata_items.end()) {
|
||||
try {
|
||||
@@ -355,9 +355,9 @@ void PrintJob::process(Ctl &ctl)
|
||||
auto update_fn = [this, &ctl,
|
||||
&is_try_lan_mode,
|
||||
&is_try_lan_mode_failed,
|
||||
&msg,
|
||||
&error_str,
|
||||
&curr_percent,
|
||||
&msg,
|
||||
&error_str,
|
||||
&curr_percent,
|
||||
&error_text,
|
||||
StagePercentPoint
|
||||
](int stage, int code, std::string info) {
|
||||
@@ -420,7 +420,7 @@ void PrintJob::process(Ctl &ctl)
|
||||
}
|
||||
}
|
||||
|
||||
//get errors
|
||||
//get errors
|
||||
if (code > 100 || code < 0 || stage == BBL::SendingPrintJobStage::PrintingStageERROR) {
|
||||
if (code == BAMBU_NETWORK_ERR_PRINT_WR_FILE_OVER_SIZE || code == BAMBU_NETWORK_ERR_PRINT_SP_FILE_OVER_SIZE) {
|
||||
m_plater->update_print_error_info(code, desc_file_too_large, info);
|
||||
@@ -441,7 +441,7 @@ void PrintJob::process(Ctl &ctl)
|
||||
return ctl.was_canceled();
|
||||
};
|
||||
|
||||
|
||||
|
||||
DeviceManager* dev = wxGetApp().getDeviceManager();
|
||||
MachineObject* obj = dev->get_selected_machine();
|
||||
|
||||
@@ -559,13 +559,13 @@ 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("An SD card needs to be inserted before printing via LAN."));
|
||||
ctl.update_status(curr_percent, _u8L("Storage needs to be inserted before printing via LAN."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -593,7 +593,7 @@ void PrintJob::process(Ctl &ctl)
|
||||
if (result != BAMBU_NETWORK_ERR_CANCELED) {
|
||||
ctl.show_error_info(msg_text, 0, "", "");
|
||||
}
|
||||
|
||||
|
||||
BOOST_LOG_TRIVIAL(error) << "print_job: failed, result = " << result;
|
||||
} else {
|
||||
// wait for printer mqtt ready the same job id
|
||||
|
||||
@@ -233,7 +233,7 @@ void SendJob::process(Ctl &ctl)
|
||||
}
|
||||
}
|
||||
|
||||
//get errors
|
||||
//get errors
|
||||
if (code > 100 || code < 0 || stage == BBL::SendingPrintJobStage::PrintingStageERROR) {
|
||||
if (code == BAMBU_NETWORK_ERR_PRINT_WR_FILE_OVER_SIZE || code == BAMBU_NETWORK_ERR_PRINT_SP_FILE_OVER_SIZE) {
|
||||
m_plater->update_print_error_info(code, desc_file_too_large, info);
|
||||
@@ -268,7 +268,7 @@ void SendJob::process(Ctl &ctl)
|
||||
else if (params.password.empty())
|
||||
params.comments = "no_password";
|
||||
|
||||
if (!params.password.empty()
|
||||
if (!params.password.empty()
|
||||
&& !params.dev_ip.empty()
|
||||
&& this->has_sdcard) {
|
||||
// try to send local with record
|
||||
@@ -294,7 +294,7 @@ void SendJob::process(Ctl &ctl)
|
||||
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("An SD card needs to be inserted before sending to printer."));
|
||||
ctl.update_status(curr_percent, _u8L("Storage needs to be inserted before sending to printer."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,12 +440,12 @@ void MediaFilePanel::fetchUrl(boost::weak_ptr<PrinterFileSystem> wfs)
|
||||
m_waiting_enable = false;
|
||||
if (!m_local_proto && !m_remote_proto) {
|
||||
m_waiting_support = true;
|
||||
m_image_grid->SetStatus(m_bmp_failed, _L("Browsing file in SD card is not supported in current firmware. Please update the printer firmware."));
|
||||
m_image_grid->SetStatus(m_bmp_failed, _L("Browsing file in storage is not supported in current firmware. Please update the printer firmware."));
|
||||
fs->SetUrl("0");
|
||||
return;
|
||||
}
|
||||
if (!m_sdcard_exist) {
|
||||
m_image_grid->SetStatus(m_bmp_failed, _L("Please check if the SD card is inserted into the printer.\nIf it still cannot be read, you can try formatting the SD card."));
|
||||
m_image_grid->SetStatus(m_bmp_failed, _L("Please check if the storage is inserted into the printer.\nIf it still cannot be read, you can try formatting the storage."));
|
||||
fs->SetUrl("0");
|
||||
return;
|
||||
}
|
||||
@@ -478,7 +478,7 @@ void MediaFilePanel::fetchUrl(boost::weak_ptr<PrinterFileSystem> wfs)
|
||||
return;
|
||||
}
|
||||
if (m_lan_mode) {
|
||||
m_image_grid->SetStatus(m_bmp_failed, _L("Browsing file in SD card is not supported in LAN Only Mode."));
|
||||
m_image_grid->SetStatus(m_bmp_failed, _L("Browsing file in storage is not supported in LAN Only Mode."));
|
||||
fs->SetUrl("0");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ static std::map<int, std::string> error_messages = {
|
||||
{PrinterFileSystem::FILE_NO_EXIST, L("File does not exist.")},
|
||||
{PrinterFileSystem::FILE_CHECK_ERR, L("File checksum error. Please retry.")},
|
||||
{PrinterFileSystem::FILE_TYPE_ERR, L("Not supported on the current printer version.")},
|
||||
{PrinterFileSystem::STORAGE_UNAVAILABLE, L("Please check if the SD card is inserted into the printer.\nIf it still cannot be read, you can try formatting the SD card.")},
|
||||
{PrinterFileSystem::STORAGE_UNAVAILABLE, L("Please check if the storage is inserted into the printer.\nIf it still cannot be read, you can try formatting the storage.")},
|
||||
{PrinterFileSystem::API_VERSION_UNSUPPORT, L("The firmware version of the printer is too low. Please update the firmware and try again.")},
|
||||
{PrinterFileSystem::FILE_EXIST, L("The file already exists, do you want to replace it?")},
|
||||
{PrinterFileSystem::STORAGE_SPACE_NOT_ENOUGH, L("Insufficient storage space, please clear the space and try again.")},
|
||||
|
||||
@@ -1736,7 +1736,12 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
|
||||
Enable_Send_Button(true);
|
||||
Enable_Refresh_Button(true);
|
||||
} else if (status == PrintDialogStatus::PrintStatusLanModeNoSdcard) {
|
||||
wxString msg_text = _L("External storage needs to be inserted before printing via LAN.");
|
||||
wxString msg_text = _L("Storage needs to be inserted before printing via LAN.");
|
||||
update_print_status_msg(msg_text, true, true);
|
||||
Enable_Send_Button(true);
|
||||
Enable_Refresh_Button(true);
|
||||
} else if (status == PrintDialogStatus::PrintStatusLanModeSDcardNotAvailable) {
|
||||
wxString msg_text = _L("Storage is not available or is in read-only mode.");
|
||||
update_print_status_msg(msg_text, true, true);
|
||||
Enable_Send_Button(true);
|
||||
Enable_Refresh_Button(true);
|
||||
@@ -1751,7 +1756,7 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
|
||||
Enable_Send_Button(true);
|
||||
Enable_Refresh_Button(true);
|
||||
} else if (status == PrintDialogStatus::PrintStatusNoSdcard) {
|
||||
wxString msg_text = _L("External storage needs to be inserted before printing.");
|
||||
wxString msg_text = _L("Storage needs to be inserted before printing.");
|
||||
update_print_status_msg(msg_text, true, true);
|
||||
Enable_Send_Button(false);
|
||||
Enable_Refresh_Button(true);
|
||||
@@ -1791,7 +1796,7 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
|
||||
Enable_Send_Button(false);
|
||||
Enable_Refresh_Button(true);
|
||||
} else if (status == PrintDialogStatus::PrintStatusTimelapseNoSdcard) {
|
||||
wxString msg_text = _L("External storage needs to be inserted to record timelapse.");
|
||||
wxString msg_text = _L("Storage needs to be inserted to record timelapse.");
|
||||
update_print_status_msg(msg_text, true, true);
|
||||
Enable_Send_Button(true);
|
||||
Enable_Refresh_Button(true);
|
||||
|
||||
@@ -176,7 +176,7 @@ void SendToPrinterDialog::on_rename_enter()
|
||||
}
|
||||
|
||||
SendToPrinterDialog::SendToPrinterDialog(Plater *plater)
|
||||
: DPIDialog(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, _L("Send to Printer SD card"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
|
||||
: DPIDialog(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, _L("Send to Printer storage"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
|
||||
, m_plater(plater), m_export_3mf_cancel(false)
|
||||
{
|
||||
#ifdef __WINDOWS__
|
||||
@@ -580,7 +580,7 @@ void SendToPrinterDialog::update_storage_list(const std::vector<std::string>& st
|
||||
m_storage_sizer->Add(radiobox, 0, wxALIGN_CENTER, 0);
|
||||
m_storage_sizer->Add(0, 0, 0, wxEXPAND|wxLEFT, FromDIP(6));
|
||||
m_storage_sizer->Add(storage_text, 0, wxALIGN_CENTER,0);
|
||||
m_storage_radioBox.push_back(radiobox);
|
||||
m_storage_radioBox.push_back(radiobox);
|
||||
}
|
||||
|
||||
if (m_storage_radioBox.size() > 0) {
|
||||
@@ -1435,7 +1435,7 @@ void SendToPrinterDialog::show_status(PrintDialogStatus status, std::vector<wxSt
|
||||
Enable_Refresh_Button(true);
|
||||
}
|
||||
else if (status == PrintDialogStatus::PrintStatusNoSdcard) {
|
||||
wxString msg_text = _L("An SD card needs to be inserted before send to printer SD card.");
|
||||
wxString msg_text = _L("Storage needs to be inserted before send to printer.");
|
||||
update_print_status_msg(msg_text, true, true);
|
||||
Enable_Send_Button(false);
|
||||
Enable_Refresh_Button(true);
|
||||
@@ -1447,7 +1447,7 @@ void SendToPrinterDialog::show_status(PrintDialogStatus status, std::vector<wxSt
|
||||
Enable_Refresh_Button(true);
|
||||
}
|
||||
else if (status == PrintDialogStatus::PrintStatusNotSupportedSendToSDCard) {
|
||||
wxString msg_text = _L("The printer does not support sending to printer SD card.");
|
||||
wxString msg_text = _L("The printer does not support sending to printer storage.");
|
||||
update_print_status_msg(msg_text, true, true);
|
||||
Enable_Send_Button(false);
|
||||
Enable_Refresh_Button(true);
|
||||
|
||||
@@ -2095,7 +2095,6 @@ void StatusPanel::update_camera_state(MachineObject* obj)
|
||||
{
|
||||
if (!obj) return;
|
||||
|
||||
//m_bitmap_sdcard_abnormal_img->SetToolTip(_L("SD Card Abnormal"));
|
||||
//sdcard
|
||||
if (m_last_sdcard != (int)obj->get_sdcard_state()) {
|
||||
if (obj->get_sdcard_state() == MachineObject::SdcardState::NO_SDCARD) {
|
||||
@@ -4766,7 +4765,7 @@ void StatusPanel::on_camera_enter(wxMouseEvent& event)
|
||||
m_camera_popup->Bind(EVT_SDCARD_ABSENT_HINT, [this](wxCommandEvent &e) {
|
||||
if (sdcard_hint_dlg == nullptr) {
|
||||
sdcard_hint_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Warning"), SecondaryCheckDialog::ButtonStyle::ONLY_CONFIRM);
|
||||
sdcard_hint_dlg->update_text(_L("Can't start this without SD card."));
|
||||
sdcard_hint_dlg->update_text(_L("Can't start this without storage."));
|
||||
}
|
||||
sdcard_hint_dlg->on_show();
|
||||
});
|
||||
|
||||
@@ -1374,12 +1374,12 @@ void CalibUtils::send_to_print(const CalibInfo &calib_info, wxString &error_mess
|
||||
}
|
||||
|
||||
else if (!obj_->is_support_print_without_sd && (obj_->get_sdcard_state() == MachineObject::SdcardState::NO_SDCARD)) {
|
||||
error_message = _L("An SD card needs to be inserted before printing.");
|
||||
error_message = _L("Storage needs to be inserted before printing.");
|
||||
return;
|
||||
}
|
||||
if (obj_->is_lan_mode_printer()) {
|
||||
if (obj_->get_sdcard_state() == MachineObject::SdcardState::NO_SDCARD) {
|
||||
error_message = _L("An SD card needs to be inserted before printing via LAN.");
|
||||
error_message = _L("Storage needs to be inserted before printing via LAN.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user