WeightScaleMesg.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  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 WeightScale profile message.
  27. /// </summary>
  28. public class WeightScaleMesg : Mesg
  29. {
  30. #region Fields
  31. #endregion
  32. #region Constructors
  33. public WeightScaleMesg() : base(Profile.GetMesg(MesgNum.WeightScale))
  34. {
  35. }
  36. public WeightScaleMesg(Mesg mesg) : base(mesg)
  37. {
  38. }
  39. #endregion // Constructors
  40. #region Methods
  41. ///<summary>
  42. /// Retrieves the Timestamp field
  43. /// Units: s</summary>
  44. /// <returns>Returns DateTime representing the Timestamp field</returns>
  45. public DateTime GetTimestamp()
  46. {
  47. return TimestampToDateTime((uint?)GetFieldValue(253, 0, Fit.SubfieldIndexMainField));
  48. }
  49. /// <summary>
  50. /// Set Timestamp field
  51. /// Units: s</summary>
  52. /// <param name="timestamp_">Nullable field value to be set</param>
  53. public void SetTimestamp(DateTime timestamp_)
  54. {
  55. SetFieldValue(253, 0, timestamp_.GetTimeStamp(), Fit.SubfieldIndexMainField);
  56. }
  57. ///<summary>
  58. /// Retrieves the Weight field
  59. /// Units: kg</summary>
  60. /// <returns>Returns nullable float representing the Weight field</returns>
  61. public float? GetWeight()
  62. {
  63. return (float?)GetFieldValue(0, 0, Fit.SubfieldIndexMainField);
  64. }
  65. /// <summary>
  66. /// Set Weight field
  67. /// Units: kg</summary>
  68. /// <param name="weight_">Nullable field value to be set</param>
  69. public void SetWeight(float? weight_)
  70. {
  71. SetFieldValue(0, 0, weight_, Fit.SubfieldIndexMainField);
  72. }
  73. ///<summary>
  74. /// Retrieves the PercentFat field
  75. /// Units: %</summary>
  76. /// <returns>Returns nullable float representing the PercentFat field</returns>
  77. public float? GetPercentFat()
  78. {
  79. return (float?)GetFieldValue(1, 0, Fit.SubfieldIndexMainField);
  80. }
  81. /// <summary>
  82. /// Set PercentFat field
  83. /// Units: %</summary>
  84. /// <param name="percentFat_">Nullable field value to be set</param>
  85. public void SetPercentFat(float? percentFat_)
  86. {
  87. SetFieldValue(1, 0, percentFat_, Fit.SubfieldIndexMainField);
  88. }
  89. ///<summary>
  90. /// Retrieves the PercentHydration field
  91. /// Units: %</summary>
  92. /// <returns>Returns nullable float representing the PercentHydration field</returns>
  93. public float? GetPercentHydration()
  94. {
  95. return (float?)GetFieldValue(2, 0, Fit.SubfieldIndexMainField);
  96. }
  97. /// <summary>
  98. /// Set PercentHydration field
  99. /// Units: %</summary>
  100. /// <param name="percentHydration_">Nullable field value to be set</param>
  101. public void SetPercentHydration(float? percentHydration_)
  102. {
  103. SetFieldValue(2, 0, percentHydration_, Fit.SubfieldIndexMainField);
  104. }
  105. ///<summary>
  106. /// Retrieves the VisceralFatMass field
  107. /// Units: kg</summary>
  108. /// <returns>Returns nullable float representing the VisceralFatMass field</returns>
  109. public float? GetVisceralFatMass()
  110. {
  111. return (float?)GetFieldValue(3, 0, Fit.SubfieldIndexMainField);
  112. }
  113. /// <summary>
  114. /// Set VisceralFatMass field
  115. /// Units: kg</summary>
  116. /// <param name="visceralFatMass_">Nullable field value to be set</param>
  117. public void SetVisceralFatMass(float? visceralFatMass_)
  118. {
  119. SetFieldValue(3, 0, visceralFatMass_, Fit.SubfieldIndexMainField);
  120. }
  121. ///<summary>
  122. /// Retrieves the BoneMass field
  123. /// Units: kg</summary>
  124. /// <returns>Returns nullable float representing the BoneMass field</returns>
  125. public float? GetBoneMass()
  126. {
  127. return (float?)GetFieldValue(4, 0, Fit.SubfieldIndexMainField);
  128. }
  129. /// <summary>
  130. /// Set BoneMass field
  131. /// Units: kg</summary>
  132. /// <param name="boneMass_">Nullable field value to be set</param>
  133. public void SetBoneMass(float? boneMass_)
  134. {
  135. SetFieldValue(4, 0, boneMass_, Fit.SubfieldIndexMainField);
  136. }
  137. ///<summary>
  138. /// Retrieves the MuscleMass field
  139. /// Units: kg</summary>
  140. /// <returns>Returns nullable float representing the MuscleMass field</returns>
  141. public float? GetMuscleMass()
  142. {
  143. return (float?)GetFieldValue(5, 0, Fit.SubfieldIndexMainField);
  144. }
  145. /// <summary>
  146. /// Set MuscleMass field
  147. /// Units: kg</summary>
  148. /// <param name="muscleMass_">Nullable field value to be set</param>
  149. public void SetMuscleMass(float? muscleMass_)
  150. {
  151. SetFieldValue(5, 0, muscleMass_, Fit.SubfieldIndexMainField);
  152. }
  153. ///<summary>
  154. /// Retrieves the BasalMet field
  155. /// Units: kcal/day</summary>
  156. /// <returns>Returns nullable float representing the BasalMet field</returns>
  157. public float? GetBasalMet()
  158. {
  159. return (float?)GetFieldValue(7, 0, Fit.SubfieldIndexMainField);
  160. }
  161. /// <summary>
  162. /// Set BasalMet field
  163. /// Units: kcal/day</summary>
  164. /// <param name="basalMet_">Nullable field value to be set</param>
  165. public void SetBasalMet(float? basalMet_)
  166. {
  167. SetFieldValue(7, 0, basalMet_, Fit.SubfieldIndexMainField);
  168. }
  169. ///<summary>
  170. /// Retrieves the PhysiqueRating field</summary>
  171. /// <returns>Returns nullable byte representing the PhysiqueRating field</returns>
  172. public byte? GetPhysiqueRating()
  173. {
  174. return (byte?)GetFieldValue(8, 0, Fit.SubfieldIndexMainField);
  175. }
  176. /// <summary>
  177. /// Set PhysiqueRating field</summary>
  178. /// <param name="physiqueRating_">Nullable field value to be set</param>
  179. public void SetPhysiqueRating(byte? physiqueRating_)
  180. {
  181. SetFieldValue(8, 0, physiqueRating_, Fit.SubfieldIndexMainField);
  182. }
  183. ///<summary>
  184. /// Retrieves the ActiveMet field
  185. /// Units: kcal/day
  186. /// Comment: ~4kJ per kcal, 0.25 allows max 16384 kcal</summary>
  187. /// <returns>Returns nullable float representing the ActiveMet field</returns>
  188. public float? GetActiveMet()
  189. {
  190. return (float?)GetFieldValue(9, 0, Fit.SubfieldIndexMainField);
  191. }
  192. /// <summary>
  193. /// Set ActiveMet field
  194. /// Units: kcal/day
  195. /// Comment: ~4kJ per kcal, 0.25 allows max 16384 kcal</summary>
  196. /// <param name="activeMet_">Nullable field value to be set</param>
  197. public void SetActiveMet(float? activeMet_)
  198. {
  199. SetFieldValue(9, 0, activeMet_, Fit.SubfieldIndexMainField);
  200. }
  201. ///<summary>
  202. /// Retrieves the MetabolicAge field
  203. /// Units: years</summary>
  204. /// <returns>Returns nullable byte representing the MetabolicAge field</returns>
  205. public byte? GetMetabolicAge()
  206. {
  207. return (byte?)GetFieldValue(10, 0, Fit.SubfieldIndexMainField);
  208. }
  209. /// <summary>
  210. /// Set MetabolicAge field
  211. /// Units: years</summary>
  212. /// <param name="metabolicAge_">Nullable field value to be set</param>
  213. public void SetMetabolicAge(byte? metabolicAge_)
  214. {
  215. SetFieldValue(10, 0, metabolicAge_, Fit.SubfieldIndexMainField);
  216. }
  217. ///<summary>
  218. /// Retrieves the VisceralFatRating field</summary>
  219. /// <returns>Returns nullable byte representing the VisceralFatRating field</returns>
  220. public byte? GetVisceralFatRating()
  221. {
  222. return (byte?)GetFieldValue(11, 0, Fit.SubfieldIndexMainField);
  223. }
  224. /// <summary>
  225. /// Set VisceralFatRating field</summary>
  226. /// <param name="visceralFatRating_">Nullable field value to be set</param>
  227. public void SetVisceralFatRating(byte? visceralFatRating_)
  228. {
  229. SetFieldValue(11, 0, visceralFatRating_, Fit.SubfieldIndexMainField);
  230. }
  231. ///<summary>
  232. /// Retrieves the UserProfileIndex field
  233. /// Comment: Associates this weight scale message to a user. This corresponds to the index of the user profile message in the weight scale file.</summary>
  234. /// <returns>Returns nullable ushort representing the UserProfileIndex field</returns>
  235. public ushort? GetUserProfileIndex()
  236. {
  237. return (ushort?)GetFieldValue(12, 0, Fit.SubfieldIndexMainField);
  238. }
  239. /// <summary>
  240. /// Set UserProfileIndex field
  241. /// Comment: Associates this weight scale message to a user. This corresponds to the index of the user profile message in the weight scale file.</summary>
  242. /// <param name="userProfileIndex_">Nullable field value to be set</param>
  243. public void SetUserProfileIndex(ushort? userProfileIndex_)
  244. {
  245. SetFieldValue(12, 0, userProfileIndex_, Fit.SubfieldIndexMainField);
  246. }
  247. #endregion // Methods
  248. } // Class
  249. } // namespace