summaryrefslogtreecommitdiffhomepage
path: root/tracker-hatire
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-hatire')
-rw-r--r--tracker-hatire/ftnoir_tracker_hat.cpp54
-rw-r--r--tracker-hatire/ftnoir_tracker_hat.h2
-rw-r--r--tracker-hatire/ftnoir_tracker_hat_dialog.cpp28
-rw-r--r--tracker-hatire/ftnoir_tracker_hat_dialog.h6
4 files changed, 45 insertions, 45 deletions
diff --git a/tracker-hatire/ftnoir_tracker_hat.cpp b/tracker-hatire/ftnoir_tracker_hat.cpp
index 10964bba..421a0e26 100644
--- a/tracker-hatire/ftnoir_tracker_hat.cpp
+++ b/tracker-hatire/ftnoir_tracker_hat.cpp
@@ -14,17 +14,17 @@
hatire::hatire()
{
- HAT.Rot[0]=0;
- HAT.Rot[1]=0;
- HAT.Rot[2]=0;
- HAT.Trans[0]=0;
- HAT.Trans[1]=0;
- HAT.Trans[2]=0;
-
- Begin.append((char) 0xAA);
- Begin.append((char) 0xAA);
- End.append((char) 0x55);
- End.append((char) 0x55);
+ HAT.Rot[0]=0;
+ HAT.Rot[1]=0;
+ HAT.Rot[2]=0;
+ HAT.Trans[0]=0;
+ HAT.Trans[1]=0;
+ HAT.Trans[2]=0;
+
+ Begin.append((char) 0xAA);
+ Begin.append((char) 0xAA);
+ End.append((char) 0x55);
+ End.append((char) 0x55);
}
hatire::~hatire()
@@ -37,16 +37,16 @@ void hatire::reset()
t.sendcmd_str(s.CmdReset);
}
-// return FPS
+// return FPS
void hatire::get_info( int *tps )
{
- *tps=frame_cnt;
- frame_cnt=0;
+ *tps=frame_cnt;
+ frame_cnt=0;
}
void hatire::start_tracker(QFrame*)
{
- CptError=0;
- frame_cnt=0;
+ CptError=0;
+ frame_cnt=0;
t.Log("Starting Tracker");
serial_result ret = t.init_serial_port();
@@ -136,14 +136,14 @@ void hatire::data(double *data)
if (CptError > 50)
{
emit t.serial_debug_info("Can't find HAT frame");
- CptError=0;
- }
+ CptError=0;
+ }
- // Need to handle this differently in opentrack as opposed to tracknoir
- //if (new_frame) {
- // in open track always populate the data, it seems opentrack always gives us a zeroed data structure to populate with pose data.
- // if we have no new data, we don't populate it and so 0 pose gets handed back which is wrong. By always running the code below, if we
- // have no new data, we will just give it the previous pose data which is the best thing we can do really.
+ // Need to handle this differently in opentrack as opposed to tracknoir
+ //if (new_frame) {
+ // in open track always populate the data, it seems opentrack always gives us a zeroed data structure to populate with pose data.
+ // if we have no new data, we don't populate it and so 0 pose gets handed back which is wrong. By always running the code below, if we
+ // have no new data, we will just give it the previous pose data which is the best thing we can do really.
const struct
{
@@ -167,11 +167,11 @@ void hatire::data(double *data)
k.place = (k.sign ? -1.f : 1.f) * (k.enable ? k.input : 0.f);
}
- // For debug
- //data->x=dataRead.length();
- //data->y=CptError;
+ // For debug
+ //data->x=dataRead.length();
+ //data->y=CptError;
}
#include "ftnoir_tracker_hat_dialog.h"
-OPENTRACK_DECLARE_TRACKER(hatire, TrackerControls, TrackerDll)
+OPENTRACK_DECLARE_TRACKER(hatire, dialog_hatire, hatire_metadata)
diff --git a/tracker-hatire/ftnoir_tracker_hat.h b/tracker-hatire/ftnoir_tracker_hat.h
index 0969fd9c..0d9d48ad 100644
--- a/tracker-hatire/ftnoir_tracker_hat.h
+++ b/tracker-hatire/ftnoir_tracker_hat.h
@@ -48,7 +48,7 @@ private:
static inline QByteArray to_latin1(const QString& str) { return str.toLatin1(); }
};
-class TrackerDll : public Metadata
+class hatire_metadata : public Metadata
{
QString name() { return QString("Hatire Arduino"); }
QIcon icon() { return QIcon(":/images/hat.png"); }
diff --git a/tracker-hatire/ftnoir_tracker_hat_dialog.cpp b/tracker-hatire/ftnoir_tracker_hat_dialog.cpp
index 7acada3f..e12b85ca 100644
--- a/tracker-hatire/ftnoir_tracker_hat_dialog.cpp
+++ b/tracker-hatire/ftnoir_tracker_hat_dialog.cpp
@@ -13,7 +13,7 @@
#include <QScrollBar>
-TrackerControls::TrackerControls() : theTracker(nullptr), timer(this)
+dialog_hatire::dialog_hatire() : theTracker(nullptr), timer(this)
{
ui.setupUi(this);
@@ -118,10 +118,10 @@ TrackerControls::TrackerControls() : theTracker(nullptr), timer(this)
//connect(ui.lineSend,SIGNAL(keyPressEvent),this,SLOT(on_lineSend_returnPressed()) );
}
-TrackerControls::~TrackerControls() {
+dialog_hatire::~dialog_hatire() {
}
-void TrackerControls::Initialize(QWidget *parent)
+void dialog_hatire::Initialize(QWidget *parent)
{
QPoint offsetpos(100, 100);
if (parent)
@@ -132,14 +132,14 @@ void TrackerControls::Initialize(QWidget *parent)
//
// Zero asked to ARDUINO
//
-void TrackerControls::doZero() {
+void dialog_hatire::doZero() {
//if (theTracker) theTracker->notifyZeroed();
}
//
// Reset asked to ARDUINO
//
-void TrackerControls::doReset() {
+void dialog_hatire::doReset() {
if (theTracker) theTracker->reset();
}
@@ -147,14 +147,14 @@ void TrackerControls::doReset() {
//
// Serial Info debug
//
-void TrackerControls::doSerialInfo() {
+void dialog_hatire::doSerialInfo() {
if (theTracker) theTracker->serial_info();
}
//
// Send command to ARDUINO
//
-void TrackerControls::doSend() {
+void dialog_hatire::doSend() {
if (theTracker) {
if (!ui.lineSend->text().isEmpty()) {
theTracker->send_serial_command(ui.lineSend->text().toLatin1());
@@ -165,7 +165,7 @@ void TrackerControls::doSend() {
//
// Enter on lineSend for send to ARDUINO
//
-void TrackerControls::on_lineSend_returnPressed()
+void dialog_hatire::on_lineSend_returnPressed()
{
doSend();
}
@@ -173,7 +173,7 @@ void TrackerControls::on_lineSend_returnPressed()
//
// Display FPS of Arduino.
//
-void TrackerControls::poll_tracker_info()
+void dialog_hatire::poll_tracker_info()
{
if (theTracker)
{
@@ -185,7 +185,7 @@ void TrackerControls::poll_tracker_info()
}
}
-void TrackerControls::WriteMsgInfo(const QByteArray &MsgInfo)
+void dialog_hatire::WriteMsgInfo(const QByteArray &MsgInfo)
{
QApplication::beep();
ui.pteINFO->moveCursor(QTextCursor::End);
@@ -194,18 +194,18 @@ void TrackerControls::WriteMsgInfo(const QByteArray &MsgInfo)
bar->setValue(bar->maximum());
}
-void TrackerControls::doOK()
+void dialog_hatire::doOK()
{
s.b->save();
close();
}
-void TrackerControls::doCancel()
+void dialog_hatire::doCancel()
{
close();
}
-void TrackerControls::register_tracker(ITracker *tracker)
+void dialog_hatire::register_tracker(ITracker *tracker)
{
theTracker = static_cast<hatire*>(tracker);
connect(&theTracker->t, SIGNAL(serial_debug_info(QByteArray)), this, SLOT(WriteMsgInfo(QByteArray)));
@@ -220,7 +220,7 @@ void TrackerControls::register_tracker(ITracker *tracker)
timer.start(250);
}
-void TrackerControls::unregister_tracker()
+void dialog_hatire::unregister_tracker()
{
timer.stop();
theTracker = nullptr;
diff --git a/tracker-hatire/ftnoir_tracker_hat_dialog.h b/tracker-hatire/ftnoir_tracker_hat_dialog.h
index 61868d43..7577445c 100644
--- a/tracker-hatire/ftnoir_tracker_hat_dialog.h
+++ b/tracker-hatire/ftnoir_tracker_hat_dialog.h
@@ -12,12 +12,12 @@
#include <QMetaType>
// Widget that has controls for FTNoIR protocol client-settings.
-class TrackerControls: public ITrackerDialog
+class dialog_hatire: public ITrackerDialog
{
Q_OBJECT
public:
- explicit TrackerControls();
- ~TrackerControls() override;
+ explicit dialog_hatire();
+ ~dialog_hatire() override;
void Initialize(QWidget *parent) ; // unused
void register_tracker(ITracker *tracker) override;
void unregister_tracker() override;