Class: Cosmos::CmdTlmServerConfig
- 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
-
#background_tasks ⇒ Array<BackgroundTask>
Array of background tasks.
-
#interfaces ⇒ Hash<String, Interface>
Interfaces hash.
-
#metadata ⇒ Boolean
Flag indicating if meta data should be collected.
-
#packet_log_writer_pairs ⇒ Hash<String, PacketLogWriterPair>
Packet log writer hash.
-
#routers ⇒ Hash<String, Interface>
Routers hash.
-
#title ⇒ String
Command and Telemetry Server title.
Instance Method Summary collapse
-
#initialize(filename, system_config) ⇒ CmdTlmServerConfig
constructor
Create a default pair of packet log writers and parses the configuration file.
Constructor Details
#initialize(filename, system_config) ⇒ CmdTlmServerConfig
Create a default pair of packet log writers and parses the configuration file.
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_tasks ⇒ Array<BackgroundTask>
Returns 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 |
#interfaces ⇒ Hash<String, Interface>
Returns Interfaces hash.
27 28 29 |
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb', line 27 def interfaces @interfaces end |
#metadata ⇒ Boolean
Returns 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_pairs ⇒ Hash<String, PacketLogWriterPair>
Returns 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 |
#routers ⇒ Hash<String, Interface>
Returns Routers hash.
29 30 31 |
# File 'lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_config.rb', line 29 def routers @routers end |
#title ⇒ String
Returns 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 |