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

t.21.120.2.source-code.LengthMesg 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 LengthMesg extends Mesg implements MesgWithEvent   {

    
    public static final int MessageIndexFieldNum = 254;
    
    public static final int TimestampFieldNum = 253;
    
    public static final int EventFieldNum = 0;
    
    public static final int EventTypeFieldNum = 1;
    
    public static final int StartTimeFieldNum = 2;
    
    public static final int TotalElapsedTimeFieldNum = 3;
    
    public static final int TotalTimerTimeFieldNum = 4;
    
    public static final int TotalStrokesFieldNum = 5;
    
    public static final int AvgSpeedFieldNum = 6;
    
    public static final int SwimStrokeFieldNum = 7;
    
    public static final int AvgSwimmingCadenceFieldNum = 9;
    
    public static final int EventGroupFieldNum = 10;
    
    public static final int TotalCaloriesFieldNum = 11;
    
    public static final int LengthTypeFieldNum = 12;
    
    public static final int PlayerScoreFieldNum = 18;
    
    public static final int OpponentScoreFieldNum = 19;
    
    public static final int StrokeCountFieldNum = 20;
    
    public static final int ZoneCountFieldNum = 21;
    
    public static final int EnhancedAvgRespirationRateFieldNum = 22;
    
    public static final int EnhancedMaxRespirationRateFieldNum = 23;
    
    public static final int AvgRespirationRateFieldNum = 24;
    
    public static final int MaxRespirationRateFieldNum = 25;
    

    protected static final  Mesg lengthMesg;
    static {int field_index = 0;
        // length
        lengthMesg = new Mesg("length", MesgNum.LENGTH);
        lengthMesg.addField(new Field("message_index", MessageIndexFieldNum, 132, 1, 0, "", false, Profile.Type.MESSAGE_INDEX));
        field_index++;
        lengthMesg.addField(new Field("timestamp", TimestampFieldNum, 134, 1, 0, "", false, Profile.Type.DATE_TIME));
        field_index++;
        lengthMesg.addField(new Field("event", EventFieldNum, 0, 1, 0, "", false, Profile.Type.EVENT));
        field_index++;
        lengthMesg.addField(new Field("event_type", EventTypeFieldNum, 0, 1, 0, "", false, Profile.Type.EVENT_TYPE));
        field_index++;
        lengthMesg.addField(new Field("start_time", StartTimeFieldNum, 134, 1, 0, "", false, Profile.Type.DATE_TIME));
        field_index++;
        lengthMesg.addField(new Field("total_elapsed_time", TotalElapsedTimeFieldNum, 134, 1000, 0, "s", false, Profile.Type.UINT32));
        field_index++;
        lengthMesg.addField(new Field("total_timer_time", TotalTimerTimeFieldNum, 134, 1000, 0, "s", false, Profile.Type.UINT32));
        field_index++;
        lengthMesg.addField(new Field("total_strokes", TotalStrokesFieldNum, 132, 1, 0, "strokes", false, Profile.Type.UINT16));
        field_index++;
        lengthMesg.addField(new Field("avg_speed", AvgSpeedFieldNum, 132, 1000, 0, "m/s", false, Profile.Type.UINT16));
        field_index++;
        lengthMesg.addField(new Field("swim_stroke", SwimStrokeFieldNum, 0, 1, 0, "swim_stroke", false, Profile.Type.SWIM_STROKE));
        field_index++;
        lengthMesg.addField(new Field("avg_swimming_cadence", AvgSwimmingCadenceFieldNum, 2, 1, 0, "strokes/min", false, Profile.Type.UINT8));
        field_index++;
        lengthMesg.addField(new Field("event_group", EventGroupFieldNum, 2, 1, 0, "", false, Profile.Type.UINT8));
        field_index++;
        lengthMesg.addField(new Field("total_calories", TotalCaloriesFieldNum, 132, 1, 0, "kcal", false, Profile.Type.UINT16));
        field_index++;
        lengthMesg.addField(new Field("length_type", LengthTypeFieldNum, 0, 1, 0, "", false, Profile.Type.LENGTH_TYPE));
        field_index++;
        lengthMesg.addField(new Field("player_score", PlayerScoreFieldNum, 132, 1, 0, "", false, Profile.Type.UINT16));
        field_index++;
        lengthMesg.addField(new Field("opponent_score", OpponentScoreFieldNum, 132, 1, 0, "", false, Profile.Type.UINT16));
        field_index++;
        lengthMesg.addField(new Field("stroke_count", StrokeCountFieldNum, 132, 1, 0, "counts", false, Profile.Type.UINT16));
        field_index++;
        lengthMesg.addField(new Field("zone_count", ZoneCountFieldNum, 132, 1, 0, "counts", false, Profile.Type.UINT16));
        field_index++;
        lengthMesg.addField(new Field("enhanced_avg_respiration_rate", EnhancedAvgRespirationRateFieldNum, 132, 100, 0, "Breaths/min", false, Profile.Type.UINT16));
        field_index++;
        lengthMesg.addField(new Field("enhanced_max_respiration_rate", EnhancedMaxRespirationRateFieldNum, 132, 100, 0, "Breaths/min", false, Profile.Type.UINT16));
        field_index++;
        lengthMesg.addField(new Field("avg_respiration_rate", AvgRespirationRateFieldNum, 2, 1, 0, "", false, Profile.Type.UINT8));
        lengthMesg.fields.get(field_index).components.add(new FieldComponent(22, false, 8, 1, 0)); // enhanced_avg_respiration_rate
        field_index++;
        lengthMesg.addField(new Field("max_respiration_rate", MaxRespirationRateFieldNum, 2, 1, 0, "", false, Profile.Type.UINT8));
        lengthMesg.fields.get(field_index).components.add(new FieldComponent(23, false, 8, 1, 0)); // enhanced_max_respiration_rate
        field_index++;
    }

    public LengthMesg() {
        super(Factory.createMesg(MesgNum.LENGTH));
    }

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


    /**
     * Get message_index field
     *
     * @return message_index
     */
    public Integer getMessageIndex() {
        return getFieldIntegerValue(254, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set message_index field
     *
     * @param messageIndex The new messageIndex value to be set
     */
    public void setMessageIndex(Integer messageIndex) {
        setFieldValue(254, 0, messageIndex, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

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

    /**
     * Set timestamp field
     *
     * @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 event field
     *
     * @return event
     */
    public Event getEvent() {
        Short value = getFieldShortValue(0, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        if (value == null) {
            return null;
        }
        return Event.getByValue(value);
    }

    /**
     * Set event field
     *
     * @param event The new event value to be set
     */
    public void setEvent(Event event) {
        setFieldValue(0, 0, event.value, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get event_type field
     *
     * @return event_type
     */
    public EventType getEventType() {
        Short value = getFieldShortValue(1, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        if (value == null) {
            return null;
        }
        return EventType.getByValue(value);
    }

    /**
     * Set event_type field
     *
     * @param eventType The new eventType value to be set
     */
    public void setEventType(EventType eventType) {
        setFieldValue(1, 0, eventType.value, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get start_time field
     *
     * @return start_time
     */
    public DateTime getStartTime() {
        return timestampToDateTime(getFieldLongValue(2, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD));
    }

    /**
     * Set start_time field
     *
     * @param startTime The new startTime value to be set
     */
    public void setStartTime(DateTime startTime) {
        setFieldValue(2, 0, startTime.getTimestamp(), Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get total_elapsed_time field
     * Units: s
     *
     * @return total_elapsed_time
     */
    public Float getTotalElapsedTime() {
        return getFieldFloatValue(3, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set total_elapsed_time field
     * Units: s
     *
     * @param totalElapsedTime The new totalElapsedTime value to be set
     */
    public void setTotalElapsedTime(Float totalElapsedTime) {
        setFieldValue(3, 0, totalElapsedTime, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get total_timer_time field
     * Units: s
     *
     * @return total_timer_time
     */
    public Float getTotalTimerTime() {
        return getFieldFloatValue(4, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set total_timer_time field
     * Units: s
     *
     * @param totalTimerTime The new totalTimerTime value to be set
     */
    public void setTotalTimerTime(Float totalTimerTime) {
        setFieldValue(4, 0, totalTimerTime, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get total_strokes field
     * Units: strokes
     *
     * @return total_strokes
     */
    public Integer getTotalStrokes() {
        return getFieldIntegerValue(5, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set total_strokes field
     * Units: strokes
     *
     * @param totalStrokes The new totalStrokes value to be set
     */
    public void setTotalStrokes(Integer totalStrokes) {
        setFieldValue(5, 0, totalStrokes, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get avg_speed field
     * Units: m/s
     *
     * @return avg_speed
     */
    public Float getAvgSpeed() {
        return getFieldFloatValue(6, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set avg_speed field
     * Units: m/s
     *
     * @param avgSpeed The new avgSpeed value to be set
     */
    public void setAvgSpeed(Float avgSpeed) {
        setFieldValue(6, 0, avgSpeed, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get swim_stroke field
     * Units: swim_stroke
     *
     * @return swim_stroke
     */
    public SwimStroke getSwimStroke() {
        Short value = getFieldShortValue(7, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        if (value == null) {
            return null;
        }
        return SwimStroke.getByValue(value);
    }

    /**
     * Set swim_stroke field
     * Units: swim_stroke
     *
     * @param swimStroke The new swimStroke value to be set
     */
    public void setSwimStroke(SwimStroke swimStroke) {
        setFieldValue(7, 0, swimStroke.value, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get avg_swimming_cadence field
     * Units: strokes/min
     *
     * @return avg_swimming_cadence
     */
    public Short getAvgSwimmingCadence() {
        return getFieldShortValue(9, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set avg_swimming_cadence field
     * Units: strokes/min
     *
     * @param avgSwimmingCadence The new avgSwimmingCadence value to be set
     */
    public void setAvgSwimmingCadence(Short avgSwimmingCadence) {
        setFieldValue(9, 0, avgSwimmingCadence, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get event_group field
     *
     * @return event_group
     */
    public Short getEventGroup() {
        return getFieldShortValue(10, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set event_group field
     *
     * @param eventGroup The new eventGroup value to be set
     */
    public void setEventGroup(Short eventGroup) {
        setFieldValue(10, 0, eventGroup, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get total_calories field
     * Units: kcal
     *
     * @return total_calories
     */
    public Integer getTotalCalories() {
        return getFieldIntegerValue(11, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set total_calories field
     * Units: kcal
     *
     * @param totalCalories The new totalCalories value to be set
     */
    public void setTotalCalories(Integer totalCalories) {
        setFieldValue(11, 0, totalCalories, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get length_type field
     *
     * @return length_type
     */
    public LengthType getLengthType() {
        Short value = getFieldShortValue(12, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        if (value == null) {
            return null;
        }
        return LengthType.getByValue(value);
    }

    /**
     * Set length_type field
     *
     * @param lengthType The new lengthType value to be set
     */
    public void setLengthType(LengthType lengthType) {
        setFieldValue(12, 0, lengthType.value, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get player_score field
     *
     * @return player_score
     */
    public Integer getPlayerScore() {
        return getFieldIntegerValue(18, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set player_score field
     *
     * @param playerScore The new playerScore value to be set
     */
    public void setPlayerScore(Integer playerScore) {
        setFieldValue(18, 0, playerScore, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get opponent_score field
     *
     * @return opponent_score
     */
    public Integer getOpponentScore() {
        return getFieldIntegerValue(19, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set opponent_score field
     *
     * @param opponentScore The new opponentScore value to be set
     */
    public void setOpponentScore(Integer opponentScore) {
        setFieldValue(19, 0, opponentScore, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    public Integer[] getStrokeCount() {
        
        return getFieldIntegerValues(20, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        
    }

    /**
     * @return number of stroke_count
     */
    public int getNumStrokeCount() {
        return getNumFieldValues(20, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get stroke_count field
     * Units: counts
     * Comment: stroke_type enum used as the index
     *
     * @param index of stroke_count
     * @return stroke_count
     */
    public Integer getStrokeCount(int index) {
        return getFieldIntegerValue(20, index, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set stroke_count field
     * Units: counts
     * Comment: stroke_type enum used as the index
     *
     * @param index of stroke_count
     * @param strokeCount The new strokeCount value to be set
     */
    public void setStrokeCount(int index, Integer strokeCount) {
        setFieldValue(20, index, strokeCount, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    public Integer[] getZoneCount() {
        
        return getFieldIntegerValues(21, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        
    }

    /**
     * @return number of zone_count
     */
    public int getNumZoneCount() {
        return getNumFieldValues(21, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get zone_count field
     * Units: counts
     * Comment: zone number used as the index
     *
     * @param index of zone_count
     * @return zone_count
     */
    public Integer getZoneCount(int index) {
        return getFieldIntegerValue(21, index, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set zone_count field
     * Units: counts
     * Comment: zone number used as the index
     *
     * @param index of zone_count
     * @param zoneCount The new zoneCount value to be set
     */
    public void setZoneCount(int index, Integer zoneCount) {
        setFieldValue(21, index, zoneCount, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get enhanced_avg_respiration_rate field
     * Units: Breaths/min
     *
     * @return enhanced_avg_respiration_rate
     */
    public Float getEnhancedAvgRespirationRate() {
        return getFieldFloatValue(22, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set enhanced_avg_respiration_rate field
     * Units: Breaths/min
     *
     * @param enhancedAvgRespirationRate The new enhancedAvgRespirationRate value to be set
     */
    public void setEnhancedAvgRespirationRate(Float enhancedAvgRespirationRate) {
        setFieldValue(22, 0, enhancedAvgRespirationRate, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get enhanced_max_respiration_rate field
     * Units: Breaths/min
     *
     * @return enhanced_max_respiration_rate
     */
    public Float getEnhancedMaxRespirationRate() {
        return getFieldFloatValue(23, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set enhanced_max_respiration_rate field
     * Units: Breaths/min
     *
     * @param enhancedMaxRespirationRate The new enhancedMaxRespirationRate value to be set
     */
    public void setEnhancedMaxRespirationRate(Float enhancedMaxRespirationRate) {
        setFieldValue(23, 0, enhancedMaxRespirationRate, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get avg_respiration_rate field
     *
     * @return avg_respiration_rate
     */
    public Short getAvgRespirationRate() {
        return getFieldShortValue(24, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set avg_respiration_rate field
     *
     * @param avgRespirationRate The new avgRespirationRate value to be set
     */
    public void setAvgRespirationRate(Short avgRespirationRate) {
        setFieldValue(24, 0, avgRespirationRate, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get max_respiration_rate field
     *
     * @return max_respiration_rate
     */
    public Short getMaxRespirationRate() {
        return getFieldShortValue(25, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set max_respiration_rate field
     *
     * @param maxRespirationRate The new maxRespirationRate value to be set
     */
    public void setMaxRespirationRate(Short maxRespirationRate) {
        setFieldValue(25, 0, maxRespirationRate, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy