From c545df178399f5c03de6937c539b64de1f9909ee Mon Sep 17 00:00:00 2001 From: informacja Date: Fri, 15 Nov 2019 00:33:12 +0100 Subject: [PATCH] modified: Finger_App/mainwindow.cpp modified: Finger_App/mainwindow.h modified: matlab/start_here.m CSV done matlab/log.csv --- Finger_App/Makefile | 78 +++++++++++++++++++++------------------ Finger_App/mainwindow.cpp | 23 +++++++----- Finger_App/mainwindow.h | 10 +++-- matlab/start_here.m | 4 +- 4 files changed, 63 insertions(+), 52 deletions(-) diff --git a/Finger_App/Makefile b/Finger_App/Makefile index d35ba3e..e60a4b0 100644 --- a/Finger_App/Makefile +++ b/Finger_App/Makefile @@ -3,16 +3,16 @@ # Generated by qmake (3.1) (Qt 5.13.1) # Project: Finger_App.pro # Template: app -# Command: C:\Qt\5.13.1\mingw73_64\bin\qmake.exe -o Makefile Finger_App.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" +# Command: C:\Qt\5.13.1\mingw73_64\bin\qmake.exe -o Makefile Finger_App.pro -spec win32-g++ "CONFIG+=qml_debug" "CONFIG+=qtquickcompiler" "CONFIG+=force_debug_info" "CONFIG+=separate_debug_info" ############################################################################# MAKEFILE = Makefile EQ = = -first: debug -install: debug-install -uninstall: debug-uninstall +first: release +install: release-install +uninstall: release-uninstall QMAKE = C:\Qt\5.13.1\mingw73_64\bin\qmake.exe DEL_FILE = del CHK_DIR_EXISTS= if not exist @@ -30,24 +30,10 @@ SYMLINK = $(QMAKE) -install ln -f -s DEL_DIR = rmdir MOVE = move SUBTARGETS = \ - debug \ - release + release \ + debug -debug: FORCE - $(MAKE) -f $(MAKEFILE).Debug -debug-make_first: FORCE - $(MAKE) -f $(MAKEFILE).Debug -debug-all: FORCE - $(MAKE) -f $(MAKEFILE).Debug all -debug-clean: FORCE - $(MAKE) -f $(MAKEFILE).Debug clean -debug-distclean: FORCE - $(MAKE) -f $(MAKEFILE).Debug distclean -debug-install: FORCE - $(MAKE) -f $(MAKEFILE).Debug install -debug-uninstall: FORCE - $(MAKE) -f $(MAKEFILE).Debug uninstall release: FORCE $(MAKE) -f $(MAKEFILE).Release release-make_first: FORCE @@ -62,6 +48,20 @@ release-install: FORCE $(MAKE) -f $(MAKEFILE).Release install release-uninstall: FORCE $(MAKE) -f $(MAKEFILE).Release uninstall +debug: FORCE + $(MAKE) -f $(MAKEFILE).Debug +debug-make_first: FORCE + $(MAKE) -f $(MAKEFILE).Debug +debug-all: FORCE + $(MAKE) -f $(MAKEFILE).Debug all +debug-clean: FORCE + $(MAKE) -f $(MAKEFILE).Debug clean +debug-distclean: FORCE + $(MAKE) -f $(MAKEFILE).Debug distclean +debug-install: FORCE + $(MAKE) -f $(MAKEFILE).Debug install +debug-uninstall: FORCE + $(MAKE) -f $(MAKEFILE).Debug uninstall Makefile: Finger_App.pro C:/Qt/5.13.1/mingw73_64/mkspecs/win32-g++/qmake.conf C:/Qt/5.13.1/mingw73_64/mkspecs/features/spec_pre.prf \ C:/Qt/5.13.1/mingw73_64/mkspecs/qdevice.pri \ @@ -226,10 +226,13 @@ Makefile: Finger_App.pro C:/Qt/5.13.1/mingw73_64/mkspecs/win32-g++/qmake.conf C: C:/Qt/5.13.1/mingw73_64/mkspecs/features/exclusive_builds_post.prf \ C:/Qt/5.13.1/mingw73_64/mkspecs/features/default_post.prf \ C:/Qt/5.13.1/mingw73_64/mkspecs/features/precompile_header.prf \ + C:/Qt/5.13.1/mingw73_64/mkspecs/features/resolve_target.prf \ + C:/Qt/5.13.1/mingw73_64/mkspecs/features/win32/separate_debug_info.prf \ + C:/Qt/5.13.1/mingw73_64/mkspecs/features/resources.prf \ + C:/Qt/5.13.1/mingw73_64/mkspecs/features/qtquickcompiler.prf \ C:/Qt/5.13.1/mingw73_64/mkspecs/features/qml_debug.prf \ C:/Qt/5.13.1/mingw73_64/mkspecs/features/warn_on.prf \ C:/Qt/5.13.1/mingw73_64/mkspecs/features/qt.prf \ - C:/Qt/5.13.1/mingw73_64/mkspecs/features/resources.prf \ C:/Qt/5.13.1/mingw73_64/mkspecs/features/moc.prf \ C:/Qt/5.13.1/mingw73_64/mkspecs/features/win32/opengl.prf \ C:/Qt/5.13.1/mingw73_64/mkspecs/features/uic.prf \ @@ -248,7 +251,7 @@ Makefile: Finger_App.pro C:/Qt/5.13.1/mingw73_64/mkspecs/win32-g++/qmake.conf C: C:/Qt/5.13.1/mingw73_64/lib/Qt5SerialPort.prl \ C:/Qt/5.13.1/mingw73_64/lib/Qt5Core.prl \ C:/Qt/5.13.1/mingw73_64/lib/qtmain.prl - $(QMAKE) -o Makefile Finger_App.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" + $(QMAKE) -o Makefile Finger_App.pro -spec win32-g++ "CONFIG+=qml_debug" "CONFIG+=qtquickcompiler" "CONFIG+=force_debug_info" "CONFIG+=separate_debug_info" C:/Qt/5.13.1/mingw73_64/mkspecs/features/spec_pre.prf: C:/Qt/5.13.1/mingw73_64/mkspecs/qdevice.pri: C:/Qt/5.13.1/mingw73_64/mkspecs/features/device_config.prf: @@ -412,10 +415,13 @@ C:/Qt/5.13.1/mingw73_64/mkspecs/features/resolve_config.prf: C:/Qt/5.13.1/mingw73_64/mkspecs/features/exclusive_builds_post.prf: C:/Qt/5.13.1/mingw73_64/mkspecs/features/default_post.prf: C:/Qt/5.13.1/mingw73_64/mkspecs/features/precompile_header.prf: +C:/Qt/5.13.1/mingw73_64/mkspecs/features/resolve_target.prf: +C:/Qt/5.13.1/mingw73_64/mkspecs/features/win32/separate_debug_info.prf: +C:/Qt/5.13.1/mingw73_64/mkspecs/features/resources.prf: +C:/Qt/5.13.1/mingw73_64/mkspecs/features/qtquickcompiler.prf: C:/Qt/5.13.1/mingw73_64/mkspecs/features/qml_debug.prf: C:/Qt/5.13.1/mingw73_64/mkspecs/features/warn_on.prf: C:/Qt/5.13.1/mingw73_64/mkspecs/features/qt.prf: -C:/Qt/5.13.1/mingw73_64/mkspecs/features/resources.prf: C:/Qt/5.13.1/mingw73_64/mkspecs/features/moc.prf: C:/Qt/5.13.1/mingw73_64/mkspecs/features/win32/opengl.prf: C:/Qt/5.13.1/mingw73_64/mkspecs/features/uic.prf: @@ -435,33 +441,33 @@ C:/Qt/5.13.1/mingw73_64/lib/Qt5SerialPort.prl: C:/Qt/5.13.1/mingw73_64/lib/Qt5Core.prl: C:/Qt/5.13.1/mingw73_64/lib/qtmain.prl: qmake: FORCE - @$(QMAKE) -o Makefile Finger_App.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" + @$(QMAKE) -o Makefile Finger_App.pro -spec win32-g++ "CONFIG+=qml_debug" "CONFIG+=qtquickcompiler" "CONFIG+=force_debug_info" "CONFIG+=separate_debug_info" qmake_all: FORCE -make_first: debug-make_first release-make_first FORCE -all: debug-all release-all FORCE -clean: debug-clean release-clean FORCE -distclean: debug-distclean release-distclean FORCE +make_first: release-make_first debug-make_first FORCE +all: release-all debug-all FORCE +clean: release-clean debug-clean FORCE +distclean: release-distclean debug-distclean FORCE -$(DEL_FILE) Makefile - -$(DEL_FILE) .qmake.stash + -$(DEL_FILE) L:\170\Finger_EMG\Finger_App\Finger_App.exe.debug .qmake.stash -debug-mocclean: - $(MAKE) -f $(MAKEFILE).Debug mocclean release-mocclean: $(MAKE) -f $(MAKEFILE).Release mocclean -mocclean: debug-mocclean release-mocclean +debug-mocclean: + $(MAKE) -f $(MAKEFILE).Debug mocclean +mocclean: release-mocclean debug-mocclean -debug-mocables: - $(MAKE) -f $(MAKEFILE).Debug mocables release-mocables: $(MAKE) -f $(MAKEFILE).Release mocables -mocables: debug-mocables release-mocables +debug-mocables: + $(MAKE) -f $(MAKEFILE).Debug mocables +mocables: release-mocables debug-mocables check: first benchmark: first FORCE: -$(MAKEFILE).Debug: Makefile $(MAKEFILE).Release: Makefile +$(MAKEFILE).Debug: Makefile diff --git a/Finger_App/mainwindow.cpp b/Finger_App/mainwindow.cpp index 942c57e..9862e95 100644 --- a/Finger_App/mainwindow.cpp +++ b/Finger_App/mainwindow.cpp @@ -112,10 +112,6 @@ MainWindow::MainWindow(QWidget *parent) : format.setByteOrder(QAudioFormat::LittleEndian); format.setSampleType(QAudioFormat::SampleType::Float); // nie ma double co zrobić? -// file_out.setFileName( get_unique_filename(FILE_NAME EXT) ); // depracated to uninitlalize - file_csv.setFileName( FILE_NAME ".csv"); - - // qDebug() << "File exist?" << QFile::exists(wav_path) << wav_path; @@ -182,8 +178,12 @@ MainWindow::MainWindow(QWidget *parent) : } ui->lineEdit_fileN->setText(FILE_NAME EXT); + + file_csv.setFileName( CSV_LOG ); file_csv.open(QIODevice::Append); - stream.setDevice( (QIODevice*) &file_csv ); + if( file_csv.isOpen() ) + stream.setDevice( (QIODevice*) &file_csv ); + else qDebug() << "Err: file_csv is not open " << file_csv.fileName(); // ui->textEdit->setVisible(ui->actionSave->isChecked()); @@ -742,11 +742,15 @@ void MainWindow::save_to_file( bool add_seconds) // if(add_seconds) { -// stream << "[" << QDateTime::currentMSecsSinceEpoch() << "]" << readdata << endl; +// stream << "[" << ( QDateTime::currentMSecsSinceEpoch() ) << "]" << readdata << endl; // no csv // file_out.write(( QString::toUtf8( QDateTime::currentMSecsSinceEpoch() ) )); } - + QDateTime UTC(QDateTime::currentDateTimeUtc()); + QDateTime local(UTC.toLocalTime()); + qDebug() << "UTC time is:" << UTC; + qDebug() << "Local time is:" << local; + qDebug() << "No difference between times:" << UTC.secsTo(local); wav_out->write(reinterpret_cast(wavData[k].data()), static_cast(wavData[k].size())*sizeof(wavData[0][0])); qInfo() <<"zapisano kanał "<< k << "size(): " << wavData[k].size()*sizeof (wavData[0][0]) << QDateTime::currentMSecsSinceEpoch(); @@ -1044,7 +1048,7 @@ void MainWindow::on_actionZapisz_domy_lne_triggered() void MainWindow::on_actionKatalog_triggered() { - char dst[512]; + char dst[1025]; QString b = QDir::currentPath(); // dst = b.data() // strcpy_s(dst,100, (char*)b); @@ -1185,7 +1189,7 @@ void MainWindow::on_pushButto_kat_clicked(){ ui->statusBar->showMessage("Nie mogę otworzyć sieżki " + path ); } } -#include + void MainWindow::on_pushButton_openFile_clicked() { wav_out->close(); @@ -1498,7 +1502,6 @@ void MainWindow::apply_filters() void MainWindow::signal_source() { - switch (simulation) { case GENERATE_SIGNAL: diff --git a/Finger_App/mainwindow.h b/Finger_App/mainwindow.h index f94a783..3992de6 100644 --- a/Finger_App/mainwindow.h +++ b/Finger_App/mainwindow.h @@ -20,11 +20,13 @@ //pętla pll #define FPS FPS -#define DATA_DIR "./data/" +//#define DATA_DIR "./data/" #define FILE_NAME "out" -#define EXT ".wav" -#define SAMPLE_DIR "../matlab/sample" -#define GEN_DIR "../matlab/generated" +#define EXT ".wav" +#define MATLAB "../matlab" +#define SAMPLE_DIR MATLAB "/sample" +#define GEN_DIR MATLAB "/generated" +#define CSV_LOG MATLAB "/log.csv" //#define B_SIZE DSIZE // minimalny rozmiar wczytywaniej paczki danych z pliku #define SQUARE(a) (a*a) diff --git a/matlab/start_here.m b/matlab/start_here.m index b77c682..88a697a 100644 --- a/matlab/start_here.m +++ b/matlab/start_here.m @@ -1,8 +1,8 @@ clear all; filename = 'Mario62/out1.wav'; filename = 'Mario62/out2.wav'; - filename = '../matlab/generated/out.wav'; -../matlab/generated/out1.wav +filename = '../matlab/generated/out17.wav'; + info = audioinfo(filename) [data, fs] = audioread(filename,'double');