Class: Cosmos::SimulatedTarget
- Defined in:
- lib/cosmos/utilities/simulated_target.rb
Instance Attribute Summary collapse
-
#tlm_packets ⇒ Object
Returns the value of attribute tlm_packets.
Instance Method Summary collapse
-
#initialize(target_name) ⇒ SimulatedTarget
constructor
A new instance of SimulatedTarget.
- #read(count_100hz, time) ⇒ Object
- #set_rates ⇒ Object
- #write(packet) ⇒ Object
Constructor Details
#initialize(target_name) ⇒ SimulatedTarget
Returns a new instance of SimulatedTarget.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/cosmos/utilities/simulated_target.rb', line 26 def initialize (target_name) @tlm_packets = {} #Generate copy of telemetry packets for this target System.telemetry.packets(target_name).each do |name, packet| @tlm_packets[name] = packet.clone @tlm_packets[name].enable_method_missing end #Set id values @tlm_packets.each do |name, packet| ids = packet.id_items ids.each do |id| packet.send((id.name + '=').to_sym, id.id_value) end end @current_cycle_delta = {} end |
Instance Attribute Details
#tlm_packets ⇒ Object
Returns the value of attribute tlm_packets.
24 25 26 |
# File 'lib/cosmos/utilities/simulated_target.rb', line 24 def tlm_packets @tlm_packets end |
Instance Method Details
#read(count_100hz, time) ⇒ Object
54 55 56 |
# File 'lib/cosmos/utilities/simulated_target.rb', line 54 def read(count_100hz, time) raise "Error: read must be implemented by subclass" end |
#set_rates ⇒ Object
46 47 48 |
# File 'lib/cosmos/utilities/simulated_target.rb', line 46 def set_rates raise "Error: set_rates must be implemented by subclass" end |
#write(packet) ⇒ Object
50 51 52 |
# File 'lib/cosmos/utilities/simulated_target.rb', line 50 def write(packet) raise "Error: write must be implemented by subclass" end |