# Custom limit set macros to facilitate confocal work. Note that this is # one of the instances where you need both brackets and quotes def set_high '{ if (($# < 1) || ($# > 2 )){ eprint "Usage: set_high motor [high_limit]" exit } low_lm = get_lim($1, -1) if ($# == 2) { high_lm = dial($1, $2) } else { high_lm = dial($1, A[$1]); } _check0 "$1" if (!set_lim($1, low_lm, high_lm)) { onp printf("\n%s limits set to %g %g (dial units).\n",\ motor_name($1), get_lim($1, -1), get_lim($1, +1)) offp } }' def set_low '{ if (($# < 1) || ($# > 2 )){ eprint "Usage: set_low motor [low_limit]" exit } high_lm = get_lim($1, +1) if ($# == 2) { low_lm = dial($1, $2) } else { low_lm = dial($1, A[$1]); } _check0 "$1" if (!set_lim($1, low_lm, high_lm)) { onp printf("\n%s limits set to %g %g (dial units).\n",\ motor_name($1), get_lim($1, -1), get_lim($1, +1)) offp } }'