[Kst] readField() in a datasource

Brisset, Nicolas nicolas.brisset at airbus.com
Mon Jun 23 06:09:43 UTC 2014

Dear Nicholas,

My understanding is the same as yours regarding the expected arguments and the fact that frameCount should return the number of samples to read from the field. V is normally sized accordingly.
I can't really help further here, other than suggesting you to use QtCreator to debug (in case you're not doing so already) as it is very convenient. What value does frameCount() return and which s and n args do you receive in readField()?


-----Ursprüngliche Nachricht-----
Von: kst-bounces at kde.org [mailto:kst-bounces at kde.org] Im Auftrag von Nicholas Chapman
Gesendet: Samstag, 21. Juni 2014 00:31
An: kst
Betreff: [Kst] readField() in a datasource

Hi, I'm struggling with a bug with the FitsTable plugin.  I've discovered that on my mac, some Fits tables can't be read (Kst crashes), but those same files open fine on a different machine running linux.  Both are 64-bit.  My theory is that very long tables are causing the problem.  I would like some help understanding the
readField() function in a datasource.  For example, from FitsTable:
int FitsTableSource::readField(double *v, const QString& field, int s, int n) {

My understanding is that v is the array which needs to have values added to it.  Kst will read v to then plot the data.  n is then the length of v, which has already been allocated by Kst.

Is that correct?  If so, how does Kst know what the value of n should be for a given field?  I thought it was from the function, e.g.

int FitsTableSource::frameCount(const QString& field) const {

which should return the size of a given field.  If so, then I don't understand why the value of n passed to readField() is not the correct value.  I wonder if this is an int versus long int thing.


Nicholas Chapman
Kst mailing list
Kst at kde.org
Sitz der Gesellschaft / Registered Office: Donauwörth
Registergericht / Registration Court: Amtsgericht Augsburg HRB 16508
Vorsitzender des Aufsichtsrates / Chairman of the Supervisory Board: Guillaume Faury
Geschäftsführung / Board of Management:
Dr. Wolfgang Schoder, Vorsitzender / CEO; Friedrich-Wilhelm Hormel; Ralf Barnscheidt; Oliver Schenzle


This communication and the information it contains is intended for the addressee ( s ) named above and for no other persons or organizations.
It is confidential and may be legally privileged and protected by law. The unauthorized use, copying or disclosure of this communication
or any part of it is prohibited and may be unlawful.
If you have received this communication in error, kindly notify us by return e-mail and discard and/or delete the communication.
Thank you very much.
It is possible for e-mails to be intercepted or affected by viruses. Whilst we maintain virus checks on our e-mails, we accept no liability for viruses
or other material which might be introduced with this message.

More information about the Kst mailing list