FIX: add warning tips when using precise_z_height with prime tower

jira: STUDIO-11208
Change-Id: I0fa704e1c4f645c3442cbd4b8476b6cdb98e837c
This commit is contained in:
zhimin.zeng 2025-04-10 15:47:54 +08:00 committed by lane.wei
parent ed7658ae9f
commit 64e7c5ac46
1 changed files with 25 additions and 0 deletions

View File

@ -1468,9 +1468,34 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
} }
wxGetApp().plater()->update(); wxGetApp().plater()->update();
} }
bool is_precise_z_height = m_config->option<ConfigOptionBool>("precise_z_height")->value;
if (boost::any_cast<bool>(value) && is_precise_z_height) {
MessageDialog dlg(wxGetApp().plater(), _L("Enabling both precise Z height and the prime tower may cause the size of prime tower to increase. Do you still want to enable?"),
_L("Warning"), wxICON_WARNING | wxYES | wxNO);
if (dlg.ShowModal() == wxID_NO) {
DynamicPrintConfig new_conf = *m_config;
new_conf.set_key_value("enable_prime_tower", new ConfigOptionBool(false));
m_config_manipulation.apply(m_config, &new_conf);
}
wxGetApp().plater()->update();
}
update_wiping_button_visibility(); update_wiping_button_visibility();
} }
if (opt_key == "precise_z_height") {
bool wipe_tower_enabled = m_config->option<ConfigOptionBool>("enable_prime_tower")->value;
if (boost::any_cast<bool>(value) && wipe_tower_enabled) {
MessageDialog dlg(wxGetApp().plater(), _L("Enabling both precise Z height and the prime tower may cause the size of prime tower to increase. Do you still want to enable?"),
_L("Warning"), wxICON_WARNING | wxYES | wxNO);
if (dlg.ShowModal() == wxID_NO) {
DynamicPrintConfig new_conf = *m_config;
new_conf.set_key_value("precise_z_height", new ConfigOptionBool(false));
m_config_manipulation.apply(m_config, &new_conf);
}
wxGetApp().plater()->update();
}
}
// reload scene to update timelapse wipe tower // reload scene to update timelapse wipe tower
if (opt_key == "timelapse_type") { if (opt_key == "timelapse_type") {
bool wipe_tower_enabled = m_config->option<ConfigOptionBool>("enable_prime_tower")->value; bool wipe_tower_enabled = m_config->option<ConfigOptionBool>("enable_prime_tower")->value;