Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(support digital nameplate v3 spike) #38

Merged
merged 6 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ export function CompareSubmodelElement(props: CompareSubmodelElementProps) {
submodelElementCollection={props.submodelElement as SubmodelElementCollection}
/>
);
case KeyTypes.SubmodelElementList:
return (
<SubmodelElementCollectionComponent
submodelElementCollection={props.submodelElement as SubmodelElementCollection}
/>
);
case KeyTypes.File:
return <FileComponent file={props.submodelElement as File} />;
case KeyTypes.MultiLanguageProperty:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ export function TemplateEditFields(props: TemplateEditFieldsProps) {
);
case KeyTypes.SubmodelElementCollection:
return <></>;
case KeyTypes.SubmodelElementList:
return <></>;

default:
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ import { DocumentComponent } from './document-component/DocumentComponent';
export const submodelElementCustomVisualizationMap = {
[SubmodelElementSemanticId.Address]: AddressComponent,
[SubmodelElementSemanticId.ContactInformation]: ContactInformationComponent,
[SubmodelElementSemanticId.Markings]: MarkingsComponent,
[SubmodelElementSemanticId.MarkingsIrdi]: MarkingsComponent,
[SubmodelElementSemanticId.MarkingsV1]: MarkingsComponent,
[SubmodelElementSemanticId.MarkingsV2]: MarkingsComponent,
[SubmodelElementSemanticId.MarkingsV3]: MarkingsComponent,
[SubmodelElementSemanticId.MarkingsIrdiV1]: MarkingsComponent,
[SubmodelElementSemanticId.MarkingsIrdiV3]: MarkingsComponent,
[SubmodelElementSemanticId.Document]: DocumentComponent,
[SubmodelElementSemanticId.DocumentIrdi]: DocumentComponent,
};
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ export function GenericSubmodelElementComponent(props: GenericSubmodelElementCom
)}
/>
);
case KeyTypes.SubmodelElementList:
return (
<SubmodelElementCollectionComponent
submodelElementCollection={props.submodelElement as SubmodelElementCollection}
submodelId={props.submodelId}
submodelElementPath={buildSubmodelElementPath(
props.submodelElementPath,
props.submodelElement.idShort,
)}
/>
);
case KeyTypes.File:
return (
<FileComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ export function SortNameplateElements(submodel: Submodel | SubmodelElementCollec
}

// Sorting
if (key === SubmodelSemanticId.Nameplate) {
const nameplateKeys = [
SubmodelSemanticId.NameplateV1,
SubmodelSemanticId.NameplateV2,
SubmodelSemanticId.NameplateV3
];
if (nameplateKeys.includes(<SubmodelSemanticId>key)) {
SortSubmodelElements(submodels, NameplateSorting);
}

Expand Down
7 changes: 5 additions & 2 deletions src/lib/enums/SubmodelElementSemanticId.enum.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
export enum SubmodelElementSemanticId {
Address = '0173-1#02-AAQ832#005',
Markings = 'https://admin-shell.io/zvei/nameplate/1/0/Nameplate/Markings',
MarkingsIrdi = '0173-1#01-AGZ673#001',
MarkingsV1 = 'https://admin-shell.io/zvei/nameplate/1/0/Nameplate/Markings',
MarkingsV2 = 'https://admin-shell.io/zvei/nameplate/2/0/Nameplate/Markings',
MarkingsV3 = 'https://admin-shell.io/zvei/nameplate/3/0/Nameplate/Markings',
MarkingsIrdiV1 = '0173-1#01-AGZ673#001',
MarkingsIrdiV3 = '0112/2///61360_7#AAS006#001',
ContactInformation = 'https://admin-shell.io/zvei/nameplate/1/0/ContactInformations/ContactInformation',
Document = 'https://admin-shell.io/vdi/2770/1/0/Document',
DocumentIrdi = '0173-1#02-ABI500#001/0173-1#01-AHF579#001',
Expand Down
4 changes: 3 additions & 1 deletion src/lib/enums/SubmodelSemanticId.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export enum SubmodelSemanticId {
TimeSeries = 'https://admin-shell.io/idta/TimeSeries/1/1',
HierarchicalStructuresV10 = 'https://admin-shell.io/idta/HierarchicalStructures/1/0/Submodel',
HierarchicalStructuresV11 = 'https://admin-shell.io/idta/HierarchicalStructures/1/1/Submodel',
Nameplate = 'https://admin-shell.io/zvei/nameplate/1/0/Nameplate',
NameplateV1 = 'https://admin-shell.io/zvei/nameplate/1/0/Nameplate',
NameplateV2 = 'https://admin-shell.io/zvei/nameplate/2/0/Nameplate',
NameplateV3 = 'https://admin-shell.io/zvei/nameplate/3/0/Nameplate',
BillOfApplications = 'https://xitaso.com/BillOfApplications',
}
Loading