#!/usr/bin/env python3
"""set burst mode
.. rst-class:: hidden
run_gpg.py [opts] uut
usage: set_burst.py [-h] [--rgm RGM] [--mbclk MBCLK] [--dx DX] [--gpg GPG]
[--sense SENSE] [--rtm_translen RTM_TRANSLEN]
[--post POST] [--trg TRG] [--hdmi_slave HDMI_SLAVE]
[--es_enable ES_ENABLE] [--trace TRACE] [--demux DEMUX]
uuts [uuts ...]
set_burst mode
positional arguments:
uuts uut
optional arguments:
-h, --help show this help message and exit
--rgm RGM mode RGM|RTM
--mbclk MBCLK notouch|FIN,FOUT
--dx DX dx d0|d1|d2
--gpg GPG source from gpg on|off
--sense SENSE rising|falling
--rtm_translen RTM_TRANSLEN transient length
--post POST shot length
--trg TRG shot trigger triplet
--es_enable ES_ENABLE 0 disables Event Signature
--trace TRACE 1: enable command trace
--demux DEMUX 0: do not demux
"""
import acq400_hapi
import argparse
## configure burst mode. call this if we import the class..
[docs]def run_shot(args, uuts):
for u in uuts:
u.s0.set_arm = 1
for u in uuts:
u.statmon.wait_armed()
# warning: this is a RACE for the case of a free-running trigger and multiple UUTs
if args.gpg == 'on':
for u in uuts:
u.s0.GPG_ENABLE = '1'
if args.trg == '1,1,1':
for u in uuts:
u.s0.soft_trigger
[docs]def disable_rgm_and_quit(uuts):
for u in uuts:
u.s1.RGM = 'OFF'
return 0
[docs]def run_main(args):
configure_and_run(args, [acq400_hapi.Acq400(u) for u in args.uuts])
[docs]def get_parser():
parser = argparse.ArgumentParser(description='Set burst and run shot')
parser.add_argument('--rgm', default='RTM', type=str, help="mode OFF|RGM|RTM")
parser.add_argument('--dx', default='d0', type=str, help='dx d0|d1|d2')
parser.add_argument('--gpg', default='off', type=str, help='source from gpg on|off')
parser.add_argument('--sense', default='rising', type=str, help='rising|falling')
parser.add_argument('--rtm_translen', default=1234, type=int, help='transient length')
parser.add_argument('--post', default=100000, type=int, help='shot length')
parser.add_argument('--pre', default=0, type=int, help='pre shot length')
parser.add_argument('--trg', default='1,0,1', type=str, help='shot trigger triplet')
parser.add_argument('--es_enable', default=1, type=int, help='0 disables Event Signature')
parser.add_argument('--demux', default=1, type=int, help='0: do not demux')
parser.add_argument('--config_only', default=1, type=int, help='1: configure RGM, do nothing else')
parser.add_argument('--clear_counters', default=0, type=int, help="clear counters (slow)")
parser.add_argument('uuts', nargs='+', help="uut")
return parser
if __name__ == '__main__':
run_main(get_parser().parse_args())