this
and the supplied object
+ *
+ * @param obj the object to compare to
+ * @return true if the objects are equal, false otherwise.
+ */
+ public boolean equalsImpl(Object obj) {
+ boolean ivarsEqual = true;
+
+ if (!(obj instanceof AntennaPattern)) {
+ return false;
+ }
+
+ final AntennaPattern rhs = (AntennaPattern) obj;
+
+ return ivarsEqual;
+ }
+}
diff --git a/src/main/java/edu/nps/moves/dis7/AntennaPatternGeneric.java b/src/main/java/edu/nps/moves/dis7/AntennaPatternGeneric.java
new file mode 100644
index 0000000..7647626
--- /dev/null
+++ b/src/main/java/edu/nps/moves/dis7/AntennaPatternGeneric.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2024, The Moves Institute
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package edu.nps.moves.dis7;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+public class AntennaPatternGeneric extends AntennaPattern {
+
+ Listthis
and the supplied object
+ *
+ * @param obj the object to compare to
+ * @return true if the objects are equal, false otherwise.
+ */
+ public boolean equalsImpl(Object obj) {
+ boolean ivarsEqual = true;
+
+ if (!(obj instanceof AntennaPattern)) {
+ return false;
+ }
+
+ final AntennaPatternGeneric rhs = (AntennaPatternGeneric) obj;
+
+ for (int idx = 0; idx < listAntennaPatternOctets.size(); idx++) {
+ if (!(listAntennaPatternOctets.get(idx).equals(rhs.listAntennaPatternOctets.get(idx)))) {
+ ivarsEqual = false;
+ }
+ }
+ return ivarsEqual;
+ }
+}
diff --git a/src/main/java/edu/nps/moves/dis7/BeamAntennaPattern.java b/src/main/java/edu/nps/moves/dis7/BeamAntennaPattern.java
index b8b4db4..b5501fb 100644
--- a/src/main/java/edu/nps/moves/dis7/BeamAntennaPattern.java
+++ b/src/main/java/edu/nps/moves/dis7/BeamAntennaPattern.java
@@ -13,7 +13,7 @@
*
* @author DMcG
*/
-public class BeamAntennaPattern extends Object implements Serializable {
+public class BeamAntennaPattern extends AntennaPattern {
/**
* The rotation that transforms the reference coordinate sytem into the beam
@@ -65,11 +65,13 @@ public class BeamAntennaPattern extends Object implements Serializable {
* Constructor
*/
public BeamAntennaPattern() {
+ super();
}
public int getMarshalledSize() {
int marshalSize = 0;
-
+
+ marshalSize = marshalSize + super.getMarshalledSize();
marshalSize = marshalSize + beamDirection.getMarshalledSize(); // beamDirection
marshalSize = marshalSize + 4; // azimuthBeamwidth
marshalSize = marshalSize + 4; // elevationBeamwidth
@@ -166,6 +168,7 @@ public long getPadding3() {
public void marshal(DataOutputStream dos) {
try {
+ super.marshal(dos);
beamDirection.marshal(dos);
dos.writeFloat((float) azimuthBeamwidth);
dos.writeFloat((float) elevationBeamwidth);
@@ -184,6 +187,7 @@ public void marshal(DataOutputStream dos) {
public void unmarshal(DataInputStream dis) {
try {
+ super.unmarshal(dis);
beamDirection.unmarshal(dis);
azimuthBeamwidth = dis.readFloat();
elevationBeamwidth = dis.readFloat();
@@ -210,6 +214,7 @@ public void unmarshal(DataInputStream dis) {
* @since ??
*/
public void marshal(java.nio.ByteBuffer buff) {
+ super.marshal(buff);
beamDirection.marshal(buff);
buff.putFloat((float) azimuthBeamwidth);
buff.putFloat((float) elevationBeamwidth);
@@ -231,6 +236,7 @@ public void marshal(java.nio.ByteBuffer buff) {
* @since ??
*/
public void unmarshal(java.nio.ByteBuffer buff) {
+ super.unmarshal(buff);
beamDirection.unmarshal(buff);
azimuthBeamwidth = buff.getFloat();
elevationBeamwidth = buff.getFloat();
diff --git a/src/main/java/edu/nps/moves/dis7/CcttSincgarsModulationParameters.java b/src/main/java/edu/nps/moves/dis7/CcttSincgarsModulationParameters.java
new file mode 100644
index 0000000..b1a03d9
--- /dev/null
+++ b/src/main/java/edu/nps/moves/dis7/CcttSincgarsModulationParameters.java
@@ -0,0 +1,237 @@
+/*
+ * Copyright (c) 2022, The Moves Institute
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package edu.nps.moves.dis7;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+/**
+ *
+ * @author fo
+ */
+public class CcttSincgarsModulationParameters extends ModulationParameters {
+
+ // This field shall identify the frequency hopping network
+ private short fhNetId;
+
+ // This field shall identify the set of frequencies used when creating a hopping pattern.
+ private short hopSetId;
+
+ //This field shall identify the set of frequencies that are excluded from the hopping pattern.
+ private short lockoutSetId;
+
+ //This field shall specify whether the radio is starting or continuing a transmission
+ private short startOfMessage;
+
+ private short reserved;
+
+ //This field shall identify the offset to exercise time in seconds for the clock in the SINCGARS radio.
+ private int fhSynchronizationTimeOffset;
+
+ //This field shall identify the transmission security key that is used when generating the hopping pattern.
+ private short transmissionSecurityKey;
+
+ //This field shall specify that the transmission is not subject to propagation loss, interference, comsec or any other form of signal degradation.
+ private short clearChannel;
+
+ public CcttSincgarsModulationParameters() {
+
+ }
+
+ public int getMarshalledSize() {
+ int marshalSize = 0;
+
+ marshalSize = super.getMarshalledSize();
+ marshalSize = marshalSize + 2;// FH Net ID
+ marshalSize = marshalSize + 2;// Hop Set Id
+ marshalSize = marshalSize + 2;// Lockou Set ID
+ marshalSize = marshalSize + 1;// Start of Message
+ marshalSize = marshalSize + 1;// Reserved
+ marshalSize = marshalSize + 4;// FH Synchronization Time Offset
+ marshalSize = marshalSize + 2;// Transmission Security key
+ marshalSize = marshalSize + 1;// Clear Channel
+
+ return marshalSize;
+ }
+
+ public short getFhNetId() {
+ return fhNetId;
+ }
+
+ public void setFhNetId(short id) {
+ fhNetId = id;
+ }
+
+ public short getHopSetId() {
+ return hopSetId;
+ }
+
+ public void setHopSetId(short id) {
+ hopSetId = id;
+ }
+
+ public short getLockoutSetId() {
+ return lockoutSetId;
+ }
+
+ public void setLockoutSetId(short id) {
+ lockoutSetId = id;
+ }
+
+ public short getStartOfMessage() {
+ return startOfMessage;
+ }
+
+ public void setStartOfMessage(short som) {
+ startOfMessage = som;
+ }
+
+ public short getReserved() {
+ return reserved;
+ }
+
+ public void setReserved(short r) {
+ reserved = r;
+ }
+
+ public int getFhSynchronizationTimeOffset() {
+ return fhSynchronizationTimeOffset;
+ }
+
+ public void setFhSynchronizationTimeOffset(int offSet) {
+ fhSynchronizationTimeOffset = offSet;
+ }
+
+ public short getTransmissionSecurityKey() {
+ return transmissionSecurityKey;
+ }
+
+ public void setTransmissionSecurityKey(short key) {
+ transmissionSecurityKey = key;
+ }
+
+ public short getClearChannel() {
+ return clearChannel;
+ }
+
+ public void setClearChannel(short channel) {
+ clearChannel = channel;
+ }
+
+ public void marshal(DataOutputStream dos) {
+ try {
+ super.marshal(dos);
+ dos.writeShort((short) fhNetId);
+ dos.writeShort((short) hopSetId);
+ dos.writeShort((short) lockoutSetId);
+ dos.writeByte((byte) startOfMessage);
+ dos.writeByte((byte) reserved);
+ dos.writeInt((int) fhSynchronizationTimeOffset);
+ dos.writeShort((short) transmissionSecurityKey);
+ dos.writeByte((byte) clearChannel);
+ } catch (IOException e) {
+ System.out.println("" + e);
+ }
+ }
+
+ public void unmarshal(DataInputStream dis) {
+ try {
+ super.unmarshal(dis);
+ fhNetId = (short) dis.readShort();
+ hopSetId = (short) dis.readShort();
+ lockoutSetId = (short) dis.readShort();
+ startOfMessage = (byte) dis.readByte();
+ reserved = (byte) dis.readByte();
+ fhSynchronizationTimeOffset = (int) dis.readInt();
+ transmissionSecurityKey = (short) dis.readShort();
+ clearChannel = (byte) dis.readByte();
+ } catch (IOException e) {
+ System.out.println("" + e);
+ }
+ }
+
+ public void marshal(java.nio.ByteBuffer buff) {
+ super.marshal(buff);
+ buff.putShort((short) fhNetId);
+ buff.putShort((short) hopSetId);
+ buff.putShort((short) lockoutSetId);
+ buff.put((byte) startOfMessage);
+ buff.put((byte) reserved);
+ buff.putInt((int) fhSynchronizationTimeOffset);
+ buff.putShort((short) transmissionSecurityKey);
+ buff.put((byte) clearChannel);
+ }
+
+ public void unmarshal(java.nio.ByteBuffer buff) {
+ super.unmarshal(buff);
+ fhNetId = (short) (buff.getShort() & 0xFFFF);
+ hopSetId = (short) (buff.getShort() & 0xFFFF);
+ lockoutSetId = (short) (buff.getShort() & 0xFFFF);
+ startOfMessage = (byte) (buff.get() & 0xFF);
+ reserved = (byte) (buff.get() & 0xFF);
+ fhSynchronizationTimeOffset = (int) (buff.getInt() & 0xFFFFFFFF);
+ transmissionSecurityKey = (short) (buff.getShort() & 0xFFFF);
+ clearChannel = (short) (buff.get() & 0xFFFF);
+ }
+
+ public boolean equalsImpl(Object obj) {
+ boolean ivarsEqual = true;
+
+ if (!(obj instanceof CcttSincgarsModulationParameters)) {
+ return false;
+ }
+
+ final CcttSincgarsModulationParameters rhs = (CcttSincgarsModulationParameters) obj;
+
+ if (!(fhNetId == rhs.getFhNetId())) {
+ ivarsEqual = false;
+ }
+ if (!(hopSetId == rhs.getHopSetId())) {
+ ivarsEqual = false;
+ }
+ if (!(lockoutSetId == rhs.getLockoutSetId())) {
+ ivarsEqual = false;
+ }
+ if (!(startOfMessage == rhs.getStartOfMessage())) {
+ ivarsEqual = false;
+ }
+ if (!(reserved == rhs.getReserved())) {
+ ivarsEqual = false;
+ }
+ if (!(fhSynchronizationTimeOffset == rhs.getFhSynchronizationTimeOffset())) {
+ ivarsEqual = false;
+ }
+ if (!(transmissionSecurityKey == rhs.getTransmissionSecurityKey())) {
+ ivarsEqual = false;
+ }
+ if (!(clearChannel == rhs.getClearChannel())) {
+ ivarsEqual = false;
+ }
+
+ return ivarsEqual;
+ }
+}
diff --git a/src/main/java/edu/nps/moves/dis7/JtidsMidsModulationParameters.java b/src/main/java/edu/nps/moves/dis7/JtidsMidsModulationParameters.java
new file mode 100644
index 0000000..0e2166f
--- /dev/null
+++ b/src/main/java/edu/nps/moves/dis7/JtidsMidsModulationParameters.java
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2022, The Moves Institute
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package edu.nps.moves.dis7;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+/**
+ *
+ * @author fo
+ */
+public class JtidsMidsModulationParameters extends ModulationParameters {
+
+ // Defines the fidelity level to be used (range 0 to 4)
+ private short timeSlotAllocationMode;
+
+ // Defines the primary mode of operation of the transmitting terminal
+ private short transmittingTerminalPrimaryMode;
+
+ // Defines the secondary mode of operation of the transmitting terminal
+ private short transmittingTerminalSecondaryMode;
+
+ // Defines the current synchronization state of the transmitting terminal
+ private short synchronizationState;
+
+ // Defines net id based on what TSA mode is selected.
+ private int networkSynchronizationID;
+
+ public JtidsMidsModulationParameters() {
+
+ }
+
+ public int getMarshalledSize() {
+ int marshalSize = 0;
+
+ marshalSize = super.getMarshalledSize();
+ marshalSize = marshalSize + 1;// Time Slot Allocation Mode
+ marshalSize = marshalSize + 1;// Transmitting Terminal Primary Mode
+ marshalSize = marshalSize + 1;// Transmitting Terminal Secondary Mode
+ marshalSize = marshalSize + 1;// Synchronization State
+ marshalSize = marshalSize + 4;// Network Synchronization ID
+ return marshalSize;
+ }
+
+ public short getTimeSlotAllocationMode() {
+ return timeSlotAllocationMode;
+ }
+
+ public void setTimeSlotAllocationMode(short mode) {
+ timeSlotAllocationMode = mode;
+ }
+
+ public short getTransmittingTerminalPrimaryMode() {
+ return transmittingTerminalPrimaryMode;
+ }
+
+ public void setTransmittingTerminalPrimaryMode(short mode) {
+ transmittingTerminalPrimaryMode = mode;
+ }
+
+ public short getTransmittingTerminalSecondaryMode() {
+ return transmittingTerminalSecondaryMode;
+ }
+
+ public void setTransmittingTerminalSecondaryMode(short mode) {
+ transmittingTerminalSecondaryMode = mode;
+ }
+
+ public short getSynchronizationState() {
+ return synchronizationState;
+ }
+
+ public void setSynchronizationState(short state) {
+ synchronizationState = state;
+ }
+
+ public int getNetworkSynchronizationID() {
+ return networkSynchronizationID;
+ }
+
+ public void setNetworkSynchronizationID(int id) {
+ networkSynchronizationID = id;
+ }
+
+ public void marshal(DataOutputStream dos) {
+ try {
+ super.marshal(dos);
+ dos.writeByte((byte) timeSlotAllocationMode);
+ dos.writeByte((byte) transmittingTerminalPrimaryMode);
+ dos.writeByte((byte) transmittingTerminalSecondaryMode);
+ dos.writeByte((byte) synchronizationState);
+ dos.writeInt((int) networkSynchronizationID);
+
+ } catch (IOException e) {
+ System.out.println("" + e);
+ }
+ }
+
+ public void unmarshal(DataInputStream dis) {
+ try {
+ super.unmarshal(dis);
+ timeSlotAllocationMode = (short) dis.readByte();
+ transmittingTerminalPrimaryMode = (short) dis.readByte();
+ transmittingTerminalSecondaryMode = (short) dis.readByte();
+ synchronizationState = (short) dis.readByte();
+ networkSynchronizationID = (int) dis.readInt();
+ } catch (IOException e) {
+ System.out.println("" + e);
+ }
+ }
+
+ public void marshal(java.nio.ByteBuffer buff) {
+ super.marshal(buff);
+ buff.put((byte) timeSlotAllocationMode);
+ buff.put((byte) transmittingTerminalPrimaryMode);
+ buff.put((byte) transmittingTerminalSecondaryMode);
+ buff.put((byte) synchronizationState);
+ buff.putInt((int) networkSynchronizationID);
+ }
+
+ public void unmarshal(java.nio.ByteBuffer buff) {
+ super.unmarshal(buff);
+ timeSlotAllocationMode = (byte) (buff.get() & 0xFF);
+ transmittingTerminalPrimaryMode = (byte) (buff.get() & 0xFF);
+ transmittingTerminalSecondaryMode = (byte) (buff.get() & 0xFF);
+ synchronizationState = (byte) (buff.get() & 0xFF);
+ networkSynchronizationID = (int) (buff.getInt() & 0xFFFFFFFF);
+ }
+
+ public boolean equalsImpl(Object obj) {
+ boolean ivarsEqual = true;
+
+ if (!(obj instanceof JtidsMidsModulationParameters)) {
+ return false;
+ }
+ final JtidsMidsModulationParameters rhs = (JtidsMidsModulationParameters) obj;
+ if (!(timeSlotAllocationMode == rhs.getTimeSlotAllocationMode())) {
+ ivarsEqual = false;
+ }
+ if (!(transmittingTerminalPrimaryMode == rhs.getTransmittingTerminalPrimaryMode())) {
+ ivarsEqual = false;
+ }
+ if (!(transmittingTerminalSecondaryMode == rhs.getTransmittingTerminalSecondaryMode())) {
+ ivarsEqual = false;
+ }
+ if (!(synchronizationState == rhs.getSynchronizationState())) {
+ ivarsEqual = false;
+ }
+ if (!(networkSynchronizationID == rhs.getNetworkSynchronizationID())) {
+ ivarsEqual = false;
+ }
+ return ivarsEqual;
+ }
+}
diff --git a/src/main/java/edu/nps/moves/dis7/ModulationParametersGeneric.java b/src/main/java/edu/nps/moves/dis7/ModulationParametersGeneric.java
new file mode 100644
index 0000000..956c62a
--- /dev/null
+++ b/src/main/java/edu/nps/moves/dis7/ModulationParametersGeneric.java
@@ -0,0 +1,171 @@
+package edu.nps.moves.dis7;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ *
+ * @author fo
+ */
+public class ModulationParametersGeneric extends ModulationParameters {
+
+ private List+ * ((edu.nps.moves.dis7.CcttSincgarsModulationParameters) + * getModulationParameters()).getStartOfMessage()
+ * + * @return Modulation parameters record from list above + */ + public ModulationParameters getModulationParameters() { + return modulationParameters; } - public List+ * ((edu.nps.moves.dis7.BeamAntennaPattern) + * pdu.getAntennaPattern()).getAzimuthBeamwidth()
+ * + * @return antenna pattern from the list above + */ + public AntennaPattern getAntennaPattern() { + return antennaPattern; } - public List