diff --git a/resources/profiles/Anycubic.json b/resources/profiles/Anycubic.json index 3cc1a327e6..fbf6502645 100644 --- a/resources/profiles/Anycubic.json +++ b/resources/profiles/Anycubic.json @@ -1,6 +1,6 @@ { "name": "Anycubic", - "version": "01.02.00.01", + "version": "01.02.00.02", "force_update": "0", "description": "Anycubic configurations", "machine_model_list": [ diff --git a/resources/profiles/Anycubic/machine/fdm_machine_common.json b/resources/profiles/Anycubic/machine/fdm_machine_common.json index a6f78e6f0c..8680aa36fb 100644 --- a/resources/profiles/Anycubic/machine/fdm_machine_common.json +++ b/resources/profiles/Anycubic/machine/fdm_machine_common.json @@ -129,6 +129,7 @@ "silent_mode": "0", "single_extruder_multi_material": "1", "change_filament_gcode": "", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n", "layer_change_gcode": "", "machine_pause_gcode": "M400 U1\n", "wipe": [ diff --git a/resources/profiles/Voron.json b/resources/profiles/Voron.json index 4e45baa9ff..a6d5ba4d8b 100644 --- a/resources/profiles/Voron.json +++ b/resources/profiles/Voron.json @@ -1,6 +1,6 @@ { "name": "Voron", - "version": "01.02.00.02", + "version": "01.02.00.03", "force_update": "0", "description": "Voron configurations", "machine_model_list": [ diff --git a/resources/profiles/Voron/machine/fdm_klipper_common.json b/resources/profiles/Voron/machine/fdm_klipper_common.json index d95df5e055..e94e73b9e6 100644 --- a/resources/profiles/Voron/machine/fdm_klipper_common.json +++ b/resources/profiles/Voron/machine/fdm_klipper_common.json @@ -133,6 +133,7 @@ "machine_start_gcode": "M190 S0\nM104 S0\nPRINT_START EXTRUDER=[nozzle_temperature_initial_layer] BED=[bed_temperature_initial_layer_single]\n; You can use following code instead if your PRINT_START macro support Chamber and print area bedmesh\n; PRINT_START EXTRUDER=[nozzle_temperature_initial_layer] BED=[bed_temperature_initial_layer_single] Chamber=[chamber_temperature] PRINT_MIN={first_layer_print_min[0]},{first_layer_print_min[1]} PRINT_MAX={first_layer_print_max[0]},{first_layer_print_max[1]}", "machine_end_gcode": "PRINT_END", "layer_change_gcode": "", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n", "scan_first_layer": "0", "nozzle_type": "hardened_steel", "auxiliary_fan": "0" diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 9fc4ad1f61..2d96eb418d 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1164,10 +1164,10 @@ namespace DoExport { print_statistics.clear(); print_statistics.total_toolchanges = std::max(0, wipe_tower_data.number_of_toolchanges); if (! extruders.empty()) { - //std::pair out_filament_used_mm ("; filament used [mm] = ", 0); - //std::pair out_filament_used_cm3("; filament used [cm3] = ", 0); - //std::pair out_filament_used_g ("; filament used [g] = ", 0); - //std::pair out_filament_cost ("; filament cost = ", 0); + std::pair out_filament_used_mm ("; filament used [mm] = ", 0); + std::pair out_filament_used_cm3("; filament used [cm3] = ", 0); + std::pair out_filament_used_g ("; filament used [g] = ", 0); + std::pair out_filament_cost ("; filament cost = ", 0); for (const Extruder &extruder : extruders) { double used_filament = extruder.used_filament() + (has_wipe_tower ? wipe_tower_data.used_filament[extruder.id()] : 0.f); double extruded_volume = extruder.extruded_volume() + (has_wipe_tower ? wipe_tower_data.used_filament[extruder.id()] * 2.4052f : 0.f); // assumes 1.75mm filament diameter @@ -1187,14 +1187,14 @@ namespace DoExport { dst.first += buf; ++ dst.second; }; - //append(out_filament_used_mm, "%.2lf", used_filament); - //append(out_filament_used_cm3, "%.2lf", extruded_volume * 0.001); + append(out_filament_used_mm, "%.2lf", used_filament); + append(out_filament_used_cm3, "%.2lf", extruded_volume * 0.001); if (filament_weight > 0.) { print_statistics.total_weight = print_statistics.total_weight + filament_weight; - //append(out_filament_used_g, "%.2lf", filament_weight); + append(out_filament_used_g, "%.2lf", filament_weight); if (filament_cost > 0.) { print_statistics.total_cost = print_statistics.total_cost + filament_cost; - //append(out_filament_cost, "%.2lf", filament_cost); + append(out_filament_cost, "%.2lf", filament_cost); } } print_statistics.total_used_filament += used_filament; @@ -1202,12 +1202,12 @@ namespace DoExport { print_statistics.total_wipe_tower_filament += has_wipe_tower ? used_filament - extruder.used_filament() : 0.; print_statistics.total_wipe_tower_cost += has_wipe_tower ? (extruded_volume - extruder.extruded_volume())* extruder.filament_density() * 0.001 * extruder.filament_cost() * 0.001 : 0.; } - //filament_stats_string_out += out_filament_used_mm.first; - //filament_stats_string_out += "\n" + out_filament_used_cm3.first; - //if (out_filament_used_g.second) - //filament_stats_string_out += "\n" + out_filament_used_g.first; - //if (out_filament_cost.second) - // filament_stats_string_out += "\n" + out_filament_cost.first; + filament_stats_string_out += out_filament_used_mm.first; + filament_stats_string_out += "\n" + out_filament_used_cm3.first; + if (out_filament_used_g.second) + filament_stats_string_out += "\n" + out_filament_used_g.first; + if (out_filament_cost.second) + filament_stats_string_out += "\n" + out_filament_cost.first; } return filament_stats_string_out; } @@ -1353,17 +1353,24 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Append full config, delimited by two 'phony' configuration keys CONFIG_BLOCK_START and CONFIG_BLOCK_END. // The delimiters are structured as configuration key / value pairs to be parsable by older versions of PrusaSlicer G-code viewer. { + file.write_format("; hack-fix: write fake slicer info here so that Moonraker will extract thumbs.\n"); + file.write_format("; %s\n\n",std::string(std::string("generated by SuperSlicer " SLIC3R_VERSION " on " ) + Slic3r::Utils::utc_timestamp()).c_str()); file.write("; CONFIG_BLOCK_START\n"); std::string full_config; append_full_config(print, full_config); if (!full_config.empty()) file.write(full_config); + + // SoftFever: write compatiple image + std::vector temps_per_bed; + int first_layer_bed_temperature = 0; + get_bed_temperature(0, true, temps_per_bed, first_layer_bed_temperature); + file.write_format("; first_layer_bed_temperature = %d\n", first_layer_bed_temperature); + file.write_format("; first_layer_temperature = %d\n", print.config().nozzle_temperature_initial_layer.get_at(0)); file.write("; CONFIG_BLOCK_END\n\n"); } //BBS: add plate id into thumbnail render logic - file.write_format("; hack-fix: write fake slicer info here so that Moonraker will extract thumbs.\n"); - file.write_format("; %s\n\n",std::string(std::string("generated by PrusaSlicer " SLIC3R_VERSION " on " ) + Slic3r::Utils::utc_timestamp()).c_str()); DoExport::export_thumbnails_to_file(thumbnail_cb, print.get_plate_index(), { Vec2d(300, 300) }, [&file](const char* sz) { file.write(sz); }, [&print]() { print.throw_if_canceled(); }); @@ -1373,8 +1380,6 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato const PrintObject *first_object = print.objects().front(); const double layer_height = first_object->config().layer_height.value; const double initial_layer_print_height = print.config().initial_layer_print_height.value; - //BBS: remove useless information in gcode file -#if 0 for (size_t region_id = 0; region_id < print.num_print_regions(); ++ region_id) { const PrintRegion ®ion = print.get_print_region(region_id); file.write_format("; external perimeters extrusion width = %.2fmm\n", region.flow(*first_object, frExternalPerimeter, layer_height).width()); @@ -1388,8 +1393,6 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write_format("; first layer extrusion width = %.2fmm\n", region.flow(*first_object, frPerimeter, initial_layer_print_height, true).width()); file.write_format("\n"); } - print.throw_if_canceled(); -#endif file.write_format("; EXECUTABLE_BLOCK_START\n"); // adds tags for time estimators @@ -1800,11 +1803,14 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_writer.extruders(), // Modifies print.m_print_statistics)); - //file.write("\n"); - //file.write_format("; total filament weight [g] = %.2lf\n", print.m_print_statistics.total_weight); - //file.write_format("; total filament cost = %.2lf\n", print.m_print_statistics.total_cost); - //if (print.m_print_statistics.total_toolchanges > 0) - // file.write_format("; total filament change = %i\n", print.m_print_statistics.total_toolchanges); + file.write("\n"); + file.write_format("; total filament used [g] = %.2lf\n", print.m_print_statistics.total_weight); + file.write_format("; total filament cost = %.2lf\n", print.m_print_statistics.total_cost); + if (print.m_print_statistics.total_toolchanges > 0) + file.write_format("; total filament change = %i\n", print.m_print_statistics.total_toolchanges); + + file.write_format("; total layers count = %i\n", m_layer_count); + file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str()); print.throw_if_canceled(); } diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index edfb737882..6f7dc21cdd 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -452,10 +452,7 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename, st PrintEstimatedStatistics::ETimeMode mode = static_cast(i); if (mode == PrintEstimatedStatistics::ETimeMode::Normal || machine.enabled) { char buf[128]; - //sprintf(buf, "; estimated printing time (%s mode) = %s\n", - // (mode == PrintEstimatedStatistics::ETimeMode::Normal) ? "normal" : "silent", - // get_time_dhms(machine.time).c_str()); - sprintf(buf, "; total estimated time: %s\n", get_time_dhms(machine.time).c_str()); + sprintf(buf, "; estimated printing time: %s\n", get_time_dhms(machine.time).c_str()); ret += buf; } } diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 90fd5bffe3..e7e4d5f0d9 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -571,7 +571,7 @@ void PrintConfigDef::init_fff_params() def->multiline = true; def->full_width = true; def->height = 5; - def->mode = comDevelop; + def->mode = comAdvanced; def->set_default_value(new ConfigOptionString("")); def = this->add("bottom_shell_layers", coInt); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 3a77ce19e5..4a4407d06b 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2911,8 +2911,8 @@ void TabPrinter::build_fff() option.opt.is_code = true; option.opt.height = gcode_field_height;//150; optgroup->append_single_option_line(option); -#if 0 - optgroup = page->new_optgroup(L("Before layer change G-code"), 0); + + optgroup = page->new_optgroup(L("Before layer change G-code"),"param_gcode", 0); optgroup->m_on_change = [this, optgroup](const t_config_option_key& opt_key, const boost::any& value) { validate_custom_gcode_cb(this, optgroup, opt_key, value); }; @@ -2921,7 +2921,6 @@ void TabPrinter::build_fff() option.opt.is_code = true; option.opt.height = gcode_field_height;//150; optgroup->append_single_option_line(option); -#endif optgroup = page->new_optgroup(L("Layer change G-code"), L"param_gcode", 0); optgroup->m_on_change = [this, optgroup](const t_config_option_key& opt_key, const boost::any& value) {