コード例 #1
0
ファイル: DoCalculations.cpp プロジェクト: jaaaaf/LK8000
bool DoCalculations(NMEA_INFO *Basic, DERIVED_INFO *Calculated)
{

  // first thing: assign navaltitude!
  EnergyHeightNavAltitude(Basic, Calculated);

  // second thing: if available, get external wind precalculated!
  if ( (Basic->ExternalWindAvailable==TRUE) && (AutoWindMode==D_AUTOWIND_EXTERNAL)) {
	if (Basic->ExternalWindSpeed>0 && Basic->ExternalWindSpeed<35) {
		Calculated->WindSpeed = Basic->ExternalWindSpeed;
		Calculated->WindBearing = Basic->ExternalWindDirection;
	}
  }

  Heading(Basic, Calculated);
  DistanceToNext(Basic, Calculated);
  DistanceToHome(Basic, Calculated);
  DetectFreeFlying(Basic,Calculated);	// check ongoing powerless flight
  DoLogging(Basic, Calculated);
  Vario(Basic,Calculated);
  TerrainHeight(Basic, Calculated);
  AltitudeRequired(Basic, Calculated, MACCREADY);
  DoAlternates(Basic,Calculated,TASKINDEX); 
  if (IsMultiMapShared()) {
	DoAlternates(Basic,Calculated,RESWP_LASTTHERMAL);
	DoAlternates(Basic,Calculated,RESWP_TEAMMATE);
	DoAlternates(Basic,Calculated,RESWP_FLARMTARGET);
	DoAlternates(Basic,Calculated,HomeWaypoint); 	
	#ifdef GTL2
	if (DoOptimizeRoute() || ACTIVE_WP_IS_AAT_AREA)
		DoAlternates(Basic, Calculated, RESWP_OPTIMIZED);
	#else
	if (DoOptimizeRoute()) DoAlternates(Basic,Calculated,RESWP_OPTIMIZED); 	
	#endif
	for (int i=RESWP_FIRST_MARKER; i<=RESWP_LAST_MARKER; i++) {
		if (WayPointList[i].Latitude==RESWP_INVALIDNUMBER) continue;
		DoAlternates(Basic,Calculated,i);
	}
  #ifndef GTL2
  }
  #else
  } else {
コード例 #2
0
ファイル: DoCalculationsVario.cpp プロジェクト: LK8000/LK8000
void DoCalculationsVario(NMEA_INFO *Basic, DERIVED_INFO *Calculated) {
    
  Vario(Basic,Calculated);
  NettoVario(Basic, Calculated);
  SpeedToFly(Basic, Calculated);
}