ENH:add "is_filament_installed" in MachineObject

jira: none
Change-Id: Ifd71947a742c1ed37fa22bbf0bb2cd538ff47268
This commit is contained in:
zhou.xu 2025-02-11 17:05:21 +08:00 committed by lane.wei
parent 9d7c9c54fc
commit 21d1159cd5
3 changed files with 24 additions and 1 deletions

View File

@ -1648,6 +1648,25 @@ int MachineObject::get_bed_temperature_limit()
return BED_TEMP_LIMIT;
}
bool MachineObject::is_filament_installed()
{
if (m_extder_data.extders.size() > 0) {
// right//or single
auto ext = m_extder_data.extders[MAIN_NOZZLE_ID];
if (ext.ext_has_filament) {
return true;
}
}
/*left*/
if (m_extder_data.extders.size() > 1) {
auto ext = m_extder_data.extders[DEPUTY_NOZZLE_ID];
if (ext.ext_has_filament) {
return true;
}
}
return false;
}
bool MachineObject::is_makeworld_subtask()
{
if (model_task && model_task->design_id > 0) {

View File

@ -899,7 +899,7 @@ public:
int printing_speed_mag = 100;
PrintingSpeedLevel _parse_printing_speed_lvl(int lvl);
int get_bed_temperature_limit();
bool is_filament_installed();
/* camera */
bool has_ipcam { false };
bool camera_recording { false };

View File

@ -2912,6 +2912,10 @@ void Sidebar::sync_ams_list(bool is_from_big_sync_btn)
p->plater->pop_warning_and_go_to_device_page(printer_name, Plater::PrinterWarningType::NOT_CONNECTED, _L("Sync printer information"));
return;
}
if (!obj->is_filament_installed()) {
p->plater->pop_warning_and_go_to_device_page("", Plater::PrinterWarningType::UNINSTALL_FILAMENT, _L("Sync printer information"));
return;
}
bool exist_at_list_one_filament =false;
for (auto &cur : list) {
auto temp_config = cur.second;