Fix unit test load_fail_FINDA_resolve_btnL

If helping the filament triggers FINDA
we should set loading state to InSelector
pull/249/head
Guðni Már Gilbert 2022-12-11 15:15:16 +00:00
parent 7e2528d675
commit bf9fec6941
2 changed files with 5 additions and 1 deletions

View File

@ -200,6 +200,7 @@ bool ToolChange::StepInner() {
// @@TODO helping filament needs improvement - the filament should try to move forward as long as the button is pressed
if (mf::finda.Pressed()) {
// the help was enough to press the FINDA, we are ok, continue normally
mg::globals.SetFilamentLoaded(plannedSlot, mg::FilamentLoadState::InSelector);
GoToFeedingToBondtech();
} else if (mfs::fsensor.Pressed()) {
// the help was enough to press the filament sensor, we are ok, continue normally

View File

@ -215,12 +215,15 @@ void ToolChangeFailLoadToFinda(logic::ToolChange &tc, uint8_t fromSlot, uint8_t
void ToolChangeFailLoadToFindaLeftBtn(logic::ToolChange &tc, uint8_t toSlot) {
// now waiting for user input
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::Left, true);
REQUIRE(WhileTopState(tc, ProgressCode::ERREngagingIdler, 5000UL));
ClearButtons(tc);
REQUIRE(VerifyState(tc, mg::FilamentLoadState::InSelector, toSlot, toSlot, false, true, ml::off, ml::blink0, ErrorCode::RUNNING, ProgressCode::ERRHelpingFilament));
REQUIRE(VerifyState(tc, mg::FilamentLoadState::AtPulley, toSlot, toSlot, false, true, ml::off, ml::blink0, ErrorCode::RUNNING, ProgressCode::ERRHelpingFilament));
// try push more, if FINDA triggers, continue loading
REQUIRE(WhileCondition(