Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
parallel_resistors.h
Go to the documentation of this file.
1
7
8#ifndef PARALLEL_RESISTORS_H
9#define PARALLEL_RESISTORS_H
10
11#include <QDialog>
12#include <QVector>
14#include "Misc/general.h"
15
17class QLabel;
18class QPushButton;
19class QGroupBox;
20class QTableWidget;
21class QLineEdit;
22
31class ParallelResistorsDialog : public QDialog {
32 Q_OBJECT
33public:
36 explicit ParallelResistorsDialog(QWidget *parent = nullptr);
37
38private slots:
40 void computeResults();
41
43 void addResistor();
44
46 void removeResistor();
47
49 void on_inputChanged();
50
52 void showDocumentation() {
53 QString path = QString("/Calculators/ParallelSeriesEquivalents/ParallelResistors/index.html");
54 showHTMLDocs(path);
55 }
56
57private:
58 // ========== Input Widgets ==========
59
61 CustomDoubleSpinBox *spinDeltaV;
62
64 CustomDoubleSpinBox *spinPmax;
65
67 QTableWidget *tableResistors;
68
69 // ========== Output Display ==========
70
72 QLabel *labelReq;
73
75 QTableWidget *resultsTable;
76
77 // ========== Helper Functions ==========
78
82 double parseResistance(const QString &valueStr) const;
83
87 QString formatResistance(double value) const;
88
92 QString formatCurrent(double value) const;
93
97 QString formatPower(double value) const;
98
101 QVector<double> getResistors() const;
102
106 double calculateParallelResistance(const QVector<double> &resistors) const;
107};
108
109#endif // PARALLEL_RESISTORS_H
Custom QDoubleSpinBox. It includes a context menu (right-click) for setting the minimum,...
A QDoubleSpinBox subclass that provides a context menu for configuring range and step.
Definition CustomDoubleSpinBox.h:28
Dialog for calculating equivalent resistance of parallel resistors.
Definition parallel_resistors.h:31
Utility functions needed across the whole project.
void showHTMLDocs(QString path)
Show HTML documentation in the web browser.
Definition showHTMLDocs.cpp:17