libs/depiction/src/lib/datasetlist/timeseries/first-latest-timeseries-entry/first-latest-timeseries-entry.component.ts
Extends the ConfigurableTimeseriesEntryComponent, with the following functions:
ConfigurableTimeseriesEntryComponent
selector | n52-first-latest-timeseries-entry |
styleUrls | ./first-latest-timeseries-entry.component.css |
templateUrl | ./first-latest-timeseries-entry.component.html |
constructor(servicesConnector: HelgolandServicesConnector, internalIdHandler: InternalIdHandler, translateSrvc: TranslateService, timeSrvc: Time)
|
|||||||||||||||
Parameters :
|
timeInterval | |
Type : TimeInterval
|
|
datasetOptions | |
Type : DatasetOptions
|
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
|
Defined in
ConfigurableTimeseriesEntryComponent:20
|
highlight | |
Type : boolean
|
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
|
Defined in
ConfigurableTimeseriesEntryComponent:23
|
datasetId | |
Type : string
|
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
|
Defined in
ConfigurableTimeseriesEntryComponent:15
|
selected | |
Type : boolean
|
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
|
Defined in
ConfigurableTimeseriesEntryComponent:18
|
datasetId | |
Type : string
|
|
Inherited from
ListEntryComponent
|
|
Defined in
ListEntryComponent:15
|
selected | |
Type : boolean
|
|
Inherited from
ListEntryComponent
|
|
Defined in
ListEntryComponent:18
|
onSelectDate | |
Type : EventEmitter<Date>
|
|
onEditOptions | |
Type : EventEmitter<DatasetOptions>
|
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
|
Defined in
ConfigurableTimeseriesEntryComponent:29
|
onShowGeometry | |
Type : EventEmitter<GeoJSON.GeoJsonObject>
|
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
|
Defined in
ConfigurableTimeseriesEntryComponent:32
|
onUpdateOptions | |
Type : EventEmitter<DatasetOptions>
|
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
|
Defined in
ConfigurableTimeseriesEntryComponent:26
|
onDeleteDataset | |
Type : EventEmitter<boolean>
|
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
|
Defined in
ConfigurableTimeseriesEntryComponent:21
|
onSelectDataset | |
Type : EventEmitter<boolean>
|
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
|
Defined in
ConfigurableTimeseriesEntryComponent:24
|
onDeleteDataset | |
Type : EventEmitter<boolean>
|
|
Inherited from
ListEntryComponent
|
|
Defined in
ListEntryComponent:21
|
onSelectDataset | |
Type : EventEmitter<boolean>
|
|
Inherited from
ListEntryComponent
|
|
Defined in
ListEntryComponent:24
|
Private checkDataInTimespan |
checkDataInTimespan()
|
Returns :
void
|
Public jumpToFirstTimeStamp |
jumpToFirstTimeStamp()
|
Returns :
void
|
Public jumpToLastTimeStamp |
jumpToLastTimeStamp()
|
Returns :
void
|
Public ngOnChanges | ||||||
ngOnChanges(changes: SimpleChanges)
|
||||||
Parameters :
Returns :
void
|
Protected setParameters |
setParameters()
|
Returns :
void
|
Public editDatasetOptions |
editDatasetOptions()
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:47
|
Returns :
void
|
Public showGeometry |
showGeometry()
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:51
|
Returns :
void
|
Public toggleVisibility |
toggleVisibility()
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:42
|
Returns :
void
|
Protected loadDataset | ||||||
loadDataset(lang?: string)
|
||||||
Inherited from
ConfigurableTimeseriesEntryComponent
|
||||||
Defined in
ConfigurableTimeseriesEntryComponent:42
|
||||||
Parameters :
Returns :
void
|
Protected setDataset | ||||||
setDataset(timeseries: HelgolandTimeseries)
|
||||||
Inherited from
ConfigurableTimeseriesEntryComponent
|
||||||
Defined in
ConfigurableTimeseriesEntryComponent:50
|
||||||
Parameters :
Returns :
void
|
Protected setParameters |
setParameters()
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:56
|
Returns :
void
|
Protected Abstract loadDataset | ||||||
loadDataset(lang?: string)
|
||||||
Inherited from
ConfigurableTimeseriesEntryComponent
|
||||||
Defined in
ConfigurableTimeseriesEntryComponent:64
|
||||||
Parameters :
Returns :
void
|
Public ngOnDestroy |
ngOnDestroy()
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:45
|
Returns :
void
|
Public ngOnInit |
ngOnInit()
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:37
|
Returns :
void
|
Protected onLanguageChanged | ||||||
onLanguageChanged(langChangeEvent: LangChangeEvent)
|
||||||
Inherited from
ConfigurableTimeseriesEntryComponent
|
||||||
Defined in
ConfigurableTimeseriesEntryComponent:58
|
||||||
Parameters :
Returns :
void
|
Public removeDataset |
removeDataset()
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:49
|
Returns :
void
|
Public toggleSelection |
toggleSelection()
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:53
|
Returns :
void
|
Protected loadDataset | ||||||
loadDataset(lang?: string)
|
||||||
Inherited from
SimpleTimeseriesEntryComponent
|
||||||
Defined in
SimpleTimeseriesEntryComponent:42
|
||||||
Parameters :
Returns :
void
|
Protected setDataset | ||||||
setDataset(timeseries: HelgolandTimeseries)
|
||||||
Inherited from
SimpleTimeseriesEntryComponent
|
||||||
Defined in
SimpleTimeseriesEntryComponent:50
|
||||||
Parameters :
Returns :
void
|
Protected setParameters |
setParameters()
|
Inherited from
SimpleTimeseriesEntryComponent
|
Defined in
SimpleTimeseriesEntryComponent:56
|
Returns :
void
|
Protected Abstract loadDataset | ||||||
loadDataset(lang?: string)
|
||||||
Inherited from
ListEntryComponent
|
||||||
Defined in
ListEntryComponent:64
|
||||||
Parameters :
Returns :
void
|
Public ngOnDestroy |
ngOnDestroy()
|
Inherited from
ListEntryComponent
|
Defined in
ListEntryComponent:45
|
Returns :
void
|
Public ngOnInit |
ngOnInit()
|
Inherited from
ListEntryComponent
|
Defined in
ListEntryComponent:37
|
Returns :
void
|
Protected onLanguageChanged | ||||||
onLanguageChanged(langChangeEvent: LangChangeEvent)
|
||||||
Inherited from
ListEntryComponent
|
||||||
Defined in
ListEntryComponent:58
|
||||||
Parameters :
Returns :
void
|
Public removeDataset |
removeDataset()
|
Inherited from
ListEntryComponent
|
Defined in
ListEntryComponent:49
|
Returns :
void
|
Public toggleSelection |
toggleSelection()
|
Inherited from
ListEntryComponent
|
Defined in
ListEntryComponent:53
|
Returns :
void
|
Public firstValue |
Type : FirstLastValue
|
Public hasData |
Default value : true
|
Public lastValue |
Type : FirstLastValue
|
Public categoryLabel |
Type : string
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:31
|
Public dataset |
Type : HelgolandTimeseries
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:26
|
Public phenomenonLabel |
Type : string
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:29
|
Public platformLabel |
Type : string
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:28
|
Public procedureLabel |
Type : string
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:30
|
Public uom |
Type : string
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:32
|
Protected internalId |
Type : InternalDatasetId
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:28
|
Private langChangeSubscription |
Type : Subscription
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:30
|
Public loading |
Type : boolean
|
Inherited from
ConfigurableTimeseriesEntryComponent
|
Defined in
ConfigurableTimeseriesEntryComponent:26
|
Public categoryLabel |
Type : string
|
Inherited from
SimpleTimeseriesEntryComponent
|
Defined in
SimpleTimeseriesEntryComponent:31
|
Public dataset |
Type : HelgolandTimeseries
|
Inherited from
SimpleTimeseriesEntryComponent
|
Defined in
SimpleTimeseriesEntryComponent:26
|
Public phenomenonLabel |
Type : string
|
Inherited from
SimpleTimeseriesEntryComponent
|
Defined in
SimpleTimeseriesEntryComponent:29
|
Public platformLabel |
Type : string
|
Inherited from
SimpleTimeseriesEntryComponent
|
Defined in
SimpleTimeseriesEntryComponent:28
|
Public procedureLabel |
Type : string
|
Inherited from
SimpleTimeseriesEntryComponent
|
Defined in
SimpleTimeseriesEntryComponent:30
|
Public uom |
Type : string
|
Inherited from
SimpleTimeseriesEntryComponent
|
Defined in
SimpleTimeseriesEntryComponent:32
|
Protected internalId |
Type : InternalDatasetId
|
Inherited from
ListEntryComponent
|
Defined in
ListEntryComponent:28
|
Private langChangeSubscription |
Type : Subscription
|
Inherited from
ListEntryComponent
|
Defined in
ListEntryComponent:30
|
Public loading |
Type : boolean
|
Inherited from
ListEntryComponent
|
Defined in
ListEntryComponent:26
|
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
import { FirstLastValue, HelgolandServicesConnector, InternalIdHandler, Time, TimeInterval } from '@helgoland/core';
import { TranslateService } from '@ngx-translate/core';
import {
ConfigurableTimeseriesEntryComponent,
} from '../configurable-timeseries-entry/configurable-timeseries-entry.component';
/**
* Extends the ConfigurableTimeseriesEntryComponent, with the following functions:
* - first and latest validation
* - jump to first and latest value events
*/
@Component({
selector: 'n52-first-latest-timeseries-entry',
templateUrl: './first-latest-timeseries-entry.component.html',
styleUrls: ['./first-latest-timeseries-entry.component.css']
})
export class FirstLatestTimeseriesEntryComponent extends ConfigurableTimeseriesEntryComponent implements OnChanges {
@Input()
public timeInterval: TimeInterval;
@Output()
public onSelectDate: EventEmitter<Date> = new EventEmitter();
public firstValue: FirstLastValue;
public lastValue: FirstLastValue;
public hasData = true;
constructor(
protected servicesConnector: HelgolandServicesConnector,
protected internalIdHandler: InternalIdHandler,
protected translateSrvc: TranslateService,
protected timeSrvc: Time
) {
super(servicesConnector, internalIdHandler, translateSrvc);
}
public ngOnChanges(changes: SimpleChanges): void {
if (changes.timeInterval) {
this.checkDataInTimespan();
}
}
public jumpToFirstTimeStamp() {
this.onSelectDate.emit(new Date(this.dataset.firstValue.timestamp));
}
public jumpToLastTimeStamp() {
this.onSelectDate.emit(new Date(this.dataset.lastValue.timestamp));
}
protected setParameters() {
super.setParameters();
this.firstValue = this.dataset.firstValue;
this.lastValue = this.dataset.lastValue;
this.checkDataInTimespan();
}
private checkDataInTimespan() {
if (this.timeInterval && this.dataset && this.dataset.firstValue && this.dataset.lastValue) {
this.hasData = this.timeSrvc.overlaps(
this.timeInterval,
this.dataset.firstValue.timestamp,
this.dataset.lastValue.timestamp
);
}
}
}
<span>{{procedureLabel}} - {{platformLabel}}</span>
<span>Has Data: {{hasData}}</span>
<button *ngIf="firstValue" (click)="jumpToFirstTimeStamp()">{{firstValue.value}} - {{firstValue.timestamp | tzDate: 'L LT z'}}</button>
<button *ngIf="lastValue" (click)="jumpToLastTimeStamp()">{{lastValue.value}} - {{lastValue.timestamp | tzDate: 'L LT z'}}</button>
./first-latest-timeseries-entry.component.css