# Version 22. 7. 2005 # Extracted cenQx, cenQz etc. macros into dtp_qcen.mac, as 'dtpHelp' already # reports. By Petr. # Version 1. 8. 2000 # Updated by Petr Mikulik # Written by Daniel Luebbert # Requirements: no ############################################################################### ############################# cen ########################################### ############################################################################### # this goes to the center between half height points of the last scan def cen '{ # Problem: it does so only for one motor. Dangerous in a2scan etc. # Solution: Insert a loop over all motors? # local cenCounter # for ( cenCounter=0; cenCounter<_nm; cenCounter++ ) { # ... _nm = number of motors in scan printf("\nMoving %s motor from %9.4f to the CEN of last scan at %9.4f\n\n",\ motor_mne(_m[0]),A[_m[0]],CEN) printf("(Last scan was %s: %s)\n\n",SCAN_N,HEADING) waitmove; get_angles A[_m[0]] = CEN _plot_line CEN move_em # } }' ############################################################################### ############################# cenmass ####################################### ############################################################################### def cenmass '{ printf("\nMoving %s motor from %9.4f to the COM of last scan at %9.4f\n\n",\ motor_mne(_m[0]),A[_m[0]],pl_COM) printf("(Last scan was %s: %s)\n\n",SCAN_N,HEADING) waitmove; get_angles; A[_m[0]] = pl_COM _plot_line pl_COM move_em #} }' ############################################################################### ############################# pk ############################################ ############################################################################### # needef later, for some reasons def pk 'pl_xMAX' ############################################################################### ############################# pic ########################################### ############################################################################### def pic '{ # this goes to the peak of the last scan printf("\nMoving %s motor from %9.4f to the PEAK of last scan at %9.4f\n\n",motor_mne(_m[0]),A[_m[0]],pk) printf("(Last scan was %s: %s)\n\n",SCAN_N,HEADING) waitmove; get_angles; A[_m[0]] = pk _plot_line pl_xMAX move_em }' #def pic '{ ## this goes to the peak of the last scan # waitmove; get_angles; # printf("(\nLast scan was %s: %s)\n",SCAN_N,HEADING) # for(n=0;n<_nm;n++){ # printf("\nMoving motor %s from %9.4f to the PEAK of last scan at %9.4f\n\n",motor_mne(_m[n]),A[_m[n]],pk); # A[_m[0]] = pk; # } # _plot_line pl_xMAX # move_em #}' ############################################################################### ############################# where ######################################### ############################################################################### # draw a line in the plot of the last (motor) scan at the actual position def where '{ _plot_line A[_m[0]]; p "Motor ",motor_mne(_m[0]),"is at ",A[_m[0]] }' ###################################################################### # plotting stuff # ###################################################################### # adds one vertical line to an existing plot; takes x position as argument def _plot_line '{ data_grp(1,2,2) data_nput(1,0,$1,(pl_MIN>0)?pl_MIN:1) data_nput(1,1,$1,pl_MAX) plot_cntl("addline") data_plot(1,0,2,0,1) }' # eof dtp_cen.mac