PRUSA 2.7.0

This commit is contained in:
sunsets
2023-12-27 18:02:35 +08:00
parent b33112327f
commit 0a3c63dcb1
488 changed files with 92371 additions and 29443 deletions

View File

@@ -7,6 +7,7 @@
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/CustomGCode.hpp"
#include <LibBGCode/binarize/binarize.hpp>
#include <cstdint>
#include <array>
#include <vector>
@@ -56,9 +57,13 @@ namespace Slic3r {
time = 0.0f;
travel_time = 0.0f;
custom_gcode_times.clear();
custom_gcode_times.shrink_to_fit();
moves_times.clear();
moves_times.shrink_to_fit();
roles_times.clear();
roles_times.shrink_to_fit();
layers_times.clear();
layers_times.shrink_to_fit();
}
};
@@ -76,6 +81,7 @@ namespace Slic3r {
m.reset();
}
volumes_per_color_change.clear();
volumes_per_color_change.shrink_to_fit();
volumes_per_extruder.clear();
used_filaments_per_role.clear();
cost_per_extruder.clear();
@@ -135,12 +141,16 @@ namespace Slic3r {
};
std::string filename;
bool is_binary_file;
unsigned int id;
std::vector<MoveVertex> moves;
// Positions of ends of lines of the final G-code this->filename after TimeProcessor::post_process() finalizes the G-code.
std::vector<size_t> lines_ends;
// Binarized gcodes usually have several gcode blocks. Each block has its own list on ends of lines.
// Ascii gcodes have only one list on ends of lines
std::vector<std::vector<size_t>> lines_ends;
Pointfs bed_shape;
float max_print_height;
float z_offset;
SettingsIds settings_ids;
size_t extruders_count;
bool backtrace_enabled;
@@ -261,6 +271,7 @@ namespace Slic3r {
EMoveType move_type{ EMoveType::Noop };
GCodeExtrusionRole role{ GCodeExtrusionRole::None };
unsigned int g1_line_id{ 0 };
unsigned int remaining_internal_g1_lines;
unsigned int layer_id{ 0 };
float distance{ 0.0f }; // mm
float acceleration{ 0.0f }; // mm/s^2
@@ -301,6 +312,7 @@ namespace Slic3r {
struct G1LinesCacheItem
{
unsigned int id;
unsigned int remaining_internal_g1_lines;
float elapsed_time;
};
@@ -523,8 +535,11 @@ namespace Slic3r {
};
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
static bgcode::binarize::BinarizerConfig& get_binarizer_config() { return s_binarizer_config; }
private:
GCodeReader m_parser;
bgcode::binarize::Binarizer m_binarizer;
static bgcode::binarize::BinarizerConfig s_binarizer_config;
EUnits m_units;
EPositioningType m_global_positioning_type;
@@ -622,6 +637,8 @@ namespace Slic3r {
void apply_config(const PrintConfig& config);
void set_print(Print* print) { m_print = print; }
bgcode::binarize::BinaryData& get_binary_data() { return m_binarizer.get_binary_data(); }
const bgcode::binarize::BinaryData& get_binary_data() const { return m_binarizer.get_binary_data(); }
void enable_stealth_time_estimator(bool enabled);
bool is_stealth_time_estimator_enabled() const {
@@ -664,6 +681,8 @@ namespace Slic3r {
void apply_config_kissslicer(const std::string& filename);
void process_gcode_line(const GCodeReader::GCodeLine& line, bool producers_enabled);
void process_ascii_file(const std::string& filename, std::function<void()> cancel_callback = nullptr);
void process_binary_file(const std::string& filename, std::function<void()> cancel_callback = nullptr);
// Process tags embedded into comments
void process_tags(const std::string_view comment, bool producers_enabled);
bool process_producers_tags(const std::string_view comment);
@@ -680,8 +699,13 @@ namespace Slic3r {
// Move
void process_G0(const GCodeReader::GCodeLine& line);
void process_G1(const GCodeReader::GCodeLine& line);
enum class G1DiscretizationOrigin {
G1,
G2G3,
};
void process_G1(const std::array<std::optional<double>, 4>& axes = { std::nullopt, std::nullopt, std::nullopt, std::nullopt },
std::optional<double> feedrate = std::nullopt, std::optional<std::string> cmt = std::nullopt);
const std::optional<double>& feedrate = std::nullopt, G1DiscretizationOrigin origin = G1DiscretizationOrigin::G1,
const std::optional<unsigned int>& remaining_internal_g1_lines = std::nullopt);
// Arc Move
void process_G2_G3(const GCodeReader::GCodeLine& line, bool clockwise);
@@ -815,7 +839,7 @@ namespace Slic3r {
// Simulates firmware st_synchronize() call
void simulate_st_synchronize(float additional_time = 0.0f);
void update_estimated_times_stats();
void update_estimated_statistics();
double extract_absolute_position_on_axis(Axis axis, const GCodeReader::GCodeLine& line, double area_filament_cross_section);
};