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
12743c1e
Commit
12743c1e
authored
Oct 20, 2017
by
Thiago Santini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unchecks widgets' button when window is closed
Man, I really need to make a base class for the widgets...
parent
8aad4435
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
64 additions
and
19 deletions
+64
-19
EyeRecToo/src/CameraWidget.h
EyeRecToo/src/CameraWidget.h
+6
-2
EyeRecToo/src/GazeEstimationWidget.h
EyeRecToo/src/GazeEstimationWidget.h
+5
-1
EyeRecToo/src/LogWidget.h
EyeRecToo/src/LogWidget.h
+8
-2
EyeRecToo/src/MainWindow.cpp
EyeRecToo/src/MainWindow.cpp
+25
-6
EyeRecToo/src/MainWindow.h
EyeRecToo/src/MainWindow.h
+10
-3
EyeRecToo/src/PerformanceMonitor.h
EyeRecToo/src/PerformanceMonitor.h
+2
-3
EyeRecToo/src/PerformanceMonitorWidget.h
EyeRecToo/src/PerformanceMonitorWidget.h
+8
-2
No files found.
EyeRecToo/src/CameraWidget.h
View file @
12743c1e
...
...
@@ -43,6 +43,7 @@ signals:
void
newData
(
EyeData
data
);
void
newData
(
FieldData
data
);
void
newClick
(
Timestamp
,
QPoint
,
QSize
);
void
closed
();
public
slots
:
void
preview
(
Timestamp
t
,
const
cv
::
Mat
&
frame
);
...
...
@@ -109,6 +110,9 @@ private:
void
drawPupil
(
const
cv
::
RotatedRect
ellipse
,
QPainter
&
painter
);
void
drawMarker
(
const
Marker
&
marker
,
QPainter
&
painter
,
QColor
color
);
void
drawGaze
(
const
FieldData
&
field
,
QPainter
&
painter
);
protected:
void
closeEvent
(
QCloseEvent
*
event
)
Q_DECL_OVERRIDE
{
Q_UNUSED
(
event
)
emit
closed
();
}
};
#endif // CAMERAWIDGET_H
EyeRecToo/src/GazeEstimationWidget.h
View file @
12743c1e
...
...
@@ -35,6 +35,7 @@ signals:
void
loadTuplesFromFile
(
CollectionTuple
::
TupleType
type
,
QString
fileName
);
void
calibrationRequest
();
void
setCalibrating
(
bool
v
);
void
closed
();
public
slots
:
...
...
@@ -88,6 +89,9 @@ private slots:
void
on_rangeFactorSB_valueChanged
(
int
arg1
);
void
on_visualizationGroupBox_toggled
(
bool
arg1
);
void
on_visualizationTimeSpinBox_valueChanged
(
int
arg1
);
protected:
void
closeEvent
(
QCloseEvent
*
event
)
Q_DECL_OVERRIDE
{
Q_UNUSED
(
event
)
emit
closed
();
}
};
#endif // GAZEESTIMATIONWIDGET_H
EyeRecToo/src/LogWidget.h
View file @
12743c1e
...
...
@@ -16,6 +16,9 @@ public:
explicit
LogWidget
(
QWidget
*
parent
=
0
);
~
LogWidget
();
signals:
void
closed
();
public
slots
:
void
appendMessage
(
const
QString
&
msg
);
...
...
@@ -26,6 +29,9 @@ private slots:
private:
Ui
::
LogWidget
*
ui
;
protected:
void
closeEvent
(
QCloseEvent
*
event
)
Q_DECL_OVERRIDE
{
Q_UNUSED
(
event
)
emit
closed
();
}
};
#endif // LOGWIDGET_H
EyeRecToo/src/MainWindow.cpp
View file @
12743c1e
...
...
@@ -2,7 +2,7 @@
#include "ui_MainWindow.h"
// TODO: refactor MainWindow into a config aware class that can be shared by the
// widgets
// widgets
. Also add the gui interface there.
void
MainWindow
::
createExtraMenus
()
{
...
...
@@ -37,6 +37,8 @@ MainWindow::MainWindow(QWidget *parent) :
logWidget
=
new
LogWidget
();
setupWidget
(
logWidget
,
cfg
.
logWidgetPos
,
cfg
.
logWidgetSize
,
cfg
.
logWidgetVisible
,
ui
->
log
);
connect
(
logWidget
,
SIGNAL
(
closed
()),
this
,
SLOT
(
logWidgetClosed
())
);
gLogWidget
=
logWidget
;
/*
...
...
@@ -53,14 +55,20 @@ MainWindow::MainWindow(QWidget *parent) :
lEyeWidget
=
new
CameraWidget
(
"LeftEye"
,
ImageProcessor
::
Eye
);
lEyeWidget
->
setWindowIcon
(
QIcon
(
":/icons/lEyeWidget.png"
));
setupWidget
(
lEyeWidget
,
cfg
.
leftEyeWidgetPos
,
cfg
.
leftEyeWidgetSize
,
cfg
.
leftEyeWidgetVisible
,
ui
->
leftEyeCam
);
connect
(
lEyeWidget
,
SIGNAL
(
closed
()),
this
,
SLOT
(
lEyeWidgetClosed
())
);
QThread
::
msleep
(
200
);
rEyeWidget
=
new
CameraWidget
(
"RightEye"
,
ImageProcessor
::
Eye
);
rEyeWidget
->
setWindowIcon
(
QIcon
(
":/icons/rEyeWidget.png"
));
setupWidget
(
rEyeWidget
,
cfg
.
rightEyeWidgetPos
,
cfg
.
rightEyeWidgetSize
,
cfg
.
rightEyeWidgetVisible
,
ui
->
rightEyeCam
);
connect
(
rEyeWidget
,
SIGNAL
(
closed
()),
this
,
SLOT
(
rEyeWidgetClosed
())
);
QThread
::
msleep
(
200
);
fieldWidget
=
new
CameraWidget
(
"Field"
,
ImageProcessor
::
Field
);
fieldWidget
->
setWindowIcon
(
QIcon
(
":/icons/fieldWidget.png"
));
setupWidget
(
fieldWidget
,
cfg
.
fieldWidgetPos
,
cfg
.
fieldWidgetSize
,
cfg
.
fieldWidgetVisible
,
ui
->
fieldCam
);
connect
(
fieldWidget
,
SIGNAL
(
closed
()),
this
,
SLOT
(
fieldWidgetClosed
())
);
/*
* Synchronizer
...
...
@@ -82,6 +90,8 @@ MainWindow::MainWindow(QWidget *parent) :
gazeEstimationWidget
,
SIGNAL
(
inDataTuple
(
DataTuple
))
);
connect
(
fieldWidget
,
SIGNAL
(
newClick
(
Timestamp
,
QPoint
,
QSize
)),
gazeEstimationWidget
,
SIGNAL
(
newClick
(
Timestamp
,
QPoint
,
QSize
))
);
connect
(
gazeEstimationWidget
,
SIGNAL
(
closed
()),
this
,
SLOT
(
gazeEstimationWidgetClosed
())
);
connect
(
gazeEstimationWidget
,
SIGNAL
(
outDataTuple
(
DataTuple
)),
fieldWidget
,
SLOT
(
preview
(
DataTuple
))
);
...
...
@@ -101,6 +111,8 @@ MainWindow::MainWindow(QWidget *parent) :
performanceMonitorWidget
=
new
PerformanceMonitorWidget
();
setupWidget
(
performanceMonitorWidget
,
cfg
.
performanceMonitorWidgetPos
,
cfg
.
performanceMonitorWidgetSize
,
cfg
.
performanceMonitorWidgetVisible
,
ui
->
performanceMonitor
);
connect
(
performanceMonitorWidget
,
SIGNAL
(
closed
()),
this
,
SLOT
(
performanceMonitorWidgetClosed
())
);
// GUI to Widgets signals
connect
(
this
,
SIGNAL
(
startRecording
()),
...
...
@@ -553,3 +565,10 @@ void MainWindow::setupWidget(QMainWindow *window, QPoint &position, const QSize
if
(
button
)
button
->
setChecked
(
visible
);
}
void
MainWindow
::
logWidgetClosed
()
{
ui
->
log
->
setChecked
(
false
);
}
void
MainWindow
::
lEyeWidgetClosed
()
{
ui
->
leftEyeCam
->
setChecked
(
false
);
}
void
MainWindow
::
rEyeWidgetClosed
()
{
ui
->
rightEyeCam
->
setChecked
(
false
);
}
void
MainWindow
::
fieldWidgetClosed
()
{
ui
->
fieldCam
->
setChecked
(
false
);
}
void
MainWindow
::
gazeEstimationWidgetClosed
()
{
ui
->
gazeEstimation
->
setChecked
(
false
);
}
void
MainWindow
::
performanceMonitorWidgetClosed
()
{
ui
->
performanceMonitor
->
setChecked
(
false
);
}
EyeRecToo/src/MainWindow.h
View file @
12743c1e
...
...
@@ -197,6 +197,13 @@ private slots:
void
showAboutDialog
();
void
on_log_clicked
();
void
on_performanceMonitor_clicked
();
void
logWidgetClosed
();
void
lEyeWidgetClosed
();
void
rEyeWidgetClosed
();
void
fieldWidgetClosed
();
void
gazeEstimationWidgetClosed
();
void
performanceMonitorWidgetClosed
();
};
#endif // MAINWINDOW_H
EyeRecToo/src/PerformanceMonitor.h
View file @
12743c1e
...
...
@@ -17,7 +17,6 @@ public:
QString
getEnrolled
(
const
unsigned
int
&
idx
)
{
return
idx
<
enrolled
.
size
()
?
enrolled
[
idx
]
:
QString
();
}
unsigned
int
enrolledCount
()
{
return
(
unsigned
int
)
enrolled
.
size
();
}
void
report
();
private:
...
...
EyeRecToo/src/PerformanceMonitorWidget.h
View file @
12743c1e
...
...
@@ -22,6 +22,9 @@ public:
explicit
PerformanceMonitorWidget
(
QWidget
*
parent
=
0
);
~
PerformanceMonitorWidget
();
signals:
void
closed
();
private:
Ui
::
PerformanceMonitorWidget
*
ui
;
...
...
@@ -35,6 +38,9 @@ private:
private
slots
:
void
update
();
void
on_resetCounters_clicked
();
protected:
void
closeEvent
(
QCloseEvent
*
event
)
Q_DECL_OVERRIDE
{
Q_UNUSED
(
event
)
emit
closed
();
}
};
#endif // PERFORMANCEMONITORWIDGET_H
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