diff --git a/.github/workflows/release_win.yml b/.github/workflows/release_win.yml
index a9e22d2..c506172 100644
--- a/.github/workflows/release_win.yml
+++ b/.github/workflows/release_win.yml
@@ -17,7 +17,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
- python-version: 3.8
+ python-version: 3.9
architecture: ${{ matrix.arch }}
- name: Install dependencies and pyinstall
run: |
diff --git a/NanoVNASaver/About.py b/NanoVNASaver/About.py
index 945edb3..532c874 100644
--- a/NanoVNASaver/About.py
+++ b/NanoVNASaver/About.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-VERSION = "0.3.10-pre04"
+VERSION = "0.3.10-pre05"
VERSION_URL = (
"https://raw.githubusercontent.com/"
"NanoVNA-Saver/nanovna-saver/master/NanoVNASaver/About.py")
diff --git a/NanoVNASaver/Analysis/Analysis.py b/NanoVNASaver/Analysis/Analysis.py
index 542d4d6..3060156 100644
--- a/NanoVNASaver/Analysis/Analysis.py
+++ b/NanoVNASaver/Analysis/Analysis.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Analysis/AntennaAnalysis.py b/NanoVNASaver/Analysis/AntennaAnalysis.py
index 8938f01..c69078d 100644
--- a/NanoVNASaver/Analysis/AntennaAnalysis.py
+++ b/NanoVNASaver/Analysis/AntennaAnalysis.py
@@ -1,7 +1,7 @@
# NanoVNASaver
#
# A python program to view and export Touchstone data from a NanoVNA
-# Copyright (C) 2020 NanoVNA-Saver Authors
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Analysis/BandPassAnalysis.py b/NanoVNASaver/Analysis/BandPassAnalysis.py
index 90845d0..159a559 100644
--- a/NanoVNASaver/Analysis/BandPassAnalysis.py
+++ b/NanoVNASaver/Analysis/BandPassAnalysis.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Analysis/BandStopAnalysis.py b/NanoVNASaver/Analysis/BandStopAnalysis.py
index b5f5aa1..8c6af78 100644
--- a/NanoVNASaver/Analysis/BandStopAnalysis.py
+++ b/NanoVNASaver/Analysis/BandStopAnalysis.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Analysis/HighPassAnalysis.py b/NanoVNASaver/Analysis/HighPassAnalysis.py
index 3d9416e..ab585a1 100644
--- a/NanoVNASaver/Analysis/HighPassAnalysis.py
+++ b/NanoVNASaver/Analysis/HighPassAnalysis.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Analysis/LowPassAnalysis.py b/NanoVNASaver/Analysis/LowPassAnalysis.py
index e35fdd7..78f3d3e 100644
--- a/NanoVNASaver/Analysis/LowPassAnalysis.py
+++ b/NanoVNASaver/Analysis/LowPassAnalysis.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Analysis/PeakSearchAnalysis.py b/NanoVNASaver/Analysis/PeakSearchAnalysis.py
index ef5b93d..0a522df 100644
--- a/NanoVNASaver/Analysis/PeakSearchAnalysis.py
+++ b/NanoVNASaver/Analysis/PeakSearchAnalysis.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Analysis/SimplePeakSearchAnalysis.py b/NanoVNASaver/Analysis/SimplePeakSearchAnalysis.py
index 999ced7..0629885 100644
--- a/NanoVNASaver/Analysis/SimplePeakSearchAnalysis.py
+++ b/NanoVNASaver/Analysis/SimplePeakSearchAnalysis.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Analysis/VSWRAnalysis.py b/NanoVNASaver/Analysis/VSWRAnalysis.py
index c8440d8..24d2f1e 100644
--- a/NanoVNASaver/Analysis/VSWRAnalysis.py
+++ b/NanoVNASaver/Analysis/VSWRAnalysis.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -16,20 +16,19 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-import logging
-
-from PyQt5 import QtWidgets
-import numpy as np
-
-from NanoVNASaver.Analysis import Analysis, PeakSearchAnalysis
-from NanoVNASaver.Formatting import format_frequency
-from NanoVNASaver.Formatting import format_complex_imp
-from NanoVNASaver.RFTools import reflection_coefficient
import os
import csv
+import logging
from collections import OrderedDict
-from NanoVNASaver.Formatting import format_frequency_short
-from NanoVNASaver.Formatting import format_resistance
+
+import numpy as np
+from PyQt5 import QtWidgets
+
+from NanoVNASaver.Analysis import Analysis, PeakSearchAnalysis
+from NanoVNASaver.Formatting import (
+ format_frequency, format_complex_imp,
+ format_frequency_short, format_resistance)
+from NanoVNASaver.RFTools import reflection_coefficient
logger = logging.getLogger(__name__)
@@ -75,10 +74,9 @@ class VSWRAnalysis(Analysis):
def runAnalysis(self):
max_dips_shown = self.max_dips_shown
- data = []
- for d in self.app.data.s11:
- data.append(d.vswr)
+ data = [d.vswr for d in self.app.data.s11]
+
# min_idx = np.argmin(data)
#
# logger.debug("Minimum at %d", min_idx)
@@ -110,7 +108,7 @@ class VSWRAnalysis(Analysis):
dips.append(data[lowest])
best_dips = []
- for i in range(max_dips_shown):
+ for _ in range(max_dips_shown):
min_idx = np.argmin(dips)
best_dips.append(minimums[min_idx])
dips.remove(dips[min_idx])
@@ -137,11 +135,10 @@ class VSWRAnalysis(Analysis):
QtWidgets.QLabel(
format_frequency(self.app.data.s11[end].freq -
self.app.data.s11[start].freq)))
- self.layout.addWidget(PeakSearchAnalysis.QHLine())
else:
self.layout.addRow("Low spot", QtWidgets.QLabel(
format_frequency(self.app.data.s11[lowest].freq)))
- self.layout.addWidget(PeakSearchAnalysis.QHLine())
+ self.layout.addWidget(PeakSearchAnalysis.QHLine())
# Remove the final separator line
self.layout.removeRow(self.layout.rowCount() - 1)
else:
@@ -199,13 +196,8 @@ class ResonanceAnalysis(Analysis):
return my_data
def _get_crossing(self):
-
- data = []
- for d in self.app.data.s11:
- data.append(d.phase)
-
- crossing = sorted(self.find_crossing_zero(data))
- return crossing
+ data = [d.phase for d in self.app.data.s11]
+ return sorted(self.find_crossing_zero(data))
def runAnalysis(self):
self.reset()
@@ -231,11 +223,9 @@ class ResonanceAnalysis(Analysis):
# if len(crossing) > max_dips_shown:
# self.layout.addRow(QtWidgets.QLabel("More than " + str(max_dips_shown) +
# " dips found. Lowest shown."))
-
# self.crossing = crossing[:max_dips_shown]
- extended_data = []
if len(crossing) > 0:
-
+ extended_data = []
for m in crossing:
start, lowest, end = m
my_data = self._get_data(lowest)
@@ -398,16 +388,17 @@ class EFHWAnalysis(ResonanceAnalysis):
row = extended_data[index]
writer.writerow(row)
- def compare(self, old, new, fields=[("freq", str), ]):
+ def compare(self, old, new, fields=None):
'''
Compare data to help changes
NB
- must be same sweep
+ must be same sweep
( same index must be same frequence )
:param old:
:param new:
'''
+ fields = fields or [("freq", str), ]
def no_compare():
@@ -451,7 +442,7 @@ class EFHWAnalysis(ResonanceAnalysis):
if delta_f > 0:
logger.debug("possible missing band, ")
- if (len(old_idx) > (i + split + 1)):
+ if len(old_idx) > (i + split + 1):
if abs(new[k]["freq"] - old[old_idx[i + split + 1]]["freq"]) < max_delta_f:
logger.debug("new is missing band, compare next ")
split += 1
diff --git a/NanoVNASaver/Calibration.py b/NanoVNASaver/Calibration.py
index b514698..56c385b 100644
--- a/NanoVNASaver/Calibration.py
+++ b/NanoVNASaver/Calibration.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -97,8 +97,7 @@ class CalDataSet:
return self.data[freq]
def items(self):
- for item in self.data.items():
- yield item
+ yield from self.data.items()
def values(self):
for freq in self.frequencies():
@@ -212,14 +211,14 @@ class Calibration:
caldata["delta_e"] = - ((g1 * (gm2 - gm3) - g2 * gm2 + g3 *
gm3) * gm1 + (g2 * gm3 - g3 * gm3) *
gm2) / denominator
- except ZeroDivisionError:
+ except ZeroDivisionError as exc:
self.isCalculated = False
logger.error(
"Division error - did you use the same measurement"
" for two of short, open and load?")
raise ValueError(
f"Two of short, open and load returned the same"
- f" values at frequency {freq}Hz.")
+ f" values at frequency {freq}Hz.") from exc
if self.isValid2Port():
caldata["e30"] = caldata["isolation"].z
@@ -354,12 +353,10 @@ class Calibration:
self.notes.append(note)
continue
if line.startswith("#"):
- if not parsed_header:
- # Check that this is a valid header
- if line == (
- "# Hz ShortR ShortI OpenR OpenI LoadR LoadI"
- " ThroughR ThroughI IsolationR IsolationI"):
- parsed_header = True
+ if not parsed_header and line == (
+ "# Hz ShortR ShortI OpenR OpenI LoadR LoadI"
+ " ThroughR ThroughI IsolationR IsolationI"):
+ parsed_header = True
continue
if not parsed_header:
logger.warning(
@@ -372,11 +369,7 @@ class Calibration:
logger.warning("Illegal data in cal file. Line %i", i)
cal = m.groupdict()
- if cal["throughr"]:
- nr_cals = 5
- else:
- nr_cals = 3
-
+ nr_cals = 5 if cal["throughr"] else 3
for name in Calibration.CAL_NAMES[:nr_cals]:
self.dataset.insert(
name,
diff --git a/NanoVNASaver/Charts/CLogMag.py b/NanoVNASaver/Charts/CLogMag.py
index 9ef5960..e47d31d 100644
--- a/NanoVNASaver/Charts/CLogMag.py
+++ b/NanoVNASaver/Charts/CLogMag.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -20,7 +20,7 @@ import math
import logging
from typing import List
-from PyQt5 import QtWidgets, QtGui
+from PyQt5 import QtGui
from NanoVNASaver.RFTools import Datapoint
from .Frequency import FrequencyChart
diff --git a/NanoVNASaver/Charts/Capacitance.py b/NanoVNASaver/Charts/Capacitance.py
index e76aa50..027737d 100644
--- a/NanoVNASaver/Charts/Capacitance.py
+++ b/NanoVNASaver/Charts/Capacitance.py
@@ -16,8 +16,14 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
+import math
import logging
+from typing import List
+from PyQt5 import QtWidgets, QtGui
+
+from NanoVNASaver.RFTools import Datapoint
+from NanoVNASaver.SITools import Format, Value
from .Frequency import FrequencyChart
logger = logging.getLogger(__name__)
@@ -26,10 +32,257 @@ logger = logging.getLogger(__name__)
class CapacitanceChart(FrequencyChart):
def __init__(self, name=""):
super().__init__(name)
-
- self.name_unit = "F"
- self.value_function = lambda x: x.capacitiveEquivalent()
-
+ self.leftMargin = 30
+ self.dim.width = 250
+ self.dim.height = 250
self.minDisplayValue = 0
self.maxDisplayValue = 100
+ self.minValue = -1
+ self.maxValue = 1
+ self.span = 1
+
+ self.setMinimumSize(self.dim.width + self.rightMargin + self.leftMargin,
+ self.dim.height + self.topMargin + self.bottomMargin)
+ self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
+ QtWidgets.QSizePolicy.MinimumExpanding))
+ pal = QtGui.QPalette()
+ pal.setColor(QtGui.QPalette.Background, self.color.background)
+ self.setPalette(pal)
+ self.setAutoFillBackground(True)
+
+ def drawChart(self, qp: QtGui.QPainter):
+ qp.setPen(QtGui.QPen(self.color.text))
+ qp.drawText(3, 15, self.name + " (F)")
+ qp.setPen(QtGui.QPen(self.color.foreground))
+ qp.drawLine(self.leftMargin, 20, self.leftMargin, self.topMargin+self.dim.height+5)
+ qp.drawLine(self.leftMargin-5, self.topMargin+self.dim.height,
+ self.leftMargin+self.dim.width, self.topMargin + self.dim.height)
+ self.drawTitle(qp)
+
+ def drawValues(self, qp: QtGui.QPainter):
+ if len(self.data) == 0 and len(self.reference) == 0:
+ return
+ pen = QtGui.QPen(self.color.sweep)
+ pen.setWidth(self.dim.point)
+ line_pen = QtGui.QPen(self.color.sweep)
+ line_pen.setWidth(self.dim.line)
+ highlighter = QtGui.QPen(QtGui.QColor(20, 0, 255))
+ highlighter.setWidth(1)
+ if not self.fixedSpan:
+ if len(self.data) > 0:
+ fstart = self.data[0].freq
+ fstop = self.data[len(self.data)-1].freq
+ else:
+ fstart = self.reference[0].freq
+ fstop = self.reference[len(self.reference) - 1].freq
+ self.fstart = fstart
+ self.fstop = fstop
+ else:
+ fstart = self.fstart = self.minFrequency
+ fstop = self.fstop = self.maxFrequency
+
+ # Draw bands if required
+ if self.bands.enabled:
+ self.drawBands(qp, fstart, fstop)
+
+ if self.fixedValues:
+ maxValue = self.maxDisplayValue / 10e11
+ minValue = self.minDisplayValue / 10e11
+ self.maxValue = maxValue
+ self.minValue = minValue
+ else:
+ # Find scaling
+ minValue = 1
+ maxValue = -1
+ for d in self.data:
+ val = d.capacitiveEquivalent()
+ if val > maxValue:
+ maxValue = val
+ if val < minValue:
+ minValue = val
+ for d in self.reference: # Also check min/max for the reference sweep
+ if d.freq < self.fstart or d.freq > self.fstop:
+ continue
+ val = d.capacitiveEquivalent()
+ if val > maxValue:
+ maxValue = val
+ if val < minValue:
+ minValue = val
+ self.maxValue = maxValue
+ self.minValue = minValue
+
+ span = maxValue - minValue
+ if span == 0:
+ logger.info("Span is zero for CapacitanceChart, setting to a small value.")
+ span = 1e-15
+ self.span = span
+
+ target_ticks = math.floor(self.dim.height / 60)
+ fmt = Format(max_nr_digits=1)
+ for i in range(target_ticks):
+ val = minValue + (i / target_ticks) * span
+ y = self.topMargin + round((self.maxValue - val) / self.span * self.dim.height)
+ qp.setPen(self.color.text)
+ if val != minValue:
+ valstr = str(Value(val, fmt=fmt))
+ qp.drawText(3, y + 3, valstr)
+ qp.setPen(QtGui.QPen(self.color.foreground))
+ qp.drawLine(self.leftMargin - 5, y, self.leftMargin + self.dim.width, y)
+
+ qp.setPen(QtGui.QPen(self.color.foreground))
+ qp.drawLine(self.leftMargin - 5, self.topMargin,
+ self.leftMargin + self.dim.width, self.topMargin)
+ qp.setPen(self.color.text)
+ qp.drawText(3, self.topMargin + 4, str(Value(maxValue, fmt=fmt)))
+ qp.drawText(3, self.dim.height+self.topMargin, str(Value(minValue, fmt=fmt)))
+ self.drawFrequencyTicks(qp)
+
+ self.drawData(qp, self.data, self.color.sweep)
+ self.drawData(qp, self.reference, self.color.reference)
+ self.drawMarkers(qp)
+
+ def getYPosition(self, d: Datapoint) -> int:
+ return (
+ self.topMargin +
+ round((self.maxValue - d.capacitiveEquivalent()) /
+ self.span * self.dim.height))
+
+ def valueAtPosition(self, y) -> List[float]:
+ absy = y - self.topMargin
+ val = -1 * ((absy / self.dim.height * self.span) - self.maxValue)
+ return [val * 10e11]
+
+ def copy(self):
+ new_chart: CapacitanceChart = super().copy()
+ new_chart.span = self.span
+ return new_chart
+
+
+class InductanceChart(FrequencyChart):
+ def __init__(self, name=""):
+ super().__init__(name)
+ self.leftMargin = 30
+ self.dim.width = 250
+ self.dim.height = 250
+ self.minDisplayValue = 0
+ self.maxDisplayValue = 100
+
+ self.minValue = -1
+ self.maxValue = 1
+ self.span = 1
+
+ self.setMinimumSize(self.dim.width + self.rightMargin + self.leftMargin,
+ self.dim.height + self.topMargin + self.bottomMargin)
+ self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
+ QtWidgets.QSizePolicy.MinimumExpanding))
+ pal = QtGui.QPalette()
+ pal.setColor(QtGui.QPalette.Background, self.color.background)
+ self.setPalette(pal)
+ self.setAutoFillBackground(True)
+
+ def drawChart(self, qp: QtGui.QPainter):
+ qp.setPen(QtGui.QPen(self.color.text))
+ qp.drawText(3, 15, self.name + " (H)")
+ qp.setPen(QtGui.QPen(self.color.foreground))
+ qp.drawLine(self.leftMargin, 20, self.leftMargin, self.topMargin+self.dim.height+5)
+ qp.drawLine(self.leftMargin-5, self.topMargin+self.dim.height,
+ self.leftMargin+self.dim.width, self.topMargin + self.dim.height)
+ self.drawTitle(qp)
+
+ def drawValues(self, qp: QtGui.QPainter):
+ if len(self.data) == 0 and len(self.reference) == 0:
+ return
+ pen = QtGui.QPen(self.color.sweep)
+ pen.setWidth(self.dim.point)
+ line_pen = QtGui.QPen(self.color.sweep)
+ line_pen.setWidth(self.dim.line)
+ highlighter = QtGui.QPen(QtGui.QColor(20, 0, 255))
+ highlighter.setWidth(1)
+ if not self.fixedSpan:
+ if len(self.data) > 0:
+ fstart = self.data[0].freq
+ fstop = self.data[len(self.data)-1].freq
+ else:
+ fstart = self.reference[0].freq
+ fstop = self.reference[len(self.reference) - 1].freq
+ self.fstart = fstart
+ self.fstop = fstop
+ else:
+ fstart = self.fstart = self.minFrequency
+ fstop = self.fstop = self.maxFrequency
+
+ # Draw bands if required
+ if self.bands.enabled:
+ self.drawBands(qp, fstart, fstop)
+
+ if self.fixedValues:
+ maxValue = self.maxDisplayValue / 10e11
+ minValue = self.minDisplayValue / 10e11
+ self.maxValue = maxValue
+ self.minValue = minValue
+ else:
+ # Find scaling
+ minValue = 1
+ maxValue = -1
+ for d in self.data:
+ val = d.inductiveEquivalent()
+ if val > maxValue:
+ maxValue = val
+ if val < minValue:
+ minValue = val
+ for d in self.reference: # Also check min/max for the reference sweep
+ if d.freq < self.fstart or d.freq > self.fstop:
+ continue
+ val = d.inductiveEquivalent()
+ if val > maxValue:
+ maxValue = val
+ if val < minValue:
+ minValue = val
+ self.maxValue = maxValue
+ self.minValue = minValue
+
+ span = maxValue - minValue
+ if span == 0:
+ logger.info("Span is zero for CapacitanceChart, setting to a small value.")
+ span = 1e-15
+ self.span = span
+
+ target_ticks = math.floor(self.dim.height / 60)
+ fmt = Format(max_nr_digits=1)
+ for i in range(target_ticks):
+ val = minValue + (i / target_ticks) * span
+ y = self.topMargin + round((self.maxValue - val) / self.span * self.dim.height)
+ qp.setPen(self.color.text)
+ if val != minValue:
+ valstr = str(Value(val, fmt=fmt))
+ qp.drawText(3, y + 3, valstr)
+ qp.setPen(QtGui.QPen(self.color.foreground))
+ qp.drawLine(self.leftMargin - 5, y, self.leftMargin + self.dim.width, y)
+
+ qp.setPen(QtGui.QPen(self.color.foreground))
+ qp.drawLine(self.leftMargin - 5, self.topMargin,
+ self.leftMargin + self.dim.width, self.topMargin)
+ qp.setPen(self.color.text)
+ qp.drawText(3, self.topMargin + 4, str(Value(maxValue, fmt=fmt)))
+ qp.drawText(3, self.dim.height+self.topMargin, str(Value(minValue, fmt=fmt)))
+ self.drawFrequencyTicks(qp)
+
+ self.drawData(qp, self.data, self.color.sweep)
+ self.drawData(qp, self.reference, self.color.reference)
+ self.drawMarkers(qp)
+
+ def getYPosition(self, d: Datapoint) -> int:
+ return (self.topMargin +
+ round((self.maxValue - d.inductiveEquivalent()) /
+ self.span * self.dim.height))
+
+ def valueAtPosition(self, y) -> List[float]:
+ absy = y - self.topMargin
+ val = -1 * ((absy / self.dim.height * self.span) - self.maxValue)
+ return [val * 10e11]
+
+ def copy(self):
+ new_chart: InductanceChart = super().copy()
+ new_chart.span = self.span
+ return new_chart
diff --git a/NanoVNASaver/Charts/Chart.py b/NanoVNASaver/Charts/Chart.py
index 139ad2f..e2d9029 100644
--- a/NanoVNASaver/Charts/Chart.py
+++ b/NanoVNASaver/Charts/Chart.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Charts/Frequency.py b/NanoVNASaver/Charts/Frequency.py
index 42891c7..44b2158 100644
--- a/NanoVNASaver/Charts/Frequency.py
+++ b/NanoVNASaver/Charts/Frequency.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Charts/GroupDelay.py b/NanoVNASaver/Charts/GroupDelay.py
index b0bfd59..79e0ea3 100644
--- a/NanoVNASaver/Charts/GroupDelay.py
+++ b/NanoVNASaver/Charts/GroupDelay.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -22,7 +22,7 @@ from typing import List
import numpy as np
-from PyQt5 import QtWidgets, QtGui
+from PyQt5 import QtGui
from NanoVNASaver.RFTools import Datapoint
from .Frequency import FrequencyChart
diff --git a/NanoVNASaver/Charts/Inductance.py b/NanoVNASaver/Charts/Inductance.py
index 7e12aa7..2fedc7b 100644
--- a/NanoVNASaver/Charts/Inductance.py
+++ b/NanoVNASaver/Charts/Inductance.py
@@ -16,7 +16,14 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
+import math
import logging
+from typing import List
+
+from PyQt5 import QtWidgets, QtGui
+
+from NanoVNASaver.RFTools import Datapoint
+from NanoVNASaver.SITools import Format, Value
from .Frequency import FrequencyChart
logger = logging.getLogger(__name__)
@@ -25,9 +32,127 @@ logger = logging.getLogger(__name__)
class InductanceChart(FrequencyChart):
def __init__(self, name=""):
super().__init__(name)
-
- self.name_unit = "H"
- self.value_function = lambda x: x.inductiveEquivalent()
-
+ self.leftMargin = 30
+ self.dim.width = 250
+ self.dim.height = 250
self.minDisplayValue = 0
self.maxDisplayValue = 100
+
+ self.minValue = -1
+ self.maxValue = 1
+ self.span = 1
+
+ self.setMinimumSize(self.dim.width + self.rightMargin + self.leftMargin,
+ self.dim.height + self.topMargin + self.bottomMargin)
+ self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
+ QtWidgets.QSizePolicy.MinimumExpanding))
+ pal = QtGui.QPalette()
+ pal.setColor(QtGui.QPalette.Background, self.color.background)
+ self.setPalette(pal)
+ self.setAutoFillBackground(True)
+
+ def drawChart(self, qp: QtGui.QPainter):
+ qp.setPen(QtGui.QPen(self.color.text))
+ qp.drawText(3, 15, self.name + " (H)")
+ qp.setPen(QtGui.QPen(self.color.foreground))
+ qp.drawLine(self.leftMargin, 20, self.leftMargin, self.topMargin+self.dim.height+5)
+ qp.drawLine(self.leftMargin-5, self.topMargin+self.dim.height,
+ self.leftMargin+self.dim.width, self.topMargin + self.dim.height)
+ self.drawTitle(qp)
+
+ def drawValues(self, qp: QtGui.QPainter):
+ if len(self.data) == 0 and len(self.reference) == 0:
+ return
+ pen = QtGui.QPen(self.color.sweep)
+ pen.setWidth(self.dim.point)
+ line_pen = QtGui.QPen(self.color.sweep)
+ line_pen.setWidth(self.dim.line)
+ highlighter = QtGui.QPen(QtGui.QColor(20, 0, 255))
+ highlighter.setWidth(1)
+ if not self.fixedSpan:
+ if len(self.data) > 0:
+ fstart = self.data[0].freq
+ fstop = self.data[len(self.data)-1].freq
+ else:
+ fstart = self.reference[0].freq
+ fstop = self.reference[len(self.reference) - 1].freq
+ self.fstart = fstart
+ self.fstop = fstop
+ else:
+ fstart = self.fstart = self.minFrequency
+ fstop = self.fstop = self.maxFrequency
+
+ # Draw bands if required
+ if self.bands.enabled:
+ self.drawBands(qp, fstart, fstop)
+
+ if self.fixedValues:
+ maxValue = self.maxDisplayValue / 10e11
+ minValue = self.minDisplayValue / 10e11
+ self.maxValue = maxValue
+ self.minValue = minValue
+ else:
+ # Find scaling
+ minValue = 1
+ maxValue = -1
+ for d in self.data:
+ val = d.inductiveEquivalent()
+ if val > maxValue:
+ maxValue = val
+ if val < minValue:
+ minValue = val
+ for d in self.reference: # Also check min/max for the reference sweep
+ if d.freq < self.fstart or d.freq > self.fstop:
+ continue
+ val = d.inductiveEquivalent()
+ if val > maxValue:
+ maxValue = val
+ if val < minValue:
+ minValue = val
+ self.maxValue = maxValue
+ self.minValue = minValue
+
+ span = maxValue - minValue
+ if span == 0:
+ logger.info("Span is zero for CapacitanceChart, setting to a small value.")
+ span = 1e-15
+ self.span = span
+
+ target_ticks = math.floor(self.dim.height / 60)
+ fmt = Format(max_nr_digits=1)
+ for i in range(target_ticks):
+ val = minValue + (i / target_ticks) * span
+ y = self.topMargin + round((self.maxValue - val) / self.span * self.dim.height)
+ qp.setPen(self.color.text)
+ if val != minValue:
+ valstr = str(Value(val, fmt=fmt))
+ qp.drawText(3, y + 3, valstr)
+ qp.setPen(QtGui.QPen(self.color.foreground))
+ qp.drawLine(self.leftMargin - 5, y, self.leftMargin + self.dim.width, y)
+
+ qp.setPen(QtGui.QPen(self.color.foreground))
+ qp.drawLine(self.leftMargin - 5, self.topMargin,
+ self.leftMargin + self.dim.width, self.topMargin)
+ qp.setPen(self.color.text)
+ qp.drawText(3, self.topMargin + 4, str(Value(maxValue, fmt=fmt)))
+ qp.drawText(3, self.dim.height+self.topMargin, str(Value(minValue, fmt=fmt)))
+ self.drawFrequencyTicks(qp)
+
+ self.drawData(qp, self.data, self.color.sweep)
+ self.drawData(qp, self.reference, self.color.reference)
+ self.drawMarkers(qp)
+
+ def getYPosition(self, d: Datapoint) -> int:
+ return (self.topMargin +
+ round((self.maxValue - d.inductiveEquivalent()) /
+ self.span * self.dim.height))
+
+ def valueAtPosition(self, y) -> List[float]:
+ absy = y - self.topMargin
+ val = -1 * ((absy / self.dim.height * self.span) - self.maxValue)
+ return [val * 10e11]
+
+ def copy(self):
+ new_chart: InductanceChart = super().copy()
+ new_chart.span = self.span
+ return new_chart
diff --git a/NanoVNASaver/Charts/LogMag.py b/NanoVNASaver/Charts/LogMag.py
index 970ad70..159a780 100644
--- a/NanoVNASaver/Charts/LogMag.py
+++ b/NanoVNASaver/Charts/LogMag.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -20,7 +20,7 @@ import math
import logging
from typing import List
-from PyQt5 import QtWidgets, QtGui
+from PyQt5 import QtGui
from NanoVNASaver.RFTools import Datapoint
from .Frequency import FrequencyChart
diff --git a/NanoVNASaver/Charts/Magnitude.py b/NanoVNASaver/Charts/Magnitude.py
index d675897..93634f4 100644
--- a/NanoVNASaver/Charts/Magnitude.py
+++ b/NanoVNASaver/Charts/Magnitude.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -20,7 +20,7 @@ import math
import logging
from typing import List
-from PyQt5 import QtWidgets, QtGui
+from PyQt5 import QtGui
from NanoVNASaver.RFTools import Datapoint
from .Frequency import FrequencyChart
diff --git a/NanoVNASaver/Charts/MagnitudeZ.py b/NanoVNASaver/Charts/MagnitudeZ.py
index bcf96ac..b89025b 100644
--- a/NanoVNASaver/Charts/MagnitudeZ.py
+++ b/NanoVNASaver/Charts/MagnitudeZ.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -20,7 +20,7 @@ import math
import logging
from typing import List
-from PyQt5 import QtWidgets, QtGui
+from PyQt5 import QtGui
from NanoVNASaver.RFTools import Datapoint
from NanoVNASaver.SITools import Format, Value
diff --git a/NanoVNASaver/Charts/MagnitudeZSeries.py b/NanoVNASaver/Charts/MagnitudeZSeries.py
index 5ccbfae..0993590 100644
--- a/NanoVNASaver/Charts/MagnitudeZSeries.py
+++ b/NanoVNASaver/Charts/MagnitudeZSeries.py
@@ -3,7 +3,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Charts/MagnitudeZShunt.py b/NanoVNASaver/Charts/MagnitudeZShunt.py
index e748af0..3736e3d 100644
--- a/NanoVNASaver/Charts/MagnitudeZShunt.py
+++ b/NanoVNASaver/Charts/MagnitudeZShunt.py
@@ -3,7 +3,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Charts/Permeability.py b/NanoVNASaver/Charts/Permeability.py
index bc0b2bf..e791b55 100644
--- a/NanoVNASaver/Charts/Permeability.py
+++ b/NanoVNASaver/Charts/Permeability.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -20,7 +20,7 @@ import math
import logging
from typing import List
-from PyQt5 import QtWidgets, QtGui
+from PyQt5 import QtGui
from NanoVNASaver.Marker import Marker
from NanoVNASaver.RFTools import Datapoint
diff --git a/NanoVNASaver/Charts/Phase.py b/NanoVNASaver/Charts/Phase.py
index 22a179b..2ffc1e4 100644
--- a/NanoVNASaver/Charts/Phase.py
+++ b/NanoVNASaver/Charts/Phase.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Charts/Polar.py b/NanoVNASaver/Charts/Polar.py
index a39eeee..b428452 100644
--- a/NanoVNASaver/Charts/Polar.py
+++ b/NanoVNASaver/Charts/Polar.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Charts/QFactor.py b/NanoVNASaver/Charts/QFactor.py
index 3c6a3ea..e15cfb6 100644
--- a/NanoVNASaver/Charts/QFactor.py
+++ b/NanoVNASaver/Charts/QFactor.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -20,7 +20,7 @@ import math
import logging
from typing import List
-from PyQt5 import QtWidgets, QtGui
+from PyQt5 import QtGui
from NanoVNASaver.RFTools import Datapoint
from .Frequency import FrequencyChart
diff --git a/NanoVNASaver/Charts/RI.py b/NanoVNASaver/Charts/RI.py
index 6ab0a7e..98888bc 100644
--- a/NanoVNASaver/Charts/RI.py
+++ b/NanoVNASaver/Charts/RI.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Charts/RISeries.py b/NanoVNASaver/Charts/RISeries.py
index 52a6ef4..245b937 100644
--- a/NanoVNASaver/Charts/RISeries.py
+++ b/NanoVNASaver/Charts/RISeries.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Charts/RIShunt.py b/NanoVNASaver/Charts/RIShunt.py
index 8ab567a..2987425 100644
--- a/NanoVNASaver/Charts/RIShunt.py
+++ b/NanoVNASaver/Charts/RIShunt.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Charts/SParam.py b/NanoVNASaver/Charts/SParam.py
index 0136066..00c15ad 100644
--- a/NanoVNASaver/Charts/SParam.py
+++ b/NanoVNASaver/Charts/SParam.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -20,7 +20,7 @@ import math
import logging
from typing import List
-from PyQt5 import QtWidgets, QtGui
+from PyQt5 import QtGui
from NanoVNASaver.RFTools import Datapoint
from .Frequency import FrequencyChart
diff --git a/NanoVNASaver/Charts/Smith.py b/NanoVNASaver/Charts/Smith.py
index c800265..1a8c629 100644
--- a/NanoVNASaver/Charts/Smith.py
+++ b/NanoVNASaver/Charts/Smith.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Charts/Square.py b/NanoVNASaver/Charts/Square.py
index 011f73b..83b96d1 100644
--- a/NanoVNASaver/Charts/Square.py
+++ b/NanoVNASaver/Charts/Square.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Charts/TDR.py b/NanoVNASaver/Charts/TDR.py
index 5f145ee..9404008 100644
--- a/NanoVNASaver/Charts/TDR.py
+++ b/NanoVNASaver/Charts/TDR.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Charts/VSWR.py b/NanoVNASaver/Charts/VSWR.py
index 8922129..3427025 100644
--- a/NanoVNASaver/Charts/VSWR.py
+++ b/NanoVNASaver/Charts/VSWR.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -20,7 +20,7 @@ import math
import logging
from typing import List
-from PyQt5 import QtWidgets, QtGui
+from PyQt5 import QtGui
from NanoVNASaver.RFTools import Datapoint
from .Frequency import FrequencyChart
diff --git a/NanoVNASaver/Controls/MarkerControl.py b/NanoVNASaver/Controls/MarkerControl.py
index 457c6d2..2330916 100644
--- a/NanoVNASaver/Controls/MarkerControl.py
+++ b/NanoVNASaver/Controls/MarkerControl.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Controls/SweepControl.py b/NanoVNASaver/Controls/SweepControl.py
index 25a6807..7e22b1e 100644
--- a/NanoVNASaver/Controls/SweepControl.py
+++ b/NanoVNASaver/Controls/SweepControl.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Formatting.py b/NanoVNASaver/Formatting.py
index f2c0b30..0dbd7da 100644
--- a/NanoVNASaver/Formatting.py
+++ b/NanoVNASaver/Formatting.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Hardware/AVNA.py b/NanoVNASaver/Hardware/AVNA.py
index a26ed9a..267532f 100644
--- a/NanoVNASaver/Hardware/AVNA.py
+++ b/NanoVNASaver/Hardware/AVNA.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Hardware/Hardware.py b/NanoVNASaver/Hardware/Hardware.py
index f14d5ed..68a5d7b 100644
--- a/NanoVNASaver/Hardware/Hardware.py
+++ b/NanoVNASaver/Hardware/Hardware.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -140,6 +140,8 @@ def detect_version(serial_port: serial.Serial) -> str:
# -H versions
if data.startswith("\r\nch> "):
return "vh"
+ if data.startswith("\r\n?\r\nch> "):
+ return "vh"
if data.startswith("2"):
return "v2"
logger.debug("Retry detection: %s", i + 1)
diff --git a/NanoVNASaver/Hardware/NanoVNA.py b/NanoVNASaver/Hardware/NanoVNA.py
index beaa09a..4c36009 100644
--- a/NanoVNASaver/Hardware/NanoVNA.py
+++ b/NanoVNASaver/Hardware/NanoVNA.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Hardware/NanoVNA_F.py b/NanoVNASaver/Hardware/NanoVNA_F.py
index 304fb01..c5efdff 100644
--- a/NanoVNASaver/Hardware/NanoVNA_F.py
+++ b/NanoVNASaver/Hardware/NanoVNA_F.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Hardware/NanoVNA_F_V2.py b/NanoVNASaver/Hardware/NanoVNA_F_V2.py
index b4e98c7..b23d44f 100644
--- a/NanoVNASaver/Hardware/NanoVNA_F_V2.py
+++ b/NanoVNASaver/Hardware/NanoVNA_F_V2.py
@@ -1,5 +1,23 @@
+# NanoVNASaver
+#
+# A python program to view and export Touchstone data from a NanoVNA
+# Copyright (C) 2019, 2020 Rune B. Broberg
+# Copyright (C) 2020,2021 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 .
import logging
-from NanoVNASaver.Hardware.Serial import Interface
+
import serial
from PyQt5 import QtGui
diff --git a/NanoVNASaver/Hardware/NanoVNA_H.py b/NanoVNASaver/Hardware/NanoVNA_H.py
index a8ae05a..681b0a5 100644
--- a/NanoVNASaver/Hardware/NanoVNA_H.py
+++ b/NanoVNASaver/Hardware/NanoVNA_H.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Hardware/NanoVNA_H4.py b/NanoVNASaver/Hardware/NanoVNA_H4.py
index be0c14c..4742708 100644
--- a/NanoVNASaver/Hardware/NanoVNA_H4.py
+++ b/NanoVNASaver/Hardware/NanoVNA_H4.py
@@ -1,7 +1,7 @@
# NanoVNASaver
#
# A python program to view and export Touchstone data from a NanoVNA
-# Copyright (C) 2020 NanoVNA-Saver Authors
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Hardware/NanoVNA_V2.py b/NanoVNASaver/Hardware/NanoVNA_V2.py
index ef40dca..e87c756 100644
--- a/NanoVNASaver/Hardware/NanoVNA_V2.py
+++ b/NanoVNASaver/Hardware/NanoVNA_V2.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -202,6 +202,8 @@ class NanoVNA_V2(VNA):
ret = [str(x.real) + ' ' + str(x.imag) for x in ret]
return ret
+ return []
+
def resetSweep(self, start: int, stop: int):
self.setSweep(start, stop)
diff --git a/NanoVNASaver/Hardware/Serial.py b/NanoVNASaver/Hardware/Serial.py
index b7abdfd..1600637 100644
--- a/NanoVNASaver/Hardware/Serial.py
+++ b/NanoVNASaver/Hardware/Serial.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Hardware/TinySA.py b/NanoVNASaver/Hardware/TinySA.py
index 19867de..86b4339 100644
--- a/NanoVNASaver/Hardware/TinySA.py
+++ b/NanoVNASaver/Hardware/TinySA.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -26,7 +26,6 @@ from PyQt5 import QtGui
from NanoVNASaver.Hardware.Serial import drain_serial, Interface
from NanoVNASaver.Hardware.VNA import VNA
-from NanoVNASaver.Version import Version
logger = logging.getLogger(__name__)
diff --git a/NanoVNASaver/Hardware/VNA.py b/NanoVNASaver/Hardware/VNA.py
index fd4fe1e..ae749b4 100644
--- a/NanoVNASaver/Hardware/VNA.py
+++ b/NanoVNASaver/Hardware/VNA.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Inputs.py b/NanoVNASaver/Inputs.py
index 494dfbf..ca73605 100644
--- a/NanoVNASaver/Inputs.py
+++ b/NanoVNASaver/Inputs.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Marker/Delta.py b/NanoVNASaver/Marker/Delta.py
index 6e34c1e..73d3fcc 100644
--- a/NanoVNASaver/Marker/Delta.py
+++ b/NanoVNASaver/Marker/Delta.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Marker/Values.py b/NanoVNASaver/Marker/Values.py
index 6defcc5..ee58d07 100644
--- a/NanoVNASaver/Marker/Values.py
+++ b/NanoVNASaver/Marker/Values.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Marker/Widget.py b/NanoVNASaver/Marker/Widget.py
index b0b90fc..76c0721 100644
--- a/NanoVNASaver/Marker/Widget.py
+++ b/NanoVNASaver/Marker/Widget.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -87,7 +87,7 @@ class Marker(QtCore.QObject, Value):
self.name = f"Marker {Marker._instances}"
self.frequencyInput = FrequencyInput()
- self.frequencyInput.setFixedHeight(20)
+ self.frequencyInput.setMinimumHeight(20)
self.frequencyInput.setAlignment(QtCore.Qt.AlignRight)
self.frequencyInput.editingFinished.connect(
lambda: self.setFrequency(
@@ -108,7 +108,7 @@ class Marker(QtCore.QObject, Value):
###############################################################
self.btnColorPicker = QtWidgets.QPushButton("█")
- self.btnColorPicker.setFixedHeight(20)
+ self.btnColorPicker.setMinimumHeight(20)
self.btnColorPicker.setFixedWidth(20)
self.btnColorPicker.clicked.connect(
lambda: self.setColor(QtWidgets.QColorDialog.getColor(
@@ -143,7 +143,9 @@ class Marker(QtCore.QObject, Value):
# line only if more then 3 selected
self.left_form = QtWidgets.QFormLayout()
+ self.left_form.setVerticalSpacing(0)
self.right_form = QtWidgets.QFormLayout()
+ self.right_form.setVerticalSpacing(0)
box_layout.addLayout(self.left_form)
box_layout.addWidget(line)
box_layout.addLayout(self.right_form)
diff --git a/NanoVNASaver/NanoVNASaver.py b/NanoVNASaver/NanoVNASaver.py
index 8c9021c..bcbf24e 100644
--- a/NanoVNASaver/NanoVNASaver.py
+++ b/NanoVNASaver/NanoVNASaver.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -23,7 +23,6 @@ from collections import OrderedDict
from time import sleep, strftime, localtime
from PyQt5 import QtWidgets, QtCore, QtGui
-from numpy import exp
from .Windows import (
AboutWindow, AnalysisWindow, CalibrationWindow,
@@ -192,6 +191,8 @@ class NanoVNASaver(QtWidgets.QWidget):
self.charts_layout = QtWidgets.QGridLayout()
+ QtWidgets.QShortcut(QtGui.QKeySequence("Ctrl+Q"), self, self.close)
+
###############################################################
# Create main layout
###############################################################
@@ -253,7 +254,7 @@ class NanoVNASaver(QtWidgets.QWidget):
self.marker_data_layout.addWidget(m.get_data_layout())
scroll2 = QtWidgets.QScrollArea()
- scroll2.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
+ #scroll2.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
scroll2.setWidgetResizable(True)
scroll2.setVisible(True)
@@ -275,6 +276,7 @@ class NanoVNASaver(QtWidgets.QWidget):
s11_control_box = QtWidgets.QGroupBox()
s11_control_box.setTitle("S11")
s11_control_layout = QtWidgets.QFormLayout()
+ s11_control_layout.setVerticalSpacing(0)
s11_control_box.setLayout(s11_control_layout)
self.s11_min_swr_label = QtWidgets.QLabel()
@@ -287,6 +289,7 @@ class NanoVNASaver(QtWidgets.QWidget):
s21_control_box = QtWidgets.QGroupBox()
s21_control_box.setTitle("S21")
s21_control_layout = QtWidgets.QFormLayout()
+ s21_control_layout.setVerticalSpacing(0)
s21_control_box.setLayout(s21_control_layout)
self.s21_min_gain_label = QtWidgets.QLabel()
@@ -301,7 +304,7 @@ class NanoVNASaver(QtWidgets.QWidget):
self.windows["analysis"] = AnalysisWindow(self)
btn_show_analysis = QtWidgets.QPushButton("Analysis ...")
- btn_show_analysis.setFixedHeight(20)
+ btn_show_analysis.setMinimumHeight(20)
btn_show_analysis.clicked.connect(
lambda: self.display_window("analysis"))
self.marker_column.addWidget(btn_show_analysis)
@@ -322,13 +325,13 @@ class NanoVNASaver(QtWidgets.QWidget):
tdr_control_box.setMaximumWidth(240)
self.tdr_result_label = QtWidgets.QLabel()
- self.tdr_result_label.setFixedHeight(20)
+ self.tdr_result_label.setMinimumHeight(20)
tdr_control_layout.addRow(
"Estimated cable length:", self.tdr_result_label)
self.tdr_button = QtWidgets.QPushButton(
"Time Domain Reflectometry ...")
- self.tdr_button.setFixedHeight(20)
+ self.tdr_button.setMinimumHeight(20)
self.tdr_button.clicked.connect(lambda: self.display_window("tdr"))
tdr_control_layout.addRow(self.tdr_button)
@@ -353,10 +356,10 @@ class NanoVNASaver(QtWidgets.QWidget):
reference_control_layout = QtWidgets.QFormLayout(reference_control_box)
btn_set_reference = QtWidgets.QPushButton("Set current as reference")
- btn_set_reference.setFixedHeight(20)
+ btn_set_reference.setMinimumHeight(20)
btn_set_reference.clicked.connect(self.setReference)
self.btnResetReference = QtWidgets.QPushButton("Reset reference")
- self.btnResetReference.setFixedHeight(20)
+ self.btnResetReference.setMinimumHeight(20)
self.btnResetReference.clicked.connect(self.resetReference)
self.btnResetReference.setDisabled(True)
@@ -374,11 +377,11 @@ class NanoVNASaver(QtWidgets.QWidget):
serial_control_box.setTitle("Serial port control")
serial_control_layout = QtWidgets.QFormLayout(serial_control_box)
self.serialPortInput = QtWidgets.QComboBox()
- self.serialPortInput.setFixedHeight(20)
+ self.serialPortInput.setMinimumHeight(20)
self.rescanSerialPort()
self.serialPortInput.setEditable(True)
btn_rescan_serial_port = QtWidgets.QPushButton("Rescan")
- btn_rescan_serial_port.setFixedHeight(20)
+ btn_rescan_serial_port.setMinimumHeight(20)
btn_rescan_serial_port.setFixedWidth(60)
btn_rescan_serial_port.clicked.connect(self.rescanSerialPort)
serial_port_input_layout = QtWidgets.QHBoxLayout()
@@ -390,12 +393,12 @@ class NanoVNASaver(QtWidgets.QWidget):
serial_button_layout = QtWidgets.QHBoxLayout()
self.btnSerialToggle = QtWidgets.QPushButton("Connect to device")
- self.btnSerialToggle.setFixedHeight(20)
+ self.btnSerialToggle.setMinimumHeight(20)
self.btnSerialToggle.clicked.connect(self.serialButtonClick)
serial_button_layout.addWidget(self.btnSerialToggle, stretch=1)
self.btnDeviceSettings = QtWidgets.QPushButton("Manage")
- self.btnDeviceSettings.setFixedHeight(20)
+ self.btnDeviceSettings.setMinimumHeight(20)
self.btnDeviceSettings.setFixedWidth(60)
self.btnDeviceSettings.clicked.connect(
lambda: self.display_window("device_settings"))
@@ -408,7 +411,7 @@ class NanoVNASaver(QtWidgets.QWidget):
###############################################################
btnOpenCalibrationWindow = QtWidgets.QPushButton("Calibration ...")
- btnOpenCalibrationWindow.setFixedHeight(20)
+ btnOpenCalibrationWindow.setMinimumHeight(20)
self.calibrationWindow = CalibrationWindow(self)
btnOpenCalibrationWindow.clicked.connect(
lambda: self.display_window("calibration"))
@@ -418,13 +421,13 @@ class NanoVNASaver(QtWidgets.QWidget):
###############################################################
btn_display_setup = QtWidgets.QPushButton("Display setup ...")
- btn_display_setup.setFixedHeight(20)
+ btn_display_setup.setMinimumHeight(20)
btn_display_setup.setMaximumWidth(240)
btn_display_setup.clicked.connect(
lambda: self.display_window("setup"))
btn_about = QtWidgets.QPushButton("About ...")
- btn_about.setFixedHeight(20)
+ btn_about.setMinimumHeight(20)
btn_about.setMaximumWidth(240)
btn_about.clicked.connect(
@@ -432,7 +435,7 @@ class NanoVNASaver(QtWidgets.QWidget):
btn_open_file_window = QtWidgets.QPushButton("Files")
- btn_open_file_window.setFixedHeight(20)
+ btn_open_file_window.setMinimumHeight(20)
btn_open_file_window.setMaximumWidth(240)
btn_open_file_window.clicked.connect(
diff --git a/NanoVNASaver/RFTools.py b/NanoVNASaver/RFTools.py
index 13a8b30..f52ac57 100644
--- a/NanoVNASaver/RFTools.py
+++ b/NanoVNASaver/RFTools.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -103,8 +103,7 @@ def groupDelay(data: List[Datapoint], index: int) -> float:
delta_freq = data[idx1].freq - data[idx0].freq
if delta_freq == 0:
return 0
- val = -delta_angle / math.tau / delta_freq
- return val
+ return -delta_angle / math.tau / delta_freq
def impedance_to_capacitance(z: complex, freq: float) -> float:
diff --git a/NanoVNASaver/SITools.py b/NanoVNASaver/SITools.py
index ec73067..b952e05 100644
--- a/NanoVNASaver/SITools.py
+++ b/NanoVNASaver/SITools.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -158,8 +158,8 @@ class Value:
try:
self._value = (decimal.Decimal(value, context=Value.CTX)
* decimal.Decimal(factor, context=Value.CTX))
- except decimal.InvalidOperation:
- raise ValueError
+ except decimal.InvalidOperation as exc:
+ raise ValueError() from exc
self._value = clamp_value(
self._value, self.fmt.parse_clamp_min, self.fmt.parse_clamp_max)
return self
diff --git a/NanoVNASaver/Settings/Bands.py b/NanoVNASaver/Settings/Bands.py
index c4ad285..ac89705 100644
--- a/NanoVNASaver/Settings/Bands.py
+++ b/NanoVNASaver/Settings/Bands.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Settings/Sweep.py b/NanoVNASaver/Settings/Sweep.py
index 2ce8809..ec0d7f6 100644
--- a/NanoVNASaver/Settings/Sweep.py
+++ b/NanoVNASaver/Settings/Sweep.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/SweepWorker.py b/NanoVNASaver/SweepWorker.py
index d78432e..f3275e0 100644
--- a/NanoVNASaver/SweepWorker.py
+++ b/NanoVNASaver/SweepWorker.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Touchstone.py b/NanoVNASaver/Touchstone.py
index 81ad1de..df855b3 100644
--- a/NanoVNASaver/Touchstone.py
+++ b/NanoVNASaver/Touchstone.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Version.py b/NanoVNASaver/Version.py
index 6fff530..1df6233 100644
--- a/NanoVNASaver/Version.py
+++ b/NanoVNASaver/Version.py
@@ -1,7 +1,7 @@
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Windows/About.py b/NanoVNASaver/Windows/About.py
index 40cb45f..6b3b5d5 100644
--- a/NanoVNASaver/Windows/About.py
+++ b/NanoVNASaver/Windows/About.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Windows/AnalysisWindow.py b/NanoVNASaver/Windows/AnalysisWindow.py
index 04b6995..a453727 100644
--- a/NanoVNASaver/Windows/AnalysisWindow.py
+++ b/NanoVNASaver/Windows/AnalysisWindow.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Windows/Bands.py b/NanoVNASaver/Windows/Bands.py
index 89db809..c878842 100644
--- a/NanoVNASaver/Windows/Bands.py
+++ b/NanoVNASaver/Windows/Bands.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Windows/CalibrationSettings.py b/NanoVNASaver/Windows/CalibrationSettings.py
index eca2653..6601846 100644
--- a/NanoVNASaver/Windows/CalibrationSettings.py
+++ b/NanoVNASaver/Windows/CalibrationSettings.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -71,11 +71,13 @@ class CalibrationWindow(QtWidgets.QWidget):
self.cal_label[label_name] = QtWidgets.QLabel("Uncalibrated")
cal_btn[label_name] = QtWidgets.QPushButton(
label_name.capitalize())
+ cal_btn[label_name].setMinimumHeight(20)
cal_btn[label_name].clicked.connect(partial(self.manual_save, label_name))
calibration_control_layout.addRow(
cal_btn[label_name], self.cal_label[label_name])
self.input_offset_delay = QtWidgets.QDoubleSpinBox()
+ self.input_offset_delay.setMinimumHeight(20)
self.input_offset_delay.setValue(0)
self.input_offset_delay.setSuffix(" ps")
self.input_offset_delay.setAlignment(QtCore.Qt.AlignRight)
@@ -86,15 +88,18 @@ class CalibrationWindow(QtWidgets.QWidget):
calibration_control_layout.addRow("Offset delay", self.input_offset_delay)
self.btn_automatic = QtWidgets.QPushButton("Calibration assistant")
+ self.btn_automatic.setMinimumHeight(20)
calibration_control_layout.addRow(self.btn_automatic)
self.btn_automatic.clicked.connect(self.automaticCalibration)
apply_reset_layout = QtWidgets.QHBoxLayout()
btn_apply = QtWidgets.QPushButton("Apply")
+ btn_apply.setMinimumHeight(20)
btn_apply.clicked.connect(self.calculate)
btn_reset = QtWidgets.QPushButton("Reset")
+ btn_reset.setMinimumHeight(20)
btn_reset.clicked.connect(self.reset)
apply_reset_layout.addWidget(btn_apply)
@@ -114,8 +119,10 @@ class CalibrationWindow(QtWidgets.QWidget):
file_box = QtWidgets.QGroupBox("Files")
file_layout = QtWidgets.QFormLayout(file_box)
btn_save_file = QtWidgets.QPushButton("Save calibration")
+ btn_save_file.setMinimumHeight(20)
btn_save_file.clicked.connect(lambda: self.saveCalibration())
btn_load_file = QtWidgets.QPushButton("Load calibration")
+ btn_load_file.setMinimumHeight(20)
btn_load_file.clicked.connect(lambda: self.loadCalibration())
save_load_layout = QtWidgets.QHBoxLayout()
@@ -137,10 +144,15 @@ class CalibrationWindow(QtWidgets.QWidget):
cal_short_form = QtWidgets.QFormLayout(self.cal_short_box)
self.cal_short_box.setDisabled(True)
self.short_l0_input = QtWidgets.QLineEdit("0")
+ self.short_l0_input.setMinimumHeight(20)
self.short_l1_input = QtWidgets.QLineEdit("0")
+ self.short_l1_input.setMinimumHeight(20)
self.short_l2_input = QtWidgets.QLineEdit("0")
+ self.short_l2_input.setMinimumHeight(20)
self.short_l3_input = QtWidgets.QLineEdit("0")
+ self.short_l3_input.setMinimumHeight(20)
self.short_length = QtWidgets.QLineEdit("0")
+ self.short_length.setMinimumHeight(20)
cal_short_form.addRow("L0 (H(e-12))", self.short_l0_input)
cal_short_form.addRow("L1 (H(e-24))", self.short_l1_input)
cal_short_form.addRow("L2 (H(e-33))", self.short_l2_input)
@@ -151,10 +163,15 @@ class CalibrationWindow(QtWidgets.QWidget):
cal_open_form = QtWidgets.QFormLayout(self.cal_open_box)
self.cal_open_box.setDisabled(True)
self.open_c0_input = QtWidgets.QLineEdit("50")
+ self.open_c0_input.setMinimumHeight(20)
self.open_c1_input = QtWidgets.QLineEdit("0")
+ self.open_c1_input.setMinimumHeight(20)
self.open_c2_input = QtWidgets.QLineEdit("0")
+ self.open_c2_input.setMinimumHeight(20)
self.open_c3_input = QtWidgets.QLineEdit("0")
+ self.open_c3_input.setMinimumHeight(20)
self.open_length = QtWidgets.QLineEdit("0")
+ self.open_length.setMinimumHeight(20)
cal_open_form.addRow("C0 (F(e-15))", self.open_c0_input)
cal_open_form.addRow("C1 (F(e-27))", self.open_c1_input)
cal_open_form.addRow("C2 (F(e-36))", self.open_c2_input)
@@ -165,10 +182,14 @@ class CalibrationWindow(QtWidgets.QWidget):
cal_load_form = QtWidgets.QFormLayout(self.cal_load_box)
self.cal_load_box.setDisabled(True)
self.load_resistance = QtWidgets.QLineEdit("50")
+ self.load_resistance.setMinimumHeight(20)
self.load_inductance = QtWidgets.QLineEdit("0")
+ self.load_inductance.setMinimumHeight(20)
# self.load_capacitance = QtWidgets.QLineEdit("0")
+ # self.load_capacitance.setMinimumHeight(20)
# self.load_capacitance.setDisabled(True) # Not yet implemented
self.load_length = QtWidgets.QLineEdit("0")
+ self.load_length.setMinimumHeight(20)
cal_load_form.addRow("Resistance (\N{OHM SIGN})", self.load_resistance)
cal_load_form.addRow("Inductance (H(e-12))", self.load_inductance)
# cal_load_form.addRow("Capacitance (F(e-12))", self.load_capacitance)
@@ -178,6 +199,7 @@ class CalibrationWindow(QtWidgets.QWidget):
cal_through_form = QtWidgets.QFormLayout(self.cal_through_box)
self.cal_through_box.setDisabled(True)
self.through_length = QtWidgets.QLineEdit("0")
+ self.through_length.setMinimumHeight(20)
cal_through_form.addRow("Offset Delay (ps)", self.through_length)
cal_standard_layout.addWidget(self.cal_short_box)
@@ -190,14 +212,18 @@ class CalibrationWindow(QtWidgets.QWidget):
self.cal_standard_save_box.setDisabled(True)
self.cal_standard_save_selector = QtWidgets.QComboBox()
+ self.cal_standard_save_selector.setMinimumHeight(20)
self.listCalibrationStandards()
cal_standard_save_layout.addWidget(self.cal_standard_save_selector)
cal_standard_save_button_layout = QtWidgets.QHBoxLayout()
btn_save_standard = QtWidgets.QPushButton("Save")
+ btn_save_standard.setMinimumHeight(20)
btn_save_standard.clicked.connect(self.saveCalibrationStandard)
btn_load_standard = QtWidgets.QPushButton("Load")
+ btn_load_standard.setMinimumHeight(20)
btn_load_standard.clicked.connect(self.loadCalibrationStandard)
btn_delete_standard = QtWidgets.QPushButton("Delete")
+ btn_delete_standard.setMinimumHeight(20)
btn_delete_standard.clicked.connect(self.deleteCalibrationStandard)
cal_standard_save_button_layout.addWidget(btn_load_standard)
cal_standard_save_button_layout.addWidget(btn_save_standard)
diff --git a/NanoVNASaver/Windows/DeviceSettings.py b/NanoVNASaver/Windows/DeviceSettings.py
index 8fc7c70..6a0ffb7 100644
--- a/NanoVNASaver/Windows/DeviceSettings.py
+++ b/NanoVNASaver/Windows/DeviceSettings.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Windows/DisplaySettings.py b/NanoVNASaver/Windows/DisplaySettings.py
index d23bb94..e743ce2 100644
--- a/NanoVNASaver/Windows/DisplaySettings.py
+++ b/NanoVNASaver/Windows/DisplaySettings.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -77,6 +77,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
self.btnColorPicker = QtWidgets.QPushButton("█")
self.btnColorPicker.setFixedWidth(20)
+ self.btnColorPicker.setMinimumHeight(20)
self.sweepColor = self.app.settings.value(
"SweepColor", defaultValue=QtGui.QColor(160, 140, 20, 128),
type=QtGui.QColor)
@@ -89,6 +90,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
self.btnSecondaryColorPicker = QtWidgets.QPushButton("█")
self.btnSecondaryColorPicker.setFixedWidth(20)
+ self.btnSecondaryColorPicker.setMinimumHeight(20)
self.secondarySweepColor = self.app.settings.value("SecondarySweepColor",
defaultValue=QtGui.QColor(
20, 160, 140, 128),
@@ -102,6 +104,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
self.btnReferenceColorPicker = QtWidgets.QPushButton("█")
self.btnReferenceColorPicker.setFixedWidth(20)
+ self.btnReferenceColorPicker.setMinimumHeight(20)
self.referenceColor = self.app.settings.value(
"ReferenceColor", defaultValue=QtGui.QColor(0, 0, 255, 48),
type=QtGui.QColor)
@@ -114,6 +117,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
self.btnSecondaryReferenceColorPicker = QtWidgets.QPushButton("█")
self.btnSecondaryReferenceColorPicker.setFixedWidth(20)
+ self.btnSecondaryReferenceColorPicker.setMinimumHeight(20)
self.secondaryReferenceColor = self.app.settings.value(
"SecondaryReferenceColor",
defaultValue=QtGui.QColor(0, 0, 255, 48),
@@ -130,6 +134,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
self.btnSecondaryReferenceColorPicker)
self.pointSizeInput = QtWidgets.QSpinBox()
+ self.pointSizeInput.setMinimumHeight(20)
pointsize = self.app.settings.value("PointSize", 2, int)
self.pointSizeInput.setValue(pointsize)
self.changePointSize(pointsize)
@@ -141,6 +146,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
display_options_layout.addRow("Point size", self.pointSizeInput)
self.lineThicknessInput = QtWidgets.QSpinBox()
+ self.lineThicknessInput.setMinimumHeight(20)
linethickness = self.app.settings.value("LineThickness", 1, int)
self.lineThicknessInput.setValue(linethickness)
self.changeLineThickness(linethickness)
@@ -152,6 +158,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
display_options_layout.addRow("Line thickness", self.lineThicknessInput)
self.markerSizeInput = QtWidgets.QSpinBox()
+ self.markerSizeInput.setMinimumHeight(20)
markersize = self.app.settings.value("MarkerSize", 6, int)
self.markerSizeInput.setValue(markersize)
self.changeMarkerSize(markersize)
@@ -200,6 +207,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
self.btn_background_picker = QtWidgets.QPushButton("█")
self.btn_background_picker.setFixedWidth(20)
+ self.btn_background_picker.setMinimumHeight(20)
self.btn_background_picker.clicked.connect(
lambda: self.setColor(
"background",
@@ -212,6 +220,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
self.btn_foreground_picker = QtWidgets.QPushButton("█")
self.btn_foreground_picker.setFixedWidth(20)
+ self.btn_foreground_picker.setMinimumHeight(20)
self.btn_foreground_picker.clicked.connect(
lambda: self.setColor(
"foreground",
@@ -223,6 +232,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
self.btn_text_picker = QtWidgets.QPushButton("█")
self.btn_text_picker.setFixedWidth(20)
+ self.btn_text_picker.setMinimumHeight(20)
self.btn_text_picker.clicked.connect(
lambda: self.setColor(
"text",
@@ -238,6 +248,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
font_options_box = QtWidgets.QGroupBox("Font")
font_options_layout = QtWidgets.QFormLayout(font_options_box)
self.font_dropdown = QtWidgets.QComboBox()
+ self.font_dropdown.setMinimumHeight(20)
self.font_dropdown.addItems(["7", "8", "9", "10", "11", "12"])
font_size = self.app.settings.value("FontSize",
defaultValue="8",
@@ -258,6 +269,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
self.btn_bands_picker = QtWidgets.QPushButton("█")
self.btn_bands_picker.setFixedWidth(20)
+ self.btn_bands_picker.setMinimumHeight(20)
self.btn_bands_picker.clicked.connect(
lambda: self.setColor(
"bands",
@@ -268,6 +280,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
bands_layout.addRow("Chart bands", self.btn_bands_picker)
self.btn_manage_bands = QtWidgets.QPushButton("Manage bands")
+ self.btn_manage_bands.setMinimumHeight(20)
self.bandsWindow = BandsWindow(self.app)
self.btn_manage_bands.clicked.connect(self.displayBandsWindow)
@@ -288,6 +301,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
self.btn_vswr_picker = QtWidgets.QPushButton("█")
self.btn_vswr_picker.setFixedWidth(20)
+ self.btn_vswr_picker.setMinimumHeight(20)
self.btn_vswr_picker.clicked.connect(
lambda: self.setColor(
"vswr",
@@ -298,6 +312,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
vswr_marker_layout.addRow("VSWR Markers", self.btn_vswr_picker)
self.vswr_marker_dropdown = QtWidgets.QComboBox()
+ self.vswr_marker_dropdown.setMinimumHeight(20)
vswr_marker_layout.addRow(self.vswr_marker_dropdown)
if len(self.vswrMarkers) == 0:
@@ -310,7 +325,9 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
self.vswr_marker_dropdown.setCurrentIndex(0)
btn_add_vswr_marker = QtWidgets.QPushButton("Add ...")
+ btn_add_vswr_marker.setMinimumHeight(20)
btn_remove_vswr_marker = QtWidgets.QPushButton("Remove")
+ btn_remove_vswr_marker.setMinimumHeight(20)
vswr_marker_btn_layout = QtWidgets.QHBoxLayout()
vswr_marker_btn_layout.addWidget(btn_add_vswr_marker)
vswr_marker_btn_layout.addWidget(btn_remove_vswr_marker)
@@ -323,10 +340,13 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
markers_layout = QtWidgets.QFormLayout(markers_box)
btn_add_marker = QtWidgets.QPushButton("Add")
+ btn_add_marker.setMinimumHeight(30)
btn_add_marker.clicked.connect(self.addMarker)
self.btn_remove_marker = QtWidgets.QPushButton("Remove")
+ self.btn_remove_marker.setMinimumHeight(30)
self.btn_remove_marker.clicked.connect(self.removeMarker)
btn_marker_settings = QtWidgets.QPushButton("Settings ...")
+ btn_marker_settings.setMinimumHeight(30)
btn_marker_settings.clicked.connect(self.displayMarkerWindow)
marker_btn_layout = QtWidgets.QHBoxLayout()
@@ -355,6 +375,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
selections.append("None")
chart00_selection = QtWidgets.QComboBox()
+ chart00_selection.setMinimumHeight(30)
chart00_selection.addItems(selections)
chart00 = self.app.settings.value("Chart00", "S11 Smith Chart")
if chart00_selection.findText(chart00) > -1:
@@ -366,6 +387,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
charts_layout.addWidget(chart00_selection, 0, 0)
chart01_selection = QtWidgets.QComboBox()
+ chart01_selection.setMinimumHeight(30)
chart01_selection.addItems(selections)
chart01 = self.app.settings.value("Chart01", "S11 Return Loss")
if chart01_selection.findText(chart01) > -1:
@@ -377,6 +399,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
charts_layout.addWidget(chart01_selection, 0, 1)
chart02_selection = QtWidgets.QComboBox()
+ chart02_selection.setMinimumHeight(30)
chart02_selection.addItems(selections)
chart02 = self.app.settings.value("Chart02", "None")
if chart02_selection.findText(chart02) > -1:
@@ -388,6 +411,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
charts_layout.addWidget(chart02_selection, 0, 2)
chart10_selection = QtWidgets.QComboBox()
+ chart10_selection.setMinimumHeight(30)
chart10_selection.addItems(selections)
chart10 = self.app.settings.value("Chart10", "S21 Polar Plot")
if chart10_selection.findText(chart10) > -1:
@@ -399,6 +423,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
charts_layout.addWidget(chart10_selection, 1, 0)
chart11_selection = QtWidgets.QComboBox()
+ chart11_selection.setMinimumHeight(30)
chart11_selection.addItems(selections)
chart11 = self.app.settings.value("Chart11", "S21 Gain")
if chart11_selection.findText(chart11) > -1:
@@ -410,6 +435,7 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
charts_layout.addWidget(chart11_selection, 1, 1)
chart12_selection = QtWidgets.QComboBox()
+ chart12_selection.setMinimumHeight(30)
chart12_selection.addItems(selections)
chart12 = self.app.settings.value("Chart12", "None")
if chart12_selection.findText(chart12) > -1:
diff --git a/NanoVNASaver/Windows/Files.py b/NanoVNASaver/Windows/Files.py
index 9b2ac52..28c37e4 100644
--- a/NanoVNASaver/Windows/Files.py
+++ b/NanoVNASaver/Windows/Files.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Windows/MarkerSettings.py b/NanoVNASaver/Windows/MarkerSettings.py
index 82c762d..a00b306 100644
--- a/NanoVNASaver/Windows/MarkerSettings.py
+++ b/NanoVNASaver/Windows/MarkerSettings.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Windows/Screenshot.py b/NanoVNASaver/Windows/Screenshot.py
index 218eb98..bc8e09e 100644
--- a/NanoVNASaver/Windows/Screenshot.py
+++ b/NanoVNASaver/Windows/Screenshot.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/Windows/SweepSettings.py b/NanoVNASaver/Windows/SweepSettings.py
index 0bc302b..9e6e901 100644
--- a/NanoVNASaver/Windows/SweepSettings.py
+++ b/NanoVNASaver/Windows/SweepSettings.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -56,6 +56,7 @@ class SweepSettingsWindow(QtWidgets.QWidget):
layout = QtWidgets.QFormLayout(box)
input_title = QtWidgets.QLineEdit(self.app.sweep.properties.name)
+ input_title.setMinimumHeight(20)
input_title.editingFinished.connect(
lambda: self.update_title(input_title.text()))
layout.addRow(input_title)
@@ -66,26 +67,33 @@ class SweepSettingsWindow(QtWidgets.QWidget):
layout = QtWidgets.QFormLayout(box)
# Sweep Mode
+ sweep_btn_layout = QtWidgets.QHBoxLayout()
+
radio_button = QtWidgets.QRadioButton("Single sweep")
+ radio_button.setMinimumHeight(20)
radio_button.setChecked(
self.app.sweep.properties.mode == SweepMode.SINGLE)
radio_button.clicked.connect(
lambda: self.update_mode(SweepMode.SINGLE))
- layout.addWidget(radio_button)
+ sweep_btn_layout.addWidget(radio_button)
radio_button = QtWidgets.QRadioButton("Continous sweep")
+ radio_button.setMinimumHeight(20)
radio_button.setChecked(
self.app.sweep.properties.mode == SweepMode.CONTINOUS)
radio_button.clicked.connect(
lambda: self.update_mode(SweepMode.CONTINOUS))
- layout.addWidget(radio_button)
+ sweep_btn_layout.addWidget(radio_button)
radio_button = QtWidgets.QRadioButton("Averaged sweep")
+ radio_button.setMinimumHeight(20)
radio_button.setChecked(
self.app.sweep.properties.mode == SweepMode.AVERAGE)
radio_button.clicked.connect(
lambda: self.update_mode(SweepMode.AVERAGE))
- layout.addWidget(radio_button)
+ sweep_btn_layout.addWidget(radio_button)
+
+ layout.addRow(sweep_btn_layout)
# Log sweep
label = QtWidgets.QLabel(
@@ -94,23 +102,28 @@ class SweepSettingsWindow(QtWidgets.QWidget):
" amount of datapoints and many segments. Step display in"
" SweepControl cannot reflect this currently.")
label.setWordWrap(True)
+ label.setMinimumSize(600,70)
layout.addRow(label)
checkbox = QtWidgets.QCheckBox("Logarithmic sweep")
+ checkbox.setMinimumHeight(20)
checkbox.setCheckState(self.app.sweep.properties.logarithmic)
checkbox.toggled.connect(
lambda: self.update_logarithmic(checkbox.isChecked()))
- layout.addWidget(checkbox)
+ layout.addRow(checkbox)
# Averaging
label = QtWidgets.QLabel(
"Averaging allows discarding outlying samples to get better"
" averages. Common values are 3/0, 5/2, 9/4 and 25/6.")
label.setWordWrap(True)
+ label.setMinimumHeight(50)
layout.addRow(label)
averages = QtWidgets.QLineEdit(
str(self.app.sweep.properties.averages[0]))
+ averages.setMinimumHeight(20)
truncates = QtWidgets.QLineEdit(
str(self.app.sweep.properties.averages[1]))
+ truncates.setMinimumHeight(20)
averages.editingFinished.connect(
lambda: self.update_averaging(averages, truncates))
truncates.editingFinished.connect(
@@ -124,9 +137,11 @@ class SweepSettingsWindow(QtWidgets.QWidget):
" attenuator in line with the S21 input (CH1) here you can"
" specify it.")
label.setWordWrap(True)
+ label.setMinimumHeight(50)
layout.addRow(label)
input_att = QtWidgets.QLineEdit(str(self.app.s21att))
+ input_att.setMinimumHeight(20)
input_att.editingFinished.connect(
lambda: self.update_attenuator(input_att))
layout.addRow("Attenuator in port CH1 (s21) in dB", input_att)
@@ -135,26 +150,29 @@ class SweepSettingsWindow(QtWidgets.QWidget):
def sweep_box(self) -> 'QtWidgets.QWidget':
box = QtWidgets.QGroupBox("Sweep band")
layout = QtWidgets.QFormLayout(box)
+ sweep_pad_layout = QtWidgets.QHBoxLayout()
self.band_list = QtWidgets.QComboBox()
+ self.band_list.setMinimumHeight(20)
self.band_list.setModel(self.app.bands)
# pylint: disable=unnecessary-lambda
self.band_list.currentIndexChanged.connect(lambda: self.update_band())
layout.addRow("Select band", self.band_list)
- for raw_label, btn_label, value in (("Pad band limits", "None", 0),
- ("", "10%", 10),
- ("", "25%", 25),
- ("", "100%", 100),):
+ sweep_pad_layout.addWidget(QtWidgets.QLabel("Pad band limits:"))
+ for btn_label, value in (("None", 0), ("10%", 10), ("25%", 25), ("100%", 100),):
radio_button = QtWidgets.QRadioButton(btn_label)
+ radio_button.setMinimumHeight(20)
radio_button.setChecked(self.padding == value)
radio_button.clicked.connect(partial(self.update_padding, value))
- layout.addRow(raw_label, radio_button)
+ sweep_pad_layout.addWidget(radio_button)
+ layout.addRow(sweep_pad_layout)
self.band_label = QtWidgets.QLabel()
layout.addRow(self.band_label)
btn_set_band_sweep = QtWidgets.QPushButton("Set band sweep")
+ btn_set_band_sweep.setMinimumHeight(20)
btn_set_band_sweep.clicked.connect(lambda: self.update_band(True))
layout.addRow(btn_set_band_sweep)
return box
diff --git a/NanoVNASaver/Windows/TDR.py b/NanoVNASaver/Windows/TDR.py
index c163a26..add929e 100644
--- a/NanoVNASaver/Windows/TDR.py
+++ b/NanoVNASaver/Windows/TDR.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/NanoVNASaver/__main__.py b/NanoVNASaver/__main__.py
index 19e9a90..80ded93 100644
--- a/NanoVNASaver/__main__.py
+++ b/NanoVNASaver/__main__.py
@@ -4,7 +4,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/README.md b/README.md
index 8affced..ccc3d55 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@ sweep frequency spans in segments to gain more than 101 data
points, and generally display and analyze the resulting data.
- Copyright 2019, 2020 Rune B. Broberg
-- Copyright 2020 NanoVNA-Saver Authors
+- Copyright 2020, 2021 NanoVNA-Saver Authors
Latest Changes
--------------
diff --git a/setup.py b/setup.py
index 8c41b27..75f50e2 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/test/__init__.py b/test/__init__.py
index f9173b2..e9dffab 100644
--- a/test/__init__.py
+++ b/test/__init__.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/test/test_formatSweepFrequency.py b/test/test_formatSweepFrequency.py
index a3b5231..5db3d59 100644
--- a/test/test_formatSweepFrequency.py
+++ b/test/test_formatSweepFrequency.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/test/test_formatting.py b/test/test_formatting.py
index 73cb1b3..8f263f6 100644
--- a/test/test_formatting.py
+++ b/test/test_formatting.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/test/test_parseFrequency.py b/test/test_parseFrequency.py
index fe74c8f..e273634 100644
--- a/test/test_parseFrequency.py
+++ b/test/test_parseFrequency.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/test/test_rftools.py b/test/test_rftools.py
index 6890727..f2ece9b 100644
--- a/test/test_rftools.py
+++ b/test/test_rftools.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/test/test_sitools.py b/test/test_sitools.py
index a0ca468..7c2a573 100644
--- a/test/test_sitools.py
+++ b/test/test_sitools.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
@@ -17,11 +17,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
import unittest
+from math import inf
# Import targets to be tested
from NanoVNASaver.SITools import Format, Value
-from decimal import Decimal
-from math import inf
F_DEFAULT = Format()
diff --git a/test/test_sweep.py b/test/test_sweep.py
index ed1762f..4f1539a 100644
--- a/test/test_sweep.py
+++ b/test/test_sweep.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/test/test_touchstone.py b/test/test_touchstone.py
index 7a2f427..d3e9e92 100644
--- a/test/test_touchstone.py
+++ b/test/test_touchstone.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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
diff --git a/test/test_version.py b/test/test_version.py
index 17312ab..ac41c17 100644
--- a/test/test_version.py
+++ b/test/test_version.py
@@ -2,7 +2,7 @@
#
# 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
+# Copyright (C) 2020,2021 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