Sha256: a7ba2d335bf1f66cd99582faeb1a5c6f82609522e635bed5706b25bbcfacb564

Contents?: true

Size: 1.56 KB

Versions: 25

Compression:

Stored size: 1.56 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

# This file contains the implementation of the SinglexyDataObjectAdder
# This provides a quick way to add single x-y data objects.

require 'cosmos'
require 'cosmos/tools/tlm_grapher/data_object_adders/xy_data_object_adder'
require 'cosmos/tools/tlm_grapher/data_objects/singlexy_data_object'

module Cosmos

  # Widget for adding a single X-Y data object to a plot
  class SinglexyDataObjectAdder < XyDataObjectAdder

    # @parent [Qt::Widget] Parent widget to hold this frame
    # @orientation [Integer] How to layout the frame.
    #   Must be Qt::Horizontal or Qt::Vertical.
    def initialize(parent, orientation = Qt::Horizontal)
      super(parent, orientation)
      @add_data_object_button.text = 'Add Single-XY Data Object'
    end

    # Adds a data object when the add button is pressed
    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

  end # class SinglexyDataObjectAdder

end # module Cosmos

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
cosmos-3.8.3 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.8.2 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.8.1 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.8.0 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.7.1 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.7.0 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.6.3 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.6.2 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.6.1 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.6.0 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.5.3 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.5.2 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.5.0 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.4.2 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.4.1 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.4.0 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.3.3 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.3.2 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.3.1 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb
cosmos-3.3.0 lib/cosmos/tools/tlm_grapher/data_object_adders/singlexy_data_object_adder.rb