Skip to content

Commit

Permalink
Merge pull request #290 from NREL/issue-163
Browse files Browse the repository at this point in the history
Issue 163, 207, 249 feedback
  • Loading branch information
rmroot authored Oct 18, 2024
2 parents 21487d8 + 15050ff commit d92f41f
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
border-left: var(--bs-border-width) solid var(--bs-border-color);
}

.utility-row:hover, .utility-row:hover .disabled-input-label {
.utility-row:hover,
.utility-row:hover .disabled-input-label,
.utility-row:hover .disabled-input-label-secondary{
background-color: #efefef;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h6>Utility Types</h6>
&& !(use.utilityType | isStandardUnit :use.energyUnit : 'Energy')">
<div class="col-4">
<div class="input-group">
<input type="text" class="disabled-input-label-secondary" [disabled]="true"
<input type="text" class="form-control disabled-input-label-secondary" [disabled]="true"
value="{{use.utilityType | utilityHhvDisplay}}">
</div>
</div>
Expand Down Expand Up @@ -150,7 +150,9 @@ <h6>Utility Types</h6>
<div class="input-group">
<input name="energySavings" type="number" class="form-control" [(ngModel)]="assessment.energySavings"
(input)="saveChanges()" id="energySavings">
<span class="input-group-text" [innerHTML]="(companyEnergyUnit | unitsDisplay) + '/yr'"></span>
<span *ngIf="numberOfTrackedUtilities !== 1"
class="input-group-text" [innerHTML]="numberOfTrackedUtilities === 1?
(trackedEnergyUnit | unitsDisplay) + '/yr': (companyEnergyUnit | unitsDisplay) + '/yr'"></span>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export class AssessmentDetailsFormComponent {
convertValue = new ConvertValue();

assessmentEnergyOpportunities: Array<IdbEnergyOpportunity>;
numberOfTrackedUtilities: number = 0;
trackedEnergyUnit: string;

constructor(
private assessmentIdbService: AssessmentIdbService,
Expand Down Expand Up @@ -115,6 +117,8 @@ export class AssessmentDetailsFormComponent {

async calculateEnergyUseCost() {
this.updateEnergyOpportunities();
this.numberOfTrackedUtilities = this.assessment.utilityEnergyUses.filter(
_energyUse => _energyUse.include).length;
let use = 0, cost = 0;
this.assessment.utilityTypes.forEach(utilityType => {
let utilityEnergyUse: UtilityEnergyUse = this.assessment.utilityEnergyUses.find(
Expand All @@ -134,11 +138,13 @@ export class AssessmentDetailsFormComponent {
utilityEnergyUse.energyUse,
utilityEnergyUse.energyUnit,
this.companyEnergyUnit).convertedValue;
this.trackedEnergyUnit = utilityEnergyUse.energyUnit;
} else {
convertedUse = this.convertValue.convertValue(
utilityEnergyUse.energyUse * utilityEnergyUse.energyHHV,
utilityEnergyUse.energyUnitStandard,
this.companyEnergyUnit).convertedValue;
this.trackedEnergyUnit = utilityEnergyUse.energyUnitStandard;
}
use += convertedUse;
// calculate cost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@
id="energyUse" name="energyUse">
{{energyEquipment.annualEnergyUse | number:'1.0-2'}}
{{companyEnergyUnit | unitsDisplay}}
({{energyEquipment.annualEnergyUseByUtility | number:'1.0-2'}}
{{energyEquipment.facilityUtilityUnit | unitsDisplay}})
<div *ngIf="companyEnergyUnit !== energyEquipment.facilityUtilityUnit">
&nbsp;/&nbsp;{{energyEquipment.annualEnergyUseByUtility | number:'1.0-2'}}
{{energyEquipment.facilityUtilityUnit | unitsDisplay}}
</div>
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
border-left: var(--bs-border-width) solid var(--bs-border-color);
}

.utility-row:hover, .utility-row:hover .disabled-input-label {
.utility-row:hover,
.utility-row:hover .disabled-input-label,
.utility-row:hover .disabled-input-label-secondary{
background-color: #efefef;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h6>Utility Types</h6>
&& !(use.utilityType | isStandardUnit :use.energyUnit : 'Energy')">
<div class="col-4">
<div class="input-group">
<input type="text" class="disabled-input-label-secondary" [disabled]="true"
<input type="text" class="form-control disabled-input-label-secondary" [disabled]="true"
value="{{use.utilityType | utilityHhvDisplay}}">
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/app/shared/constants/assessmentTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const AssessmentOptions: Array<AssessmentOption> = [
{assessmentType: "Pump", utilityTypes: ['Electricity']},
{assessmentType: "Fan", utilityTypes: ['Electricity']},
{assessmentType: "Process heating", utilityTypes: ['Natural Gas', 'Other Fuels', 'Electricity']},
{assessmentType: "Steam", utilityTypes: ['Natural Gas', "Other Fuels", 'Electricity']},
{assessmentType: "Compressed Air", utilityTypes: ['Electricity']},
{assessmentType: "Steam", utilityTypes: ['Natural Gas', "Other Fuels", 'Electricity', 'Steam']},
{assessmentType: "Compressed Air", utilityTypes: ['Electricity', 'Compressed Air']},
// {assessmentType: "Water", utilityTypes: ['Water']},
{assessmentType: "Treasure Hunt", utilityTypes: UtilityTypes},
{assessmentType: "Other", utilityTypes: UtilityTypes}
Expand Down

0 comments on commit d92f41f

Please sign in to comment.