Ocular.cpp   Ocular.cpp 
skipping to change at line 71 skipping to change at line 71
} }
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Instance Methods #pragma mark Instance Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
double Ocular::actualFOV(const Telescope * telescope, const Lens * lens) co nst double Ocular::actualFOV(const Telescope * telescope, const Lens * lens) co nst
{ {
const double lens_multipler = (lens != NULL ? lens->getMultipler() : 1.0f); const double lens_multipler = (lens != Q_NULLPTR ? lens->getMultiple r() : 1.0f);
double actualFOV = 0.0; double actualFOV = 0.0;
if (m_binoculars) { if (m_binoculars) {
actualFOV = appearentFOV(); actualFOV = appearentFOV();
} else if (fieldStop() > 0.0) { } else if (fieldStop() > 0.0) {
actualFOV = fieldStop() / (telescope->focalLength() * lens_ multipler) * 57.3; actualFOV = fieldStop() / (telescope->focalLength() * lens_ multipler) * 57.3;
} else { } else {
//actualFOV = apparent / mag //actualFOV = apparent / mag
actualFOV = appearentFOV() / (telescope->focalLength() * len s_multipler / effectiveFocalLength()); actualFOV = appearentFOV() / (telescope->focalLength() * len s_multipler / effectiveFocalLength());
} }
return actualFOV; return actualFOV;
} }
double Ocular::magnification(const Telescope * telescope, const Lens * lens ) const double Ocular::magnification(const Telescope * telescope, const Lens * lens ) const
{ {
double magnifiction = 0.0; double magnifiction = 0.0;
if (m_binoculars) { if (m_binoculars) {
magnifiction = effectiveFocalLength(); magnifiction = effectiveFocalLength();
} else { } else {
const double lens_multipler = (lens != NULL ? lens->getMulti pler() : 1.0f); const double lens_multipler = (lens != Q_NULLPTR ? lens->get Multipler() : 1.0f);
magnifiction = telescope->focalLength() * lens_multipler / e ffectiveFocalLength(); magnifiction = telescope->focalLength() * lens_multipler / e ffectiveFocalLength();
} }
return magnifiction; return magnifiction;
} }
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Accessors & Mutators #pragma mark Accessors & Mutators
#endif #endif
skipping to change at line 197 skipping to change at line 197
ocular->setBinoculars(theSettings->value(prefix + "binoculars", "fal se").toBool()); ocular->setBinoculars(theSettings->value(prefix + "binoculars", "fal se").toBool());
ocular->setPermanentCrosshair(theSettings->value(prefix + "permanent Crosshair", "false").toBool()); ocular->setPermanentCrosshair(theSettings->value(prefix + "permanent Crosshair", "false").toBool());
ocular->setReticlePath(theSettings->value(prefix + "reticlePath", "" ).toString()); ocular->setReticlePath(theSettings->value(prefix + "reticlePath", "" ).toString());
if (!(ocular->appearentFOV() > 0.0 && ocular->effectiveFocalLength() > 0.0)) { if (!(ocular->appearentFOV() > 0.0 && ocular->effectiveFocalLength() > 0.0)) {
qWarning() << "WARNING: Invalid data for ocular. Ocular valu es must be positive. \n" qWarning() << "WARNING: Invalid data for ocular. Ocular valu es must be positive. \n"
<< "\tafov: " << ocular->appearentFOV() << "\n" << "\tafov: " << ocular->appearentFOV() << "\n"
<< "\tefl: " << ocular->effectiveFocalLength() << "\n" << "\tefl: " << ocular->effectiveFocalLength() << "\n"
<< "\tThis ocular will be ignored."; << "\tThis ocular will be ignored.";
delete ocular; delete ocular;
ocular = NULL; ocular = Q_NULLPTR;
} }
return ocular; return ocular;
} }
void Ocular::writeToSettings(QSettings * settings, const int index) void Ocular::writeToSettings(QSettings * settings, const int index)
{ {
QString prefix = "ocular/" + QVariant(index).toString() + "/"; QString prefix = "ocular/" + QVariant(index).toString() + "/";
settings->setValue(prefix + "name", this->name()); settings->setValue(prefix + "name", this->name());
settings->setValue(prefix + "afov", this->appearentFOV()); settings->setValue(prefix + "afov", this->appearentFOV());
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/