OcularsGuiPanel.cpp   OcularsGuiPanel.cpp 
skipping to change at line 131 skipping to change at line 131
ccdControls->setVisible(false); ccdControls->setVisible(false);
telescopeControls = new QGraphicsWidget(this); telescopeControls = new QGraphicsWidget(this);
telescopeControls->setParentItem(this); telescopeControls->setParentItem(this);
telescopeControls->setVisible(false); telescopeControls->setVisible(false);
fieldOcularName = new QGraphicsTextItem(ocularControls); fieldOcularName = new QGraphicsTextItem(ocularControls);
fieldOcularFl = new QGraphicsTextItem(ocularControls); fieldOcularFl = new QGraphicsTextItem(ocularControls);
fieldOcularAfov = new QGraphicsTextItem(ocularControls); fieldOcularAfov = new QGraphicsTextItem(ocularControls);
fieldCcdName = new QGraphicsTextItem(ccdControls); fieldCcdName = new QGraphicsTextItem(ccdControls);
fieldCcdDimensions = new QGraphicsTextItem(ccdControls); fieldCcdDimensions = new QGraphicsTextItem(ccdControls);
fieldCcdHScale = new QGraphicsTextItem(ccdControls);
fieldCcdVScale = new QGraphicsTextItem(ccdControls);
fieldCcdRotation = new QGraphicsTextItem(ccdControls); fieldCcdRotation = new QGraphicsTextItem(ccdControls);
fieldTelescopeName = new QGraphicsTextItem(telescopeControls); fieldTelescopeName = new QGraphicsTextItem(telescopeControls);
fieldMagnification = new QGraphicsTextItem(telescopeControls); fieldMagnification = new QGraphicsTextItem(telescopeControls);
fieldExitPupil = new QGraphicsTextItem(telescopeControls); fieldExitPupil = new QGraphicsTextItem(telescopeControls);
fieldFov = new QGraphicsTextItem(telescopeControls); fieldFov = new QGraphicsTextItem(telescopeControls);
fieldLensName = new QGraphicsTextItem(lensControls); fieldLensName = new QGraphicsTextItem(lensControls);
fieldLensMultipler = new QGraphicsTextItem(lensControls); fieldLensMultipler = new QGraphicsTextItem(lensControls);
QFont newFont = font(); QFont newFont = font();
skipping to change at line 156 skipping to change at line 158
//Traditional field width from Ocular ;) //Traditional field width from Ocular ;)
QFontMetrics fm(fieldOcularName->font()); QFontMetrics fm(fieldOcularName->font());
int maxWidth = fm.width(QString("MMMMMMMMMMMMMMMMMMM")); int maxWidth = fm.width(QString("MMMMMMMMMMMMMMMMMMM"));
int lineHeight = fm.height(); int lineHeight = fm.height();
fieldOcularName->setTextWidth(maxWidth); fieldOcularName->setTextWidth(maxWidth);
fieldOcularFl->setTextWidth(maxWidth); fieldOcularFl->setTextWidth(maxWidth);
fieldOcularAfov->setTextWidth(maxWidth); fieldOcularAfov->setTextWidth(maxWidth);
fieldCcdName->setTextWidth(maxWidth); fieldCcdName->setTextWidth(maxWidth);
fieldCcdDimensions->setTextWidth(maxWidth); fieldCcdDimensions->setTextWidth(maxWidth);
fieldCcdHScale->setTextWidth(maxWidth);
fieldCcdVScale->setTextWidth(maxWidth);
fieldCcdRotation->setTextWidth(maxWidth); fieldCcdRotation->setTextWidth(maxWidth);
fieldTelescopeName->setTextWidth(maxWidth); fieldTelescopeName->setTextWidth(maxWidth);
fieldMagnification->setTextWidth(maxWidth); fieldMagnification->setTextWidth(maxWidth);
fieldExitPupil->setTextWidth(maxWidth); fieldExitPupil->setTextWidth(maxWidth);
fieldFov->setTextWidth(maxWidth); fieldFov->setTextWidth(maxWidth);
fieldLensName->setTextWidth(maxWidth); fieldLensName->setTextWidth(maxWidth);
fieldLensMultipler->setTextWidth(maxWidth); fieldLensMultipler->setTextWidth(maxWidth);
float scale = lineHeight*1.5; // TODO: change hardcoded 1.5 to edita ble value of scaling coefficient float scale = lineHeight*1.5; // TODO: change hardcoded 1.5 to edita ble value of scaling coefficient
skipping to change at line 550 skipping to change at line 554
posY += fieldOcularName->boundingRect().height(); posY += fieldOcularName->boundingRect().height();
widgetHeight += fieldOcularName->boundingRect().height(); widgetHeight += fieldOcularName->boundingRect().height();
if (ocular->isBinoculars()) if (ocular->isBinoculars())
{ {
fieldOcularFl->setVisible(false); fieldOcularFl->setVisible(false);
fieldOcularAfov->setVisible(false); fieldOcularAfov->setVisible(false);
} }
else else
{ {
double focalLength = ocular->effectiveFocalLength(); QString focalLengthString = QString(q_("Ocular FL: %1 mm")).
QString focalLengthString = QString(q_("Ocular FL: %1 mm")). arg(QString::number(ocular->effectiveFocalLength(), 'f', 1));
arg(focalLength);
fieldOcularFl->setPlainText(focalLengthString); fieldOcularFl->setPlainText(focalLengthString);
fieldOcularFl->setToolTip(q_("Effective focal length of the ocular")); fieldOcularFl->setToolTip(q_("Effective focal length of the ocular"));
fieldOcularFl->setPos(posX, posY); fieldOcularFl->setPos(posX, posY);
posY += fieldOcularFl->boundingRect().height(); posY += fieldOcularFl->boundingRect().height();
widgetHeight += fieldOcularFl->boundingRect().height(); widgetHeight += fieldOcularFl->boundingRect().height();
double apparentFov = ocular->appearentFOV(); QString apparentFovString = QString::number(ocular->appearen
QString apparentFovString = QString::number(apparentFov); tFOV(), 'f', 2);
apparentFovString.append(QChar(0x00B0));// Degree sign apparentFovString.append(QChar(0x00B0));// Degree sign
QString apparentFovLabel = QString(q_("Ocular aFOV: %1")) QString apparentFovLabel = QString(q_("Ocular aFOV: %1"))
.arg(apparentFovString); .arg(apparentFovString);
fieldOcularAfov->setPlainText(apparentFovLabel); fieldOcularAfov->setPlainText(apparentFovLabel);
fieldOcularAfov->setToolTip(q_("Apparent field of view of th e ocular")); fieldOcularAfov->setToolTip(q_("Apparent field of view of th e ocular"));
fieldOcularAfov->setPos(posX, posY); fieldOcularAfov->setPos(posX, posY);
widgetHeight += fieldOcularAfov->boundingRect().height(); widgetHeight += fieldOcularAfov->boundingRect().height();
fieldOcularFl->setVisible(true); fieldOcularFl->setVisible(true);
fieldOcularAfov->setVisible(true); fieldOcularAfov->setVisible(true);
skipping to change at line 696 skipping to change at line 698
widgetWidth += nextCcdButton->boundingRect().width(); widgetWidth += nextCcdButton->boundingRect().width();
posX = prevCcdButton->boundingRect().width(); posX = prevCcdButton->boundingRect().width();
posY = fieldCcdName->boundingRect().height(); posY = fieldCcdName->boundingRect().height();
widgetHeight += fieldCcdName->boundingRect().height(); widgetHeight += fieldCcdName->boundingRect().height();
//We need the current telescope //We need the current telescope
index = ocularsPlugin->selectedTelescopeIndex; index = ocularsPlugin->selectedTelescopeIndex;
Telescope* telescope = ocularsPlugin->telescopes[index]; Telescope* telescope = ocularsPlugin->telescopes[index];
Q_ASSERT(telescope); Q_ASSERT(telescope);
double fovX = ((int)(ccd->getActualFOVx(telescope, lens) * 1000.0)) const double fovX = ccd->getActualFOVx(telescope, lens);
/ 1000.0; const double fovY = ccd->getActualFOVy(telescope, lens);
double fovY = ((int)(ccd->getActualFOVy(telescope, lens) * 1000.0))
/ 1000.0;
QString dimensionsLabel = QString(q_("Dimensions: %1")).arg(ocularsP lugin->getDimensionsString(fovX, fovY)); QString dimensionsLabel = QString(q_("Dimensions: %1")).arg(ocularsP lugin->getDimensionsString(fovX, fovY));
fieldCcdDimensions->setPlainText(dimensionsLabel); fieldCcdDimensions->setPlainText(dimensionsLabel);
fieldCcdDimensions->setToolTip(q_("Dimensions field of view"));
fieldCcdDimensions->setPos(posX, posY); fieldCcdDimensions->setPos(posX, posY);
posY += fieldCcdDimensions->boundingRect().height(); posY += fieldCcdDimensions->boundingRect().height();
widgetHeight += fieldCcdDimensions->boundingRect().height(); widgetHeight += fieldCcdDimensions->boundingRect().height();
//TRANSLATORS: Unit of measure for scale - arcseconds per pixel
QString unit = q_("\"/px");
fieldCcdHScale->setPlainText(QString("%1: %2%3").arg(q_("X scale"),
QString::number(fovX*3600*ccd->binningX()/ccd->resolutionX(), 'f', 4), unit
));
fieldCcdHScale->setToolTip(q_("Horizontal scale"));
fieldCcdHScale->setPos(posX, posY);
posY += fieldCcdHScale->boundingRect().height();
widgetHeight += fieldCcdHScale->boundingRect().height();
fieldCcdVScale->setPlainText(QString("%1: %2%3").arg(q_("Y scale"),
QString::number(fovY*3600*ccd->binningY()/ccd->resolutionY(), 'f', 4), unit
));
fieldCcdVScale->setToolTip(q_("Vertical scale"));
fieldCcdVScale->setPos(posX, posY);
posY += fieldCcdVScale->boundingRect().height();
widgetHeight += fieldCcdVScale->boundingRect().height();
QString rotation = QString::number(ocularsPlugin->ccdRotationAngle() , 'f', 0); QString rotation = QString::number(ocularsPlugin->ccdRotationAngle() , 'f', 0);
rotation.append(QChar(0x00B0)); rotation.append(QChar(0x00B0));
QString rotationLabel = QString(q_("Rotation: %1")).arg(rotation); QString rotationLabel = QString(q_("Rotation: %1")).arg(rotation);
fieldCcdRotation->setPlainText(rotationLabel); fieldCcdRotation->setPlainText(rotationLabel);
fieldCcdRotation->setPos(posX, posY); fieldCcdRotation->setPos(posX, posY);
posY += fieldCcdRotation->boundingRect().height(); posY += fieldCcdRotation->boundingRect().height();
widgetHeight += fieldCcdRotation->boundingRect().height(); widgetHeight += fieldCcdRotation->boundingRect().height();
int rotationButtonsWidth = rotateCcdMinus15Button->boundingRect().wi dth(); int rotationButtonsWidth = rotateCcdMinus15Button->boundingRect().wi dth();
rotationButtonsWidth += rotateCcdMinus5Button->boundingRect().width( ); rotationButtonsWidth += rotateCcdMinus5Button->boundingRect().width( );
skipping to change at line 792 skipping to change at line 807
widgetHeight += fieldTelescopeName->boundingRect().height(); widgetHeight += fieldTelescopeName->boundingRect().height();
Lens *lens = ocularsPlugin->selectedLens(); Lens *lens = ocularsPlugin->selectedLens();
if (ocularsPlugin->flagShowCCD) if (ocularsPlugin->flagShowCCD)
{ {
int index = ocularsPlugin->selectedCCDIndex; int index = ocularsPlugin->selectedCCDIndex;
CCD* ccd = ocularsPlugin->ccds[index]; CCD* ccd = ocularsPlugin->ccds[index];
Q_ASSERT(ccd); Q_ASSERT(ccd);
double fovX = ((int)(ccd->getActualFOVx(telescope, lens) * 1 const double fovX = ccd->getActualFOVx(telescope, lens);
000.0)) / 1000.0; const double fovY = ccd->getActualFOVy(telescope, lens);
double fovY = ((int)(ccd->getActualFOVy(telescope, lens) * 1
000.0)) / 1000.0;
QString dimensionsLabel = QString(q_("Dimensions: %1")).arg( ocularsPlugin->getDimensionsString(fovX, fovY)); QString dimensionsLabel = QString(q_("Dimensions: %1")).arg( ocularsPlugin->getDimensionsString(fovX, fovY));
fieldCcdDimensions->setPlainText(dimensionsLabel); fieldCcdDimensions->setPlainText(dimensionsLabel);
fieldCcdDimensions->setToolTip(q_("Dimensions field of view"
));
//TRANSLATORS: Unit of measure for scale - arcseconds per pi
xel
QString unit = q_("\"/px");
fieldCcdHScale->setPlainText(QString("%1: %2%3").arg(q_("X s
cale"), QString::number(fovX*3600*ccd->binningX()/ccd->resolutionX(), 'f',
4), unit));
fieldCcdHScale->setToolTip(q_("Horizontal scale"));
fieldCcdVScale->setPlainText(QString("%1: %2%3").arg(q_("Y s
cale"), QString::number(fovY*3600*ccd->binningY()/ccd->resolutionY(), 'f',
4), unit));
fieldCcdVScale->setToolTip(q_("Vertical scale"));
fieldMagnification->setVisible(false); fieldMagnification->setVisible(false);
fieldExitPupil->setVisible(false); fieldExitPupil->setVisible(false);
fieldFov->setVisible(false); fieldFov->setVisible(false);
} }
else if (ocularsPlugin->flagShowOculars) else if (ocularsPlugin->flagShowOculars)
{ {
//We need the current ocular //We need the current ocular
int index = ocularsPlugin->selectedOcularIndex; int index = ocularsPlugin->selectedOcularIndex;
Ocular* ocular = ocularsPlugin->oculars[index]; Ocular* ocular = ocularsPlugin->oculars[index];
skipping to change at line 832 skipping to change at line 855
{ {
prevTelescopeButton->setVisible(true); prevTelescopeButton->setVisible(true);
nextTelescopeButton->setVisible(true); nextTelescopeButton->setVisible(true);
fieldTelescopeName->setVisible(true); fieldTelescopeName->setVisible(true);
fieldMagnification->setToolTip(q_("Magnification pro vided by this ocular/lens/telescope combination")); fieldMagnification->setToolTip(q_("Magnification pro vided by this ocular/lens/telescope combination"));
fieldFov->setToolTip(q_("Actual field of view provid ed by this ocular/lens/telescope combination")); fieldFov->setToolTip(q_("Actual field of view provid ed by this ocular/lens/telescope combination"));
fieldExitPupil->setToolTip(q_("Exit pupil provided b y this ocular/lens/telescope combination")); fieldExitPupil->setToolTip(q_("Exit pupil provided b y this ocular/lens/telescope combination"));
} }
//WTF? Rounding? double mag = ocular->magnification(telescope, lens);
double magnification = ((int)(ocular->magnification(telescop QString magnificationString = QString::number(mag, 'f', 1);
e, lens) * 10.0)) / 10.0;
QString magnificationString = QString::number(magnification)
;
magnificationString.append(QChar(0x00D7)); magnificationString.append(QChar(0x00D7));
QString magnificationLabel = QString(q_("Magnification: %1") ).arg(magnificationString); QString magnificationLabel = QString(q_("Magnification: %1") ).arg(magnificationString);
fieldMagnification->setPlainText(magnificationLabel); fieldMagnification->setPlainText(magnificationLabel);
fieldMagnification->setPos(posX, posY); fieldMagnification->setPos(posX, posY);
posY += fieldMagnification->boundingRect().height(); posY += fieldMagnification->boundingRect().height();
widgetHeight += fieldMagnification->boundingRect().height(); widgetHeight += fieldMagnification->boundingRect().height();
double mag = ocular->magnification(telescope, lens);
if (mag>0) if (mag>0)
{ {
double exitPupil = telescope->diameter()/mag; double exitPupil = telescope->diameter()/mag;
if (ocular->isBinoculars()) if (ocular->isBinoculars())
exitPupil = ocular->fieldStop()/mag; exitPupil = ocular->fieldStop()/mag;
QString exitPupilLabel = QString(q_("Exit pupil: %1 mm")).arg(QString::number(exitPupil, 'f', 2)); QString exitPupilLabel = QString(q_("Exit pupil: %1 mm")).arg(QString::number(exitPupil, 'f', 2));
fieldExitPupil->setPlainText(exitPupilLabel); fieldExitPupil->setPlainText(exitPupilLabel);
fieldExitPupil->setPos(posX, posY); fieldExitPupil->setPos(posX, posY);
posY += fieldExitPupil->boundingRect().height(); posY += fieldExitPupil->boundingRect().height();
widgetHeight += fieldExitPupil->boundingRect().heigh t(); widgetHeight += fieldExitPupil->boundingRect().heigh t();
} }
double fov = ((int)(ocular->actualFOV(telescope, lens) * 100 QString fovString = QString::number(ocular->actualFOV(telesc
00.00)) / 10000.0; ope, lens), 'f', 1) + QChar(0x00B0);
QString fovString = QString::number(fov) + QChar(0x00B0);
QString fovLabel = QString(q_("FOV: %1")).arg(fovString); QString fovLabel = QString(q_("FOV: %1")).arg(fovString);
fieldFov->setPlainText(fovLabel); fieldFov->setPlainText(fovLabel);
fieldFov->setPos(posX, posY); fieldFov->setPos(posX, posY);
widgetHeight += fieldFov->boundingRect().height(); widgetHeight += fieldFov->boundingRect().height();
fieldMagnification->setVisible(true); fieldMagnification->setVisible(true);
fieldFov->setVisible(true); fieldFov->setVisible(true);
if (mag>0) if (mag>0)
fieldExitPupil->setVisible(true); fieldExitPupil->setVisible(true);
else else
skipping to change at line 1025 skipping to change at line 1045
buttonConfiguration->setPos(posX, posY); buttonConfiguration->setPos(posX, posY);
} }
void OcularsGuiPanel::setControlsColor(const QColor& color) void OcularsGuiPanel::setControlsColor(const QColor& color)
{ {
Q_ASSERT(fieldOcularName); Q_ASSERT(fieldOcularName);
Q_ASSERT(fieldOcularFl); Q_ASSERT(fieldOcularFl);
Q_ASSERT(fieldOcularAfov); Q_ASSERT(fieldOcularAfov);
Q_ASSERT(fieldCcdName); Q_ASSERT(fieldCcdName);
Q_ASSERT(fieldCcdDimensions); Q_ASSERT(fieldCcdDimensions);
Q_ASSERT(fieldCcdHScale);
Q_ASSERT(fieldCcdVScale);
Q_ASSERT(fieldCcdRotation); Q_ASSERT(fieldCcdRotation);
Q_ASSERT(fieldTelescopeName); Q_ASSERT(fieldTelescopeName);
Q_ASSERT(fieldMagnification); Q_ASSERT(fieldMagnification);
Q_ASSERT(fieldExitPupil); Q_ASSERT(fieldExitPupil);
Q_ASSERT(fieldFov); Q_ASSERT(fieldFov);
Q_ASSERT(fieldLensName); Q_ASSERT(fieldLensName);
Q_ASSERT(fieldLensMultipler); Q_ASSERT(fieldLensMultipler);
fieldOcularName->setDefaultTextColor(color); fieldOcularName->setDefaultTextColor(color);
fieldOcularFl->setDefaultTextColor(color); fieldOcularFl->setDefaultTextColor(color);
fieldOcularAfov->setDefaultTextColor(color); fieldOcularAfov->setDefaultTextColor(color);
fieldCcdName->setDefaultTextColor(color); fieldCcdName->setDefaultTextColor(color);
fieldCcdDimensions->setDefaultTextColor(color); fieldCcdDimensions->setDefaultTextColor(color);
fieldCcdHScale->setDefaultTextColor(color);
fieldCcdVScale->setDefaultTextColor(color);
fieldCcdRotation->setDefaultTextColor(color); fieldCcdRotation->setDefaultTextColor(color);
fieldTelescopeName->setDefaultTextColor(color); fieldTelescopeName->setDefaultTextColor(color);
fieldMagnification->setDefaultTextColor(color); fieldMagnification->setDefaultTextColor(color);
fieldFov->setDefaultTextColor(color); fieldFov->setDefaultTextColor(color);
fieldExitPupil->setDefaultTextColor(color); fieldExitPupil->setDefaultTextColor(color);
fieldLensName->setDefaultTextColor(color); fieldLensName->setDefaultTextColor(color);
fieldLensMultipler->setDefaultTextColor(color); fieldLensMultipler->setDefaultTextColor(color);
} }
void OcularsGuiPanel::setControlsFont(const QFont& font) void OcularsGuiPanel::setControlsFont(const QFont& font)
{ {
Q_ASSERT(fieldOcularName); Q_ASSERT(fieldOcularName);
Q_ASSERT(fieldOcularFl); Q_ASSERT(fieldOcularFl);
Q_ASSERT(fieldOcularAfov); Q_ASSERT(fieldOcularAfov);
Q_ASSERT(fieldCcdName); Q_ASSERT(fieldCcdName);
Q_ASSERT(fieldCcdDimensions); Q_ASSERT(fieldCcdDimensions);
Q_ASSERT(fieldCcdHScale);
Q_ASSERT(fieldCcdVScale);
Q_ASSERT(fieldCcdRotation); Q_ASSERT(fieldCcdRotation);
Q_ASSERT(fieldTelescopeName); Q_ASSERT(fieldTelescopeName);
Q_ASSERT(fieldMagnification); Q_ASSERT(fieldMagnification);
Q_ASSERT(fieldExitPupil); Q_ASSERT(fieldExitPupil);
Q_ASSERT(fieldFov); Q_ASSERT(fieldFov);
Q_ASSERT(fieldLensName); Q_ASSERT(fieldLensName);
Q_ASSERT(fieldLensMultipler); Q_ASSERT(fieldLensMultipler);
fieldOcularName->setFont(font); fieldOcularName->setFont(font);
fieldOcularFl->setFont(font); fieldOcularFl->setFont(font);
fieldOcularAfov->setFont(font); fieldOcularAfov->setFont(font);
fieldCcdName->setFont(font); fieldCcdName->setFont(font);
fieldCcdDimensions->setFont(font); fieldCcdDimensions->setFont(font);
fieldCcdHScale->setFont(font);
fieldCcdVScale->setFont(font);
fieldCcdRotation->setFont(font); fieldCcdRotation->setFont(font);
fieldTelescopeName->setFont(font); fieldTelescopeName->setFont(font);
fieldMagnification->setFont(font); fieldMagnification->setFont(font);
fieldFov->setFont(font); fieldFov->setFont(font);
fieldExitPupil->setFont(font); fieldExitPupil->setFont(font);
fieldLensName->setFont(font); fieldLensName->setFont(font);
fieldLensMultipler->setFont(font); fieldLensMultipler->setFont(font);
} }
void OcularsGuiPanel::setColorScheme(const QString &schemeName) void OcularsGuiPanel::setColorScheme(const QString &schemeName)
 End of changes. 16 change blocks. 
22 lines changed or deleted 55 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/