Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/manager.cpp
Show First 20 Lines • Show All 425 Lines • ▼ Show 20 Line(s) | 411 | { | |||
---|---|---|---|---|---|
426 | 426 | | |||
427 | captureProcess.reset(); | 427 | captureProcess.reset(); | ||
428 | focusProcess.reset(); | 428 | focusProcess.reset(); | ||
429 | guideProcess.reset(); | 429 | guideProcess.reset(); | ||
430 | domeProcess.reset(); | 430 | domeProcess.reset(); | ||
431 | alignProcess.reset(); | 431 | alignProcess.reset(); | ||
432 | mountProcess.reset(); | 432 | mountProcess.reset(); | ||
433 | weatherProcess.reset(); | 433 | weatherProcess.reset(); | ||
434 | observatoryProcess.reset(); | ||||
434 | dustCapProcess.reset(); | 435 | dustCapProcess.reset(); | ||
435 | 436 | | |||
436 | Ekos::CommunicationStatus previousStatus = m_ekosStatus; | 437 | Ekos::CommunicationStatus previousStatus = m_ekosStatus; | ||
437 | m_ekosStatus = Ekos::Idle; | 438 | m_ekosStatus = Ekos::Idle; | ||
438 | if (previousStatus != m_ekosStatus) | 439 | if (previousStatus != m_ekosStatus) | ||
439 | emit ekosStatusChanged(m_ekosStatus); | 440 | emit ekosStatusChanged(m_ekosStatus); | ||
440 | 441 | | |||
441 | previousStatus = m_indiStatus; | 442 | previousStatus = m_indiStatus; | ||
▲ Show 20 Lines • Show All 1419 Lines • ▼ Show 20 Line(s) | 1852 | { | |||
1861 | else if (currentWidget == captureProcess.get()) | 1862 | else if (currentWidget == captureProcess.get()) | ||
1862 | ekosLogOut->setPlainText(captureProcess->getLogText()); | 1863 | ekosLogOut->setPlainText(captureProcess->getLogText()); | ||
1863 | else if (currentWidget == focusProcess.get()) | 1864 | else if (currentWidget == focusProcess.get()) | ||
1864 | ekosLogOut->setPlainText(focusProcess->getLogText()); | 1865 | ekosLogOut->setPlainText(focusProcess->getLogText()); | ||
1865 | else if (currentWidget == guideProcess.get()) | 1866 | else if (currentWidget == guideProcess.get()) | ||
1866 | ekosLogOut->setPlainText(guideProcess->getLogText()); | 1867 | ekosLogOut->setPlainText(guideProcess->getLogText()); | ||
1867 | else if (currentWidget == mountProcess.get()) | 1868 | else if (currentWidget == mountProcess.get()) | ||
1868 | ekosLogOut->setPlainText(mountProcess->getLogText()); | 1869 | ekosLogOut->setPlainText(mountProcess->getLogText()); | ||
1869 | if (currentWidget == schedulerProcess.get()) | 1870 | else if (currentWidget == schedulerProcess.get()) | ||
1870 | ekosLogOut->setPlainText(schedulerProcess->getLogText()); | 1871 | ekosLogOut->setPlainText(schedulerProcess->getLogText()); | ||
1872 | else if (currentWidget == observatoryProcess.get()) | ||||
1873 | ekosLogOut->setPlainText(observatoryProcess->getLogText()); | ||||
1871 | 1874 | | |||
1872 | #ifdef Q_OS_OSX | 1875 | #ifdef Q_OS_OSX | ||
1873 | repaint(); //This is a band-aid for a bug in QT 5.10.0 | 1876 | repaint(); //This is a band-aid for a bug in QT 5.10.0 | ||
1874 | #endif | 1877 | #endif | ||
1875 | 1878 | | |||
1876 | } | 1879 | } | ||
1877 | 1880 | | |||
1878 | void Manager::appendLogText(const QString &text) | 1881 | void Manager::appendLogText(const QString &text) | ||
▲ Show 20 Lines • Show All 334 Lines • ▼ Show 20 Line(s) | 2206 | { | |||
2213 | }); | 2216 | }); | ||
2214 | 2217 | | |||
2215 | connect(domeProcess.get(), &Ekos::Dome::azimuthPositionChanged, [&](double pos) | 2218 | connect(domeProcess.get(), &Ekos::Dome::azimuthPositionChanged, [&](double pos) | ||
2216 | { | 2219 | { | ||
2217 | QJsonObject status = { { "az", pos} }; | 2220 | QJsonObject status = { { "az", pos} }; | ||
2218 | ekosLiveClient.get()->message()->updateDomeStatus(status); | 2221 | ekosLiveClient.get()->message()->updateDomeStatus(status); | ||
2219 | }); | 2222 | }); | ||
2220 | 2223 | | |||
2224 | initObservatory(nullptr, domeProcess.get()); | ||||
2221 | emit newModule("Dome"); | 2225 | emit newModule("Dome"); | ||
2222 | 2226 | | |||
2223 | ekosLiveClient->message()->sendDomes(); | 2227 | ekosLiveClient->message()->sendDomes(); | ||
2224 | } | 2228 | } | ||
2225 | 2229 | | |||
2226 | void Manager::initWeather() | 2230 | void Manager::initWeather() | ||
2227 | { | 2231 | { | ||
2228 | if (weatherProcess.get() != nullptr) | 2232 | if (weatherProcess.get() != nullptr) | ||
2229 | return; | 2233 | return; | ||
2230 | 2234 | | |||
2231 | weatherProcess.reset(new Ekos::Weather()); | 2235 | weatherProcess.reset(new Ekos::Weather()); | ||
2236 | initObservatory(weatherProcess.get(), nullptr); | ||||
2232 | 2237 | | |||
2233 | emit newModule("Weather"); | 2238 | emit newModule("Weather"); | ||
2234 | } | 2239 | } | ||
2235 | 2240 | | |||
2241 | void Manager::initObservatory(Weather *weather, Dome *dome) | ||||
2242 | { | ||||
2243 | if (observatoryProcess.get() == nullptr) | ||||
2244 | { | ||||
2245 | // Initialize the Observatory Module | ||||
2246 | observatoryProcess.reset(new Ekos::Observatory()); | ||||
2247 | int index = toolsWidget->addTab(observatoryProcess.get(), QIcon(":/icons/ekos_observatory.png"), ""); | ||||
2248 | toolsWidget->tabBar()->setTabToolTip(index, i18n("Observatory")); | ||||
2249 | connect(observatoryProcess.get(), &Ekos::Observatory::newLog, this, &Ekos::Manager::updateLog); | ||||
2250 | } | ||||
2251 | | ||||
2252 | Observatory *obs = observatoryProcess.get(); | ||||
2253 | if (weather != nullptr) | ||||
2254 | obs->getWeatherModel()->initModel(weather); | ||||
2255 | if (dome != nullptr) | ||||
2256 | obs->getDomeModel()->initModel(dome); | ||||
2257 | | ||||
2258 | emit newModule("Observatory"); | ||||
2259 | | ||||
2260 | } | ||||
2261 | | ||||
2236 | void Manager::initDustCap() | 2262 | void Manager::initDustCap() | ||
2237 | { | 2263 | { | ||
2238 | if (dustCapProcess.get() != nullptr) | 2264 | if (dustCapProcess.get() != nullptr) | ||
2239 | return; | 2265 | return; | ||
2240 | 2266 | | |||
2241 | dustCapProcess.reset(new Ekos::DustCap()); | 2267 | dustCapProcess.reset(new Ekos::DustCap()); | ||
2242 | 2268 | | |||
2243 | connect(dustCapProcess.get(), &Ekos::DustCap::newStatus, [&](ISD::DustCap::Status newStatus) | 2269 | connect(dustCapProcess.get(), &Ekos::DustCap::newStatus, [&](ISD::DustCap::Status newStatus) | ||
Show All 40 Lines | 2305 | { | |||
2284 | 2310 | | |||
2285 | alignProcess.reset(); | 2311 | alignProcess.reset(); | ||
2286 | captureProcess.reset(); | 2312 | captureProcess.reset(); | ||
2287 | focusProcess.reset(); | 2313 | focusProcess.reset(); | ||
2288 | guideProcess.reset(); | 2314 | guideProcess.reset(); | ||
2289 | mountProcess.reset(); | 2315 | mountProcess.reset(); | ||
2290 | domeProcess.reset(); | 2316 | domeProcess.reset(); | ||
2291 | weatherProcess.reset(); | 2317 | weatherProcess.reset(); | ||
2318 | observatoryProcess.reset(); | ||||
2292 | dustCapProcess.reset(); | 2319 | dustCapProcess.reset(); | ||
2293 | 2320 | | |||
2294 | managedDevices.clear(); | 2321 | managedDevices.clear(); | ||
2295 | 2322 | | |||
2296 | connect(toolsWidget, &QTabWidget::currentChanged, this, &Ekos::Manager::processTabChange, Qt::UniqueConnection); | 2323 | connect(toolsWidget, &QTabWidget::currentChanged, this, &Ekos::Manager::processTabChange, Qt::UniqueConnection); | ||
2297 | } | 2324 | } | ||
2298 | 2325 | | |||
2299 | bool Manager::isRunning(const QString &process) | 2326 | bool Manager::isRunning(const QString &process) | ||
▲ Show 20 Lines • Show All 881 Lines • Show Last 20 Lines |