Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Thiago Santini
EyeRecToo
Commits
e416c3f8
Commit
e416c3f8
authored
Apr 30, 2018
by
Thiago Santini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds metadata to recordings
parent
bcc04414
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
2 deletions
+51
-2
EyeRecToo/src/MainWindow.cpp
EyeRecToo/src/MainWindow.cpp
+47
-2
EyeRecToo/src/MainWindow.h
EyeRecToo/src/MainWindow.h
+4
-0
No files found.
EyeRecToo/src/MainWindow.cpp
View file @
e416c3f8
#include "MainWindow.h"
#include "ui_MainWindow.h"
#include <QSysInfo>
// TODO: automatically detect suitable window positions on first init
void
MainWindow
::
createExtraMenus
()
...
...
@@ -365,7 +367,8 @@ void MainWindow::on_recordingToggle_clicked()
if
(
!
setupSubjectDirectory
())
{
ui
->
recordingToggle
->
setChecked
(
false
);
return
;
}
}
storeMetaDataHead
();
QMetaObject
::
invokeMethod
(
performanceMonitorWidget
,
"on_resetCounters_clicked"
);
qInfo
()
<<
"Record starting (Subject:"
<<
ui
->
subject
->
text
()
<<
")"
;
ui
->
changeSubjectButton
->
setEnabled
(
false
);
...
...
@@ -382,7 +385,8 @@ void MainWindow::on_recordingToggle_clicked()
emit
stopRecording
();
disconnect
(
gazeEstimationWidget
,
SIGNAL
(
outDataTuple
(
DataTuple
)),
journal
,
SIGNAL
(
newData
(
DataTuple
))
);
killTimer
(
elapsedTimeUpdateTimer
);
storeMetaDataTail
();
killTimer
(
elapsedTimeUpdateTimer
);
elapsedTime
.
invalidate
();
ui
->
elapsedTime
->
setText
(
"00:00:00"
);
ui
->
recordingToggle
->
setText
(
"Start"
);
...
...
@@ -596,3 +600,44 @@ void MainWindow::togglePreview()
{
gFreezePreview
=
!
gFreezePreview
;
}
void
MainWindow
::
storeMetaDataHead
()
{
QFile
file
(
metaDataFile
);
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
))
return
;
QTextStream
out
(
&
file
);
QDateTime
utc
=
QDateTime
::
currentDateTimeUtc
();
out
<<
"start_utc"
<<
gDataSeparator
<<
utc
.
toString
()
<<
gDataNewline
;
out
<<
"start_timer"
<<
gDataSeparator
<<
gTimer
.
elapsed
()
<<
gDataNewline
;
out
<<
"version"
<<
gDataSeparator
<<
VERSION
<<
gDataNewline
;
out
<<
"build"
<<
gDataSeparator
<<
QString
(
"%1 %2"
).
arg
(
GIT_BRANCH
).
arg
(
GIT_COMMIT_HASH
)
<<
gDataNewline
;
QSysInfo
system
;
(
void
)
system
;
// MSVC is giving an unused variable warning so let's satisfy it...
out
<<
"OS"
<<
gDataSeparator
<<
QString
(
"%1 %2"
).
arg
(
system
.
productType
()).
arg
(
system
.
productVersion
())
<<
gDataNewline
;
out
<<
"Host"
<<
gDataSeparator
<<
system
.
machineHostName
()
<<
gDataNewline
;
file
.
close
();
}
void
MainWindow
::
storeMetaDataTail
()
{
QFile
file
(
metaDataFile
);
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Append
|
QIODevice
::
Text
))
return
;
QTextStream
out
(
&
file
);
QDateTime
utc
=
QDateTime
::
currentDateTimeUtc
();
out
<<
"end_utc"
<<
gDataSeparator
<<
utc
.
toString
()
<<
gDataNewline
;
out
<<
"end_timer"
<<
gDataSeparator
<<
gTimer
.
elapsed
()
<<
gDataNewline
;
file
.
close
();
}
EyeRecToo/src/MainWindow.h
View file @
e416c3f8
...
...
@@ -100,6 +100,10 @@ private:
void
createExtraMenus
();
void
setupWidget
(
ERWidget
*
widget
,
QSettings
*
settings
,
QPushButton
*
button
=
NULL
);
const
QString
metaDataFile
=
"meta.csv"
;
void
storeMetaDataHead
();
void
storeMetaDataTail
();
protected:
void
closeEvent
(
QCloseEvent
*
event
)
Q_DECL_OVERRIDE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment