[Orxonox-commit 833] r3350 - branches/resource/src/core
landauf at orxonox.net
landauf at orxonox.net
Sat Jul 25 21:46:24 CEST 2009
Author: landauf
Date: 2009-07-25 21:46:24 +0200 (Sat, 25 Jul 2009)
New Revision: 3350
Modified:
branches/resource/src/core/ConsoleCommandCompilation.cc
branches/resource/src/core/TclBind.cc
branches/resource/src/core/TclThreadManager.cc
Log:
small changes relating to tcl
Modified: branches/resource/src/core/ConsoleCommandCompilation.cc
===================================================================
--- branches/resource/src/core/ConsoleCommandCompilation.cc 2009-07-25 12:14:05 UTC (rev 3349)
+++ branches/resource/src/core/ConsoleCommandCompilation.cc 2009-07-25 19:46:24 UTC (rev 3350)
@@ -93,11 +93,11 @@
{
if (newline)
{
- COUT(0) << text << std::endl;
+ COUT(0) << stripEnclosingBraces(text) << std::endl;
}
else
{
- COUT(0) << text;
+ COUT(0) << stripEnclosingBraces(text);
}
}
Modified: branches/resource/src/core/TclBind.cc
===================================================================
--- branches/resource/src/core/TclBind.cc 2009-07-25 12:14:05 UTC (rev 3349)
+++ branches/resource/src/core/TclBind.cc 2009-07-25 19:46:24 UTC (rev 3350)
@@ -85,9 +85,10 @@
try
{
- this->interpreter_->eval("proc query args { orxonox::query [join $args] }");
- this->interpreter_->eval("proc crossquery {id args} { orxonox::crossquery 0 $id [join $args] }");
- this->interpreter_->eval("proc crossexecute {id args} { orxonox::crossquery 0 $id [join $args] }");
+ this->interpreter_->eval("proc query {args} { orxonox::query $args }");
+ this->interpreter_->eval("proc crossquery {id args} { orxonox::crossquery 0 $id $args }");
+ this->interpreter_->eval("proc crossexecute {id args} { orxonox::crossquery 0 $id $args }");
+ this->interpreter_->eval("proc running {} { return 1 }");
this->interpreter_->eval("set id 0");
this->interpreter_->eval("rename exit tcl::exit; proc exit {} { execute exit }");
}
@@ -104,7 +105,7 @@
{
Tcl::interpreter* interpreter;
#ifdef DEPENDENCY_PACKAGE_ENABLE
- if (true)//Core::isDevelopmentRun())
+ if (Core::isDevelopmentRun())
interpreter = new Tcl::interpreter(std::string(ORXONOX_DEP_LIB_PATH) + "/tcl");
else
interpreter = new Tcl::interpreter(Core::getRootPathString() + "lib/tcl");
Modified: branches/resource/src/core/TclThreadManager.cc
===================================================================
--- branches/resource/src/core/TclThreadManager.cc 2009-07-25 12:14:05 UTC (rev 3349)
+++ branches/resource/src/core/TclThreadManager.cc 2009-07-25 19:46:24 UTC (rev 3350)
@@ -256,8 +256,9 @@
// Create threadspecific shortcuts for the functions above
newbundle->interpreter_->def("execute", TclThreadManager::tcl_execute, Tcl::variadic());
newbundle->interpreter_->def("crossexecute", TclThreadManager::tcl_crossexecute, Tcl::variadic());
- newbundle->interpreter_->eval("proc query args { orxonox::query " + id_string + " $args }");
+ newbundle->interpreter_->eval("proc query {args} { orxonox::query " + id_string + " $args }");
newbundle->interpreter_->eval("proc crossquery {id args} { orxonox::crossquery " + id_string + " $id $args }");
+ newbundle->interpreter_->eval("proc running {} { return [orxonox::running " + id_string + "] }");
// Define a variable containing the thread id
newbundle->interpreter_->eval("set id " + id_string);
@@ -267,10 +268,10 @@
newbundle->interpreter_->eval("proc exit {} { execute TclThreadManager destroy " + id_string + " }");
// Redefine some native functions
-// newbundle->interpreter_->eval("rename while tcl::while");
-// newbundle->interpreter_->eval("proc while {test command} { tcl::while {[uplevel 1 expr $test]} {uplevel 1 $command} }"); // (\"$test\" && [orxonox::running " + id + "]])
-// newbundle->interpreter_->eval("rename for tcl::for");
-// newbundle->interpreter_->eval("proc for {start test next command} { uplevel tcl::for \"$start\" \"$test\" \"$next\" \"$command\" }");
+ newbundle->interpreter_->eval("rename while tcl::while");
+ newbundle->interpreter_->eval("rename orxonox::while while");
+ newbundle->interpreter_->eval("rename for tcl::for");
+ newbundle->interpreter_->eval("rename orxonox::for for");
}
catch (const Tcl::tcl_error& e)
{ newbundle->interpreter_ = 0; COUT(1) << "Tcl error while creating Tcl-interpreter (" << id << "): " << e.what() << std::endl; }
@@ -295,6 +296,11 @@
{
// TODO
// Not yet implemented
+ TclInterpreterBundle* bundle = TclThreadManager::getInstance().getInterpreterBundle(id);
+ if (bundle)
+ {
+ bundle->bRunning_ = false;
+ }
}
/**
More information about the Orxonox-commit
mailing list