Eclipse SUMO - Simulation of Urban MObility
GUIMessageWindow Class Reference

A logging window for the gui. More...

#include <GUIMessageWindow.h>

Inheritance diagram for GUIMessageWindow:
[legend]
Collaboration diagram for GUIMessageWindow:
[legend]

Data Structures

class  MsgOutputDevice
 FOX needs this. More...
 

Public Member Functions

void addSeparator ()
 Adds a a separator to this log window. More...
 
void appendMsg (GUIEventType eType, const std::string &msg)
 Adds new text to the window. More...
 
void clear ()
 Clears the window. More...
 
 GUIMessageWindow (FXComposite *parent, GUIMainWindow *mainWindow)
 Constructor. More...
 
long onKeyPress (FXObject *o, FXSelector sel, void *data)
 handle keys More...
 
void registerMsgHandlers ()
 register message handlers More...
 
virtual void setCursorPos (FXint pos, FXbool notify=FALSE)
 set cursor position over a certain line More...
 
void unregisterMsgHandlers ()
 unregister message handlers More...
 
 ~GUIMessageWindow ()
 Destructor. More...
 

Static Public Member Functions

static void enableLocateLinks (const bool val)
 switch locate links on and off More...
 
static SUMOTime getBreakPointOffset ()
 ask whether locate links is enabled More...
 
static FXHiliteStyle * getStyles ()
 The text colors used. More...
 
static bool locateLinksEnabled ()
 ask whether locate links is enabled More...
 
static void setBreakPointOffset (SUMOTime val)
 switch locate links on and off More...
 

Private Member Functions

void fillStyles ()
 fill styles More...
 
const GUIGlObjectgetActiveStringObject (const FXString &text, const FXint pos, const FXint lineS, const FXint lineE) const
 get active string object More...
 
SUMOTime getTimeString (const FXString &text, const FXint pos, const FXint lineS, const FXint lineE) const
 get time string object More...
 

Private Attributes

OutputDevicemyDebugRetriever
 
OutputDevicemyErrorRetriever
 The instances of message retriever encapsulations. More...
 
OutputDevicemyGLDebugRetriever
 
GUIMainWindowmyMainWindow
 main window More...
 
OutputDevicemyMessageRetriever
 
OutputDevicemyWarningRetriever
 

Static Private Attributes

static SUMOTime myBreakPointOffset = TIME2STEPS(-5)
 Offset when creating breakpoint by clicking on time links. More...
 
static bool myLocateLinks = true
 whether messages are linked to the GUI elements More...
 
static FXHiliteStyle * myStyles = new FXHiliteStyle[8]
 The text colors used. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ GUIMessageWindow()

GUIMessageWindow::GUIMessageWindow ( FXComposite *  parent,
GUIMainWindow mainWindow 
)

Constructor.

Parameters
[in]parentThe parent window

Definition at line 55 of file GUIMessageWindow.cpp.

◆ ~GUIMessageWindow()

GUIMessageWindow::~GUIMessageWindow ( )

Destructor.

Definition at line 70 of file GUIMessageWindow.cpp.

References myErrorRetriever, myMessageRetriever, myStyles, and myWarningRetriever.

Member Function Documentation

◆ addSeparator()

void GUIMessageWindow::addSeparator ( )

Adds a a separator to this log window.

Definition at line 274 of file GUIMessageWindow.cpp.

Referenced by GUIApplicationWindow::closeAllWindows(), GNEApplicationWindow::onCmdClose(), GNEApplicationWindow::onCmdSaveEdgeTypes(), GNEApplicationWindow::onCmdSaveNetwork(), and GNEApplicationWindow::onCmdSaveTLSPrograms().

Here is the caller graph for this function:

◆ appendMsg()

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

Parameters
[in]eTypeThe type of the event the message was generated by
[in]msgThe message
See also
GUIEventType

Definition at line 195 of file GUIMessageWindow.cpp.

References DEBUG_OCCURRED, ERROR_OCCURRED, getActiveStringObject(), GUIGlObject::getGlID(), getTimeString(), GUIGlObjectStorage::gIDStorage, GLDEBUG_OCCURRED, MESSAGE_OCCURRED, myLocateLinks, TL, GUIGlObjectStorage::unblockObject(), and WARNING_OCCURRED.

Referenced by GUIApplicationWindow::handleEvent_Message(), GNEApplicationWindow::handleEvent_Message(), GUIApplicationWindow::handleEvent_SimulationEnded(), and GUIMessageWindow::MsgOutputDevice::postWriteHook().

Here is the caller graph for this function:

◆ clear()

void GUIMessageWindow::clear ( )

Clears the window.

Definition at line 287 of file GUIMessageWindow.cpp.

Referenced by GUIApplicationWindow::onCmdClearMsgWindow(), and GNEApplicationWindow::onCmdClearMsgWindow().

Here is the caller graph for this function:

◆ enableLocateLinks()

static void GUIMessageWindow::enableLocateLinks ( const bool  val)
inlinestatic

switch locate links on and off

Definition at line 90 of file GUIMessageWindow.h.

References myLocateLinks.

Referenced by GUIDialog_AppSettings::onCmdOk().

Here is the caller graph for this function:

◆ fillStyles()

void GUIMessageWindow::fillStyles ( )
private

fill styles

Definition at line 345 of file GUIMessageWindow.cpp.

References myStyles.

◆ getActiveStringObject()

const GUIGlObject * GUIMessageWindow::getActiveStringObject ( const FXString &  text,
const FXint  pos,
const FXint  lineS,
const FXint  lineE 
) const
private

get active string object

Definition at line 79 of file GUIMessageWindow.cpp.

References GUIGlObjectStorage::getObjectBlocking(), GUIGlObjectStorage::gIDStorage, and MAX2().

Referenced by appendMsg(), and setCursorPos().

Here is the caller graph for this function:

◆ getBreakPointOffset()

static SUMOTime GUIMessageWindow::getBreakPointOffset ( )
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().

Here is the caller graph for this function:

◆ getStyles()

FXHiliteStyle * GUIMessageWindow::getStyles ( )
static

The text colors used.

Definition at line 339 of file GUIMessageWindow.cpp.

References myStyles.

Referenced by GNERunNetgenerateDialog::GNERunNetgenerateDialog(), and GNERunPythonToolDialog::GNERunPythonToolDialog().

Here is the caller graph for this function:

◆ getTimeString()

SUMOTime GUIMessageWindow::getTimeString ( const FXString &  text,
const FXint  pos,
const FXint  lineS,
const FXint  lineE 
) const
private

get time string object

Definition at line 113 of file GUIMessageWindow.cpp.

References string2time().

Referenced by appendMsg(), and setCursorPos().

Here is the caller graph for this function:

◆ locateLinksEnabled()

static bool GUIMessageWindow::locateLinksEnabled ( )
inlinestatic

ask whether locate links is enabled

Definition at line 95 of file GUIMessageWindow.h.

References myLocateLinks.

◆ onKeyPress()

long GUIMessageWindow::onKeyPress ( FXObject *  o,
FXSelector  sel,
void *  data 
)

handle keys

Definition at line 328 of file GUIMessageWindow.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ registerMsgHandlers()

void GUIMessageWindow::registerMsgHandlers ( )

◆ setBreakPointOffset()

static void GUIMessageWindow::setBreakPointOffset ( SUMOTime  val)
inlinestatic

switch locate links on and off

Definition at line 100 of file GUIMessageWindow.h.

References myBreakPointOffset.

Referenced by GUIDialog_AppSettings::onCmdOk().

Here is the caller graph for this function:

◆ setCursorPos()

◆ unregisterMsgHandlers()

void GUIMessageWindow::unregisterMsgHandlers ( )

unregister message handlers

Definition at line 318 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().

Here is the caller graph for this function:

Field Documentation

◆ myBreakPointOffset

SUMOTime GUIMessageWindow::myBreakPointOffset = TIME2STEPS(-5)
staticprivate

Offset when creating breakpoint by clicking on time links.

Definition at line 170 of file GUIMessageWindow.h.

Referenced by getBreakPointOffset(), setBreakPointOffset(), and setCursorPos().

◆ myDebugRetriever

OutputDevice * GUIMessageWindow::myDebugRetriever
private

Definition at line 176 of file GUIMessageWindow.h.

Referenced by registerMsgHandlers(), and unregisterMsgHandlers().

◆ myErrorRetriever

OutputDevice* GUIMessageWindow::myErrorRetriever
private

The instances of message retriever encapsulations.

Definition at line 176 of file GUIMessageWindow.h.

Referenced by registerMsgHandlers(), unregisterMsgHandlers(), and ~GUIMessageWindow().

◆ myGLDebugRetriever

OutputDevice * GUIMessageWindow::myGLDebugRetriever
private

Definition at line 176 of file GUIMessageWindow.h.

Referenced by registerMsgHandlers(), and unregisterMsgHandlers().

◆ myLocateLinks

bool GUIMessageWindow::myLocateLinks = true
staticprivate

whether messages are linked to the GUI elements

Definition at line 167 of file GUIMessageWindow.h.

Referenced by appendMsg(), enableLocateLinks(), locateLinksEnabled(), and setCursorPos().

◆ myMainWindow

GUIMainWindow* GUIMessageWindow::myMainWindow
private

main window

Definition at line 164 of file GUIMessageWindow.h.

Referenced by setCursorPos().

◆ myMessageRetriever

OutputDevice * GUIMessageWindow::myMessageRetriever
private

◆ myStyles

FXHiliteStyle * GUIMessageWindow::myStyles = new FXHiliteStyle[8]
staticprivate

The text colors used.

Definition at line 173 of file GUIMessageWindow.h.

Referenced by fillStyles(), getStyles(), and ~GUIMessageWindow().

◆ myWarningRetriever

OutputDevice * GUIMessageWindow::myWarningRetriever
private

The documentation for this class was generated from the following files: