TotalsMesg.cs 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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 Totals profile message.
  27. /// </summary>
  28. public class TotalsMesg : Mesg
  29. {
  30. #region Fields
  31. #endregion
  32. #region Constructors
  33. public TotalsMesg() : base(Profile.GetMesg(MesgNum.Totals))
  34. {
  35. }
  36. public TotalsMesg(Mesg mesg) : base(mesg)
  37. {
  38. }
  39. #endregion // Constructors
  40. #region Methods
  41. ///<summary>
  42. /// Retrieves the MessageIndex field</summary>
  43. /// <returns>Returns nullable ushort representing the MessageIndex field</returns>
  44. public ushort? GetMessageIndex()
  45. {
  46. return (ushort?)GetFieldValue(254, 0, Fit.SubfieldIndexMainField);
  47. }
  48. /// <summary>
  49. /// Set MessageIndex field</summary>
  50. /// <param name="messageIndex_">Nullable field value to be set</param>
  51. public void SetMessageIndex(ushort? messageIndex_)
  52. {
  53. SetFieldValue(254, 0, messageIndex_, Fit.SubfieldIndexMainField);
  54. }
  55. ///<summary>
  56. /// Retrieves the Timestamp field
  57. /// Units: s</summary>
  58. /// <returns>Returns DateTime representing the Timestamp field</returns>
  59. public DateTime GetTimestamp()
  60. {
  61. return TimestampToDateTime((uint?)GetFieldValue(253, 0, Fit.SubfieldIndexMainField));
  62. }
  63. /// <summary>
  64. /// Set Timestamp field
  65. /// Units: s</summary>
  66. /// <param name="timestamp_">Nullable field value to be set</param>
  67. public void SetTimestamp(DateTime timestamp_)
  68. {
  69. SetFieldValue(253, 0, timestamp_.GetTimeStamp(), Fit.SubfieldIndexMainField);
  70. }
  71. ///<summary>
  72. /// Retrieves the TimerTime field
  73. /// Units: s
  74. /// Comment: Excludes pauses</summary>
  75. /// <returns>Returns nullable uint representing the TimerTime field</returns>
  76. public uint? GetTimerTime()
  77. {
  78. return (uint?)GetFieldValue(0, 0, Fit.SubfieldIndexMainField);
  79. }
  80. /// <summary>
  81. /// Set TimerTime field
  82. /// Units: s
  83. /// Comment: Excludes pauses</summary>
  84. /// <param name="timerTime_">Nullable field value to be set</param>
  85. public void SetTimerTime(uint? timerTime_)
  86. {
  87. SetFieldValue(0, 0, timerTime_, Fit.SubfieldIndexMainField);
  88. }
  89. ///<summary>
  90. /// Retrieves the Distance field
  91. /// Units: m</summary>
  92. /// <returns>Returns nullable uint representing the Distance field</returns>
  93. public uint? GetDistance()
  94. {
  95. return (uint?)GetFieldValue(1, 0, Fit.SubfieldIndexMainField);
  96. }
  97. /// <summary>
  98. /// Set Distance field
  99. /// Units: m</summary>
  100. /// <param name="distance_">Nullable field value to be set</param>
  101. public void SetDistance(uint? distance_)
  102. {
  103. SetFieldValue(1, 0, distance_, Fit.SubfieldIndexMainField);
  104. }
  105. ///<summary>
  106. /// Retrieves the Calories field
  107. /// Units: kcal</summary>
  108. /// <returns>Returns nullable uint representing the Calories field</returns>
  109. public uint? GetCalories()
  110. {
  111. return (uint?)GetFieldValue(2, 0, Fit.SubfieldIndexMainField);
  112. }
  113. /// <summary>
  114. /// Set Calories field
  115. /// Units: kcal</summary>
  116. /// <param name="calories_">Nullable field value to be set</param>
  117. public void SetCalories(uint? calories_)
  118. {
  119. SetFieldValue(2, 0, calories_, Fit.SubfieldIndexMainField);
  120. }
  121. ///<summary>
  122. /// Retrieves the Sport field</summary>
  123. /// <returns>Returns nullable Sport enum representing the Sport field</returns>
  124. public Sport? GetSport()
  125. {
  126. object obj = GetFieldValue(3, 0, Fit.SubfieldIndexMainField);
  127. Sport? value = obj == null ? (Sport?)null : (Sport)obj;
  128. return value;
  129. }
  130. /// <summary>
  131. /// Set Sport field</summary>
  132. /// <param name="sport_">Nullable field value to be set</param>
  133. public void SetSport(Sport? sport_)
  134. {
  135. SetFieldValue(3, 0, sport_, Fit.SubfieldIndexMainField);
  136. }
  137. ///<summary>
  138. /// Retrieves the ElapsedTime field
  139. /// Units: s
  140. /// Comment: Includes pauses</summary>
  141. /// <returns>Returns nullable uint representing the ElapsedTime field</returns>
  142. public uint? GetElapsedTime()
  143. {
  144. return (uint?)GetFieldValue(4, 0, Fit.SubfieldIndexMainField);
  145. }
  146. /// <summary>
  147. /// Set ElapsedTime field
  148. /// Units: s
  149. /// Comment: Includes pauses</summary>
  150. /// <param name="elapsedTime_">Nullable field value to be set</param>
  151. public void SetElapsedTime(uint? elapsedTime_)
  152. {
  153. SetFieldValue(4, 0, elapsedTime_, Fit.SubfieldIndexMainField);
  154. }
  155. ///<summary>
  156. /// Retrieves the Sessions field</summary>
  157. /// <returns>Returns nullable ushort representing the Sessions field</returns>
  158. public ushort? GetSessions()
  159. {
  160. return (ushort?)GetFieldValue(5, 0, Fit.SubfieldIndexMainField);
  161. }
  162. /// <summary>
  163. /// Set Sessions field</summary>
  164. /// <param name="sessions_">Nullable field value to be set</param>
  165. public void SetSessions(ushort? sessions_)
  166. {
  167. SetFieldValue(5, 0, sessions_, Fit.SubfieldIndexMainField);
  168. }
  169. ///<summary>
  170. /// Retrieves the ActiveTime field
  171. /// Units: s</summary>
  172. /// <returns>Returns nullable uint representing the ActiveTime field</returns>
  173. public uint? GetActiveTime()
  174. {
  175. return (uint?)GetFieldValue(6, 0, Fit.SubfieldIndexMainField);
  176. }
  177. /// <summary>
  178. /// Set ActiveTime field
  179. /// Units: s</summary>
  180. /// <param name="activeTime_">Nullable field value to be set</param>
  181. public void SetActiveTime(uint? activeTime_)
  182. {
  183. SetFieldValue(6, 0, activeTime_, Fit.SubfieldIndexMainField);
  184. }
  185. ///<summary>
  186. /// Retrieves the SportIndex field</summary>
  187. /// <returns>Returns nullable byte representing the SportIndex field</returns>
  188. public byte? GetSportIndex()
  189. {
  190. return (byte?)GetFieldValue(9, 0, Fit.SubfieldIndexMainField);
  191. }
  192. /// <summary>
  193. /// Set SportIndex field</summary>
  194. /// <param name="sportIndex_">Nullable field value to be set</param>
  195. public void SetSportIndex(byte? sportIndex_)
  196. {
  197. SetFieldValue(9, 0, sportIndex_, Fit.SubfieldIndexMainField);
  198. }
  199. #endregion // Methods
  200. } // Class
  201. } // namespace