Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Oct 2020 16:50:26 +0000 (UTC)
From:      Diane Bruce <db@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r552598 - in head/comms/nanovna-saver: . files
Message-ID:  <202010171650.09HGoQuL062225@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: db
Date: Sat Oct 17 16:50:25 2020
New Revision: 552598
URL: https://svnweb.freebsd.org/changeset/ports/552598

Log:
  Long overdue upgrade to 0.3.7
  Added Sysctl.py to handle retrieving pid/vid of comports [db]
  
  Changelog						[upstream]
  =========
  
  v0.3.7
  ------
  
  - Added a delta marker
  - Segments can now have exponential different step widths
    (see logarithmic sweeping)
  - More different data points selectable
    (shorter are useful on logarithmic sweeping)
  - Scrollable marker column
  - Markers initialize on start, middle, end
  - Frequency input is now more "lazy"
    10m, 50K and 1g are now valid for 10MHz, 50kHz and 1GHz
  - Added a wavelength field to Markers
  - 32 bit windows binaries build in actions
  - Stability improvements due to better exception handling
  - Workaround for wrong first S21mag value on V2 devices
  
  v0.3.6
  ------
  
  - Implemented bandwidth setting in device management
  
  v0.3.5
  ------
  
  - Sweep worker now initializes full dataset on setting changes.
    Therefore no resize of charts when doing multi segment sweep
  - Changing datapoints in DeviceSettings are reflected in SweepSettings widget step size
  - Simplified calibration code by just using scipy.interp1d with fill\_value
  - Established Interface class to ease locking and allow non usb connections in future
  - Cleaned up VNA code. Added some pause statements to get more robust readings
  - Added MagLoopAnalysis
  - Touchstone class can now generate interpolated Datapoints for a given frequency
    Will be usefull in future analysis code
  - Fixed a bug in Version comparison
  
  v0.3.4
  ------
  
  - Refactored Analysis
  - Add Antenna Analysis
  - Fixed bug in Through Calibration
  - Fixed bug in s2p saving
  - Fixed crash when clicking connect with no device connected
  - Fixed module error with source installation if
    pkg\_resources missing
  
  v0.3.3
  ------
  
  - Fixed data acquisition with S-A-A-2 / NanoVNA V2
  - Refactored calibration code
  - Calibration data between known datapoints in now
    interpolated by spline interpolation
  - Fixed through calibration
  
  v0.3.2
  ------
  
  - fixed crash with averaging sweeps
    also averaging now discards reading by geometrical distance
  
  v0.3.1
  ------
  
  - fixed crash with calibration assistant
  
  v0.3.0
  ------
  
  - Support for S-A-A-2 / NanoVNA V2
  - Support for 202 Datapoints/scan with NanoVNA-H
  - Support for attenuator at S11
  - Massive code separation to easy additon of
    Hardware, Charts, Analysis ...
  
  Known Issues
  ------------
  
  - -H / -H4 supports depends on Firmware

Added:
  head/comms/nanovna-saver/files/Sysctl.py   (contents, props changed)
  head/comms/nanovna-saver/files/patch-NanoVNASaver_Hardware_Hardware.py   (contents, props changed)
Deleted:
  head/comms/nanovna-saver/files/patch-NanoVNASaver_NanoVNASaver.py
Modified:
  head/comms/nanovna-saver/Makefile
  head/comms/nanovna-saver/distinfo   (contents, props changed)
  head/comms/nanovna-saver/files/patch-setup.py   (contents, props changed)

Modified: head/comms/nanovna-saver/Makefile
==============================================================================
--- head/comms/nanovna-saver/Makefile	Sat Oct 17 16:32:54 2020	(r552597)
+++ head/comms/nanovna-saver/Makefile	Sat Oct 17 16:50:25 2020	(r552598)
@@ -2,8 +2,7 @@
 
 PORTNAME=	nanovna-saver
 DISTVERSIONPREFIX=	v
-DISTVERSION=	0.2.2
-PORTREVISION=	2
+DISTVERSION=	0.3.7
 CATEGORIES=	comms hamradio
 
 MAINTAINER=	hamradio@FreeBSD.org
@@ -26,5 +25,8 @@ USE_GITHUB=	yes
 GH_ACCOUNT=	mihtjel
 
 NO_ARCH=	yes
+
+post-extract:
+	${CP} ${FILESDIR}/Sysctl.py ${WRKSRC}/NanoVNASaver/Hardware/
 
 .include <bsd.port.mk>

Modified: head/comms/nanovna-saver/distinfo
==============================================================================
--- head/comms/nanovna-saver/distinfo	Sat Oct 17 16:32:54 2020	(r552597)
+++ head/comms/nanovna-saver/distinfo	Sat Oct 17 16:50:25 2020	(r552598)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1578812631
-SHA256 (mihtjel-nanovna-saver-v0.2.2_GH0.tar.gz) = 82fa37fcd487cbafebd07751f76fc5bad42f7e6f1276008f5463f0256e17748f
-SIZE (mihtjel-nanovna-saver-v0.2.2_GH0.tar.gz) = 178819
+TIMESTAMP = 1602611094
+SHA256 (mihtjel-nanovna-saver-v0.3.7_GH0.tar.gz) = 4b2cb4e736855452ef0fcc198f4f467ab042857b7844aac973fa99de7eb128ad
+SIZE (mihtjel-nanovna-saver-v0.3.7_GH0.tar.gz) = 359208

Added: head/comms/nanovna-saver/files/Sysctl.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/comms/nanovna-saver/files/Sysctl.py	Sat Oct 17 16:50:25 2020	(r552598)
@@ -0,0 +1,23 @@
+import re
+from ctypes import *
+from ctypes.util import find_library
+
+libc = cdll.LoadLibrary(find_library("c"))
+sysctlbyname = libc.sysctlbyname
+
+def posix_sysctlbyname(name):
+    _len = c_uint(0)
+    result = sysctlbyname(name,None , byref(_len), None, 0)
+    _mem = create_string_buffer(_len.value)
+    result = sysctlbyname(name, _mem, byref(_len), None, 0)
+    if result != 0:
+        raise Exception('sysctlbyname returned with error %s' % result)
+    return _mem.value
+
+def usb_vid_pid(name):
+    digit = (re.search(r'\d',name)).group()
+    result = (posix_sysctlbyname(b'dev.umodem.'+bytes(digit,'ascii')+b'.%pnpinfo')).decode('ascii')
+    items=result.split(' ')
+    vendor=int(items[0].split('=')[1],0)
+    product=int(items[1].split('=')[1],0)
+    return([vendor,product])

Added: head/comms/nanovna-saver/files/patch-NanoVNASaver_Hardware_Hardware.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/comms/nanovna-saver/files/patch-NanoVNASaver_Hardware_Hardware.py	Sat Oct 17 16:50:25 2020	(r552598)
@@ -0,0 +1,33 @@
+--- NanoVNASaver/Hardware/Hardware.py.orig	2020-08-13 17:01:29 UTC
++++ NanoVNASaver/Hardware/Hardware.py
+@@ -32,6 +32,7 @@ from NanoVNASaver.Hardware.NanoVNA_H import NanoVNA_H
+ from NanoVNASaver.Hardware.NanoVNA_H4 import NanoVNA_H4
+ from NanoVNASaver.Hardware.NanoVNA_V2 import NanoVNA_V2
+ from NanoVNASaver.Hardware.Serial import drain_serial, Interface
++from NanoVNASaver.Hardware.Sysctl import usb_vid_pid
+ 
+ logger = logging.getLogger(__name__)
+ 
+@@ -61,8 +62,12 @@ def get_interfaces() -> List[Interface]:
+     interfaces = []
+     # serial like usb interfaces
+     for d in list_ports.comports():
+-        if platform.system() == 'Windows' and d.vid is None:
+-            d = _fix_v2_hwinfo(d)
++        if platform.system() == 'FreeBSD':
++            logger.debug("Found FreeBSD USB port %s", d.device)
++            vid_pid = usb_vid_pid(d.device)
++            d.vid = vid_pid[0]
++            d.pid = vid_pid[1]
++                
+         for t in USBDEVICETYPES:
+             if d.vid != t.vid or d.pid != t.pid:
+                 continue
+@@ -72,7 +77,6 @@ def get_interfaces() -> List[Interface]:
+             iface.port = d.device
+             interfaces.append(iface)
+     return interfaces
+-
+ 
+ def get_VNA(iface: Interface) -> 'VNA':
+     # serial_port.timeout = TIMEOUT

Modified: head/comms/nanovna-saver/files/patch-setup.py
==============================================================================
--- head/comms/nanovna-saver/files/patch-setup.py	Sat Oct 17 16:32:54 2020	(r552597)
+++ head/comms/nanovna-saver/files/patch-setup.py	Sat Oct 17 16:50:25 2020	(r552598)
@@ -1,36 +1,16 @@
---- setup.py.orig	2019-12-04 11:05:36 UTC
+--- setup.py.orig	2020-08-13 17:01:29 UTC
 +++ setup.py
-@@ -15,10 +15,11 @@
- #  along with this program.  If not, see <https://www.gnu.org/licenses/>.
- 
- import sys
-+import io
- from NanoVNASaver.about import version
- 
--if sys.version_info < (3, 7):
--    print("You need at least Python 3.7 for this application!")
-+if sys.version_info < (3, 3):
-+    print("You need at least Python 3.3 for this application!")
-     if sys.version_info[0] < 3:
-         print("try running with python3 {}".format(" ".join(sys.argv)))
-     sys.exit(1)
-@@ -30,7 +31,7 @@ except ImportError:
-     print("Try installing them with pip install setuptools")
-     sys.exit(1)
- 
--with open("README.md", "r") as fh:
-+with io.open("README.md", "r", encoding="utf-8") as fh:
-     long_description = fh.read()
- 
- setup(
-@@ -48,10 +49,4 @@ setup(
+@@ -37,12 +37,5 @@ setup(
+         'console_scripts': [
              'NanoVNASaver = NanoVNASaver.__main__:main'
          ],
-     },
+-    },
 -    install_requires=[
 -        'pyserial',
 -        'PyQt5',
 -        'numpy',
--        'scipy'
+-        'scipy<1.5',
+-        'cython',
 -    ],
++    }
  )



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010171650.09HGoQuL062225>