Changeset 225:298b775161db
- Timestamp:
- 06/04/12 12:24:42 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/common.py
r221 r225 228 228 #------------------------------------------------------------------------------ 229 229 230 def formatFlightLogLine(timeStr, line ):230 def formatFlightLogLine(timeStr, line, isFault = False): 231 231 """Format the given flight log line.""" 232 232 """Format the given line for flight logging.""" 233 233 if timeStr is not None: 234 234 line = timeStr + ": " + line 235 #if isFault: 236 # line = "<b>" + line + "</b>" 235 237 return line + "\n" 236 238 -
src/mlx/gui/gui.py
r221 r225 463 463 return True 464 464 465 def addFlightLogLine(self, timeStr, line ):465 def addFlightLogLine(self, timeStr, line, isFault = False): 466 466 """Write the given message line to the log.""" 467 467 gobject.idle_add(self._writeLog, 468 formatFlightLogLine(timeStr, line ),468 formatFlightLogLine(timeStr, line, isFault = isFault), 469 469 self._logView) 470 470 471 def updateFlightLogLine(self, index, timeStr, line ):471 def updateFlightLogLine(self, index, timeStr, line, isFault = False): 472 472 """Update the line with the given index.""" 473 473 gobject.idle_add(self._updateFlightLogLine, index, 474 formatFlightLogLine(timeStr, line)) 474 formatFlightLogLine(timeStr, line, 475 isFault = isFault)) 475 476 476 477 def _updateFlightLogLine(self, index, line): -
src/mlx/gui/pirep.py
r224 r225 234 234 235 235 logBuffer = self._log.get_buffer() 236 print dir(logBuffer) 236 237 logBuffer.set_text("") 238 lineIndex = 0 237 239 for (timeStr, line) in pirep.logLines: 240 isFault = lineIndex in pirep.faultLineIndexes 238 241 logBuffer.insert(logBuffer.get_end_iter(), 239 formatFlightLogLine(timeStr, line)) 242 formatFlightLogLine(timeStr, line, 243 isFault = isFault)) 244 lineIndex += 1 240 245 241 246 self._notebook.set_current_page(0) -
src/mlx/logger.py
r160 r225 56 56 self._faultLineIndexes = [] 57 57 58 def message(self, timestamp, msg ):58 def message(self, timestamp, msg, isFault = False): 59 59 """Put a simple textual message into the log with the given timestamp.""" 60 60 timeStr = util.getTimestampString(timestamp) 61 return self._logLine(msg, timeStr )61 return self._logLine(msg, timeStr, isFault = isFault) 62 62 63 def untimedMessage(self, msg ):63 def untimedMessage(self, msg, isFault = False): 64 64 """Put an untimed message into the log.""" 65 return self._logLine(msg )65 return self._logLine(msg, isFault = isFault) 66 66 67 67 def debug(self, msg): … … 91 91 text = "%s (NO GO)" % (what) if score==Logger.NO_GO_SCORE \ 92 92 else "%s (%.1f)" % (what, score) 93 lineIndex = self.message(timestamp, text )93 lineIndex = self.message(timestamp, text, isFault = True) 94 94 self._faultLineIndexes.append(lineIndex) 95 95 (messageType, duration) = (const.MESSAGETYPE_NOGO, 10) \ … … 118 118 self._output.updateFlightLogLine(index, timeStr, line) 119 119 120 def _logLine(self, line, timeStr = None ):120 def _logLine(self, line, timeStr = None, isFault = False): 121 121 """Log the given line.""" 122 122 index = len(self._lines) 123 123 self._lines.append((timeStr, line)) 124 self._output.addFlightLogLine(timeStr, line )124 self._output.addFlightLogLine(timeStr, line, isFault) 125 125 return index 126 126
Note:
See TracChangeset
for help on using the changeset viewer.