45 FXText(parent, nullptr, 0, 0, 0, 0, 0, 50),
46 myMainWindow(mainWindow),
47 myStyles(new FXHiliteStyle[8]),
48 myErrorRetriever(nullptr),
49 myMessageRetriever(nullptr),
50 myWarningRetriever(nullptr) {
53 const FXColor white = FXRGB(0xff, 0xff, 0xff);
54 const FXColor blue = FXRGB(0x00, 0x00, 0x88);
55 const FXColor green = FXRGB(0x00, 0x88, 0x00);
56 const FXColor red = FXRGB(0x88, 0x00, 0x00);
57 const FXColor yellow = FXRGB(0xe6, 0x98, 0x00);
58 const FXColor fuchsia = FXRGB(0x88, 0x00, 0x88);
84 myStyles[3].normalForeColor = yellow;
85 myStyles[3].selectBackColor = yellow;
86 myStyles[3].hiliteForeColor = yellow;
91 myStyles[7].normalForeColor = fuchsia;
92 myStyles[7].selectBackColor = fuchsia;
93 myStyles[7].hiliteForeColor = fuchsia;
109 const FXint idS =
MAX2(text.rfind(
" '", pos), text.rfind(
"='", pos));
110 const FXint idE = text.find(
"'", pos);
111 if (idS >= 0 && idE >= 0 && idS >= lineS && idE <= lineE) {
112 FXint typeS = text.rfind(
" ", idS - 1);
114 if (text.at(typeS + 1) ==
'(') {
117 std::string type(text.mid(typeS + 1, idS - typeS - 1).lower().text());
118 if (type ==
"tllogic") {
120 }
else if (type ==
"busstop" || type ==
"trainstop") {
122 }
else if (type ==
"containerstop") {
123 type =
"containerStop";
124 }
else if (type ==
"chargingstation") {
125 type =
"chargingStation";
126 }
else if (type ==
"overheadwiresegment") {
127 type =
"overheadWireSegment";
128 }
else if (type ==
"parkingarea") {
129 type =
"parkingArea";
131 const std::string id(text.mid(idS + 2, idE - idS - 2).text());
140 const FXint end = text.find(
" ", pos + 1);
143 time = text.mid(pos, end - pos).text();
145 time = text.mid(pos, text.length() - pos).text();
149 if (time.back() ==
'\n') {
155 if (time.back() ==
'.') {
162 if (time.front() ==
' ') {
163 time = time.substr(1);
177 FXText::setCursorPos(pos, notify);
180 std::vector<std::string> viewIDs =
main->getViewIDs();
181 if (viewIDs.empty()) {
185 const FXString text = getText();
187 if (glObj !=
nullptr) {
190 if (getApp()->getKeyState(KEY_Control_L)) {
194 const int lookback =
MIN2(pos, 10);
195 const int start =
MAX2(lineStart(pos), pos - lookback);
196 const FXString candidate = text.mid(start, lineEnd(pos) - start);
197 FXint timePos = candidate.find(
" time");
200 t =
getTimeString(candidate, timePos + 6, 0, candidate.length());
204 if (std::find(breakpoints.begin(), breakpoints.end(), t) == breakpoints.end()) {
205 breakpoints.push_back(t);
206 std::sort(breakpoints.begin(), breakpoints.end());
247 FXString text(msg.c_str());
249 FXint pos = text.find(
"'");
252 if (glObj !=
nullptr) {
254 FXString insText = text.left(pos + 1);
255 FXText::appendStyledText(insText, style + 1);
256 text.erase(0, pos + 1);
257 pos = text.find(
"'");
258 insText = text.left(pos);
259 FXText::appendStyledText(insText, style + 4);
262 pos = text.find(
"'", pos + 1);
265 pos = text.find(
" time");
271 FXString insText = text.left(pos + 6);
272 FXText::appendStyledText(insText, style + 1);
273 text.erase(0, pos + 6);
274 pos = text.find(
" ");
276 pos = text.rfind(
".");
278 insText = text.left(pos);
279 FXText::appendStyledText(insText, style + 4);
284 FXText::appendStyledText(text, style + 1,
true);
285 FXText::setCursorPos(getLength() - 1);
286 FXText::setBottomLine(getLength() - 1);
296 std::string msg =
"----------------------------------------------------------------------------------------\n";
297 FXText::appendStyledText(msg.c_str(), (FXint) msg.length(), 1,
true);
298 FXText::setCursorPos(getLength() - 1);
299 FXText::setBottomLine(getLength() - 1);
309 if (getLength() == 0) {
312 FXText::removeText(0, getLength() - 1,
true);
@ MESSAGE_OCCURRED
send when a message occured
@ GLDEBUG_OCCURRED
send when a gldebug occured
@ ERROR_OCCURRED
send when a error occured
@ DEBUG_OCCURRED
send when a debug occured
@ WARNING_OCCURRED
send when a warning occured
GUISelectedStorage gSelected
A global holder of selected objects.
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
int main(int argc, char *argv[])
void setView(GUIGlID id)
Centers the view onto the given artifact.
GUIGlID getGlID() const
Returns the numerical id of the object.
void unblockObject(GUIGlID id)
Marks an object as unblocked.
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
virtual const std::vector< SUMOTime > retrieveBreakpoints() const
retrieve breakpoints if provided by the application
virtual void setBreakpoints(const std::vector< SUMOTime > &)
Sets the breakpoints of the parent application.
static GUIMainWindow * getInstance()
get instance
GUIMainWindow * myMainWindow
OutputDevice * myGLDebugRetriever
void addSeparator()
Adds a a separator to this log window.
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations.
void unregisterMsgHandlers()
unregister message handlers
static SUMOTime myBreakPointOffset
Offset when creating breakpoint by clicking on time links.
void clear()
Clears the window.
SUMOTime getTimeString(const FXString &text, const FXint pos, const FXint lineS, const FXint lineE) const
static bool myLocateLinks
whether messages are linked to the GUI elements
FXHiliteStyle * myStyles
The text colors used.
void appendMsg(GUIEventType eType, const std::string &msg)
Adds new text to the window.
virtual void setCursorPos(FXint pos, FXbool notify=FALSE)
set cursor position over a certain line
GUIMessageWindow(FXComposite *parent, GUIMainWindow *mainWindow)
Constructor.
OutputDevice * myWarningRetriever
OutputDevice * myMessageRetriever
OutputDevice * myDebugRetriever
~GUIMessageWindow()
Destructor.
const GUIGlObject * getActiveStringObject(const FXString &text, const FXint pos, const FXint lineS, const FXint lineE) const
get active string object
void registerMsgHandlers()
register message handlers
void toggleSelection(GUIGlID id)
Toggles selection of an object.
virtual void addRetriever(OutputDevice *retriever)
Adds a further retriever to the instance responsible for a certain msg type.
static MsgHandler * getGLDebugInstance()
Returns the instance to add GLdebug to.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
static MsgHandler * getDebugInstance()
Returns the instance to add debug to.
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
virtual void removeRetriever(OutputDevice *retriever)
Removes the retriever from the handler.
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.