示例#1
0
def awgreset():
    global awgsess
    awgsess = AWG.InitWithOptions()
    AWG.Abort_Gen(awgsess)
    status = AWG.model(awgsess)  # model
    print('Model: %s (%s)' % (status[1], status_code(status[0])))
    return jsonify(message=awgsess)
示例#2
0
def awgabout():
    global awgsess
    message = []
    status = AWG.model(awgsess)  # model
    message += ['Model: %s (%s)' % (status[1], status_code(status[0]))]
    status = AWG.active_marker(awgsess)  # active marker
    message += ['Active Marker: %s (%s)' % (status[1], status_code(status[0]))]
    status = AWG.marker_delay(awgsess)  # marker delay
    message += ['Marker Delay: %s (%s)' % (status[1], status_code(status[0]))]
    status = AWG.marker_pulse_width(awgsess)  # marker pulse width
    message += [
        'Marker Pulse Width: %s (%s)' % (status[1], status_code(status[0]))
    ]
    status = AWG.marker_source(awgsess)  # marker source
    message += ['Marker Source: %s (%s)' % (status[1], status_code(status[0]))]
    status = AWG.predistortion_enabled(awgsess)  # predistortion enabled
    message += [
        'Predistortion Enabled: %s (%s)' % (status[1], status_code(status[0]))
    ]
    status = AWG.output_mode_adv(awgsess)  # advanced output mode
    message += [
        'Advanced Output Mode: %s (%s)' % (status[1], status_code(status[0]))
    ]
    status = AWG.arb_sample_rate(awgsess)  # sample rate
    message += ['Sample Rate: %s (%s)' % (status[1], status_code(status[0]))]

    return jsonify(message=message)
示例#3
0
def show():
    stat = 'No reading'
    global session
    if request.method == 'POST':
        if request.form.get('reset'):
            status, session = AWG.InitWithOptions()
            awgcache.update(Initialized=status)
        if request.form.get('marker'):
            active = request.form.get('active')
            status = AWG.active_marker(session, action=['Set', active])
            awgcache.update(Marker=status)
            delay = request.form.get('delay')
            status = AWG.marker_delay(session, action=['Set', float(delay)])
            awgcache.update(Delay=status)
        if request.form.get('model'):
            stat = AWG.model(session)

    return render_template("blog/awgonly.html", stat=stat)
示例#4
0
def show():
    global session
    status, ans, mark = None, None, {}

    if request.form.get('model'):
        stat = AWG.model(session)
        ans = stat[1]

    if request.form.get('gemarker'):
        stat = AWG.active_marker(session)
        mark = dict(active=stat[1])
        stat = AWG.marker_delay(session)
        mark.update(delay=stat[1])

    if request.form.get('reset'):
        status = AWG.InitWithOptions()
        session = status[1]
        return redirect('/')

    if request.form.get('semarker'):
        active = request.form.get('active')
        AWG.active_marker(session, action=['Set', active])
        delay = request.form.get('delay')
        AWG.marker_delay(session, action=['Set', float(delay)])
        return redirect('/')

    if request.form.get('closeawg'):  # or x == 1:
        AWG.close(session)
        return redirect('/')

    if request.form.get('esgon'):
        freq = request.form.get('frequency')
        powa = request.form.get('power')
        ESG.control(True, freq, powa)
        return redirect('/')

    if request.form.get('esgoff'):
        ESG.control(False)
        return redirect('/')

    return render_template('blog/combo.html', ans=ans,
                           mark=mark)  #this is where it really goes
示例#5
0
 def MODEL(session):
     wrapped = AWG.model(session)
     print(Fore.BLACK + Back.WHITE +
           "Inquired instrument's model: %s, Error: %s" %
           (wrapped[1], wrapped[0]))
     return
示例#6
0
def model():
    global session
    status = AWG.model(session)
    awgcache.update(Model=status)
    message = 'Model: %s (error: %s)' % (status[1], status[0])
    return jsonify(message=message)