open-dis / open-dis-java

Java implementation of the IEEE-1278.1 Distributed Interactive Simulation (DIS) application protocol v6 and v7 :boom:
Other
44 stars 35 forks source link

DIS time converter #65

Open joshserrin opened 5 years ago

joshserrin commented 5 years ago

We provide DisTime to convert System.currentimemillis to dis time but not a conversion back. Ideally, given a pdu time, get the millis since epoch equivalent. Does this library provide that or is anyone aware of the java code that successfully does the conversion?

leif81 commented 5 years ago

Hi @joshserrin , it sounds like it could be a useful addition to the DisTime class. Would you like to submit a pull request?

joshserrin commented 5 years ago

I don't have an implementation right now but if I write one I'll submit a PR. I'm just curious if other have implemented this function already.

A better description of the function would be 'Given a pduTime, convert to the millis since the top of the hour (since pduTimes are only relative to the hour)'.

a-keleher commented 1 year ago

Suggesting the attachment as an augmentation to ClockTime. It could go in DisTime, but this is where I would have expected it.

ClockTime.java.txt

leif81 commented 10 months ago

@a-keleher sorry for the long delay. Would you be able to submit this as a pull request so that the proposed change can be reviewed?