Junction Diagram Automation Suite 1.2.0
An AutoCAD 2024 plugin for the manipulation and generation of junction box wiring diagrams
Loading...
Searching...
No Matches
Cable Class Reference

Represents a cable with specific attributes and devices connected to it. More...

#include <Cable.h>

Public Member Functions

 Cable (CableType cableType, SystemType sysType, IOType ioType)
 Construct a Cable object with specified types.
void draw (AcGePoint3d origin, int terminalNumber, bool flip, const wchar_t *junctionTag, int tableNumber) const
 Draw the cable starting from a given origin.
void addDevice (Device device)
 Add a device to the cable's list of connected devices.
CableType getCableType () const
 Get the type of this cable.
SystemType getSystemType () const
 Get the system type associated with this cable.
IOType getIOType () const
 Get the input/output type of this cable.
std::vector< DevicegetDevices () const
 Get all devices connected to this cable.
int getTerminalFootprint () const
 Calculate and return the terminal footprint count.
Device operator[] (int index) const
 Access a device by index from the list of connected devices.
bool operator< (const Cable &rhs) const
 Compare this cable with another based on the following criteria:

Static Public Member Functions

static CableType getWireTypeFromCell (const std::string &cell)
 Determine the CableType from a given cell string identifier.
static SystemType getSystemTypeFromCell (const std::string &cell)
 Determine the SystemType from a given cell string identifier.
static IOType getIOTypeFromCell (const std::string &cell)
 Determine the IOType from a given cell string identifier.

Detailed Description

Represents a cable with specific attributes and devices connected to it.

The Cable class encapsulates information about a cable including its type, system usage, input/output characteristics, and the devices it connects to.

Constructor & Destructor Documentation

◆ Cable()

Cable::Cable ( CableType cableType,
SystemType sysType,
IOType ioType )

Construct a Cable object with specified types.

Parameters
cableTypeType of the cable.
sysTypeSystem type (e.g., SAFETY or CONTROL).
ioTypeInput/output type (e.g., DIGITAL or ANALOG).

Member Function Documentation

◆ addDevice()

void Cable::addDevice ( Device device)

Add a device to the cable's list of connected devices.

Parameters
deviceDevice object to be added.

◆ draw()

void Cable::draw ( AcGePoint3d origin,
int terminalNumber,
bool flip,
const wchar_t * junctionTag,
int tableNumber ) const

Draw the cable starting from a given origin.

Parameters
originThe starting point for drawing.
terminalNumberThe number of the first terminal the cable connects to (from top to bottom).
flipDirection of the cable. true if the cable should be drawn to the right instead of to the left, false otherwise.
junctionTagTag of the junction box this cable is attached to. Used for creating field tags.
tableNumberNumber indicating which table this cable is attached to (e.g., 1 for TB1).

◆ getCableType()

CableType Cable::getCableType ( ) const

Get the type of this cable.

Returns
CableType representing the type of this cable.

◆ getDevices()

std::vector< Device > Cable::getDevices ( ) const

Get all devices connected to this cable.

Returns
A vector containing all Device objects connected to this cable.

◆ getIOType()

IOType Cable::getIOType ( ) const

Get the input/output type of this cable.

Returns
IOType representing either DIGITAL or ANALOG.

◆ getIOTypeFromCell()

IOType Cable::getIOTypeFromCell ( const std::string & cell)
static

Determine the IOType from a given cell string identifier.

Parameters
cellA string representing the cell information.
Returns
The corresponding IOType.

◆ getSystemType()

SystemType Cable::getSystemType ( ) const

Get the system type associated with this cable.

Returns
SystemType indicating whether it's a SAFETY or CONTROL system.

◆ getSystemTypeFromCell()

SystemType Cable::getSystemTypeFromCell ( const std::string & cell)
static

Determine the SystemType from a given cell string identifier.

Parameters
cellA string representing the cell information.
Returns
The corresponding SystemType.

◆ getTerminalFootprint()

int Cable::getTerminalFootprint ( ) const

Calculate and return the terminal footprint count.

Returns
The number of terminals on the cable must connect to.

◆ getWireTypeFromCell()

CableType Cable::getWireTypeFromCell ( const std::string & cell)
static

Determine the CableType from a given cell string identifier.

Parameters
cellA string representing the cell information.
Returns
The corresponding CableType.

◆ operator<()

bool Cable::operator< ( const Cable & rhs) const

Compare this cable with another based on the following criteria:

  1. All CONTROL cables are less than all SAFETY cables.
  2. All ANALOG cables are less than all DIGITAL cables.
  3. Cables with lesser devices are lesser cables.
Parameters
rhsRight-hand side Cable object for comparison.
Returns
True if this cable is considered less than rhs, otherwise false.

◆ operator[]()

Device Cable::operator[] ( int index) const

Access a device by index from the list of connected devices.

Parameters
indexIndex of the device to access.
Returns
The Device object at the specified index.

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