DECL/COMMON,CHAR,20, BARAXIS
DECL/LOCAL,INTGR, NUM, NUM_DO
decl/COMMON,REAL, ERROR1, ERROR2, MAXERROR, MINERROR, MAXMIN
decl/COMMON,REAL, VI, VJ, VK, VIABS, VJABS, VKABS
RECALL/D(MCS)
MODE/MAN
NUM_DO = PROMPT/'请输入打点数'
F(PT0)=FEAT/POINT,CART,0,0,0,0,0,1
MEAS/POINT, F(PT0), 1
ENDMES
D(CRD1) = TRANS/XORIG, FA(PT0), YORIG, FA(PT0), ZORIG, FA(PT0)
VI = OBTAIN/FA(PT0)[1],5
VJ = OBTAIN/FA(PT0)[1],6
VK = OBTAIN/FA(PT0)[1],7
VIABS = ASSIGN/ABS(VI)
VJABS = ASSIGN/ABS(VJ)
VKABS = ASSIGN/ABS(VK)
BARAXIS = ASSIGN/'请垂直 机械坐标轴方向 打点'
IF/(VIABS .GT. 0.95)
NUM = ASSIGN/3
IF/(VI .GT. 0)
BARAXIS = ASSIGN/' X 正 方向'
VI = ASSIGN/1
VJ = ASSIGN/0
VK = ASSIGN/0
ELSE
BARAXIS = ASSIGN/' X 负 方向'
VI = ASSIGN/-1
VJ = ASSIGN/0
VK = ASSIGN/0
ENDIF
ENDIF
IF/(VJABS .GT. 0.95)
NUM = ASSIGN/4
IF/(VJ .GT. 0)
BARAXIS = ASSIGN/' Y 正 方向'
VI = ASSIGN/0
VJ = ASSIGN/1
VK = ASSIGN/0
ELSE
BARAXIS = ASSIGN/' Y 负 方向'
VI = ASSIGN/0
VJ = ASSIGN/-1
VK = ASSIGN/0
ENDIF
ENDIF
IF/(VKABS .GT. 0.95)
NUM = ASSIGN/5
IF/(VK .GT. 0)
BARAXIS = ASSIGN/' Z 正 方向'
VI = ASSIGN/0
VJ = ASSIGN/0
VK = ASSIGN/1
ELSE
BARAXIS = ASSIGN/' Z 负 方向'
VI = ASSIGN/0
VJ = ASSIGN/0
VK = ASSIGN/-1
ENDIF
ENDIF
DID(DEFAULTSCREEN) = DEVICE/TERM,'SCREENOUTPUT'
OPEN/DID(DEFAULTSCREEN),FDATA,V(DEFAULTFORMAT),OUTPUT
WRITE/DID(DEFAULTSCREEN),''
WRITE/DID(DEFAULTSCREEN),BARAXIS
$$
MODE/PROG,MAN
$$
F(Point)=FEAT/POINT,CART,0,0,0,VI,VJ,VK
MEAS/POINT, F(Point), 1
PTMEAS/CART, 0,0,0,VI,VJ,VK
ENDMES
D(CRD2) = TRANS/XORIG, FA(Point), YORIG, FA(Point), ZORIG, FA(Point)
DECL/LOCAL,INTGR, I, II
DO/I,1,NUM_DO
F(Point)=FEAT/POINT,CART,0,0,0,VI,VJ,VK
MEAS/POINT, F(Point), 1
PTMEAS/CART, 0,0,0,VI,VJ,VK
ENDMES
ERROR1 = OBTAIN/FA(Point),NUM
ERROR1 = ASSIGN/ERROR1*1000
IF/(I .EQ. 1)
MAXERROR = ASSIGN/ERROR1
MINERROR = ASSIGN/ERROR1
ENDIF
IF/(ERROR1 .LT. MINERROR)
MINERROR = ASSIGN/ERROR1
ENDIF
IF/(ERROR1 .GT. MAXERROR)
MAXERROR = ASSIGN/ERROR1
ENDIF
IF/(MOD(I,2) .EQ. 0)
II = ASSIGN/I-1
WRITE/DID(DEFAULTSCREEN),' 第',II:3,' 点:',ERROR2:5:2,' 第',I:3,' 点:',ERROR1:5:2
ELSE
ERROR2 = ASSIGN/ERROR1
ENDIF
ENDDO
MAXMIN = ASSIGN/MAXERROR - MINERROR
WRITE/DID(DEFAULTSCREEN),''
WRITE/DID(DEFAULTSCREEN),BARAXIS,'——单点重复:',MAXMIN:2:2,', 最大:', MAXERROR:2:2,', 最小:', MINERROR:2:2