Class: Cosmos::CmdTlmServerConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb

Overview

Reads an ascii file that defines the configuration settings used to configure the Command/Telemetry Server.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, system_config) ⇒ CmdTlmServerConfig

Create a default pair of packet log writers and parses the configuration file.

Parameters:

  • filename (String)

    The name of the configuration file to parse



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb', line 44

def initialize(filename, system_config)
  @system_config = system_config
  @interfaces = {}
  @routers = {}
  @packet_log_writer_pairs = {}
  # cmd_log_writer = System.default_packet_log_writer.new(:CMD, *System.default_packet_log_writer_params)
  # tlm_log_writer = System.default_packet_log_writer.new(:TLM, *System.default_packet_log_writer_params)
  # @packet_log_writer_pairs['DEFAULT'] = PacketLogWriterPair.new(cmd_log_writer, tlm_log_writer)
  @background_tasks = []
  @title = nil
  @metadata = false
  process_file(filename)
end

Instance Attribute Details

#background_tasksArray<BackgroundTask>

Returns Array of background tasks.

Returns:

  • (Array<BackgroundTask>)

    Array of background tasks



34
35
36
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb', line 34

def background_tasks
  @background_tasks
end

#interfacesHash<String, Interface>

Returns Interfaces hash.

Returns:



27
28
29
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb', line 27

def interfaces
  @interfaces
end

#metadataBoolean

Returns Flag indicating if meta data should be collected.

Returns:

  • (Boolean)

    Flag indicating if meta data should be collected



38
39
40
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb', line 38

def 
  @metadata
end

#packet_log_writer_pairsHash<String, PacketLogWriterPair>

Returns Packet log writer hash. Each pair encapsulates a command and telemetry log writer.

Returns:

  • (Hash<String, PacketLogWriterPair>)

    Packet log writer hash. Each pair encapsulates a command and telemetry log writer.



32
33
34
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb', line 32

def packet_log_writer_pairs
  @packet_log_writer_pairs
end

#routersHash<String, Interface>

Returns Routers hash.

Returns:



29
30
31
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb', line 29

def routers
  @routers
end

#titleString

Returns Command and Telemetry Server title.

Returns:

  • (String)

    Command and Telemetry Server title



36
37
38
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb', line 36

def title
  @title
end