added weatherforecast template

This commit is contained in:
louis 2015-01-13 12:49:05 +01:00
parent 30b3a8c935
commit e13811af7f
5 changed files with 81 additions and 4 deletions

View File

@ -8,6 +8,8 @@ public:
cServiceCurrentWeather(void) { cServiceCurrentWeather(void) {
timeStamp = ""; timeStamp = "";
temperature = ""; temperature = "";
minTemperature = "";
maxTemperature = "";
apparentTemperature = ""; apparentTemperature = "";
summary = ""; summary = "";
icon = ""; icon = "";
@ -26,6 +28,8 @@ public:
std::string timeStamp; std::string timeStamp;
std::string temperature; std::string temperature;
std::string apparentTemperature; std::string apparentTemperature;
std::string minTemperature;
std::string maxTemperature;
std::string summary; std::string summary;
std::string icon; std::string icon;
std::string precipitationIntensity; std::string precipitationIntensity;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -218,6 +218,8 @@
{timestamp} timestamp of forecast in dd.mm hh:mm {timestamp} timestamp of forecast in dd.mm hh:mm
{temperature} current temperature in °C {temperature} current temperature in °C
{apparenttemperature} apparent (feeled) temperature {apparenttemperature} apparent (feeled) temperature
{mintemperature} minimum temperature this day
{maxtemperature} maximum temperature this day
{summary} short weather summary {summary} short weather summary
{icon} weather icon {icon} weather icon
{precipitationintensity} precipitation intensity in l/m2 {precipitationintensity} precipitation intensity in l/m2
@ -233,11 +235,15 @@
{ozone} ozone value in DU {ozone} ozone value in DU
--> -->
<currentweather> <currentweather>
<area x="70%" y="15%" width="13%" height="13%" layer="1"> <area x="70%" y="15%" width="13%" height="13%" layer="2">
<drawimage imagetype="icon" path="{icon}" align="center" valign="center" width="{areaheight}*0.8" height="{areaheight}*0.8"/> <drawimage imagetype="icon" path="{icon}" align="center" valign="center" width="{areaheight}*0.8" height="{areaheight}*0.8"/>
</area> </area>
<area x="85%" y="15%" width="13%" height="13%" layer="1"> <area x="85%" y="15%" width="13%" height="13%" layer="2">
<drawtext align="center" valign="center" font="{light}" fontsize="90%" color="{clrWhite}" text="{temperature}°C" /> <drawtext x="0" y="0" font="{light}" fontsize="25%" color="{clrWhite}" text="{mintemperature}°C" />
<drawtext x="0" y="75%" font="{light}" fontsize="25%" color="{clrWhite}" text="{maxtemperature}°C" />
</area>
<area x="85%" y="15%" width="13%" height="13%" layer="3">
<drawtext align="right" valign="center" font="{light}" fontsize="60%" color="{clrWhite}" text="{temperature}°C" />
</area> </area>
</currentweather> </currentweather>

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE menuplugin SYSTEM "../../../dtd/displaymenuplugin.dtd">
<menuplugin x="0" y="0" width="100%" height="100%" fadetime="0">
<background>
<area x="0" y="0" width="100%" height="100%" layer="1">
<fill color="{clrTransBlack}" />
</area>
</background>
<header>
<area x="0" y="0" width="1" height="1" layer="1">
<fill color="{clrTransparent}" />
</area>
</header>
<detailheader>
<area x="0" y="0" width="100%" height="20%" layer="2">
<fill color="{clrTransBlueLight}" />
</area>
<area x="0" y="0" width="100%" height="20%" layer="3">
<drawtext x="20" valign="center" font="{light}" fontsize="40%" color="{clrWhite}" text="{menuheader}" />
</area>
<area x="{areawidth} - {areaheight}*0.2" y="0" width="{areaheight}*0.2" height="20%" layer="4">
<drawimage imagetype="icon" path="{icon}" align="center" valign="center" width="90%" height="90%"/>
</area>
<area x="{areawidth} - {areaheight}*0.6" y="0" width="{areaheight}*0.35" height="20%" layer="4">
<drawtext align="right" valign="center" font="{light}" fontsize="90%" color="{clrWhite}" text="{temperature}°C" />
</area>
</detailheader>
<datetime>
<area x="0" y="0" width="1" height="1" layer="1">
<fill color="{clrTransparent}" />
</area>
</datetime>
<colorbuttons>
<area x="0" y="0" width="1" height="1" layer="1">
<fill color="{clrTransparent}" />
</area>
</colorbuttons>
<scrollbar>
<area x="98%" y="20%" width="2%" height="65%" layer="3">
<fill color="{clrWhite}" />
<drawrectangle x="2" y="2" width="{areawidth} - 4" height="{areaheight} - 4" color="{clrTransparent}" />
<drawrectangle x="4" y="4 + {areaheight} * {offset} / 1000" width="{areawidth} - 8" height="{areaheight} * {height} / 1000 - 8" color="{clrWhite}" />
</area>
</scrollbar>
<tab name="current" x="2%" y="20%" width="94%" height="65%" layer="2" scrollheight="{areaheight}/4">
<drawtext x="0" y="0" font="{semibold}" fontsize="10%" color="{clrWhite}" text="Wetterlage: {summary}" />
<drawtext x="0" y="10%" font="{light}" fontsize="10%" color="{clrWhite}" text="Aktuelle Temperatur: {temperature}°C" />
<drawtext x="0" y="20%" font="{light}" fontsize="10%" color="{clrWhite}" text="Gefühlte Temperatur: {apparenttemperature}°C" />
<drawtext x="0" y="30%" font="{light}" fontsize="10%" color="{clrWhite}" text="heutiges Minimum: {mintemperature}°C, heutiges Maximum: {maxtemperature}°C" />
<drawtext x="0" y="40%" font="{light}" fontsize="10%" color="{clrWhite}" text="Niederschlagswahrscheinlichkeit: {precipitationprobability} %" />
<drawtext x="0" y="50%" font="{light}" fontsize="10%" color="{clrWhite}" text="Niederschlagsmenge: {precipitationintensity} l/qm" />
<drawtext x="0" y="60%" font="{light}" fontsize="10%" color="{clrWhite}" text="Luftfeuchtigkeit: {humidity} %" />
<drawtext x="0" y="70%" font="{light}" fontsize="10%" color="{clrWhite}" text="Windgeschwindigkeit: {windspeed} km/h aus {windbearingstring}" />
<drawtext x="0" y="80%" font="{light}" fontsize="10%" color="{clrWhite}" text="Sicht: {visibility} km" />
<drawtext x="0" y="90%" font="{light}" fontsize="10%" color="{clrWhite}" text="Bewölkung: {cloudcover} %" />
<drawtext x="0" y="100%" font="{light}" fontsize="10%" color="{clrWhite}" text="Luftdruck: {pressure} HPa" />
<drawtext x="0" y="110%" font="{light}" fontsize="10%" color="{clrWhite}" text="Ozon: {ozone} DU" />
</tab>
</menuplugin>

View File

@ -435,10 +435,11 @@ void cViewHelpers::SetCurrentWeatherTokens(map < string, string > &stringTokens,
if (!pWeatherForecast->Service("GetCurrentWeather", &currentWeather)) { if (!pWeatherForecast->Service("GetCurrentWeather", &currentWeather)) {
return; return;
} }
esyslog("skindesigner: service call successfull");
stringTokens.insert(pair<string,string>("timestamp", currentWeather.timeStamp)); stringTokens.insert(pair<string,string>("timestamp", currentWeather.timeStamp));
stringTokens.insert(pair<string,string>("temperature", currentWeather.temperature)); stringTokens.insert(pair<string,string>("temperature", currentWeather.temperature));
stringTokens.insert(pair<string,string>("apparenttemperature", currentWeather.apparentTemperature)); stringTokens.insert(pair<string,string>("apparenttemperature", currentWeather.apparentTemperature));
stringTokens.insert(pair<string,string>("mintemperature", currentWeather.minTemperature));
stringTokens.insert(pair<string,string>("maxtemperature", currentWeather.maxTemperature));
stringTokens.insert(pair<string,string>("summary", currentWeather.summary)); stringTokens.insert(pair<string,string>("summary", currentWeather.summary));
stringTokens.insert(pair<string,string>("icon", currentWeather.icon)); stringTokens.insert(pair<string,string>("icon", currentWeather.icon));
stringTokens.insert(pair<string,string>("precipitationintensity", currentWeather.precipitationIntensity)); stringTokens.insert(pair<string,string>("precipitationintensity", currentWeather.precipitationIntensity));