Example #1
0
float	MyFlightLoopCallback(
                                   float                inElapsedSinceLastCall,    
                                   float                inElapsedTimeSinceLastFlightLoop,    
                                   int                  inCounter,    
                                   void *               inRefcon)
{
	/* The actual callback.  First we read the sim's time and the data. */
	float	elapsed = XPLMGetElapsedTime();
	float	lat = XPLMGetDataf(gPlaneLat);
	float	lon = XPLMGetDataf(gPlaneLon);
	float	el = XPLMGetDataf(gPlaneEl);
	float	vis = XPLMGetDataf(gPlaneVis);
	
	/* Write the data to a file. */
	fprintf(gOutputFile, "Vis=%f,Time=%f,lat=%f,lon=%f,el=%f.\n",vis,elapsed, lat, lon, el);

	XPLMSetDataf(gPlaneVis, vis_amount);
	
	/* Return 1.0 to indicate that we want to be called again in 1 second. */
	return 1.0;
}
float XPlaneInterface::getElapsedTimeDecimalSeconds()
{
	return XPLMGetElapsedTime();
}