Subversion Repositories NaviCtrl

Rev

Rev 92 | Rev 152 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 92 Rev 151
Line 87... Line 87...
87
                WPList[i].Position.Longitude = 0;
87
                WPList[i].Position.Longitude = 0;
88
                WPList[i].Position.Altitude = 0;
88
                WPList[i].Position.Altitude = 0;
89
                WPList[i].Heading = -1;
89
                WPList[i].Heading = -1;
90
                WPList[i].ToleranceRadius = 0;  // in meters, if the MK is within that range around the target, then the next target is triggered
90
                WPList[i].ToleranceRadius = 0;  // in meters, if the MK is within that range around the target, then the next target is triggered
91
                WPList[i].HoldTime = 0;                 // in seconds, if the was once in the tolerance area around a WP, this time defines the delay before the next WP is triggered
91
                WPList[i].HoldTime = 0;                 // in seconds, if the was once in the tolerance area around a WP, this time defines the delay before the next WP is triggered
92
                WPList[i].Event_Flag = 0;                       // future implementation
92
                WPList[i].Event_Flag = 0;               // future implementation
93
        }
93
        }
94
        return TRUE;           
94
        return TRUE;           
95
}
95
}
Line 96... Line 96...
96
 
96
 
Line 114... Line 114...
114
 
114
 
115
// rewind to the begin of the list, and returns the first waypoint
115
// rewind to the begin of the list, and returns the first waypoint
116
Waypoint_t* WPList_Begin(void)
116
Waypoint_t* WPList_Begin(void)
117
{
117
{
118
        WPIndex = 0; // reset list index
118
        WPIndex = 0; // reset list index
119
        NaviData.WaypointIndex = WPIndex;
119
        NaviData.WaypointIndex = WPIndex + 1;
120
        if(WPNumber > 0) return(&(WPList[WPIndex])); // if list is not empty return pointer to first waypoint in the list
120
        if(WPNumber > 0) return(&(WPList[WPIndex])); // if list is not empty return pointer to first waypoint in the list
Line 121... Line 121...
121
        else return NULL; // else return NULL
121
        else return NULL; // else return NULL
Line -... Line 122...
-
 
122
 
-
 
123
}
-
 
124
 
-
 
125
// jump to the end of the list, and returns the last waypoint
-
 
126
Waypoint_t* WPList_End(void)
-
 
127
{
-
 
128
        if(WPNumber > 0)
-
 
129
        {
-
 
130
                NaviData.WaypointIndex = WPNumber;
-
 
131
                WPIndex = WPNumber - 1;
-
 
132
                return(&(WPList[WPIndex])); // if list is not empty return pointer to first waypoint in the list
-
 
133
        }
-
 
134
        else
-
 
135
        {
-
 
136
                return NULL; // else return NULL
-
 
137
        }
122
 
138
 
123
}
139
}
124
 
140
 
125
// returns a pointer to the next waypoint or NULL if the end of the list has been reached
141
// returns a pointer to the next waypoint or NULL if the end of the list has been reached
126
Waypoint_t* WPList_Next(void)
142
Waypoint_t* WPList_Next(void)
127
{
143
{
128
        if((WPIndex + 1) < WPNumber) // if the next WPIndex exist
144
        if((WPIndex + 1) < WPNumber) // if the next WPIndex exist
129
        {
145
        {
130
                WPIndex++; // goto next
146
                WPIndex++; // goto next
131
                NaviData.WaypointIndex = WPIndex;
147
                NaviData.WaypointIndex = WPIndex + 1;
132
                return(&(WPList[WPIndex]));     // return pointer to this waypoint
148
                return(&(WPList[WPIndex]));     // return pointer to this waypoint