Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 292 → Rev 315

/cvi/instr/AitSipmDAQ/AitGui.c
543,7 → 543,7
MIKRO_Init(2,0);
#endif
#ifdef uSMC_USB
uSMC_Open();
if (uSMC_Open()) MessagePopup("SMC Error","SMC Open Failed");
for (int i=0; i<3; i++) {
node[i]=uSMC_FindSerial(serials[i])+1;
uSMC_Init(node[i],1);
741,6 → 741,16
direction = -1;
GetCtrlVal(panel, SCAN_STEPY, &step);
break;
case SCAN_BF :
axis = 3;
direction = 1;
GetCtrlVal(panel, SCAN_STEPZ, &step);
break;
case SCAN_BB :
axis = 3;
direction = -1;
GetCtrlVal(panel, SCAN_STEPZ, &step);
break;
}
#ifdef MIKRO
{
749,6 → 759,7
MIKRO_GetPosition(axis,&n);
if (axis == 1) SetCtrlVal (panel, SCAN_XP, n);
if (axis == 2) SetCtrlVal (panel, SCAN_YP, n);
if (axis == 3) SetCtrlVal (panel, SCAN_ZP, n);
}
#endif // MIKRO
759,6 → 770,7
uSMC_GetPosition(node[axis-1],&n);
if (axis == 1) SetCtrlVal (panel, SCAN_XP, n);
if (axis == 2) SetCtrlVal (panel, SCAN_YP, n);
if (axis == 3) SetCtrlVal (panel, SCAN_ZP, n);
}
#endif // MIKRO
}
814,10 → 826,32
return 0;
}
 
int CVICALLBACK GoZCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
int n2;
switch (event) {
case EVENT_COMMIT:
GetCtrlVal (panel, SCAN_ZG, &n2);
#ifdef MIKRO
MIKRO_MoveTo(3,n2);
MIKRO_GetPosition(3,&n2);
 
#endif
#ifdef uSMC_USB
uSMC_MoveTo(node[2],n2);
uSMC_GetPosition(node[2],&n2);
#endif
SetCtrlVal (panel, SCAN_ZP, n2);
break;
}
return 0;
}
 
 
int CVICALLBACK GetCurrentPositionCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
 
int n[2];
int n[3];
switch (event) {
case EVENT_COMMIT: {
#ifdef MIKRO
825,6 → 859,8
SetCtrlVal (panel, SCAN_XP, n[0]);
MIKRO_GetPosition(2,&n[1]);
SetCtrlVal (panel, SCAN_YP, n[1]);
MIKRO_GetPosition(3,&n[2]);
SetCtrlVal (panel, SCAN_ZP, n[2]);
#endif
#ifdef uSMC_USB
uSMC_GetPosition(node[0],&n[0]);
831,6 → 867,8
SetCtrlVal (panel, SCAN_XP, n[0]);
uSMC_GetPosition(node[1],&n[1]);
SetCtrlVal (panel, SCAN_YP, n[1]);
uSMC_GetPosition(node[2],&n[2]);
SetCtrlVal (panel, SCAN_ZP, n[2]);
#endif
break;
}