FIX: Cannot send the print job when the printer is not at FDM mode

jira: [STUDIO-10571]
Change-Id: I20c02b79d09400dce2089856fde98d0cd50713ff
This commit is contained in:
xin.zhang 2025-03-06 20:35:10 +08:00 committed by lane.wei
parent f5c49c89a8
commit d327fa9178
4 changed files with 19 additions and 4 deletions

View File

@ -6103,8 +6103,7 @@ void MachineObject::parse_new_info(json print)
} }
if (device.contains("type")) { if (device.contains("type")) {
int type = device["type"].get<int>(); // FDM:1<<0 Laser:1<< Cut:1<<2 m_device_mode = (DeviceMode)device["type"].get<int>();// FDM:1<<0 Laser:1<< Cut:1<<2
is_fdm = type & 1;
} }
if (device.contains("bed_temp")) { if (device.contains("bed_temp")) {

View File

@ -960,6 +960,13 @@ public:
DOOR_OPEN_CHECK_ENABLE_PAUSE_PRINT = 2,/*pause print*/ DOOR_OPEN_CHECK_ENABLE_PAUSE_PRINT = 2,/*pause print*/
}; };
enum DeviceMode : unsigned int
{
DEVICE_MODE_FDM = 0x00000001,
DEVICE_MODE_LASER = 0x00000010,
DEVICE_MODE_CUT = 0x00000100,
};
bool file_model_download{false}; bool file_model_download{false};
bool virtual_camera{false}; bool virtual_camera{false};
@ -1064,8 +1071,8 @@ public:
bool is_makeworld_subtask(); bool is_makeworld_subtask();
/* device type */ /* device type */
bool is_fdm{ true }; DeviceMode m_device_mode{ DEVICE_MODE_FDM };
inline bool is_fdm_type() const { return is_fdm; } inline bool is_fdm_type() const { return m_device_mode == DEVICE_MODE_FDM; }
int m_plate_index { -1 }; int m_plate_index { -1 };
std::string m_gcode_file; std::string m_gcode_file;

View File

@ -1775,6 +1775,8 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
} else if (status == PrintDialogStatus::PrintStatusReadingTimeout) { } else if (status == PrintDialogStatus::PrintStatusReadingTimeout) {
wxString msg_text = _L("Synchronizing device information time out"); wxString msg_text = _L("Synchronizing device information time out");
update_print_status_msg(msg_text, true, true, true); update_print_status_msg(msg_text, true, true, true);
} else if (status == PrintDialogStatus::PrintStatusModeNotFDM) {
update_print_status_msg(_L("Cannot send the print job when the printer is not at FDM mode"), true, false, true);
} else if (status == PrintDialogStatus::PrintStatusInUpgrading) { } else if (status == PrintDialogStatus::PrintStatusInUpgrading) {
wxString msg_text = _L("Cannot send the print job when the printer is updating firmware"); wxString msg_text = _L("Cannot send the print job when the printer is updating firmware");
update_print_status_msg(msg_text, true, false, true); update_print_status_msg(msg_text, true, false, true);
@ -3298,6 +3300,12 @@ void SelectMachineDialog::update_show_status()
} }
} }
if (!obj_->is_fdm_type())
{
show_status(PrintDialogStatus::PrintStatusModeNotFDM);
return;
}
if (is_blocking_printing(obj_)) { if (is_blocking_printing(obj_)) {
show_status(PrintDialogStatus::PrintStatusUnsupportedPrinter); show_status(PrintDialogStatus::PrintStatusUnsupportedPrinter);
return; return;

View File

@ -69,6 +69,7 @@ enum PrintDialogStatus {
PrintStatusReadingFinished, PrintStatusReadingFinished,
PrintStatusReadingTimeout, PrintStatusReadingTimeout,
PrintStatusInUpgrading, PrintStatusInUpgrading,
PrintStatusModeNotFDM,
PrintStatusNeedUpgradingAms, PrintStatusNeedUpgradingAms,
PrintStatusInSystemPrinting, PrintStatusInSystemPrinting,
PrintStatusInPrinting, PrintStatusInPrinting,