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 1423 Lines • ▼ Show 20 Line(s) | 1856 | { | |||
1865 | else if (currentWidget == captureProcess.get()) | 1866 | else if (currentWidget == captureProcess.get()) | ||
1866 | ekosLogOut->setPlainText(captureProcess->getLogText()); | 1867 | ekosLogOut->setPlainText(captureProcess->getLogText()); | ||
1867 | else if (currentWidget == focusProcess.get()) | 1868 | else if (currentWidget == focusProcess.get()) | ||
1868 | ekosLogOut->setPlainText(focusProcess->getLogText()); | 1869 | ekosLogOut->setPlainText(focusProcess->getLogText()); | ||
1869 | else if (currentWidget == guideProcess.get()) | 1870 | else if (currentWidget == guideProcess.get()) | ||
1870 | ekosLogOut->setPlainText(guideProcess->getLogText()); | 1871 | ekosLogOut->setPlainText(guideProcess->getLogText()); | ||
1871 | else if (currentWidget == mountProcess.get()) | 1872 | else if (currentWidget == mountProcess.get()) | ||
1872 | ekosLogOut->setPlainText(mountProcess->getLogText()); | 1873 | ekosLogOut->setPlainText(mountProcess->getLogText()); | ||
1873 | if (currentWidget == schedulerProcess.get()) | 1874 | else if (currentWidget == schedulerProcess.get()) | ||
1874 | ekosLogOut->setPlainText(schedulerProcess->getLogText()); | 1875 | ekosLogOut->setPlainText(schedulerProcess->getLogText()); | ||
1876 | else if (currentWidget == observatoryProcess.get()) | ||||
1877 | ekosLogOut->setPlainText(observatoryProcess->getLogText()); | ||||
1875 | 1878 | | |||
1876 | #ifdef Q_OS_OSX | 1879 | #ifdef Q_OS_OSX | ||
1877 | repaint(); //This is a band-aid for a bug in QT 5.10.0 | 1880 | repaint(); //This is a band-aid for a bug in QT 5.10.0 | ||
1878 | #endif | 1881 | #endif | ||
1879 | 1882 | | |||
1880 | } | 1883 | } | ||
1881 | 1884 | | |||
1882 | void Manager::appendLogText(const QString &text) | 1885 | void Manager::appendLogText(const QString &text) | ||
▲ Show 20 Lines • Show All 334 Lines • ▼ Show 20 Line(s) | 2210 | { | |||
2217 | }); | 2220 | }); | ||
2218 | 2221 | | |||
2219 | connect(domeProcess.get(), &Ekos::Dome::azimuthPositionChanged, [&](double pos) | 2222 | connect(domeProcess.get(), &Ekos::Dome::azimuthPositionChanged, [&](double pos) | ||
2220 | { | 2223 | { | ||
2221 | QJsonObject status = { { "az", pos} }; | 2224 | QJsonObject status = { { "az", pos} }; | ||
2222 | ekosLiveClient.get()->message()->updateDomeStatus(status); | 2225 | ekosLiveClient.get()->message()->updateDomeStatus(status); | ||
2223 | }); | 2226 | }); | ||
2224 | 2227 | | |||
2228 | initObservatory(nullptr, domeProcess.get()); | ||||
2225 | emit newModule("Dome"); | 2229 | emit newModule("Dome"); | ||
2226 | 2230 | | |||
2227 | ekosLiveClient->message()->sendDomes(); | 2231 | ekosLiveClient->message()->sendDomes(); | ||
2228 | } | 2232 | } | ||
2229 | 2233 | | |||
2230 | void Manager::initWeather() | 2234 | void Manager::initWeather() | ||
2231 | { | 2235 | { | ||
2232 | if (weatherProcess.get() != nullptr) | 2236 | if (weatherProcess.get() != nullptr) | ||
2233 | return; | 2237 | return; | ||
2234 | 2238 | | |||
2235 | weatherProcess.reset(new Ekos::Weather()); | 2239 | weatherProcess.reset(new Ekos::Weather()); | ||
2240 | initObservatory(weatherProcess.get(), nullptr); | ||||
2236 | 2241 | | |||
2237 | emit newModule("Weather"); | 2242 | emit newModule("Weather"); | ||
2238 | } | 2243 | } | ||
2239 | 2244 | | |||
2245 | void Manager::initObservatory(Weather *weather, Dome *dome) | ||||
2246 | { | ||||
2247 | if (observatoryProcess.get() == nullptr) | ||||
2248 | { | ||||
2249 | // Initialize the Observatory Module | ||||
2250 | observatoryProcess.reset(new Ekos::Observatory()); | ||||
2251 | int index = toolsWidget->addTab(observatoryProcess.get(), QIcon(":/icons/ekos_observatory.png"), ""); | ||||
2252 | toolsWidget->tabBar()->setTabToolTip(index, i18n("Observatory")); | ||||
2253 | connect(observatoryProcess.get(), &Ekos::Observatory::newLog, this, &Ekos::Manager::updateLog); | ||||
2254 | } | ||||
2255 | | ||||
2256 | Observatory *obs = observatoryProcess.get(); | ||||
2257 | if (weather != nullptr) | ||||
2258 | obs->getWeatherModel()->initModel(weather); | ||||
2259 | if (dome != nullptr) | ||||
2260 | obs->getDomeModel()->initModel(dome); | ||||
2261 | | ||||
2262 | emit newModule("Observatory"); | ||||
2263 | | ||||
2264 | } | ||||
2265 | | ||||
2240 | void Manager::initDustCap() | 2266 | void Manager::initDustCap() | ||
2241 | { | 2267 | { | ||
2242 | if (dustCapProcess.get() != nullptr) | 2268 | if (dustCapProcess.get() != nullptr) | ||
2243 | return; | 2269 | return; | ||
2244 | 2270 | | |||
2245 | dustCapProcess.reset(new Ekos::DustCap()); | 2271 | dustCapProcess.reset(new Ekos::DustCap()); | ||
2246 | 2272 | | |||
2247 | connect(dustCapProcess.get(), &Ekos::DustCap::newStatus, [&](ISD::DustCap::Status newStatus) | 2273 | connect(dustCapProcess.get(), &Ekos::DustCap::newStatus, [&](ISD::DustCap::Status newStatus) | ||
Show All 40 Lines | 2309 | { | |||
2288 | 2314 | | |||
2289 | alignProcess.reset(); | 2315 | alignProcess.reset(); | ||
2290 | captureProcess.reset(); | 2316 | captureProcess.reset(); | ||
2291 | focusProcess.reset(); | 2317 | focusProcess.reset(); | ||
2292 | guideProcess.reset(); | 2318 | guideProcess.reset(); | ||
2293 | mountProcess.reset(); | 2319 | mountProcess.reset(); | ||
2294 | domeProcess.reset(); | 2320 | domeProcess.reset(); | ||
2295 | weatherProcess.reset(); | 2321 | weatherProcess.reset(); | ||
2322 | observatoryProcess.reset(); | ||||
2296 | dustCapProcess.reset(); | 2323 | dustCapProcess.reset(); | ||
2297 | 2324 | | |||
2298 | managedDevices.clear(); | 2325 | managedDevices.clear(); | ||
2299 | 2326 | | |||
2300 | connect(toolsWidget, &QTabWidget::currentChanged, this, &Ekos::Manager::processTabChange, Qt::UniqueConnection); | 2327 | connect(toolsWidget, &QTabWidget::currentChanged, this, &Ekos::Manager::processTabChange, Qt::UniqueConnection); | ||
2301 | } | 2328 | } | ||
2302 | 2329 | | |||
2303 | bool Manager::isRunning(const QString &process) | 2330 | bool Manager::isRunning(const QString &process) | ||
▲ Show 20 Lines • Show All 890 Lines • Show Last 20 Lines |