Universal Robots TypeScript API - v10.12.0
    Preparing search index...

    Service for generating and getting reserved variable names

    Use dedicated services instead: VariableService, FunctionService, ModuleService.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    communicationChannel: CommunicationChannel

    Methods

    • Generates a new function. The function name is based on the suggested name. If the suggested name is not usable a new, based on the suggestion, will be created

      Parameters

      • suggestedName: string
      • OptionalmoduleName: string

      Returns Promise<URFunction>

      Use FunctionService.createFunction(name).

    • Experimental

      Generates a new Logic Program. The program name is based on the suggested name. If the suggested name is not usable a new, based on the suggestion, will be created

      Parameters

      • suggestedName: string

      Returns Promise<URLogicProgram>

      Promise<URLogicProgram> A promise that resolves to the created logic program.

    • Generates a new module. The module name is based on the suggested name. If the suggested name is not usable a new, based on the suggestion, will be created

      Parameters

      • suggestedName: string

      Returns Promise<URModule>

      Use ModuleService.createModule(name).

    • Generates a new variable. The variable name is based on the suggested name. If the suggested name is not usable a new, based on the suggestion, will be created

      Parameters

      • suggestedName: string

        The intended name for the variable, will be suffixed if the name is already taken

      • valueType: VariableValueType

        The ValueType of the variable

      • Optionalblacklist: string[]

        Optional parameter to provide additional names which shouldn't be used.

      Returns Promise<URVariable>

      Use VariableService.createVariable(name, variableType); perform your own naming conflict resolution if needed.

    • Get a list of available functions for the given module name. If no name provided, functions for the global scope

      Parameters

      • OptionalmoduleName: string

      Returns Promise<URFunction[]>

      Use FunctionService.functions() then filter by module (description contains module reference).

    • Get functions map. Contains a list of functions for each module name. Note: Empty string is the global scope.

      Parameters

      • Optionalfilter: { filterAsync?: boolean }

        Filter on if the function is async or not is async or not

      Returns Promise<FunctionsMap>

      Prefer querying FunctionService.functions() and building maps client-side; async filtering can be applied locally.

    • Experimental

      Return a list of available Logic Program names

      Returns Promise<string[]>

      Promise<Array> A promise that resolves to an array of logic program names.

    • Get a list of available modules

      Returns Promise<string[]>

      Use ModuleService.modules() for reactive module listing.

    • Get the URVariable with the given name

      Parameters

      • name: string

        Name of the variable to get

      Returns Promise<URVariable | undefined>

      URVariable with the given name

      Use VariableService.getVariableDescription(reference) once you have a reference; avoid name-based lookups.

    • Get a list of available variables

      Returns Promise<URVariable[]>

      Use VariableService.variables() to observe variable descriptions.

    • Returns a list of the global variables as a stream.

      Returns Observable<GlobalVariable[]>

      Observable of global variables object

      Use VariableService.variables(); global variables are exposed uniformly via variable descriptions.

    • Return true if the function is a thread

      Parameters

      • functionName: string

        The name of the function

      • OptionalmoduleName: string

        The module of the symbol if defined

      Returns Promise<boolean>

      Boolean describing if the function is a thread

      Use metadata from FunctionService.functions() when async/thread capability is surfaced there.

    • Return true if the provided name is the name of a registered function

      Parameters

      • functionName: string
      • OptionalmoduleName: string

      Returns Promise<boolean>

      Use FunctionService.functions() and search for a matching name; no direct registration check helper.

    • Experimental

      Returns true if the provided name matches a registered Logic Program.

      Parameters

      • logicProgramName: string

        The name of the Logic Program to check for registration.

      Returns Promise<boolean>

      Promise A promise that resolves to true if the name is registered, otherwise false.

    • Return true if the provided name is the name of a registered module

      Parameters

      • moduleName: string

      Returns Promise<boolean>

      Use ModuleService.modules() and search by name; no direct registration check helper.

    • Return true if the provided name is a registered name of the given type.

      Parameters

      • name: string
      • type: URSymbolType
      • OptionalmoduleName: string
      • Optionalunique: boolean

      Returns Promise<boolean>

      Use the specific service (Variable/Function/Module) and inspect lists for existence; uniqueness checks should be done client-side.

    • Return true if the provided name is the name of a registered variable

      Parameters

      • variableName: string

      Returns Promise<boolean>

      Use VariableService.variables() and search by name; there's no direct registration check helper.

    • Return true if the declaring program node is suppressed

      Parameters

      • name: string

        The name of the symbol

      • OptionalmoduleName: string

        The module of the symbol if defined

      Returns Promise<boolean>

      Boolean describing if the declaring node is suppressed

      Suppression is exposed via metadata on objects with the VariableDescription, FunctionDescription and ModuleDescription type. Query entities on the corresponding service (VariableService, FunctionService, ModuleService) and check for the isSuppressed property.

    • Parameters

      • variableName: string

        name of the variable being validated

      • OptionalacceptedTypes: string[]

        an optional array of valid type strings, e.g., float.

      Returns Promise<boolean>

      true if the variable is registered not suppressed, and is of a valid value type

      Compose validation using VariableService.variables() & description metadata instead.

    • returns a reply promise to the specified message

      Type Parameters

      • T

      Parameters

      • type: string

        The type of message being sent

      • Optionaldata: any

        The message data

      Returns Promise<T>

    • returns an observable that will emit any messages replied to the specified message

      Type Parameters

      • T

      Parameters

      • type: string

        The type of message being sent

      • Optionaldata: any

        The message data

      Returns Observable<T>

    • returns a reply promise for the requested message

      Type Parameters

      • T

      Parameters

      • type: string

        The type of message being sent

      • Optionaldata: any

        The message data

      Returns Promise<T>

    • returns an observable that will emit any messages replied to the requested message

      Type Parameters

      • T

      Parameters

      • type: string

        The type of message being sent

      • Optionaldata: any

        The message data

      Returns Observable<T>

    • Get an observable of available variables

      Returns Observable<URVariable[]>

      Use VariableService.variables() which returns richer descriptions including references.