kopia lustrzana https://github.com/NanoVNA-Saver/nanovna-saver
- Fix for wrongly displayed capacitance values
- Allow gain in S21 readingspull/12/head
rodzic
62984beb4a
commit
782a2653ed
|
@ -832,11 +832,12 @@ class NanoVNASaver(QtWidgets.QWidget):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def reactanceEquivalent(im50, freq) -> str:
|
def reactanceEquivalent(im50, freq) -> str:
|
||||||
reactance = im50 / (freq * 2 * math.pi)
|
capacitance = 10**12/(freq * 2 * math.pi * im50)
|
||||||
if reactance < 0:
|
inductance = im50 / (freq * 2 * math.pi)
|
||||||
return str(round(-reactance * 1000000000, 3)) + " nF"
|
if im50 < 0:
|
||||||
|
return str(round(-capacitance, 3)) + " pF"
|
||||||
else:
|
else:
|
||||||
return str(round(reactance * 1000000000, 3)) + " nH"
|
return str(round(inductance * 1000000000, 3)) + " nH"
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def gain(data: Datapoint):
|
def gain(data: Datapoint):
|
||||||
|
|
|
@ -130,10 +130,10 @@ class SweepWorker(QtCore.QRunnable):
|
||||||
for d in tmpdata:
|
for d in tmpdata:
|
||||||
a, b = d.split(" ")
|
a, b = d.split(" ")
|
||||||
try:
|
try:
|
||||||
if float(a) < -1.5 or float(a) > 1.5:
|
if float(a) < -2.5 or float(a) > 2.5:
|
||||||
print("Warning: Got a non-float data value: " + d + " (" + a + ")")
|
print("Warning: Got a non-float data value: " + d + " (" + a + ")")
|
||||||
done = False
|
done = False
|
||||||
if float(b) < -1.5 or float(b) > 1.5:
|
if float(b) < -2.5 or float(b) > 2.5:
|
||||||
print("Warning: Got a non-float data value: " + d + " (" + b + ")")
|
print("Warning: Got a non-float data value: " + d + " (" + b + ")")
|
||||||
done = False
|
done = False
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
Ładowanie…
Reference in New Issue