[Kst] Re: Creating Datasource Reader

Sonic get.sonic at gmail.com
Fri Mar 18 02:30:31 CET 2011

On 03/17/2011 12:49 PM, Brisset, Nicolas wrote:
> Hi,
>>       We've been using a package called Easyplot for all our plotting
>> needs and we're now considering Kst 1.8 on Linux. (Can't use Kst 2.x
>> series because we're on KDE 3.5 on RHEL 5).
> Just a quick note in case you're not aware of it: kst2 has far less
> dependencies than kst1 had. In particular, it is currently a pure Qt4
> app, which means kdelibs and all of its dependencies are not required.
> We are planning to offer optional KDE integration on the platforms where
> it is available, but it will stay optional.
We already have built Qt4 on RHEL and all our applications are developed 
in Qt4. I didn't know Kst 2.x was
pure Qt4. I was thinking that it required KDE4 libs.

> All in all, I'd tend towards kst2 unless you absolutely need scripting
> and need it fast (it will be brought back at some point in time, though
> not necessarily compatible with kst 1.x scripting).
In that case, I'd definitely try it out. But how do I implement custom 
datasource readers for 2.x?
If I remember right, for Kst 1.x, this was done as ordinary KDE3 
plugins. Is there a separate handbook for
custom readers for Kst 2.x?

>> Our plot files are single independent files that contain ASCII header
>> (that describe the number of columns, X&  y vectors, formatting etc.)
>> followed by ASCII or binary data. I'd like to know if I can make Kst
>> open and use the same plot file by creating a custom datasource
> reader.
> Plain ASCII files hould be supported out of the box, kst is really very
> configurable in that respect. Regarding binary files you'll probably
> have to make some changes. Creating a custom datasource is always
> possible and allows you anything.
> I'd recommend doing it in a generic way and contributing it to kst
> (preferably 2), so that we are able to help and so that others also
> benefit from your efforts. One thing which may be discussed is making
> the change directly in the ASCII datasource: if the only difference
> between your ASCII and binary options is the storage of the data, maybe
> adding a checkbox "binary data" and using a different approach to parse
> the file would make sense. To be discussed, here is the right place.
Actually, the problem is that the number of vectors, columns 
corresponding to x & y axes, data in ascii or binary etc. will be known 
only when the
header (ASCII) of the plot file is read. That's why I think a custom 
reader would be required, as we cannot simply call Kst with command line 
arguments to specify columns.

>> My requirement is that by opening the file in Kst, the plot should
>> appear, without the user needing to select more options or making more
>> clicks. It's okay if I need to call Kst with some command line
> options.
> I believe what you're asking for is already available: you can create a
> plot based on a data file, and reuse the same layout with another data
> file. You can even easily compare the two files using the "Change Data
> File" tool, be it kst 1.x or 2.x.
This is not exactly what I want. I want the plot file to contain the 
data so that I can simply share one file and someone else can simply 
open it as a plot by just clicking on it. I wouldn't want to open that 
file in Kst and then manually choose the vectors and plotting options. 
Just opening the file in Kst should bring up the plot as specified by 
the header information in the plot file. I guess this is already 
possible by creating a *.kst file and choosing to put the data inside 
it. But my requirement is to have the same behaviour for some other kind 
of plot file.

In short, my file will *not* be a *.kst file. Instead it'll be some 
other format (that contains an ASCII header followed by ASCII or binary 
data) which when opened by Kst should bring up the plot as written 
inside it's header.
I wanted to know if a custom reader would make this work.

Thanks for all the help. I really appreciate it.


Syam Krishnan

More information about the Kst mailing list