|
cvi的头文件*.h是自动生成的,摘录如下:
#define Main_PANEL 3
#define Main_PANEL_S1_32 2
#define Main_PANEL_S1_31 3
#define Main_PANEL_S1_30 4
#define Main_PANEL_S1_29 5
#define Main_PANEL_S1_28 6
#define Main_PANEL_S1_27 7
#define Main_PANEL_S1_26 8
#define Main_PANEL_S1_25 9
#define Main_PANEL_Chn_32 10
#define Main_PANEL_Chn_31 11
#define Main_PANEL_Chn_30 12
#define Main_PANEL_Chn_29 13
#define Main_PANEL_Chn_28 14
#define Main_PANEL_Chn_27 15
#define Main_PANEL_Chn_26 16
#define Main_PANEL_Chn_25 17
#define Main_PANEL_CHECKBOX_29 18
#define Main_PANEL_CHECKBOX_26 19
#define Main_PANEL_CHECKBOX_32 20
#define Main_PANEL_CHECKBOX_31 21
#define Main_PANEL_CHECKBOX_30 22
#define Main_PANEL_CHECKBOX_28 23
#define Main_PANEL_CHECKBOX_27 24
#define Main_PANEL_CHECKBOX_25 25
#define Main_PANEL_S1_24 26
#define Main_PANEL_S1_23 27
#define Main_PANEL_S1_22 28
可以看到相同的控件定义不连续,现在我想手动按照下面的方式来定义,如:
#define Main_PANEL 3
#define Main_PANEL_S1_1 2
#define Main_PANEL_S1_2 3
#define Main_PANEL_S1_3 4
. .
. .
. .
#define Main_PANEL_S1_30 31
#define Main_PANEL_S1_31 32
#define Main_PANEL_S1_32 33
#define Main_PANEL_Chn_1 34
#define Main_PANEL_Chn_2 35
#define Main_PANEL_Chn_3 36
. .
. .
. .
#define Main_PANEL_Chn_30 63
#define Main_PANEL_Chn_31 64
#define Main_PANEL_Chn_32 65
. .
. .
. .
这样定义后,在编程的时候就可以通过对控件句柄简单的加减计算来得到控件所在通道的编号.
但是为什么我手动可以修改,但只要我一改动主面板上任何一个控件的大小或者位置,然后保存,
头文件又恢复到原来的形式?不知道这是什么原因?还是我在设计面板的时候有什么不对的地
方?请高手多多指点! |
|