Rename Motion::CurrentPos to Position()
This matches PulseGen::Position() and avoids confusion around the term "current": Position() returns the head position in the queue, not the "live" axis position. We have PulseGen::CurPosition() now for this purpose, although we don't expose it to Motion yet.pull/47/head
parent
9bb1bf4a53
commit
98845008aa
|
|
@ -22,7 +22,7 @@ bool Idler::Disengage() {
|
|||
|
||||
mm::motion.InitAxis(mm::Idler);
|
||||
// plan move to idle position
|
||||
mm::motion.PlanMove(mm::Idler, config::idlerSlotPositions[IdleSlotIndex()] - mm::motion.CurrentPos(mm::Idler), 1000); // @@TODO
|
||||
mm::motion.PlanMove(mm::Idler, config::idlerSlotPositions[IdleSlotIndex()] - mm::motion.Position(mm::Idler), 1000); // @@TODO
|
||||
state = Moving;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ bool Idler::Engage(uint8_t slot) {
|
|||
return true;
|
||||
|
||||
mm::motion.InitAxis(mm::Idler);
|
||||
mm::motion.PlanMove(mm::Idler, config::idlerSlotPositions[slot] - mm::motion.CurrentPos(mm::Idler), 1000); // @@TODO
|
||||
mm::motion.PlanMove(mm::Idler, config::idlerSlotPositions[slot] - mm::motion.Position(mm::Idler), 1000); // @@TODO
|
||||
state = Moving;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ void Motion::PlanMoveTo(Axis axis, pos_t pos, steps_t feedrate) {
|
|||
}
|
||||
}
|
||||
|
||||
pos_t Motion::CurrentPos(Axis axis) const {
|
||||
pos_t Motion::Position(Axis axis) const {
|
||||
return axisData[axis].ctrl.Position();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,12 +112,12 @@ public:
|
|||
/// @param delta relative to current position
|
||||
/// @param feedrate maximum feedrate
|
||||
void PlanMove(Axis axis, pos_t delta, steps_t feedrate) {
|
||||
PlanMoveTo(axis, CurrentPos(axis) + delta, feedrate);
|
||||
PlanMoveTo(axis, Position(axis) + delta, feedrate);
|
||||
}
|
||||
|
||||
/// @returns current position of an axis
|
||||
/// @returns head position of an axis (last enqueued position)
|
||||
/// @param axis axis affected
|
||||
pos_t CurrentPos(Axis axis) const;
|
||||
pos_t Position(Axis axis) const;
|
||||
|
||||
/// Set acceleration for the selected axis
|
||||
/// @param axis axis affected
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ bool Selector::MoveToSlot(uint8_t slot) {
|
|||
return true;
|
||||
|
||||
mm::motion.InitAxis(mm::Selector);
|
||||
mm::motion.PlanMove(mm::Selector, config::selectorSlotPositions[slot] - mm::motion.CurrentPos(mm::Selector), 1000); // @@TODO
|
||||
mm::motion.PlanMove(mm::Selector, config::selectorSlotPositions[slot] - mm::motion.Position(mm::Selector), 1000); // @@TODO
|
||||
state = Moving;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ void Motion::PlanMoveTo(Axis axis, pos_t pos, steps_t feedrate) {
|
|||
axes[axis].targetPos = pos;
|
||||
}
|
||||
|
||||
pos_t Motion::CurrentPos(Axis axis) const {
|
||||
pos_t Motion::Position(Axis axis) const {
|
||||
return axes[axis].pos;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue