Merge branch 'master' into fs_dir_per_glyph_SPE-1597

This commit is contained in:
Filip Sykala - NTB T15p 2023-07-11 21:35:58 +02:00
commit e927cf4d6c
3 changed files with 5 additions and 9 deletions

View File

@ -783,8 +783,8 @@ std::string CoolingBuffer::apply_layer_cooldown(
if (int(layer_id) >= disable_fan_first_layers && int(layer_id) + 1 < full_fan_speed_layer) { if (int(layer_id) >= disable_fan_first_layers && int(layer_id) + 1 < full_fan_speed_layer) {
// Ramp up the fan speed from disable_fan_first_layers to full_fan_speed_layer. // Ramp up the fan speed from disable_fan_first_layers to full_fan_speed_layer.
float factor = float(int(layer_id + 1) - disable_fan_first_layers) / float(full_fan_speed_layer - disable_fan_first_layers); float factor = float(int(layer_id + 1) - disable_fan_first_layers) / float(full_fan_speed_layer - disable_fan_first_layers);
fan_speed_new = std::clamp(int(float(fan_speed_new) * factor + 0.5f), 0, 255); fan_speed_new = std::clamp(int(float(fan_speed_new) * factor + 0.5f), 0, 100);
bridge_fan_speed = std::clamp(int(float(bridge_fan_speed) * factor + 0.5f), 0, 255); bridge_fan_speed = std::clamp(int(float(bridge_fan_speed) * factor + 0.5f), 0, 100);
custom_fan_speed_limits.second = fan_speed_new; custom_fan_speed_limits.second = fan_speed_new;
} }
#undef EXTRUDER_CONFIG #undef EXTRUDER_CONFIG

View File

@ -470,20 +470,16 @@ void ToolOrdering::fill_wipe_tower_partitions(const PrintConfig &config, coordf_
bool ToolOrdering::insert_wipe_tower_extruder() bool ToolOrdering::insert_wipe_tower_extruder()
{ {
// In case that wipe_tower_extruder is set to non-zero, we must make sure that the extruder will be in the list. // In case that wipe_tower_extruder is set to non-zero, we must make sure that the extruder will be in the list.
// The list is 1-based, as is the config value !
bool changed = false; bool changed = false;
if (m_print_config_ptr->wipe_tower_extruder != 0) { if (m_print_config_ptr->wipe_tower_extruder != 0) {
for (LayerTools& lt : m_layer_tools) { for (LayerTools& lt : m_layer_tools) {
if (lt.wipe_tower_partitions > 0) { if (lt.wipe_tower_partitions > 0) {
lt.extruders.emplace_back(m_print_config_ptr->wipe_tower_extruder - 1); lt.extruders.emplace_back(m_print_config_ptr->wipe_tower_extruder);
sort_remove_duplicates(lt.extruders); sort_remove_duplicates(lt.extruders);
changed = true; changed = true;
} }
} }
// Now convert the 0-based list to 1-based again.
for (LayerTools& lt : m_layer_tools) {
for (auto& extruder : lt.extruders)
++extruder;
}
} }
return changed; return changed;
} }

View File

@ -283,7 +283,7 @@ void ObjectLayers::sys_color_changed()
if (item->IsSizer()) {// case when we have editor with buttons if (item->IsSizer()) {// case when we have editor with buttons
for (size_t btn : {2, 3}) { // del_btn, add_btn for (size_t btn : {2, 3}) { // del_btn, add_btn
wxSizerItem* b_item = item->GetSizer()->GetItem(btn); wxSizerItem* b_item = item->GetSizer()->GetItem(btn);
if (b_item->IsWindow()) { if (b_item && b_item->IsWindow()) {
auto button = dynamic_cast<PlusMinusButton*>(b_item->GetWindow()); auto button = dynamic_cast<PlusMinusButton*>(b_item->GetWindow());
if (button != nullptr) if (button != nullptr)
button->sys_color_changed(); button->sys_color_changed();