$ npm install gamma-monitor
const gammaMonitor = require('gamma-monitor')
// All properties in the options Object are optional,
// below are its default values.
const options = {
width: 320,
heigth: 240,
frameRate: 10,
facingMode: 'user',
}
const measurement = gammaMonitor(options)
// GammaMonitor { ... }
Al methods with the exeption of the Error handler (.catch) receive a Measurement {}
as its only paremeter with measurement
as its context.
Object that is an instance of Measurement with data produced by gammaMonitor as its properties.
Method to start a measurement.
Method to stop a measurement.
Method that is called when the measurements has started.
Method that is called when the measurements has stopped.
Method that is called when the measurements has updated (once every second).
Method that is called when the measurements has changed (once every minute).
Method that is called when the measurements has thrown an Error. If an error occurs, the measurement is stopped right away.
Number representing the current version of the underlying algorithm.
Boolean representing wheter the monitor is currently active.
Boolean representing wheter the baseline reading has completed, and actual monitoring has started.
Unix time Number representing the time a measurement has started, set to null
by default.
Unix time Number representing the time of the current frame, set to null
by default.
Number from 0 to 1 representing the progress of a current cycle (baseline measurement/minute of measuring).
Number representing the offset between signal and noise, indicative of sensor accuracy.
Number representing the most recent reading for a second, 0
by default.
Number representing the most recent reading for a full minute, 0
by default.
Array with the countPerSecond
of all seconds within the current minute.
Array with the countPerMinute
of all minutes within the current measurement.
If an error occurs it is set to this property, set to null
otherwise.
MIT © Waag Society