Module: F4R::GlobalFit

Defined in:
lib/f4r.rb

Overview

Provides the FIT SDK global definition for all objects. Sometimes more information is needed in order to be able to decode FIT files so definitions for these undocumented messages and types (based on guesses ) is also provided.

Defined Under Namespace

Classes: Helper

Class Method Summary collapse

Class Method Details

.base_typesArray<Hash>

Type definitions provide a FIT to F4R (BinData) type conversion table.

Returns:

  • (Array<Hash>)

    data types.



443
444
445
# File 'lib/f4r.rb', line 443

def self.base_types
  @@base_types ||= Helper.new.get_base_types.freeze
end

.messagesArray<Hash>

Collection of defined (FIT SDK) and undefined (F4R) messages.

Message fields without field_def (e.i., field’s number/id within the message) which usually mean that they are either sub-fields or not defined properly (e.i., invalid) get filtered out. Results come from F4R::GlobalFit::Helper#get_messages.

Examples:

GlobalFit.messages

[
  {
    :name=>"file_id",
    :number=>0,
    :fields=> [...]
  },
  {
    :name=>"file_creator",
    :number=>49,
    :fields=> [...]
  }
  ...
]

Returns:

  • (Array<Hash>)

    of FIT messages



397
398
399
# File 'lib/f4r.rb', line 397

def self.messages
  @@messages ||= Helper.new.get_messages.freeze
end

.typesHash

Collection of defined (FIT SDK) and undefined (F4R) types. Results come from F4R::GlobalFit::Helper#get_types.

Examples:

GlobalFit.types

{
  file:
  {
    base_type: :enum,
    values: [
      {value_name: "device",
      value: 1,
      comment: "Read only, single file. Must be in root directory."},
      {
        value_name: "settings",
        value: 2,
        comment: "Read/write, single file. Directory=Settings"},
      ...
    ]
  },
  tissue_model_type:
  {
    base_type: :enum,
    values: [
      {
        value_name: "zhl_16c",
        value: 0,
        comment: "Buhlmann's decompression algorithm, version C"}]},
  ...
}

Returns:

  • (Hash)

    Fit Profile types.



434
435
436
# File 'lib/f4r.rb', line 434

def self.types
  @@types ||= Helper.new.get_types.freeze
end