Class: OpenC3::TableItem
- Inherits:
-
PacketItem
- Object
- StructureItem
- PacketItem
- OpenC3::TableItem
- Defined in:
- lib/openc3/tools/table_manager/table_item.rb
Overview
Implements the attributes that are unique to a TableItem such as editable and hidden. All other functionality is inherited from PacketItem.
Constant Summary
Constants inherited from PacketItem
Instance Attribute Summary collapse
-
#editable ⇒ Boolean
Whether this item is editable.
-
#hidden ⇒ Boolean
Whether this item is hidden (not displayed).
Attributes inherited from PacketItem
#default, #description, #format_string, #hazardous, #id_value, #limits, #messages_disabled, #obfuscate, #range, #read_conversion, #required, #state_colors, #states, #units, #units_full, #write_conversion
Instance Method Summary collapse
-
#as_json(*a) ⇒ Object
Create a hash of this item’s attributes.
-
#clone ⇒ Object
(also: #dup)
Make a light weight clone of this item.
-
#initialize(name, bit_offset, bit_size, data_type, endianness, array_size = nil, overflow = :ERROR) ⇒ TableItem
constructor
Create a StructureItem by setting all the attributes.
Methods inherited from PacketItem
#calculate_range, #check_default_and_range_data_types, #meta, #meta=, #to_config
Constructor Details
#initialize(name, bit_offset, bit_size, data_type, endianness, array_size = nil, overflow = :ERROR) ⇒ TableItem
Create a StructureItem by setting all the attributes. It calls all the setter routines to do the attribute verification and then verifies the overall integrity.
It also initializes the attributes of the PacketItem.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/openc3/tools/table_manager/table_item.rb', line 31 def initialize( name, bit_offset, bit_size, data_type, endianness, array_size = nil, overflow = :ERROR ) super( name, bit_offset, bit_size, data_type, endianness, array_size, overflow, ) @display_type = nil @editable = true @hidden = false end |
Instance Attribute Details
#editable ⇒ Boolean
Returns Whether this item is editable.
25 26 27 |
# File 'lib/openc3/tools/table_manager/table_item.rb', line 25 def editable @editable end |
#hidden ⇒ Boolean
Returns Whether this item is hidden (not displayed).
28 29 30 |
# File 'lib/openc3/tools/table_manager/table_item.rb', line 28 def hidden @hidden end |
Instance Method Details
#as_json(*a) ⇒ Object
Create a hash of this item’s attributes
81 82 83 84 85 86 |
# File 'lib/openc3/tools/table_manager/table_item.rb', line 81 def as_json(*a) hash = super() hash['editable'] = self.editable hash['hidden'] = self.hidden hash end |
#clone ⇒ Object Also known as: dup
Make a light weight clone of this item
73 74 75 76 77 |
# File 'lib/openc3/tools/table_manager/table_item.rb', line 73 def clone item = super() item.editable = self.editable item end |