Options
All
  • Public
  • Public/Protected
  • All
Menu

Class responsible for creating and managing the TwinCAT Type Map, which is fetched from the TwinCAT's ADS layer.

Hierarchy

Index

Constructors

constructor

Events

on

Methods

Private __adsTypeDeleteChild

  • __adsTypeDeleteChild(index: number, adsTypeData: TcTypeInfo): void
  • Internal function for deleting ADS Child Type Data from ADS Type. Due to the non-linear pattern of registration, this is useful, as a means of preventing redundant looping

    Parameters

    • index: number

      Index of the ADS Child Type to be deleted

    • adsTypeData: TcTypeInfo

      The ADS Type from which the child is deleted

    Returns void

Private __adsTypeDeleteEntry

  • Internal function for deleting ADS Type Data entry from the full map of ADS Type Data Due to the non-linear pattern of registration, this is useful, as a means of preventing redundant looping

    Parameters

    • adsTypeData: TcTypeInfo

      The ADS Type Data to delete from map

    • adsTypeDataMap: TcTypeInfoMap

      The ADS Type Map from which the entry is deleted

    Returns void

Private __adsTypeHasParent

  • Internal function, which check if the provided ADS Type Data, has a parent associated with it

    Parameters

    • adsTypeData: TcTypeInfo

      The ADS Type to check for parent presence

    • adsTypeDataMap: TcTypeInfoMap

      The full ADS Type Map, where the parent's existence is checked

    Returns TcTypeInfo | undefined

    • The parents ADS Type Data if it exists, else undefined

Private __adsTypeIsBit

  • __adsTypeIsBit(adsTypeData: TcTypeInfo): boolean
  • Internal function, which checks if the ADS Type Data is of type BOOL

    Parameters

    • adsTypeData: TcTypeInfo

      The ADS Type Data, which is checked for being of type BOOL

    Returns boolean

    • Is true if ADS Type Data matched queried type

Private __adsTypeIsNumber

  • __adsTypeIsNumber(adsTypeData: TcTypeInfo): boolean
  • Internal function, which checks if the ADS Type Data is of type Integer or Floating Point Number

    Parameters

    • adsTypeData: TcTypeInfo

      The ADS Type Data, which is checked for being of type Integer or Floating Point Number

    Returns boolean

    • Is true if ADS Type Data matched queried type

Private __adsTypeIsPointerOrReference

  • __adsTypeIsPointerOrReference(adsTypeData: TcTypeInfo): boolean
  • Internal function, which filters out Pointers and References

    Parameters

    • adsTypeData: TcTypeInfo

      The ADS Type Data, which is checked for being either a Pointer or a Reference

    Returns boolean

    • Is true if the passed ADS Type Data is of type Pointer or Reference

Private __adsTypeIsString

  • __adsTypeIsString(adsTypeData: TcTypeInfo): boolean
  • Internal function, which checks if the ADS Type Data is of type STRING

    Parameters

    • adsTypeData: TcTypeInfo

      The ADS Type Data, which is checked for being of type STRING

    Returns boolean

    • Is true if ADS Type Data matched queried type

Private __adsTypeIsStruct

  • __adsTypeIsStruct(adsTypeData: TcTypeInfo): number | false
  • Internal function, which checks if the ADS Type Data is of type Structure or Function_Block

    Parameters

    • adsTypeData: TcTypeInfo

      The ADS Type Data, which is checked for being of type Structure or Function_Block

    Returns number | false

    • Is true if ADS Type Data matched queried type

Private __adsTypeProcess

  • Internal function for processing ADS Type Data, after it was initially filtered.

    throws

    TcComIsInvalidException - Attempting to use an invalidated TcCom Object

    throws

    TcComToRawException - Error occurred when transforming value to raw data

    Parameters

    • adsTypeData: TcTypeInfo

      The ADS Type Data to process

    • adsTypeDataMap: TcTypeInfoMap

      The full map of ADS Type Data, for parent/child analysis

    Returns Promise<TcType | undefined>

    • Either the created TcType from the ADS Type Data, or undefined, if the Type is not bindable

Private __adsTypeProcessChildren

  • Internal function for checking if an ADS Type Data has children, and if so, will attempt to register all the children associated with this ADS Type

    throws

    TcComIsInvalidException - Attempting to use an invalidated TcCom Object

    throws

    TcComToRawException - Error occurred when transforming value to raw data

    Parameters

    • adsTypeData: TcTypeInfo

      The ADS Type, whose children are evaluated

    • adsTypeDataMap: TcTypeInfoMap

      The full map of ADS Type Data, for parent/child analysis

    Returns Promise<{ key: string; type: TcType }[]>

    • List of registered TcType Children with their key. If no children were successfully registered - the list is empty

Private __adsTypeProcessParent

  • Internal function for checking if an ADS Type Data has a parent, and if so, will attempt to register that parent

    throws

    TcComIsInvalidException - Attempting to use an invalidated TcCom Object

    throws

    TcComToRawException - Error occurred when transforming value to raw data

    Parameters

    • adsTypeData: TcTypeInfo

      The ADS Type, whose parent is evaluated

    • adsTypeDataMap: TcTypeInfoMap

      The full map of ADS Type Data, for parent/child analysis

    Returns Promise<TcType | undefined>

    • Either the processed parent's registered TcType Object, or undefined if that processing has failed

Private __adsTypeRegister

  • Internal function for processing and registering a TcType based on the ADS Type Data collected previously. If Type is not bindable, it is ignored and not registered.

    throws

    TcComIsInvalidException - Attempting to use an invalidated TcCom Object

    throws

    TcComToRawException - Error occurred when transforming value to raw data

    Parameters

    • adsTypeData: TcTypeInfo

      The ADS Type Data to process and potentially register

    • adsTypeDataMap: TcTypeInfoMap

      The full map of ADS Type Data, for parent/child analysis

    Returns Promise<TcType | undefined>

    • Either the newly registered TcType, or undefined, if registration failed

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

create

  • create(): Promise<void>

destroy

  • destroy(): void

emit

  • emit(eventName: string | symbol, e: TcEvent): boolean
  • Emits an event of eventName with data e and if parent is present will propagated that event to it, unless stopped

    Parameters

    • eventName: string | symbol

      The event name to emit

    • e: TcEvent

      The Data associated with this event

    Returns boolean

    • True if the event had listeners, false otherwise.

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getMaxListeners

  • getMaxListeners(): number

has

  • has(name: string): TcType | undefined
  • Returns a TcType of the provided name from the Type Map. If Type does not exist in the Type Map, returns undefined

    Parameters

    • name: string

      The name of the TcType to get

    Returns TcType | undefined

    • Either that Type Data under the provided name, or undefined if Type does not exist

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

register

  • register(name: string, type: TcType): void
  • Registers a TcType created Object as part of the Type Map, under the provided name

    Parameters

    • name: string

      The Type Name of the created TcType Object

    • type: TcType

      The created TcType Object to register with the Type Map

    Returns void

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

Generated using TypeDoc