File

datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.service.ts

Index

Methods

Constructor

constructor(aggregationService: AggregationService, alertService: AlertService, datapointsExportSelectorDataProcessingService: DataProcessingService, translateService: TranslateService)
Parameters :
Name Type Optional
aggregationService AggregationService No
alertService AlertService No
datapointsExportSelectorDataProcessingService DataProcessingService No
translateService TranslateService No

Methods

cleanupCachedData
cleanupCachedData()
Returns : void
determineInterval
determineInterval(dateFrom: string, dateTo: string)

Determines the interval between two dates.

Parameters :
Name Type Optional Description
dateFrom string No
  • The starting date in ISO 8601 string format.
dateTo string No
  • The ending date in ISO 8601 string format.
Returns : TimeRangeInterval

The time range interval unit.

Async getMeasurementExportedDataBlob
getMeasurementExportedDataBlob(extension: string, dataToExport: DataToExportWithBackendCreatedFile[])
Parameters :
Name Type Optional
extension string No
dataToExport DataToExportWithBackendCreatedFile[] No
Returns : Promise<Blob | null>
Async getSeriesExportedDataBlob
getSeriesExportedDataBlob(fileType: string, dataToExport: DataToExport[], mergedExportDetails: MergedExportDetails)
Parameters :
Name Type Optional
fileType string No
dataToExport DataToExport[] No
mergedExportDetails MergedExportDetails No
Returns : Promise<Blob | null>
setToFirstAvailableAggregationOptionIfCurrentIsDisabled
setToFirstAvailableAggregationOptionIfCurrentIsDisabled(aggregationValue: string, disabledAggregationOptions: AggregationOptionStatus)

Sets the aggregation control to the first available (non-disabled) option if the current option is disabled.

This method:

  • Retrieves the current value of the aggregation control.
  • Checks if the current aggregation option is disabled.
  • If the current option is disabled, sets the control to the first available (non-disabled) option based on the following order:
    • If the current value is DAILY, it switches to HOURLY if it's not disabled, otherwise to MINUTELY if HOURLY is also disabled.
    • If the current value is HOURLY, it switches to MINUTELY if it's not disabled.
    • If all options are disabled, it sets the value to NONE.

The disabled state is stored in the disabledAggregationOptions object, where the key is the aggregation value and the value is a boolean indicating whether the option is disabled.

The AGGREGATION_VALUES object defines the possible aggregation values.

Parameters :
Name Type Optional Description
aggregationValue string No
  • The value of the current aggregation option.
disabledAggregationOptions AggregationOptionStatus No
  • An object containing disabled aggregation options.
Returns : AggregationOption

The new aggregation option to be set.

updateDisabledStateOfAggregationOptionEntries
updateDisabledStateOfAggregationOptionEntries(dateFrom: string, dateTo: string, disabledAggregationOptions: AggregationOptionStatus)

Updates the disabled state of aggregation options based on the current value of the time interval form control.

This method:

  • Retrieves the current date range from the form controls.
  • Determines the current time interval based on the date range.
  • Sets the disabled state for each aggregation option based on predefined conditions.

The disabled state is stored in the disabledAggregationOptions object, where the key is the aggregation value and the value is a boolean indicating whether the option should be disabled.

The disabledConditions object defines the conditions under which each aggregation option should be disabled.

Parameters :
Name Type Optional Description
dateFrom string No
  • The value of the "date from" input.
dateTo string No
  • The value of the "date to" input.
disabledAggregationOptions AggregationOptionStatus No
  • The object containing the disabled state of aggregation options.

The updated object with the disabled state of aggregation options.

results matching ""

    No results matching ""