Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/observatory/observatoryweathermodel.cpp
- This file was added.
1 | /* Ekos Observatory Module | ||||
---|---|---|---|---|---|
2 | Copyright (C) Wolfgang Reissenberger <sterne-jaeger@t-online.de> | ||||
3 | | ||||
4 | This application is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU General Public | ||||
6 | License as published by the Free Software Foundation; either | ||||
7 | version 2 of the License, or (at your option) any later version. | ||||
8 | */ | ||||
9 | | ||||
10 | #include "observatoryweathermodel.h" | ||||
11 | | ||||
12 | namespace Ekos | ||||
13 | { | ||||
14 | | ||||
15 | void ObservatoryWeatherModel::initModel(Weather *weather) | ||||
16 | { | ||||
17 | mWeather = weather; | ||||
18 | | ||||
19 | connect(mWeather, &Weather::ready, this, &ObservatoryWeatherModel::ready); | ||||
20 | connect(mWeather, &Weather::newStatus, this, &ObservatoryWeatherModel::newStatus); | ||||
21 | | ||||
22 | if (mWeather->status() != ISD::Weather::WEATHER_IDLE) | ||||
23 | emit ready(); | ||||
24 | } | ||||
25 | | ||||
26 | ISD::Weather::Status ObservatoryWeatherModel::status() | ||||
27 | { | ||||
28 | if (mWeather == nullptr) | ||||
29 | return ISD::Weather::WEATHER_IDLE; | ||||
30 | | ||||
31 | return mWeather->status(); | ||||
32 | } | ||||
33 | | ||||
34 | } // Ekos |