mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-17 14:02:35 +00:00
* fix(GUI): honor "Ignore" when layer height exceeds the configured maximum Entering a layer height above the printer's max_layer_height on the Print Settings tab fired two guards in sequence. Tab::on_value_change prompts "...Adjust to the set range automatically?" with an Adjust/Ignore choice, and ConfigManipulation::update_print_fff_config then showed an OK-only "Too large layer height. Reset to X" dialog whose result was never checked, so it always reset the value. The second guard overrode the user's "Ignore", resetting the layer height regardless. Changes: - Extract the shared Adjust/Ignore dialog into ConfigManipulation::layer_height_out_of_range_dialog, reused by the tab (Tab::on_value_change) and the per-object/part settings panels. The dialog now names the value it will clamp to and reads correctly for too-low as well as too-high. - The tab/plate path is already covered by Tab::on_value_change, so the duplicate reset is dropped from update_print_fff_config. - The per-object/part panels have no on_value_change hook, so add ConfigManipulation::check_object_layer_height and call it from the object settings update paths, gated on the edited option (changed_opt_key == "layer_height"). It prompts once per layer-height edit and does not re-prompt when unrelated object settings change after the user chose "Ignore". Fixes #14214 * refactor(GUI): unify the layer-height range check across tab and object panels Copilot review of #14369 noted that the per-object check only guarded the max at extruder 0 and skipped the too-low case, diverging from the tab. Move the whole range check into ConfigManipulation::check_layer_height, used by both Tab::on_value_change and the per-object/part panels. It takes the widest [min, max] window across the printer's extruders, offers Adjust/Ignore in both directions, and resets a near-zero value. The tab's inline block collapses to one call, dropping the duplicated limit logic. * fix(GUI): only enforce layer-height limits that are actually set max_layer_height defaults to 0 (unset), so the unconditional range check offered to clamp any layer height to 0 on presets that don't define it. Guard each branch (near-zero, too-high, too-low) so an unset limit disables that direction; the slice-time nozzle-diameter check still applies. Also run check_layer_height before update_print_fff_config in the object panels so a near-zero per-object value prompts the same way the tab does, with update_print_fff_config's fallback still covering the no-minimum case.
78 lines
2.0 KiB
C++
78 lines
2.0 KiB
C++
#ifndef slic3r_GUI_ObjectSettings_hpp_
|
|
#define slic3r_GUI_ObjectSettings_hpp_
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
#include <wx/panel.h>
|
|
#include "wxExtensions.hpp"
|
|
|
|
#define NEW_OBJECT_SETTING 1
|
|
|
|
class wxBoxSizer;
|
|
|
|
namespace Slic3r {
|
|
class DynamicPrintConfig;
|
|
class ModelConfig;
|
|
namespace GUI {
|
|
class ConfigOptionsGroup;
|
|
|
|
class OG_Settings
|
|
{
|
|
protected:
|
|
std::shared_ptr<ConfigOptionsGroup> m_og;
|
|
wxWindow* m_parent;
|
|
public:
|
|
OG_Settings(wxWindow* parent, const bool staticbox);
|
|
virtual ~OG_Settings() {}
|
|
|
|
virtual bool IsShown();
|
|
virtual void Show(const bool show);
|
|
virtual void Hide();
|
|
virtual void UpdateAndShow(const bool show);
|
|
|
|
virtual wxSizer* get_sizer();
|
|
ConfigOptionsGroup* get_og() { return m_og.get(); }
|
|
wxWindow* parent() const {return m_parent; }
|
|
};
|
|
|
|
class TabPrintModel;
|
|
|
|
#if !NEW_OBJECT_SETTING
|
|
class ObjectSettings : public OG_Settings
|
|
#else
|
|
class ObjectSettings
|
|
#endif
|
|
{
|
|
// sizer for extra Object/Part's settings
|
|
#if !NEW_OBJECT_SETTING
|
|
wxBoxSizer* m_settings_list_sizer{ nullptr };
|
|
// option groups for settings
|
|
std::vector <std::shared_ptr<ConfigOptionsGroup>> m_og_settings;
|
|
|
|
ScalableBitmap m_bmp_delete;
|
|
ScalableBitmap m_bmp_delete_focus;
|
|
#else
|
|
wxWindow* m_parent;
|
|
TabPrintModel * m_tab_active;
|
|
#endif
|
|
|
|
public:
|
|
ObjectSettings(wxWindow* parent);
|
|
~ObjectSettings() {}
|
|
|
|
bool update_settings_list();
|
|
/* Additional check for override options: Add options, if its needed.
|
|
* Example: if Infill is set to 100%, and Fill Pattern is missed in config_to,
|
|
* we should add sparse_infill_pattern to avoid endless loop in update
|
|
*/
|
|
bool add_missed_options(ModelConfig *config_to, const DynamicPrintConfig &config_from);
|
|
void update_config_values(ModelConfig *config, const std::string& changed_opt_key = "");
|
|
void UpdateAndShow(const bool show);
|
|
void msw_rescale();
|
|
void sys_color_changed();
|
|
};
|
|
|
|
}}
|
|
|
|
#endif // slic3r_GUI_ObjectSettings_hpp_
|