mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-21 12:15:21 +00:00
SPE-1739: Fixed calculation of gcode preview sequential slider endpoints
(cherry picked from commit 578921257d14e2c07611dfbb89cda5f9dc776e0c)
This commit is contained in:
committed by
Andrew Sun
parent
25c19c94b5
commit
20f132e09a
@@ -1609,6 +1609,7 @@ namespace DoExport {
|
|||||||
silent_time_estimator_enabled = (config.gcode_flavor == gcfMarlinLegacy || config.gcode_flavor == gcfMarlinFirmware)
|
silent_time_estimator_enabled = (config.gcode_flavor == gcfMarlinLegacy || config.gcode_flavor == gcfMarlinFirmware)
|
||||||
&& config.silent_mode;
|
&& config.silent_mode;
|
||||||
processor.reset();
|
processor.reset();
|
||||||
|
processor.initialize_result_moves();
|
||||||
processor.apply_config(config);
|
processor.apply_config(config);
|
||||||
processor.enable_stealth_time_estimator(silent_time_estimator_enabled);
|
processor.enable_stealth_time_estimator(silent_time_estimator_enabled);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1288,8 +1288,7 @@ void GCodeProcessor::process_file(const std::string& filename, std::function<voi
|
|||||||
// process gcode
|
// process gcode
|
||||||
m_result.filename = filename;
|
m_result.filename = filename;
|
||||||
m_result.id = ++s_result_id;
|
m_result.id = ++s_result_id;
|
||||||
// 1st move must be a dummy move
|
initialize_result_moves();
|
||||||
m_result.moves.emplace_back(GCodeProcessorResult::MoveVertex());
|
|
||||||
size_t parse_line_callback_cntr = 10000;
|
size_t parse_line_callback_cntr = 10000;
|
||||||
m_parser.parse_file(filename, [this, cancel_callback, &parse_line_callback_cntr](GCodeReader& reader, const GCodeReader::GCodeLine& line) {
|
m_parser.parse_file(filename, [this, cancel_callback, &parse_line_callback_cntr](GCodeReader& reader, const GCodeReader::GCodeLine& line) {
|
||||||
if (-- parse_line_callback_cntr == 0) {
|
if (-- parse_line_callback_cntr == 0) {
|
||||||
@@ -1312,8 +1311,6 @@ void GCodeProcessor::initialize(const std::string& filename)
|
|||||||
// process gcode
|
// process gcode
|
||||||
m_result.filename = filename;
|
m_result.filename = filename;
|
||||||
m_result.id = ++s_result_id;
|
m_result.id = ++s_result_id;
|
||||||
// 1st move must be a dummy move
|
|
||||||
m_result.moves.emplace_back(GCodeProcessorResult::MoveVertex());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GCodeProcessor::process_buffer(const std::string &buffer)
|
void GCodeProcessor::process_buffer(const std::string &buffer)
|
||||||
|
|||||||
@@ -787,6 +787,11 @@ class Print;
|
|||||||
|
|
||||||
// Streaming interface, for processing G-codes just generated by PrusaSlicer in a pipelined fashion.
|
// Streaming interface, for processing G-codes just generated by PrusaSlicer in a pipelined fashion.
|
||||||
void initialize(const std::string& filename);
|
void initialize(const std::string& filename);
|
||||||
|
void initialize_result_moves() {
|
||||||
|
// 1st move must be a dummy move
|
||||||
|
assert(m_result.moves.empty());
|
||||||
|
m_result.moves.emplace_back(GCodeProcessorResult::MoveVertex());
|
||||||
|
}
|
||||||
void process_buffer(const std::string& buffer);
|
void process_buffer(const std::string& buffer);
|
||||||
void finalize(bool post_process);
|
void finalize(bool post_process);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user