JSUTILS.SignalScope Class
A simple 2 channel scope to view analog input data.
Constructor
JSUTILS.SignalScope
(
-
canvasId
-
width
-
height
-
rangeMin
-
rangeMax
-
ch1Color
-
ch2Color
Parameters:
-
canvasId
StringThe id of the canvas element to use to draw the signal.
-
width
NumberThe width of the canvas element.
-
height
NumberThe height of the canvas element.
-
rangeMin
NumberThe minimum range of the scope.
-
rangeMax
NumberThe maximum range of the scope.
-
ch1Color
String[optional] The hex color value to use for the channel 1 signal (default = #FF0000).
-
ch2Color
String[optional] The hex colorvalue to use for the channel 2 signal (default = #0000FF).
Item Index
Methods
Methods
addMarker
(
-
level
-
color
Add a horizontal marker to the scope. 1 or more markers can be added.
Parameters:
-
level
NumberThe value of the marker within the input value range.
-
color
StringThe hex color value for the marker.
drawChannel
()
private
drawMarkers
()
private
update
(
-
input1
-
input2
Call this method at the desired frame rate in order to draw the input signal.
Parameters:
-
input1
NumberThe channel 1 input signal
-
input2
Number[optional] The channel 2 input signal