Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
seicke committed Dec 7, 2024
1 parent 69912ea commit 8974783
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions aas-web-ui/src/mixins/SubmodelElementHandling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,26 +645,29 @@ export default defineComponent({

semanticIdsToFetch.forEach((semanticId: string) => {
if (semanticId.startsWith('0173-1#')) {
semanticIdsToFetch.push(semanticId.replace(/-1#(\d{2})-/, '/1///$1#'));
semanticIdsToFetch.push('https://api.eclass-cdp.com/' + semanticId.replaceAll('#', '-'));
} else if (semanticId.startsWith('0173/1')) {
semanticIdsToFetch.push(semanticId.replace(/\/1\/\/\/(\d{2})#/, '-1#$1-'));
// e.g. 0173-1#01-AHF578#001
semanticIdsToFetch.push(semanticId.replace(/-1#(\d{2})-/, '/1///$1#')); // 0173-1#01-AHF578#001 --> 0173/1///01#AHF578#001
semanticIdsToFetch.push('https://api.eclass-cdp.com/' + semanticId.replaceAll('#', '-')); // 0173-1#01-AHF578#001 --> https://api.eclass-cdp.com/0173-1-01-AHF578-001
} else if (semanticId.startsWith('0173/1///')) {
// e.g. 0173/1///01#AHF578#001
semanticIdsToFetch.push(semanticId.replace(/\/1\/\/\/(\d{2})#/, '-1#$1-')); // 0173/1///01#AHF578#001 --> 0173-1#01-AHF578#001
semanticIdsToFetch.push(
'https://api.eclass-cdp.com/' +
semanticId.replace(/\/1\/\/\/(\d{2})#/, '-1-$1-').replaceAll('#', '-')
semanticId.replace(/\/1\/\/\/(\d{2})#/, '-1-$1-').replaceAll('#', '-') // 0173/1///01#AHF578#001 --> https://api.eclass-cdp.com/0173-1-01-AHF578-001
);
} else if (semanticId.startsWith('https://api.eclass-cdp.com/0173-1')) {
// e.g. https://api.eclass-cdp.com/0173-1-01-AHF578-001
semanticIdsToFetch.push(
semanticId
.replaceAll('https://api.eclass-cdp.com/', '')
.replaceAll('-', '#')
.replace(/#1#(\d{2})#/, '-1#$1-')
.replace(/-1-(\d{2})-/, '-1#$1-')
.replace(/-(\d{3})$/, '#$1') // https://api.eclass-cdp.com/0173-1-01-AHF578-001 --> 0173-1#01-AHF578#001
);
semanticIdsToFetch.push(
semanticId
.replaceAll('https://api.eclass-cdp.com/', '')
.replaceAll('-', '#')
.replace(/#1#(\d{2})#/, '/1///$1#')
.replace(/-1-(\d{2})-/, '/1///$1#')
.replace(/-(\d{3})$/, '#$1') // https://api.eclass-cdp.com/0173-1-01-AHF578-001 --> 0173/1///01#AHF578#001
);
}
});
Expand Down

0 comments on commit 8974783

Please sign in to comment.