Skip to content

Commit

Permalink
fix: remove duplicate shells
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfaron committed Sep 10, 2024
1 parent 7626819 commit a648fd3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
22 changes: 18 additions & 4 deletions projects/aas-server/src/app/aas-provider/aas-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import { inject, singleton } from 'tsyringe';
import { extname } from 'path/posix';
import { Jimp } from 'jimp';
import { Readable } from 'stream';
import {
AASDocument,
Expand Down Expand Up @@ -120,15 +119,21 @@ export class AASProvider {

/**
* Gets the AAS environment for the specified AAS document.
* @param endpointName
* @param id
* @returns
* @param endpointName The endpoint name.
* @param id The AAS identifier.
* @returns The AAS environment.
*/
public async getContentAsync(endpointName: string, id: string): Promise<aas.Environment> {
const document = await this.index.get(endpointName, id);
return this.getDocumentContentAsync(document);
}

/**
* Gets the thumbnail of the specified AAS.
* @param endpointName The endpoint name.
* @param id The AAS identifier.
* @returns A readable stream.
*/
public async getThumbnailAsync(endpointName: string, id: string): Promise<NodeJS.ReadableStream | undefined> {
const endpoint = await this.index.getEndpoint(endpointName);
const document = await this.index.get(endpointName, id);
Expand All @@ -141,6 +146,15 @@ export class AASProvider {
}
}

/**
* Gets the value of the specified DataElement.
* @param endpointName The endpoint name.
* @param id The AAS identifier.
* @param smId The Submodel identifier.
* @param path The idShort path.
* @param options Additional options.
* @returns A readable stream.
*/
public async getDataElementValueAsync(
endpointName: string,
id: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class AASServerScan extends AASResourceScan {
try {
await this.server.openAsync();
const documents: AASDocument[] = [];
const ids = await this.server.getShellsAsync();
const ids = new Set(await this.server.getShellsAsync());
for (const id of ids) {
try {
const aasPackage = new AASServerPackage(this.logger, this.server, id);
Expand Down

0 comments on commit a648fd3

Please sign in to comment.