summaryrefslogtreecommitdiffhomepage
path: root/tracker-hatire/ftnoir_tracker_hat.h
blob: 4767d29116fe33acacb44e6952a743e9f44231ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#pragma once

#include "thread.hpp"
#include "opentrack/plugin-support.hpp"
#include "ftnoir_tracker_hat_settings.h"
#include "ftnoir_arduino_type.h"

#include <QObject>
#include <QPalette>
#include <QtGui>
#include <QByteArray>
#include <QMessageBox>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include <QSettings>

#define VER_FILEVERSION_STR         "Version 2.1.1"

class hatire : public QObject, public ITracker
{
    Q_OBJECT

public:
    hatire();
    ~hatire();

    void start_tracker(QFrame*);
    void data(double *data);
    //void center();
    void applysettings(const TrackerSettings& settings);
    //bool notifyZeroed();
    void reset();
    void get_info( int *tps );
    void serial_info();
    void send_serial_command(const QByteArray& x);

private:
    TArduinoData ArduinoData, HAT;
    QByteArray Begin;
    QByteArray End;

    hatire_thread t;
    thread_settings ts;

    // XXX move to settings api -sh 20160410
    TrackerSettings settings;

    int frame_cnt;
    bool new_frame;

    bool bEnableRoll;
    bool bEnablePitch;
    bool bEnableYaw;
    bool bEnableX;
    bool bEnableY;
    bool bEnableZ;

    bool bInvertRoll;
    bool bInvertPitch;
    bool bInvertYaw;
    bool bInvertX;
    bool bInvertY;
    bool bInvertZ;

    int iRollAxe;
    int iPitchAxe;
    int iYawAxe;
    int iXAxe;
    int iYAxe;
    int iZAxe;

    volatile int CptError;
};

class TrackerDll : public Metadata
{
    QString name() { return QString("Hatire Arduino"); }
    QIcon icon() { return QIcon(":/images/hat.png"); }
};