• Welcome to TodayPlus Boards v2.
 

News:

No news is good news.

Main Menu

Weather Question

Started by dmk, October 25, 2005, 08:05:30 AM

Previous topic - Next topic

dmk

In hammerskin US the main page displays today/tomorrow weather icon and forecast;  is there a way to have the main page weather show today and tomorrow, then have the 4 day weather forcast on the  weather page  to begin on "tomorrow".  I am currently downloanding citytxt via radar.exe and getting info from weather, i have the string set to begin 5 day forcast beginning tomorrow.

Example: today is Tuesday; on the main screen I want the forcast to show Tuesday and Wednesday, when go into weather I want the current to remain but the forecast to betin with Wednesday.

Any Ideas.

DeftOne

This will require you to make some changes in the following section of the skin file in Region 3:

//===================================
// WEATHER FORECAST  4 DAY
//===================================

calcvar,var20,weatherupdatetimediff

if,var,var20,,<,240
imagebutton,5,145,wetter_button_detail.png,t,7,4,0,3
button,5,145,95,13,-1,6,var1=1
forecasticon,1,5,162,,t
color,font,0_0_0
forecast,date_dddd,1,7,145,,,l
forecast,date_MM/dd,1,98,145,,,r
color,font,-1_4_-1
text,40,160,High:,l
text,40,170,Low:,l
text,40,180,Prec:,l
color,font,195_0_0
forecast,high,1,100,160,, °F,r
color,font,0_0_195
forecast,low,1,100,170,, °F,r
color,font,-1_4_-1
forecast,precipitation,1,100,180,, %,r

imagebutton,110,145,wetter_button_detail.png,t,7,4,0,3
button,110,145,95,13,-1,6,var1=2
forecasticon,2,110,162,,t
color,font,0_0_0
forecast,date_dddd,2,112,145,,,l
forecast,date_MM/dd,2,204,145,,,r
color,font,-1_4_-1
text,145,160,High:,l
text,145,170,Low:,l
text,145,180,Prec:,l
color,font,195_0_0
forecast,high,2,205,160,, °F,r
color,font,0_0_195
forecast,low,2,205,170,, °F,r
color,font,-1_4_-1
forecast,precipitation,2,205,180,, %,r

imagebutton,5,198,wetter_button_detail.png,t,7,4,0,3
button,5,198,95,13,-1,6,var1=3
forecasticon,3,5,215,,t
color,font,0_0_0
forecast,date_dddd,3,7,198,,,l
forecast,date_MM/dd,3,98,198,,,r
color,font,-1_4_-1
text,40,213,High:,l
text,40,223,Low:,l
text,40,233,Prec:,l
color,font,195_0_0
forecast,high,3,100,213,, °F,r
color,font,0_0_195
forecast,low,3,100,223,, °F,r
color,font,-1_4_-1
forecast,precipitation,3,100,233,, %,r

imagebutton,110,198,wetter_button_detail.png,t,7,4,0,3
button,110,198,95,13,-1,6,var1=4
forecasticon,4,110,215,,t
color,font,0_0_0
forecast,date_dddd,4,112,198,,,l
forecast,date_MM/dd,4,204,198,,,r
color,font,-1_4_-1
text,145,213,High:,l
text,145,223,Low:,l
text,145,233,Prec:,l
color,font,195_0_0
forecast,high,4,205,213,, °F,r
color,font,0_0_195
forecast,low,4,205,223,, °F,r
color,font,-1_4_-1
forecast,precipitation,4,205,233,, %,r


The command of interest in this section is the forecast command, which has the following syntax:

forecast,<variable>,<day number>,<x>,<y>,<prepend>,<append>,<justification>

For every forecast command you see in this section, add one to the day number.

You may also need to do some tweaking in the if/else sections immediately following that look like this:

else
calcvar,var21,firstvalidforecastday

if,var,var21,,<,6
imagebutton,5,145,wetter_button_detail.png,t,7,4,0,3
button,5,145,95,13,-1,6,var1=%var21%
forecasticon,%var21%,5,162,,t
color,font,0_0_0
forecast,date_dddd,%var21%,7,145,,,l
forecast,date_MM/dd,%var21%,98,145,,,r
color,font,-1_4_-1
text,40,160,High:,l
text,40,170,Low:,l
text,40,180,Prec:,l
color,font,195_0_0
forecast,high,%var21%,100,160,, °F,r
color,font,0_0_195
forecast,low,%var21%,100,170,, °F,r
color,font,-1_4_-1
forecast,precipitation,%var21%,100,180,, %,r

addvar,var21,1
else
image,5,162,none.png,t
imagebutton,5,145,wetter_button_detail.png,t,7,4,0,3
button,5,145,95,13,-1,6,var1=%var21%
color,font,0_0_0
text,7,145,     No Forecast,l
color,font,-1_4_-1
text,40,160,High:,l
text,40,170,Low:,l
text,40,180,Prec:,l
endif


if,var,var21,,<,6
imagebutton,110,145,wetter_button_detail.png,t,7,4,0,3
button,110,145,95,13,-1,6,var1=%var21%
forecasticon,%var21%,110,162,,t
color,font,0_0_0
forecast,date_dddd,%var21%,112,145,,,l
forecast,date_MM/dd,%var21%,204,145,,,r
color,font,-1_4_-1
text,145,160,High:,l
text,145,170,Low:,l
text,145,180,Prec:,l
color,font,195_0_0
forecast,high,%var21%,205,160,, °F,r
color,font,0_0_195
forecast,low,%var21%,205,170,, °F,r
color,font,-1_4_-1
forecast,precipitation,%var21%,205,180,, %,r

addvar,var21,1
else
image,110,162,none.png,t
imagebutton,110,145,wetter_button_detail.png,t,7,4,0,3
button,110,145,95,13,-1,6,var1=%var21%
color,font,0_0_0
text,112,145,    No Forecast,l
color,font,-1_4_-1
text,145,160,High:,l
text,145,170,Low:,l
text,145,180,Prec:,l
endif


if,var,var21,,<,6
imagebutton,5,198,wetter_button_detail.png,t,7,4,0,3
button,5,198,95,13,-1,6,var1=%var21%
forecasticon,%var21%,5,215,,t
color,font,0_0_0
forecast,date_dddd,%var21%,7,198,,,l
forecast,date_MM/dd,%var21%,98,198,,,r
color,font,-1_4_-1
text,40,213,High:,l
text,40,223,Low:,l
text,40,233,Prec:,l
color,font,195_0_0
forecast,high,%var21%,100,213,, °F,r
color,font,0_0_195
forecast,low,%var21%,100,223,, °F,r
color,font,-1_4_-1
forecast,precipitation,%var21%,100,233,, %,r

addvar,var21,1
else
image,5,215,none.png,t
imagebutton,5,198,wetter_button_detail.png,t,7,4,0,3
button,5,198,95,13,-1,6,var1=%var21%
color,font,0_0_0
text,7,198,    No Forecast,l
color,font,-1_4_-1
text,40,213,High:,l
text,40,223,Low:,l
text,40,233,Prec:,l
endif


if,var,var21,,<,6
imagebutton,110,198,wetter_button_detail.png,t,7,4,0,3
button,110,198,95,13,-1,6,var1=%var21%
forecasticon,%var21%,110,215,,t
color,font,0_0_0
forecast,date_dddd,%var21%,112,198,,,l
forecast,date_MM/dd,%var21%,204,198,,,r
color,font,-1_4_-1
text,145,213,High:,l
text,145,223,Low:,l
text,145,233,Prec:,l
color,font,195_0_0
forecast,high,%var21%,205,213,, °F,r
color,font,0_0_195
forecast,low,%var21%,205,223,, °F,r
color,font,-1_4_-1
forecast,precipitation,%var21%,205,233,, %,r

addvar,var21,1
else
image,110,215,none.png,t
imagebutton,110,198,wetter_button_detail.png,t,7,4,0,3
button,110,198,95,13,-1,6,var1=%var21%
color,font,0_0_0
text,112,198,    No Forecast,l
color,font,-1_4_-1
text,145,213,High:,l
text,145,223,Low:,l
text,145,233,Prec:,l
endif
endif


I haven't really looked at it too closely, nor have I tried these changes to see if there needs to be any modification to this section.  You can try and see for yourself.  This should get you started anyway.

Hope this helps.

dgmele

Adding a number to the day works for the general weather display, but the popup weather details display shows the previous day details. Any suggestions for correcting this?

DeftOne

Try also adding 1 to var1 in each of the button codes in that same region (Region 3 - the first section I referenced earlier).

button,5,145,95,13,-1,6,var1=1

etc.

var1 is used in the code for populating the popup window with the weather details.

dgmele

Added a 1 to each "button" entry as per your suggestion. The popup window for all days now reads the current day details. Another suggestion?

DeftOne

I actually took the time to try out my suggestions, and it seems to be working perfectly for me - including the details popup window.

You didn't make all the var1 variables equal to 1, did you?  This would cause all the weather detail popup windows to show the current day, and is not what I meant.  What I meant was to add one to the number that was already in the code - just like you did with the forecast command day number.  

I also noticed one more thing...don't forget to add one to the day number of the forecasticon commands as well, otherwise the icons won't match the forecast.

forecasticon,<day number>,<x>,<y>,,<image options>

dgmele

All was done as you had indicated, except for the "if" sections, which have %var21%. Perhaps there is something I have overlooked. I'll check again. Could you post the code with the changes you made?

DeftOne

Here you go.  All modifications made were in this section only.  None were made to the portion of the code using the %var21% immediately after this section.


//===================================
// WEATHER FORECAST  4 DAY
//===================================

calcvar,var20,weatherupdatetimediff

if,var,var20,,<,240
imagebutton,5,145,wetter_button_detail.png,t,7,4,0,3
button,5,145,95,13,-1,6,var1=2
forecasticon,2,5,162,,t
color,font,0_0_0
forecast,date_dddd,2,7,145,,,l
forecast,date_MM/dd,2,98,145,,,r
color,font,-1_4_-1
text,40,160,High:,l
text,40,170,Low:,l
text,40,180,Prec:,l
color,font,195_0_0
forecast,high,2,100,160,, °F,r
color,font,0_0_195
forecast,low,2,100,170,, °F,r
color,font,-1_4_-1
forecast,precipitation,2,100,180,, %,r

imagebutton,110,145,wetter_button_detail.png,t,7,4,0,3
button,110,145,95,13,-1,6,var1=3
forecasticon,3,110,162,,t
color,font,0_0_0
forecast,date_dddd,3,112,145,,,l
forecast,date_MM/dd,3,204,145,,,r
color,font,-1_4_-1
text,145,160,High:,l
text,145,170,Low:,l
text,145,180,Prec:,l
color,font,195_0_0
forecast,high,3,205,160,, °F,r
color,font,0_0_195
forecast,low,3,205,170,, °F,r
color,font,-1_4_-1
forecast,precipitation,3,205,180,, %,r

imagebutton,5,198,wetter_button_detail.png,t,7,4,0,3
button,5,198,95,13,-1,6,var1=4
forecasticon,4,5,215,,t
color,font,0_0_0
forecast,date_dddd,4,7,198,,,l
forecast,date_MM/dd,4,98,198,,,r
color,font,-1_4_-1
text,40,213,High:,l
text,40,223,Low:,l
text,40,233,Prec:,l
color,font,195_0_0
forecast,high,4,100,213,, °F,r
color,font,0_0_195
forecast,low,4,100,223,, °F,r
color,font,-1_4_-1
forecast,precipitation,4,100,233,, %,r

imagebutton,110,198,wetter_button_detail.png,t,7,4,0,3
button,110,198,95,13,-1,6,var1=5
forecasticon,5,110,215,,t
color,font,0_0_0
forecast,date_dddd,5,112,198,,,l
forecast,date_MM/dd,5,204,198,,,r
color,font,-1_4_-1
text,145,213,High:,l
text,145,223,Low:,l
text,145,233,Prec:,l
color,font,195_0_0
forecast,high,5,205,213,, °F,r
color,font,0_0_195
forecast,low,5,205,223,, °F,r
color,font,-1_4_-1
forecast,precipitation,5,205,233,, %,r
else


Again, all I did was increase the day number by one for every forecast and forecasticon command and increase var1 by one for each button command.  Seems to be working just fine for me...

dgmele


dmk

I tried this by copying your code directly into my hammerskin, works however weather icons don't show up.  When I return to the orginial they do.

DeftOne

@dgmele,

I see that you've edited your post...did you get it to work correctly???  If so, what was the problem?


@dmk,

I'm not sure what would be causing that problem...I'll have to think about that one.

dgmele

I did not get it to work. The days were correct in the popup, but the weather details were the same as the first day for all the days. But thanks again for your efforts.

DeftOne

I'm sorry I couldn't be of more help.  It's really frustrating since I've gotten it to work properly on my own PPC.  For the life of me, I just don't see what's keeping it from working on yours.   :?

dgmele

The problem is probably a result of some alteration that I made in the skin for some other purpose. It's a moot point now because I have changed skins, but I agree that it is frustrating not to get things to work properly (just part of the fun playing with TodayPlus). Thanks again.