Skip to content

Table of changes to Xmlpg generated code for Open DIS

Leif Gruenwoldt edited this page Nov 5, 2024 · 38 revisions

The Xmlpg code generator was used by the Open DIS project (up until ~2018) to produce a 95% starting point of a DIS spec implementation for multiple languages. However there are some flaws with the generated code. To address this, there are several changes that must be applied to the generated code. The following table is an attempt to capture all the key changes that have been made, and in which other langauges they have also been applied or still need to be applied.

Historic context:

In the "old days" these changes were tracked as a folder of Unix patch files within each language repo (e.g. /patches). When Xmlpg was in heavy development, Xmlpg was re-run regularly and the folder of patches were reapplied to the output each time. Fast forard, Xmlpg reached a state that the generated output was "good enough", and the Xmlpg tool was not being re-run anymore. As the community found issues with the generated output, GitHub issues were logged, pull requests submitted and the changes were applied directly to the git repository as git commits. This was to encourage community contribution, but the downside was the divide between the output of the Xmlpg tool and the git repositories grew and the divide between each language implementation grew. It became a great challenge to backport a change from one language to all the other languages too. It was easy to forget and not trivial to lookup if a change had been backported to one, some, or all language implementations.

Goals:

  1. Increase awareness into what common changes are required to the implementations.
  2. Support a process to backport common changes to all languages.

Table instructions:

  1. Record a a Yes, No, NA or TBD as to whether the change has been applied to each language. Better is a commit or line ref. Even better is a unit test ref.
Change open-dis-java open-dis-cpp open-dis-javascript open-dis-python open-dis-csharp xmlpg
Pdu class #getLength should return #getMarshalledSize instead of the length field Yes DIS 6 and DIS 7 Yes No No No TBD
VariableDatum class should pad buffer on 64 bit boundary. Affects #marshall and #unmarshall. TBD TBD TBD TBD TBD TBD
VariableDatum length measured in bits not bytes Yes DIS 6 TBD Yes DIS 7, Yes DIS 6 TBD TBD TBD
Marking class should ensure content set by #setCharacters is truncated or padded to 11 characters. Yes No Yes DIS 7 Yes TBD TBD
Replace all uses of OneByteChunk class with byte array. Yes DIS 6 and DIS 7 Yes TBD TBD TBD TBD
SignalPdu class #getDataLength should return the length in bits and not in bytes. Yes DIS 6, Yes DIS 7 Yes DIS 6 TBD TBD TBD TBD
TransmitterPdu class - Each Modulation Parameter should only be 16 bits. The wrong data type used. Yes DIS 6 TBD TBD TBD TBD TBD
EntityId add #hashCode Yes DIS and DIS 7 TBD TBD TBD TBD TBD
SetDataPdu class refactor to use VariableDatum and FixedDatum classes Yes DIS 6 TODO TBD TODO TBD Yes
Transmitter PDU BeamAntennaPattern reference system field is 8-bits. The wrong data type is used (byte not short) Yes DIS 6 TBD TBD TBD TBD TBD
Articulation parameter is either a parameter value (first 32 bits) or an entity type record dependent on the parameter type designator field Yes DIS 6 TBD TBD TBD TBD TBD
Underwater Acoustic PDU has wrong size of BeamDataLength in AcousticBeamData Yes DIS 6 and DIS 7 Yes DIS 6 TBD TBD TBD TBD
Clone this wiki locally