File

widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.service.ts

Index

Methods

Methods

determineAggregationValue
determineAggregationValue(interval: TimeRangeInterval)

Determines the aggregation value based on the provided interval.

Parameters :
Name Type Optional Description
interval TimeRangeInterval No
  • The time range interval.
Returns : AggregationOption

The corresponding aggregation value.

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.

determineNewAggregationValue
determineNewAggregationValue(currentValue: AggregationOption, disabledOptions: AggregationOptionStatus)

Determines the new aggregation value based on the current value and disabled options.

Goal is to switch to the next available aggregation option if the current one 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.
Parameters :
Name Type Optional Description
currentValue AggregationOption No
  • The current aggregation option.
disabledOptions AggregationOptionStatus No
  • An object containing disabled options.
Returns : AggregationOption

The new aggregation option.

updateDisabledStateOfAggregationOptionEntries
updateDisabledStateOfAggregationOptionEntries(dateFrom: string, dateTo: string, aggregationValuesArr)

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 starting date of the range.
dateTo string No
  • The ending date of the range.
aggregationValuesArr No
  • An array of aggregation options.

An object containing the disabled state of each aggregation option.

results matching ""

    No results matching ""