First page Back Continue Last page Overview Text

Notes:


var curvalue = tag0.innerText;

// call parseFloat() function to be certain curvalue is a number

curvalue = parseFloat(curvalue);

if (curvalue < 0)

  curvalue = 0;

else if (curvalue > 10)

  curvalue = 10;

  var indexfwd = Math.floor(curvalue);       // indexfwd goes from image 0 up to image 9

  if (indexfwd > 9)

      indexfwd = 9;

  image0.src = "/images/RTES_AHU_PumpVlv3way_Y.gfx?img=Ytwo_" + indexfwd + ".png";

  var indexrev = 9 - indexfwd;              // indexrev goes from image 9 down to image 0

  image1.src = "/images/RTES_AHU_Coils_HTG.gfx?img=HTGcoil_Vert_" + indexrev + ".png"

        // (optional) display Volts and %

  label2.innerText = round(2 + (curvalue * 0.8)) + " volts";

  label3.innerText = round(curvalue * 10.0) + " %";

        // (optional) for training purposes show which image is being used

  label0.innerText = "HTG Coil #" + indexrev;

  label1.innerText = "Valve image #" + indexfwd;

        // use our own rounding function because javascript toFixed() function is faulty

function round(num) {

  return Math.round(num*100+((num*1000)%10>4?1:0))/100; }