Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c9ba0c9
refactor: make all Record classes inherit from a Record base class in…
ngjunsiang Oct 6, 2025
5173b9d
feat: add static method for validating bytelength parameter
ngjunsiang Oct 6, 2025
37b3f4a
fix: handle variable-size record classes correctly by subclassing Var…
ngjunsiang Oct 6, 2025
0f8785f
fix: parse VTPs correctly by reading recordLength first
ngjunsiang Oct 6, 2025
b19715a
feat: make Record and VariableRecord checkable with isinstance() and …
ngjunsiang Oct 6, 2025
b1682f5
refactor: use getVariableRecordClass getter function to retrieve Vari…
ngjunsiang Oct 6, 2025
519ad47
refactor: migrate Vector3Float to record namespace
ngjunsiang Oct 6, 2025
dd58862
refactor: migrate SimulationAddress and EventIdentifier to record nam…
ngjunsiang Oct 6, 2025
998045b
refactor: migrate SimulationAddress and EventIdentifier to record nam…
ngjunsiang Oct 6, 2025
6c1e685
refactor: migrate DirectedEnergyDamage to record namespace
ngjunsiang Oct 6, 2025
a7b9bb5
refactor: migrate DirectedEnergyRecords to record namespace
ngjunsiang Oct 6, 2025
4ccd7bd
refactor: migrate WorldCoordinates to record namespace; clean up forw…
ngjunsiang Oct 7, 2025
1a38e10
refactor: clean up forward references
ngjunsiang Oct 7, 2025
0f6582b
refactor: migrate EntityID and EntityIdentifier to record namespace
ngjunsiang Oct 7, 2025
e3b95d1
refactor: replace all use of EntityID with EntityIdentifier
ngjunsiang Oct 7, 2025
945d5e4
refactor: remove unused class EntityID
ngjunsiang Oct 7, 2025
6f6a01b
fix: enforce Record interface for EntityIdentifier, implement marshal…
ngjunsiang Oct 7, 2025
74166ce
refactor: replace all use of EntityID with EntityIdentifier
ngjunsiang Oct 7, 2025
c300159
refactor: remove unused class EntityID
ngjunsiang Oct 7, 2025
7b33978
refactor: implement VariableRecord interface for Directed Energy records
ngjunsiang Oct 7, 2025
7a1c41b
refactor: distinguish VariableRecords and StandardVariableRecords
ngjunsiang Oct 7, 2025
a929ac9
refactor: follow VariableRecord and StandardVariableRecord interfaces
ngjunsiang Oct 7, 2025
d1b708b
refactor: rename SVClass getter function
ngjunsiang Oct 7, 2025
a9b1604
feat: handle Directed Energy records in DirectedEnergyFirePdu
ngjunsiang Oct 7, 2025
ed93893
fix: fix type annotations
ngjunsiang Oct 7, 2025
c7d3c36
refactor: use common UnknownStandardVariableRecord for all unrecognis…
ngjunsiang Oct 7, 2025
2f659ef
feat: handle DirectedEnergy fire flags in DirectedEnergyFirePdu
ngjunsiang Oct 7, 2025
de003fd
chore: remove unused imports
ngjunsiang Oct 7, 2025
46aaf1c
fix: fix type annotation issues
ngjunsiang Oct 7, 2025
0e49cf4
refactor: organise radio namespace by protocol family
ngjunsiang Oct 7, 2025
50b49e6
feat: handle StandardVariable damage description records in EntityDam…
ngjunsiang Oct 7, 2025
a0c66b6
refactor: migrate DataInputStream and DataOutputStream to stream
ngjunsiang Oct 7, 2025
d422bfa
refactor: use parseStandardVariableRecord helper to enforce consisten…
ngjunsiang Oct 7, 2025
828f15e
fix: typos
ngjunsiang Oct 7, 2025
78385a8
format: rename for consistency
ngjunsiang Oct 7, 2025
efdb502
fix: typos
ngjunsiang Oct 7, 2025
2ae417b
fix: typos, type checking
ngjunsiang Oct 7, 2025
e75c424
Merge pull request #2 from ngjunsiang/feat-record-class
ngjunsiang Oct 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/dis_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

import socket
import time
import sys
import array
from typing import cast

from opendis.dis7 import *
from opendis.RangeCoordinates import *
Expand All @@ -20,7 +19,7 @@

print("Listening for DIS on UDP socket {}".format(UDP_PORT))

gps = GPS();
gps = GPS()

def recv():
print('Reading from socket...')
Expand All @@ -31,6 +30,7 @@ def recv():
pduTypeName = pdu.__class__.__name__

if pdu.pduType == 1: # PduTypeDecoders.EntityStatePdu:
pdu = cast(EntityStatePdu, pdu) # for static checkers
loc = (pdu.entityLocation.x,
pdu.entityLocation.y,
pdu.entityLocation.z,
Expand All @@ -42,7 +42,7 @@ def recv():
body = gps.ecef2llarpy(*loc)

print("Received {}\n".format(pduTypeName)
+ " Id : {}\n".format(pdu.entityID.entityID)
+ " Id : {}\n".format(pdu.entityID.entityNumber)
+ " Latitude : {:.2f} degrees\n".format(rad2deg(body[0]))
+ " Longitude : {:.2f} degrees\n".format(rad2deg(body[1]))
+ " Altitude : {:.0f} meters\n".format(body[2])
Expand Down
8 changes: 4 additions & 4 deletions examples/dis_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from io import BytesIO

from opendis.DataOutputStream import DataOutputStream
from opendis.stream import DataOutputStream
from opendis.dis7 import EntityStatePdu
from opendis.RangeCoordinates import *

Expand All @@ -23,9 +23,9 @@
def send():
pdu = EntityStatePdu()

pdu.entityID.entityID = 42
pdu.entityID.siteID = 17
pdu.entityID.applicationID = 23
pdu.entityID.entityNumber = 42
pdu.entityID.simulationAddress.site = 17
pdu.entityID.simulationAddress.application = 23
pdu.marking.setString('Igor3d')

# Entity in Monterey, CA, USA facing North, no roll or pitch
Expand Down
103 changes: 0 additions & 103 deletions opendis/DataInputStream.py

This file was deleted.

103 changes: 0 additions & 103 deletions opendis/DataOutputStream.py

This file was deleted.

Loading