123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284 |
- #region Copyright
- ////////////////////////////////////////////////////////////////////////////////
- // The following FIT Protocol software provided may be used with FIT protocol
- // devices only and remains the copyrighted property of Dynastream Innovations Inc.
- // The software is being provided on an "as-is" basis and as an accommodation,
- // and therefore all warranties, representations, or guarantees of any kind
- // (whether express, implied or statutory) including, without limitation,
- // warranties of merchantability, non-infringement, or fitness for a particular
- // purpose, are specifically disclaimed.
- //
- // Copyright 2016 Dynastream Innovations Inc.
- ////////////////////////////////////////////////////////////////////////////////
- // ****WARNING**** This file is auto-generated! Do NOT edit this file.
- // Profile Version = 16.60Release
- // Tag = production-akw-16.60.00-0-g5d3d436
- ////////////////////////////////////////////////////////////////////////////////
- #endregion
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Text;
- using System.IO;
- namespace Dynastream.Fit
- {
- /// <summary>
- /// Implements the ThreeDSensorCalibration profile message.
- /// </summary>
- public class ThreeDSensorCalibrationMesg : Mesg
- {
- #region Fields
- static class CalibrationFactorSubfield
- {
- public static ushort AccelCalFactor = 0;
- public static ushort GyroCalFactor = 1;
- public static ushort Subfields = 2;
- public static ushort Active = Fit.SubfieldIndexActiveSubfield;
- public static ushort MainField = Fit.SubfieldIndexMainField;
- }
- #endregion
- #region Constructors
- public ThreeDSensorCalibrationMesg() : base(Profile.GetMesg(MesgNum.ThreeDSensorCalibration))
- {
- }
- public ThreeDSensorCalibrationMesg(Mesg mesg) : base(mesg)
- {
- }
- #endregion // Constructors
- #region Methods
- ///<summary>
- /// Retrieves the Timestamp field
- /// Units: s
- /// Comment: Whole second part of the timestamp</summary>
- /// <returns>Returns DateTime representing the Timestamp field</returns>
- public DateTime GetTimestamp()
- {
- return TimestampToDateTime((uint?)GetFieldValue(253, 0, Fit.SubfieldIndexMainField));
- }
-
-
- /// <summary>
- /// Set Timestamp field
- /// Units: s
- /// Comment: Whole second part of the timestamp</summary>
- /// <param name="timestamp_">Nullable field value to be set</param>
- public void SetTimestamp(DateTime timestamp_)
- {
- SetFieldValue(253, 0, timestamp_.GetTimeStamp(), Fit.SubfieldIndexMainField);
- }
-
- ///<summary>
- /// Retrieves the SensorType field
- /// Comment: Indicates which sensor the calibration is for</summary>
- /// <returns>Returns nullable SensorType enum representing the SensorType field</returns>
- public SensorType? GetSensorType()
- {
- object obj = GetFieldValue(0, 0, Fit.SubfieldIndexMainField);
- SensorType? value = obj == null ? (SensorType?)null : (SensorType)obj;
- return value;
- }
-
-
- /// <summary>
- /// Set SensorType field
- /// Comment: Indicates which sensor the calibration is for</summary>
- /// <param name="sensorType_">Nullable field value to be set</param>
- public void SetSensorType(SensorType? sensorType_)
- {
- SetFieldValue(0, 0, sensorType_, Fit.SubfieldIndexMainField);
- }
-
- ///<summary>
- /// Retrieves the CalibrationFactor field
- /// Comment: Calibration factor used to convert from raw ADC value to degrees, g, etc.</summary>
- /// <returns>Returns nullable uint representing the CalibrationFactor field</returns>
- public uint? GetCalibrationFactor()
- {
- return (uint?)GetFieldValue(1, 0, Fit.SubfieldIndexMainField);
- }
-
-
- /// <summary>
- /// Set CalibrationFactor field
- /// Comment: Calibration factor used to convert from raw ADC value to degrees, g, etc.</summary>
- /// <param name="calibrationFactor_">Nullable field value to be set</param>
- public void SetCalibrationFactor(uint? calibrationFactor_)
- {
- SetFieldValue(1, 0, calibrationFactor_, Fit.SubfieldIndexMainField);
- }
-
- /// <summary>
- /// Retrieves the AccelCalFactor subfield
- /// Units: g
- /// Comment: Accelerometer calibration factor</summary>
- /// <returns>Nullable uint representing the AccelCalFactor subfield</returns>
- public uint? GetAccelCalFactor()
- {
- return (uint?)GetFieldValue(1, 0, CalibrationFactorSubfield.AccelCalFactor);
- }
- /// <summary>
- ///
- /// Set AccelCalFactor subfield
- /// Units: g
- /// Comment: Accelerometer calibration factor</summary>
- /// <param name="accelCalFactor">Subfield value to be set</param>
- public void SetAccelCalFactor(uint? accelCalFactor)
- {
- SetFieldValue(1, 0, accelCalFactor, CalibrationFactorSubfield.AccelCalFactor);
- }
- /// <summary>
- /// Retrieves the GyroCalFactor subfield
- /// Units: deg/s
- /// Comment: Gyro calibration factor</summary>
- /// <returns>Nullable uint representing the GyroCalFactor subfield</returns>
- public uint? GetGyroCalFactor()
- {
- return (uint?)GetFieldValue(1, 0, CalibrationFactorSubfield.GyroCalFactor);
- }
- /// <summary>
- ///
- /// Set GyroCalFactor subfield
- /// Units: deg/s
- /// Comment: Gyro calibration factor</summary>
- /// <param name="gyroCalFactor">Subfield value to be set</param>
- public void SetGyroCalFactor(uint? gyroCalFactor)
- {
- SetFieldValue(1, 0, gyroCalFactor, CalibrationFactorSubfield.GyroCalFactor);
- }
- ///<summary>
- /// Retrieves the CalibrationDivisor field
- /// Units: counts
- /// Comment: Calibration factor divisor</summary>
- /// <returns>Returns nullable uint representing the CalibrationDivisor field</returns>
- public uint? GetCalibrationDivisor()
- {
- return (uint?)GetFieldValue(2, 0, Fit.SubfieldIndexMainField);
- }
-
-
- /// <summary>
- /// Set CalibrationDivisor field
- /// Units: counts
- /// Comment: Calibration factor divisor</summary>
- /// <param name="calibrationDivisor_">Nullable field value to be set</param>
- public void SetCalibrationDivisor(uint? calibrationDivisor_)
- {
- SetFieldValue(2, 0, calibrationDivisor_, Fit.SubfieldIndexMainField);
- }
-
- ///<summary>
- /// Retrieves the LevelShift field
- /// Comment: Level shift value used to shift the ADC value back into range</summary>
- /// <returns>Returns nullable uint representing the LevelShift field</returns>
- public uint? GetLevelShift()
- {
- return (uint?)GetFieldValue(3, 0, Fit.SubfieldIndexMainField);
- }
-
-
- /// <summary>
- /// Set LevelShift field
- /// Comment: Level shift value used to shift the ADC value back into range</summary>
- /// <param name="levelShift_">Nullable field value to be set</param>
- public void SetLevelShift(uint? levelShift_)
- {
- SetFieldValue(3, 0, levelShift_, Fit.SubfieldIndexMainField);
- }
-
-
- /// <summary>
- ///
- /// </summary>
- /// <returns>returns number of elements in field OffsetCal</returns>
- public int GetNumOffsetCal()
- {
- return GetNumFieldValues(4, Fit.SubfieldIndexMainField);
- }
- ///<summary>
- /// Retrieves the OffsetCal field
- /// Comment: Internal calibration factors, one for each: xy, yx, zx</summary>
- /// <param name="index">0 based index of OffsetCal element to retrieve</param>
- /// <returns>Returns nullable int representing the OffsetCal field</returns>
- public int? GetOffsetCal(int index)
- {
- return (int?)GetFieldValue(4, index, Fit.SubfieldIndexMainField);
- }
-
-
- /// <summary>
- /// Set OffsetCal field
- /// Comment: Internal calibration factors, one for each: xy, yx, zx</summary>
- /// <param name="index">0 based index of offset_cal</param>
- /// <param name="offsetCal_">Nullable field value to be set</param>
- public void SetOffsetCal(int index, int? offsetCal_)
- {
- SetFieldValue(4, index, offsetCal_, Fit.SubfieldIndexMainField);
- }
-
-
- /// <summary>
- ///
- /// </summary>
- /// <returns>returns number of elements in field OrientationMatrix</returns>
- public int GetNumOrientationMatrix()
- {
- return GetNumFieldValues(5, Fit.SubfieldIndexMainField);
- }
- ///<summary>
- /// Retrieves the OrientationMatrix field
- /// Comment: 3 x 3 rotation matrix (row major)</summary>
- /// <param name="index">0 based index of OrientationMatrix element to retrieve</param>
- /// <returns>Returns nullable float representing the OrientationMatrix field</returns>
- public float? GetOrientationMatrix(int index)
- {
- return (float?)GetFieldValue(5, index, Fit.SubfieldIndexMainField);
- }
-
-
- /// <summary>
- /// Set OrientationMatrix field
- /// Comment: 3 x 3 rotation matrix (row major)</summary>
- /// <param name="index">0 based index of orientation_matrix</param>
- /// <param name="orientationMatrix_">Nullable field value to be set</param>
- public void SetOrientationMatrix(int index, float? orientationMatrix_)
- {
- SetFieldValue(5, index, orientationMatrix_, Fit.SubfieldIndexMainField);
- }
-
- #endregion // Methods
- } // Class
- } // namespace
|