|
要做一个绘图软件,能输入数据,然后记录,根据记录的8个数据,生成一个曲线
我的面板是
我的C文件是
#include <cvirte.h>
#include <userint.h>
#include "king.h"
static int panelHandle;
int k;
double x[8];
double y[8];
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((panelHandle = LoadPanel (0, "king.uir", read)) < 0)
return -1;
DisplayPanel (panelHandle);
RunUserInterface ();
DiscardPanel (panelHandle);
return 0;
}
int CVICALLBACK RingCallBack (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
GetCtrlVal(read,read_RING,&k);
SetCtrlVal(read,read_RING,k);
SetCtrlVal(read,read_X,x[k]);
SetCtrlVal(read,read_Y,y[k]);
break;
}
return 0;
}
int CVICALLBACK GetCallBack (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
GetCtrlVal(read,read_RING,&k);
SetCtrlVal(read,read_RING,k);
GetCtrlVal(read,read_X,&x[k]);
GetCtrlVal(read,read_Y,&y[k]);
break;
}
return 0;
}
int CVICALLBACK QuitCallBack (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
QuitUserInterface (0);
break;
}
return 0;
}
int CVICALLBACK DrawCallBack (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
PlotXY(read,read_DRAW,x[8],y[8],2000,VAL_DOUBLE,VAL_DOUBLE,VAL_THIN_LINE,VAL_EMPTY_SQUARE,VAL_SOLID,1,VAL_RED);
break;
}
return 0;
}
但总是出现2个错误71, 35 Type error in argument 3 to `PlotXY'; found 'double' expected 'pointer to void'.
71, 40 Type error in argument 4 to `PlotXY'; found 'double' expected 'pointer to void'
有人给我说是把x[8],y[8].改为,x,y
那我之前的数据怎么办呢?怎么读出来?
小弟在这纠结了1个星期了,请高手给讲讲,新手上路,希望大哥们讲的详细点~谢谢了~
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|