├── .gitignore ├── LICENSE ├── README.md ├── package-lock.json ├── package.json └── src ├── dis ├── AcknowledgePdu.js ├── AcknowledgeReliablePdu.js ├── AcousticBeamData.js ├── AcousticBeamFundamentalParameter.js ├── AcousticEmitter.js ├── AcousticEmitterSystem.js ├── AcousticEmitterSystemData.js ├── ActionRequestPdu.js ├── ActionRequestReliablePdu.js ├── ActionResponsePdu.js ├── ActionResponseReliablePdu.js ├── AggregateID.js ├── AggregateMarking.js ├── AggregateStatePdu.js ├── AggregateType.js ├── AngularVelocityVector.js ├── AntennaLocation.js ├── ApaData.js ├── ArealObjectStatePdu.js ├── ArticulationParameter.js ├── BeamAntennaPattern.js ├── BeamData.js ├── BurstDescriptor.js ├── ClockTime.js ├── CollisionElasticPdu.js ├── CollisionPdu.js ├── CommentPdu.js ├── CommentReliablePdu.js ├── CreateEntityPdu.js ├── CreateEntityReliablePdu.js ├── DataPdu.js ├── DataQueryPdu.js ├── DataQueryReliablePdu.js ├── DataReliablePdu.js ├── DeadReckoningParameter.js ├── DesignatorPdu.js ├── DetonationPdu.js ├── DistributedEmissionsFamilyPdu.js ├── ElectronicEmissionBeamData.js ├── ElectronicEmissionSystemData.js ├── ElectronicEmissionsPdu.js ├── EmitterSystem.js ├── EntityID.js ├── EntityInformationFamilyPdu.js ├── EntityManagementFamilyPdu.js ├── EntityStatePdu.js ├── EntityStateUpdatePdu.js ├── EntityType.js ├── Environment.js ├── EnvironmentalProcessPdu.js ├── EventID.js ├── EventReportPdu.js ├── EventReportReliablePdu.js ├── FastEntityStatePdu.js ├── FirePdu.js ├── FixedDatum.js ├── FundamentalParameterData.js ├── FundamentalParameterDataIff.js ├── GridAxisRecord.js ├── GridAxisRecordRepresentation0.js ├── GridAxisRecordRepresentation1.js ├── GridAxisRecordRepresentation2.js ├── GriddedDataPdu.js ├── IffAtcNavAidsLayer1Pdu.js ├── IffAtcNavAidsLayer2Pdu.js ├── IffFundamentalData.js ├── IntercomCommunicationsParameters.js ├── IntercomControlPdu.js ├── IntercomSignalPdu.js ├── IsGroupOfPdu.js ├── IsPartOfPdu.js ├── LayerHeader.js ├── LinearObjectStatePdu.js ├── LinearSegmentParameter.js ├── LogisticsFamilyPdu.js ├── Marking.js ├── MinefieldDataPdu.js ├── MinefieldFamilyPdu.js ├── MinefieldQueryPdu.js ├── MinefieldResponseNackPdu.js ├── MinefieldStatePdu.js ├── ModulationType.js ├── NamedLocation.js ├── ObjectType.js ├── Orientation.js ├── Pdu.js ├── PduContainer.js ├── PduStream.js ├── Point.js ├── PointObjectStatePdu.js ├── PropulsionSystemData.js ├── RadioCommunicationsFamilyPdu.js ├── RadioEntityType.js ├── ReceiverPdu.js ├── RecordQueryReliablePdu.js ├── RecordSet.js ├── Relationship.js ├── RemoveEntityPdu.js ├── RemoveEntityReliablePdu.js ├── RepairCompletePdu.js ├── RepairResponsePdu.js ├── ResupplyCancelPdu.js ├── ResupplyOfferPdu.js ├── ResupplyReceivedPdu.js ├── SeesPdu.js ├── ServiceRequestPdu.js ├── SetDataPdu.js ├── SetDataReliablePdu.js ├── SetRecordReliablePdu.js ├── ShaftRPMs.js ├── SignalPdu.js ├── SimulationAddress.js ├── SimulationManagementFamilyPdu.js ├── SimulationManagementWithReliabilityFamilyPdu.js ├── SixByteChunk.js ├── SphericalHarmonicAntennaPattern.js ├── StartResumePdu.js ├── StartResumeReliablePdu.js ├── StopFreezePdu.js ├── StopFreezeReliablePdu.js ├── SupplyQuantity.js ├── SyntheticEnvironmentFamilyPdu.js ├── SystemID.js ├── TrackJamTarget.js ├── TransferControlRequestPdu.js ├── TransmitterPdu.js ├── UaPdu.js ├── UnsignedIntegerWrapper.js ├── VariableDatum.js ├── Vector3Double.js ├── Vector3Float.js ├── VectoringNozzleSystemData.js └── WarfareFamilyPdu.js ├── dis7 ├── AcknowledgePdu.js ├── AcknowledgeReliablePdu.js ├── AcousticEmitter.js ├── ActionRequestPdu.js ├── ActionRequestReliablePdu.js ├── ActionResponsePdu.js ├── ActionResponseReliablePdu.js ├── AggregateIdentifier.js ├── AggregateMarking.js ├── AggregateType.js ├── AngleDeception.js ├── AngularVelocityVector.js ├── AntennaLocation.js ├── ArealObjectStatePdu.js ├── ArticulatedParts.js ├── Association.js ├── AttachedParts.js ├── Attribute.js ├── AttributePdu.js ├── BeamAntennaPattern.js ├── BeamData.js ├── BeamStatus.js ├── BlankingSector.js ├── ChangeOptions.js ├── ClockTime.js ├── CollisionElasticPdu.js ├── CollisionPdu.js ├── CommentPdu.js ├── CommentReliablePdu.js ├── CommunicationsNodeID.js ├── CreateEntityPdu.js ├── CreateEntityReliablePdu.js ├── DataFilterRecord.js ├── DataPdu.js ├── DataQueryDatumSpecification.js ├── DataQueryPdu.js ├── DataQueryReliablePdu.js ├── DataReliablePdu.js ├── DatumSpecification.js ├── DeadReckoningParameters.js ├── DesignatorPdu.js ├── DetonationPdu.js ├── DirectedEnergyAreaAimpoint.js ├── DirectedEnergyDamage.js ├── DirectedEnergyFirePdu.js ├── DirectedEnergyPrecisionAimpoint.js ├── DirectedEnergyTargetEnergyDeposition.js ├── DistributedEmissionsFamilyPdu.js ├── EEFundamentalParameterData.js ├── ElectronicEmissionsPdu.js ├── EmitterSystem.js ├── EngineFuel.js ├── EngineFuelReload.js ├── EntityAssociation.js ├── EntityDamageStatusPdu.js ├── EntityID.js ├── EntityIdentifier.js ├── EntityInformationFamilyPdu.js ├── EntityManagementFamilyPdu.js ├── EntityMarking.js ├── EntityStatePdu.js ├── EntityStateUpdatePdu.js ├── EntityType.js ├── EntityTypeVP.js ├── Environment.js ├── EnvironmentGeneral.js ├── EnvironmentType.js ├── EulerAngles.js ├── EventIdentifier.js ├── EventIdentifierLiveEntity.js ├── EventReportPdu.js ├── EventReportReliablePdu.js ├── Expendable.js ├── ExpendableDescriptor.js ├── ExpendableReload.js ├── ExplosionDescriptor.js ├── FalseTargetsAttribute.js ├── FastEntityStatePdu.js ├── FirePdu.js ├── FixedDatum.js ├── FundamentalOperationalData.js ├── GridAxis.js ├── GridAxisDescriptorVariable.js ├── GroupID.js ├── IFFData.js ├── IFFFundamentalParameterData.js ├── IOCommunicationsNode.js ├── IOEffect.js ├── IffDataSpecification.js ├── IntercomCommunicationsParameters.js ├── IntercomControlPdu.js ├── IntercomIdentifier.js ├── IntercomSignalPdu.js ├── IsPartOfPdu.js ├── JammingTechnique.js ├── LaunchedMunitionRecord.js ├── LayerHeader.js ├── LinearObjectStatePdu.js ├── LinearSegmentParameter.js ├── LiveEntityIdentifier.js ├── LiveEntityPdu.js ├── LiveSimulationAddress.js ├── LogisticsFamilyPdu.js ├── MineEntityIdentifier.js ├── MinefieldFamilyPdu.js ├── MinefieldIdentifier.js ├── MinefieldResponseNackPdu.js ├── MinefieldSensorType.js ├── MinefieldStatePdu.js ├── ModulationParameters.js ├── ModulationType.js ├── Munition.js ├── MunitionDescriptor.js ├── MunitionReload.js ├── NamedLocationIdentification.js ├── ObjectIdentifier.js ├── ObjectType.js ├── OwnershipStatus.js ├── Pdu.js ├── PduContainer.js ├── PduHeader.js ├── PduStatus.js ├── PduStream.js ├── PduSuperclass.js ├── PointObjectStatePdu.js ├── PropulsionSystemData.js ├── ProtocolMode.js ├── RadioCommunicationsFamilyPdu.js ├── RadioIdentifier.js ├── RadioType.js ├── ReceiverPdu.js ├── RecordQueryReliablePdu.js ├── RecordQuerySpecification.js ├── RecordSpecification.js ├── RecordSpecificationElement.js ├── Relationship.js ├── RemoveEntityPdu.js ├── RemoveEntityReliablePdu.js ├── RepairCompletePdu.js ├── RepairResponsePdu.js ├── RequestID.js ├── ResupplyOfferPdu.js ├── ResupplyReceivedPdu.js ├── SecondaryOperationalData.js ├── SeesPdu.js ├── Sensor.js ├── SeparationVP.js ├── ServiceRequestPdu.js ├── SetDataPdu.js ├── SetDataReliablePdu.js ├── SignalPdu.js ├── SilentEntitySystem.js ├── SimulationAddress.js ├── SimulationIdentifier.js ├── SimulationManagementFamilyPdu.js ├── SimulationManagementPduHeader.js ├── SimulationManagementWithReliabilityFamilyPdu.js ├── StandardVariableSpecification.js ├── StartResumePdu.js ├── StartResumeReliablePdu.js ├── StopFreezePdu.js ├── StopFreezeReliablePdu.js ├── StorageFuel.js ├── StorageFuelReload.js ├── SupplyQuantity.js ├── SyntheticEnvironmentFamilyPdu.js ├── SystemIdentifier.js ├── Timestamp.js ├── TotalRecordSets.js ├── TrackJamData.js ├── TransmitterPdu.js ├── UAFundamentalParameter.js ├── UaPdu.js ├── UnattachedIdentifier.js ├── UnsignedDISInteger.js ├── VariableDatum.js ├── VariableParameter.js ├── VariableTransmitterParameters.js ├── Vector2Float.js ├── Vector3Double.js ├── Vector3Float.js ├── VectoringNozzleSystem.js └── WarfareFamilyPdu.js └── disSupporting ├── BigInteger.js.tmp ├── Chunk.js ├── CoordinateConversion.js ├── DisAppearance.js ├── InputStream.js ├── OutputStream.js ├── PduFactory.js ├── RangeCoordinates.js ├── StringConversion.js └── export.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dis6.js 3 | dis7.js 4 | dis6.min.js 5 | dis7.min.js 6 | open-dis-*.tgz 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, mcgredonps 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Open DIS for Javascript 2 | 3 | NPM version 4 | 5 | ## Introduction 6 | 7 | A Javascript implementation of DIS that decodes IEEE 1278.1 8 | binary data format messages and turns them into Javascript 9 | objects. 10 | 11 | This library is intended to be used on the client side with 12 | the websocket receiving data. The web socket hands off an 13 | event message with binary data attached, and the javascript 14 | library decodes it and turns it into a javascript object. 15 | 16 | The code also includes some simple coordinate system transforms 17 | to change DIS world coordinates to (lat, lon, alt) or to a 18 | position in a local tanget plane coordinate system. 19 | 20 | ## Build 21 | 22 | To generate a single `dis6.min.js` and `dis7.min.js` from the source files, run the following command: 23 | 24 | `$ npm install` 25 | 26 | # Release 27 | 28 | Releases are published to http://npmjs.com/package/open-dis 29 | 30 | 1. `$ npm login` 31 | 1. `$ npm version ` 32 | 1. `$ npm publish` 33 | 1. `$ git push` 34 | 1. `$ git push --tags` 35 | 1. Draft a new GitHub Release for this tag. 36 | 37 | ## Examples 38 | 39 | Example code using this library for sending and receiving DIS packets with Node.js can be found here: https://github.com/keckxde/node-disnetworkclient 40 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "open-dis", 3 | "version": "1.3.6", 4 | "description": "Javascript Node module for IEEE 1278.1, Distributed Interactive Simulation", 5 | "main": "./dist/dis6.min.js", 6 | "scripts": { 7 | "lint": "eslint \"src/**/*.js\"", 8 | "test": "echo \"Error: no test specified\" && exit 1", 9 | "prepare": "rimraf dist && mkdir dist && uglifyjs src/dis/*.js src/disSupporting/*.js -o dist/dis6.min.js && uglifyjs src/dis7/*.js src/disSupporting/*.js -o dist/dis7.min.js" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/open-dis/open-dis-javascript.git" 14 | }, 15 | "keywords": [ 16 | "IEEE", 17 | "1278.1", 18 | "DIS", 19 | "Distributed", 20 | "Interactive", 21 | "Simulation", 22 | "open-dis" 23 | ], 24 | "author": { 25 | "name": "Don McGregor", 26 | "email": "mcgredo@nps.edu", 27 | "url": "http://www.movesinstitute.org/" 28 | }, 29 | "license": "BSD-2-Clause", 30 | "bugs": { 31 | "url": "https://github.com/open-dis/open-dis-javascript/issues" 32 | }, 33 | "homepage": "https://github.com/open-dis/open-dis-javascript", 34 | "dependencies": { 35 | "long": "^3.2.0", 36 | "uglifyjs": "^2.4.11" 37 | }, 38 | "devDependencies": { 39 | "eslint": "^6.7.1", 40 | "rimraf": "^6.0.1", 41 | "uglify-js": "^3.7.0" 42 | }, 43 | "files": [ 44 | "dist", 45 | "src" 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /src/dis/AcousticBeamData.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Used in UA PDU 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.AcousticBeamData = function() 21 | { 22 | /** beam data length */ 23 | this.beamDataLength = 0; 24 | 25 | /** beamIDNumber */ 26 | this.beamIDNumber = 0; 27 | 28 | /** padding */ 29 | this.pad2 = 0; 30 | 31 | /** fundamental data parameters */ 32 | this.fundamentalDataParameters = new dis.AcousticBeamFundamentalParameter(); 33 | 34 | dis.AcousticBeamData.prototype.initFromBinary = function(inputStream) 35 | { 36 | this.beamDataLength = inputStream.readUShort(); 37 | this.beamIDNumber = inputStream.readUByte(); 38 | this.pad2 = inputStream.readUShort(); 39 | this.fundamentalDataParameters.initFromBinary(inputStream); 40 | }; 41 | 42 | dis.AcousticBeamData.prototype.encodeToBinary = function(outputStream) 43 | { 44 | outputStream.writeUShort(this.beamDataLength); 45 | outputStream.writeUByte(this.beamIDNumber); 46 | outputStream.writeUShort(this.pad2); 47 | this.fundamentalDataParameters.encodeToBinary(outputStream); 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.AcousticBeamData = dis.AcousticBeamData; 53 | 54 | // End of AcousticBeamData class 55 | 56 | -------------------------------------------------------------------------------- /src/dis/AcousticEmitter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.35. information about a specific UA emmtter 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.AcousticEmitter = function() 21 | { 22 | /** the system for a particular UA emitter, and an enumeration */ 23 | this.acousticName = 0; 24 | 25 | /** The function of the acoustic system */ 26 | this.function = 0; 27 | 28 | /** The UA emitter identification number relative to a specific system */ 29 | this.acousticIdNumber = 0; 30 | 31 | dis.AcousticEmitter.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.acousticName = inputStream.readUShort(); 34 | this.function = inputStream.readUByte(); 35 | this.acousticIdNumber = inputStream.readUByte(); 36 | }; 37 | 38 | dis.AcousticEmitter.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeUShort(this.acousticName); 41 | outputStream.writeUByte(this.function); 42 | outputStream.writeUByte(this.acousticIdNumber); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.AcousticEmitter = dis.AcousticEmitter; 48 | 49 | // End of AcousticEmitter class 50 | 51 | -------------------------------------------------------------------------------- /src/dis/AcousticEmitterSystem.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 5.3.35: Information about a particular UA emitter shall be represented using an Acoustic Emitter System record. This record shall consist of three fields: Acoustic Name, Function, and Acoustic ID Number 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.AcousticEmitterSystem = function() 21 | { 22 | /** This field shall specify the system for a particular UA emitter. */ 23 | this.acousticName = 0; 24 | 25 | /** This field shall describe the function of the acoustic system. */ 26 | this.acousticFunction = 0; 27 | 28 | /** This field shall specify the UA emitter identification number relative to a specific system. This field shall be represented by an 8-bit unsigned integer. This field allows the differentiation of multiple systems on an entity, even if in some instances two or more of the systems may be identical UA emitter types. Numbering of systems shall begin with the value 1. */ 29 | this.acousticID = 0; 30 | 31 | dis.AcousticEmitterSystem.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.acousticName = inputStream.readUShort(); 34 | this.acousticFunction = inputStream.readUByte(); 35 | this.acousticID = inputStream.readUByte(); 36 | }; 37 | 38 | dis.AcousticEmitterSystem.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeUShort(this.acousticName); 41 | outputStream.writeUByte(this.acousticFunction); 42 | outputStream.writeUByte(this.acousticID); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.AcousticEmitterSystem = dis.AcousticEmitterSystem; 48 | 49 | // End of AcousticEmitterSystem class 50 | 51 | -------------------------------------------------------------------------------- /src/dis/AggregateID.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.36. Each agregate in a given simulation app is given an aggregate identifier number unique for all other aggregates in that app and in that exercise. The id is valid for the duration of the the exercise. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.AggregateID = function() 21 | { 22 | /** The site ID */ 23 | this.site = 0; 24 | 25 | /** The application ID */ 26 | this.application = 0; 27 | 28 | /** the aggregate ID */ 29 | this.aggregateID = 0; 30 | 31 | dis.AggregateID.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.site = inputStream.readUShort(); 34 | this.application = inputStream.readUShort(); 35 | this.aggregateID = inputStream.readUShort(); 36 | }; 37 | 38 | dis.AggregateID.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeUShort(this.site); 41 | outputStream.writeUShort(this.application); 42 | outputStream.writeUShort(this.aggregateID); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.AggregateID = dis.AggregateID; 48 | 49 | // End of AggregateID class 50 | 51 | -------------------------------------------------------------------------------- /src/dis/AggregateMarking.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.37. Specifies the character set used inthe first byte, followed by up to 31 characters of text data. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.AggregateMarking = function() 21 | { 22 | /** The character set */ 23 | this.characterSet = 0; 24 | 25 | /** The characters */ 26 | this.characters = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 27 | 28 | dis.AggregateMarking.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.characterSet = inputStream.readUByte(); 31 | for(var idx = 0; idx < 31; idx++) 32 | { 33 | this.characters[ idx ] = inputStream.readByte(); 34 | } 35 | }; 36 | 37 | dis.AggregateMarking.prototype.encodeToBinary = function(outputStream) 38 | { 39 | outputStream.writeUByte(this.characterSet); 40 | for(var idx = 0; idx < 31; idx++) 41 | { 42 | outputStream.writeByte(this.characters[ idx ] ); 43 | } 44 | }; 45 | }; // end of class 46 | 47 | // node.js module support 48 | exports.AggregateMarking = dis.AggregateMarking; 49 | 50 | // End of AggregateMarking class 51 | 52 | -------------------------------------------------------------------------------- /src/dis/AngularVelocityVector.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 5.2.2: angular velocity measured in radians per second out each of the entity's own coordinate axes. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.AngularVelocityVector = function() 21 | { 22 | /** velocity about the x axis */ 23 | this.x = 0; 24 | 25 | /** velocity about the y axis */ 26 | this.y = 0; 27 | 28 | /** velocity about the zaxis */ 29 | this.z = 0; 30 | 31 | dis.AngularVelocityVector.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.x = inputStream.readFloat32(); 34 | this.y = inputStream.readFloat32(); 35 | this.z = inputStream.readFloat32(); 36 | }; 37 | 38 | dis.AngularVelocityVector.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeFloat32(this.x); 41 | outputStream.writeFloat32(this.y); 42 | outputStream.writeFloat32(this.z); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.AngularVelocityVector = dis.AngularVelocityVector; 48 | 49 | // End of AngularVelocityVector class 50 | 51 | -------------------------------------------------------------------------------- /src/dis/AntennaLocation.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 5.2.3: location of the radiating portion of the antenna, specified in world coordinates and entity coordinates. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.AntennaLocation = function() 21 | { 22 | /** Location of the radiating portion of the antenna in world coordinates */ 23 | this.antennaLocation = new dis.Vector3Double(); 24 | 25 | /** Location of the radiating portion of the antenna in entity coordinates */ 26 | this.relativeAntennaLocation = new dis.Vector3Float(); 27 | 28 | dis.AntennaLocation.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.antennaLocation.initFromBinary(inputStream); 31 | this.relativeAntennaLocation.initFromBinary(inputStream); 32 | }; 33 | 34 | dis.AntennaLocation.prototype.encodeToBinary = function(outputStream) 35 | { 36 | this.antennaLocation.encodeToBinary(outputStream); 37 | this.relativeAntennaLocation.encodeToBinary(outputStream); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.AntennaLocation = dis.AntennaLocation; 43 | 44 | // End of AntennaLocation class 45 | 46 | -------------------------------------------------------------------------------- /src/dis/ApaData.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Used in UA PDU 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ApaData = function() 21 | { 22 | /** Index of APA parameter */ 23 | this.parameterIndex = 0; 24 | 25 | /** Index of APA parameter */ 26 | this.parameterValue = 0; 27 | 28 | dis.ApaData.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.parameterIndex = inputStream.readUShort(); 31 | this.parameterValue = inputStream.readShort(); 32 | }; 33 | 34 | dis.ApaData.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeUShort(this.parameterIndex); 37 | outputStream.writeShort(this.parameterValue); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.ApaData = dis.ApaData; 43 | 44 | // End of ApaData class 45 | 46 | -------------------------------------------------------------------------------- /src/dis/ArticulationParameter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.5. Articulation parameters for movable parts and attached parts of an entity. Specifes wether or not a change has occured, the part identifcation of the articulated part to which it is attached, and the type and value of each parameter. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ArticulationParameter = function() 21 | { 22 | this.parameterTypeDesignator = 0; 23 | 24 | this.changeIndicator = 0; 25 | 26 | this.partAttachedTo = 0; 27 | 28 | this.parameterType = 0; 29 | 30 | this.parameterValue = 0; 31 | 32 | dis.ArticulationParameter.prototype.initFromBinary = function(inputStream) 33 | { 34 | this.parameterTypeDesignator = inputStream.readUByte(); 35 | this.changeIndicator = inputStream.readUByte(); 36 | this.partAttachedTo = inputStream.readUShort(); 37 | this.parameterType = inputStream.readInt(); 38 | this.parameterValue = inputStream.readFloat64(); 39 | }; 40 | 41 | dis.ArticulationParameter.prototype.encodeToBinary = function(outputStream) 42 | { 43 | outputStream.writeUByte(this.parameterTypeDesignator); 44 | outputStream.writeUByte(this.changeIndicator); 45 | outputStream.writeUShort(this.partAttachedTo); 46 | outputStream.writeInt(this.parameterType); 47 | outputStream.writeFloat64(this.parameterValue); 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.ArticulationParameter = dis.ArticulationParameter; 53 | 54 | // End of ArticulationParameter class 55 | 56 | -------------------------------------------------------------------------------- /src/dis/BurstDescriptor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.7. Specifies the type of muntion fired, the type of warhead, the type of fuse, the number of rounds fired, and the rate at which the roudns are fired in rounds per minute. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.BurstDescriptor = function() 21 | { 22 | /** What munition was used in the burst */ 23 | this.munition = new dis.EntityType(); 24 | 25 | /** type of warhead */ 26 | this.warhead = 0; 27 | 28 | /** type of fuse used */ 29 | this.fuse = 0; 30 | 31 | /** how many of the munition were fired */ 32 | this.quantity = 0; 33 | 34 | /** rate at which the munition was fired */ 35 | this.rate = 0; 36 | 37 | dis.BurstDescriptor.prototype.initFromBinary = function(inputStream) 38 | { 39 | this.munition.initFromBinary(inputStream); 40 | this.warhead = inputStream.readUShort(); 41 | this.fuse = inputStream.readUShort(); 42 | this.quantity = inputStream.readUShort(); 43 | this.rate = inputStream.readUShort(); 44 | }; 45 | 46 | dis.BurstDescriptor.prototype.encodeToBinary = function(outputStream) 47 | { 48 | this.munition.encodeToBinary(outputStream); 49 | outputStream.writeUShort(this.warhead); 50 | outputStream.writeUShort(this.fuse); 51 | outputStream.writeUShort(this.quantity); 52 | outputStream.writeUShort(this.rate); 53 | }; 54 | }; // end of class 55 | 56 | // node.js module support 57 | exports.BurstDescriptor = dis.BurstDescriptor; 58 | 59 | // End of BurstDescriptor class 60 | 61 | -------------------------------------------------------------------------------- /src/dis/ClockTime.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.8. Time measurements that exceed one hour. Hours is the number of hours since January 1, 1970, UTC 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ClockTime = function() 21 | { 22 | /** Hours in UTC */ 23 | this.hour = 0; 24 | 25 | /** Time past the hour */ 26 | this.timePastHour = 0; 27 | 28 | dis.ClockTime.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.hour = inputStream.readInt(); 31 | this.timePastHour = inputStream.readUInt(); 32 | }; 33 | 34 | dis.ClockTime.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeInt(this.hour); 37 | outputStream.writeUInt(this.timePastHour); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.ClockTime = dis.ClockTime; 43 | 44 | // End of ClockTime class 45 | 46 | -------------------------------------------------------------------------------- /src/dis/DeadReckoningParameter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * represents values used in dead reckoning algorithms 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.DeadReckoningParameter = function() 21 | { 22 | /** enumeration of what dead reckoning algorighm to use */ 23 | this.deadReckoningAlgorithm = 0; 24 | 25 | /** other parameters to use in the dead reckoning algorithm */ 26 | this.otherParameters = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 27 | 28 | /** Linear acceleration of the entity */ 29 | this.entityLinearAcceleration = new dis.Vector3Float(); 30 | 31 | /** angular velocity of the entity */ 32 | this.entityAngularVelocity = new dis.Vector3Float(); 33 | 34 | dis.DeadReckoningParameter.prototype.initFromBinary = function(inputStream) 35 | { 36 | this.deadReckoningAlgorithm = inputStream.readUByte(); 37 | for(var idx = 0; idx < 15; idx++) 38 | { 39 | this.otherParameters[ idx ] = inputStream.readByte(); 40 | } 41 | this.entityLinearAcceleration.initFromBinary(inputStream); 42 | this.entityAngularVelocity.initFromBinary(inputStream); 43 | }; 44 | 45 | dis.DeadReckoningParameter.prototype.encodeToBinary = function(outputStream) 46 | { 47 | outputStream.writeUByte(this.deadReckoningAlgorithm); 48 | for(var idx = 0; idx < 15; idx++) 49 | { 50 | outputStream.writeByte(this.otherParameters[ idx ] ); 51 | } 52 | this.entityLinearAcceleration.encodeToBinary(outputStream); 53 | this.entityAngularVelocity.encodeToBinary(outputStream); 54 | }; 55 | }; // end of class 56 | 57 | // node.js module support 58 | exports.DeadReckoningParameter = dis.DeadReckoningParameter; 59 | 60 | // End of DeadReckoningParameter class 61 | 62 | -------------------------------------------------------------------------------- /src/dis/EmitterSystem.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.11. This field shall specify information about a particular emitter system 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.EmitterSystem = function() 21 | { 22 | /** Name of the emitter, 16 bit enumeration */ 23 | this.emitterName = 0; 24 | 25 | /** function of the emitter, 8 bit enumeration */ 26 | this.function = 0; 27 | 28 | /** emitter ID, 8 bit enumeration */ 29 | this.emitterIdNumber = 0; 30 | 31 | dis.EmitterSystem.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.emitterName = inputStream.readUShort(); 34 | this.function = inputStream.readUByte(); 35 | this.emitterIdNumber = inputStream.readUByte(); 36 | }; 37 | 38 | dis.EmitterSystem.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeUShort(this.emitterName); 41 | outputStream.writeUByte(this.function); 42 | outputStream.writeUByte(this.emitterIdNumber); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.EmitterSystem = dis.EmitterSystem; 48 | 49 | // End of EmitterSystem class 50 | 51 | -------------------------------------------------------------------------------- /src/dis/Environment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.40. Information about a geometry, a state associated with a geometry, a bounding volume, or an associated entity ID. NOTE: this class requires hand coding. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Environment = function() 21 | { 22 | /** Record type */ 23 | this.environmentType = 0; 24 | 25 | /** length, in bits */ 26 | this.length = 0; 27 | 28 | /** Identify the sequentially numbered record index */ 29 | this.recordIndex = 0; 30 | 31 | /** padding */ 32 | this.padding1 = 0; 33 | 34 | /** Geometry or state record */ 35 | this.geometry = 0; 36 | 37 | /** padding to bring the total size up to a 64 bit boundry */ 38 | this.padding2 = 0; 39 | 40 | dis.Environment.prototype.initFromBinary = function(inputStream) 41 | { 42 | this.environmentType = inputStream.readUInt(); 43 | this.length = inputStream.readUByte(); 44 | this.recordIndex = inputStream.readUByte(); 45 | this.padding1 = inputStream.readUByte(); 46 | this.geometry = inputStream.readUByte(); 47 | this.padding2 = inputStream.readUByte(); 48 | }; 49 | 50 | dis.Environment.prototype.encodeToBinary = function(outputStream) 51 | { 52 | outputStream.writeUInt(this.environmentType); 53 | outputStream.writeUByte(this.length); 54 | outputStream.writeUByte(this.recordIndex); 55 | outputStream.writeUByte(this.padding1); 56 | outputStream.writeUByte(this.geometry); 57 | outputStream.writeUByte(this.padding2); 58 | }; 59 | }; // end of class 60 | 61 | // node.js module support 62 | exports.Environment = dis.Environment; 63 | 64 | // End of Environment class 65 | 66 | -------------------------------------------------------------------------------- /src/dis/EventID.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.18. Identifies a unique event in a simulation via the combination of three values 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.EventID = function() 21 | { 22 | /** The site ID */ 23 | this.site = 0; 24 | 25 | /** The application ID */ 26 | this.application = 0; 27 | 28 | /** the number of the event */ 29 | this.eventNumber = 0; 30 | 31 | dis.EventID.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.site = inputStream.readUShort(); 34 | this.application = inputStream.readUShort(); 35 | this.eventNumber = inputStream.readUShort(); 36 | }; 37 | 38 | dis.EventID.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeUShort(this.site); 41 | outputStream.writeUShort(this.application); 42 | outputStream.writeUShort(this.eventNumber); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.EventID = dis.EventID; 48 | 49 | // End of EventID class 50 | 51 | -------------------------------------------------------------------------------- /src/dis/FixedDatum.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.18. Fixed Datum Record 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.FixedDatum = function() 21 | { 22 | /** ID of the fixed datum */ 23 | this.fixedDatumID = 0; 24 | 25 | /** Value for the fixed datum */ 26 | this.fixedDatumValue = 0; 27 | 28 | dis.FixedDatum.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.fixedDatumID = inputStream.readUInt(); 31 | this.fixedDatumValue = inputStream.readUInt(); 32 | }; 33 | 34 | dis.FixedDatum.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeUInt(this.fixedDatumID); 37 | outputStream.writeUInt(this.fixedDatumValue); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.FixedDatum = dis.FixedDatum; 43 | 44 | // End of FixedDatum class 45 | 46 | -------------------------------------------------------------------------------- /src/dis/GridAxisRecord.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 5.2.44: Grid data record, a common abstract superclass for several subtypes 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.GridAxisRecord = function() 21 | { 22 | /** type of environmental sample */ 23 | this.sampleType = 0; 24 | 25 | /** value that describes data representation */ 26 | this.dataRepresentation = 0; 27 | 28 | dis.GridAxisRecord.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.sampleType = inputStream.readUShort(); 31 | this.dataRepresentation = inputStream.readUShort(); 32 | }; 33 | 34 | dis.GridAxisRecord.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeUShort(this.sampleType); 37 | outputStream.writeUShort(this.dataRepresentation); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.GridAxisRecord = dis.GridAxisRecord; 43 | 44 | // End of GridAxisRecord class 45 | 46 | -------------------------------------------------------------------------------- /src/dis/GridAxisRecordRepresentation0.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 5.2.44: Grid data record, representation 0 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.GridAxisRecordRepresentation0 = function() 21 | { 22 | /** type of environmental sample */ 23 | this.sampleType = 0; 24 | 25 | /** value that describes data representation */ 26 | this.dataRepresentation = 0; 27 | 28 | /** number of bytes of environmental state data */ 29 | this.numberOfBytes = 0; 30 | 31 | /** variable length variablelist of data parameters ^^^this is wrong--need padding as well */ 32 | this.dataValues = new Array(); 33 | 34 | dis.GridAxisRecordRepresentation0.prototype.initFromBinary = function(inputStream) 35 | { 36 | this.sampleType = inputStream.readUShort(); 37 | this.dataRepresentation = inputStream.readUShort(); 38 | this.numberOfBytes = inputStream.readUShort(); 39 | for(var idx = 0; idx < this.numberOfBytes; idx++) 40 | { 41 | var anX = new dis.Chunk(1); 42 | anX.initFromBinary(inputStream); 43 | this.dataValues.push(anX); 44 | } 45 | 46 | }; 47 | 48 | dis.GridAxisRecordRepresentation0.prototype.encodeToBinary = function(outputStream) 49 | { 50 | outputStream.writeUShort(this.sampleType); 51 | outputStream.writeUShort(this.dataRepresentation); 52 | outputStream.writeUShort(this.numberOfBytes); 53 | for(var idx = 0; idx < this.dataValues.length; idx++) 54 | { 55 | this.dataValues[idx].encodeToBinary(outputStream); 56 | } 57 | 58 | }; 59 | }; // end of class 60 | 61 | // node.js module support 62 | exports.GridAxisRecordRepresentation0 = dis.GridAxisRecordRepresentation0; 63 | 64 | // End of GridAxisRecordRepresentation0 class 65 | 66 | -------------------------------------------------------------------------------- /src/dis/GridAxisRecordRepresentation2.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 5.2.44: Grid data record, representation 1 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.GridAxisRecordRepresentation2 = function() 21 | { 22 | /** type of environmental sample */ 23 | this.sampleType = 0; 24 | 25 | /** value that describes data representation */ 26 | this.dataRepresentation = 0; 27 | 28 | /** number of values */ 29 | this.numberOfValues = 0; 30 | 31 | /** variable length list of data parameters ^^^this is wrong--need padding as well */ 32 | this.dataValues = new Array(); 33 | 34 | dis.GridAxisRecordRepresentation2.prototype.initFromBinary = function(inputStream) 35 | { 36 | this.sampleType = inputStream.readUShort(); 37 | this.dataRepresentation = inputStream.readUShort(); 38 | this.numberOfValues = inputStream.readUShort(); 39 | for(var idx = 0; idx < this.numberOfValues; idx++) 40 | { 41 | var anX = new dis.Chunk(4); 42 | anX.initFromBinary(inputStream); 43 | this.dataValues.push(anX); 44 | } 45 | 46 | }; 47 | 48 | dis.GridAxisRecordRepresentation2.prototype.encodeToBinary = function(outputStream) 49 | { 50 | outputStream.writeUShort(this.sampleType); 51 | outputStream.writeUShort(this.dataRepresentation); 52 | outputStream.writeUShort(this.numberOfValues); 53 | for(var idx = 0; idx < this.dataValues.length; idx++) 54 | { 55 | this.dataValues[idx].encodeToBinary(outputStream); 56 | } 57 | 58 | }; 59 | }; // end of class 60 | 61 | // node.js module support 62 | exports.GridAxisRecordRepresentation2 = dis.GridAxisRecordRepresentation2; 63 | 64 | // End of GridAxisRecordRepresentation2 class 65 | 66 | -------------------------------------------------------------------------------- /src/dis/IntercomCommunicationsParameters.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 5.2.46. Intercom communcations parameters 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.IntercomCommunicationsParameters = function() 21 | { 22 | /** Type of intercom parameters record */ 23 | this.recordType = 0; 24 | 25 | /** length of record-specifid field, in octets */ 26 | this.recordLength = 0; 27 | 28 | /** variable length variablelist of data parameters */ 29 | this.parameterValues = new Array(); 30 | 31 | dis.IntercomCommunicationsParameters.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.recordType = inputStream.readUShort(); 34 | this.recordLength = inputStream.readUShort(); 35 | for(var idx = 0; idx < this.recordLength; idx++) 36 | { 37 | var anX = new dis.Chunk(1); 38 | anX.initFromBinary(inputStream); 39 | this.parameterValues.push(anX); 40 | } 41 | 42 | }; 43 | 44 | dis.IntercomCommunicationsParameters.prototype.encodeToBinary = function(outputStream) 45 | { 46 | outputStream.writeUShort(this.recordType); 47 | outputStream.writeUShort(this.recordLength); 48 | for(var idx = 0; idx < this.parameterValues.length; idx++) 49 | { 50 | this.parameterValues[idx].encodeToBinary(outputStream); 51 | } 52 | 53 | }; 54 | }; // end of class 55 | 56 | // node.js module support 57 | exports.IntercomCommunicationsParameters = dis.IntercomCommunicationsParameters; 58 | 59 | // End of IntercomCommunicationsParameters class 60 | 61 | -------------------------------------------------------------------------------- /src/dis/LayerHeader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 5.2.47. Layer header. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.LayerHeader = function() 21 | { 22 | /** Layer number */ 23 | this.layerNumber = 0; 24 | 25 | /** Layer speccific information enumeration */ 26 | this.layerSpecificInformaiton = 0; 27 | 28 | /** information length */ 29 | this.length = 0; 30 | 31 | dis.LayerHeader.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.layerNumber = inputStream.readUByte(); 34 | this.layerSpecificInformaiton = inputStream.readUByte(); 35 | this.length = inputStream.readUShort(); 36 | }; 37 | 38 | dis.LayerHeader.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeUByte(this.layerNumber); 41 | outputStream.writeUByte(this.layerSpecificInformaiton); 42 | outputStream.writeUShort(this.length); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.LayerHeader = dis.LayerHeader; 48 | 49 | // End of LayerHeader class 50 | 51 | -------------------------------------------------------------------------------- /src/dis/ModulationType.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Radio modulation 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ModulationType = function() 21 | { 22 | /** spread spectrum, 16 bit boolean array */ 23 | this.spreadSpectrum = 0; 24 | 25 | /** major */ 26 | this.major = 0; 27 | 28 | /** detail */ 29 | this.detail = 0; 30 | 31 | /** system */ 32 | this.system = 0; 33 | 34 | dis.ModulationType.prototype.initFromBinary = function(inputStream) 35 | { 36 | this.spreadSpectrum = inputStream.readUShort(); 37 | this.major = inputStream.readUShort(); 38 | this.detail = inputStream.readUShort(); 39 | this.system = inputStream.readUShort(); 40 | }; 41 | 42 | dis.ModulationType.prototype.encodeToBinary = function(outputStream) 43 | { 44 | outputStream.writeUShort(this.spreadSpectrum); 45 | outputStream.writeUShort(this.major); 46 | outputStream.writeUShort(this.detail); 47 | outputStream.writeUShort(this.system); 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.ModulationType = dis.ModulationType; 53 | 54 | // End of ModulationType class 55 | 56 | -------------------------------------------------------------------------------- /src/dis/NamedLocation.js: -------------------------------------------------------------------------------- 1 | /** 2 | * discrete ostional relationsihip 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.NamedLocation = function() 21 | { 22 | /** station name enumeration */ 23 | this.stationName = 0; 24 | 25 | /** station number */ 26 | this.stationNumber = 0; 27 | 28 | dis.NamedLocation.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.stationName = inputStream.readUShort(); 31 | this.stationNumber = inputStream.readUShort(); 32 | }; 33 | 34 | dis.NamedLocation.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeUShort(this.stationName); 37 | outputStream.writeUShort(this.stationNumber); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.NamedLocation = dis.NamedLocation; 43 | 44 | // End of NamedLocation class 45 | 46 | -------------------------------------------------------------------------------- /src/dis/ObjectType.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Identifies type of object. This is a shorter version of EntityType that omits the specific and extra fields. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ObjectType = function() 21 | { 22 | /** Kind of entity */ 23 | this.entityKind = 0; 24 | 25 | /** Domain of entity (air, surface, subsurface, space, etc) */ 26 | this.domain = 0; 27 | 28 | /** country to which the design of the entity is attributed */ 29 | this.country = 0; 30 | 31 | /** category of entity */ 32 | this.category = 0; 33 | 34 | /** subcategory of entity */ 35 | this.subcategory = 0; 36 | 37 | dis.ObjectType.prototype.initFromBinary = function(inputStream) 38 | { 39 | this.entityKind = inputStream.readUByte(); 40 | this.domain = inputStream.readUByte(); 41 | this.country = inputStream.readUShort(); 42 | this.category = inputStream.readUByte(); 43 | this.subcategory = inputStream.readUByte(); 44 | }; 45 | 46 | dis.ObjectType.prototype.encodeToBinary = function(outputStream) 47 | { 48 | outputStream.writeUByte(this.entityKind); 49 | outputStream.writeUByte(this.domain); 50 | outputStream.writeUShort(this.country); 51 | outputStream.writeUByte(this.category); 52 | outputStream.writeUByte(this.subcategory); 53 | }; 54 | }; // end of class 55 | 56 | // node.js module support 57 | exports.ObjectType = dis.ObjectType; 58 | 59 | // End of ObjectType class 60 | 61 | -------------------------------------------------------------------------------- /src/dis/Orientation.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.17. Three floating point values representing an orientation, psi, theta, and phi, aka the euler angles, in radians 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Orientation = function() 21 | { 22 | this.psi = 0; 23 | 24 | this.theta = 0; 25 | 26 | this.phi = 0; 27 | 28 | dis.Orientation.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.psi = inputStream.readFloat32(); 31 | this.theta = inputStream.readFloat32(); 32 | this.phi = inputStream.readFloat32(); 33 | }; 34 | 35 | dis.Orientation.prototype.encodeToBinary = function(outputStream) 36 | { 37 | outputStream.writeFloat32(this.psi); 38 | outputStream.writeFloat32(this.theta); 39 | outputStream.writeFloat32(this.phi); 40 | }; 41 | }; // end of class 42 | 43 | // node.js module support 44 | exports.Orientation = dis.Orientation; 45 | 46 | // End of Orientation class 47 | 48 | -------------------------------------------------------------------------------- /src/dis/PduContainer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A container that holds PDUs 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.PduContainer = function() 21 | { 22 | /** Number of PDUs in the container list */ 23 | this.numberOfPdus = 0; 24 | 25 | /** List of PDUs */ 26 | this.pdus = new Array(); 27 | 28 | dis.PduContainer.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.numberOfPdus = inputStream.readInt(); 31 | for(var idx = 0; idx < this.numberOfPdus; idx++) 32 | { 33 | var anX = new dis.Pdu(); 34 | anX.initFromBinary(inputStream); 35 | this.pdus.push(anX); 36 | } 37 | 38 | }; 39 | 40 | dis.PduContainer.prototype.encodeToBinary = function(outputStream) 41 | { 42 | outputStream.writeInt(this.numberOfPdus); 43 | for(var idx = 0; idx < this.pdus.length; idx++) 44 | { 45 | this.pdus[idx].encodeToBinary(outputStream); 46 | } 47 | 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.PduContainer = dis.PduContainer; 53 | 54 | // End of PduContainer class 55 | 56 | -------------------------------------------------------------------------------- /src/dis/Point.js: -------------------------------------------------------------------------------- 1 | /** 2 | * x,y point 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Point = function() 21 | { 22 | /** x */ 23 | this.x = 0; 24 | 25 | /** y */ 26 | this.y = 0; 27 | 28 | dis.Point.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.x = inputStream.readFloat32(); 31 | this.y = inputStream.readFloat32(); 32 | }; 33 | 34 | dis.Point.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeFloat32(this.x); 37 | outputStream.writeFloat32(this.y); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.Point = dis.Point; 43 | 44 | // End of Point class 45 | 46 | -------------------------------------------------------------------------------- /src/dis/PropulsionSystemData.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Data about a propulsion system 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.PropulsionSystemData = function() 21 | { 22 | /** powerSetting */ 23 | this.powerSetting = 0; 24 | 25 | /** engine RPMs */ 26 | this.engineRpm = 0; 27 | 28 | dis.PropulsionSystemData.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.powerSetting = inputStream.readFloat32(); 31 | this.engineRpm = inputStream.readFloat32(); 32 | }; 33 | 34 | dis.PropulsionSystemData.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeFloat32(this.powerSetting); 37 | outputStream.writeFloat32(this.engineRpm); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.PropulsionSystemData = dis.PropulsionSystemData; 43 | 44 | // End of PropulsionSystemData class 45 | 46 | -------------------------------------------------------------------------------- /src/dis/RadioEntityType.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.25. Identifies the type of radio 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.RadioEntityType = function() 21 | { 22 | /** Kind of entity */ 23 | this.entityKind = 0; 24 | 25 | /** Domain of entity (air, surface, subsurface, space, etc) */ 26 | this.domain = 0; 27 | 28 | /** country to which the design of the entity is attributed */ 29 | this.country = 0; 30 | 31 | /** category of entity */ 32 | this.category = 0; 33 | 34 | /** specific info based on subcategory field */ 35 | this.nomenclatureVersion = 0; 36 | 37 | this.nomenclature = 0; 38 | 39 | dis.RadioEntityType.prototype.initFromBinary = function(inputStream) 40 | { 41 | this.entityKind = inputStream.readUByte(); 42 | this.domain = inputStream.readUByte(); 43 | this.country = inputStream.readUShort(); 44 | this.category = inputStream.readUByte(); 45 | this.nomenclatureVersion = inputStream.readUByte(); 46 | this.nomenclature = inputStream.readUShort(); 47 | }; 48 | 49 | dis.RadioEntityType.prototype.encodeToBinary = function(outputStream) 50 | { 51 | outputStream.writeUByte(this.entityKind); 52 | outputStream.writeUByte(this.domain); 53 | outputStream.writeUShort(this.country); 54 | outputStream.writeUByte(this.category); 55 | outputStream.writeUByte(this.nomenclatureVersion); 56 | outputStream.writeUShort(this.nomenclature); 57 | }; 58 | }; // end of class 59 | 60 | // node.js module support 61 | exports.RadioEntityType = dis.RadioEntityType; 62 | 63 | // End of RadioEntityType class 64 | 65 | -------------------------------------------------------------------------------- /src/dis/RecordSet.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Record sets, used in transfer control request PDU 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.RecordSet = function() 21 | { 22 | /** record ID */ 23 | this.recordID = 0; 24 | 25 | /** record set serial number */ 26 | this.recordSetSerialNumber = 0; 27 | 28 | /** record length */ 29 | this.recordLength = 0; 30 | 31 | /** record count */ 32 | this.recordCount = 0; 33 | 34 | /** ^^^This is wrong--variable sized data records */ 35 | this.recordValues = 0; 36 | 37 | /** ^^^This is wrong--variable sized padding */ 38 | this.pad4 = 0; 39 | 40 | dis.RecordSet.prototype.initFromBinary = function(inputStream) 41 | { 42 | this.recordID = inputStream.readUInt(); 43 | this.recordSetSerialNumber = inputStream.readUInt(); 44 | this.recordLength = inputStream.readUShort(); 45 | this.recordCount = inputStream.readUShort(); 46 | this.recordValues = inputStream.readUShort(); 47 | this.pad4 = inputStream.readUByte(); 48 | }; 49 | 50 | dis.RecordSet.prototype.encodeToBinary = function(outputStream) 51 | { 52 | outputStream.writeUInt(this.recordID); 53 | outputStream.writeUInt(this.recordSetSerialNumber); 54 | outputStream.writeUShort(this.recordLength); 55 | outputStream.writeUShort(this.recordCount); 56 | outputStream.writeUShort(this.recordValues); 57 | outputStream.writeUByte(this.pad4); 58 | }; 59 | }; // end of class 60 | 61 | // node.js module support 62 | exports.RecordSet = dis.RecordSet; 63 | 64 | // End of RecordSet class 65 | 66 | -------------------------------------------------------------------------------- /src/dis/Relationship.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 5.2.56. Purpose for joinging two entities 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Relationship = function() 21 | { 22 | /** Nature of join */ 23 | this.nature = 0; 24 | 25 | /** position of join */ 26 | this.position = 0; 27 | 28 | dis.Relationship.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.nature = inputStream.readUShort(); 31 | this.position = inputStream.readUShort(); 32 | }; 33 | 34 | dis.Relationship.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeUShort(this.nature); 37 | outputStream.writeUShort(this.position); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.Relationship = dis.Relationship; 43 | 44 | // End of Relationship class 45 | 46 | -------------------------------------------------------------------------------- /src/dis/ShaftRPMs.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Shaft RPMs, used in underwater acoustic clacluations. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ShaftRPMs = function() 21 | { 22 | /** Current shaft RPMs */ 23 | this.currentShaftRPMs = 0; 24 | 25 | /** ordered shaft rpms */ 26 | this.orderedShaftRPMs = 0; 27 | 28 | /** rate of change of shaft RPMs */ 29 | this.shaftRPMRateOfChange = 0; 30 | 31 | dis.ShaftRPMs.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.currentShaftRPMs = inputStream.readShort(); 34 | this.orderedShaftRPMs = inputStream.readShort(); 35 | this.shaftRPMRateOfChange = inputStream.readFloat32(); 36 | }; 37 | 38 | dis.ShaftRPMs.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeShort(this.currentShaftRPMs); 41 | outputStream.writeShort(this.orderedShaftRPMs); 42 | outputStream.writeFloat32(this.shaftRPMRateOfChange); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.ShaftRPMs = dis.ShaftRPMs; 48 | 49 | // End of ShaftRPMs class 50 | 51 | -------------------------------------------------------------------------------- /src/dis/SimulationAddress.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.14.1. A Simulation Address record shall consist of the Site Identification number and the Application Identification number. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.SimulationAddress = function() 21 | { 22 | /** The site ID */ 23 | this.site = 0; 24 | 25 | /** The application ID */ 26 | this.application = 0; 27 | 28 | dis.SimulationAddress.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.site = inputStream.readUShort(); 31 | this.application = inputStream.readUShort(); 32 | }; 33 | 34 | dis.SimulationAddress.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeUShort(this.site); 37 | outputStream.writeUShort(this.application); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.SimulationAddress = dis.SimulationAddress; 43 | 44 | // End of SimulationAddress class 45 | 46 | -------------------------------------------------------------------------------- /src/dis/SixByteChunk.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 48 bit piece of data 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.SixByteChunk = function() 21 | { 22 | /** six bytes of arbitrary data */ 23 | this.otherParameters = new Array(0, 0, 0, 0, 0, 0); 24 | 25 | dis.SixByteChunk.prototype.initFromBinary = function(inputStream) 26 | { 27 | for(var idx = 0; idx < 6; idx++) 28 | { 29 | this.otherParameters[ idx ] = inputStream.readByte(); 30 | } 31 | }; 32 | 33 | dis.SixByteChunk.prototype.encodeToBinary = function(outputStream) 34 | { 35 | for(var idx = 0; idx < 6; idx++) 36 | { 37 | outputStream.writeByte(this.otherParameters[ idx ] ); 38 | } 39 | }; 40 | }; // end of class 41 | 42 | // node.js module support 43 | exports.SixByteChunk = dis.SixByteChunk; 44 | 45 | // End of SixByteChunk class 46 | 47 | -------------------------------------------------------------------------------- /src/dis/SphericalHarmonicAntennaPattern.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.4.3. Used when the antenna pattern type in the transmitter pdu is of value 2. Specified the direction and radiation pattern from a radio transmitter's antenna. NOTE: this class must be hand-coded to clean up some implementation details. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.SphericalHarmonicAntennaPattern = function() 21 | { 22 | this.harmonicOrder = 0; 23 | 24 | dis.SphericalHarmonicAntennaPattern.prototype.initFromBinary = function(inputStream) 25 | { 26 | this.harmonicOrder = inputStream.readByte(); 27 | }; 28 | 29 | dis.SphericalHarmonicAntennaPattern.prototype.encodeToBinary = function(outputStream) 30 | { 31 | outputStream.writeByte(this.harmonicOrder); 32 | }; 33 | }; // end of class 34 | 35 | // node.js module support 36 | exports.SphericalHarmonicAntennaPattern = dis.SphericalHarmonicAntennaPattern; 37 | 38 | // End of SphericalHarmonicAntennaPattern class 39 | 40 | -------------------------------------------------------------------------------- /src/dis/SupplyQuantity.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.30. A supply, and the amount of that supply. Similar to an entity kind but with the addition of a quantity. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.SupplyQuantity = function() 21 | { 22 | /** Type of supply */ 23 | this.supplyType = new dis.EntityType(); 24 | 25 | /** quantity to be supplied */ 26 | this.quantity = 0; 27 | 28 | dis.SupplyQuantity.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.supplyType.initFromBinary(inputStream); 31 | this.quantity = inputStream.readUByte(); 32 | }; 33 | 34 | dis.SupplyQuantity.prototype.encodeToBinary = function(outputStream) 35 | { 36 | this.supplyType.encodeToBinary(outputStream); 37 | outputStream.writeUByte(this.quantity); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.SupplyQuantity = dis.SupplyQuantity; 43 | 44 | // End of SupplyQuantity class 45 | 46 | -------------------------------------------------------------------------------- /src/dis/SystemID.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 5.2.58. Used in IFF ATC PDU 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.SystemID = function() 21 | { 22 | /** System Type */ 23 | this.systemType = 0; 24 | 25 | /** System name, an enumeration */ 26 | this.systemName = 0; 27 | 28 | /** System mode */ 29 | this.systemMode = 0; 30 | 31 | /** Change Options */ 32 | this.changeOptions = 0; 33 | 34 | dis.SystemID.prototype.initFromBinary = function(inputStream) 35 | { 36 | this.systemType = inputStream.readUShort(); 37 | this.systemName = inputStream.readUShort(); 38 | this.systemMode = inputStream.readUByte(); 39 | this.changeOptions = inputStream.readUByte(); 40 | }; 41 | 42 | dis.SystemID.prototype.encodeToBinary = function(outputStream) 43 | { 44 | outputStream.writeUShort(this.systemType); 45 | outputStream.writeUShort(this.systemName); 46 | outputStream.writeUByte(this.systemMode); 47 | outputStream.writeUByte(this.changeOptions); 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.SystemID = dis.SystemID; 53 | 54 | // End of SystemID class 55 | 56 | -------------------------------------------------------------------------------- /src/dis/TrackJamTarget.js: -------------------------------------------------------------------------------- 1 | /** 2 | * One track/jam target 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.TrackJamTarget = function() 21 | { 22 | /** track/jam target */ 23 | this.trackJam = new dis.EntityID(); 24 | 25 | /** Emitter ID */ 26 | this.emitterID = 0; 27 | 28 | /** beam ID */ 29 | this.beamID = 0; 30 | 31 | dis.TrackJamTarget.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.trackJam.initFromBinary(inputStream); 34 | this.emitterID = inputStream.readUByte(); 35 | this.beamID = inputStream.readUByte(); 36 | }; 37 | 38 | dis.TrackJamTarget.prototype.encodeToBinary = function(outputStream) 39 | { 40 | this.trackJam.encodeToBinary(outputStream); 41 | outputStream.writeUByte(this.emitterID); 42 | outputStream.writeUByte(this.beamID); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.TrackJamTarget = dis.TrackJamTarget; 48 | 49 | // End of TrackJamTarget class 50 | 51 | -------------------------------------------------------------------------------- /src/dis/UnsignedIntegerWrapper.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Wrapper for an unsigned 32 bit integer 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.UnsignedIntegerWrapper = function() 21 | { 22 | /** name can't be too accurate or the generated source code will have reserved word problems */ 23 | this.wrapper = 0; 24 | 25 | dis.UnsignedIntegerWrapper.prototype.initFromBinary = function(inputStream) 26 | { 27 | this.wrapper = inputStream.readUInt(); 28 | }; 29 | 30 | dis.UnsignedIntegerWrapper.prototype.encodeToBinary = function(outputStream) 31 | { 32 | outputStream.writeUInt(this.wrapper); 33 | }; 34 | }; // end of class 35 | 36 | // node.js module support 37 | exports.UnsignedIntegerWrapper = dis.UnsignedIntegerWrapper; 38 | 39 | // End of UnsignedIntegerWrapper class 40 | 41 | -------------------------------------------------------------------------------- /src/dis/Vector3Double.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.3.34. Three double precision floating point values, x, y, and z 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Vector3Double = function() 21 | { 22 | /** X value */ 23 | this.x = 0; 24 | 25 | /** Y value */ 26 | this.y = 0; 27 | 28 | /** Z value */ 29 | this.z = 0; 30 | 31 | dis.Vector3Double.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.x = inputStream.readFloat64(); 34 | this.y = inputStream.readFloat64(); 35 | this.z = inputStream.readFloat64(); 36 | }; 37 | 38 | dis.Vector3Double.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeFloat64(this.x); 41 | outputStream.writeFloat64(this.y); 42 | outputStream.writeFloat64(this.z); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.Vector3Double = dis.Vector3Double; 48 | 49 | // End of Vector3Double class 50 | 51 | -------------------------------------------------------------------------------- /src/dis/Vector3Float.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Section 5.2.33. Three floating point values, x, y, and z 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Vector3Float = function() 21 | { 22 | /** X value */ 23 | this.x = 0; 24 | 25 | /** y Value */ 26 | this.y = 0; 27 | 28 | /** Z value */ 29 | this.z = 0; 30 | 31 | dis.Vector3Float.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.x = inputStream.readFloat32(); 34 | this.y = inputStream.readFloat32(); 35 | this.z = inputStream.readFloat32(); 36 | }; 37 | 38 | dis.Vector3Float.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeFloat32(this.x); 41 | outputStream.writeFloat32(this.y); 42 | outputStream.writeFloat32(this.z); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.Vector3Float = dis.Vector3Float; 48 | 49 | // End of Vector3Float class 50 | 51 | -------------------------------------------------------------------------------- /src/dis/VectoringNozzleSystemData.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Data about a vectoring nozzle system 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.VectoringNozzleSystemData = function() 21 | { 22 | /** horizontal deflection angle */ 23 | this.horizontalDeflectionAngle = 0; 24 | 25 | /** vertical deflection angle */ 26 | this.verticalDeflectionAngle = 0; 27 | 28 | dis.VectoringNozzleSystemData.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.horizontalDeflectionAngle = inputStream.readFloat32(); 31 | this.verticalDeflectionAngle = inputStream.readFloat32(); 32 | }; 33 | 34 | dis.VectoringNozzleSystemData.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeFloat32(this.horizontalDeflectionAngle); 37 | outputStream.writeFloat32(this.verticalDeflectionAngle); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.VectoringNozzleSystemData = dis.VectoringNozzleSystemData; 43 | 44 | // End of VectoringNozzleSystemData class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/AcousticEmitter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * information about a specific UA emmtter. Section 6.2.2. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.AcousticEmitter = function() 21 | { 22 | /** the system for a particular UA emitter, and an enumeration */ 23 | this.acousticSystemName = 0; 24 | 25 | /** The function of the acoustic system */ 26 | this.acousticFunction = 0; 27 | 28 | /** The UA emitter identification number relative to a specific system */ 29 | this.acousticIDNumber = 0; 30 | 31 | dis.AcousticEmitter.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.acousticSystemName = inputStream.readUShort(); 34 | this.acousticFunction = inputStream.readUByte(); 35 | this.acousticIDNumber = inputStream.readUByte(); 36 | }; 37 | 38 | dis.AcousticEmitter.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeUShort(this.acousticSystemName); 41 | outputStream.writeUByte(this.acousticFunction); 42 | outputStream.writeUByte(this.acousticIDNumber); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.AcousticEmitter = dis.AcousticEmitter; 48 | 49 | // End of AcousticEmitter class 50 | 51 | -------------------------------------------------------------------------------- /src/dis7/AggregateIdentifier.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The unique designation of each aggrgate in an exercise is specified by an aggregate identifier record. The aggregate ID is not an entity and shall not be treated as such. Section 6.2.3. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.AggregateIdentifier = function() 21 | { 22 | /** Simulation address, ie site and application, the first two fields of the entity ID */ 23 | this.simulationAddress = new dis.SimulationAddress(); 24 | 25 | /** the aggregate ID, an object identifier */ 26 | this.aggregateID = 0; 27 | 28 | dis.AggregateIdentifier.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.simulationAddress.initFromBinary(inputStream); 31 | this.aggregateID = inputStream.readUShort(); 32 | }; 33 | 34 | dis.AggregateIdentifier.prototype.encodeToBinary = function(outputStream) 35 | { 36 | this.simulationAddress.encodeToBinary(outputStream); 37 | outputStream.writeUShort(this.aggregateID); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.AggregateIdentifier = dis.AggregateIdentifier; 43 | 44 | // End of AggregateIdentifier class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/AggregateMarking.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Specifies the character set used in the first byte, followed by up to 31 characters of text data. Section 6.2.4. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.AggregateMarking = function() 21 | { 22 | /** The character set */ 23 | this.characterSet = 0; 24 | 25 | /** The characters */ 26 | this.characters = 0; 27 | 28 | dis.AggregateMarking.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.characterSet = inputStream.readUByte(); 31 | this.characters = inputStream.readUByte(); 32 | }; 33 | 34 | dis.AggregateMarking.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeUByte(this.characterSet); 37 | outputStream.writeUByte(this.characters); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.AggregateMarking = dis.AggregateMarking; 43 | 44 | // End of AggregateMarking class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/AngularVelocityVector.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Angular velocity measured in radians per second out each of the entity's own coordinate axes. Order of measurement is angular velocity around the x, y, and z axis of the entity. The positive direction is determined by the right hand rule. Section 6.2.7 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.AngularVelocityVector = function() 21 | { 22 | /** velocity about the x axis */ 23 | this.x = 0; 24 | 25 | /** velocity about the y axis */ 26 | this.y = 0; 27 | 28 | /** velocity about the zaxis */ 29 | this.z = 0; 30 | 31 | dis.AngularVelocityVector.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.x = inputStream.readFloat32(); 34 | this.y = inputStream.readFloat32(); 35 | this.z = inputStream.readFloat32(); 36 | }; 37 | 38 | dis.AngularVelocityVector.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeFloat32(this.x); 41 | outputStream.writeFloat32(this.y); 42 | outputStream.writeFloat32(this.z); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.AngularVelocityVector = dis.AngularVelocityVector; 48 | 49 | // End of AngularVelocityVector class 50 | 51 | -------------------------------------------------------------------------------- /src/dis7/AntennaLocation.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Location of the radiating portion of the antenna, specified in world coordinates and entity coordinates. Section 6.2.8 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.AntennaLocation = function() 21 | { 22 | /** Location of the radiating portion of the antenna in world coordinates */ 23 | this.antennaLocation = new dis.Vector3Double(); 24 | 25 | /** Location of the radiating portion of the antenna in entity coordinates */ 26 | this.relativeAntennaLocation = new dis.Vector3Float(); 27 | 28 | dis.AntennaLocation.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.antennaLocation.initFromBinary(inputStream); 31 | this.relativeAntennaLocation.initFromBinary(inputStream); 32 | }; 33 | 34 | dis.AntennaLocation.prototype.encodeToBinary = function(outputStream) 35 | { 36 | this.antennaLocation.encodeToBinary(outputStream); 37 | this.relativeAntennaLocation.encodeToBinary(outputStream); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.AntennaLocation = dis.AntennaLocation; 43 | 44 | // End of AntennaLocation class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/Association.js: -------------------------------------------------------------------------------- 1 | /** 2 | * An entity's associations with other entities and/or locations. For each association, this record shall specify the type of the association, the associated entity's EntityID and/or the associated location's world coordinates. This record may be used (optionally) in a transfer transaction to send internal state data from the divesting simulation to the acquiring simulation (see 5.9.4). This record may also be used for other purposes. Section 6.2.9 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Association = function() 21 | { 22 | this.associationType = 0; 23 | 24 | this.padding4 = 0; 25 | 26 | /** identity of associated entity. If none, NO_SPECIFIC_ENTITY */ 27 | this.associatedEntityID = new dis.EntityID(); 28 | 29 | /** location, in world coordinates */ 30 | this.associatedLocation = new dis.Vector3Double(); 31 | 32 | dis.Association.prototype.initFromBinary = function(inputStream) 33 | { 34 | this.associationType = inputStream.readUByte(); 35 | this.padding4 = inputStream.readUByte(); 36 | this.associatedEntityID.initFromBinary(inputStream); 37 | this.associatedLocation.initFromBinary(inputStream); 38 | }; 39 | 40 | dis.Association.prototype.encodeToBinary = function(outputStream) 41 | { 42 | outputStream.writeUByte(this.associationType); 43 | outputStream.writeUByte(this.padding4); 44 | this.associatedEntityID.encodeToBinary(outputStream); 45 | this.associatedLocation.encodeToBinary(outputStream); 46 | }; 47 | }; // end of class 48 | 49 | // node.js module support 50 | exports.Association = dis.Association; 51 | 52 | // End of Association class 53 | 54 | -------------------------------------------------------------------------------- /src/dis7/Attribute.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Used to convey information for one or more attributes. Attributes conform to the standard variable record format of 6.2.82. Section 6.2.10. NOT COMPLETE 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Attribute = function() 21 | { 22 | this.recordType = 0; 23 | 24 | this.recordLength = 0; 25 | 26 | this.recordSpecificFields = 0; 27 | 28 | dis.Attribute.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.recordType = inputStream.readUInt(); 31 | this.recordLength = inputStream.readUShort(); 32 | this.recordSpecificFields = inputStream.readLong(); 33 | }; 34 | 35 | dis.Attribute.prototype.encodeToBinary = function(outputStream) 36 | { 37 | outputStream.writeUInt(this.recordType); 38 | outputStream.writeUShort(this.recordLength); 39 | outputStream.writeLong(this.recordSpecificFields); 40 | }; 41 | }; // end of class 42 | 43 | // node.js module support 44 | exports.Attribute = dis.Attribute; 45 | 46 | // End of Attribute class 47 | 48 | -------------------------------------------------------------------------------- /src/dis7/BeamStatus.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Information related to the status of a beam. This is contained in the beam status field of the electromagnitec emission PDU. The first bit determines whether the beam is active (0) or deactivated (1). Section 6.2.12. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.BeamStatus = function() 21 | { 22 | /** First bit zero means beam is active, first bit = 1 means deactivated. The rest is padding. */ 23 | this.beamState = 0; 24 | 25 | dis.BeamStatus.prototype.initFromBinary = function(inputStream) 26 | { 27 | this.beamState = inputStream.readUByte(); 28 | }; 29 | 30 | dis.BeamStatus.prototype.encodeToBinary = function(outputStream) 31 | { 32 | outputStream.writeUByte(this.beamState); 33 | }; 34 | 35 | /** 0 active, 1 deactivated */ 36 | dis.BeamStatus.prototype.getBeamState_beamState = function() 37 | { 38 | var val = this.beamState & 0x1; 39 | return val >> 0; 40 | }; 41 | 42 | 43 | /** 0 active, 1 deactivated */ 44 | dis.BeamStatus.prototype.setBeamState_beamState= function(val) 45 | { 46 | this.beamState &= ~0x1; // Zero existing bits 47 | val = val << 0; 48 | this.beamState = this.beamState | val; 49 | }; 50 | 51 | 52 | /** padding */ 53 | dis.BeamStatus.prototype.getBeamState_padding = function() 54 | { 55 | var val = this.beamState & 0xFE; 56 | return val >> 1; 57 | }; 58 | 59 | 60 | /** padding */ 61 | dis.BeamStatus.prototype.setBeamState_padding= function(val) 62 | { 63 | this.beamState &= ~0xFE; // Zero existing bits 64 | val = val << 1; 65 | this.beamState = this.beamState | val; 66 | }; 67 | 68 | }; // end of class 69 | 70 | // node.js module support 71 | exports.BeamStatus = dis.BeamStatus; 72 | 73 | // End of BeamStatus class 74 | 75 | -------------------------------------------------------------------------------- /src/dis7/ChangeOptions.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is wrong and breaks serialization. See section 6.2.13 aka B.2.41 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ChangeOptions = function() 21 | { 22 | dis.ChangeOptions.prototype.initFromBinary = function(inputStream) 23 | { 24 | }; 25 | 26 | dis.ChangeOptions.prototype.encodeToBinary = function(outputStream) 27 | { 28 | }; 29 | }; // end of class 30 | 31 | // node.js module support 32 | exports.ChangeOptions = dis.ChangeOptions; 33 | 34 | // End of ChangeOptions class 35 | 36 | -------------------------------------------------------------------------------- /src/dis7/ClockTime.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Time measurements that exceed one hour are represented by this record. The first field is the hours since the unix epoch (Jan 1 1970, used by most Unix systems and java) and the second field the timestamp units since the top of the hour. Section 6.2.14 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ClockTime = function() 21 | { 22 | /** Hours since midnight, 1970, UTC */ 23 | this.hour = 0; 24 | 25 | /** Time past the hour, in timestamp form */ 26 | this.timePastHour = new dis.Timestamp(); 27 | 28 | dis.ClockTime.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.hour = inputStream.readUInt(); 31 | this.timePastHour.initFromBinary(inputStream); 32 | }; 33 | 34 | dis.ClockTime.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeUInt(this.hour); 37 | this.timePastHour.encodeToBinary(outputStream); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.ClockTime = dis.ClockTime; 43 | 44 | // End of ClockTime class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/CommunicationsNodeID.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Identity of a communications node. Section 6.2.48.4 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.CommunicationsNodeID = function() 21 | { 22 | this.entityID = new dis.EntityID(); 23 | 24 | this.elementID = 0; 25 | 26 | dis.CommunicationsNodeID.prototype.initFromBinary = function(inputStream) 27 | { 28 | this.entityID.initFromBinary(inputStream); 29 | this.elementID = inputStream.readUShort(); 30 | }; 31 | 32 | dis.CommunicationsNodeID.prototype.encodeToBinary = function(outputStream) 33 | { 34 | this.entityID.encodeToBinary(outputStream); 35 | outputStream.writeUShort(this.elementID); 36 | }; 37 | }; // end of class 38 | 39 | // node.js module support 40 | exports.CommunicationsNodeID = dis.CommunicationsNodeID; 41 | 42 | // End of CommunicationsNodeID class 43 | 44 | -------------------------------------------------------------------------------- /src/dis7/DataQueryDatumSpecification.js: -------------------------------------------------------------------------------- 1 | /** 2 | * List of fixed and variable datum ID records. Section 6.2.17 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.DataQueryDatumSpecification = function() 21 | { 22 | /** Number of fixed datum IDs */ 23 | this.numberOfFixedDatums = 0; 24 | 25 | /** Number of variable datum IDs */ 26 | this.numberOfVariableDatums = 0; 27 | 28 | /** variable length list fixed datum IDs */ 29 | this.fixedDatumIDList = new dis.UnsignedDISInteger(); 30 | 31 | /** variable length list variable datum IDs */ 32 | this.variableDatumIDList = new dis.UnsignedDISInteger(); 33 | 34 | dis.DataQueryDatumSpecification.prototype.initFromBinary = function(inputStream) 35 | { 36 | this.numberOfFixedDatums = inputStream.readUInt(); 37 | this.numberOfVariableDatums = inputStream.readUInt(); 38 | this.fixedDatumIDList.initFromBinary(inputStream); 39 | this.variableDatumIDList.initFromBinary(inputStream); 40 | }; 41 | 42 | dis.DataQueryDatumSpecification.prototype.encodeToBinary = function(outputStream) 43 | { 44 | outputStream.writeUInt(this.numberOfFixedDatums); 45 | outputStream.writeUInt(this.numberOfVariableDatums); 46 | this.fixedDatumIDList.encodeToBinary(outputStream); 47 | this.variableDatumIDList.encodeToBinary(outputStream); 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.DataQueryDatumSpecification = dis.DataQueryDatumSpecification; 53 | 54 | // End of DataQueryDatumSpecification class 55 | 56 | -------------------------------------------------------------------------------- /src/dis7/DatumSpecification.js: -------------------------------------------------------------------------------- 1 | /** 2 | * List of fixed and variable datum records. Section 6.2.18 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.DatumSpecification = function() 21 | { 22 | /** Number of fixed datums */ 23 | this.numberOfFixedDatums = 0; 24 | 25 | /** Number of variable datums */ 26 | this.numberOfVariableDatums = 0; 27 | 28 | /** variable length list fixed datums */ 29 | this.fixedDatumList = new dis.FixedDatum(); 30 | 31 | /** variable length list variable datums. See 6.2.93 */ 32 | this.variableDatumList = new dis.VariableDatum(); 33 | 34 | dis.DatumSpecification.prototype.initFromBinary = function(inputStream) 35 | { 36 | this.numberOfFixedDatums = inputStream.readUInt(); 37 | this.numberOfVariableDatums = inputStream.readUInt(); 38 | this.fixedDatumList.initFromBinary(inputStream); 39 | this.variableDatumList.initFromBinary(inputStream); 40 | }; 41 | 42 | dis.DatumSpecification.prototype.encodeToBinary = function(outputStream) 43 | { 44 | outputStream.writeUInt(this.numberOfFixedDatums); 45 | outputStream.writeUInt(this.numberOfVariableDatums); 46 | this.fixedDatumList.encodeToBinary(outputStream); 47 | this.variableDatumList.encodeToBinary(outputStream); 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.DatumSpecification = dis.DatumSpecification; 53 | 54 | // End of DatumSpecification class 55 | 56 | -------------------------------------------------------------------------------- /src/dis7/DirectedEnergyTargetEnergyDeposition.js: -------------------------------------------------------------------------------- 1 | /** 2 | * DE energy depostion properties for a target entity. Section 6.2.20.4 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.DirectedEnergyTargetEnergyDeposition = function() 21 | { 22 | /** Unique ID of the target entity. */ 23 | this.targetEntityID = new dis.EntityID(); 24 | 25 | /** padding */ 26 | this.padding = 0; 27 | 28 | /** Peak irrandiance */ 29 | this.peakIrradiance = 0; 30 | 31 | dis.DirectedEnergyTargetEnergyDeposition.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.targetEntityID.initFromBinary(inputStream); 34 | this.padding = inputStream.readUShort(); 35 | this.peakIrradiance = inputStream.readFloat32(); 36 | }; 37 | 38 | dis.DirectedEnergyTargetEnergyDeposition.prototype.encodeToBinary = function(outputStream) 39 | { 40 | this.targetEntityID.encodeToBinary(outputStream); 41 | outputStream.writeUShort(this.padding); 42 | outputStream.writeFloat32(this.peakIrradiance); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.DirectedEnergyTargetEnergyDeposition = dis.DirectedEnergyTargetEnergyDeposition; 48 | 49 | // End of DirectedEnergyTargetEnergyDeposition class 50 | 51 | -------------------------------------------------------------------------------- /src/dis7/EmitterSystem.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This field shall specify information about a particular emitter system. Section 6.2.23. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.EmitterSystem = function() 21 | { 22 | /** Name of the emitter, 16 bit enumeration */ 23 | this.emitterName = 0; 24 | 25 | /** function of the emitter, 8 bit enumeration */ 26 | this.emitterFunction = 0; 27 | 28 | /** emitter ID, 8 bit enumeration */ 29 | this.emitterIDNumber = 0; 30 | 31 | dis.EmitterSystem.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.emitterName = inputStream.readUShort(); 34 | this.emitterFunction = inputStream.readUByte(); 35 | this.emitterIDNumber = inputStream.readUByte(); 36 | }; 37 | 38 | dis.EmitterSystem.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeUShort(this.emitterName); 41 | outputStream.writeUByte(this.emitterFunction); 42 | outputStream.writeUByte(this.emitterIDNumber); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.EmitterSystem = dis.EmitterSystem; 48 | 49 | // End of EmitterSystem class 50 | 51 | -------------------------------------------------------------------------------- /src/dis7/EngineFuel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Information about an entity's engine fuel. Section 6.2.24. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.EngineFuel = function() 21 | { 22 | /** Fuel quantity, units specified by next field */ 23 | this.fuelQuantity = 0; 24 | 25 | /** Units in which the fuel is measured */ 26 | this.fuelMeasurementUnits = 0; 27 | 28 | /** Type of fuel */ 29 | this.fuelType = 0; 30 | 31 | /** Location of fuel as related to entity. See section 14 of EBV document */ 32 | this.fuelLocation = 0; 33 | 34 | /** padding */ 35 | this.padding = 0; 36 | 37 | dis.EngineFuel.prototype.initFromBinary = function(inputStream) 38 | { 39 | this.fuelQuantity = inputStream.readUInt(); 40 | this.fuelMeasurementUnits = inputStream.readUByte(); 41 | this.fuelType = inputStream.readUByte(); 42 | this.fuelLocation = inputStream.readUByte(); 43 | this.padding = inputStream.readUByte(); 44 | }; 45 | 46 | dis.EngineFuel.prototype.encodeToBinary = function(outputStream) 47 | { 48 | outputStream.writeUInt(this.fuelQuantity); 49 | outputStream.writeUByte(this.fuelMeasurementUnits); 50 | outputStream.writeUByte(this.fuelType); 51 | outputStream.writeUByte(this.fuelLocation); 52 | outputStream.writeUByte(this.padding); 53 | }; 54 | }; // end of class 55 | 56 | // node.js module support 57 | exports.EngineFuel = dis.EngineFuel; 58 | 59 | // End of EngineFuel class 60 | 61 | -------------------------------------------------------------------------------- /src/dis7/EntityID.js: -------------------------------------------------------------------------------- 1 | /** 2 | * more laconically named EntityIdentifier 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.EntityID = function() 21 | { 22 | /** Site ID */ 23 | this.siteID = 0; 24 | 25 | /** application number ID */ 26 | this.applicationID = 0; 27 | 28 | /** Entity number ID */ 29 | this.entityID = 0; 30 | 31 | dis.EntityID.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.siteID = inputStream.readUShort(); 34 | this.applicationID = inputStream.readUShort(); 35 | this.entityID = inputStream.readUShort(); 36 | }; 37 | 38 | dis.EntityID.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeUShort(this.siteID); 41 | outputStream.writeUShort(this.applicationID); 42 | outputStream.writeUShort(this.entityID); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.EntityID = dis.EntityID; 48 | 49 | // End of EntityID class 50 | 51 | -------------------------------------------------------------------------------- /src/dis7/EntityIdentifier.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Entity Identifier. Unique ID for entities in the world. Consists of an simulation address and a entity number. Section 6.2.28. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.EntityIdentifier = function() 21 | { 22 | /** Site and application IDs */ 23 | this.simulationAddress = new dis.SimulationAddress(); 24 | 25 | /** Entity number */ 26 | this.entityNumber = 0; 27 | 28 | dis.EntityIdentifier.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.simulationAddress.initFromBinary(inputStream); 31 | this.entityNumber = inputStream.readUShort(); 32 | }; 33 | 34 | dis.EntityIdentifier.prototype.encodeToBinary = function(outputStream) 35 | { 36 | this.simulationAddress.encodeToBinary(outputStream); 37 | outputStream.writeUShort(this.entityNumber); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.EntityIdentifier = dis.EntityIdentifier; 43 | 44 | // End of EntityIdentifier class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/EntityTypeVP.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Association or disassociation of two entities. Section 6.2.94.5 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.EntityTypeVP = function() 21 | { 22 | /** the identification of the Variable Parameter record. Enumeration from EBV */ 23 | this.recordType = 3; 24 | 25 | /** Indicates if this VP has changed since last issuance */ 26 | this.changeIndicator = 0; 27 | 28 | /** */ 29 | this.entityType = new dis.EntityType(); 30 | 31 | /** padding */ 32 | this.padding = 0; 33 | 34 | /** padding */ 35 | this.padding1 = 0; 36 | 37 | dis.EntityTypeVP.prototype.initFromBinary = function(inputStream) 38 | { 39 | this.recordType = inputStream.readUByte(); 40 | this.changeIndicator = inputStream.readUByte(); 41 | this.entityType.initFromBinary(inputStream); 42 | this.padding = inputStream.readUShort(); 43 | this.padding1 = inputStream.readUInt(); 44 | }; 45 | 46 | dis.EntityTypeVP.prototype.encodeToBinary = function(outputStream) 47 | { 48 | outputStream.writeUByte(this.recordType); 49 | outputStream.writeUByte(this.changeIndicator); 50 | this.entityType.encodeToBinary(outputStream); 51 | outputStream.writeUShort(this.padding); 52 | outputStream.writeUInt(this.padding1); 53 | }; 54 | }; // end of class 55 | 56 | // node.js module support 57 | exports.EntityTypeVP = dis.EntityTypeVP; 58 | 59 | // End of EntityTypeVP class 60 | 61 | -------------------------------------------------------------------------------- /src/dis7/Environment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Incomplete environment record; requires hand coding to fix. Section 6.2.31.1 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Environment = function() 21 | { 22 | /** type */ 23 | this.environmentType = 0; 24 | 25 | /** length, in bits, of the record */ 26 | this.length = 0; 27 | 28 | /** identifies the sequntially numbered record index */ 29 | this.index = 0; 30 | 31 | /** padding */ 32 | this.padding = 0; 33 | 34 | dis.Environment.prototype.initFromBinary = function(inputStream) 35 | { 36 | this.environmentType = inputStream.readUInt(); 37 | this.length = inputStream.readUShort(); 38 | this.index = inputStream.readUByte(); 39 | this.padding = inputStream.readUByte(); 40 | }; 41 | 42 | dis.Environment.prototype.encodeToBinary = function(outputStream) 43 | { 44 | outputStream.writeUInt(this.environmentType); 45 | outputStream.writeUShort(this.length); 46 | outputStream.writeUByte(this.index); 47 | outputStream.writeUByte(this.padding); 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.Environment = dis.Environment; 53 | 54 | // End of Environment class 55 | 56 | -------------------------------------------------------------------------------- /src/dis7/EnvironmentGeneral.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Information about a geometry, a state associated with a geometry, a bounding volume, or an associated entity ID. NOTE: this class requires hand coding. 6.2.31 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.EnvironmentGeneral = function() 21 | { 22 | /** Record type */ 23 | this.environmentType = 0; 24 | 25 | /** length, in bits */ 26 | this.length = 0; 27 | 28 | /** Identify the sequentially numbered record index */ 29 | this.index = 0; 30 | 31 | /** padding */ 32 | this.padding1 = 0; 33 | 34 | /** Geometry or state record */ 35 | this.geometry = 0; 36 | 37 | /** padding to bring the total size up to a 64 bit boundry */ 38 | this.padding2 = 0; 39 | 40 | dis.EnvironmentGeneral.prototype.initFromBinary = function(inputStream) 41 | { 42 | this.environmentType = inputStream.readUInt(); 43 | this.length = inputStream.readUByte(); 44 | this.index = inputStream.readUByte(); 45 | this.padding1 = inputStream.readUByte(); 46 | this.geometry = inputStream.readUByte(); 47 | this.padding2 = inputStream.readUByte(); 48 | }; 49 | 50 | dis.EnvironmentGeneral.prototype.encodeToBinary = function(outputStream) 51 | { 52 | outputStream.writeUInt(this.environmentType); 53 | outputStream.writeUByte(this.length); 54 | outputStream.writeUByte(this.index); 55 | outputStream.writeUByte(this.padding1); 56 | outputStream.writeUByte(this.geometry); 57 | outputStream.writeUByte(this.padding2); 58 | }; 59 | }; // end of class 60 | 61 | // node.js module support 62 | exports.EnvironmentGeneral = dis.EnvironmentGeneral; 63 | 64 | // End of EnvironmentGeneral class 65 | 66 | -------------------------------------------------------------------------------- /src/dis7/EulerAngles.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Three floating point values representing an orientation, psi, theta, and phi, aka the euler angles, in radians. Section 6.2.33 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.EulerAngles = function() 21 | { 22 | this.psi = 0; 23 | 24 | this.theta = 0; 25 | 26 | this.phi = 0; 27 | 28 | dis.EulerAngles.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.psi = inputStream.readFloat32(); 31 | this.theta = inputStream.readFloat32(); 32 | this.phi = inputStream.readFloat32(); 33 | }; 34 | 35 | dis.EulerAngles.prototype.encodeToBinary = function(outputStream) 36 | { 37 | outputStream.writeFloat32(this.psi); 38 | outputStream.writeFloat32(this.theta); 39 | outputStream.writeFloat32(this.phi); 40 | }; 41 | }; // end of class 42 | 43 | // node.js module support 44 | exports.EulerAngles = dis.EulerAngles; 45 | 46 | // End of EulerAngles class 47 | 48 | -------------------------------------------------------------------------------- /src/dis7/EventIdentifier.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Identifies an event in the world. Use this format for every PDU EXCEPT the LiveEntityPdu. Section 6.2.34. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.EventIdentifier = function() 21 | { 22 | /** Site and application IDs */ 23 | this.simulationAddress = new dis.SimulationAddress(); 24 | 25 | this.eventNumber = 0; 26 | 27 | dis.EventIdentifier.prototype.initFromBinary = function(inputStream) 28 | { 29 | this.simulationAddress.initFromBinary(inputStream); 30 | this.eventNumber = inputStream.readUShort(); 31 | }; 32 | 33 | dis.EventIdentifier.prototype.encodeToBinary = function(outputStream) 34 | { 35 | this.simulationAddress.encodeToBinary(outputStream); 36 | outputStream.writeUShort(this.eventNumber); 37 | }; 38 | }; // end of class 39 | 40 | // node.js module support 41 | exports.EventIdentifier = dis.EventIdentifier; 42 | 43 | // End of EventIdentifier class 44 | 45 | -------------------------------------------------------------------------------- /src/dis7/EventIdentifierLiveEntity.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Identifies an event in the world. Use this format for ONLY the LiveEntityPdu. Section 6.2.34. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.EventIdentifierLiveEntity = function() 21 | { 22 | this.siteNumber = 0; 23 | 24 | this.applicationNumber = 0; 25 | 26 | this.eventNumber = 0; 27 | 28 | dis.EventIdentifierLiveEntity.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.siteNumber = inputStream.readUByte(); 31 | this.applicationNumber = inputStream.readUByte(); 32 | this.eventNumber = inputStream.readUShort(); 33 | }; 34 | 35 | dis.EventIdentifierLiveEntity.prototype.encodeToBinary = function(outputStream) 36 | { 37 | outputStream.writeUByte(this.siteNumber); 38 | outputStream.writeUByte(this.applicationNumber); 39 | outputStream.writeUShort(this.eventNumber); 40 | }; 41 | }; // end of class 42 | 43 | // node.js module support 44 | exports.EventIdentifierLiveEntity = dis.EventIdentifierLiveEntity; 45 | 46 | // End of EventIdentifierLiveEntity class 47 | 48 | -------------------------------------------------------------------------------- /src/dis7/Expendable.js: -------------------------------------------------------------------------------- 1 | /** 2 | * An entity's expendable (chaff, flares, etc) information. Section 6.2.36 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Expendable = function() 21 | { 22 | /** Type of expendable */ 23 | this.expendable = new dis.EntityType(); 24 | 25 | this.station = 0; 26 | 27 | this.quantity = 0; 28 | 29 | this.expendableStatus = 0; 30 | 31 | this.padding = 0; 32 | 33 | dis.Expendable.prototype.initFromBinary = function(inputStream) 34 | { 35 | this.expendable.initFromBinary(inputStream); 36 | this.station = inputStream.readUInt(); 37 | this.quantity = inputStream.readUShort(); 38 | this.expendableStatus = inputStream.readUByte(); 39 | this.padding = inputStream.readUByte(); 40 | }; 41 | 42 | dis.Expendable.prototype.encodeToBinary = function(outputStream) 43 | { 44 | this.expendable.encodeToBinary(outputStream); 45 | outputStream.writeUInt(this.station); 46 | outputStream.writeUShort(this.quantity); 47 | outputStream.writeUByte(this.expendableStatus); 48 | outputStream.writeUByte(this.padding); 49 | }; 50 | }; // end of class 51 | 52 | // node.js module support 53 | exports.Expendable = dis.Expendable; 54 | 55 | // End of Expendable class 56 | 57 | -------------------------------------------------------------------------------- /src/dis7/ExpendableDescriptor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Burst of chaff or expendible device. Section 6.2.19.4 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ExpendableDescriptor = function() 21 | { 22 | /** Type of the object that exploded */ 23 | this.expendableType = new dis.EntityType(); 24 | 25 | /** Padding */ 26 | this.padding = 0; 27 | 28 | dis.ExpendableDescriptor.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.expendableType.initFromBinary(inputStream); 31 | this.padding = inputStream.readLong(); 32 | }; 33 | 34 | dis.ExpendableDescriptor.prototype.encodeToBinary = function(outputStream) 35 | { 36 | this.expendableType.encodeToBinary(outputStream); 37 | outputStream.writeLong(this.padding); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.ExpendableDescriptor = dis.ExpendableDescriptor; 43 | 44 | // End of ExpendableDescriptor class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/ExpendableReload.js: -------------------------------------------------------------------------------- 1 | /** 2 | * An entity's expendable (chaff, flares, etc) information. Section 6.2.37 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ExpendableReload = function() 21 | { 22 | /** Type of expendable */ 23 | this.expendable = new dis.EntityType(); 24 | 25 | this.station = 0; 26 | 27 | this.standardQuantity = 0; 28 | 29 | this.maximumQuantity = 0; 30 | 31 | this.standardQuantityReloadTime = 0; 32 | 33 | this.maximumQuantityReloadTime = 0; 34 | 35 | dis.ExpendableReload.prototype.initFromBinary = function(inputStream) 36 | { 37 | this.expendable.initFromBinary(inputStream); 38 | this.station = inputStream.readUInt(); 39 | this.standardQuantity = inputStream.readUShort(); 40 | this.maximumQuantity = inputStream.readUShort(); 41 | this.standardQuantityReloadTime = inputStream.readUInt(); 42 | this.maximumQuantityReloadTime = inputStream.readUInt(); 43 | }; 44 | 45 | dis.ExpendableReload.prototype.encodeToBinary = function(outputStream) 46 | { 47 | this.expendable.encodeToBinary(outputStream); 48 | outputStream.writeUInt(this.station); 49 | outputStream.writeUShort(this.standardQuantity); 50 | outputStream.writeUShort(this.maximumQuantity); 51 | outputStream.writeUInt(this.standardQuantityReloadTime); 52 | outputStream.writeUInt(this.maximumQuantityReloadTime); 53 | }; 54 | }; // end of class 55 | 56 | // node.js module support 57 | exports.ExpendableReload = dis.ExpendableReload; 58 | 59 | // End of ExpendableReload class 60 | 61 | -------------------------------------------------------------------------------- /src/dis7/ExplosionDescriptor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Explosion of a non-munition. Section 6.2.19.3 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ExplosionDescriptor = function() 21 | { 22 | /** Type of the object that exploded. See 6.2.30 */ 23 | this.explodingObject = new dis.EntityType(); 24 | 25 | /** Material that exploded. Can be grain dust, tnt, gasoline, etc. Enumeration */ 26 | this.explosiveMaterial = 0; 27 | 28 | /** padding */ 29 | this.padding = 0; 30 | 31 | /** Force of explosion, in equivalent KG of TNT */ 32 | this.explosiveForce = 0; 33 | 34 | dis.ExplosionDescriptor.prototype.initFromBinary = function(inputStream) 35 | { 36 | this.explodingObject.initFromBinary(inputStream); 37 | this.explosiveMaterial = inputStream.readUShort(); 38 | this.padding = inputStream.readUShort(); 39 | this.explosiveForce = inputStream.readFloat32(); 40 | }; 41 | 42 | dis.ExplosionDescriptor.prototype.encodeToBinary = function(outputStream) 43 | { 44 | this.explodingObject.encodeToBinary(outputStream); 45 | outputStream.writeUShort(this.explosiveMaterial); 46 | outputStream.writeUShort(this.padding); 47 | outputStream.writeFloat32(this.explosiveForce); 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.ExplosionDescriptor = dis.ExplosionDescriptor; 53 | 54 | // End of ExplosionDescriptor class 55 | 56 | -------------------------------------------------------------------------------- /src/dis7/FixedDatum.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Fixed Datum Record. Section 6.2.38 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.FixedDatum = function() 21 | { 22 | /** ID of the fixed datum, an enumeration */ 23 | this.fixedDatumID = 0; 24 | 25 | /** Value for the fixed datum */ 26 | this.fixedDatumValue = 0; 27 | 28 | dis.FixedDatum.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.fixedDatumID = inputStream.readUInt(); 31 | this.fixedDatumValue = inputStream.readUInt(); 32 | }; 33 | 34 | dis.FixedDatum.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeUInt(this.fixedDatumID); 37 | outputStream.writeUInt(this.fixedDatumValue); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.FixedDatum = dis.FixedDatum; 43 | 44 | // End of FixedDatum class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/GroupID.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Unique designation of a group of entities contained in the isGroupOfPdu. Represents a group of entities rather than a single entity. Section 6.2.43 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.GroupID = function() 21 | { 22 | /** Simulation address (site and application number) */ 23 | this.simulationAddress = new dis.EntityType(); 24 | 25 | /** group number */ 26 | this.groupNumber = 0; 27 | 28 | dis.GroupID.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.simulationAddress.initFromBinary(inputStream); 31 | this.groupNumber = inputStream.readUShort(); 32 | }; 33 | 34 | dis.GroupID.prototype.encodeToBinary = function(outputStream) 35 | { 36 | this.simulationAddress.encodeToBinary(outputStream); 37 | outputStream.writeUShort(this.groupNumber); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.GroupID = dis.GroupID; 43 | 44 | // End of GroupID class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/IFFData.js: -------------------------------------------------------------------------------- 1 | /** 2 | * repeating element if IFF Data specification record 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.IFFData = function() 21 | { 22 | /** enumeration for type of record */ 23 | this.recordType = 0; 24 | 25 | /** length of record. Should be padded to 32 bit boundary. */ 26 | this.recordLength = 0; 27 | 28 | /** IFF data. */ 29 | this.iffData = new Array(); 30 | 31 | dis.IFFData.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.recordType = inputStream.readUInt(); 34 | this.recordLength = inputStream.readUShort(); 35 | for(var idx = 0; idx < this.recordLength; idx++) 36 | { 37 | var anX = new dis.Chunk(1); 38 | anX.initFromBinary(inputStream); 39 | this.iffData.push(anX); 40 | } 41 | 42 | }; 43 | 44 | dis.IFFData.prototype.encodeToBinary = function(outputStream) 45 | { 46 | outputStream.writeUInt(this.recordType); 47 | outputStream.writeUShort(this.recordLength); 48 | for(var idx = 0; idx < this.iffData.length; idx++) 49 | { 50 | this.iffData[idx].encodeToBinary(outputStream); 51 | } 52 | 53 | }; 54 | }; // end of class 55 | 56 | // node.js module support 57 | exports.IFFData = dis.IFFData; 58 | 59 | // End of IFFData class 60 | 61 | -------------------------------------------------------------------------------- /src/dis7/IOCommunicationsNode.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A communications node that is part of a simulted communcations network. Section 6.2.49.2 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.IOCommunicationsNode = function() 21 | { 22 | this.recordType = 5501; 23 | 24 | this.recordLength = 16; 25 | 26 | this.communcationsNodeType = 0; 27 | 28 | this.padding = 0; 29 | 30 | this.communicationsNodeID = new dis.CommunicationsNodeID(); 31 | 32 | dis.IOCommunicationsNode.prototype.initFromBinary = function(inputStream) 33 | { 34 | this.recordType = inputStream.readUInt(); 35 | this.recordLength = inputStream.readUShort(); 36 | this.communcationsNodeType = inputStream.readUByte(); 37 | this.padding = inputStream.readUByte(); 38 | this.communicationsNodeID.initFromBinary(inputStream); 39 | }; 40 | 41 | dis.IOCommunicationsNode.prototype.encodeToBinary = function(outputStream) 42 | { 43 | outputStream.writeUInt(this.recordType); 44 | outputStream.writeUShort(this.recordLength); 45 | outputStream.writeUByte(this.communcationsNodeType); 46 | outputStream.writeUByte(this.padding); 47 | this.communicationsNodeID.encodeToBinary(outputStream); 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.IOCommunicationsNode = dis.IOCommunicationsNode; 53 | 54 | // End of IOCommunicationsNode class 55 | 56 | -------------------------------------------------------------------------------- /src/dis7/IffDataSpecification.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Requires hand coding to be useful. Section 6.2.43 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.IffDataSpecification = function() 21 | { 22 | /** Number of iff records */ 23 | this.numberOfIffDataRecords = 0; 24 | 25 | /** IFF data records */ 26 | this.iffDataRecords = new Array(); 27 | 28 | dis.IffDataSpecification.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.numberOfIffDataRecords = inputStream.readUShort(); 31 | for(var idx = 0; idx < this.numberOfIffDataRecords; idx++) 32 | { 33 | var anX = new dis.IFFData(); 34 | anX.initFromBinary(inputStream); 35 | this.iffDataRecords.push(anX); 36 | } 37 | 38 | }; 39 | 40 | dis.IffDataSpecification.prototype.encodeToBinary = function(outputStream) 41 | { 42 | outputStream.writeUShort(this.numberOfIffDataRecords); 43 | for(var idx = 0; idx < this.iffDataRecords.length; idx++) 44 | { 45 | this.iffDataRecords[idx].encodeToBinary(outputStream); 46 | } 47 | 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.IffDataSpecification = dis.IffDataSpecification; 53 | 54 | // End of IffDataSpecification class 55 | 56 | -------------------------------------------------------------------------------- /src/dis7/IntercomCommunicationsParameters.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Intercom communcations parameters. Section 6.2.47. This requires hand coding 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.IntercomCommunicationsParameters = function() 21 | { 22 | /** Type of intercom parameters record */ 23 | this.recordType = 0; 24 | 25 | /** length of record */ 26 | this.recordLength = 0; 27 | 28 | /** This is a placeholder. */ 29 | this.recordSpecificField = 0; 30 | 31 | dis.IntercomCommunicationsParameters.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.recordType = inputStream.readUShort(); 34 | this.recordLength = inputStream.readUShort(); 35 | this.recordSpecificField = inputStream.readUInt(); 36 | }; 37 | 38 | dis.IntercomCommunicationsParameters.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeUShort(this.recordType); 41 | outputStream.writeUShort(this.recordLength); 42 | outputStream.writeUInt(this.recordSpecificField); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.IntercomCommunicationsParameters = dis.IntercomCommunicationsParameters; 48 | 49 | // End of IntercomCommunicationsParameters class 50 | 51 | -------------------------------------------------------------------------------- /src/dis7/IntercomIdentifier.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Unique designation of an attached or unattached intercom in an event or exercirse. Section 6.2.48 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.IntercomIdentifier = function() 21 | { 22 | this.siteNumber = 0; 23 | 24 | this.applicationNumber = 0; 25 | 26 | this.referenceNumber = 0; 27 | 28 | this.intercomNumber = 0; 29 | 30 | dis.IntercomIdentifier.prototype.initFromBinary = function(inputStream) 31 | { 32 | this.siteNumber = inputStream.readUShort(); 33 | this.applicationNumber = inputStream.readUShort(); 34 | this.referenceNumber = inputStream.readUShort(); 35 | this.intercomNumber = inputStream.readUShort(); 36 | }; 37 | 38 | dis.IntercomIdentifier.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeUShort(this.siteNumber); 41 | outputStream.writeUShort(this.applicationNumber); 42 | outputStream.writeUShort(this.referenceNumber); 43 | outputStream.writeUShort(this.intercomNumber); 44 | }; 45 | }; // end of class 46 | 47 | // node.js module support 48 | exports.IntercomIdentifier = dis.IntercomIdentifier; 49 | 50 | // End of IntercomIdentifier class 51 | 52 | -------------------------------------------------------------------------------- /src/dis7/JammingTechnique.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Jamming technique. Section 6.2.49 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.JammingTechnique = function() 21 | { 22 | this.kind = 0; 23 | 24 | this.category = 0; 25 | 26 | this.subcategory = 0; 27 | 28 | this.specific = 0; 29 | 30 | dis.JammingTechnique.prototype.initFromBinary = function(inputStream) 31 | { 32 | this.kind = inputStream.readUByte(); 33 | this.category = inputStream.readUByte(); 34 | this.subcategory = inputStream.readUByte(); 35 | this.specific = inputStream.readUByte(); 36 | }; 37 | 38 | dis.JammingTechnique.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeUByte(this.kind); 41 | outputStream.writeUByte(this.category); 42 | outputStream.writeUByte(this.subcategory); 43 | outputStream.writeUByte(this.specific); 44 | }; 45 | }; // end of class 46 | 47 | // node.js module support 48 | exports.JammingTechnique = dis.JammingTechnique; 49 | 50 | // End of JammingTechnique class 51 | 52 | -------------------------------------------------------------------------------- /src/dis7/LaunchedMunitionRecord.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Identity of a communications node. Section 6.2.50 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.LaunchedMunitionRecord = function() 21 | { 22 | this.fireEventID = new dis.EventIdentifier(); 23 | 24 | this.padding = 0; 25 | 26 | this.firingEntityID = new dis.EventIdentifier(); 27 | 28 | this.padding2 = 0; 29 | 30 | this.targetEntityID = new dis.EventIdentifier(); 31 | 32 | this.padding3 = 0; 33 | 34 | this.targetLocation = new dis.Vector3Double(); 35 | 36 | dis.LaunchedMunitionRecord.prototype.initFromBinary = function(inputStream) 37 | { 38 | this.fireEventID.initFromBinary(inputStream); 39 | this.padding = inputStream.readUShort(); 40 | this.firingEntityID.initFromBinary(inputStream); 41 | this.padding2 = inputStream.readUShort(); 42 | this.targetEntityID.initFromBinary(inputStream); 43 | this.padding3 = inputStream.readUShort(); 44 | this.targetLocation.initFromBinary(inputStream); 45 | }; 46 | 47 | dis.LaunchedMunitionRecord.prototype.encodeToBinary = function(outputStream) 48 | { 49 | this.fireEventID.encodeToBinary(outputStream); 50 | outputStream.writeUShort(this.padding); 51 | this.firingEntityID.encodeToBinary(outputStream); 52 | outputStream.writeUShort(this.padding2); 53 | this.targetEntityID.encodeToBinary(outputStream); 54 | outputStream.writeUShort(this.padding3); 55 | this.targetLocation.encodeToBinary(outputStream); 56 | }; 57 | }; // end of class 58 | 59 | // node.js module support 60 | exports.LaunchedMunitionRecord = dis.LaunchedMunitionRecord; 61 | 62 | // End of LaunchedMunitionRecord class 63 | 64 | -------------------------------------------------------------------------------- /src/dis7/LayerHeader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The identification of the additional information layer number, layer-specific information, and the length of the layer. Section 6.2.51 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.LayerHeader = function() 21 | { 22 | this.layerNumber = 0; 23 | 24 | /** field shall specify layer-specific information that varies by System Type (see 6.2.86) and Layer Number. */ 25 | this.layerSpecificInformation = 0; 26 | 27 | /** This field shall specify the length in octets of the layer, including the Layer Header record */ 28 | this.length = 0; 29 | 30 | dis.LayerHeader.prototype.initFromBinary = function(inputStream) 31 | { 32 | this.layerNumber = inputStream.readUByte(); 33 | this.layerSpecificInformation = inputStream.readUByte(); 34 | this.length = inputStream.readUShort(); 35 | }; 36 | 37 | dis.LayerHeader.prototype.encodeToBinary = function(outputStream) 38 | { 39 | outputStream.writeUByte(this.layerNumber); 40 | outputStream.writeUByte(this.layerSpecificInformation); 41 | outputStream.writeUShort(this.length); 42 | }; 43 | }; // end of class 44 | 45 | // node.js module support 46 | exports.LayerHeader = dis.LayerHeader; 47 | 48 | // End of LayerHeader class 49 | 50 | -------------------------------------------------------------------------------- /src/dis7/LiveEntityIdentifier.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The unique designation of each entity in an event or exercise that is contained in a Live Entity PDU. Section 6.2.54 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.LiveEntityIdentifier = function() 21 | { 22 | /** Live Simulation Address record (see 6.2.54) */ 23 | this.liveSimulationAddress = new dis.LiveSimulationAddress(); 24 | 25 | /** Live entity number */ 26 | this.entityNumber = 0; 27 | 28 | dis.LiveEntityIdentifier.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.liveSimulationAddress.initFromBinary(inputStream); 31 | this.entityNumber = inputStream.readUShort(); 32 | }; 33 | 34 | dis.LiveEntityIdentifier.prototype.encodeToBinary = function(outputStream) 35 | { 36 | this.liveSimulationAddress.encodeToBinary(outputStream); 37 | outputStream.writeUShort(this.entityNumber); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.LiveEntityIdentifier = dis.LiveEntityIdentifier; 43 | 44 | // End of LiveEntityIdentifier class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/LiveSimulationAddress.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A simulation's designation associated with all Live Entity IDs contained in Live Entity PDUs. Section 6.2.55 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.LiveSimulationAddress = function() 21 | { 22 | /** facility, installation, organizational unit or geographic location may have multiple sites associated with it. The Site Number is the first component of the Live Simulation Address, which defines a live simulation. */ 23 | this.liveSiteNumber = 0; 24 | 25 | /** An application associated with a live site is termed a live application. Each live application participating in an event */ 26 | this.liveApplicationNumber = 0; 27 | 28 | dis.LiveSimulationAddress.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.liveSiteNumber = inputStream.readUByte(); 31 | this.liveApplicationNumber = inputStream.readUByte(); 32 | }; 33 | 34 | dis.LiveSimulationAddress.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeUByte(this.liveSiteNumber); 37 | outputStream.writeUByte(this.liveApplicationNumber); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.LiveSimulationAddress = dis.LiveSimulationAddress; 43 | 44 | // End of LiveSimulationAddress class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/MineEntityIdentifier.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The unique designation of a mine contained in the Minefield Data PDU. No espdus are issued for mine entities. Section 6.2.55 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.MineEntityIdentifier = function() 21 | { 22 | /** */ 23 | this.simulationAddress = new dis.SimulationAddress(); 24 | 25 | /** */ 26 | this.mineEntityNumber = 0; 27 | 28 | dis.MineEntityIdentifier.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.simulationAddress.initFromBinary(inputStream); 31 | this.mineEntityNumber = inputStream.readUShort(); 32 | }; 33 | 34 | dis.MineEntityIdentifier.prototype.encodeToBinary = function(outputStream) 35 | { 36 | this.simulationAddress.encodeToBinary(outputStream); 37 | outputStream.writeUShort(this.mineEntityNumber); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.MineEntityIdentifier = dis.MineEntityIdentifier; 43 | 44 | // End of MineEntityIdentifier class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/MinefieldIdentifier.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The unique designation of a minefield Section 6.2.56 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.MinefieldIdentifier = function() 21 | { 22 | /** */ 23 | this.simulationAddress = new dis.SimulationAddress(); 24 | 25 | /** */ 26 | this.minefieldNumber = 0; 27 | 28 | dis.MinefieldIdentifier.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.simulationAddress.initFromBinary(inputStream); 31 | this.minefieldNumber = inputStream.readUShort(); 32 | }; 33 | 34 | dis.MinefieldIdentifier.prototype.encodeToBinary = function(outputStream) 35 | { 36 | this.simulationAddress.encodeToBinary(outputStream); 37 | outputStream.writeUShort(this.minefieldNumber); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.MinefieldIdentifier = dis.MinefieldIdentifier; 43 | 44 | // End of MinefieldIdentifier class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/MinefieldSensorType.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Information about a minefield sensor. Section 6.2.57 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.MinefieldSensorType = function() 21 | { 22 | /** sensor type. bit fields 0-3 are the type category, 4-15 are teh subcategory */ 23 | this.sensorType = 0; 24 | 25 | dis.MinefieldSensorType.prototype.initFromBinary = function(inputStream) 26 | { 27 | this.sensorType = inputStream.readUShort(); 28 | }; 29 | 30 | dis.MinefieldSensorType.prototype.encodeToBinary = function(outputStream) 31 | { 32 | outputStream.writeUShort(this.sensorType); 33 | }; 34 | }; // end of class 35 | 36 | // node.js module support 37 | exports.MinefieldSensorType = dis.MinefieldSensorType; 38 | 39 | // End of MinefieldSensorType class 40 | 41 | -------------------------------------------------------------------------------- /src/dis7/ModulationParameters.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Modulation parameters associated with a specific radio system. INCOMPLETE. 6.2.58 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ModulationParameters = function() 21 | { 22 | dis.ModulationParameters.prototype.initFromBinary = function(inputStream) 23 | { 24 | }; 25 | 26 | dis.ModulationParameters.prototype.encodeToBinary = function(outputStream) 27 | { 28 | }; 29 | }; // end of class 30 | 31 | // node.js module support 32 | exports.ModulationParameters = dis.ModulationParameters; 33 | 34 | // End of ModulationParameters class 35 | 36 | -------------------------------------------------------------------------------- /src/dis7/ModulationType.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Information about the type of modulation used for radio transmission. 6.2.59 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ModulationType = function() 21 | { 22 | /** This field shall indicate the spread spectrum technique or combination of spread spectrum techniques in use. Bit field. 0=freq hopping, 1=psuedo noise, time hopping=2, reamining bits unused */ 23 | this.spreadSpectrum = 0; 24 | 25 | /** the major classification of the modulation type. */ 26 | this.majorModulation = 0; 27 | 28 | /** provide certain detailed information depending upon the major modulation type */ 29 | this.detail = 0; 30 | 31 | /** the radio system associated with this Transmitter PDU and shall be used as the basis to interpret other fields whose values depend on a specific radio system. */ 32 | this.radioSystem = 0; 33 | 34 | dis.ModulationType.prototype.initFromBinary = function(inputStream) 35 | { 36 | this.spreadSpectrum = inputStream.readUShort(); 37 | this.majorModulation = inputStream.readUShort(); 38 | this.detail = inputStream.readUShort(); 39 | this.radioSystem = inputStream.readUShort(); 40 | }; 41 | 42 | dis.ModulationType.prototype.encodeToBinary = function(outputStream) 43 | { 44 | outputStream.writeUShort(this.spreadSpectrum); 45 | outputStream.writeUShort(this.majorModulation); 46 | outputStream.writeUShort(this.detail); 47 | outputStream.writeUShort(this.radioSystem); 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.ModulationType = dis.ModulationType; 53 | 54 | // End of ModulationType class 55 | 56 | -------------------------------------------------------------------------------- /src/dis7/Munition.js: -------------------------------------------------------------------------------- 1 | /** 2 | * An entity's munition (e.g., bomb, missile) information shall be represented by one or more Munition records. For each type or location of munition, this record shall specify the type, location, quantity and status of munitions that an entity contains. Section 6.2.60 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Munition = function() 21 | { 22 | /** This field shall identify the entity type of the munition. See section 6.2.30. */ 23 | this.munitionType = new dis.EntityType(); 24 | 25 | /** the station or launcher to which the munition is assigned. See Annex I */ 26 | this.station = 0; 27 | 28 | /** the quantity remaining of this munition. */ 29 | this.quantity = 0; 30 | 31 | /** the status of the munition. It shall be represented by an 8-bit enumeration. */ 32 | this.munitionStatus = 0; 33 | 34 | /** padding */ 35 | this.padding = 0; 36 | 37 | dis.Munition.prototype.initFromBinary = function(inputStream) 38 | { 39 | this.munitionType.initFromBinary(inputStream); 40 | this.station = inputStream.readUInt(); 41 | this.quantity = inputStream.readUShort(); 42 | this.munitionStatus = inputStream.readUByte(); 43 | this.padding = inputStream.readUByte(); 44 | }; 45 | 46 | dis.Munition.prototype.encodeToBinary = function(outputStream) 47 | { 48 | this.munitionType.encodeToBinary(outputStream); 49 | outputStream.writeUInt(this.station); 50 | outputStream.writeUShort(this.quantity); 51 | outputStream.writeUByte(this.munitionStatus); 52 | outputStream.writeUByte(this.padding); 53 | }; 54 | }; // end of class 55 | 56 | // node.js module support 57 | exports.Munition = dis.Munition; 58 | 59 | // End of Munition class 60 | 61 | -------------------------------------------------------------------------------- /src/dis7/MunitionDescriptor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Represents the firing or detonation of a munition. Section 6.2.19.2 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.MunitionDescriptor = function() 21 | { 22 | /** What munition was used in the burst */ 23 | this.munitionType = new dis.EntityType(); 24 | 25 | /** type of warhead enumeration */ 26 | this.warhead = 0; 27 | 28 | /** type of fuse used enumeration */ 29 | this.fuse = 0; 30 | 31 | /** how many of the munition were fired */ 32 | this.quantity = 0; 33 | 34 | /** rate at which the munition was fired */ 35 | this.rate = 0; 36 | 37 | dis.MunitionDescriptor.prototype.initFromBinary = function(inputStream) 38 | { 39 | this.munitionType.initFromBinary(inputStream); 40 | this.warhead = inputStream.readUShort(); 41 | this.fuse = inputStream.readUShort(); 42 | this.quantity = inputStream.readUShort(); 43 | this.rate = inputStream.readUShort(); 44 | }; 45 | 46 | dis.MunitionDescriptor.prototype.encodeToBinary = function(outputStream) 47 | { 48 | this.munitionType.encodeToBinary(outputStream); 49 | outputStream.writeUShort(this.warhead); 50 | outputStream.writeUShort(this.fuse); 51 | outputStream.writeUShort(this.quantity); 52 | outputStream.writeUShort(this.rate); 53 | }; 54 | }; // end of class 55 | 56 | // node.js module support 57 | exports.MunitionDescriptor = dis.MunitionDescriptor; 58 | 59 | // End of MunitionDescriptor class 60 | 61 | -------------------------------------------------------------------------------- /src/dis7/NamedLocationIdentification.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Information about the discrete positional relationship of the part entity with respect to the its host entity Section 6.2.62 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.NamedLocationIdentification = function() 21 | { 22 | /** the station name within the host at which the part entity is located. If the part entity is On Station, this field shall specify the representation of the part’s location data fields. This field shall be specified by a 16-bit enumeration */ 23 | this.stationName = 0; 24 | 25 | /** the number of the particular wing station, cargo hold etc., at which the part is attached. */ 26 | this.stationNumber = 0; 27 | 28 | dis.NamedLocationIdentification.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.stationName = inputStream.readUShort(); 31 | this.stationNumber = inputStream.readUShort(); 32 | }; 33 | 34 | dis.NamedLocationIdentification.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeUShort(this.stationName); 37 | outputStream.writeUShort(this.stationNumber); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.NamedLocationIdentification = dis.NamedLocationIdentification; 43 | 44 | // End of NamedLocationIdentification class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/ObjectIdentifier.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The unique designation of an environmental object. Section 6.2.63 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ObjectIdentifier = function() 21 | { 22 | /** Simulation Address */ 23 | this.simulationAddress = new dis.SimulationAddress(); 24 | 25 | /** object number */ 26 | this.objectNumber = 0; 27 | 28 | dis.ObjectIdentifier.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.simulationAddress.initFromBinary(inputStream); 31 | this.objectNumber = inputStream.readUShort(); 32 | }; 33 | 34 | dis.ObjectIdentifier.prototype.encodeToBinary = function(outputStream) 35 | { 36 | this.simulationAddress.encodeToBinary(outputStream); 37 | outputStream.writeUShort(this.objectNumber); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.ObjectIdentifier = dis.ObjectIdentifier; 43 | 44 | // End of ObjectIdentifier class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/ObjectType.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The unique designation of an environmental object. Section 6.2.64 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ObjectType = function() 21 | { 22 | /** Domain of entity (air, surface, subsurface, space, etc) */ 23 | this.domain = 0; 24 | 25 | /** country to which the design of the entity is attributed */ 26 | this.objectKind = 0; 27 | 28 | /** category of entity */ 29 | this.category = 0; 30 | 31 | /** subcategory of entity */ 32 | this.subcategory = 0; 33 | 34 | dis.ObjectType.prototype.initFromBinary = function(inputStream) 35 | { 36 | this.domain = inputStream.readUByte(); 37 | this.objectKind = inputStream.readUByte(); 38 | this.category = inputStream.readUByte(); 39 | this.subcategory = inputStream.readUByte(); 40 | }; 41 | 42 | dis.ObjectType.prototype.encodeToBinary = function(outputStream) 43 | { 44 | outputStream.writeUByte(this.domain); 45 | outputStream.writeUByte(this.objectKind); 46 | outputStream.writeUByte(this.category); 47 | outputStream.writeUByte(this.subcategory); 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.ObjectType = dis.ObjectType; 53 | 54 | // End of ObjectType class 55 | 56 | -------------------------------------------------------------------------------- /src/dis7/OwnershipStatus.js: -------------------------------------------------------------------------------- 1 | /** 2 | * used to convey entity and conflict status information associated with transferring ownership of an entity. Section 6.2.65 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.OwnershipStatus = function() 21 | { 22 | /** EntityID */ 23 | this.entityId = new dis.EntityID(); 24 | 25 | /** The ownership and/or ownership conflict status of the entity represented by the Entity ID field. */ 26 | this.ownershipStatus = 0; 27 | 28 | /** padding */ 29 | this.padding = 0; 30 | 31 | dis.OwnershipStatus.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.entityId.initFromBinary(inputStream); 34 | this.ownershipStatus = inputStream.readUByte(); 35 | this.padding = inputStream.readUByte(); 36 | }; 37 | 38 | dis.OwnershipStatus.prototype.encodeToBinary = function(outputStream) 39 | { 40 | this.entityId.encodeToBinary(outputStream); 41 | outputStream.writeUByte(this.ownershipStatus); 42 | outputStream.writeUByte(this.padding); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.OwnershipStatus = dis.OwnershipStatus; 48 | 49 | // End of OwnershipStatus class 50 | 51 | -------------------------------------------------------------------------------- /src/dis7/PduContainer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Used for XML compatability. A container that holds PDUs 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.PduContainer = function() 21 | { 22 | /** Number of PDUs in the container list */ 23 | this.numberOfPdus = 0; 24 | 25 | /** List of PDUs */ 26 | this.pdus = new Array(); 27 | 28 | dis.PduContainer.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.numberOfPdus = inputStream.readInt(); 31 | for(var idx = 0; idx < this.numberOfPdus; idx++) 32 | { 33 | var anX = new dis.Pdu(); 34 | anX.initFromBinary(inputStream); 35 | this.pdus.push(anX); 36 | } 37 | 38 | }; 39 | 40 | dis.PduContainer.prototype.encodeToBinary = function(outputStream) 41 | { 42 | outputStream.writeInt(this.numberOfPdus); 43 | for(var idx = 0; idx < this.pdus.length; idx++) 44 | { 45 | this.pdus[idx].encodeToBinary(outputStream); 46 | } 47 | 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.PduContainer = dis.PduContainer; 53 | 54 | // End of PduContainer class 55 | 56 | -------------------------------------------------------------------------------- /src/dis7/PduStatus.js: -------------------------------------------------------------------------------- 1 | /** 2 | * PDU Status. These are a series of bit fields. Represented here as just a byte. Section 6.2.67 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.PduStatus = function() 21 | { 22 | /** Bit fields. The semantics of the bit fields depend on the PDU type */ 23 | this.pduStatus = 0; 24 | 25 | dis.PduStatus.prototype.initFromBinary = function(inputStream) 26 | { 27 | this.pduStatus = inputStream.readUByte(); 28 | }; 29 | 30 | dis.PduStatus.prototype.encodeToBinary = function(outputStream) 31 | { 32 | outputStream.writeUByte(this.pduStatus); 33 | }; 34 | }; // end of class 35 | 36 | // node.js module support 37 | exports.PduStatus = dis.PduStatus; 38 | 39 | // End of PduStatus class 40 | 41 | -------------------------------------------------------------------------------- /src/dis7/PduSuperclass.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The superclass for all PDUs, including classic and Live Entity (LE) PDUs. This incorporates the PduHeader record, section 7.2.2 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.PduSuperclass = function() 21 | { 22 | /** The version of the protocol. 5=DIS-1995, 6=DIS-1998, 7=DIS-2009. */ 23 | this.protocolVersion = 7; 24 | 25 | /** Exercise ID */ 26 | this.exerciseID = 0; 27 | 28 | /** Type of pdu, unique for each PDU class */ 29 | this.pduType = 0; 30 | 31 | /** value that refers to the protocol family, eg SimulationManagement, et */ 32 | this.protocolFamily = 0; 33 | 34 | /** Timestamp value */ 35 | this.timestamp = 0; 36 | 37 | /** Length, in bytes, of the PDU */ 38 | this.length = 0; 39 | 40 | dis.PduSuperclass.prototype.initFromBinary = function(inputStream) 41 | { 42 | this.protocolVersion = inputStream.readUByte(); 43 | this.exerciseID = inputStream.readUByte(); 44 | this.pduType = inputStream.readUByte(); 45 | this.protocolFamily = inputStream.readUByte(); 46 | this.timestamp = inputStream.readUInt(); 47 | this.length = inputStream.readUShort(); 48 | }; 49 | 50 | dis.PduSuperclass.prototype.encodeToBinary = function(outputStream) 51 | { 52 | outputStream.writeUByte(this.protocolVersion); 53 | outputStream.writeUByte(this.exerciseID); 54 | outputStream.writeUByte(this.pduType); 55 | outputStream.writeUByte(this.protocolFamily); 56 | outputStream.writeUInt(this.timestamp); 57 | outputStream.writeUShort(this.length); 58 | }; 59 | }; // end of class 60 | 61 | // node.js module support 62 | exports.PduSuperclass = dis.PduSuperclass; 63 | 64 | // End of PduSuperclass class 65 | 66 | -------------------------------------------------------------------------------- /src/dis7/PropulsionSystemData.js: -------------------------------------------------------------------------------- 1 | /** 2 | * contains information describing the propulsion systems of the entity. This information shall be provided for each active propulsion system defined. Section 6.2.68 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.PropulsionSystemData = function() 21 | { 22 | /** powerSetting */ 23 | this.powerSetting = 0; 24 | 25 | /** engine RPMs */ 26 | this.engineRpm = 0; 27 | 28 | dis.PropulsionSystemData.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.powerSetting = inputStream.readFloat32(); 31 | this.engineRpm = inputStream.readFloat32(); 32 | }; 33 | 34 | dis.PropulsionSystemData.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeFloat32(this.powerSetting); 37 | outputStream.writeFloat32(this.engineRpm); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.PropulsionSystemData = dis.PropulsionSystemData; 43 | 44 | // End of PropulsionSystemData class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/ProtocolMode.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bit field used to identify minefield data. bits 14-15 are a 2-bit enum, other bits unused. Section 6.2.69 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.ProtocolMode = function() 21 | { 22 | /** Bitfields, 14-15 contain an enum */ 23 | this.protocolMode = 0; 24 | 25 | dis.ProtocolMode.prototype.initFromBinary = function(inputStream) 26 | { 27 | this.protocolMode = inputStream.readUShort(); 28 | }; 29 | 30 | dis.ProtocolMode.prototype.encodeToBinary = function(outputStream) 31 | { 32 | outputStream.writeUShort(this.protocolMode); 33 | }; 34 | }; // end of class 35 | 36 | // node.js module support 37 | exports.ProtocolMode = dis.ProtocolMode; 38 | 39 | // End of ProtocolMode class 40 | 41 | -------------------------------------------------------------------------------- /src/dis7/RadioIdentifier.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The unique designation of an attached or unattached radio in an event or exercise Section 6.2.70 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.RadioIdentifier = function() 21 | { 22 | /** site */ 23 | this.siteNumber = 0; 24 | 25 | /** application number */ 26 | this.applicationNumber = 0; 27 | 28 | /** reference number */ 29 | this.referenceNumber = 0; 30 | 31 | /** Radio number */ 32 | this.radioNumber = 0; 33 | 34 | dis.RadioIdentifier.prototype.initFromBinary = function(inputStream) 35 | { 36 | this.siteNumber = inputStream.readUShort(); 37 | this.applicationNumber = inputStream.readUShort(); 38 | this.referenceNumber = inputStream.readUShort(); 39 | this.radioNumber = inputStream.readUShort(); 40 | }; 41 | 42 | dis.RadioIdentifier.prototype.encodeToBinary = function(outputStream) 43 | { 44 | outputStream.writeUShort(this.siteNumber); 45 | outputStream.writeUShort(this.applicationNumber); 46 | outputStream.writeUShort(this.referenceNumber); 47 | outputStream.writeUShort(this.radioNumber); 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.RadioIdentifier = dis.RadioIdentifier; 53 | 54 | // End of RadioIdentifier class 55 | 56 | -------------------------------------------------------------------------------- /src/dis7/RadioType.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Identifies the type of radio. Section 6.2.71 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.RadioType = function() 21 | { 22 | /** Kind of entity */ 23 | this.entityKind = 0; 24 | 25 | /** Domain of entity (air, surface, subsurface, space, etc) */ 26 | this.domain = 0; 27 | 28 | /** country to which the design of the entity is attributed */ 29 | this.country = 0; 30 | 31 | /** category of entity */ 32 | this.category = 0; 33 | 34 | /** specific info based on subcategory field */ 35 | this.subcategory = 0; 36 | 37 | this.specific = 0; 38 | 39 | this.extra = 0; 40 | 41 | dis.RadioType.prototype.initFromBinary = function(inputStream) 42 | { 43 | this.entityKind = inputStream.readUByte(); 44 | this.domain = inputStream.readUByte(); 45 | this.country = inputStream.readUShort(); 46 | this.category = inputStream.readUByte(); 47 | this.subcategory = inputStream.readUByte(); 48 | this.specific = inputStream.readUByte(); 49 | this.extra = inputStream.readUByte(); 50 | }; 51 | 52 | dis.RadioType.prototype.encodeToBinary = function(outputStream) 53 | { 54 | outputStream.writeUByte(this.entityKind); 55 | outputStream.writeUByte(this.domain); 56 | outputStream.writeUShort(this.country); 57 | outputStream.writeUByte(this.category); 58 | outputStream.writeUByte(this.subcategory); 59 | outputStream.writeUByte(this.specific); 60 | outputStream.writeUByte(this.extra); 61 | }; 62 | }; // end of class 63 | 64 | // node.js module support 65 | exports.RadioType = dis.RadioType; 66 | 67 | // End of RadioType class 68 | 69 | -------------------------------------------------------------------------------- /src/dis7/RecordQuerySpecification.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The identification of the records being queried 6.2.72 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.RecordQuerySpecification = function() 21 | { 22 | this.numberOfRecords = 0; 23 | 24 | /** variable length list of 32 bit records */ 25 | this.records = new Array(); 26 | 27 | dis.RecordQuerySpecification.prototype.initFromBinary = function(inputStream) 28 | { 29 | this.numberOfRecords = inputStream.readUInt(); 30 | for(var idx = 0; idx < this.numberOfRecords; idx++) 31 | { 32 | var anX = new dis.Chunk(4); 33 | anX.initFromBinary(inputStream); 34 | this.records.push(anX); 35 | } 36 | 37 | }; 38 | 39 | dis.RecordQuerySpecification.prototype.encodeToBinary = function(outputStream) 40 | { 41 | outputStream.writeUInt(this.numberOfRecords); 42 | for(var idx = 0; idx < this.records.length; idx++) 43 | { 44 | records[idx].encodeToBinary(outputStream); 45 | } 46 | 47 | }; 48 | }; // end of class 49 | 50 | // node.js module support 51 | exports.RecordQuerySpecification = dis.RecordQuerySpecification; 52 | 53 | // End of RecordQuerySpecification class 54 | 55 | -------------------------------------------------------------------------------- /src/dis7/RecordSpecification.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This record shall specify the number of record sets contained in the Record Specification record and the record details. Section 6.2.73. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.RecordSpecification = function() 21 | { 22 | /** The number of record sets */ 23 | this.numberOfRecordSets = 0; 24 | 25 | /** variable length list record specifications. */ 26 | this.recordSets = new Array(); 27 | 28 | dis.RecordSpecification.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.numberOfRecordSets = inputStream.readUInt(); 31 | for(var idx = 0; idx < this.numberOfRecordSets; idx++) 32 | { 33 | var anX = new dis.RecordSpecificationElement(); 34 | anX.initFromBinary(inputStream); 35 | this.recordSets.push(anX); 36 | } 37 | 38 | }; 39 | 40 | dis.RecordSpecification.prototype.encodeToBinary = function(outputStream) 41 | { 42 | outputStream.writeUInt(this.numberOfRecordSets); 43 | for(var idx = 0; idx < this.recordSets.length; idx++) 44 | { 45 | recordSets[idx].encodeToBinary(outputStream); 46 | } 47 | 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.RecordSpecification = dis.RecordSpecification; 53 | 54 | // End of RecordSpecification class 55 | 56 | -------------------------------------------------------------------------------- /src/dis7/Relationship.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The relationship of the part entity to its host entity. Section 6.2.74. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Relationship = function() 21 | { 22 | /** the nature or purpose for joining of the part entity to the host entity and shall be represented by a 16-bit enumeration */ 23 | this.nature = 0; 24 | 25 | /** the position of the part entity with respect to the host entity and shall be represented by a 16-bit enumeration */ 26 | this.position = 0; 27 | 28 | dis.Relationship.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.nature = inputStream.readUShort(); 31 | this.position = inputStream.readUShort(); 32 | }; 33 | 34 | dis.Relationship.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeUShort(this.nature); 37 | outputStream.writeUShort(this.position); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.Relationship = dis.Relationship; 43 | 44 | // End of Relationship class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/RequestID.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A monotonically increasing number inserted into all simulation managment PDUs. This should be a hand-coded thingie, maybe a singleton. Section 6.2.75 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.RequestID = function() 21 | { 22 | /** monotonically increasing number */ 23 | this.requestID = 0; 24 | 25 | dis.RequestID.prototype.initFromBinary = function(inputStream) 26 | { 27 | this.requestID = inputStream.readUInt(); 28 | }; 29 | 30 | dis.RequestID.prototype.encodeToBinary = function(outputStream) 31 | { 32 | outputStream.writeUInt(this.requestID); 33 | }; 34 | }; // end of class 35 | 36 | // node.js module support 37 | exports.RequestID = dis.RequestID; 38 | 39 | // End of RequestID class 40 | 41 | -------------------------------------------------------------------------------- /src/dis7/SecondaryOperationalData.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Additional operational data for an IFF emitting system and the number of IFF Fundamental Parameter Data records Section 6.2.76. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.SecondaryOperationalData = function() 21 | { 22 | /** additional operational characteristics of the IFF emitting system. Each 8-bit field will vary depending on the system type. */ 23 | this.operationalData1 = 0; 24 | 25 | /** additional operational characteristics of the IFF emitting system. Each 8-bit field will vary depending on the system type. */ 26 | this.operationalData2 = 0; 27 | 28 | /** the number of IFF Fundamental Parameter Data records that follow */ 29 | this.numberOfIFFFundamentalParameterRecords = 0; 30 | 31 | dis.SecondaryOperationalData.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.operationalData1 = inputStream.readUByte(); 34 | this.operationalData2 = inputStream.readUByte(); 35 | this.numberOfIFFFundamentalParameterRecords = inputStream.readUShort(); 36 | }; 37 | 38 | dis.SecondaryOperationalData.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeUByte(this.operationalData1); 41 | outputStream.writeUByte(this.operationalData2); 42 | outputStream.writeUShort(this.numberOfIFFFundamentalParameterRecords); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.SecondaryOperationalData = dis.SecondaryOperationalData; 48 | 49 | // End of SecondaryOperationalData class 50 | 51 | -------------------------------------------------------------------------------- /src/dis7/SimulationAddress.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A Simulation Address record shall consist of the Site Identification number and the Application Identification number. Section 6.2.79 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.SimulationAddress = function() 21 | { 22 | /** A site is defined as a facility, installation, organizational unit or a geographic location that has one or more simulation applications capable of participating in a distributed event. */ 23 | this.site = 0; 24 | 25 | /** An application is defined as a software program that is used to generate and process distributed simulation data including live, virtual and constructive data. */ 26 | this.application = 0; 27 | 28 | dis.SimulationAddress.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.site = inputStream.readUShort(); 31 | this.application = inputStream.readUShort(); 32 | }; 33 | 34 | dis.SimulationAddress.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeUShort(this.site); 37 | outputStream.writeUShort(this.application); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.SimulationAddress = dis.SimulationAddress; 43 | 44 | // End of SimulationAddress class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/SimulationIdentifier.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 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 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.SimulationIdentifier = function() 21 | { 22 | /** Simulation address */ 23 | this.simulationAddress = new dis.SimulationAddress(); 24 | 25 | /** This field shall be set to zero as there is no reference number associated with a Simulation Identifier. */ 26 | this.referenceNumber = 0; 27 | 28 | dis.SimulationIdentifier.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.simulationAddress.initFromBinary(inputStream); 31 | this.referenceNumber = inputStream.readUShort(); 32 | }; 33 | 34 | dis.SimulationIdentifier.prototype.encodeToBinary = function(outputStream) 35 | { 36 | this.simulationAddress.encodeToBinary(outputStream); 37 | outputStream.writeUShort(this.referenceNumber); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.SimulationIdentifier = dis.SimulationIdentifier; 43 | 44 | // End of SimulationIdentifier class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/SimulationManagementPduHeader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * First part of a simulation management (SIMAN) PDU and SIMAN-Reliability (SIMAN-R) PDU. Sectionn 6.2.81 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.SimulationManagementPduHeader = function() 21 | { 22 | /** Conventional PDU header */ 23 | this.pduHeader = new dis.PduHeader(); 24 | 25 | /** IDs the simulation or entity, etiehr a simulation or an entity. Either 6.2.80 or 6.2.28 */ 26 | this.originatingID = new dis.SimulationIdentifier(); 27 | 28 | /** simulation, all simulations, a special ID, or an entity. See 5.6.5 and 5.12.4 */ 29 | this.receivingID = new dis.SimulationIdentifier(); 30 | 31 | dis.SimulationManagementPduHeader.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.pduHeader.initFromBinary(inputStream); 34 | this.originatingID.initFromBinary(inputStream); 35 | this.receivingID.initFromBinary(inputStream); 36 | }; 37 | 38 | dis.SimulationManagementPduHeader.prototype.encodeToBinary = function(outputStream) 39 | { 40 | this.pduHeader.encodeToBinary(outputStream); 41 | this.originatingID.encodeToBinary(outputStream); 42 | this.receivingID.encodeToBinary(outputStream); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.SimulationManagementPduHeader = dis.SimulationManagementPduHeader; 48 | 49 | // End of SimulationManagementPduHeader class 50 | 51 | -------------------------------------------------------------------------------- /src/dis7/StandardVariableSpecification.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Does not work, and causes failure in anything it is embedded in. Section 6.2.83 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.StandardVariableSpecification = function() 21 | { 22 | /** Number of static variable records */ 23 | this.numberOfStandardVariableRecords = 0; 24 | 25 | /** variable length list of standard variables, The class type and length here are WRONG and will cause the incorrect serialization of any class in whihc it is embedded. */ 26 | this.standardVariables = new Array(); 27 | 28 | dis.StandardVariableSpecification.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.numberOfStandardVariableRecords = inputStream.readUShort(); 31 | for(var idx = 0; idx < this.numberOfStandardVariableRecords; idx++) 32 | { 33 | var anX = new dis.SimulationManagementPduHeader(); 34 | anX.initFromBinary(inputStream); 35 | this.standardVariables.push(anX); 36 | } 37 | 38 | }; 39 | 40 | dis.StandardVariableSpecification.prototype.encodeToBinary = function(outputStream) 41 | { 42 | outputStream.writeUShort(this.numberOfStandardVariableRecords); 43 | for(var idx = 0; idx < this.standardVariables.length; idx++) 44 | { 45 | this.standardVariables[idx].encodeToBinary(outputStream); 46 | } 47 | 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.StandardVariableSpecification = dis.StandardVariableSpecification; 53 | 54 | // End of StandardVariableSpecification class 55 | 56 | -------------------------------------------------------------------------------- /src/dis7/StorageFuel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Information about an entity's engine fuel. Section 6.2.84. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.StorageFuel = function() 21 | { 22 | /** Fuel quantity, units specified by next field */ 23 | this.fuelQuantity = 0; 24 | 25 | /** Units in which the fuel is measured */ 26 | this.fuelMeasurementUnits = 0; 27 | 28 | /** Type of fuel */ 29 | this.fuelType = 0; 30 | 31 | /** Location of fuel as related to entity. See section 14 of EBV document */ 32 | this.fuelLocation = 0; 33 | 34 | /** padding */ 35 | this.padding = 0; 36 | 37 | dis.StorageFuel.prototype.initFromBinary = function(inputStream) 38 | { 39 | this.fuelQuantity = inputStream.readUInt(); 40 | this.fuelMeasurementUnits = inputStream.readUByte(); 41 | this.fuelType = inputStream.readUByte(); 42 | this.fuelLocation = inputStream.readUByte(); 43 | this.padding = inputStream.readUByte(); 44 | }; 45 | 46 | dis.StorageFuel.prototype.encodeToBinary = function(outputStream) 47 | { 48 | outputStream.writeUInt(this.fuelQuantity); 49 | outputStream.writeUByte(this.fuelMeasurementUnits); 50 | outputStream.writeUByte(this.fuelType); 51 | outputStream.writeUByte(this.fuelLocation); 52 | outputStream.writeUByte(this.padding); 53 | }; 54 | }; // end of class 55 | 56 | // node.js module support 57 | exports.StorageFuel = dis.StorageFuel; 58 | 59 | // End of StorageFuel class 60 | 61 | -------------------------------------------------------------------------------- /src/dis7/SupplyQuantity.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A supply, and the amount of that supply. Section 6.2.86 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.SupplyQuantity = function() 21 | { 22 | /** Type of supply */ 23 | this.supplyType = new dis.EntityType(); 24 | 25 | /** the number of units of a supply type. */ 26 | this.quantity = 0; 27 | 28 | dis.SupplyQuantity.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.supplyType.initFromBinary(inputStream); 31 | this.quantity = inputStream.readFloat32(); 32 | }; 33 | 34 | dis.SupplyQuantity.prototype.encodeToBinary = function(outputStream) 35 | { 36 | this.supplyType.encodeToBinary(outputStream); 37 | outputStream.writeFloat32(this.quantity); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.SupplyQuantity = dis.SupplyQuantity; 43 | 44 | // End of SupplyQuantity class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/SystemIdentifier.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The ID of the IFF emitting system. NOT COMPLETE. Section 6.2.87 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.SystemIdentifier = function() 21 | { 22 | /** general type of emitting system, an enumeration */ 23 | this.systemType = 0; 24 | 25 | /** named type of system, an enumeration */ 26 | this.systemName = 0; 27 | 28 | /** mode of operation for the system, an enumeration */ 29 | this.systemMode = 0; 30 | 31 | /** status of this PDU, see section 6.2.15 */ 32 | this.changeOptions = new dis.ChangeOptions(); 33 | 34 | dis.SystemIdentifier.prototype.initFromBinary = function(inputStream) 35 | { 36 | this.systemType = inputStream.readUShort(); 37 | this.systemName = inputStream.readUShort(); 38 | this.systemMode = inputStream.readUShort(); 39 | this.changeOptions.initFromBinary(inputStream); 40 | }; 41 | 42 | dis.SystemIdentifier.prototype.encodeToBinary = function(outputStream) 43 | { 44 | outputStream.writeUShort(this.systemType); 45 | outputStream.writeUShort(this.systemName); 46 | outputStream.writeUShort(this.systemMode); 47 | this.changeOptions.encodeToBinary(outputStream); 48 | }; 49 | }; // end of class 50 | 51 | // node.js module support 52 | exports.SystemIdentifier = dis.SystemIdentifier; 53 | 54 | // End of SystemIdentifier class 55 | 56 | -------------------------------------------------------------------------------- /src/dis7/Timestamp.js: -------------------------------------------------------------------------------- 1 | /** 2 | * LSB is absolute or relative timestamp. Scale is 2^31 - 1 divided into one hour. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Timestamp = function() 21 | { 22 | /** timestamp */ 23 | this.timestamp = 0; 24 | 25 | dis.Timestamp.prototype.initFromBinary = function(inputStream) 26 | { 27 | this.timestamp = inputStream.readUInt(); 28 | }; 29 | 30 | dis.Timestamp.prototype.encodeToBinary = function(outputStream) 31 | { 32 | outputStream.writeUInt(this.timestamp); 33 | }; 34 | 35 | /** 0 relative timestamp, 1 host synchronized timestamp */ 36 | dis.Timestamp.prototype.getTimestamp_timestampType = function() 37 | { 38 | var val = this.timestamp & 0x1; 39 | return val >> 0; 40 | }; 41 | 42 | 43 | /** 0 relative timestamp, 1 host synchronized timestamp */ 44 | dis.Timestamp.prototype.setTimestamp_timestampType= function(val) 45 | { 46 | this.timestamp &= ~0x1; // Zero existing bits 47 | val = val << 0; 48 | this.timestamp = this.timestamp | val; 49 | }; 50 | 51 | 52 | /** 2^31-1 per hour time units */ 53 | dis.Timestamp.prototype.getTimestamp_timestampValue = function() 54 | { 55 | var val = this.timestamp & 0xFE; 56 | return val >> 1; 57 | }; 58 | 59 | 60 | /** 2^31-1 per hour time units */ 61 | dis.Timestamp.prototype.setTimestamp_timestampValue= function(val) 62 | { 63 | this.timestamp &= ~0xFE; // Zero existing bits 64 | val = val << 1; 65 | this.timestamp = this.timestamp | val; 66 | }; 67 | 68 | }; // end of class 69 | 70 | // node.js module support 71 | exports.Timestamp = dis.Timestamp; 72 | 73 | // End of Timestamp class 74 | 75 | -------------------------------------------------------------------------------- /src/dis7/TotalRecordSets.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Total number of record sets contained in a logical set of one or more PDUs. Used to transfer ownership, etc Section 6.2.88 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.TotalRecordSets = function() 21 | { 22 | /** Total number of record sets */ 23 | this.totalRecordSets = 0; 24 | 25 | /** padding */ 26 | this.padding = 0; 27 | 28 | dis.TotalRecordSets.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.totalRecordSets = inputStream.readUShort(); 31 | this.padding = inputStream.readUShort(); 32 | }; 33 | 34 | dis.TotalRecordSets.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeUShort(this.totalRecordSets); 37 | outputStream.writeUShort(this.padding); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.TotalRecordSets = dis.TotalRecordSets; 43 | 44 | // End of TotalRecordSets class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/TrackJamData.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Track-Jam data Section 6.2.89 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.TrackJamData = function() 21 | { 22 | /** the entity tracked or illumated, or an emitter beam targeted with jamming */ 23 | this.entityID = new dis.EntityID(); 24 | 25 | /** Emitter system associated with the entity */ 26 | this.emitterNumber = 0; 27 | 28 | /** Beam associated with the entity */ 29 | this.beamNumber = 0; 30 | 31 | dis.TrackJamData.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.entityID.initFromBinary(inputStream); 34 | this.emitterNumber = inputStream.readUByte(); 35 | this.beamNumber = inputStream.readUByte(); 36 | }; 37 | 38 | dis.TrackJamData.prototype.encodeToBinary = function(outputStream) 39 | { 40 | this.entityID.encodeToBinary(outputStream); 41 | outputStream.writeUByte(this.emitterNumber); 42 | outputStream.writeUByte(this.beamNumber); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.TrackJamData = dis.TrackJamData; 48 | 49 | // End of TrackJamData class 50 | 51 | -------------------------------------------------------------------------------- /src/dis7/UnattachedIdentifier.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The unique designation of one or more unattached radios in an event or exercise Section 6.2.91 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.UnattachedIdentifier = function() 21 | { 22 | /** See 6.2.79 */ 23 | this.simulationAddress = new dis.SimulationAddress(); 24 | 25 | /** Reference number */ 26 | this.referenceNumber = 0; 27 | 28 | dis.UnattachedIdentifier.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.simulationAddress.initFromBinary(inputStream); 31 | this.referenceNumber = inputStream.readUShort(); 32 | }; 33 | 34 | dis.UnattachedIdentifier.prototype.encodeToBinary = function(outputStream) 35 | { 36 | this.simulationAddress.encodeToBinary(outputStream); 37 | outputStream.writeUShort(this.referenceNumber); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.UnattachedIdentifier = dis.UnattachedIdentifier; 43 | 44 | // End of UnattachedIdentifier class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/UnsignedDISInteger.js: -------------------------------------------------------------------------------- 1 | /** 2 | * container class not in specification 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.UnsignedDISInteger = function() 21 | { 22 | /** unsigned integer */ 23 | this.val = 0; 24 | 25 | dis.UnsignedDISInteger.prototype.initFromBinary = function(inputStream) 26 | { 27 | this.val = inputStream.readUInt(); 28 | }; 29 | 30 | dis.UnsignedDISInteger.prototype.encodeToBinary = function(outputStream) 31 | { 32 | outputStream.writeUInt(this.val); 33 | }; 34 | }; // end of class 35 | 36 | // node.js module support 37 | exports.UnsignedDISInteger = dis.UnsignedDISInteger; 38 | 39 | // End of UnsignedDISInteger class 40 | 41 | -------------------------------------------------------------------------------- /src/dis7/VariableDatum.js: -------------------------------------------------------------------------------- 1 | /** 2 | * the variable datum type, the datum length, and the value for that variable datum type. NOT COMPLETE. Section 6.2.93 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.VariableDatum = function() 21 | { 22 | /** ID of variable datum to be transmitted. 32 bit enumeration defined in EBV */ 23 | this.variableDatumID = 0; 24 | 25 | /** Length, IN BITS, of the variable datum. */ 26 | this.variableDatumLength = 0; 27 | 28 | /** Variable length data class */ 29 | this.variableDatumData = new Array(); 30 | 31 | dis.VariableDatum.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.variableDatumID = inputStream.readUInt(); 34 | this.variableDatumLength = inputStream.readUInt(); 35 | for(var idx = 0; idx < this.variableDatumLength/8; idx++) //take care: the variableDatumLength is in bits (=> divide by 8 for bytes) 36 | { 37 | var anX = new dis.Chunk(1); 38 | anX.initFromBinary(inputStream); 39 | this.variableDatumData.push(anX); 40 | } 41 | 42 | }; 43 | 44 | dis.VariableDatum.prototype.encodeToBinary = function(outputStream) 45 | { 46 | outputStream.writeUInt(this.variableDatumID); 47 | outputStream.writeUInt(this.variableDatumLength); 48 | for(var idx = 0; idx < this.variableDatumData.length; idx++) 49 | { 50 | this.variableDatumData[idx].encodeToBinary(outputStream); 51 | } 52 | 53 | }; 54 | }; // end of class 55 | 56 | // node.js module support 57 | exports.VariableDatum = dis.VariableDatum; 58 | 59 | // End of VariableDatum class 60 | 61 | -------------------------------------------------------------------------------- /src/dis7/VariableTransmitterParameters.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Relates to radios. NOT COMPLETE. Section 6.2.94 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.VariableTransmitterParameters = function() 21 | { 22 | /** Type of VTP. Enumeration from EBV */ 23 | this.recordType = 0; 24 | 25 | /** Length, in bytes */ 26 | this.recordLength = 4; 27 | 28 | dis.VariableTransmitterParameters.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.recordType = inputStream.readUInt(); 31 | this.recordLength = inputStream.readUInt(); 32 | }; 33 | 34 | dis.VariableTransmitterParameters.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeUInt(this.recordType); 37 | outputStream.writeUInt(this.recordLength); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.VariableTransmitterParameters = dis.VariableTransmitterParameters; 43 | 44 | // End of VariableTransmitterParameters class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/Vector2Float.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Two floating point values, x, y 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Vector2Float = function() 21 | { 22 | /** X value */ 23 | this.x = 0; 24 | 25 | /** y Value */ 26 | this.y = 0; 27 | 28 | dis.Vector2Float.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.x = inputStream.readFloat32(); 31 | this.y = inputStream.readFloat32(); 32 | }; 33 | 34 | dis.Vector2Float.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeFloat32(this.x); 37 | outputStream.writeFloat32(this.y); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.Vector2Float = dis.Vector2Float; 43 | 44 | // End of Vector2Float class 45 | 46 | -------------------------------------------------------------------------------- /src/dis7/Vector3Double.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Three double precision floating point values, x, y, and z. Used for world coordinates Section 6.2.97. 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Vector3Double = function() 21 | { 22 | /** X value */ 23 | this.x = 0; 24 | 25 | /** y Value */ 26 | this.y = 0; 27 | 28 | /** Z value */ 29 | this.z = 0; 30 | 31 | dis.Vector3Double.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.x = inputStream.readFloat64(); 34 | this.y = inputStream.readFloat64(); 35 | this.z = inputStream.readFloat64(); 36 | }; 37 | 38 | dis.Vector3Double.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeFloat64(this.x); 41 | outputStream.writeFloat64(this.y); 42 | outputStream.writeFloat64(this.z); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.Vector3Double = dis.Vector3Double; 48 | 49 | // End of Vector3Double class 50 | 51 | -------------------------------------------------------------------------------- /src/dis7/Vector3Float.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Three floating point values, x, y, and z. Section 6.2.95 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.Vector3Float = function() 21 | { 22 | /** X value */ 23 | this.x = 0; 24 | 25 | /** y Value */ 26 | this.y = 0; 27 | 28 | /** Z value */ 29 | this.z = 0; 30 | 31 | dis.Vector3Float.prototype.initFromBinary = function(inputStream) 32 | { 33 | this.x = inputStream.readFloat32(); 34 | this.y = inputStream.readFloat32(); 35 | this.z = inputStream.readFloat32(); 36 | }; 37 | 38 | dis.Vector3Float.prototype.encodeToBinary = function(outputStream) 39 | { 40 | outputStream.writeFloat32(this.x); 41 | outputStream.writeFloat32(this.y); 42 | outputStream.writeFloat32(this.z); 43 | }; 44 | }; // end of class 45 | 46 | // node.js module support 47 | exports.Vector3Float = dis.Vector3Float; 48 | 49 | // End of Vector3Float class 50 | 51 | -------------------------------------------------------------------------------- /src/dis7/VectoringNozzleSystem.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Operational data for describing the vectoring nozzle systems Section 6.2.96 3 | * 4 | * Copyright (c) 2008-2015, MOVES Institute, Naval Postgraduate School. All rights reserved. 5 | * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html 6 | * 7 | * @author DMcG 8 | */ 9 | // On the client side, support for a namespace. 10 | if (typeof dis === "undefined") 11 | var dis = {}; 12 | 13 | 14 | // Support for node.js style modules. Ignored if used in a client context. 15 | // See http://howtonode.org/creating-custom-modules 16 | if (typeof exports === "undefined") 17 | exports = {}; 18 | 19 | 20 | dis.VectoringNozzleSystem = function() 21 | { 22 | /** In degrees */ 23 | this.horizontalDeflectionAngle = 0; 24 | 25 | /** In degrees */ 26 | this.verticalDeflectionAngle = 0; 27 | 28 | dis.VectoringNozzleSystem.prototype.initFromBinary = function(inputStream) 29 | { 30 | this.horizontalDeflectionAngle = inputStream.readFloat32(); 31 | this.verticalDeflectionAngle = inputStream.readFloat32(); 32 | }; 33 | 34 | dis.VectoringNozzleSystem.prototype.encodeToBinary = function(outputStream) 35 | { 36 | outputStream.writeFloat32(this.horizontalDeflectionAngle); 37 | outputStream.writeFloat32(this.verticalDeflectionAngle); 38 | }; 39 | }; // end of class 40 | 41 | // node.js module support 42 | exports.VectoringNozzleSystem = dis.VectoringNozzleSystem; 43 | 44 | // End of VectoringNozzleSystem class 45 | 46 | -------------------------------------------------------------------------------- /src/disSupporting/Chunk.js: -------------------------------------------------------------------------------- 1 | if (typeof dis === "undefined") 2 | var dis = {}; 3 | 4 | // Support for node.js style modules; ignore if not using node.js require 5 | if (typeof exports === "undefined") 6 | exports = {}; 7 | 8 | // Replaces (n)ByteChunk functions 9 | // chunkSize: specify the size of the chunk, ie 1 = 1 byte chunk, 8 = 8 byte chunk, etc. 10 | // usage: var foo = new Chunk(4) // for a 4 byte chunk 11 | dis.Chunk = function(chunkSize, isSigned = true) { 12 | 13 | this.data = new Array(chunkSize).fill(0); 14 | this.chunkSize = chunkSize; 15 | this.isSigned = isSigned; 16 | 17 | dis.Chunk.prototype.initFromBinary = function(inputStream) { 18 | for(var i = 0; i < this.chunkSize; i++) { 19 | this.data[i] = this.isSigned ? inputStream.readByte() : inputStream.readUByte(); 20 | } 21 | } 22 | dis.Chunk.prototype.encodeToBinary = function(outputStream) { 23 | for(var i = 0; i < this.chunkSize; i++) { 24 | this.isSigned ? outputStream.writeByte(this.data[i]) : outputStream.writeUByte(this.data[i]); 25 | } 26 | } 27 | } 28 | 29 | exports.Chunk = dis.Chunk; 30 | -------------------------------------------------------------------------------- /src/disSupporting/export.js: -------------------------------------------------------------------------------- 1 | 2 | // This is a temporary placeholder until full require.js code 3 | // support is present. 4 | if (typeof exports === "undefined") 5 | exports = {}; 6 | 7 | exports.RangeCoordinates = dis.RangeCoordinates; 8 | exports.InputStream = dis.InputStream; 9 | exports.OutputStream = dis.OutputStream; 10 | 11 | --------------------------------------------------------------------------------