diff --git a/DFDL/dataFormats/rst/build.xml b/DFDL/dataFormats/rst/build.xml index 0f0617ca8b894a7934067d4599e63086d4659dfe..a40cfc2c29f602d329cb60f0463aa1baa13ebd13 100644 --- a/DFDL/dataFormats/rst/build.xml +++ b/DFDL/dataFormats/rst/build.xml @@ -76,11 +76,28 @@ <xmlvalidate file="${rst.subset.xsd}" failonerror="false" warn="true" lenient="true"/> <!--note that XSD schema validation using schemavalidate task requires special setup https://ant.apache.org/manual/Tasks/schemavalidate.html--> <echo message="schemavalidate original schema ${rst.subset.xsd}"/> + <!-- DFDL schema set can be found in the org.apache.daffodil.daffodil-lib-3.4.0.jar under the package org.apache.daffodil.xsd --> <schemavalidate file="${rst.subset.xsd}" failonerror="true" warn="true" lenient="false" fullchecking="false"> - <schema namespace="http://www.w3.org/2001/XMLSchema" file="${attrib.dir}/org/apache/daffodil/xsd/XMLSchema_for_DFDL.xsd"/> + <!--<schema namespace="http://www.w3.org/2001/XMLSchema" file="${attrib.dir}/org/apache/daffodil/xsd/XMLSchema_for_DFDL.xsd"/>--> +<!-- <classpath> + <fileset dir="${dfdl.lib.dir}"> + <include name="**/*.jar"/> + </fileset> + </classpath>--> + <xmlcatalog> +<!-- <classpath> + <fileset dir="${dfdl.lib.dir}"> + <include name="**/*.jar"/> + </fileset> + </classpath>--> + <catalogpath> + <pathelement path="${xml.catalog}"/> + <!--<fileset dir="${attrib.dir}" includes="XMLCatalog.xml"/>--> + </catalogpath> + </xmlcatalog> </schemavalidate> <echo message="... schemavalidate passed"/> - <echo message="daffodil parse dis rst"/> +<!-- <echo message="daffodil parse rstdis "/> <echo message="... (note that apache daffodil warnings about dfdl:encodingErrorPolicy can be ignored)"/> <antcall target="parse.validate"/> <echo message="============================================"/> @@ -96,23 +113,34 @@ <echo message="============================================"/> <echo message="Check well-formed result for ${output.xml}"/> <xmlvalidate file="${output.xml}" failonerror="false" warn="true" lenient="true"/> - <!--note that XSD schema validation using schemavalidate task requires special setup https://ant.apache.org/manual/Tasks/schemavalidate.html--> + note that XSD schema validation using schemavalidate task requires special setup https://ant.apache.org/manual/Tasks/schemavalidate.html <echo message="Check schema-valid result for ${output.xml} using original ${rst.subset.xsd}"/> - <!-- note failonerror="false" in order to reach follow-on TODO - TODO: Do we need the attrib noNamespaceFile? (tdn) --> + note failonerror="false" in order to reach follow-on TODO + TODO: Do we need the attrib noNamespaceFile? (tdn) <schemavalidate file="${output.xml}" failonerror="false" warn="true" lenient="false" disableDTD="true" fullchecking="true" noNamespaceFile="${rst.subset.xsd}"/> <echo message="TODO validation errors seem due to insufficient XML generation by Apache Daffodil"/> <echo message="Suggested namespace declaration additions:"/> <echo message=' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'/> - <echo message=' xsi:noNamespaceSchemaLocation="${rst.subset.xsd}"'/> + <echo message=' xsi:noNamespaceSchemaLocation="${rst.subset.xsd}"'/>--> + </target> + + <target name="trace.parse.no.validate" depends="init"> + <exec executable="${bin.dir}/daffodil" vmlauncher="false"> + <arg value="-t"/> + <arg value="parse"/> + <arg line="-s ${rst.subset.xsd}"/> + <arg value="--nostream"/> + <arg line="-o ${output.xml}"/> + <arg value="${input.data.path}"/> + </exec> </target> <target name="parse.no.validate" depends="init"> <exec executable="${bin.dir}/daffodil" vmlauncher="false"> <arg value="parse"/> <arg line="-s ${rst.subset.xsd}"/> - <arg value="--stream"/> + <arg value="--stream"/> <!-- nostream good for debugging --> <arg line="-o ${output.xml}"/> <arg value="${input.data.path}"/> </exec> diff --git a/DFDL/dataFormats/rst/doc/PduGenerator_ENCODING_PLAINTEXT_CommentPduLog.bitmap b/DFDL/dataFormats/rst/doc/PduGenerator_ENCODING_PLAINTEXT_CommentPduLog.bitmap new file mode 100644 index 0000000000000000000000000000000000000000..d6c897d40b36f310d6321d1f2bd1dd2e16d7c426 --- /dev/null +++ b/DFDL/dataFormats/rst/doc/PduGenerator_ENCODING_PLAINTEXT_CommentPduLog.bitmap @@ -0,0 +1,28 @@ +PDU Header +7, Protocol Version +1, Exercise ID +22, PDU Type +5, Protocol Family +0,0,0,0,0, Timestamp +80, Length +40, PDU Status +0, Padding + +Originating ID +0, Site # +0, App. # +0, Ref. # + +Receiving ID +0, Site # +0, App. # +0, Ref. # + +0, Number of Fixed Datum Records +0, Number of Variable Datum Records (M) + +Variable Datam i +0,0,0,0,0,0,0,0,0,0,0,1,0,0,-81,-46,0,0,1, Variable Datum ID +64, Variable Datum Length +83,105,109,117,108,97,116,105,111,110,32,116,105,109,101,115,116,101,112,32,100,117,114,97,116,105,111,110,32,49,46,48,32,115,101,99,111,110,100,115 + Variable Datum Value diff --git a/DFDL/dataFormats/rst/doc/PduGenerator_ENCODING_PLAINTEXT_EntityStatePduLog4.bitmap b/DFDL/dataFormats/rst/doc/PduGenerator_ENCODING_PLAINTEXT_EntityStatePduLog4.bitmap new file mode 100644 index 0000000000000000000000000000000000000000..6597de57016789fdddbba200db19ada738e1aa28 --- /dev/null +++ b/DFDL/dataFormats/rst/doc/PduGenerator_ENCODING_PLAINTEXT_EntityStatePduLog4.bitmap @@ -0,0 +1,55 @@ +PDU Header +7, Protocol Version +1, Exercise ID +1, PDU Type +1, Protocol Family +0,0,0,0,0, Timestamp +-112, Length +40, PDU Status +0, Padding + +Entity ID +0, Site # +1, App. # +0, Entity # + +2, Force ID +0, Number of Variable Parameter Records + +Entity Type +3, Entity Kind +1, Domain +0, Country +1, Category +2, Subcategory +0, Specific +-31, Extra + +Alternate Entity Type +23, Entity Kind +2, Domain +1, Country +0, Category +0, Subcategory +0, Specific +0, Extra + +Entity Linear Velocity +-31, x-component +0, y-component +0, z-component + +Entity Location +0, X-component +0, Y-component +0, Z-component + +Entity Orientation +0, Psi +0, Theta +0, Phi + +Dead Reckoning Parameters +0, Dead Reckoning Algorithm +0, Other Parameters +0,0,0,0,0,0,63,-16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,69,110,116,105,116,121,32,35,53,51,0,0,0,0 diff --git a/DFDL/dataFormats/rst/lib/commons-io-2.6.jar b/DFDL/dataFormats/rst/lib/commons-io-2.6.jar new file mode 100644 index 0000000000000000000000000000000000000000..00556b119d45dd85a3c3073b1826916c3c60b9c4 Binary files /dev/null and b/DFDL/dataFormats/rst/lib/commons-io-2.6.jar differ diff --git a/DFDL/dataFormats/rst/lib/guava-28.0-jre.jar b/DFDL/dataFormats/rst/lib/guava-28.0-jre.jar new file mode 100644 index 0000000000000000000000000000000000000000..f254aae7680a1a64f886b826a7e1fc25ebdaef1f Binary files /dev/null and b/DFDL/dataFormats/rst/lib/guava-28.0-jre.jar differ diff --git a/DFDL/dataFormats/rst/lib/opendis7-enumerations-classes.jar b/DFDL/dataFormats/rst/lib/opendis7-enumerations-classes.jar new file mode 100644 index 0000000000000000000000000000000000000000..74afd1ecb60074d964c0cc2a953b049d66bb2c88 Binary files /dev/null and b/DFDL/dataFormats/rst/lib/opendis7-enumerations-classes.jar differ diff --git a/DFDL/dataFormats/rst/lib/opendis7-enumerations-source.jar b/DFDL/dataFormats/rst/lib/opendis7-enumerations-source.jar new file mode 100644 index 0000000000000000000000000000000000000000..ab226e7c9ba16f4693b787e2e36fe764fb9e5d82 Binary files /dev/null and b/DFDL/dataFormats/rst/lib/opendis7-enumerations-source.jar differ diff --git a/DFDL/dataFormats/rst/lib/opendis7-pdus-classes.jar b/DFDL/dataFormats/rst/lib/opendis7-pdus-classes.jar new file mode 100644 index 0000000000000000000000000000000000000000..2e8281b9f1daacbe47e44f4fb2f406054fc26393 Binary files /dev/null and b/DFDL/dataFormats/rst/lib/opendis7-pdus-classes.jar differ diff --git a/DFDL/dataFormats/rst/nbproject/configs/Base64.properties b/DFDL/dataFormats/rst/nbproject/configs/Base64.properties new file mode 100644 index 0000000000000000000000000000000000000000..95d6f5cadca43c15da1c848ed1bf61555dff6e52 --- /dev/null +++ b/DFDL/dataFormats/rst/nbproject/configs/Base64.properties @@ -0,0 +1 @@ +main.class=edu.nps.moves.dis7.examples.PduGenerator diff --git a/DFDL/dataFormats/rst/nbproject/configs/Binary.properties b/DFDL/dataFormats/rst/nbproject/configs/Binary.properties new file mode 100644 index 0000000000000000000000000000000000000000..95d6f5cadca43c15da1c848ed1bf61555dff6e52 --- /dev/null +++ b/DFDL/dataFormats/rst/nbproject/configs/Binary.properties @@ -0,0 +1 @@ +main.class=edu.nps.moves.dis7.examples.PduGenerator diff --git a/DFDL/dataFormats/rst/nbproject/configs/PlainText.properties b/DFDL/dataFormats/rst/nbproject/configs/PlainText.properties new file mode 100644 index 0000000000000000000000000000000000000000..95d6f5cadca43c15da1c848ed1bf61555dff6e52 --- /dev/null +++ b/DFDL/dataFormats/rst/nbproject/configs/PlainText.properties @@ -0,0 +1 @@ +main.class=edu.nps.moves.dis7.examples.PduGenerator diff --git a/DFDL/dataFormats/rst/nbproject/project.properties b/DFDL/dataFormats/rst/nbproject/project.properties index 5790df535c75ab4536ef7bc971923f2b264a4696..a6e153532cab0137e137ce19cf8369645862c1e7 100644 --- a/DFDL/dataFormats/rst/nbproject/project.properties +++ b/DFDL/dataFormats/rst/nbproject/project.properties @@ -29,17 +29,25 @@ debug.test.modulepath=\ dist.archive.excludes= # This directory is removed when the project is cleaned: dist.dir=dist -dist.jar=${dist.dir}/dis.jar +dist.jar=${dist.dir}/${application.title}.jar dist.javadoc.dir=${dist.dir}/javadoc dist.jlink.dir=${dist.dir}/jlink dist.jlink.output=${dist.jlink.dir}/dis endorsed.classpath= excludes= +file.reference.commons-io-2.6.jar=lib/commons-io-2.6.jar +file.reference.guava-28.0-jre.jar=lib/guava-28.0-jre.jar +file.reference.opendis7-pdus-classes.jar=lib/opendis7-pdus-classes.jar +file.reference.opendis7-enumerations-classes.jar=lib/opendis7-enumerations-classes.jar includes=** jar.archive.disabled=${jnlp.enabled} jar.compress=false jar.index=${jnlp.enabled} -javac.classpath= +javac.classpath=\ + ${file.reference.opendis7-pdus-classes.jar}:\ + ${file.reference.opendis7-enumerations-classes.jar}:\ + ${file.reference.commons-io-2.6.jar}:\ + ${file.reference.guava-28.0-jre.jar} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false @@ -84,7 +92,7 @@ jnlp.signed=false jnlp.signing= jnlp.signing.alias= jnlp.signing.keystore= -main.class= +main.class=edu.nps.moves.dis7.utilities.stream.PduRecorderIEEE # Optional override of default Application-Library-Allowable-Codebase attribute identifying the locations where your signed RIA is expected to be found. manifest.custom.application.library.allowable.codebase= # Optional override of default Caller-Allowable-Codebase attribute identifying the domains from which JavaScript code can make calls to your RIA without security prompts. @@ -119,11 +127,15 @@ test.resources.dir=src/test/resources test.src.dir=src/test/java # Project specific resources -bin.dir=../../bin -#bin.dir=/Users/terry/javaapis/Apache Software Foundation (ASF)/apache-daffodil-3.5.0-bin/bin -attrib.dir=../../lib +dfdl.lib.dir=../../lib +#bin.dir=../../bin +bin.dir=../../../../Apache Software Foundation (ASF)/apache-daffodil-3.5.0-bin/bin +attrib.dir=../../attribution +xml.catalog=${attrib.dir}/XMLCatalog.xml pkg.path=edu/nps/moves/xsd/rst/dis -rst.subset.xsd=${src.resources.dir}/${pkg.path}/DIS_7_2012.RichSemanticTrackSubset.dfdl.xsd -input.data.name=PduCaptureLog +#rst.subset.xsd=${src.resources.dir}/${pkg.path}/DIS_7_2012.RichSemanticTrackSubset-string.dfdl_xsd +rst.subset.xsd=${src.resources.dir}/${pkg.path}/DIS_7_2012.RichSemanticTrackSubset-binary.dfdl_xsd +#input.data.name=PduGenerator_ENCODING_PLAINTEXT_PduCaptureLog +input.data.name=PduGenerator_ENCODING_BINARY_PduCaptureLog input.data.path=${test.resources.dir}/${pkg.path}/data/${input.data.name}.dislog -output.xml=${data.file.name}.xml +output.xml=${input.data.name}.xml diff --git a/DFDL/dataFormats/rst/src/doc/ReadMe b/DFDL/dataFormats/rst/src/doc/ReadMe index 54ebaf6a79fd205e2eda3bb348713dfdf6106373..bfd8003a36e1f3fa355a82ee3229fea49e2a7454 100644 --- a/DFDL/dataFormats/rst/src/doc/ReadMe +++ b/DFDL/dataFormats/rst/src/doc/ReadMe @@ -3,14 +3,16 @@ Started 03 AUG 2023 To configure the NetBeans IDE to develop DFDL schemas, by following the convention given for Eclipse: https://daffodil.apache.org/eclipse-configuration/ -The NetBeans IDE will not let you create a new file extension containing a . -i.e. .dfdl.xsd, as Eclipse does, so, disregard that part. It's most important to -configure the User XML catalog as follows: +The NetBeans IDE will not let you create a new file extension containing an +extra . in the file extension, i.e. .dfdl.xsd, as Eclipse does, so, disregard +that part. It's most important to just configure the User XML catalog as +follows: Configure the UserXMLCatalog.xml file located at -${DEFAULT_USERDIR_ROOT}/18/config/xml/ by placing this entry between the empty -catalog elements. Note: WIN machines will need a uri that begins like this: -file:///c:path/to/your/robodata/clone +${DEFAULT_USERDIR_ROOT}/18/config/xml/ by placing the below entry between the +empty catalog elements. If not yet created, then select Tools -> DTDs and XML +Schemas -> User Catalog -> Add local DTD or Schema. Note: WIN machines will need +a uri that begins like this: file:///c:path/to/your/robodata/clone <public publicId="-//W3C//DTD XMLSCHEMA 200102//EN" uri="file:/Users/terry/javaapis/robodata/DFDL/attribution/org/apache/daffodil/xsd/XMLSchema.dtd"/> <public publicId="datatypes" uri="file:/Users/terry/javaapis/robodata/DFDL/attribution/org/apache/daffodil/xsd/datatypes.dtd"/> diff --git a/DFDL/dataFormats/rst/src/main/java/edu/nps/moves/dis7/examples/PduGenerator.java b/DFDL/dataFormats/rst/src/main/java/edu/nps/moves/dis7/examples/PduGenerator.java new file mode 100644 index 0000000000000000000000000000000000000000..80496a00c47788bda36f99eb1e2686c6fbb27911 --- /dev/null +++ b/DFDL/dataFormats/rst/src/main/java/edu/nps/moves/dis7/examples/PduGenerator.java @@ -0,0 +1,431 @@ +/** + * Copyright (c) 2008-2023, MOVES Institute, Naval Postgraduate School (NPS). All rights reserved. + * This work is provided under a BSD open-source license, see project license.html or license.txt + * + * Based on the original <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/examples/src/OpenDis7Examples/ExampleSimulationProgram.java">ExampleSimulationProgram.java</a> + * + * @author brutzman@nps.edu + * @author <a href="mailto:tdnorbra@nps.edu?subject=edu.nps.moves.dis7.examples.ExampleSimulationProgram">Terry D. Norbraten</a> + */ +package edu.nps.moves.dis7.examples; + +import edu.nps.moves.dis7.entities.swe.platform.surface._002Triton; +import edu.nps.moves.dis7.entities.usa.platform.air.CH53ESuperStallion; +import edu.nps.moves.dis7.enumerations.*; +import edu.nps.moves.dis7.pdus.*; +import edu.nps.moves.dis7.utilities.DisChannel; +import edu.nps.moves.dis7.utilities.DisChannelIEEE; +import edu.nps.moves.dis7.utilities.PduFactory; + +import java.time.LocalDateTime; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** The purpose of this inheritable class is to provide an easily modifiable + * example simulation program that includes DIS-capable entities performing + * tasks of interest, and then reporting activity via PDUs to the network. + * Default program initialization includes PDU recording turned on by default. + * @see <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/examples/src/OpenDis7Examples/ExampleSimulationProgramLog.txt">ExampleSimulationProgramLog.txt</a> + * @see <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/examples/src/OpenDis7Examples/ExampleSimulationProgramPduCaptureLog.dislog">ExampleSimulationProgramPduCaptureLog.dislog</a> + * @see <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/examples/src/OpenDis7Examples/ExampleSimulationProgramFlowDiagram.pdf">ExampleSimulationProgramFlowDiagram.pdf</a> + * @see <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/examples/src/OpenDis7Examples/ExampleSimulationProgramWireshark.png">ExampleSimulationProgramWireshark.png</a> + * @see <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/examples/src/OpenDis7Examples/ExampleSimulationProgramSequenceDiagram.png">ExampleSimulationProgramSequenceDiagram.png</a> + */ +public class PduGenerator +{ + /** Maximum number of simulation loops */ + private static final int MAX_LOOP_COUNT = 0; + + /* **************************** infrastructure code, modification is seldom needed ************************* */ + + private String descriptor; + /** DIS channel defined by network address/port combination includes multiple utility capabilities */ + private DisChannel disChannel; + /** Factory object used to create new PDU instances */ + private PduFactory pduFactory; + + /** seconds per loop for real-time or simulation execution */ + private double simulationTimeStepDuration; // seconds TODO encapsulate + /** initial simulation time in seconds */ +// private double simulationTimeInitial = 0.0d; + /** current simulation time in seconds */ + private double simulationTimeSeconds/*simulationTimeInitial*/; + + private String narrativeMessage1; + private String narrativeMessage2; + private String narrativeMessage3; + + /** EntityID settings for entity 1 */ + private EntityID entityID_1; + /** EntityID settings for entity 2 */ + private EntityID entityID_2; + /** ESPDU for entity 1 */ + private EntityStatePdu entityStatePdu_1; + /** ESPDU for entity 2 */ + private EntityStatePdu entityStatePdu_2; + /** FirePdu for entity 1 first weapon (if any) */ + private FirePdu firePdu_1a; + /** FirePdu for entity 1 second weapon (if any) */ + private FirePdu firePdu_1b; + /** MunitionDescriptor for these weapons */ + private MunitionDescriptor munitionDescriptor1; + + // hey programmer, what other state do you want? this is a good place to declare it... + + /** + * Constructor to create an instance of this class. + * Design goal: additional built-in initialization conveniences can go here + * to keep your efforts focused on the runSimulation() method. + */ + // base constructor is not invoked automatically by other constructors + // https://stackoverflow.com/questions/581873/best-way-to-handle-multiple-constructors-in-java + public PduGenerator() + { + simulationTimeStepDuration = 1.0d; + simulationTimeSeconds = 0.0d; + descriptor = this.getClass().getSimpleName(); + entityID_1 = new EntityID(); + entityID_2 = new EntityID(); + initialize(); + } + + /** + * Constructor to create an instance of this class. + * @param newDescriptor describes this program, useful for logging and debugging + */ + public PduGenerator(String newDescriptor) + { + this(); + descriptor = newDescriptor; + } + + /** + * Utility Constructor that allows your example simulation program to override default network address and port + * @param address network address to use + * @param port corresponding network port to use + */ + public PduGenerator(String address, int port) + { + this(); + disChannel.setNetworkAddress (address); + disChannel.setNetworkPort (port); + disChannel.setVerboseComments (false); // TODO rename library method to disambiguate CommentPDU + // TODO still seems really chatty... add silent mode? + disChannel.setVerboseDisNetworkInterface(false); // Default false + disChannel.setVerbosePduRecorder (false); // default false + } + + /** Initialize channel setup for OpenDis7 and report a test PDU + * @see initializeDisChannel + * @see initializeSimulationEntities */ + private void initialize() + { + initializeDisChannel(); // must come first, uses PduFactory + + initializeSimulationEntities(); // set unchanging parameters + + disChannel.join(); // TODO further functionality expected + + String timeStepMessage = "Simulation timestep duration " + getSimulationTimeStepDuration() + " seconds"; +// disChannel.sendCommentPdu(simulationTimeSeconds, DisChannel.COMMENTPDU_SIMULATION_TIMESTEP, timeStepMessage); + // additional constructor initialization can go here + } + + /** Initialize channel setup for OpenDis7 and report a test PDU */ + private void initializeDisChannel() + { + if (disChannel == null) + disChannel = new DisChannelIEEE(); + else + { + disChannel.printlnTRACE ("*** warning, duplicate invocation of initializeDisChannel() ignored"); + return; + } + pduFactory = disChannel.getPduFactory(); + disChannel.setDescriptor(this.getClass().getSimpleName()); // PduGenerator might be a superclass + disChannel.setUpNetworkInterface(); + disChannel.printlnTRACE ("just checking: disChannel.getNetworkAddress()=" + disChannel.getNetworkAddress() + + ", getNetworkPort()=" + disChannel.getNetworkPort()); + + disChannel.getPduRecorder().setVerbose(true); + + // TODO confirm whether recorder is explicitly started by programmer (or not) +// disChannel.sendCommentPdu(VariableRecordType.OTHER, "ArrivalProcessOpenDis7 initialized"); // hello channel, debug + } + + /** Get ready, get set... initialize simulation entities. Who's who in the zoo? + */ + public void initializeSimulationEntities() + { + if (pduFactory == null) + pduFactory = disChannel.getPduFactory(); + entityStatePdu_1 = pduFactory.makeEntityStatePdu(); + entityStatePdu_2 = pduFactory.makeEntityStatePdu(); +// firePdu_1a = pduFactory.makeFirePdu(); +// firePdu_1b = pduFactory.makeFirePdu(); + munitionDescriptor1 = new MunitionDescriptor(); + + // Your model setup: define participants. who's who in this zoo? + // Assuming you keep track of entity objects... here is some support for for Entity 1. + + // PDU objects are already declared and instances created, so now set their values. + entityID_1.setSiteID(1).setApplicationID(2).setEntityID(3); // made-up example ID; +// disChannel.addEntity(entityID_1); + + entityID_2.setSiteID(1).setApplicationID(2).setEntityID(4); // made-up example ID; +// disChannel.addEntity(entityID_2); + // TODO someday, use enumerations for sites as part of a SimulationManager object; e.g. is there a unique site triplet for MOVES Institute? + + entityStatePdu_1.setEntityID(entityID_1); + entityStatePdu_1.setForceId(ForceID.FRIENDLY); + entityStatePdu_1.setEntityType(new CH53ESuperStallion()); // note import statement at top + entityStatePdu_1.setMarking("Entity #53"); + + entityStatePdu_2.setEntityID(entityID_2); + entityStatePdu_2.setForceId(ForceID.OPPOSING); + entityStatePdu_2.setEntityType(new _002Triton()); // note import statement above + entityStatePdu_2.setMarking("Entity #2"); + + // TODO how should we customize this munition? what are key parameters for your simulation? + // more is needed here by scenario authors... + munitionDescriptor1.setQuantity(1); +// firePdu_1a.setDescriptor(munitionDescriptor1).setRange(1000.0f); + } + + /** + * This runSimulationLoops() method is for you, a customizable programmer-modifiable + * code block for defining and running a new simulation of interest. + * + * Welcome! Other parts of this program handle bookkeeping and plumbing tasks so that + * you can focus on your model entities and activities. + * Expandable support includes DIS EntityStatePdu, FirePdu and CommentPdu all available for + * modification and sending in a simulation loop. + * Continuous improvement efforts seek to make this program as easy and straightforward + * as possible for DIS simulationists to use and adapt. + * All of the other methods are setup, teardown and configuration that you may find + * interesting, even helpful, but don't really have to worry about. + */ + @SuppressWarnings("SleepWhileInLoop") // yes we might do that + public void runSimulationLoops () + { + try + { + final int SIMULATION_MAX_LOOP_COUNT = 10; // be deliberate out there! also avoid infinite loops. + int simulationLoopCount = 0; // variable, initialized at 0 + boolean simulationComplete = false; // sentinel variable as termination condition, are we done yet? + + // TODO reset Clock Time for today's date and timestamp to zero, providing consistent outputs for each simulation run + String timeMessage = "Simulation time " + simulationTimeSeconds + " at LocalDateTime " + LocalDateTime.now(); + + // TODO: The VariableDatamRecord length isn't parsing correctly on the + // DFDL side. However, the PDU value is correct. +// disChannel.sendCommentPdu(simulationTimeSeconds, DisChannel.COMMENTPDU_TIME, timeMessage); + // TODO replace enumeration with disChannel.COMMENTPDU_TIME + // TODO fix VariableRecordType.TIME_AMP_DATE_VALID + + // =================================================================================================== + // loop the simulation while allowed, programmer can set additional conditions to break out and finish + while (simulationLoopCount < SIMULATION_MAX_LOOP_COUNT) // are we done yet? + { + simulationLoopCount++; // good practice: increment loop counter as first action in that loop + + // ============================================================================================= + // * your own simulation code starts here! ***************************************************** + // ============================================================================================= + + // are there any other variables to modify at the beginning of your loop? + + // are you reading any DIS PDUs from the network? check for them here + + // compute a track, update an ESPDU, whatever it is that your model is doing... + + // Where is my entity? Insert changes in position; this sample only changes X position. + entityStatePdu_1.getEntityLocation().setX(entityStatePdu_1.getEntityLocation().getX() + 1.0d); // 1m per timestep + + // decide whether to fire, and then update the firePdu. Hmmm, you might want a target to shoot at! + + // etc. etc. your code goes here for your simulation of interest + + // something happens between my simulation entities, la de da de da... + System.out.println ("... My simulation just did something, no really..."); + System.out.flush(); // make sure this arrives to user even if other threads somehow become deadlocked + + // make your reports: narrative code for CommentPdu here (set all to empty strings to avoid sending) + narrativeMessage1 = getClass().getSimpleName(); + narrativeMessage2 = "runSimulation() loop " + simulationLoopCount; + narrativeMessage3 = ""; // intentionally blank for testing + + // your loop termination condition goes here + if (simulationLoopCount > MAX_LOOP_COUNT) // for example + { + simulationComplete = true; + } + // ============================================================================================= + // * your own simulation code is finished here! ************************************************ + // ============================================================================================= + + // staying synchronized with timestep: wait duration for elapsed time in this loop + // Thread.sleep needs a (long) parameter for milliseconds, which are clumsy to use sometimes + Thread.sleep((long)(getSimulationTimeStepDuration() * 1000)); // units of seconds * (1000 msec/sec) = milliseconds + System.out.println ("... [Pausing for " + getSimulationTimeStepDuration() + " seconds]"); + + // OK now send the status PDUs for this loop, and then continue + System.out.println ("... sending PDUs of interest for simulation step " + simulationLoopCount + ", monitor loopback to confirm sent"); + System.out.flush(); + + // TODO set timesteps in PDUs + + sendAllPdusForLoopTimestep(simulationTimeSeconds, + entityStatePdu_1, + firePdu_1a, + DisChannel.COMMENTPDU_APPLICATION_STATUS, + narrativeMessage1, narrativeMessage2, narrativeMessage3); + disChannel.sendSinglePdu(simulationTimeSeconds, entityStatePdu_2); // me too i.e. 2! + + System.out.println ("... [PDUs of interest successfully sent for this loop]"); + System.out.flush(); + + // =============================== + // current loop now finished, check whether to terminate if simulation complete, otherwise continue + if (simulationComplete || (simulationLoopCount > 10000)) // for example; including fail-safe condition is good + { + System.out.println ("... [loop termination condition met, simulationComplete=" + simulationComplete + "]"); // ", final loopCount=" + loopCount + + System.out.flush(); + break; + } + simulationTimeSeconds += getSimulationTimeStepDuration(); // good practice: increment simulationTime as lastst action in that loop + + } // end of simulation loop, continue until done + // ===================================================================================================// ===================================================================================================// ===================================================================================================// =================================================================================================== + + narrativeMessage2 = "runSimulation() completed successfully"; // all done, so tell everyone else on the channel + // TODO better javadoc needs to be autogenerated for VariableRecordType enumerations + + // TODO: The VariableDatamRecord length doesn't parse correctly on the DFDL side with this one as well. +// disChannel.sendCommentPdu(DisChannel.COMMENTPDU_NARRATIVE, narrativeMessage1, narrativeMessage2, narrativeMessage3); + System.out.println ("... [final=completion CommentPdu successfully sent for simulation]"); + + disChannel.leave(); // embedded SimulationManager is expected to send appropriate PDUs for entity, application shutdown + } + catch (InterruptedException iex) // handle any exception that your code might choose to provoke! + { + Logger.getLogger(PduGenerator.class.getSimpleName()).log(Level.SEVERE, null, iex); + } + } + + /** + * Send EntityState, Fire, Comment PDUs that got updated for this loop, reflecting state of current simulation timestep. + * @param simTimeSeconds simulation time in second, applied to PDU as timestamp + * @param entityStatePdu the ESPDU to send, if any + * @param firePdu the FirePDU to send, if any + * @param commentType enumeration value describing purpose of the narrative comment PDU + * @param comments String array of narrative comments + * @see DisChannel +// * @see DisTime // TODO find renamed version + * @see <a href="https://docs.oracle.com/javase/tutorial/java/javaOO/arguments.html">Passing Information to a Method or a Constructor</a> Arbitrary Number of Arguments + */ + public void sendAllPdusForLoopTimestep(double simTimeSeconds, + EntityStatePdu entityStatePdu, + FirePdu firePdu, + VariableRecordType commentType, + // vararg... variable-length set of String comments can optionally follow + String... comments) + { + if (entityStatePdu != null) + disChannel.sendSinglePdu(simTimeSeconds, entityStatePdu); + + if (firePdu != null) + disChannel.sendSinglePdu(simTimeSeconds, firePdu); // bang + + // TODO: The VariableDatamRecord length doesn't parse correctly on the DFDL side with this one as well. +// disChannel.sendCommentPdu(simTimeSeconds, commentType, comments); // empty comments are filtered + } + + /** + * Initial execution via main() method: handle args array of command-line initialization (CLI) arguments here + * @param args command-line parameters: network address and port + */ + protected void handleArguments (String[] args) + { + // initial execution: handle args array of initialization arguments here + if (args.length == 2) + { + if ((args[0] != null) && !args[0].isEmpty()) + thisProgram.disChannel.setNetworkAddress(args[0]); + if ((args[1] != null) && !args[1].isEmpty()) + thisProgram.disChannel.setNetworkPort(Integer.parseInt(args[1])); + } + else if (args.length < 1) + { + System.err.println("Usage: " + thisProgram.getClass().getSimpleName() + " [address port]"); + System.exit(-1); + } + } + + /** + * Get simple descriptor (such as parent class name) for this network interface, used in trace statements + * @return simple descriptor name + */ + public String getDescriptor() { + return descriptor; + } + + /** + * Set new simple descriptor (such as parent class name) for this network interface, used in trace statements + * @param newDescriptor simple descriptor name for this interface + */ + public void setDescriptor(String newDescriptor) { + if (newDescriptor == null) + newDescriptor = ""; + this.descriptor = newDescriptor; + } + + /** + * parameter accessor method + * @return the simulationTimeStepDuration in seconds + */ + public double getSimulationTimeStepDuration() { + return simulationTimeStepDuration; + } + + /** + * parameter accessor method + * @param timeStepDurationSeconds the simulationTimeStepDuration in seconds to set + */ + public void setSimulationTimeStepDuration(double timeStepDurationSeconds) { + this.simulationTimeStepDuration = timeStepDurationSeconds; + } + + /** Locally instantiable copy of program, can be subclassed. */ + protected static PduGenerator thisProgram; + + /** + * Main method is first executed when a program instance is loaded. + * @see <a href="https://docs.oracle.com/javase/tutorial/getStarted/application/index.html">Java Tutorials: A Closer Look at the "Hello World!" Application</a> + * @param args command-line parameters: [address port] or encoding. + * Command-line arguments are an array of optional String parameters that are passed from execution environment during invocation + */ + public static void main(String[] args) + { + if (args.length < 1) { + System.err.println("Must provide encoding. Check edu.nps.moves.dis7.utilities.stream.PduRecorder for types of encoding"); + System.exit(1); + } + else + DisChannelIEEE.setPDU_ENCODING(args[0]); + + thisProgram = new PduGenerator("test constructor"); // create instance of self within static main() method + + thisProgram.disChannel.printlnTRACE("main() started..."); + + thisProgram.handleArguments(args); // process any command-line invocation arguments + + thisProgram.runSimulationLoops(); // ... your simulation execution code goes in there ... + + thisProgram.disChannel.tearDownNetworkInterface(); // make sure no processes are left lingering + + thisProgram.disChannel.printlnTRACE("complete."); // report successful completion + + System.exit(0); // ensure all threads and sockets released + } +} diff --git a/DFDL/dataFormats/rst/src/main/java/edu/nps/moves/dis7/utilities/DisChannelIEEE.java b/DFDL/dataFormats/rst/src/main/java/edu/nps/moves/dis7/utilities/DisChannelIEEE.java new file mode 100644 index 0000000000000000000000000000000000000000..74d2d541df30a785c28845c73c492256fc354bb8 --- /dev/null +++ b/DFDL/dataFormats/rst/src/main/java/edu/nps/moves/dis7/utilities/DisChannelIEEE.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) 2008-2022, MOVES Institute, Naval Postgraduate School (NPS). All rights reserved. + * This work is provided under a BSD-style open-source license, see project + * <a href="https://savage.nps.edu/opendis7-java/license.html" target="_blank">license.html</a> and <a href="https://savage.nps.edu/opendis7-java/license.txt" target="_blank">license.txt</a> + */ +package edu.nps.moves.dis7.utilities; + +import edu.nps.moves.dis7.pdus.Pdu; +import edu.nps.moves.dis7.utilities.stream.PduRecorder; +import edu.nps.moves.dis7.utilities.stream.PduRecorderIEEE; + +/** + * DisChannel integrates multiple utility capabilities to handle most networking and entity-management tasks. + * Provides a simplified interface wrapping DisThreadedNetworkInterface, PduRecorderIEEE, and SimulationManager + * for programs connecting to OpenDis7 communications. + * + * Based on the original <a href="https://github.com/open-dis/opendis7-java" target="_blank">edu.nps.moves.dis7.utilities.DisChannel</a> + * Modified to invoke the PduRecorderIEEE which records PLAINTEXT PDUs without headers/footers/comments + * + * <br> + TODO future work will confirm that multiple different DisChannelIEEE connections can be used simultaneously by a parent program. + * @see <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/specifications/README.md">MV3500 Distributed Simulation Fundamentals, Specification Documents, IEEE and SISO</a> + * @see <a href="https://ieeexplore.ieee.org/document/6387564">1278.1-2012. IEEE Standard for Distributed Interactive Simulation (DIS) - Application Protocols</a> + * @author brutzman + * @author <a href="mailto:tdnorbra@nps.edu?subject=edu.nps.moves.dis7.utilities.DisChannelIEEE">Terry D. Norbraten</a> + */ +public class DisChannelIEEE extends DisChannel +{ + private static String PDU_ENCODING; + + /** Base constructor */ + public DisChannelIEEE() + { + super(); + } + + /** Constructor with new descriptor + * @param initialDescriptor descriptor for this instance + */ + public DisChannelIEEE(String initialDescriptor) + { + super(initialDescriptor); + } + + /** Constructor with new verboseness + * @param verbosenessDisNetworkInterface whether channel is initially verbose + * @param verbosenessPduRecorder whether PduRecorder is initially verbose + */ + public DisChannelIEEE(boolean verbosenessDisNetworkInterface, boolean verbosenessPduRecorder) + { + super(verbosenessDisNetworkInterface, verbosenessPduRecorder); + } + + /** Constructor with new descriptor, verboseness + * @param initialDescriptor descriptor for this instance + * @param verbosenessDisNetworkInterface whether channel is initially verbose + * @param verbosenessPduRecorder whether PduRecorder is initially verbose + */ + public DisChannelIEEE(String initialDescriptor, boolean verbosenessDisNetworkInterface, boolean verbosenessPduRecorder) + { + super(initialDescriptor, verbosenessDisNetworkInterface, verbosenessPduRecorder); + } + + @Override + public synchronized void setUpNetworkInterface() + { + if (disNetworkInterface != null) + { + printlnTRACE("*** Warning: setUpNetworkInterface() has already created disNetworkInterface, second invocation ignored"); + return; + } + disNetworkInterface = new DisThreadedNetworkInterface(getNetworkAddress(), getNetworkPort()); + getDisNetworkInterface().setDescriptor(descriptor); + getDisNetworkInterface().setVerbose(isVerboseDisNetworkInterface()); + if (isVerbosePduRecorder()) + printlnTRACE("Network confirmation:" + " address=" + getDisNetworkInterface().getAddress() + // disNetworkInterface.getMulticastGroup() + + " port=" + getDisNetworkInterface().getPort()); // + disNetworkInterface.getDisPort()); + pduListener = (Pdu newPdu) -> { + receivedPdu = newPdu; + }; /** Callback handler for listener */ + + getDisNetworkInterface().addListener(pduListener); + String pduLogOutputDirectory = DEFAULT_PDULOG_OUTPUT_DIRECTORY; + printlnTRACE("Beginning pdu save to directory " + pduLogOutputDirectory); + pduRecorder = new PduRecorderIEEE(pduLogOutputDirectory, getNetworkAddress(), getNetworkPort()); // assumes save + pduRecorder.setEncodingPduLog(getPDU_ENCODING()); + + // Here is where we need plain text PDU output in CSV with no headers/footers/comments, etc + if (getPDU_ENCODING().equals(PduRecorder.ENCODING_PLAINTEXT)) + pduRecorder.setIncludeHeaders(false); // was set true in above method call + + pduRecorder.setLogFileName(descriptor + "_" + getPDU_ENCODING() + "_" + PduRecorder.DEFAULT_FILE_NAME); + pduRecorder.setVerbose(isVerboseDisNetworkInterface()); // either sending, receiving or both + pduRecorder.start(); // begin running + } + + /** + * @return the PDU_ENCODING + */ + public static String getPDU_ENCODING() { + return PDU_ENCODING; + } + + /** + * @param PDU_ENCODING the PDU_ENCODING to set + */ + public static void setPDU_ENCODING(String PDU_ENCODING) { + DisChannelIEEE.PDU_ENCODING = PDU_ENCODING; + } + +} // end class DisChannelIEEE diff --git a/DFDL/dataFormats/rst/src/main/java/edu/nps/moves/dis7/utilities/stream/PduRecorderIEEE.java b/DFDL/dataFormats/rst/src/main/java/edu/nps/moves/dis7/utilities/stream/PduRecorderIEEE.java new file mode 100644 index 0000000000000000000000000000000000000000..3a6b394a63d9eec15f82e26361f35bff7cf79d8e --- /dev/null +++ b/DFDL/dataFormats/rst/src/main/java/edu/nps/moves/dis7/utilities/stream/PduRecorderIEEE.java @@ -0,0 +1,216 @@ +package edu.nps.moves.dis7.utilities.stream; + +import edu.nps.moves.dis7.enumerations.DisPduType; +import edu.nps.moves.dis7.pdus.Pdu; +import edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface; + +import java.io.IOException; +import java.io.PrintWriter; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.Charset; +import java.util.Arrays; + +/** Utility to save PDUs received over the network to disk, greatly simplifying the capture of DIS streams by applications. + * + * Example <code>main()</code> self-test response shown in log file, example results also included. + * @see <a href="https://github.com/open-dis/open-dis7-java/blob/master/src/edu/nps/moves/dis7/utilities/stream/PduRecorderSelfTestLog.txt">https://github.com/open-dis/open-dis7-java/blob/master/src/edu/nps/moves/dis7/utilities/stream/PduRecorderSelfTestLog.txt</a> + * @see <a href="https://github.com/open-dis/open-dis7-java/blob/master/src/edu/nps/moves/dis7/utilities/stream/PduRecorderSelfTestENCODING_BASE64_PduCaptureLog.dislog">https://github.com/open-dis/open-dis7-java/blob/master/src/edu/nps/moves/dis7/utilities/stream/PduRecorderSelfTestENCODING_BASE64_PduCaptureLog.dislog</a> + * @see <a href="https://github.com/open-dis/open-dis7-java/blob/master/src/edu/nps/moves/dis7/utilities/stream/PduRecorderSelfTestENCODING_BINARY_PduCaptureLog.dislog">https://github.com/open-dis/open-dis7-java/blob/master/src/edu/nps/moves/dis7/utilities/stream/PduRecorderSelfTestENCODING_BINARY_PduCaptureLog.dislog</a> + * @see <a href="https://github.com/open-dis/open-dis7-java/blob/master/src/edu/nps/moves/dis7/utilities/stream/PduRecorderSelfTestENCODING_PLAINTEXT_PduCaptureLog.dislog">https://github.com/open-dis/open-dis7-java/blob/master/src/edu/nps/moves/dis7/utilities/stream/PduRecorderSelfTestENCODING_PLAINTEXT_PduCaptureLog.dislog</a> + * + * Based on the original <a href="https://github.com/open-dis/opendis7-java" target="_blank">edu.nps.moves.dis7.utilities.stream.PduRecorder</a> + * Modified to record PLAINTEXT PDUs without headers/footers/comments + * + * @author Don Brutzman, brutzman@nps.edu + * @author Mike Bailey, jmbailey@nps.edu + * @author <a href="mailto:tdnorbra@nps.edu?subject=edu.nps.moves.dis7.utilities.stream.PduRecorderIEEE">Terry D. Norbraten</a> + */ +public class PduRecorderIEEE extends PduRecorder // implements PduReceiver +{ + /** + * Default constructor that uses default values for output directory, DIS address and port. + * Each instance must invoke start() to begin operations, pause() to suspend operations, + * resume() to continue operations, and stop() to terminate operations. + */ + public PduRecorderIEEE() + { + this(OUTPUT_DIRECTORY_DEFAULT); + } + + /** + * Constructor to let the use specify an output directory. + * Uses default values for multicast address and port. + * Each instance must invoke start() to begin operations, pause() to suspend operations, + * resume() to continue operations, and stop() to terminate operations. + * + * @param initialOutputDirectory the directory to write log files to + */ + public PduRecorderIEEE(String initialOutputDirectory) + { + this(initialOutputDirectory, DEFAULT_DIS_ADDRESS, DEFAULT_DIS_PORT); + } + + /** Constructor to let the user specify all required parameters. + * Each instance must invoke start() to begin operations, pause() to suspend operations, + * resume() to continue operations, and stop() to terminate operations.. + * + * @param initialOutputDirectory local path for directory where the log files are written + * @param initialAddress multicast group address to receive data from (TODO allow unicast UDP) + * @param initialPort UDP port to listen for data + */ + public PduRecorderIEEE(String initialOutputDirectory, String initialAddress, int initialPort) + { + super(initialOutputDirectory, initialAddress, initialPort); + setIncludeHeaders(false); + setReadableTimeStamp(false); + setDescriptor(getClass().getSimpleName()); + } + + /** receivePdu from DIS data stream, invoked via callback from DisThreadedNetworkInterface.RawPduListener + * @param newBuffer byte array for receiving data + * @param newLength length of byte array + */ + @Override + public void receivePdu(byte[] newBuffer, int newLength) + { + if(!isRunning()) + return; // thread operations no longer in progress, ignore this received PDU + + byte[] byteBufferSized = Arrays.copyOf(newBuffer, newLength); + + switch (encodingPduLog) + { + case ENCODING_BINARY: + // diagnostics can go here, TODO is any processing needed? + break; + + case ENCODING_BASE64: + sb.append(base64Encoder.encodeToString(byteBufferSized)); + break; + + case ENCODING_PLAINTEXT: + + // No timestamp in the beginning, just pure PDU contents + // PDU contents, remove square brackets to end up with pure CSV + sb.append(Arrays.toString(byteBufferSized).replace(" ", "").replace("[","").replace("]","")); + break; + + default: + if (ENCODING_OPTIONS_LIST.contains(encodingPduLog)) + System.err.println ("Encoding " + encodingPduLog + " not supported"); + else + System.err.println ("Encoding " + encodingPduLog + " not recognized"); + break; + } + try + { + if (encodingPduLog.equals(ENCODING_BINARY)) + { + // https://stackoverflow.com/questions/4931854/converting-char-array-into-byte-array-and-back-again + Charset charset = Charset.forName("ISO-8859-1"); // Must be this to get the proper encoding to DFDL +// Charset charset = Charset.forName("UTF_8"); +// Charset charset = Charset.forName("US-ASCII"); + CharBuffer charBufferSized = charset.decode(ByteBuffer.wrap(byteBufferSized)); + logFileWriter.write(charBufferSized.array()); + } + else + { + logFileWriter.write(sb.toString()); + ((PrintWriter)logFileWriter).println(); + } + } + catch (IOException ex) + { + throw new RuntimeException("Fatal exception writing DIS log file in " + getDescriptor() + " thread, encodingPduLog=" + encodingPduLog + ": " + ex); + } + pduCount = pduCount + 1; +// if (false) // debug +// System.out.println(TRACE_PREFIX + " + getDescriptor() + ": pduCount="+ pduCount); + + sb.setLength(0); + } + + /** + * Entry point invocation to facilitate developmental testing, runs selfTest() method. + * + * @param args none supported, TODO offer path/filename + */ + public static void main(String[] args) + { + PduRecorder pduRecorder = new PduRecorderIEEE(); // instantiates an instance object of this class, + pduRecorder.selfTest(args); // and tests it. Results shown in .dislog files. + } + + /** This selfTest() method saves PDU output logs to assigned directory using all supported encodings. + * Further checking can be accomplished by separately Invoking the edu.nps.moves.dis7.examples.PduReaderPlayer + * which will playback all logs written to that log directory. + * + * @param args none supported, TODO offer path/filename + */ + @Override + public synchronized void selfTest(String[] args) + { + System.out.println(getDescriptor() + " main() performs self-test by sending full set of PDUs"); + + PduRecorder pduRecorder; + DisThreadedNetworkInterface disNetworkInterface; + DisPduType allPDUTypesArray[] = DisPduType.values(); + System.out.println(getDescriptor() + " allPDUTypesArray created, length=" + allPDUTypesArray.length + " ..."); + System.out.flush(); // ensure all output sent + + for (String currentEncoding : ENCODING_OPTIONS_LIST) + { + pduRecorder = new PduRecorderIEEE(); // default address, port, output directory path + + System.out.println("================================================="); + System.out.println("Test " + getDescriptor() + " encoding " + currentEncoding); + pduRecorder.setEncodingPduLog(currentEncoding); + + // Here is where we need plain text PDU output in CSV with no headers/footers/comments, etc + if (pduRecorder.getEncodingPduLog().equals(ENCODING_PLAINTEXT)) + pduRecorder.setIncludeHeaders(false); // was set true in above method call + + pduRecorder.setDescriptor(getDescriptor() + ".selfTest " + currentEncoding); +// pduRecorder.setPort(1); // option to avoid listening to other PDU streams during self test + pduRecorder.setLogFileName(getDescriptor() + ".selfTest" + "_" + currentEncoding + "_" + DEFAULT_FILE_NAME); + pduRecorder.start(); + disNetworkInterface = pduRecorder.getDisThreadedNetworkInterface(); // must reinitialize after each begin + System.out.println(pduRecorder.getDescriptor() + " pduRecorder started... isRunning()=" + pduRecorder.isRunning()); + + for (int index=0; index < allPDUTypesArray.length; index++) + { + DisPduType pduTypeValue = allPDUTypesArray[index]; + if (pduTypeValue != DisPduType.OTHER) + { + try { + // These are empty PDUs, no boilerplate data marshalled + Pdu nextPdu = pduFactory.createPdu(allPDUTypesArray[index]); + nextPdu.setTimestamp(index * 10); // seconds + nextPdu.setLength(nextPdu.getMarshalledSize()); +// nextPdu.getTimestamp(); // debug + disNetworkInterface.send(nextPdu); + + // https://stackoverflow.com/questions/10663920/calling-thread-sleep-from-synchronized-context-in-java + // https://stackoverflow.com/questions/1036754/difference-between-wait-vs-sleep-in-java + wait (100L); // let send/receive threads and streams catch up // TODO consider wait() instead of sleep() + } + catch (InterruptedException ex) { + System.err.println("Exception sending Pdu " + pduTypeValue + ": " + ex.getLocalizedMessage()); + } + } + else + { + System.err.println("Found pduTypeValue=DisPduType.OTHER=" + pduTypeValue); + } + } + System.out.flush(); + System.err.flush(); // ensure all output sent + pduRecorder.stop(); + System.out.println(pduRecorder.getDescriptor() + " pduRecorder complete... isRunning()=" + pduRecorder.isRunning()); + } + // end of loop ENCODING_OPTIONS_LIST + System.out.println("================================================="); + } + +} // end class PduRecorderIEEE diff --git a/DFDL/dataFormats/rst/src/main/resources/edu/nps/moves/xsd/rst/dis/DIS_7_2012.RichSemanticTrackSubset-binary.dfdl_xsd b/DFDL/dataFormats/rst/src/main/resources/edu/nps/moves/xsd/rst/dis/DIS_7_2012.RichSemanticTrackSubset-binary.dfdl_xsd new file mode 100644 index 0000000000000000000000000000000000000000..eaa62e950e922e23a5165afc1b206fe5c1bcccb7 --- /dev/null +++ b/DFDL/dataFormats/rst/src/main/resources/edu/nps/moves/xsd/rst/dis/DIS_7_2012.RichSemanticTrackSubset-binary.dfdl_xsd @@ -0,0 +1,783 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- +Copyright (c) 1995-2023 held by the author(s). All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the names of the Naval Postgraduate School (NPS) + Modeling Virtual Environments and Simulation (MOVES) Institute + (https://www.nps.edu and https://my.nps.edu/web/moves) + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +--> + +<!-- Based on the original RST DIS subset schema at: https://github.com/open-dis/opendis7-source-generator/blob/master/xml/DIS_7_2012.RichSemanticTrackSubset.xsd --> + +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" + xmlns:dfdlx="http://www.ogf.org/dfdl/dfdl-1.0/extensions" + xmlns:fn="http://www.w3.org/2005/xpath-functions" + xmlns:b="urn:basicBinary" + xmlns:daf="urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:ext" + xmlns:dafint="urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:int" + xmlns:rstdis="urn:rstdis:1.0" + xmlns:tns="urn:rstdis:1.0" + targetNamespace="urn:rstdis:1.0" + elementFormDefault="unqualified" + version="1.0"> + + <xs:import namespace="urn:basicBinary" schemaLocation="basicByteBinary.dfdl.xsd"/> + + <xs:annotation> + <xs:appinfo source="http://www.ogf.org/dfdl/"> + <dfdl:format ref="b:basicByteBinary"/> + </xs:appinfo> + </xs:annotation> + + <!-- + Since this is a DFDL schema for a concrete file format, we have a root global element. + All other elements are declared as local element declarations and so will have + unqualified names + --> + + <xs:element name="RSTDIS" type="rstdis:RSTDIS"/> + + <xs:complexType name="RSTDIS"> + <xs:sequence> + <xs:element name="DISPDUS"> + <xs:annotation> + <xs:appinfo>Root element for DIS PDU log</xs:appinfo> + <xs:documentation>https://savage.nps.edu/opendis7-java/xml/SchemaDocumentation</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:choice> + <xs:element ref="rstdis:CreateEntityPDU" maxOccurs="unbounded"/> + <xs:element ref="rstdis:CommentPDU" maxOccurs="unbounded"/> + <xs:element ref="rstdis:EntityStatePDU" maxOccurs="unbounded"/> + </xs:choice> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:element name="CreateEntityPDU"> + <xs:annotation> + <xs:appinfo> + 7.5.2 The creation of a new entity shall be communicated using a + Create Entity PDU. See 5.6.5.2 for specific + requirements on the use of the Create Entity PDU. + </xs:appinfo> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:element name="PDUHeader" type="rstdis:PduHeader" minOccurs="1"> + <xs:annotation> + <xs:appinfo source="http://www.ogf.org/dfdl/"> +<!-- <dfdl:assert message="{ + fn:concat('PDUType unknown: ', ./PDUType) + }" + test="{./PDUType eq 11}"/>--> + <dfdl:discriminator test="{./PDUType eq 11}"/> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="OriginatingID" type="rstdis:SimulationIdentifierType"> + <xs:annotation> + <xs:appinfo>IDs the simulation or entity, either a simulation or an entity. Either 6.2.80 or 6.2.28</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ReceivingID" type="rstdis:SimulationIdentifierType"> + <xs:annotation> + <xs:appinfo>simulation, all simulations, a special ID, or an entity. See 5.6.5 and 5.12.4</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="RequestID" type="b:uint32"/> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="CommentPDU"> + <xs:annotation> + <xs:appinfo>7.5.13 Used to enter arbitrary messages (character strings, for example). See 5.6.5.13 + (length of list found in field numberOfVariableDatumRecords) + </xs:appinfo> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:annotation> + <xs:appinfo>First part of a simulation management (SIMAN) PDU and SIMAN-Reliability (SIMAN-R) + PDU. Sectionn 6.2.81 + </xs:appinfo> + </xs:annotation> + <xs:element name="PDUHeader" type="rstdis:PduHeader" minOccurs="1"> + <xs:annotation> + <xs:appinfo source="http://www.ogf.org/dfdl/"> +<!-- <dfdl:assert message="{ + fn:concat('PDUType unknown: ', ./PDUType) + }" + test="{./PDUType eq 22}"/>--> + <dfdl:discriminator test="{./PDUType eq 22}"/> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="OriginatingID" type="rstdis:SimulationIdentifierType"> + <xs:annotation> + <xs:appinfo>IDs the simulation or entity, either a simulation or an entity. Either 6.2.80 or 6.2.28</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ReceivingID" type="rstdis:SimulationIdentifierType"> + <xs:annotation> + <xs:appinfo>simulation, all simulations, a special ID, or an entity. See 5.6.5 and 5.12.4</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="NumberOfFixedDatumRecords" type="b:uint32"> + <xs:annotation> + <xs:appinfo> + Number of fixed datum records, + not used in this Pdu + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="NumberOfVariableDatumRecords" type="b:uint32"> + <xs:annotation> + <xs:appinfo> + Number of variable datum + records, handled automatically by marshaller at run + time (and not modifiable by end-user programmers) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:sequence> + <xs:annotation> + <xs:appinfo>Number of elements is determined by size NumberOfVariableDatumRecords and can be 0 or greater. + Ensure that the total PDU size does not exceed maximums allowed in IEEE DIS Specification. + </xs:appinfo> + <xs:documentation>numberOfVariableDatumRecords</xs:documentation> + </xs:annotation> + <xs:element name="VariableDatum" type="rstdis:VariableDatumType"> + <xs:annotation> + <xs:appinfo>variable length list of variable length datums (length of list found in field NumberOfVariableDatumRecords)</xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="EntityStatePDU"> + <xs:annotation> + <xs:appinfo>7.2.2. Represents the position and state of one entity in the world. See 5.3.2. (length + of list found in field numberOfVariableParameters) + </xs:appinfo> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:element name="PDUHeader" type="rstdis:PduHeader"> + <xs:annotation> + <xs:appinfo source="http://www.ogf.org/dfdl/"> +<!-- <dfdl:assert message="{ + fn:concat('PDUType unknown: ', ./PDUType) + }" + test="{./PDUType eq 1}"/>--> + <dfdl:discriminator test="{./PDUType eq 1}"/> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityID" type="rstdis:EntityIDType"> + <xs:annotation> + <xs:appinfo>Unique ID for an entity that is tied to this state information</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ForceId" type="b:enum8"> + <xs:annotation> + <xs:appinfo> + What force this entity is affiliated with, eg red, blue, neutral, etc (SISO enumeration + ForceID uid 6) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="NumberOfVariableParameterRecords" type="b:ubyte"> + <xs:annotation> + <xs:appinfo> + How many variable parameters are in the variable length list. In earlier versions + of DIS these were known as articulation parameters + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityType" type="rstdis:EntityTypeType"> + <xs:annotation> + <xs:appinfo>Describes the type of entity in the world</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="AlternativeEntityType" type="rstdis:EntityTypeType"/> + <xs:element name="EntityLinearVelocity" type="rstdis:Vector3FloatType"> + <xs:annotation> + <xs:appinfo>Describes the speed of the entity in the world</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityLocation" type="rstdis:Vector3DoubleType"> + <xs:annotation> + <xs:appinfo>Describes the location of the entity in the world</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityOrientation" type="rstdis:EulerAnglesType"> + <xs:annotation> + <xs:appinfo>Describes the orientation of the entity, in euler angles with units of radians</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityAppearance" type="b:int32"> + <xs:annotation> + <xs:appinfo> + A series of bit flags that are used to help draw the entity, such as smoking, on fire, + etc. + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="DeadReckoningParameters" type="rstdis:DeadReckoningParametersType"> + <xs:annotation> + <xs:appinfo>Parameters used for dead reckoning</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityMarking" type="rstdis:EntityMarkingType"> + <xs:annotation> + <xs:appinfo>11 characters that can be used for entity identification, debugging, or to draw unique + strings on the side of entities in the world + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Capabilities" type="b:int32"> + <xs:annotation> + <xs:appinfo> + A series of bit flags (SISO bitfield enumeration, size 32 bits, EntityCapabilities + uid 55) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="VariableParameterRecord" type="rstdis:VariableParameterType" + dfdl:occursCount="{ ../NumberOfVariableParameterRecords }" + dfdl:occursCountKind="expression" minOccurs="0"> + <xs:annotation> + <xs:appinfo>Variable length list of variable parameters. + In earlier DIS versions this was articulation + parameters. + (length of list found in field NumberOfVariableParameters) + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:complexType name="PduHeader"> + <xs:annotation> + <xs:appinfo>Base class of PduBase and LiveEntityPdu</xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="ProtocolVersion" type="b:enum8"> + <xs:annotation> + <xs:appinfo> + The version of the protocol. + 5=DIS-1995, 6=DIS-1998, 7=DIS-2012 (SISO enumeration + DISProtocolVersion uid 3) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ExerciseID" type="b:ubyte"> + <xs:annotation> + <xs:appinfo> + Exercise ID provides a unique identifier + </xs:appinfo> + </xs:annotation> + </xs:element> + <!-- expression borrowed from bug report attached schema: https://issues.apache.org/jira/browse/DAFFODIL-2078 --> + <xs:element name="PDUType" type="b:enum8"> + <xs:annotation> + <xs:appinfo> + Type of pdu, unique for each + PDU class (SISO enumeration DisPduType uid 4) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ProtocolFamily" type="b:enum8"> + <xs:annotation> + <xs:appinfo> + DISProtocolFamily.SIMULATION_MANAGEMENT + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Timestamp" type="b:uint32"> + <xs:annotation> + <xs:appinfo> + Timestamp value + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Length" type="b:uint16"> + <xs:annotation> + <xs:appinfo> + Length, in bytes, of the PDU + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:sequence> + <xs:annotation> + <xs:appinfo>PduStatus provides a set of bit-masked indicator values, section 6.2.67. Bit fields + include Transferred Entity Indicator (TEI), LVC Indicator (LVC), Coupled Extension + Indicator (CEI), Fire Type Indicator (FTI), Detonation Type Indicator (DTI), Radio + Attached Indicator (RAI), Intercom Attached Indicator (IAI), IFF Simulation Mode (ISM) + and Active Interrogation Indicator (AII). + </xs:appinfo> + </xs:annotation> + <xs:element name="PDUStatus" type="b:enum8"> + <xs:annotation> + <xs:appinfo> + PDU Status Record. Described + in 6.2.67. This field is not present in earlier DIS + versions + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Padding" type="b:enum8" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + 8 bit unused + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="DeadReckoningParametersType"> + <xs:annotation> + <xs:appinfo>Not specified in the standard. This is used by the ESPDU</xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="DeadReckoningAlgorithm" type="b:enum8"> + <xs:annotation> + <xs:appinfo> + Algorithm to use in computing dead reckoning. + See EBV doc. (SISO enumeration DeadReckoningAlgorithm + uid 44) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="OtherParameters" type="b:enum120"> + <xs:annotation> + <xs:appinfo>Dead reckoning parameters. + Contents depends on algorithm. + Spec says 120 bits. + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityLinearAcceleration" type="rstdis:Vector3FloatType"> + <xs:annotation> + <xs:appinfo>Linear acceleration of the entity</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityAngularVelocity" type="rstdis:Vector3FloatType"> + <xs:annotation> + <xs:appinfo>Angular velocity of the entity</xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="EntityIDType"> + <xs:annotation> + <xs:appinfo>Unique identifier triplet for this entity. Also referred to as EntityIdentifier</xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="SiteID" type="b:uint16"> + <xs:annotation> + <xs:appinfo> + Site ID values are unique identification number for originating site, often corresponding + to an internet address. Site ID values are agreed upon by individual simulations. + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ApplicationID" type="b:uint16"> + <xs:annotation> + <xs:appinfo> + Application ID values are unique identification number for originating application + at a given site. Application ID values are sssigned by individual sites. + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityID" type="b:uint16"> + <xs:annotation> + <xs:appinfo> + Entity ID values are unique identification number for s givent entity in the originating + application at a given site. Entity ID values are sssigned by individual simulation + programs. + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="EntityMarkingType"> + <xs:annotation> + <xs:appinfo>Specifies the character set used in the first byte, followed by 11 characters of text + data. Section 6.29 + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="CharacterSet" type="b:enum8"> + <xs:annotation> + <xs:appinfo> + The character set (SISO enumeration EntityMarkingCharacterSet uid 45) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Characters" type="xs:string" + dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" + dfdl:alignment="8" dfdl:length="11"> + <xs:annotation> + <xs:appinfo>11 Characters</xs:appinfo> + </xs:annotation> + </xs:element> +<!-- <xs:element name="FirstCharacter" type="b:ubyte" + <xs:annotation> + <xs:appinfo>1st Character</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="SecondCharacter" type="b:ubyte"> + <xs:annotation> + <xs:appinfo>2nd Character</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ThirdCharacter" type="b:ubyte"> + <xs:annotation> + <xs:appinfo>3rd Character</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="FourthCharacter" type="b:ubyte"> + <xs:annotation> + <xs:appinfo>4th Character</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="FifthCharacter" type="b:ubyte"> + <xs:annotation> + <xs:appinfo>5th Character</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="SixthCharacter" type="b:ubyte"> + <xs:annotation> + <xs:appinfo>6th Character</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="SeventhCharacter" type="b:ubyte"> + <xs:annotation> + <xs:appinfo>7th Character</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EighthCharacter" type="b:ubyte"> + <xs:annotation> + <xs:appinfo>8th Character</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="NinthCharacter" type="b:ubyte"> + <xs:annotation> + <xs:appinfo>9th Character</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="TenthCharacter" type="b:ubyte"> + <xs:annotation> + <xs:appinfo>10th Character</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EleventhCharacter" type="b:ubyte"> + <xs:annotation> + <xs:appinfo>11th Character</xs:appinfo> + </xs:annotation> + </xs:element>--> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="EntityTypeType"> + <xs:annotation> + <xs:appinfo>Identifies the type of Entity</xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="EntityKind" type="b:enum8"> + <xs:annotation> + <xs:appinfo> + Kind of entity (SISO enumeration EntityKind uid 7) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Domain" type="b:enum8"> + <xs:annotation> + <xs:appinfo> + Domain of entity (air, surface, subsurface, space, etc.) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Country" type="xs:short"> + <xs:annotation> + <xs:appinfo> + Country to which the design of the entity is attributed (SISO enumeration Country + uid 29) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Category" type="b:enum8"> + <xs:annotation> + <xs:appinfo> + Category of entity + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="SubCategory" type="b:enum8"> + <xs:annotation> + <xs:appinfo> + Subcategory based on category + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Specific" type="b:enum8"> + <xs:annotation> + <xs:appinfo> + Specific info based on subcategory + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Extra" type="b:enum8"> + <xs:annotation> + <xs:appinfo> + Specific info based on subcategory + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="EulerAnglesType"> + <xs:annotation> + <xs:appinfo>Three floating point values representing an orientation, psi, theta, and phi, aka + the euler angles, in radians. Section 6.2.33 + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="Psi" type="xs:float" dfdl:lengthKind="implicit"> + <xs:annotation> + <xs:appinfo> + Specific info based on subcategory + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Theta" type="xs:float" dfdl:lengthKind="implicit"> + <xs:annotation> + <xs:appinfo> + Specific info based on subcategory + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Phi" type="xs:float" dfdl:lengthKind="implicit"> + <xs:annotation> + <xs:appinfo> + Specific info based on subcategory + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="SimulationIdentifierType"> + <xs:annotation> + <xs:appinfo>The unique designation of a simulation when using the 48-bit identifier format shall + be specified by the Sim- ulation Identifier record. The reason that the 48-bit format + is required in addition to the 32-bit simulation address format that actually identifies + a specific simulation is because some 48-bit identifier fields in PDUs may contain + either an Object Identifier, such as an Entity ID, or a Simulation Identifier. Section + 6.2.80 + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:annotation> + <xs:appinfo>A Simulation Address record shall consist of the Site Identification number and the + Application Identification number. Section 6.2.79 + </xs:appinfo> + </xs:annotation> + <xs:element name="SiteNumber" type="b:uint16"> + <xs:annotation> + <xs:appinfo> + Simulation address + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ApplicationNumber" type="b:uint16"> + <xs:annotation> + <xs:appinfo> + Simulation address + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ReferenceNumber" type="b:uint16"> + <xs:annotation> + <xs:appinfo> + This field shall be set to + zero as there is no reference number associated with + a Simulation Identifier. + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="VariableDatumType"> + <xs:annotation> + <xs:appinfo>The variable datum type, the datum length, and the value for that variable datum type. + Section 6.2.93 + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="VariableDatumID" type="b:int32"> + <xs:annotation> + <xs:appinfo> + Type of variable datum to be + transmitted. 32-bit enumeration defined in EBV (SISO + enumeration VariableRecordType uid 66 Variable Record + Type values are defined by VariableRecordType + enumerations) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="VariableDatumLength" type="b:uint32"> + <xs:annotation> + <xs:appinfo> + Length, IN BITS, of the variable datum. + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="VariableDatumValue" type="xs:string" + dfdl:alignment="8" + dfdl:length="{ ../VariableDatumLength }" + dfdl:lengthKind="explicit"> + <xs:annotation> + <xs:appinfo> + This can any # bits long + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Padding" type="xs:unsignedLong" + dfdl:lengthKind="explicit" + dfdl:length="{ xs:unsignedLong(fn:ceiling(../VariableDatumLength div 64) * 64 - ../VariableDatumLength) }"> + <xs:annotation> + <xs:appinfo>zero-filled array of + padding bits for byte alignment and consistent + sizing of PDU data to the 64 bit boundary + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="VariableParameterType"> + <xs:annotation> + <xs:appinfo>Used in DetonationPdu, ArticulatedPartsPdu among others</xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="RecordType" type="b:enum8"> + <xs:annotation> + <xs:appinfo> + The identification of the + Variable Parameter record. Enumeration from EBV + (SISO enumeration VariableParameterRecordType uid 56) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="RecordSpecificFields" type="b:enum120"> + <xs:annotation> + <xs:appinfo>Spec says 120 bits</xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="Vector3DoubleType"> + <xs:annotation> + <xs:appinfo>Three double precision floating point values, X, Y, and Z. + Used for world coordinates + Section 6.2.97. + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="X-component" type="xs:double" dfdl:lengthKind="implicit"> + <xs:annotation> + <xs:appinfo> + X value + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Y-component" type="xs:double" dfdl:lengthKind="implicit"> + <xs:annotation> + <xs:appinfo> + Y Value + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Z-component" type="xs:double" dfdl:lengthKind="implicit"> + <xs:annotation> + <xs:appinfo> + Z value + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="Vector3FloatType"> + <xs:annotation> + <xs:appinfo>Three floating point values, x, y, and z. Section 6.2.95</xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="x-component" type="xs:float" dfdl:lengthKind="implicit"> + <xs:annotation> + <xs:appinfo> + X value + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="y-component" type="xs:float" dfdl:lengthKind="implicit"> + <xs:annotation> + <xs:appinfo> + Y Value + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="z-component" type="xs:float" dfdl:lengthKind="implicit"> + <xs:annotation> + <xs:appinfo> + Z value + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + +</xs:schema> diff --git a/DFDL/dataFormats/rst/src/main/resources/edu/nps/moves/xsd/rst/dis/DIS_7_2012.RichSemanticTrackSubset-string.dfdl_xsd b/DFDL/dataFormats/rst/src/main/resources/edu/nps/moves/xsd/rst/dis/DIS_7_2012.RichSemanticTrackSubset-string.dfdl_xsd new file mode 100644 index 0000000000000000000000000000000000000000..50b3e3a86f1a058cf2c3afa3d6a2976a7b859cbb --- /dev/null +++ b/DFDL/dataFormats/rst/src/main/resources/edu/nps/moves/xsd/rst/dis/DIS_7_2012.RichSemanticTrackSubset-string.dfdl_xsd @@ -0,0 +1,732 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- +Copyright (c) 1995-2023 held by the author(s). All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the names of the Naval Postgraduate School (NPS) + Modeling Virtual Environments and Simulation (MOVES) Institute + (https://www.nps.edu and https://my.nps.edu/web/moves) + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +--> + +<!-- Based on the original RST DIS subset schema at: https://github.com/open-dis/opendis7-source-generator/blob/master/xml/DIS_7_2012.RichSemanticTrackSubset.xsd --> + +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" + xmlns:fn="http://www.w3.org/2005/xpath-functions" + xmlns:dfdlx="http://www.ogf.org/dfdl/dfdl-1.0/extensions" + xmlns:daf="urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:ext" + xmlns:dafint="urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:int" + xmlns:rstdis="urn:rstdis:1.0" + xmlns:tns="urn:rstdis:1.0" + targetNamespace="urn:rstdis:1.0" + elementFormDefault="unqualified" + version="1.0"> + + <xs:include schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/> + + <xs:annotation> + <xs:appinfo source="http://www.ogf.org/dfdl/"> + <dfdl:format ref="rstdis:GeneralFormat" + lengthKind="delimited" + separator=","/> + </xs:appinfo> + </xs:annotation> + + <!-- + Since this is a DFDL schema for a concrete file format, we have a root global element. + All other elements are declared as local element declarations and so will have + unqualified names + --> + + <xs:element name="RSTDIS" type="rstdis:RSTDIS"/> + + <xs:complexType name="RSTDIS"> + <xs:sequence dfdl:terminator="%NL;"> + <xs:element name="DISPDUS"> + <xs:annotation> + <xs:appinfo>Root element for DIS PDU log, optionally contains head meta information</xs:appinfo> + <xs:documentation>https://savage.nps.edu/opendis7-java/xml/SchemaDocumentation</xs:documentation> + </xs:annotation> + <xs:complexType> + <xs:choice> + <xs:element ref="rstdis:CommentPDU" maxOccurs="unbounded"/> + <xs:element ref="rstdis:EntityStatePDU" maxOccurs="unbounded"/> + </xs:choice> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:element name="CommentPDU"> + <xs:annotation> + <xs:appinfo>7.5.13 Used to enter arbitrary messages (character strings, for example). See 5.6.5.13 + (length of list found in field numberOfVariableDatumRecords) + </xs:appinfo> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:annotation> + <xs:appinfo>First part of a simulation management (SIMAN) PDU and SIMAN-Reliability (SIMAN-R) + PDU. Sectionn 6.2.81 + </xs:appinfo> + </xs:annotation> + <xs:element name="PDUHeader" type="rstdis:PduHeader" minOccurs="1"> + <xs:annotation> + <xs:appinfo source="http://www.ogf.org/dfdl/"> + <dfdl:assert message="{ + fn:concat('PDUType unknown: ', ./PDUType) + }" + test="{./PDUType eq '22'}"/> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="OriginatingID" type="rstdis:SimulationIdentifierType"> + <xs:annotation> + <xs:appinfo>IDs the simulation or entity, either a simulation or an entity. Either 6.2.80 or 6.2.28</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ReceivingID" type="rstdis:SimulationIdentifierType"> + <xs:annotation> + <xs:appinfo>simulation, all simulations, a special ID, or an entity. See 5.6.5 and 5.12.4</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="NumberOfFixedDatumRecords" type="xs:string" + dfdl:lengthKind="explicit" dfdl:lengthUnits="characters" + dfdl:length="1" > + <xs:annotation> + <xs:appinfo> + Number of fixed datum records, + not used in this Pdu + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="NumberOfVariableDatumRecords" type="xs:string" + dfdl:lengthKind="explicit" dfdl:lengthUnits="characters" + dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + Number of variable datum + records, handled automatically by marshaller at run + time (and not modifiable by end-user programmers) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:sequence> + <xs:annotation> + <xs:appinfo>Number of elements is determined by size NumberOfVariableDatumRecords and can be 0 or greater. + Ensure that the total PDU size does not exceed maximums allowed in IEEE DIS Specification. + </xs:appinfo> + <xs:documentation>numberOfVariableDatumRecords</xs:documentation> + </xs:annotation> + <xs:element name="VariableDatum" type="rstdis:VariableDatumType"> + <xs:annotation> + <xs:appinfo>variable length list of variable length datums (length of list found in field NumberOfVariableDatumRecords)</xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="EntityStatePDU"> + <xs:annotation> + <xs:appinfo>7.2.2. Represents the position and state of one entity in the world. See 5.3.2. (length + of list found in field numberOfVariableParameters) + </xs:appinfo> + </xs:annotation> + <xs:complexType> + <xs:sequence> + <xs:element name="PDUHeader" type="rstdis:PduHeader"> + <xs:annotation> + <xs:appinfo source="http://www.ogf.org/dfdl/"> + <dfdl:assert message="{ + fn:concat('PDUType unknown: ', ./PDUType) + }" + test="{./PDUType eq '1'}"/> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityID" type="rstdis:EntityIDType"> + <xs:annotation> + <xs:appinfo>Unique ID for an entity that is tied to this state information</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ForceId" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + What force this entity is affiliated with, eg red, blue, neutral, etc (SISO enumeration + ForceID uid 6) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="NumberOfVariableParameterRecords" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + How many variable parameters are in the variable length list. In earlier versions + of DIS these were known as articulation parameters + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityType" type="rstdis:EntityTypeType"> + <xs:annotation> + <xs:appinfo>Describes the type of entity in the world</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="AlternativeEntityType" type="rstdis:EntityTypeType"/> + <xs:element name="EntityLinearVelocity" type="rstdis:Vector3FloatType"> + <xs:annotation> + <xs:appinfo>Describes the speed of the entity in the world</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityLocation" type="rstdis:Vector3DoubleType"> + <xs:annotation> + <xs:appinfo>Describes the location of the entity in the world</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityOrientation" type="rstdis:EulerAnglesType"> + <xs:annotation> + <xs:appinfo>Describes the orientation of the entity, in euler angles with units of radians</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityAppearance" type="xs:byte" dfdl:lengthKind="explicit" + dfdl:lengthUnits="bits" dfdl:length="32"> + <xs:annotation> + <xs:appinfo> + A series of bit flags that are used to help draw the entity, such as smoking, on fire, + etc. + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="DeadReckoningParameters" type="rstdis:DeadReckoningParametersType"> + <xs:annotation> + <xs:appinfo>Parameters used for dead reckoning</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityMarking" type="rstdis:EntityMarkingType"> + <xs:annotation> + <xs:appinfo>11 characters that can be used for entity identification, debugging, or to draw unique + strings on the side of entities in the world + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Capabilities" type="xs:byte" dfdl:lengthKind="explicit" + dfdl:lengthUnits="bits" dfdl:length="32"> + <xs:annotation> + <xs:appinfo> + A series of bit flags (SISO bitfield enumeration, size 32 bits, EntityCapabilities + uid 55) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="VariableParameterRecord" type="rstdis:VariableParameterType"> + <xs:annotation> + <xs:appinfo>Variable length list of variable parameters. In earlier DIS versions this was articulation + parameters. (length of list found in field NumberOfVariableParameters) + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:complexType name="PduHeader"> + <xs:annotation> + <xs:appinfo>Base class of PduBase and LiveEntityPdu</xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="ProtocolVersion" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + The version of the protocol. + 5=DIS-1995, 6=DIS-1998, 7=DIS-2012 (SISO enumeration + DISProtocolVersion uid 3) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ExerciseID" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + Exercise ID provides a unique + identifier + </xs:appinfo> + </xs:annotation> + </xs:element> + <!-- expression borrowed from bug report attached schema: https://issues.apache.org/jira/browse/DAFFODIL-2078 --> + <xs:element name="PDUType" type="xs:string" + dfdl:occursCount="{ if(dfdl:contentLength(/., 'bytes') eq 1) then 1 + else 2 + }"> + <xs:annotation> + <xs:appinfo> + Type of pdu, unique for each + PDU class (SISO enumeration DisPduType uid 4) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ProtocolFamily" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + DISProtocolFamily.SIMULATION_MANAGEMENT + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Timestamp" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="9"> + <xs:annotation> + <xs:appinfo> + Timestamp value + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Length" type="xs:string" + dfdl:occursCount="{ if(dfdl:contentLength(/., 'bytes') eq 1) then 1 + else if(dfdl:contentLength(/., 'bytes') eq 2) then 2 + else if(dfdl:contentLength(/., 'bytes') eq 3) then 3 + else 4 + }"> + <xs:annotation> + <xs:appinfo> + Length, in bytes, of the PDU + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:sequence> + <xs:annotation> + <xs:appinfo>PduStatus provides a set of bit-masked indicator values, section 6.2.67. Bit fields + include Transferred Entity Indicator (TEI), LVC Indicator (LVC), Coupled Extension + Indicator (CEI), Fire Type Indicator (FTI), Detonation Type Indicator (DTI), Radio + Attached Indicator (RAI), Intercom Attached Indicator (IAI), IFF Simulation Mode (ISM) + and Active Interrogation Indicator (AII). + </xs:appinfo> + </xs:annotation> + <xs:element name="PDUStatus" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="2"> + <xs:annotation> + <xs:appinfo> + PDU Status Record. Described + in 6.2.67. This field is not present in earlier DIS + versions + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Padding" type="xs:string" minOccurs="0" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + Length, in bytes, of the PDU + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="DeadReckoningParametersType"> + <xs:annotation> + <xs:appinfo>Not specified in the standard. This is used by the ESPDU</xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="EntityLinearAcceleration" type="rstdis:Vector3FloatType" minOccurs="0"> + <xs:annotation> + <xs:appinfo>Linear acceleration of the entity</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityAngularVelocity" type="rstdis:Vector3FloatType" minOccurs="0"> + <xs:annotation> + <xs:appinfo>Angular velocity of the entity</xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="DeadReckoningAlgorithm" type="xs:string" minOccurs="0" + dfdl:lengthKind="explicit" dfdl:lengthUnits="bits" + dfdl:length="8"> + <xs:annotation> + <xs:appinfo> + Algorithm to use in computing dead reckoning. See EBV doc. (SISO enumeration DeadReckoningAlgorithm + uid 44) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="OtherParameters" type="xs:byte" minOccurs="0" + dfdl:lengthKind="explicit" dfdl:lengthUnits="bits" + dfdl:length="120"> + <xs:annotation> + <xs:appinfo>Dead reckoning parameters. Contents depends on algorithm.</xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="EntityIDType"> + <xs:annotation> + <xs:appinfo>Unique identifier triplet for this entity. Also referred to as EntityIdentifier</xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="SiteID" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + Site ID values are unique identification number for originating site, often corresponding + to an internet address. Site ID values are agreed upon by individual simulations. + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ApplicationID" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + Application ID values are unique identification number for originating application + at a given site. Application ID values are sssigned by individual sites. + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="EntityID" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + Entity ID values are unique identification number for s givent entity in the originating + application at a given site. Entity ID values are sssigned by individual simulation + programs. + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="EntityMarkingType"> + <xs:annotation> + <xs:appinfo>Specifies the character set used in the first byte, followed by 11 characters of text + data. Section 6.29 + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="CharacterSet" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="8"> + <xs:annotation> + <xs:appinfo> + The character set (SISO enumeration EntityMarkingCharacterSet uid 45) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Characters" type="xs:string" maxOccurs="11" + dfdl:lengthKind="explicit" dfdl:lengthUnits="characters" + dfdl:length="8"> + <xs:annotation> + <xs:appinfo> + The characters</xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="EntityTypeType"> + <xs:annotation> + <xs:appinfo>Identifies the type of Entity</xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="EntityKind" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + Kind of entity (SISO enumeration EntityKind uid 7) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Domain" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + Domain of entity (air, surface, subsurface, space, etc.) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Country" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + Country to which the design of the entity is attributed (SISO enumeration Country + uid 29) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Category" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + Category of entity + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="SubCategory" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + Subcategory based on category + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Specific" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + Specific info based on subcategory + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Extra" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + Specific info based on subcategory + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="EulerAnglesType"> + <xs:annotation> + <xs:appinfo>Three floating point values representing an orientation, psi, theta, and phi, aka + the euler angles, in radians. Section 6.2.33 + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="Psi" type="xs:byte" dfdl:lengthKind="explicit" + dfdl:lengthUnits="bits" dfdl:length="32"> + <xs:annotation> + <xs:appinfo> + Specific info based on subcategory + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Theta" type="xs:byte" dfdl:lengthKind="explicit" + dfdl:lengthUnits="bits" dfdl:length="32"> + <xs:annotation> + <xs:appinfo> + Specific info based on subcategory + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Phi" type="xs:byte" dfdl:lengthKind="explicit" + dfdl:lengthUnits="bits" dfdl:length="32"> + <xs:annotation> + <xs:appinfo> + Specific info based on subcategory + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="SimulationIdentifierType"> + <xs:annotation> + <xs:appinfo>The unique designation of a simulation when using the 48-bit identifier format shall + be specified by the Sim- ulation Identifier record. The reason that the 48-bit format + is required in addition to the 32-bit simulation address format that actually identifies + a specific simulation is because some 48-bit identifier fields in PDUs may contain + either an Object Identifier, such as an Entity ID, or a Simulation Identifier. Section + 6.2.80 + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:annotation> + <xs:appinfo>A Simulation Address record shall consist of the Site Identification number and the + Application Identification number. Section 6.2.79 + </xs:appinfo> + </xs:annotation> + <xs:element name="SiteNumber" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + Simulation address + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ApplicationNumber" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + Simulation address + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ReferenceNumber" type="xs:string" dfdl:lengthKind="explicit" + dfdl:lengthUnits="characters" dfdl:length="1"> + <xs:annotation> + <xs:appinfo> + This field shall be set to + zero as there is no reference number associated with + a Simulation Identifier. + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="VariableDatumType"> + <xs:annotation> + <xs:appinfo>The variable datum type, the datum length, and the value for that variable datum type. + Section 6.2.93 + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="VariableDatumID" type="xs:string" minOccurs="0" + dfdl:lengthKind="explicit" dfdl:lengthUnits="characters" + dfdl:length="41"> + <xs:annotation> + <xs:appinfo> + Type of variable datum to be + transmitted. 32-bit enumeration defined in EBV (SISO + enumeration VariableRecordType uid 66 Variable Record + Type values are defined by VariableRecordType + enumerations) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="VariableDatumLength" type="xs:string" + dfdl:occursCount="{ if(dfdl:contentLength(/., 'bytes') eq 1) then 1 + else 2 + }"> + <xs:annotation> + <xs:appinfo> + Length, IN BITS, of the variable datum. + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="VariableDatumValue" type="xs:string" + dfdl:lengthKind="explicit" dfdl:lengthUnits="characters" + dfdl:length="148"> + <xs:annotation> + <xs:appinfo> + This can be up to 64 bits long. If short of 64 bit, will + be padded to that boundary. + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="VariableParameterType"> + <xs:annotation> + <xs:appinfo>Used in DetonationPdu, ArticulatedPartsPdu among others</xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="RecordType" type="xs:string" minOccurs="0" + dfdl:lengthUnits="characters" dfdl:lengthKind="explicit" + dfdl:length="8"> + <xs:annotation> + <xs:appinfo> + The identification of the + Variable Parameter record. Enumeration from EBV + (SISO enumeration VariableParameterRecordType uid 56) + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="RecordSpecificFields" type="xs:byte" minOccurs="0" + dfdl:lengthKind="explicit" dfdl:lengthUnits="bits" + dfdl:length="120"> + <xs:annotation> + <xs:appinfo>120 bits</xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="Vector3DoubleType"> + <xs:annotation> + <xs:appinfo>Three double precision floating point values, x, y, and z. Used for world coordinates + Section 6.2.97. + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="X-component" type="xs:byte" dfdl:lengthKind="explicit" + dfdl:lengthUnits="bits" dfdl:length="64"> + <xs:annotation> + <xs:appinfo> + X value + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Y-component" type="xs:byte" dfdl:lengthKind="explicit" + dfdl:lengthUnits="bits" dfdl:length="64"> + <xs:annotation> + <xs:appinfo> + Y Value + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="Z-component" type="xs:byte" dfdl:lengthKind="explicit" + dfdl:lengthUnits="bits" dfdl:length="64"> + <xs:annotation> + <xs:appinfo> + Z value + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="Vector3FloatType"> + <xs:annotation> + <xs:appinfo>Three floating point values, x, y, and z. Section 6.2.95</xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="x-component" type="xs:byte" dfdl:lengthKind="explicit" + dfdl:lengthUnits="bits" dfdl:length="32"> + <xs:annotation> + <xs:appinfo> + X value + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="y-component" type="xs:byte" dfdl:lengthKind="explicit" + dfdl:lengthUnits="bits" dfdl:length="32"> + <xs:annotation> + <xs:appinfo> + Y Value + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="z-component" type="xs:byte" dfdl:lengthKind="explicit" + dfdl:lengthUnits="bits" dfdl:length="32"> + <xs:annotation> + <xs:appinfo> + Z value + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + +</xs:schema> diff --git a/DFDL/dataFormats/rst/src/main/resources/edu/nps/moves/xsd/rst/dis/DIS_7_2012.RichSemanticTrackSubset.dfdl.xsd b/DFDL/dataFormats/rst/src/main/resources/edu/nps/moves/xsd/rst/dis/DIS_7_2012.RichSemanticTrackSubset.dfdl.xsd deleted file mode 100644 index e3cfcae9818460d151a4eef1b98d4fed2d470029..0000000000000000000000000000000000000000 --- a/DFDL/dataFormats/rst/src/main/resources/edu/nps/moves/xsd/rst/dis/DIS_7_2012.RichSemanticTrackSubset.dfdl.xsd +++ /dev/null @@ -1,696 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- -Copyright (c) 1995-2023 held by the author(s). All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the names of the Naval Postgraduate School (NPS) - Modeling Virtual Environments and Simulation (MOVES) Institute - (https://www.nps.edu and https://my.nps.edu/web/moves) - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. ---> - -<!-- Based on the original DIS RST subset schema at: https://github.com/open-dis/opendis7-source-generator/blob/master/xml/DIS_7_2012.RichSemanticTrackSubset.xsd --> - -<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.1" - xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" - xmlns:daf="urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:ext" - xmlns:rstdis="urn:rstdis:1.0" - xmlns:tns="urn:rstdis:1.0" - targetNamespace="urn:rstdis:1.0" - elementFormDefault="qualified" - attributeFormDefault="unqualified"> - - <xs:include schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/> - - <xs:element name="RSTDIS" type="rstdis:RSTDIS"/> - - <xs:complexType name="RSTDIS"> - <xs:sequence> - - <xs:element name="DIS"> - <xs:annotation> - <xs:appinfo>Root element for DIS PDU log, optionally contains head meta information</xs:appinfo> - <xs:documentation>https://savage.nps.edu/opendis7-java/xml/SchemaDocumentation</xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:element ref="head" minOccurs="0"/> - <!-- minOccurs="0" maxOccurs="unbounded" --> - <xs:choice> - <xs:element ref="EntityStatePdu"/> - <xs:element ref="CommentPdu"/> - </xs:choice> - </xs:sequence> -<!-- <xs:attribute name="version" type="xs:string" fixed="7.0"> - <xs:annotation> - <xs:appinfo>Warning: version is required and must be specified in source document.</xs:appinfo> - </xs:annotation> - </xs:attribute>--> - </xs:complexType> - </xs:element> - - </xs:sequence> - </xs:complexType> - <xs:element name="head"> - <xs:annotation> - <xs:appinfo>Functional summary: each DIS file includes an optional head statement that can contain - any number of meta statements. - </xs:appinfo> - <xs:documentation source="https://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/concepts.html#Header"/> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:element ref="meta" minOccurs="0" maxOccurs="unbounded"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="meta"> - <xs:annotation> - <xs:appinfo>Functional summary: the meta statement provides metadata information about a file, - where name and content attributes provide attribute=value metadata pairs. - </xs:appinfo> - <xs:documentation source="https://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/concepts.html#Header"/> - </xs:annotation> -<!-- <xs:complexType> - <xs:attribute name="name" type="xs:string" use="required"> - <xs:annotation> - <xs:documentation source="http://www.dublincore.org/documents/dcmi-terms/#terms-description"/> - </xs:annotation> - </xs:attribute> - <xs:attribute name="content" type="xs:string" use="required"> - <xs:annotation> - <xs:documentation source="http://www.w3.org/TR/html4/struct/global.html#adef-content"/> - </xs:annotation> - </xs:attribute> - </xs:complexType>--> - </xs:element> - <!-- abstract="true" --> - <xs:complexType name="rootType"/> - <!-- abstract="true" --> - <xs:complexType name="EntityInformationInteractionFamilyPduType"> - <xs:annotation> - <xs:appinfo>Section 5.3.3. Common superclass for EntityState, Collision, collision-elastic, and - entity state update PDUs. - <xs:attribute name="id" type="xs:integer" fixed="1"/> - </xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="PduBaseType"> - <xs:attribute name="protocolFamily" default="DISProtocolFamily.ENTITY_INFORMATION_INTERACTION"/> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:element name="EntityStatePdu"> - <xs:annotation> - <xs:appinfo>7.2.2. Represents the position and state of one entity in the world. See 5.3.2. (length - of list found in field numberOfVariableParameters) - <xs:attribute name="id" type="xs:integer" fixed="1"/> - </xs:appinfo> - </xs:annotation> - <xs:complexType> - <xs:complexContent> - <xs:extension base="EntityInformationInteractionFamilyPduType"> - <xs:sequence> - <xs:element name="entityID" type="EntityIDType"> - <xs:annotation> - <xs:appinfo>Unique ID for an entity that is tied to this state information</xs:appinfo> - </xs:annotation> - </xs:element> - <xs:element name="entityType" type="EntityTypeType"> - <xs:annotation> - <xs:appinfo>Describes the type of entity in the world</xs:appinfo> - </xs:annotation> - </xs:element> - <xs:element name="alternativeEntityType" type="EntityTypeType"/> - <xs:element name="entityLinearVelocity" type="Vector3FloatType"> - <xs:annotation> - <xs:appinfo>Describes the speed of the entity in the world</xs:appinfo> - </xs:annotation> - </xs:element> - <xs:element name="entityLocation" type="Vector3DoubleType"> - <xs:annotation> - <xs:appinfo>describes the location of the entity in the world</xs:appinfo> - </xs:annotation> - </xs:element> - <xs:element name="entityOrientation" type="EulerAnglesType"> - <xs:annotation> - <xs:appinfo>describes the orientation of the entity, in euler angles with units of radians</xs:appinfo> - </xs:annotation> - </xs:element> - <xs:element name="deadReckoningParameters" type="DeadReckoningParametersType"> - <xs:annotation> - <xs:appinfo>parameters used for dead reckoning</xs:appinfo> - </xs:annotation> - </xs:element> - <xs:element name="marking" type="EntityMarkingType"> - <xs:annotation> - <xs:appinfo>11 characters that can be used for entity identification, debugging, or to draw unique - strings on the side of entities in the world - </xs:appinfo> - </xs:annotation> - </xs:element> - <!--Attribute (as element) EntityStatePdu variableParameters with objectlist classRef name=VariableParameter, type=VariableParameterType--> - <xs:sequence minOccurs="0" maxOccurs="unbounded"> - <xs:annotation> - <xs:appinfo>Number of elements is determined by size fieldnumberOfVariableParameters and can be 0 or greater. - Ensure that the total PDU size does not exceed maximums allowed in IEEE DIS Specification. - </xs:appinfo> - <xs:documentation>numberOfVariableParameters</xs:documentation> - </xs:annotation> - <xs:element name="VariableParameter" type="VariableParameterType"> - <xs:annotation> - <xs:appinfo>variable length list of variable parameters. In earlier DIS versions this was articulation - parameters. (length of list found in field numberOfVariableParameters) - </xs:appinfo> - </xs:annotation> - </xs:element> - </xs:sequence> - </xs:sequence> - <xs:attribute name="family" fixed="EntityInformationInteractionFamilyPduType"/> - <xs:attribute name="forceId" type="xs:string"> - <xs:annotation> - <xs:appinfo>What force this entity is affiliated with, eg red, blue, neutral, etc (SISO enumeration - ForceID uid 6) - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="numberOfVariableParameters" type="xs:unsignedByte"> - <xs:annotation> - <xs:appinfo>How many variable parameters are in the variable length list. In earlier versions - of DIS these were known as articulation parameters - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="entityAppearance" type="xs:unsignedLong"> - <xs:annotation> - <xs:appinfo>a series of bit flags that are used to help draw the entity, such as smoking, on fire, - etc. - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="capabilities" type="xs:unsignedLong"> - <xs:annotation> - <xs:appinfo>a series of bit flags (SISO bitfield enumeration, size 32 bits, EntityCapabilities - uid 55) - </xs:appinfo> - </xs:annotation> - </xs:attribute> - </xs:extension> - <!-- ========== debug: divider between elements and attributes ========== --> - </xs:complexContent> - </xs:complexType> - </xs:element> - <xs:element name="CommentPdu"> - <xs:annotation> - <xs:appinfo>7.5.13 Used to enter arbitrary messages (character strings, for example). See 5.6.5.13 - (length of list found in field numberOfVariableDatumRecords) - <xs:attribute name="id" type="xs:integer" fixed="22"/> - </xs:appinfo> - </xs:annotation> - <xs:complexType> - <xs:complexContent> - <xs:extension base="SimulationManagementFamilyPduType"> - <xs:sequence> - <!--Attribute (as element) CommentPdu variableDatums with objectlist classRef name=VariableDatum, type=VariableDatumType--> - <xs:sequence minOccurs="0" maxOccurs="unbounded"> - <xs:annotation> - <xs:appinfo>Number of elements is determined by size fieldnumberOfVariableDatumRecords and can be 0 or greater. - Ensure that the total PDU size does not exceed maximums allowed in IEEE DIS Specification. - </xs:appinfo> - <xs:documentation>numberOfVariableDatumRecords</xs:documentation> - </xs:annotation> - <xs:element name="VariableDatum" type="VariableDatumType"> - <xs:annotation> - <xs:appinfo>variable length list of variable length datums (length of list found in field numberOfVariableDatumRecords)</xs:appinfo> - </xs:annotation> - </xs:element> - </xs:sequence> - </xs:sequence> - <xs:attribute name="family" fixed="SimulationManagementFamilyPduType"/> - <xs:attribute name="numberOfFixedDatumRecords" type="xs:unsignedLong"> - <xs:annotation> - <xs:appinfo>Number of fixed datum records, not used in this Pdu</xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="numberOfVariableDatumRecords" type="xs:unsignedLong"> - <xs:annotation> - <xs:appinfo>Number of variable datum records, handled automatically by marshaller at run time - (and not modifiable by end-user programmers) - </xs:appinfo> - </xs:annotation> - </xs:attribute> - </xs:extension> - <!-- ========== debug: divider between elements and attributes ========== --> - </xs:complexContent> - </xs:complexType> - </xs:element> - <xs:complexType name="SimulationManagementFamilyPduType" abstract="true"> - <xs:annotation> - <xs:appinfo>First part of a simulation management (SIMAN) PDU and SIMAN-Reliability (SIMAN-R) - PDU. Sectionn 6.2.81 - <xs:attribute name="id" type="xs:integer" fixed="5"/> - </xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="PduBaseType"> - <xs:sequence> - <xs:element name="originatingID" type="SimulationIdentifierType"> - <xs:annotation> - <xs:appinfo>IDs the simulation or entity, either a simulation or an entity. Either 6.2.80 or 6.2.28</xs:appinfo> - </xs:annotation> - </xs:element> - <xs:element name="receivingID" type="SimulationIdentifierType"> - <xs:annotation> - <xs:appinfo>simulation, all simulations, a special ID, or an entity. See 5.6.5 and 5.12.4</xs:appinfo> - </xs:annotation> - </xs:element> - </xs:sequence> - <xs:attribute name="protocolFamily" default="DISProtocolFamily.SIMULATION_MANAGEMENT"/> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="DeadReckoningParametersType" abstract="false"> - <xs:annotation> - <xs:appinfo>Not specified in the standard. This is used by the ESPDU</xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="rootType"> - <xs:sequence> - <xs:element name="entityLinearAcceleration" type="Vector3FloatType"> - <xs:annotation> - <xs:appinfo>Linear acceleration of the entity</xs:appinfo> - </xs:annotation> - </xs:element> - <xs:element name="entityAngularVelocity" type="Vector3FloatType"> - <xs:annotation> - <xs:appinfo>Angular velocity of the entity</xs:appinfo> - </xs:annotation> - </xs:element> - </xs:sequence> - <xs:attribute name="deadReckoningAlgorithm" type="xs:string"> - <xs:annotation> - <xs:appinfo>Algorithm to use in computing dead reckoning. See EBV doc. (SISO enumeration DeadReckoningAlgorithm - uid 44) - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="parameters"> - <xs:annotation> - <xs:appinfo>Dead reckoning parameters. Contents depends on algorithm.</xs:appinfo> - </xs:annotation> - </xs:attribute> - </xs:extension> - <!-- ========== debug: divider between elements and attributes ========== --> - </xs:complexContent> - <!--abstract='false' base='rootType'--> - </xs:complexType> - <xs:complexType name="DomainType" abstract="false"> - <xs:annotation> - <xs:appinfo>A special class to contain and act as a super class for Domain enumerations.</xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="rootType"> - <xs:attribute name="value" type="xs:unsignedByte"> - <xs:annotation> - <xs:appinfo>domain field containing enumeration value. See SISO enumerations for PlatformDomain - uid 8, MunitionDomain uid 14 and SupplyDomain uid 600. - </xs:appinfo> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - <!--abstract='false' base='rootType'--> - </xs:complexType> - <xs:complexType name="EntityIDType" abstract="false"> - <xs:annotation> - <xs:appinfo>Unique identifier triplet for this entity. Also referred to as EntityIdentifier</xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="rootType"> - <xs:attribute name="siteID" type="xs:unsignedShort"> - <xs:annotation> - <xs:appinfo>Site ID values are unique identification number for originating site, often corresponding - to an internet address. Site ID values are agreed upon by individual simulations. - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="applicationID" type="xs:unsignedShort"> - <xs:annotation> - <xs:appinfo>Application ID values are unique identification number for originating application - at a given site. Application ID values are sssigned by individual sites. - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="entityID" type="xs:unsignedShort"> - <xs:annotation> - <xs:appinfo>Entity ID values are unique identification number for s givent entity in the originating - application at a given site. Entity ID values are sssigned by individual simulation - programs. - </xs:appinfo> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - <!--abstract='false' base='rootType'--> - </xs:complexType> - <xs:complexType name="EntityMarkingType" abstract="false"> - <xs:annotation> - <xs:appinfo>Specifies the character set used in the first byte, followed by 11 characters of text - data. Section 6.29 - </xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="rootType"> - <xs:attribute name="characterSet" type="xs:string"> - <xs:annotation> - <xs:appinfo>The character set (SISO enumeration EntityMarkingCharacterSet uid 45)</xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="characters"> - <xs:annotation> - <xs:appinfo>The characters</xs:appinfo> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - <!--abstract='false' base='rootType'--> - </xs:complexType> - <xs:complexType name="EntityTypeType" abstract="false"> - <xs:annotation> - <xs:appinfo>Identifies the type of Entity</xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="rootType"> - <xs:sequence> - <xs:element name="domain" type="DomainType"> - <xs:annotation> - <xs:appinfo>Domain of entity (air, surface, subsurface, space, etc.)</xs:appinfo> - </xs:annotation> - </xs:element> - </xs:sequence> - <xs:attribute name="entityKind" type="xs:string"> - <xs:annotation> - <xs:appinfo>Kind of entity (SISO enumeration EntityKind uid 7)</xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="country" type="xs:string"> - <xs:annotation> - <xs:appinfo>country to which the design of the entity is attributed (SISO enumeration Country - uid 29) - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="category" type="xs:unsignedByte"> - <xs:annotation> - <xs:appinfo>category of entity</xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="subCategory" type="xs:unsignedByte"> - <xs:annotation> - <xs:appinfo>subcategory based on category</xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="specific" type="xs:unsignedByte"> - <xs:annotation> - <xs:appinfo>specific info based on subcategory</xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="extra" type="xs:unsignedByte"/> - </xs:extension> - <!-- ========== debug: divider between elements and attributes ========== --> - </xs:complexContent> - <!--abstract='false' base='rootType'--> - </xs:complexType> - <xs:complexType name="EulerAnglesType" abstract="false"> - <xs:annotation> - <xs:appinfo>Three floating point values representing an orientation, psi, theta, and phi, aka - the euler angles, in radians. Section 6.2.33 - </xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="rootType"> - <xs:attribute name="psi" type="xs:float"/> - <xs:attribute name="theta" type="xs:float"/> - <xs:attribute name="phi" type="xs:float"/> - </xs:extension> - </xs:complexContent> - <!--abstract='false' base='rootType'--> - </xs:complexType> - <xs:complexType name="PduType" abstract="true"> - <xs:annotation> - <xs:appinfo>Base class of PduBase and LiveEntityPdu</xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="rootType"> - <xs:attribute name="protocolVersion" type="xs:string"> - <xs:annotation> - <xs:appinfo>The version of the protocol. 5=DIS-1995, 6=DIS-1998, 7=DIS-2012 (SISO enumeration - DISProtocolVersion uid 3) - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="exerciseID" type="xs:unsignedByte"> - <xs:annotation> - <xs:appinfo>Exercise ID provides a unique identifier</xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="pduType" type="xs:string"> - <xs:annotation> - <xs:appinfo>Type of pdu, unique for each PDU class (SISO enumeration DisPduType uid 4)</xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="timestamp" type="xs:unsignedLong"> - <xs:annotation> - <xs:appinfo>Timestamp value</xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="length" type="xs:unsignedShort"> - <xs:annotation> - <xs:appinfo>Length, in bytes, of the PDU</xs:appinfo> - </xs:annotation> - </xs:attribute> - </xs:extension> - <!--xs:attribute protocolFamily is defined in subclasses for Pdu rather than here, in order to avoid inheritance collisions.--> - </xs:complexContent> - <!--abstract='true' base='rootType'--> - </xs:complexType> - <xs:complexType name="PduBaseType" abstract="true"> - <xs:annotation> - <xs:appinfo>The superclass for all PDUs except LiveEntity. This incorporates the PduHeader record, - section 7.2.2 - </xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="PduType"> - <xs:sequence> - <xs:element name="pduStatus" type="PduStatusType"> - <xs:annotation> - <xs:appinfo>PDU Status Record. Described in 6.2.67. This field is not present in earlier DIS versions</xs:appinfo> - </xs:annotation> - </xs:element> - </xs:sequence> - </xs:extension> - <!-- ========== debug: divider between elements and attributes ========== --> - <!--xs:attribute padding is defined in subclasses for PduBase rather than here, in order to avoid inheritance collisions.--> - </xs:complexContent> - <!--abstract='true' base='PduType'--> - </xs:complexType> - <xs:complexType name="PduStatusType" abstract="true"> - <xs:annotation> - <xs:appinfo>PduStatus provides a set of bit-masked indicator values, section 6.2.67. Bit fields - include Transferred Entity Indicator (TEI), LVC Indicator (LVC), Coupled Extension - Indicator (CEI), Fire Type Indicator (FTI), Detonation Type Indicator (DTI), Radio - Attached Indicator (RAI), Intercom Attached Indicator (IAI), IFF Simulation Mode (ISM) - and Active Interrogation Indicator (AII). - </xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="rootType"> - <xs:attribute name="value" type="xs:unsignedByte"> - <xs:annotation> - <xs:appinfo>PDU Status Record value containing bitmasked field</xs:appinfo> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - <!--abstract='true' base='rootType'--> - </xs:complexType> - <xs:complexType name="SimulationAddressType" abstract="false"> - <xs:annotation> - <xs:appinfo>A Simulation Address record shall consist of the Site Identification number and the - Application Identification number. Section 6.2.79 - </xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="rootType"/> - </xs:complexContent> - <!--abstract='false' base='rootType'--> - </xs:complexType> - <xs:complexType name="SimulationIdentifierType" abstract="false"> - <xs:annotation> - <xs:appinfo>The unique designation of a simulation when using the 48-bit identifier format shall - be specified by the Sim- ulation Identifier record. The reason that the 48-bit format - is required in addition to the 32-bit simulation address format that actually identifies - a specific simulation is because some 48-bit identifier fields in PDUs may contain - either an Object Identifier, such as an Entity ID, or a Simulation Identifier. Section - 6.2.80 - </xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="rootType"> - <xs:sequence> - <xs:element name="simulationAddress" type="SimulationAddressType"> - <xs:annotation> - <xs:appinfo>Simulation address</xs:appinfo> - </xs:annotation> - </xs:element> - </xs:sequence> - <xs:attribute name="referenceNumber" type="xs:unsignedShort"> - <xs:annotation> - <xs:appinfo>This field shall be set to zero as there is no reference number associated with a - Simulation Identifier. - </xs:appinfo> - </xs:annotation> - </xs:attribute> - </xs:extension> - <!-- ========== debug: divider between elements and attributes ========== --> - </xs:complexContent> - <!--abstract='false' base='rootType'--> - </xs:complexType> - <xs:complexType name="VariableDatumType" abstract="false"> - <xs:annotation> - <xs:appinfo>The variable datum type, the datum length, and the value for that variable datum type. - Section 6.2.93 - </xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="rootType"> - <xs:attribute name="variableDatumID" type="xs:string"> - <xs:annotation> - <xs:appinfo>Type of variable datum to be transmitted. 32-bit enumeration defined in EBV (SISO - enumeration VariableRecordType uid 66 Variable Record Type values are defined by VariableRecordType - enumerations) - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="variableDatumLength" type="xs:unsignedLong"> - <xs:annotation> - <xs:appinfo>Length, IN BITS, of the variable datum.</xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="variableDatumValue"> - <xs:annotation> - <xs:appinfo>This can be any number of bits long, depending on the datum.</xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="padding" type="xs:unsignedInt"> - <xs:annotation> - <xs:appinfo>zero-filled array of padding bits for byte alignment and consistent sizing of PDU - data - </xs:appinfo> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - <!--abstract='false' base='rootType'--> - </xs:complexType> - <xs:complexType name="VariableParameterType" abstract="false"> - <xs:annotation> - <xs:appinfo>used in DetonationPdu, ArticulatedPartsPdu among others</xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="rootType"> - <xs:attribute name="recordType" type="xs:string"> - <xs:annotation> - <xs:appinfo>The identification of the Variable Parameter record. Enumeration from EBV (SISO enumeration - VariableParameterRecordType uid 56) - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="recordSpecificFields"> - <xs:annotation> - <xs:appinfo>120 bits</xs:appinfo> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - <!--abstract='false' base='rootType'--> - </xs:complexType> - <xs:complexType name="Vector3DoubleType" abstract="false"> - <xs:annotation> - <xs:appinfo>Three double precision floating point values, x, y, and z. Used for world coordinates - Section 6.2.97. - </xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="rootType"> - <xs:attribute name="x" type="xs:double"> - <xs:annotation> - <xs:appinfo>X value</xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="y" type="xs:double"> - <xs:annotation> - <xs:appinfo>y Value</xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="z" type="xs:double"> - <xs:annotation> - <xs:appinfo>Z value</xs:appinfo> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - <!--abstract='false' base='rootType'--> - </xs:complexType> - <xs:complexType name="Vector3FloatType" abstract="false"> - <xs:annotation> - <xs:appinfo>Three floating point values, x, y, and z. Section 6.2.95</xs:appinfo> - </xs:annotation> - <xs:complexContent> - <xs:extension base="rootType"> - <xs:attribute name="x" type="xs:float"> - <xs:annotation> - <xs:appinfo>X value</xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="y" type="xs:float"> - <xs:annotation> - <xs:appinfo>y Value</xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="z" type="xs:float"> - <xs:annotation> - <xs:appinfo>Z value</xs:appinfo> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - <!--abstract='false' base='rootType'--> - </xs:complexType> -</xs:schema> \ No newline at end of file diff --git a/DFDL/dataFormats/rst/src/main/resources/edu/nps/moves/xsd/rst/dis/basicByteBinary.dfdl.xsd b/DFDL/dataFormats/rst/src/main/resources/edu/nps/moves/xsd/rst/dis/basicByteBinary.dfdl.xsd new file mode 100644 index 0000000000000000000000000000000000000000..2501a358432d72bd81ee65035f3f4e2c465b3024 --- /dev/null +++ b/DFDL/dataFormats/rst/src/main/resources/edu/nps/moves/xsd/rst/dis/basicByteBinary.dfdl.xsd @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?> + + +<!-- +Copyright (c) 2012-2021 Owl Cyber Defense. All rights reserved. + +Developed by: Owl Cyber Defense + http://www.owlcyberdefense.com + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + 3. Neither the names of Owl Cyber Defense, nor the names of its contributors + may be used to endorse or promote products derived from this Software + without specific prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. +--> + +<!-- +Basic byte-oriented binary data. This is a standard set of +conventions useful for describing things like IP packets. +--> + +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" + xmlns:dfdlx="http://www.ogf.org/dfdl/dfdl-1.0/extensions" + xmlns:daf="urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:ext" + xmlns:dafint="urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:int" + xmlns:b="urn:basicBinary" + xmlns:tns="urn:basicBinary" + targetNamespace="urn:basicBinary"> + + <xs:include schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/> + + <xs:annotation> + <xs:appinfo source="http://www.ogf.org/dfdl/"> + + <dfdl:defineFormat name="basicByteBinary"> + <dfdl:format ref="tns:GeneralFormat" + alignmentUnits="bits" + documentFinalTerminatorCanBeMissing="yes" + lengthUnits="bits" + representation="binary"/> + </dfdl:defineFormat> + + <dfdl:format ref="b:basicByteBinary"/> + + </xs:appinfo> + </xs:annotation> + + <xs:simpleType name="bit" dfdl:lengthKind="explicit"> + <xs:restriction base="xs:unsignedInt"/> + </xs:simpleType> + + <xs:simpleType name="enum8" dfdl:lengthKind="explicit" dfdl:length="8"> + <xs:restriction base="xs:unsignedInt"/> + </xs:simpleType> + + <xs:simpleType name="ubyte" dfdl:lengthKind="explicit" dfdl:length="8"> + <xs:restriction base="xs:unsignedInt"/> + </xs:simpleType> + + <xs:simpleType name="uint16" dfdl:lengthKind="explicit" dfdl:length="16"> + <xs:restriction base="xs:unsignedInt"/> + </xs:simpleType> + + <xs:simpleType name="uint32" dfdl:lengthKind="explicit" dfdl:length="32"> + <xs:restriction base="xs:unsignedInt"/> + </xs:simpleType> + + <xs:simpleType name="int32" dfdl:lengthKind="explicit" dfdl:length="4" + dfdl:lengthUnits="bytes"> + <xs:restriction base="xs:int"/> + </xs:simpleType> + + <xs:simpleType name="enum120" dfdl:lengthKind="explicit" dfdl:length="120"> + <xs:restriction base="xs:nonNegativeInteger"/> + </xs:simpleType> + +</xs:schema> diff --git a/DFDL/dataFormats/rst/src/test/resources/edu/nps/moves/xsd/rst/dis/data/PduCaptureLog.dislog b/DFDL/dataFormats/rst/src/test/resources/edu/nps/moves/xsd/rst/dis/data/PduCaptureLog.dislog deleted file mode 100644 index 6ee34c51a9d92bfe77ccd264f8276e69a9780c56..0000000000000000000000000000000000000000 --- a/DFDL/dataFormats/rst/src/test/resources/edu/nps/moves/xsd/rst/dis/data/PduCaptureLog.dislog +++ /dev/null @@ -1,54 +0,0 @@ -# Start, ENCODING_PLAINTEXT, [PduRecorder] 20230802_174037, DIS capture file, ./pduLog/PduCaptureLog.dislog -# Timestamp(8 bytes),ProtocolVersion,CompatibilityVersion,ExerciseID,PduType,PduStatus,HeaderLength,PduLength,then PDU-specific data -# ============================================= -# DisPduType 11 CREATE_ENTITY, Session time 17:40:37.4, session duration 00:00:00.0, Pdu timestamp -1387051339 03:57:41.0, simulation stream interval 0 00:00:00.0 -0,0,57,-32,-68,-91,44,-103,7,4,11,5,-83,83,70,-75,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -# DisPduType 11 CREATE_ENTITY, Session time 17:40:37.4, session duration 00:00:00.0, Pdu timestamp -1387051339 03:57:41.0, simulation stream interval 0 00:00:00.0 -0,0,0,0,0,-99,108,-56,7,4,11,5,-83,83,70,-75,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -# DisPduType 22 COMMENT, Session time 17:40:37.4, session duration 00:00:00.0, Pdu timestamp 0 00:00:00.0, simulation stream interval 1387051339 20:02:19.0 -0,0,0,0,0,-93,96,56,7,1,22,5,0,0,0,0,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,-81,-46,0,0,1,64,83,105,109,117,108,97,116,105,111,110,32,116,105,109,101,115,116,101,112,32,100,117,114,97,116,105,111,110,32,49,46,48,32,115,101,99,111,110,100,115 -# DisPduType 22 COMMENT, Session time 17:40:37.5, session duration 00:00:00.1, Pdu timestamp 0 00:00:00.0, simulation stream interval 1387051339 20:02:19.0 -0,0,0,0,6,-92,38,72,7,1,22,5,0,0,0,0,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,-53,32,0,0,1,-8,83,105,109,117,108,97,116,105,111,110,32,116,105,109,101,32,48,46,48,32,97,116,32,76,111,99,97,108,68,97,116,101,84,105,109,101,32,50,48,50,51,45,48,56,45,48,50,84,49,55,58,52,48,58,51,55,46,53,48,49,50,48,56,0 -# DisPduType 01 ENTITY_STATE, Session time 17:40:38.6, session duration 00:00:01.2, Pdu timestamp 0 00:00:00.0, simulation stream interval 1387051339 20:02:19.0 -0,0,0,0,72,-35,-61,72,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,3,1,0,1,2,0,-31,23,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,-16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,69,110,116,105,116,121,32,35,53,51,0,0,0,0 -# DisPduType 02 FIRE, Session time 17:40:38.7, session duration 00:00:01.3, Pdu timestamp 0 00:00:00.0, simulation stream interval 1387051339 20:02:19.0 -0,0,0,0,79,33,24,104,7,1,2,2,0,0,0,0,0,96,40,0,0,2,0,3,0,0,0,2,0,3,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,122,0,0 -# DisPduType 22 COMMENT, Session time 17:40:38.8, session duration 00:00:01.4, Pdu timestamp 0 00:00:00.0, simulation stream interval 1387051339 20:02:19.0 -0,0,0,0,85,108,-11,32,7,1,22,5,0,0,0,0,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,-87,-72,0,0,0,-8,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,0,0,3,-87,-72,0,0,0,-80,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,108,111,111,112,32,49,0,0 -# DisPduType 01 ENTITY_STATE, Session time 17:40:38.9, session duration 00:00:01.5, Pdu timestamp 0 00:00:00.0, simulation stream interval 1387051339 20:02:19.0 -0,0,0,0,91,-102,57,-48,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,4,2,0,1,3,0,-51,62,2,2,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,50,0,0,0,0 -# DisPduType 01 ENTITY_STATE, Session time 17:40:40.0, session duration 00:00:02.6, Pdu timestamp 1000 00:16:40.0, simulation stream interval 1387052339 20:18:59.0 -0,0,0,0,-99,-65,61,96,7,1,1,1,0,0,3,-24,0,-112,40,0,0,1,0,2,0,3,1,0,1,2,0,-31,23,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,69,110,116,105,116,121,32,35,53,51,0,0,0,0 -# DisPduType 02 FIRE, Session time 17:40:40.1, session duration 00:00:02.7, Pdu timestamp 1000 00:16:40.0, simulation stream interval 1387052339 20:18:59.0 -0,0,0,0,-93,-11,9,-88,7,1,2,2,0,0,3,-24,0,96,40,0,0,2,0,3,0,0,0,2,0,3,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,122,0,0 -# DisPduType 22 COMMENT, Session time 17:40:40.2, session duration 00:00:02.8, Pdu timestamp 1000 00:16:40.0, simulation stream interval 1387052339 20:18:59.0 -0,0,0,0,-86,47,51,32,7,1,22,5,0,0,3,-24,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,-87,-72,0,0,0,-8,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,0,0,3,-87,-72,0,0,0,-80,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,108,111,111,112,32,50,0,0 -# DisPduType 01 ENTITY_STATE, Session time 17:40:40.3, session duration 00:00:02.9, Pdu timestamp 1000 00:16:40.0, simulation stream interval 1387052339 20:18:59.0 -0,0,0,0,-80,109,72,-128,7,1,1,1,0,0,3,-24,0,-112,40,0,0,1,0,2,0,4,2,0,1,3,0,-51,62,2,2,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,50,0,0,0,0 -# DisPduType 01 ENTITY_STATE, Session time 17:40:41.4, session duration 00:00:04.0, Pdu timestamp 2000 00:33:20.0, simulation stream interval 1387053339 20:35:39.0 -0,0,0,0,-14,127,-125,120,7,1,1,1,0,0,7,-48,0,-112,40,0,0,1,0,2,0,3,1,0,1,2,0,-31,23,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,69,110,116,105,116,121,32,35,53,51,0,0,0,0 -# DisPduType 02 FIRE, Session time 17:40:41.5, session duration 00:00:04.1, Pdu timestamp 2000 00:33:20.0, simulation stream interval 1387053339 20:35:39.0 -0,0,0,0,-8,-64,17,-88,7,1,2,2,0,0,7,-48,0,96,40,0,0,2,0,3,0,0,0,2,0,3,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,122,0,0 -# DisPduType 22 COMMENT, Session time 17:40:41.6, session duration 00:00:04.2, Pdu timestamp 2000 00:33:20.0, simulation stream interval 1387053339 20:35:39.0 -0,0,0,0,-2,-3,107,-120,7,1,22,5,0,0,7,-48,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,-87,-72,0,0,0,-8,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,0,0,3,-87,-72,0,0,0,-80,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,108,111,111,112,32,51,0,0 -# DisPduType 01 ENTITY_STATE, Session time 17:40:41.7, session duration 00:00:04.3, Pdu timestamp 2000 00:33:20.0, simulation stream interval 1387053339 20:35:39.0 -0,0,0,1,5,53,20,96,7,1,1,1,0,0,7,-48,0,-112,40,0,0,1,0,2,0,4,2,0,1,3,0,-51,62,2,2,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,50,0,0,0,0 -# DisPduType 01 ENTITY_STATE, Session time 17:40:42.8, session duration 00:00:05.4, Pdu timestamp 3000 00:50:00.0, simulation stream interval 1387054339 20:52:19.0 -0,0,0,1,71,66,-104,80,7,1,1,1,0,0,11,-72,0,-112,40,0,0,1,0,2,0,3,1,0,1,2,0,-31,23,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,69,110,116,105,116,121,32,35,53,51,0,0,0,0 -# DisPduType 02 FIRE, Session time 17:40:42.9, session duration 00:00:05.5, Pdu timestamp 3000 00:50:00.0, simulation stream interval 1387054339 20:52:19.0 -0,0,0,1,77,117,17,8,7,1,2,2,0,0,11,-72,0,96,40,0,0,2,0,3,0,0,0,2,0,3,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,122,0,0 -# DisPduType 22 COMMENT, Session time 17:40:43.1, session duration 00:00:05.7, Pdu timestamp 3000 00:50:00.0, simulation stream interval 1387054339 20:52:19.0 -0,0,0,1,83,-65,-95,-72,7,1,22,5,0,0,11,-72,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,-87,-72,0,0,0,-8,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,0,0,3,-87,-72,0,0,0,-80,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,108,111,111,112,32,52,0,0 -# DisPduType 01 ENTITY_STATE, Session time 17:40:43.2, session duration 00:00:05.8, Pdu timestamp 3000 00:50:00.0, simulation stream interval 1387054339 20:52:19.0 -0,0,0,1,89,-11,-123,112,7,1,1,1,0,0,11,-72,0,-112,40,0,0,1,0,2,0,4,2,0,1,3,0,-51,62,2,2,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,50,0,0,0,0 -# DisPduType 01 ENTITY_STATE, Session time 17:40:44.3, session duration 00:00:06.9, Pdu timestamp 4000 01:06:40.0, simulation stream interval 1387055339 21:08:59.0 -0,0,0,1,-100,41,-116,-64,7,1,1,1,0,0,15,-96,0,-112,40,0,0,1,0,2,0,3,1,0,1,2,0,-31,23,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,69,110,116,105,116,121,32,35,53,51,0,0,0,0 -# DisPduType 02 FIRE, Session time 17:40:44.4, session duration 00:00:07.0, Pdu timestamp 4000 01:06:40.0, simulation stream interval 1387055339 21:08:59.0 -0,0,0,1,-94,90,76,16,7,1,2,2,0,0,15,-96,0,96,40,0,0,2,0,3,0,0,0,2,0,3,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,122,0,0 -# DisPduType 22 COMMENT, Session time 17:40:44.5, session duration 00:00:07.1, Pdu timestamp 4000 01:06:40.0, simulation stream interval 1387055339 21:08:59.0 -0,0,0,1,-88,-99,1,8,7,1,22,5,0,0,15,-96,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,-87,-72,0,0,0,-8,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,0,0,3,-87,-72,0,0,0,-80,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,108,111,111,112,32,53,0,0 -# DisPduType 01 ENTITY_STATE, Session time 17:40:44.6, session duration 00:00:07.2, Pdu timestamp 4000 01:06:40.0, simulation stream interval 1387055339 21:08:59.0 -0,0,0,1,-82,-36,-99,8,7,1,1,1,0,0,15,-96,0,-112,40,0,0,1,0,2,0,4,2,0,1,3,0,-51,62,2,2,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,50,0,0,0,0 -# DisPduType 22 COMMENT, Session time 17:40:44.7, session duration 00:00:07.3, Pdu timestamp -1378286025 14:46:15.0, simulation stream interval 8765314 10:48:34.0 -0,0,0,1,-75,41,-90,-120,7,1,22,5,-83,-39,6,55,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,9,90,-90,0,0,0,-8,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,0,0,9,90,-90,0,0,1,48,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,99,111,109,112,108,101,116,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,0,0 -# Finish, ENCODING_PLAINTEXT, [PduRecorder] 20230802_174046, DIS capture file, ./pduLog/PduCaptureLog.dislog diff --git a/DFDL/dataFormats/rst/src/test/resources/edu/nps/moves/xsd/rst/dis/data/PduGenerator_ENCODING_BINARY_PduCaptureLog.dislog b/DFDL/dataFormats/rst/src/test/resources/edu/nps/moves/xsd/rst/dis/data/PduGenerator_ENCODING_BINARY_PduCaptureLog.dislog new file mode 100644 index 0000000000000000000000000000000000000000..bdbc67cb0299cd6f6b8463b6912514332968ff57 Binary files /dev/null and b/DFDL/dataFormats/rst/src/test/resources/edu/nps/moves/xsd/rst/dis/data/PduGenerator_ENCODING_BINARY_PduCaptureLog.dislog differ