Make LoadFilament terminate completely OK when button pressed
parent
8ce029a28c
commit
bd95807b23
|
|
@ -7,6 +7,7 @@ target_sources(
|
|||
feed_to_finda.cpp
|
||||
home.cpp
|
||||
load_filament.cpp
|
||||
move_selector.cpp
|
||||
no_command.cpp
|
||||
retract_from_finda.cpp
|
||||
set_mode.cpp
|
||||
|
|
|
|||
|
|
@ -71,7 +71,8 @@ bool FeedToFinda::Step() {
|
|||
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InSelector);
|
||||
dbg_logic_P(PSTR("Feed to Finda --> Idler disengaged"));
|
||||
dbg_logic_fP(PSTR("Pulley end steps %u"), mpu::pulley.CurrentPositionPulley_mm());
|
||||
state = OK;
|
||||
state = mui::userInput.AnyEvent() ? Stopped : OK;
|
||||
mui::userInput.Clear();
|
||||
return true; // return immediately to allow for a seamless planning of another move (like feeding to bondtech)
|
||||
} else if (mm::motion.PlannedMoves(mm::Pulley) < 2) {
|
||||
// plan another move to make the illusion of unlimited moves
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ struct FeedToFinda {
|
|||
UnloadBackToPTFE,
|
||||
DisengagingIdler,
|
||||
OK,
|
||||
Failed
|
||||
Failed,
|
||||
Stopped
|
||||
};
|
||||
|
||||
inline FeedToFinda()
|
||||
|
|
|
|||
|
|
@ -58,12 +58,19 @@ bool LoadFilament::StepInner() {
|
|||
switch (state) {
|
||||
case ProgressCode::FeedingToFinda:
|
||||
if (feed.Step()) {
|
||||
if (feed.State() == FeedToFinda::Failed) {
|
||||
// @@TODO - try to repeat 6x - push/pull sequence - probably something to put into feed_to_finda as an option
|
||||
switch (feed.State()) {
|
||||
case FeedToFinda::Failed: // @@TODO - try to repeat 6x - push/pull sequence - probably something to put into feed_to_finda as an option
|
||||
GoToErrDisengagingIdler(ErrorCode::FINDA_DIDNT_SWITCH_ON); // signal loading error
|
||||
} else {
|
||||
break;
|
||||
case FeedToFinda::OK:
|
||||
state = ProgressCode::RetractingFromFinda;
|
||||
retract.Reset();
|
||||
break;
|
||||
case FeedToFinda::Stopped:
|
||||
// the user stopped the load for whatever reason
|
||||
// - we are considering the LoadFlament operation as completed
|
||||
state = ProgressCode::OK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue