CoursePointMesg.cs 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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 CoursePoint profile message.
  27. /// </summary>
  28. public class CoursePointMesg : Mesg
  29. {
  30. #region Fields
  31. #endregion
  32. #region Constructors
  33. public CoursePointMesg() : base(Profile.GetMesg(MesgNum.CoursePoint))
  34. {
  35. }
  36. public CoursePointMesg(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(1, 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(1, 0, timestamp_.GetTimeStamp(), Fit.SubfieldIndexMainField);
  68. }
  69. ///<summary>
  70. /// Retrieves the PositionLat field
  71. /// Units: semicircles</summary>
  72. /// <returns>Returns nullable int representing the PositionLat field</returns>
  73. public int? GetPositionLat()
  74. {
  75. return (int?)GetFieldValue(2, 0, Fit.SubfieldIndexMainField);
  76. }
  77. /// <summary>
  78. /// Set PositionLat field
  79. /// Units: semicircles</summary>
  80. /// <param name="positionLat_">Nullable field value to be set</param>
  81. public void SetPositionLat(int? positionLat_)
  82. {
  83. SetFieldValue(2, 0, positionLat_, Fit.SubfieldIndexMainField);
  84. }
  85. ///<summary>
  86. /// Retrieves the PositionLong field
  87. /// Units: semicircles</summary>
  88. /// <returns>Returns nullable int representing the PositionLong field</returns>
  89. public int? GetPositionLong()
  90. {
  91. return (int?)GetFieldValue(3, 0, Fit.SubfieldIndexMainField);
  92. }
  93. /// <summary>
  94. /// Set PositionLong field
  95. /// Units: semicircles</summary>
  96. /// <param name="positionLong_">Nullable field value to be set</param>
  97. public void SetPositionLong(int? positionLong_)
  98. {
  99. SetFieldValue(3, 0, positionLong_, Fit.SubfieldIndexMainField);
  100. }
  101. ///<summary>
  102. /// Retrieves the Distance field
  103. /// Units: m</summary>
  104. /// <returns>Returns nullable float representing the Distance field</returns>
  105. public float? GetDistance()
  106. {
  107. return (float?)GetFieldValue(4, 0, Fit.SubfieldIndexMainField);
  108. }
  109. /// <summary>
  110. /// Set Distance field
  111. /// Units: m</summary>
  112. /// <param name="distance_">Nullable field value to be set</param>
  113. public void SetDistance(float? distance_)
  114. {
  115. SetFieldValue(4, 0, distance_, Fit.SubfieldIndexMainField);
  116. }
  117. ///<summary>
  118. /// Retrieves the Type field</summary>
  119. /// <returns>Returns nullable CoursePoint enum representing the Type field</returns>
  120. new public CoursePoint? GetType()
  121. {
  122. object obj = GetFieldValue(5, 0, Fit.SubfieldIndexMainField);
  123. CoursePoint? value = obj == null ? (CoursePoint?)null : (CoursePoint)obj;
  124. return value;
  125. }
  126. /// <summary>
  127. /// Set Type field</summary>
  128. /// <param name="type_">Nullable field value to be set</param>
  129. public void SetType(CoursePoint? type_)
  130. {
  131. SetFieldValue(5, 0, type_, Fit.SubfieldIndexMainField);
  132. }
  133. ///<summary>
  134. /// Retrieves the Name field</summary>
  135. /// <returns>Returns byte[] representing the Name field</returns>
  136. public byte[] GetName()
  137. {
  138. return (byte[])GetFieldValue(6, 0, Fit.SubfieldIndexMainField);
  139. }
  140. ///<summary>
  141. /// Retrieves the Name field</summary>
  142. /// <returns>Returns String representing the Name field</returns>
  143. public String GetNameAsString()
  144. {
  145. return Encoding.UTF8.GetString((byte[])GetFieldValue(6, 0, Fit.SubfieldIndexMainField));
  146. }
  147. ///<summary>
  148. /// Set Name field</summary>
  149. /// <param name="name_"> field value to be set</param>
  150. public void SetName(String name_)
  151. {
  152. SetFieldValue(6, 0, System.Text.Encoding.UTF8.GetBytes(name_), Fit.SubfieldIndexMainField);
  153. }
  154. /// <summary>
  155. /// Set Name field</summary>
  156. /// <param name="name_">field value to be set</param>
  157. public void SetName(byte[] name_)
  158. {
  159. SetFieldValue(6, 0, name_, Fit.SubfieldIndexMainField);
  160. }
  161. ///<summary>
  162. /// Retrieves the Favorite field</summary>
  163. /// <returns>Returns nullable Bool enum representing the Favorite field</returns>
  164. public Bool? GetFavorite()
  165. {
  166. object obj = GetFieldValue(8, 0, Fit.SubfieldIndexMainField);
  167. Bool? value = obj == null ? (Bool?)null : (Bool)obj;
  168. return value;
  169. }
  170. /// <summary>
  171. /// Set Favorite field</summary>
  172. /// <param name="favorite_">Nullable field value to be set</param>
  173. public void SetFavorite(Bool? favorite_)
  174. {
  175. SetFieldValue(8, 0, favorite_, Fit.SubfieldIndexMainField);
  176. }
  177. #endregion // Methods
  178. } // Class
  179. } // namespace