From: John O. <joh...@gm...> - 2007-08-30 15:58:19
|
I did something similar not long ago: Each header does come with a time stamp since the start of the simulation, my solution was to simply record the most recent time stamp. The best position to do this seems to be in "read (int interf, int index)" in PlayerClient.java, after the line: header = readHeader (); you could add something like: if(header.getTimestamp()>currentTime) { currentTime = header.getTimestamp(); } then a getter method on currentTime in PlayerClient would allow you to get the latest time. I have attached my version of http://www.nabble.com/file/p12410309/PlayerClient.java PlayerClient.java . Its not exactly the most eligent way of doing this since PlayerClient shouldnt realy be storing this type of information but it works. Let me know if you have any problems Thanks John sarahb-2 wrote: > > > > I am developing a simulation using Stage and have run into a problem. > With > the old C++ client, it was very easy to get the simulation time. However, > I > can't seem to find a way to get the time since start of simulation using > the > JavaClient. > > If there is a way, does anyone know what it is? If not, can anyone point > me > in the right direction on how to add this feature to the JavaClient? > > Thanks for any help. > > Sarah > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Java-player-users mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-player-users > > -- View this message in context: http://www.nabble.com/simulation-clock-tf4345003.html#a12410309 Sent from the java-player-users mailing list archive at Nabble.com. |