Oculars.cpp   Oculars.cpp 
skipping to change at line 112 skipping to change at line 112
flagShowTelrad(false), flagShowTelrad(false),
usageMessageLabelID(-1), usageMessageLabelID(-1),
flagAzimuthalGrid(false), flagAzimuthalGrid(false),
flagGalacticGrid(false), flagGalacticGrid(false),
flagEquatorGrid(false), flagEquatorGrid(false),
flagEquatorJ2000Grid(false), flagEquatorJ2000Grid(false),
flagEquatorLine(false), flagEquatorLine(false),
flagEclipticLine(false), flagEclipticLine(false),
flagEclipticJ2000Grid(false), flagEclipticJ2000Grid(false),
flagMeridianLine(false), flagMeridianLine(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),
ccdRotationAngle(0.0), ccdRotationAngle(0.0),
maxEyepieceAngle(0.0), maxEyepieceAngle(0.0),
requireSelection(true), requireSelection(true),
skipping to change at line 574 skipping to change at line 575
} }
if (lensCount > 0 && actualLensCount < lensCount) if (lensCount > 0 && actualLensCount < lensCount)
{ {
qWarning() << "The Oculars ini file appears to be co rrupt; delete it."; qWarning() << "The Oculars ini file appears to be co rrupt; delete it.";
} }
ocularDialog = new OcularDialog(this, &ccds, &oculars, &tele scopes, &lense); ocularDialog = new OcularDialog(this, &ccds, &oculars, &tele scopes, &lense);
initializeActivationActions(); initializeActivationActions();
determineMaxEyepieceAngle(); determineMaxEyepieceAngle();
guiPanelEnabled = settings->value("enable_control_panel", fa lse).toBool(); guiPanelEnabled = settings->value("enable_control_panel", tr ue).toBool();
enableGuiPanel(guiPanelEnabled); enableGuiPanel(guiPanelEnabled);
setFlagDecimalDegrees(settings->value("use_decimal_degrees", false).toBool()); setFlagDecimalDegrees(settings->value("use_decimal_degrees", false).toBool());
setFlagLimitMagnitude(settings->value("limit_stellar_magnitu de", true).toBool()); setFlagLimitMagnitude(settings->value("limit_stellar_magnitu de", true).toBool());
setFlagInitFovUsage(settings->value("use_initial_fov", false ).toBool()); setFlagInitFovUsage(settings->value("use_initial_fov", false ).toBool());
setFlagUseFlipForCCD(settings->value("use_ccd_flip", false). toBool()); setFlagUseFlipForCCD(settings->value("use_ccd_flip", false). toBool());
} catch (std::runtime_error& e) { } catch (std::runtime_error& e) {
qWarning() << "WARNING: unable to locate ocular.ini file or create a default one for Ocular plugin: " << e.what(); qWarning() << "WARNING: unable to locate ocular.ini file or create a default one for Ocular plugin: " << e.what();
ready = false; ready = false;
} }
skipping to change at line 1446 skipping to change at line 1447
a = transform.map(QPoint(-cross, 0.f )); a = transform.map(QPoint(-cross, 0.f ));
b = transform.map(QPoint(cross, 0.f) ); b = transform.map(QPoint(cross, 0.f) );
painter.drawLine2d(a.x(), a.y(), b.x (), b.y()); painter.drawLine2d(a.x(), a.y(), b.x (), b.y());
// calculate coordinates of the cent er and show it // calculate coordinates of the cent er and show it
Vec3d centerPosition; Vec3d centerPosition;
Vec2f center = projector->getViewpor tCenter(); Vec2f center = projector->getViewpor tCenter();
projector->unProject(center[0], cent er[1], centerPosition); projector->unProject(center[0], cent er[1], centerPosition);
double cx, cy; double cx, cy;
QString cxt, cyt; QString cxt, cyt;
StelUtils::rectToSphe(&cx,&cy,core-> equinoxEquToJ2000(centerPosition)); // Calculate RA/DE (J2000.0) and show i t... StelUtils::rectToSphe(&cx,&cy,core-> equinoxEquToJ2000(centerPosition)); // Calculate RA/DE (J2000.0) and show i t...
bool withDecimalDegree = dynamic_cas t<StelGui*>(StelApp::getInstance().getGui())->getFlagShowDecimalDegrees(); bool withDecimalDegree = StelApp::ge tInstance().getFlagShowDecimalDegrees();
if (withDecimalDegree) if (withDecimalDegree)
{ {
cxt = StelUtils::radToDecDeg Str(cx, 5, false, true); cxt = StelUtils::radToDecDeg Str(cx, 5, false, true);
cyt = StelUtils::radToDecDeg Str(cy); cyt = StelUtils::radToDecDeg Str(cy);
} }
else else
{ {
cxt = StelUtils::radToHmsStr (cx, true); cxt = StelUtils::radToHmsStr (cx, true);
cyt = StelUtils::radToDmsStr (cy, true); cyt = StelUtils::radToDmsStr (cy, true);
} }
skipping to change at line 1556 skipping to change at line 1557
void Oculars::paintText(const StelCore* core) void Oculars::paintText(const StelCore* core)
{ {
const StelProjectorP prj = core->getProjection(StelCore::FrameAltAz) ; const StelProjectorP prj = core->getProjection(StelCore::FrameAltAz) ;
StelPainter painter(prj); StelPainter painter(prj);
// Get the current instruments // Get the current instruments
CCD *ccd = NULL; CCD *ccd = NULL;
if(selectedCCDIndex != -1) { if(selectedCCDIndex != -1) {
ccd = ccds[selectedCCDIndex]; ccd = ccds[selectedCCDIndex];
} }
Ocular *ocular = oculars[selectedOcularIndex]; Ocular *ocular = NULL;
Telescope *telescope = telescopes[selectedTelescopeIndex]; if(selectedOcularIndex !=-1) {
Lens *lens = selectedLensIndex >=0 ? lense[selectedLensIndex] : NUL ocular = oculars[selectedOcularIndex];
L; }
Telescope *telescope = NULL;
if(selectedTelescopeIndex != -1) {
telescope = telescopes[selectedTelescopeIndex];
}
Lens *lens = NULL;
if(selectedLensIndex != -1) {
lens = lense[selectedLensIndex];
}
// set up the color and the GL state // set up the color and the GL state
painter.setColor(0.8, 0.48, 0.0, 1); painter.setColor(0.8, 0.48, 0.0, 1);
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND); glEnable(GL_BLEND);
// Get the X & Y positions, and the line height // Get the X & Y positions, and the line height
painter.setFont(font); painter.setFont(font);
QString widthString = "MMMMMMMMMMMMMMMMMMM"; QString widthString = "MMMMMMMMMMMMMMMMMMM";
skipping to change at line 1580 skipping to change at line 1590
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) {
QString ocularNumberLabel; QString ocularNumberLabel;
QString name = ocular->name(); QString 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 1637 skipping to change at line 1649
} }
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 telescopeNumberLabel;
QString telescopeName = telescope->name(); QString telescopeName = "";
if (telescope!=NULL)
name = 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);
skipping to change at line 1672 skipping to change at line 1686
QString fovString = QString::number(fov); QString fovString = QString::number(fov);
fovString.append(QChar(0x00B0));//Degree sign fovString.append(QChar(0x00B0));//Degree sign
QString fovLabel = QString(q_("FOV: %1")).arg(fovStr ing); QString fovLabel = QString(q_("FOV: %1")).arg(fovStr ing);
painter.drawText(xPosition, yPosition, fovLabel); painter.drawText(xPosition, yPosition, fovLabel);
} }
} }
// The CCD // The CCD
if (flagShowCCD) { if (flagShowCCD) {
QString ccdSensorLabel, ccdInfoLabel; QString ccdSensorLabel, ccdInfoLabel;
double fovX = ((int)(ccd->getActualFOVx(telescope, lens) * 1 QString name = "";
000.0)) / 1000.0; double fovX = 0.0;
double fovY = ((int)(ccd->getActualFOVy(telescope, lens) * 1 double fovY = 0.0;
000.0)) / 1000.0; if (ccd!=NULL)
{
fovX = ((int)(ccd->getActualFOVx(telescope, lens) *
1000.0)) / 1000.0;
fovY = ((int)(ccd->getActualFOVy(telescope, lens) *
1000.0)) / 1000.0;
name = ccd->name();
}
ccdInfoLabel = QString(q_("Dimensions: %1")).arg(getDimensio nsString(fovX, fovY)); ccdInfoLabel = QString(q_("Dimensions: %1")).arg(getDimensio nsString(fovX, fovY));
QString name = ccd->name();
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);
} }
skipping to change at line 1782 skipping to change at line 1802
StelSkyDrawer *skyManager = core->getSkyDrawer(); StelSkyDrawer *skyManager = core->getSkyDrawer();
gridManager->setFlagAzimuthalGrid(flagAzimuthalGrid); gridManager->setFlagAzimuthalGrid(flagAzimuthalGrid);
gridManager->setFlagGalacticGrid(flagGalacticGrid); gridManager->setFlagGalacticGrid(flagGalacticGrid);
gridManager->setFlagEquatorGrid(flagEquatorGrid); gridManager->setFlagEquatorGrid(flagEquatorGrid);
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->setFlagHorizonLine(flagHorizonLine); gridManager->setFlagHorizonLine(flagHorizonLine);
gridManager->setFlagGalacticEquatorLine(flagGalacticEquatorLine); gridManager->setFlagGalacticEquatorLine(flagGalacticEquatorLine);
skyManager->setFlagLuminanceAdaptation(flagAdaptation); skyManager->setFlagLuminanceAdaptation(flagAdaptation);
skyManager->setFlagStarMagnitudeLimit(flagLimitStars); skyManager->setFlagStarMagnitudeLimit(flagLimitStars);
skyManager->setFlagNebulaMagnitudeLimit(flagLimitDSOs); skyManager->setFlagNebulaMagnitudeLimit(flagLimitDSOs);
skyManager->setCustomStarMagnitudeLimit(magLimitStars); skyManager->setCustomStarMagnitudeLimit(magLimitStars);
skyManager->setCustomNebulaMagnitudeLimit(magLimitDSOs); skyManager->setCustomNebulaMagnitudeLimit(magLimitDSOs);
movementManager->setFlagTracking(false); movementManager->setFlagTracking(false);
movementManager->setFlagEnableZoomKeys(true); movementManager->setFlagEnableZoomKeys(true);
movementManager->setFlagEnableMouseNavigation(true); movementManager->setFlagEnableMouseNavigation(true);
skipping to change at line 1825 skipping to change at line 1846
GridLinesMgr *gridManager = (GridLinesMgr *)StelApp: :getInstance().getModuleMgr().getModule("GridLinesMgr"); GridLinesMgr *gridManager = (GridLinesMgr *)StelApp: :getInstance().getModuleMgr().getModule("GridLinesMgr");
// Current state // Current state
flagAzimuthalGrid = gridManager->getFlagAzimuthalGri d(); flagAzimuthalGrid = gridManager->getFlagAzimuthalGri d();
flagGalacticGrid = gridManager->getFlagGalacticGrid( ); flagGalacticGrid = gridManager->getFlagGalacticGrid( );
flagEquatorGrid = gridManager->getFlagEquatorGrid(); flagEquatorGrid = gridManager->getFlagEquatorGrid();
flagEquatorJ2000Grid = gridManager->getFlagEquatorJ2 000Grid(); flagEquatorJ2000Grid = gridManager->getFlagEquatorJ2 000Grid();
flagEquatorLine = gridManager->getFlagEquatorLine(); flagEquatorLine = gridManager->getFlagEquatorLine();
flagEclipticLine = gridManager->getFlagEclipticLine( ); flagEclipticLine = gridManager->getFlagEclipticLine( );
flagEclipticJ2000Grid = gridManager->getFlagEcliptic J2000Grid(); flagEclipticJ2000Grid = gridManager->getFlagEcliptic J2000Grid();
flagMeridianLine = gridManager->getFlagMeridianLine( ); flagMeridianLine = gridManager->getFlagMeridianLine( );
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();
flagLimitDSOs = skyManager->getFlagNebulaMagnitudeLi mit(); flagLimitDSOs = skyManager->getFlagNebulaMagnitudeLi mit();
magLimitStars = skyManager->getCustomStarMagnitudeLi mit(); magLimitStars = skyManager->getCustomStarMagnitudeLi mit();
magLimitDSOs = skyManager->getCustomNebulaMagnitudeL imit(); magLimitDSOs = skyManager->getCustomNebulaMagnitudeL imit();
skipping to change at line 1865 skipping to change at line 1887
StelSkyDrawer *skyManager = core->getSkyDrawer(); StelSkyDrawer *skyManager = core->getSkyDrawer();
gridManager->setFlagAzimuthalGrid(false); gridManager->setFlagAzimuthalGrid(false);
gridManager->setFlagGalacticGrid(false); gridManager->setFlagGalacticGrid(false);
gridManager->setFlagEquatorGrid(false); gridManager->setFlagEquatorGrid(false);
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->setFlagHorizonLine(false); gridManager->setFlagHorizonLine(false);
gridManager->setFlagGalacticEquatorLine(false); gridManager->setFlagGalacticEquatorLine(false);
skyManager->setFlagLuminanceAdaptation(false); skyManager->setFlagLuminanceAdaptation(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()) {
 End of changes. 11 change blocks. 
13 lines changed or deleted 35 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/