Advertisement
Guest User

methcode

a guest
Jul 14th, 2017
1,583
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     ngOnInit() {
  2.         //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  3.         //We want to recalculate the ParameterB value when any of the following controls value changes
  4.         if (this.ctrlMetricSelect != null) {
  5.           //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  6.           this.ctrlMetricSelect.valueChanges.debounceTime(200).subscribe(value => {
  7.             // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  8.             if (value.toString().trim().toUpperCase() == 'METRIC') {
  9.               if (this.ctrlMetricSelect.value != null && this.ctrlMetricSelect.value.trim() !== '') {
  10.                 // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  11.                 if (this.pumpCurveCalcData.isUomMetric === false) {
  12.                   // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  13.                   this.changeUomFromImperialToMetric(true);
  14.                   // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  15.                 }
  16.               }
  17.               else {
  18.                 // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  19.                 this.changeUomFromImperialToMetric(false);
  20.                 // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  21.               }
  22.               // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  23.             }
  24.             else {
  25.               // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  26.               if (this.ctrlMetricSelect.value != null && this.ctrlMetricSelect.value.trim() !== '') {
  27.                 // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  28.                 if (this.pumpCurveCalcData.isUomMetric === true) {
  29.                   // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  30.                   this.uomChangeFromMetricToImperial(true);
  31.                   // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  32.                 }
  33.                 // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  34.               }
  35.               else {
  36.                 // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  37.                 this.uomChangeFromMetricToImperial(false);
  38.                 // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  39.               }
  40.               // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  41.             }
  42.             // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  43.           });
  44.           //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  45.         }
  46.         //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  47.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement