X-Git-Url: http://git.hcoop.net/clinton/Smoothieware.git/blobdiff_plain/4cff3ded0e09a5461b0639b939a6cbc54312d5f5..7b49793df4770c6a0bf7a4b8b0d405b5f954b841:/src/modules/robot/Block.h?ds=sidebyside diff --git a/src/modules/robot/Block.h b/src/modules/robot/Block.h index fd61e913..ab2c2fd2 100644 --- a/src/modules/robot/Block.h +++ b/src/modules/robot/Block.h @@ -12,9 +12,13 @@ using namespace std; #include #include + #include "../communication/utils/Gcode.h" #include "Planner.h" class Planner; +class Player; + +double max_allowable_speed( double acceleration, double target_velocity, double distance); class Block { public: @@ -29,23 +33,39 @@ class Block { void append_gcode(Gcode* gcode); void pop_and_execute_gcode(Kernel* &kernel); double get_duration_left(unsigned int already_taken_steps); - vector commands; + void take(); + void release(); + void ready(); - unsigned short steps[3]; // Number of steps for each axis for this block - float speeds[3]; // Speeds for each axis, used in the planning process - unsigned short steps_event_count; // Steps for the longest axis + vector commands; + vector travel_distances; + vector gcodes; + + unsigned int steps[3]; // Number of steps for each axis for this block + unsigned int steps_event_count; // Steps for the longest axis unsigned int nominal_rate; // Nominal rate in steps per minute float nominal_speed; // Nominal speed in mm per minute float millimeters; // Distance for this move - float entry_factor; // Starting speed for the block - unsigned int rate_delta; // Nomber of steps to add to the speed for each acceleration tick + double entry_speed; + float rate_delta; // Nomber of steps to add to the speed for each acceleration tick unsigned int initial_rate; // Initial speed in steps per minute unsigned int final_rate; // Final speed in steps per minute - unsigned short accelerate_until; // Stop accelerating after this number of steps - unsigned short decelerate_after; // Start decelerating after this number of steps + unsigned int accelerate_until; // Stop accelerating after this number of steps + unsigned int decelerate_after; // Start decelerating after this number of steps unsigned int direction_bits; // Direction for each axis in bit form, relative to the direction port's mask + + uint8_t recalculate_flag; // Planner flag to recalculate trapezoids on entry junction + uint8_t nominal_length_flag; // Planner flag for nominal speed always reached + + double max_entry_speed; Planner* planner; + Player* player; + + bool is_ready; + + short times_taken; // A block can be "taken" by any number of modules, and the next block is not moved to until all the modules have "released" it. This value serves as a tracker. + };