[Kst] Further enhancements to ASCII datasource

Brisset, Nicolas Nicolas.Brisset at eurocopter.com
Tue Jan 25 10:06:07 CET 2005

Once the code I sent yesterday is cleaned up and integrated (I can send
the complete file or generate another diff if it helps), here is what I
thought might be worth adding/changing:
- a combobox with different "formats", with the filename pattern used as
discriminator. You could e.g. associate "*.dat" with 0 header lines, no
variable names, free format and "*.csv" with 1 header line corresponding
to variable names, and a custom ";" separator, etc... The user could
then load a set of settings by just changing choices in the combobox. It
would also require 2 buttons to add/delete format definitions. This
could also be important to allow loading plots which use different file
formats as otherwise there is no possibility of changing datasource
settings while loading the .kst document.
- a lineedit with comma-separated field names that should be read as
time/dates (and the datasource would not use atof() but some other
function to read values that look like xx:xx or xx:xx:xx or even
xx:xx:xx.xxx for time, and xx/xx/xx or xx/xx/xxxx for dates)
- in the current implementation, non-numeric values are read with aotf
and in case it fails, values are set to 0. I don't know if that's the
fallback value used by atof() or rather the result of the initialization
to 0 with memset(). I suppose it would be better to arrange for the
values to be set to NaN when the characters read can't be converted to a

Thoughts ? Code ?


More information about the Kst mailing list