[IGSTK-Developers] Re: SerialCommunicationSimulator data file format
David Gobbi
dgobbi at atamai.com
Tue Jul 19 20:58:25 EDT 2005
Hee-su Kim wrote:
> Hi David:
>
> You're right.
>
> I know it doesn't support the binary stream yet.
>
> I planned to use the number of bytes in the stream file but I missed
> the point with the std::string.
>
> I'll go to a VTK course in this week, so I'll make modification next
> week or you can do that in this week.
I'll add it to the bug tracker. It doesn't have to be fixed
immediately, because right now we are only using ASCII data records with
the Aurora, but we don't want to forget about it either.
This week I'm dedicating a lot of time on code cleanup, so if I get
around to doing the fix before you are back from Kitware I'll let you know.
> Another issue is how to treat different responses with the same request.
>
> One option is to maintain a list of different responses for each
> request. Responses could be returned sequentially.
For testing, sequential responses are fine as long as the tests don't
change. I think it will be okay to get rid of the map and just use
sequential responses.
- David
>
> Regards,
> Hee-Su
>
> ----- Original Message ----- From: "David Gobbi" <dgobbi at atamai.com>
> To: "Hee-su Kim" <hkim at isis.imac.georgetown.edu>
> Cc: "IGSTK-developers" <igstk-developers at public.kitware.com>
> Sent: Tuesday, July 19, 2005 7:58 PM
> Subject: SerialCommunicationSimulator data file format
>
>
>> Hi Hee-Su,
>>
>> I've taken a look at the simulator data file and it the
>> SerialCommunicationSimulator and it misses one of the requirements:
>> it isn't able to handle binary data streams.
>>
>> The difference between an ASCII data stream and a binary data stream
>> is that the bytes in an ASCII stream only contains ASCII characters,
>> that is, the byte values are always in the range [1,127].
>>
>> The bytes in a binary stream can have any value in the range
>> [0,255]. A binary stream can contain zeros, but an ASCII stream cannot.
>> A chunk of binary data cannot be stored in a C++ string, because a
>> C++ string cannot contain a zero byte, except at the very end.
>>
>> The reason that this is important is that virtually all tracking
>> systems do at least some communication using binary data, for example
>> we cannot support the Aurora's BX "binary transform" command unless
>> we can communicate with binary data, and tracking systems like the
>> Flock of Birds always communicate transforms with binary data.
>>
>> In summary:
>>
>> The Communication classes cannot store their input or data in C++
>> strings. The data must either be stored in a char array e.g. char
>> data[1024], or in a C++ vector. Or perhaps, going along with Luis'
>> philosophy on these things, we should define our own data container
>> type for this purpose.
>>
>> The file format for the CommunicationSimulator data file will also
>> have to be adjusted, because it doesn't support binary data either.
>> On my wiki design page for SerialCommunicationSimulator I specified a
>> file format that stored the number of bytes used by every sent and
>> received data record, but the file format used by the simulator
>> doesn't appear to follow that design.
>>
>> - David
>>
>
>
More information about the IGSTK-Developers
mailing list