Jump to content

One Question


ThomasZaniboni

Recommended Posts

Guest lorathon

Sure you can do this within the kACARS_Free module. Open the module and locate the

case 'liveupdate':

Replace the entire case down to the break with the following. NOT TESTED but it should work. Let me know if you have any problems

case 'liveupdate':	

				$pilotid = PilotData::parsePilotID($xml->verify->pilotID);
				$lat = str_replace(",", ".", $xml->liveupdate->latitude);
				$lon = str_replace(",", ".", $xml->liveupdate->longitude);

				# Get the distance remaining
				$depapt = OperationsData::GetAirportInfo($xml->liveupdate->depICAO);
				$arrapt = OperationsData::GetAirportInfo($xml->liveupdate->arrICAO);
				$dist_remain = round(SchedulesData::distanceBetweenPoints(
					$lat, $lon,	$arrapt->lat, $arrapt->lng));

				# Estimate the time remaining
				if($xml->liveupdate->groundSpeed > 0)
				{
					$Minutes = round($dist_remain / $xml->liveupdate->groundSpeed * 60);
					$time_remain = self::ConvertMinutes2Hours($Minutes);
				}
				else
				{
					$time_remain = '00:00';
				}

				$phase = $xml->liveupdate->status;

				$phase = str_replace("Boarding", "Cargo Loading", $phase);  // If phase is boarding replace with Cargo Loading

				$fields = array(
					'pilotid'        =>$pilotid,
					'flightnum'      =>$xml->liveupdate->flightNumber,
					'pilotname'      =>'',
					'aircraft'       =>$xml->liveupdate->registration,
					'lat'            =>$lat,
					'lng'            =>$lon,
					'heading'        =>$xml->liveupdate->heading,
					'alt'            =>$xml->liveupdate->altitude,
					'gs'             =>$xml->liveupdate->groundSpeed,
					'depicao'        =>$xml->liveupdate->depICAO,
					'arricao'        =>$xml->liveupdate->arrICAO,
					'deptime'        =>$xml->liveupdate->depTime,
					'arrtime'        =>'',
					'route'          =>$xml->liveupdate->route,
					'distremain'     =>$dist_remain,
					'timeremaining'  =>$time_remain,
					'phasedetail'    =>$phase,
					'online'         =>'',
					'client'         =>'kACARS',
					);

				#$this->log("UpdateFlightData: \n".print_r($fields, true), 'kacars');
				ACARSData::UpdateFlightData($pilotid, $fields);	

				break;

Link to comment
Share on other sites

Guest lorathon

Are you sure about that? I just tested it and it worked fine. You have to give it a chance to work. It will only change when an update is passed from kACARS. Since kACARS passes an update about every 10 minutes you will need to be patient.

Let me know if you still have problems.

post-451-071637900 1283353245_thumb.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...