Changeset View
Changeset View
Standalone View
Standalone View
kstars/indi/indiweather.cpp
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | |||||
91 | { | 91 | { | ||
92 | INumberVectorProperty *updateNP = baseDevice->getNumber("WEATHER_UPDATE"); | 92 | INumberVectorProperty *updateNP = baseDevice->getNumber("WEATHER_UPDATE"); | ||
93 | 93 | | |||
94 | if (updateNP == nullptr) | 94 | if (updateNP == nullptr) | ||
95 | return 0; | 95 | return 0; | ||
96 | 96 | | |||
97 | return static_cast<quint16>(updateNP->np[0].value); | 97 | return static_cast<quint16>(updateNP->np[0].value); | ||
98 | } | 98 | } | ||
99 | | ||||
100 | bool Weather::refresh() | ||||
101 | { | ||||
102 | ISwitchVectorProperty *refreshSP = baseDevice->getSwitch("WEATHER_REFRESH"); | ||||
103 | | ||||
104 | if (refreshSP == nullptr) | ||||
105 | return false; | ||||
106 | | ||||
107 | ISwitch *refreshSW = IUFindSwitch(refreshSP, "REFRESH"); | ||||
108 | | ||||
109 | if (refreshSW == nullptr) | ||||
110 | return false; | ||||
111 | | ||||
112 | IUResetSwitch(refreshSP); | ||||
113 | refreshSW->s = ISS_ON; | ||||
114 | clientManager->sendNewSwitch(refreshSP); | ||||
115 | | ||||
116 | return true; | ||||
117 | | ||||
118 | } | ||||
99 | } | 119 | } | ||
100 | 120 | | |||
101 | #ifndef KSTARS_LITE | 121 | #ifndef KSTARS_LITE | ||
102 | QDBusArgument &operator<<(QDBusArgument &argument, const ISD::Weather::Status &source) | 122 | QDBusArgument &operator<<(QDBusArgument &argument, const ISD::Weather::Status &source) | ||
103 | { | 123 | { | ||
104 | argument.beginStructure(); | 124 | argument.beginStructure(); | ||
105 | argument << static_cast<int>(source); | 125 | argument << static_cast<int>(source); | ||
106 | argument.endStructure(); | 126 | argument.endStructure(); | ||
Show All 13 Lines |