Lampix Apps API
  • Introduction
  • Application Development
    • Getting Started
      • Up and Running
      • Boilerplate
    • Step by step app
      • What We'll Build
      • Environment Setup
      • Styling
      • HTML Structure
      • NeuralNetworkClassifier
      • MovementBasedSegmenter
      • Final Step
      • Extras
    • LampixJS
      • API Reference
        • Watcher
        • RegisteredWatcher
        • .watchers.add
        • .watchers.remove
        • .watchers.pauseAll
        • .watchers.resumeAll
        • .presets.button
        • .helpers.rectangle
        • getLampixInfo
        • switchToApp
        • exit
        • getApps
        • getAppConfig
        • getAppMetadata
        • writeJsonToFile
        • readJsonFromFile
        • transformRectCoords
        • constants
      • Examples
        • NeuralNetworkClassifier: Buttons
        • MovementBasedSegmenter
        • Counter App
      • Migrating from v0.x.x to v1.0.0-beta.x
      • Ecosystem
    • Deploying
      • Application Structure (production)
      • Local Deploy
    • Standard Watchers
    • Custom Watchers
      • Description
      • Environment Setup
      • Directory Structure
      • End result
      • QRCodeDetector implementation
    • Community
  • Lampix Simulator
    • Installation
    • Usage
      • Basics
Powered by GitBook
On this page
  • Properties
  • Methods
  • pause()
  • resume()
  • remove()
  • channel.send(data)
  • updateShape(shape)

Was this helpful?

  1. Application Development
  2. LampixJS
  3. API Reference

RegisteredWatcher

PreviousWatcherNext.watchers.add

Last updated 6 years ago

Was this helpful?

Registered watcher objects are plain objects with a few convenience methods and properties. These objects can only be obtained via the method (for the time being), and all watcher management is done through the interface they provide. If watcher management (e.g pausing, resuming, removing, updating) is required by an application, they should be saved in the app's state.

Properties

  • source (Object): A replica of the object provided to .watchers.add.

  • state (Object): An object representing the current state of the registered watcher.

    • active (boolean): Represents whether computer vision processes are active for the watcher in question. Changed by pause and resume methods.

  • onClassification (Function): Configurable handler for the classification event. See for details.

  • onLocation (Function, Optional): Configurable handler for the location event. See for details.

  • channel (Object): Channel to use to send data to the watcher past the point of initialization

Methods

Note that all of these methods return a promise with no resolve value.

Pauses computer vision activity (classification, location) for the registered watcher.

Resumes computer vision activity (classification, location) for the registered watcher.

Removes the registered watcher.

Notes

Replaces the shape of a registered watcher with the new one provided.

Sends data to be acted upon by all listeners registered in the watcher. Mainly for use with custom watchers. Can be anything valid according to the method

Adding and removing watchers can have an impact on performance. If you intend to reuse the same watcher, consider using the and methods instead.

JSON.stringify
.watchers.add
Watcher
Watcher
pause()
resume()
remove()
channel.send(data)
pause
resume
updateShape(shape)