Dave, it will basically be an event listener for "refresh_acars".
This will work with the next beta:
<?php
class test extends CodonModule
{
public function __construct()
{
parent::__construct();
CodonEvent::addListener('test');
}
public function EventListener($eventinfo)
{
if($eventinfo[0] == 'refresh_acars')
{
// This gets the current instance of the ACARS controller so we can
// manipulate it
$acars = MainController::getInstance('ACARS');
//$acars->acarsflights This has all of the ACARS flights currently
// This presumabley would be in a loop
//foreach($flight as $flight)
//{
// Populate this array below with all of the data we need
// Ignore the fields in it right now, I just pulled it from the acars now
$acarsflight = array('pilotid'=>$pilotid,
'flightnum'=>$_GET['IATA'],
'pilotname'=>'',
'aircraft'=>$_GET['Regist'],
'lat'=>$_GET['lat'],
'lng'=>$_GET['long'],
'heading'=>'',
'alt'=>$_GET['Alt'],
'gs'=>$_GET['GS'],
'depicao'=>$_GET['depaptICAO'],
'depapt'=>$_GET['depapt'],
'arricao'=>$_GET['destaptICAO'],
'arrapt'=>$_GET['destapt'],
'deptime'=>'',
'arrtime'=>'',
'distremain'=>$_GET['disdestapt'],
'timeremaining'=>$_GET['timedestapt'],
'phasedetail'=>$phase_detail[$_GET['detailph']],
'online'=>$_GET['Online'],
'client'=>'FSACARS');
// Now add the above data structure to our total acars flights
$acars->acarsflights[] = $acarsflight;
//} // end loop
}
}
}