AccelerometerDataMesg.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  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 AccelerometerData profile message.
  27. /// </summary>
  28. public class AccelerometerDataMesg : Mesg
  29. {
  30. #region Fields
  31. #endregion
  32. #region Constructors
  33. public AccelerometerDataMesg() : base(Profile.GetMesg(MesgNum.AccelerometerData))
  34. {
  35. }
  36. public AccelerometerDataMesg(Mesg mesg) : base(mesg)
  37. {
  38. }
  39. #endregion // Constructors
  40. #region Methods
  41. ///<summary>
  42. /// Retrieves the Timestamp field
  43. /// Units: s
  44. /// Comment: Whole second part of the timestamp</summary>
  45. /// <returns>Returns DateTime representing the Timestamp field</returns>
  46. public DateTime GetTimestamp()
  47. {
  48. return TimestampToDateTime((uint?)GetFieldValue(253, 0, Fit.SubfieldIndexMainField));
  49. }
  50. /// <summary>
  51. /// Set Timestamp field
  52. /// Units: s
  53. /// Comment: Whole second part of the timestamp</summary>
  54. /// <param name="timestamp_">Nullable field value to be set</param>
  55. public void SetTimestamp(DateTime timestamp_)
  56. {
  57. SetFieldValue(253, 0, timestamp_.GetTimeStamp(), Fit.SubfieldIndexMainField);
  58. }
  59. ///<summary>
  60. /// Retrieves the TimestampMs field
  61. /// Units: ms
  62. /// Comment: Millisecond part of the timestamp.</summary>
  63. /// <returns>Returns nullable ushort representing the TimestampMs field</returns>
  64. public ushort? GetTimestampMs()
  65. {
  66. return (ushort?)GetFieldValue(0, 0, Fit.SubfieldIndexMainField);
  67. }
  68. /// <summary>
  69. /// Set TimestampMs field
  70. /// Units: ms
  71. /// Comment: Millisecond part of the timestamp.</summary>
  72. /// <param name="timestampMs_">Nullable field value to be set</param>
  73. public void SetTimestampMs(ushort? timestampMs_)
  74. {
  75. SetFieldValue(0, 0, timestampMs_, Fit.SubfieldIndexMainField);
  76. }
  77. /// <summary>
  78. ///
  79. /// </summary>
  80. /// <returns>returns number of elements in field SampleTimeOffset</returns>
  81. public int GetNumSampleTimeOffset()
  82. {
  83. return GetNumFieldValues(1, Fit.SubfieldIndexMainField);
  84. }
  85. ///<summary>
  86. /// Retrieves the SampleTimeOffset field
  87. /// Units: ms
  88. /// Comment: Each time in the array describes the time at which the accelerometer sample with the corrosponding index was taken. Limited to 30 samples in each message. The samples may span across seconds. Array size must match the number of samples in accel_x and accel_y and accel_z</summary>
  89. /// <param name="index">0 based index of SampleTimeOffset element to retrieve</param>
  90. /// <returns>Returns nullable ushort representing the SampleTimeOffset field</returns>
  91. public ushort? GetSampleTimeOffset(int index)
  92. {
  93. return (ushort?)GetFieldValue(1, index, Fit.SubfieldIndexMainField);
  94. }
  95. /// <summary>
  96. /// Set SampleTimeOffset field
  97. /// Units: ms
  98. /// Comment: Each time in the array describes the time at which the accelerometer sample with the corrosponding index was taken. Limited to 30 samples in each message. The samples may span across seconds. Array size must match the number of samples in accel_x and accel_y and accel_z</summary>
  99. /// <param name="index">0 based index of sample_time_offset</param>
  100. /// <param name="sampleTimeOffset_">Nullable field value to be set</param>
  101. public void SetSampleTimeOffset(int index, ushort? sampleTimeOffset_)
  102. {
  103. SetFieldValue(1, index, sampleTimeOffset_, Fit.SubfieldIndexMainField);
  104. }
  105. /// <summary>
  106. ///
  107. /// </summary>
  108. /// <returns>returns number of elements in field AccelX</returns>
  109. public int GetNumAccelX()
  110. {
  111. return GetNumFieldValues(2, Fit.SubfieldIndexMainField);
  112. }
  113. ///<summary>
  114. /// Retrieves the AccelX field
  115. /// Units: counts
  116. /// Comment: These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read.</summary>
  117. /// <param name="index">0 based index of AccelX element to retrieve</param>
  118. /// <returns>Returns nullable ushort representing the AccelX field</returns>
  119. public ushort? GetAccelX(int index)
  120. {
  121. return (ushort?)GetFieldValue(2, index, Fit.SubfieldIndexMainField);
  122. }
  123. /// <summary>
  124. /// Set AccelX field
  125. /// Units: counts
  126. /// Comment: These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read.</summary>
  127. /// <param name="index">0 based index of accel_x</param>
  128. /// <param name="accelX_">Nullable field value to be set</param>
  129. public void SetAccelX(int index, ushort? accelX_)
  130. {
  131. SetFieldValue(2, index, accelX_, Fit.SubfieldIndexMainField);
  132. }
  133. /// <summary>
  134. ///
  135. /// </summary>
  136. /// <returns>returns number of elements in field AccelY</returns>
  137. public int GetNumAccelY()
  138. {
  139. return GetNumFieldValues(3, Fit.SubfieldIndexMainField);
  140. }
  141. ///<summary>
  142. /// Retrieves the AccelY field
  143. /// Units: counts
  144. /// Comment: These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read.</summary>
  145. /// <param name="index">0 based index of AccelY element to retrieve</param>
  146. /// <returns>Returns nullable ushort representing the AccelY field</returns>
  147. public ushort? GetAccelY(int index)
  148. {
  149. return (ushort?)GetFieldValue(3, index, Fit.SubfieldIndexMainField);
  150. }
  151. /// <summary>
  152. /// Set AccelY field
  153. /// Units: counts
  154. /// Comment: These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read.</summary>
  155. /// <param name="index">0 based index of accel_y</param>
  156. /// <param name="accelY_">Nullable field value to be set</param>
  157. public void SetAccelY(int index, ushort? accelY_)
  158. {
  159. SetFieldValue(3, index, accelY_, Fit.SubfieldIndexMainField);
  160. }
  161. /// <summary>
  162. ///
  163. /// </summary>
  164. /// <returns>returns number of elements in field AccelZ</returns>
  165. public int GetNumAccelZ()
  166. {
  167. return GetNumFieldValues(4, Fit.SubfieldIndexMainField);
  168. }
  169. ///<summary>
  170. /// Retrieves the AccelZ field
  171. /// Units: counts
  172. /// Comment: These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read.</summary>
  173. /// <param name="index">0 based index of AccelZ element to retrieve</param>
  174. /// <returns>Returns nullable ushort representing the AccelZ field</returns>
  175. public ushort? GetAccelZ(int index)
  176. {
  177. return (ushort?)GetFieldValue(4, index, Fit.SubfieldIndexMainField);
  178. }
  179. /// <summary>
  180. /// Set AccelZ field
  181. /// Units: counts
  182. /// Comment: These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read.</summary>
  183. /// <param name="index">0 based index of accel_z</param>
  184. /// <param name="accelZ_">Nullable field value to be set</param>
  185. public void SetAccelZ(int index, ushort? accelZ_)
  186. {
  187. SetFieldValue(4, index, accelZ_, Fit.SubfieldIndexMainField);
  188. }
  189. /// <summary>
  190. ///
  191. /// </summary>
  192. /// <returns>returns number of elements in field CalibratedAccelX</returns>
  193. public int GetNumCalibratedAccelX()
  194. {
  195. return GetNumFieldValues(5, Fit.SubfieldIndexMainField);
  196. }
  197. ///<summary>
  198. /// Retrieves the CalibratedAccelX field
  199. /// Units: g
  200. /// Comment: Calibrated accel reading</summary>
  201. /// <param name="index">0 based index of CalibratedAccelX element to retrieve</param>
  202. /// <returns>Returns nullable float representing the CalibratedAccelX field</returns>
  203. public float? GetCalibratedAccelX(int index)
  204. {
  205. return (float?)GetFieldValue(5, index, Fit.SubfieldIndexMainField);
  206. }
  207. /// <summary>
  208. /// Set CalibratedAccelX field
  209. /// Units: g
  210. /// Comment: Calibrated accel reading</summary>
  211. /// <param name="index">0 based index of calibrated_accel_x</param>
  212. /// <param name="calibratedAccelX_">Nullable field value to be set</param>
  213. public void SetCalibratedAccelX(int index, float? calibratedAccelX_)
  214. {
  215. SetFieldValue(5, index, calibratedAccelX_, Fit.SubfieldIndexMainField);
  216. }
  217. /// <summary>
  218. ///
  219. /// </summary>
  220. /// <returns>returns number of elements in field CalibratedAccelY</returns>
  221. public int GetNumCalibratedAccelY()
  222. {
  223. return GetNumFieldValues(6, Fit.SubfieldIndexMainField);
  224. }
  225. ///<summary>
  226. /// Retrieves the CalibratedAccelY field
  227. /// Units: g
  228. /// Comment: Calibrated accel reading</summary>
  229. /// <param name="index">0 based index of CalibratedAccelY element to retrieve</param>
  230. /// <returns>Returns nullable float representing the CalibratedAccelY field</returns>
  231. public float? GetCalibratedAccelY(int index)
  232. {
  233. return (float?)GetFieldValue(6, index, Fit.SubfieldIndexMainField);
  234. }
  235. /// <summary>
  236. /// Set CalibratedAccelY field
  237. /// Units: g
  238. /// Comment: Calibrated accel reading</summary>
  239. /// <param name="index">0 based index of calibrated_accel_y</param>
  240. /// <param name="calibratedAccelY_">Nullable field value to be set</param>
  241. public void SetCalibratedAccelY(int index, float? calibratedAccelY_)
  242. {
  243. SetFieldValue(6, index, calibratedAccelY_, Fit.SubfieldIndexMainField);
  244. }
  245. /// <summary>
  246. ///
  247. /// </summary>
  248. /// <returns>returns number of elements in field CalibratedAccelZ</returns>
  249. public int GetNumCalibratedAccelZ()
  250. {
  251. return GetNumFieldValues(7, Fit.SubfieldIndexMainField);
  252. }
  253. ///<summary>
  254. /// Retrieves the CalibratedAccelZ field
  255. /// Units: g
  256. /// Comment: Calibrated accel reading</summary>
  257. /// <param name="index">0 based index of CalibratedAccelZ element to retrieve</param>
  258. /// <returns>Returns nullable float representing the CalibratedAccelZ field</returns>
  259. public float? GetCalibratedAccelZ(int index)
  260. {
  261. return (float?)GetFieldValue(7, index, Fit.SubfieldIndexMainField);
  262. }
  263. /// <summary>
  264. /// Set CalibratedAccelZ field
  265. /// Units: g
  266. /// Comment: Calibrated accel reading</summary>
  267. /// <param name="index">0 based index of calibrated_accel_z</param>
  268. /// <param name="calibratedAccelZ_">Nullable field value to be set</param>
  269. public void SetCalibratedAccelZ(int index, float? calibratedAccelZ_)
  270. {
  271. SetFieldValue(7, index, calibratedAccelZ_, Fit.SubfieldIndexMainField);
  272. }
  273. #endregion // Methods
  274. } // Class
  275. } // namespace