fix badge mark

This commit is contained in:
SoftFever
2026-01-30 16:14:41 +08:00
parent 01eed59ee2
commit 7059789578
2 changed files with 16 additions and 6 deletions

View File

@@ -1985,6 +1985,8 @@ Sidebar::Sidebar(Plater *parent)
}
{
// Orca: Sidebar - Filament titlebar UI
// add filament title
p->m_panel_filament_title = new StaticBox(p->scrolled, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_NONE);
p->m_panel_filament_title->SetBackgroundColor(title_bg);
@@ -2094,7 +2096,8 @@ Sidebar::Sidebar(Plater *parent)
//wxBoxSizer* bSizer_filament_content;
//bSizer_filament_content = new wxBoxSizer( wxHORIZONTAL );
// BBS: filament double columns
// Orca: Sidebar - Filament content UI: setup filament selection combos panel layout
// Creates a two-column grid layout for filament selection dropdowns within the scrollable panel
p->sizer_filaments = new wxBoxSizer(wxHORIZONTAL);
p->sizer_filaments->Add(new wxBoxSizer(wxVERTICAL), 1, wxEXPAND);
p->sizer_filaments->Add(new wxBoxSizer(wxVERTICAL), 1, wxEXPAND);
@@ -3501,6 +3504,14 @@ void Sidebar::sync_ams_list(bool is_from_big_sync_btn)
auto_calc_flushing_volumes(i);
}
}
Layout();
// Perform preset selection and list update first — these may rebuild combo widgets,
// which clears any badge state. Badges must be set AFTER these calls to persist.
wxGetApp().get_tab(Preset::TYPE_FILAMENT)->select_preset(wxGetApp().preset_bundle->filament_presets[0]);
wxGetApp().preset_bundle->export_selections(*wxGetApp().app_config);
update_dynamic_filament_list();
auto badge_combox_filament = [](PlaterPresetComboBox *c) {
auto tip = _L("Filament type and color information have been synchronized, but slot information is not included.");
c->SetToolTip(tip);
@@ -3567,11 +3578,6 @@ void Sidebar::sync_ams_list(bool is_from_big_sync_btn)
}
}
}
Layout();
wxGetApp().get_tab(Preset::TYPE_FILAMENT)->select_preset(wxGetApp().preset_bundle->filament_presets[0]);
wxGetApp().preset_bundle->export_selections(*wxGetApp().app_config);
update_dynamic_filament_list();
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "begin pop_finsish_sync_ams_dialog";
pop_finsish_sync_ams_dialog();
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "finish pop_finsish_sync_ams_dialog";

View File

@@ -580,6 +580,10 @@ void MoonrakerPrinterAgent::build_ams_payload(int ams_count, const std::vector<A
DevFilaSystemParser::ParseV1_0(print_json, obj, obj->GetFilaSystem(), false);
BOOST_LOG_TRIVIAL(info) << "MoonrakerPrinterAgent::build_ams_payload: Parsed " << trays.size() << " trays";
// Set printer_type so update_sync_status() can match it against the preset's printer type.
// Without this, the comparison fails and all sync badges are cleared.
obj->printer_type = device_info.model_id;
// Set push counters so is_info_ready() returns true for pull-mode agents.
if (obj->m_push_count == 0) {
obj->m_push_count = 1;