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

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

    
    public static final int SplitTypeFieldNum = 0;
    
    public static final int TotalElapsedTimeFieldNum = 1;
    
    public static final int TotalTimerTimeFieldNum = 2;
    
    public static final int TotalDistanceFieldNum = 3;
    
    public static final int StartTimeFieldNum = 9;
    
    public static final int TotalMovingTimeFieldNum = 110;
    

    protected static final  Mesg splitMesg;
    static {
        // split
        splitMesg = new Mesg("split", MesgNum.SPLIT);
        splitMesg.addField(new Field("split_type", SplitTypeFieldNum, 0, 1, 0, "", false, Profile.Type.SPLIT_TYPE));
        
        splitMesg.addField(new Field("total_elapsed_time", TotalElapsedTimeFieldNum, 134, 1000, 0, "s", false, Profile.Type.UINT32));
        
        splitMesg.addField(new Field("total_timer_time", TotalTimerTimeFieldNum, 134, 1000, 0, "s", false, Profile.Type.UINT32));
        
        splitMesg.addField(new Field("total_distance", TotalDistanceFieldNum, 134, 100, 0, "m", false, Profile.Type.UINT32));
        
        splitMesg.addField(new Field("start_time", StartTimeFieldNum, 134, 1, 0, "", false, Profile.Type.DATE_TIME));
        
        splitMesg.addField(new Field("total_moving_time", TotalMovingTimeFieldNum, 134, 1000, 0, "s", false, Profile.Type.UINT32));
        
    }

    public SplitMesg() {
        super(Factory.createMesg(MesgNum.SPLIT));
    }

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


    /**
     * Get split_type field
     *
     * @return split_type
     */
    public SplitType getSplitType() {
        Short value = getFieldShortValue(0, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
        if (value == null) {
            return null;
        }
        return SplitType.getByValue(value);
    }

    /**
     * Set split_type field
     *
     * @param splitType The new splitType value to be set
     */
    public void setSplitType(SplitType splitType) {
        setFieldValue(0, 0, splitType.value, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get total_elapsed_time field
     * Units: s
     *
     * @return total_elapsed_time
     */
    public Float getTotalElapsedTime() {
        return getFieldFloatValue(1, 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(1, 0, totalElapsedTime, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get total_timer_time field
     * Units: s
     *
     * @return total_timer_time
     */
    public Float getTotalTimerTime() {
        return getFieldFloatValue(2, 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(2, 0, totalTimerTime, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get total_distance field
     * Units: m
     *
     * @return total_distance
     */
    public Float getTotalDistance() {
        return getFieldFloatValue(3, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set total_distance field
     * Units: m
     *
     * @param totalDistance The new totalDistance value to be set
     */
    public void setTotalDistance(Float totalDistance) {
        setFieldValue(3, 0, totalDistance, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get start_time field
     *
     * @return start_time
     */
    public DateTime getStartTime() {
        return timestampToDateTime(getFieldLongValue(9, 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(9, 0, startTime.getTimestamp(), Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Get total_moving_time field
     * Units: s
     *
     * @return total_moving_time
     */
    public Float getTotalMovingTime() {
        return getFieldFloatValue(110, 0, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

    /**
     * Set total_moving_time field
     * Units: s
     *
     * @param totalMovingTime The new totalMovingTime value to be set
     */
    public void setTotalMovingTime(Float totalMovingTime) {
        setFieldValue(110, 0, totalMovingTime, Fit.SUBFIELD_INDEX_MAIN_FIELD);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy