Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ngOnInit() {
- //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- //We want to recalculate the ParameterB value when any of the following controls value changes
- if (this.ctrlMetricSelect != null) {
- //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- this.ctrlMetricSelect.valueChanges.debounceTime(200).subscribe(value => {
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- if (value.toString().trim().toUpperCase() == 'METRIC') {
- if (this.ctrlMetricSelect.value != null && this.ctrlMetricSelect.value.trim() !== '') {
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- if (this.pumpCurveCalcData.isUomMetric === false) {
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- this.changeUomFromImperialToMetric(true);
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- }
- }
- else {
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- this.changeUomFromImperialToMetric(false);
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- }
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- }
- else {
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- if (this.ctrlMetricSelect.value != null && this.ctrlMetricSelect.value.trim() !== '') {
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- if (this.pumpCurveCalcData.isUomMetric === true) {
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- this.uomChangeFromMetricToImperial(true);
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- }
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- }
- else {
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- this.uomChangeFromMetricToImperial(false);
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- }
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- }
- // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- });
- //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- }
- //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement