diff --git a/.gitignore b/.gitignore index a5ef23a..8fce4c2 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ client/Boundaries/Boundaries/obj client/Boundaries/TestBoundaries/obj client/Boundaries/TestBoundaries/bin aibel_dexpi/* -aibel_dexpi.xml \ No newline at end of file +aibel_dexpi.xml + diff --git a/www/script.js b/www/script.js index 80f4f68..0021b46 100644 --- a/www/script.js +++ b/www/script.js @@ -52,6 +52,15 @@ async function handleNodeClick(node, event) { } function createHighlightBox(node) { + var parentElement = node.parentNode; + if(parentElement.tagName === 'symbol'){ + var internalPaths = parentElement.querySelectorAll('path, ellipse, rect, circle'); + internalPaths.forEach(path => { + path.setAttribute('fill', 'yellow'); + path.setAttribute('fill-opacity', '0.2'); + }); + } + var highlightRects = node.querySelectorAll('.commissionHighlight'); if (highlightRects.length !== 0) return; @@ -107,6 +116,14 @@ function addCommissionHighlight(node){ } function removeCommissionHighlight(node) { + var parentElement = node.parentNode; + if(parentElement.tagName === 'symbol'){ + var internalPaths = parentElement.querySelectorAll('path, ellipse, rect, circle'); + internalPaths.forEach(path => { + path.setAttribute('fill', 'none'); + path.setAttribute('fill-opacity', '0.0'); + }); + } let highlightRects = node.querySelectorAll('.commissionHighlight'); highlightRects.forEach(rect => rect.remove()); } @@ -119,7 +136,12 @@ async function updateInCommissioningPackage() { let queryInside = ` SELECT * WHERE { ?node a data:insideBoundary . - ?node ?o . + ?node ?o . + { ?node ?tagNr. } + UNION + { ?node ?tagNr. } + FILTER NOT EXISTS { ?node a imf:Terminal . } + } `; let queryBoundary = ` @@ -150,7 +172,7 @@ async function updateInCommissioningPackage() { document.getElementById('boundary-table-container').innerHTML = ''; } nodes.forEach(node => { - if (nodeIds.includes(node.id) && !node.classList.contains('boundary') && !node.classList.contains('insideBoundary')) { + if (nodeIds.includes(node.id) && !node.classList.contains('boundary')) { addCommissionHighlight(node); } else { removeCommissionHighlight(node);