File

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

Index

Properties
Methods

Constructor

constructor(fileGenerators: FileGenerator[], utils: UtilsService)
Parameters :
Name Type Optional
fileGenerators FileGenerator[] No
utils UtilsService No

Methods

createExportData
createExportData(dataToExport: DataToExport, time: string, isMeasurement: boolean, value: number, valueMax?: number)
Parameters :
Name Type Optional
dataToExport DataToExport No
time string No
isMeasurement boolean No
value number No
valueMax number Yes
Returns : ExportData
createFileName
createFileName(source: string | number, fragmentSeries: string, fileExtension: string)
Parameters :
Name Type Optional
source string | number No
fragmentSeries string No
fileExtension string No
Returns : string
Async exportSeriesData
exportSeriesData(params: SeriesExportParams)

Exports the given data to CSV or Excel files.

Parameters :
Name Type Optional Description
params SeriesExportParams No
  • An object containing all the necessary parameters for the export and zip process.
Returns : Promise<Blob>

A Promise that resolves to a Blob representing the exported file.

Async exportSeriesDataToMergedFiles
exportSeriesDataToMergedFiles(exportData: ExportData[], fileType: string, mergedExportDetails: MergedExportDetails)

Exports the given data to merged CSV or Excel files.

Example of exported merged file structure: date from date to 2024-04-15T12:14:00.000Z 2024-07-16T14:14:28+02:00 time G6Fit -> c8y_Acceleration.accelerationX [G] G6Fit -> c8y_Acceleration.accelerationY [G] 2024-05-13T13:45:10.500+02:00 0.0109026359624273 0.789461628278069

Example of exported file name format: 04dec231240-06dec232350.xlsx

Parameters :
Name Type Optional Description
exportData ExportData[] No
  • An array containing ExportData objects that will be used as parts of the merged file.
fileType string No
  • Indicates the type of the file to be exported.
mergedExportDetails MergedExportDetails No
  • An object containing the date range from which the export was created and aggregation type.

An objects containing file name and its respective content as Blob.

Example of exported merged file structure: date from date to 2024-04-15T12:14:00.000Z 2024-07-16T14:14:28+02:00 time G6Fit -> c8y_Acceleration.accelerationX [G] G6Fit -> c8y_Acceleration.accelerationY [G] 2024-05-13T13:45:10.500+02:00 0.0109026359624273 0.789461628278069

Example of exported file name format: 04dec231240-06dec232350.xlsx

processDataToExport
processDataToExport(dataToExport: DataToExport)

Processes a single dataToExport and transforms it into an array of ExportData.

Used further for creating series data based export and also for measurements and series data based preview. Series data provides min and max values for each timestamp.

Example :
     that can be used as a row data in the exported files or for preview.
Parameters :
Name Type Optional Description
dataToExport DataToExport No
  • A processed measurement or series data combined with the respective properties of the datapoint to be precessed
Returns : ExportData[]

An array of ExportData representing the processed datapoint, that can be used as a row data in the exported files or for preview.

setGenerators
setGenerators(fileGenerators: FileGenerator[])
Parameters :
Name Type Optional
fileGenerators FileGenerator[] No
Returns : void
transformToExportFileStructure
transformToExportFileStructure(dataToExport: DataToExport[])

Transforms the data into a structured format for an export.

Example :
     where each inner array contains ExportData entries representing the transformed measurements and metadata of each datapoint.
Parameters :
Name Type Optional Description
dataToExport DataToExport[] No
  • An array of processed measurement data combined with the respective properties of the datapoint.
Returns : [][]

Provides a two-dimensional array of ExportData, where each inner array contains ExportData entries representing the transformed measurements and metadata of each datapoint.

transformToExportFileStructureForPreview
transformToExportFileStructureForPreview(dataToExport: DataToExport[])

Transforms the input datapoints with values into a structured format for a preview.

Parameters :
Name Type Optional Description
dataToExport DataToExport[] No
  • An array of processed measurement data combined with the respective properties of the datapoint.
Returns : ExportData[]

Provides an array of up to 5 ExportData elements (no more is needed for a preview) or an empty array,

Async zipFiles
zipFiles(files: ExportedFile[])

Zips all created files.

Parameters :
Name Type Optional Description
files ExportedFile[] No
  • An array of objects containing file names and their respective content as Blobs.
Returns : Promise<Blob>

A Promise that resolves to a Blob representing the generated zip file.

Properties

fileTypesConfigs
Type : literal type
mergeMapping
Type : object
Default value : {}

results matching ""

    No results matching ""