57 #ifndef ORO_TASKBROWSER_HPP 58 #define ORO_TASKBROWSER_HPP 61 #include <rtt/RTT.hpp> 62 #include <rtt/TaskContext.hpp> 63 #include <rtt/Service.hpp> 68 #if defined(HAS_READLINE) && !defined(HAS_EDITLINE) && defined(_POSIX_VERSION) 72 #include <ocl/OCL.hpp> 87 :
public RTT::TaskContext
90 static RTT::TaskContext* taskcontext;
92 static RTT::TaskContext* peer;
94 static RTT::TaskContext* tb;
96 static RTT::TaskContext* context;
97 static RTT::Service::shared_ptr taskobject;
98 RTT::internal::DataSource<bool>::shared_ptr accepted;
105 std::string storedname;
109 std::deque<RTT::TaskContext*> taskHistory;
112 typedef std::map<std::pair<RTT::TaskContext*,std::string>,
int> PTrace;
117 const char* histfile;
121 base::DataSourceBase::shared_ptr last_expr;
122 #if defined(HAS_READLINE) || defined(HAS_EDITLINE) 123 #if defined(_POSIX_VERSION) && !defined(HAS_EDITLINE) 124 static void rl_sigwinch_handler(
int sig, siginfo_t *si,
void *ctxt);
127 static int rl_received_signal;
128 static void rl_signal_handler(
int sig, siginfo_t *si,
void *ctxt);
131 static int rl_getc(FILE *);
138 static std::vector<std::string> candidates;
140 static std::vector<std::string> completes;
141 static std::vector<std::string>::iterator complete_iter;
143 static std::string component_found;
144 static std::string component;
145 static std::string peerpath;
146 static std::string text;
149 static char* dupstr(
const char *s );
151 static void find_completes();
153 static void find_ops();
154 static void find_peers(std::string::size_type startpos);
156 static char ** orocos_hmi_completion (
const char *text,
int start,
int end );
158 static char *command_generator(
const char *_text,
int state );
160 static RTT::TaskContext* findPeer( std::string comm );
164 void listText(std::stringstream& txtss,
int start,
int end,
int ln,
char s);
166 void doPrint( RTT::base::DataSourceBase::shared_ptr ds,
bool recurse);
172 std::string macrotext;
173 std::string macroname;
174 std::stringstream sresult;
175 void recordMacro(std::string name);
180 Service::shared_ptr stringToService(std::string
const& names);
198 void switchTaskContext(std::string& path);
206 void switchTaskContext( RTT::TaskContext* tc,
bool store =
true);
218 void browserAction(std::string& act );
223 void printResult( RTT::base::DataSourceBase* ds,
bool recurse);
233 void printHelp(std::string command);
238 void printInfo(
const std::string& peerpath);
243 void printSource(
const std::string m );
248 void printOperation(
const std::string m, Service::shared_ptr ops );
253 bool printService(
const std::string name);
258 void printProgram(
const std::string& pn,
int line = -1, RTT::TaskContext* progpeer = 0 );
263 void printProgram(
int line = -1 );
286 void evaluate(std::string& comm );
291 void switchTask( RTT::TaskContext* c);
328 void evalCommand(std::string& comm );
static std::string coloron
The 'turn color on' escape sequence.
static std::string underline
The 'underline' escape sequence.
This component allows a text client to browse the peers of a peer RTT::TaskContext and execute comman...
static std::string green
The green color.
static std::string blue
The blue color.
The Orocos Component Library.
ColorTheme
The kinds of color themes the TaskBrowser supports.
static std::string prompt
The prompt.
static std::string coloroff
The 'turn color off' escape sequence.
Use colors suitable for a dark background.
static std::string red
The red color.