Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/guide/guide.cpp
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Line(s) | |||||
142 | { | 142 | { | ||
143 | delete guider; | 143 | delete guider; | ||
144 | } | 144 | } | ||
145 | 145 | | |||
146 | void Guide::handleHorizontalPlotSizeChange() | 146 | void Guide::handleHorizontalPlotSizeChange() | ||
147 | { | 147 | { | ||
148 | driftPlot->xAxis->setScaleRatio(driftPlot->yAxis, 1.0); | 148 | driftPlot->xAxis->setScaleRatio(driftPlot->yAxis, 1.0); | ||
149 | driftPlot->replot(); | 149 | driftPlot->replot(); | ||
150 | calibrationPlot->xAxis->setScaleRatio(calibrationPlot->yAxis, 1.0); | ||||
151 | calibrationPlot->replot(); | ||||
150 | } | 152 | } | ||
151 | 153 | | |||
152 | void Guide::handleVerticalPlotSizeChange() | 154 | void Guide::handleVerticalPlotSizeChange() | ||
153 | { | 155 | { | ||
154 | driftPlot->yAxis->setScaleRatio(driftPlot->xAxis, 1.0); | 156 | driftPlot->yAxis->setScaleRatio(driftPlot->xAxis, 1.0); | ||
155 | driftPlot->replot(); | 157 | driftPlot->replot(); | ||
158 | calibrationPlot->yAxis->setScaleRatio(calibrationPlot->xAxis, 1.0); | ||||
159 | calibrationPlot->replot(); | ||||
156 | } | 160 | } | ||
157 | 161 | | |||
158 | void Guide::guideAfterMeridianFlip() | 162 | void Guide::guideAfterMeridianFlip() | ||
159 | { | 163 | { | ||
160 | //This will clear the tracking box selection | 164 | //This will clear the tracking box selection | ||
161 | //The selected guide star is no longer valid due to the flip | 165 | //The selected guide star is no longer valid due to the flip | ||
162 | guideView->setTrackingBoxEnabled(false); | 166 | guideView->setTrackingBoxEnabled(false); | ||
163 | starCenter = QVector3D(); | 167 | starCenter = QVector3D(); | ||
▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Line(s) | 264 | { | |||
269 | driftGraph->clearItems(); //Clears dither text items from the graph | 273 | driftGraph->clearItems(); //Clears dither text items from the graph | ||
270 | driftGraph->replot(); | 274 | driftGraph->replot(); | ||
271 | driftPlot->replot(); | 275 | driftPlot->replot(); | ||
272 | 276 | | |||
273 | //Since the labels got cleared with clearItems above. | 277 | //Since the labels got cleared with clearItems above. | ||
274 | setupNSEWLabels(); | 278 | setupNSEWLabels(); | ||
275 | } | 279 | } | ||
276 | 280 | | |||
281 | void Guide::clearCalibrationGraphs() | ||||
282 | { | ||||
283 | calibrationPlot->graph(0)->data()->clear(); //RA out | ||||
284 | calibrationPlot->graph(1)->data()->clear(); //RA back | ||||
285 | calibrationPlot->graph(2)->data()->clear(); //DEC out | ||||
286 | calibrationPlot->graph(3)->data()->clear(); //DEC back | ||||
287 | calibrationPlot->replot(); | ||||
288 | } | ||||
289 | | ||||
277 | void Guide::setupNSEWLabels() | 290 | void Guide::setupNSEWLabels() | ||
278 | { | 291 | { | ||
279 | //Labels for N/S/E/W | 292 | //Labels for N/S/E/W | ||
280 | QColor raLabelColor(KStarsData::Instance()->colorScheme()->colorNamed("RAGuideError")); | 293 | QColor raLabelColor(KStarsData::Instance()->colorScheme()->colorNamed("RAGuideError")); | ||
281 | QColor deLabelColor(KStarsData::Instance()->colorScheme()->colorNamed("DEGuideError")); | 294 | QColor deLabelColor(KStarsData::Instance()->colorScheme()->colorNamed("DEGuideError")); | ||
282 | 295 | | |||
283 | //DriftGraph | 296 | //DriftGraph | ||
284 | { | 297 | { | ||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | 361 | { | |||
357 | driftPlot->xAxis->setRange(-accuracyRadius * 3, accuracyRadius * 3); | 370 | driftPlot->xAxis->setRange(-accuracyRadius * 3, accuracyRadius * 3); | ||
358 | driftPlot->yAxis->setRange(-accuracyRadius * 3, accuracyRadius * 3); | 371 | driftPlot->yAxis->setRange(-accuracyRadius * 3, accuracyRadius * 3); | ||
359 | driftPlot->graph(0)->rescaleAxes(true); | 372 | driftPlot->graph(0)->rescaleAxes(true); | ||
360 | 373 | | |||
361 | driftPlot->yAxis->setScaleRatio(driftPlot->xAxis, 1.0); | 374 | driftPlot->yAxis->setScaleRatio(driftPlot->xAxis, 1.0); | ||
362 | driftPlot->xAxis->setScaleRatio(driftPlot->yAxis, 1.0); | 375 | driftPlot->xAxis->setScaleRatio(driftPlot->yAxis, 1.0); | ||
363 | 376 | | |||
364 | driftPlot->replot(); | 377 | driftPlot->replot(); | ||
378 | | ||||
379 | calibrationPlot->xAxis->setRange(-10, 10); | ||||
380 | calibrationPlot->yAxis->setRange(-10, 10); | ||||
381 | calibrationPlot->graph(0)->rescaleAxes(true); | ||||
382 | | ||||
383 | calibrationPlot->yAxis->setScaleRatio(calibrationPlot->xAxis, 1.0); | ||||
384 | calibrationPlot->xAxis->setScaleRatio(calibrationPlot->yAxis, 1.0); | ||||
385 | | ||||
386 | calibrationPlot->replot(); | ||||
365 | } | 387 | } | ||
366 | 388 | | |||
367 | void Guide::guideHistory() | 389 | void Guide::guideHistory() | ||
368 | { | 390 | { | ||
369 | int sliderValue = guideSlider->value(); | 391 | int sliderValue = guideSlider->value(); | ||
370 | latestCheck->setChecked(sliderValue == guideSlider->maximum() - 1 || sliderValue == guideSlider->maximum()); | 392 | latestCheck->setChecked(sliderValue == guideSlider->maximum() - 1 || sliderValue == guideSlider->maximum()); | ||
371 | 393 | | |||
372 | driftGraph->graph(2)->data()->clear(); //Clear RA highlighted point | 394 | driftGraph->graph(2)->data()->clear(); //Clear RA highlighted point | ||
▲ Show 20 Lines • Show All 1430 Lines • ▼ Show 20 Line(s) | 1808 | #endif | |||
1803 | 1825 | | |||
1804 | case GUIDE_IDLE: | 1826 | case GUIDE_IDLE: | ||
1805 | case GUIDE_CALIBRATION_ERROR: | 1827 | case GUIDE_CALIBRATION_ERROR: | ||
1806 | setBusy(false); | 1828 | setBusy(false); | ||
1807 | manualDitherB->setEnabled(false); | 1829 | manualDitherB->setEnabled(false); | ||
1808 | break; | 1830 | break; | ||
1809 | 1831 | | |||
1810 | case GUIDE_CALIBRATING: | 1832 | case GUIDE_CALIBRATING: | ||
1833 | clearCalibrationGraphs(); | ||||
1811 | appendLogText(i18n("Calibration started.")); | 1834 | appendLogText(i18n("Calibration started.")); | ||
1812 | setBusy(true); | 1835 | setBusy(true); | ||
1813 | break; | 1836 | break; | ||
1814 | 1837 | | |||
1815 | case GUIDE_GUIDING: | 1838 | case GUIDE_GUIDING: | ||
1816 | if (previousState == GUIDE_SUSPENDED || previousState == GUIDE_DITHERING_SUCCESS) | 1839 | if (previousState == GUIDE_SUSPENDED || previousState == GUIDE_DITHERING_SUCCESS) | ||
1817 | appendLogText(i18n("Guiding resumed.")); | 1840 | appendLogText(i18n("Guiding resumed.")); | ||
1818 | else | 1841 | else | ||
▲ Show 20 Lines • Show All 367 Lines • ▼ Show 20 Line(s) | 2208 | { | |||
2186 | connect(guider, &Ekos::GuideInterface::frameCaptureRequested, this, &Ekos::Guide::capture); | 2209 | connect(guider, &Ekos::GuideInterface::frameCaptureRequested, this, &Ekos::Guide::capture); | ||
2187 | connect(guider, &Ekos::GuideInterface::newLog, this, &Ekos::Guide::appendLogText); | 2210 | connect(guider, &Ekos::GuideInterface::newLog, this, &Ekos::Guide::appendLogText); | ||
2188 | connect(guider, &Ekos::GuideInterface::newStatus, this, &Ekos::Guide::setStatus); | 2211 | connect(guider, &Ekos::GuideInterface::newStatus, this, &Ekos::Guide::setStatus); | ||
2189 | connect(guider, &Ekos::GuideInterface::newStarPosition, this, &Ekos::Guide::setStarPosition); | 2212 | connect(guider, &Ekos::GuideInterface::newStarPosition, this, &Ekos::Guide::setStarPosition); | ||
2190 | 2213 | | |||
2191 | connect(guider, &Ekos::GuideInterface::newAxisDelta, this, &Ekos::Guide::setAxisDelta); | 2214 | connect(guider, &Ekos::GuideInterface::newAxisDelta, this, &Ekos::Guide::setAxisDelta); | ||
2192 | connect(guider, &Ekos::GuideInterface::newAxisPulse, this, &Ekos::Guide::setAxisPulse); | 2215 | connect(guider, &Ekos::GuideInterface::newAxisPulse, this, &Ekos::Guide::setAxisPulse); | ||
2193 | connect(guider, &Ekos::GuideInterface::newAxisSigma, this, &Ekos::Guide::setAxisSigma); | 2216 | connect(guider, &Ekos::GuideInterface::newAxisSigma, this, &Ekos::Guide::setAxisSigma); | ||
2217 | connect(guider, &Ekos::GuideInterface::calibrationUpdate, this, &Ekos::Guide::calibrationUpdate); | ||||
2194 | 2218 | | |||
2195 | connect(guider, &Ekos::GuideInterface::guideEquipmentUpdated, this, &Ekos::Guide::configurePHD2Camera); | 2219 | connect(guider, &Ekos::GuideInterface::guideEquipmentUpdated, this, &Ekos::Guide::configurePHD2Camera); | ||
2196 | } | 2220 | } | ||
2197 | 2221 | | |||
2198 | externalConnectB->setEnabled(false); | 2222 | externalConnectB->setEnabled(false); | ||
2199 | externalDisconnectB->setEnabled(false); | 2223 | externalDisconnectB->setEnabled(false); | ||
2200 | 2224 | | |||
2201 | if (guider != nullptr && guiderType != GUIDE_INTERNAL) | 2225 | if (guider != nullptr && guiderType != GUIDE_INTERNAL) | ||
▲ Show 20 Lines • Show All 355 Lines • ▼ Show 20 Line(s) | 2521 | { | |||
2557 | l_DeltaDEC->setText(QString::number(de, 'f', 2)); | 2581 | l_DeltaDEC->setText(QString::number(de, 'f', 2)); | ||
2558 | 2582 | | |||
2559 | emit newAxisDelta(ra, de); | 2583 | emit newAxisDelta(ra, de); | ||
2560 | 2584 | | |||
2561 | profilePixmap = driftGraph->grab(); | 2585 | profilePixmap = driftGraph->grab(); | ||
2562 | emit newProfilePixmap(profilePixmap); | 2586 | emit newProfilePixmap(profilePixmap); | ||
2563 | } | 2587 | } | ||
2564 | 2588 | | |||
2589 | void Guide::calibrationUpdate(GuideInterface::CalibrationUpdateType type, const QString& message, | ||||
2590 | double dx, double dy) | ||||
2591 | { | ||||
2592 | switch (type) | ||||
2593 | { | ||||
2594 | case GuideInterface::RA_IN: | ||||
2595 | calibrationPlot->graph(0)->addData(dx, dy); | ||||
2596 | break; | ||||
2597 | case GuideInterface::RA_OUT: | ||||
2598 | calibrationPlot->graph(1)->addData(dx, dy); | ||||
2599 | break; | ||||
2600 | case GuideInterface::DEC_IN: | ||||
2601 | calibrationPlot->graph(2)->addData(dx, dy); | ||||
2602 | break; | ||||
2603 | case GuideInterface::DEC_OUT: | ||||
2604 | calibrationPlot->graph(3)->addData(dx, dy); | ||||
2605 | break; | ||||
2606 | case GuideInterface::CALIBRATION_MESSAGE_ONLY: | ||||
2607 | ; | ||||
2608 | } | ||||
2609 | calLabel->setText(message); | ||||
2610 | calibrationPlot->replot(); | ||||
2611 | } | ||||
2612 | | ||||
2565 | void Guide::setAxisSigma(double ra, double de) | 2613 | void Guide::setAxisSigma(double ra, double de) | ||
2566 | { | 2614 | { | ||
2567 | l_ErrRA->setText(QString::number(ra, 'f', 2)); | 2615 | l_ErrRA->setText(QString::number(ra, 'f', 2)); | ||
2568 | l_ErrDEC->setText(QString::number(de, 'f', 2)); | 2616 | l_ErrDEC->setText(QString::number(de, 'f', 2)); | ||
2569 | l_TotalRMS->setText(QString::number(std::hypot(ra, de), 'f', 2)); | 2617 | l_TotalRMS->setText(QString::number(std::hypot(ra, de), 'f', 2)); | ||
2570 | emit newAxisSigma(ra, de); | 2618 | emit newAxisSigma(ra, de); | ||
2571 | } | 2619 | } | ||
2572 | 2620 | | |||
▲ Show 20 Lines • Show All 603 Lines • ▼ Show 20 Line(s) | |||||
3176 | 3224 | | |||
3177 | bool Guide::disconnectGuider() | 3225 | bool Guide::disconnectGuider() | ||
3178 | { | 3226 | { | ||
3179 | return guider->Disconnect(); | 3227 | return guider->Disconnect(); | ||
3180 | } | 3228 | } | ||
3181 | 3229 | | |||
3182 | void Guide::initPlots() | 3230 | void Guide::initPlots() | ||
3183 | { | 3231 | { | ||
3232 | initDriftGraph(); | ||||
3233 | initDriftPlot(); | ||||
3234 | initCalibrationPlot(); | ||||
3235 | | ||||
3236 | connect(rightLayout, &QSplitter::splitterMoved, this, &Ekos::Guide::handleVerticalPlotSizeChange); | ||||
3237 | connect(driftSplitter, &QSplitter::splitterMoved, this, &Ekos::Guide::handleHorizontalPlotSizeChange); | ||||
3238 | | ||||
3239 | //This sets the values of all the Graph Options that are stored. | ||||
3240 | accuracyRadiusSpin->setValue(Options::guiderAccuracyThreshold()); | ||||
3241 | showRAPlotCheck->setChecked(Options::rADisplayedOnGuideGraph()); | ||||
3242 | showDECPlotCheck->setChecked(Options::dEDisplayedOnGuideGraph()); | ||||
3243 | showRACorrectionsCheck->setChecked(Options::rACorrDisplayedOnGuideGraph()); | ||||
3244 | showDECorrectionsCheck->setChecked(Options::dECorrDisplayedOnGuideGraph()); | ||||
3245 | | ||||
3246 | buildTarget(); | ||||
3247 | } | ||||
3248 | | ||||
3249 | void Guide::initDriftGraph() | ||||
3250 | { | ||||
3184 | // Drift Graph Color Settings | 3251 | // Drift Graph Color Settings | ||
3185 | driftGraph->setBackground(QBrush(Qt::black)); | 3252 | driftGraph->setBackground(QBrush(Qt::black)); | ||
3186 | driftGraph->xAxis->setBasePen(QPen(Qt::white, 1)); | 3253 | driftGraph->xAxis->setBasePen(QPen(Qt::white, 1)); | ||
3187 | driftGraph->yAxis->setBasePen(QPen(Qt::white, 1)); | 3254 | driftGraph->yAxis->setBasePen(QPen(Qt::white, 1)); | ||
3188 | driftGraph->xAxis->grid()->setPen(QPen(QColor(140, 140, 140), 1, Qt::DotLine)); | 3255 | driftGraph->xAxis->grid()->setPen(QPen(QColor(140, 140, 140), 1, Qt::DotLine)); | ||
3189 | driftGraph->yAxis->grid()->setPen(QPen(QColor(140, 140, 140), 1, Qt::DotLine)); | 3256 | driftGraph->yAxis->grid()->setPen(QPen(QColor(140, 140, 140), 1, Qt::DotLine)); | ||
3190 | driftGraph->xAxis->grid()->setSubGridPen(QPen(QColor(80, 80, 80), 1, Qt::DotLine)); | 3257 | driftGraph->xAxis->grid()->setSubGridPen(QPen(QColor(80, 80, 80), 1, Qt::DotLine)); | ||
3191 | driftGraph->yAxis->grid()->setSubGridPen(QPen(QColor(80, 80, 80), 1, Qt::DotLine)); | 3258 | driftGraph->yAxis->grid()->setSubGridPen(QPen(QColor(80, 80, 80), 1, Qt::DotLine)); | ||
▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Line(s) | |||||
3299 | connect(driftGraph->yAxis, static_cast<void(QCPAxis::*)(const QCPRange &)>(&QCPAxis::rangeChanged), | 3366 | connect(driftGraph->yAxis, static_cast<void(QCPAxis::*)(const QCPRange &)>(&QCPAxis::rangeChanged), | ||
3300 | this, &Ekos::Guide::setCorrectionGraphScale); | 3367 | this, &Ekos::Guide::setCorrectionGraphScale); | ||
3301 | driftGraph->setInteractions(QCP::iRangeZoom); | 3368 | driftGraph->setInteractions(QCP::iRangeZoom); | ||
3302 | driftGraph->setInteraction(QCP::iRangeDrag, true); | 3369 | driftGraph->setInteraction(QCP::iRangeDrag, true); | ||
3303 | 3370 | | |||
3304 | connect(driftGraph, &QCustomPlot::mouseMove, this, &Ekos::Guide::driftMouseOverLine); | 3371 | connect(driftGraph, &QCustomPlot::mouseMove, this, &Ekos::Guide::driftMouseOverLine); | ||
3305 | connect(driftGraph, &QCustomPlot::mousePress, this, &Ekos::Guide::driftMouseClicked); | 3372 | connect(driftGraph, &QCustomPlot::mousePress, this, &Ekos::Guide::driftMouseClicked); | ||
3306 | 3373 | | |||
3374 | //This sets the visibility of graph components to the stored values. | ||||
3375 | driftGraph->graph(0)->setVisible(Options::rADisplayedOnGuideGraph()); //RA data | ||||
3376 | driftGraph->graph(1)->setVisible(Options::dEDisplayedOnGuideGraph()); //DEC data | ||||
3377 | driftGraph->graph(2)->setVisible(Options::rADisplayedOnGuideGraph()); //RA highlighted point | ||||
3378 | driftGraph->graph(3)->setVisible(Options::dEDisplayedOnGuideGraph()); //DEC highlighted point | ||||
3379 | driftGraph->graph(4)->setVisible(Options::rACorrDisplayedOnGuideGraph()); //RA Pulses | ||||
3380 | driftGraph->graph(5)->setVisible(Options::dECorrDisplayedOnGuideGraph()); //DEC Pulses | ||||
3381 | | ||||
3382 | updateCorrectionsScaleVisibility(); | ||||
3383 | } | ||||
3307 | 3384 | | |||
3385 | void Guide::initDriftPlot() | ||||
3386 | { | ||||
3308 | //drift plot | 3387 | //drift plot | ||
3309 | double accuracyRadius = 2; | 3388 | double accuracyRadius = 2; | ||
3310 | 3389 | | |||
3311 | driftPlot->setBackground(QBrush(Qt::black)); | 3390 | driftPlot->setBackground(QBrush(Qt::black)); | ||
3312 | driftPlot->setSelectionTolerance(10); | 3391 | driftPlot->setSelectionTolerance(10); | ||
3313 | 3392 | | |||
3314 | driftPlot->xAxis->setBasePen(QPen(Qt::white, 1)); | 3393 | driftPlot->xAxis->setBasePen(QPen(Qt::white, 1)); | ||
3315 | driftPlot->yAxis->setBasePen(QPen(Qt::white, 1)); | 3394 | driftPlot->yAxis->setBasePen(QPen(Qt::white, 1)); | ||
Show All 37 Lines | |||||
3353 | driftPlot->addGraph(); | 3432 | driftPlot->addGraph(); | ||
3354 | driftPlot->graph(0)->setLineStyle(QCPGraph::lsNone); | 3433 | driftPlot->graph(0)->setLineStyle(QCPGraph::lsNone); | ||
3355 | driftPlot->graph(0)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssStar, Qt::gray, 5)); | 3434 | driftPlot->graph(0)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssStar, Qt::gray, 5)); | ||
3356 | 3435 | | |||
3357 | driftPlot->addGraph(); | 3436 | driftPlot->addGraph(); | ||
3358 | driftPlot->graph(1)->setLineStyle(QCPGraph::lsNone); | 3437 | driftPlot->graph(1)->setLineStyle(QCPGraph::lsNone); | ||
3359 | driftPlot->graph(1)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssPlusCircle, QPen(Qt::yellow, 2), QBrush(), 10)); | 3438 | driftPlot->graph(1)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssPlusCircle, QPen(Qt::yellow, 2), QBrush(), 10)); | ||
3360 | 3439 | | |||
3361 | connect(rightLayout, &QSplitter::splitterMoved, this, &Ekos::Guide::handleVerticalPlotSizeChange); | 3440 | driftPlot->resize(190, 190); | ||
3362 | connect(driftSplitter, &QSplitter::splitterMoved, this, &Ekos::Guide::handleHorizontalPlotSizeChange); | 3441 | driftPlot->replot(); | ||
3442 | } | ||||
3363 | 3443 | | |||
3364 | //This sets the values of all the Graph Options that are stored. | 3444 | void Guide::initCalibrationPlot() | ||
3365 | accuracyRadiusSpin->setValue(Options::guiderAccuracyThreshold()); | 3445 | { | ||
3366 | showRAPlotCheck->setChecked(Options::rADisplayedOnGuideGraph()); | 3446 | calibrationPlot->setBackground(QBrush(Qt::black)); | ||
3367 | showDECPlotCheck->setChecked(Options::dEDisplayedOnGuideGraph()); | 3447 | calibrationPlot->setSelectionTolerance(10); | ||
3368 | showRACorrectionsCheck->setChecked(Options::rACorrDisplayedOnGuideGraph()); | | |||
3369 | showDECorrectionsCheck->setChecked(Options::dECorrDisplayedOnGuideGraph()); | | |||
3370 | 3448 | | |||
3371 | //This sets the visibility of graph components to the stored values. | 3449 | calibrationPlot->xAxis->setBasePen(QPen(Qt::white, 1)); | ||
3372 | driftGraph->graph(0)->setVisible(Options::rADisplayedOnGuideGraph()); //RA data | 3450 | calibrationPlot->yAxis->setBasePen(QPen(Qt::white, 1)); | ||
3373 | driftGraph->graph(1)->setVisible(Options::dEDisplayedOnGuideGraph()); //DEC data | | |||
3374 | driftGraph->graph(2)->setVisible(Options::rADisplayedOnGuideGraph()); //RA highlighted point | | |||
3375 | driftGraph->graph(3)->setVisible(Options::dEDisplayedOnGuideGraph()); //DEC highlighted point | | |||
3376 | driftGraph->graph(4)->setVisible(Options::rACorrDisplayedOnGuideGraph()); //RA Pulses | | |||
3377 | driftGraph->graph(5)->setVisible(Options::dECorrDisplayedOnGuideGraph()); //DEC Pulses | | |||
3378 | updateCorrectionsScaleVisibility(); | | |||
3379 | 3451 | | |||
3380 | driftPlot->resize(190, 190); | 3452 | calibrationPlot->xAxis->setTickPen(QPen(Qt::white, 1)); | ||
3381 | driftPlot->replot(); | 3453 | calibrationPlot->yAxis->setTickPen(QPen(Qt::white, 1)); | ||
3454 | | ||||
3455 | calibrationPlot->xAxis->setSubTickPen(QPen(Qt::white, 1)); | ||||
3456 | calibrationPlot->yAxis->setSubTickPen(QPen(Qt::white, 1)); | ||||
3457 | | ||||
3458 | calibrationPlot->xAxis->setTickLabelColor(Qt::white); | ||||
3459 | calibrationPlot->yAxis->setTickLabelColor(Qt::white); | ||||
3460 | | ||||
3461 | calibrationPlot->xAxis->setLabelColor(Qt::white); | ||||
3462 | calibrationPlot->yAxis->setLabelColor(Qt::white); | ||||
3463 | | ||||
3464 | calibrationPlot->xAxis->setLabelFont(QFont(font().family(), 10)); | ||||
3465 | calibrationPlot->yAxis->setLabelFont(QFont(font().family(), 10)); | ||||
3466 | calibrationPlot->xAxis->setTickLabelFont(QFont(font().family(), 9)); | ||||
3467 | calibrationPlot->yAxis->setTickLabelFont(QFont(font().family(), 9)); | ||||
3468 | | ||||
3469 | calibrationPlot->xAxis->setLabelPadding(2); | ||||
3470 | calibrationPlot->yAxis->setLabelPadding(2); | ||||
3471 | | ||||
3472 | calibrationPlot->xAxis->grid()->setPen(QPen(QColor(140, 140, 140), 1, Qt::DotLine)); | ||||
3473 | calibrationPlot->yAxis->grid()->setPen(QPen(QColor(140, 140, 140), 1, Qt::DotLine)); | ||||
3474 | calibrationPlot->xAxis->grid()->setSubGridPen(QPen(QColor(80, 80, 80), 1, Qt::DotLine)); | ||||
3475 | calibrationPlot->yAxis->grid()->setSubGridPen(QPen(QColor(80, 80, 80), 1, Qt::DotLine)); | ||||
3476 | calibrationPlot->xAxis->grid()->setZeroLinePen(QPen(Qt::gray)); | ||||
3477 | calibrationPlot->yAxis->grid()->setZeroLinePen(QPen(Qt::gray)); | ||||
3478 | | ||||
3479 | calibrationPlot->xAxis->setLabel(i18n("x (pixels)")); | ||||
3480 | calibrationPlot->yAxis->setLabel(i18n("y (pixels)")); | ||||
3481 | | ||||
3482 | calibrationPlot->xAxis->setRange(-10, 10); | ||||
3483 | calibrationPlot->yAxis->setRange(-10, 10); | ||||
3484 | | ||||
3485 | calibrationPlot->setInteractions(QCP::iRangeZoom); | ||||
3486 | calibrationPlot->setInteraction(QCP::iRangeDrag, true); | ||||
3487 | | ||||
3488 | calibrationPlot->addGraph(); | ||||
3489 | calibrationPlot->graph(0)->setLineStyle(QCPGraph::lsNone); | ||||
3490 | calibrationPlot->graph(0)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssDisc, QPen(KStarsData::Instance()->colorScheme()->colorNamed("RAGuideError"), 2), QBrush(), 6)); | ||||
3491 | calibrationPlot->graph(0)->setName("RA out"); | ||||
3492 | | ||||
3493 | calibrationPlot->addGraph(); | ||||
3494 | calibrationPlot->graph(1)->setLineStyle(QCPGraph::lsNone); | ||||
3495 | calibrationPlot->graph(1)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssCircle, QPen(Qt::white, 2), QBrush(), 4)); | ||||
3496 | calibrationPlot->graph(1)->setName("RA in"); | ||||
3497 | | ||||
3498 | calibrationPlot->addGraph(); | ||||
3499 | calibrationPlot->graph(2)->setLineStyle(QCPGraph::lsNone); | ||||
3500 | calibrationPlot->graph(2)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssDisc, QPen(KStarsData::Instance()->colorScheme()->colorNamed("DEGuideError"), 2), QBrush(), 6)); | ||||
3501 | calibrationPlot->graph(2)->setName("DEC out"); | ||||
3502 | | ||||
3503 | calibrationPlot->addGraph(); | ||||
3504 | calibrationPlot->graph(3)->setLineStyle(QCPGraph::lsNone); | ||||
3505 | calibrationPlot->graph(3)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssCircle, QPen(Qt::yellow, 2), QBrush(), 4)); | ||||
3506 | calibrationPlot->graph(3)->setName("DEC in"); | ||||
3507 | | ||||
3508 | calLabel = new QCPItemText(calibrationPlot); | ||||
3509 | calLabel->setColor(QColor(255,255,255)); | ||||
3510 | calLabel->setPositionAlignment(Qt::AlignTop|Qt::AlignHCenter); | ||||
3511 | calLabel->position->setType(QCPItemPosition::ptAxisRectRatio); | ||||
3512 | calLabel->position->setCoords(0.5, 0); | ||||
3513 | calLabel->setText(""); | ||||
3514 | calLabel->setFont(QFont(font().family(), 10)); | ||||
3515 | calLabel->setVisible(true); | ||||
3382 | 3516 | | |||
3383 | buildTarget(); | 3517 | calibrationPlot->resize(190, 190); | ||
3518 | calibrationPlot->replot(); | ||||
3384 | } | 3519 | } | ||
3385 | 3520 | | |||
3386 | void Guide::initView() | 3521 | void Guide::initView() | ||
3387 | { | 3522 | { | ||
3388 | guideView = new FITSView(guideWidget, FITS_GUIDE); | 3523 | guideView = new FITSView(guideWidget, FITS_GUIDE); | ||
3389 | guideView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); | 3524 | guideView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); | ||
3390 | guideView->setBaseSize(guideWidget->size()); | 3525 | guideView->setBaseSize(guideWidget->size()); | ||
3391 | guideView->createFloatingToolBar(); | 3526 | guideView->createFloatingToolBar(); | ||
▲ Show 20 Lines • Show All 236 Lines • Show Last 20 Lines |