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

LogicalWorkspace is a graphics view. Network design using logical topology icons happens in this space. More...

Public Member Functions

int getState ()
 Returns the state of the Logical workspace. More...
 
vector< uuid > getCanvasItemIds () const
 Returns the list of UUIDs of items on the Logical workspace. More...
 
vector< uuid > getCanvasNoteIds () const
 Returns the list of UUIDs of note items on the Logical workspace. More...
 
vector< uuid > getCanvasRectIds () const
 Returns the list of UUIDs of rectangle items on the Logical workspace. More...
 
vector< uuid > getCanvasEllipseIds () const
 Returns the list of UUIDs of ellipse items on the Logical workspace. More...
 
vector< uuid > getCanvasLineIds () const
 Returns the list of UUIDs of line items on the Logical workspace. More...
 
vector< uuid > getCanvasPolygonIds () const
 Returns the list of UUIDs of polygon items on the Logical workspace. More...
 
vector< string > getRectItemData (uuid) const
 Returns a vector of data for a rectangle workspace item. More...
 
vector< string > getEllipseItemData (uuid) const
 Returns a vector of data for a ellipse workspace item. More...
 
vector< string > getLineItemData (uuid) const
 Returns a vector of data for a line workspace item. More...
 
vector< string > getPolygonItemData (uuid) const
 Returns a vector of data for a polygon workspace item. More...
 
int getCanvasItemX (uuid) const
 Returns the x-coordinate of the Logical workspace item with the specified UUID. More...
 
int getCanvasItemY (uuid) const
 Returns the y-coordinate of the Logical workspace item with the specified UUID. More...
 
int getCanvasItemRealX (uuid) const
 Returns the real x-coordinate of the Logical workspace item with the specified UUID. More...
 
int getCanvasItemRealY (uuid) const
 Returns the real y-coordinate of the Logical workspace item with the specified UUID. More...
 
void setCanvasItemRealPos (uuid, int, int)
 Sets the x-coordinate of the Logical workspace item with the specified UUID. More...
 
void setCanvasItemX (uuid, int)
 Sets the x-coordinate of the Logical workspace item with the specified UUID. More...
 
void setCanvasItemY (uuid, int)
 Sets the y-coordinate of the Logical workspace item with the specified UUID. More...
 
void moveCanvasItemBy (uuid, int, int)
 Moves the Logical workspace item with the specified UUID by the specified increments. More...
 
int getComponentItemsCount ()
 Returns the number of component items on the Logical workspace. More...
 
ComponentItem getComponentItem (QString)
 Returns the component item with the specified device name. More...
 
int getComponentChildCountFor (QString)
 
ComponentItem getComponentChildForAt (QString, int)
 
ComponentItem getComponentChildForByName (QString, QString)
 
QString addDevice (DeviceType, string, double, double)
 Adds a device to the Logical workspace. More...
 
bool removeDevice (QString)
 Removes the specified device from the Logical workspace and network. More...
 
void deviceAdded (QString, string, uuid)
 This event is emitted when a device is added to the Logical workspace. More...
 
void deviceRemoved (QString, uuid)
 This event is emitted when a device is removed from the Logical workspace. More...
 
void deviceRemoving (QString, uuid)
 This event is emitted when a device is about to be removed from the Logical workspace. More...
 
void canvasNoteTextChanged (uuid, QString)
 This event is emitted when a canvas item note has it's text changed. More...
 
void canvasNoteRemoved (uuid)
 This event is emitted when a canvas item note is removed from the Logical workspace. More...
 
void canvasNoteAdded (uuid)
 This event is emitted when a canvas item note is added to the Logical workspace. More...
 
QString addRemoteNetwork ()
 Adds a Multiuser remote network to the Logical workspace. More...
 
bool removeRemoteNetwork (QString)
 Removes the Multiuser remote network with the specified name from the Logical workspace. More...
 
void remoteNetworkAdded (QString)
 This event is emitted when a Multiuser remote network is added to the Logical workspace. More...
 
void remoteNetworkRemoved (QString)
 This event is emitted when a Multiuser remote network is removed from the Logical workspace. More...
 
bool moveRemoteNetwork (QString, int, int)
 Moves the Multiuser remote network to the specified location. More...
 
bool createLink (QString, string, QString, string, CONNECT_TYPES)
 Creates a link from one device's port to another device's port. More...
 
void linkStarted (QString, string, CONNECT_TYPES)
 This event is emitted when a link starts (i.e. user connects the first end of a link) More...
 
void linkCreated (QString, string, QString, string, CONNECT_TYPES)
 This event is emitted when a link has been created. More...
 
void linkDeleted (QString, string, QString, string, CONNECT_TYPES)
 This event is emitted when a link has been deleted. More...
 
bool deleteLink (QString, string)
 Deletes a link from the device connected to the specified port. More...
 
bool clearLayer (double)
 Clears the specified layer. More...
 
uuid drawLine (int, int, int, int, double, int, int, int, int)
 Draws a line on the Logical workspace. More...
 
uuid drawCircle (int, int, double, int, int, int, int)
 Draws a circle on the Logical workspace. More...
 
uuid addNote (int, int, double, QString)
 Adds a note on the Logical workspace. More...
 
QString getCanvasNoteText (uuid)
 Gets text from a note on the Logical workspace. More...
 
double getIncNoteZOrder ()
 Gets and increments the current z order to use for a new note. More...
 
int getMUItemCount ()
 Gets how many multiuser items there are, if any. More...
 
bool changeNoteText (uuid, QString)
 Changes text in a note on the logical workspace. More...
 
bool removeCanvasItem (uuid)
 Removes the specified item from the Logical workspace. More...
 
double getUnusedLayer ()
 Returns the unused layer. More...
 
bool isLayerUsed (double)
 Returns true if the specified layer is used, otherwise false. More...
 
double getLayerInbetweenComponents (QString, QString)
 Returns the layer between the specified devices. More...
 
vector< byte > getWorkspaceImage (QString)
 Returns the series of bytes of the Logical workspace image. More...
 
uuid addTextPopup (int, int, double, int, QString)
 Adds a text popup to the Logical workspace. More...
 
bool removeTextPopup (uuid)
 Removes the specified text popup from the Logical workspace. More...
 
void showClusterContents (QString)
 Shows the content of the specified cluster. More...
 
void showClusterContents (QString)
 Triggered when a cluster contents are shown. More...
 
void addCluster ()
 Creates new cluster object with the currently selected objects. More...
 
void removeCluster (QString, bool)
 Removes csluter object with given id. More...
 
void unCluster (QString)
 Unclusters cluster with the given clusterId. More...
 
void clusterAdded (QString)
 This event is emitted when a cluster object is added. More...
 
void clusterRemoved (QString)
 This event is emitted when a cluster is removed from the Logical workspace. More...
 
Cluster getRootCluster ()
 Returns root cluster. More...
 
Cluster getCurrentCluster ()
 Returns root cluster. More...
 
Cluster getCluster (QString)
 Returns cluster object for a given cluster id. More...
 
uuid getClusterItemId (QString)
 Returns uuid for the item associated with this cluster object. More...
 
Cluster getClusterFromItem (uuid)
 Returns cluster object assosiatete with a given cluster item. More...
 
Cluster getClusterForItem (uuid)
 Returns cluster object this item belongs to. More...
 
QString getClusterIdForItem (uuid)
 Returns cluster id for a given workspace item. More...
 
void moveItemToCluster (uuid, QString)
 Moves item from current cluster to a cluster with given clusterId. More...
 
void autoConnectDevices (QString, QString)
 Auto connect function, connect the given devices with a default cable at default ports, if possible. More...
 
void clusterForItemChanged (uuid, QString, QString)
 Sent when an item is moved from one cluster to another, etc. More...
 
void onNoAutoConnectError (QString, QString)
 Sent when autoconnect occures and there isn't an error. More...
 
void setDeviceCustomImage (QString, QString)
 Change Device image in logical workspace. More...
 
void centerOn (double, double)
 
void centerOnComponentByName (QString)
 
int getCurrentZoom ()
 

Detailed Description

LogicalWorkspace is a graphics view. Network design using logical topology icons happens in this space.

Member Function Documentation

◆ addCluster()

void LogicalWorkspace::addCluster ( )

Creates new cluster object with the currently selected objects.

◆ addDevice()

QString LogicalWorkspace::addDevice ( DeviceType  ,
string  ,
double  ,
double   
)

Adds a device to the Logical workspace.

Parameters
type,thetype of the device. Device types: eRouter = 0, eSwitch = 1, eCloud = 2, eBridge = 3, eHub = 4, eRepeater = 5, eCoAxialSplitter = 6, eAccessPoint = 7, ePc = 8, eServer = 9, ePrinter = 10, eWirelessRouter = 11, eIpPhone = 12, eDslModem = 13, eCableModem = 14, eRemoteNetwork = 15, eMultiLayerSwitch = 16, eLaptop = 17, eTabletPC = 18, ePda = 19, eWirelessEndDevice = 20, eWiredEndDevice = 21, eTV = 22, eHomeVoip = 23, eAnalogPhone = 24, eMultiUser = 25, eASA = 26, eIoE = 27, eHomeGateway = 28, eCellTower = 29, eCentralOfficeServer = 30 eCiscoAccessPoint = 31, eEmbeddedCiscoAccessPoint = 32, eSniffer = 33, eMCU = 34, eSBC = 35, eThing = 36, eMCUComponent = 37, eEmbeddedServer = 38,
eWirelessLanController = 39, eCluster = 40
model,themodel of the device.
x,xcoord to add the device at.
y,ycoord to add the device at.
Returns
QString, the device name of the device.

◆ addNote()

uuid LogicalWorkspace::addNote ( int  ,
int  ,
double  ,
QString   
)

Adds a note on the Logical workspace.

Parameters
x,thex-coordinate for the note.
y,they-coordinate for the note.
layer,thelayer to add the note on.
text,thetext for the note.
Returns
uuid, the UUID of the note.

◆ addRemoteNetwork()

QString LogicalWorkspace::addRemoteNetwork ( )

Adds a Multiuser remote network to the Logical workspace.

    \brief This event is emitted when action bar button on a android device is pressed, or corresponding button on some other device.
    \arg id, .

\NOT APPLICABLE TO DESKTOP.

event: actionBarButtonPressed(QString id) - PrivGetNetwork;

Returns
QString, the name of the Multiuser remote network.

◆ addTextPopup()

uuid LogicalWorkspace::addTextPopup ( int  ,
int  ,
double  ,
int  ,
QString   
)

Adds a text popup to the Logical workspace.

Parameters
x,thex-coordinate for the text popup.
y,they-coordinate for the text popup.
layer,thelayer to add the text popup to.
width,thewidth for the text popup.
text,thetext for the text popup.
Returns
uuid, the UUID of the text popup.

◆ autoConnectDevices()

void LogicalWorkspace::autoConnectDevices ( QString  ,
QString   
)

Auto connect function, connect the given devices with a default cable at default ports, if possible.

Parameters
device1The originating device
device2the destination device

◆ canvasNoteAdded()

void LogicalWorkspace::canvasNoteAdded ( uuid  )

This event is emitted when a canvas item note is added to the Logical workspace.

  • id, the uuid of the note added.

IPC event.

◆ canvasNoteRemoved()

void LogicalWorkspace::canvasNoteRemoved ( uuid  )

This event is emitted when a canvas item note is removed from the Logical workspace.

  • id, the uuid of the note removed.

IPC event.

◆ canvasNoteTextChanged()

void LogicalWorkspace::canvasNoteTextChanged ( uuid  ,
QString   
)

This event is emitted when a canvas item note has it's text changed.

  • id, the uuid of the note removed.
  • text, text from the note.

IPC event.

◆ centerOn()

void LogicalWorkspace::centerOn ( double  ,
double   
)

◆ centerOnComponentByName()

void LogicalWorkspace::centerOnComponentByName ( QString  )

◆ changeNoteText()

bool LogicalWorkspace::changeNoteText ( uuid  ,
QString   
)

Changes text in a note on the logical workspace.

Parameters
id,IDof the
text,thetext for the note.
Returns
uuid, the UUID of the note.

◆ clearLayer()

bool LogicalWorkspace::clearLayer ( double  )

Clears the specified layer.

Parameters
layerNumber,thelayer of interest.
Returns
bool, true if successful, otherwise false.

◆ clusterAdded()

void LogicalWorkspace::clusterAdded ( QString  )

This event is emitted when a cluster object is added.

  • addedId, Id of the new cluster.

IPC event.

◆ clusterForItemChanged()

void LogicalWorkspace::clusterForItemChanged ( uuid  ,
QString  ,
QString   
)

Sent when an item is moved from one cluster to another, etc.

  • itemUuid, item ID of an item. This can be a uuid of canvas item, Device or Cluster.
  • clusterId, Cluster id from which to remove the item.

IPC event.

◆ clusterRemoved()

void LogicalWorkspace::clusterRemoved ( QString  )

This event is emitted when a cluster is removed from the Logical workspace.

  • removedId, Id of the cluster removed.

IPC event.

◆ createLink()

bool LogicalWorkspace::createLink ( QString  ,
string  ,
QString  ,
string  ,
CONNECT_TYPES   
)

Creates a link from one device's port to another device's port.

Parameters
deviceName1,thename of the first device.
portName1,portNamecan be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
deviceName2,thename of the second device.
portName2portName can be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
connType,theconnection type. Connection types: ETHERNET_STRAIGHT = 8100, ETHERNET_CROSS = 8101, ETHERNET_ROLL = 8102, FIBER = 8103, PHONE = 8104, CABLE = 8105, SERIAL = 8106, AUTO = 8107, CONSOLE = 8108, WIRELESS = 8109, COAXIAL = 8110, OCTAL = 8111, CELLULAR = 8112, USB = 8113, CUSTOM_IO = 8114,
Returns
bool, true if successful, otherwise false.

◆ deleteLink()

bool LogicalWorkspace::deleteLink ( QString  ,
string   
)

Deletes a link from the device connected to the specified port.

Parameters
deviceName1,thename of the first device.
portName1,portNamecan be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
Returns
bool, true if successful, otherwise false.

◆ deviceAdded()

void LogicalWorkspace::deviceAdded ( QString  ,
string  ,
uuid   
)

This event is emitted when a device is added to the Logical workspace.

  • name, the name of the device added.
  • model, the model of the device added.

IPC event.

◆ deviceRemoved()

void LogicalWorkspace::deviceRemoved ( QString  ,
uuid   
)

This event is emitted when a device is removed from the Logical workspace.

  • name, the name of the device removed.
  • deviceUuid, the unique ID of the device.

IPC event.

◆ deviceRemoving()

void LogicalWorkspace::deviceRemoving ( QString  ,
uuid   
)

This event is emitted when a device is about to be removed from the Logical workspace.

  • name, the name of the device being removed.
  • deviceUuid, the unique ID of the device.

IPC event.

◆ drawCircle()

uuid LogicalWorkspace::drawCircle ( int  ,
int  ,
double  ,
int  ,
int  ,
int  ,
int   
)

Draws a circle on the Logical workspace.

Parameters
cx,thex-coordinate of the center for the circle.
cy,they-coordinate of the center for the circle.
layer,thelayer to draw the circle on.
radius,theradius for the circle.
r,thered color value for the circle.
g,thegreen color value for the circle.
b,theblue color value for the circle.
Returns
uuid, the UUID of the circle.

◆ drawLine()

uuid LogicalWorkspace::drawLine ( int  ,
int  ,
int  ,
int  ,
double  ,
int  ,
int  ,
int  ,
int   
)

Draws a line on the Logical workspace.

Parameters
sx,thex-coordinate to start drawing the line from.
sy,they-coordinate to start drawing the line from.
ex,thex-coordinate to stop drawing the line at.
ey,they-coordinate to stop drawing the line at.
layer,thelayer to draw the line on.
w,thewidth for the line.
r,thered color value for the line.
g,thegreen color value for the line.
b,theblue color value for the line.
Returns
uuid, the UUID of the line.

◆ getCanvasEllipseIds()

vector< uuid > LogicalWorkspace::getCanvasEllipseIds ( ) const

Returns the list of UUIDs of ellipse items on the Logical workspace.

Returns
vector<uuid>, the list of UUIDs of ellipse items on the Logical workspace.

◆ getCanvasItemIds()

vector< uuid > LogicalWorkspace::getCanvasItemIds ( ) const

Returns the list of UUIDs of items on the Logical workspace.

Returns
vector<uuid>, the list of UUIDs of items on the Logical workspace.

◆ getCanvasItemRealX()

int LogicalWorkspace::getCanvasItemRealX ( uuid  ) const

Returns the real x-coordinate of the Logical workspace item with the specified UUID.

Parameters
item_id,theUUID of the Logical workspace item of interest.
Returns
int, the x-coordinate of the Logical workspace item with the specified UUID.

◆ getCanvasItemRealY()

int LogicalWorkspace::getCanvasItemRealY ( uuid  ) const

Returns the real y-coordinate of the Logical workspace item with the specified UUID.

Parameters
item_id,theUUID of the Logical workspace item of interest.
Returns
int, the y-coordinate of the Logical workspace item with the specified UUID.

◆ getCanvasItemX()

int LogicalWorkspace::getCanvasItemX ( uuid  ) const

Returns the x-coordinate of the Logical workspace item with the specified UUID.

Parameters
item_id,theUUID of the Logical workspace item of interest.
Returns
int, the x-coordinate of the Logical workspace item with the specified UUID.

◆ getCanvasItemY()

int LogicalWorkspace::getCanvasItemY ( uuid  ) const

Returns the y-coordinate of the Logical workspace item with the specified UUID.

Parameters
item_id,theUUID of the Logical workspace item of interest.
Returns
int, the y-coordinate of the Logical workspace item with the specified UUID.

◆ getCanvasLineIds()

vector< uuid > LogicalWorkspace::getCanvasLineIds ( ) const

Returns the list of UUIDs of line items on the Logical workspace.

Returns
vector<uuid>, the list of UUIDs of line items on the Logical workspace.

◆ getCanvasNoteIds()

vector< uuid > LogicalWorkspace::getCanvasNoteIds ( ) const

Returns the list of UUIDs of note items on the Logical workspace.

Returns
vector<uuid>, the list of UUIDs of note items on the Logical workspace.

◆ getCanvasNoteText()

QString LogicalWorkspace::getCanvasNoteText ( uuid  )

Gets text from a note on the Logical workspace.

Parameters
uuid,theid of the canvas note.
Returns
QString, the note text.

◆ getCanvasPolygonIds()

vector< uuid > LogicalWorkspace::getCanvasPolygonIds ( ) const

Returns the list of UUIDs of polygon items on the Logical workspace.

Returns
vector<uuid>, the list of UUIDs of polygon items on the Logical workspace.

◆ getCanvasRectIds()

vector< uuid > LogicalWorkspace::getCanvasRectIds ( ) const

Returns the list of UUIDs of rectangle items on the Logical workspace.

Returns
vector<uuid>, the list of UUIDs of rectangle items on the Logical workspace.

◆ getCluster()

Cluster LogicalWorkspace::getCluster ( QString  )

Returns cluster object for a given cluster id.

  • clusterId of a cluster object.

◆ getClusterForItem()

Cluster LogicalWorkspace::getClusterForItem ( uuid  )

Returns cluster object this item belongs to.

Parameters
itemUuid,theuuid an item. This can be a uuid of any canvas item, Device uuid or Cluster uuid.
Returns
Cluster, cluster object the given item belongs to.

◆ getClusterFromItem()

Cluster LogicalWorkspace::getClusterFromItem ( uuid  )

Returns cluster object assosiatete with a given cluster item.

Parameters
clusterItemUuid,theuuid for the cluster item of interest. For non-cluster items this will return NULL.
Returns
Cluster, the cluster object assosiatete with a given cluster item.

◆ getClusterIdForItem()

QString LogicalWorkspace::getClusterIdForItem ( uuid  )

Returns cluster id for a given workspace item.

Parameters
itemUuidof an item. This can be a uuid of canvas item, Device or Cluster.
Returns
QString, cluster id for a given workspace item.

◆ getClusterItemId()

uuid LogicalWorkspace::getClusterItemId ( QString  )

Returns uuid for the item associated with this cluster object.

Parameters
clusterId,IDof a cluster object for which we want to get an item.
Returns
uuid, the uuid for the item associated with the given cluster.

◆ getComponentChildCountFor()

int LogicalWorkspace::getComponentChildCountFor ( QString  )

◆ getComponentChildForAt()

ComponentItem LogicalWorkspace::getComponentChildForAt ( QString  ,
int   
)

◆ getComponentChildForByName()

ComponentItem LogicalWorkspace::getComponentChildForByName ( QString  ,
QString   
)

◆ getComponentItem()

ComponentItem LogicalWorkspace::getComponentItem ( QString  )

Returns the component item with the specified device name.

Parameters
deviceName,thename of the device of interest.
Returns
ComponentItem, the ComponentItem object with the specified device name.

◆ getComponentItemsCount()

int LogicalWorkspace::getComponentItemsCount ( )

Returns the number of component items on the Logical workspace.

Returns
int, the number of component items on the Logical workspace.

◆ getCurrentCluster()

Cluster LogicalWorkspace::getCurrentCluster ( )

Returns root cluster.

◆ getCurrentZoom()

int LogicalWorkspace::getCurrentZoom ( )
Returns
int, 0 means default zoom. a positive number indicates zoom in level. a negative number indicates zoom out level.

◆ getEllipseItemData()

vector< string > LogicalWorkspace::getEllipseItemData ( uuid  ) const

Returns a vector of data for a ellipse workspace item.

Parameters
itemID,IDof the ellipse to get information for.
Returns
vector<string>, Each string is part of the data, like the x position of the starting position, etc. index [0, 1] start x and y. index [2, 3] end x and y. index [4] inner color rgb 'r,g,b', empty string if not displayed. index [5] outer color rgb. 'r,g,b', empty string if not displayed. index [6] text

◆ getIncNoteZOrder()

double LogicalWorkspace::getIncNoteZOrder ( )

Gets and increments the current z order to use for a new note.

Returns
uuid, the UUID of the note.

◆ getLayerInbetweenComponents()

double LogicalWorkspace::getLayerInbetweenComponents ( QString  ,
QString   
)

Returns the layer between the specified devices.

Parameters
deviceName1,thename of the first device.
deviceName2,thename of the second device.
Returns
double, the layer between the specified devices.

◆ getLineItemData()

vector< string > LogicalWorkspace::getLineItemData ( uuid  ) const

Returns a vector of data for a line workspace item.

Parameters
itemID,IDof the line to get information for.
Returns
vector<string>, Each string is part of the data, like the x position of the starting position, etc. index [0, 1] start x and y. index [2, 3] end x and y. index [4] Color rgb 'r,g,b'.

◆ getMUItemCount()

int LogicalWorkspace::getMUItemCount ( )

Gets how many multiuser items there are, if any.

Returns
int, the number of multiuser items.

◆ getPolygonItemData()

vector< string > LogicalWorkspace::getPolygonItemData ( uuid  ) const

Returns a vector of data for a polygon workspace item.

Parameters
itemID,IDof the polygon to get information for.
Returns
vector<string>, Each string is part of the data. index [0] inner color rgb. 'r,g,b', empty string if not displayed. index [1] outer color rgb. 'r,g,b', empty string if not displayed. index [2, vectorSize-1] These are the points of the polygon. [2] would be x, [3] would be y. All indexes after [1] are points in this fashion.

◆ getRectItemData()

vector< string > LogicalWorkspace::getRectItemData ( uuid  ) const

Returns a vector of data for a rectangle workspace item.

Parameters
itemID,IDof the rectangle to retrieve information for.
Returns
vector<string>, Each string is part of the data, like the x position of the starting position, etc. index [0, 1] start x and y. index [2, 3] end x and y. index [4] inner color rgb 'r,g,b', empty string if not displayed. index [5] outer color rgb. 'r,g,b', empty string if not displayed. index [6] text

◆ getRootCluster()

Cluster LogicalWorkspace::getRootCluster ( )

Returns root cluster.

◆ getState()

int LogicalWorkspace::getState ( )

Returns the state of the Logical workspace.

Returns
int, the state of the Logical workspace. States: sNone = 0, sHandScroll = 1, sAddNote = 2, sAddLine = 3, sAddEllipse = 4, sAddRectangle = 5, sDragging = 6, sDragged = 7, sConnect1 = 8, sConnect2 = 9, sAConnect1 = 10, sAConnect2 = 11, sInspect = 12, sDelete = 13, sPDU = 14, sAddDevice = 15, sAddDevices = 16, sMoveItem = 17, sZoom = 18, sZoomReset = 19, sDeviceTemplate = 20, sCtrlDrag = 21, sNameExists = 22, sResizeShape = 23, sRecable = 24, sFreeformPolygon = 100

◆ getUnusedLayer()

double LogicalWorkspace::getUnusedLayer ( )

Returns the unused layer.

Returns
double, the unused layer.

◆ getWorkspaceImage()

vector< byte > LogicalWorkspace::getWorkspaceImage ( QString  )

Returns the series of bytes of the Logical workspace image.

Parameters
format,theformat of the image. Image formats: BMP, GIF, JPG, JPEG, PNG, PBM, PGM, PPM, XBM, XPM.
Returns
vector<byte>, the series of bytes of the Logical workspace image.

◆ isLayerUsed()

bool LogicalWorkspace::isLayerUsed ( double  )

Returns true if the specified layer is used, otherwise false.

Parameters
layer,thelayer of interest.
Returns
true if the specified layer is used, otherwise false.

◆ linkCreated()

void LogicalWorkspace::linkCreated ( QString  ,
string  ,
QString  ,
string  ,
CONNECT_TYPES   
)

This event is emitted when a link has been created.

  • deviceName1, the name of the first device.
  • portName1, portName can be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
  • deviceName2, the name of the second device.
  • portName2, portName can be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
  • connType, the connection type. Connection types: ETHERNET_STRAIGHT = 8100, ETHERNET_CROSS = 8101, ETHERNET_ROLL = 8102, FIBER = 8103, PHONE = 8104, CABLE = 8105, SERIAL = 8106, AUTO = 8107, CONSOLE = 8108, WIRELESS = 8109, COAXIAL = 8110, OCTAL = 8111, CELLULAR = 8112, USB = 8113, CUSTOM_IO = 8114,

IPC event.

◆ linkDeleted()

void LogicalWorkspace::linkDeleted ( QString  ,
string  ,
QString  ,
string  ,
CONNECT_TYPES   
)

This event is emitted when a link has been deleted.

  • deviceName1, the name of the first device.
  • portName1, portName can be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
  • deviceName2, the name of the second device.
  • portName2, portName can be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
  • connType, the connection type. Connection types: ETHERNET_STRAIGHT = 8100, ETHERNET_CROSS = 8101, ETHERNET_ROLL = 8102, FIBER = 8103, PHONE = 8104, CABLE = 8105, SERIAL = 8106, AUTO = 8107, CONSOLE = 8108, WIRELESS = 8109, COAXIAL = 8110, OCTAL = 8111, CELLULAR = 8112, USB = 8113, CUSTOM_IO = 8114,

IPC event.

◆ linkStarted()

void LogicalWorkspace::linkStarted ( QString  ,
string  ,
CONNECT_TYPES   
)

This event is emitted when a link starts (i.e. user connects the first end of a link)

  • deviceName1, the name of the first device.
  • portName1, portName can be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
  • connType, the connection type. Connection types: ETHERNET_STRAIGHT = 8100, ETHERNET_CROSS = 8101, ETHERNET_ROLL = 8102, FIBER = 8103, PHONE = 8104, CABLE = 8105, SERIAL = 8106, AUTO = 8107, CONSOLE = 8108, WIRELESS = 8109, COAXIAL = 8110, OCTAL = 8111, CELLULAR = 8112, USB = 8113, CUSTOM_IO = 8114,

IPC event.

◆ moveCanvasItemBy()

void LogicalWorkspace::moveCanvasItemBy ( uuid  ,
int  ,
int   
)

Moves the Logical workspace item with the specified UUID by the specified increments.

Parameters
item_id,theUUID of the Logical workspace item of interest.
dx,thevalue to move the item in the x-axis by.
dy,thevalue to move the item in the y-axis by.

◆ moveItemToCluster()

void LogicalWorkspace::moveItemToCluster ( uuid  ,
QString   
)

Moves item from current cluster to a cluster with given clusterId.

Parameters
itemUuidof an item. This can be a uuid of canvas item, Device or Cluster.
clusterId,ClusterID of the cluster to add the item to.

◆ moveRemoteNetwork()

bool LogicalWorkspace::moveRemoteNetwork ( QString  ,
int  ,
int   
)

Moves the Multiuser remote network to the specified location.

Parameters
name,thename of the Multiuser remote network of interest.
x,thenew x-coorindate for the Multiuser remote network.
y,thenew y-coordinate for the Multiuser remote network.
Returns
bool, true if successful, otherwise false.

◆ onNoAutoConnectError()

void LogicalWorkspace::onNoAutoConnectError ( QString  ,
QString   
)

Sent when autoconnect occures and there isn't an error.

  • device1, one of the devices in the autoconnect that occured.
  • device2, the other device in the autoconnect that occured.

IPC event.

◆ remoteNetworkAdded()

void LogicalWorkspace::remoteNetworkAdded ( QString  )

This event is emitted when a Multiuser remote network is added to the Logical workspace.

  • name, the name of the Multiuser remote network added.

IPC event.

◆ remoteNetworkRemoved()

void LogicalWorkspace::remoteNetworkRemoved ( QString  )

This event is emitted when a Multiuser remote network is removed from the Logical workspace.

  • name, the name of the Multiuser remote network removed.

IPC event.

◆ removeCanvasItem()

bool LogicalWorkspace::removeCanvasItem ( uuid  )

Removes the specified item from the Logical workspace.

Parameters
id,theUUID of the item of interest.
Returns
bool, true if successful, otherwise false.

◆ removeCluster()

void LogicalWorkspace::removeCluster ( QString  ,
bool   
)

Removes csluter object with given id.

Parameters
clusterId,Thecluster ID of the cluster of interest.
uncluster,Whenfalse - the cluster with everything inside will be killed. When true - is equivalent to unCluster.

◆ removeDevice()

bool LogicalWorkspace::removeDevice ( QString  )

Removes the specified device from the Logical workspace and network.

Parameters
deviceName,thename of the device of interest.
Returns
bool, true if successful, otherwise false.

◆ removeRemoteNetwork()

bool LogicalWorkspace::removeRemoteNetwork ( QString  )

Removes the Multiuser remote network with the specified name from the Logical workspace.

Parameters
name,thename of the Multiuser remote network to remove.
Returns
bool, true if successful, otherwise false.

◆ removeTextPopup()

bool LogicalWorkspace::removeTextPopup ( uuid  )

Removes the specified text popup from the Logical workspace.

Parameters
id,theUUID of the text popup of interest.
Returns
bool, true if successful, otherwise false.

◆ setCanvasItemRealPos()

void LogicalWorkspace::setCanvasItemRealPos ( uuid  ,
int  ,
int   
)

Sets the x-coordinate of the Logical workspace item with the specified UUID.

Parameters
item_id,theUUID of the Logical workspace item of interest.
x,thex-coordinate for the Logical workspace item.
y,they-coordinate for the Logical workspace item.

◆ setCanvasItemX()

void LogicalWorkspace::setCanvasItemX ( uuid  ,
int   
)

Sets the x-coordinate of the Logical workspace item with the specified UUID.

Parameters
item_id,theUUID of the Logical workspace item of interest.
x,thex-coordinate for the Logical workspace item.

◆ setCanvasItemY()

void LogicalWorkspace::setCanvasItemY ( uuid  ,
int   
)

Sets the y-coordinate of the Logical workspace item with the specified UUID.

Parameters
item_id,theUUID of the Logical workspace item of interest.
y,they-coordinate for the Logical workspace item.

◆ setDeviceCustomImage()

void LogicalWorkspace::setDeviceCustomImage ( QString  ,
QString   
)

Change Device image in logical workspace.

Parameters
deviceName,thename of the device to set the custom image for.
path,pathto the image to use.

◆ showClusterContents() [1/2]

void LogicalWorkspace::showClusterContents ( QString  )

Shows the content of the specified cluster.

Parameters
clustid,thecluster ID of the cluster of interest.

◆ showClusterContents() [2/2]

void LogicalWorkspace::showClusterContents ( QString  )

Triggered when a cluster contents are shown.

Parameters
clustid,thecluster ID of the cluster of interest.

IPC event.

◆ unCluster()

void LogicalWorkspace::unCluster ( QString  )

Unclusters cluster with the given clusterId.

  • clusterId, Cluster id for which to do unclustering operation.

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