Cisco Packet Tracer Extensions API 8.1.0
API for communication between Cisco Packet Tracer application and its extension applications and modules.
Public Member Functions | List of all members
ModuleDescriptor Class Reference

Descriptor for modules. Used to create a module based on the stored information. More...

Public Member Functions

ModuleType getType ()
 Returns the type of the module descriptor. More...
 
string getModel ()
 Returns type name of the module.. More...
 
void setImagePath (string)
 Sets the image path to the image to use for the module. More...
 
string getImagePath ()
 Gets the image path to the image to use for the module. More...
 
void setInfo (QString)
 Sets the text to display when in module view and the module is selected. More...
 
QString getInfo ()
 Gets the text to display when in module view and the module is selected. More...
 
void setGroup (QString)
 Sets the group the module is considered a part of. More...
 
QString getGroup ()
 Gets the group the module is considered a part of. More...
 
void addSlot (ModuleType)
 Adds the given module type to the module descriptor. Doing this allows the module type to be added to the module created from the descriptor. More...
 
int getSlotCount ()
 Returns the number of slots in the descriptor. More...
 
ModuleType getSlotTypeAt (int)
 Returns the module type of the given slot index. More...
 
bool addModuleAt (ModuleDescriptor, int)
 Adds the module descriptor to the given slot index, if possible. More...
 
void removeModuleAt (int)
 Removes the module descriptor to the given module index. More...
 
int getModuleCount ()
 Returns the number of module descriptions stored. More...
 
ModuleDescriptor getModuleAt (int)
 Returns module description at the given index. More...
 
void setHotSwappable (bool)
 Set if the module is hot swappable (able to be removed and added while the device is powered on). More...
 
bool isHotSwappable ()
 Get if the module is hot swappable (able to be removed and added while the device is powered on). More...
 
ModulePhysicalView addModulePhysicalView (int, int, int, int)
 Add a display area to the descriptor. More...
 
int getModulePhysicalViewCount ()
 Get the number of display areas in the module. More...
 
ModulePhysicalView getModulePhysicalViewAt (int)
 Get the display area at the given index. More...
 
Module create ()
 Create a module using the descriptor. More...
 

Detailed Description

Descriptor for modules. Used to create a module based on the stored information.

Member Function Documentation

◆ addModuleAt()

bool ModuleDescriptor::addModuleAt ( ModuleDescriptor  ,
int   
)

Adds the module descriptor to the given slot index, if possible.

Parameters
index,indexto try to store the module descriptor at.
Returns
bool, value is true if the module descriptor was stored, false if not.

◆ addModulePhysicalView()

ModulePhysicalView ModuleDescriptor::addModulePhysicalView ( int  ,
int  ,
int  ,
int   
)

Add a display area to the descriptor.

Parameters
X1,leftx.
X2,rightx.
Y1,topy.
Y2,bottomy.

◆ addSlot()

void ModuleDescriptor::addSlot ( ModuleType  )

Adds the given module type to the module descriptor. Doing this allows the module type to be added to the module created from the descriptor.

Parameters
type,moduletype to add.

◆ create()

Module ModuleDescriptor::create ( )

Create a module using the descriptor.

Returns
Module, module created using the descriptor.

◆ getGroup()

QString ModuleDescriptor::getGroup ( )

Gets the group the module is considered a part of.

Returns
QString, Some modules use this and most don't. The ones that do can be "SENSORS" or "ACTUATORS".

◆ getImagePath()

string ModuleDescriptor::getImagePath ( )

Gets the image path to the image to use for the module.

Returns
string, path of the image to use. Something like "../art/PhysicalView/gModuleNM-4AS.xpm"

◆ getInfo()

QString ModuleDescriptor::getInfo ( )

Gets the text to display when in module view and the module is selected.

Returns
QString, text that is displayed explaining the module.

◆ getModel()

string ModuleDescriptor::getModel ( )

Returns type name of the module..

Returns
string, type name of the model. Something like "NM-2W".

◆ getModuleAt()

ModuleDescriptor ModuleDescriptor::getModuleAt ( int  )

Returns module description at the given index.

Parameters
index,indexto retrive the description from. Range (0, getModuleCount()-1).
Returns
ModuleDescriptor, the module description at the given index.

◆ getModuleCount()

int ModuleDescriptor::getModuleCount ( )

Returns the number of module descriptions stored.

Returns
int, the number of module descriptions stored.

◆ getModulePhysicalViewAt()

ModulePhysicalView ModuleDescriptor::getModulePhysicalViewAt ( int  )

Get the display area at the given index.

Parameters
index,indexof the display area to retrive.

return ModulePhysicalView, display area at the given index.

◆ getModulePhysicalViewCount()

int ModuleDescriptor::getModulePhysicalViewCount ( )

Get the number of display areas in the module.

Returns
int, the number of display areas in the module descriptor.

◆ getSlotCount()

int ModuleDescriptor::getSlotCount ( )

Returns the number of slots in the descriptor.

Returns
int, the number of slots in the descriptor.

◆ getSlotTypeAt()

ModuleType ModuleDescriptor::getSlotTypeAt ( int  )

Returns the module type of the given slot index.

Parameters
index,slotindex to get the module type for.
Returns
ModuleType, the module type of the given slot index.

◆ getType()

ModuleType ModuleDescriptor::getType ( )

Returns the type of the module descriptor.

Returns
enum<ModuleType>, the number of the module. Types: eLineCard = 0, eNetworkModule = 1, eInterfaceCard = 2, ePtRouterModule = 3, ePtSwitchModule = 4, ePtCloudModule = 5, ePtRepeaterModule = 6, ePtHostModule = 7,
ePtModemModule = 8, ePtLaptopModule = 9, ePtTVModule = 10, eIpPhonePowerAdapter = 11, ePtTabletPCModule = 12, ePtPdaModule = 13, ePtWirelessEndDeviceModule = 14, ePtWiredEndDeviceModule = 15, eTrs35 = 16, eUsb = 17, eNonRemovableModule = 18, eASAModule = 19, eASAPowerAdapter = 20, ePtCellTowerModule = 21, ePtIoeModule = 22, ePtIoeNetworkModule = 23, ePtIoeAnalogModule = 24, ePtIoeDigitalModule = 25, ePtIoeCustomIOModule = 26, ePtIoePowerAdapter = 27, ePtIoeMcuComponentPowerAdapter = 28, ePtRouterPowerAdapter = 29, eSfpModule = 30, eAccessPointPowerAdaptor = 31, eNonRemovableInterfaceCard = 32, eCustomModuleType = 2000

◆ isHotSwappable()

bool ModuleDescriptor::isHotSwappable ( )

Get if the module is hot swappable (able to be removed and added while the device is powered on).

Returns
bool, true if the module can be added and removed while the device is powered on, false if not.

◆ removeModuleAt()

void ModuleDescriptor::removeModuleAt ( int  )

Removes the module descriptor to the given module index.

Parameters
index,indexto try to remove the module descriptor from. Range (0, getModuleCount()-1).

◆ setGroup()

void ModuleDescriptor::setGroup ( QString  )

Sets the group the module is considered a part of.

Parameters
group,Somemodules use this and most don't. The ones that do can be "SENSORS" or "ACTUATORS".

◆ setHotSwappable()

void ModuleDescriptor::setHotSwappable ( bool  )

Set if the module is hot swappable (able to be removed and added while the device is powered on).

Parameters
bHot,trueif the module can be added and removed while the device is powered on, false if not.

◆ setImagePath()

void ModuleDescriptor::setImagePath ( string  )

Sets the image path to the image to use for the module.

Parameters
path,pathof the image to use. Something like "../art/PhysicalView/gModuleNM-4AS.xpm"

◆ setInfo()

void ModuleDescriptor::setInfo ( QString  )

Sets the text to display when in module view and the module is selected.

Parameters
strInfo,textto display explaining the module.

The documentation for this class was generated from the following file: