Class: Cosmos::ValueWidget

Inherits:
Qt::LineEdit show all
Includes:
AgingWidget, Widget
Defined in:
lib/cosmos/tools/tlm_viewer/widgets/value_widget.rb

Direct Known Subclasses

FormatvalueWidget

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 included from AgingWidget

included, #process_aging_settings, #setup_aging

Methods included from Widget

#context_menu, #get_tooltip_text, included, #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, value_type = :WITH_UNITS, characters = 12) ⇒ ValueWidget

Returns a new instance of ValueWidget.



21
22
23
24
25
26
27
28
29
# File 'lib/cosmos/tools/tlm_viewer/widgets/value_widget.rb', line 21

def initialize(parent_layout, target_name, packet_name, item_name, value_type = :WITH_UNITS, characters = 12)
  super(target_name, packet_name, item_name, value_type)
  setup_aging
  @characters = characters.to_i
  setReadOnly(true)
  setAlignment(Qt::AlignRight)
  setFixedWidth(fontMetrics.width('X') * @characters + 10)
  parent_layout.addWidget(self) if parent_layout
end

Instance Method Details

#process_settingsObject



36
37
38
39
# File 'lib/cosmos/tools/tlm_viewer/widgets/value_widget.rb', line 36

def process_settings
  super
  process_aging_settings
end

#value=(data) ⇒ Object



31
32
33
34
# File 'lib/cosmos/tools/tlm_viewer/widgets/value_widget.rb', line 31

def value=(data)
  self.text = super(data)
  setColors(@foreground, @background)
end