Structured dialog for .source / .detector / .lgref commands. Source: refdes of one or two independent V- or I-sources. Detector: voltage (V_ ) or current (I_ ) — single type for both entries; second entry makes it a differential detector. LG ref: ref
| 6 | |
| 7 | |
| 8 | class AnalysisDialog(QDialog): |
| 9 | """ |
| 10 | Structured dialog for .source / .detector / .lgref commands. |
| 11 | |
| 12 | Source: refdes of one or two independent V- or I-sources. |
| 13 | Detector: voltage (V_<node>) or current (I_<V-source>) — single type for |
| 14 | both entries; second entry makes it a differential detector. |
| 15 | LG ref: refdes of one or two dependent sources. |
| 16 | """ |
| 17 | |
| 18 | def __init__(self, source=None, detector=None, lgref=None, parent=None): |
| 19 | super().__init__(parent, Qt.Window) |
| 20 | self.setWindowTitle("Define Source / Detector / Loop Gain Reference") |
| 21 | self.setMinimumWidth(440) |
| 22 | |
| 23 | layout = QVBoxLayout(self) |
| 24 | |
| 25 | # ── .source ────────────────────────────────────────────────────────── |
| 26 | src_box = QGroupBox(".source (independent V or I sources only)") |
| 27 | src_form = QFormLayout(src_box) |
| 28 | self._src1 = QLineEdit() |
| 29 | self._src1.setPlaceholderText("e.g. V1 or I1") |
| 30 | self._src2 = QLineEdit() |
| 31 | self._src2.setPlaceholderText("optional — must be same type as Ref 1") |
| 32 | src_form.addRow("Ref 1:", self._src1) |
| 33 | src_form.addRow("Ref 2:", self._src2) |
| 34 | layout.addWidget(src_box) |
| 35 | |
| 36 | # ── .detector ──────────────────────────────────────────────────────── |
| 37 | det_box = QGroupBox(".detector") |
| 38 | det_v = QVBoxLayout(det_box) |
| 39 | |
| 40 | type_row = QHBoxLayout() |
| 41 | self._det_type = QComboBox() |
| 42 | self._det_type.addItems(["V", "I"]) |
| 43 | type_row.addWidget(QLabel("Type:")) |
| 44 | type_row.addWidget(self._det_type) |
| 45 | type_row.addStretch() |
| 46 | det_v.addLayout(type_row) |
| 47 | |
| 48 | hint = QLabel( |
| 49 | "V — voltage at node (result: V_<ref>)\n" |
| 50 | "I — current through V-source (result: I_<ref>)" |
| 51 | ) |
| 52 | hint.setEnabled(False) |
| 53 | det_v.addWidget(hint) |
| 54 | |
| 55 | ref_form = QFormLayout() |
| 56 | self._det1_ref = QLineEdit() |
| 57 | self._det1_ref.setPlaceholderText("node name or V-source refdes") |
| 58 | self._det2_ref = QLineEdit() |
| 59 | self._det2_ref.setPlaceholderText("optional — differential detector (same type)") |
| 60 | ref_form.addRow("Ref 1:", self._det1_ref) |
| 61 | ref_form.addRow("Ref 2:", self._det2_ref) |
| 62 | det_v.addLayout(ref_form) |
| 63 | layout.addWidget(det_box) |
| 64 | |
| 65 | # ── .lgref ──────────────────────────────────────────────────────────── |
no outgoing calls
no test coverage detected