Eclipse SUMO - Simulation of Urban MObility
|
A logging window for the gui. More...
#include <GUIMessageWindow.h>
Data Structures | |
class | MsgOutputDevice |
FOX needs this. More... | |
Public Member Functions | |
void | addSeparator () |
Adds a a separator to this log window. | |
void | appendMsg (GUIEventType eType, const std::string &msg) |
Adds new text to the window. | |
void | clear () |
Clears the window. | |
GUIMessageWindow (FXComposite *parent, GUIMainWindow *mainWindow) | |
Constructor. | |
long | onKeyPress (FXObject *o, FXSelector sel, void *data) |
handle keys | |
void | registerMsgHandlers () |
register message handlers | |
virtual void | setCursorPos (FXint pos, FXbool notify=FALSE) |
set cursor position over a certain line | |
void | unregisterMsgHandlers () |
unregister message handlers | |
~GUIMessageWindow () | |
Destructor. | |
Static Public Member Functions | |
static void | enableLocateLinks (const bool val) |
switch locate links on and off | |
static SUMOTime | getBreakPointOffset () |
ask whether locate links is enabled | |
static FXHiliteStyle * | getStyles () |
The text colors used. | |
static bool | locateLinksEnabled () |
ask whether locate links is enabled | |
static void | setBreakPointOffset (SUMOTime val) |
switch locate links on and off | |
Private Member Functions | |
void | fillStyles () |
fill styles | |
const GUIGlObject * | getActiveStringObject (const FXString &text, const FXint pos, const FXint lineS, const FXint lineE) const |
get active string object | |
SUMOTime | getTimeString (const FXString &text, const FXint pos) const |
get time string object | |
Private Attributes | |
OutputDevice * | myDebugRetriever |
OutputDevice * | myErrorRetriever |
The instances of message retriever encapsulations. | |
OutputDevice * | myGLDebugRetriever |
GUIMainWindow * | myMainWindow |
main window | |
OutputDevice * | myMessageRetriever |
OutputDevice * | myWarningRetriever |
Static Private Attributes | |
static SUMOTime | myBreakPointOffset = TIME2STEPS(-5) |
Offset when creating breakpoint by clicking on time links. | |
static bool | myLocateLinks = true |
whether messages are linked to the GUI elements | |
static FXHiliteStyle * | myStyles = new FXHiliteStyle[8] |
The text colors used. | |
static std::string | myTimeText |
The time text to look for. | |
static std::map< std::string, std::string > | myTypeStrings |
The translated type strings text to look for. | |
A logging window for the gui.
This class displays messages incoming to the gui from either the load or the run thread.
The text is colored in dependence to its type (messages: green, warnings: yellow, errors: red)
Each time a new message is passed, the window is reopened.
Definition at line 52 of file GUIMessageWindow.h.
GUIMessageWindow::GUIMessageWindow | ( | FXComposite * | parent, |
GUIMainWindow * | mainWindow | ||
) |
Constructor.
[in] | parent | The parent window |
Definition at line 57 of file GUIMessageWindow.cpp.
References TL, and StringUtils::to_lower_case().
GUIMessageWindow::~GUIMessageWindow | ( | ) |
Destructor.
Definition at line 86 of file GUIMessageWindow.cpp.
References myErrorRetriever, myMessageRetriever, myStyles, and myWarningRetriever.
void GUIMessageWindow::addSeparator | ( | ) |
Adds a a separator to this log window.
Definition at line 272 of file GUIMessageWindow.cpp.
Referenced by GUIApplicationWindow::closeAllWindows(), GNEApplicationWindow::onCmdClose(), GNEApplicationWindow::onCmdSaveEdgeTypes(), GNEApplicationWindow::onCmdSaveNetwork(), and GNEApplicationWindow::onCmdSaveTLSPrograms().
void GUIMessageWindow::appendMsg | ( | GUIEventType | eType, |
const std::string & | msg | ||
) |
Adds new text to the window.
The type of the text is determined by the first parameter
[in] | eType | The type of the event the message was generated by |
[in] | msg | The message |
Definition at line 193 of file GUIMessageWindow.cpp.
References DEBUG_OCCURRED, ERROR_OCCURRED, getActiveStringObject(), GUIGlObject::getGlID(), getTimeString(), GUIGlObjectStorage::gIDStorage, GLDEBUG_OCCURRED, MESSAGE_OCCURRED, myLocateLinks, myTimeText, GUIGlObjectStorage::unblockObject(), and WARNING_OCCURRED.
Referenced by GUIApplicationWindow::handleEvent_Message(), GNEApplicationWindow::handleEvent_Message(), GUIApplicationWindow::handleEvent_SimulationEnded(), and GUIMessageWindow::MsgOutputDevice::postWriteHook().
void GUIMessageWindow::clear | ( | ) |
Clears the window.
Definition at line 285 of file GUIMessageWindow.cpp.
Referenced by GUIApplicationWindow::onCmdClearMsgWindow(), and GNEApplicationWindow::onCmdClearMsgWindow().
|
inlinestatic |
switch locate links on and off
Definition at line 90 of file GUIMessageWindow.h.
References myLocateLinks.
Referenced by GUIDialog_AppSettings::onCmdOk().
|
private |
|
private |
get active string object
Definition at line 95 of file GUIMessageWindow.cpp.
References GUIGlObjectStorage::getObjectBlocking(), GUIGlObjectStorage::gIDStorage, MAX2(), and myTypeStrings.
Referenced by appendMsg(), and setCursorPos().
|
inlinestatic |
ask whether locate links is enabled
Definition at line 105 of file GUIMessageWindow.h.
References myBreakPointOffset.
Referenced by GUIDialog_AppSettings::GUIDialog_AppSettings(), and GUIApplicationWindow::onCmdBreakpointEarly().
|
static |
The text colors used.
Definition at line 337 of file GUIMessageWindow.cpp.
References myStyles.
Referenced by GNERunNetgenerateDialog::GNERunNetgenerateDialog(), and GNERunPythonToolDialog::GNERunPythonToolDialog().
|
private |
get time string object
Definition at line 120 of file GUIMessageWindow.cpp.
References string2time().
Referenced by appendMsg(), and setCursorPos().
|
inlinestatic |
ask whether locate links is enabled
Definition at line 95 of file GUIMessageWindow.h.
References myLocateLinks.
long GUIMessageWindow::onKeyPress | ( | FXObject * | o, |
FXSelector | sel, | ||
void * | data | ||
) |
handle keys
Definition at line 326 of file GUIMessageWindow.cpp.
Referenced by FXDEFMAP().
void GUIMessageWindow::registerMsgHandlers | ( | ) |
register message handlers
Definition at line 298 of file GUIMessageWindow.cpp.
References MsgHandler::addRetriever(), DEBUG_OCCURRED, ERROR_OCCURRED, MsgHandler::getDebugInstance(), MsgHandler::getErrorInstance(), MsgHandler::getGLDebugInstance(), MsgHandler::getMessageInstance(), MsgHandler::getWarningInstance(), GLDEBUG_OCCURRED, MESSAGE_OCCURRED, myDebugRetriever, myErrorRetriever, myGLDebugRetriever, myMessageRetriever, myWarningRetriever, and WARNING_OCCURRED.
Referenced by GNEApplicationWindow::handleEvent_NetworkLoaded().
|
inlinestatic |
switch locate links on and off
Definition at line 100 of file GUIMessageWindow.h.
References myBreakPointOffset.
Referenced by GUIDialog_AppSettings::onCmdOk().
|
virtual |
set cursor position over a certain line
Definition at line 157 of file GUIMessageWindow.cpp.
References GUIMainWindow::addBreakpoint(), getActiveStringObject(), GUIGlObject::getGlID(), getTimeString(), GUIMainWindow::getViewByID(), GUIMainWindow::getViewIDs(), GUIGlObjectStorage::gIDStorage, gSelected, gSimulation, MAX2(), MIN2(), myBreakPointOffset, myLocateLinks, myMainWindow, myTimeText, GUIGlChildWindow::setView(), GUISelectedStorage::toggleSelection(), and GUIGlObjectStorage::unblockObject().
void GUIMessageWindow::unregisterMsgHandlers | ( | ) |
unregister message handlers
Definition at line 316 of file GUIMessageWindow.cpp.
References MsgHandler::getDebugInstance(), MsgHandler::getErrorInstance(), MsgHandler::getGLDebugInstance(), MsgHandler::getMessageInstance(), MsgHandler::getWarningInstance(), myDebugRetriever, myErrorRetriever, myGLDebugRetriever, myMessageRetriever, myWarningRetriever, and MsgHandler::removeRetriever().
Referenced by GNEApplicationWindow::closeAllWindows().
|
staticprivate |
Offset when creating breakpoint by clicking on time links.
Definition at line 170 of file GUIMessageWindow.h.
Referenced by getBreakPointOffset(), setBreakPointOffset(), and setCursorPos().
|
private |
Definition at line 182 of file GUIMessageWindow.h.
Referenced by registerMsgHandlers(), and unregisterMsgHandlers().
|
private |
The instances of message retriever encapsulations.
Definition at line 182 of file GUIMessageWindow.h.
Referenced by registerMsgHandlers(), unregisterMsgHandlers(), and ~GUIMessageWindow().
|
private |
Definition at line 182 of file GUIMessageWindow.h.
Referenced by registerMsgHandlers(), and unregisterMsgHandlers().
|
staticprivate |
whether messages are linked to the GUI elements
Definition at line 167 of file GUIMessageWindow.h.
Referenced by appendMsg(), enableLocateLinks(), locateLinksEnabled(), and setCursorPos().
|
private |
|
private |
Definition at line 182 of file GUIMessageWindow.h.
Referenced by registerMsgHandlers(), unregisterMsgHandlers(), and ~GUIMessageWindow().
|
staticprivate |
The text colors used.
Definition at line 173 of file GUIMessageWindow.h.
Referenced by fillStyles(), getStyles(), and ~GUIMessageWindow().
|
staticprivate |
The time text to look for.
Definition at line 176 of file GUIMessageWindow.h.
Referenced by appendMsg(), and setCursorPos().
|
staticprivate |
The translated type strings text to look for.
Definition at line 179 of file GUIMessageWindow.h.
Referenced by getActiveStringObject().
|
private |
Definition at line 182 of file GUIMessageWindow.h.
Referenced by registerMsgHandlers(), unregisterMsgHandlers(), and ~GUIMessageWindow().