Source code for NanoVNASaver.Analysis.Base

#  NanoVNASaver
#
#  A python program to view and export Touchstone data from a NanoVNA
#  Copyright (C) 2019, 2020 Rune B. Broberg
#  Copyright (C) 2020ff 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 <https://www.gnu.org/licenses/>.
import logging
from PyQt6 import QtWidgets

logger = logging.getLogger(__name__)

CUTOFF_VALS = (3.0, 6.0, 10.0, 20.0, 60.0)


[docs] class QHLine(QtWidgets.QFrame): def __init__(self): super().__init__() self.setFrameShape(QtWidgets.QFrame.Shape.HLine)
[docs] class Analysis: def __init__(self, app: QtWidgets.QWidget): self.app = app self.label: dict[str, QtWidgets.QLabel] = { "titel": QtWidgets.QLabel(), "result": QtWidgets.QLabel(), } self.layout = QtWidgets.QFormLayout() self._widget = QtWidgets.QWidget() self._widget.setLayout(self.layout)
[docs] def widget(self) -> QtWidgets.QWidget: return self._widget
[docs] def runAnalysis(self): pass
[docs] def reset(self): for label in self.label.values(): label.clear()
[docs] def set_result(self, text): self.label["result"].setText(text)
[docs] def set_titel(self, text): self.label["titel"].setText(text)