def dcamplifier(): ampstat = request.args.get('ampstat') # print(type(ampstat)) if ampstat == 'true': global Amp Amp = DC.amplifier() print("Amplifier Initialized") elif ampstat == 'false': Amp.close() print("Amplifier Closed") return jsonify(ampstat=Amp.state)
def dcmeasureivcurve(): V0, I, Vb = [], [], [] vrange = waveform(request.args.get('vrange')) mdelay = float(request.args.get('mdelay')) mwaiting = float(request.args.get('mwaiting')) ivcurve = DC.measure(delay=mdelay*1e-3, waiting=mwaiting*1e-3, samps_per_chan=vrange.count) print("DC Measurement Started") read_values = ivcurve.IVb(vrange.data) V0 = list(read_values[0]) #ai0 I = list(read_values[3] / Amp_Rb) #ai3 Vb = [x/Amp_Div for x in vrange.data] ivcurve.close() print("DC Measurement Closed") return jsonify(state=ivcurve.state, V0=V0, I=I, Vb=Vb)