Logo
Telescience Resource Kit
TReK Python  5.4.0 ART
PacketItem Class Reference

PacketItem is the base abstraction for data that can be added to a Packet. More...

Inherits NamedItem.

Inherited by DelimitedParameterCollection, FormatCollection, OrderedParameterCollection, Packet, ParameterCollection, and RandomPacketCollection.

Public Member Functions

Parameters

Functions handling Parameters.

def find_parameter (name: str -> Parameter ) -> def 
 Finds the specified parameter in the collection. More...
 
def get_parameter_list (full_name: bool=True, mod_only: bool=False -> List[str] ) -> def 
 Returns a list of all parameters within a collection. More...
 
def get_sorted_parameter_list (full_name: bool=True, mod_only: bool=False -> List[str] ) -> def 
 Returns a sorted list of all parameters within a collection by their start location. More...
 
Packet

Functions handling Packets.

def get_length_in_bits ( -> int ) -> def 
 Returns the length of the PacketItem in bits. More...
 
def get_length_in_bytes ( -> int ) -> def 
 Returns the length of the PacketItem in bytes. More...
 
def get_maximum_length_in_bits ( -> int ) -> def 
 Returns the maximum length of the PacketItem in bits. More...
 
def has_modifiable_data (data_zone_only: bool=True -> bool ) -> def 
 Determines if any parameter in the PacketItem is modifiable. More...
 
def has_variable_length_data ( -> bool ) -> def 
 Determines if the PacketItem has any variable length data. More...
 
def is_complete ( -> bool ) -> def 
 Determines if all parameters have a value. More...
 
def is_modifiable (top_level: bool=True -> bool ) -> def 
 Determines if any data is modifiable. More...
 
- Public Member Functions inherited from NamedItem
def remove_all_attributes ( -> None ) -> def 
 Removes all attributes.
 
def remove_attribute (name: str -> None ) -> def 
 Removes the attribute by name. More...
 
def PacketItem ( Optional[NamedItem] named_item=None -> None ) -> def 
 Class initializer. More...
 
def __eq__ (named_item: object -> bool ) -> def 
 Equality operator "==". More...
 
def copy (copy_from: object -> None ) -> def 
 Copies the contents of the provided 'copy_from' NamedItem into this NamedItem. More...
 
def initialize ( -> None ) -> def 
 Initializes the object. More...
 
def add_attribute (name: str, value: str -> None ) -> def 
 Adds an attribute to the item. More...
 
def get_alias ( -> str ) -> def 
 Returns the alias of the item. More...
 
def get_attribute (name: str -> str ) -> def 
 Get the value of the specified attribute. More...
 
def get_attribute_list ( -> list[str] ) -> def 
 Gets a list of the attribute names. More...
 
def get_name ( -> str ) -> def 
 Returns the name of the item. More...
 
def get_long_description ( -> str ) -> def 
 Returns the long description of the item. More...
 
def get_short_description ( -> str ) -> def 
 Returns the short description of the item. More...
 
def get_user_description ( -> str ) -> def 
 Returns the user description of the item. More...
 
def get_owner ( -> str ) -> def 
 Returns the owner of the item. More...
 
def get_path ( -> str ) -> def 
 Returns the path for the item. More...
 
def set_name (name: str -> None ) -> def 
 Sets the name of the item. More...
 
def set_alias (alias: str -> None ) -> def 
 Sets the alias of the item. More...
 
def set_short_description (description: str -> None ) -> def 
 Sets the short description of the item. More...
 
def set_long_description (description: str -> None ) -> def 
 Sets the long description of the item. More...
 
def set_user_description (description: str -> None ) -> def 
 Sets the user description of the item. More...
 
def set_owner (owner: str -> None ) -> def 
 Sets the owner of the item. More...
 
def set_path (path: str -> None ) -> def 
 Sets the path of the item. More...
 

Detailed Description

PacketItem is the base abstraction for data that can be added to a Packet.

Use derived classes.

Member Function Documentation

◆ find_parameter()

(name : str ) -> Parameter

Finds the specified parameter in the collection.

Returns
Parameter, if located
Exceptions
TrekError15007 - TREK_DATA_DOES_NOT_EXIST

Reimplemented in DelimitedParameterCollection, FormatCollection, OrderedParameterCollection, Packet, ParameterCollection, and RandomPacketCollection.

◆ get_length_in_bits()

() -> int

Returns the length of the PacketItem in bits.

This is an abstract method overridden in derived classes.

Reimplemented in DelimitedParameterCollection, FormatCollection, OrderedParameterCollection, Packet, ParameterCollection, and RandomPacketCollection.

◆ get_length_in_bytes()

() -> int

Returns the length of the PacketItem in bytes.

This is an abstract method overridden in derived classes.

Reimplemented in DelimitedParameterCollection, FormatCollection, OrderedParameterCollection, Packet, ParameterCollection, and RandomPacketCollection.

◆ get_maximum_length_in_bits()

() -> int

Returns the maximum length of the PacketItem in bits.

This is an abstract method overridden in derived classes.

Reimplemented in DelimitedParameterCollection, FormatCollection, OrderedParameterCollection, Packet, ParameterCollection, and RandomPacketCollection.

◆ get_parameter_list()

(full_name : bool  
mod_only : bool  
) -> List[str]

Returns a list of all parameters within a collection.

Returns
List of parameters in the collection.

Reimplemented in DelimitedParameterCollection, FormatCollection, OrderedParameterCollection, Packet, ParameterCollection, and RandomPacketCollection.

◆ get_sorted_parameter_list()

(full_name : bool  
mod_only : bool  
) -> List[str]

Returns a sorted list of all parameters within a collection by their start location.

Parameters
[in]full_nameTrue, indicates to return parameter fully qualified names.
[in]mod_onlyTrue, indicates only return modifiable parameters.

Reimplemented in DelimitedParameterCollection, FormatCollection, OrderedParameterCollection, Packet, ParameterCollection, and RandomPacketCollection.

◆ has_modifiable_data()

(data_zone_only : bool  ) -> bool

Determines if any parameter in the PacketItem is modifiable.

Parameters
[in]data_zone_onlyCurrently ignored, default True.
Returns
True, if at least one is modifiable.

Reimplemented in DelimitedParameterCollection, FormatCollection, OrderedParameterCollection, Packet, ParameterCollection, and RandomPacketCollection.

◆ has_variable_length_data()

() -> bool

Determines if the PacketItem has any variable length data.

Returns
True, if parameter has any variable length data.

Reimplemented in DelimitedParameterCollection, FormatCollection, OrderedParameterCollection, Packet, ParameterCollection, and RandomPacketCollection.

◆ is_complete()

() -> bool

Determines if all parameters have a value.

Returns
If all parameters have a value.

Reimplemented in DelimitedParameterCollection, FormatCollection, OrderedParameterCollection, Packet, ParameterCollection, and RandomPacketCollection.

◆ is_modifiable()

(top_level : bool  ) -> bool

Determines if any data is modifiable.

Parameters
[in]top_levelDesignates that this is a top level packet.
Returns
True, if at least one is modifiable.

Reimplemented in DelimitedParameterCollection, FormatCollection, OrderedParameterCollection, Packet, ParameterCollection, and RandomPacketCollection.