return false;
}
- _plan->setCurrentIndex(0);
+ _plan->activate();
active->setBoolValue(true);
SG_LOG(SG_AUTOPILOT, SG_INFO, "route-manager, activate route ok");
return true;
_currentWaypointChanged = true;
unlockDelegate();
}
-
+
+void FlightPlan::activate()
+{
+ lockDelegate();
+
+ _currentIndex = 0;
+ _currentWaypointChanged = true;
+
+ if (_delegate) {
+ _delegate->runActivated();
+ }
+
+ unlockDelegate();
+}
+
void FlightPlan::finish()
{
if (_currentIndex == -1) {
endOfFlightPlan();
}
+void FlightPlan::Delegate::runActivated()
+{
+ if (_inner) _inner->runActivated();
+ activated();
+}
+
void FlightPlan::setFollowLegTrackToFixes(bool tf)
{
_followLegTrackToFix = tf;
virtual void arrivalChanged() { }
virtual void waypointsChanged() { }
virtual void cleared() { }
+ virtual void activated() { }
virtual void currentWaypointChanged() { }
virtual void endOfFlightPlan() { }
protected:
void runCurrentWaypointChanged();
void runCleared();
void runFinished();
-
+ void runActivated();
+
friend class FlightPlan;
bool _deleteWithPlan;
{ return _currentIndex; }
void setCurrentIndex(int index);
-
+
+ void activate();
+
void finish();
Leg* currentLeg() const;
{
callDelegateMethod("endOfFlightPlan");
}
+
+ virtual void activated()
+ {
+ callDelegateMethod("activated");
+ }
private:
void callDelegateMethod(const char* method)