void RfSystem::reset() { BaseClass::reset(); // --- // Do we need to find the antenna? // --- if (getAntenna() == 0 && getAntennaName() != 0 && getOwnship() != 0) { // We have a name of the antenna, but not the antenna it's self const char* name = *getAntennaName(); // Get the named antenna from the player's list of gimbals, antennas and optics Antenna* p = dynamic_cast<Antenna*>( getOwnship()->getGimbalByName(name) ); if (p != 0) { setAntenna( p ); getAntenna()->setSystem(this); } if (getAntenna() == 0) { // The assigned antenna was not found! std::cerr << "RfSystem::reset() ERROR -- antenna: " << name << ", was not found!" << std::endl; setSlotAntennaName(0); } } // --- // Initialize players of interest // --- processPlayersOfInterest(); }
//------------------------------------------------------------------------------ // updateData() -- update background data here //------------------------------------------------------------------------------ void RfSystem::updateData(const LCreal dt) { // --- // Process our player's of interest // --- processPlayersOfInterest(); // --- // Our base class methods // --- BaseClass::updateData(dt); }
//------------------------------------------------------------------------------ // updateData() -- update background data here //------------------------------------------------------------------------------ void IrSystem::updateData(const double dt) { // --- // Do we need to find the seeker? // --- if (getSeeker() == nullptr && getSeekerName() != nullptr && getOwnship() != nullptr) { // We have a name of the seeker, but not the seeker itself const char* name = *getSeekerName(); // Get the named seeker from the player's list of gimbals const auto p = dynamic_cast<IrSeeker*>( getOwnship()->getGimbalByName(name) ); if (p != nullptr) { setSeeker( p ); // FAB - not needed - esp if multiple sensors on a seeker. //getSeeker()->setSystem(this); } if (getSeeker() == nullptr) { // The assigned seeker was not found! if (isMessageEnabled(MSG_ERROR)) { std::cerr << "IrSystem::update() ERROR -- seeker: " << name << ", was not found!" << std::endl; } setSlotSeekerName(nullptr); } } // --- // Process our players of interest // --- processPlayersOfInterest(); // --- // Our base class methods // --- BaseClass::updateData(dt); }