mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-02 21:10:29 -07:00
FIX: wrong filament map in plate params
1.Always clear filament map when global map mode change if plate filament map mode is default jira:NONE Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: I38055b7c77668fdb211f6b459be1044d8d3c8f8c (cherry picked from commit b492ab13a28b25599da9668d84447be260cbbc34) (cherry picked from commit 48c45e06a571decf9cfe460cd680bfad75ace3fe)
This commit is contained in:
parent
439761f71e
commit
c0cda458e5
5 changed files with 32 additions and 7 deletions
|
|
@ -1620,9 +1620,12 @@ wxBoxSizer* MainFrame::create_side_tools()
|
|||
}
|
||||
|
||||
if (slice) {
|
||||
if (m_plater->get_global_filament_map_mode() != g_filament_map_mode)
|
||||
m_plater->on_filament_map_mode_change();
|
||||
m_plater->set_global_filament_map_mode(g_filament_map_mode);
|
||||
if (g_filament_map_mode == FilamentMapMode::fmmManual)
|
||||
m_plater->set_global_filament_map(g_filament_map);
|
||||
|
||||
if (m_slice_select == eSliceAll)
|
||||
wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_SLICE_ALL));
|
||||
else
|
||||
|
|
|
|||
|
|
@ -3271,12 +3271,17 @@ void PartPlate::set_filament_maps(const std::vector<int>& f_maps)
|
|||
m_config.option<ConfigOptionInts>("filament_map", true)->values = f_maps;
|
||||
}
|
||||
|
||||
void PartPlate::clear_filament_map_info()
|
||||
void PartPlate::clear_filament_map()
|
||||
{
|
||||
if (m_config.has("filament_map"))
|
||||
m_config.erase("filament_map");
|
||||
}
|
||||
|
||||
void PartPlate::clear_filament_map_mode()
|
||||
{
|
||||
if (m_config.has("filament_map_mode"))
|
||||
m_config.erase("filament_map_mode");
|
||||
|
||||
}
|
||||
|
||||
const std::vector<std::vector<int>>& PartPlate::get_unprintable_filament_ids()
|
||||
|
|
@ -3295,7 +3300,8 @@ void PartPlate::on_extruder_count_changed(int extruder_count)
|
|||
{
|
||||
if (extruder_count < 2) {
|
||||
// clear filament map and mode in single extruder mode
|
||||
clear_filament_map_info();
|
||||
clear_filament_map();
|
||||
clear_filament_map_mode();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -255,8 +255,8 @@ public:
|
|||
std::vector<int> get_filament_maps() const;
|
||||
void set_filament_maps(const std::vector<int>& f_maps);
|
||||
|
||||
// remove filament map and map mode in profiles
|
||||
void clear_filament_map_info();
|
||||
void clear_filament_map();
|
||||
void clear_filament_map_mode();
|
||||
|
||||
bool has_spiral_mode_config() const;
|
||||
bool get_spiral_vase_mode() const;
|
||||
|
|
|
|||
|
|
@ -14561,6 +14561,17 @@ FilamentMapMode Plater::get_global_filament_map_mode() const
|
|||
return project_config.option<ConfigOptionEnum<FilamentMapMode>>("filament_map_mode")->value;
|
||||
}
|
||||
|
||||
void Plater::on_filament_map_mode_change()
|
||||
{
|
||||
auto& plate_list = this->get_partplate_list();
|
||||
int plate_count = plate_list.get_plate_count();
|
||||
for (int idx = 0; idx < plate_count; ++idx) {
|
||||
auto plate=plate_list.get_plate(idx);
|
||||
auto plate_map_mode = plate->get_filament_map_mode();
|
||||
if (plate_map_mode == fmmDefault)
|
||||
plate->clear_filament_map();
|
||||
}
|
||||
}
|
||||
|
||||
wxWindow* Plater::get_select_machine_dialog()
|
||||
{
|
||||
|
|
@ -15374,14 +15385,18 @@ void Plater::open_filament_map_setting_dialog(wxCommandEvent &evt)
|
|||
bool need_invalidate = (old_map_mode != new_map_mode ||
|
||||
old_filament_maps != new_filament_maps);
|
||||
|
||||
if (old_map_mode != new_map_mode)
|
||||
if (old_map_mode != new_map_mode) {
|
||||
curr_plate->set_filament_map_mode(new_map_mode);
|
||||
curr_plate->clear_filament_map();
|
||||
}
|
||||
|
||||
if (old_filament_maps != new_filament_maps && new_map_mode==fmmManual)
|
||||
curr_plate->set_filament_maps(new_filament_maps);
|
||||
|
||||
if (new_map_mode == fmmDefault)
|
||||
curr_plate->clear_filament_map_info();
|
||||
if (new_map_mode == fmmDefault) {
|
||||
curr_plate->clear_filament_map();
|
||||
curr_plate->clear_filament_map_mode();
|
||||
}
|
||||
|
||||
if (need_invalidate) {
|
||||
if (need_slice) {
|
||||
|
|
|
|||
|
|
@ -509,6 +509,7 @@ public:
|
|||
void set_global_filament_map(const std::vector<int>& filament_map);
|
||||
std::vector<int> get_global_filament_map() const;
|
||||
FilamentMapMode get_global_filament_map_mode() const;
|
||||
void on_filament_map_mode_change();
|
||||
|
||||
void update_menus();
|
||||
// BBS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue