Class: Cosmos::DumpComponent
- Inherits:
-
DataViewerComponent
- Object
- Qt::Base
- Qt::Widget
- DataViewerComponent
- Cosmos::DumpComponent
- Defined in:
- lib/cosmos/tools/data_viewer/dump_component.rb
Overview
DumpComponent class
This class displays packets as raw hex values
Instance Attribute Summary
Attributes inherited from DataViewerComponent
Instance Method Summary collapse
-
#process_packet(packet) ⇒ Object
Processes the given packet.
Methods inherited from DataViewerComponent
#add_packet, #initialize, #initialize_gui, #reset, #scroll_to_bottom, #showEvent, #shutdown, #update_gui
Constructor Details
This class inherits a constructor from Cosmos::DataViewerComponent
Instance Method Details
#process_packet(packet) ⇒ Object
Processes the given packet. No gui interaction should be done in this method. Override this method for other components.
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/cosmos/tools/data_viewer/dump_component.rb', line 24 def process_packet (packet) processed_text = '' processed_text << '*' * 80 << "\n" processed_text << "* #{packet.target_name} #{packet.packet_name}\n" processed_text << "* Received Time: #{packet.received_time.formatted}\n" if packet.received_time processed_text << "* Received Count: #{packet.received_count}\n" processed_text << '*' * 80 << "\n" processed_text << packet.buffer.formatted << "\n" # Ensure that queue does not grow infinitely while paused if @processed_queue.length < 1000 @processed_queue << processed_text end end |