Use constants
parent
2f2f4d7be3
commit
64bd2bb894
|
|
@ -13,6 +13,7 @@ namespace logic {
|
||||||
void FeedToFinda::Reset(bool feedPhaseLimited) {
|
void FeedToFinda::Reset(bool feedPhaseLimited) {
|
||||||
state = EngagingIdler;
|
state = EngagingIdler;
|
||||||
this->feedPhaseLimited = feedPhaseLimited;
|
this->feedPhaseLimited = feedPhaseLimited;
|
||||||
|
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::Color::green, ml::Mode::blink0);
|
||||||
mi::idler.Engage(mg::globals.ActiveSlot());
|
mi::idler.Engage(mg::globals.ActiveSlot());
|
||||||
// We can't get any FINDA readings if the selector is at the wrong spot - move it accordingly if necessary
|
// We can't get any FINDA readings if the selector is at the wrong spot - move it accordingly if necessary
|
||||||
ms::selector.MoveToSlot(mg::globals.ActiveSlot());
|
ms::selector.MoveToSlot(mg::globals.ActiveSlot());
|
||||||
|
|
@ -23,8 +24,7 @@ bool FeedToFinda::Step() {
|
||||||
case EngagingIdler:
|
case EngagingIdler:
|
||||||
if (mi::idler.Engaged() && ms::selector.Slot() == mg::globals.ActiveSlot()) {
|
if (mi::idler.Engaged() && ms::selector.Slot() == mg::globals.ActiveSlot()) {
|
||||||
state = PushingFilament;
|
state = PushingFilament;
|
||||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::blink0);
|
mm::motion.PlanMove<mm::Pulley>(config::FeedToFINDA, config::pulleyFeedrate);
|
||||||
mm::motion.PlanMove(mm::Pulley, feedPhaseLimited ? 1500 : 32767, 4000); //@@TODO constants
|
|
||||||
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;
|
||||||
|
|
@ -33,7 +33,7 @@ bool FeedToFinda::Step() {
|
||||||
mm::motion.AbortPlannedMoves(); // stop pushing filament
|
mm::motion.AbortPlannedMoves(); // 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
|
||||||
state = UnloadBackToPTFE;
|
state = UnloadBackToPTFE;
|
||||||
mm::motion.PlanMove(mm::Pulley, -600, 4000); //@@TODO constants
|
mm::motion.PlanMove<mm::Pulley>(-config::CuttingEdgeToFINDAmidpoint, config::pulleyFeedrate);
|
||||||
} else if (mm::motion.QueueEmpty()) { // all moves have been finished and FINDA didn't switch on
|
} else if (mm::motion.QueueEmpty()) { // all moves have been finished and FINDA didn't switch on
|
||||||
state = Failed;
|
state = Failed;
|
||||||
// @@TODO - shall we disengage the idler?
|
// @@TODO - shall we disengage the idler?
|
||||||
|
|
@ -44,14 +44,14 @@ bool FeedToFinda::Step() {
|
||||||
return false;
|
return false;
|
||||||
case UnloadBackToPTFE:
|
case UnloadBackToPTFE:
|
||||||
if (mm::motion.QueueEmpty()) { // all moves have been finished
|
if (mm::motion.QueueEmpty()) { // all moves have been finished
|
||||||
// state = DisengagingIdler;
|
state = DisengagingIdler;
|
||||||
// mi::idler.Disengage();
|
mi::idler.Disengage();
|
||||||
// }
|
}
|
||||||
// return false;
|
return false;
|
||||||
// case DisengagingIdler:
|
case DisengagingIdler:
|
||||||
// if (!mi::idler.Engaged()) {
|
if (!mi::idler.Engaged()) {
|
||||||
state = OK;
|
state = OK;
|
||||||
// ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::on);
|
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::off);
|
||||||
}
|
}
|
||||||
// @@TODO FINDA must be reported as OFF again as we are pulling the filament from it - is this correct?
|
// @@TODO FINDA must be reported as OFF again as we are pulling the filament from it - is this correct?
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue