From d8a9c3c4b0b9d5a2790c3155760dec816e1afa31 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 20 Mar 2019 23:51:49 +0100 Subject: [PATCH] lcd4l: write weather_city file Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7e775d0c5fb9f02314a6b93583e4055c47324488 Author: vanhofen Date: 2019-03-20 (Wed, 20 Mar 2019) Origin message was: ------------------ - lcd4l: write weather_city file ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/lcd4l.cpp | 10 +++++++++- src/driver/lcd4l.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/driver/lcd4l.cpp b/src/driver/lcd4l.cpp index b01db9de8..c97a70522 100644 --- a/src/driver/lcd4l.cpp +++ b/src/driver/lcd4l.cpp @@ -104,6 +104,7 @@ extern CPictureViewer *g_PicViewer; #define FCOLOR2 LCD_DATADIR "fcolor2" #define PBCOLOR LCD_DATADIR "pbcolor" +#define WEATHER_CITY LCD_DATADIR "weather_city" #define WEATHER_TEMP LCD_DATADIR "weather_temp" #define WEATHER_ICON LCD_DATADIR "weather_icon" @@ -253,6 +254,7 @@ void CLCD4l::Init() m_Start = "00:00"; m_End = "00:00"; + m_wcity = ""; m_wtemp = ""; m_wicon = ""; @@ -1018,6 +1020,13 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) if (g_settings.weather_enabled && CWeather::getInstance()->checkUpdate(firstRun)) { + std::string wcity = CWeather::getInstance()->getCity(); + if (m_wcity.compare(wcity)) + { + WriteFile(WEATHER_CITY, wcity); + m_wcity = wcity; + } + int forecast = 1; // days for forecast std::string wtemp = CWeather::getInstance()->getActTemp(); @@ -1038,7 +1047,6 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) m_wicon = wicon; } } - } /* ----------------------------------------------------------------- */ diff --git a/src/driver/lcd4l.h b/src/driver/lcd4l.h index 19b404a78..835e07fe9 100644 --- a/src/driver/lcd4l.h +++ b/src/driver/lcd4l.h @@ -126,6 +126,7 @@ class CLCD4l std::string m_fcolor2; std::string m_pbcolor; + std::string m_wcity; std::string m_wtemp; std::string m_wicon; };