diff --git a/core/include/moveit/task_constructor/storage.h b/core/include/moveit/task_constructor/storage.h index 54058eeb..ed8ef9d2 100644 --- a/core/include/moveit/task_constructor/storage.h +++ b/core/include/moveit/task_constructor/storage.h @@ -248,6 +248,7 @@ private: std::ostream& operator<<(std::ostream& os, const InterfaceState::Priority& prio); std::ostream& operator<<(std::ostream& os, const Interface& interface); +std::ostream& operator<<(std::ostream& os, Interface::Direction); /// Find index of the iterator in the container. Counting starts at 1. Zero corresponds to not found. template diff --git a/core/src/stage.cpp b/core/src/stage.cpp index 9c6410cb..f0efb54f 100644 --- a/core/src/stage.cpp +++ b/core/src/stage.cpp @@ -737,7 +737,6 @@ ConnectingPrivate::StatePair ConnectingPrivate::make_pair(In return StatePair(second, first); } -// TODO: bool updated -> uint_8 updated (bitfield of PRIORITY | STATUS) template void ConnectingPrivate::newState(Interface::iterator it, Interface::UpdateFlags updated) { auto parent_pimpl = parent()->pimpl(); @@ -799,8 +798,7 @@ void ConnectingPrivate::newState(Interface::iterator it, Interface::UpdateFlags #if 0 auto& os = std::cerr; for (auto d : { Interface::FORWARD, Interface::BACKWARD }) { - bool fw = (d == Interface::FORWARD); - if (fw) + if (d == Interface::FORWARD) os << " " << std::setw(10) << std::left << this->name(); else os << std::setw(12) << std::right << ""; @@ -808,7 +806,7 @@ void ConnectingPrivate::newState(Interface::iterator it, Interface::UpdateFlags os << (updated ? " !" : " +"); else os << " "; - os << (fw ? "↓ " : "↑ ") << this->pullInterface(d) << ": " << *this->pullInterface(d) << std::endl; + os << d << " " << this->pullInterface(d) << ": " << *this->pullInterface(d) << std::endl; } os << std::setw(15) << " "; printPendingPairs(os) << std::endl; diff --git a/core/src/storage.cpp b/core/src/storage.cpp index 8b825a05..bd0211d9 100644 --- a/core/src/storage.cpp +++ b/core/src/storage.cpp @@ -178,6 +178,10 @@ std::ostream& operator<<(std::ostream& os, const InterfaceState::Priority& prio) << InterfaceState::STATUS_COLOR[3]; return os; } +std::ostream& operator<<(std::ostream& os, Interface::Direction dir) { + os << (dir == Interface::FORWARD ? "↓" : "↑"); + return os; +} void SolutionBase::setCreator(Stage* creator) { assert(creator_ == nullptr || creator_ == creator); // creator must only set once