Sha256: 1180d5d9d28cb33555af2f40b9b6a0a1671e7067bc08a8e6921e4f42de63e430
Contents?: true
Size: 1.33 KB
Versions: 12
Compression:
Stored size: 1.33 KB
Contents
# encoding: ascii-8bit # Copyright 2014 Ball Aerospace & Technologies Corp. # All Rights Reserved. # # This program is free software; you can modify and/or redistribute it # under the terms of the GNU General Public License # as published by the Free Software Foundation; version 3 with # attribution addendums as found in the LICENSE.txt require 'cosmos' require 'cosmos/tools/data_viewer/data_viewer_component' module Cosmos # Displays packets as raw hex values class DumpComponent < DataViewerComponent # Processes the given packet. No gui interaction should be done in this # method. Override this method for other components. def process_packet (packet) processed_text = '' processed_text << '*' * 80 << "\n" processed_text << "* #{packet.target_name} #{packet.packet_name}\n" processed_text << "* Packet Time: #{packet.packet_time.formatted}\n" if packet.packet_time 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 end end
Version data entries
12 entries across 12 versions & 1 rubygems