Subversion Repositories NaviCtrl

Compare Revisions

Ignore whitespace Rev 600 → Rev 601

/trunk/waypoints.c
67,9 → 67,6
 
WPL_Store_t WPL_Store;
 
// the waypoints list
#define MAX_LIST_LEN 101
 
Point_t PointList[MAX_LIST_LEN];
u8 WPIndex = 0; // list index of GPS point representig the current WP, can be maximal WPCount
u8 POIIndex = 0; // list index of GPS Point representing the current POI, can be maximal WPCount
76,6 → 73,7
u8 WPCount = 0; // number of waypoints
u8 PointCount = 0; // number of points in the list can be maximal equal to MAX_LIST_LEN
u8 POICount = 0; // number of point of interest in the list
u8 FsPointCnt = 0;
s16 HeadingOld = -1;
u32 SD_WaypointTimeout = 5; // Setting on SD-Card
 
92,6 → 90,7
WPIndex = 0; // real list position are 1 ,2, 3 ...
POIIndex = 0; // real list position are 1 ,2, 3 ...
WPCount = 0; // no waypoints
FsPointCnt = 0;
POICount = 0;
PointCount = 0; // no contents
WPActive = FALSE;
155,6 → 154,10
POICount++;
PointCount++;
break;
case POINT_TYPE_FS:
FsPointCnt++;
PointCount++;
break;
}
break;
170,7 → 173,10
case POINT_TYPE_WP:
//nothing to do
break;
case POINT_TYPE_FS:
FsPointCnt++;
WPCount--;
break;
case POINT_TYPE_POI:
POICount++;
WPCount--;
190,6 → 196,11
WPCount++;
POICount--;
break;
 
case POINT_TYPE_FS:
FsPointCnt++;
POICount--;
break;
case POINT_TYPE_POI:
default:
196,6 → 207,30
// nothing to do
break;
}
case POINT_TYPE_FS: // was a Failsafe
switch(pPoint->Type)
{
case POINT_TYPE_INVALID:
FsPointCnt--;
PointCount--;
break;
 
case POINT_TYPE_WP:
WPCount++;
FsPointCnt--;
break;
case POINT_TYPE_POI:
POICount++;
FsPointCnt--;
break;
 
case POINT_TYPE_FS:
break;
default:
// nothing to do
break;
}
break;
}
memcpy(&PointList[pPoint->Index-1], pPoint, sizeof(Point_t)); // copy data to list entry
219,11 → 254,18
// search for first wp in list
for(i = 0; i <MAX_LIST_LEN; i++)
{
if((PointList[i].Type == POINT_TYPE_WP) && (PointList[i].Position.Status != INVALID))
if((PointList[i].Type == POINT_TYPE_WP) && (PointList[i].Position.Status != INVALID)) // jump over POIs and FS-Positions
{
WPIndex = i + 1;
break;
}
/*
else
if((PointList[i].Type == POINT_TYPE_FS) && (PointList[i].Position.Status != INVALID))
{
GPSPos_Copy(&(PointList[i].Position), &GPS_FailsafePosition);
}
*/
}
if(WPIndex) // found a WP in the list
{
318,11 → 360,18
u8 i;
for(i = WPIndex; i < MAX_LIST_LEN; i++) // start search for next at next list entry
{
if((PointList[i].Type == POINT_TYPE_WP) && (PointList[i].Position.Status != INVALID)) // jump over POIs
if((PointList[i].Type == POINT_TYPE_WP) && (PointList[i].Position.Status != INVALID)) // jump over POIs and FS-Positions
{
wp_found = i+1;
break;
}
/*
else
if((PointList[i].Type == POINT_TYPE_FS) && (PointList[i].Position.Status != INVALID)) // jump over POIs
{
GPSPos_Copy(&(PointList[i].Position), &GPS_FailsafePosition);
}
*/
}
}
if(wp_found)
615,7 → 664,9
PointList[IsPointSection-1].Position.Altitude /= 10; // dm only for WPs
WPCount++;
break;
 
case POINT_TYPE_FS:
FsPointCnt++;
break;
case POINT_TYPE_POI:
POICount++;
break;