def setUp(self): vna = Vna() vna.open_tcp() vna.clear_status() vna.manual_sweep = True timeout_ms = 2 * vna.sweep_time_ms + 5000 vna.start_sweeps() vna.pause(timeout_ms) self.vna = vna
def setUp(self): root_path = get_root_path() / "test_diagram" serial_no = "123" by_serial_no = True self.path = SavePath(root_path, serial_no, by_serial_no) vna = Vna() vna.open_tcp() vna.clear_status() vna.manual_sweep = True timeout_ms = 2 * vna.sweep_time_ms + 5000 vna.start_sweeps() vna.pause(timeout_ms) self.vna = vna self.settings = default_settings.copy()
def setUp(self): source_root = os.path.dirname(os.path.realpath(__file__)) self.source_root = Path(source_root) root_path = get_root_path() / "test_html" serial_no = self.serial_no = "123" by_serial_no = True self.path = SavePath(root_path, serial_no, by_serial_no) vna = Vna() vna.open_tcp() vna.clear_status() vna.manual_sweep = True timeout_ms = 2 * vna.sweep_time_ms + 5000 vna.start_sweeps() vna.pause(timeout_ms) self.vna = vna self.settings = default_settings.copy()
now = timestamp() # set file args.set_file = args.set_file or vna.active_set vna.open_set(args.set_file) vna.active_set = args.set_file # make data directory data_path = args.data_path / f'{now}_{args.set_file}' data_path.mkdir() # turn screen off (speed improvement) vna.settings.display = False # sweep, measure time vna.manual_sweep = True vna.sweep_count = args.sweep_count total_time_s = default_time_s(vna.sweep) time_per_sweep_s = total_time_s / args.sweep_count # save timing info timing_info_file = data_path / 'timing_info.csv' with timing_info_file.open('w') as f: header = [ 'sweep_count', 'total_time_s', 'time_per_sweep_s'] data = [args.sweep_count, total_time_s, time_per_sweep_s ] csvwriter = csv.writer(f) csvwriter.writerow(header) csvwriter.writerow(data) # save trace history