Show:

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 String

    The id of the canvas element to use to draw the signal.

  • width Number

    The width of the canvas element.

  • height Number

    The height of the canvas element.

  • rangeMin Number

    The minimum range of the scope.

  • rangeMax Number

    The 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).

Methods

addMarker

(
  • level
  • color
)

Add a horizontal marker to the scope. 1 or more markers can be added.

Parameters:

  • level Number

    The value of the marker within the input value range.

  • color String

    The 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 Number

    The channel 1 input signal

  • input2 Number

    [optional] The channel 2 input signal