Skip to content

Commit

Permalink
fix: reading file from AAS updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfaron committed Dec 12, 2023
1 parent 75b27ba commit fd1cc49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h4 class="modal-title text-info">
<button type="button" class="btn-close" (click)="close()"></button>
</div>
<div class="modal-body">
<fhg-img classname="img-fluid" [src]="image" [alt]="name" />
<fhg-img classname="img-fluid" [src]="image" [alt]="name" [width]="600" [height]="600"/>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" (click)="close()" translate>CMD_CLOSE</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,18 @@ export class AasxServerV3 extends AasxServer {
return messages;
}

public async openFileAsync(shell: aas.AssetAdministrationShell, file: aas.File): Promise<NodeJS.ReadableStream> {
const aasId = encodeBase64Url(shell.id);
public async openFileAsync(_: aas.AssetAdministrationShell, file: aas.File): Promise<NodeJS.ReadableStream> {
const smId = encodeBase64Url(file.parent!.keys[0].value);
const path = getIdShortPath(file);
const url = this.resolve(`/shells/${aasId}/submodels/${smId}/submodel/submodelElements/${path}/attachment`);
const url = this.resolve(`/submodels/${smId}/submodel-elements/${path}/attachment`);
return await this.message.getResponse(url);
}

public resolveNodeId(shell: aas.AssetAdministrationShell, nodeId: string): string {
const aasId = encodeBase64Url(shell.id);
const items = nodeId.split('.');
const path = items[1].split('/').slice(1).join('.');
return this.resolve(`/shells/${aasId}/aas/submodels/${items[0]}/submodel/submodel-elements/${path}`).href;
return this.resolve(`/shells/${aasId}/submodels/${items[0]}/submodel-elements/${path}`).href;
}

public async getPackageAsync(aasIdentifier: string): Promise<NodeJS.ReadableStream> {
Expand Down

0 comments on commit fd1cc49

Please sign in to comment.