<?php

function PIE_settings()
  {
    return array('flags'              => ISF_LOCAL,
                 'outgaugehost'       => '127.0.0.1',
                 'outgaugeport'       => 49999);
  }
  
function PIE_OutGauge($data)
  {
    $PIE = PIE::connect();
    
    $lasttime = $PIE->get('lastOutGauge');
    $thistime = $data['Time'];
    
    $PIE->set('lastOutGauge', $thistime);
    if ($lasttime > $thistime)
      return;
    
    $speed = number_format(($data['Speed']*3.5398), 1);
    PIE_sendpacket(array( 'Type'     => ISP_BTN,
                          'ClickID'  => 7,
                          'BStyle'   => 0,
                          'T'        => 147,
                          'L'        => 90,
                          'W'        => 20,
                          'H'        => 8,
                          'Text'     => $speed));
  }