Page 1 of 1

Creating a file import plugin, need to set number format

Posted: Tue Mar 05, 2013 12:15 pm
by Gogeta70
Hi, i'm creating a DPlot plugin to import a custom file format that is generated by another program i wrote. This program takes data from electrical meters that monitor amps and voltage over a period of time.

Basically, i need to generate a line graph that uses the Y axis as the voltage and amp values, and the X axis represents a period of time. I've read over the help file in DPlot regarding developing plugins as well as the plugin examples and the DPlot.h header file, however i haven't found anything that suggests i can set the number format for the X axis.

I did see that in the DPlot help file, it shows an lpszCommands string for the DPLOT structure, but i could not find that in the DPlot.h header file (which supports up to version 4).

Am i missing something here? DPlot is a great solution for what i need, but i have to be able to represent dates and times along the X axis.

Posted: Tue Mar 05, 2013 4:13 pm
by DPlotAdmin
Search the DPlot Help file for plugins then scroll near the bottom for the DPLOT structure.

This is different than the structure used by calls to DPLOTLIB.DLL, which I think may have caused some confusion... except that I just noticed I included the wrong DPLOT.H with the plugin examples, so it's no wonder you were confused! I'll fix this soon. In the meantime just copy the DPLOT structure from the Help file and you should be good to go.

The lpszCommands string should contain commands in the same syntax you'd use when calling DPlot_Command in another application. For example to set the number format on the X axis to date & time you'd use

"[NumberFormat(0,13)]"

You can string as many commands together as you want, up to 32K.

Let me know if you have any questions.

Posted: Tue Mar 05, 2013 4:20 pm
by DPlotAdmin
I just replaced http://www.dplot.com/plugins.zip to include the correct header file. Sorry for the trouble.

Posted: Tue Mar 05, 2013 5:09 pm
by Gogeta70
Perfect! Thank you.

One more question, just so i'm sure.

Say i write a plugin to import a file that has say, 3 curves. For the second curve, do write to X and Y[DPlot->MaxPoints], and for the third curve X and Y[DPlot-MaxPoints * 2]?

Posted: Tue Mar 05, 2013 5:27 pm
by DPlotAdmin
Yes, that's correct.

Posted: Tue Mar 05, 2013 5:41 pm
by Gogeta70
Thanks for all the help! I'm finally getting somewhere with all this now. :)