mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Merge remote-tracking branch 'origin/ys_bf_updating'
This commit is contained in:
commit
a1fdbf213c
6 changed files with 96 additions and 28 deletions
|
@ -669,7 +669,6 @@ void Tab::load_config(const DynamicPrintConfig& config)
|
|||
bool modified = 0;
|
||||
for(auto opt_key : m_config->diff(config)) {
|
||||
m_config->set_key_value(opt_key, config.option(opt_key)->clone());
|
||||
m_dirty_options.emplace(opt_key);
|
||||
modified = 1;
|
||||
}
|
||||
if (modified) {
|
||||
|
@ -752,8 +751,6 @@ void Tab::load_key_value(const std::string& opt_key, const boost::any& value, bo
|
|||
|
||||
void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
||||
{
|
||||
m_dirty_options.erase(opt_key);
|
||||
|
||||
ConfigOptionsGroup* og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params(supports_printer_technology(ptFFF));
|
||||
if (opt_key == "fill_density" || opt_key == "supports_enable" || opt_key == "pad_enable")
|
||||
{
|
||||
|
@ -778,22 +775,29 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
|||
if (opt_key == "wipe_tower" || opt_key == "single_extruder_multi_material" || opt_key == "extruders_count" )
|
||||
update_wiping_button_visibility();
|
||||
|
||||
if (opt_key == "extruders_count")
|
||||
wxGetApp().plater()->on_extruders_change(boost::any_cast<size_t>(value));
|
||||
|
||||
update();
|
||||
|
||||
// #ys_FIXME_to_delete
|
||||
// Post event to the Plater after updating of the all dirty options
|
||||
// It helps to avoid needless schedule_background_processing
|
||||
if (update_completed()) {
|
||||
wxCommandEvent event(EVT_TAB_VALUE_CHANGED);
|
||||
event.SetEventObject(this);
|
||||
event.SetString(opt_key);
|
||||
if (opt_key == "extruders_count")
|
||||
{
|
||||
const int val = boost::any_cast<size_t>(value);
|
||||
event.SetInt(val);
|
||||
}
|
||||
|
||||
wxPostEvent(this, event);
|
||||
}
|
||||
// if (update_completed())
|
||||
// if (m_update_stack.empty())
|
||||
// {
|
||||
// // wxCommandEvent event(EVT_TAB_VALUE_CHANGED);
|
||||
// // event.SetEventObject(this);
|
||||
// // event.SetString(opt_key);
|
||||
// // if (opt_key == "extruders_count")
|
||||
// // {
|
||||
// // const int val = boost::any_cast<size_t>(value);
|
||||
// // event.SetInt(val);
|
||||
// // }
|
||||
// //
|
||||
// // wxPostEvent(this, event);
|
||||
// wxGetApp().mainframe->on_value_changed(m_config);
|
||||
// }
|
||||
}
|
||||
|
||||
// Show/hide the 'purging volumes' button
|
||||
|
@ -826,10 +830,18 @@ void Tab::on_presets_changed()
|
|||
// refresh the print or filament/sla_material tab page.
|
||||
wxGetApp().get_tab(t)->load_current_preset();
|
||||
}
|
||||
// clear m_dependent_tabs after first update from select_preset()
|
||||
// to avoid needless preset loading from update() function
|
||||
m_dependent_tabs.clear();
|
||||
|
||||
// #ys_FIXME_to_delete
|
||||
// wxCommandEvent event(EVT_TAB_PRESETS_CHANGED);
|
||||
// event.SetEventObject(this);
|
||||
// wxPostEvent(this, event);
|
||||
|
||||
// Instead of PostEvent (EVT_TAB_PRESETS_CHANGED) just call update_presets
|
||||
wxGetApp().plater()->sidebar().update_presets(m_type);
|
||||
|
||||
wxCommandEvent event(EVT_TAB_PRESETS_CHANGED);
|
||||
event.SetEventObject(this);
|
||||
wxPostEvent(this, event);
|
||||
update_preset_description_line();
|
||||
}
|
||||
|
||||
|
@ -1166,6 +1178,7 @@ void TabPrint::update()
|
|||
if (m_preset_bundle->printers.get_selected_preset().printer_technology() == ptSLA)
|
||||
return; // ys_FIXME
|
||||
|
||||
// #ys_FIXME_to_delete
|
||||
//! Temporary workaround for the correct updates of the SpinCtrl (like "perimeters"):
|
||||
// KillFocus() for the wxSpinCtrl use CallAfter function. So,
|
||||
// to except the duplicate call of the update() after dialog->ShowModal(),
|
||||
|
@ -1173,6 +1186,7 @@ void TabPrint::update()
|
|||
// if (is_msg_dlg_already_exist) // ! It looks like a fixed problem after start to using of a m_dirty_options
|
||||
// return; // ! TODO Let delete this part of code after a common aplication testing
|
||||
|
||||
m_update_cnt++;
|
||||
Freeze();
|
||||
|
||||
double fill_density = m_config->option<ConfigOptionPercent>("fill_density")->value;
|
||||
|
@ -1385,6 +1399,10 @@ void TabPrint::update()
|
|||
from_u8(PresetHints::recommended_thin_wall_thickness(*m_preset_bundle)));
|
||||
|
||||
Thaw();
|
||||
m_update_cnt--;
|
||||
|
||||
if (m_update_cnt==0)
|
||||
wxGetApp().mainframe->on_config_changed(m_config);
|
||||
}
|
||||
|
||||
void TabPrint::OnActivate()
|
||||
|
@ -1554,6 +1572,7 @@ void TabFilament::update()
|
|||
if (m_preset_bundle->printers.get_selected_preset().printer_technology() == ptSLA)
|
||||
return; // ys_FIXME
|
||||
|
||||
m_update_cnt++;
|
||||
Freeze();
|
||||
wxString text = from_u8(PresetHints::cooling_description(m_presets->get_edited_preset()));
|
||||
m_cooling_description_line->SetText(text);
|
||||
|
@ -1568,7 +1587,11 @@ void TabFilament::update()
|
|||
|
||||
for (auto el : { "min_fan_speed", "disable_fan_first_layers" })
|
||||
get_field(el)->toggle(fan_always_on);
|
||||
Thaw();
|
||||
Thaw();
|
||||
m_update_cnt--;
|
||||
|
||||
if (m_update_cnt == 0)
|
||||
wxGetApp().mainframe->on_config_changed(m_config);
|
||||
}
|
||||
|
||||
void TabFilament::OnActivate()
|
||||
|
@ -2242,7 +2265,12 @@ void TabPrinter::update_pages()
|
|||
|
||||
void TabPrinter::update()
|
||||
{
|
||||
m_update_cnt++;
|
||||
m_presets->get_edited_preset().printer_technology() == ptFFF ? update_fff() : update_sla();
|
||||
m_update_cnt--;
|
||||
|
||||
if (m_update_cnt == 0)
|
||||
wxGetApp().mainframe->on_config_changed(m_config);
|
||||
}
|
||||
|
||||
void TabPrinter::update_fff()
|
||||
|
@ -3207,6 +3235,14 @@ void TabSLAMaterial::update()
|
|||
{
|
||||
if (m_preset_bundle->printers.get_selected_preset().printer_technology() == ptFFF)
|
||||
return; // #ys_FIXME
|
||||
|
||||
// #ys_FIXME
|
||||
// m_update_cnt++;
|
||||
// ! something to update
|
||||
// m_update_cnt--;
|
||||
//
|
||||
// if (m_update_cnt == 0)
|
||||
wxGetApp().mainframe->on_config_changed(m_config);
|
||||
}
|
||||
|
||||
void TabSLAPrint::build()
|
||||
|
@ -3291,6 +3327,14 @@ void TabSLAPrint::update()
|
|||
{
|
||||
if (m_preset_bundle->printers.get_selected_preset().printer_technology() == ptFFF)
|
||||
return; // #ys_FIXME
|
||||
|
||||
// #ys_FIXME
|
||||
// m_update_cnt++;
|
||||
// ! something to update
|
||||
// m_update_cnt--;
|
||||
//
|
||||
// if (m_update_cnt == 0)
|
||||
wxGetApp().mainframe->on_config_changed(m_config);
|
||||
}
|
||||
|
||||
} // GUI
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue