Exemplo n.º 1
0
KeyboardShortcutDialog::KeyboardShortcutDialog( FaceTrackNoIR *ftnoir, QWidget *parent )
    : QWidget( parent, Qt::Dialog)
{
    ui.setupUi( this );

    QPoint offsetpos(100, 100);
    this->move(parent->pos() + offsetpos);

    mainApp = ftnoir;											// Preserve a pointer to FTNoIR

    // Connect Qt signals to member-functions
    connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
    connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));

    for ( int i = 0; i < global_key_sequences.size(); i++) {
        ui.cbxCenterKey->addItem(global_key_sequences.at(i));
        ui.cbxToggleKey->addItem(global_key_sequences.at(i));
    }

    tie_setting(mainApp->s.center_key.key_index, ui.cbxCenterKey);
    tie_setting(mainApp->s.center_key.alt, ui.chkCenterAlt);
    tie_setting(mainApp->s.center_key.shift, ui.chkCenterShift);
    tie_setting(mainApp->s.center_key.ctrl, ui.chkCenterCtrl);

    tie_setting(mainApp->s.toggle_key.key_index, ui.cbxToggleKey);
    tie_setting(mainApp->s.toggle_key.alt, ui.chkToggleAlt);
    tie_setting(mainApp->s.toggle_key.shift, ui.chkToggleShift);
    tie_setting(mainApp->s.toggle_key.ctrl, ui.chkToggleCtrl);
}
//
// Constructor for server-settings-dialog
//
FTControls::FTControls() :
    QWidget()
{
    QString aFileName;														// File Path and Name

    ui.setupUi( this );

    // Connect Qt signals to member-functions
    connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
    connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));
    connect(ui.bntLocateNPClient, SIGNAL(clicked()), this, SLOT(selectDLL()));

    tie_setting(s.intUsedInterface, ui.cbxSelectInterface);
    tie_setting(s.useDummyExe, ui.chkStartDummy);
    tie_setting(s.useTIRViews, ui.chkTIRViews);

    ui.cbxSelectInterface->addItem("Enable both");
    ui.cbxSelectInterface->addItem("Use FreeTrack, hide TrackIR");
    ui.cbxSelectInterface->addItem("Use TrackIR, hide FreeTrack");

    aFileName = QCoreApplication::applicationDirPath() + "/TIRViews.dll";
    if ( !QFile::exists( aFileName ) ) {
        ui.chkTIRViews->setChecked( false );
        ui.chkTIRViews->setEnabled ( false );
    }
    else {
        ui.chkTIRViews->setEnabled ( true );
    }
}
Exemplo n.º 3
0
TrackerControls::TrackerControls()
{
    tracker = nullptr;
	ui.setupUi(this);
    setAttribute(Qt::WA_NativeWindow, true);
	connect(ui.cameraName, SIGNAL(currentIndexChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.cameraFPS, SIGNAL(currentIndexChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.cameraFOV, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
	connect(ui.rx, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.ry, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.rz, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.tx, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.ty, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.tz, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
    connect(ui.cx, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
    connect(ui.cy, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
    connect(ui.cz, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
    //connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
    //connect(ui.buttonOK, SIGNAL(clicked()), this, SLOT(doOK()));
    //connect(ui.buttonSettings, SIGNAL(clicked()), this, SLOT(cameraSettings()));
    connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
    connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));
    loadSettings();
	settingsDirty = false;
}
TrackerControls::TrackerControls() : tracker(nullptr)
{
    ui.setupUi( this );

    // Connect Qt signals to member-functions
    connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
    connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));

    {
        auto hr = CoInitialize( nullptr );
        LPDIRECTINPUT8 g_pDI = nullptr;

        if( FAILED( hr = DirectInput8Create( GetModuleHandle( NULL ), DIRECTINPUT_VERSION,
                                             IID_IDirectInput8, ( VOID** )&g_pDI, NULL ) ) )
            goto fin;

        if( FAILED( hr = g_pDI->EnumDevices( DI8DEVCLASS_GAMECTRL,
                                             EnumJoysticksCallback,
                                             this,
                                             DIEDFL_ATTACHEDONLY )))
            goto fin;

fin:
        if (g_pDI)
            g_pDI->Release();
    }
	
	tie_setting(s.joyid, ui.joylist);
}
MOUSEControls::MOUSEControls() : _proto(nullptr)
{
    ui.setupUi( this );
    ui.cbxSelectMouse_X->addItem("None");
    ui.cbxSelectMouse_X->addItem("X");
    ui.cbxSelectMouse_X->addItem("Y");
    ui.cbxSelectMouse_X->addItem("Z");
    ui.cbxSelectMouse_X->addItem("Yaw");
    ui.cbxSelectMouse_X->addItem("Pitch");
    ui.cbxSelectMouse_X->addItem("Roll");

    ui.cbxSelectMouse_Y->addItem("None");
    ui.cbxSelectMouse_Y->addItem("X");
    ui.cbxSelectMouse_Y->addItem("Y");
    ui.cbxSelectMouse_Y->addItem("Z");
    ui.cbxSelectMouse_Y->addItem("Yaw");
    ui.cbxSelectMouse_Y->addItem("Pitch");
    ui.cbxSelectMouse_Y->addItem("Roll");

    connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK()));
    connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));

    tie_setting(s.Mouse_X, ui.cbxSelectMouse_X);
    tie_setting(s.Mouse_Y, ui.cbxSelectMouse_Y);
}
//*******************************************************************************************************
// FaceTrackNoIR Filter Settings-dialog.
//*******************************************************************************************************
//
// Constructor for server-settings-dialog
//
FilterControls::FilterControls() :
    QWidget(), accela_filter(NULL)
{
    ui.setupUi( this );

	// Load the settings from the current .INI-file
	loadSettings();
    connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
    connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));
    connect(ui.rotation_alpha, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
    connect(ui.translation_alpha, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));

    QDoubleSpinBox* boxen[] = {
        ui.doubleSpinBox,
        ui.doubleSpinBox_2,
        ui.doubleSpinBox_3,
        ui.doubleSpinBox_4,
        ui.doubleSpinBox_5,
        ui.doubleSpinBox_6,
    };

    for (int i = 0; i < 6; i++)
    {
        connect(boxen[i], SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
    }

    connect(ui.expt, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));

	qDebug() << "FilterControls() says: started";
}
FSUIPCControls::FSUIPCControls()
{
    ui.setupUi( this );
    connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK()));
    connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
    connect(ui.btnFindDLL, SIGNAL(clicked()), this, SLOT(getLocationOfDLL()));

    tie_setting(s.LocationOfDLL, ui.txtLocationOfDLL);
}
FilterControls::FilterControls() :
    QWidget(), pFilter(NULL)
{
    ui.setupUi( this );

    connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
    connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));

    tie_setting(s.kMaxSmoothing, ui.maxSmooth);
    tie_setting(s.kMinSmoothing, ui.minSmooth);
    tie_setting(s.kSmoothingScaleCurve, ui.powCurve);
}
//
// Constructor for server-settings-dialog
//
FGControls::FGControls() : theProtocol(nullptr)
{
	ui.setupUi( this );

    tie_setting(s.ip1, ui.spinIPFirstNibble);
    tie_setting(s.ip2, ui.spinIPSecondNibble);
    tie_setting(s.ip3, ui.spinIPThirdNibble);
    tie_setting(s.ip4, ui.spinIPFourthNibble);
    tie_setting(s.port, ui.spinPortNumber);

    connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
    connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));
}
//
// Constructor for server-settings-dialog
//
MOUSEControls::MOUSEControls() :
QWidget()
{
	ui.setupUi( this );

	//
	// Setup the choices
	//
	ui.cbxSelectMouseStyle->addItem("Absolute");
	ui.cbxSelectMouseStyle->addItem("Relative");

	ui.cbxSelectMouse_X->addItem("None");
	ui.cbxSelectMouse_X->addItem("Pitch");
	ui.cbxSelectMouse_X->addItem("Yaw");
	ui.cbxSelectMouse_X->addItem("Roll");
	ui.cbxSelectMouse_X->addItem("X");
	ui.cbxSelectMouse_X->addItem("Y");
	ui.cbxSelectMouse_X->addItem("Z");

	ui.cbxSelectMouse_Y->addItem("None");
	ui.cbxSelectMouse_Y->addItem("Pitch");
	ui.cbxSelectMouse_Y->addItem("Yaw");
	ui.cbxSelectMouse_Y->addItem("Roll");
	ui.cbxSelectMouse_Y->addItem("X");
	ui.cbxSelectMouse_Y->addItem("Y");
	ui.cbxSelectMouse_Y->addItem("Z");

	ui.cbxSelectMouse_Wheel->addItem("None");
	ui.cbxSelectMouse_Wheel->addItem("Pitch");
	ui.cbxSelectMouse_Wheel->addItem("Yaw");
	ui.cbxSelectMouse_Wheel->addItem("Roll");
	ui.cbxSelectMouse_Wheel->addItem("X");
	ui.cbxSelectMouse_Wheel->addItem("Y");
	ui.cbxSelectMouse_Wheel->addItem("Z");

	// Connect Qt signals to member-functions
	connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK()));
	connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
	connect(ui.cbxSelectMouse_X, SIGNAL(currentIndexChanged(int)), this, SLOT(settingChanged( int )));
	connect(ui.cbxSelectMouse_Y, SIGNAL(currentIndexChanged(int)), this, SLOT(settingChanged( int )));
	connect(ui.cbxSelectMouse_Wheel, SIGNAL(currentIndexChanged(int)), this, SLOT(settingChanged( int )));

	connect(ui.spinSensX, SIGNAL(valueChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.spinSensY, SIGNAL(valueChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.spinSensWheel, SIGNAL(valueChanged(int)), this, SLOT(settingChanged(int)));

	connect(ui.chkUseVirtualDesk, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));

	// Load the settings from the current .INI-file
	loadSettings();
}
Exemplo n.º 11
0
int CenterlineWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: doOK(); break;
        case 1: doCancel(); break;
        }
        _id -= 2;
    }
    return _id;
}
FTNControls::FTNControls() :
    QWidget()
{
    ui.setupUi( this );

    tie_setting(s.ip1, ui.spinIPFirstNibble);
    tie_setting(s.ip2, ui.spinIPSecondNibble);
    tie_setting(s.ip3, ui.spinIPThirdNibble);
    tie_setting(s.ip4, ui.spinIPFourthNibble);
    tie_setting(s.port, ui.spinPortNumber);

    connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK()));
    connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
}
//
// Constructor for server-settings-dialog
//
SCControls::SCControls() :
QWidget()
{
	ui.setupUi( this );

	// Connect Qt signals to member-functions
	connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK()));
	connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
	//connect(ui.cbxSelectPPJoyNumber, SIGNAL(currentIndexChanged(int)), this, SLOT(virtualJoystickSelected( int )));

	theProtocol = NULL;

	// Load the settings from the current .INI-file
	loadSettings();
}
//
// Constructor for server-settings-dialog
//
FSUIPCControls::FSUIPCControls() :
QWidget()
{
	ui.setupUi( this );

	// Connect Qt signals to member-functions
	connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK()));
	connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
	connect(ui.btnFindDLL, SIGNAL(clicked()), this, SLOT(getLocationOfDLL()));

	theProtocol = NULL;

	// Load the settings from the current .INI-file
	loadSettings();
}
Exemplo n.º 15
0
int DataWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: doOK(); break;
        case 1: doCancel(); break;
        case 2: doSplay1((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 3: doSplay2((*reinterpret_cast< bool(*)>(_a[1]))); break;
        }
        _id -= 4;
    }
    return _id;
}
Exemplo n.º 16
0
CurveConfigurationDialog::CurveConfigurationDialog(FaceTrackNoIR *ftnoir, QWidget *parent) :
QWidget( parent, Qt::Dialog )
{
	ui.setupUi( this );

	QPoint offsetpos(120, 30);
	this->move(parent->pos() + offsetpos);

	mainApp = ftnoir;											// Preserve a pointer to FTNoIR

	// Connect Qt signals to member-functions
	connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK()));
	connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));

	// Load the settings from the current .INI-file
	loadSettings();
}
TrackerControls::TrackerControls()
{
	ui.setupUi(this);
	loadSettings();
	connect(ui.cameraName, SIGNAL(currentIndexChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.cameraFPS, SIGNAL(currentIndexChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.cameraFOV, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double)));
	connect(ui.rx, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.ry, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.rz, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.tx, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.ty, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.tz, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
	connect(ui.buttonOK, SIGNAL(clicked()), this, SLOT(doOK()));
	settingsDirty = false;
}
TrackerControls::TrackerControls() :
QWidget()
{
	ui.setupUi( this );

	// Connect Qt signals to member-functions
    connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
    connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));

    tie_setting(s.bEnableYaw, ui.chkEnableYaw);
    tie_setting(s.bEnablePitch, ui.chkEnablePitch);
    tie_setting(s.bEnableRoll, ui.chkEnableRoll);

    tie_setting(s.constant_drift, ui.constantDrift);
    tie_setting(s.deadzone, ui.deadzone);
    tie_setting(s.persistence, ui.persistence);
    tie_setting(s.useYawSpring, ui.yawSpring);
}
Exemplo n.º 19
0
int CommentWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: doOK(); break;
        case 1: doCancel(); break;
        case 2: doComment((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 3: doExtend((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 4: doFlag((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 5: doSwap((*reinterpret_cast< bool(*)>(_a[1]))); break;
        }
        _id -= 6;
    }
    return _id;
}
//*******************************************************************************************************
// FaceTrackNoIR Filter Settings-dialog.
//*******************************************************************************************************
//
// Constructor for server-settings-dialog
//
FilterControls::FilterControls() :
	QWidget(),
	functionConfig("Accela-Scaling-Rotation", 4, 8),
	translationFunctionConfig("Accela-Scaling-Translation", 4, 8)
{
	ui.setupUi( this );

	// Load the settings from the current .INI-file
	loadSettings();
	connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK()));
	connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
	connect(ui.scalingConfig, SIGNAL(CurveChanged(bool)), this, SLOT(settingChanged(bool)));
	connect(ui.translationScalingConfig, SIGNAL(CurveChanged(bool)), this, SLOT(settingChanged(bool)));

	// Connect slider for reduction
	connect(ui.slideReduction, SIGNAL(valueChanged(int)), this, SLOT(settingChanged(int)));

	qDebug() << "FilterControls() says: started";
}
Exemplo n.º 21
0
//
// Constructor for server-settings-dialog
//
FTNServerControls::FTNServerControls( QWidget *parent, Qt::WindowFlags f ) :
QWidget( parent , f)
{
	ui.setupUi( this );

	QPoint offsetpos(100, 100);
	this->move(parent->pos() + offsetpos);

	// Connect Qt signals to member-functions
	connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK()));
	connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
	connect(ui.spinIPFirstNibble, SIGNAL(valueChanged(int)), this, SLOT(settingChanged()));
	connect(ui.spinIPSecondNibble, SIGNAL(valueChanged(int)), this, SLOT(settingChanged()));
	connect(ui.spinIPThirdNibble, SIGNAL(valueChanged(int)), this, SLOT(settingChanged()));
	connect(ui.spinIPFourthNibble, SIGNAL(valueChanged(int)), this, SLOT(settingChanged()));
	connect(ui.spinPortNumber, SIGNAL(valueChanged(int)), this, SLOT(settingChanged()));

	// Load the settings from the current .INI-file
	loadSettings();
}
//
// Constructor for server-settings-dialog
//
TrackerControls::TrackerControls() :
QWidget()
{
	ui.setupUi( this );

	// Connect Qt signals to member-functions
    connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
    connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));

	connect(ui.chkEnableRoll, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.chkEnablePitch, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.chkEnableYaw, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
#if 0
	connect(ui.chkEnableX, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.chkEnableY, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.chkEnableZ, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
#endif
	// Load the settings from the current .INI-file
	loadSettings();
}
Exemplo n.º 23
0
//
// Constructor for server-settings-dialog
//
TrackerControls::TrackerControls() :
QWidget()
{
	ui.setupUi( this );

	// Connect Qt signals to member-functions
	connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK()));
	connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
	connect(ui.spinPortNumber, SIGNAL(valueChanged(int)), this, SLOT(settingChanged()));

	connect(ui.chkEnableRoll, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.chkEnablePitch, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.chkEnableYaw, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.chkEnableX, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.chkEnableY, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.chkEnableZ, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));

	// Load the settings from the current .INI-file
	loadSettings();
}
Exemplo n.º 24
0
//
// Constructor for server-settings-dialog
//
FTControls::FTControls() :
QWidget()
{
	QString aFileName;														// File Path and Name

	ui.setupUi( this );

	// Connect Qt signals to member-functions
    connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
    connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));
	connect(ui.bntLocateNPClient, SIGNAL(clicked()), this, SLOT(selectDLL()));
	connect(ui.chkTIRViews, SIGNAL(stateChanged(int)), this, SLOT(settingChanged()));
	connect(ui.chkStartDummy, SIGNAL(stateChanged(int)), this, SLOT(settingChanged()));
	connect(ui.cbxSelectInterface, SIGNAL(currentIndexChanged(int)), this, SLOT(settingChanged( int )));

	ui.cbxSelectInterface->addItem("Enable both");
	ui.cbxSelectInterface->addItem("Use FreeTrack, hide TrackIR");
	ui.cbxSelectInterface->addItem("Use TrackIR, hide FreeTrack");

	theProtocol = NULL;

	// Load the settings from the current .INI-file
	loadSettings();


	aFileName = QCoreApplication::applicationDirPath() + "/TIRViews.dll";
	if ( !QFile::exists( aFileName ) ) {
		ui.chkTIRViews->setChecked( false );
		ui.chkTIRViews->setEnabled ( false );

		//
		// Best do this save() last, or it will continually reset the settings... :-(
		//
		save();
	}
	else {
		ui.chkTIRViews->setEnabled ( true );
	}


}
//
// Constructor for server-settings-dialog
//
TrackerControls::TrackerControls() :
    QWidget(),
    shm(SM_MM_DATA, SM_MUTEX, sizeof(TFaceData))
{
    pMemData = (SMMemMap*) shm.mem;
    
	ui.setupUi( this );

	theTracker = NULL;
	prev_state = -1;

	// Connect Qt signals to member-functions
	connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK()));
	connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
	connect(ui.btnEngineStart, SIGNAL(clicked()), this, SLOT(doStartEngine()));
	connect(ui.btnEngineStop, SIGNAL(clicked()), this, SLOT(doStopEngine()));
	connect(ui.btnSave, SIGNAL(clicked()), this, SLOT(save()));

	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()));

	//Setup the timer for showing the headpose.
	timUpdateSettings = new QTimer(this);
    connect(timUpdateSettings, SIGNAL(timeout()), this, SLOT(doTimUpdate()));
	timUpdateSettings->start(100);
	connect(this, SIGNAL(stateChanged( int )), this, SLOT(showSettings( int )));

	connect(ui.chkEnableRoll, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.chkEnablePitch, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.chkEnableYaw, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.chkEnableX, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.chkEnableY, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
	connect(ui.chkEnableZ, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int)));
}
Exemplo n.º 26
0
LRESULT CUIDialog::doCommand(
	int notifyCode,
	int commandId,
	HWND control)
{
	if (notifyCode == BN_CLICKED)
	{
		if (commandId == IDOK)
		{
			doOK();
			return 0;
		}
		else if (commandId == IDCANCEL)
		{
			doCancel();
			return 0;
		}
	}
	else if (notifyCode == EN_CHANGE)
	{
		return doTextFieldChange(commandId, control);
	}
	return CUIWindow::doCommand(notifyCode, commandId, control);
}
Exemplo n.º 27
0
//-----------------------------------------------------------------------------
TrackerDialog::TrackerDialog()
    : settings_dirty(false), tracker(NULL), trans_calib_running(false), timer(this)
{
	qDebug()<<"TrackerDialog::TrackerDialog";
	setAttribute(Qt::WA_DeleteOnClose, false);

	ui.setupUi( this );

	settings.load_ini();
	dialog_settings.load_ini();

	// initialize ui values
	ui.videowidget_check->setChecked(settings.video_widget);
	ui.dynpose_check->setChecked(settings.dyn_pose_res);
	ui.sleep_spin->setValue(settings.sleep_time);
	ui.reset_spin->setValue(settings.reset_time);
	ui.camindex_spin->setValue(settings.cam_index);
	ui.f_dspin->setValue(settings.cam_f);
	ui.res_x_spin->setValue(settings.cam_res_x);
	ui.res_y_spin->setValue(settings.cam_res_y);
	ui.fps_spin->setValue(settings.cam_fps);
	ui.campitch_spin->setValue(settings.cam_pitch);
	ui.threshold_slider->setValue(settings.threshold);

	ui.chkEnableRoll->setChecked(settings.bEnableRoll);
	ui.chkEnablePitch->setChecked(settings.bEnablePitch);
	ui.chkEnableYaw->setChecked(settings.bEnableYaw);
	ui.chkEnableX->setChecked(settings.bEnableX);
	ui.chkEnableY->setChecked(settings.bEnableY);
	ui.chkEnableZ->setChecked(settings.bEnableZ);

	ui.mindiam_spin->setValue(settings.min_point_size);
	ui.maxdiam_spin->setValue(settings.max_point_size);
	ui.model_tabs->setCurrentIndex(dialog_settings.active_model_panel);
	ui.clip_bheight_spin->setValue(dialog_settings.clip_by);
	ui.clip_blength_spin->setValue(dialog_settings.clip_bz);
	ui.clip_theight_spin->setValue(dialog_settings.clip_ty);
	ui.clip_tlength_spin->setValue(dialog_settings.clip_tz);
	ui.cap_width_spin->setValue(dialog_settings.cap_x);
	ui.cap_height_spin->setValue(dialog_settings.cap_y);
	ui.cap_length_spin->setValue(dialog_settings.cap_z);
	ui.m1x_spin->setValue(dialog_settings.M01x);
	ui.m1y_spin->setValue(dialog_settings.M01y);
	ui.m1z_spin->setValue(dialog_settings.M01z);
	ui.m2x_spin->setValue(dialog_settings.M02x);
	ui.m2y_spin->setValue(dialog_settings.M02y);
	ui.m2z_spin->setValue(dialog_settings.M02z);
	ui.tx_spin->setValue(settings.t_MH[0]);
	ui.ty_spin->setValue(settings.t_MH[1]);
	ui.tz_spin->setValue(settings.t_MH[2]);

	// connect Qt signals and slots
	connect( ui.videowidget_check,SIGNAL(toggled(bool)),     this,SLOT(set_video_widget(bool)) );
	connect( ui.dynpose_check,SIGNAL(toggled(bool)),         this,SLOT(set_dyn_pose_res(bool)) );
	connect( ui.sleep_spin,SIGNAL(valueChanged(int)),        this,SLOT(set_sleep_time(int)) );
	connect( ui.reset_spin,SIGNAL(valueChanged(int)),        this,SLOT(set_reset_time(int)) );
	connect( ui.camindex_spin,SIGNAL(valueChanged(int)),     this,SLOT(set_cam_index(int)) );	
	connect( ui.f_dspin,SIGNAL(valueChanged(double)),        this,SLOT(set_cam_f(double)) );
	connect( ui.res_x_spin,SIGNAL(valueChanged(int)),        this,SLOT(set_cam_res_x(int)) );
	connect( ui.res_y_spin,SIGNAL(valueChanged(int)),        this,SLOT(set_cam_res_y(int)) );
	connect( ui.fps_spin,SIGNAL(valueChanged(int)),          this,SLOT(set_cam_fps(int)) );
	connect( ui.campitch_spin,SIGNAL(valueChanged(int)),     this,SLOT(set_cam_pitch(int)) );
	connect( ui.threshold_slider,SIGNAL(sliderMoved(int)),   this,SLOT(set_threshold(int)) );

	connect( ui.chkEnableRoll,SIGNAL(toggled(bool)),		 this,SLOT(set_ena_roll(bool)) );
	connect( ui.chkEnablePitch,SIGNAL(toggled(bool)),		 this,SLOT(set_ena_pitch(bool)) );
	connect( ui.chkEnableYaw,SIGNAL(toggled(bool)),			 this,SLOT(set_ena_yaw(bool)) );
	connect( ui.chkEnableX,SIGNAL(toggled(bool)),			 this,SLOT(set_ena_x(bool)) );
	connect( ui.chkEnableY,SIGNAL(toggled(bool)),			 this,SLOT(set_ena_y(bool)) );
	connect( ui.chkEnableZ,SIGNAL(toggled(bool)),			 this,SLOT(set_ena_z(bool)) );

	connect( ui.mindiam_spin,SIGNAL(valueChanged(int)),      this,SLOT(set_min_point_size(int)) );
	connect( ui.maxdiam_spin,SIGNAL(valueChanged(int)),      this,SLOT(set_max_point_size(int)) );
	connect( ui.model_tabs,SIGNAL(currentChanged(int)),      this,SLOT(set_model(int)) );
	connect( ui.clip_theight_spin,SIGNAL(valueChanged(int)), this,SLOT(set_clip_t_height(int)) );
	connect( ui.clip_tlength_spin,SIGNAL(valueChanged(int)), this,SLOT(set_clip_t_length(int)) );
	connect( ui.clip_bheight_spin,SIGNAL(valueChanged(int)), this,SLOT(set_clip_b_height(int)) );
	connect( ui.clip_blength_spin,SIGNAL(valueChanged(int)), this,SLOT(set_clip_b_length(int)) );
	connect( ui.cap_width_spin,SIGNAL(valueChanged(int)),    this,SLOT(set_cap_width(int)) );
	connect( ui.cap_height_spin,SIGNAL(valueChanged(int)),   this,SLOT(set_cap_height(int)) );	
	connect( ui.cap_length_spin,SIGNAL(valueChanged(int)),   this,SLOT(set_cap_length(int)) );
	connect( ui.m1x_spin,SIGNAL(valueChanged(int)),          this,SLOT(set_m1x(int)) );
	connect( ui.m1y_spin,SIGNAL(valueChanged(int)),          this,SLOT(set_m1y(int)) );
	connect( ui.m1z_spin,SIGNAL(valueChanged(int)),          this,SLOT(set_m1z(int)) );
	connect( ui.m2x_spin,SIGNAL(valueChanged(int)),          this,SLOT(set_m2x(int)) );
	connect( ui.m2y_spin,SIGNAL(valueChanged(int)),          this,SLOT(set_m2y(int)) );
	connect( ui.m2z_spin,SIGNAL(valueChanged(int)),          this,SLOT(set_m2z(int)) );
	connect( ui.tx_spin,SIGNAL(valueChanged(int)),           this,SLOT(set_tx(int)) );
	connect( ui.ty_spin,SIGNAL(valueChanged(int)),           this,SLOT(set_ty(int)) );
	connect( ui.tz_spin,SIGNAL(valueChanged(int)),           this,SLOT(set_tz(int)) );

	connect( ui.tcalib_button,SIGNAL(toggled(bool)), this,SLOT(startstop_trans_calib(bool)) );

	connect(ui.reset_button, SIGNAL(clicked()),  this, SLOT(doReset()));
	//connect(ui.center_button, SIGNAL(clicked()), this, SLOT(doCenter()));

	connect(ui.ok_button, SIGNAL(clicked()),     this, SLOT(doOK()));
	connect(ui.cancel_button, SIGNAL(clicked()), this, SLOT(doCancel()));

    connect(&timer,SIGNAL(timeout()), this,SLOT(poll_tracker_info()));
    timer.start(100);
}
FTControls::FTControls()
{
    ui.setupUi( this );
    connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK()));
    connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
}