diff --git a/src/app/shared/helper-pipes/degree-day-total.pipe.ts b/src/app/shared/helper-pipes/degree-day-total.pipe.ts index 5a5211e6b..5ce779936 100644 --- a/src/app/shared/helper-pipes/degree-day-total.pipe.ts +++ b/src/app/shared/helper-pipes/degree-day-total.pipe.ts @@ -20,7 +20,16 @@ export class DegreeDayTotalPipe implements PipeTransform { }); return totalMinutes / 1440; } else { - let weatherDataSelection: WeatherDataSelection = sumBy as WeatherDataSelection; + let weatherDataSelection: WeatherDataSelection; + if (sumBy == 'coolingDegreeDay') { + weatherDataSelection = 'CDD'; + } else if (sumBy == 'heatingDegreeDay') { + weatherDataSelection = 'HDD'; + } else if (sumBy == 'dryBulbTemp') { + weatherDataSelection = 'dryBulbTemp'; + } else if (sumBy == 'relativeHumidity') { + weatherDataSelection = 'relativeHumidity'; + } return getDegreeDayAmount(values, weatherDataSelection); } } diff --git a/src/app/shared/helper-services/backup-data.service.ts b/src/app/shared/helper-services/backup-data.service.ts index 56daa7a60..3a5f22092 100644 --- a/src/app/shared/helper-services/backup-data.service.ts +++ b/src/app/shared/helper-services/backup-data.service.ts @@ -150,9 +150,6 @@ export class BackupDataService { } async importAccountBackupFile(backupFile: BackupFile): Promise { - - console.log(backupFile); - this.analyticsService.sendEvent('import_backup_file'); this.loadingService.setLoadingMessage('Adding Account...'); let accountGUIDs: { oldId: string, newId: string } = { @@ -324,6 +321,7 @@ export class BackupDataService { delete predictorData.id; predictorData.guid = newGUID; predictorData.accountId = accountGUIDs.newId; + predictorData.date = this.getImportDate(predictorData.date); predictorData.facilityId = this.getNewId(predictorData.facilityId, facilityGUIDs); predictorData.predictorId = this.getNewId(predictorData.predictorId, predictorGUIDs); await firstValueFrom(this.predictorDataDbService.addWithObservable(predictorData)); diff --git a/src/app/shared/helper-services/degree-days.service.ts b/src/app/shared/helper-services/degree-days.service.ts index 22e90664a..edc212d1d 100644 --- a/src/app/shared/helper-services/degree-days.service.ts +++ b/src/app/shared/helper-services/degree-days.service.ts @@ -160,22 +160,12 @@ export class DegreeDaysService { let heatingDegreeDifference: number = 0; let coolingDegreeDay: number = 0; let coolingDegreeDifference: number = 0; - if (averageDryBulbTemp < baseHeatingTemperature) { - heatingDegreeDifference = baseHeatingTemperature - averageDryBulbTemp; - heatingDegreeDay = heatingDegreeDifference * portionOfDay; - } - let gapInData: boolean = false let minutesBetween: number = this.getMinutesBetweenDates(previousDate, localClimatologicalDataMonth[i].DATE); if (minutesBetween > 720) { gapInData = true; } if (averageDryBulbTemp < baseHeatingTemperature || averageDryBulbTemp > baseCoolingTemperature) { - - let heatingDegreeDay: number = 0; - let heatingDegreeDifference: number = 0; - let coolingDegreeDay: number = 0; - let coolingDegreeDifference: number = 0; if (averageDryBulbTemp < baseHeatingTemperature) { heatingDegreeDifference = baseHeatingTemperature - averageDryBulbTemp; heatingDegreeDay = heatingDegreeDifference * portionOfDay; diff --git a/src/app/weather-data/monthly-station-data/monthly-station-data.component.html b/src/app/weather-data/monthly-station-data/monthly-station-data.component.html index 9a4836788..110f9e3a2 100644 --- a/src/app/weather-data/monthly-station-data/monthly-station-data.component.html +++ b/src/app/weather-data/monthly-station-data/monthly-station-data.component.html @@ -88,7 +88,7 @@ [weatherDataSelection]="weatherDataSelection"> -
+
Error occured while calculating degree days. diff --git a/src/app/weather-data/monthly-station-data/monthly-station-table/monthly-station-table.component.html b/src/app/weather-data/monthly-station-data/monthly-station-table/monthly-station-table.component.html index 6120ca3a0..da99add40 100644 --- a/src/app/weather-data/monthly-station-data/monthly-station-table/monthly-station-table.component.html +++ b/src/app/weather-data/monthly-station-data/monthly-station-table/monthly-station-table.component.html @@ -64,6 +64,9 @@ + + + {{detailedDegreeDays | degreeDayTotal: 'dryBulbTemp' | number:'1.0-1'}} % {{detailedDegreeDays | degreeDayTotal: 'heatingDegreeDay' | number}} @@ -74,9 +77,6 @@ {{detailedDegreeDays | degreeDayTotal: 'relativeHumidity' | number:'1.0-4'}} % - - {{detailedDegreeDays | degreeDayTotal: 'dryBulbTemp' | number:'1.0-1'}} % -