AviationAttitudeMesg.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  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 AviationAttitude profile message.
  27. /// </summary>
  28. public class AviationAttitudeMesg : Mesg
  29. {
  30. #region Fields
  31. #endregion
  32. #region Constructors
  33. public AviationAttitudeMesg() : base(Profile.GetMesg(MesgNum.AviationAttitude))
  34. {
  35. }
  36. public AviationAttitudeMesg(Mesg mesg) : base(mesg)
  37. {
  38. }
  39. #endregion // Constructors
  40. #region Methods
  41. ///<summary>
  42. /// Retrieves the Timestamp field
  43. /// Units: s
  44. /// Comment: Timestamp message was output</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: Timestamp message was output</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: Fractional part of timestamp, added to 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: Fractional part of timestamp, added to 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 SystemTime</returns>
  81. public int GetNumSystemTime()
  82. {
  83. return GetNumFieldValues(1, Fit.SubfieldIndexMainField);
  84. }
  85. ///<summary>
  86. /// Retrieves the SystemTime field
  87. /// Units: ms
  88. /// Comment: System time associated with sample expressed in ms.</summary>
  89. /// <param name="index">0 based index of SystemTime element to retrieve</param>
  90. /// <returns>Returns nullable uint representing the SystemTime field</returns>
  91. public uint? GetSystemTime(int index)
  92. {
  93. return (uint?)GetFieldValue(1, index, Fit.SubfieldIndexMainField);
  94. }
  95. /// <summary>
  96. /// Set SystemTime field
  97. /// Units: ms
  98. /// Comment: System time associated with sample expressed in ms.</summary>
  99. /// <param name="index">0 based index of system_time</param>
  100. /// <param name="systemTime_">Nullable field value to be set</param>
  101. public void SetSystemTime(int index, uint? systemTime_)
  102. {
  103. SetFieldValue(1, index, systemTime_, Fit.SubfieldIndexMainField);
  104. }
  105. /// <summary>
  106. ///
  107. /// </summary>
  108. /// <returns>returns number of elements in field Pitch</returns>
  109. public int GetNumPitch()
  110. {
  111. return GetNumFieldValues(2, Fit.SubfieldIndexMainField);
  112. }
  113. ///<summary>
  114. /// Retrieves the Pitch field
  115. /// Units: radians
  116. /// Comment: Range -PI/2 to +PI/2</summary>
  117. /// <param name="index">0 based index of Pitch element to retrieve</param>
  118. /// <returns>Returns nullable short representing the Pitch field</returns>
  119. public short? GetPitch(int index)
  120. {
  121. return (short?)GetFieldValue(2, index, Fit.SubfieldIndexMainField);
  122. }
  123. /// <summary>
  124. /// Set Pitch field
  125. /// Units: radians
  126. /// Comment: Range -PI/2 to +PI/2</summary>
  127. /// <param name="index">0 based index of pitch</param>
  128. /// <param name="pitch_">Nullable field value to be set</param>
  129. public void SetPitch(int index, short? pitch_)
  130. {
  131. SetFieldValue(2, index, pitch_, Fit.SubfieldIndexMainField);
  132. }
  133. /// <summary>
  134. ///
  135. /// </summary>
  136. /// <returns>returns number of elements in field Roll</returns>
  137. public int GetNumRoll()
  138. {
  139. return GetNumFieldValues(3, Fit.SubfieldIndexMainField);
  140. }
  141. ///<summary>
  142. /// Retrieves the Roll field
  143. /// Units: radians
  144. /// Comment: Range -PI to +PI</summary>
  145. /// <param name="index">0 based index of Roll element to retrieve</param>
  146. /// <returns>Returns nullable short representing the Roll field</returns>
  147. public short? GetRoll(int index)
  148. {
  149. return (short?)GetFieldValue(3, index, Fit.SubfieldIndexMainField);
  150. }
  151. /// <summary>
  152. /// Set Roll field
  153. /// Units: radians
  154. /// Comment: Range -PI to +PI</summary>
  155. /// <param name="index">0 based index of roll</param>
  156. /// <param name="roll_">Nullable field value to be set</param>
  157. public void SetRoll(int index, short? roll_)
  158. {
  159. SetFieldValue(3, index, roll_, Fit.SubfieldIndexMainField);
  160. }
  161. /// <summary>
  162. ///
  163. /// </summary>
  164. /// <returns>returns number of elements in field AccelLateral</returns>
  165. public int GetNumAccelLateral()
  166. {
  167. return GetNumFieldValues(4, Fit.SubfieldIndexMainField);
  168. }
  169. ///<summary>
  170. /// Retrieves the AccelLateral field
  171. /// Units: m/s^2
  172. /// Comment: Range -78.4 to +78.4 (-8 Gs to 8 Gs)</summary>
  173. /// <param name="index">0 based index of AccelLateral element to retrieve</param>
  174. /// <returns>Returns nullable float representing the AccelLateral field</returns>
  175. public float? GetAccelLateral(int index)
  176. {
  177. return (float?)GetFieldValue(4, index, Fit.SubfieldIndexMainField);
  178. }
  179. /// <summary>
  180. /// Set AccelLateral field
  181. /// Units: m/s^2
  182. /// Comment: Range -78.4 to +78.4 (-8 Gs to 8 Gs)</summary>
  183. /// <param name="index">0 based index of accel_lateral</param>
  184. /// <param name="accelLateral_">Nullable field value to be set</param>
  185. public void SetAccelLateral(int index, float? accelLateral_)
  186. {
  187. SetFieldValue(4, index, accelLateral_, Fit.SubfieldIndexMainField);
  188. }
  189. /// <summary>
  190. ///
  191. /// </summary>
  192. /// <returns>returns number of elements in field AccelNormal</returns>
  193. public int GetNumAccelNormal()
  194. {
  195. return GetNumFieldValues(5, Fit.SubfieldIndexMainField);
  196. }
  197. ///<summary>
  198. /// Retrieves the AccelNormal field
  199. /// Units: m/s^2
  200. /// Comment: Range -78.4 to +78.4 (-8 Gs to 8 Gs)</summary>
  201. /// <param name="index">0 based index of AccelNormal element to retrieve</param>
  202. /// <returns>Returns nullable float representing the AccelNormal field</returns>
  203. public float? GetAccelNormal(int index)
  204. {
  205. return (float?)GetFieldValue(5, index, Fit.SubfieldIndexMainField);
  206. }
  207. /// <summary>
  208. /// Set AccelNormal field
  209. /// Units: m/s^2
  210. /// Comment: Range -78.4 to +78.4 (-8 Gs to 8 Gs)</summary>
  211. /// <param name="index">0 based index of accel_normal</param>
  212. /// <param name="accelNormal_">Nullable field value to be set</param>
  213. public void SetAccelNormal(int index, float? accelNormal_)
  214. {
  215. SetFieldValue(5, index, accelNormal_, Fit.SubfieldIndexMainField);
  216. }
  217. /// <summary>
  218. ///
  219. /// </summary>
  220. /// <returns>returns number of elements in field TurnRate</returns>
  221. public int GetNumTurnRate()
  222. {
  223. return GetNumFieldValues(6, Fit.SubfieldIndexMainField);
  224. }
  225. ///<summary>
  226. /// Retrieves the TurnRate field
  227. /// Units: radians/second
  228. /// Comment: Range -8.727 to +8.727 (-500 degs/sec to +500 degs/sec)</summary>
  229. /// <param name="index">0 based index of TurnRate element to retrieve</param>
  230. /// <returns>Returns nullable float representing the TurnRate field</returns>
  231. public float? GetTurnRate(int index)
  232. {
  233. return (float?)GetFieldValue(6, index, Fit.SubfieldIndexMainField);
  234. }
  235. /// <summary>
  236. /// Set TurnRate field
  237. /// Units: radians/second
  238. /// Comment: Range -8.727 to +8.727 (-500 degs/sec to +500 degs/sec)</summary>
  239. /// <param name="index">0 based index of turn_rate</param>
  240. /// <param name="turnRate_">Nullable field value to be set</param>
  241. public void SetTurnRate(int index, float? turnRate_)
  242. {
  243. SetFieldValue(6, index, turnRate_, Fit.SubfieldIndexMainField);
  244. }
  245. /// <summary>
  246. ///
  247. /// </summary>
  248. /// <returns>returns number of elements in field Stage</returns>
  249. public int GetNumStage()
  250. {
  251. return GetNumFieldValues(7, Fit.SubfieldIndexMainField);
  252. }
  253. ///<summary>
  254. /// Retrieves the Stage field</summary>
  255. /// <param name="index">0 based index of Stage element to retrieve</param>
  256. /// <returns>Returns nullable AttitudeStage enum representing the Stage field</returns>
  257. public AttitudeStage? GetStage(int index)
  258. {
  259. object obj = GetFieldValue(7, index, Fit.SubfieldIndexMainField);
  260. AttitudeStage? value = obj == null ? (AttitudeStage?)null : (AttitudeStage)obj;
  261. return value;
  262. }
  263. /// <summary>
  264. /// Set Stage field</summary>
  265. /// <param name="index">0 based index of stage</param>
  266. /// <param name="stage_">Nullable field value to be set</param>
  267. public void SetStage(int index, AttitudeStage? stage_)
  268. {
  269. SetFieldValue(7, index, stage_, Fit.SubfieldIndexMainField);
  270. }
  271. /// <summary>
  272. ///
  273. /// </summary>
  274. /// <returns>returns number of elements in field AttitudeStageComplete</returns>
  275. public int GetNumAttitudeStageComplete()
  276. {
  277. return GetNumFieldValues(8, Fit.SubfieldIndexMainField);
  278. }
  279. ///<summary>
  280. /// Retrieves the AttitudeStageComplete field
  281. /// Units: %
  282. /// Comment: The percent complete of the current attitude stage. Set to 0 for attitude stages 0, 1 and 2 and to 100 for attitude stage 3 by AHRS modules that do not support it. Range - 100</summary>
  283. /// <param name="index">0 based index of AttitudeStageComplete element to retrieve</param>
  284. /// <returns>Returns nullable byte representing the AttitudeStageComplete field</returns>
  285. public byte? GetAttitudeStageComplete(int index)
  286. {
  287. return (byte?)GetFieldValue(8, index, Fit.SubfieldIndexMainField);
  288. }
  289. /// <summary>
  290. /// Set AttitudeStageComplete field
  291. /// Units: %
  292. /// Comment: The percent complete of the current attitude stage. Set to 0 for attitude stages 0, 1 and 2 and to 100 for attitude stage 3 by AHRS modules that do not support it. Range - 100</summary>
  293. /// <param name="index">0 based index of attitude_stage_complete</param>
  294. /// <param name="attitudeStageComplete_">Nullable field value to be set</param>
  295. public void SetAttitudeStageComplete(int index, byte? attitudeStageComplete_)
  296. {
  297. SetFieldValue(8, index, attitudeStageComplete_, Fit.SubfieldIndexMainField);
  298. }
  299. /// <summary>
  300. ///
  301. /// </summary>
  302. /// <returns>returns number of elements in field Track</returns>
  303. public int GetNumTrack()
  304. {
  305. return GetNumFieldValues(9, Fit.SubfieldIndexMainField);
  306. }
  307. ///<summary>
  308. /// Retrieves the Track field
  309. /// Units: radians
  310. /// Comment: Track Angle/Heading Range 0 - 2pi</summary>
  311. /// <param name="index">0 based index of Track element to retrieve</param>
  312. /// <returns>Returns nullable ushort representing the Track field</returns>
  313. public ushort? GetTrack(int index)
  314. {
  315. return (ushort?)GetFieldValue(9, index, Fit.SubfieldIndexMainField);
  316. }
  317. /// <summary>
  318. /// Set Track field
  319. /// Units: radians
  320. /// Comment: Track Angle/Heading Range 0 - 2pi</summary>
  321. /// <param name="index">0 based index of track</param>
  322. /// <param name="track_">Nullable field value to be set</param>
  323. public void SetTrack(int index, ushort? track_)
  324. {
  325. SetFieldValue(9, index, track_, Fit.SubfieldIndexMainField);
  326. }
  327. /// <summary>
  328. ///
  329. /// </summary>
  330. /// <returns>returns number of elements in field Validity</returns>
  331. public int GetNumValidity()
  332. {
  333. return GetNumFieldValues(10, Fit.SubfieldIndexMainField);
  334. }
  335. ///<summary>
  336. /// Retrieves the Validity field</summary>
  337. /// <param name="index">0 based index of Validity element to retrieve</param>
  338. /// <returns>Returns nullable ushort representing the Validity field</returns>
  339. public ushort? GetValidity(int index)
  340. {
  341. return (ushort?)GetFieldValue(10, index, Fit.SubfieldIndexMainField);
  342. }
  343. /// <summary>
  344. /// Set Validity field</summary>
  345. /// <param name="index">0 based index of validity</param>
  346. /// <param name="validity_">Nullable field value to be set</param>
  347. public void SetValidity(int index, ushort? validity_)
  348. {
  349. SetFieldValue(10, index, validity_, Fit.SubfieldIndexMainField);
  350. }
  351. #endregion // Methods
  352. } // Class
  353. } // namespace