components/parameter-summary/parameter-summary.component.ts
Summary of parameters entered, form field values to call service.
selector | app-parameter-summary |
imports |
MatList
MatListItem
|
templateUrl | ./parameter-summary.component.html |
styleUrl | ./parameter-summary.component.scss |
Properties |
constructor(service: AppService)
|
||||||
Parameters :
|
form |
Default value : this.service.formGroup
|
Control form field state |
gmms |
Default value : computed(() => this.service.usage()?.response?.parameters.gmm.values)
|
List of GMMs |
imtIdToDisplay |
Default value : gmmUtils.imtIdToDisplay
|
Function to convert IMT id to display |
Params |
Default value : MultiSelectableParam
|
Parameters |
import {Component, computed} from '@angular/core';
import {MatList, MatListItem} from '@angular/material/list';
import {gmmUtils, MultiSelectableParam} from '@ghsc/nshmp-lib-ng/gmm';
import {AppService} from '../../services/app.service';
/**
* Summary of parameters entered, form field values to call service.
*/
@Component({
imports: [MatList, MatListItem],
selector: 'app-parameter-summary',
styleUrl: './parameter-summary.component.scss',
templateUrl: './parameter-summary.component.html',
})
export class ParameterSummaryComponent {
/** Parameters */
Params = MultiSelectableParam;
/** Function to convert IMT id to display */
imtIdToDisplay = gmmUtils.imtIdToDisplay;
/** Control form field state */
form = this.service.formGroup;
/** List of GMMs */
gmms = computed(() => this.service.usage()?.response?.parameters.gmm.values);
constructor(private service: AppService) {}
}
<div class="grid-row parameter-summary">
<div class="grid-col-12 tablet-lg:grid-col-6">
<mat-list class="parameter-list">
<mat-list-item>
<span class="parameter">Ground Motion Models</span>:
</mat-list-item>
@for (gmmSource of form?.value?.gmmSource; track gmmSource) {
<mat-list-item class="indent-list font-small">
{{ gmmSource.gmm.display }}
</mat-list-item>
}
</mat-list>
</div>
<div class="grid-col-12 tablet-lg:grid-col-3">
<mat-list class="parameter-list">
@if (form.value.multiSelectableParam === Params.MW) {
<mat-list-item>
<span class="parameter">Magnitude</span>:
</mat-list-item>
@for (Mw of form?.value?.MwMulti; track Mw) {
<mat-list-item class="indent-list">
{{ Mw }}
</mat-list-item>
}
} @else {
<mat-list-item>
<span class="parameter">Magnitude</span>:
{{ form?.value?.Mw }}
</mat-list-item>
}
<mat-list-item>
<span class="parameter">Rake</span>: {{ form?.value?.rake }}°
</mat-list-item>
<mat-list-item>
<span class="parameter"> Z<sub>HYP</sub> </span>:
{{ form?.value?.zHyp }} km
</mat-list-item>
<mat-list-item>
<span class="parameter">Centered Down-Dip</span>:
{{ form.value.zHypCentered === true ? 'On' : 'Off' }}
</mat-list-item>
<mat-list-item>
<span class="parameter"> Z<sub>TOR</sub> </span>:
{{ form?.value?.zTor }} km
</mat-list-item>
<mat-list-item>
<span class="parameter">Dip</span>: {{ form?.value?.dip }}°
</mat-list-item>
<mat-list-item>
<span class="parameter">Width</span>: {{ form?.value?.width }} km
</mat-list-item>
<mat-list-item>
<span class="parameter"> R<sub>X</sub> </span>:
{{ form?.value?.rX }}
km
</mat-list-item>
</mat-list>
</div>
<div class="grid-col-12 tablet-lg:grid-col-3">
<mat-list class="parameter-list">
<mat-list-item>
<span class="parameter"> R<sub>RUP</sub> </span>:
{{ form?.value?.rRup }}
km
</mat-list-item>
<mat-list-item>
<span class="parameter"> R<sub>JB</sub> </span>:
{{ form?.value?.rJB }}
km
</mat-list-item>
<mat-list-item>
<span class="parameter">Derive R<sub>JB</sub> & R<sub>RUP</sub></span
>:
{{ form.value.derivePathParams === true ? 'On' : 'Off' }}
</mat-list-item>
<mat-list-item>
<span class="parameter">Wall</span>:
{{ form?.value?.hangingWall ? 'Hanging Wall' : 'Footwall' }}
</mat-list-item>
@if (form.value.multiSelectableParam === Params.VS30) {
<mat-list-item> <span class="parameter">Vs30</span>: </mat-list-item>
@for (vs30 of form?.value?.vs30Multi; track vs30) {
<mat-list-item class="indent-list">
{{ vs30 }}
<sup> m</sup>/<sub>s</sub>
</mat-list-item>
}
} @else {
<mat-list-item>
<span class="parameter">Vs30</span>: {{ form?.value?.vs30 }}
<sup> m</sup>/<sub>s</sub>
</mat-list-item>
}
<mat-list-item>
<span class="parameter"> Z<sub>1.0</sub> </span>:
{{ form?.value?.z1p0 }}
@if (form?.value?.z1p0) {
<span> km</span>
}
</mat-list-item>
<mat-list-item>
<span class="parameter"> Z<sub>2.5</sub> </span>:
{{ form?.value?.z2p5 }}
@if (form?.value?.z2p5) {
<span> km</span>
}
</mat-list-item>
<mat-list-item>
<span class="parameter"> Z<sub>SED</sub> </span>:
{{ form?.value?.zSed }}
@if (form?.value?.zSed) {
<span> km</span>
}
</mat-list-item>
</mat-list>
</div>
</div>