Skip to content

Commit

Permalink
Merge pull request #7126 from ORNL-AMO/issue-6103-redo
Browse files Browse the repository at this point in the history
Issue 6103 - Co2 unit as its own setting
  • Loading branch information
rhernandez-intertech authored Nov 13, 2024
2 parents d7c5e67 + 7d41198 commit 000f62d
Show file tree
Hide file tree
Showing 35 changed files with 130 additions and 135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ <h4 class="show-print print-section-header">Assessment Executive Summary</h4>
</tr>
<tr class="bold-row">
<td>Annual Emission Output Rate
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</td>
<td [ngClass]="{'selected-modification': selectedModificationIndex == -1}">
{{baselineResults.total.annualEmissionOutput | number:'1.0-0'}}</td>
Expand Down Expand Up @@ -264,8 +264,8 @@ <h4 class="show-print print-section-header">Assessment Executive Summary</h4>

<tr class="bold-row row-stripe bg-row">
<td>Annual Emission Savings
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</td>
<td [ngClass]="{'selected-modification': selectedModificationIndex == -1}">&mdash; &mdash;</td>
<td *ngFor="let result of combinedDayTypeResults; let index = index;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@
<div class="d-flex align-items-center pl-1 pr-1 col-4">
<span class="bold table-text">{{dayTypeBaselineResult.annualEmissionOutput |
number:'1.0-0'}}
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</span>
</div>
<div class="col-4 d-flex align-items-center pl-1 pr-1">
<span class="bold table-text">{{dayTypeModificationResult.annualEmissionOutput
| number:'1.0-0'}}
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</span>
</div>
</div>
Expand Down Expand Up @@ -228,8 +228,8 @@
<div class="col-4 d-flex align-items-center pl-1 pr-1">
<span class="bold table-text">{{dayTypeModificationResult.allSavingsResults.savings.annualEmissionOutputSavings
| number:'1.0-0'}}
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</span>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/app/examples/mockCompressedAirAssessment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17360,6 +17360,7 @@ export const MockCompressedAirAssessmentSettings: Settings = {
"language": "English",
"currency": "$",
"unitsOfMeasure": "Imperial",
"emissionsUnit": "Metric",
"distanceMeasurement": "ft",
"flowMeasurement": "gpm",
"powerMeasurement": "hp",
Expand Down
1 change: 1 addition & 0 deletions src/app/examples/mockFsat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ export const MockFsatSettings: Settings = {
language: "English",
currency: "$",
unitsOfMeasure: "Imperial",
emissionsUnit: "Metric",
distanceMeasurement: "ft",
flowMeasurement: "gpm",
powerMeasurement: "hp",
Expand Down
1 change: 1 addition & 0 deletions src/app/examples/mockPhast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,7 @@ export const MockPhastSettings: Settings = {
co2SavingsEnergySource: "Natural Gas",
co2SavingsFuelType: "Natural Gas",
totalEmissionOutputRate: 401.07,
emissionsUnit: 'Metric',
totalFuelEmissionOutputRate: 0,
totalNaturalGasEmissionOutputRate: 53.06,
totalCoalEmissionOutputRate: 0,
Expand Down
1 change: 1 addition & 0 deletions src/app/examples/mockPsat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ export const MockPsatSettings: Settings = {
"language": "English",
"currency": "$",
"unitsOfMeasure": "Imperial",
"emissionsUnit": "Metric",
"distanceMeasurement": "ft",
"flowMeasurement": "gpm",
"powerMeasurement": "hp",
Expand Down
1 change: 1 addition & 0 deletions src/app/examples/mockSsmt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ export const MockSsmtSettings: Settings = {
"language": "English",
"currency": "$",
"unitsOfMeasure": "Imperial",
"emissionsUnit": "Metric",
"distanceMeasurement": "ft",
"flowMeasurement": "gpm",
"powerMeasurement": "hp",
Expand Down
1 change: 1 addition & 0 deletions src/app/examples/mockTreasureHunt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,7 @@ export const MockTreasureHuntSettings: Settings = {
"language": "English",
"currency": "$",
"unitsOfMeasure": "Imperial",
"emissionsUnit": "Metric",
"distanceMeasurement": "ft",
"flowMeasurement": "gpm",
"powerMeasurement": "hp",
Expand Down
1 change: 1 addition & 0 deletions src/app/examples/mockWasteWater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export const MockWasteWaterSettings: Settings = {
"language": "English",
"currency": "$",
"unitsOfMeasure": "Imperial",
"emissionsUnit": "Metric",
"distanceMeasurement": "ft",
"flowMeasurement": "MGD",
"powerMeasurement": "hp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ <h4 class="show-print">Report Results</h4>

<tr class="callout">
<th>Annual CO2 Emissions
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</th>
<th [ngClass]="{'selected-modification': selectedModificationIndex == -1}">{{fsat.outputs.co2EmissionsOutput |
number:'1.1-1'}}</th>
Expand All @@ -153,8 +153,8 @@ <h4 class="show-print">Report Results</h4>
</tr>
<tr class="callout">
<th>Annual CO2 Emissions Savings
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</th>
<th [ngClass]="{'selected-modification': selectedModificationIndex == -1}">&mdash;</th>
<th *ngFor="let modification of fsat.modifications; let index = index;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@
<div class="d-flex stripe my-table-bg my-table-item">
<div class="d-flex align-items-center pl-1 pr-1" [ngClass]="{'col-4': !inSetup, 'col-6': inSetup}">
<span class="bold table-text">Annual CO2 Emissions
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</span>
</div>
<div class="d-flex align-items-center pl-1 pr-1" [ngClass]="{'col-4': !inSetup, 'col-6': inSetup}">
Expand All @@ -242,8 +242,8 @@
<div class="d-flex stripe my-table-bg my-table-item">
<div class="d-flex align-items-center pl-1 pr-1" [ngClass]="{'col-4': !inSetup, 'col-6': inSetup}">
<span class="bold table-text">Annual CO2 Emissions Savings
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</span>
</div>
<div class="d-flex align-items-center pl-1 pr-1" [ngClass]="{'col-4': !inSetup, 'col-6': inSetup}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class FsatResultsPanelComponent implements OnInit {
constructor(private fsatService: FsatService) { }

ngOnInit() {
console.log('settings', this.settings);
this.updateDataSub = this.fsatService.updateData.subscribe(() => { this.getResults(); });
if (this.fsat.modifications && this.fsat.modifications.length > 0) {
this.isWhatIfScenario = this.fsat.modifications[this.modificationIndex].fsat.whatIfScenario;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
<span *ngIf="!departmentSummaryItem.co2EmissionOutput">
&mdash;
</span>
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -89,8 +89,8 @@
<span *ngIf="!inventorySummary.totalEmissions">
&mdash;
</span>
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</td>
</tr>
</tfoot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export class Co2SavingsPhastService {
co2EmissionsOutput.totalEmissionOutput = co2EmissionsOutput.hourlyTotalEmissionOutput * phastCopy.operatingHours.hoursPerYear;
}

if (settings.unitsOfMeasure !== 'Metric') {
if (settings.emissionsUnit !== 'Metric') {
co2EmissionsOutput.hourlyTotalEmissionOutput = co2EmissionsOutput.hourlyTotalEmissionOutput !== undefined? this.convertUnitsService.value(co2EmissionsOutput.hourlyTotalEmissionOutput).from('tonne').to('ton') : undefined;
co2EmissionsOutput.emissionsSavings = co2EmissionsOutput.emissionsSavings !== undefined? this.convertUnitsService.value(co2EmissionsOutput.emissionsSavings).from('tonne').to('ton') : undefined;
co2EmissionsOutput.totalEmissionOutput = co2EmissionsOutput.totalEmissionOutput !== undefined? this.convertUnitsService.value(co2EmissionsOutput.totalEmissionOutput).from('tonne').to('ton') : undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ <h4 class="show-print print-section-header">Assessment Executive Summary</h4>
</tr>
<tr>
<td> Total CO<sub>2</sub> Emissions
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</td>
<td [ngClass]="{'selected-modification': selectedModificationIndex == -1}">
{{baselineSummary.co2EmissionsOutput.totalEmissionOutput | number:'1.0-2'}}</td>
Expand All @@ -68,8 +68,8 @@ <h4 class="show-print print-section-header">Assessment Executive Summary</h4>
</tr>
<tr>
<td> CO<sub>2</sub> Emissions Savings
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</td>
<td [ngClass]="{'selected-modification': selectedModificationIndex == -1}">&mdash; &mdash;</td>
<td *ngFor="let mod of modificationSummaries; let index = index;">
Expand Down Expand Up @@ -338,8 +338,8 @@ <h4 class="show-print print-section-header">Assessment Executive Summary</h4>
<tbody>
<tr>
<td> Electrical CO<sub>2</sub> Emissions
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</td>
<td [ngClass]="{'selected-modification': selectedModificationIndex == -1}">
{{baselinePhastResults.co2EmissionsOutput.electricityEmissionOutput | number:'1.0-2'}}</td>
Expand All @@ -354,12 +354,12 @@ <h4 class="show-print print-section-header">Assessment Executive Summary</h4>
</tr>
<tr>
<td *ngIf="settings.furnaceType === 'Electric Arc Furnace (EAF)'"> Natural Gas CO<sub>2</sub> Emissions
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</td>
<td *ngIf="settings.furnaceType !== 'Electric Arc Furnace (EAF)'"> Fuel CO<sub>2</sub> Emissions
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</td>
<td [ngClass]="{'selected-modification': selectedModificationIndex == -1}">
{{baselinePhastResults.co2EmissionsOutput.fuelEmissionOutput | number:'1.0-2'}}</td>
Expand All @@ -375,8 +375,8 @@ <h4 class="show-print print-section-header">Assessment Executive Summary</h4>
<ng-container *ngIf="settings.furnaceType === 'Electric Arc Furnace (EAF)'">
<tr>
<td> Coal Carbon CO<sub>2</sub> Emissions
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</td>
<td [ngClass]="{'selected-modification': selectedModificationIndex == -1}">
{{baselinePhastResults.co2EmissionsOutput.coalCarbonEmissionsOutput | number:'1.0-2'}}</td>
Expand All @@ -392,8 +392,8 @@ <h4 class="show-print print-section-header">Assessment Executive Summary</h4>

<tr>
<td> Electrode CO<sub>2</sub> Emissions
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</td>
<td [ngClass]="{'selected-modification': selectedModificationIndex == -1}">
{{baselinePhastResults.co2EmissionsOutput.electrodeEmissionsOutput | number:'1.0-2'}}</td>
Expand All @@ -408,8 +408,8 @@ <h4 class="show-print print-section-header">Assessment Executive Summary</h4>

<tr>
<td> Other Fuel CO<sub>2</sub> Emissions
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</td>
<td [ngClass]="{'selected-modification': selectedModificationIndex == -1}">
{{baselinePhastResults.co2EmissionsOutput.otherFuelEmissionsOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ <h4 class="show-print print-section-header">Results Data</h4>

<tr>
<td> CO<sub>2</sub> Emissions
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</td>
<td [ngClass]="{'selected-modification': selectedModificationIndex == -1}">
<span *ngIf="baseLineResults.co2EmissionsOutput.hourlyTotalEmissionOutput">
Expand All @@ -423,8 +423,8 @@ <h4 class="show-print print-section-header">Results Data</h4>
</tr>
<tr *ngIf="modificationResults.length > 0" class="tr-underline">
<td> CO<sub>2</sub> Emissions Savings
<span *ngIf="settings.unitsOfMeasure === 'Imperial' || settings.unitsOfMeasure === 'Custom'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.unitsOfMeasure === 'Metric'">(tonne CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Imperial'">(ton CO<sub>2</sub>)</span>
<span *ngIf="settings.emissionsUnit === 'Metric'">(tonne CO<sub>2</sub>)</span>
</td>
<td [ngClass]="{'selected-modification': selectedModificationIndex == -1}">&mdash; &mdash;</td>
<td *ngFor="let mod of modificationResults; let index = index;"
Expand Down
Loading

0 comments on commit 000f62d

Please sign in to comment.