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 |
secondsToFix |
protected int |
summaryActivity |
protected int |
summaryCalories |
protected double |
summaryDistance |
protected int |
summaryDuration |
protected int |
summaryType |
protected int |
timeZoneSeconds |
protected String |
workout |
protected String |
workoutDescription |
protected String |
workoutSteps |
Constructor and Description |
---|
Activity(TtbinHeader header)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
compressTrack(double maxError) |
void |
dumpActivityCsv()
Dump the activity to csv file for analysis purposes
|
void |
dumpRecordData(byte[] recordData,
boolean asText,
int maxSize)
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.
|
int |
getCycles()
Returns the number of cycles; Running: steps, Cycling: cranc rotations
|
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.
|
int |
getPace()
Returns the number of cycles per minute; Running: steps/min, Cycling: cranc rpm
|
List<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
|
List<ActivityRecord> |
getWaypoints() |
String |
getWorkout()
Get the workout that was performed
|
String |
getWorkoutDescription()
Get the description of the workout that was performed
|
String |
getWorkoutSteps()
Get the list of workout steps
|
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 workout
protected String workoutDescription
protected String workoutSteps
protected String route
protected int secondsToFix
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 List<ActivityRecord> getRecords(int segmentId)
segmentId
- Index of the segmentpublic List<ActivityRecord> getWaypoints()
public int getFitnessPoints()
public String getWorkout()
public String getWorkoutDescription()
public String getWorkoutSteps()
public String getRouteName()
public void parseRecord(byte[] recordData)
recordData
- Data representing the recordpublic void dumpRecordData(byte[] recordData, boolean asText, int maxSize)
recordData
- The record data.asText
- False: print hex, True: print asciimaxSize
- Truncate after this number of characterspublic 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()
public int getCycles()
public int getPace()
public void compressTrack(double maxError)
Copyright © 2023. All rights reserved.