ActivityMesg.cs 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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 Activity profile message.
  27. /// </summary>
  28. public class ActivityMesg : Mesg
  29. {
  30. #region Fields
  31. #endregion
  32. #region Constructors
  33. public ActivityMesg() : base(Profile.GetMesg(MesgNum.Activity))
  34. {
  35. }
  36. public ActivityMesg(Mesg mesg) : base(mesg)
  37. {
  38. }
  39. #endregion // Constructors
  40. #region Methods
  41. ///<summary>
  42. /// Retrieves the Timestamp field</summary>
  43. /// <returns>Returns DateTime representing the Timestamp field</returns>
  44. public DateTime GetTimestamp()
  45. {
  46. return TimestampToDateTime((uint?)GetFieldValue(253, 0, Fit.SubfieldIndexMainField));
  47. }
  48. /// <summary>
  49. /// Set Timestamp field</summary>
  50. /// <param name="timestamp_">Nullable field value to be set</param>
  51. public void SetTimestamp(DateTime timestamp_)
  52. {
  53. SetFieldValue(253, 0, timestamp_.GetTimeStamp(), Fit.SubfieldIndexMainField);
  54. }
  55. ///<summary>
  56. /// Retrieves the TotalTimerTime field
  57. /// Units: s
  58. /// Comment: Exclude pauses</summary>
  59. /// <returns>Returns nullable float representing the TotalTimerTime field</returns>
  60. public float? GetTotalTimerTime()
  61. {
  62. return (float?)GetFieldValue(0, 0, Fit.SubfieldIndexMainField);
  63. }
  64. /// <summary>
  65. /// Set TotalTimerTime field
  66. /// Units: s
  67. /// Comment: Exclude pauses</summary>
  68. /// <param name="totalTimerTime_">Nullable field value to be set</param>
  69. public void SetTotalTimerTime(float? totalTimerTime_)
  70. {
  71. SetFieldValue(0, 0, totalTimerTime_, Fit.SubfieldIndexMainField);
  72. }
  73. ///<summary>
  74. /// Retrieves the NumSessions field</summary>
  75. /// <returns>Returns nullable ushort representing the NumSessions field</returns>
  76. public ushort? GetNumSessions()
  77. {
  78. return (ushort?)GetFieldValue(1, 0, Fit.SubfieldIndexMainField);
  79. }
  80. /// <summary>
  81. /// Set NumSessions field</summary>
  82. /// <param name="numSessions_">Nullable field value to be set</param>
  83. public void SetNumSessions(ushort? numSessions_)
  84. {
  85. SetFieldValue(1, 0, numSessions_, Fit.SubfieldIndexMainField);
  86. }
  87. ///<summary>
  88. /// Retrieves the Type field</summary>
  89. /// <returns>Returns nullable Activity enum representing the Type field</returns>
  90. new public Activity? GetType()
  91. {
  92. object obj = GetFieldValue(2, 0, Fit.SubfieldIndexMainField);
  93. Activity? value = obj == null ? (Activity?)null : (Activity)obj;
  94. return value;
  95. }
  96. /// <summary>
  97. /// Set Type field</summary>
  98. /// <param name="type_">Nullable field value to be set</param>
  99. public void SetType(Activity? type_)
  100. {
  101. SetFieldValue(2, 0, type_, Fit.SubfieldIndexMainField);
  102. }
  103. ///<summary>
  104. /// Retrieves the Event field</summary>
  105. /// <returns>Returns nullable Event enum representing the Event field</returns>
  106. public Event? GetEvent()
  107. {
  108. object obj = GetFieldValue(3, 0, Fit.SubfieldIndexMainField);
  109. Event? value = obj == null ? (Event?)null : (Event)obj;
  110. return value;
  111. }
  112. /// <summary>
  113. /// Set Event field</summary>
  114. /// <param name="event_">Nullable field value to be set</param>
  115. public void SetEvent(Event? event_)
  116. {
  117. SetFieldValue(3, 0, event_, Fit.SubfieldIndexMainField);
  118. }
  119. ///<summary>
  120. /// Retrieves the EventType field</summary>
  121. /// <returns>Returns nullable EventType enum representing the EventType field</returns>
  122. public EventType? GetEventType()
  123. {
  124. object obj = GetFieldValue(4, 0, Fit.SubfieldIndexMainField);
  125. EventType? value = obj == null ? (EventType?)null : (EventType)obj;
  126. return value;
  127. }
  128. /// <summary>
  129. /// Set EventType field</summary>
  130. /// <param name="eventType_">Nullable field value to be set</param>
  131. public void SetEventType(EventType? eventType_)
  132. {
  133. SetFieldValue(4, 0, eventType_, Fit.SubfieldIndexMainField);
  134. }
  135. ///<summary>
  136. /// Retrieves the LocalTimestamp field
  137. /// Comment: timestamp epoch expressed in local time, used to convert activity timestamps to local time </summary>
  138. /// <returns>Returns nullable uint representing the LocalTimestamp field</returns>
  139. public uint? GetLocalTimestamp()
  140. {
  141. return (uint?)GetFieldValue(5, 0, Fit.SubfieldIndexMainField);
  142. }
  143. /// <summary>
  144. /// Set LocalTimestamp field
  145. /// Comment: timestamp epoch expressed in local time, used to convert activity timestamps to local time </summary>
  146. /// <param name="localTimestamp_">Nullable field value to be set</param>
  147. public void SetLocalTimestamp(uint? localTimestamp_)
  148. {
  149. SetFieldValue(5, 0, localTimestamp_, Fit.SubfieldIndexMainField);
  150. }
  151. ///<summary>
  152. /// Retrieves the EventGroup field</summary>
  153. /// <returns>Returns nullable byte representing the EventGroup field</returns>
  154. public byte? GetEventGroup()
  155. {
  156. return (byte?)GetFieldValue(6, 0, Fit.SubfieldIndexMainField);
  157. }
  158. /// <summary>
  159. /// Set EventGroup field</summary>
  160. /// <param name="eventGroup_">Nullable field value to be set</param>
  161. public void SetEventGroup(byte? eventGroup_)
  162. {
  163. SetFieldValue(6, 0, eventGroup_, Fit.SubfieldIndexMainField);
  164. }
  165. #endregion // Methods
  166. } // Class
  167. } // namespace