-
Notifications
You must be signed in to change notification settings - Fork 9
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
Pcf plugin #53
base: main
Are you sure you want to change the base?
Pcf plugin #53
Conversation
this.initializeCarbonFootprint('https://adminshell.io/idta/CarbonFootprint/ProductCarbonFootprint/0/9', 'PCFCO2eq'); | ||
}, | ||
initializeTransportCarbonFootprint() { | ||
this.initializeCarbonFootprint('[IRDI] https://adminshell.io/idta/CarbonFootprint/TransportCarbonFootprint/0/9', 'TCFCO2eq'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete "[IRDI] "
Please also correct IRI to "https://admin-shell.io/idta/CarbonFootprint/TransportCarbonFootprint/0/9" (missing "-" in "adminshell" in your IRI)
} | ||
}, | ||
initializeProductCarbonFootprint() { | ||
this.initializeCarbonFootprint('https://adminshell.io/idta/CarbonFootprint/ProductCarbonFootprint/0/9', 'PCFCO2eq'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please correct IRI to "https://admin-shell.io/idta/CarbonFootprint/ProductCarbonFootprint/0/9" (missing "-" in "adminshell" in your IRI)
checkSemanticId( | ||
'https://admin-shell.io/idta/CarbonFootprint/CarbonFootprint/0/9', | ||
submodelElementData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please swap the two parameter of checkSemanticId()
See SubmodelElementHandling.ts: checkSemanticId(submodelElement: any, semanticId: string)
return elem.semanticId?.type === 'ExternalReference' && | ||
elem.semanticId?.keys?.[0]?.type === 'GlobalReference' && | ||
elem.semanticId?.keys?.[0]?.value === semanticId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion no need for checking the types, return elem.semanticId?.keys?.[0]?.value === semanticId;
is sufficient
Alternatively, you can use checkSemanticId(submodelElement: any, semanticId: string)
of SubmodelElementHandling.ts, so that not just the first key (keys?.[0]
) is considered
unitSuffix(value: Array<any>): string { | ||
return value.length > 0 && value[0].unit || ''; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In your example AASX files there is missing the Unit for the PCFCO2eq resp. TCFCO2eq properties. The unit can be specified via embeddedDatapSecification, e.g.:
Then you can get the unit of the property via unitSuffix(prop: any)
(see SubmodelElementHandling.ts)
The Carbon Footprint plugin is a visualization tool designed to display the carbon footprint of products and, if applicable, the transport associated with them. This plugin represents the carbon footprint data using a visual foot shape, with distinct colors indicating different types of carbon emissions.
The plugin uses an SVG-based graphical representation of a foot to depict the carbon footprint values:
The lengths of the blue and green sections are proportional to their respective values, providing a clear and immediate visual comparison of the two footprints.