Fix unit test load_fail_FINDA_resolve_btnM
- If FINDA was not pressed, filament load state should be AtPulley - When a user presses the middle button, the pulley motor should be enabled =>feeding startedpull/249/head
parent
26be20e9aa
commit
7e2528d675
|
|
@ -53,7 +53,6 @@ bool FeedToFinda::Step() {
|
||||||
// one move has already been planned above, this is the second one
|
// one move has already been planned above, this is the second one
|
||||||
mpu::pulley.PlanMove(config::maximumFeedToFinda, config::pulleySlowFeedrate);
|
mpu::pulley.PlanMove(config::maximumFeedToFinda, config::pulleySlowFeedrate);
|
||||||
}
|
}
|
||||||
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InSelector);
|
|
||||||
mui::userInput.Clear(); // remove all buffered events if any just before we wait for some input
|
mui::userInput.Clear(); // remove all buffered events if any just before we wait for some input
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -77,7 +76,9 @@ bool FeedToFinda::Step() {
|
||||||
if (mf::finda.Pressed() || mui::userInput.AnyEvent()) {
|
if (mf::finda.Pressed() || mui::userInput.AnyEvent()) {
|
||||||
mm::motion.AbortPlannedMoves(haltAtEnd); // stop pushing filament
|
mm::motion.AbortPlannedMoves(haltAtEnd); // stop pushing filament
|
||||||
// FINDA triggered - that means it works and detected the filament tip
|
// FINDA triggered - that means it works and detected the filament tip
|
||||||
|
if (mf::finda.Pressed()) {
|
||||||
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InSelector);
|
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InSelector);
|
||||||
|
}
|
||||||
dbg_logic_P(PSTR("Feed to Finda --> Idler disengaged"));
|
dbg_logic_P(PSTR("Feed to Finda --> Idler disengaged"));
|
||||||
dbg_logic_fP(PSTR("Pulley end steps %u"), mpu::pulley.CurrentPosition_mm());
|
dbg_logic_fP(PSTR("Pulley end steps %u"), mpu::pulley.CurrentPosition_mm());
|
||||||
state = mui::userInput.AnyEvent() ? Stopped : OK;
|
state = mui::userInput.AnyEvent() ? Stopped : OK;
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ void ToolChangeFailLoadToFinda(logic::ToolChange &tc, uint8_t fromSlot, uint8_t
|
||||||
REQUIRE(WhileTopState(tc, ProgressCode::FeedingToFinda, 50000UL));
|
REQUIRE(WhileTopState(tc, ProgressCode::FeedingToFinda, 50000UL));
|
||||||
|
|
||||||
// should end up in error disengage idler
|
// should end up in error disengage idler
|
||||||
REQUIRE(VerifyState(tc, mg::FilamentLoadState::InSelector, toSlot, toSlot, false, true, ml::off, ml::blink0, ErrorCode::RUNNING, ProgressCode::ERRDisengagingIdler));
|
REQUIRE(VerifyState(tc, mg::FilamentLoadState::AtPulley, toSlot, toSlot, false, true, ml::off, ml::blink0, ErrorCode::RUNNING, ProgressCode::ERRDisengagingIdler));
|
||||||
|
|
||||||
SimulateErrDisengagingIdler(tc, ErrorCode::FINDA_DIDNT_SWITCH_ON);
|
SimulateErrDisengagingIdler(tc, ErrorCode::FINDA_DIDNT_SWITCH_ON);
|
||||||
}
|
}
|
||||||
|
|
@ -242,13 +242,16 @@ void ToolChangeFailLoadToFindaLeftBtn(logic::ToolChange &tc, uint8_t toSlot) {
|
||||||
void ToolChangeFailLoadToFindaMiddleBtn(logic::ToolChange &tc, uint8_t toSlot) {
|
void ToolChangeFailLoadToFindaMiddleBtn(logic::ToolChange &tc, uint8_t toSlot) {
|
||||||
// now waiting for user input
|
// now waiting for user input
|
||||||
REQUIRE_FALSE(mui::userInput.AnyEvent());
|
REQUIRE_FALSE(mui::userInput.AnyEvent());
|
||||||
|
|
||||||
|
REQUIRE(VerifyState(tc, mg::FilamentLoadState::AtPulley, mi::idler.IdleSlotIndex(), toSlot, false, false, ml::off, ml::blink0, ErrorCode::FINDA_DIDNT_SWITCH_ON, ProgressCode::ERRWaitingForUser));
|
||||||
|
|
||||||
PressButtonAndDebounce(tc, mb::Middle, true);
|
PressButtonAndDebounce(tc, mb::Middle, true);
|
||||||
|
|
||||||
REQUIRE_FALSE(mi::idler.HomingValid());
|
REQUIRE_FALSE(mi::idler.HomingValid());
|
||||||
REQUIRE_FALSE(ms::selector.HomingValid());
|
REQUIRE_FALSE(ms::selector.HomingValid());
|
||||||
SimulateIdlerAndSelectorHoming(tc); // failed load to FINDA = nothing blocking the selector - it can rehome
|
SimulateIdlerAndSelectorHoming(tc); // failed load to FINDA = nothing blocking the selector - it can rehome
|
||||||
|
|
||||||
REQUIRE(VerifyState(tc, mg::FilamentLoadState::AtPulley, mi::Idler::IdleSlotIndex(), toSlot, false, false, ml::blink0, ml::off, ErrorCode::RUNNING, ProgressCode::FeedingToFinda));
|
REQUIRE(VerifyState(tc, mg::FilamentLoadState::AtPulley, mi::Idler::IdleSlotIndex(), toSlot, false, true, ml::blink0, ml::off, ErrorCode::RUNNING, ProgressCode::FeedingToFinda));
|
||||||
|
|
||||||
ClearButtons(tc);
|
ClearButtons(tc);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue