Fix+verify Cut filament unit test
it now finished ok, but future tweaks and improvements are expectedpull/26/head
parent
ede475c5a6
commit
1f8934c2c1
|
|
@ -15,10 +15,11 @@ bool Idler::Disengage() {
|
|||
if (state == Moving)
|
||||
return false;
|
||||
|
||||
plannedEngage = false;
|
||||
|
||||
if (!Engaged())
|
||||
return true;
|
||||
|
||||
plannedEngage = false;
|
||||
mm::motion.InitAxis(mm::Idler);
|
||||
// plan move to idle position
|
||||
// mm::motion.PlanMove(0, idle_position, 0, 1000, 0, 0); // @@TODO
|
||||
|
|
@ -30,11 +31,12 @@ bool Idler::Engage(uint8_t slot) {
|
|||
if (state == Moving)
|
||||
return false;
|
||||
|
||||
plannedSlot = slot;
|
||||
plannedEngage = true;
|
||||
|
||||
if (Engaged())
|
||||
return true;
|
||||
|
||||
plannedSlot = slot;
|
||||
plannedEngage = true;
|
||||
mm::motion.InitAxis(mm::Idler);
|
||||
// mm::motion.PlanMove(0, slotPositions[slot], 0, 1000, 0, 0); // @@TODO
|
||||
state = Moving;
|
||||
|
|
|
|||
|
|
@ -15,10 +15,11 @@ bool Selector::MoveToSlot(uint8_t slot) {
|
|||
if (state == Moving)
|
||||
return false;
|
||||
|
||||
plannedSlot = slot;
|
||||
|
||||
if (currentSlot == slot)
|
||||
return true;
|
||||
|
||||
plannedSlot = slot;
|
||||
mm::motion.InitAxis(mm::Selector);
|
||||
// mm::motion.PlanMove(1, slotPositions[slot], 0, 1000, 0, 0); // @@TODO
|
||||
state = Moving;
|
||||
|
|
|
|||
|
|
@ -49,10 +49,15 @@ TEST_CASE("cut_filament::cut0", "[cut_filament]") {
|
|||
|
||||
// idler and selector reached their target positions and the CF automaton will start feeding to FINDA as the next step
|
||||
REQUIRE(cf.State() == ProgressCode::FeedingToFinda);
|
||||
// prepare for simulated finda trigger
|
||||
hal::adc::ReinitADC(1, hal::adc::TADCData({ 0, 0, 0, 0, 600, 700, 800, 900 }), 10);
|
||||
REQUIRE(WhileCondition([&]() { return cf.State() == ProgressCode::FeedingToFinda; }, 50000));
|
||||
|
||||
// filament fed into FINDA, cutting...
|
||||
REQUIRE(cf.State() == ProgressCode::PreparingBlade);
|
||||
REQUIRE(WhileCondition([&]() { return cf.State() == ProgressCode::PreparingBlade; }, 5000));
|
||||
|
||||
REQUIRE(cf.State() == ProgressCode::EngagingIdler);
|
||||
REQUIRE(WhileCondition([&]() { return cf.State() == ProgressCode::EngagingIdler; }, 5000));
|
||||
|
||||
// the idler should be at the active slot @@TODO
|
||||
|
|
|
|||
Loading…
Reference in New Issue