Marker improvements: linked marker groups

This commit is contained in:
Jan Käberich 2021-06-19 15:33:43 +02:00
parent cf401fcb01
commit a232be3443
31 changed files with 755 additions and 318 deletions

View file

@ -7,7 +7,7 @@ using namespace std;
constexpr double ImpedanceMatchDialog::Z0;
ImpedanceMatchDialog::ImpedanceMatchDialog(TraceMarkerModel &model, TraceMarker *marker, QWidget *parent) :
ImpedanceMatchDialog::ImpedanceMatchDialog(MarkerModel &model, Marker *marker, QWidget *parent) :
QDialog(parent),
ui(new Ui::ImpedanceMatchDialog)
{
@ -44,7 +44,7 @@ ImpedanceMatchDialog::ImpedanceMatchDialog(TraceMarkerModel &model, TraceMarker
// matching only possible for reflections
continue;
}
ui->cSource->addItem("From Marker "+QString::number(m->getNumber()), QVariant::fromValue<TraceMarker*>(m));
ui->cSource->addItem("From Marker "+QString::number(m->getNumber()), QVariant::fromValue<Marker*>(m));
if(m == marker) {
// select the last index, e.i. the just created marker
ui->cSource->setCurrentIndex(ui->cSource->count()-1);
@ -65,7 +65,7 @@ void ImpedanceMatchDialog::on_cSource_currentIndexChanged(int index)
ui->zImag->setEnabled(index == 0);
ui->zFreq->setEnabled(index == 0);
if(index > 0) {
auto m = qvariant_cast<TraceMarker*>(ui->cSource->itemData(index));
auto m = qvariant_cast<Marker*>(ui->cSource->itemData(index));
ui->rbSeries->setChecked(true);
auto data = m->getData();
auto reflection = Z0 * (1.0 + data) / (1.0 - data);

View file

@ -2,7 +2,7 @@
#define IMPEDANCEMATCHDIALOG_H
#include <QDialog>
#include "Traces/tracemarkermodel.h"
#include "Traces/Marker/markermodel.h"
namespace Ui {
class ImpedanceMatchDialog;
@ -13,7 +13,7 @@ class ImpedanceMatchDialog : public QDialog
Q_OBJECT
public:
explicit ImpedanceMatchDialog(TraceMarkerModel &model, TraceMarker *marker = nullptr, QWidget *parent = nullptr);
explicit ImpedanceMatchDialog(MarkerModel &model, Marker *marker = nullptr, QWidget *parent = nullptr);
~ImpedanceMatchDialog();
private slots: