Skip to content

PDUUtil

Quintin edited this page May 16, 2023 · 2 revisions

PDU Util

Class that holds common utilities for PDUs.

public static class PDUUtil

Includes

Back to Top


Members

Access Type Name Description
Public const string DELIMITER_PERIOD Constant field that contains a the "." character.

Back to Top


Functions

Access Return Name Description
Public Static EntityStatePdu DeepCopyEntityStatePDU(EntityStatePdu EntityStatePDUIn) Deep copies an Entity State PDU.
Public Static UInt64 EntityIDToUInt64(FEntityID entityID) Converts a DIS Entity ID to a UInt64.
Public Static UInt64 EntityTypeToUInt64(FEntityType entityType) Converts a DIS Entity Type to a UInt64.
Public Static string getEntityStatePDUMarkingSAE(EntityStatePdu entityStatePdu) Gets the Marking and Entity ID from the given Entity State PDU and converts them to a combined string.
Public Static string getEntityTypeAsString(EntityStatePdu entityStatePdu) Gets the Entity Type from the given Entity State PDU and converts it to a string.
Public Static string getMarkingAsString(EntityStatePdu entityStatePdu) Gets the Marking from the given Entity State PDU and converts it to a string.
Public Static Marking getStringAsMarking(string stringToConvert) Converts a given string to a DIS Marking.
Public Static UInt64 ThreeUShortsToUInt64(ushort low, ushort mid, ushort high) Converts the given ushorts to a UInt64.
Public Static string UInt64ToString(UInt64 uInt64) Converts the given UInt64 to a string.

Back to Top


Details

DELIMITER_PERIOD

public const string DELIMITER_PERIOD = "."

Constant field that contains a the "." character.

Back to Top


DeepCopyEntityStatePDU

public static EntityStatePdu DeepCopyEntityStatePDU
(
    EntityStatePdu EntityStatePDUIn
)

Deep copies an Entity State PDU.

Parameter Description
EntityStatePDUIn The Entity State PDU to make a deep copy of.
Returns
The deep copied Entity State PDU.

Back to Top


EntityIDToUInt64

public static UInt64 EntityIDToUInt64
(
    EntityID entityID
)

Converts a DIS Entity ID to a UInt64.

Parameter Description
entityID The Entity ID to convert.
Returns
The UInt64 representation of the Entity ID.

Back to Top


EntityTypeToUInt64

public static UInt64 EntityTypeToUInt64
(
    EntityType entityType
)

Converts a DIS Entity Type to a UInt64.

Parameter Description
entityType The Entity Type to convert.
Returns
The UInt64 representation of the Entity Type.

Back to Top


GetEntityStatePDUMarkingSAE

public static string getEntityStatePDUMarkingSAE
(
    EntityStatePdu entityStatePdu
)

Gets the Marking and Entity ID from the given Entity State PDU and converts them to a combined string.

Parameter Description
entityStatePdu The Entity State PDU to get the string representation of the Marking and Entity ID from.
Returns
The string representation of the Marking and Entity ID.

Back to Top


GetEntityTypeAsString

public static string getEntityTypeAsString
(
    EntityStatePdu entityStatePdu
)

Gets the Entity Type from the given Entity State PDU and converts it to a string.

Parameter Description
entityStatePdu The Entity State PDU to get the string representation of the Entity Type from.
Returns
The string representation of the Entity Type.

Back to Top


GetMarkingAsString

public static string getMarkingAsString
(
    EntityStatePdu entityStatePdu
)

Gets the Marking from the given Entity State PDU and converts it to a string.

Parameter Description
entityStatePdu The Entity State PDU to get the string representation of the Marking from.
Returns
The string representation of the Marking.

Back to Top


GetStringAsMarking

public static Marking getStringAsMarking
(
    string stringToConvert
)

Converts a given string to a DIS Marking.

Parameter Description
stringToConvert The string to convert to a DIS Marking.
Returns
The DIS Marking.

Back to Top


ThreeUShortsToUInt64

public static UInt64 ThreeUShortsToUInt64
(
    ushort low,
    ushort mid,
    ushort high
)

Converts the given ushorts to a UInt64.

Parameter Description
low The least significant 16 bits.
mid The middle 16 bits.
high The most significant 16 bits.
Returns
The UInt64 representation of the 3 given ushorts.

Back to Top


UInt64ToString

public static string UInt64ToString
(
    UInt64 uInt64
)

Converts the given UInt64 to a string.

Parameter Description
uInt64 The UInt64 to convert to a string.
Returns
The string representation of the UInt64.

Back to Top