コード例 #1
0
ファイル: Virtuals.cpp プロジェクト: Acrobot/LK8000
// Must be called BEFORE ReadWaypoints()!! 
void InitVirtualWaypoints()	// 091102
{

  #if TESTBENCH
  StartupStore(_T(". InitVirtualWaypoints: start%s"),NEWLINE);
  #endif
    LockTaskData();

  if (!AllocateWaypointList()) {
  	StartupStore(_T("!!!!!! InitVirtualWaypoints: AllocateWaypointList FAILED. CRITIC!%s"),NEWLINE);
    	UnlockTaskData(); // BUGFIX 091122
	return;
  }

  // if first load, reserve space
  if (NumberOfWayPoints<=NUMRESWP) {
	AddReservedWaypoints();
	NumberOfWayPoints=NUMRESWP;
	#if TESTBENCH
	StartupStore(_T(". InitVirtualWaypoints: done (%d vwp)%s"),NUMRESWP,NEWLINE);
	#endif
  } else {
	#if TESTBENCH
	StartupStore(_T(".. InitVirtualWaypoints: already done, skipping.%s"),NEWLINE);
        #endif
  }

    UnlockTaskData();

}
コード例 #2
0
ファイル: Virtuals.cpp プロジェクト: LK8000/LK8000
/**
 *  Must be called BEFORE ReadWaypoints()!!
 *  #LockTaskData() Needed for call this.
 */
void InitVirtualWaypoints()	// 091102
{
  #if TESTBENCH
  StartupStore(_T(". InitVirtualWaypoints: start%s"),NEWLINE);
  #endif

  // if first load, reserve space
  if (WayPointList.size()<=NUMRESWP) {
	AddReservedWaypoints();
	#if TESTBENCH
	StartupStore(_T(". InitVirtualWaypoints: done (%d vwp)%s"),NUMRESWP,NEWLINE);
	#endif
  } else {
	#if TESTBENCH
	StartupStore(_T(".. InitVirtualWaypoints: already done, skipping.%s"),NEWLINE);
        #endif
  }
}