Prusa 2.7.1

This commit is contained in:
sunsets
2023-12-28 10:57:18 +08:00
parent 0a3c63dcb1
commit ab227dba3c
20 changed files with 197 additions and 151 deletions

View File

@@ -64,6 +64,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
"bed_temperature",
"before_layer_gcode",
"between_objects_gcode",
"binary_gcode",
"bridge_acceleration",
"bridge_fan_speed",
//B15
@@ -121,7 +122,6 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
"perimeter_acceleration",
"post_process",
"gcode_substitutions",
"gcode_binary",
"printer_notes",
"travel_ramping_lift",
"travel_initial_part_length",
@@ -1588,7 +1588,14 @@ std::string Print::output_filename(const std::string &filename_base) const
DynamicConfig config = this->finished() ? this->print_statistics().config() : this->print_statistics().placeholders();
config.set_key_value("num_extruders", new ConfigOptionInt((int)m_config.nozzle_diameter.size()));
config.set_key_value("default_output_extension", new ConfigOptionString(".gcode"));
return this->PrintBase::output_filename(m_config.output_filename_format.value, ".gcode", filename_base, &config);
// Handle output_filename_format. There is a hack related to binary G-codes: gcode / bgcode substitution.
std::string output_filename_format = m_config.output_filename_format.value;
if (m_config.binary_gcode && boost::iends_with(output_filename_format, ".gcode"))
output_filename_format.insert(output_filename_format.end()-5, 'b');
if (! m_config.binary_gcode && boost::iends_with(output_filename_format, ".bgcode"))
output_filename_format.erase(output_filename_format.end()-6);
return this->PrintBase::output_filename(output_filename_format, ".gcode", filename_base, &config);
}
const std::string PrintStatistics::FilamentUsedG = "filament used [g]";
@@ -1610,6 +1617,8 @@ const std::string PrintStatistics::FilamentCostMask = "; filament cost =";
const std::string PrintStatistics::TotalFilamentCost = "total filament cost";
const std::string PrintStatistics::TotalFilamentCostMask = "; total filament cost =";
const std::string PrintStatistics::TotalFilamentCostValueMask = "; total filament cost = %.2lf\n";
const std::string PrintStatistics::TotalFilamentUsedWipeTower = "total filament used for wipe tower [g]";
const std::string PrintStatistics::TotalFilamentUsedWipeTowerValueMask = "; total filament used for wipe tower [g] = %.2lf\n";
DynamicConfig PrintStatistics::config() const
{
DynamicConfig config;