[Kst] Further enhancements to ASCII datasource

George Staikos staikos at kde.org
Mon Jan 31 05:21:38 CET 2005

On Tuesday 25 January 2005 04:06, Brisset, Nicolas wrote:
> 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.

    Sounds like a good idea - basically "configuration templates".

> - 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)

   This is starting to get specialized, but I guess it would be useful too.

> - 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
> number...

   I once talked to Barth about our use of atof().  He said he likes the 
behavior of atof() with respect to failure and handling of unknown data.  
Barth, any comments?  Do we have some testcases for this?

George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/

More information about the Kst mailing list