SimpleWeather service : new weather implementation

Fix recovery firmware and code formatting.
This commit is contained in:
Jean-François Milants
2023-12-09 21:05:50 +01:00
committed by JF
parent c94a59e7d3
commit 50c679023f
5 changed files with 93 additions and 62 deletions

View File

@@ -122,7 +122,7 @@ void DisplayApp::PushMessage(Display::Messages msg) {
void DisplayApp::Register(Pinetime::System::SystemTask* /*systemTask*/) {
}
void DisplayApp::Register(Pinetime::Controllers::WeatherService* /*weatherService*/) {
void DisplayApp::Register(Pinetime::Controllers::SimpleWeatherService* /*weatherService*/) {
}
void DisplayApp::Register(Pinetime::Controllers::MusicService* /*musicService*/) {

View File

@@ -34,7 +34,7 @@ namespace Pinetime {
class AlarmController;
class BrightnessController;
class FS;
class WeatherService;
class SimpleWeatherService;
class MusicService;
class NavigationService;
}
@@ -69,7 +69,7 @@ namespace Pinetime {
void PushMessage(Pinetime::Applications::Display::Messages msg);
void Register(Pinetime::System::SystemTask* systemTask);
void Register(Pinetime::Controllers::WeatherService* weatherService);
void Register(Pinetime::Controllers::SimpleWeatherService* weatherService);
void Register(Pinetime::Controllers::MusicService* musicService);
void Register(Pinetime::Controllers::NavigationService* NavigationService);

View File

@@ -45,16 +45,36 @@ namespace {
const char* GetIcon(const Pinetime::Controllers::SimpleWeatherService::Icons icon) {
switch (icon) {
case Pinetime::Controllers::SimpleWeatherService::Icons::Sun: return Symbols::sun; break;
case Pinetime::Controllers::SimpleWeatherService::Icons::CloudsSun: return Symbols::cloudSun; break;
case Pinetime::Controllers::SimpleWeatherService::Icons::Clouds: return Symbols::cloud; break;
case Pinetime::Controllers::SimpleWeatherService::Icons::BrokenClouds: return Symbols::cloud; break; // TODO missing symbol
case Pinetime::Controllers::SimpleWeatherService::Icons::Thunderstorm: return Symbols::cloud; break; // TODO missing symbol
case Pinetime::Controllers::SimpleWeatherService::Icons::Snow: return Symbols::cloud; break; // TODO missing symbol
case Pinetime::Controllers::SimpleWeatherService::Icons::CloudShowerHeavy: return Symbols::cloudShowersHeavy; break;
case Pinetime::Controllers::SimpleWeatherService::Icons::CloudSunRain: return Symbols::cloudSunRain; break;
case Pinetime::Controllers::SimpleWeatherService::Icons::Smog: return Symbols::smog; break;
default: return Symbols::ban; break;
case Pinetime::Controllers::SimpleWeatherService::Icons::Sun:
return Symbols::sun;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::CloudsSun:
return Symbols::cloudSun;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::Clouds:
return Symbols::cloud;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::BrokenClouds:
return Symbols::cloud;
break; // TODO missing symbol
case Pinetime::Controllers::SimpleWeatherService::Icons::Thunderstorm:
return Symbols::cloud;
break; // TODO missing symbol
case Pinetime::Controllers::SimpleWeatherService::Icons::Snow:
return Symbols::cloud;
break; // TODO missing symbol
case Pinetime::Controllers::SimpleWeatherService::Icons::CloudShowerHeavy:
return Symbols::cloudShowersHeavy;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::CloudSunRain:
return Symbols::cloudSunRain;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::Smog:
return Symbols::smog;
break;
default:
return Symbols::ban;
break;
}
}
}