Sha256: cdf6167a6c17f42f9a107299ec69810bb82c02cc0c0b8d8499acf3c722f09ef4

Contents?: true

Size: 1.46 KB

Versions: 12

Compression:

Stored size: 1.46 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/tools/tlm_viewer/widgets/widget'
require 'cosmos/tools/tlm_viewer/widgets/multi_widget'
require 'cosmos/tools/tlm_viewer/widgets/label_widget'
require 'cosmos/tools/tlm_viewer/widgets/value_widget'

module Cosmos
  # Displays a LabelWidget which contains the item's description (instead of its name)
  # followed by a ValueWidget
  class LabelvaluedescWidget < Qt::Widget
    include Widget
    include MultiWidget

    def initialize(parent_layout, target_name, packet_name, item_name, description = "", value_type = :WITH_UNITS, characters = 12)
      super(target_name, packet_name, item_name, value_type)
      setLayout(Qt::HBoxLayout.new)
      layout.setSpacing(5)
      layout.setContentsMargins(0,0,0,0)
      description = ConfigParser.handle_nil(description)
      description = @item.description unless description
      @widgets << LabelWidget.new(layout, description.to_s)
      layout.addStretch(1)
      @widgets << ValueWidget.new(layout, target_name, packet_name, item_name, value_type, characters)
      parent_layout.addWidget(self) if parent_layout
    end

    def self.takes_value?
      return true
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cosmos-4.5.2-java lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb
cosmos-4.5.2 lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb
cosmos-4.5.1-java lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb
cosmos-4.5.1 lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb
cosmos-4.5.0-java lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb
cosmos-4.5.0 lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb
cosmos-4.4.2-java lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb
cosmos-4.4.2 lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb
cosmos-4.4.1-java lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb
cosmos-4.4.1 lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb
cosmos-4.4.0-java lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb
cosmos-4.4.0 lib/cosmos/tools/tlm_viewer/widgets/labelvaluedesc_widget.rb