![]() |
VR-Forces 4.10 Class Documentation
|
Each DtVrfObject has a console that is displayed as part of the information dialog box for that object.
When you extend the simulation engine, you can send messages to the object console window for a particular object. These messages are also printed to the vrfSim console and to the vrfSim log file, with the name of the object added as a prefix.
To write messages to the object console, use one of the objectConsole*() stream methods on the DtVrfObject class or the DtSimComponent class. Each object console has five notification levels, and each level has a stream method. You should choose a level appropriate to the nature of the message you are printing to the console. The console will only display messages with a notification level equal to or higher than the notification level chosen by the user. The table shows the notification levels and describes the types of messages that you should use for each level.
| Notification Message Types | ||
|---|---|---|
| Level | Function | Type of Message |
| Error (1) | objectConsoleError() | Always displayed to the user. Use for important errors that indicate failure of some type. |
| Warn (2) | objectConsoleWarn() | Displayed to the user by default. Use for situations that may lead to unexpected behavior. |
| Info (3) | objectConsoleInfo() | Use for important events of an object that are part of normal operation. |
| Verbose (4) | objectConsoleVerbose() | Use for general events or conditions for an object that are part of normal operation, but less important than Info level events. |
| Debug (5) | objectConsoleDebug() | Use for debugging level messages that only users attempting to debug operation of an object would be interested in. |
When you call an object console method on the DtVrfObject class, the message is sent to that object’s console. When you call an object console method on the DtSimComponent class, the message is sent to the console of the object to which that component is attached. The following example is sent from a class derived from DtSimComponent:
You can code object console messages so that they can be extracted by lupdate into an untranslated.ts file for translation. (For complete details about translation files, please see Section 2.5, Localizing the Graphical User Interface in VR-Forces Users Guide.) This is done with a macro in vrfobjcore/objectConsole.h:
where module is the name of the class that the console message is in, for example:
[<< The Simulation Object Editor and OPD Editor Plug-in API] [Home] [Top of Page] [The Boost Serialization Library >>]