Class: Cosmos::FormatvalueWidget

Inherits:
ValueWidget show all
Defined in:
lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb

Direct Known Subclasses

FormatfontvalueWidget

Instance Attribute Summary

Attributes included from AgingWidget

#coloring

Attributes included from Widget

#item, #item_name, #limits_set, #limits_state, #packet, #packet_name, #polling_period, #screen, #settings, #target_name, #value, #value_type

Instance Method Summary collapse

Methods inherited from ValueWidget

#process_settings

Methods included from AgingWidget

included, #process_aging_settings, #setup_aging

Methods included from Widget

#context_menu, #get_tooltip_text, included, #process_settings, #set_setting, #set_subsetting, #shutdown, #update_widget

Methods inherited from Qt::LineEdit

#setColors, #text=

Constructor Details

#initialize(parent_layout, target_name, packet_name, item_name, format_string, value_type = :CONVERTED, characters = 12) ⇒ FormatvalueWidget

Returns a new instance of FormatvalueWidget.



23
24
25
26
# File 'lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb', line 23

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

Instance Method Details

#value=(data) ⇒ Object



28
29
30
31
# File 'lib/cosmos/tools/tlm_viewer/widgets/formatvalue_widget.rb', line 28

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