From 2dc723dc9a8a7163be96f71f0d7267eb62fdc815 Mon Sep 17 00:00:00 2001 From: Vincenzo Petrolo Date: Sat, 8 May 2021 01:06:44 +0200 Subject: [PATCH] feat : starting implementation for frequency spectrum Signed-off-by: Vincenzo Petrolo --- .gitmodules | 3 +++ Desktop_Interface/isodriver.cpp | 17 +++++++++++++++-- Desktop_Interface/isodriver.h | 1 + Desktop_Interface/kfr | 1 + Desktop_Interface/mainwindow.cpp | 5 +++++ Desktop_Interface/mainwindow.h | 2 ++ Desktop_Interface/make_appimage | 2 +- 7 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .gitmodules create mode 160000 Desktop_Interface/kfr diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..962d036c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Desktop_Interface/kfr"] + path = Desktop_Interface/kfr + url = https://github.com/kfrlib/kfr.git diff --git a/Desktop_Interface/isodriver.cpp b/Desktop_Interface/isodriver.cpp index c988153c..04e1df65 100644 --- a/Desktop_Interface/isodriver.cpp +++ b/Desktop_Interface/isodriver.cpp @@ -718,12 +718,25 @@ void isoDriver::frameActionGeneric(char CH1_mode, char CH2_mode) udateCursors(); - if(XYmode){ + /* After having gathered all infos in CH1, CH2 if spectrum is true + * we calculate the FFT, and subsitute FFT values to CH1,CH2 vectors. + * It is also needed to change the graph indications. + */ + if (spectrum) { + if (CH2_mode) { + /*Then size of buffer is doubled 750ks*/ + } else { + /*Size of input buffer is 375ks*/ + } + /*Compute FFT*/ + /*Write output to new arrays, and plot them*/ + } else if(XYmode){ QCPCurve* curve = reinterpret_cast(axes->plottable(0)); curve->setData(CH1, CH2); axes->xAxis->setRange(xmin, xmax); axes->yAxis->setRange(ymin, ymax); - }else{ + } else{ + /*@HINT here plotting graph*/ axes->graph(0)->setData(x,CH1); if(CH2_mode) axes->graph(1)->setData(x,CH2); axes->xAxis->setRange(-display.window - display.delay, -display.delay); diff --git a/Desktop_Interface/isodriver.h b/Desktop_Interface/isodriver.h index cabb288e..528ec248 100644 --- a/Desktop_Interface/isodriver.h +++ b/Desktop_Interface/isodriver.h @@ -88,6 +88,7 @@ public: //DAQ bool fileModeEnabled = false; double daq_maxWindowSize; + bool spectrum = false; private: //Those bloody bools that just Enable/Disable a single property bool paused_CH1 = false; diff --git a/Desktop_Interface/kfr b/Desktop_Interface/kfr new file mode 160000 index 00000000..9fc73247 --- /dev/null +++ b/Desktop_Interface/kfr @@ -0,0 +1 @@ +Subproject commit 9fc73247f43b303617329294ae264613df4dce71 diff --git a/Desktop_Interface/mainwindow.cpp b/Desktop_Interface/mainwindow.cpp index f00d1b71..6e4ef7ac 100644 --- a/Desktop_Interface/mainwindow.cpp +++ b/Desktop_Interface/mainwindow.cpp @@ -2511,3 +2511,8 @@ void MainWindow::on_actionHide_Widget_LogicAnalyzer_triggered(bool checked) ui->busSnifferGroup_CH2->setVisible(!checked); ui->digitalOutputGroup->setVisible(!checked); } + +void MainWindow::on_actionFrequency_Spectrum_triggered(bool checked) +{ + ui->controller_iso->spectrum = checked; +} diff --git a/Desktop_Interface/mainwindow.h b/Desktop_Interface/mainwindow.h index 8edc9a51..9262b594 100644 --- a/Desktop_Interface/mainwindow.h +++ b/Desktop_Interface/mainwindow.h @@ -227,6 +227,8 @@ private slots: void on_actionHide_Widget_LogicAnalyzer_triggered(bool checked); + void on_actionFrequency_Spectrum_triggered(bool checked); + private: //Generic Vars Ui::MainWindow *ui; diff --git a/Desktop_Interface/make_appimage b/Desktop_Interface/make_appimage index a2911d62..41e70d2f 100755 --- a/Desktop_Interface/make_appimage +++ b/Desktop_Interface/make_appimage @@ -11,7 +11,7 @@ unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH export VERSION=$(git rev-parse --short HEAD) ./linuxdeployqt-*.AppImage appdir/usr/share/applications/*.desktop -bundle-non-qt-libs -verbose=2 -unsupported-allow-new-glibc mkdir -p appdir/usr/optional/ ; wget -c https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/exec-x86_64.so -O ./appdir/usr/optional/exec.so -mkdir -p appdir/usr/optional/libstdc++/ ; cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./appdir/usr/optional/libstdc++/ +mkdir -p appdir/usr/optional/libstdc++/ ; cp /usr/lib/libstdc++.so.6 ./appdir/usr/optional/libstdc++/ ./linuxdeployqt-*.AppImage --appimage-extract rm ./appdir/AppRun ; cp ./resources/AppRun appdir/ ; chmod a+x ./appdir/AppRun PATH=./squashfs-root/usr/bin:$PATH ./squashfs-root/usr/bin/appimagetool -g ./appdir/