Options
All
  • Public
  • Public/Protected
  • All
Menu

External module environment

Introduction

The piweb.environment module provides information about the element and its properties, as well as global settings. It also contains classes that are used by the functions of the piweb.format module.

import * as piweb from 'piweb';
import environment = piweb.environment;
see

format

Index

Type aliases

AngleUnit

AngleUnit: "degreeDecimal" | "degreeMinuteSecond" | "radian"

LengthUnit

LengthUnit: "mm" | "inch"

LimitType

LimitType: "tolerance" | "warning" | "control" | "scrap"

LimitUsageReference

LimitUsageReference: "nominal" | "middleOfTolerance"

Variables

Private LocalNativeTimeZone

LocalNativeTimeZone: any = provider.LocalTimeZone

apiVersion

apiVersion: string = provider.ApiVersion

Gets the semantic version of the plot extension API that is used to host the plot.

host

Private cachedLimitsConfiguration

cachedLimitsConfiguration: LimitsConfiguration | undefined

Private cachedLimitsConfigurationToken

cachedLimitsConfigurationToken: any

clientString

clientString: string = provider.ClientString

Gets the name of the hosting PiWeb client.

host

clientVersion

clientVersion: string = provider.ClientVersion

Gets the version of the hosting PiWeb client.

host

Private currentNativeCulture

currentNativeCulture: any = provider.CurrentCulture

Private currentNativeRegion

currentNativeRegion: any = provider.CurrentRegion

Private provider

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

toolboxItemName

toolboxItemName: string = provider.ToolboxItemName

If the extensions defined multiple toolbox entries in the package.json manifest file, this property can be used to find out which entry the user picked. The returned value is the property name used as toolbox entry id in the manifest.

host

Functions

getAngleUnit

  • Returns prefered display unit of angles. This can be configured in the settings menu of Piweb Designer and PiWeb Monitor.

    host

    Returns AngleUnit

getDecimalPlaces

  • getDecimalPlaces(): number
  • Returns prefered number of decimal places of displayed values. This can be configured in the settings menu of Piweb Designer and PiWeb Monitor. Use this only as a fallback value in case no prefered number of decimal places is configured for the displayed characteristic by attribute K2022.

    host

    Returns number

getLengthUnit

  • Returns prefered display unit of length. This can be configured in the settings menu of Piweb Designer and PiWeb Monitor.

    host

    Returns LengthUnit

getLimitsConfiguration

  • Returns the limit configuration that can be specified for a report.

    host

    Returns LimitsConfiguration

getLocation

  • Returns the position of the element on the report page in millimeters.

    host

    Returns Point

getSize

  • Returns the current size of the element in millimeters.

    host

    Returns Size

isDesignMode

  • isDesignMode(): boolean
  • If true, the plot is rendered by PiWeb Designer, otherwise it's rendered by PiWeb Monitor. Some very complex elements don't render their complete content while in design mode, to guarantee a smooth and fluent editing in PiWeb Designer.

    host

    Returns boolean

Private mapAngleUnit

  • mapAngleUnit(angleUnit: AngleUnitId.DegreeDecimal | AngleUnitId.DegreeMinuteSecond | AngleUnitId.Radian): AngleUnit
  • Parameters

    • angleUnit: AngleUnitId.DegreeDecimal | AngleUnitId.DegreeMinuteSecond | AngleUnitId.Radian

    Returns AngleUnit

Private mapLengthUnit

  • mapLengthUnit(lengthUnit: LengthUnitId.Mm | LengthUnitId.Inch): LengthUnit
  • Parameters

    • lengthUnit: LengthUnitId.Mm | LengthUnitId.Inch

    Returns LengthUnit

Private mapLimitType

  • mapLimitType(id: LimitTypeId.Tolerance | LimitTypeId.Warning | LimitTypeId.Control | LimitTypeId.Scrap): LimitType
  • Parameters

    • id: LimitTypeId.Tolerance | LimitTypeId.Warning | LimitTypeId.Control | LimitTypeId.Scrap

    Returns LimitType

Private mapLimitUsageReference

  • mapLimitUsageReference(id: LimitUsageReferenceId.Nominal | LimitUsageReferenceId.MiddleOfTolerance): LimitUsageReference
  • Parameters

    • id: LimitUsageReferenceId.Nominal | LimitUsageReferenceId.MiddleOfTolerance

    Returns LimitUsageReference

Private readLimitConfiguration

Generated using TypeDoc