Class: Cosmos::SinglexyDataObjectAdder

Inherits:
XyDataObjectAdder show all
Defined in:
lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb

Overview

Widget for adding a single X-Y data object to a plot

Instance Attribute Summary

Attributes inherited from XyDataObjectAdder

#add_data_object_callback

Instance Method Summary collapse

Methods inherited from XyDataObjectAdder

#update

Constructor Details

#initialize(parent, orientation = Qt::Horizontal) ⇒ SinglexyDataObjectAdder

Returns a new instance of SinglexyDataObjectAdder.



26
27
28
29
# File 'lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb', line 26

def initialize(parent, orientation = Qt::Horizontal)
  super(parent, orientation)
  @add_data_object_button.text = 'Add Single-XY Data Object'
end

Instance Method Details

#add_data_objectObject

Adds a data object when the add button is pressed



32
33
34
35
36
37
38
39
40
# File 'lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb', line 32

def add_data_object
  data_object = SinglexyDataObject.new
  data_object.target_name = @telemetry_chooser.target_name
  data_object.packet_name = @telemetry_chooser.packet_name
  data_object.y_item_name = @telemetry_chooser.item_name
  data_object.x_item_name = @x_item_name.string

  @add_data_object_callback.call(data_object) if @add_data_object_callback
end