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
Workspace Class Reference

Workspace is the base class for Logical and Physical workspace related objects. More...

Public Member Functions

bool isLogicalView ()
 Returns true if the Logical workspace is currently visible, otherwise false. More...
 
bool isGeoView ()
 Returns true if the Physical workspace is currently visible, otherwise false. More...
 
bool isRackView ()
 Returns true if the wiring closet is currently visible, otherwise false. More...
 
LogicalWorkspace getLogicalWorkspace ()
 Returns the Logical workspace. More...
 
GeoView getGeoView ()
 Returns the Physical workspace. More...
 
RackView getRackView ()
 Returns the wiring closet. More...
 
PhysicalObject getRootPhysicalObject ()
 
PhysicalObject getCurrentPhysicalObject ()
 Returns the current physical location. More...
 
bool switchToPhysicalObject (PhysicalObject)
 Switch to the new physical location. More...
 
void physicalObjectAdded (PhysicalObject)
 This event is emitted when a new Physical object(container, building, closet...) is added. More...
 
void physicalObjectRemoved (uuid)
 This event is emitted when a Physical object(container, building, closet...) is removed. More...
 
void physicalObjectMoved (PhysicalObject, uuid, PhysicalObject)
 This event is emitted when a Physical object(container, building, closet...) is moved. More...
 
void currentPhysicalObjectChanged (PhysicalObject, PhysicalObject)
 This event is emitted when a Physical object(container, building, closet...) is changed. More...
 
void setLogicalBackgroundPath (QString, bool)
 Sets the background image of the logical workspace. More...
 
vector< QString > devicesAt (int, int, int, int, bool)
 Returns a list of devices within a rectangle with specified with and height right of the specified location. More...
 
void setComponentOpacity (QString, QString, double)
 Set the opacity for a component. More...
 
void fillColor (QString, QString, int, int, int)
 Fill the component with a specified color. More...
 
void setComponentRotation (QString, QString, double)
 Set the rotation for a component. More...
 
void setThingRotation (QString, double)
 Set the rotation for a thing. More...
 
void setThingCustomText (QString, int, int, int, int, QString)
 Set the custom text for Thing at a location. More...
 
bool hasProperty (QString)
 Check if the a property is defined. More...
 
QString getProperty (QString)
 Return the property value. More...
 
void setProperty (QString, QString)
 Set the property value. More...
 
vector< QString > getProperties ()
 Return a list of properties defined. More...
 
void pauseEnvironmentTime ()
 Pause the Environemnt time. More...
 
void resumeEnvironmentTime ()
 Resume the Environemnt time. More...
 
int getEnvironmentTimeInSeconds ()
 Get Environment time in seconds. More...
 
void resetEnvironment ()
 Reset the Environemnt time. More...
 
void setParentGraphicFromComponent (QString, QString, int, bool, bool)
 Set parent graphic from component. More...
 
bool moveItemInWorkspace (QString, int, int)
 Move item in workspace to a new location. More...
 
void setBaseZLevel (QString, float)
 Sets the base z level, which is the current z level plus the base level. More...
 
float getZLevel (QString)
 Returns the current z level. More...
 
void setVisible (bool)
 
void zoomIn ()
 Zooms into the workspace. More...
 
void zoomOut ()
 Zooms out of the workspace. More...
 
void zoomReset ()
 Resets the zoom scale of the workspace. More...
 
void deviceTypeSelected (QString, DeviceDescriptor, bool)
 This event is emitted when a device or cable is selected from the network component box or cable pegboard. More...
 
void deviceTypeDeselected ()
 This event is emitted when a device or cable is deselected from the network component box (via clicking on the cancel button) or when a cable is deselected from a cable pegboard. More...
 

Detailed Description

Workspace is the base class for Logical and Physical workspace related objects.

Member Function Documentation

◆ currentPhysicalObjectChanged()

void Workspace::currentPhysicalObjectChanged ( PhysicalObject  ,
PhysicalObject   
)

This event is emitted when a Physical object(container, building, closet...) is changed.

  • newObject, the new Physical object

IPC event.

◆ devicesAt()

vector< QString > Workspace::devicesAt ( int  ,
int  ,
int  ,
int  ,
bool   
)

Returns a list of devices within a rectangle with specified with and height right of the specified location.

Parameters
x,xcoordinate of the specified location
y,ycoordinate of the specified location
w,widthof the rectangle that contains the devices to be included
h,heightof the rectangle that contains the devices to be included
includeClusters,trueif including devices inside the cluster and false if not including
Returns
vector<QString> of device names

◆ deviceTypeDeselected()

void Workspace::deviceTypeDeselected ( )

This event is emitted when a device or cable is deselected from the network component box (via clicking on the cancel button) or when a cable is deselected from a cable pegboard.

IPC event.

◆ deviceTypeSelected()

void Workspace::deviceTypeSelected ( QString  ,
DeviceDescriptor  ,
bool   
)

This event is emitted when a device or cable is selected from the network component box or cable pegboard.

  • str, represents the device type or cable type
  • bType, true if the state of the workspace is sAddDevices, false if the state is sAddDevice

IPC event.

◆ fillColor()

void Workspace::fillColor ( QString  ,
QString  ,
int  ,
int  ,
int   
)

Fill the component with a specified color.

Parameters
deviceName,devicename
componentName,componentname
red,therbg red value
green,therbg green value
blue,therbg blue value
Returns
none

◆ getCurrentPhysicalObject()

PhysicalObject Workspace::getCurrentPhysicalObject ( )

Returns the current physical location.

Returns
PhysicalObject, the PhysicalObject object.

◆ getEnvironmentTimeInSeconds()

int Workspace::getEnvironmentTimeInSeconds ( )

Get Environment time in seconds.

Returns
int, time in seconds

◆ getGeoView()

GeoView Workspace::getGeoView ( )

Returns the Physical workspace.

Returns
GeoView, the GeoView object.

◆ getLogicalWorkspace()

LogicalWorkspace Workspace::getLogicalWorkspace ( )

Returns the Logical workspace.

Returns
LogicalWorkspace, the Logical object.

◆ getProperties()

vector< QString > Workspace::getProperties ( )

Return a list of properties defined.

Returns
vector<QString>, list of property names

◆ getProperty()

QString Workspace::getProperty ( QString  )

Return the property value.

Parameters
prop,propertyname
Returns
QString, property value

◆ getRackView()

RackView Workspace::getRackView ( )

Returns the wiring closet.

Returns
RackView, the RackView object.

◆ getRootPhysicalObject()

PhysicalObject Workspace::getRootPhysicalObject ( )

Returns the root/top item in the physical workspace location tree

◆ getZLevel()

float Workspace::getZLevel ( QString  )

Returns the current z level.

Returns
none

◆ hasProperty()

bool Workspace::hasProperty ( QString  )

Check if the a property is defined.

Parameters
prop,propertyname
Returns
bool, true if it contains the property and false if not

◆ isGeoView()

bool Workspace::isGeoView ( )

Returns true if the Physical workspace is currently visible, otherwise false.

Returns
bool, true if the Physical workspace is currently visible, otherwise false.

◆ isLogicalView()

bool Workspace::isLogicalView ( )

Returns true if the Logical workspace is currently visible, otherwise false.

Returns
bool, true if the Logical workspace is currently visible, otherwise false.

◆ isRackView()

bool Workspace::isRackView ( )

Returns true if the wiring closet is currently visible, otherwise false.

Returns
bool, true if the wiring closet is currently visible, otherwise false.

◆ moveItemInWorkspace()

bool Workspace::moveItemInWorkspace ( QString  ,
int  ,
int   
)

Move item in workspace to a new location.

Parameters
itemName,itemname
x,thex coordinate
y,they coordinate
Returns
none

◆ pauseEnvironmentTime()

void Workspace::pauseEnvironmentTime ( )

Pause the Environemnt time.

Returns
none

◆ physicalObjectAdded()

void Workspace::physicalObjectAdded ( PhysicalObject  )

This event is emitted when a new Physical object(container, building, closet...) is added.

IPC event.

◆ physicalObjectMoved()

void Workspace::physicalObjectMoved ( PhysicalObject  ,
uuid  ,
PhysicalObject   
)

This event is emitted when a Physical object(container, building, closet...) is moved.

  • oldParentUuid, the uuid of the parent container
  • newParent, the new parent Physical object that the current object was moved to

IPC event.

◆ physicalObjectRemoved()

void Workspace::physicalObjectRemoved ( uuid  )

This event is emitted when a Physical object(container, building, closet...) is removed.

  • objectUuid, the uuid of the physical object that was removed

IPC event.

◆ resetEnvironment()

void Workspace::resetEnvironment ( )

Reset the Environemnt time.

Returns
none

◆ resumeEnvironmentTime()

void Workspace::resumeEnvironmentTime ( )

Resume the Environemnt time.

Returns
none

◆ setBaseZLevel()

void Workspace::setBaseZLevel ( QString  ,
float   
)

Sets the base z level, which is the current z level plus the base level.

Parameters
deviceName,itemname
baseZLevel,thebase level
Returns
none

◆ setComponentOpacity()

void Workspace::setComponentOpacity ( QString  ,
QString  ,
double   
)

Set the opacity for a component.

Parameters
deviceName,devicename
componentName,componentname
value,theopacity value
Returns
none

◆ setComponentRotation()

void Workspace::setComponentRotation ( QString  ,
QString  ,
double   
)

Set the rotation for a component.

Parameters
deviceName,devicename
componentName,componentname
value,therotation value
Returns
none

◆ setLogicalBackgroundPath()

void Workspace::setLogicalBackgroundPath ( QString  ,
bool   
)

Sets the background image of the logical workspace.

Parameters
tiled,trueif the image will be used as tiled layout and false if not
Returns
none

◆ setParentGraphicFromComponent()

void Workspace::setParentGraphicFromComponent ( QString  ,
QString  ,
int  ,
bool  ,
bool   
)

Set parent graphic from component.

Parameters
deviceName,devicename
componentName,componentname
index,theimage index to be used
bOnLogical,iftrue, set parent graphic in logical workspace
bOnPhysical,iftrue, set parent graphic in physical workspace
Returns
none

◆ setProperty()

void Workspace::setProperty ( QString  ,
QString   
)

Set the property value.

Parameters
prop,propertyname
value,propertyvalue
Returns
none

◆ setThingCustomText()

void Workspace::setThingCustomText ( QString  ,
int  ,
int  ,
int  ,
int  ,
QString   
)

Set the custom text for Thing at a location.

Parameters
deviceName,devicename
x,thex coordinate of where the text will show up
y,they coordinate of where the text will show up
width,thewidth the text
height,theheight of the text
text,thestring to show up
Returns
none

◆ setThingRotation()

void Workspace::setThingRotation ( QString  ,
double   
)

Set the rotation for a thing.

Parameters
deviceName,devicename
value,therotation value
Returns
none

◆ setVisible()

void Workspace::setVisible ( bool  )

◆ switchToPhysicalObject()

bool Workspace::switchToPhysicalObject ( PhysicalObject  )

Switch to the new physical location.

Parameters
object,PhysicalObjectobject
Returns
bool, return true if the switching is successful and false if not.

◆ zoomIn()

void Workspace::zoomIn ( )

Zooms into the workspace.

Returns
none

◆ zoomOut()

void Workspace::zoomOut ( )

Zooms out of the workspace.

Returns
none

◆ zoomReset()

void Workspace::zoomReset ( )

Resets the zoom scale of the workspace.

Returns
none

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