Ocular.cpp   Ocular.cpp 
skipping to change at line 28 skipping to change at line 28
#include "Ocular.hpp" #include "Ocular.hpp"
#include "Telescope.hpp" #include "Telescope.hpp"
#include "Lens.hpp" #include "Lens.hpp"
Ocular::Ocular() Ocular::Ocular()
: m_binoculars(false), : m_binoculars(false),
m_permanetCrosshair(false), m_permanetCrosshair(false),
m_appearentFOV(0.0), m_appearentFOV(0.0),
m_effectiveFocalLength(0.0), m_effectiveFocalLength(0.0),
m_fieldStop(0.0), m_fieldStop(0.0)
m_reticleFOV(0.0)
{ {
} }
Ocular::Ocular(const QObject& other) Ocular::Ocular(const QObject& other)
: m_binoculars(other.property("binoculars").toBool()), : m_binoculars(other.property("binoculars").toBool()),
m_permanetCrosshair(other.property("permanentCrosshair").toBool()) , m_permanetCrosshair(other.property("permanentCrosshair").toBool()) ,
m_appearentFOV(other.property("appearentFOV").toDouble()), m_appearentFOV(other.property("appearentFOV").toDouble()),
m_effectiveFocalLength(other.property("effectiveFocalLength").toDo uble()), m_effectiveFocalLength(other.property("effectiveFocalLength").toDo uble()),
m_fieldStop(other.property("fieldStop").toDouble()), m_fieldStop(other.property("fieldStop").toDouble()),
m_name(other.property("name").toString()), m_name(other.property("name").toString()),
m_reticlePath(other.property("reticlePath").toString()), m_reticlePath(other.property("reticlePath").toString())
m_reticleFOV(other.property("reticleFOV").toDouble())
{ {
} }
Ocular::~Ocular() Ocular::~Ocular()
{ {
} }
static QMap<int, QString> mapping; static QMap<int, QString> mapping;
QMap<int, QString> Ocular::propertyMap(void) QMap<int, QString> Ocular::propertyMap(void)
{ {
skipping to change at line 186 skipping to change at line 184
#pragma mark Static Methods #pragma mark Static Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
Ocular * Ocular::ocularFromSettings(const QSettings *theSettings, const int ocularIndex) Ocular * Ocular::ocularFromSettings(const QSettings *theSettings, const int ocularIndex)
{ {
Ocular* ocular = new Ocular(); Ocular* ocular = new Ocular();
QString prefix = "ocular/" + QVariant(ocularIndex).toString() + "/"; QString prefix = "ocular/" + QVariant(ocularIndex).toString() + "/";
ocular->setName(theSettings->value(prefix + "name", "").toString()); ocular->setName(theSettings->value(prefix + "name", "").toString());
ocular->setAppearentFOV(theSettings->value(prefix + "afov", "0.0").t ocular->setAppearentFOV(theSettings->value(prefix + "afov", 0.0).toD
oDouble()); ouble());
ocular->setEffectiveFocalLength(theSettings->value(prefix + "efl", " ocular->setEffectiveFocalLength(theSettings->value(prefix + "efl", 0
0.0").toDouble()); .0).toDouble());
ocular->setFieldStop(theSettings->value(prefix + "fieldStop", "0.0") ocular->setFieldStop(theSettings->value(prefix + "fieldStop", 0.0).t
.toDouble()); oDouble());
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;
 End of changes. 3 change blocks. 
10 lines changed or deleted 8 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/