0.3.14
This commit is contained in:
parent
f2c0e47f94
commit
08c740c64f
@ -61,11 +61,10 @@ function addCab(elementID, elementFace, elementType){
|
|||||||
});
|
});
|
||||||
|
|
||||||
if(elementType == 'object') {
|
if(elementType == 'object') {
|
||||||
refreshPathData();
|
drawCabinet();
|
||||||
redraw();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
makePortsHoverable();
|
makePortsHoverable(false);
|
||||||
makeCabArrowsClickable();
|
makeCabArrowsClickable();
|
||||||
makeCabCloseClickable();
|
makeCabCloseClickable();
|
||||||
$('#objectTreeModal').modal('hide');
|
$('#objectTreeModal').modal('hide');
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
// ### Cabinet Functions ###
|
// ### Cabinet Functions ###
|
||||||
function drawCabinet(){
|
function drawCabinet(){
|
||||||
|
|
||||||
resizeCabinetCanvas();
|
resizeCabinetCanvas();
|
||||||
clearCabinetConnections();
|
clearCabinetConnections();
|
||||||
crawlCabinet();
|
crawlCabinet();
|
||||||
@ -23,13 +22,13 @@ function crawlCabinet(){
|
|||||||
$.each(pathSourceArray, function(pathSourceType, pathSource){
|
$.each(pathSourceArray, function(pathSourceType, pathSource){
|
||||||
|
|
||||||
if(pathSource !== undefined && pathSource !== false) {
|
if(pathSource !== undefined && pathSource !== false) {
|
||||||
|
|
||||||
// -=# TESTING #=-
|
|
||||||
var testConnectionArray = crawlCabinetConnections($(pathSource));
|
var testConnectionArray = crawlCabinetConnections($(pathSource));
|
||||||
var testTrunkArray = crawlCabinetTrunks($(pathSource));
|
var testTrunkArray = crawlCabinetTrunks($(pathSource));
|
||||||
|
} else {
|
||||||
|
var testConnectionArray = [];
|
||||||
|
var testTrunkArray = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
//$(document).data(sourceTypeMap[pathSourceType][0], connectionArray);
|
|
||||||
$(document).data(sourceTypeMap[pathSourceType][0], testConnectionArray);
|
$(document).data(sourceTypeMap[pathSourceType][0], testConnectionArray);
|
||||||
$(document).data(sourceTypeMap[pathSourceType][1], testTrunkArray);
|
$(document).data(sourceTypeMap[pathSourceType][1], testTrunkArray);
|
||||||
});
|
});
|
||||||
@ -171,6 +170,8 @@ function crawlCabinetTrunks(localPort, trunkArray = [], visitedPartitionArray =
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} else if(localRemotePartitionID.toLowerCase() != 'none') {
|
||||||
|
trunkArray.push([localPartition, localRemotePartitionID]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gather local peer ports
|
// Gather local peer ports
|
||||||
@ -598,11 +599,13 @@ function highlightElement(elem, color){
|
|||||||
cabinetCtx.lineWidth = origLineWidth;
|
cabinetCtx.lineWidth = origLineWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
function makePortsHoverable(){
|
function makePortsHoverable(clearPaths=true){
|
||||||
|
|
||||||
|
if(clearPaths) {
|
||||||
resetConnectionData();
|
resetConnectionData();
|
||||||
clearPathConnections();
|
clearPathConnections();
|
||||||
clearCabinetConnections();
|
clearCabinetConnections();
|
||||||
|
}
|
||||||
|
|
||||||
$('#buildSpaceContent').find('.port').each(function(){
|
$('#buildSpaceContent').find('.port').each(function(){
|
||||||
$(this).unbind('mouseenter mouseleave click.drawConnections');
|
$(this).unbind('mouseenter mouseleave click.drawConnections');
|
||||||
@ -650,7 +653,7 @@ function makeCabArrowsClickable(){
|
|||||||
var direction = $(this).data('cabMoveDirection');
|
var direction = $(this).data('cabMoveDirection');
|
||||||
var cabinet = $(this).closest('.diagramCabinetContainer');
|
var cabinet = $(this).closest('.diagramCabinetContainer');
|
||||||
if(direction == 'left') {
|
if(direction == 'left') {
|
||||||
$(cabinet).insertBefore($(cabinet).prev()).animate();
|
$(cabinet).insertBefore($(cabinet).prev());
|
||||||
} else {
|
} else {
|
||||||
$(cabinet).insertAfter($(cabinet).next());
|
$(cabinet).insertAfter($(cabinet).next());
|
||||||
}
|
}
|
||||||
|
|||||||
64
includes/content-path2.php
Executable file
64
includes/content-path2.php
Executable file
@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$path = array();
|
||||||
|
|
||||||
|
if($connectorCode39) {
|
||||||
|
$connectorID = base_convert($connectorCode39, 36, 10);
|
||||||
|
$rootCable = $qls->App->inventoryByIDArray[$connectorID];
|
||||||
|
|
||||||
|
$objID = $rootCable['local_object_id'];
|
||||||
|
$objFace = $rootCable['local_object_face'];
|
||||||
|
$objDepth = $rootCable['local_object_depth'];
|
||||||
|
$objPort = $rootCable['local_object_port'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$selectedObjID = $objID;
|
||||||
|
$selectedObjFace = $objFace;
|
||||||
|
$selectedObjDepth = $objDepth;
|
||||||
|
$selectedObjPort = $objPort;
|
||||||
|
|
||||||
|
function crawlConnSet($objID, $objFace, $objDepth, $objPort, $connSetID=0, $connSet=array(array(),array())) {
|
||||||
|
|
||||||
|
// Store port details
|
||||||
|
$workingArray = array(
|
||||||
|
'objID' => $objID,
|
||||||
|
'objFace' => $objFace,
|
||||||
|
'objDepth' => $objDepth,
|
||||||
|
'objPort' => $objPort,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Verify this node has not been visited already
|
||||||
|
$alreadySeen = false;
|
||||||
|
foreach($connSet as $conn) {
|
||||||
|
foreach($conn as $port) {
|
||||||
|
if($port['objID'] == $objID and $port['objFace'] == $objFace and $port['objDepth'] == $objDepth and $port['objPort'] == $objPort) {
|
||||||
|
$alreadySeen = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Is local port connected?
|
||||||
|
if(isset($qls->App->inventoryArray[$objID][$objFace][$objDepth][$objPort]) and !$alreadySeen) {
|
||||||
|
|
||||||
|
// Add port info to connection set
|
||||||
|
array_push($connSet[$connSetID], $workingArray);
|
||||||
|
|
||||||
|
// Loop over each local port connection
|
||||||
|
$inventoryEntry = $qls->App->inventoryArray[$objID][$objFace][$objDepth][$objPort];
|
||||||
|
foreach($inventoryEntry as $connection) {
|
||||||
|
|
||||||
|
// Collect remote object data
|
||||||
|
$remoteObjID = $connection['id'];
|
||||||
|
$remoteObjFace = $connection['face'];
|
||||||
|
$remoteObjDepth = $connection['depth'];
|
||||||
|
$remoteObjPort = $connection['port'];
|
||||||
|
|
||||||
|
// Flip the connection set ID
|
||||||
|
$connSetID = ($connSetID == 0) ? 1 : 0;
|
||||||
|
crawlConnSet($remoteObjID, $remoteObjFace, $remoteObjDepth, $remoteObjPort, $connSetID, $connSet);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
Loading…
Reference in New Issue
Block a user