GyroscopeDataMesg.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 GyroscopeData profile message.
  27. /// </summary>
  28. public class GyroscopeDataMesg : Mesg
  29. {
  30. #region Fields
  31. #endregion
  32. #region Constructors
  33. public GyroscopeDataMesg() : base(Profile.GetMesg(MesgNum.GyroscopeData))
  34. {
  35. }
  36. public GyroscopeDataMesg(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 gyro 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 gyro_x and gyro_y and gyro_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 gyro 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 gyro_x and gyro_y and gyro_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 GyroX</returns>
  109. public int GetNumGyroX()
  110. {
  111. return GetNumFieldValues(2, Fit.SubfieldIndexMainField);
  112. }
  113. ///<summary>
  114. /// Retrieves the GyroX 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 GyroX element to retrieve</param>
  118. /// <returns>Returns nullable ushort representing the GyroX field</returns>
  119. public ushort? GetGyroX(int index)
  120. {
  121. return (ushort?)GetFieldValue(2, index, Fit.SubfieldIndexMainField);
  122. }
  123. /// <summary>
  124. /// Set GyroX 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 gyro_x</param>
  128. /// <param name="gyroX_">Nullable field value to be set</param>
  129. public void SetGyroX(int index, ushort? gyroX_)
  130. {
  131. SetFieldValue(2, index, gyroX_, Fit.SubfieldIndexMainField);
  132. }
  133. /// <summary>
  134. ///
  135. /// </summary>
  136. /// <returns>returns number of elements in field GyroY</returns>
  137. public int GetNumGyroY()
  138. {
  139. return GetNumFieldValues(3, Fit.SubfieldIndexMainField);
  140. }
  141. ///<summary>
  142. /// Retrieves the GyroY 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 GyroY element to retrieve</param>
  146. /// <returns>Returns nullable ushort representing the GyroY field</returns>
  147. public ushort? GetGyroY(int index)
  148. {
  149. return (ushort?)GetFieldValue(3, index, Fit.SubfieldIndexMainField);
  150. }
  151. /// <summary>
  152. /// Set GyroY 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 gyro_y</param>
  156. /// <param name="gyroY_">Nullable field value to be set</param>
  157. public void SetGyroY(int index, ushort? gyroY_)
  158. {
  159. SetFieldValue(3, index, gyroY_, Fit.SubfieldIndexMainField);
  160. }
  161. /// <summary>
  162. ///
  163. /// </summary>
  164. /// <returns>returns number of elements in field GyroZ</returns>
  165. public int GetNumGyroZ()
  166. {
  167. return GetNumFieldValues(4, Fit.SubfieldIndexMainField);
  168. }
  169. ///<summary>
  170. /// Retrieves the GyroZ 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 GyroZ element to retrieve</param>
  174. /// <returns>Returns nullable ushort representing the GyroZ field</returns>
  175. public ushort? GetGyroZ(int index)
  176. {
  177. return (ushort?)GetFieldValue(4, index, Fit.SubfieldIndexMainField);
  178. }
  179. /// <summary>
  180. /// Set GyroZ 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 gyro_z</param>
  184. /// <param name="gyroZ_">Nullable field value to be set</param>
  185. public void SetGyroZ(int index, ushort? gyroZ_)
  186. {
  187. SetFieldValue(4, index, gyroZ_, Fit.SubfieldIndexMainField);
  188. }
  189. /// <summary>
  190. ///
  191. /// </summary>
  192. /// <returns>returns number of elements in field CalibratedGyroX</returns>
  193. public int GetNumCalibratedGyroX()
  194. {
  195. return GetNumFieldValues(5, Fit.SubfieldIndexMainField);
  196. }
  197. ///<summary>
  198. /// Retrieves the CalibratedGyroX field
  199. /// Units: deg/s
  200. /// Comment: Calibrated gyro reading</summary>
  201. /// <param name="index">0 based index of CalibratedGyroX element to retrieve</param>
  202. /// <returns>Returns nullable float representing the CalibratedGyroX field</returns>
  203. public float? GetCalibratedGyroX(int index)
  204. {
  205. return (float?)GetFieldValue(5, index, Fit.SubfieldIndexMainField);
  206. }
  207. /// <summary>
  208. /// Set CalibratedGyroX field
  209. /// Units: deg/s
  210. /// Comment: Calibrated gyro reading</summary>
  211. /// <param name="index">0 based index of calibrated_gyro_x</param>
  212. /// <param name="calibratedGyroX_">Nullable field value to be set</param>
  213. public void SetCalibratedGyroX(int index, float? calibratedGyroX_)
  214. {
  215. SetFieldValue(5, index, calibratedGyroX_, Fit.SubfieldIndexMainField);
  216. }
  217. /// <summary>
  218. ///
  219. /// </summary>
  220. /// <returns>returns number of elements in field CalibratedGyroY</returns>
  221. public int GetNumCalibratedGyroY()
  222. {
  223. return GetNumFieldValues(6, Fit.SubfieldIndexMainField);
  224. }
  225. ///<summary>
  226. /// Retrieves the CalibratedGyroY field
  227. /// Units: deg/s
  228. /// Comment: Calibrated gyro reading</summary>
  229. /// <param name="index">0 based index of CalibratedGyroY element to retrieve</param>
  230. /// <returns>Returns nullable float representing the CalibratedGyroY field</returns>
  231. public float? GetCalibratedGyroY(int index)
  232. {
  233. return (float?)GetFieldValue(6, index, Fit.SubfieldIndexMainField);
  234. }
  235. /// <summary>
  236. /// Set CalibratedGyroY field
  237. /// Units: deg/s
  238. /// Comment: Calibrated gyro reading</summary>
  239. /// <param name="index">0 based index of calibrated_gyro_y</param>
  240. /// <param name="calibratedGyroY_">Nullable field value to be set</param>
  241. public void SetCalibratedGyroY(int index, float? calibratedGyroY_)
  242. {
  243. SetFieldValue(6, index, calibratedGyroY_, Fit.SubfieldIndexMainField);
  244. }
  245. /// <summary>
  246. ///
  247. /// </summary>
  248. /// <returns>returns number of elements in field CalibratedGyroZ</returns>
  249. public int GetNumCalibratedGyroZ()
  250. {
  251. return GetNumFieldValues(7, Fit.SubfieldIndexMainField);
  252. }
  253. ///<summary>
  254. /// Retrieves the CalibratedGyroZ field
  255. /// Units: deg/s
  256. /// Comment: Calibrated gyro reading</summary>
  257. /// <param name="index">0 based index of CalibratedGyroZ element to retrieve</param>
  258. /// <returns>Returns nullable float representing the CalibratedGyroZ field</returns>
  259. public float? GetCalibratedGyroZ(int index)
  260. {
  261. return (float?)GetFieldValue(7, index, Fit.SubfieldIndexMainField);
  262. }
  263. /// <summary>
  264. /// Set CalibratedGyroZ field
  265. /// Units: deg/s
  266. /// Comment: Calibrated gyro reading</summary>
  267. /// <param name="index">0 based index of calibrated_gyro_z</param>
  268. /// <param name="calibratedGyroZ_">Nullable field value to be set</param>
  269. public void SetCalibratedGyroZ(int index, float? calibratedGyroZ_)
  270. {
  271. SetFieldValue(7, index, calibratedGyroZ_, Fit.SubfieldIndexMainField);
  272. }
  273. #endregion // Methods
  274. } // Class
  275. } // namespace