XForms: Problems with XYPlot

Timo Laitinen (timolai@utu.fi)
Mon, 05 Jan 1998 14:16:03 +0200 (EET)

To subscribers of the xforms list from Timo Laitinen <timolai@utu.fi> :

I'm trying to build a system for real-time data monitoring. Basically what I
need is a XY-plot with time on x-axis and some sort of a ring buffer ( or
shifting of static buffer) for adding the latest data to the end and removing
the first data from the beginning.

With just one plot: simple. With more than that?

If I set two plots and once a second update them both, the plots do not
update properly but occasionally tickmarks, axislabels etc. just flash and
disappear. This I managed to solve by using fl_set_object_dblbuffer(obj,1)
(without really understanding what it means. Could someone clarify?)
The same effect reappeared when I was using fl_freeze_form...

Next problem: using the same data on both plots I noticed, that occasionally
one of the plots was a second behind.
Using fl_redraw_form(form) produced REALLY weird results. About every other
second either or both of the plots and a button on the form disappeared! (not
exactly every other second, but randomly). Fortunately updating both plots
with fl_redraw_object(object) didn't have the same effect, so I could
continue.

The next problem can be put into a single question: WHY FLOAT? Why not
double, which is more accurate and useful (at least for me :-) )?

The natural selection for describing time is of course the unix definition
(seconds since 00:00:00 UTC Jan 1 1970). Unfortunately (at least in intel
linux) the mantissa of float is 24 bits long. With 24 bits you can represent
accurately only 16777216 seconds=194 days which is far too short a time.
Double's mantissa is (I think) 52 bits which would last for the next 100
million years...

I know that double takes more memory and in most plots float is more than
adequate, but at least I have shown one place where a better resolution would
be needed (I don't need year's plot with one second interval. I need a system
that can be used anytime...)

The only solution that I came up with was to use a static X-values from zero
to the width of the plot and use fl_add_xyplot_text/fl_delete_xyplot_text.
Again: Flashing.

Running out of options...

The last possible solution I have is to place X-values outside of the plot.

Is there any other way? Have I missed something? Something I
misunderstood? Anything else I could try? (I did try fl_clear_xyplot, but
still flashing...)

I'm running linuxelf 2.0.30, gcc 2.7.2, libc.so.5.3.12 and XFree 3.3.1 and
xforms-versions 0.86 and 0.88

----------------
Timo FABRICATI DIEM, PVNK.
email:timolai@utu.fi

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bloch.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/