CCD.cpp   CCD.cpp 
skipping to change at line 31 skipping to change at line 31
#include "Lens.hpp" #include "Lens.hpp"
#include <QDebug> #include <QDebug>
#include <QSettings> #include <QSettings>
#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_resolutionY(0)
, m_chipWidth(0.)
, m_chipHeight(0.)
, m_pixelWidth(0.)
, m_pixelHeight(0.)
{ {
} }
CCD::CCD(const QObject& other) CCD::CCD(const QObject& other)
: m_name(other.property("name").toString())
, m_resolutionX(other.property("resolutionX").toInt())
, m_resolutionY(other.property("resolutionY").toInt())
, m_chipWidth(other.property("chipWidth").toFloat())
, m_chipHeight(other.property("chipHeight").toFloat())
, m_pixelWidth(other.property("pixelWidth").toFloat())
, m_pixelHeight(other.property("pixelHeight").toFloat())
{ {
this->m_name = other.property("name").toString();
this->m_chipHeight = other.property("chipHeight").toFloat();
this->m_chipWidth = other.property("chipWidth").toFloat();
this->m_pixelHeight = other.property("pixelHeight").toFloat();
this->m_pixelWidth = other.property("pixelWidth").toFloat();
this->m_resolutionX = other.property("resolutionX").toInt();
this->m_resolutionY = other.property("resolutionY").toInt();
} }
CCD::~CCD() CCD::~CCD()
{ {
} }
static QMap<int, QString> mapping; static QMap<int, QString> mapping;
QMap<int, QString> CCD::propertyMap() QMap<int, QString> CCD::propertyMap()
{ {
skipping to change at line 156 skipping to change at line 162
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 calLength() * lens_multipler); double FOVy = RADIAN_TO_DEGREES * this->chipWidth() / (telescope->fo calLength() * lens_multipler);
return FOVy; return FOVy;
} }
void CCD::writeToSettings(QSettings * settings, const int index)
{
QString prefix = "ccd/" + QVariant(index).toString() + "/";
settings->setValue(prefix + "name", this->name());
settings->setValue(prefix + "resolutionX", this->resolutionX());
settings->setValue(prefix + "resolutionY", this->resolutionY());
settings->setValue(prefix + "chip_width", this->chipWidth());
settings->setValue(prefix + "chip_height", this->chipHeight());
settings->setValue(prefix + "pixel_width", this->pixelWidth());
settings->setValue(prefix + "pixel_height", this->pixelWidth());
}
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Static Methods #pragma mark Static Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
CCD* CCD::ccdFromSettings(QSettings* theSettings, int ccdIndex) CCD* CCD::ccdFromSettings(QSettings* theSettings, int ccdIndex)
{ {
CCD* ccd = new CCD(); CCD* ccd = new CCD();
QString prefix = "ccd/" + QVariant(ccdIndex).toString() + "/"; QString prefix = "ccd/" + QVariant(ccdIndex).toString() + "/";
 End of changes. 4 change blocks. 
7 lines changed or deleted 24 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/