Skip to content

Commit

Permalink
Merge pull request #7278 from ORNL-AMO/issue-6986
Browse files Browse the repository at this point in the history
Issue 6986 - Show Base/Trim instead of order in ordering table and summary table
  • Loading branch information
nbintertech authored Jan 23, 2025
2 parents 9af32db + 740b948 commit e45cd99
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
<tbody *ngFor="let summary of profileSummary">
<tr class="compressor-name-row">
<td colspan="100" class="bold">{{(summary.compressorId | compressorName: inventoryItems)}}
<span *ngIf="checkIsTrim(summary.compressorId)">
<span *ngIf="summary.compressorId === selectedTrimCompressorId">
(Trim)
</span>

</td>
</tr>
<tr>
Expand Down Expand Up @@ -80,12 +79,18 @@
Order
</td>
<td *ngFor="let data of summary.profileSummaryData;">
<span *ngIf="data.order != 0">
{{data.order}}
</span>
<span *ngIf="data.order == 0">
&mdash;
</span>
@if (systemInformation.multiCompressorSystemControls == 'baseTrim') {
<span *ngIf="data.order != 0 && summary.compressorId === selectedTrimCompressorId">Trim</span>
<span *ngIf="data.order != 0 && summary.compressorId !== selectedTrimCompressorId">Base</span>
<span *ngIf="data.order == 0">&mdash;</span>
} @else {
<span *ngIf="data.order != 0">
{{data.order}}
</span>
<span *ngIf="data.order == 0">
&mdash;
</span>
}
</td>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,25 @@ export class ProfileSummaryTableComponent implements OnInit {
systemProfileSetup: SystemProfileSetup;
@Input()
systemInformation: SystemInformation;


selectedTrimCompressorId: string;

@ViewChild('profileTable', { static: false }) profileTable: ElementRef;
allTablesString: string;
constructor() { }

ngOnInit(): void {
if (this.systemInformation.trimSelections && this.systemProfileSetup.dayTypeId) {
let selection = this.systemInformation.trimSelections.find(selection => selection.dayTypeId == this.systemProfileSetup.dayTypeId);
this.selectedTrimCompressorId = selection? selection.compressorId : undefined;
}
}

updateTableString() {
this.allTablesString = this.profileTable.nativeElement.innerText;
}


checkShowAuxiliary() {
let auxTotal: ProfileSummaryTotal = this.totals.find(totalData => { return totalData.auxiliaryPower != 0 });
return auxTotal != undefined;
}

checkIsTrim(compressorId: string): boolean {
if (this.systemInformation.multiCompressorSystemControls == 'baseTrim' && this.systemInformation.trimSelections && this.systemProfileSetup.dayTypeId) {
let selection = this.systemInformation.trimSelections.find(selection => { return selection.dayTypeId == this.systemProfileSetup.dayTypeId && selection.compressorId == compressorId });
return selection != undefined;
} else {
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@
class="btn btn-sm" *ngIf="summaryData.order == 0" (click)="toggleOn(summary, orderIndex)">Off</button>
<button id="{{'order_'+compressorIndex+orderIndex}}" name="{{'order_'+compressorIndex+orderIndex}}"
class="btn btn-sm btn-active" *ngIf="summaryData.order != 0"
(click)="toggleOn(summary, orderIndex)">{{summaryData.order}}</button>
(click)="toggleOn(summary, orderIndex)">
<span *ngIf="summary.compressorId === this.trimSelection">Trim</span>
<span *ngIf="summary.compressorId !== this.trimSelection">Base</span>
</button>
</td>
</tr>
</tbody>
Expand Down

0 comments on commit e45cd99

Please sign in to comment.