#region Copyright
////////////////////////////////////////////////////////////////////////////////
// The following FIT Protocol software provided may be used with FIT protocol
// devices only and remains the copyrighted property of Dynastream Innovations Inc.
// The software is being provided on an "as-is" basis and as an accommodation,
// and therefore all warranties, representations, or guarantees of any kind
// (whether express, implied or statutory) including, without limitation,
// warranties of merchantability, non-infringement, or fitness for a particular
// purpose, are specifically disclaimed.
//
// Copyright 2016 Dynastream Innovations Inc.
////////////////////////////////////////////////////////////////////////////////
// ****WARNING**** This file is auto-generated! Do NOT edit this file.
// Profile Version = 16.60Release
// Tag = production-akw-16.60.00-0-g5d3d436
////////////////////////////////////////////////////////////////////////////////
#endregion
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.IO;
namespace Dynastream.Fit
{
///
/// Implements the Length profile message.
///
public class LengthMesg : Mesg
{
#region Fields
#endregion
#region Constructors
public LengthMesg() : base(Profile.GetMesg(MesgNum.Length))
{
}
public LengthMesg(Mesg mesg) : base(mesg)
{
}
#endregion // Constructors
#region Methods
///
/// Retrieves the MessageIndex field
/// Returns nullable ushort representing the MessageIndex field
public ushort? GetMessageIndex()
{
return (ushort?)GetFieldValue(254, 0, Fit.SubfieldIndexMainField);
}
///
/// Set MessageIndex field
/// Nullable field value to be set
public void SetMessageIndex(ushort? messageIndex_)
{
SetFieldValue(254, 0, messageIndex_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the Timestamp field
/// Returns DateTime representing the Timestamp field
public DateTime GetTimestamp()
{
return TimestampToDateTime((uint?)GetFieldValue(253, 0, Fit.SubfieldIndexMainField));
}
///
/// Set Timestamp field
/// Nullable field value to be set
public void SetTimestamp(DateTime timestamp_)
{
SetFieldValue(253, 0, timestamp_.GetTimeStamp(), Fit.SubfieldIndexMainField);
}
///
/// Retrieves the Event field
/// Returns nullable Event enum representing the Event field
public Event? GetEvent()
{
object obj = GetFieldValue(0, 0, Fit.SubfieldIndexMainField);
Event? value = obj == null ? (Event?)null : (Event)obj;
return value;
}
///
/// Set Event field
/// Nullable field value to be set
public void SetEvent(Event? event_)
{
SetFieldValue(0, 0, event_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the EventType field
/// Returns nullable EventType enum representing the EventType field
public EventType? GetEventType()
{
object obj = GetFieldValue(1, 0, Fit.SubfieldIndexMainField);
EventType? value = obj == null ? (EventType?)null : (EventType)obj;
return value;
}
///
/// Set EventType field
/// Nullable field value to be set
public void SetEventType(EventType? eventType_)
{
SetFieldValue(1, 0, eventType_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the StartTime field
/// Returns DateTime representing the StartTime field
public DateTime GetStartTime()
{
return TimestampToDateTime((uint?)GetFieldValue(2, 0, Fit.SubfieldIndexMainField));
}
///
/// Set StartTime field
/// Nullable field value to be set
public void SetStartTime(DateTime startTime_)
{
SetFieldValue(2, 0, startTime_.GetTimeStamp(), Fit.SubfieldIndexMainField);
}
///
/// Retrieves the TotalElapsedTime field
/// Units: s
/// Returns nullable float representing the TotalElapsedTime field
public float? GetTotalElapsedTime()
{
return (float?)GetFieldValue(3, 0, Fit.SubfieldIndexMainField);
}
///
/// Set TotalElapsedTime field
/// Units: s
/// Nullable field value to be set
public void SetTotalElapsedTime(float? totalElapsedTime_)
{
SetFieldValue(3, 0, totalElapsedTime_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the TotalTimerTime field
/// Units: s
/// Returns nullable float representing the TotalTimerTime field
public float? GetTotalTimerTime()
{
return (float?)GetFieldValue(4, 0, Fit.SubfieldIndexMainField);
}
///
/// Set TotalTimerTime field
/// Units: s
/// Nullable field value to be set
public void SetTotalTimerTime(float? totalTimerTime_)
{
SetFieldValue(4, 0, totalTimerTime_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the TotalStrokes field
/// Units: strokes
/// Returns nullable ushort representing the TotalStrokes field
public ushort? GetTotalStrokes()
{
return (ushort?)GetFieldValue(5, 0, Fit.SubfieldIndexMainField);
}
///
/// Set TotalStrokes field
/// Units: strokes
/// Nullable field value to be set
public void SetTotalStrokes(ushort? totalStrokes_)
{
SetFieldValue(5, 0, totalStrokes_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the AvgSpeed field
/// Units: m/s
/// Returns nullable float representing the AvgSpeed field
public float? GetAvgSpeed()
{
return (float?)GetFieldValue(6, 0, Fit.SubfieldIndexMainField);
}
///
/// Set AvgSpeed field
/// Units: m/s
/// Nullable field value to be set
public void SetAvgSpeed(float? avgSpeed_)
{
SetFieldValue(6, 0, avgSpeed_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the SwimStroke field
/// Units: swim_stroke
/// Returns nullable SwimStroke enum representing the SwimStroke field
public SwimStroke? GetSwimStroke()
{
object obj = GetFieldValue(7, 0, Fit.SubfieldIndexMainField);
SwimStroke? value = obj == null ? (SwimStroke?)null : (SwimStroke)obj;
return value;
}
///
/// Set SwimStroke field
/// Units: swim_stroke
/// Nullable field value to be set
public void SetSwimStroke(SwimStroke? swimStroke_)
{
SetFieldValue(7, 0, swimStroke_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the AvgSwimmingCadence field
/// Units: strokes/min
/// Returns nullable byte representing the AvgSwimmingCadence field
public byte? GetAvgSwimmingCadence()
{
return (byte?)GetFieldValue(9, 0, Fit.SubfieldIndexMainField);
}
///
/// Set AvgSwimmingCadence field
/// Units: strokes/min
/// Nullable field value to be set
public void SetAvgSwimmingCadence(byte? avgSwimmingCadence_)
{
SetFieldValue(9, 0, avgSwimmingCadence_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the EventGroup field
/// Returns nullable byte representing the EventGroup field
public byte? GetEventGroup()
{
return (byte?)GetFieldValue(10, 0, Fit.SubfieldIndexMainField);
}
///
/// Set EventGroup field
/// Nullable field value to be set
public void SetEventGroup(byte? eventGroup_)
{
SetFieldValue(10, 0, eventGroup_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the TotalCalories field
/// Units: kcal
/// Returns nullable ushort representing the TotalCalories field
public ushort? GetTotalCalories()
{
return (ushort?)GetFieldValue(11, 0, Fit.SubfieldIndexMainField);
}
///
/// Set TotalCalories field
/// Units: kcal
/// Nullable field value to be set
public void SetTotalCalories(ushort? totalCalories_)
{
SetFieldValue(11, 0, totalCalories_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the LengthType field
/// Returns nullable LengthType enum representing the LengthType field
public LengthType? GetLengthType()
{
object obj = GetFieldValue(12, 0, Fit.SubfieldIndexMainField);
LengthType? value = obj == null ? (LengthType?)null : (LengthType)obj;
return value;
}
///
/// Set LengthType field
/// Nullable field value to be set
public void SetLengthType(LengthType? lengthType_)
{
SetFieldValue(12, 0, lengthType_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the PlayerScore field
/// Returns nullable ushort representing the PlayerScore field
public ushort? GetPlayerScore()
{
return (ushort?)GetFieldValue(18, 0, Fit.SubfieldIndexMainField);
}
///
/// Set PlayerScore field
/// Nullable field value to be set
public void SetPlayerScore(ushort? playerScore_)
{
SetFieldValue(18, 0, playerScore_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the OpponentScore field
/// Returns nullable ushort representing the OpponentScore field
public ushort? GetOpponentScore()
{
return (ushort?)GetFieldValue(19, 0, Fit.SubfieldIndexMainField);
}
///
/// Set OpponentScore field
/// Nullable field value to be set
public void SetOpponentScore(ushort? opponentScore_)
{
SetFieldValue(19, 0, opponentScore_, Fit.SubfieldIndexMainField);
}
///
///
///
/// returns number of elements in field StrokeCount
public int GetNumStrokeCount()
{
return GetNumFieldValues(20, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the StrokeCount field
/// Units: counts
/// Comment: stroke_type enum used as the index
/// 0 based index of StrokeCount element to retrieve
/// Returns nullable ushort representing the StrokeCount field
public ushort? GetStrokeCount(int index)
{
return (ushort?)GetFieldValue(20, index, Fit.SubfieldIndexMainField);
}
///
/// Set StrokeCount field
/// Units: counts
/// Comment: stroke_type enum used as the index
/// 0 based index of stroke_count
/// Nullable field value to be set
public void SetStrokeCount(int index, ushort? strokeCount_)
{
SetFieldValue(20, index, strokeCount_, Fit.SubfieldIndexMainField);
}
///
///
///
/// returns number of elements in field ZoneCount
public int GetNumZoneCount()
{
return GetNumFieldValues(21, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the ZoneCount field
/// Units: counts
/// Comment: zone number used as the index
/// 0 based index of ZoneCount element to retrieve
/// Returns nullable ushort representing the ZoneCount field
public ushort? GetZoneCount(int index)
{
return (ushort?)GetFieldValue(21, index, Fit.SubfieldIndexMainField);
}
///
/// Set ZoneCount field
/// Units: counts
/// Comment: zone number used as the index
/// 0 based index of zone_count
/// Nullable field value to be set
public void SetZoneCount(int index, ushort? zoneCount_)
{
SetFieldValue(21, index, zoneCount_, Fit.SubfieldIndexMainField);
}
#endregion // Methods
} // Class
} // namespace