mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-30 05:40:06 +00:00
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
This commit is contained in:
parent
87138d3657
commit
6437cedaf2
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=552598
@ -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
|
||||
@ -27,4 +26,7 @@ GH_ACCOUNT= mihtjel
|
||||
|
||||
NO_ARCH= yes
|
||||
|
||||
post-extract:
|
||||
${CP} ${FILESDIR}/Sysctl.py ${WRKSRC}/NanoVNASaver/Hardware/
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
@ -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
|
||||
|
23
comms/nanovna-saver/files/Sysctl.py
Normal file
23
comms/nanovna-saver/files/Sysctl.py
Normal file
@ -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])
|
@ -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
|
@ -1,15 +0,0 @@
|
||||
--- NanoVNASaver/NanoVNASaver.py.orig 2019-12-04 11:05:36 UTC
|
||||
+++ NanoVNASaver/NanoVNASaver.py
|
||||
@@ -540,11 +540,7 @@ class NanoVNASaver(QtWidgets.QWidget):
|
||||
return_ports = []
|
||||
device_list = list_ports.comports()
|
||||
for d in device_list:
|
||||
- if (d.vid == VID and
|
||||
- d.pid == PID):
|
||||
- port = d.device
|
||||
- logger.info("Found NanoVNA (%04x %04x) on port %s", d.vid, d.pid, d.device)
|
||||
- return_ports.append(port)
|
||||
+ return_ports.append(d.device)
|
||||
return return_ports
|
||||
|
||||
def exportFileS1P(self):
|
@ -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',
|
||||
- ],
|
||||
+ }
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user