Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 121 lines (86 sloc) 2.963 kB
53a7c8a Woops, fixing embarassing spelling error on void incoming_reading() slot
cpscotti authored
1 /*
2 * Copyright (c) 2011 Nokia Corporation
3 *
4 * This file is part of the Push Snowboarding Project, More info at:
5 * www.pushsnowboading.com
6 *
7 * Author: Clovis Scotti <scotti@ieee.org>
8 *
9 * This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 *
26 */
27
28 #ifndef PUSHN8AIRTIMEDETECTOR_H
29 #define PUSHN8AIRTIMEDETECTOR_H
30
31 #include <typeinfo>
32
33 #include "npushlogtick.h"
34
35 #include "npushimutick.h"
36 #include "npushacctick.h"
37 #include "npushnormfeettick.h"
38
39 #include "npushairtimetick.h"
40
41 #include "pushburtongenericdevice.h"
42
43 #include "AbsNormFeetTypes.h"
44
45 #include "pushn8absnormfeetdevice.h"
46 #include "pushn8phoneacc.h"
47 #include "pushn8imudevice.h"
48
49 #include "fuzzydetector.h"
50
51
52 #include "npushreportairtime.h"
53
54 class PushN8AirTimeDetector : public PushBurtonGenericDevice
55 {
56 Q_OBJECT
57 public:
58 PushN8AirTimeDetector();
59
60 ~PushN8AirTimeDetector();
61
62 bool subscribesToAny();
63 bool subscribesTo(PushBurtonGenericDevice* deviceType);
64
c35ef9d Using standard names for all devices; responsible tick disposal when …
Clovis Scotti authored
65 QString getName();
53a7c8a Woops, fixing embarassing spelling error on void incoming_reading() slot
cpscotti authored
66
67 void start_readings();
68 void stop_readings();
69
70 bool is_online();
71
72 SnowboradPressureData last_pdata;
73
74 NPushReportAirTime * atReport;
75
76 protected:
77 bool start_run();
78 bool end_run();
79
80 private:
81 void handle_response(Response);
c35ef9d Using standard names for all devices; responsible tick disposal when …
Clovis Scotti authored
82 // void handle_response(Response);
53a7c8a Woops, fixing embarassing spelling error on void incoming_reading() slot
cpscotti authored
83 bool flying;
84
85 FuzzyDetector fuzzyDetector;
86
87 double tRunStart;
88 double tRunCurr;
89
90 double fp,pa,ia,bpa;
91
c35ef9d Using standard names for all devices; responsible tick disposal when …
Clovis Scotti authored
92 static const quint64 small_airtime_threshold = 220;
93
53a7c8a Woops, fixing embarassing spelling error on void incoming_reading() slot
cpscotti authored
94 static const quint64 air_threshold = 200;//how big an air needs to be to be even considered
95
c35ef9d Using standard names for all devices; responsible tick disposal when …
Clovis Scotti authored
96 static const quint64 ground_threshold = 40;//80;//for how long the rider needs to be on the
53a7c8a Woops, fixing embarassing spelling error on void incoming_reading() slot
cpscotti authored
97 //ground to count as landing
98
99 quint64 currentTstamp;//always running
100 quint64 takeOffTime;//tstamp when the jump started (entered Counting Air)
101 quint64 touchDownTime;//tstamp when ground detected (entered CountingGround)
102
103 quint64 lastAirborneTime;
104
c35ef9d Using standard names for all devices; responsible tick disposal when …
Clovis Scotti authored
105 int nOfSamplesInAir;
106
53a7c8a Woops, fixing embarassing spelling error on void incoming_reading() slot
cpscotti authored
107 enum AirDetectorDynState
108 {
109 IdleGround = 42,
110 CountingAir,
111 IdleAir,
112 CountingGround
113 } dynamic_state;
114
115 public slots:
116 void incoming_reading(NPushLogTick *);
117
118 };
119
120 #endif // PUSHN8AIRTIMEDETECTOR_H
Something went wrong with that request. Please try again.