12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- # NanoVNASaver
- #
- # A python program to view and export Touchstone data from a NanoVNA
- # Copyright (C) 2019, 2020 Rune B. Broberg
- # Copyright (C) 2020 NanoVNA-Saver Authors
- #
- # This program is free software: you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation, either version 3 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program. If not, see <https://www.gnu.org/licenses/>.
- import logging
- from collections import OrderedDict
- from time import sleep
- from typing import List, Iterator
- from Serial import Interface, drain_serial
- logger = logging.getLogger(__name__)
- class VNA:
- name = "VNA"
- wait = 0.05
- def __init__(self, iface: Interface):
- self.iface = iface
- self.valid_freq = None
- self.valid_power = None
- self.valid_bw = None
- self.valid_points = None
-
- self.freq_start = None
- self.power = None
- self.points = None
- self.bw = None
-
- def connect(self) -> bool:
- self.iface.open()
- return self.iface.isOpen()
- def disconnect(self) -> bool:
- self.iface.close()
- return not self.iface.isOpen()
- def reconnect(self) -> bool:
- self.iface.close()
- sleep(self.wait)
- self.iface.open()
- return self.iface.isOpen()
- def set_bw(self):
- pass
- def set_sweep(self, freq_start: float, freq_end: float, points: int):
- pass
- def get_bw(self) -> float:
- pass
- def get_sweep(self) -> List:
- pass
- def get_info(self) -> Dict:
- pass
- def run(self) -> List:
- pass
- def set_power(self, power: float):
- pass
- def get_power(self) -> float:
- pass
- def set_cal(self):
- pass
- def get_cal(self):
- pass
-
|