JSUTILS.SignalScope Class
A simple 2 channel scope to view analog input data.
Constructor
JSUTILS.SignalScope
(
-
canvasId -
width -
height -
rangeMin -
rangeMax -
ch1Color -
ch2Color
Parameters:
-
canvasIdStringThe id of the canvas element to use to draw the signal.
-
widthNumberThe width of the canvas element.
-
heightNumberThe height of the canvas element.
-
rangeMinNumberThe minimum range of the scope.
-
rangeMaxNumberThe maximum range of the scope.
-
ch1ColorString[optional] The hex color value to use for the channel 1 signal (default = #FF0000).
-
ch2ColorString[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:
-
levelNumberThe value of the marker within the input value range.
-
colorStringThe 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:
-
input1NumberThe channel 1 input signal
-
input2Number[optional] The channel 2 input signal
