Class: Cosmos::NewPacketLogConversion
- Inherits:
-
Conversion
- Object
- Conversion
- Cosmos::NewPacketLogConversion
- Defined in:
- lib/cosmos/conversions/new_packet_log_conversion.rb
Overview
Creates new packet logs whenever it executes
Instance Attribute Summary
Attributes inherited from Conversion
#converted_bit_size, #converted_type
Instance Method Summary collapse
-
#call(value, packet, buffer) ⇒ Varies
The value given.
-
#initialize(packet_log_writer_name = 'ALL') ⇒ NewPacketLogConversion
constructor
Initializes converted_type to :FLOAT and converted_bit_size to 64.
-
#to_s ⇒ String
The name of the class and the associated packet log writer name.
Constructor Details
#initialize(packet_log_writer_name = 'ALL') ⇒ NewPacketLogConversion
Initializes converted_type to :FLOAT and converted_bit_size to 64
23 24 25 |
# File 'lib/cosmos/conversions/new_packet_log_conversion.rb', line 23 def initialize(packet_log_writer_name = 'ALL') @packet_log_writer_name = packet_log_writer_name end |
Instance Method Details
#call(value, packet, buffer) ⇒ Varies
Returns The value given.
29 30 31 32 33 34 |
# File 'lib/cosmos/conversions/new_packet_log_conversion.rb', line 29 def call(value, packet, buffer) if CmdTlmServer.instance and CmdTlmServer.packet_logging CmdTlmServer.instance.start_logging(@packet_log_writer_name) end value end |
#to_s ⇒ String
Returns The name of the class and the associated packet log writer name.
37 38 39 40 41 |
# File 'lib/cosmos/conversions/new_packet_log_conversion.rb', line 37 def to_s result = super() result << " (#{@packet_log_writer_name})" result end |