96,7 → 96,6 |
WPActive = FALSE; |
NaviData.WaypointNumber = WPCount; |
NaviData.WaypointIndex = 0; |
|
for(i = 0; i < MAX_LIST_LEN; i++) |
{ |
PointList[i].Position.Status = INVALID; |
481,7 → 480,7 |
return(retval); |
} |
|
u8 PointList_Load(u8 * filename, u8* listname, u8 listnamelen) |
u8 PointList_Load(u8 * filename, u8* listname, u8 listnamelen, u8 use_preset_speed) |
{ |
File_t *fp; |
s8 wpline[LINE_MAX]; |
594,7 → 593,8 |
} |
else if(strcmp(name, "SPEED") == 0) |
{ |
PointList[IsPointSection-1].Speed = (u8)atoi(value); |
if(use_preset_speed) PointList[IsPointSection-1].Speed = use_preset_speed; |
else PointList[IsPointSection-1].Speed = (u8)atoi(value); |
} |
else if(strcmp(name, "CAM-NICK") == 0) |
{ |
717,7 → 717,7 |
{ |
sprintf(filename, "/WPL/list_%03d.wpl", pWPL_Store->Index); |
} |
return PointList_Load(filename, pWPL_Store->Name, sizeof(pWPL_Store->Name)); |
return PointList_Load(filename, pWPL_Store->Name, sizeof(pWPL_Store->Name),0); |
} |
|
// save actual point list to SD card |
757,19 → 757,30 |
// clear current point list |
PointList_Clear(); |
// prepare WP at current position |
|
if(NCFlags & NC_FLAG_FREE || NaviData.TargetPositionDeviation.Distance > 7*10) |
{ // take actual position |
GPSPos_Copy(&GPSData.Position, &(WP.Position)); |
} |
else |
{ // take last target position |
GPSPos_Copy(&NaviData.TargetPosition, &(WP.Position)); |
} |
|
GPSPos_Copy(&GPSData.Position, &(WP.Position)); |
// set heading |
WP.Heading = CompassSetpointCorrected/10; |
if(WP.Heading == 0) WP.Heading = 360; |
WP.ToleranceRadius = 15; |
WP.HoldTime = 5; |
WP.ToleranceRadius = 120; // 12m |
WP.HoldTime = 2; |
WP.Index = 1; |
WP.Type = POINT_TYPE_WP; |
WP.WP_EventChannelValue = 0; |
if(FC.StatusFlags & FC_STATUS_FLY) |
if(FC.StatusFlags & FC_STATUS_FLY && (FromFC_VarioCharacter != ' ')) // only in flight and if the Altitude control is enabled |
{ |
WP.AltitudeRate = 15; |
WP.Position.Altitude = NaviData.Altimeter / 2; |
WP.AltitudeRate = 255; // Auto |
// WP.Position.Altitude = NaviData.Altimeter / 2; |
WP.Position.Altitude = NaviData.SetpointAltitude / 2; |
} |
else |
{ |
776,7 → 787,7 |
WP.AltitudeRate = 0; |
WP.Position.Altitude = 0; |
} |
WP.Speed = SD_ComingHomeSpeed; |
WP.Speed = 50; // beim Laden wird der Wert nochmal neu gesetzt |
WP.CamAngle = 0; |
WP.Name[0] = 'P'; |
WP.Name[1] = 0; |
789,17 → 800,25 |
retval = PointList_Save(filename, pWPL_Store->Name, 1); |
|
// clear current point list |
PointList_Clear(); |
if((NC_GPS_ModeCharacter != 'w') && (NC_GPS_ModeCharacter != 'W')) PointList_Clear(); |
else |
{ |
if(FC.StatusFlags & FC_STATUS_FLY) PointList_WPActive(TRUE); |
GPS_pWaypoint = PointList_WPBegin(); // updates POI index |
} |
|
return(retval); |
} |
// load target gps posititon and heading from file |
u8 PointList_LoadSinglePoint(WPL_Store_t * pWPL_Store) |
{ |
u8 filename[30]; |
u8 filename[30], result = 0; |
|
sprintf(filename, "/POINT/POINT%03d.wpl", pWPL_Store->Index); |
pWPL_Store->Name[0] = 0; // clear current list name |
return PointList_Load(filename, pWPL_Store->Name, sizeof(pWPL_Store->Name)); |
result = PointList_Load(filename, pWPL_Store->Name, sizeof(pWPL_Store->Name),Parameter.SingleWpSpeed); |
if(result) UART1_Request_ReadPoint = 1; // Sends Point 1 to the PC |
return(result); |
} |
|
|