MonitoringInfoMesg.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. #region Copyright
  2. ////////////////////////////////////////////////////////////////////////////////
  3. // The following FIT Protocol software provided may be used with FIT protocol
  4. // devices only and remains the copyrighted property of Dynastream Innovations Inc.
  5. // The software is being provided on an "as-is" basis and as an accommodation,
  6. // and therefore all warranties, representations, or guarantees of any kind
  7. // (whether express, implied or statutory) including, without limitation,
  8. // warranties of merchantability, non-infringement, or fitness for a particular
  9. // purpose, are specifically disclaimed.
  10. //
  11. // Copyright 2016 Dynastream Innovations Inc.
  12. ////////////////////////////////////////////////////////////////////////////////
  13. // ****WARNING**** This file is auto-generated! Do NOT edit this file.
  14. // Profile Version = 16.60Release
  15. // Tag = production-akw-16.60.00-0-g5d3d436
  16. ////////////////////////////////////////////////////////////////////////////////
  17. #endregion
  18. using System;
  19. using System.Collections.Generic;
  20. using System.Diagnostics;
  21. using System.Text;
  22. using System.IO;
  23. namespace Dynastream.Fit
  24. {
  25. /// <summary>
  26. /// Implements the MonitoringInfo profile message.
  27. /// </summary>
  28. public class MonitoringInfoMesg : Mesg
  29. {
  30. #region Fields
  31. #endregion
  32. #region Constructors
  33. public MonitoringInfoMesg() : base(Profile.GetMesg(MesgNum.MonitoringInfo))
  34. {
  35. }
  36. public MonitoringInfoMesg(Mesg mesg) : base(mesg)
  37. {
  38. }
  39. #endregion // Constructors
  40. #region Methods
  41. ///<summary>
  42. /// Retrieves the Timestamp field
  43. /// Units: s</summary>
  44. /// <returns>Returns DateTime representing the Timestamp field</returns>
  45. public DateTime GetTimestamp()
  46. {
  47. return TimestampToDateTime((uint?)GetFieldValue(253, 0, Fit.SubfieldIndexMainField));
  48. }
  49. /// <summary>
  50. /// Set Timestamp field
  51. /// Units: s</summary>
  52. /// <param name="timestamp_">Nullable field value to be set</param>
  53. public void SetTimestamp(DateTime timestamp_)
  54. {
  55. SetFieldValue(253, 0, timestamp_.GetTimeStamp(), Fit.SubfieldIndexMainField);
  56. }
  57. ///<summary>
  58. /// Retrieves the LocalTimestamp field
  59. /// Units: s
  60. /// Comment: Use to convert activity timestamps to local time if device does not support time zone and daylight savings time correction.</summary>
  61. /// <returns>Returns nullable uint representing the LocalTimestamp field</returns>
  62. public uint? GetLocalTimestamp()
  63. {
  64. return (uint?)GetFieldValue(0, 0, Fit.SubfieldIndexMainField);
  65. }
  66. /// <summary>
  67. /// Set LocalTimestamp field
  68. /// Units: s
  69. /// Comment: Use to convert activity timestamps to local time if device does not support time zone and daylight savings time correction.</summary>
  70. /// <param name="localTimestamp_">Nullable field value to be set</param>
  71. public void SetLocalTimestamp(uint? localTimestamp_)
  72. {
  73. SetFieldValue(0, 0, localTimestamp_, Fit.SubfieldIndexMainField);
  74. }
  75. /// <summary>
  76. ///
  77. /// </summary>
  78. /// <returns>returns number of elements in field ActivityType</returns>
  79. public int GetNumActivityType()
  80. {
  81. return GetNumFieldValues(1, Fit.SubfieldIndexMainField);
  82. }
  83. ///<summary>
  84. /// Retrieves the ActivityType field</summary>
  85. /// <param name="index">0 based index of ActivityType element to retrieve</param>
  86. /// <returns>Returns nullable ActivityType enum representing the ActivityType field</returns>
  87. public ActivityType? GetActivityType(int index)
  88. {
  89. object obj = GetFieldValue(1, index, Fit.SubfieldIndexMainField);
  90. ActivityType? value = obj == null ? (ActivityType?)null : (ActivityType)obj;
  91. return value;
  92. }
  93. /// <summary>
  94. /// Set ActivityType field</summary>
  95. /// <param name="index">0 based index of activity_type</param>
  96. /// <param name="activityType_">Nullable field value to be set</param>
  97. public void SetActivityType(int index, ActivityType? activityType_)
  98. {
  99. SetFieldValue(1, index, activityType_, Fit.SubfieldIndexMainField);
  100. }
  101. /// <summary>
  102. ///
  103. /// </summary>
  104. /// <returns>returns number of elements in field CyclesToDistance</returns>
  105. public int GetNumCyclesToDistance()
  106. {
  107. return GetNumFieldValues(3, Fit.SubfieldIndexMainField);
  108. }
  109. ///<summary>
  110. /// Retrieves the CyclesToDistance field
  111. /// Units: m/cycle
  112. /// Comment: Indexed by activity_type</summary>
  113. /// <param name="index">0 based index of CyclesToDistance element to retrieve</param>
  114. /// <returns>Returns nullable float representing the CyclesToDistance field</returns>
  115. public float? GetCyclesToDistance(int index)
  116. {
  117. return (float?)GetFieldValue(3, index, Fit.SubfieldIndexMainField);
  118. }
  119. /// <summary>
  120. /// Set CyclesToDistance field
  121. /// Units: m/cycle
  122. /// Comment: Indexed by activity_type</summary>
  123. /// <param name="index">0 based index of cycles_to_distance</param>
  124. /// <param name="cyclesToDistance_">Nullable field value to be set</param>
  125. public void SetCyclesToDistance(int index, float? cyclesToDistance_)
  126. {
  127. SetFieldValue(3, index, cyclesToDistance_, Fit.SubfieldIndexMainField);
  128. }
  129. /// <summary>
  130. ///
  131. /// </summary>
  132. /// <returns>returns number of elements in field CyclesToCalories</returns>
  133. public int GetNumCyclesToCalories()
  134. {
  135. return GetNumFieldValues(4, Fit.SubfieldIndexMainField);
  136. }
  137. ///<summary>
  138. /// Retrieves the CyclesToCalories field
  139. /// Units: kcal/cycle
  140. /// Comment: Indexed by activity_type</summary>
  141. /// <param name="index">0 based index of CyclesToCalories element to retrieve</param>
  142. /// <returns>Returns nullable float representing the CyclesToCalories field</returns>
  143. public float? GetCyclesToCalories(int index)
  144. {
  145. return (float?)GetFieldValue(4, index, Fit.SubfieldIndexMainField);
  146. }
  147. /// <summary>
  148. /// Set CyclesToCalories field
  149. /// Units: kcal/cycle
  150. /// Comment: Indexed by activity_type</summary>
  151. /// <param name="index">0 based index of cycles_to_calories</param>
  152. /// <param name="cyclesToCalories_">Nullable field value to be set</param>
  153. public void SetCyclesToCalories(int index, float? cyclesToCalories_)
  154. {
  155. SetFieldValue(4, index, cyclesToCalories_, Fit.SubfieldIndexMainField);
  156. }
  157. ///<summary>
  158. /// Retrieves the RestingMetabolicRate field
  159. /// Units: kcal / day</summary>
  160. /// <returns>Returns nullable ushort representing the RestingMetabolicRate field</returns>
  161. public ushort? GetRestingMetabolicRate()
  162. {
  163. return (ushort?)GetFieldValue(5, 0, Fit.SubfieldIndexMainField);
  164. }
  165. /// <summary>
  166. /// Set RestingMetabolicRate field
  167. /// Units: kcal / day</summary>
  168. /// <param name="restingMetabolicRate_">Nullable field value to be set</param>
  169. public void SetRestingMetabolicRate(ushort? restingMetabolicRate_)
  170. {
  171. SetFieldValue(5, 0, restingMetabolicRate_, Fit.SubfieldIndexMainField);
  172. }
  173. #endregion // Methods
  174. } // Class
  175. } // namespace