Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #19361

Re: Suggestions please...

From rickman <gnuarm@gmail.com>
Newsgroups comp.lang.forth
Subject Re: Suggestions please...
Date 2013-02-01 19:12 -0500
Organization A noiseless patient Spider
Message-ID <kehllj$7b8$1@dont-email.me> (permalink)
References <bb7a586f-5cc7-4b57-8cb4-61786f1d40dc@googlegroups.com> <RpWdnU2pIZFSoZHMnZ2dnUVZ_qydnZ2d@supernews.com>

Show all headers | View raw


On 2/1/2013 5:08 PM, Elizabeth D. Rather wrote:
> On 2/1/13 11:14 AM, Howerd wrote:
>> Hi Forthers,
>>
>> I am logging two octet packet data streams - TX and RX on a data channel.
>> When I display these on a screen I use two different colours, but the
>> display takes too long and causes the data channel to timeout, so I
>> would like to store them into an array, and display them later.
>>
>> What is the best way to encode the channel info with the data so that
>> I can play back the captured packets with the correct colours?
>>
>> It would also be very useful if I could save the array to a file and
>> use an off-the-shelf editor to view the data.
>>
>> Some ideas :
>> 1. XML with Cascading Style Sheet - a bit wordy
>> 2. HDLC with first byte of each packet defining the colour
>> 3. ANSI escape sequences - need to escape the escape character
>> 4. RTF format - too complex?
>> 5. convert data to hex or base64 and use ASCII control characters
>> 6. use two arrays and a timestamp - this still needs a packet delimeter
>> 7. ???
>>
>> Apologies if this is slightly off-topic - the logging code is in
>> Forth, of course.
>>
>> Any suggestions welcome, particularly if someone has already solved
>> this problem and can provide working code, and access to a compatible
>> editor...
>
> Definitely segregate the recording of the data from display and/or
> formatting. I would certainly use separate buffers for the two streams,
> and then have a separate task running concurrently, picking up recorded
> data and encoding it appropriately if necessary, or writing it into a
> file for offline display.
>
> I'm not sure it's necessary to mess with the data, though. If you have
> the streams separate, it should be possible to feed them to, say, Excel
> and tell it to display each stream in the appropriate color.
>
> Cheers,
> Elizabeth

I'm not sure just what your constrains are, but I think Elizabeth has 
the right idea in separating the capture of the data and the display 
formatting.  But that is up to you.  I would not use two buffers since 
time stamping can be a bit complex, but that all depends, of course.  Do 
you need to display the arrival of each "octet" in sequence or just the 
order of arrival of the packets?  That is, do individual octets get 
interleaved?  If so, I think a two buffer approach would be PITA.  If 
you are only ordering the packets, then a time stamp would do fine, even 
if it just indicates order such as a sequence number.

If you want to use an off the shelf editor, obviously you *do* need to 
use a single buffer and include formatting.  I'm not familiar with 
editors that can do this easily.  There are lots of ANSI compatible 
terminals around though.

-- 

Rick

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Suggestions please... Howerd <howerdo@yahoo.co.uk> - 2013-02-01 13:14 -0800
  Re: Suggestions please... "Elizabeth D. Rather" <erather@forth.com> - 2013-02-01 12:08 -1000
    Re: Suggestions please... rickman <gnuarm@gmail.com> - 2013-02-01 19:12 -0500
      Re: Suggestions please... "Elizabeth D. Rather" <erather@forth.com> - 2013-02-01 16:28 -1000
        Re: Suggestions please... wiljan@nospam.pobox.com (Will Janoschka) - 2013-02-04 20:09 -0600
  Re: Suggestions please... Paul Rubin <no.email@nospam.invalid> - 2013-02-02 02:21 -0800
  Re: Suggestions please... Bernd Paysan <bernd.paysan@gmx.de> - 2013-02-02 15:01 +0100
  Re: Suggestions please... Howerd <howerdo@yahoo.co.uk> - 2013-02-02 09:04 -0800
    Re: Suggestions please... Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2013-02-02 18:18 +0000
      Re: Suggestions please... Howerd <howerdo@yahoo.co.uk> - 2013-02-04 04:13 -0800
  Re: Suggestions please... Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-02-04 17:20 -0800
  Re: Suggestions please... Brad Eckert <hwfwguy@gmail.com> - 2013-02-05 09:16 -0800

csiph-web