TrainingFileMesg.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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 TrainingFile profile message.
  27. /// </summary>
  28. public class TrainingFileMesg : Mesg
  29. {
  30. #region Fields
  31. static class ProductSubfield
  32. {
  33. public static ushort GarminProduct = 0;
  34. public static ushort Subfields = 1;
  35. public static ushort Active = Fit.SubfieldIndexActiveSubfield;
  36. public static ushort MainField = Fit.SubfieldIndexMainField;
  37. }
  38. #endregion
  39. #region Constructors
  40. public TrainingFileMesg() : base(Profile.GetMesg(MesgNum.TrainingFile))
  41. {
  42. }
  43. public TrainingFileMesg(Mesg mesg) : base(mesg)
  44. {
  45. }
  46. #endregion // Constructors
  47. #region Methods
  48. ///<summary>
  49. /// Retrieves the Timestamp field</summary>
  50. /// <returns>Returns DateTime representing the Timestamp field</returns>
  51. public DateTime GetTimestamp()
  52. {
  53. return TimestampToDateTime((uint?)GetFieldValue(253, 0, Fit.SubfieldIndexMainField));
  54. }
  55. /// <summary>
  56. /// Set Timestamp field</summary>
  57. /// <param name="timestamp_">Nullable field value to be set</param>
  58. public void SetTimestamp(DateTime timestamp_)
  59. {
  60. SetFieldValue(253, 0, timestamp_.GetTimeStamp(), Fit.SubfieldIndexMainField);
  61. }
  62. ///<summary>
  63. /// Retrieves the Type field</summary>
  64. /// <returns>Returns nullable File enum representing the Type field</returns>
  65. new public File? GetType()
  66. {
  67. object obj = GetFieldValue(0, 0, Fit.SubfieldIndexMainField);
  68. File? value = obj == null ? (File?)null : (File)obj;
  69. return value;
  70. }
  71. /// <summary>
  72. /// Set Type field</summary>
  73. /// <param name="type_">Nullable field value to be set</param>
  74. public void SetType(File? type_)
  75. {
  76. SetFieldValue(0, 0, type_, Fit.SubfieldIndexMainField);
  77. }
  78. ///<summary>
  79. /// Retrieves the Manufacturer field</summary>
  80. /// <returns>Returns nullable ushort representing the Manufacturer field</returns>
  81. public ushort? GetManufacturer()
  82. {
  83. return (ushort?)GetFieldValue(1, 0, Fit.SubfieldIndexMainField);
  84. }
  85. /// <summary>
  86. /// Set Manufacturer field</summary>
  87. /// <param name="manufacturer_">Nullable field value to be set</param>
  88. public void SetManufacturer(ushort? manufacturer_)
  89. {
  90. SetFieldValue(1, 0, manufacturer_, Fit.SubfieldIndexMainField);
  91. }
  92. ///<summary>
  93. /// Retrieves the Product field</summary>
  94. /// <returns>Returns nullable ushort representing the Product field</returns>
  95. public ushort? GetProduct()
  96. {
  97. return (ushort?)GetFieldValue(2, 0, Fit.SubfieldIndexMainField);
  98. }
  99. /// <summary>
  100. /// Set Product field</summary>
  101. /// <param name="product_">Nullable field value to be set</param>
  102. public void SetProduct(ushort? product_)
  103. {
  104. SetFieldValue(2, 0, product_, Fit.SubfieldIndexMainField);
  105. }
  106. /// <summary>
  107. /// Retrieves the GarminProduct subfield</summary>
  108. /// <returns>Nullable ushort representing the GarminProduct subfield</returns>
  109. public ushort? GetGarminProduct()
  110. {
  111. return (ushort?)GetFieldValue(2, 0, ProductSubfield.GarminProduct);
  112. }
  113. /// <summary>
  114. ///
  115. /// Set GarminProduct subfield</summary>
  116. /// <param name="garminProduct">Subfield value to be set</param>
  117. public void SetGarminProduct(ushort? garminProduct)
  118. {
  119. SetFieldValue(2, 0, garminProduct, ProductSubfield.GarminProduct);
  120. }
  121. ///<summary>
  122. /// Retrieves the SerialNumber field</summary>
  123. /// <returns>Returns nullable uint representing the SerialNumber field</returns>
  124. public uint? GetSerialNumber()
  125. {
  126. return (uint?)GetFieldValue(3, 0, Fit.SubfieldIndexMainField);
  127. }
  128. /// <summary>
  129. /// Set SerialNumber field</summary>
  130. /// <param name="serialNumber_">Nullable field value to be set</param>
  131. public void SetSerialNumber(uint? serialNumber_)
  132. {
  133. SetFieldValue(3, 0, serialNumber_, Fit.SubfieldIndexMainField);
  134. }
  135. ///<summary>
  136. /// Retrieves the TimeCreated field</summary>
  137. /// <returns>Returns DateTime representing the TimeCreated field</returns>
  138. public DateTime GetTimeCreated()
  139. {
  140. return TimestampToDateTime((uint?)GetFieldValue(4, 0, Fit.SubfieldIndexMainField));
  141. }
  142. /// <summary>
  143. /// Set TimeCreated field</summary>
  144. /// <param name="timeCreated_">Nullable field value to be set</param>
  145. public void SetTimeCreated(DateTime timeCreated_)
  146. {
  147. SetFieldValue(4, 0, timeCreated_.GetTimeStamp(), Fit.SubfieldIndexMainField);
  148. }
  149. #endregion // Methods
  150. } // Class
  151. } // namespace