def test_process_waveform(): with Rigol_DS1000Z(find_visa()) as oscope: oscope.autoscale() filename = "tests/test_process_waveform.csv" process_waveform(oscope.waveform(source=2), filename=filename) assert os.path.isfile(filename) os.remove(filename)
def test_process_display(): with Rigol_DS1000Z(find_visa()) as oscope: oscope.autoscale() filename = "tests/test_process_display_data.png" process_display(oscope.display(), filename=filename) assert os.path.isfile(filename) os.remove(filename)
def save_waveform(source, filename): with Rigol_DS1000Z(find_visa()) as oscope: try: source = int(source) except ValueError: pass finally: waveform = oscope.waveform(source=source) process_waveform(waveform, filename=filename)
def test_find_visa(): assert find_visa() == "USB0::0x1AB1::0x04CE::DS1ZA224812889::INSTR"
def oscope(): with Rigol_DS1000Z(find_visa()) as oscope: oscope.ieee(rst=True) yield oscope
def save_display(filename): with Rigol_DS1000Z(find_visa()) as oscope: display = oscope.display() process_display(display, filename=filename)