-
大小: 460KB文件類型: .rar金幣: 2下載: 1 次發(fā)布日期: 2021-01-01
- 語言: 其他
- 標(biāo)簽: labwindows??cvi??graph??
資源簡介
使用過CVI的人都知道,CVI中有兩種波圖控件:Graph和StripChart。
其中StripChart是專門用來顯示實(shí)時(shí)波形的,其波形可以連續(xù)滾動顯示,但缺點(diǎn)是波圖中最多只能承載10K個(gè)采樣點(diǎn),超過的部分將從控件左端滾動出去。而Graph控件是專業(yè)顯示靜態(tài)波形的,它不限采樣點(diǎn)數(shù)(有多少個(gè)都可以顯示),同時(shí)還能鼠標(biāo)取值、放大縮小等等。
本例是使用Graph控件模仿StripChart來使用。
代碼片段和文件信息
#include?“toolbox.h“
#include?
#include?
#include?“graph.h“
#define?AXIS_X_MAX?30
static?int?panelHandle;
double?x1?=?0;
double?y1?=?0;
double?cx?=?0;?
int?mFlage=0;
int?plotHandle[10000];
int?plotCount=0;
int?plotdelCount=0;
int?gn=0;
int?main?(int?argc?char?*argv[])
{
if?(InitCVIRTE?(0?argv?0)?==?0)
return?-1; /*?out?of?memory?*/
if?((panelHandle?=?LoadPanel?(0?“graph.uir“?PANEL))?0)
return?-1;
DisplayPanel?(panelHandle);
//向Graph中添加一個(gè)十字光標(biāo)
SetCtrlAttribute?(panelHandle?PANEL_GRAPH?ATTR_NUM_CURSORS?1);
RunUserInterface?();
DiscardPanel?(panelHandle);
return?0;
}
int?CVICALLBACK?GraphCallback?(int?panel?int?control?int?eventvoid?*callbackData?int?eventData1?int?eventData2)
{
switch?(event)
{
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????12426??2014-08-07?16:06??graph.prj
?????文件???????3988??2014-08-07?16:39??graph.uir
?????文件????????128??2014-04-17?12:50??說明.txt
?????文件???????3546??2014-08-07?17:30??cvibuild.graph\build.ini
?????文件?????739840??2014-08-07?17:05??cvibuild.graph\Debug\graph.exe
?????文件?????125882??2014-08-07?17:05??cvibuild.graph\Debug\graph.nidobj
?????文件?????302048??2014-08-07?17:05??cvibuild.graph\Debug\resources.res
?????文件????????144??2014-08-07?17:05??cvibuild.graph\dependencies.bri
?????文件???????3175??2014-08-07?17:05??graph.c
?????文件????1132864??2014-08-07?17:05??graph.cdb
?????文件???????4822??2014-08-07?17:05??graph.cws
?????文件?????739840??2014-08-07?17:05??graph.exe
?????文件???????2014??2014-08-07?16:39??graph.h
?????目錄??????????0??2014-08-07?17:05??cvibuild.graph\Debug
?????目錄??????????0??2014-08-07?17:30??cvibuild.graph
-----------?---------??----------?-----??----
??????????????3070717????????????????????15
評論
共有 條評論