LengthMesg.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  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 Length profile message.
  27. /// </summary>
  28. public class LengthMesg : Mesg
  29. {
  30. #region Fields
  31. #endregion
  32. #region Constructors
  33. public LengthMesg() : base(Profile.GetMesg(MesgNum.Length))
  34. {
  35. }
  36. public LengthMesg(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</summary>
  57. /// <returns>Returns DateTime representing the Timestamp field</returns>
  58. public DateTime GetTimestamp()
  59. {
  60. return TimestampToDateTime((uint?)GetFieldValue(253, 0, Fit.SubfieldIndexMainField));
  61. }
  62. /// <summary>
  63. /// Set Timestamp field</summary>
  64. /// <param name="timestamp_">Nullable field value to be set</param>
  65. public void SetTimestamp(DateTime timestamp_)
  66. {
  67. SetFieldValue(253, 0, timestamp_.GetTimeStamp(), Fit.SubfieldIndexMainField);
  68. }
  69. ///<summary>
  70. /// Retrieves the Event field</summary>
  71. /// <returns>Returns nullable Event enum representing the Event field</returns>
  72. public Event? GetEvent()
  73. {
  74. object obj = GetFieldValue(0, 0, Fit.SubfieldIndexMainField);
  75. Event? value = obj == null ? (Event?)null : (Event)obj;
  76. return value;
  77. }
  78. /// <summary>
  79. /// Set Event field</summary>
  80. /// <param name="event_">Nullable field value to be set</param>
  81. public void SetEvent(Event? event_)
  82. {
  83. SetFieldValue(0, 0, event_, Fit.SubfieldIndexMainField);
  84. }
  85. ///<summary>
  86. /// Retrieves the EventType field</summary>
  87. /// <returns>Returns nullable EventType enum representing the EventType field</returns>
  88. public EventType? GetEventType()
  89. {
  90. object obj = GetFieldValue(1, 0, Fit.SubfieldIndexMainField);
  91. EventType? value = obj == null ? (EventType?)null : (EventType)obj;
  92. return value;
  93. }
  94. /// <summary>
  95. /// Set EventType field</summary>
  96. /// <param name="eventType_">Nullable field value to be set</param>
  97. public void SetEventType(EventType? eventType_)
  98. {
  99. SetFieldValue(1, 0, eventType_, Fit.SubfieldIndexMainField);
  100. }
  101. ///<summary>
  102. /// Retrieves the StartTime field</summary>
  103. /// <returns>Returns DateTime representing the StartTime field</returns>
  104. public DateTime GetStartTime()
  105. {
  106. return TimestampToDateTime((uint?)GetFieldValue(2, 0, Fit.SubfieldIndexMainField));
  107. }
  108. /// <summary>
  109. /// Set StartTime field</summary>
  110. /// <param name="startTime_">Nullable field value to be set</param>
  111. public void SetStartTime(DateTime startTime_)
  112. {
  113. SetFieldValue(2, 0, startTime_.GetTimeStamp(), Fit.SubfieldIndexMainField);
  114. }
  115. ///<summary>
  116. /// Retrieves the TotalElapsedTime field
  117. /// Units: s</summary>
  118. /// <returns>Returns nullable float representing the TotalElapsedTime field</returns>
  119. public float? GetTotalElapsedTime()
  120. {
  121. return (float?)GetFieldValue(3, 0, Fit.SubfieldIndexMainField);
  122. }
  123. /// <summary>
  124. /// Set TotalElapsedTime field
  125. /// Units: s</summary>
  126. /// <param name="totalElapsedTime_">Nullable field value to be set</param>
  127. public void SetTotalElapsedTime(float? totalElapsedTime_)
  128. {
  129. SetFieldValue(3, 0, totalElapsedTime_, Fit.SubfieldIndexMainField);
  130. }
  131. ///<summary>
  132. /// Retrieves the TotalTimerTime field
  133. /// Units: s</summary>
  134. /// <returns>Returns nullable float representing the TotalTimerTime field</returns>
  135. public float? GetTotalTimerTime()
  136. {
  137. return (float?)GetFieldValue(4, 0, Fit.SubfieldIndexMainField);
  138. }
  139. /// <summary>
  140. /// Set TotalTimerTime field
  141. /// Units: s</summary>
  142. /// <param name="totalTimerTime_">Nullable field value to be set</param>
  143. public void SetTotalTimerTime(float? totalTimerTime_)
  144. {
  145. SetFieldValue(4, 0, totalTimerTime_, Fit.SubfieldIndexMainField);
  146. }
  147. ///<summary>
  148. /// Retrieves the TotalStrokes field
  149. /// Units: strokes</summary>
  150. /// <returns>Returns nullable ushort representing the TotalStrokes field</returns>
  151. public ushort? GetTotalStrokes()
  152. {
  153. return (ushort?)GetFieldValue(5, 0, Fit.SubfieldIndexMainField);
  154. }
  155. /// <summary>
  156. /// Set TotalStrokes field
  157. /// Units: strokes</summary>
  158. /// <param name="totalStrokes_">Nullable field value to be set</param>
  159. public void SetTotalStrokes(ushort? totalStrokes_)
  160. {
  161. SetFieldValue(5, 0, totalStrokes_, Fit.SubfieldIndexMainField);
  162. }
  163. ///<summary>
  164. /// Retrieves the AvgSpeed field
  165. /// Units: m/s</summary>
  166. /// <returns>Returns nullable float representing the AvgSpeed field</returns>
  167. public float? GetAvgSpeed()
  168. {
  169. return (float?)GetFieldValue(6, 0, Fit.SubfieldIndexMainField);
  170. }
  171. /// <summary>
  172. /// Set AvgSpeed field
  173. /// Units: m/s</summary>
  174. /// <param name="avgSpeed_">Nullable field value to be set</param>
  175. public void SetAvgSpeed(float? avgSpeed_)
  176. {
  177. SetFieldValue(6, 0, avgSpeed_, Fit.SubfieldIndexMainField);
  178. }
  179. ///<summary>
  180. /// Retrieves the SwimStroke field
  181. /// Units: swim_stroke</summary>
  182. /// <returns>Returns nullable SwimStroke enum representing the SwimStroke field</returns>
  183. public SwimStroke? GetSwimStroke()
  184. {
  185. object obj = GetFieldValue(7, 0, Fit.SubfieldIndexMainField);
  186. SwimStroke? value = obj == null ? (SwimStroke?)null : (SwimStroke)obj;
  187. return value;
  188. }
  189. /// <summary>
  190. /// Set SwimStroke field
  191. /// Units: swim_stroke</summary>
  192. /// <param name="swimStroke_">Nullable field value to be set</param>
  193. public void SetSwimStroke(SwimStroke? swimStroke_)
  194. {
  195. SetFieldValue(7, 0, swimStroke_, Fit.SubfieldIndexMainField);
  196. }
  197. ///<summary>
  198. /// Retrieves the AvgSwimmingCadence field
  199. /// Units: strokes/min</summary>
  200. /// <returns>Returns nullable byte representing the AvgSwimmingCadence field</returns>
  201. public byte? GetAvgSwimmingCadence()
  202. {
  203. return (byte?)GetFieldValue(9, 0, Fit.SubfieldIndexMainField);
  204. }
  205. /// <summary>
  206. /// Set AvgSwimmingCadence field
  207. /// Units: strokes/min</summary>
  208. /// <param name="avgSwimmingCadence_">Nullable field value to be set</param>
  209. public void SetAvgSwimmingCadence(byte? avgSwimmingCadence_)
  210. {
  211. SetFieldValue(9, 0, avgSwimmingCadence_, Fit.SubfieldIndexMainField);
  212. }
  213. ///<summary>
  214. /// Retrieves the EventGroup field</summary>
  215. /// <returns>Returns nullable byte representing the EventGroup field</returns>
  216. public byte? GetEventGroup()
  217. {
  218. return (byte?)GetFieldValue(10, 0, Fit.SubfieldIndexMainField);
  219. }
  220. /// <summary>
  221. /// Set EventGroup field</summary>
  222. /// <param name="eventGroup_">Nullable field value to be set</param>
  223. public void SetEventGroup(byte? eventGroup_)
  224. {
  225. SetFieldValue(10, 0, eventGroup_, Fit.SubfieldIndexMainField);
  226. }
  227. ///<summary>
  228. /// Retrieves the TotalCalories field
  229. /// Units: kcal</summary>
  230. /// <returns>Returns nullable ushort representing the TotalCalories field</returns>
  231. public ushort? GetTotalCalories()
  232. {
  233. return (ushort?)GetFieldValue(11, 0, Fit.SubfieldIndexMainField);
  234. }
  235. /// <summary>
  236. /// Set TotalCalories field
  237. /// Units: kcal</summary>
  238. /// <param name="totalCalories_">Nullable field value to be set</param>
  239. public void SetTotalCalories(ushort? totalCalories_)
  240. {
  241. SetFieldValue(11, 0, totalCalories_, Fit.SubfieldIndexMainField);
  242. }
  243. ///<summary>
  244. /// Retrieves the LengthType field</summary>
  245. /// <returns>Returns nullable LengthType enum representing the LengthType field</returns>
  246. public LengthType? GetLengthType()
  247. {
  248. object obj = GetFieldValue(12, 0, Fit.SubfieldIndexMainField);
  249. LengthType? value = obj == null ? (LengthType?)null : (LengthType)obj;
  250. return value;
  251. }
  252. /// <summary>
  253. /// Set LengthType field</summary>
  254. /// <param name="lengthType_">Nullable field value to be set</param>
  255. public void SetLengthType(LengthType? lengthType_)
  256. {
  257. SetFieldValue(12, 0, lengthType_, Fit.SubfieldIndexMainField);
  258. }
  259. ///<summary>
  260. /// Retrieves the PlayerScore field</summary>
  261. /// <returns>Returns nullable ushort representing the PlayerScore field</returns>
  262. public ushort? GetPlayerScore()
  263. {
  264. return (ushort?)GetFieldValue(18, 0, Fit.SubfieldIndexMainField);
  265. }
  266. /// <summary>
  267. /// Set PlayerScore field</summary>
  268. /// <param name="playerScore_">Nullable field value to be set</param>
  269. public void SetPlayerScore(ushort? playerScore_)
  270. {
  271. SetFieldValue(18, 0, playerScore_, Fit.SubfieldIndexMainField);
  272. }
  273. ///<summary>
  274. /// Retrieves the OpponentScore field</summary>
  275. /// <returns>Returns nullable ushort representing the OpponentScore field</returns>
  276. public ushort? GetOpponentScore()
  277. {
  278. return (ushort?)GetFieldValue(19, 0, Fit.SubfieldIndexMainField);
  279. }
  280. /// <summary>
  281. /// Set OpponentScore field</summary>
  282. /// <param name="opponentScore_">Nullable field value to be set</param>
  283. public void SetOpponentScore(ushort? opponentScore_)
  284. {
  285. SetFieldValue(19, 0, opponentScore_, Fit.SubfieldIndexMainField);
  286. }
  287. /// <summary>
  288. ///
  289. /// </summary>
  290. /// <returns>returns number of elements in field StrokeCount</returns>
  291. public int GetNumStrokeCount()
  292. {
  293. return GetNumFieldValues(20, Fit.SubfieldIndexMainField);
  294. }
  295. ///<summary>
  296. /// Retrieves the StrokeCount field
  297. /// Units: counts
  298. /// Comment: stroke_type enum used as the index</summary>
  299. /// <param name="index">0 based index of StrokeCount element to retrieve</param>
  300. /// <returns>Returns nullable ushort representing the StrokeCount field</returns>
  301. public ushort? GetStrokeCount(int index)
  302. {
  303. return (ushort?)GetFieldValue(20, index, Fit.SubfieldIndexMainField);
  304. }
  305. /// <summary>
  306. /// Set StrokeCount field
  307. /// Units: counts
  308. /// Comment: stroke_type enum used as the index</summary>
  309. /// <param name="index">0 based index of stroke_count</param>
  310. /// <param name="strokeCount_">Nullable field value to be set</param>
  311. public void SetStrokeCount(int index, ushort? strokeCount_)
  312. {
  313. SetFieldValue(20, index, strokeCount_, Fit.SubfieldIndexMainField);
  314. }
  315. /// <summary>
  316. ///
  317. /// </summary>
  318. /// <returns>returns number of elements in field ZoneCount</returns>
  319. public int GetNumZoneCount()
  320. {
  321. return GetNumFieldValues(21, Fit.SubfieldIndexMainField);
  322. }
  323. ///<summary>
  324. /// Retrieves the ZoneCount field
  325. /// Units: counts
  326. /// Comment: zone number used as the index</summary>
  327. /// <param name="index">0 based index of ZoneCount element to retrieve</param>
  328. /// <returns>Returns nullable ushort representing the ZoneCount field</returns>
  329. public ushort? GetZoneCount(int index)
  330. {
  331. return (ushort?)GetFieldValue(21, index, Fit.SubfieldIndexMainField);
  332. }
  333. /// <summary>
  334. /// Set ZoneCount field
  335. /// Units: counts
  336. /// Comment: zone number used as the index</summary>
  337. /// <param name="index">0 based index of zone_count</param>
  338. /// <param name="zoneCount_">Nullable field value to be set</param>
  339. public void SetZoneCount(int index, ushort? zoneCount_)
  340. {
  341. SetFieldValue(21, index, zoneCount_, Fit.SubfieldIndexMainField);
  342. }
  343. #endregion // Methods
  344. } // Class
  345. } // namespace