Rename mp (modules::pulley) namespace to mpu

clashed with the already used `modules::protocol` (mp)
pull/154/head
D.R.racer 2022-01-17 09:00:05 +01:00 committed by DRracer
parent b36e6b99a1
commit c5e5f57100
12 changed files with 27 additions and 27 deletions

View File

@ -120,7 +120,7 @@ bool CommandBase::WaitForModulesErrorRecovery() {
if (WaitForOneModuleErrorRecovery(CheckMovable(ms::selector), ms::selector)) if (WaitForOneModuleErrorRecovery(CheckMovable(ms::selector), ms::selector))
return true; return true;
if (WaitForOneModuleErrorRecovery(CheckMovable(mp::pulley), mp::pulley)) if (WaitForOneModuleErrorRecovery(CheckMovable(mpu::pulley), mpu::pulley))
return true; return true;
return false; return false;
@ -180,7 +180,7 @@ bool CommandBase::CheckToolIndex(uint8_t index) {
void CommandBase::ErrDisengagingIdler() { void CommandBase::ErrDisengagingIdler() {
if (!mi::idler.Engaged()) { if (!mi::idler.Engaged()) {
state = ProgressCode::ERRWaitingForUser; state = ProgressCode::ERRWaitingForUser;
mp::pulley.Disable(); mpu::pulley.Disable();
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
} }
} }

View File

@ -61,7 +61,7 @@ bool CutFilament::StepInner() {
} else { } else {
// unload back to the pulley // unload back to the pulley
state = ProgressCode::UnloadingToPulley; state = ProgressCode::UnloadingToPulley;
mp::pulley.PlanMove(-config::cutLength, config::pulleyUnloadFeedrate); mpu::pulley.PlanMove(-config::cutLength, config::pulleyUnloadFeedrate);
} }
} }
break; break;
@ -75,7 +75,7 @@ bool CutFilament::StepInner() {
case ProgressCode::PreparingBlade: case ProgressCode::PreparingBlade:
if (ms::selector.Slot() == cutSlot + 1) { if (ms::selector.Slot() == cutSlot + 1) {
state = ProgressCode::PushingFilament; state = ProgressCode::PushingFilament;
mp::pulley.PlanMove(config::cutLength, config::pulleyUnloadFeedrate); // mpu::pulley.PlanMove(config::cutLength, config::pulleyUnloadFeedrate); //
} }
break; break;
case ProgressCode::PushingFilament: case ProgressCode::PushingFilament:

View File

@ -54,8 +54,8 @@ bool EjectFilament::StepInner() {
case ProgressCode::ParkingSelector: case ProgressCode::ParkingSelector:
if (mm::motion.QueueEmpty()) { // selector parked aside if (mm::motion.QueueEmpty()) { // selector parked aside
state = ProgressCode::EjectingFilament; state = ProgressCode::EjectingFilament;
mp::pulley.InitAxis(); mpu::pulley.InitAxis();
mp::pulley.PlanMove(-config::filamentMinLoadedToMMU, config::pulleySlowFeedrate); mpu::pulley.PlanMove(-config::filamentMinLoadedToMMU, config::pulleySlowFeedrate);
} }
break; break;
case ProgressCode::EjectingFilament: case ProgressCode::EjectingFilament:
@ -66,7 +66,7 @@ bool EjectFilament::StepInner() {
break; break;
case ProgressCode::DisengagingIdler: case ProgressCode::DisengagingIdler:
if (!mi::idler.Engaged()) { // idler disengaged if (!mi::idler.Engaged()) { // idler disengaged
mp::pulley.Disable(); mpu::pulley.Disable();
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::NotLoaded); mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::NotLoaded);
state = ProgressCode::OK; state = ProgressCode::OK;
error = ErrorCode::OK; error = ErrorCode::OK;

View File

@ -24,7 +24,7 @@ void logic::FeedToBondtech::GoToPushToNozzle() {
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InFSensor); mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InFSensor);
// plan a slow move to help push filament into the nozzle // plan a slow move to help push filament into the nozzle
//@@TODO the speed in mm/s must correspond to printer's feeding speed! //@@TODO the speed in mm/s must correspond to printer's feeding speed!
mp::pulley.PlanMove(config::fsensorToNozzle, config::pulleySlowFeedrate); mpu::pulley.PlanMove(config::fsensorToNozzle, config::pulleySlowFeedrate);
state = PushingFilamentIntoNozzle; state = PushingFilamentIntoNozzle;
} }
@ -35,8 +35,8 @@ bool FeedToBondtech::Step() {
dbg_logic_P(PSTR("Feed to Bondtech --> Idler engaged")); dbg_logic_P(PSTR("Feed to Bondtech --> Idler engaged"));
dbg_logic_fP(PSTR("Pulley start steps %u"), mm::motion.CurPosition(mm::Pulley)); dbg_logic_fP(PSTR("Pulley start steps %u"), mm::motion.CurPosition(mm::Pulley));
state = PushingFilamentToFSensor; state = PushingFilamentToFSensor;
mp::pulley.InitAxis(); mpu::pulley.InitAxis();
mp::pulley.PlanMove(config::defaultBowdenLength, config::pulleyLoadFeedrate, config::pulleySlowFeedrate); mpu::pulley.PlanMove(config::defaultBowdenLength, config::pulleyLoadFeedrate, config::pulleySlowFeedrate);
} }
return false; return false;
case PushingFilamentToFSensor: case PushingFilamentToFSensor:
@ -56,7 +56,7 @@ bool FeedToBondtech::Step() {
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InNozzle); mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InNozzle);
mi::idler.Disengage(); mi::idler.Disengage();
// while disengaging the idler, keep on moving with the pulley to avoid grinding while the printer is trying to grab the filament itself // while disengaging the idler, keep on moving with the pulley to avoid grinding while the printer is trying to grab the filament itself
mp::pulley.PlanMove(config::fsensorToNozzleAvoidGrind, config::pulleySlowFeedrate); mpu::pulley.PlanMove(config::fsensorToNozzleAvoidGrind, config::pulleySlowFeedrate);
state = DisengagingIdler; state = DisengagingIdler;
} }
return false; return false;
@ -65,7 +65,7 @@ bool FeedToBondtech::Step() {
dbg_logic_P(PSTR("Feed to Bondtech --> Idler disengaged")); dbg_logic_P(PSTR("Feed to Bondtech --> Idler disengaged"));
dbg_logic_fP(PSTR("Pulley end steps %u"), mm::motion.CurPosition(mm::Pulley)); dbg_logic_fP(PSTR("Pulley end steps %u"), mm::motion.CurPosition(mm::Pulley));
state = OK; state = OK;
mp::pulley.Disable(); mpu::pulley.Disable();
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::on); ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::on);
} }
return false; return false;

View File

@ -30,12 +30,12 @@ bool FeedToFinda::Step() {
dbg_logic_P(PSTR("Feed to Finda --> Idler engaged")); dbg_logic_P(PSTR("Feed to Finda --> Idler engaged"));
dbg_logic_fP(PSTR("Pulley start steps %u"), mm::motion.CurPosition(mm::Pulley)); dbg_logic_fP(PSTR("Pulley start steps %u"), mm::motion.CurPosition(mm::Pulley));
state = PushingFilament; state = PushingFilament;
mp::pulley.InitAxis(); mpu::pulley.InitAxis();
// @@TODO this may never happen as load filament always assumes the filament is at least at the pulley // @@TODO this may never happen as load filament always assumes the filament is at least at the pulley
// if (mg::globals.FilamentLoaded() == mg::FilamentLoadState::NotLoaded) { // feed slowly filament to PTFE // if (mg::globals.FilamentLoaded() == mg::FilamentLoadState::NotLoaded) { // feed slowly filament to PTFE
// mp::pulley.PlanMove(config::filamentMinLoadedToMMU, config::pulleySlowFeedrate); // mp::pulley.PlanMove(config::filamentMinLoadedToMMU, config::pulleySlowFeedrate);
// } // }
mp::pulley.PlanMove(config::maximumFeedToFinda, config::pulleySlowFeedrate); mpu::pulley.PlanMove(config::maximumFeedToFinda, config::pulleySlowFeedrate);
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InSelector); 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
} }

View File

@ -42,7 +42,7 @@ void logic::LoadFilament::FinishedCorrectly() {
state = ProgressCode::OK; state = ProgressCode::OK;
error = ErrorCode::OK; error = ErrorCode::OK;
ml::leds.SetPairButOffOthers(mg::globals.ActiveSlot(), ml::off, ml::off); ml::leds.SetPairButOffOthers(mg::globals.ActiveSlot(), ml::off, ml::off);
mp::pulley.Disable(); mpu::pulley.Disable();
} }
bool LoadFilament::StepInner() { bool LoadFilament::StepInner() {
@ -118,7 +118,7 @@ bool LoadFilament::StepInner() {
case ProgressCode::ERREngagingIdler: case ProgressCode::ERREngagingIdler:
if (mi::idler.Engaged()) { if (mi::idler.Engaged()) {
state = ProgressCode::ERRHelpingFilament; state = ProgressCode::ERRHelpingFilament;
mp::pulley.PlanMove(config::pulleyHelperMove, config::pulleySlowFeedrate); mpu::pulley.PlanMove(config::pulleyHelperMove, config::pulleySlowFeedrate);
} }
return false; return false;
case ProgressCode::ERRHelpingFilament: case ProgressCode::ERRHelpingFilament:

View File

@ -23,7 +23,7 @@ bool RetractFromFinda::Step() {
if (mi::idler.Engaged()) { if (mi::idler.Engaged()) {
dbg_logic_fP(PSTR("Pulley start steps %u"), mm::motion.CurPosition(mm::Pulley)); dbg_logic_fP(PSTR("Pulley start steps %u"), mm::motion.CurPosition(mm::Pulley));
state = UnloadBackToPTFE; state = UnloadBackToPTFE;
mp::pulley.PlanMove(-(config::cuttingEdgeToFindaMidpoint + config::cuttingEdgeRetract), config::pulleyUnloadFeedrate); mpu::pulley.PlanMove(-(config::cuttingEdgeToFindaMidpoint + config::cuttingEdgeRetract), config::pulleyUnloadFeedrate);
} }
return false; return false;
case UnloadBackToPTFE: case UnloadBackToPTFE:

View File

@ -133,7 +133,7 @@ bool ToolChange::StepInner() {
case ProgressCode::ERREngagingIdler: case ProgressCode::ERREngagingIdler:
if (mi::idler.Engaged()) { if (mi::idler.Engaged()) {
state = ProgressCode::ERRHelpingFilament; state = ProgressCode::ERRHelpingFilament;
mp::pulley.PlanMove(config::pulleyHelperMove, config::pulleySlowFeedrate); mpu::pulley.PlanMove(config::pulleyHelperMove, config::pulleySlowFeedrate);
} }
return false; return false;
case ProgressCode::ERRHelpingFilament: case ProgressCode::ERRHelpingFilament:

View File

@ -25,7 +25,7 @@ void UnloadFilament::Reset(uint8_t /*param*/) {
} }
// unloads filament from extruder - filament is above Bondtech gears // unloads filament from extruder - filament is above Bondtech gears
mp::pulley.InitAxis(); mpu::pulley.InitAxis();
state = ProgressCode::UnloadingToFinda; state = ProgressCode::UnloadingToFinda;
error = ErrorCode::RUNNING; error = ErrorCode::RUNNING;
unl.Reset(maxRetries); unl.Reset(maxRetries);
@ -35,7 +35,7 @@ void UnloadFilament::Reset(uint8_t /*param*/) {
void UnloadFilament::FinishedCorrectly() { void UnloadFilament::FinishedCorrectly() {
state = ProgressCode::OK; state = ProgressCode::OK;
error = ErrorCode::OK; error = ErrorCode::OK;
mp::pulley.Disable(); mpu::pulley.Disable();
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::AtPulley); // filament unloaded mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::AtPulley); // filament unloaded
ml::leds.SetPairButOffOthers(mg::globals.ActiveSlot(), ml::off, ml::off); ml::leds.SetPairButOffOthers(mg::globals.ActiveSlot(), ml::off, ml::off);
} }
@ -133,7 +133,7 @@ bool UnloadFilament::StepInner() {
case ProgressCode::ERREngagingIdler: case ProgressCode::ERREngagingIdler:
if (mi::idler.Engaged()) { if (mi::idler.Engaged()) {
state = ProgressCode::ERRHelpingFilament; state = ProgressCode::ERRHelpingFilament;
mp::pulley.PlanMove(-config::pulleyHelperMove, config::pulleySlowFeedrate); mpu::pulley.PlanMove(-config::pulleyHelperMove, config::pulleySlowFeedrate);
} }
return false; return false;
case ProgressCode::ERRHelpingFilament: case ProgressCode::ERRHelpingFilament:

View File

@ -33,7 +33,7 @@ bool UnloadToFinda::Step() {
case EngagingIdler: case EngagingIdler:
if (mg::globals.FilamentLoaded() >= mg::FilamentLoadState::InSelector) { if (mg::globals.FilamentLoaded() >= mg::FilamentLoadState::InSelector) {
state = UnloadingToFinda; state = UnloadingToFinda;
mp::pulley.InitAxis(); mpu::pulley.InitAxis();
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::blink0); ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::blink0);
} else { } else {
state = FailedFINDA; state = FailedFINDA;
@ -43,8 +43,8 @@ bool UnloadToFinda::Step() {
if (mi::idler.Engaged()) { if (mi::idler.Engaged()) {
state = WaitingForFINDA; state = WaitingForFINDA;
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InSelector); mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InSelector);
unloadStart_mm = mp::pulley.CurrentPositionPulley_mm(); unloadStart_mm = mpu::pulley.CurrentPositionPulley_mm();
mp::pulley.PlanMove(-config::defaultBowdenLength - config::feedToFinda - config::filamentMinLoadedToMMU, config::pulleyUnloadFeedrate); mpu::pulley.PlanMove(-config::defaultBowdenLength - config::feedToFinda - config::filamentMinLoadedToMMU, config::pulleyUnloadFeedrate);
} }
return false; return false;
case WaitingForFINDA: { case WaitingForFINDA: {

View File

@ -47,4 +47,4 @@ extern Pulley pulley;
} // namespace pulley } // namespace pulley
} // namespace modules } // namespace modules
namespace mp = modules::pulley; namespace mpu = modules::pulley;

View File

@ -27,7 +27,7 @@ void main_loop() {
mf::finda.Step(); mf::finda.Step();
mfs::fsensor.Step(); mfs::fsensor.Step();
mi::idler.Step(); mi::idler.Step();
mp::pulley.Step(); mpu::pulley.Step();
ms::selector.Step(); ms::selector.Step();
mm::motion.Step(); mm::motion.Step();
mui::userInput.Step(); mui::userInput.Step();
@ -52,7 +52,7 @@ void ForceReinitAllAutomata() {
new (&mf::finda) mf::FINDA(); new (&mf::finda) mf::FINDA();
new (&mfs::fsensor) mfs::FSensor(); new (&mfs::fsensor) mfs::FSensor();
new (&mi::idler) mi::Idler(); new (&mi::idler) mi::Idler();
new (&mp::pulley) mp::Pulley(); new (&mpu::pulley) mpu::Pulley();
new (&ms::selector) ms::Selector(); new (&ms::selector) ms::Selector();
new (&mm::motion) mm::Motion(); new (&mm::motion) mm::Motion();