openlvc / disco

Java library for Distributed Interactive Simulation
11 stars 3 forks source link

Add support for custom PDUs and RPR mappers #64

Closed timpokorny closed 8 months ago

timpokorny commented 8 months ago

Support for Custom PDUs

Changes PduFactory from a utility class with statics to a regular class, and puts an instance of it inside the OpsCenter. We also keep support for a "default" factory singleton via PduFactory.getDefaultFactory().

Users can register custom PDUs by adding them to the DIS configuration used to create the OpsCenter. The OpsCenter will then set up its factory on startup with support for the custom PDUs. As the factory is now bound inside the OpsCenter, different concurrent OpsCenterinstances can have different custom PDU support.

Support for Custom Mappers of Custom PDUs

The same is now true for custom FOM mappers. A user can get register a custom FOM mapper by getting the RprConfiguration and calling the method registerExtensionMapper(). Note that you will need to also ensure that any custom FOM modules that the mapper needs are registered via the method registerExtensionModules() before startup.

Other Changes

We also remove PduFactory.create() methods with generic return type. These were not type safe anyway and should never have been generic.

Updated Portico

Fixed some bugs in Portico 2.0.x and added a working version that allowed the custom RPR mapper tests to run successfully.