mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-04 22:17:31 +00:00
CSV export + DFT math operation
This commit is contained in:
parent
79a990af47
commit
6e55eb02dd
27 changed files with 935 additions and 52 deletions
|
|
@ -2,28 +2,42 @@
|
|||
|
||||
#include <QFileDialog>
|
||||
#include "Traces/traceimportdialog.h"
|
||||
#include "Traces/traceexportdialog.h"
|
||||
#include "Traces/tracetouchstoneexport.h"
|
||||
#include "Traces/tracecsvexport.h"
|
||||
#include "ui_tracewidget.h"
|
||||
|
||||
#include <QMenu>
|
||||
|
||||
TraceWidgetVNA::TraceWidgetVNA(TraceModel &model, QWidget *parent)
|
||||
: TraceWidget(model, parent)
|
||||
{
|
||||
auto exportMenu = new QMenu();
|
||||
auto exportTouchstone = new QAction("Touchstone");
|
||||
auto exportCSV = new QAction("CSV");
|
||||
exportMenu->addAction(exportTouchstone);
|
||||
exportMenu->addAction(exportCSV);
|
||||
|
||||
}
|
||||
ui->bExport->setMenu(exportMenu);
|
||||
|
||||
void TraceWidgetVNA::exportDialog()
|
||||
{
|
||||
auto e = new TraceExportDialog(model);
|
||||
// Attempt to set default traces (this will result in correctly populated
|
||||
// 2 port export if the initial 4 traces have not been modified)
|
||||
e->setPortNum(2);
|
||||
auto traces = model.getTraces();
|
||||
for(unsigned int i=0;i<4;i++) {
|
||||
if(i >= traces.size()) {
|
||||
break;
|
||||
connect(exportTouchstone, &QAction::triggered, [&]() {
|
||||
auto e = new TraceTouchstoneExport(model);
|
||||
// Attempt to set default traces (this will result in correctly populated
|
||||
// 2 port export if the initial 4 traces have not been modified)
|
||||
e->setPortNum(2);
|
||||
auto traces = model.getTraces();
|
||||
for(unsigned int i=0;i<4;i++) {
|
||||
if(i >= traces.size()) {
|
||||
break;
|
||||
}
|
||||
e->setTrace(i%2, i/2, traces[i]);
|
||||
}
|
||||
e->setTrace(i%2, i/2, traces[i]);
|
||||
}
|
||||
e->show();
|
||||
e->show();
|
||||
});
|
||||
|
||||
connect(exportCSV, &QAction::triggered, [&]() {
|
||||
auto e = new TraceCSVExport(model);
|
||||
e->show();
|
||||
});
|
||||
}
|
||||
|
||||
void TraceWidgetVNA::importDialog()
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ class TraceWidgetVNA : public TraceWidget
|
|||
public:
|
||||
TraceWidgetVNA(TraceModel &model, QWidget *parent = nullptr);
|
||||
protected slots:
|
||||
virtual void exportDialog() override;
|
||||
virtual void exportDialog() override {};
|
||||
virtual void importDialog() override;
|
||||
|
||||
protected:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue