Sha256: ef009cafaa8fa030379a5d78eeaa6cc6ae0e908da617cf4457c46991651f0b1d

Contents?: true

Size: 1.13 KB

Versions: 52

Compression:

Stored size: 1.13 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 and FormatValueWidget class.   This class
# implements a widget that formats its value before displaying it.  This can be
# used to format items differently than their format string or to format items
# that don't have a format string defined.

require 'cosmos'
require 'cosmos/tools/tlm_viewer/widgets/value_widget'

module Cosmos

  class FormatvalueWidget < ValueWidget

    def initialize (parent_layout, target_name, packet_name, item_name, format_string, value_type = :CONVERTED, characters = 12)
      super(parent_layout, target_name, packet_name, item_name, value_type, characters)
      @format_string = format_string
    end

    def value= (data)
      formatted_data = sprintf(@format_string, data)
      super(formatted_data)
    end

  end

end # module Cosmos

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
cosmos-4.3.0-java lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.3.0 lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.2.4-java lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.2.4 lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.2.3-java lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.2.3 lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.2.2-java lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.2.2 lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.2.1-java lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.2.1 lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.2.0-java lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.2.0 lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.1.1-java lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.1.1 lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.1.0-java lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.1.0 lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.0.3-java lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.0.3-universal-java-1.8 lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.0.3 lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb
cosmos-4.0.2-universal-java-1.8 lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb