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 variable extension.

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

piweb.events.on("calculate", calculate);

function calculate() {
    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"

InspectionPlanItemType

InspectionPlanItemType: "characteristic" | "part"

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.

VolumeDirection

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

Known volume directions / planes

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('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.

    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.

    Returns DefectCollection

getInspectionPlanCollection

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

    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.

    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.

    Returns RawDataCollection

getRawDataSources

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

    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.

    Returns VolumeCollection

getVolumeSources

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

    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 mapInspectionPlanItemType

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

    • id: InspectionPlanItemTypeId.Characteristic | InspectionPlanItemTypeId.Part

    Returns InspectionPlanItemType

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 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 readRawDataItem

  • Parameters

    • reader: BufferReader

    Returns RawDataItem

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.

    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.

    Parameters

    Returns void

setVolumeSources

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

    deprecated

    Use the property volume_sources in the package.json instead.

    Parameters

    Returns void

Generated using TypeDoc