Using rtirecord.xml in python connector/XML Application

1 post / 0 new
Offline
Last seen: 1 month 5 days ago
Joined: 05/08/2017
Posts: 1
Using rtirecord.xml in python connector/XML Application

Main Question:

How do I explicitly fill out a union? The other examples given on the forum rely on it automatically figuring out what type to use, but the rtirecord struct (ab)uses the discriminator to mean different things!

<enum name="RTIRecorderAdminMessageType">
        <enumerator name="RTI_RECORDER_ADMIN_ANNOUNCE" />
        <enumerator name="RTI_RECORDER_ADMIN_START" />
        <enumerator name="RTI_RECORDER_ADMIN_STOP" />
        <enumerator name="RTI_RECORDER_ADMIN_CONFIGURE" />
        <enumerator name="RTI_RECORDER_ADMIN_INFO" />
        <enumerator name="RTI_RECORDER_ADMIN_SHUTDOWN" />
        <enumerator name="RTI_RECORDER_ADMIN_ADD" />
        <enumerator name="RTI_RECORDER_ADMIN_UPDATE" />
        <enumerator name="RTI_RECORDER_ADMIN_MODIFY" />
        <enumerator name="RTI_RECORDER_ADMIN_DELETE" />
        <enumerator name="RTI_RECORDER_ADMIN_PAUSE" />
        <enumerator name="RTI_RECORDER_ADMIN_RESUME" />
        <enumerator name="RTI_RECORDER_ADMIN_PING" />
        <enumerator name="RTI_RECORDER_ADMIN_RESPONSE" />
        <enumerator name="RTI_RECORDER_ADMIN_PARTITION" />
    </enum>

<!-- ... -->

<union name="RTIRecorderAdminUnion" nested="true" extensibility="mutable">
        <discriminator type="nonBasic" nonBasicTypeName="RTIRecorderAdminMessageType" />
        <case>
            <caseDiscriminator value="(RTI_RECORDER_ADMIN_ANNOUNCE)" />
            <member name="service_mask" type="int32" />
        </case>
        <case>
            <caseDiscriminator value="(RTI_RECORDER_ADMIN_START)" />
            <caseDiscriminator value="(RTI_RECORDER_ADMIN_STOP)" />
            <caseDiscriminator value="(RTI_RECORDER_ADMIN_SHUTDOWN)" />
            <caseDiscriminator value="(RTI_RECORDER_ADMIN_PAUSE)" />
            <caseDiscriminator value="(RTI_RECORDER_ADMIN_RESUME)" />
            <member name="dummy" type="int32" />
        </case>
        <case>
            <caseDiscriminator value="(RTI_RECORDER_ADMIN_PARTITION)" />
            <member name="partitions" type="nonBasic" nonBasicTypeName="RTIRecorderPartitionMessage" />
        </case>
        <case>
            <caseDiscriminator value="(RTI_RECORDER_ADMIN_CONFIGURE)" />
            <caseDiscriminator value="(RTI_RECORDER_ADMIN_ADD)" />
            <caseDiscriminator value="(RTI_RECORDER_ADMIN_UPDATE)" />
            <caseDiscriminator value="(RTI_RECORDER_ADMIN_MODIFY)" />
            <caseDiscriminator value="(RTI_RECORDER_ADMIN_DELETE)" />
            <caseDiscriminator value="(RTI_RECORDER_ADMIN_PING)" />
            <member name="config" type="nonBasic" nonBasicTypeName="RTIRecorderConfigMessage" />
        </case>
        <case>
          <caseDiscriminator value="(RTI_RECORDER_ADMIN_RESPONSE)" />
          <member name="result" type="nonBasic" nonBasicTypeName="RTIRecorderResponse"/>
        </case>
        <case>
          <caseDiscriminator value="(RTI_RECORDER_ADMIN_INFO)" />
          <member name="info" type="nonBasic" nonBasicTypeName="RTIRecorderInfoMessage"/>
        </case>
    </union>

As such, I don't quite see a way to send a STOP vs a START message if all I can do is set the dummy field.

Background:

I have an older record/playback UI written in Python that I need to add some dds support to, effectively controlling two datastreams at once. Since it's solely in Python as it is, I'd like to keep it that way, and have hooked up the RTIConnector in an attempt to stay there.

Caveat:

I know that the remote admin recording API is going to change in 6.0.0, but I'm not sure that my project will migrate to it then, if at all...

 

Thanks in advance!