This commit is contained in:
SoftFever
2026-01-23 17:05:56 +08:00
parent 12f51f906e
commit 9703a6b4d7
60 changed files with 13396 additions and 1785 deletions

View File

@@ -2099,6 +2099,11 @@ void Tab::on_presets_changed()
// Instead of PostEvent (EVT_TAB_PRESETS_CHANGED) just call update_presets
wxGetApp().plater()->sidebar().update_presets(m_type);
// Check if printer agent needs switching
if (m_type == Preset::TYPE_PRINTER) {
update_printer_agent_if_needed();
}
bool is_bbl_vendor_preset = m_preset_bundle->is_bbl_vendor();
if (is_bbl_vendor_preset) {
wxGetApp().plater()->get_partplate_list().set_render_option(true, true);
@@ -2129,6 +2134,28 @@ void Tab::on_presets_changed()
wxGetApp().plater()->update_project_dirty_from_presets();
}
void Tab::update_printer_agent_if_needed()
{
std::string agent_id = "orca";
if (m_preset_bundle) {
if (wxGetApp().preset_bundle->is_bbl_vendor()) {
agent_id = "bbl";
} else if (wxGetApp().preset_bundle->is_qidi_vendor()) {
agent_id = "qidi";
}
}
const DynamicPrintConfig& config = m_preset_bundle->printers.get_edited_preset().config;
if (config.has("printer_agent")) {
std::string value = config.option<ConfigOptionString>("printer_agent")->value;
if (!value.empty()) {
agent_id = value;
}
}
// Switch agent in GUI_App
wxGetApp().switch_printer_agent(agent_id);
}
void Tab::build_preset_description_line(ConfigOptionsGroup* optgroup)
{
auto description_line = [this](wxWindow* parent) {