Last updated

API / geotoolkit / welllog / data / LogAbstractData / LogAbstractData

Class: LogAbstractData

data.LogAbstractData.LogAbstractData

Define abstract Log data

Hierarchy

Table of contents

Constructors
Methods

Contents

Constructors

new LogAbstractData()

Protected new LogAbstractData()

Overrides

EventDispatcher.constructor

Methods

calculateNeatLimits

Abstract calculateNeatLimits(logScale, centerOnZeroOnNegativeMin, displayUnit): number[]

Return an array of neat min and max

Parameters

Name Type Description
logScalebooleanscale log scale
centerOnZeroOnNegativeMinbooleanIf negative and positive values, center around 0
displayUnitstring | AbstractUnitdisplayed unit

Returns

number[]


clear

Abstract clear(): LogAbstractData

Clear log data. Removes all samples and reset depth limits

Returns

LogAbstractData

this


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

EventDispatcher.dispose


getClassName

getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName


getDataOrder

Abstract getDataOrder(): Order

Return the order of the log data

Returns

Order


getDepth

getDepth(index): number

Return depth by index

Parameters

Name Type Description
indexnumberindex at the depth

Returns

number


getDepths

Abstract getDepths(): number[]

Return an array of depths

Returns

number[]


getIndexAt

getIndexAt(depth, fromIndex?, toIndex?): number

Return index for specified depth

Parameters

Name Type Description
depthnumberThe depth for which you want to compute the index
Optional fromIndexnumberindex of sample in depths
Optional toIndexnumberindex of sample in depths

Returns

number


getIndexUnit

Abstract getIndexUnit(): AbstractUnit

Return the value unit

Throws

when this method is not implemented

Returns

AbstractUnit


getMaxDepth

Abstract getMaxDepth(): number

Return maximum depth

Throws

when this method is not implemented

Returns

number


getMaxMeaningDepth

Abstract getMaxMeaningDepth(): number

Return maximum Meaning depth (last depth with value)

Returns

number


getMaxValue

Abstract getMaxValue(): number

Return maximum data value

Returns

number


getMinDepth

Abstract getMinDepth(): number

Return minimum depth

Throws

when this method is not implemented

Returns

number


getMinMeaningDepth

Abstract getMinMeaningDepth(): number

Return minimum Meaning depth (first depth with value)

Returns

number


getMinValue

Abstract getMinValue(): number

Return minimum data value

Returns

number


getName

Abstract getName(): string

Return name of the data

Returns

string


getSize

Abstract getSize(): number

Return the count of the samples

Returns

number


getState

getState(): LogDataState

Return state

Returns

LogDataState


getTimeStamp

getTimeStamp(): number

Return the value to indicate if data source was changed

Returns

number


getValue

getValue(index): number

Return value by index

Parameters

Name Type Description
indexnumberindex of the sample in the array

Returns

number


getValueAt

getValueAt(depth, fromIndex?, toIndex?, interpolation?): number

Return the value matching the given depth or NaN if the given depth is out of the logdata depth range.

If the depths are strictly increasing:

  • The returned value will be interpolated when necessary. See example 1

If the depths are not strictly increasing but never decreasing:

  • The value returned will be the first one found (in the insertion order). See example 2
  • The value returned will be interpolated between the last one found and its closest larger neighbor. See example 2

If the depths are not always increasing (not forward only):

  • The value returned will be the last one found (in the insertion order). See example 3
  • The value returned will be interpolated between the first one found and its closest larger neighbor. See example 3

Examples assume the default linear interpolation

Example

// Depth Value
// 0      0
// 100    1
// 200    2

getValueAt(100) // -> 1
getValueAt(150) // -> 1.5

Example

// Depth Value
// 0      0
// 100    1
// 100    2
// 200    3

getValueAt(100) // -> 1
getValueAt(150) // -> 2.5

Example

// Depth Value
// 0      0
// 100    1
// 200    2
// 100    3

getValueAt(100) // -> 3
getValueAt(150) // -> 1.5

Parameters

Name Type Description
depthnumberThe depth for which you want to compute the value
Optional fromIndexnumberindex of sample in depths
Optional toIndexnumberindex of sample in depths
Optional interpolationInterpolationTypeinterpolation type for the value

Returns

number


getValueInRange

Abstract getValueInRange(depth, prev, next): number

Return value by depth, using linear interpolation if necessary. See LogAbstractData.findValueAt.

Throws

when this method is not implemented

Parameters

Name Type Description
depthnumberThe depth for which you want to compute the value
prevnumberThe index of the largest previous depth
nextnumberThe index of the smallest following depth

Returns

number


getValueUnit

Abstract getValueUnit(): AbstractUnit

Return the depth unit

Throws

when this method is not implemented

Returns

AbstractUnit


getValues

Abstract getValues(): number[]

Return an array of values

Returns

number[]


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

EventDispatcher.hasEventListener


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

EventDispatcher.isDisposed


isForwardOnly

Abstract isForwardOnly(): boolean

Return true if data is in ascending order

Returns

boolean


isSilent

isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

EventDispatcher.isSilent


notify

notify<E>(type, source, args?): LogAbstractData

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceLogAbstractDataof the event
Optional argsEventMap[E]arguments of the event

Returns

LogAbstractData

this

Overrides

EventDispatcher.notify


off

off<E>(type?, callback?): LogAbstractData

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: LogAbstractData, args: EventMap[E]) => voidfunction to be called

Returns

LogAbstractData

this

Overrides

EventDispatcher.off


on

on<E>(type, callback): LogAbstractData

Attach listener on event that will be called whenever the specified event is delivered to the target

If the callback function is already in the list of event listeners for this target, the function is not added a second time.

If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: LogAbstractData, args: EventMap[E]) => voidto be called

Returns

LogAbstractData

this

Overrides

EventDispatcher.on


requestData

Abstract requestData(range, scale, callback?): void

Parameters

Name Type Description
rangeRangerange
scalenumberscale
Optional callback() => voidcallback to be called after loading data

Returns

void


resumeUpdate

resumeUpdate(forceUpdate): LogAbstractData

Resume update. forceUpdate updates data statistics (update min, max of values, depths...)

Parameters

Name Type Description
forceUpdatebooleanforce update based on the state of the data

Returns

LogAbstractData

this


setIndexUnit

Abstract setIndexUnit(unit): LogAbstractData

Sets index unit

Throws

when this method is not implemented

Parameters

Name Type Description
unitstring | AbstractUnitindex unit

Returns

LogAbstractData

this


setName

Abstract setName(name): LogAbstractData

Set name of the data

Parameters

Name Type Description
namestringThe log data name

Returns

LogAbstractData

this


setSilent

setSilent(bool): LogAbstractData

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

LogAbstractData

this

Inherited from

EventDispatcher.setSilent


setState

setState(state): LogAbstractData

Sets state of data. Values can be (Empty,Normal, Warning,Error,Fetching).

Parameters

Name Type Description
stateLogDataStatestate of data.

Returns

LogAbstractData

this


setValue

Abstract setValue(index, value): LogAbstractData

Set value by index

Throws

when this method is not implemented

Parameters

Name Type Description
indexnumberindex of the sample
valuenumbersample values

Returns

LogAbstractData

this


setValueUnit

Abstract setValueUnit(unit): LogAbstractData

Sets value unit

Throws

when this method is not implemented

Parameters

Name Type Description
unitstring | AbstractUnitvalue unit

Returns

LogAbstractData

this


suspendUpdate

suspendUpdate(): LogAbstractData

Suspend update

Returns

LogAbstractData

this


update

Protected update(args?): void

Notify when data has been changed.

Parameters

Name Type Description
Optional argsLogDataEventoptional parameters

Returns

void


updateDataStatistics

Protected Abstract updateDataStatistics(): LogAbstractData

Update data statistics

Returns

LogAbstractData

this


updateTimeStamp

updateTimeStamp(): void

Update time stamp

Returns

void


findValueAt

Static findValueAt(depth, depths, values, prev, next, interpolation?): number

Utility function to interpolate a value between two depths.

Parameters

Name Type Description
depthnumberThe depth for which you want to compute the value
depthsnumber[]The array of ordered depths
valuesnumber[]The array of values
prevnumberThe index of the largest previous depth
nextnumberThe index of the smallest following depth
Optional interpolationInterpolationTypeinterpolation type for the value

Returns

number

The interpolated value or Number.NaN if outside the range


getClassName

Static getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName


interpolateValueAt

Static interpolateValueAt(depth, depthPrev, valuePrev, depthNext, valueNext, interpolation?): number

Utility function to interpolate a value between two depths.

Parameters

Name Type Description
depthnumberThe depth for which you want to compute the value
depthPrevnumberprev depth
valuePrevnumberprev value
depthNextnumbernext depth
valueNextnumbernext value
Optional interpolationInterpolationTypeinterpolation type for the value

Returns

number

The interpolated value or Number.NaN if outside the range