ENH: show why can not set timelapse

jira: [STUDIO-11109]
Change-Id: Id6347a6b0e5f6ead0a5ad534790b42adf9f01c4a
(cherry picked from commit 9a80a45a82f5db6f85fadbde977529d39d8036b1)
This commit is contained in:
xin.zhang
2025-04-02 19:49:36 +08:00
committed by Noisyfox
parent 8c513c816b
commit 618716b544
4 changed files with 70 additions and 34 deletions

View File

@@ -1756,10 +1756,10 @@ bool MachineObject::is_studio_cmd(int sequence_id)
return false;
}
bool MachineObject::canEnableTimelapse() const
bool MachineObject::canEnableTimelapse(wxString &error_message) const
{
if (!is_support_timelapse)
{
if (!is_support_timelapse) {
error_message = _L("Timelapse is not supported on this printer.");
return false;
}
@@ -1768,7 +1768,19 @@ bool MachineObject::canEnableTimelapse() const
return true;
}
return sdcard_state == MachineObject::SdcardState::HAS_SDCARD_NORMAL;
if (sdcard_state != MachineObject::SdcardState::HAS_SDCARD_NORMAL) {
if (sdcard_state == MachineObject::SdcardState::NO_SDCARD) {
error_message = _L("Timelapse is not supported while the SD card does not exist.");
} else if (sdcard_state == MachineObject::SdcardState::HAS_SDCARD_ABNORMAL) {
error_message = _L("Timelapse is not supported while the SD card is unavailable.");
} else if (sdcard_state == MachineObject::SdcardState::HAS_SDCARD_READONLY) {
error_message = _L("Timelapse is not supported while the SD card is readonly.");
}
return false;
}
return true;
}
int MachineObject::command_select_extruder(int id)