[Orxonox-commit 1289] r6007 - in code/branches/console/src/libraries: core util
rgrieder at orxonox.net
rgrieder at orxonox.net
Fri Oct 30 17:26:28 CET 2009
Author: rgrieder
Date: 2009-10-30 17:26:28 +0100 (Fri, 30 Oct 2009)
New Revision: 6007
Modified:
code/branches/console/src/libraries/core/IOConsole.cc
code/branches/console/src/libraries/core/IOConsole.h
code/branches/console/src/libraries/core/PathConfig.cc
code/branches/console/src/libraries/util/OutputHandler.cc
Log:
Fixed IOConsole partly and fixed two problems in PathConfig and OutputHandler
Modified: code/branches/console/src/libraries/core/IOConsole.cc
===================================================================
--- code/branches/console/src/libraries/core/IOConsole.cc 2009-10-30 13:24:53 UTC (rev 6006)
+++ code/branches/console/src/libraries/core/IOConsole.cc 2009-10-30 16:26:28 UTC (rev 6007)
@@ -53,8 +53,6 @@
#ifdef ORXONOX_PLATFORM_UNIX
- termios* IOConsole::originalTerminalSettings_;
-
namespace EscapeMode
{
enum Value
@@ -68,9 +66,9 @@
IOConsole::IOConsole()
: shell_(new Shell("IOConsole", false))
, buffer_(shell_->getInputBuffer())
+ , originalTerminalSettings_(new termios())
, bStatusPrinted_(false)
{
- this->originalTerminalSettings_ = new termios();
this->setTerminalMode();
this->shell_->registerListener(this);
Modified: code/branches/console/src/libraries/core/IOConsole.h
===================================================================
--- code/branches/console/src/libraries/core/IOConsole.h 2009-10-30 13:24:53 UTC (rev 6006)
+++ code/branches/console/src/libraries/core/IOConsole.h 2009-10-30 16:26:28 UTC (rev 6007)
@@ -54,7 +54,7 @@
private:
void setTerminalMode();
- static void resetTerminalMode();
+ void resetTerminalMode();
int getTerminalSize(int* x, int* y);
void printLogText(const std::string& line);
@@ -71,7 +71,7 @@
void exit();
Shell* shell_;
InputBuffer* buffer_;
- static termios* originalTerminalSettings_;
+ termios* originalTerminalSettings_;
bool bPrintStatusLine_;
bool bStatusPrinted_;
std::vector<unsigned> statusLineWidths_;
Modified: code/branches/console/src/libraries/core/PathConfig.cc
===================================================================
--- code/branches/console/src/libraries/core/PathConfig.cc 2009-10-30 13:24:53 UTC (rev 6006)
+++ code/branches/console/src/libraries/core/PathConfig.cc 2009-10-30 16:26:28 UTC (rev 6007)
@@ -262,6 +262,10 @@
std::string pathVariable = getenv("PATH");
putenv(const_cast<char*>(("PATH=" + pathVariable + ";" + modulePath_.string()).c_str()));
+ // Make sure the path exists, otherwise don't load modules
+ if (!boost::filesystem::exists(modulePath_))
+ return modulePaths;
+
boost::filesystem::directory_iterator file(modulePath_);
boost::filesystem::directory_iterator end;
Modified: code/branches/console/src/libraries/util/OutputHandler.cc
===================================================================
--- code/branches/console/src/libraries/util/OutputHandler.cc 2009-10-30 13:24:53 UTC (rev 6006)
+++ code/branches/console/src/libraries/util/OutputHandler.cc 2009-10-30 16:26:28 UTC (rev 6007)
@@ -69,7 +69,7 @@
This is only required to avoid another call to getInstance (this c'tor was
called from getInstance!)
*/
- LogFileWriter(OutputHandler& outputHandler)
+ LogFileWriter()
: OutputListener(OutputHandler::logFileOutputListenerName_s)
{
// Get path for a temporary file
@@ -91,9 +91,6 @@
this->logFile_.flush();
this->outputStream_ = &this->logFile_;
- // Use default level until we get the configValue from the Core
- this->setSoftDebugLevel(OutputLevel::Debug);
- outputHandler.registerOutputListener(this);
}
//! Closes the log file
@@ -146,13 +143,10 @@
This is only required to avoid another call to getInstance (this c'tor was
called from getInstance!)
*/
- MemoryLogWriter(OutputHandler& outputHandler)
+ MemoryLogWriter()
: OutputListener("memoryLog")
{
this->outputStream_ = &this->buffer_;
- // We capture as much input as the listener with the highest level
- this->setSoftDebugLevel(OutputHandler::getSoftDebugLevel());
- outputHandler.registerOutputListener(this);
}
//! Pushed the just written output to the internal array
@@ -181,8 +175,15 @@
OutputHandler::OutputHandler()
: outputLevel_(OutputLevel::Verbose)
{
- this->logFile_ = new LogFileWriter(*this);
- this->output_ = new MemoryLogWriter(*this);
+ this->logFile_ = new LogFileWriter();
+ // Use default level until we get the configValue from the Core
+ this->logFile_->softDebugLevel_ = OutputLevel::Debug;
+ this->registerOutputListener(this->logFile_);
+
+ this->output_ = new MemoryLogWriter();
+ // We capture as much input as the listener with the highest level
+ this->output_->softDebugLevel_ = getSoftDebugLevel();
+ this->registerOutputListener(this->output_);
}
//! Destroys the LogFileWriter and the MemoryLogWriter
More information about the Orxonox-commit
mailing list