Class: Cosmos::NewPacketLogProcessor

Inherits:
Processor show all
Defined in:
lib/cosmos/processors/new_packet_log_processor.rb

Instance Attribute Summary

Attributes inherited from Processor

#name, #results, #value_type

Instance Method Summary collapse

Methods inherited from Processor

#clone, #reset, #to_s

Constructor Details

#initialize(packet_log_writer_name = 'ALL') ⇒ NewPacketLogProcessor



18
19
20
21
# File 'lib/cosmos/processors/new_packet_log_processor.rb', line 18

def initialize(packet_log_writer_name = 'ALL')
  super()
  @packet_log_writer_name = packet_log_writer_name
end

Instance Method Details

#call(packet, buffer) ⇒ Object

Create a new log file

See Processor#call



26
27
28
29
30
# File 'lib/cosmos/processors/new_packet_log_processor.rb', line 26

def call(packet, buffer)
  if CmdTlmServer.instance and $0 !~ /Replay/
    CmdTlmServer.instance.start_logging(@packet_log_writer_name)
  end
end

#to_configObject

Convert to configuration file string



33
34
35
# File 'lib/cosmos/processors/new_packet_log_processor.rb', line 33

def to_config
  "  PROCESSOR #{@name} #{self.class.name.to_s.class_name_to_filename} #{@packet_log_writer_name}\n"
end