Skip to content

Commit

Permalink
modified: Finger_App/mainwindow.cpp
Browse files Browse the repository at this point in the history
	modified:   Finger_App/mainwindow.h
	modified:   matlab/start_here.m
CSV done
	matlab/log.csv
  • Loading branch information
informacja committed Nov 14, 2019
1 parent 6a6e06d commit c545df1
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 52 deletions.
78 changes: 42 additions & 36 deletions Finger_App/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 \
Expand Down Expand Up @@ -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 \
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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
23 changes: 13 additions & 10 deletions Finger_App/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand Down Expand Up @@ -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());

Expand Down Expand Up @@ -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<char*>(wavData[k].data()), static_cast<uint>(wavData[k].size())*sizeof(wavData[0][0]));

qInfo() <<"zapisano kanał "<< k << "size(): " << wavData[k].size()*sizeof (wavData[0][0]) << QDateTime::currentMSecsSinceEpoch();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1185,7 +1189,7 @@ void MainWindow::on_pushButto_kat_clicked(){
ui->statusBar->showMessage("Nie mogę otworzyć sieżki " + path );
}
}
#include <QClipboard>

void MainWindow::on_pushButton_openFile_clicked()
{
wav_out->close();
Expand Down Expand Up @@ -1498,7 +1502,6 @@ void MainWindow::apply_filters()

void MainWindow::signal_source()
{

switch (simulation)
{
case GENERATE_SIGNAL:
Expand Down
10 changes: 6 additions & 4 deletions Finger_App/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions matlab/start_here.m
Original file line number Diff line number Diff line change
@@ -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');
Expand Down

0 comments on commit c545df1

Please sign in to comment.