From ee33a0918c1f1e1b1b655f78ec81842fc73a237e Mon Sep 17 00:00:00 2001 From: remi durand Date: Wed, 17 Mar 2021 15:35:03 +0100 Subject: [PATCH] #1007 fix temperature calibration --- src/slic3r/GUI/CalibrationTempDialog.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/CalibrationTempDialog.cpp b/src/slic3r/GUI/CalibrationTempDialog.cpp index eb0cf84da..e485e8270 100644 --- a/src/slic3r/GUI/CalibrationTempDialog.cpp +++ b/src/slic3r/GUI/CalibrationTempDialog.cpp @@ -102,10 +102,10 @@ void CalibrationTempDialog::create_geometry(wxCommandEvent& event_args) { } for (int16_t i = 1; i < nb_items; i++) { tower.push_back(add_part(model.objects[objs_idx[0]], Slic3r::resources_dir()+"/calibration/filament_temp/Smart_compact_temperature_calibration_item.amf", - Vec3d{ 0,0, zshift + i * 10 * xyzScale }, Vec3d{ xyzScale, xyzScale * 0.5, xyzScale })); + Vec3d{ 0,0, i * 10 * xyzScale }, Vec3d{ xyzScale, xyzScale * 0.5, xyzScale })); if (temperature - i * step_temp > 175 && temperature - i * step_temp < 290) { tower.push_back(add_part(model.objects[objs_idx[0]], Slic3r::resources_dir()+"/calibration/filament_temp/t" + std::to_string(temperature - i * step_temp) + ".amf", - Vec3d{ xyzScale * 5, -xyzScale * 2.5, zshift + xyzScale * (i * 10 - 2.5) }, Vec3d{ xyzScale, xyzScale, xyzScale * 0.43 })); + Vec3d{ xyzScale * 5, -xyzScale * 2.5, xyzScale * (i * 10 - 2.5) }, Vec3d{ xyzScale, xyzScale, xyzScale * 0.43 })); } } @@ -126,7 +126,9 @@ void CalibrationTempDialog::create_geometry(wxCommandEvent& event_args) { /// -- generate the heat change gcode //std::string str_layer_gcode = "{if layer_num > 0 and layer_z <= " + std::to_string(2 * xyzScale) + "}\nM104 S" + std::to_string(temperature - (int8_t)nb_delta * 5); // double print_z, std::string gcode,int extruder, std::string color - model.custom_gcode_per_print_z.gcodes.emplace_back(CustomGCode::Item{ nozzle_diameter, CustomGCode::Type::Custom, -1, "", "M104 S" + std::to_string(temperature) + " ; ground floor temp tower set" }); + double firstChangeHeight = print_config->get_abs_value("first_layer_height", nozzle_diameter); + //model.custom_gcode_per_print_z.gcodes.emplace_back(CustomGCode::Item{ firstChangeHeight + nozzle_diameter/2, CustomGCode::Type::Custom, -1, "", "M104 S" + std::to_string(temperature) + " ; ground floor temp tower set" }); + model.objects[objs_idx[0]]->config.set_key_value("print_temperature", new ConfigOptionInt(temperature)); for (int16_t i = 1; i < nb_items; i++) { model.custom_gcode_per_print_z.gcodes.emplace_back(CustomGCode::Item{ (i * 10 * xyzScale), CustomGCode::Type::Custom , -1, "", "M104 S" + std::to_string(temperature - i * step_temp) + " ; floor " + std::to_string(i) + " of the temp tower set" }); //str_layer_gcode += "\n{ elsif layer_z >= " + std::to_string(i * 10 * xyzScale) + " and layer_z <= " + std::to_string((1 + i * 10) * xyzScale) + " }\nM104 S" + std::to_string(temperature - (int8_t)nb_delta * 5 + i * 5);