This commit is contained in:
Garrett 2020-12-22 15:17:47 +00:00
parent 7b50c60b78
commit 49dec8d17b
2 changed files with 124 additions and 97 deletions

View File

@ -2029,14 +2029,18 @@ var $qls;
case 'object': case 'object':
$objID = $object['data']['id']; $objName = '';
$objFace = $object['data']['face']; foreach($object['data'] as $item) {
$objDepth = $object['data']['depth']; $objID = $item['id'];
$objPort = $object['data']['port']; $objFace = $item['face'];
$selected = $object['data']['selected']; $objDepth = $item['depth'];
$objName = $this->generateObjectPortName($objID, $objFace, $objDepth, $objPort); $objPort = $item['port'];
$objBox = $this->wrapObject($objID, $objName, $selected); $selected = $item['selected'];
$objName .= $this->generateObjectPortName($objID, $objFace, $objDepth, $objPort).'<br>';
}
$objBox = $this->wrapObject($objID, $objName, $selected);
// Wrap in <td> and add to row array // Wrap in <td> and add to row array
$htmlString = '<td>'.$objBox.'</td>'; $htmlString = '<td>'.$objBox.'</td>';
array_push($tableArray[count($tableArray)-1], $htmlString); array_push($tableArray[count($tableArray)-1], $htmlString);

View File

@ -56,12 +56,13 @@ for($x=0; $x<2; $x++){
$workingArray = array( $workingArray = array(
'type' => 'object', 'type' => 'object',
'data' => array( 'data' => array(
array(
'id' => $objID, 'id' => $objID,
'face' => $objFace, 'face' => $objFace,
'depth' => $objDepth, 'depth' => $objDepth,
'port' => $objPort, 'port' => $objPort,
'selected' => $selected 'selected' => $selected
) ))
); );
if($x == 0) { if($x == 0) {
array_push($path, $workingArray); array_push($path, $workingArray);
@ -71,119 +72,141 @@ for($x=0; $x<2; $x++){
// Connection // Connection
if(isset($qls->App->inventoryArray[$objID][$objFace][$objDepth][$objPort])) { if(isset($qls->App->inventoryArray[$objID][$objFace][$objDepth][$objPort])) {
$objectWorkingArray = array(
$inventory = $qls->App->inventoryArray[$objID][$objFace][$objDepth][$objPort]; 'type' => 'object',
$inventoryID = $inventory['rowID']; 'data' => array()
$localAttrPrefix = $inventory['localAttrPrefix'];
$remoteAttrPrefix = $inventory['remoteAttrPrefix'];
$connection = $qls->App->inventoryAllArray[$inventoryID];
$mediaTypeID = $connection['mediaType'];
$length = $connection['length'];
$includeUnit = true;
$length = $qls->App->calculateCableLength($mediaTypeID, $length, $includeUnit);
// Local Connection
$workingArray = array(
'type' => 'connector',
'data' => array(
'code39' => $connection[$localAttrPrefix.'_code39'],
'connectorType' => $connection[$localAttrPrefix.'_connector']
)
); );
if($x == 0) { foreach($qls->App->inventoryArray[$objID][$objFace][$objDepth][$objPort] as $index => $inventory) {
array_push($path, $workingArray);
} else {
array_unshift($path, $workingArray);
}
// Cable
$workingArray = array(
'type' => 'cable',
'data' => array(
'mediaTypeID' => $mediaTypeID,
'length' => $length
)
);
if($x == 0) {
array_push($path, $workingArray);
} else {
array_unshift($path, $workingArray);
}
// Remote Connection
$workingArray = array(
'type' => 'connector',
'data' => array(
'code39' => $connection[$remoteAttrPrefix.'_code39'],
'connectorType' => $connection[$remoteAttrPrefix.'_connector']
)
);
if($x == 0) {
array_push($path, $workingArray);
} else {
array_unshift($path, $workingArray);
}
if($connection[$remoteAttrPrefix.'_object_id'] != 0) {
$inventoryID = $inventory['rowID'];
$localAttrPrefix = $inventory['localAttrPrefix'];
$remoteAttrPrefix = $inventory['remoteAttrPrefix'];
$connection = $qls->App->inventoryAllArray[$inventoryID];
$objID = $connection[$remoteAttrPrefix.'_object_id']; // Local Connection
$objFace = $connection[$remoteAttrPrefix.'_object_face']; $connector1WorkingArray = array(
$objDepth = $connection[$remoteAttrPrefix.'_object_depth']; 'type' => 'connector',
$objPort = $connection[$remoteAttrPrefix.'_port_id'];
// Remote Object
$workingArray = array(
'type' => 'object',
'data' => array( 'data' => array(
'id' => $objID, 'code39' => $connection[$localAttrPrefix.'_code39'],
'face' => $objFace, 'connectorType' => $connection[$localAttrPrefix.'_connector']
'depth' => $objDepth,
'port' => $objPort
) )
); );
/*
if($x == 0) { if($x == 0) {
array_push($path, $workingArray); array_push($path, $workingArray);
} else { } else {
array_unshift($path, $workingArray); array_unshift($path, $workingArray);
} }
*/
$isTrunked = false; // Cable
if(isset($qls->App->peerArray[$objID][$objFace][$objDepth])) { $mediaTypeID = $connection['mediaType'];
$isTrunked = true; $length = $connection['length'];
// Remote Object Peer $includeUnit = true;
$peer = $qls->App->peerArray[$objID][$objFace][$objDepth]; $length = $qls->App->calculateCableLength($mediaTypeID, $length, $includeUnit);
if($peer['floorplanPeer']) { $cableWorkingArray = array(
$isTrunked = isFloorplanTrunked($peer, $objPort); 'type' => 'cable',
} 'data' => array(
'mediaTypeID' => $mediaTypeID,
'length' => $length
)
);
/*
if($x == 0) {
array_push($path, $workingArray);
} else {
array_unshift($path, $workingArray);
} }
*/
if($isTrunked) { // Remote Connection
$objID = $peer['peerID']; $connector2WorkingArray = array(
$objFace = $peer['peerFace']; 'type' => 'connector',
$objDepth = $peer['peerDepth']; 'data' => array(
'code39' => $connection[$remoteAttrPrefix.'_code39'],
'connectorType' => $connection[$remoteAttrPrefix.'_connector']
)
);
/*
if($x == 0) {
array_push($path, $workingArray);
} else {
array_unshift($path, $workingArray);
}
*/
// Object
if($connection[$remoteAttrPrefix.'_object_id'] != 0) {
// Trunk $objID = $connection[$remoteAttrPrefix.'_object_id'];
$objFace = $connection[$remoteAttrPrefix.'_object_face'];
$objDepth = $connection[$remoteAttrPrefix.'_object_depth'];
$objPort = $connection[$remoteAttrPrefix.'_port_id'];
// Remote Object
$workingArray = array( $workingArray = array(
'type' => 'trunk', 'id' => $objID,
'data' => array() 'face' => $objFace,
'depth' => $objDepth,
'port' => $objPort
); );
if($x == 0) { array_push($objectWorkingArray['data'], $workingArray);
array_push($path, $workingArray);
$isTrunked = false;
if(isset($qls->App->peerArray[$objID][$objFace][$objDepth])) {
$isTrunked = true;
// Remote Object Peer
$peer = $qls->App->peerArray[$objID][$objFace][$objDepth];
if($peer['floorplanPeer']) {
$isTrunked = isFloorplanTrunked($peer, $objPort);
}
}
if($isTrunked) {
$objID = $peer['peerID'];
$objFace = $peer['peerFace'];
$objDepth = $peer['peerDepth'];
// Trunk
$trunkWorkingArray = array(
'type' => 'trunk',
'data' => array()
);
/*
if($x == 0) {
array_push($path, $workingArray);
} else {
array_unshift($path, $workingArray);
}
*/
} else { } else {
array_unshift($path, $workingArray);
// No trunk peer found
$objID = 0;
} }
} else { } else {
// No trunk peer found // No connected object
$objID = 0; $objID = 0;
} }
} else {
// No connected object
$objID = 0;
} }
if($x == 0) {
array_push($path, $connector1WorkingArray);
array_push($path, $cableWorkingArray);
array_push($path, $connector2WorkingArray);
array_push($path, $objectWorkingArray);
if($isTrunked) {
array_push($path, $trunkWorkingArray);
}
} else {
array_unshift($path, $connector1WorkingArray);
array_unshift($path, $cableWorkingArray);
array_unshift($path, $connector2WorkingArray);
array_unshift($path, $objectWorkingArray);
if($isTrunked) {
array_unshift($path, $trunkWorkingArray);
}
}
} else if(isset($qls->App-> populatedPortArray[$objID][$objFace][$objDepth][$objPort])) { } else if(isset($qls->App-> populatedPortArray[$objID][$objFace][$objDepth][$objPort])) {