Update eject_steps with the new unit API for demonstration

pull/71/head
Yuri D'Elia 2021-07-25 17:24:49 +02:00
parent 402a2b91ce
commit 49275b2cb2
2 changed files with 6 additions and 2 deletions

View File

@ -50,7 +50,7 @@ bool EjectFilament::Step() {
if (mm::motion.QueueEmpty()) { // selector parked aside if (mm::motion.QueueEmpty()) { // selector parked aside
state = ProgressCode::EjectingFilament; state = ProgressCode::EjectingFilament;
mm::motion.InitAxis(mm::Pulley); mm::motion.InitAxis(mm::Pulley);
mm::motion.PlanMove(mm::Pulley, ejectSteps, 1500); mm::motion.PlanMove<mm::Pulley>(ejectLenght, ejectSpeed);
} }
break; break;
case ProgressCode::EjectingFilament: case ProgressCode::EjectingFilament:

View File

@ -2,9 +2,14 @@
#include <stdint.h> #include <stdint.h>
#include "command_base.h" #include "command_base.h"
#include "unload_filament.h" #include "unload_filament.h"
#include "../modules/axisunit.h"
namespace logic { namespace logic {
// These cannot be class memebers without definition until c++17
static constexpr modules::motion::P_pos_t ejectLenght = 50.0_P_mm; //@@TODO
static constexpr modules::motion::P_speed_t ejectSpeed = 1000.0_P_mm_s; //@@TODO
/// @brief A high-level command state machine - handles the complex logic of ejecting filament /// @brief A high-level command state machine - handles the complex logic of ejecting filament
/// ///
/// The eject operation consists of: /// The eject operation consists of:
@ -31,7 +36,6 @@ public:
ErrorCode Error() const override; ErrorCode Error() const override;
private: private:
constexpr static const uint16_t ejectSteps = 500; //@@TODO
UnloadFilament unl; ///< a high-level command/operation may be used as a building block of other operations as well UnloadFilament unl; ///< a high-level command/operation may be used as a building block of other operations as well
uint8_t slot; uint8_t slot;
void MoveSelectorAside(); void MoveSelectorAside();