Class StpRecognizer

Commands and events to interact with STP

Hierarchy

  • StpRecognizer

Constructors

Properties

onCoaAdded: undefined | ((poid, coa, isUndo) => void)

A new COA has been added

Param

Unique identifier of the added COA

Param

Definition of COA to add

Param

True if this is the result of an undo operation (of a to COA delete)

onCoaDeleted: undefined | ((poid, isUndo) => void)

A COA has been deleted

Param

Unique identifier of the added COA

Param

True if this is the result of an undo operation (of a to COA add)

onCoaModified: undefined | ((poid, coa, isUndo) => void)

A COA has been modified

Param

Unique identifier of the added COA

Param

Modified COA definition

Param

True if this is the result of an undo operation (of a to COA modify)

onCommand: undefined | ((operation, location) => void)

Custom operation has been detected

Param

as defined in the Edits configuration table

Param

associated gesture (point, line, area)

onInkProcessed: undefined | (() => void)

Sketched gestures have either been processed, or failed to process and can be cleared of the UI

onMapOperation: undefined | ((operation, location) => void)

Map operation (such as pan, zoom) has been detected

Param

'pan' | 'zoom'| ...

Param

associated gesture (point, line, area)

onPenDown: undefined | ((time, coord) => void)

A pen down action was performed by a user

Param

Pen down time

Param

Pen down map coordinate

onRoleSwitched: undefined | ((role) => void)

A new role has become current/active

Param

onSpeechRecognized: undefined | ((phrases) => void)

User speech was successfully transcribed

Param

Phrases that were recognized

onStpMessage: undefined | ((msg, level) => void)

Message indicating an STP issue or event to be displayed to the user

Param

Message describing the issue

Param

Type of message (see the corresponding enum)

onSymbolAdded: undefined | ((alternates, isUndo) => void)

A new symbol has been added

Param

One or more symbol interpretations, ranked by likelihood

Param

True if this is the result of an undo operation (of a symbol delete)

onSymbolDeleted: undefined | ((poid, isUndo) => void)

A symbol has been deleted

Param

Unique symbol identifier of the deleted symbol

Param

True if this is the result of an undo operation (of a symbol add)

onSymbolEdited: undefined | ((operation, location) => void)

A symbol edit operation (such as select) has been detected Notice that Delete, Move and attribute editing operations are automatically handled by STP These are just events tht require action from the client UI

Param

'select' | other custom operations

Param

associated gesture (point, line, area)

onSymbolModified: undefined | ((poid, symbol, isUndo) => void)

A symbol has been modified

Param

Unique symbol identifier of the modified symbol

Param

Symbol added

Param

True if this is the result of an undo operation (of a symbol modify)

onSymbolReport: undefined | ((poid, symbol) => void)

An update report for a symbol has been received, e.g from C2SIM

Param

Unique symbol identifier of the updated symbol

Param

Updated symbol properties

onTaskAdded: undefined | ((poid, alternates, taskPoids, isUndo) => void)

A new task has been added

Param

Unique identifier of the added task

Param

Ranked collection of alternate task interpretations

Param

True if this is the result of an undo operation (of a to unit add)

onTaskDeleted: undefined | ((poid, isUndo) => void)

A task has been deleted

Param

Unique identifier of the deleted task

Param

True if this is the result of an undo operation (of a to unit add)

onTaskModified: undefined | ((poid, alternates, taskPoids, isUndo) => void)

A task has been modified

Param

Unique identifier of the modified task

Param

Ranked collection of alternate task interpretations

Param

True if this is the result of an undo operation (of a to unit add)

onTaskOrgAdded: undefined | ((taskOrg, isUndo) => void)

A new task org has been added

Param

Added TO

Param

True if this is the result of an undo operation (of a TO delete)

onTaskOrgDeleted: undefined | ((poid, isUndo) => void)

A task org has been deleted

Param

Unique identifier of the deleted TO

Param

True if this is the result of an undo operation (of a TO add)

onTaskOrgModified: undefined | ((poid, taskOrg, isUndo) => void)

A task org has been modified

Param

Unique symbol identifier of the modified symbol

Param

Modified TO

Param

True if this is the result of an undo operation (of a TO modify)

onTaskOrgRelationshipAdded: undefined | ((rel, isUndo) => void)

A new task org relationship has been added

Param

Relationship added

Param

True if this is the result of an undo operation (of a to unit delete)

onTaskOrgRelationshipDeleted: undefined | ((poid, isUndo) => void)

A task org relationship has been deleted

Param

Unique identifier of the deleted to relationship

Param

True if this is the result of an undo operation (of a to unit add)

onTaskOrgRelationshipModified: undefined | ((poid, rel, isUndo) => void)

A task org relationship has been modified

Param

Unique identifier of the modified to relationship

Param

Relationship added

Param

True if this is the result of an undo operation (of a to unit modify)

onTaskOrgSwitched: undefined | ((taskOrg) => void)

A new task org has become current/active

Param

onTaskOrgUnitAdded: undefined | ((unit, isUndo) => void)

A new task org unit has been added

Param

Unit added

Param

True if this is the result of an undo operation (of a to unit delete)

onTaskOrgUnitDeleted: undefined | ((poid, isUndo) => void)

A task org unit has been deleted

Param

Unique identifier of the deleted to unit

Param

True if this is the result of an undo operation (of a to unit add)

onTaskOrgUnitModified: undefined | ((poid, unit, isUndo) => void)

A task org unit has been modified

Param

Unique symbol identifier of the modified symbol

Param

Unit added

Param

True if this is the result of an undo operation (of a to unit modify)

serviceName: string
stpConnector: IStpConnector

Methods

  • Request that a symbol be added by STP. The actual addition should only happen when STP responds with SymbolAdded

    Parameters

    Returns void

  • Request that a task be added by STP. The actual addition should only happen when STP responds with TaskAdded

    Parameters

    Returns void

  • Add a new TO to the scenario

    Parameters

    Returns void

    TO's unique id

  • Request that a Task Org Relationship be added by STP. The actual addition should only happen when STP responds with TaskOrgRelationshipAdded

    Parameters

    Returns void

  • Request that a Task Org Unit be added by STP. The actual addition should only happen when STP responds with TaskOrgUnitAdded

    Parameters

    Returns void

  • Pick an alternate recognition for a symbol/task. The STP runtime responds with an object chosen notification

    Parameters

    • poid: string

      Unique identifier of the symbol for which an alternate is being picked

    • nBestIndex: number

      Index indicating which of the current alternates is selected

    Returns void

  • Pick an alternate as the confirmed task. The STP runtime responds with a task update notification in which uiStatus is set to 'confirmed'

    Parameters

    • poid: string

      Unique identifier of the task for which an alternate is being confirmed

    • nBestIndex: number

      Index indicating which of the current alternates is selected for confirmation

    • Optional isConfirmed: boolean = true

      True (default) if swithing task to confirmed status, false back to confirming

    Returns void

  • Connect to the STP engine Important: the event function properties need to be assigned to handlers before this method is called

    Parameters

    • serviceName: string

      Name of this component / service

    • timeout: number

      Number fo seconds to wait for a connection before failing

    • Optional machineId: string

      Optional machine Id to use. If not provided, it is set to some unique Id.

    • Optional sessionId: string

      Optional session Id to use. If not provided:

      1. the suffix to the WebSocket connection string is used
      2. if no WebSocket suffix was provided, the machineId is used.

    Returns Promise<undefined | string>

  • Create and load a new scenario, replacing any previous content that might have been loaded into STP

    Parameters

    • name: string
    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<void>

  • Delete COA from scenario

    Parameters

    • poid: string

    Returns void

  • Request a symbol deletion from STP. The actual removal should only happen when STP responds with SymbolDeleted

    Parameters

    • poid: string

      Unique identifier of the symbol to delete

    Returns void

  • Request a task deletion from STP. The actual removal should only happen when STP responds with TaskDeleted

    Parameters

    • poid: string

      Unique identifier of the task to delete

    Returns void

  • Delete TO from scenario

    Parameters

    • poid: string

    Returns void

  • Request a Task Org Relationship deletion from STP. The actual removal should only happen when STP responds with TaskOrgRelationshipDeleted

    Parameters

    • poid: string

      Unique identifier of the Task Org Relationship to delete

    Returns void

  • Request a Task Org Unit deletion from STP. The actual removal should only happen when STP responds with TaskOrgUnitDeleted

    Parameters

    • poid: string

      Unique identifier of the Task Org Unit to delete

    Returns void

  • Get a COA content as a multiline string ready to be persisted

    Parameters

    • poid: string

      COA's unique id

    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<string>

  • Get the current scenario content as a multiline string ready to be persisted

    Parameters

    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<string>

    Scenario content, formatted as object_set([[element1], [element2], ...])

  • Get TO content as a multiline string ready to be persisted

    Parameters

    • poid: string

      TO's unique id

    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<string>

    • TO content, formatted as object_set([[element1], [element2], ...])
  • Checks STP for a loaded scenario

    Parameters

    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<boolean>

    True if a scenario is active

  • Import a new COA into the scenario The COA is imported with a new unique Ids, i.e., the content is used as a template That includes the Id of the COA definition as well as the individual symbols's

    Parameters

    • toContent: string
    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<string>

    New COA's unique id

  • Load additional data into an existing scenario

    Parameters

    • content: string

      Content to load, formatted as object_set([[element1], [element2], ...])

    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<void>

  • Import TO into the scenario The TO is imported with a new unique Ids, i.e., the content is used as a template The individual task org units retain their original unique Ids

    Parameters

    • content: string

      Content to load, formatted as object_set([[element1], [element2], ...])

    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<string>

    TO's unique id

  • Generic method that handles the actual sending of a message over to STP

    Parameters

    • name: string

      Name of the event / method to inform

    • parms: any

      parameter object

    Returns void

  • Load all current STP objects into a project - this emulates receiving the STP events to create objects

    Parameters

    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<void>

  • Load a new scenario, replacing any previous content that might have been loaded into STP

    Parameters

    • content: string

      Content to load, formatted as object_set([[element1], [element2], ...])

    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<void>

  • Generic method that handles the STP requests - messages for which results are expected

    Parameters

    • name: string

      Name of the event / method to request

    • parms: any

      parameter object

    • Optional timeout: number

      Optional timeout for this request

    Returns Promise<any>

  • Remove TO association from a particular COA

    Parameters

    • Optional coaPoid: string

      Unique Id of the COA in which the TO should be reset - global default if undefined

    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<void>

  • Reset TO as the default - TO is not deleted, but is no longer active

    Parameters

    • affiliation: "friend" | "hostile"

      affiliation of the TO to reset as the default

    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<void>

  • Send sketched gesture to STP

    Parameters

    • pixelBoundsWindow: Size

      Map region screen bounds in pixels

    • topLeftGeoMap: LatLon

      Map top, left coordinates

    • bottomRightGeoMap: LatLon

      Map bottom, right coordinates

    • strokePoints: LatLon[]

      Coordinates of the sketched gesture

    • timeStrokeStart: string

      Time the first point was placed

    • timeStrokeEnd: string

      Time the last point was placed

    • intersectedPoids: string[]

      Symbol Ids of all the symbols that were intersected by the sketched gesture - used for editing operations, e.g. when user sketches over a symbol and says "delete this"

    Returns void

  • Advertise that the user has started a sketched gesture

    Parameters

    • location: LatLon

      Map coordinate of the first point

    • timestamp: string

      Time the first point was placed - ISO 8601

    Returns void

  • Send to STP the transcribed speech results, as obtained by a speech recognizer, or typed by the user

    Parameters

    • recoList: ISpeechRecoItem[]

      List of recognition hypothesis

    • startTime: Date

      Time speech started - ISO 8601

    • endTime: Date

      Time speech ended- ISO 8601

    Returns void

  • Set TO to use when a particular COA is selected, or globally, when any COA (of the corresponding affiliation) is selected

    Parameters

    • toPoid: string

      Unique id of the TO to set

    • Optional coaPoid: string

      Unique Id of the COA the TO should be associated with - global default if undefined

    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<void>

  • Select the current COA - edits and data imports are made into this COA henceforth

    Parameters

    • poid: string

      COA's unique id

    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<void>

  • Switch the role associated with the current COA

    Parameters

    • role: StpRole
    • createIfNone: boolean = true

      true causes a default COA to be created for the desired role if none exists yet

    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<void>

  • Set TO to use when a particular COA is selected, or globally, when any COA (of the corresponding affiliation) is selected

    Parameters

    • poid: string

      Unique id of the TO to set

    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<void>

  • Load a scenario, updating a session content with detected differences

    Parameters

    • content: string

      Content to load, formatted as object_set([[element1], [element2], ...])

    • Optional timeout: number

      Optional timeout in seconds

    Returns Promise<void>

  • Update COA definition

    Parameters

    • poid: string
    • coa: StpCoa

      updated COA

    Returns void

  • Request that a symbol be updated by STP. The actual update should only happen when STP responds with SymbolModified

    Parameters

    • poid: string

      Unique identifier of the symbol to update

    • symbol: StpSymbol

      Symbol to be updated

    Returns void

  • Request that a task be updated by STP. The actual update should only happen when STP responds with TaskModified

    Parameters

    • poid: string

      Unique identifier of the task to update

    • alternates: StpTask[]

      Alternates of the task to update - normally only one of the alternates will have been modified

    Returns void

  • Update TO definition

    Parameters

    Returns void

  • Request that a Task Org Relationship be updated by STP. The actual update should only happen when STP responds with TaskOrgRelationshipModified

    Parameters

    Returns void

  • Request that a Task Org Unit be updated by STP. The actual update should only happen when STP responds with TaskOrgUnitModified

    Parameters

    • poid: string

      Unique identifier of the Task Org Unit to update

    • toUnit: StpTaskOrgUnit

      Task Org Unit to be updated

    Returns void

Generated using TypeDoc