0.3.12
This commit is contained in:
parent
1cebdf1303
commit
57bdd24fd9
@ -38,7 +38,7 @@ function drawConnection(elementArray){
|
||||
context.strokeStyle = 'LightSkyBlue';
|
||||
context.lineWidth = 3;
|
||||
context.beginPath();
|
||||
console.log('Debug (elementArray): '+JSON.stringify(elementArray));
|
||||
//console.log('Debug (elementArray): '+JSON.stringify(elementArray));
|
||||
|
||||
$.each(elementArray, function(index, element){
|
||||
var elemA = element[0];
|
||||
@ -236,19 +236,15 @@ function crawlPath(selectedPort){
|
||||
}
|
||||
|
||||
while($(selectedPort).length) {
|
||||
console.log('here1');
|
||||
portArray.push(selectedPort);
|
||||
|
||||
// Crawl connection peer
|
||||
var connectedPortIDString = $(selectedPort).data('connectedGlobalId');
|
||||
var connectedPortIDArray = JSON.parse(atob(connectedPortIDString));
|
||||
|
||||
console.log('Debug (connectedPortIDString): '+atob(connectedPortIDString));
|
||||
|
||||
if(connectedPortIDArray.length) {
|
||||
var peerPortFound = false;
|
||||
$.each(connectedPortIDArray, function(index, connectedPortID){
|
||||
console.log('Debug (connectedPortID): '+connectedPortID);
|
||||
var connectedPort = $('#'+connectedPortID);
|
||||
if($(connectedPort).length) {
|
||||
|
||||
@ -277,14 +273,10 @@ function crawlPath(selectedPort){
|
||||
if(connectedPartitionPeerID != 'none') {
|
||||
trunkArray.push([connectedPartition, connectedPartitionPeerID]);
|
||||
}
|
||||
//selectedPort = false;
|
||||
//return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
connectionArray.push([selectedPort, connectedPortID]);
|
||||
//selectedPort = false;
|
||||
//return false;
|
||||
}
|
||||
});
|
||||
if(peerPortFound == false) {
|
||||
@ -304,6 +296,30 @@ function crawlPath(selectedPort){
|
||||
};
|
||||
}
|
||||
|
||||
function crawlPathDiagram(){
|
||||
var pathElementArray = {};
|
||||
var connectorElementArray = $('#containerFullPath').find('.port');
|
||||
$.each(connectorElementArray, function(index, element){
|
||||
console.log('here1');
|
||||
if($(element).data('connectionPairId') !== undefined) {
|
||||
console.log('here2');
|
||||
var connectionPairID = $(element).data('connectionPairId');
|
||||
if(pathElementArray[connectionPairID] === undefined) {
|
||||
console.log('here3');
|
||||
pathElementArray[connectionPairID] = [];
|
||||
}
|
||||
pathElementArray[connectionPairID].push($(element));
|
||||
}
|
||||
});
|
||||
return pathElementArray;
|
||||
}
|
||||
|
||||
function drawPathDiagram(){
|
||||
var pathElementArray = crawlPathDiagram();
|
||||
console.log(JSON.stringify(pathElementArray));
|
||||
drawConnection(pathElementArray);
|
||||
}
|
||||
|
||||
function makePortsHoverable(){
|
||||
|
||||
resizeCanvas();
|
||||
|
||||
@ -261,6 +261,7 @@ function retrievePortPath(objID, objFace, partitionDepth, portID){
|
||||
} else {
|
||||
$('#containerFullPath').html(responseJSON.success);
|
||||
makeCableConnectorsClickable();
|
||||
drawPathDiagram();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -1990,17 +1990,9 @@ var $qls;
|
||||
}
|
||||
|
||||
$connectorTypeID = $object['data']['connectorType'];
|
||||
|
||||
if($connectorTypeID != 0) {
|
||||
$connectorTypeName = $this->portTypeValueArray[$connectorTypeID]['name'];
|
||||
$connectorHTML = '<div title="'.$connectorTypeName.'" class="port '.$connectorTypeName.'"></div>';
|
||||
} else {
|
||||
$connectorTypeName = 'Unk';
|
||||
$connectorHTML = '<div title="'.$connectorTypeName.'" class="port '.$connectorTypeName.'"></div>';
|
||||
}
|
||||
|
||||
// Wrap in <td> and add to row array
|
||||
$htmlString = '<td>'.$connectorHTML.'</td>';
|
||||
$connectionPairID = $object['data']['connectionPairID'];
|
||||
$connectorTypeName = ($connectorTypeID != 0) ? $this->portTypeValueArray[$connectorTypeID]['name'] : 'Unk';
|
||||
$htmlString = '<td><div title="'.$connectorTypeName.'" class="port '.$connectorTypeName.'" data-connection-pair-id='.$connectionPairID.'></div></td>';
|
||||
array_push($tableArray[count($tableArray)-1], $htmlString);
|
||||
|
||||
if($objectIndex == count($path)-1) {
|
||||
@ -2055,17 +2047,9 @@ var $qls;
|
||||
if($path[$objectIndex+1]['type'] == 'trunk' or !isset($path[$objectIndex+1])) {
|
||||
if(isset($path[$objectIndex-1])) {
|
||||
$connectorTypeID = $path[$objectIndex-1]['data']['connectorType'];
|
||||
|
||||
if($connectorTypeID != 0) {
|
||||
$connectorTypeName = $this->portTypeValueArray[$connectorTypeID]['name'];
|
||||
$connectorHTML = '<div title="'.$connectorTypeName.'" class="port '.$connectorTypeName.'"></div>';
|
||||
} else {
|
||||
$connectorTypeName = 'Unk';
|
||||
$connectorHTML = '<div title="'.$connectorTypeName.'" class="port '.$connectorTypeName.'"></div>';
|
||||
}
|
||||
|
||||
// Wrap in <td> and add to row array
|
||||
$htmlString = '<td>'.$connectorHTML.'</td>';
|
||||
$connectionPairID = $path[$objectIndex-1]['data']['connectionPairID'];
|
||||
$connectorTypeName = ($connectorTypeID != 0) ? $this->portTypeValueArray[$connectorTypeID]['name'] : 'Unk';
|
||||
$htmlString = '<td><div title="'.$connectorTypeName.'" class="port '.$connectorTypeName.'" data-connection-pair-id='.$connectionPairID.'></div></td>';
|
||||
array_push($tableArray[count($tableArray)-1], $htmlString);
|
||||
|
||||
array_push($tableArray[count($tableArray)-1], '<td></td>');
|
||||
|
||||
@ -44,6 +44,8 @@ if($isTrunked) {
|
||||
$reversePortID = 0;
|
||||
}
|
||||
|
||||
$connectionPairID = 1;
|
||||
|
||||
// Discover path elements
|
||||
// First look outward from the far end of the cable,
|
||||
// then look outward from the near end of the cable.
|
||||
@ -83,25 +85,13 @@ for($x=0; $x<2; $x++){
|
||||
$remoteAttrPrefix = $inventory['remoteAttrPrefix'];
|
||||
$connection = $qls->App->inventoryAllArray[$inventoryID];
|
||||
|
||||
// Retrieve local connector type
|
||||
$localObj = $qls->App->objectArray[$objID];
|
||||
$localTemplateID = $localObj['template_id'];
|
||||
$localConnectorType = $qls->App->compatibilityArray[$localTemplateID][$objFace][$objDepth]['portType'];
|
||||
|
||||
// Retrieve remote connector type
|
||||
$remoteObjID = $inventory['id'];
|
||||
$remoteObjFace = $inventory['face'];
|
||||
$remoteObjDepth = $inventory['depth'];
|
||||
$remoteObj = $qls->App->objectArray[$remoteObjID];
|
||||
$remoteTemplateID = $remoteObj['template_id'];
|
||||
$remoteConnectorType = $qls->App->compatibilityArray[$remoteTemplateID][$remoteObjFace][$remoteObjDepth]['portType'];
|
||||
|
||||
// Local Connection
|
||||
$connector1WorkingArray = array(
|
||||
'type' => 'connector',
|
||||
'data' => array(
|
||||
'code39' => $connection[$localAttrPrefix.'_code39'],
|
||||
'connectorType' => $localConnectorType
|
||||
'connectorType' => $connection[$localAttrPrefix.'_connector'],
|
||||
'connectionPairID' => $connectionPairID
|
||||
)
|
||||
);
|
||||
|
||||
@ -123,7 +113,8 @@ for($x=0; $x<2; $x++){
|
||||
'type' => 'connector',
|
||||
'data' => array(
|
||||
'code39' => $connection[$remoteAttrPrefix.'_code39'],
|
||||
'connectorType' => $remoteConnectorType
|
||||
'connectorType' => $connection[$remoteAttrPrefix.'_connector'],
|
||||
'connectionPairID' => $connectionPairID
|
||||
)
|
||||
);
|
||||
|
||||
@ -217,6 +208,8 @@ for($x=0; $x<2; $x++){
|
||||
// No connected object
|
||||
$objID = 0;
|
||||
}
|
||||
|
||||
$connectionPairID++;
|
||||
}
|
||||
|
||||
// Now that we've discovered the far side of the scanned cable,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user