mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-22 21:27:02 -07:00
FIX: cali: fix the 3mf wrong issue when cali for multi-extruder
jira: no-jira Change-Id: I352e4dd499f4e4dd22cdc21f3f62428a0baa5bfb (cherry picked from commit f9cd3dd8764ab551c2aa85cdb7383b19bc345f36)
This commit is contained in:
parent
592734dbf7
commit
a2c6ea7d15
4 changed files with 73 additions and 9 deletions
|
|
@ -2113,7 +2113,7 @@ void CalibrationPresetPage::select_default_compatible_filament()
|
|||
Layout();
|
||||
}
|
||||
else {
|
||||
assert(false);
|
||||
//assert(false);
|
||||
}
|
||||
|
||||
check_filament_compatible();
|
||||
|
|
@ -2169,7 +2169,7 @@ std::vector<FilamentComboBox*> CalibrationPresetPage::get_selected_filament_comb
|
|||
}
|
||||
}
|
||||
} else {
|
||||
assert(false);
|
||||
//assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6379,17 +6379,20 @@ void GLCanvas3D::render_thumbnail_framebuffer_ext(ThumbnailData& thumbnail_data,
|
|||
// glsafe(::glDisable(GL_MULTISAMPLE));
|
||||
}
|
||||
|
||||
void GLCanvas3D::render_thumbnail_legacy(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, const ThumbnailsParams& thumbnail_params, PartPlateList &partplate_list, ModelObjectPtrs& model_objects, const GLVolumeCollection& volumes, std::vector<ColorRGBA>& extruder_colors, GLShaderProgram* shader, Camera::EType camera_type)
|
||||
void GLCanvas3D::render_thumbnail_legacy(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, const ThumbnailsParams& thumbnail_params, PartPlateList &partplate_list, ModelObjectPtrs& model_objects, const GLVolumeCollection& volumes, std::vector<ColorRGBA>& extruder_colors, GLShaderProgram* shader, Camera::EType camera_type,
|
||||
bool use_top_view,
|
||||
bool for_picking,
|
||||
bool ban_light)
|
||||
{
|
||||
// check that thumbnail size does not exceed the default framebuffer size
|
||||
const Size& cnv_size = get_canvas_size();
|
||||
/*const Size& cnv_size = get_canvas_size();
|
||||
unsigned int cnv_w = (unsigned int)cnv_size.get_width();
|
||||
unsigned int cnv_h = (unsigned int)cnv_size.get_height();
|
||||
if (w > cnv_w || h > cnv_h) {
|
||||
float ratio = std::min((float)cnv_w / (float)w, (float)cnv_h / (float)h);
|
||||
w = (unsigned int)(ratio * (float)w);
|
||||
h = (unsigned int)(ratio * (float)h);
|
||||
}
|
||||
}*/
|
||||
|
||||
thumbnail_data.set(w, h);
|
||||
if (!thumbnail_data.is_valid())
|
||||
|
|
|
|||
|
|
@ -911,6 +911,21 @@ public:
|
|||
PartPlateList& partplate_list, ModelObjectPtrs& model_objects, const GLVolumeCollection& volumes, std::vector<ColorRGBA>& extruder_colors,
|
||||
GLShaderProgram* shader, Camera::EType camera_type, bool use_top_view = false, bool for_picking = false, bool ban_light = false);
|
||||
|
||||
// render thumbnail using the default framebuffer
|
||||
static void render_thumbnail_legacy(ThumbnailData & thumbnail_data,
|
||||
unsigned int w,
|
||||
unsigned int h,
|
||||
const ThumbnailsParams & thumbnail_params,
|
||||
PartPlateList & partplate_list,
|
||||
ModelObjectPtrs & model_objects,
|
||||
const GLVolumeCollection & volumes,
|
||||
std::vector<ColorRGBA> & extruder_colors,
|
||||
GLShaderProgram * shader,
|
||||
Camera::EType camera_type,
|
||||
bool use_top_view = false,
|
||||
bool for_picking = false,
|
||||
bool ban_light = false);
|
||||
|
||||
//BBS use gcoder viewer render calibration thumbnails
|
||||
void render_calibration_thumbnail(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, const ThumbnailsParams& thumbnail_params);
|
||||
|
||||
|
|
@ -1210,8 +1225,6 @@ private:
|
|||
bool _render_orient_menu(float left, float right, float bottom, float top);
|
||||
bool _render_arrange_menu(float left, float right, float bottom, float top);
|
||||
void _render_3d_navigator();
|
||||
// render thumbnail using the default framebuffer
|
||||
void render_thumbnail_legacy(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, const ThumbnailsParams& thumbnail_params, PartPlateList& partplate_list, ModelObjectPtrs& model_objects, const GLVolumeCollection& volumes, std::vector<ColorRGBA>& extruder_colors, GLShaderProgram* shader, Camera::EType camera_type);
|
||||
|
||||
void _update_volumes_hover_state();
|
||||
|
||||
|
|
|
|||
|
|
@ -218,6 +218,40 @@ static bool check_nozzle_diameter_and_type(const DynamicPrintConfig &full_config
|
|||
return true;
|
||||
}
|
||||
|
||||
static void init_multi_extruder_params_for_cali(DynamicPrintConfig& config, const CalibInfo& calib_info)
|
||||
{
|
||||
int extruder_count = 1;
|
||||
auto nozzle_diameters_opt = dynamic_cast<const ConfigOptionFloatsNullable*>(config.option("nozzle_diameter"));
|
||||
if (nozzle_diameters_opt != nullptr) {
|
||||
extruder_count = (int)(nozzle_diameters_opt->size());
|
||||
}
|
||||
std::vector<int>& nozzle_volume_types = dynamic_cast<ConfigOptionEnumsGeneric*>(config.option("nozzle_volume_type", true))->values;
|
||||
nozzle_volume_types.clear();
|
||||
nozzle_volume_types.resize(extruder_count, (int)calib_info.nozzle_volume_type);
|
||||
|
||||
std::vector<int> physical_extruder_maps = dynamic_cast<ConfigOptionInts*>(config.option("physical_extruder_map", true))->values;
|
||||
int extruder_id = calib_info.extruder_id;
|
||||
for (size_t index = 0; index < extruder_count; ++index) {
|
||||
if (physical_extruder_maps[index] == extruder_id)
|
||||
{
|
||||
extruder_id = index + 1;
|
||||
}
|
||||
}
|
||||
|
||||
int num_filaments = 1;
|
||||
auto filament_colour_opt = dynamic_cast<const ConfigOptionStrings*>(config.option("filament_colour"));
|
||||
if (filament_colour_opt != nullptr) {
|
||||
num_filaments = (int)(filament_colour_opt->size());
|
||||
}
|
||||
std::vector<int>& filament_maps = config.option<ConfigOptionInts>("filament_map", true)->values;
|
||||
filament_maps.clear();
|
||||
filament_maps.resize(num_filaments, extruder_id);
|
||||
|
||||
config.option<ConfigOptionEnum<FilamentMapMode>>("filament_map_mode", true)->value = FilamentMapMode::fmmManual;
|
||||
|
||||
}
|
||||
|
||||
|
||||
CalibMode CalibUtils::get_calib_mode_by_name(const std::string name, int& cali_stage)
|
||||
{
|
||||
if (name == "pa_line_calib_mode") {
|
||||
|
|
@ -615,6 +649,8 @@ bool CalibUtils::calib_flowrate(int pass, const CalibInfo &calib_info, wxString
|
|||
full_config.apply(filament_config);
|
||||
full_config.apply(printer_config);
|
||||
|
||||
init_multi_extruder_params_for_cali(full_config, calib_info);
|
||||
|
||||
Calib_Params params;
|
||||
params.mode = CalibMode::Calib_Flow_Rate;
|
||||
if (!process_and_store_3mf(&model, full_config, params, error_message))
|
||||
|
|
@ -722,6 +758,8 @@ bool CalibUtils::calib_generic_PA(const CalibInfo &calib_info, wxString &error_m
|
|||
full_config.apply(filament_config);
|
||||
full_config.apply(printer_config);
|
||||
|
||||
init_multi_extruder_params_for_cali(full_config, calib_info);
|
||||
|
||||
if (!process_and_store_3mf(&model, full_config, params, error_message))
|
||||
return false;
|
||||
|
||||
|
|
@ -795,6 +833,8 @@ void CalibUtils::calib_temptue(const CalibInfo &calib_info, wxString &error_mess
|
|||
full_config.apply(filament_config);
|
||||
full_config.apply(printer_config);
|
||||
|
||||
init_multi_extruder_params_for_cali(full_config, calib_info);
|
||||
|
||||
process_and_store_3mf(&model, full_config, params, error_message);
|
||||
if (!error_message.empty())
|
||||
return;
|
||||
|
|
@ -871,6 +911,8 @@ void CalibUtils::calib_max_vol_speed(const CalibInfo &calib_info, wxString &erro
|
|||
full_config.apply(filament_config);
|
||||
full_config.apply(printer_config);
|
||||
|
||||
init_multi_extruder_params_for_cali(full_config, calib_info);
|
||||
|
||||
process_and_store_3mf(&model, full_config, new_params, error_message);
|
||||
if (!error_message.empty())
|
||||
return;
|
||||
|
|
@ -928,6 +970,8 @@ void CalibUtils::calib_VFA(const CalibInfo &calib_info, wxString &error_message)
|
|||
full_config.apply(filament_config);
|
||||
full_config.apply(printer_config);
|
||||
|
||||
init_multi_extruder_params_for_cali(full_config, calib_info);
|
||||
|
||||
process_and_store_3mf(&model, full_config, params, error_message);
|
||||
if (!error_message.empty())
|
||||
return;
|
||||
|
|
@ -979,6 +1023,8 @@ void CalibUtils::calib_retraction(const CalibInfo &calib_info, wxString &error_m
|
|||
full_config.apply(filament_config);
|
||||
full_config.apply(printer_config);
|
||||
|
||||
init_multi_extruder_params_for_cali(full_config, calib_info);
|
||||
|
||||
process_and_store_3mf(&model, full_config, params, error_message);
|
||||
if (!error_message.empty())
|
||||
return;
|
||||
|
|
@ -1146,9 +1192,11 @@ bool CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &f
|
|||
partplate_list, model->objects, glvolume_collection, colors_out, shader, Slic3r::GUI::Camera::EType::Ortho);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("framebuffer_type: unknown");
|
||||
default:{
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(": framebuffer_type: others");
|
||||
Slic3r::GUI::GLCanvas3D::render_thumbnail_legacy(*thumbnail_data, thumbnail_width, thumbnail_height, thumbnail_params, partplate_list, model->objects, glvolume_collection, colors_out, shader, Slic3r::GUI::Camera::EType::Ortho);
|
||||
break;
|
||||
}
|
||||
}
|
||||
thumbnails.push_back(thumbnail_data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue