24 , running_child_idx_(-1)
25 , previously_executed_idx_(-1)
44 if( children_count == 0 )
49 bool repeat_last =
false;
88 win = newwin( 6, 70, 1, 1 );
90 mvwprintw( win, 0, 0,
"No children." );
91 mvwprintw( win, 1, 0,
"Press: S to return SUCCESFULL," );
92 mvwprintw( win, 2, 0,
" F to return FAILURE, or" );
93 mvwprintw( win, 3, 0,
" R to return RUNNING." );
104 if( ch ==
's' || ch ==
'S')
109 else if( ch ==
'f' || ch ==
'F')
114 else if( ch ==
'r' || ch ==
'R')
132 std::vector<std::string> list;
133 list.reserve(children_count);
140 for(
const auto& str: list) {
141 width = std::max(width, str.size()+2);
148 win = newwin( children_count+6, 70, 1, 1 );
150 mvwprintw( win, 0, 0,
"Use UP/DOWN arrow to select the child, Enter to confirm." );
151 mvwprintw( win, 1, 0,
"Press: S to skip and return SUCCESFULL," );
152 mvwprintw( win, 2, 0,
" F to skip and return FAILURE, or" );
153 mvwprintw( win, 3, 0,
" R to skip and return RUNNING." );
156 for(
size_t i=0; i<list.size(); i++ )
158 mvwprintw( win, i+5, 0,
"%2d. %s", i+1, list[i].c_str() );
171 wattroff( win, A_STANDOUT );
172 mvwprintw( win, row+5, 4,
"%s", list[row].c_str() );
176 row = (row == children_count-1) ? 0 : row+1;
178 else if( ch == KEY_UP )
180 row = ( row == 0) ? (children_count-1) : row-1;
182 else if( ch == KEY_ENTER || ch == 10 )
186 else if( ch ==
's' || ch ==
'S')
191 else if( ch ==
'f' || ch ==
'F')
196 else if( ch ==
'r' || ch ==
'R')
203 wattron( win, A_STANDOUT );
204 mvwprintw( win, row+5, 4,
"%s", list[row].c_str());
virtual void halt() override
const std::string & name() const
Name of the instance, not the type.
std::vector< TreeNode * > children_nodes_
int previously_executed_idx_
virtual void halt() override
static constexpr const char * REPEAT_LAST_SELECTION
ManualSelectorNode(const std::string &name, const NodeConfiguration &config)
const TreeNode * child(size_t index) const
Result getInput(const std::string &key, T &destination) const
NodeStatus selectStatus() const
void setRegistrationID(StringView ID)
uint8_t selectChild() const
virtual BT::NodeStatus tick() override
Method to be implemented by the user.
void setStatus(NodeStatus new_status)