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.h
Go to the documentation of this file.
1
14
15#pragma once
16
17#include <iostream>
18#include <vector>
19
20#include "actrans.h"
21
22#include "Device.h"
23#include "helpers.h"
24
36
45
54
62class Cable
63{
64private:
65 CableType _cableType;
66 SystemType _sysType;
67 IOType _ioType;
68 std::vector<Device> _devices;
69
75 std::wstring _getVisState() const;
76public:
84 Cable(CableType cableType, SystemType sysType, IOType ioType);
85
95 void draw(AcGePoint3d origin, int terminalNumber, bool flip, const wchar_t *junctionTag, int tableNumber) const;
96
97 /* ----- Setters ----- */
98
104 void addDevice(Device device);
105
106 /* ----- Getters ----- */
107
113 CableType getCableType() const;
114
121
127 IOType getIOType() const;
128
134 std::vector<Device> getDevices() const;
135
141 int getTerminalFootprint() const;
142
143 /* ----- Helpers ----- */
144
151 static CableType getWireTypeFromCell(const std::string& cell);
152
159 static SystemType getSystemTypeFromCell(const std::string& cell);
160
167 static IOType getIOTypeFromCell(const std::string& cell);
168
169 /* ----- Operators ----- */
170
177 Device operator[](int index) const;
178
188 bool operator<(const Cable& rhs) const;
189};
190
191
192
193
IOType
Enumerates the input/output types supported by cables.
Definition Cable.h:50
@ DIGITAL
Digital signals (e.g., on/off).
Definition Cable.h:52
@ ANALOG
Analog signals (e.g., varying voltage).
Definition Cable.h:51
SystemType
Enumerates the types of systems that can use cables.
Definition Cable.h:41
@ SAFETY
Cables used in safety-critical systems.
Definition Cable.h:43
@ CONTROL
Cables used in control systems.
Definition Cable.h:42
CableType
Enumerates the different types of cables.
Definition Cable.h:29
@ WIRE7
A seven-wire cable configuration.
Definition Cable.h:34
@ PAIR2
A cable with 2 pairs configuration.
Definition Cable.h:31
@ TRIAD1
A cable with a triad configuration.
Definition Cable.h:33
@ PAIR4
A cable with 4 pairs configuration.
Definition Cable.h:32
@ PAIR1
A cable with 1 pair configuration.
Definition Cable.h:30
Interface for the Device class.
IOType getIOType() const
Get the input/output type of this cable.
Definition Cable.cpp:144
bool operator<(const Cable &rhs) const
Compare this cable with another based on the following criteria:
Definition Cable.cpp:187
std::vector< Device > getDevices() const
Get all devices connected to this cable.
Definition Cable.cpp:148
SystemType getSystemType() const
Get the system type associated with this cable.
Definition Cable.cpp:140
void draw(AcGePoint3d origin, int terminalNumber, bool flip, const wchar_t *junctionTag, int tableNumber) const
Draw the cable starting from a given origin.
Definition Cable.cpp:52
static IOType getIOTypeFromCell(const std::string &cell)
Determine the IOType from a given cell string identifier.
Definition Cable.cpp:176
Device operator[](int index) const
Access a device by index from the list of connected devices.
Definition Cable.cpp:182
Cable(CableType cableType, SystemType sysType, IOType ioType)
Construct a Cable object with specified types.
Definition Cable.cpp:21
static CableType getWireTypeFromCell(const std::string &cell)
Determine the CableType from a given cell string identifier.
Definition Cable.cpp:161
int getTerminalFootprint() const
Calculate and return the terminal footprint count.
Definition Cable.cpp:153
void addDevice(Device device)
Add a device to the cable's list of connected devices.
Definition Cable.cpp:132
CableType getCableType() const
Get the type of this cable.
Definition Cable.cpp:136
static SystemType getSystemTypeFromCell(const std::string &cell)
Determine the SystemType from a given cell string identifier.
Definition Cable.cpp:170
Represents a device within the Junction Diagram Automation Suite.
Definition Device.h:32
Interface for helper functions related to database operations.