public class Activity extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
batteryLevel |
static int |
FITNESSPOINTS_UNDEFINED |
protected int |
fitnessPointsEnd |
protected int |
fitnessPointsStart |
protected TimeZone |
localTimeZone |
protected String |
route |
protected int |
summaryActivity |
protected int |
summaryCalories |
protected double |
summaryDistance |
protected int |
summaryDuration |
protected int |
summaryType |
protected int |
timeZoneSeconds |
Constructor and Description |
---|
Activity(TtbinHeader header)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
dumpActivityCsv()
Dump the activity to csv file for analysis purposes
|
void |
dumpRecordData(byte[] recordData)
Dump the record data as hexadecimals
|
String |
getActivityDescription()
Return the activity description of this Activity instance
|
static String |
getActivityDescription(int activityType)
Return the activity name as string
|
int |
getActivityType()
Returns the activity type.
|
String |
getDeviceName()
Gets the device name.
|
String |
getDeviceSerialNumber()
Gets the device serial number.
|
double |
getDistance()
Returns the total distance of this activity
|
hirondelle.date4j.DateTime |
getFirstActiveRecordTime()
Returns the date time of the first active record
|
int |
getFitnessPoints()
Get the fitness points earned with this activity
|
int |
getNumberOfSegments()
Returns the number of segments in this Acitivity.
|
ArrayList<ActivityRecord> |
getRecords(int segmentId)
Get the array list of records associated with indicated segment.
|
String |
getRouteName()
Returns the name of the planned route that was followed
|
ActivitySegment |
getSegment(int segmentNumber)
Return the indicated segment number
|
hirondelle.date4j.DateTime |
getStartDateTime()
Returns the start datetime
|
float |
getTrackSmoothingQFactor()
Returns the track smoothing Q factor that is used for the Kalman
filter
|
ArrayList<ActivityRecord> |
getWaypoints() |
boolean |
hasHeightValues()
This method checks if the activity has GPS reocord with height values.
|
boolean |
isSmoothed()
Returns whether the track has been smoothed
|
void |
parseRecord(byte[] recordData)
Parse the record data and create a record or add to a record.
|
boolean |
processGoogleHeightServiceResults(byte[] heights) |
boolean |
readHeigthsFromService()
This method reads the height values for the coordinates from a
service on internet.
|
void |
resetSmoothing()
This method resets the smoothing
|
void |
setDeviceName(String name)
Sets the name or id of the device
|
void |
setDeviceSerialNumber(String serial)
Sets the serial number of the device
|
void |
setTimeZoneDifference(int seconds)
Set the local time zone
|
void |
smoothTrack(float trackSmoothingQFactor)
This method smoothes the track, by applying a Kalman filter
|
public static final int FITNESSPOINTS_UNDEFINED
protected int summaryType
protected double summaryDistance
protected int summaryCalories
protected int summaryDuration
protected int summaryActivity
protected TimeZone localTimeZone
protected int timeZoneSeconds
protected int batteryLevel
protected int fitnessPointsStart
protected int fitnessPointsEnd
protected String route
public Activity(TtbinHeader header)
header
- Header defining the ttbin filepublic void setDeviceName(String name)
name
- The name of the devicepublic String getDeviceName()
public void setDeviceSerialNumber(String serial)
serial
- The name of the devicepublic String getDeviceSerialNumber()
public void setTimeZoneDifference(int seconds)
seconds
- Seconds with respect to GMTpublic static String getActivityDescription(int activityType)
activityType
- The activity as integerpublic String getActivityDescription()
public int getActivityType()
public int getNumberOfSegments()
public ActivitySegment getSegment(int segmentNumber)
segmentNumber
- The index of the segment numberpublic hirondelle.date4j.DateTime getStartDateTime()
public hirondelle.date4j.DateTime getFirstActiveRecordTime()
public ArrayList<ActivityRecord> getRecords(int segmentId)
segmentId
- Index of the segmentpublic ArrayList<ActivityRecord> getWaypoints()
public int getFitnessPoints()
public String getRouteName()
public void parseRecord(byte[] recordData)
recordData
- Data representing the recordpublic void dumpRecordData(byte[] recordData)
recordData
- The record data.public void dumpActivityCsv()
public boolean hasHeightValues()
public boolean processGoogleHeightServiceResults(byte[] heights)
public boolean readHeigthsFromService()
public void smoothTrack(float trackSmoothingQFactor)
trackSmoothingQFactor
- The factor influencing the smoothing.
1.0 - high amount to 10.0 - lowpublic float getTrackSmoothingQFactor()
public void resetSmoothing()
public boolean isSmoothed()
public double getDistance()
Copyright © 2019. All rights reserved.