Oculars.cpp   Oculars.cpp 
skipping to change at line 41 skipping to change at line 41
#include "StelGuiItems.hpp" #include "StelGuiItems.hpp"
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "StelMainView.hpp" #include "StelMainView.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelMovementMgr.hpp" #include "StelMovementMgr.hpp"
#include "StelObjectMgr.hpp" #include "StelObjectMgr.hpp"
#include "StelPainter.hpp" #include "StelPainter.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "StelTextureMgr.hpp" #include "StelTextureMgr.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "SolarSystem.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include <QAction> #include <QAction>
#include <QDebug> #include <QDebug>
#include <QDir> #include <QDir>
#include <QGraphicsWidget> #include <QGraphicsWidget>
#include <QKeyEvent> #include <QKeyEvent>
#include <QMenu> #include <QMenu>
#include <QMouseEvent> #include <QMouseEvent>
#include <QtNetwork> #include <QtNetwork>
skipping to change at line 120 skipping to change at line 121
flagEclipticJ2000Grid(false), flagEclipticJ2000Grid(false),
flagMeridianLine(false), flagMeridianLine(false),
flagLongitudeLine(false), flagLongitudeLine(false),
flagHorizonLine(false), flagHorizonLine(false),
flagGalacticEquatorLine(false), flagGalacticEquatorLine(false),
flagAdaptation(false), flagAdaptation(false),
flagLimitStars(false), flagLimitStars(false),
magLimitStars(0.0), magLimitStars(0.0),
flagLimitDSOs(false), flagLimitDSOs(false),
magLimitDSOs(0.0), magLimitDSOs(0.0),
flagLimitPlanets(false),
magLimitPlanets(0.0),
flagMoonScale(false),
ccdRotationAngle(0.0), ccdRotationAngle(0.0),
maxEyepieceAngle(0.0), maxEyepieceAngle(0.0),
requireSelection(true), requireSelection(true),
flagLimitMagnitude(false), flagLimitMagnitude(false),
useMaxEyepieceAngle(true), useMaxEyepieceAngle(true),
guiPanelEnabled(false), guiPanelEnabled(false),
flagDecimalDegrees(false), flagDecimalDegrees(false),
ccdRotationSignalMapper(0), ccdRotationSignalMapper(0),
ccdsSignalMapper(0), ccdsSignalMapper(0),
ocularsSignalMapper(0), ocularsSignalMapper(0),
skipping to change at line 1588 skipping to change at line 1592
QString widthString = "MMMMMMMMMMMMMMMMMMM"; QString widthString = "MMMMMMMMMMMMMMMMMMM";
float insetFromRHS = painter.getFontMetrics().width(widthString); float insetFromRHS = painter.getFontMetrics().width(widthString);
StelProjector::StelProjectorParams projectorParams = core->getCurren tStelProjectorParams(); StelProjector::StelProjectorParams projectorParams = core->getCurren tStelProjectorParams();
int xPosition = projectorParams.viewportXywh[2]; int xPosition = projectorParams.viewportXywh[2];
xPosition -= insetFromRHS; xPosition -= insetFromRHS;
int yPosition = projectorParams.viewportXywh[3]; int yPosition = projectorParams.viewportXywh[3];
yPosition -= 40; yPosition -= 40;
const int lineHeight = painter.getFontMetrics().height(); const int lineHeight = painter.getFontMetrics().height();
// The Ocular // The Ocular
if (flagShowOculars) { if (flagShowOculars && ocular!=NULL)
{
QString ocularNumberLabel; QString ocularNumberLabel;
QString name = ""; QString name = ocular->name();
if (ocular!=NULL)
name = ocular->name();
if (name.isEmpty()) if (name.isEmpty())
{ {
ocularNumberLabel = QString(q_("Ocular #%1")) ocularNumberLabel = QString(q_("Ocular #%1"))
.arg(selectedOcularIndex); .arg(selectedOcularIndex);
} }
else else
{ {
ocularNumberLabel = QString(q_("Ocular #%1: %2")) ocularNumberLabel = QString(q_("Ocular #%1: %2"))
.arg(selectedOcularIndex) .arg(selectedOcularIndex)
.arg(name); .arg(name);
skipping to change at line 1648 skipping to change at line 1651
} }
} }
else else
{ {
lensNumberLabel = QString (q_("Lens: none")) ; lensNumberLabel = QString (q_("Lens: none")) ;
} }
painter.drawText(xPosition, yPosition, lensNumberLab el); painter.drawText(xPosition, yPosition, lensNumberLab el);
yPosition-=lineHeight; yPosition-=lineHeight;
// The telescope // The telescope
QString telescopeNumberLabel; QString telescopeString = "";
QString telescopeName = ""; QString magString = "";
QString fovString = "";
if (telescope!=NULL) if (telescope!=NULL)
name = telescope->name();
if (telescopeName.isEmpty())
{
telescopeNumberLabel = QString(q_("Telescope
#%1"))
.arg(selectedTelescopeIndex)
;
}
else
{ {
telescopeNumberLabel = QString(q_("Telescope QString telescopeName = telescope->name();
#%1: %2"))
.arg(selectedTelescopeIndex) if (telescopeName.isEmpty())
.arg(telescopeName); telescopeString = QString("%1").arg(
selectedTelescopeIndex);
else
telescopeString = QString("%1: %2").
arg(selectedTelescopeIndex).arg(telescopeName);
// General info
if (lens!=NULL)
{
magString = QString::number(((int)(o
cular->magnification(telescope, lens) * 10.0)) / 10.0);
magString.append(QChar(0x00D7));//Mu
ltiplication sign
fovString = QString::number(((int)(o
cular->actualFOV(telescope, lens) * 10000.00)) / 10000.0);
fovString.append(QChar(0x00B0));//De
gree sign
}
} }
painter.drawText(xPosition, yPosition, telescopeNumb
erLabel); painter.drawText(xPosition, yPosition, QString(q_("T
elescope #%1")).arg(telescopeString));
yPosition-=lineHeight; yPosition-=lineHeight;
// General info painter.drawText(xPosition, yPosition, QString(q_("M
double magnification = ((int)(ocular->magnification( agnification: %1")).arg(magString));
telescope, lens) * 10.0)) / 10.0;
QString magString = QString::number(magnification);
magString.append(QChar(0x00D7));//Multiplication sig
n
QString magnificationLabel = QString(q_("Magnificati
on: %1"))
.arg(magString);
painter.drawText(xPosition, yPosition, magnification
Label);
yPosition-=lineHeight; yPosition-=lineHeight;
double fov = ((int)(ocular->actualFOV(telescope, len painter.drawText(xPosition, yPosition, QString(q_("F
s) * 10000.00)) / 10000.0; OV: %1")).arg(fovString));
QString fovString = QString::number(fov);
fovString.append(QChar(0x00B0));//Degree sign
QString fovLabel = QString(q_("FOV: %1")).arg(fovStr
ing);
painter.drawText(xPosition, yPosition, fovLabel);
} }
} }
// The CCD // The CCD
if (flagShowCCD) { if (flagShowCCD && ccd!=NULL) {
QString ccdSensorLabel, ccdInfoLabel; QString ccdSensorLabel, ccdInfoLabel;
QString name = ""; QString name = "";
QString telescopeName = "";
double fovX = 0.0; double fovX = 0.0;
double fovY = 0.0; double fovY = 0.0;
if (ccd!=NULL) if (telescope!=NULL && lens!=NULL)
{ {
fovX = ((int)(ccd->getActualFOVx(telescope, lens) * 1000.0)) / 1000.0; fovX = ((int)(ccd->getActualFOVx(telescope, lens) * 1000.0)) / 1000.0;
fovY = ((int)(ccd->getActualFOVy(telescope, lens) * 1000.0)) / 1000.0; fovY = ((int)(ccd->getActualFOVy(telescope, lens) * 1000.0)) / 1000.0;
name = ccd->name(); name = ccd->name();
telescopeName = telescope->name();
} }
ccdInfoLabel = QString(q_("Dimensions: %1")).arg(getDimensio nsString(fovX, fovY)); ccdInfoLabel = QString(q_("Dimensions: %1")).arg(getDimensio nsString(fovX, fovY));
if (name.isEmpty()) if (name.isEmpty())
{ {
ccdSensorLabel = QString(q_("Sensor #%1")).arg(selec tedCCDIndex); ccdSensorLabel = QString(q_("Sensor #%1")).arg(selec tedCCDIndex);
} }
else else
{ {
ccdSensorLabel = QString(q_("Sensor #%1: %2")) ccdSensorLabel = QString(q_("Sensor #%1: %2"))
.arg(selectedCCDIndex) .arg(selectedCCDIndex)
.arg(name); .arg(name);
} }
painter.drawText(xPosition, yPosition, ccdSensorLabel);
yPosition-=lineHeight;
painter.drawText(xPosition, yPosition, ccdInfoLabel);
yPosition-=lineHeight;
// The telescope // The telescope
QString telescopeNumberLabel; QString telescopeNumberLabel;
QString telescopeName = telescope->name();
if (telescopeName.isEmpty()) if (telescopeName.isEmpty())
{ {
telescopeNumberLabel = QString(q_("Telescope #%1")) telescopeNumberLabel = QString(q_("Telescope #%1"))
.arg(selectedTelescopeIndex); .arg(selectedTelescopeIndex);
} }
else else
{ {
telescopeNumberLabel = QString(q_("Telescope #%1: %2 ")) telescopeNumberLabel = QString(q_("Telescope #%1: %2 "))
.arg(selectedTelescopeIndex) .arg(selectedTelescopeIndex)
.arg(telescopeName); .arg(telescopeName);
} }
painter.drawText(xPosition, yPosition, ccdSensorLabel);
yPosition-=lineHeight;
painter.drawText(xPosition, yPosition, ccdInfoLabel);
yPosition-=lineHeight;
painter.drawText(xPosition, yPosition, telescopeNumberLabel) ; painter.drawText(xPosition, yPosition, telescopeNumberLabel) ;
} }
} }
void Oculars::validateAndLoadIniFile() void Oculars::validateAndLoadIniFile()
{ {
// Insure the module directory exists // Insure the module directory exists
StelFileMgr::makeSureDirExistsAndIsWritable(StelFileMgr::getUserDir( )+"/modules/Oculars"); StelFileMgr::makeSureDirExistsAndIsWritable(StelFileMgr::getUserDir( )+"/modules/Oculars");
StelFileMgr::Flags flags = (StelFileMgr::Flags)(StelFileMgr::Directo ry|StelFileMgr::Writable); StelFileMgr::Flags flags = (StelFileMgr::Flags)(StelFileMgr::Directo ry|StelFileMgr::Writable);
skipping to change at line 1807 skipping to change at line 1810
gridManager->setFlagEquatorJ2000Grid(flagEquatorJ2000Grid); gridManager->setFlagEquatorJ2000Grid(flagEquatorJ2000Grid);
gridManager->setFlagEquatorLine(flagEquatorLine); gridManager->setFlagEquatorLine(flagEquatorLine);
gridManager->setFlagEclipticLine(flagEclipticLine); gridManager->setFlagEclipticLine(flagEclipticLine);
gridManager->setFlagEclipticJ2000Grid(flagEclipticJ2000Grid); gridManager->setFlagEclipticJ2000Grid(flagEclipticJ2000Grid);
gridManager->setFlagMeridianLine(flagMeridianLine); gridManager->setFlagMeridianLine(flagMeridianLine);
gridManager->setFlagLongitudeLine(flagLongitudeLine); gridManager->setFlagLongitudeLine(flagLongitudeLine);
gridManager->setFlagHorizonLine(flagHorizonLine); gridManager->setFlagHorizonLine(flagHorizonLine);
gridManager->setFlagGalacticEquatorLine(flagGalacticEquatorLine); gridManager->setFlagGalacticEquatorLine(flagGalacticEquatorLine);
skyManager->setFlagLuminanceAdaptation(flagAdaptation); skyManager->setFlagLuminanceAdaptation(flagAdaptation);
skyManager->setFlagStarMagnitudeLimit(flagLimitStars); skyManager->setFlagStarMagnitudeLimit(flagLimitStars);
skyManager->setFlagPlanetMagnitudeLimit(flagLimitPlanets);
skyManager->setFlagNebulaMagnitudeLimit(flagLimitDSOs); skyManager->setFlagNebulaMagnitudeLimit(flagLimitDSOs);
skyManager->setCustomStarMagnitudeLimit(magLimitStars); skyManager->setCustomStarMagnitudeLimit(magLimitStars);
skyManager->setCustomPlanetMagnitudeLimit(magLimitPlanets);
skyManager->setCustomNebulaMagnitudeLimit(magLimitDSOs); skyManager->setCustomNebulaMagnitudeLimit(magLimitDSOs);
movementManager->setFlagTracking(false); movementManager->setFlagTracking(false);
movementManager->setFlagEnableZoomKeys(true); movementManager->setFlagEnableZoomKeys(true);
movementManager->setFlagEnableMouseNavigation(true); movementManager->setFlagEnableMouseNavigation(true);
GETSTELMODULE(SolarSystem)->setFlagMoonScale(flagMoonScale);
// Set the screen display // Set the screen display
core->setMaskType(StelProjector::MaskNone); core->setMaskType(StelProjector::MaskNone);
core->setFlipHorz(false); core->setFlipHorz(false);
core->setFlipVert(false); core->setFlipVert(false);
if (getFlagInitFovUsage()) if (getFlagInitFovUsage())
movementManager->zoomTo(movementManager->getInitFov()); movementManager->zoomTo(movementManager->getInitFov());
else else
movementManager->zoomTo(initialFOV); movementManager->zoomTo(initialFOV);
} }
skipping to change at line 1854 skipping to change at line 1861
flagEclipticJ2000Grid = gridManager->getFlagEcliptic J2000Grid(); flagEclipticJ2000Grid = gridManager->getFlagEcliptic J2000Grid();
flagMeridianLine = gridManager->getFlagMeridianLine( ); flagMeridianLine = gridManager->getFlagMeridianLine( );
flagLongitudeLine = gridManager->getFlagLongitudeLin e(); flagLongitudeLine = gridManager->getFlagLongitudeLin e();
flagHorizonLine = gridManager->getFlagHorizonLine(); flagHorizonLine = gridManager->getFlagHorizonLine();
flagGalacticEquatorLine = gridManager->getFlagGalact icEquatorLine(); flagGalacticEquatorLine = gridManager->getFlagGalact icEquatorLine();
StelSkyDrawer *skyManager = core->getSkyDrawer(); StelSkyDrawer *skyManager = core->getSkyDrawer();
// Current state // Current state
flagAdaptation = skyManager->getFlagLuminanceAdaptat ion(); flagAdaptation = skyManager->getFlagLuminanceAdaptat ion();
flagLimitStars = skyManager->getFlagStarMagnitudeLim it(); flagLimitStars = skyManager->getFlagStarMagnitudeLim it();
flagLimitPlanets = skyManager->getFlagPlanetMagnitud eLimit();
flagLimitDSOs = skyManager->getFlagNebulaMagnitudeLi mit(); flagLimitDSOs = skyManager->getFlagNebulaMagnitudeLi mit();
magLimitStars = skyManager->getCustomStarMagnitudeLi mit(); magLimitStars = skyManager->getCustomStarMagnitudeLi mit();
magLimitPlanets = skyManager->getCustomPlanetMagnitu deLimit();
magLimitDSOs = skyManager->getCustomNebulaMagnitudeL imit(); magLimitDSOs = skyManager->getCustomNebulaMagnitudeL imit();
flagMoonScale = GETSTELMODULE(SolarSystem)->getFlagM
oonScale();
StelMovementMgr *movementManager = core->getMovement Mgr(); StelMovementMgr *movementManager = core->getMovement Mgr();
initialFOV = movementManager->getCurrentFov(); initialFOV = movementManager->getCurrentFov();
} }
// set new state // set new state
zoomOcular(); zoomOcular();
} else { } else {
//reset to original state //reset to original state
unzoomOcular(); unzoomOcular();
} }
skipping to change at line 1892 skipping to change at line 1903
gridManager->setFlagEquatorJ2000Grid(false); gridManager->setFlagEquatorJ2000Grid(false);
gridManager->setFlagEquatorLine(false); gridManager->setFlagEquatorLine(false);
gridManager->setFlagEclipticLine(false); gridManager->setFlagEclipticLine(false);
gridManager->setFlagEclipticJ2000Grid(false); gridManager->setFlagEclipticJ2000Grid(false);
gridManager->setFlagMeridianLine(false); gridManager->setFlagMeridianLine(false);
gridManager->setFlagLongitudeLine(false); gridManager->setFlagLongitudeLine(false);
gridManager->setFlagHorizonLine(false); gridManager->setFlagHorizonLine(false);
gridManager->setFlagGalacticEquatorLine(false); gridManager->setFlagGalacticEquatorLine(false);
skyManager->setFlagLuminanceAdaptation(false); skyManager->setFlagLuminanceAdaptation(false);
GETSTELMODULE(SolarSystem)->setFlagMoonScale(false);
movementManager->setFlagTracking(true); movementManager->setFlagTracking(true);
movementManager->setFlagEnableZoomKeys(false); movementManager->setFlagEnableZoomKeys(false);
movementManager->setFlagEnableMouseNavigation(false); movementManager->setFlagEnableMouseNavigation(false);
// We won't always have a selected object // We won't always have a selected object
if (StelApp::getInstance().getStelObjectMgr().getWasSelected()) { if (StelApp::getInstance().getStelObjectMgr().getWasSelected()) {
StelObjectP selectedObject = StelApp::getInstance().getStelO bjectMgr().getSelectedObject()[0]; StelObjectP selectedObject = StelApp::getInstance().getStelO bjectMgr().getSelectedObject()[0];
movementManager->moveToJ2000(selectedObject->getEquinoxEquat orialPos(core), 0.0, 1); movementManager->moveToJ2000(selectedObject->getEquinoxEquat orialPos(core), 0.0, 1);
} }
 End of changes. 25 change blocks. 
47 lines changed or deleted 60 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/