Options
All
  • Public
  • Public/Protected
  • All
Menu

External module data

Introduction

The piweb.data interface exposes methods to retrieve the inspection plan items, measurements, values and raw data that is bound to the plot extension element. Be aware that the data can change. Whenever this happens, the plot extension engine will emit the dataChanged event.

import * as piweb from 'piweb';
import data = piweb.data;

piweb.events.on("dataChanged", loadData);

function loadData() {
    const configuration = data.getConfiguration();
    const inspectionPlan = data.getInspectionPlan();
    ...
}

Index

Modules

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

AttributeType

AttributeType: "string" | "integer" | "float" | "date" | "catalog"

AttributeValue

AttributeValue: string | number | Date

ConfigurationEntity

ConfigurationEntity: "characteristic" | "part" | "measurement" | "measurementValue" | "catalog"

FormplotType

FormplotType: "none" | "circle" | "plane" | "curve" | "line" | "cylinder" | "pitch" | "borePattern" | "circleInProfile" | "fourier"

Known types of plot geometries, usually used for different plot types.

InspectionPlanItemType

InspectionPlanItemType: "characteristic" | "part"

PlotDeviationType

PlotDeviationType: "none" | "length" | "angle"

Known deviation types of formplots.

PlotGeometryType

PlotGeometryType: "none" | "circle" | "circleInProfile" | "curve" | "cylinder" | "line" | "pitch" | "plane"

Known types of plot geometries, usually used for different plot types.

PlotPropertyType

PlotPropertyType: "string" | "integer" | "float" | "date" | "timespan"

The supported datatypes for plot properties.

PlotPropertyValue

PlotPropertyValue: string | number | Date

Represents the value of a plot property. Timespans are stored as a number, which is the number of milliseconds.

PlotToleranceType

PlotToleranceType: "linear" | "radial" | "rectangular" | "spatial"

Known types of plot tolerances, usually used for different plot types.

RawDataEntity

RawDataEntity: "part" | "characteristic" | "measurement" | "measurementValue"

An enumeration to identify the entity to which a raw data item is attached.

SegmentType

SegmentType: "none" | "circle" | "line" | "helix" | "touchingPoint" | "maxGapPoint" | "bendingCircle" | "axis" | "nominalReferenceProfile" | "nominalMeasureProfile" | "actualReferenceProfile" | "actualMeasureProfile" | "nominalProfile" | "actualProfile"

Known segment types that indicate the supposed usage of a segment.

version

1.4

VolumeDirection

VolumeDirection: "x" | "y" | "z"

Known volume directions / planes

version

1.1

Variables

Private neutralId

neutralId: "" = ""

Private provider

provider: any = require.binding('RawDataProvider')

Private provider

provider: any = require.binding('DataImageProvider')

Private provider

provider: any = require.binding('DataImageProvider')

Private provider

provider: any = require.binding('DataImageProvider')

Private provider

provider: any = require.binding('DefectImageProvider')

Private provider

provider: any = require.binding('FormplotProvider')

Private provider

provider: any = require.binding('VolumeProvider')

Functions

Private IsGreaterThanOrEqualTo

  • IsGreaterThanOrEqualTo(x: number, y: number, tolerance: number): boolean
  • Parameters

    • x: number
    • y: number
    • tolerance: number

    Returns boolean

Private IsLessThanOrEqualTo

  • IsLessThanOrEqualTo(x: number, y: number, tolerance: number): boolean
  • Parameters

    • x: number
    • y: number
    • tolerance: number

    Returns boolean

Private calculateDerivedValue

  • calculateDerivedValue(toleranceFactor: number | undefined, tolerance: number | undefined, referenceValue: number | undefined): number | undefined
  • Parameters

    • toleranceFactor: number | undefined
    • tolerance: number | undefined
    • referenceValue: number | undefined

    Returns number | undefined

Private calculateDistance

  • calculateDistance(value: number, limit: Limit, referenceValue: number): any
  • Parameters

    • value: number
    • limit: Limit
    • referenceValue: number

    Returns any

Private calculateUsage

  • calculateUsage(value: number, limit: Limit, referenceValue: number, precision?: number): number
  • Parameters

    • value: number
    • limit: Limit
    • referenceValue: number
    • Default value precision: number = 0.000001

    Returns number

Private createLimitCollection

Private createLimitContext

Private createRawDataIdentity

  • createRawDataIdentity(inspectionId: string | undefined, measurementId: string | undefined, key: number): Buffer
  • Parameters

    • inspectionId: string | undefined
    • measurementId: string | undefined
    • key: number

    Returns Buffer

Private createSliceDefinition

  • createSliceDefinition(inspectionId: string | undefined, measurementId: string | undefined, key: number, direction: VolumeDirection, index: number): Buffer
  • Parameters

    • inspectionId: string | undefined
    • measurementId: string | undefined
    • key: number
    • direction: VolumeDirection
    • index: number

    Returns Buffer

escapeEntityName

  • escapeEntityName(name: string): string
  • Escapes inspection plan entity names which would be invalid as a path element.

    Parameters

    • name: string

      inspection plan entity name to escape.

    Returns string

Private getCatalogs

  • Returns Catalog[]

getConfiguration

  • Returns the database configuration from the PiWeb server.

    host

    Returns Configuration

getDefectCollection

  • Returns all defect plots that are bound to the plot extension element with databinding. You can change the databinding in PiWeb Designer. The defects are grouped by the measurement value they are associated to. Such a group or bundle is called DefectPlot. You can iterate either the defects or the plots by calling the getPlots method of the collection.

    version

    1.1

    host

    Returns DefectCollection

getFormplotCollection

  • Returns all formplots that are bound to the plot extension element with databinding. You can change the databinding in PiWeb Designer.

    version

    1.4

    host

    Returns FormplotCollection

getInspectionPlanCollection

  • Returns all inspection plan items that are bound to the plot extension element with databinding. You can change the databinding in PiWeb Designer.

    host

    Parameters

    • Default value requestedAttributes: Array<number> | undefined = undefined

    Returns InspectionPlanCollection

getMeasurementCollection

  • Returns all measurements that are associated to the parts that are bound to the plot extension element with databinding. You can change the databinding and the measurement selection in PiWeb Designer.

    host

    Parameters

    • Default value requestedAttributes: Array<number> | undefined = undefined

    Returns MeasurementCollection

getRawDataCollection

  • Returns a list of all raw data entries that are bound to the plot extension via databinding. Since the raw data files are possibly quite large, they are not copied by the plot extension engine.

    function getRawDataCollection() : RawDataCollection;
    

    You can specify the entity from which you wish to get the raw data in the package definition.

    host

    Returns RawDataCollection

getRawDataSources

  • Returns the raw data entities from which the plot extension fetches the raw data.

    host

    Returns Iterable<RawDataEntity>

Private getReferenceValue

  • getReferenceValue(toleranceLimit: Limit, nominalValue: number | undefined, lowerValueIsNatural: boolean, upperValueIsNatural: boolean, limitReference: LimitUsageReference): number | undefined
  • Parameters

    • toleranceLimit: Limit
    • nominalValue: number | undefined
    • lowerValueIsNatural: boolean
    • upperValueIsNatural: boolean
    • limitReference: LimitUsageReference

    Returns number | undefined

getVolumeCollection

  • Returns a list of all volumes that are bound to the plot extension via databinding. Since the volumes are possibly very large, they are not copied by the plot extension engine.

    function getVolumeCollection() : VolumeCollection;
    

    You can specify the entity from which you wish to get the volume in the package definition.

    version

    1.1

    host

    Returns VolumeCollection

getVolumeSources

  • Returns the raw data entities from which the plot extension fetches the volumes.

    version

    1.1

    host

    Returns Iterable<RawDataEntity>

Private isNominalValueValid

  • isNominalValueValid(nominalValue: number | undefined, limit: Limit): boolean
  • Parameters

    • nominalValue: number | undefined
    • limit: Limit

    Returns boolean

Private listRawData

  • Returns Iterable<RawDataItem>

Private mapAttributeType

  • mapAttributeType(attributeType: AttributeTypeId.String | AttributeTypeId.Integer | AttributeTypeId.Float | AttributeTypeId.Date | AttributeTypeId.Catalog): AttributeType
  • Parameters

    • attributeType: AttributeTypeId.String | AttributeTypeId.Integer | AttributeTypeId.Float | AttributeTypeId.Date | AttributeTypeId.Catalog

    Returns AttributeType

Private mapEntityType

  • Parameters

    • entityType: number

    Returns RawDataEntity

Private mapFormplotType

  • mapFormplotType(id: FormplotTypeId.None | FormplotTypeId.Circle | FormplotTypeId.Plane | FormplotTypeId.Curve | FormplotTypeId.Line | FormplotTypeId.Cylinder | FormplotTypeId.Pitch | FormplotTypeId.BorePattern | FormplotTypeId.CircleInProfile | FormplotTypeId.Fourier): FormplotType
  • Parameters

    • id: FormplotTypeId.None | FormplotTypeId.Circle | FormplotTypeId.Plane | FormplotTypeId.Curve | FormplotTypeId.Line | FormplotTypeId.Cylinder | FormplotTypeId.Pitch | FormplotTypeId.BorePattern | FormplotTypeId.CircleInProfile | FormplotTypeId.Fourier

    Returns FormplotType

Private mapInspectionPlanItemType

  • mapInspectionPlanItemType(id: InspectionPlanItemTypeId.Characteristic | InspectionPlanItemTypeId.Part): InspectionPlanItemType
  • Parameters

    • id: InspectionPlanItemTypeId.Characteristic | InspectionPlanItemTypeId.Part

    Returns InspectionPlanItemType

Private mapPlotDeviationType

  • mapPlotDeviationType(id: PlotDeviationTypeId.None | PlotDeviationTypeId.Length | PlotDeviationTypeId.Angle): PlotDeviationType
  • Parameters

    • id: PlotDeviationTypeId.None | PlotDeviationTypeId.Length | PlotDeviationTypeId.Angle

    Returns PlotDeviationType

Private mapSegmentType

  • mapSegmentType(id: SegmentTypeId.None | SegmentTypeId.Circle | SegmentTypeId.Line | SegmentTypeId.Helix | SegmentTypeId.TouchingPoint | SegmentTypeId.MaxGapPoint | SegmentTypeId.BendingCircle | SegmentTypeId.Axis | SegmentTypeId.NominalReferenceProfile | SegmentTypeId.NominalMeasureProfile | SegmentTypeId.ActualReferenceProfile | SegmentTypeId.ActualMeasureProfile | SegmentTypeId.NominalProfile | SegmentTypeId.ActualProfile): SegmentType
  • Parameters

    • id: SegmentTypeId.None | SegmentTypeId.Circle | SegmentTypeId.Line | SegmentTypeId.Helix | SegmentTypeId.TouchingPoint | SegmentTypeId.MaxGapPoint | SegmentTypeId.BendingCircle | SegmentTypeId.Axis | SegmentTypeId.NominalReferenceProfile | SegmentTypeId.NominalMeasureProfile | SegmentTypeId.ActualReferenceProfile | SegmentTypeId.ActualMeasureProfile | SegmentTypeId.NominalProfile | SegmentTypeId.ActualProfile

    Returns SegmentType

parse

  • Returns an object from a path string - the opposite of format().

    Parameters

    • pathString: string

      path to evaluate.

    Returns ParsedPath

Private readAttribute

  • readAttribute(source: BufferReader): Attribute
  • Parameters

    • source: BufferReader

    Returns Attribute

Private readAttributeDefinition

Private readAttributeDefinitions

Private readAttributes

  • readAttributes(source: BufferReader): Attribute[]
  • Parameters

    • source: BufferReader

    Returns Attribute[]

Private readCatalog

  • readCatalog(reader: BufferReader): Catalog
  • Parameters

    • reader: BufferReader

    Returns Catalog

Private readCatalogEntries

  • Parameters

    • reader: BufferReader

    Returns CatalogEntry[]

Private readCatalogEntry

  • Parameters

    • reader: BufferReader

    Returns CatalogEntry

Private readDefect

  • Parameters

    Returns Defect

Private readDefectPlot

  • readDefectPlot(reader: BufferReader): DefectPlot
  • Parameters

    • reader: BufferReader

    Returns DefectPlot

Private readElementSystem

  • Parameters

    • source: BufferReader

    Returns ElementSystem

Private readFormplot

  • readFormplot(source: BufferReader): Formplot
  • Parameters

    • source: BufferReader

    Returns Formplot

Private readGeometry

  • Parameters

    • source: BufferReader

    Returns PlotGeometry

Private readInspectionPlanItem

  • Parameters

    • reader: BufferReader

    Returns InspectionPlanItem

Private readMeasurement

  • Parameters

    • reader: BufferReader

    Returns Measurement

Private readMeasurementValue

  • Parameters

    • reader: BufferReader

    Returns MeasurementValue

Private readPath

  • readPath(reader: BufferReader): object
  • Parameters

    • reader: BufferReader

    Returns object

    • depth: number
    • partDepth: number
    • path: string

Private readPlotProperties

Private readPlotProperty

  • Parameters

    • source: BufferReader

    Returns PlotProperty

Private readPoint

  • readPoint(source: BufferReader, type: FormplotTypeId.None | FormplotTypeId.Circle | FormplotTypeId.Plane | FormplotTypeId.Curve | FormplotTypeId.Line | FormplotTypeId.Cylinder | FormplotTypeId.Pitch | FormplotTypeId.BorePattern | FormplotTypeId.CircleInProfile | FormplotTypeId.Fourier): PlotPoint
  • Parameters

    • source: BufferReader
    • type: FormplotTypeId.None | FormplotTypeId.Circle | FormplotTypeId.Plane | FormplotTypeId.Curve | FormplotTypeId.Line | FormplotTypeId.Cylinder | FormplotTypeId.Pitch | FormplotTypeId.BorePattern | FormplotTypeId.CircleInProfile | FormplotTypeId.Fourier

    Returns PlotPoint

Private readRawDataItem

  • Parameters

    • reader: BufferReader

    Returns RawDataItem

Private readSegment

  • readSegment(source: BufferReader, type: FormplotTypeId.None | FormplotTypeId.Circle | FormplotTypeId.Plane | FormplotTypeId.Curve | FormplotTypeId.Line | FormplotTypeId.Cylinder | FormplotTypeId.Pitch | FormplotTypeId.BorePattern | FormplotTypeId.CircleInProfile | FormplotTypeId.Fourier): Segment
  • Parameters

    • source: BufferReader
    • type: FormplotTypeId.None | FormplotTypeId.Circle | FormplotTypeId.Plane | FormplotTypeId.Curve | FormplotTypeId.Line | FormplotTypeId.Cylinder | FormplotTypeId.Pitch | FormplotTypeId.BorePattern | FormplotTypeId.CircleInProfile | FormplotTypeId.Fourier

    Returns Segment

Private readTolerance

  • Parameters

    • source: BufferReader

    Returns PlotTolerance | undefined

Private readVector

  • readVector(source: BufferReader): Vector
  • Parameters

    • source: BufferReader

    Returns Vector

Private readVolume

  • readVolume(reader: BufferReader): Volume
  • Parameters

    • reader: BufferReader

    Returns Volume

Private readVoxel

  • readVoxel(reader: BufferReader): Voxel
  • Parameters

    • reader: BufferReader

    Returns Voxel

replaceAll

  • replaceAll(target: string, find: string, replacement: string): string
  • Parameters

    • target: string
    • find: string
    • replacement: string

    Returns string

resolve

  • resolve(...pathSegments: any[]): string
  • Resolves {pathSegments} to an absolute path.

    If the right most argument isn't already absolute, arguments are prepended in right to left order, until an absolute path is found. If after using all paths still no absolute path is found, the path is considered relative to the root. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root.

    Parameters

    • Rest ...pathSegments: any[]

      string paths to join. Non-string arguments are ignored.

    Returns string

setFetchDefects

  • setFetchDefects(value: boolean): void
  • Sets a value indicating whether this plot needs to fetch defects.

    version

    1.1

    deprecated

    Use the property fetch_defects in the package.json instead.

    host

    Parameters

    • value: boolean

    Returns void

setRawDataSources

  • Sets the raw data entities from which the plot extension fetches the raw data. By default, the plot fetches raw data from all entities, including measurement values. When the databinding of the plot extension element features a lot of characteristics and measurements, the raw data fetching can have a large performance impact.

    deprecated

    Use the property raw_data_sources in the package.json instead.

    host

    Parameters

    Returns void

setVolumeSources

  • Sets the raw data entities from which the plot extension fetches the volumes.

    version

    1.1

    deprecated

    Use the property volume_sources in the package.json instead.

    host

    Parameters

    Returns void

Generated using TypeDoc