CCD.cpp   CCD.cpp 
skipping to change at line 25 skipping to change at line 25
* 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 "CCD.hpp" #include "CCD.hpp"
#include "Telescope.hpp" #include "Telescope.hpp"
#include "Lens.hpp" #include "Lens.hpp"
#include <QDebug> #include <QDebug>
#include <QSettings> #include <QSettings>
#include <QtMath>
#include <math.h> #include <math.h>
#define RADIAN_TO_DEGREES 57.2957795131 #define RADIAN_TO_DEGREES 57.2957795131
CCD::CCD() CCD::CCD()
: m_resolutionX(0) : m_resolutionX(0)
, m_resolutionY(0) , m_resolutionY(0)
, m_chipWidth(0.) , m_chipWidth(0.)
, m_chipHeight(0.) , m_chipHeight(0.)
skipping to change at line 151 skipping to change at line 152
} }
void CCD::setPixelHeight(double height) void CCD::setPixelHeight(double height)
{ {
m_pixelHeight = height; m_pixelHeight = height;
} }
double CCD::getActualFOVx(Telescope *telescope, Lens *lens) const double CCD::getActualFOVx(Telescope *telescope, Lens *lens) const
{ {
const double lens_multipler = (lens != NULL ? lens->multipler() : 1. 0f); const double lens_multipler = (lens != NULL ? lens->multipler() : 1. 0f);
double FOVx = RADIAN_TO_DEGREES * this->chipHeight() / (telescope->f double fovX = RADIAN_TO_DEGREES * 2 * qAtan(this->chipHeight() /(2.0
ocalLength() * lens_multipler); * telescope->focalLength() * lens_multipler));
return FOVx; return fovX;
} }
double CCD::getActualFOVy(Telescope *telescope, Lens *lens) const double CCD::getActualFOVy(Telescope *telescope, Lens *lens) const
{ {
const double lens_multipler = (lens != NULL ? lens->multipler() : 1. 0f); const double lens_multipler = (lens != NULL ? lens->multipler() : 1. 0f);
double FOVy = RADIAN_TO_DEGREES * this->chipWidth() / (telescope->fo double fovY = RADIAN_TO_DEGREES * 2 * qAtan(this->chipWidth() /(2.0
calLength() * lens_multipler); * telescope->focalLength() * lens_multipler));
return FOVy; return fovY;
} }
void CCD::writeToSettings(QSettings * settings, const int index) void CCD::writeToSettings(QSettings * settings, const int index)
{ {
QString prefix = "ccd/" + QVariant(index).toString() + "/"; QString prefix = "ccd/" + QVariant(index).toString() + "/";
settings->setValue(prefix + "name", this->name()); settings->setValue(prefix + "name", this->name());
settings->setValue(prefix + "resolutionX", this->resolutionX()); settings->setValue(prefix + "resolutionX", this->resolutionX());
settings->setValue(prefix + "resolutionY", this->resolutionY()); settings->setValue(prefix + "resolutionY", this->resolutionY());
settings->setValue(prefix + "chip_width", this->chipWidth()); settings->setValue(prefix + "chip_width", this->chipWidth());
settings->setValue(prefix + "chip_height", this->chipHeight()); settings->setValue(prefix + "chip_height", this->chipHeight());
 End of changes. 3 change blocks. 
6 lines changed or deleted 7 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/