mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-01-05 00:00:42 +01:00
Add YAxis: impedance and enable log option
This commit is contained in:
parent
124feb5b6b
commit
cdfe95af17
|
|
@ -108,6 +108,8 @@ double YAxis::sampleToCoordinate(Trace::Data data, Trace *t, unsigned int sample
|
|||
return data.y.real();
|
||||
case YAxis::Type::Imaginary:
|
||||
return data.y.imag();
|
||||
case YAxis::Type::AbsImpedance:
|
||||
return abs(Util::SparamToImpedance(data.y, t->getReferenceImpedance()));
|
||||
case YAxis::Type::SeriesR:
|
||||
return Util::SparamToResistance(data.y, t->getReferenceImpedance());
|
||||
case YAxis::Type::Reactance:
|
||||
|
|
@ -201,6 +203,7 @@ QString YAxis::TypeToName(Type type)
|
|||
case Type::VSWR: return "VSWR";
|
||||
case Type::Real: return "Real";
|
||||
case Type::Imaginary: return "Imaginary";
|
||||
case Type::AbsImpedance: return "Impedance (absolute)";
|
||||
case Type::SeriesR: return "Resistance";
|
||||
case Type::Reactance: return "Reactance";
|
||||
case Type::Capacitance: return "Capacitance";
|
||||
|
|
@ -247,6 +250,7 @@ QString YAxis::Unit(Type type, TraceModel::DataSource source)
|
|||
case Type::Imaginary:
|
||||
case Type::QualityFactor:
|
||||
return "";
|
||||
case Type::AbsImpedance: return "Ω";
|
||||
case Type::SeriesR: return "Ω";
|
||||
case Type::Reactance: return "Ω";
|
||||
case Type::Capacitance: return "F";
|
||||
|
|
@ -281,6 +285,7 @@ QString YAxis::Prefixes(Type type, TraceModel::DataSource source)
|
|||
case Type::Real: return "pnum ";
|
||||
case Type::Imaginary: return "pnum ";
|
||||
case Type::QualityFactor: return " ";
|
||||
case Type::AbsImpedance: return " ";
|
||||
case Type::SeriesR: return "m kM";
|
||||
case Type::Reactance: return "m kM";
|
||||
case Type::Capacitance: return "pnum ";
|
||||
|
|
@ -337,6 +342,7 @@ std::set<YAxis::Type> YAxis::getSupported(XAxis::Type type, TraceModel::DataSour
|
|||
ret.insert(YAxis::Type::VSWR);
|
||||
ret.insert(YAxis::Type::Real);
|
||||
ret.insert(YAxis::Type::Imaginary);
|
||||
ret.insert(YAxis::Type::AbsImpedance);
|
||||
ret.insert(YAxis::Type::SeriesR);
|
||||
ret.insert(YAxis::Type::Reactance);
|
||||
ret.insert(YAxis::Type::Capacitance);
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ public:
|
|||
Real,
|
||||
Imaginary,
|
||||
// derived parameter options
|
||||
AbsImpedance,
|
||||
SeriesR,
|
||||
Reactance,
|
||||
Capacitance,
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ XYplotAxisDialog::XYplotAxisDialog(TraceXYPlot *plot) :
|
|||
|
||||
// Setup GUI connections
|
||||
connect(ui->Y1type, qOverload<int>(&QComboBox::currentIndexChanged), [=](int index) {
|
||||
//ui->Y1log->setEnabled(index != 0);
|
||||
ui->Y1log->setEnabled(index != 0);
|
||||
ui->Y1linear->setEnabled(index != 0);
|
||||
ui->Y1auto->setEnabled(index != 0);
|
||||
bool autoRange = ui->Y1auto->isChecked();
|
||||
|
|
@ -74,7 +74,7 @@ XYplotAxisDialog::XYplotAxisDialog(TraceXYPlot *plot) :
|
|||
});
|
||||
|
||||
connect(ui->Y2type, qOverload<int>(&QComboBox::currentIndexChanged), [=](int index) {
|
||||
//ui->Y2log->setEnabled(index != 0);
|
||||
ui->Y2log->setEnabled(index != 0);
|
||||
ui->Y2linear->setEnabled(index != 0);
|
||||
ui->Y2auto->setEnabled(index != 0);
|
||||
bool autoRange = ui->Y2auto->isChecked();
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
<item>
|
||||
<widget class="QRadioButton" name="Y1log">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Log</string>
|
||||
|
|
@ -204,7 +204,7 @@
|
|||
<item>
|
||||
<widget class="QRadioButton" name="Y2log">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Log</string>
|
||||
|
|
@ -592,8 +592,8 @@
|
|||
</connection>
|
||||
</connections>
|
||||
<buttongroups>
|
||||
<buttongroup name="Xgroup"/>
|
||||
<buttongroup name="Y1group"/>
|
||||
<buttongroup name="Xgroup"/>
|
||||
<buttongroup name="Y2group"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
|
|
|||
Loading…
Reference in a new issue