Example #1
0
//------------------------------------------------------------------------------
// updateData() -- update Non-time critical stuff here
//------------------------------------------------------------------------------
void Navigation::updateData(const LCreal dt)
{    
    // ---
    // Update our position, attitude and velocities
    // ---
    if (getOwnship() != 0) {
        velValid = updateSysVelocity();
        posValid = updateSysPosition();
        attValid = updateSysAttitude();
        magVarValid = updateMagVar();
    }
    else {
        posValid = false;
        attValid = false;
        velValid = false;
        magVarValid = false;
    }
    
    // ---
    // Update the BaseClass and our primary route
    // ---
    BaseClass::updateData(dt);
    if (priRoute != 0) priRoute->updateData(dt);

    // Update our bullseye
    if (bull != 0) bull->compute(this);

    // ---
    // Update our navigational steering data
    // ---
    updateNavSteering();
    
}
Example #2
0
//------------------------------------------------------------------------------
// Process phase
//------------------------------------------------------------------------------
void Navigation::process(const LCreal dt)
{
   BaseClass::process(dt);

   // ---
   // Update our position, attitude and velocities
   // ---
   if (getOwnship() != 0) {
      velValid = updateSysVelocity();
      posValid = updateSysPosition();
      attValid = updateSysAttitude();
      magVarValid = updateMagVar();
   }
   else {
      posValid = false;
      attValid = false;
      velValid = false;
      magVarValid = false;
   }

   // Update UTC
   double v = utc + dt;
   if (v >= Basic::Time::D2S) v = (v - Basic::Time::D2S);
   setUTC(v);

   // ---
   // Update our primary route
   // ---
   if (priRoute != 0) priRoute->tcFrame(dt);

   // Update our bullseye
   if (bull != 0) bull->compute(this);

   // ---
   // Update our navigational steering data
   // ---
   updateNavSteering();
}