Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/observatory/observatory.cpp
Show First 20 Lines • Show All 516 Lines • ▼ Show 20 Line(s) | 496 | { | |||
---|---|---|---|---|---|
517 | weatherActionsBox->setVisible(true); | 517 | weatherActionsBox->setVisible(true); | ||
518 | weatherActionsBox->setEnabled(true); | 518 | weatherActionsBox->setEnabled(true); | ||
519 | weatherWarningBox->setChecked(getWeatherModel()->getWarningActionsActive()); | 519 | weatherWarningBox->setChecked(getWeatherModel()->getWarningActionsActive()); | ||
520 | weatherAlertBox->setChecked(getWeatherModel()->getAlertActionsActive()); | 520 | weatherAlertBox->setChecked(getWeatherModel()->getAlertActionsActive()); | ||
521 | setWeatherStatus(getWeatherModel()->status()); | 521 | setWeatherStatus(getWeatherModel()->status()); | ||
522 | setWarningActions(getWeatherModel()->getWarningActions()); | 522 | setWarningActions(getWeatherModel()->getWarningActions()); | ||
523 | setAlertActions(getWeatherModel()->getAlertActions()); | 523 | setAlertActions(getWeatherModel()->getAlertActions()); | ||
524 | weatherStatusTimer.start(1000); | 524 | weatherStatusTimer.start(1000); | ||
525 | if (getWeatherModel()->refresh() == false) | ||||
526 | appendLogText(i18n("Refreshing weather data failed.")); | ||||
525 | } | 527 | } | ||
526 | 528 | | |||
527 | void Observatory::shutdownWeather() | 529 | void Observatory::shutdownWeather() | ||
528 | { | 530 | { | ||
529 | weatherStatusTimer.stop(); | 531 | weatherStatusTimer.stop(); | ||
530 | setWeatherStatus(ISD::Weather::WEATHER_IDLE); | 532 | setWeatherStatus(ISD::Weather::WEATHER_IDLE); | ||
531 | enableWeather(false); | 533 | enableWeather(false); | ||
532 | } | 534 | } | ||
Show All 12 Lines | 538 | { | |||
545 | } | 547 | } | ||
546 | 548 | | |||
547 | // store the data | 549 | // store the data | ||
548 | sensorGraphData[id]->append(QCPGraphData(static_cast<double>(now.toTime_t()), value)); | 550 | sensorGraphData[id]->append(QCPGraphData(static_cast<double>(now.toTime_t()), value)); | ||
549 | 551 | | |||
550 | // add data for the graphs we display | 552 | // add data for the graphs we display | ||
551 | if (selectedSensorID == id) | 553 | if (selectedSensorID == id) | ||
552 | { | 554 | { | ||
555 | // display first point in scattered style | ||||
556 | if (sensorGraphData[id]->size() == 1) | ||||
557 | sensorGraphs->graph()->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssCircle, QPen(Qt::black, 0), QBrush(Qt::green), 5)); | ||||
558 | else | ||||
559 | sensorGraphs->graph()->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssNone)); | ||||
560 | | ||||
553 | // display data point | 561 | // display data point | ||
554 | sensorGraphs->graph()->addData(sensorGraphData[id]->last().key, sensorGraphData[id]->last().value); | 562 | sensorGraphs->graph()->addData(sensorGraphData[id]->last().key, sensorGraphData[id]->last().value); | ||
555 | sensorGraphs->rescaleAxes(); | 563 | sensorGraphs->rescaleAxes(); | ||
556 | // ensure that the 0-line is visible | 564 | // ensure that the 0-line is visible | ||
557 | if ((sensorRanges[id] > 0 && value < 0) || (sensorRanges[id] < 0 && value > 0)) | 565 | if ((sensorRanges[id] > 0 && value < 0) || (sensorRanges[id] < 0 && value > 0)) | ||
558 | sensorRanges[id] = 0; | 566 | sensorRanges[id] = 0; | ||
559 | 567 | | |||
560 | // ensure visibility of the 0-line on the y-axis | 568 | // ensure visibility of the 0-line on the y-axis | ||
▲ Show 20 Lines • Show All 313 Lines • Show Last 20 Lines |