-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ab4e45
commit a7ffc7a
Showing
9 changed files
with
563 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Compiled source # | ||
################### | ||
*.com | ||
*.class | ||
*.dll | ||
*.exe | ||
*.o | ||
*.so | ||
|
||
# Packages # | ||
############ | ||
# it's better to unpack these files and commit the raw source | ||
# git has its own built in compression methods | ||
*.7z | ||
*.dmg | ||
*.gz | ||
*.iso | ||
*.jar | ||
*.rar | ||
*.tar | ||
*.zip | ||
*.war | ||
*.ear | ||
|
||
# Logs and databases # | ||
###################### | ||
*.log | ||
*.sql | ||
*.sqlite | ||
|
||
# OS generated files # | ||
###################### | ||
.DS_Store* | ||
ehthumbs.db | ||
Icon? | ||
Thumbs.db | ||
|
||
#Eclipse files | ||
############## | ||
.project | ||
.classpath | ||
.settings/ | ||
build.properties | ||
|
||
#VAADIN files | ||
############# | ||
konekti.countertrack.workbench/src/main/webapp/VAADIN/widgetsets/* | ||
|
||
#MANIFEST files | ||
############### | ||
MANIFEST.MF | ||
|
||
#Maven binaries | ||
############### | ||
target/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Gait.cpp | ||
* | ||
* Created on: 22/10/2013 | ||
* Author: miguel | ||
*/ | ||
#include "Gait.h" | ||
#include <cstdlib> | ||
|
||
Gait::Gait() { | ||
direction = 0; | ||
gaitDate = time(0); | ||
sequence.push_back(0); | ||
} | ||
|
||
Gait::Gait(int currentDirection, vector<int>currentSequence) { | ||
direction = currentDirection; | ||
sequence = currentSequence; | ||
gaitDate = time(0); | ||
} | ||
|
||
bool Gait::sameGait(Gait lastGait) { | ||
bool sameGait = false; | ||
|
||
if (abs(gaitDate - lastGait.getGaitDate() < 500) ) { | ||
if (direction == 1 && lastGait.getDirection() == 1 && | ||
sequence[sequence.size()-1] > lastGait.getSequence()[lastGait.getSequence().size() -1] | ||
) { | ||
sameGait = true; | ||
} else if (direction == 0 && lastGait.getDirection() == 0 && | ||
sequence[sequence.size()-1] < lastGait.getSequence()[lastGait.getSequence().size() -1] | ||
) { | ||
sameGait = true; | ||
} | ||
} | ||
return sameGait; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Gait.h | ||
* | ||
* Created on: 22/10/2013 | ||
* Author: miguel | ||
*/ | ||
#include <vector> | ||
#include <ctime> | ||
|
||
using namespace std; | ||
|
||
#ifndef GAIT_H_ | ||
#define GAIT_H_ | ||
|
||
class Gait { | ||
public: | ||
Gait(); | ||
Gait(int currentDirection, vector<int> currentSequence); | ||
bool sameGait(Gait lastGait); | ||
|
||
int getDirection() const { | ||
return direction; | ||
} | ||
|
||
time_t getGaitDate() const { | ||
return gaitDate; | ||
} | ||
|
||
vector<int> getSequence() const { | ||
return sequence; | ||
} | ||
private: | ||
int direction; | ||
vector<int> sequence; | ||
time_t gaitDate; | ||
}; | ||
|
||
|
||
#endif /* GAIT_H_ */ |
Oops, something went wrong.