#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 Event profile message.
///
public class EventMesg : Mesg
{
#region Fields
static class DataSubfield
{
public static ushort TimerTrigger = 0;
public static ushort CoursePointIndex = 1;
public static ushort BatteryLevel = 2;
public static ushort VirtualPartnerSpeed = 3;
public static ushort HrHighAlert = 4;
public static ushort HrLowAlert = 5;
public static ushort SpeedHighAlert = 6;
public static ushort SpeedLowAlert = 7;
public static ushort CadHighAlert = 8;
public static ushort CadLowAlert = 9;
public static ushort PowerHighAlert = 10;
public static ushort PowerLowAlert = 11;
public static ushort TimeDurationAlert = 12;
public static ushort DistanceDurationAlert = 13;
public static ushort CalorieDurationAlert = 14;
public static ushort FitnessEquipmentState = 15;
public static ushort SportPoint = 16;
public static ushort GearChangeData = 17;
public static ushort RiderPosition = 18;
public static ushort CommTimeout = 19;
public static ushort Subfields = 20;
public static ushort Active = Fit.SubfieldIndexActiveSubfield;
public static ushort MainField = Fit.SubfieldIndexMainField;
}
#endregion
#region Constructors
public EventMesg() : base(Profile.GetMesg(MesgNum.Event))
{
}
public EventMesg(Mesg mesg) : base(mesg)
{
}
#endregion // Constructors
#region Methods
///
/// Retrieves the Timestamp field
/// Units: s
/// Returns DateTime representing the Timestamp field
public DateTime GetTimestamp()
{
return TimestampToDateTime((uint?)GetFieldValue(253, 0, Fit.SubfieldIndexMainField));
}
///
/// Set Timestamp field
/// Units: s
/// 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 Data16 field
/// Returns nullable ushort representing the Data16 field
public ushort? GetData16()
{
return (ushort?)GetFieldValue(2, 0, Fit.SubfieldIndexMainField);
}
///
/// Set Data16 field
/// Nullable field value to be set
public void SetData16(ushort? data16_)
{
SetFieldValue(2, 0, data16_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the Data field
/// Returns nullable uint representing the Data field
public uint? GetData()
{
return (uint?)GetFieldValue(3, 0, Fit.SubfieldIndexMainField);
}
///
/// Set Data field
/// Nullable field value to be set
public void SetData(uint? data_)
{
SetFieldValue(3, 0, data_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the TimerTrigger subfield
/// Nullable TimerTrigger enum representing the TimerTrigger subfield
public TimerTrigger? GetTimerTrigger()
{
return (TimerTrigger?)GetFieldValue(3, 0, DataSubfield.TimerTrigger);
}
///
///
/// Set TimerTrigger subfield
/// Subfield value to be set
public void SetTimerTrigger(byte? timerTrigger)
{
SetFieldValue(3, 0, timerTrigger, DataSubfield.TimerTrigger);
}
///
/// Retrieves the CoursePointIndex subfield
/// Nullable ushort representing the CoursePointIndex subfield
public ushort? GetCoursePointIndex()
{
return (ushort?)GetFieldValue(3, 0, DataSubfield.CoursePointIndex);
}
///
///
/// Set CoursePointIndex subfield
/// Subfield value to be set
public void SetCoursePointIndex(ushort? coursePointIndex)
{
SetFieldValue(3, 0, coursePointIndex, DataSubfield.CoursePointIndex);
}
///
/// Retrieves the BatteryLevel subfield
/// Units: V
/// Nullable float representing the BatteryLevel subfield
public float? GetBatteryLevel()
{
return (float?)GetFieldValue(3, 0, DataSubfield.BatteryLevel);
}
///
///
/// Set BatteryLevel subfield
/// Units: V
/// Subfield value to be set
public void SetBatteryLevel(float? batteryLevel)
{
SetFieldValue(3, 0, batteryLevel, DataSubfield.BatteryLevel);
}
///
/// Retrieves the VirtualPartnerSpeed subfield
/// Units: m/s
/// Nullable float representing the VirtualPartnerSpeed subfield
public float? GetVirtualPartnerSpeed()
{
return (float?)GetFieldValue(3, 0, DataSubfield.VirtualPartnerSpeed);
}
///
///
/// Set VirtualPartnerSpeed subfield
/// Units: m/s
/// Subfield value to be set
public void SetVirtualPartnerSpeed(float? virtualPartnerSpeed)
{
SetFieldValue(3, 0, virtualPartnerSpeed, DataSubfield.VirtualPartnerSpeed);
}
///
/// Retrieves the HrHighAlert subfield
/// Units: bpm
/// Nullable byte representing the HrHighAlert subfield
public byte? GetHrHighAlert()
{
return (byte?)GetFieldValue(3, 0, DataSubfield.HrHighAlert);
}
///
///
/// Set HrHighAlert subfield
/// Units: bpm
/// Subfield value to be set
public void SetHrHighAlert(byte? hrHighAlert)
{
SetFieldValue(3, 0, hrHighAlert, DataSubfield.HrHighAlert);
}
///
/// Retrieves the HrLowAlert subfield
/// Units: bpm
/// Nullable byte representing the HrLowAlert subfield
public byte? GetHrLowAlert()
{
return (byte?)GetFieldValue(3, 0, DataSubfield.HrLowAlert);
}
///
///
/// Set HrLowAlert subfield
/// Units: bpm
/// Subfield value to be set
public void SetHrLowAlert(byte? hrLowAlert)
{
SetFieldValue(3, 0, hrLowAlert, DataSubfield.HrLowAlert);
}
///
/// Retrieves the SpeedHighAlert subfield
/// Units: m/s
/// Nullable float representing the SpeedHighAlert subfield
public float? GetSpeedHighAlert()
{
return (float?)GetFieldValue(3, 0, DataSubfield.SpeedHighAlert);
}
///
///
/// Set SpeedHighAlert subfield
/// Units: m/s
/// Subfield value to be set
public void SetSpeedHighAlert(float? speedHighAlert)
{
SetFieldValue(3, 0, speedHighAlert, DataSubfield.SpeedHighAlert);
}
///
/// Retrieves the SpeedLowAlert subfield
/// Units: m/s
/// Nullable float representing the SpeedLowAlert subfield
public float? GetSpeedLowAlert()
{
return (float?)GetFieldValue(3, 0, DataSubfield.SpeedLowAlert);
}
///
///
/// Set SpeedLowAlert subfield
/// Units: m/s
/// Subfield value to be set
public void SetSpeedLowAlert(float? speedLowAlert)
{
SetFieldValue(3, 0, speedLowAlert, DataSubfield.SpeedLowAlert);
}
///
/// Retrieves the CadHighAlert subfield
/// Units: rpm
/// Nullable ushort representing the CadHighAlert subfield
public ushort? GetCadHighAlert()
{
return (ushort?)GetFieldValue(3, 0, DataSubfield.CadHighAlert);
}
///
///
/// Set CadHighAlert subfield
/// Units: rpm
/// Subfield value to be set
public void SetCadHighAlert(ushort? cadHighAlert)
{
SetFieldValue(3, 0, cadHighAlert, DataSubfield.CadHighAlert);
}
///
/// Retrieves the CadLowAlert subfield
/// Units: rpm
/// Nullable ushort representing the CadLowAlert subfield
public ushort? GetCadLowAlert()
{
return (ushort?)GetFieldValue(3, 0, DataSubfield.CadLowAlert);
}
///
///
/// Set CadLowAlert subfield
/// Units: rpm
/// Subfield value to be set
public void SetCadLowAlert(ushort? cadLowAlert)
{
SetFieldValue(3, 0, cadLowAlert, DataSubfield.CadLowAlert);
}
///
/// Retrieves the PowerHighAlert subfield
/// Units: watts
/// Nullable ushort representing the PowerHighAlert subfield
public ushort? GetPowerHighAlert()
{
return (ushort?)GetFieldValue(3, 0, DataSubfield.PowerHighAlert);
}
///
///
/// Set PowerHighAlert subfield
/// Units: watts
/// Subfield value to be set
public void SetPowerHighAlert(ushort? powerHighAlert)
{
SetFieldValue(3, 0, powerHighAlert, DataSubfield.PowerHighAlert);
}
///
/// Retrieves the PowerLowAlert subfield
/// Units: watts
/// Nullable ushort representing the PowerLowAlert subfield
public ushort? GetPowerLowAlert()
{
return (ushort?)GetFieldValue(3, 0, DataSubfield.PowerLowAlert);
}
///
///
/// Set PowerLowAlert subfield
/// Units: watts
/// Subfield value to be set
public void SetPowerLowAlert(ushort? powerLowAlert)
{
SetFieldValue(3, 0, powerLowAlert, DataSubfield.PowerLowAlert);
}
///
/// Retrieves the TimeDurationAlert subfield
/// Units: s
/// Nullable float representing the TimeDurationAlert subfield
public float? GetTimeDurationAlert()
{
return (float?)GetFieldValue(3, 0, DataSubfield.TimeDurationAlert);
}
///
///
/// Set TimeDurationAlert subfield
/// Units: s
/// Subfield value to be set
public void SetTimeDurationAlert(float? timeDurationAlert)
{
SetFieldValue(3, 0, timeDurationAlert, DataSubfield.TimeDurationAlert);
}
///
/// Retrieves the DistanceDurationAlert subfield
/// Units: m
/// Nullable float representing the DistanceDurationAlert subfield
public float? GetDistanceDurationAlert()
{
return (float?)GetFieldValue(3, 0, DataSubfield.DistanceDurationAlert);
}
///
///
/// Set DistanceDurationAlert subfield
/// Units: m
/// Subfield value to be set
public void SetDistanceDurationAlert(float? distanceDurationAlert)
{
SetFieldValue(3, 0, distanceDurationAlert, DataSubfield.DistanceDurationAlert);
}
///
/// Retrieves the CalorieDurationAlert subfield
/// Units: calories
/// Nullable uint representing the CalorieDurationAlert subfield
public uint? GetCalorieDurationAlert()
{
return (uint?)GetFieldValue(3, 0, DataSubfield.CalorieDurationAlert);
}
///
///
/// Set CalorieDurationAlert subfield
/// Units: calories
/// Subfield value to be set
public void SetCalorieDurationAlert(uint? calorieDurationAlert)
{
SetFieldValue(3, 0, calorieDurationAlert, DataSubfield.CalorieDurationAlert);
}
///
/// Retrieves the FitnessEquipmentState subfield
/// Nullable FitnessEquipmentState enum representing the FitnessEquipmentState subfield
public FitnessEquipmentState? GetFitnessEquipmentState()
{
return (FitnessEquipmentState?)GetFieldValue(3, 0, DataSubfield.FitnessEquipmentState);
}
///
///
/// Set FitnessEquipmentState subfield
/// Subfield value to be set
public void SetFitnessEquipmentState(byte? fitnessEquipmentState)
{
SetFieldValue(3, 0, fitnessEquipmentState, DataSubfield.FitnessEquipmentState);
}
///
/// Retrieves the SportPoint subfield
/// Nullable uint representing the SportPoint subfield
public uint? GetSportPoint()
{
return (uint?)GetFieldValue(3, 0, DataSubfield.SportPoint);
}
///
///
/// Set SportPoint subfield
/// Subfield value to be set
public void SetSportPoint(uint? sportPoint)
{
SetFieldValue(3, 0, sportPoint, DataSubfield.SportPoint);
}
///
/// Retrieves the GearChangeData subfield
/// Nullable uint representing the GearChangeData subfield
public uint? GetGearChangeData()
{
return (uint?)GetFieldValue(3, 0, DataSubfield.GearChangeData);
}
///
///
/// Set GearChangeData subfield
/// Subfield value to be set
public void SetGearChangeData(uint? gearChangeData)
{
SetFieldValue(3, 0, gearChangeData, DataSubfield.GearChangeData);
}
///
/// Retrieves the RiderPosition subfield
/// Comment: Indicates the rider position value.
/// Nullable RiderPositionType enum representing the RiderPosition subfield
public RiderPositionType? GetRiderPosition()
{
return (RiderPositionType?)GetFieldValue(3, 0, DataSubfield.RiderPosition);
}
///
///
/// Set RiderPosition subfield
/// Comment: Indicates the rider position value.
/// Subfield value to be set
public void SetRiderPosition(byte? riderPosition)
{
SetFieldValue(3, 0, riderPosition, DataSubfield.RiderPosition);
}
///
/// Retrieves the CommTimeout subfield
/// Nullable ushort representing the CommTimeout subfield
public ushort? GetCommTimeout()
{
return (ushort?)GetFieldValue(3, 0, DataSubfield.CommTimeout);
}
///
///
/// Set CommTimeout subfield
/// Subfield value to be set
public void SetCommTimeout(ushort? commTimeout)
{
SetFieldValue(3, 0, commTimeout, DataSubfield.CommTimeout);
}
///
/// Retrieves the EventGroup field
/// Returns nullable byte representing the EventGroup field
public byte? GetEventGroup()
{
return (byte?)GetFieldValue(4, 0, Fit.SubfieldIndexMainField);
}
///
/// Set EventGroup field
/// Nullable field value to be set
public void SetEventGroup(byte? eventGroup_)
{
SetFieldValue(4, 0, eventGroup_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the Score field
/// Comment: Do not populate directly. Autogenerated by decoder for sport_point subfield components
/// Returns nullable ushort representing the Score field
public ushort? GetScore()
{
return (ushort?)GetFieldValue(7, 0, Fit.SubfieldIndexMainField);
}
///
/// Set Score field
/// Comment: Do not populate directly. Autogenerated by decoder for sport_point subfield components
/// Nullable field value to be set
public void SetScore(ushort? score_)
{
SetFieldValue(7, 0, score_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the OpponentScore field
/// Comment: Do not populate directly. Autogenerated by decoder for sport_point subfield components
/// Returns nullable ushort representing the OpponentScore field
public ushort? GetOpponentScore()
{
return (ushort?)GetFieldValue(8, 0, Fit.SubfieldIndexMainField);
}
///
/// Set OpponentScore field
/// Comment: Do not populate directly. Autogenerated by decoder for sport_point subfield components
/// Nullable field value to be set
public void SetOpponentScore(ushort? opponentScore_)
{
SetFieldValue(8, 0, opponentScore_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the FrontGearNum field
/// Comment: Do not populate directly. Autogenerated by decoder for gear_change subfield components. Front gear number. 1 is innermost.
/// Returns nullable byte representing the FrontGearNum field
public byte? GetFrontGearNum()
{
return (byte?)GetFieldValue(9, 0, Fit.SubfieldIndexMainField);
}
///
/// Set FrontGearNum field
/// Comment: Do not populate directly. Autogenerated by decoder for gear_change subfield components. Front gear number. 1 is innermost.
/// Nullable field value to be set
public void SetFrontGearNum(byte? frontGearNum_)
{
SetFieldValue(9, 0, frontGearNum_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the FrontGear field
/// Comment: Do not populate directly. Autogenerated by decoder for gear_change subfield components. Number of front teeth.
/// Returns nullable byte representing the FrontGear field
public byte? GetFrontGear()
{
return (byte?)GetFieldValue(10, 0, Fit.SubfieldIndexMainField);
}
///
/// Set FrontGear field
/// Comment: Do not populate directly. Autogenerated by decoder for gear_change subfield components. Number of front teeth.
/// Nullable field value to be set
public void SetFrontGear(byte? frontGear_)
{
SetFieldValue(10, 0, frontGear_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the RearGearNum field
/// Comment: Do not populate directly. Autogenerated by decoder for gear_change subfield components. Rear gear number. 1 is innermost.
/// Returns nullable byte representing the RearGearNum field
public byte? GetRearGearNum()
{
return (byte?)GetFieldValue(11, 0, Fit.SubfieldIndexMainField);
}
///
/// Set RearGearNum field
/// Comment: Do not populate directly. Autogenerated by decoder for gear_change subfield components. Rear gear number. 1 is innermost.
/// Nullable field value to be set
public void SetRearGearNum(byte? rearGearNum_)
{
SetFieldValue(11, 0, rearGearNum_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the RearGear field
/// Comment: Do not populate directly. Autogenerated by decoder for gear_change subfield components. Number of rear teeth.
/// Returns nullable byte representing the RearGear field
public byte? GetRearGear()
{
return (byte?)GetFieldValue(12, 0, Fit.SubfieldIndexMainField);
}
///
/// Set RearGear field
/// Comment: Do not populate directly. Autogenerated by decoder for gear_change subfield components. Number of rear teeth.
/// Nullable field value to be set
public void SetRearGear(byte? rearGear_)
{
SetFieldValue(12, 0, rearGear_, Fit.SubfieldIndexMainField);
}
///
/// Retrieves the DeviceIndex field
/// Returns nullable byte representing the DeviceIndex field
public byte? GetDeviceIndex()
{
return (byte?)GetFieldValue(13, 0, Fit.SubfieldIndexMainField);
}
///
/// Set DeviceIndex field
/// Nullable field value to be set
public void SetDeviceIndex(byte? deviceIndex_)
{
SetFieldValue(13, 0, deviceIndex_, Fit.SubfieldIndexMainField);
}
#endregion // Methods
} // Class
} // namespace