Ocular.cpp   Ocular.cpp 
skipping to change at line 21 skipping to change at line 21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "Ocular.hpp" #include "Ocular.hpp"
#include "Telescope.hpp" #include "Telescope.hpp"
#include "Lens.hpp"
Ocular::Ocular() Ocular::Ocular()
{ {
} }
Ocular::Ocular(const QObject& other) Ocular::Ocular(const QObject& other)
{ {
this->m_appearentFOV = other.property("appearentFOV").toDouble(); this->m_appearentFOV = other.property("appearentFOV").toDouble();
this->m_effectiveFocalLength = other.property("effectiveFocalLength" ).toDouble(); this->m_effectiveFocalLength = other.property("effectiveFocalLength" ).toDouble();
this->m_fieldStop = other.property("fieldStop").toDouble(); this->m_fieldStop = other.property("fieldStop").toDouble();
skipping to change at line 59 skipping to change at line 60
} }
return mapping; return mapping;
} }
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Instance Methods #pragma mark Instance Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
double Ocular::actualFOV(Telescope *telescope) const double Ocular::actualFOV(Telescope *telescope, Lens *lens) const
{ {
const double lens_multipler = (lens != NULL ? lens->multipler() : 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() * 57.3; actualFOV = fieldStop() / (telescope->focalLength() * lens_ multipler) * 57.3;
} else { } else {
//actualFOV = apparent / mag //actualFOV = apparent / mag
actualFOV = appearentFOV() / (telescope->focalLength() / eff ectiveFocalLength()); actualFOV = appearentFOV() / (telescope->focalLength() * len s_multipler / effectiveFocalLength());
} }
return actualFOV; return actualFOV;
} }
double Ocular::magnification(Telescope *telescope) const double Ocular::magnification(Telescope *telescope, Lens *lens) const
{ {
double magnifiction = 0.0; double magnifiction = 0.0;
if (m_binoculars) { if (m_binoculars) {
magnifiction = effectiveFocalLength(); magnifiction = effectiveFocalLength();
} else { } else {
magnifiction = telescope->focalLength() / effectiveFocalLeng const double lens_multipler = (lens != NULL ? lens->multiple
th(); r() : 1.0f);
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
/* ********************************************************************* */ /* ********************************************************************* */
 End of changes. 7 change blocks. 
6 lines changed or deleted 10 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/