comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDL Strip Chart
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL Strip Chart [message #40897 is a reply to message #40896] Fri, 10 September 2004 07:42 Go to previous messageGo to previous message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
R.G. Stockwell wrote:
> <pestMay@gmail.com> wrote in message news:MIO%c.17702$iS.1208@newssvr29.news.prodigy.com...
>
>> For anyone involved in real-time data collection (e.g., atmospheric data,
>> heart-rate,
>> other physiological data) display this data as it arrives, say on a serial
>> port, is essential
>> in monitoring the data stream.
>>
>> There are many commercial hardware/software solutions (e.g., BIO-PAC) and an
>> IDL
>> competitor, MATLAB, has one. The X-axis is always time, and often there are
>> a number of
>> channels of data that might include an event marker (e.g., we just launched
>> the weather sound,
>> a subject in an experiment pressed a button, etc.).
>>
>> Ed May
>
>
>
> I had a few minutes to kill before a meeting, so here is a quicky strip chart
> in direct graphics. It is not the most efficient thing ever, but it will give you
> a starting point.
>
> Cheers,
> bob
>

Hi,

I echo Paul, Cool!

I have added a few tidbits to control flashing (at least on my machine.) (1)
plotting is done to a pixmap then copied to the display and (2) a keepStart
keyword keeps the starting data postion in time.

I'll bet you the Mark H will pipe in here to mention that it is possible to do
this very smoothly with object graphics.


Ben

*********START

PRO stripchart, $
keepStart = keepStart

xr = [0,100]
yr=[-4,4]


keep = Keyword_Set(KeepStart)

Window, /free
thisWin = !D.window
xSize = !D.x_size
ySize = !D.y_size

Window, /free, /pixmap
pixWin = !D.window
plot,fltarr(1),xr=xr,yr=yr


wset, thisWin
; [Xs, Ys, Nx, Ny, Xd, Yd, W]
Device, copy = [0,0,xsize, ysize,0,0, pixWin]
wset, pixWin

timeincrement = 1 ; the sample interval
datacounter = 0

datatime = !values.f_nan
data = !values.f_nan



for i = 0,1000 do begin
; make measurement
newdata = (randomn(seed,1))[0]
datatime = [datatime,i]
data = [data,newdata]
datacounter = datacounter+1

if datacounter gt 50 then begin
;shift the axis - keep start position if requested
if keep then $
xr[1] = (xr[1] + timeIncrement) else $
xr = (xr + timeincrement)

;redraw data

plot,datatime,data,xr=xr,yr=yr,psym=-4


endif else begin

if i gt 0 then begin
plots,datatime[datacounter],data[datacounter],psym=-4, /data, /continue
endif else begin
plots,datatime[datacounter],data[datacounter],psym=4, /data
endelse

endelse

wset, thisWin
; [Xs, Ys, Nx, Ny, Xd, Yd, W]
Device, copy = [0,0,xsize, ysize,0,0, pixWin]
wset, pixWin

wait,0.1

endfor


end


******END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: CALL_EXTERNAL... unresolved?
Next Topic: Re: CALL_EXTERNAL... unresolved?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 09:19:15 PDT 2025

Total time taken to generate the page: 0.08481 seconds