From c5e5f57100756cd8cdba957e20742e8386aa5be1 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Mon, 17 Jan 2022 09:00:05 +0100 Subject: [PATCH] Rename mp (modules::pulley) namespace to mpu clashed with the already used `modules::protocol` (mp) --- src/logic/command_base.cpp | 4 ++-- src/logic/cut_filament.cpp | 4 ++-- src/logic/eject_filament.cpp | 6 +++--- src/logic/feed_to_bondtech.cpp | 10 +++++----- src/logic/feed_to_finda.cpp | 4 ++-- src/logic/load_filament.cpp | 4 ++-- src/logic/retract_from_finda.cpp | 2 +- src/logic/tool_change.cpp | 2 +- src/logic/unload_filament.cpp | 6 +++--- src/logic/unload_to_finda.cpp | 6 +++--- src/modules/pulley.h | 2 +- tests/unit/logic/stubs/main_loop_stub.cpp | 4 ++-- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/logic/command_base.cpp b/src/logic/command_base.cpp index 9de4ad3..d27e385 100644 --- a/src/logic/command_base.cpp +++ b/src/logic/command_base.cpp @@ -120,7 +120,7 @@ bool CommandBase::WaitForModulesErrorRecovery() { if (WaitForOneModuleErrorRecovery(CheckMovable(ms::selector), ms::selector)) return true; - if (WaitForOneModuleErrorRecovery(CheckMovable(mp::pulley), mp::pulley)) + if (WaitForOneModuleErrorRecovery(CheckMovable(mpu::pulley), mpu::pulley)) return true; return false; @@ -180,7 +180,7 @@ bool CommandBase::CheckToolIndex(uint8_t index) { void CommandBase::ErrDisengagingIdler() { if (!mi::idler.Engaged()) { 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 } } diff --git a/src/logic/cut_filament.cpp b/src/logic/cut_filament.cpp index cef5258..304b997 100644 --- a/src/logic/cut_filament.cpp +++ b/src/logic/cut_filament.cpp @@ -61,7 +61,7 @@ bool CutFilament::StepInner() { } else { // unload back to the pulley state = ProgressCode::UnloadingToPulley; - mp::pulley.PlanMove(-config::cutLength, config::pulleyUnloadFeedrate); + mpu::pulley.PlanMove(-config::cutLength, config::pulleyUnloadFeedrate); } } break; @@ -75,7 +75,7 @@ bool CutFilament::StepInner() { case ProgressCode::PreparingBlade: if (ms::selector.Slot() == cutSlot + 1) { state = ProgressCode::PushingFilament; - mp::pulley.PlanMove(config::cutLength, config::pulleyUnloadFeedrate); // + mpu::pulley.PlanMove(config::cutLength, config::pulleyUnloadFeedrate); // } break; case ProgressCode::PushingFilament: diff --git a/src/logic/eject_filament.cpp b/src/logic/eject_filament.cpp index 095d28e..de62f15 100644 --- a/src/logic/eject_filament.cpp +++ b/src/logic/eject_filament.cpp @@ -54,8 +54,8 @@ bool EjectFilament::StepInner() { case ProgressCode::ParkingSelector: if (mm::motion.QueueEmpty()) { // selector parked aside state = ProgressCode::EjectingFilament; - mp::pulley.InitAxis(); - mp::pulley.PlanMove(-config::filamentMinLoadedToMMU, config::pulleySlowFeedrate); + mpu::pulley.InitAxis(); + mpu::pulley.PlanMove(-config::filamentMinLoadedToMMU, config::pulleySlowFeedrate); } break; case ProgressCode::EjectingFilament: @@ -66,7 +66,7 @@ bool EjectFilament::StepInner() { break; case ProgressCode::DisengagingIdler: if (!mi::idler.Engaged()) { // idler disengaged - mp::pulley.Disable(); + mpu::pulley.Disable(); mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::NotLoaded); state = ProgressCode::OK; error = ErrorCode::OK; diff --git a/src/logic/feed_to_bondtech.cpp b/src/logic/feed_to_bondtech.cpp index 23e1aba..9494ce3 100644 --- a/src/logic/feed_to_bondtech.cpp +++ b/src/logic/feed_to_bondtech.cpp @@ -24,7 +24,7 @@ void logic::FeedToBondtech::GoToPushToNozzle() { mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InFSensor); // plan a slow move to help push filament into the nozzle //@@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; } @@ -35,8 +35,8 @@ bool FeedToBondtech::Step() { dbg_logic_P(PSTR("Feed to Bondtech --> Idler engaged")); dbg_logic_fP(PSTR("Pulley start steps %u"), mm::motion.CurPosition(mm::Pulley)); state = PushingFilamentToFSensor; - mp::pulley.InitAxis(); - mp::pulley.PlanMove(config::defaultBowdenLength, config::pulleyLoadFeedrate, config::pulleySlowFeedrate); + mpu::pulley.InitAxis(); + mpu::pulley.PlanMove(config::defaultBowdenLength, config::pulleyLoadFeedrate, config::pulleySlowFeedrate); } return false; case PushingFilamentToFSensor: @@ -56,7 +56,7 @@ bool FeedToBondtech::Step() { mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InNozzle); 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 - mp::pulley.PlanMove(config::fsensorToNozzleAvoidGrind, config::pulleySlowFeedrate); + mpu::pulley.PlanMove(config::fsensorToNozzleAvoidGrind, config::pulleySlowFeedrate); state = DisengagingIdler; } return false; @@ -65,7 +65,7 @@ bool FeedToBondtech::Step() { dbg_logic_P(PSTR("Feed to Bondtech --> Idler disengaged")); dbg_logic_fP(PSTR("Pulley end steps %u"), mm::motion.CurPosition(mm::Pulley)); state = OK; - mp::pulley.Disable(); + mpu::pulley.Disable(); ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::on); } return false; diff --git a/src/logic/feed_to_finda.cpp b/src/logic/feed_to_finda.cpp index b709f44..faeda42 100644 --- a/src/logic/feed_to_finda.cpp +++ b/src/logic/feed_to_finda.cpp @@ -30,12 +30,12 @@ bool FeedToFinda::Step() { dbg_logic_P(PSTR("Feed to Finda --> Idler engaged")); dbg_logic_fP(PSTR("Pulley start steps %u"), mm::motion.CurPosition(mm::Pulley)); 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 // if (mg::globals.FilamentLoaded() == mg::FilamentLoadState::NotLoaded) { // feed slowly filament to PTFE // 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); mui::userInput.Clear(); // remove all buffered events if any just before we wait for some input } diff --git a/src/logic/load_filament.cpp b/src/logic/load_filament.cpp index f190783..d617aaa 100644 --- a/src/logic/load_filament.cpp +++ b/src/logic/load_filament.cpp @@ -42,7 +42,7 @@ void logic::LoadFilament::FinishedCorrectly() { state = ProgressCode::OK; error = ErrorCode::OK; ml::leds.SetPairButOffOthers(mg::globals.ActiveSlot(), ml::off, ml::off); - mp::pulley.Disable(); + mpu::pulley.Disable(); } bool LoadFilament::StepInner() { @@ -118,7 +118,7 @@ bool LoadFilament::StepInner() { case ProgressCode::ERREngagingIdler: if (mi::idler.Engaged()) { state = ProgressCode::ERRHelpingFilament; - mp::pulley.PlanMove(config::pulleyHelperMove, config::pulleySlowFeedrate); + mpu::pulley.PlanMove(config::pulleyHelperMove, config::pulleySlowFeedrate); } return false; case ProgressCode::ERRHelpingFilament: diff --git a/src/logic/retract_from_finda.cpp b/src/logic/retract_from_finda.cpp index 8f16879..9c1cb27 100644 --- a/src/logic/retract_from_finda.cpp +++ b/src/logic/retract_from_finda.cpp @@ -23,7 +23,7 @@ bool RetractFromFinda::Step() { if (mi::idler.Engaged()) { dbg_logic_fP(PSTR("Pulley start steps %u"), mm::motion.CurPosition(mm::Pulley)); state = UnloadBackToPTFE; - mp::pulley.PlanMove(-(config::cuttingEdgeToFindaMidpoint + config::cuttingEdgeRetract), config::pulleyUnloadFeedrate); + mpu::pulley.PlanMove(-(config::cuttingEdgeToFindaMidpoint + config::cuttingEdgeRetract), config::pulleyUnloadFeedrate); } return false; case UnloadBackToPTFE: diff --git a/src/logic/tool_change.cpp b/src/logic/tool_change.cpp index d48df22..769cd56 100644 --- a/src/logic/tool_change.cpp +++ b/src/logic/tool_change.cpp @@ -133,7 +133,7 @@ bool ToolChange::StepInner() { case ProgressCode::ERREngagingIdler: if (mi::idler.Engaged()) { state = ProgressCode::ERRHelpingFilament; - mp::pulley.PlanMove(config::pulleyHelperMove, config::pulleySlowFeedrate); + mpu::pulley.PlanMove(config::pulleyHelperMove, config::pulleySlowFeedrate); } return false; case ProgressCode::ERRHelpingFilament: diff --git a/src/logic/unload_filament.cpp b/src/logic/unload_filament.cpp index fe55b90..d9f8921 100644 --- a/src/logic/unload_filament.cpp +++ b/src/logic/unload_filament.cpp @@ -25,7 +25,7 @@ void UnloadFilament::Reset(uint8_t /*param*/) { } // unloads filament from extruder - filament is above Bondtech gears - mp::pulley.InitAxis(); + mpu::pulley.InitAxis(); state = ProgressCode::UnloadingToFinda; error = ErrorCode::RUNNING; unl.Reset(maxRetries); @@ -35,7 +35,7 @@ void UnloadFilament::Reset(uint8_t /*param*/) { void UnloadFilament::FinishedCorrectly() { state = ProgressCode::OK; error = ErrorCode::OK; - mp::pulley.Disable(); + mpu::pulley.Disable(); mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::AtPulley); // filament unloaded ml::leds.SetPairButOffOthers(mg::globals.ActiveSlot(), ml::off, ml::off); } @@ -133,7 +133,7 @@ bool UnloadFilament::StepInner() { case ProgressCode::ERREngagingIdler: if (mi::idler.Engaged()) { state = ProgressCode::ERRHelpingFilament; - mp::pulley.PlanMove(-config::pulleyHelperMove, config::pulleySlowFeedrate); + mpu::pulley.PlanMove(-config::pulleyHelperMove, config::pulleySlowFeedrate); } return false; case ProgressCode::ERRHelpingFilament: diff --git a/src/logic/unload_to_finda.cpp b/src/logic/unload_to_finda.cpp index 3644c58..c78ee24 100644 --- a/src/logic/unload_to_finda.cpp +++ b/src/logic/unload_to_finda.cpp @@ -33,7 +33,7 @@ bool UnloadToFinda::Step() { case EngagingIdler: if (mg::globals.FilamentLoaded() >= mg::FilamentLoadState::InSelector) { state = UnloadingToFinda; - mp::pulley.InitAxis(); + mpu::pulley.InitAxis(); ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::blink0); } else { state = FailedFINDA; @@ -43,8 +43,8 @@ bool UnloadToFinda::Step() { if (mi::idler.Engaged()) { state = WaitingForFINDA; mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InSelector); - unloadStart_mm = mp::pulley.CurrentPositionPulley_mm(); - mp::pulley.PlanMove(-config::defaultBowdenLength - config::feedToFinda - config::filamentMinLoadedToMMU, config::pulleyUnloadFeedrate); + unloadStart_mm = mpu::pulley.CurrentPositionPulley_mm(); + mpu::pulley.PlanMove(-config::defaultBowdenLength - config::feedToFinda - config::filamentMinLoadedToMMU, config::pulleyUnloadFeedrate); } return false; case WaitingForFINDA: { diff --git a/src/modules/pulley.h b/src/modules/pulley.h index 12e70ce..38918cc 100644 --- a/src/modules/pulley.h +++ b/src/modules/pulley.h @@ -47,4 +47,4 @@ extern Pulley pulley; } // namespace pulley } // namespace modules -namespace mp = modules::pulley; +namespace mpu = modules::pulley; diff --git a/tests/unit/logic/stubs/main_loop_stub.cpp b/tests/unit/logic/stubs/main_loop_stub.cpp index 791ef4d..b59b6aa 100644 --- a/tests/unit/logic/stubs/main_loop_stub.cpp +++ b/tests/unit/logic/stubs/main_loop_stub.cpp @@ -27,7 +27,7 @@ void main_loop() { mf::finda.Step(); mfs::fsensor.Step(); mi::idler.Step(); - mp::pulley.Step(); + mpu::pulley.Step(); ms::selector.Step(); mm::motion.Step(); mui::userInput.Step(); @@ -52,7 +52,7 @@ void ForceReinitAllAutomata() { new (&mf::finda) mf::FINDA(); new (&mfs::fsensor) mfs::FSensor(); new (&mi::idler) mi::Idler(); - new (&mp::pulley) mp::Pulley(); + new (&mpu::pulley) mpu::Pulley(); new (&ms::selector) ms::Selector(); new (&mm::motion) mm::Motion();