Class: Cosmos::TlmGrapher
- Inherits:
-
TabbedPlotsTool
- Object
- Qt::MainWindow
- QtTool
- TabbedPlotsTool
- Cosmos::TlmGrapher
- Defined in:
- lib/cosmos/tools/tlm_grapher/tlm_grapher.rb
Overview
TlmGrapher class
This class implements the TlmGrapher Application. This application displays multiple line graphs that perform various analysis on housekeeping telemetry.
Constant Summary
Constants inherited from TabbedPlotsTool
Cosmos::TabbedPlotsTool::DEFAULT_LEFT_PANEL_WIDTH, Cosmos::TabbedPlotsTool::MINIMUM_LEFT_PANEL_WIDTH
Class Method Summary collapse
-
.run(opts = nil, options = nil) ⇒ Object
Runs the application.
Instance Method Summary collapse
- #closeEvent(event) ⇒ Object
-
#handle_items ⇒ Object
Handles items being passed in as command line arguments.
Methods inherited from TabbedPlotsTool
#initialize, #initialize_actions, #initialize_central_widget, #initialize_menus
Methods inherited from QtTool
#about, #complete_initialize, create_default_options, graceful_kill, #initialize, #initialize_actions, #initialize_help_menu, post_options_parsed_hook, pre_window_new_hook, redirect_io, restore_io
Constructor Details
This class inherits a constructor from Cosmos::TabbedPlotsTool
Class Method Details
.run(opts = nil, options = nil) ⇒ Object
Runs the application
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/cosmos/tools/tlm_grapher/tlm_grapher.rb', line 27 def self.run (opts = nil, = nil) Cosmos.catch_fatal_exception do unless opts, = () .auto_size = false .width = 1000 .height = 800 .title = "Telemetry Grapher" .config_dir = 'tlm_grapher' .config_file = 'tlm_grapher.txt' .tool_short_name = 'tlmgrapher' .tabbed_plots_type = 'overview' .data_object_types = ['HOUSEKEEPING', 'XY','SINGLEXY'] .plot_types = ['LINEGRAPH', 'XY','SINGLEXY'] .plot_type_to_data_object_type_mapping = {'LINEGRAPH' => ['HOUSEKEEPING'], 'XY' => ['XY'], 'SINGLEXY' => ['SINGLEXY']} .adder_types = ['HOUSEKEEPING'] .adder_orientation = Qt::Horizontal .items = [] .start = false .about_string = "TlmGrapher provides realtime and log file graphing abilities to the COSMOS system." opts.separator "Telemetry Grapher Specific Options:" opts.on("-c", "--config FILE", "Use the specified configuration file") do |arg| .config_file = arg end opts.on("-s", "--start", "Start graphing immediately") do |arg| .start = true end opts.on("-i", "--item 'TARGET_NAME PACKET_NAME ITEM_NAME'", "Start graphing the specified item (ignores config file)") do |arg| split = arg.split if split.length != 3 puts "Items must be specified as 'TARGET_NAME PACKET_NAME ITEM_NAME' in quotes" exit end .items << split end end super(opts, ) end end |
Instance Method Details
#closeEvent(event) ⇒ Object
69 70 71 |
# File 'lib/cosmos/tools/tlm_grapher/tlm_grapher.rb', line 69 def closeEvent(event) super(event) end |
#handle_items ⇒ Object
Handles items being passed in as command line arguments
74 75 76 77 78 79 80 81 82 83 |
# File 'lib/cosmos/tools/tlm_grapher/tlm_grapher.rb', line 74 def handle_items plot_index = 0 @items.each do |target_name, packet_name, item_name| # Default configuration has one plot so don't add plot for first item data_object = HousekeepingDataObject.new data_object.set_item(target_name, packet_name, item_name) @tabbed_plots_config.add_data_object(0, 0, data_object) plot_index += 1 end end |