#ifndef TIME_ESTIMATE_H #define TIME_ESTIMATE_H #include "settings.h" #include #include /** The TimeEstimateCalculator class generates a estimate of printing time calculated with acceleration in mind. Some of this code has been addapted from the Marlin sources. */ class TimeEstimateCalculator { public: const static unsigned int NUM_AXIS = 4; const static unsigned int X_AXIS = 0; const static unsigned int Y_AXIS = 1; const static unsigned int Z_AXIS = 2; const static unsigned int E_AXIS = 3; class Position { public: Position() {for(unsigned int n=0;n blocks; public: void applyAccelerationSettings(ConfigSettings& config); void setPosition(Position newPos); void plan(Position newPos, double feedRate); void reset(); double calculate(); private: void reverse_pass(); void forward_pass(); void recalculate_trapezoids(); void calculate_trapezoid_for_block(Block *block, double entry_factor, double exit_factor); void planner_reverse_pass_kernel(Block *previous, Block *current, Block *next); void planner_forward_pass_kernel(Block *previous, Block *current, Block *next); }; #endif//TIME_ESTIMATE_H