This commit is contained in:
Garrett K 2021-01-25 21:42:57 +00:00
parent 4319ae4135
commit 59c03f25c3
2 changed files with 9 additions and 7 deletions

View File

@ -291,8 +291,10 @@ function crawlPathConnections(){
var pathConnections = {}; var pathConnections = {};
var connectorElementArray = $('#containerFullPath').find('.port'); var connectorElementArray = $('#containerFullPath').find('.port');
// Sort ports by connectionPairId
$.each(connectorElementArray, function(index, element){ $.each(connectorElementArray, function(index, element){
if($(element).data('connectionPairId') !== undefined) { if($(element).data('connectionPairId') !== '') {
var connectionPairID = $(element).data('connectionPairId'); var connectionPairID = $(element).data('connectionPairId');
if(pathConnections[connectionPairID] === undefined) { if(pathConnections[connectionPairID] === undefined) {
pathConnections[connectionPairID] = []; pathConnections[connectionPairID] = [];
@ -300,6 +302,8 @@ function crawlPathConnections(){
pathConnections[connectionPairID].push($(element)); pathConnections[connectionPairID].push($(element));
} }
}); });
// Store path connection data
$(document).data('pathConnections', pathConnections); $(document).data('pathConnections', pathConnections);
} }

View File

@ -48,11 +48,8 @@ if($_SERVER['REQUEST_METHOD'] == 'POST'){
$mediaCategoryTable[$row['value']] = $row; $mediaCategoryTable[$row['value']] = $row;
} }
// Create endpointA object // Create endpoint objects
// If object is an endpoint
$endpointAObj = $qls->App->objectArray[$endpointAObjID]; $endpointAObj = $qls->App->objectArray[$endpointAObjID];
// If object is an endpoint
$endpointBObj = $qls->App->objectArray[$endpointBObjID]; $endpointBObj = $qls->App->objectArray[$endpointBObjID];
$endpointAObj['face'] = $endpointAObjFace; $endpointAObj['face'] = $endpointAObjFace;
@ -324,6 +321,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST'){
findPaths2($qls, $maxResults, $maxDepth, $reachable, $endpointAObj, $endpointBObj, $finalPathArray, $previousPathType); findPaths2($qls, $maxResults, $maxDepth, $reachable, $endpointAObj, $endpointBObj, $finalPathArray, $previousPathType);
} }
error_log('Debug (finalPathArray): '.json_encode($finalPathArray));
foreach($finalPathArray as $mediaType => &$pathData) { foreach($finalPathArray as $mediaType => &$pathData) {
foreach($pathData as &$path) { foreach($pathData as &$path) {
$path['pathHTML'] = $qls->App->buildPathFull($path['pathArray'], null); $path['pathHTML'] = $qls->App->buildPathFull($path['pathArray'], null);
@ -377,13 +375,13 @@ function findPaths2(&$qls, &$maxResults, &$maxDepth, &$reachable, &$focus, &$end
array_push($workingArray, array( array_push($workingArray, array(
'type' => 'object', 'type' => 'object',
'data' => array( 'data' => array(array(
'id' => $focusID, 'id' => $focusID,
'face' => $focusFace, 'face' => $focusFace,
'depth' => $focusDepth, 'depth' => $focusDepth,
'port' => $focusPort, 'port' => $focusPort,
'selected' => false 'selected' => false
) ))
)); ));
// If focus is endpointB, add it to finalPathArray // If focus is endpointB, add it to finalPathArray