OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GCodeProcessor::TimeMachine Struct Reference
Collaboration diagram for Slic3r::GCodeProcessor::TimeMachine:

Classes

struct  State
struct  CustomGCodeTime
struct  G1LinesCacheItem
struct  ActualSpeedMove
struct  StopTime

Public Types

using AdditionalBufferBlock = std::pair<EMoveType, float>
using AdditionalBuffer = std::vector<AdditionalBufferBlock>

Public Member Functions

void reset ()
size_t plan_klipper (bool lazy)
void calculate_time (GCodeProcessorResult &result, PrintEstimatedStatistics::ETimeMode mode, size_t keep_last_n_blocks=0, float additional_time=0.0f, EMoveType target_move_type=EMoveType::Noop, bool is_final=false)

Static Public Member Functions

static AdditionalBuffer merge_adjacent_additional_time_blocks (const AdditionalBuffer &buffer)

Public Attributes

bool enabled
float acceleration
float max_acceleration
float retract_acceleration
float max_retract_acceleration
float travel_acceleration
float max_travel_acceleration
float extrude_factor_override_percentage
bool klipper { false }
float minimum_cruise_ratio { 0.5f }
float requested_accel_to_decel { -1.0f }
float klipper_junction_flush { 1.0f }
bool klipper_queue_priming { true }
double time
std::vector< StopTime > stop_times
std::string line_m73_main_mask
std::string line_m73_stop_mask
State curr
State prev
CustomGCodeTime gcode_time
std::vector< TimeBlock > blocks
std::vector< G1LinesCacheItem > g1_times_cache
float first_layer_time
std::vector< ActualSpeedMove > actual_speed_moves
float prepare_time
AdditionalBuffer m_additional_time_buffer

Detailed Description


Class Documentation

◆ Slic3r::GCodeProcessor::TimeMachine::G1LinesCacheItem

struct Slic3r::GCodeProcessor::TimeMachine::G1LinesCacheItem
Class Members
float elapsed_time
unsigned int id
unsigned int remaining_internal_g1_lines { 0 }

◆ Slic3r::GCodeProcessor::TimeMachine::ActualSpeedMove

struct Slic3r::GCodeProcessor::TimeMachine::ActualSpeedMove
Class Members
float actual_feedrate { 0.0f }
optional< float > delta_extruder
optional< float > fan_speed
optional< float > feedrate
optional< float > height
optional< float > mm3_per_mm
unsigned int move_id { 0 }
optional< Vec3f > position
optional< float > temperature
optional< float > width

◆ Slic3r::GCodeProcessor::TimeMachine::StopTime

struct Slic3r::GCodeProcessor::TimeMachine::StopTime
Class Members
float elapsed_time
unsigned int g1_line_id

Member Typedef Documentation

◆ AdditionalBuffer

◆ AdditionalBufferBlock

Member Function Documentation

◆ calculate_time()

void Slic3r::GCodeProcessor::TimeMachine::calculate_time ( GCodeProcessorResult & result,
PrintEstimatedStatistics::ETimeMode mode,
size_t keep_last_n_blocks = 0,
float additional_time = 0.0f,
EMoveType target_move_type = EMoveType::Noop,
bool is_final = false )
577{
578 if (!enabled)
579 return;
580 // Drain buffered delays on the final pass, even with no motion left.
581 // A trailing filament change has no later move to receive its time.
582 const bool drain_final = is_final && !m_additional_time_buffer.empty();
583 if ((klipper ? blocks.empty() : blocks.size() < 2) && !drain_final) {
584 // Not enough blocks to attribute the extra time to yet; buffer it so it is
585 // applied on a later pass instead of being dropped.
586 if (additional_time > 0.0f)
587 m_additional_time_buffer.emplace_back(target_move_type, additional_time);
588 return;
589 }
590
591 assert(klipper || keep_last_n_blocks <= blocks.size());
592
593 // Merge any previously buffered extra time with this call's extra time. Each
594 // entry is applied, in order, to the first block matching its target move type
595 // (EMoveType::Noop matches any block).
596 AdditionalBuffer additional_buffer = m_additional_time_buffer;
597 if (additional_time > 0.0f)
598 additional_buffer.emplace_back(target_move_type, additional_time);
599 additional_buffer = merge_adjacent_additional_time_blocks(additional_buffer);
600
601 size_t n_blocks_process;
602 if (klipper) {
603 n_blocks_process = plan_klipper(keep_last_n_blocks != 0);
604 keep_last_n_blocks = blocks.size() - n_blocks_process;
605 } else {
606 for (int i = static_cast<int>(blocks.size()) - 1; i > 0; --i)
608 for (size_t i = 0; i + 1 < blocks.size(); ++i)
611 n_blocks_process = blocks.size() - keep_last_n_blocks;
612 }
613 size_t additional_buffer_idx = 0;
614 for (size_t i = 0; i < n_blocks_process; ++i) {
615 const TimeBlock& block = blocks[i];
616 double motion_time;
617 if (klipper && block.trapezoid.cruise_feedrate > 0.0f) {
618 // Integrate using the planned speeds. Reconstructing the exit speed
619 // from rounded deceleration distance loses precision near a stop.
620 const double cruise = block.trapezoid.cruise_feedrate;
621 motion_time = block.distance / cruise;
622 if (block.acceleration > 0.0f) {
623 const double accel_delta = cruise - block.feedrate_profile.entry;
624 const double decel_delta = cruise - block.feedrate_profile.exit;
625 motion_time += (sqr(accel_delta) + sqr(decel_delta)) / (2.0 * block.acceleration * cruise);
626 }
627 } else {
628 motion_time = block.time();
629 }
630 double block_time = motion_time;
631 if (additional_buffer_idx < additional_buffer.size()) {
632 const EMoveType buf_move_type = additional_buffer[additional_buffer_idx].first;
633 if (buf_move_type == EMoveType::Noop || buf_move_type == block.move_type) {
634 block_time += additional_buffer[additional_buffer_idx].second;
635 ++additional_buffer_idx;
636 }
637 }
638
639 time += block_time;
640 // Orca: accumulate per-SkipType time spent inside SKIPPABLE regions, folded into this single
641 // calculate_time write site. Fires fleet-wide (the shipping time_lapse_gcode template stamps
642 // blocks stTimelapse), but writes only skippable_part_time, which has no g-code-emitting
643 // reader until the pre-heat injector consumes it, so output is byte-identical.
644 if (block.skippable_type != SkipType::stNone)
645 result.skippable_part_time[block.skippable_type] += motion_time;
646 result.moves[block.move_id].time[static_cast<size_t>(mode)] = block_time;
647 gcode_time.cache += block_time;
648 //BBS
649 if (block.flags.prepare_stage)
650 prepare_time += block_time;
651
652 if (block.layer_id == 1)
653 first_layer_time += block_time;
654
655 // detect actual speed moves required to render toolpaths using actual speed
657 GCodeProcessorResult::MoveVertex& curr_move = result.moves[block.move_id];
658 if (curr_move.type != EMoveType::Extrude &&
659 curr_move.type != EMoveType::Travel &&
660 curr_move.type != EMoveType::Wipe)
661 continue;
662
663 assert(curr_move.actual_feedrate == 0.0f);
664
665 GCodeProcessorResult::MoveVertex& prev_move = result.moves[block.move_id - 1];
666 const bool interpolate = (prev_move.type == curr_move.type);
667 if (!interpolate &&
668 prev_move.type != EMoveType::Extrude &&
669 prev_move.type != EMoveType::Travel &&
670 prev_move.type != EMoveType::Wipe)
671 prev_move.actual_feedrate = block.feedrate_profile.entry;
672
673 if (EPSILON < block.trapezoid.accelerate_until && block.trapezoid.accelerate_until < block.distance - EPSILON) {
674 const float t = block.trapezoid.accelerate_until / block.distance;
675 const Vec3f position = lerp(prev_move.position, curr_move.position, t);
676 if ((position - prev_move.position).norm() > EPSILON &&
677 (position - curr_move.position).norm() > EPSILON) {
678 const float delta_extruder = interpolate ? lerp(prev_move.delta_extruder, curr_move.delta_extruder, t) : curr_move.delta_extruder;
679 const float feedrate = curr_move.feedrate; // ORCA: set feedrate to the gcode feed rate to prevent visualiser from
680 // displaying erroneous speed transition when actual speed/actual flow views are NOT selected.
681 // interpolate ? lerp(prev_move.feedrate, curr_move.feedrate, t) : curr_move.feedrate;
682 const float width = interpolate ? lerp(prev_move.width, curr_move.width, t) : curr_move.width;
683 const float height = interpolate ? lerp(prev_move.height, curr_move.height, t) : curr_move.height;
684 // ORCA: Fix issue with flow rate changes being visualized incorrectly
685 const float mm3_per_mm = curr_move.mm3_per_mm;
686 const float fan_speed = curr_move.fan_speed;
687 const float temperature = interpolate ? lerp(prev_move.temperature, curr_move.temperature, t) : curr_move.temperature;
688 actual_speed_moves.push_back({
689 block.move_id,
690 position,
691 block.trapezoid.cruise_feedrate,
692 delta_extruder,
693 feedrate,
694 width,
695 height,
696 mm3_per_mm,
697 fan_speed,
698 temperature
699 });
700 }
701 }
702
703 const bool has_deceleration = block.trapezoid.deceleration_distance(block.distance) > EPSILON;
704 if (has_deceleration && block.trapezoid.decelerate_after > block.trapezoid.accelerate_until + EPSILON) {
705 const float t = block.trapezoid.decelerate_after / block.distance;
706 const Vec3f position = lerp(prev_move.position, curr_move.position, t);
707 if ((position - prev_move.position).norm() > EPSILON &&
708 (position - curr_move.position).norm() > EPSILON) {
709 const float delta_extruder = interpolate ? lerp(prev_move.delta_extruder, curr_move.delta_extruder, t) : curr_move.delta_extruder;
710 const float feedrate = curr_move.feedrate; // ORCA: set feedrate to the gcode feed rate to prevent visualiser from
711 // displaying erroneous speed transition when actual speed/actual flow views are NOT selected.
712 // interpolate ? lerp(prev_move.feedrate, curr_move.feedrate, t) : curr_move.feedrate;
713 const float width = interpolate ? lerp(prev_move.width, curr_move.width, t) : curr_move.width;
714 const float height = interpolate ? lerp(prev_move.height, curr_move.height, t) : curr_move.height;
715 // ORCA: Fix issue with flow rate changes being visualized incorrectly
716 const float mm3_per_mm = curr_move.mm3_per_mm;
717 const float fan_speed = curr_move.fan_speed;
718 const float temperature = interpolate ? lerp(prev_move.temperature, curr_move.temperature, t) : curr_move.temperature;
719 actual_speed_moves.push_back({
720 block.move_id,
721 position,
722 block.trapezoid.cruise_feedrate,
723 delta_extruder,
724 feedrate,
725 width,
726 height,
727 mm3_per_mm,
728 fan_speed,
729 temperature
730 });
731 }
732 }
733
734 const bool is_cruise_only = block.trapezoid.is_cruise_only(block.distance);
735 actual_speed_moves.push_back({
736 block.move_id,
737 std::nullopt,
738 (is_cruise_only || !has_deceleration) ? block.trapezoid.cruise_feedrate : block.feedrate_profile.exit,
739 std::nullopt,
740 std::nullopt,
741 std::nullopt,
742 std::nullopt,
743 std::nullopt,
744 std::nullopt,
745 std::nullopt
746 });
747 }
748 g1_times_cache.push_back({ block.g1_line_id, block.remaining_internal_g1_lines, float(time) });
749 // update times for remaining time to printer stop placeholders
750 auto it_stop_time = std::lower_bound(stop_times.begin(), stop_times.end(), block.g1_line_id,
751 [](const StopTime& t, unsigned int value) { return t.g1_line_id < value; });
752 if (it_stop_time != stop_times.end() && it_stop_time->g1_line_id == block.g1_line_id)
753 it_stop_time->elapsed_time = float(time);
754 }
755
756 // Carry forward any extra time that found no matching block this pass, so it
757 // is retried against the blocks of a later pass.
759 if (additional_buffer_idx < additional_buffer.size()) {
760 if (is_final) {
761 // Orca EOF hardening: no later pass remains to attribute this remainder,
762 // so add it to the machine total (and the custom-gcode cache) instead of
763 // dropping it. Deliberately NOT attributed to any move vertex, so a stray
764 // filament-change delay can never leak into an extrusion role's time.
765 // (BambuStudio drops the remainder here.)
766 float leftover = 0.0f;
767 for (size_t i = additional_buffer_idx; i < additional_buffer.size(); ++i)
768 leftover += additional_buffer[i].second;
769 BOOST_LOG_TRIVIAL(debug) << "calculate_time(is_final): leftover=" << leftover
770 << "s from " << (additional_buffer.size() - additional_buffer_idx) << " items";
771 time += double(leftover);
772 gcode_time.cache += leftover;
773 } else {
775 additional_buffer.begin() + additional_buffer_idx,
776 additional_buffer.end());
777 }
778 }
779
780 if (keep_last_n_blocks) {
781 blocks.erase(blocks.begin(), blocks.begin() + n_blocks_process);
782
783 // Preserve the boundary speed in the Marlin planner. Klipper only flushes
784 // moves whose cruise speed is already independent of future moves.
785 if (!klipper) {
786 TimeBlock& first_block = blocks.front();
787 first_block.max_entry_speed = first_block.feedrate_profile.entry;
788 }
789 } else {
790 blocks.clear();
791 }
792}
#define EPSILON
Definition ColorUtils.cpp:64
GCodeProcessorResult & result()
Definition GCodeProcessor.hpp:1435
Point interpolate(const Point &a, const Point &b, double t)
Definition ExclusionVolumeTravelAvoidance.cpp:158
coord_t width(const BoundingBox &box)
Definition Arrange.cpp:1184
coord_t height(const BoundingBox &box)
Definition Arrange.cpp:1185
@ stNone
Definition GCodeProcessor.hpp:77
static void planner_reverse_pass_kernel(GCodeProcessor::TimeBlock &curr, const GCodeProcessor::TimeBlock &next)
Definition GCodeProcessor.cpp:422
static void planner_forward_pass_kernel(const GCodeProcessor::TimeBlock &prev, GCodeProcessor::TimeBlock &curr)
Definition GCodeProcessor.cpp:400
static void recalculate_trapezoids(std::vector< GCodeProcessor::TimeBlock > &blocks)
Definition GCodeProcessor.cpp:453
ColorRGB lerp(const ColorRGB &a, const ColorRGB &b, float t)
Definition Color.cpp:244
Eigen::Matrix< float, 3, 1, Eigen::DontAlign > Vec3f
Definition Point.hpp:65
EMoveType
Definition GCodeProcessor.hpp:53
@ Travel
Definition GCodeProcessor.hpp:62
@ Noop
Definition GCodeProcessor.hpp:54
@ Wipe
Definition GCodeProcessor.hpp:63
@ Extrude
Definition GCodeProcessor.hpp:64
constexpr T sqr(T x)
Definition libslic3r.h:301
std::vector< MoveVertex > moves
Definition GCodeProcessor.hpp:313
std::unordered_map< SkipType, float > skippable_part_time
Definition GCodeProcessor.hpp:402
bool klipper
Definition GCodeProcessor.hpp:815
AdditionalBuffer m_additional_time_buffer
Definition GCodeProcessor.hpp:849
std::vector< TimeBlock > blocks
Definition GCodeProcessor.hpp:834
std::vector< ActualSpeedMove > actual_speed_moves
Definition GCodeProcessor.hpp:837
static AdditionalBuffer merge_adjacent_additional_time_blocks(const AdditionalBuffer &buffer)
Definition GCodeProcessor.cpp:483
double time
Definition GCodeProcessor.hpp:822
std::vector< StopTime > stop_times
Definition GCodeProcessor.hpp:828
std::vector< G1LinesCacheItem > g1_times_cache
Definition GCodeProcessor.hpp:835
float prepare_time
Definition GCodeProcessor.hpp:839
std::vector< AdditionalBufferBlock > AdditionalBuffer
Definition GCodeProcessor.hpp:848
size_t plan_klipper(bool lazy)
Definition GCodeProcessor.cpp:505
CustomGCodeTime gcode_time
Definition GCodeProcessor.hpp:833
float first_layer_time
Definition GCodeProcessor.hpp:836
bool enabled
Definition GCodeProcessor.hpp:804
Definition GCodeProcessor.hpp:824
@ Normal
Definition GCodeProcessor.hpp:89

References Slic3r::GCodeProcessor::Trapezoid::accelerate_until, Slic3r::GCodeProcessor::TimeBlock::acceleration, Slic3r::GCodeProcessorResult::MoveVertex::actual_feedrate, actual_speed_moves, blocks, Slic3r::GCodeProcessor::Trapezoid::cruise_feedrate, Slic3r::GCodeProcessor::Trapezoid::decelerate_after, Slic3r::GCodeProcessor::Trapezoid::deceleration_distance(), Slic3r::GCodeProcessorResult::MoveVertex::delta_extruder, Slic3r::GCodeProcessor::TimeBlock::distance, enabled, Slic3r::GCodeProcessor::FeedrateProfile::entry, EPSILON, Slic3r::GCodeProcessor::FeedrateProfile::exit, Slic3r::Extrude, Slic3r::GCodeProcessorResult::MoveVertex::fan_speed, Slic3r::GCodeProcessorResult::MoveVertex::feedrate, Slic3r::GCodeProcessor::TimeBlock::feedrate_profile, first_layer_time, Slic3r::GCodeProcessor::TimeBlock::flags, Slic3r::GCodeProcessor::TimeBlock::g1_line_id, g1_times_cache, gcode_time, Slic3r::GCodeProcessorResult::MoveVertex::height, Slic3r::GCodeProcessor::Trapezoid::is_cruise_only(), klipper, Slic3r::GCodeProcessor::TimeBlock::layer_id, Slic3r::lerp(), m_additional_time_buffer, Slic3r::GCodeProcessor::TimeBlock::max_entry_speed, merge_adjacent_additional_time_blocks(), Slic3r::GCodeProcessorResult::MoveVertex::mm3_per_mm, Slic3r::GCodeProcessor::TimeBlock::move_id, Slic3r::GCodeProcessor::TimeBlock::move_type, Slic3r::Noop, Slic3r::PrintEstimatedStatistics::Normal, plan_klipper(), Slic3r::planner_forward_pass_kernel(), Slic3r::planner_reverse_pass_kernel(), Slic3r::GCodeProcessorResult::MoveVertex::position, Slic3r::GCodeProcessor::TimeBlock::Flags::prepare_stage, prepare_time, Slic3r::recalculate_trapezoids(), Slic3r::GCodeProcessor::TimeBlock::remaining_internal_g1_lines, Slic3r::GCodeProcessor::result(), Slic3r::GCodeProcessor::TimeBlock::skippable_type, Slic3r::sqr(), Slic3r::stNone, stop_times, Slic3r::GCodeProcessorResult::MoveVertex::temperature, Slic3r::GCodeProcessor::TimeBlock::time(), time, Slic3r::GCodeProcessor::TimeBlock::trapezoid, Slic3r::Travel, Slic3r::GCodeProcessorResult::MoveVertex::type, Slic3r::GCodeProcessorResult::MoveVertex::width, and Slic3r::Wipe.

Referenced by Slic3r::GCodeProcessor::calculate_time().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ merge_adjacent_additional_time_blocks()

GCodeProcessor::TimeMachine::AdditionalBuffer Slic3r::GCodeProcessor::TimeMachine::merge_adjacent_additional_time_blocks ( const AdditionalBuffer & buffer)
static
484{
485 AdditionalBuffer merged;
486 if (buffer.empty())
487 return merged;
488
489 AdditionalBufferBlock current_block = buffer.front();
490 for (size_t idx = 1; idx < buffer.size(); ++idx) {
491 const AdditionalBufferBlock& next_block = buffer[idx];
492 if (current_block.first == next_block.first)
493 current_block.second += next_block.second;
494 else {
495 merged.push_back(current_block);
496 current_block = next_block;
497 }
498 }
499 merged.push_back(current_block);
500 return merged;
501}
std::pair< EMoveType, float > AdditionalBufferBlock
Definition GCodeProcessor.hpp:847

Referenced by calculate_time().

Here is the caller graph for this function:

◆ plan_klipper()

size_t Slic3r::GCodeProcessor::TimeMachine::plan_klipper ( bool lazy)
506{
507 klipper_junction_flush = requested_accel_to_decel >= 0.0f ? 0.250f : 0.150f;
508 klipper_queue_priming = false;
509 size_t flush_count = blocks.size();
510 bool update_flush_count = lazy;
511 float next_start_v2 = 0.0f;
512 float next_mcr_start_v2 = 0.0f;
513 float peak_cruise_v2 = 0.0f;
514 size_t pending = 0;
515 for (size_t i = blocks.size(); i-- > 0;) {
516 TimeBlock& block = blocks[i];
517 const float delta_v2 = 2.0f * block.distance * block.acceleration;
518 const float reachable_start_v2 = next_start_v2 + delta_v2;
519 const float start_v2 = std::min(sqr(block.max_entry_speed), reachable_start_v2);
520 const float reachable_mcr_v2 = next_mcr_start_v2 + block.mcr_delta_v2;
521 const float mcr_start_v2 = std::min(block.max_mcr_entry_speed_sqr, reachable_mcr_v2);
522 float cruise_v2 = -1.0f;
523 ++pending;
524 if (mcr_start_v2 < reachable_mcr_v2) {
525 if (mcr_start_v2 + block.mcr_delta_v2 > next_mcr_start_v2 || pending > 1) {
526 // Stop at this block, not past it: the blocks above still have a cruise speed
527 // that depends on moves not yet seen, so only [0, i) may be committed.
528 if (update_flush_count && peak_cruise_v2 > 0.0f) {
529 flush_count = i;
530 update_flush_count = false;
531 }
532 peak_cruise_v2 = std::min(sqr(block.feedrate_profile.cruise),
533 0.5f * (mcr_start_v2 + reachable_mcr_v2));
534 }
535 cruise_v2 = std::min({0.5f * (start_v2 + reachable_start_v2),
536 sqr(block.feedrate_profile.cruise), peak_cruise_v2});
537 pending = 0;
538 }
539 // Until the forward pass, these fields hold v^2, not speeds; -1 marks
540 // an unassigned cruise speed. A lazy return leaves them in this state.
541 block.feedrate_profile.entry = start_v2;
542 block.feedrate_profile.exit = next_start_v2;
543 block.trapezoid.cruise_feedrate = cruise_v2;
544 block.peak_cruise_v2 = peak_cruise_v2;
545 next_start_v2 = start_v2;
546 next_mcr_start_v2 = mcr_start_v2;
547 }
548 if (update_flush_count)
549 return 0;
550 // A run of blocks that cannot accelerate is resolved here, once the peak cruise speed of the
551 // accelerating block that precedes it is known. Each one takes a running minimum with its own
552 // entry speed, seeded from that peak rather than from the setter's own clamped cruise speed.
553 float prev_cruise_v2 = 0.0f;
554 for (size_t i = 0; i < flush_count; ++i) {
555 TimeBlock& block = blocks[i];
556 float cruise_v2 = block.trapezoid.cruise_feedrate;
557 if (cruise_v2 < 0.0f) {
558 cruise_v2 = std::min(prev_cruise_v2, block.feedrate_profile.entry);
559 prev_cruise_v2 = cruise_v2;
560 } else
561 prev_cruise_v2 = block.peak_cruise_v2;
562 const float start_v2 = std::min(block.feedrate_profile.entry, cruise_v2);
563 const float end_v2 = std::min(block.feedrate_profile.exit, cruise_v2);
564 // A zero acceleration would put an infinity in the ramp distances; the Marlin helpers guard
565 // their divides the same way and fall back to a pure cruise.
566 const float inv_two_accel = block.acceleration > 0.0f ? 0.5f / block.acceleration : 0.0f;
567 block.feedrate_profile.entry = std::sqrt(start_v2);
568 block.feedrate_profile.exit = std::sqrt(end_v2);
569 block.trapezoid.cruise_feedrate = std::sqrt(cruise_v2);
570 block.trapezoid.accelerate_until = (cruise_v2 - start_v2) * inv_two_accel;
571 block.trapezoid.decelerate_after = block.distance - (cruise_v2 - end_v2) * inv_two_accel;
572 }
573 return flush_count;
574}
bool klipper_queue_priming
Definition GCodeProcessor.hpp:819
float requested_accel_to_decel
Definition GCodeProcessor.hpp:817
float klipper_junction_flush
Definition GCodeProcessor.hpp:818

References Slic3r::GCodeProcessor::Trapezoid::accelerate_until, Slic3r::GCodeProcessor::TimeBlock::acceleration, blocks, Slic3r::GCodeProcessor::FeedrateProfile::cruise, Slic3r::GCodeProcessor::Trapezoid::cruise_feedrate, Slic3r::GCodeProcessor::Trapezoid::decelerate_after, Slic3r::GCodeProcessor::TimeBlock::distance, Slic3r::GCodeProcessor::FeedrateProfile::entry, Slic3r::GCodeProcessor::FeedrateProfile::exit, Slic3r::GCodeProcessor::TimeBlock::feedrate_profile, klipper_junction_flush, klipper_queue_priming, Slic3r::GCodeProcessor::TimeBlock::max_entry_speed, Slic3r::GCodeProcessor::TimeBlock::max_mcr_entry_speed_sqr, Slic3r::GCodeProcessor::TimeBlock::mcr_delta_v2, Slic3r::GCodeProcessor::TimeBlock::peak_cruise_v2, requested_accel_to_decel, Slic3r::sqr(), and Slic3r::GCodeProcessor::TimeBlock::trapezoid.

Referenced by calculate_time().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void Slic3r::GCodeProcessor::TimeMachine::reset ( )
374{
375 enabled = false;
376 acceleration = 0.0f;
377 max_acceleration = 0.0f;
380 travel_acceleration = 0.0f;
383 klipper = false;
388 time = 0.0f;
389 stop_times = std::vector<StopTime>();
390 curr.reset();
391 prev.reset();
392 gcode_time.reset();
393 blocks = std::vector<TimeBlock>();
394 g1_times_cache = std::vector<G1LinesCacheItem>();
395 first_layer_time = 0.0f;
396 prepare_time = 0.0f;
398}
State prev
Definition GCodeProcessor.hpp:832
float extrude_factor_override_percentage
Definition GCodeProcessor.hpp:814
float max_retract_acceleration
Definition GCodeProcessor.hpp:810
State curr
Definition GCodeProcessor.hpp:831
float travel_acceleration
Definition GCodeProcessor.hpp:811
float max_travel_acceleration
Definition GCodeProcessor.hpp:813
float retract_acceleration
Definition GCodeProcessor.hpp:808
float minimum_cruise_ratio
Definition GCodeProcessor.hpp:816
float acceleration
Definition GCodeProcessor.hpp:805
float max_acceleration
Definition GCodeProcessor.hpp:807

References acceleration, blocks, curr, enabled, extrude_factor_override_percentage, first_layer_time, g1_times_cache, gcode_time, klipper, klipper_junction_flush, klipper_queue_priming, m_additional_time_buffer, max_acceleration, max_retract_acceleration, max_travel_acceleration, minimum_cruise_ratio, prepare_time, prev, requested_accel_to_decel, retract_acceleration, stop_times, time, and travel_acceleration.

Member Data Documentation

◆ acceleration

float Slic3r::GCodeProcessor::TimeMachine::acceleration

◆ actual_speed_moves

std::vector<ActualSpeedMove> Slic3r::GCodeProcessor::TimeMachine::actual_speed_moves

◆ blocks

◆ curr

State Slic3r::GCodeProcessor::TimeMachine::curr

◆ enabled

◆ extrude_factor_override_percentage

float Slic3r::GCodeProcessor::TimeMachine::extrude_factor_override_percentage

◆ first_layer_time

float Slic3r::GCodeProcessor::TimeMachine::first_layer_time

Referenced by calculate_time(), and reset().

◆ g1_times_cache

std::vector<G1LinesCacheItem> Slic3r::GCodeProcessor::TimeMachine::g1_times_cache

◆ gcode_time

◆ klipper

bool Slic3r::GCodeProcessor::TimeMachine::klipper { false }

◆ klipper_junction_flush

float Slic3r::GCodeProcessor::TimeMachine::klipper_junction_flush { 1.0f }

◆ klipper_queue_priming

bool Slic3r::GCodeProcessor::TimeMachine::klipper_queue_priming { true }

◆ line_m73_main_mask

std::string Slic3r::GCodeProcessor::TimeMachine::line_m73_main_mask

◆ line_m73_stop_mask

std::string Slic3r::GCodeProcessor::TimeMachine::line_m73_stop_mask

◆ m_additional_time_buffer

AdditionalBuffer Slic3r::GCodeProcessor::TimeMachine::m_additional_time_buffer

Referenced by calculate_time(), and reset().

◆ max_acceleration

float Slic3r::GCodeProcessor::TimeMachine::max_acceleration

Referenced by reset().

◆ max_retract_acceleration

float Slic3r::GCodeProcessor::TimeMachine::max_retract_acceleration

Referenced by reset().

◆ max_travel_acceleration

float Slic3r::GCodeProcessor::TimeMachine::max_travel_acceleration

Referenced by reset().

◆ minimum_cruise_ratio

float Slic3r::GCodeProcessor::TimeMachine::minimum_cruise_ratio { 0.5f }

◆ prepare_time

float Slic3r::GCodeProcessor::TimeMachine::prepare_time

◆ prev

State Slic3r::GCodeProcessor::TimeMachine::prev

◆ requested_accel_to_decel

float Slic3r::GCodeProcessor::TimeMachine::requested_accel_to_decel { -1.0f }

◆ retract_acceleration

float Slic3r::GCodeProcessor::TimeMachine::retract_acceleration

Referenced by reset().

◆ stop_times

std::vector<StopTime> Slic3r::GCodeProcessor::TimeMachine::stop_times

◆ time

double Slic3r::GCodeProcessor::TimeMachine::time

◆ travel_acceleration

float Slic3r::GCodeProcessor::TimeMachine::travel_acceleration

The documentation for this struct was generated from the following files: