Page 1 of 1
Double Precision Data in Plugin File Reader
Posted: Thu Jan 06, 2005 3:52 pm
by raswaim
Is there an interface to pass double precision values into dplot through the plugin/dlls? I've written a plugin for my data format, but I require finer time resolution for the x-axis than is possible with the float data type.... It appears that you must be using 'double' in your built-in readers already.
Thanks - RAS
Posted: Thu Jan 06, 2005 6:03 pm
by DPlotAdmin
Yes, though now that you mention it I notice that I haven't updated the plugin examples properly. I'll do that late tonight. In the meantime, the short version is:
#define PLUGIN_DOUBLES 32L
In plugin_init, return DataType as the actual data type + PLUGIN_DOUBLES.
In plugin_readfile the only difference is that the last 2 arguments are (double *) rather than (float *).
Posted: Thu Jan 06, 2005 9:14 pm
by raswaim
Excellent - with the added PLUGIN_DOUBLES flag and changed return types I'm up to the required precision. Thanks.
On a related question, is DATA_XYYY really not a valid plugin data type (as indicated in the example plugin comments)? My (very long) data files effectively consist of a number of synchronously sampled channels, and it seems a shame to have to take up space for the storage of redundant X values. Do you store redundant X values internally when you read a multicolumn ASCII/CSV file?
Posted: Thu Jan 06, 2005 9:37 pm
by DPlotAdmin
You're welcome. Glad it worked out easily.
Yes, DATA_XYYY isn't valid (nor is DATA_DXY). You guessed correctly: all of those redundant X values are stored in DPlot regardless of the data source, so nothing would be gained by using either of those 2 formats. All X values are stored because to do otherwise would become a bookkeeping problem - think appending other files, pasting data, truncating or otherwise operating on only one curve, etc.