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

Pcf plugin #53

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Pcf plugin #53

wants to merge 2 commits into from

Conversation

LauraPastor
Copy link

@LauraPastor LauraPastor commented Oct 7, 2024

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:

  • Product Carbon Footprint (PCT): Displayed in blue, showing the value in CO₂ equivalents (CO₂eq).
  • Transport Carbon Footprint (TCP): Displayed in green, showing the value in CO₂ equivalents (CO₂eq), only if transport data exists.
    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.

@LauraPastor
Copy link
Author

CarbonFootprint.zip

this.initializeCarbonFootprint('https://adminshell.io/idta/CarbonFootprint/ProductCarbonFootprint/0/9', 'PCFCO2eq');
},
initializeTransportCarbonFootprint() {
this.initializeCarbonFootprint('[IRDI] https://adminshell.io/idta/CarbonFootprint/TransportCarbonFootprint/0/9', 'TCFCO2eq');
Copy link
Member

@seicke seicke Oct 10, 2024

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');
Copy link
Member

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)

Comment on lines +53 to +55
checkSemanticId(
'https://admin-shell.io/idta/CarbonFootprint/CarbonFootprint/0/9',
submodelElementData
Copy link
Member

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)

Comment on lines +146 to +148
return elem.semanticId?.type === 'ExternalReference' &&
elem.semanticId?.keys?.[0]?.type === 'GlobalReference' &&
elem.semanticId?.keys?.[0]?.value === semanticId;
Copy link
Member

@seicke seicke Oct 10, 2024

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

Comment on lines +168 to +170
unitSuffix(value: Array<any>): string {
return value.length > 0 && value[0].unit || '';
}
Copy link
Member

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.:
PCFCO2eq_Example

Then you can get the unit of the property via unitSuffix(prop: any) (see SubmodelElementHandling.ts)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants