Menu

DataPDU Example?

Mike
2014-06-03
2018-02-04
  • Mike

    Mike - 2014-06-03

    Does anyone have an example of creating / sending a DataPDU? (C# preferred)

    I want to create a DataPDU with 10 fixed (4 int, 6 float) and 1 variable (string) datums and I’m not understanding the DataPDU datum constructs.

    Any help would be appreciated.

    Mike

     

    Last edit: Mike 2014-06-03
  • robert j ducharme

    I recognize this post is old but I came here wondering how to encode floats as ints for packaging in fixed datums using java. The simple answer I eventually found (and the post did help) was to convert each float / double to a byte array and then the byte array to an int. With this little bit of additional understanding, fixed datums work great in open dis and the use of java creates no special problems that I have been able to find.

     
  • robert j ducharme

    Hi Leif,
    This is good information.I was actually using open-dis 4.09. I did recently pull this old code and update it to fix a crashing issue in VariableDatum.java at line 114. It seems from a quick read that I could have just updated to the git hub project and also got other nice features such as the removal of all the unused imports. I will do this soon and report back if I find any problems.

    Thank you for all your hard work on this project.

    Robert

     
    • Don McGregor

      Don McGregor - 2018-01-30

      Yes, the original source code was created from an XML description

      of the classes and attributes. That made it easy to generate

      implementations for other languages (C++, Javascript, a few others)

      that works reasonably well, but it's not really practical to regenerate

      code libraries by applying Unix-style patches when a lot of people

      don't run Unix and are thus unable to fix it. The update process

      for cross-platform dev environments is just too annoying and

      complex, though it would be nice to have any future languages

      generated correctly.

      So just working with the code generated by the older XML template

      is the way to go. Doing git updates to the central repo is good and

      not that obscure.


      From: robert j ducharme robertjducharme@users.sourceforge.net
      Sent: Sunday, January 28, 2018 6:40:33 PM
      To: [open-dis:discussion]
      Subject: [open-dis:discussion] DataPDU Example?

      Hi Leif,
      This is good information.I was actually using open-dis 4.09. I did recently pull this old code and update it to fix a crashing issue in VariableDatum.java at line 114. It seems from a quick read that I could have just updated to the git hub project and also got other nice features such as the removal of all the unused imports. I will do this soon and report back if I find any problems.

      Thank you for all your hard work on this project.

      Robert


      DataPDU Example?


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/open-dis/discussion/general/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
  • robert j ducharme

    Don and Leif,
    I took your advice and updated to the git hub project. It works great. Easy to build and no bugs that I've been able to find.

    Thank You!

    Robert

     
MongoDB Logo MongoDB