Oculars.cpp   Oculars.cpp 
skipping to change at line 124 skipping to change at line 124
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), flagLimitPlanets(false),
magLimitPlanets(0.0), magLimitPlanets(0.0),
flagMoonScale(false), flagMoonScale(false),
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),
telescopesSignalMapper(0), telescopesSignalMapper(0),
skipping to change at line 794 skipping to change at line 793
if (selectedCCDIndex >= ccds.count()) if (selectedCCDIndex >= ccds.count())
selectedCCDIndex = ccds.count() - 1; selectedCCDIndex = ccds.count() - 1;
if (flagShowCCD) if (flagShowCCD)
emit selectedCCDChanged(); emit selectedCCDChanged();
} }
} }
void Oculars::ccdRotationReset() void Oculars::ccdRotationReset()
{ {
ccdRotationAngle = 0.0; CCD *ccd = ccds[selectedCCDIndex];
if (ccd) ccd->setChipRotAngle(0.0);
emit(selectedCCDChanged());
}
double Oculars::ccdRotationAngle() const
{
CCD *ccd = ccds[selectedCCDIndex];
if (ccd) return ccd->chipRotAngle();
else return 0.0;
} }
void Oculars::enableOcular(bool enableOcularMode) void Oculars::enableOcular(bool enableOcularMode)
{ {
if (enableOcularMode) if (enableOcularMode)
{ {
// Close the sensor view if it's displayed // Close the sensor view if it's displayed
if (flagShowCCD) if (flagShowCCD)
{ {
if (actionShowSensor->isChecked()) if (actionShowSensor->isChecked())
skipping to change at line 1128 skipping to change at line 1136
} }
void Oculars::disableLens() void Oculars::disableLens()
{ {
selectedLensIndex = -1; selectedLensIndex = -1;
emit(selectedLensChanged()); emit(selectedLensChanged());
} }
void Oculars::rotateCCD(QString amount) void Oculars::rotateCCD(QString amount)
{ {
ccdRotationAngle += amount.toInt(); CCD *ccd = ccds[selectedCCDIndex];
if (ccdRotationAngle >= 360) { if (!ccd) return;
ccdRotationAngle -= 360; double angle = ccd->chipRotAngle();
} else if (ccdRotationAngle <= -360) { angle += amount.toInt();
ccdRotationAngle += 360; if (angle >= 360) {
angle -= 360;
} else if (angle <= -360) {
angle += 360;
} }
ccd->setChipRotAngle(angle);
emit(selectedCCDChanged());
} }
void Oculars::selectCCDAtIndex(QString indexString) void Oculars::selectCCDAtIndex(QString indexString)
{ {
int index = indexString.toInt(); int index = indexString.toInt();
if (index > -2 && index < ccds.count()) { if (index > -2 && index < ccds.count()) {
selectedCCDIndex = index; selectedCCDIndex = index;
emit(selectedCCDChanged()); emit(selectedCCDChanged());
} }
} }
skipping to change at line 1408 skipping to change at line 1421
// As the FOV is based on the narrow aspect of the s creen, we need to calculate // As the FOV is based on the narrow aspect of the s creen, we need to calculate
// height & width based soley off of that dimension. // height & width based soley off of that dimension.
int aspectIndex = 2; int aspectIndex = 2;
if (params.viewportXywh[2] > params.viewportXywh[3]) { if (params.viewportXywh[2] > params.viewportXywh[3]) {
aspectIndex = 3; aspectIndex = 3;
} }
float width = params.viewportXywh[aspectIndex] * ccd YRatio * params.devicePixelsPerPixel; float width = params.viewportXywh[aspectIndex] * ccd YRatio * params.devicePixelsPerPixel;
float height = params.viewportXywh[aspectIndex] * cc dXRatio * params.devicePixelsPerPixel; float height = params.viewportXywh[aspectIndex] * cc dXRatio * params.devicePixelsPerPixel;
double polarAngle = 0;
// if the telescope is Equatorial derotate the field
if (telescope->isEquatorial()) {
Vec3d CPos;
Vec2f cpos = projector->getViewportCenter();
projector->unProject(cpos[0], cpos[1], CPos)
;
Vec3d CPrel(CPos);
CPrel[2]*=0.2;
Vec3d crel;
projector->project(CPrel, crel);
polarAngle = atan2(cpos[1] - crel[1], cpos[0
] - crel[0]) * (-180.0)/M_PI; // convert to degrees
if (CPos[2] > 0) polarAngle += 90.0;
else polarAngle -= 90.0;
}
if (width > 0.0 && height > 0.0) { if (width > 0.0 && height > 0.0) {
QPoint a, b; QPoint a, b;
QTransform transform = QTransform().translat e(params.viewportCenter[0] * params.devicePixelsPerPixel, QTransform transform = QTransform().translat e(params.viewportCenter[0] * params.devicePixelsPerPixel,
params.viewportCenter[1] * p arams.devicePixelsPerPixel).rotate(-ccdRotationAngle); params.viewportCenter[1] * p arams.devicePixelsPerPixel).rotate(-(ccd->chipRotAngle() + polarAngle));
// bottom line // bottom line
a = transform.map(QPoint(-width/2.0, -height /2.0)); a = transform.map(QPoint(-width/2.0, -height /2.0));
b = transform.map(QPoint(width/2.0, -height/ 2.0)); b = transform.map(QPoint(width/2.0, -height/ 2.0));
painter.drawLine2d(a.x(), a.y(), b.x(), b.y( )); painter.drawLine2d(a.x(), a.y(), b.x(), b.y( ));
// top line // top line
a = transform.map(QPoint(-width/2.0, height/ 2.0)); a = transform.map(QPoint(-width/2.0, height/ 2.0));
b = transform.map(QPoint(width/2.0, height/2 .0)); b = transform.map(QPoint(width/2.0, height/2 .0));
painter.drawLine2d(a.x(), a.y(), b.x(), b.y( )); painter.drawLine2d(a.x(), a.y(), b.x(), b.y( ));
// left line // left line
a = transform.map(QPoint(-width/2.0, -height /2.0)); a = transform.map(QPoint(-width/2.0, -height /2.0));
b = transform.map(QPoint(-width/2.0, height/ 2.0)); b = transform.map(QPoint(-width/2.0, height/ 2.0));
painter.drawLine2d(a.x(), a.y(), b.x(), b.y( )); painter.drawLine2d(a.x(), a.y(), b.x(), b.y( ));
// right line // right line
a = transform.map(QPoint(width/2.0, height/2 .0)); a = transform.map(QPoint(width/2.0, height/2 .0));
b = transform.map(QPoint(width/2.0, -height/ 2.0)); b = transform.map(QPoint(width/2.0, -height/ 2.0));
painter.drawLine2d(a.x(), a.y(), b.x(), b.y( )); painter.drawLine2d(a.x(), a.y(), b.x(), b.y( ));
if(ccd->hasOAG()) {
const double InnerOAGRatio = ccd->ge
tInnerOAGRadius(telescope, lens) / screenFOV;
const double OuterOAGRatio = ccd->ge
tOuterOAGRadius(telescope, lens) / screenFOV;
const double prismXRatio = ccd->getO
AGActualFOVx(telescope, lens) / screenFOV;
float in_oag_r = params.viewportXywh
[aspectIndex] * InnerOAGRatio * params.devicePixelsPerPixel;
float out_oag_r = params.viewportXyw
h[aspectIndex] * OuterOAGRatio * params.devicePixelsPerPixel;
float h_width = params.viewportXywh[
aspectIndex] * prismXRatio * params.devicePixelsPerPixel / 2.0;
//painter.setColor(0.60f, 0.20f, 0.2
0f, .5f);
painter.drawCircle(params.viewportCe
nter[0] * params.devicePixelsPerPixel,
params.viewportCente
r[1] * params.devicePixelsPerPixel, in_oag_r);
painter.drawCircle(params.viewportCe
nter[0] * params.devicePixelsPerPixel,
params.viewportCente
r[1] * params.devicePixelsPerPixel, out_oag_r);
QTransform oag_transform = QTransfor
m().translate(params.viewportCenter[0] * params.devicePixelsPerPixel,
params.viewportCente
r[1] * params.devicePixelsPerPixel).rotate(-(ccd->chipRotAngle() + polarAng
le + ccd->prismPosAngle()));
// bottom line
a = oag_transform.map(QPoint(-h_widt
h, in_oag_r));
b = oag_transform.map(QPoint(h_width
, in_oag_r));
painter.drawLine2d(a.x(),a.y(), b.x(
), b.y());
// top line
a = oag_transform.map(QPoint(-h_widt
h, out_oag_r));
b = oag_transform.map(QPoint(h_width
, out_oag_r));
painter.drawLine2d(a.x(),a.y(), b.x(
), b.y());
// left line
a = oag_transform.map(QPoint(-h_widt
h, out_oag_r));
b = oag_transform.map(QPoint(-h_widt
h, in_oag_r));
painter.drawLine2d(a.x(),a.y(), b.x(
), b.y());
// right line
a = oag_transform.map(QPoint(h_width
, out_oag_r));
b = oag_transform.map(QPoint(h_width
, in_oag_r));
painter.drawLine2d(a.x(),a.y(), b.x(
), b.y());
}
// Tool for planning a mosaic astrophotograp hy: shows a small cross at center of CCD's // Tool for planning a mosaic astrophotograp hy: shows a small cross at center of CCD's
// frame and equatorial coordinates for epoc h J2000.0 of that center. // frame and equatorial coordinates for epoc h J2000.0 of that center.
// Details: https://bugs.launchpad.net/stell arium/+bug/1404695 // Details: https://bugs.launchpad.net/stell arium/+bug/1404695
ratioLimit = 0.25f; ratioLimit = 0.25f;
if (ccdXRatio>=ratioLimit || ccdYRatio>=rati oLimit) if (ccdXRatio>=ratioLimit || ccdYRatio>=rati oLimit)
{ {
// draw cross at center // draw cross at center
float cross = width>height ? height/ 50.f : width/50.f; float cross = width>height ? height/ 50.f : width/50.f;
a = transform.map(QPoint(0.f, -cross )); a = transform.map(QPoint(0.f, -cross ));
skipping to change at line 1464 skipping to change at line 1527
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);
} }
QString coords = QString("%1: %2/%3" ).arg(qc_("RA/Dec (J2000.0) of cross", "abbreviated in the plugin")).arg(cx t).arg(cyt); QString coords = QString("%1: %2/%3" ).arg(qc_("RA/Dec (J2000.0) of cross", "abbreviated in the plugin")).arg(cx t).arg(cyt);
a = transform.map(QPoint(-width/2.0, height/2.0 + 5.f)); a = transform.map(QPoint(-width/2.0, height/2.0 + 5.f));
painter.drawText(a.x(), a.y(), coord s, -ccdRotationAngle); painter.drawText(a.x(), a.y(), coord s, -(ccd->chipRotAngle() + polarAngle));
} }
} }
} }
} }
} }
void Oculars::paintCrosshairs() void Oculars::paintCrosshairs()
{ {
StelCore *core = StelApp::getInstance().getCore(); StelCore *core = StelApp::getInstance().getCore();
 End of changes. 8 change blocks. 
9 lines changed or deleted 100 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/