Instructions

Table Of Contents
User Scripting (R&S RTH-K38)
R&S
®
Scope Rider RTH
523User Manual 1326.1578.02 ─ 15
<span id=CursorX2>x2: 0</span><br>
<span id=CursorY1>y1: 0</span><br>
<span id=CursorY2>y2: 0</span><br>
<input type="checkbox" id="CursorStateButton">
<span id="CursorCBState">Cursor state</span><br>
<canvas id="MyCanvas" width="300" height="150" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<script>
var scpi = new SCPI();
var bInit = true;
var a1 = new Array();
var a2 = new Array();
var g_aMax=0;
var g_aMin=0;
function calcRange( a ) {
var i;
for( i=0; i<a.length; ++i )
{
var y = a[i];
if ( bInit && !isNaN(y) ) {
g_aMax = y;
g_aMin = y;
bInit = false;
}
if ( y>g_aMax && !isNaN(y) )
g_aMax = y;
if ( y<g_aMin && !isNaN(y) )
g_aMin = y;
}
}
function drawPath( a, ctx, width, height ) {
var aMax = g_aMax;
var aMin = g_aMin;
if ( aMax==aMin )
aMax = aMin + 1;
var i;
ctx.beginPath();
for( i=0; i<a.length; ++i )
{
var y = height * (1 - (a[i]-aMin) / (aMax - aMin) );
if ( i==0 )
Demo App