All Downloads are FREE. Search and download functionalities are using the official Maven repository.

t.21.120.2.source-code.TimeInZoneMesg Maven / Gradle / Ivy

There is a newer version: 21.141.0
Show newest version
/////////////////////////////////////////////////////////////////////////////////////////////
// Copyright 2023 Garmin International, Inc.
// Licensed under the Flexible and Interoperable Data Transfer (FIT) Protocol License; you
// may not use this file except in compliance with the Flexible and Interoperable Data
// Transfer (FIT) Protocol License.
/////////////////////////////////////////////////////////////////////////////////////////////
// ****WARNING****  This file is auto-generated!  Do NOT edit this file.
// Profile Version = 21.120Release
// Tag = production/release/21.120.00-0-g2d77811
/////////////////////////////////////////////////////////////////////////////////////////////


package com.garmin.fit;



public class TimeInZoneMesg extends Mesg   {

    
    public static final int TimestampFieldNum = 253;
    
    public static final int ReferenceMesgFieldNum = 0;
    
    public static final int ReferenceIndexFieldNum = 1;
    
    public static final int TimeInHrZoneFieldNum = 2;
    
    public static final int TimeInSpeedZoneFieldNum = 3;
    
    public static final int TimeInCadenceZoneFieldNum = 4;
    
    public static final int TimeInPowerZoneFieldNum = 5;
    
    public static final int HrZoneHighBoundaryFieldNum = 6;
    
    public static final int SpeedZoneHighBoundaryFieldNum = 7;
    
    public static final int CadenceZoneHighBondaryFieldNum = 8;
    
    public static final int PowerZoneHighBoundaryFieldNum = 9;
    
    public static final int HrCalcTypeFieldNum = 10;
    
    public static final int MaxHeartRateFieldNum = 11;
    
    public static final int RestingHeartRateFieldNum = 12;
    
    public static final int ThresholdHeartRateFieldNum = 13;
    
    public static final int PwrCalcTypeFieldNum = 14;
    
    public static final int FunctionalThresholdPowerFieldNum = 15;
    

    protected static final  Mesg timeInZoneMesg;
    static {
        // time_in_zone
        timeInZoneMesg = new Mesg("time_in_zone", MesgNum.TIME_IN_ZONE);
        timeInZoneMesg.addField(new Field("timestamp", TimestampFieldNum, 134, 1, 0, "s", false, Profile.Type.DATE_TIME));
        
        timeInZoneMesg.addField(new Field("reference_mesg", ReferenceMesgFieldNum, 132, 1, 0, "", false, Profile.Type.MESG_NUM));
        
        timeInZoneMesg.addField(new Field("reference_index", ReferenceIndexFieldNum, 132, 1, 0, "", false, Profile.Type.MESSAGE_INDEX));
        
        timeInZoneMesg.addField(new Field("time_in_hr_zone", TimeInHrZoneFieldNum, 134, 1000, 0, "s", false, Profile.Type.UINT32));
        
        timeInZoneMesg.addField(new Field("time_in_speed_zone", TimeInSpeedZoneFieldNum, 134, 1000, 0, "s", false, Profile.Type.UINT32));
        
        timeInZoneMesg.addField(new Field("time_in_cadence_zone", TimeInCadenceZoneFieldNum, 134, 1000, 0, "s", false, Profile.Type.UINT32));
        
        timeInZoneMesg.addField(new Field("time_in_power_zone", TimeInPowerZoneFieldNum, 134, 1000, 0, "s", false, Profile.Type.UINT32));
        
        timeInZoneMesg.addField(new Field("hr_zone_high_boundary", HrZoneHighBoundaryFieldNum, 2, 1, 0, "bpm", false, Profile.Type.UINT8));
        
        timeInZoneMesg.addField(new Field("speed_zone_high_boundary", SpeedZoneHighBoundaryFieldNum, 132, 1000, 0, "m/s", false, Profile.Type.UINT16));
        
        timeInZoneMesg.addField(new Field("cadence_zone_high_bondary", CadenceZoneHighBondaryFieldNum, 2, 1, 0, "rpm", false, Profile.Type.UINT8));
        
        timeInZoneMesg.addField(new Field("power_zone_high_boundary", PowerZoneHighBoundaryFieldNum, 132, 1, 0, "watts", false, Profile.Type.UINT16));
        
        timeInZoneMesg.addField(new Field("hr_calc_type", HrCalcTypeFieldNum, 0, 1, 0, "", false, Profile.Type.HR_ZONE_CALC));
        
        timeInZoneMesg.addField(new Field("max_heart_rate", MaxHeartRateFieldNum, 2, 1, 0, "", false, Profile.Type.UINT8));
        
        timeInZoneMesg.addField(new Field("resting_heart_rate", RestingHeartRateFieldNum, 2, 1, 0, "", false, Profile.Type.UINT8));
        
        timeInZoneMesg.addField(new Field("threshold_heart_rate", ThresholdHeartRateFieldNum, 2, 1, 0, "", false, Profile.Type.UINT8));
        
        timeInZoneMesg.addField(new Field("pwr_calc_type", PwrCalcTypeFieldNum, 0, 1, 0, "", false, Profile.Type.PWR_ZONE_CALC));
        
        timeInZoneMesg.addField(new Field("functional_threshold_power", FunctionalThresholdPowerFieldNum, 132, 1, 0, "", false, Profile.Type.UINT16));
        
    }

    public TimeInZoneMesg() {
        super(Factory.createMesg(MesgNum.TIME_IN_ZONE));
    }

    public TimeInZoneMesg(final Mesg mesg) {
        super(mesg);
    }


    /**
     * Get timestamp field
     * Units: s
     *
     * @return timestamp
     */
    public DateTime getTimestamp() {
        return timestampToDateTime(getFieldLongValue(253, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD));
    }

    /**
     * Set timestamp field
     * Units: s
     *
     * @param timestamp The new timestamp value to be set
     */
    public void setTimestamp(DateTime timestamp) {
        setFieldValue(253, 0, timestamp.getTimestamp(), Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get reference_mesg field
     *
     * @return reference_mesg
     */
    public Integer getReferenceMesg() {
        return getFieldIntegerValue(0, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set reference_mesg field
     *
     * @param referenceMesg The new referenceMesg value to be set
     */
    public void setReferenceMesg(Integer referenceMesg) {
        setFieldValue(0, 0, referenceMesg, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get reference_index field
     *
     * @return reference_index
     */
    public Integer getReferenceIndex() {
        return getFieldIntegerValue(1, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set reference_index field
     *
     * @param referenceIndex The new referenceIndex value to be set
     */
    public void setReferenceIndex(Integer referenceIndex) {
        setFieldValue(1, 0, referenceIndex, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    public Float[] getTimeInHrZone() {
        
        return getFieldFloatValues(2, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        
    }

    /**
     * @return number of time_in_hr_zone
     */
    public int getNumTimeInHrZone() {
        return getNumFieldValues(2, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get time_in_hr_zone field
     * Units: s
     *
     * @param index of time_in_hr_zone
     * @return time_in_hr_zone
     */
    public Float getTimeInHrZone(int index) {
        return getFieldFloatValue(2, index, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set time_in_hr_zone field
     * Units: s
     *
     * @param index of time_in_hr_zone
     * @param timeInHrZone The new timeInHrZone value to be set
     */
    public void setTimeInHrZone(int index, Float timeInHrZone) {
        setFieldValue(2, index, timeInHrZone, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    public Float[] getTimeInSpeedZone() {
        
        return getFieldFloatValues(3, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        
    }

    /**
     * @return number of time_in_speed_zone
     */
    public int getNumTimeInSpeedZone() {
        return getNumFieldValues(3, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get time_in_speed_zone field
     * Units: s
     *
     * @param index of time_in_speed_zone
     * @return time_in_speed_zone
     */
    public Float getTimeInSpeedZone(int index) {
        return getFieldFloatValue(3, index, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set time_in_speed_zone field
     * Units: s
     *
     * @param index of time_in_speed_zone
     * @param timeInSpeedZone The new timeInSpeedZone value to be set
     */
    public void setTimeInSpeedZone(int index, Float timeInSpeedZone) {
        setFieldValue(3, index, timeInSpeedZone, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    public Float[] getTimeInCadenceZone() {
        
        return getFieldFloatValues(4, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        
    }

    /**
     * @return number of time_in_cadence_zone
     */
    public int getNumTimeInCadenceZone() {
        return getNumFieldValues(4, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get time_in_cadence_zone field
     * Units: s
     *
     * @param index of time_in_cadence_zone
     * @return time_in_cadence_zone
     */
    public Float getTimeInCadenceZone(int index) {
        return getFieldFloatValue(4, index, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set time_in_cadence_zone field
     * Units: s
     *
     * @param index of time_in_cadence_zone
     * @param timeInCadenceZone The new timeInCadenceZone value to be set
     */
    public void setTimeInCadenceZone(int index, Float timeInCadenceZone) {
        setFieldValue(4, index, timeInCadenceZone, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    public Float[] getTimeInPowerZone() {
        
        return getFieldFloatValues(5, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        
    }

    /**
     * @return number of time_in_power_zone
     */
    public int getNumTimeInPowerZone() {
        return getNumFieldValues(5, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get time_in_power_zone field
     * Units: s
     *
     * @param index of time_in_power_zone
     * @return time_in_power_zone
     */
    public Float getTimeInPowerZone(int index) {
        return getFieldFloatValue(5, index, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set time_in_power_zone field
     * Units: s
     *
     * @param index of time_in_power_zone
     * @param timeInPowerZone The new timeInPowerZone value to be set
     */
    public void setTimeInPowerZone(int index, Float timeInPowerZone) {
        setFieldValue(5, index, timeInPowerZone, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    public Short[] getHrZoneHighBoundary() {
        
        return getFieldShortValues(6, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        
    }

    /**
     * @return number of hr_zone_high_boundary
     */
    public int getNumHrZoneHighBoundary() {
        return getNumFieldValues(6, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get hr_zone_high_boundary field
     * Units: bpm
     *
     * @param index of hr_zone_high_boundary
     * @return hr_zone_high_boundary
     */
    public Short getHrZoneHighBoundary(int index) {
        return getFieldShortValue(6, index, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set hr_zone_high_boundary field
     * Units: bpm
     *
     * @param index of hr_zone_high_boundary
     * @param hrZoneHighBoundary The new hrZoneHighBoundary value to be set
     */
    public void setHrZoneHighBoundary(int index, Short hrZoneHighBoundary) {
        setFieldValue(6, index, hrZoneHighBoundary, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    public Float[] getSpeedZoneHighBoundary() {
        
        return getFieldFloatValues(7, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        
    }

    /**
     * @return number of speed_zone_high_boundary
     */
    public int getNumSpeedZoneHighBoundary() {
        return getNumFieldValues(7, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get speed_zone_high_boundary field
     * Units: m/s
     *
     * @param index of speed_zone_high_boundary
     * @return speed_zone_high_boundary
     */
    public Float getSpeedZoneHighBoundary(int index) {
        return getFieldFloatValue(7, index, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set speed_zone_high_boundary field
     * Units: m/s
     *
     * @param index of speed_zone_high_boundary
     * @param speedZoneHighBoundary The new speedZoneHighBoundary value to be set
     */
    public void setSpeedZoneHighBoundary(int index, Float speedZoneHighBoundary) {
        setFieldValue(7, index, speedZoneHighBoundary, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    public Short[] getCadenceZoneHighBondary() {
        
        return getFieldShortValues(8, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        
    }

    /**
     * @return number of cadence_zone_high_bondary
     */
    public int getNumCadenceZoneHighBondary() {
        return getNumFieldValues(8, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get cadence_zone_high_bondary field
     * Units: rpm
     *
     * @param index of cadence_zone_high_bondary
     * @return cadence_zone_high_bondary
     */
    public Short getCadenceZoneHighBondary(int index) {
        return getFieldShortValue(8, index, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set cadence_zone_high_bondary field
     * Units: rpm
     *
     * @param index of cadence_zone_high_bondary
     * @param cadenceZoneHighBondary The new cadenceZoneHighBondary value to be set
     */
    public void setCadenceZoneHighBondary(int index, Short cadenceZoneHighBondary) {
        setFieldValue(8, index, cadenceZoneHighBondary, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    public Integer[] getPowerZoneHighBoundary() {
        
        return getFieldIntegerValues(9, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        
    }

    /**
     * @return number of power_zone_high_boundary
     */
    public int getNumPowerZoneHighBoundary() {
        return getNumFieldValues(9, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get power_zone_high_boundary field
     * Units: watts
     *
     * @param index of power_zone_high_boundary
     * @return power_zone_high_boundary
     */
    public Integer getPowerZoneHighBoundary(int index) {
        return getFieldIntegerValue(9, index, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set power_zone_high_boundary field
     * Units: watts
     *
     * @param index of power_zone_high_boundary
     * @param powerZoneHighBoundary The new powerZoneHighBoundary value to be set
     */
    public void setPowerZoneHighBoundary(int index, Integer powerZoneHighBoundary) {
        setFieldValue(9, index, powerZoneHighBoundary, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get hr_calc_type field
     *
     * @return hr_calc_type
     */
    public HrZoneCalc getHrCalcType() {
        Short value = getFieldShortValue(10, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        if (value == null) {
            return null;
        }
        return HrZoneCalc.getByValue(value);
    }

    /**
     * Set hr_calc_type field
     *
     * @param hrCalcType The new hrCalcType value to be set
     */
    public void setHrCalcType(HrZoneCalc hrCalcType) {
        setFieldValue(10, 0, hrCalcType.value, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get max_heart_rate field
     *
     * @return max_heart_rate
     */
    public Short getMaxHeartRate() {
        return getFieldShortValue(11, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set max_heart_rate field
     *
     * @param maxHeartRate The new maxHeartRate value to be set
     */
    public void setMaxHeartRate(Short maxHeartRate) {
        setFieldValue(11, 0, maxHeartRate, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get resting_heart_rate field
     *
     * @return resting_heart_rate
     */
    public Short getRestingHeartRate() {
        return getFieldShortValue(12, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set resting_heart_rate field
     *
     * @param restingHeartRate The new restingHeartRate value to be set
     */
    public void setRestingHeartRate(Short restingHeartRate) {
        setFieldValue(12, 0, restingHeartRate, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get threshold_heart_rate field
     *
     * @return threshold_heart_rate
     */
    public Short getThresholdHeartRate() {
        return getFieldShortValue(13, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set threshold_heart_rate field
     *
     * @param thresholdHeartRate The new thresholdHeartRate value to be set
     */
    public void setThresholdHeartRate(Short thresholdHeartRate) {
        setFieldValue(13, 0, thresholdHeartRate, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get pwr_calc_type field
     *
     * @return pwr_calc_type
     */
    public PwrZoneCalc getPwrCalcType() {
        Short value = getFieldShortValue(14, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        if (value == null) {
            return null;
        }
        return PwrZoneCalc.getByValue(value);
    }

    /**
     * Set pwr_calc_type field
     *
     * @param pwrCalcType The new pwrCalcType value to be set
     */
    public void setPwrCalcType(PwrZoneCalc pwrCalcType) {
        setFieldValue(14, 0, pwrCalcType.value, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get functional_threshold_power field
     *
     * @return functional_threshold_power
     */
    public Integer getFunctionalThresholdPower() {
        return getFieldIntegerValue(15, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set functional_threshold_power field
     *
     * @param functionalThresholdPower The new functionalThresholdPower value to be set
     */
    public void setFunctionalThresholdPower(Integer functionalThresholdPower) {
        setFieldValue(15, 0, functionalThresholdPower, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy