Browse Source

fixed a few include issues

curiousmuch 2 years ago
parent
commit
d6a4e31303
8 changed files with 19 additions and 8 deletions
  1. 1 1
      Calibration.py
  2. 1 1
      Hardware.py
  3. 9 5
      NanoVNA_V2.py
  4. 1 1
      RFTools.py
  5. BIN
      media/nanoVNA_commands.png
  6. BIN
      media/nanoVNA_fifo_format.png
  7. BIN
      media/nanoVNA_registers.png
  8. 7 0
      setup.py

+ 1 - 1
Calibration.py

@@ -26,7 +26,7 @@ from typing import List
 
 from scipy.interpolate import interp1d
 
-from RFTools import Datapoint
+from .RFTools import Datapoint
 
 RXP_CAL_LINE = re.compile(r"""^\s*
     (?P<freq>\d+) \s+

+ 1 - 1
Hardware.py

@@ -26,7 +26,7 @@ import serial
 from serial.tools import list_ports
 
 
-from Serial import drain_serial, Interface
+from .Serial import drain_serial, Interface
 
 
 logger = logging.getLogger(__name__)

+ 9 - 5
NanoVNA_V2.py

@@ -22,10 +22,10 @@ import time
 from struct import pack, unpack_from
 
 from time import sleep
-from typing import List
-from Serial import Interface
-from Calibration import Calibration
-from RFTools import Datapoint
+from typing import Dict, List
+from .Serial import Interface
+from .Calibration import Calibration
+from .RFTools import Datapoint
 
 __all__ = ['NanoVNA_V2_H4']
 
@@ -104,7 +104,7 @@ class NanoVNA_V2_H4:
 
     def __init__(self, iface: Interface = None):
         self.iface = iface
-        self.iface.open()
+        #self.iface.open()
 
         if platform.system() != "Windows":
             tty.setraw(self.iface.fd)
@@ -165,6 +165,10 @@ class NanoVNA_V2_H4:
         self.iface.open()
         return self.iface.isOpen()
 
+    def get_info(self):
+        reg = self.read_registers()
+        info = Dict()
+
     def _read_register(self, reg_name: str):
         if reg_name not in _NANOVNA_V2_REGS:
             raise ValueError(

+ 1 - 1
RFTools.py

@@ -24,7 +24,7 @@ from typing import Iterator, List, NamedTuple, Tuple
 import numpy as np
 from scipy.interpolate import interp1d
 
-from SITools import Format, clamp_value
+from .SITools import Format, clamp_value
 
 FMT_FREQ = Format()
 FMT_SHORT = Format(max_nr_digits=4)

BIN
media/nanoVNA_commands.png


BIN
media/nanoVNA_fifo_format.png


BIN
media/nanoVNA_registers.png


+ 7 - 0
setup.py

@@ -0,0 +1,7 @@
+from distutils.core import setup 
+
+setup(
+    name='curiousVNA',
+    version='0.1',
+    packages=['NanoVNA_V2', 'Hardware'] 
+)