From 9990b05efb6fcd806ec5d996310f4a945a0b0fac Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 27 Nov 2013 19:52:03 +0100 Subject: merge in the right hatire branch this time! Signed-off-by: Stanislaw Halik --- ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h | 56 +++++++++++++++++------ 1 file changed, 41 insertions(+), 15 deletions(-) (limited to 'ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h') diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h index 25bd839c..e413ded6 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h @@ -1,35 +1,41 @@ #ifndef FTNOIR_TRACKER_HAT_DIALOG_H #define FTNOIR_TRACKER_HAT_DIALOG_H +#ifdef OPENTRACK_API #include "ftnoir_tracker_base/ftnoir_tracker_base.h" +#else +#include "..\ftnoir_tracker_base\ftnoir_tracker_base.h" +#endif #include "ftnoir_tracker_hat_settings.h" #include "ftnoir_tracker_hat.h" #include "ui_ftnoir_hatcontrols.h" - +#include +#include #include #include +#include +// Widget that has controls for FTNoIR protocol client-settings. class TrackerControls: public QWidget, public ITrackerDialog { Q_OBJECT - public: explicit TrackerControls(); - virtual ~TrackerControls() virt_override; - + virtual ~TrackerControls(); void Initialize(QWidget *parent) virt_override; void registerTracker(ITracker *tracker) virt_override; void unRegisterTracker() virt_override; private: Ui::UIHATControls ui; - int pre_frame; FTNoIR_Tracker *theTracker; + QTime last_time; + +public slots: + void WriteMsgInfo(const QByteArray &MsgInfo); protected slots: - void set_mod_port(const QString & val) { settings.SerialPortName =val; - QMessageBox::warning(this,"FaceTrackNoIR Error", settings.SerialPortName); - settings_changed(); } + void set_mod_port(const QString & val) { settings.SerialPortName =val; settings_changed(); } void set_ena_roll(bool val) { settings.EnableRoll = val; settings_changed(); } void set_ena_pitch(bool val) { settings.EnablePitch = val; settings_changed(); } void set_ena_yaw(bool val) { settings.EnableYaw = val; settings_changed(); } @@ -45,20 +51,41 @@ protected slots: void set_inv_z(bool val) { settings.InvertZ = val; settings_changed(); } - void set_rot_roll(int val) { settings.RollAxis = val; settings_changed(); } - void set_rot_pitch(int val) { settings.PitchAxis = val; settings_changed(); } - void set_rot_yaw(int val) { settings.YawAxis = val; settings_changed(); } - void set_acc_x(int val) { settings.XAxis = val; settings_changed(); } - void set_acc_y(int val) { settings.YAxis = val; settings_changed(); } - void set_acc_z(int val) { settings.ZAxis = val; settings_changed(); } + void set_rot_roll(int val) { settings.RollAxe = val; settings_changed(); } + void set_rot_pitch(int val) { settings.PitchAxe = val; settings_changed(); } + void set_rot_yaw(int val) { settings.YawAxe = val; settings_changed(); } + void set_acc_x(int val) { settings.XAxe = val; settings_changed(); } + void set_acc_y(int val) { settings.YAxe = val; settings_changed(); } + void set_acc_z(int val) { settings.ZAxe = val; settings_changed(); } + + void set_cmd_start(const QString &val) { settings.CmdStart = val; settings_changed(); } + void set_cmd_stop(const QString &val) { settings.CmdStop = val; settings_changed(); } + void set_cmd_init(const QString &val) { settings.CmdInit = val; settings_changed(); } + void set_cmd_reset(const QString &val) { settings.CmdReset = val; settings_changed(); } + void set_cmd_center(const QString &val) { settings.CmdCenter = val; settings_changed(); } + void set_cmd_zero(const QString &val) { settings.CmdZero = val; settings_changed(); } + + void set_DelayInit(int val) { settings.DelayInit = val; settings_changed(); } + void set_DelayStart(int val) { settings.DelayStart = val; settings_changed(); } + void set_DelaySeq(int val) { settings.DelaySeq = val; settings_changed(); } + + void set_endian(bool val) { settings.BigEndian = val; settings_changed(); } + + void set_mod_baud(int val) { settings.pBaudRate = static_cast(ui.QCB_Serial_baudRate->itemData(val).toInt()) ; settings_changed(); } + void set_mod_dataBits(int val) { settings.pDataBits = static_cast(ui.QCB_Serial_dataBits->itemData(val).toInt()) ; settings_changed(); } + void set_mod_parity(int val) { settings.pParity = static_cast(ui.QCB_Serial_parity->itemData(val).toInt()) ; settings_changed(); } + void set_mod_stopBits(int val) { settings.pStopBits = static_cast(ui.QCB_Serial_stopBits->itemData(val).toInt()); settings_changed(); } + void set_mod_flowControl(int val) { settings.pFlowControl = static_cast(ui.QCB_Serial_flowControl->itemData(val).toInt()) ; settings_changed(); } void doOK(); void doCancel(); void doSave(); void doReset(); void doCenter(); + void doZero(); void doSend(); void poll_tracker_info(); + void doSerialInfo(); protected: bool settingsDirty; @@ -67,5 +94,4 @@ protected: QTimer timer; }; - #endif //FTNOIR_TRACKER_HAT_DIALOG_H -- cgit v1.2.3