Definitons for building junction boxes.
More...
|
void | _drawJunctionBox (std::string filename, std::string selectedTag, BoxSize selectedSize, AcGePoint3d origin) |
| Draw a junction box from a file.
|
bool | _shouldSplit (BoxSize boxSize, std::vector< Cable > &cables, int currentCableIndex, int currentTerminalIndex, int currentTableIndex) |
| Given a cable list and a current position in that list, should the next cable be drawn on the next table.
|
std::vector< Cable > | _xlsxGetCables (HWND hDlg, const std::string &filename, const std::string &junctionTag) |
| Parse the provided Cable Schedule workbook and create a list of Cable objects for the specified junction tag.
|
void | _xlsxGetJunctionTags (HWND hDlg, const std::string &filename, std::vector< std::string > &tags) |
| Collect all unique junction tags found in the Cable Schedule sheet of the workbook.
|
int | _xlsxGetJunctionFootprint (HWND hDlg, std::string filename, std::string junctionTag, BoxSize boxSize) |
| Calculate the total number of terminals required by all cables that terminate in the given junction tag.
|
void | _updateSizeRadioButtons (HWND hDlg, const std::vector< HWND > &sizeButtons, const std::vector< int > &spareCounts) |
void | _rebuildDialogBox (const std::vector< std::string > &junctionTags, std::vector< HWND > &tagRadioButtons, std::vector< HWND > &sizeRadioButtons, const std::vector< int > &spareCounts, HWND hDlg) |
| Rebuild (or build) the dialog‑box controls for junction‑tag and box‑ size selection.
|
INT_PTR CALLBACK | _DialogProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) |
| Dialog‑box procedure that handles all messages for the Junction Box Builder dialog.
|
void | buildJunctionBox () |
| Build a junction box based on the provided specifications.
|
void | flipCable () |
| Flip a cable or a set of cables.
|
void | reIndexCable () |
| Change the terminal index of a cable or set of cables.
|
Definitons for building junction boxes.
This module is part of the Junction Diagram Automation Suite. Unauthorized copying, distribution, or modification is prohibited.
- Version
- 1.2.0
- Author
- Ethan Barnes ebarn.nosp@m.es@g.nosp@m.astec.nosp@m.heng.nosp@m..com
- Date
- 2025-06-19
- Copyright
- Proprietary - All Rights Reserved by GasTech Engineering LLC
◆ BoxSize
Predefined enclosure footprints supported by the tool.
Enumerator |
---|
SMALL | 12" × 12" × 6" enclosure
|
MEDIUM | 16" × 16" × 6" enclosure
|
LARGE | 24" × 24" × 8" enclosure
|
CUSTOM | Custom enclosure. User will place the cables.
|
◆ _DialogProc()
INT_PTR CALLBACK _DialogProc |
( |
HWND | hDlg, |
|
|
UINT | message, |
|
|
WPARAM | wParam, |
|
|
LPARAM | lParam ) |
Dialog‑box procedure that handles all messages for the Junction Box Builder dialog.
- Parameters
-
hDlg | Dialog window handle. |
message | Windows message identifier. |
wParam | Additional message information. |
lParam | Additional message information (custom for WM_INITDIALOG). |
- Returns
- TRUE if the message was processed, FALSE otherwise (per Windows API requirements for dialog procedures).
◆ _drawJunctionBox()
void _drawJunctionBox |
( |
std::string | filename, |
|
|
std::string | selectedTag, |
|
|
BoxSize | selectedSize, |
|
|
AcGePoint3d | origin ) |
Draw a junction box from a file.
- Parameters
-
filename | Absolute path to the Excel (.xlsx) file. |
selectedTag | Tag (e.g. "IJB-810") identifying the junction whose cables should be extracted. |
selectedSize | Size of the box to be drawn. |
origin | Point where the box should be drawn. (Usually 0 0 0) |
◆ _rebuildDialogBox()
void _rebuildDialogBox |
( |
const std::vector< std::string > & | junctionTags, |
|
|
std::vector< HWND > & | tagRadioButtons, |
|
|
std::vector< HWND > & | sizeRadioButtons, |
|
|
const std::vector< int > & | spareCounts, |
|
|
HWND | hDlg ) |
Rebuild (or build) the dialog‑box controls for junction‑tag and box‑ size selection.
The function is called after selecting a new XLSX file and whenever the spare‑terminal counts must be refreshed.
- Parameters
-
junctionTags | List of available junction tags. |
tagRadioButtons | Vector that will receive handles to dynamically created tag buttons (output). |
sizeRadioButtons | Vector that will receive handles to size buttons (output). |
spareCounts | Spare‑terminal counts for each predefined box size. |
hDlg | Dialog window handle. |
◆ _shouldSplit()
bool _shouldSplit |
( |
BoxSize | boxSize, |
|
|
std::vector< Cable > & | cables, |
|
|
int | currentCableIndex, |
|
|
int | currentTerminalIndex, |
|
|
int | currentTableIndex ) |
Given a cable list and a current position in that list, should the next cable be drawn on the next table.
- Parameters
-
boxSize | Size of the box. |
cables | Reference to a vector of Cable objects. |
currentCableIndex | The index of the cable that is about to be added to the drawing. |
currentTerminalIndex | The terminal that the next cable will reside on. |
currentTableIndex | The current table being drawn to. |
- Returns
- true if the cable being drawn should be placed on the next table, false otherwise.
◆ _updateSizeRadioButtons()
void _updateSizeRadioButtons |
( |
HWND | hDlg, |
|
|
const std::vector< HWND > & | sizeButtons, |
|
|
const std::vector< int > & | spareCounts ) |
brief Update the size‑selection radio buttons to show how many spare terminals each box size would have after the current selection.
- Parameters
-
hDlg | Dialog‑box window handle. |
sizeButtons | Handles of size radio buttons in dialog. |
spareCounts | Spare‑terminal counts (same order as sizeButtons). |
◆ _xlsxGetCables()
std::vector< Cable > _xlsxGetCables |
( |
HWND | hDlg, |
|
|
const std::string & | filename, |
|
|
const std::string & | junctionTag ) |
Parse the provided Cable Schedule workbook and create a list of Cable objects for the specified junction tag.
- Parameters
-
hDlg | Parent‑window handle used for any error message boxes. |
filename | Absolute path to the Excel (.xlsx) file. |
junctionTag | Tag (e.g. "IJB-810") identifying the junction whose cables should be extracted. |
- Returns
- Vector of fully‑populated Cable objects. If the file fails to open or is incompatible, an empty vector is returned.
◆ _xlsxGetJunctionFootprint()
int _xlsxGetJunctionFootprint |
( |
HWND | hDlg, |
|
|
std::string | filename, |
|
|
std::string | junctionTag, |
|
|
BoxSize | boxSize ) |
Calculate the total number of terminals required by all cables that terminate in the given junction tag.
- Parameters
-
hDlg | Parent‑window handle for error dialogs. |
filename | Path to the Excel workbook. |
junctionTag | Junction tag whose footprint is required. |
boxSize | Size of the box to calculate the footprint on. (Required to account for table splitting) |
- Returns
- Terminal count ("footprint").
◆ _xlsxGetJunctionTags()
void _xlsxGetJunctionTags |
( |
HWND | hDlg, |
|
|
const std::string & | filename, |
|
|
std::vector< std::string > & | tags ) |
Collect all unique junction tags found in the Cable Schedule sheet of the workbook.
- Parameters
-
hDlg | Parent‑window handle for error dialogs. |
filename | Path to the Excel workbook. |
tags | Reference that will be filled with unique tags (output). |
◆ buildJunctionBox()
void buildJunctionBox |
( |
| ) |
|
Build a junction box based on the provided specifications.
This function is responsible for constructing a junction box by utilizing available data such as device and cable information. It involves generating the layout, placing components appropriately within the AutoCAD environment, and ensuring all connections are accurately represented.
The process may include reading from an Excel file to gather necessary input data, interacting with AutoCAD for drawing purposes, and managing various attributes related to devices and cables. It serves as a core functionality of the Junction Diagram Automation Suite.
◆ flipCable()
Flip a cable or a set of cables.
This function asks the user to select a set of cable-related blocks, and then automatically flips the cables about the axis of the junction termination block
◆ reIndexCable()
Change the terminal index of a cable or set of cables.
This function asks the user to select a set of cable-related blocks, and then asks for the terminal number of the top wire. It then automatically changes the attributes of each cable to match the respective terminal blocks they attach to, assuming proper spacing.