ENH:add check machine sync status logic

1. Check machine sync logic before pop up filament map
2. Switch to auto for flush mode if is not synced

jira: NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I05ef0e610418767f763c5579f5fc85a4e9b79c47
(cherry picked from commit 5d7f8b126789ca4f8f20d5cfbcc70ac24efd4d6c)
This commit is contained in:
xun.zhang
2024-12-20 20:05:43 +08:00
committed by Noisyfox
parent 057a1a4f5d
commit daad39949f
4 changed files with 37 additions and 2 deletions

View File

@@ -3221,6 +3221,7 @@ struct Plater::priv
void unbind_canvas_event_handlers();
void reset_canvas_volumes();
bool check_ams_status_impl(); // Check whether the printer and ams status are consistent, for grouping algorithm
bool get_machine_sync_status(); // check whether the printer is linked and the printer type is same as selected profile
// BBS
bool init_collapse_toolbar();
@@ -8988,6 +8989,20 @@ bool Plater::priv::check_ams_status_impl()
return true;
}
bool Plater::priv::get_machine_sync_status()
{
Slic3r::DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
if (!dev)
return false;
MachineObject* obj = dev->get_selected_machine();
if (!obj)
return false;
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
return preset_bundle && preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle) == obj->printer_type;
}
bool Plater::priv::init_collapse_toolbar()
{
if (wxGetApp().is_gcode_viewer())
@@ -15824,6 +15839,11 @@ void Plater::update_machine_sync_status()
GUI::wxGetApp().sidebar().update_sync_status(obj);
}
bool Plater::get_machine_sync_status()
{
return p->get_machine_sync_status();
}
#if ENABLE_ENVIRONMENT_MAP
void Plater::init_environment_texture()
{