|
最近我使用了数据驱动功能,但是很奇怪出现了一些古怪问题:
table = "zuobiao.xls";
ddt_close(table);
rc = ddt_open(table, DDT_MODE_READ);
if (rc!= E_OK && rc != E_FILE_OPEN)
pause("Cannot open table.");
ddt_get_row_count(table,table_RowCount);
function L_SetItemUnderBasicDimension(DimensionMethod,second,third,fourth,fifth,sixth)
{
auto result = E_OK;
win_activate (gProductName);
set_window (gProductName, 1);
obj_mouse_click ("标注工具", 14, 15, LEFT);#点击标注工具栏上的标注命令
switch (DimensionMethod)
{
case 0:
win_activate (gProductName);
set_window (gProductName, 1);
list_select_item("标注类型","基本标注");#选取标注类型
# obj_mouse_click("Afx:400000:2b",371,218);
# obj_mouse_click("Afx:400000:2b",602,351);
#
for(table_Row = 1; table_Row <= table_RowCount; table_Row ++)
{
ddt_set_row(table,table_Row);
win_activate (gProductName);
set_window (gProductName, 1);
obj_mouse_click("Afx:400000:2b",ddt_val(table, "x1") ,ddt_val(table, "y1") );
}
#
if(second==0)
L_SetListItem("标注2","文字平行");
else
L_SetListItem("标注2","文字水平");
if(third ==0)
L_SetListItem("标注3","长度");
else
L_SetListItem("标注3","直径");
if(fourth==0)
L_SetListItem("标注4","正交");
else
L_SetListItem("标注4","平行");
if(fifth==0)
L_SetListItem("标注5","文字居中");
else
L_SetListItem("标注5","文字拖动");
if(sixth==0)
L_SetListItem("标注6","文字有边框");
else
L_SetListItem("标注6","文字无边框");
break;
case 1:
if( second==0)
L_SetListItem("标注2","文字平行");
else
L_SetListItem("标注2","文字水平");
if(third==0)
L_SetListItem("标注3","正交");
else
L_SetListItem("标注3","平行");
if(fourth==0)
L_SetListItem("标注4","文字有边框");
else
L_SetListItem("标注4","文字无边框");
break;
#
# case 2:
# case 3:
# case 4:
# case 5:
# cae 6:
# case 7:
# case 8:
default:
report_msg("ERROR Occured when selecting item");
}
return result;
}
下面是我的主程序,(一部分)其他的不是很重要
for(table_Row = 1; table_Row <= table_RowCount; table_Row ++)
{
ddt_set_row(table,table_Row);
istep++;
DimensionImg="DimensionImg"&istep;
StatusBarImg="StatusBarImg"&istep;
obj_mouse_click ("Afx:400000:2b", ddt_val(table, "PickX") , ddt_val(table, "PickY") , LEFT);
}
ddt_close(table);
现在问题是,我如果把运行的话,会有提示以下错误:
附件是图片。 |
|