![]() |
VR-Forces Developer's Guide
|
This document describes the public API changes in the vrfGuiObjectInformationQt library between VR-Forces 5.2 and VR-Forces 5.3.
The library supplies the object information dialog, its pages, and the page item update functions that populate them. It is the primary extension point for applications that add custom information pages or custom information items, so most of the changes below affect derived classes rather than direct callers.
The changes fall into four groups: the removal of the Tactical Data Link message page, a rework of the IFF page widget structure, a shift from makVrv::DtUniqueID to DtUUID in the spot report items, and a set of signature and container changes in the aggregate and systems page logic classes. A number of new state page items were also added.
Changes that are internal to an implementation or limited to comments are not listed.
The header vrfGuiObjectInformationQt/tdlMessageStatePage.h was deleted along with the internal Tactical Data Link subsystem. It defined DtTDLMessageStatePage, a DtSpotReportStatePage subclass, and the DtTDLMessageStatePageCreator typedef.
Remove the include, any registration of DtTDLMessageStatePageCreator with the page factory, and any page configuration entries that reference the page class name. There is no replacement page. Code that derived from DtTDLMessageStatePage should derive from DtSpotReportStatePage directly if the spot report presentation is still required.
The IFF page no longer hosts its pages in a QTabWidget. It now uses a QTabBar paired with a separate content widget, and the forward declaration at the top of the header changed from QTabWidget to QTabBar accordingly.
Code that reached into myTabWidget to add, style, or query tab pages must be rewritten against the tab bar and the canvas widget. myTabBar carries the tab labels and the current index; myCanvas is the widget that holds the contents of the selected tab. Use addPage, removePage, numPages, and selectedIffStateComponent where possible instead of manipulating the widgets directly, since those methods now encapsulate the coordination between the two widgets.
The page-to-element association is established when a page is created, so the separate setter is no longer part of the interface. Overrides of setPageId in derived classes must be deleted, and callers must rely on addPage to establish the association. iffStateComponent(int page) remains available for retrieving the component bound to a given tab index.
The spot report items are keyed by simulation object UUID rather than by the GUI element unique identifier. Two virtual methods on DtSpotReportInformationItem changed signature:
Any class deriving from DtSpotReportInformationItem that overrides either method must be updated, and callers must pass a DtUUID. Because the parameter is now passed by const reference rather than by value, an override that keeps the old signature will silently become a new overload rather than an override; the override specifier will catch this at compile time.
The protected member that tracks the set of observers changed with the UUID conversion above:
The accessor for the cached state properties is now a virtual method that takes the simulation object reference whose properties are requested. The non-virtual, inline, argument-less form was removed.
Every call site must supply the reference for the object being displayed. Derived classes that cache or transform state properties can now override the accessor instead of shadowing the member.
updateStateProperties and parameterDataUpdated moved from the protected section to the public section:
Existing overrides continue to work, but a derived class that redeclares these methods in its own protected section narrows their accessibility relative to the base class. Move such declarations to the public section so that the access level matches.
The systems page now tracks the hit zone associated with each system, so the item map no longer stores a bare tree widget item. A new protected nested struct holds the pair.
Derived classes that iterate mySystemItems must access the tree item through myQTreeItem rather than dereferencing the mapped value directly. Note also that the DtSystemItems typedef moved from the trailing protected block to a protected block declared ahead of the public section, so it is declared before the methods that use it.
Both items dropped the protected member that cached the last displayed count:
The values are read from the aggregate state component on each update, so there is no cached value to consult. Derived classes that read these members for change detection must compare against the value returned by value(DtSimObjectReference) instead.
Four maritime lighting items and a symbol identification code item were added to entityInformationPageItems.h. Each follows the established DtEntityStatePageItem pattern, with the two standard constructors, a static creatorName, and a matching DtItemUpdateFunctionCreator typedef.
| Class | Creator typedef |
|---|---|
DtStateSidc | DtStateSidcCreator |
DtEntityStateAgroundLightsOn | DtEntityStateAgroundLightsOnCreator |
DtEntityStateConstrainedByDraftLightsOn | DtEntityStateConstrainedByDraftLightsOnCreator |
DtEntityStateMobOperationLightsOn | DtEntityStateMobOperationLightsOnCreator |
DtEntityStateSignalLightsOn | DtEntityStateSignalLightsOnCreator |
DtStateSidc overrides needsPageLogicForWidgetRepresentation. The four lighting items override shouldBeHidden so that they are displayed only for platforms whose state carries the corresponding light. Register the creators with the item factory to make the items available to page configurations.
aisDataPageItems.h gained DtAisShipClassPageItem, a DtAisDataPageItem subclass that reports the AIS ship class. It provides the display-name constructor and the page logic constructor used by the other AIS items and overrides stateValue. Unlike the entity state items above, it does not declare a creator typedef.
DtInformationDialogPage gained a new virtual method:
It reports whether the page offers a right-click copy action for its contents. The base implementation supplies a default, so existing pages compile unchanged; override it in a custom page to opt in or out. DtTaskStatePage overrides it in 5.3. Because this method was inserted into the virtual table of a class that plug-ins derive from, plug-in binaries must be recompiled against the 5.3 headers.
DtAggregateStatePageItem now declares virtual void deactivate() override, and DtAggregateStateHealth and DtAggregateStatePrimaryEquipment add protected deactivate overrides. Derived items that hold connections or widgets should release them from an override of deactivate and call the base implementation.
DtAggregateStateOrderedPosture adds virtual void timerUpdate() const together with the protected members myTimerUpdate, a scoped signal connection, and myDisplayText, which caches the rendered posture transition text between timed updates.
Returns the UUID assigned to a named sensor, allocating and caching one on first use. This supports the per-sensor simulation object references created by createSensorContactReference.
The systems page now displays hit zones in addition to component systems. The following public methods were added:
addHitZones populates the list with hit zones that are not associated with any system. updateSystemsDamagedState appends the damaged state to the enabled state as a comma separated string, and updateHitZonesDamagedState performs the equivalent update for the hit zone entries.
The following protected helpers support them:
The object console logic now listens for notify level messages and detects stale state. Three protected virtual methods were added:
The header now includes vrfmsgs/vrfObjectMessage.h for the message type, and the class holds an additional myStateUpdateConnection member for the state update subscription.
DtAggregateSuppliesPageLogic adds a protected virtual void updateData() override, which refreshes the ammunition and supplies tabs from the current state properties.
| Header | Replacement |
|---|---|
vrfGuiObjectInformationQt/tdlMessageStatePage.h | None. The Tactical Data Link message page was removed with the internal Tactical Data Link subsystem. Derive from DtSpotReportStatePage if the spot report presentation is still needed. |
Return to VR-Forces 5.3 API Migration Guide.
[Home]