Class: Tdms::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/tdms/channel.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#data_type_idObject

Returns the value of attribute data_type_id.



4
5
6
# File 'lib/tdms/channel.rb', line 4

def data_type_id
  @data_type_id
end

#dimensionObject

Returns the value of attribute dimension.



4
5
6
# File 'lib/tdms/channel.rb', line 4

def dimension
  @dimension
end

#fileObject

Returns the value of attribute file.



4
5
6
# File 'lib/tdms/channel.rb', line 4

def file
  @file
end

#num_valuesObject

Returns the value of attribute num_values.



4
5
6
# File 'lib/tdms/channel.rb', line 4

def num_values
  @num_values
end

#pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/tdms/channel.rb', line 4

def path
  @path
end

#raw_data_posObject

Returns the value of attribute raw_data_pos.



4
5
6
# File 'lib/tdms/channel.rb', line 4

def raw_data_pos
  @raw_data_pos
end

Instance Method Details

#data_typeObject



23
24
25
# File 'lib/tdms/channel.rb', line 23

def data_type
  @data_type ||= DataType.find_by_id(data_type_id)
end

#nameObject



7
8
9
# File 'lib/tdms/channel.rb', line 7

def name
  path.channel
end

#valuesObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/tdms/channel.rb', line 11

def values
  @values ||= begin
    klass = if data_type::LengthInBytes.nil?
      StringChannelEnumerator
    else
      ChannelEnumerator
    end

    klass.new(self)
  end
end