summaryrefslogtreecommitdiffhomepage
path: root/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp')
-rw-r--r--FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp42
1 files changed, 37 insertions, 5 deletions
diff --git a/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp b/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp
index 9834e78f..0998d90a 100644
--- a/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp
+++ b/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp
@@ -251,6 +251,11 @@ QWidget()
connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
connect(ui.btnEngineStart, SIGNAL(clicked()), this, SLOT(doStartEngine()));
connect(ui.btnEngineStop, SIGNAL(clicked()), this, SLOT(doStopEngine()));
+
+ ui.cbxFilterSetting->addItem("None");
+ ui.cbxFilterSetting->addItem("Normal");
+ ui.cbxFilterSetting->addItem("High");
+ connect(ui.cbxFilterSetting, SIGNAL(currentIndexChanged(int)), this, SLOT(doSetFilter( int )));
connect(ui.btnCameraSettings, SIGNAL(clicked()), this, SLOT(doShowCam()));
if (SMCreateMapping()) {
@@ -265,8 +270,9 @@ QWidget()
//Setup the timer for showing the headpose.
timUpdateSettings = new QTimer(this);
- connect(timUpdateSettings, SIGNAL(timeout()), this, SLOT(showSettings()));
- timUpdateSettings->start(1000);
+ connect(timUpdateSettings, SIGNAL(timeout()), this, SLOT(doTimUpdate()));
+ timUpdateSettings->start(100);
+ connect(this, SIGNAL(stateChanged( int )), this, SLOT(showSettings( int )));
}
@@ -435,10 +441,22 @@ bool SMClientControls::SMCreateMapping()
//
// Show the current engine-settings etc.
//
-void SMClientControls::showSettings()
+void SMClientControls::doTimUpdate()
+{
+ int state = pMemData->state;
+ if ( state != prev_state) {
+ emit stateChanged(state);
+ prev_state = state;
+ }
+}
+
+//
+// Show the current engine-settings etc.
+//
+void SMClientControls::showSettings( int newState )
{
qDebug() << "SMClientControls::showSettings says: Starting Function";
- switch (pMemData->state)
+ switch (newState)
{
case SM_API_ENGINE_STATE_TERMINATED:
ui._engine_state_label->setText("TERMINATED");
@@ -463,10 +481,11 @@ void SMClientControls::showSettings()
break;
}
+ ui.cbxFilterSetting->setEnabled( (newState == SM_API_ENGINE_STATE_IDLE) );
}
//
-// Start the tracking Engine.
+// Send a command without parameter-value to the tracking Engine.
//
void SMClientControls::doCommand(int command)
{
@@ -477,6 +496,19 @@ void SMClientControls::doCommand(int command)
return;
}
+//
+// Send a command with integer parameter-value to the tracking Engine.
+//
+void SMClientControls::doCommand(int command, int value)
+{
+ if ( (pMemData != NULL) && (WaitForSingleObject(hSMMutex, 100) == WAIT_OBJECT_0) ) {
+ pMemData->command = command; // Send command
+ pMemData->par_val_int = value;
+ ReleaseMutex(hSMMutex);
+ }
+ return;
+}
+
////////////////////////////////////////////////////////////////////////////////
// Factory function that creates instances if the Tracker-settings dialog object.