DPLOT structure lpszCommands parameter
Posted: Mon Mar 11, 2013 5:49 pm
I'm writing a file import plugin for dplot. Since a single curve can only contain up to 1024 points, i'm using multiple curves to represent a single line in a graph. Because of this, i need to set the curves that represent the same line to the same color.
The problem is that chaining together commands doesn't seem to work for the lpszCommands parameter in the DPLOT structure.
Currently, for testing, i just have my code settings all curves to the same color, but it doesn't work...
Here's the gist of the code relating to setting the lpszCommands value:
the fprintf() call writes data to a text file for debugging purposes. In this case, i have it write the contents of the lpszCommand variable to the text file. Here is the resulting command string:
The problem is that chaining together commands doesn't seem to work for the lpszCommands parameter in the DPLOT structure.
Currently, for testing, i just have my code settings all curves to the same color, but it doesn't work...
Here's the gist of the code relating to setting the lpszCommands value:
Code: Select all
// creating and zeroing out the commands variable
char *commands = new char[10000];
for(int i = 0; i < 10000; i++)
commands[i] = 0;
// inside the loop for setting the points for each curve
int clen = strlen(commands);
char addcmd[1000] = {0};
sprintf(addcmd, "[Color(%lu,255,0,0)]", DPlot->NumCurves);
strcpy(commands+clen, addcmd);
// just before returning PLUGIN_SUCCESS
fprintf(DEBUG, "%s\r\n", commands);
DPlot->lpszCommands = commands;
So why doesn't this work?[Color(1,255,0,0)][Color(2,255,0,0)][Color(3,255,0,0)][Color(4,255,0,0)][Color(5,255,0,0)][Color(6,255,0,0)][Color(7,255,0,0)][Color(8,255,0,0)][Color(9,255,0,0)][Color(10,255,0,0)]