• Welcome to TodayPlus Boards v2.
 

Changing Fº to Cº

Started by marcelof, December 03, 2003, 03:24:52 PM

Previous topic - Next topic

jhollin1138

Eddy,

load,city,%var0%
should work fine.  I think all you need is an
initvar,var0,1
somewhere before the load statement.

I am interested in seeing your skin and how you solve your problem with displaying 3 cities and mix of SI and English units.
Jim H

srs

you probably don't need to duplicate the entire section, but should probably just group the temperature and barometer values together and just include those in the if statement.


if,var,var0,,=1
    today,realtemp,140,24,,°F,r
    today,temp,140,12,,°F,r
    today,barometer,140,36,, in,r
else
    today,realtemp,140,24,,°C,r
    today,temp,140,12,,°C,r
    today,barometer,140,36,, mBar,r
endif


you can extend it to more than two cities like so:


if,var,var0,,=1
    today,realtemp,140,24,,°F,r
    today,temp,140,12,,°F,r
    today,barometer,140,36,, in,r
else
    if,var,var0,,=2
         today,realtemp,140,24,,°F,r
         today,temp,140,12,,°F,r
         today,barometer,140,36,, in,r
    else
         today,realtemp,140,24,,°C,r
         today,temp,140,12,,°C,r
         today,barometer,140,36,, mBar,r
    endif
endif


in this case 1 and 2 will be in English units while the rest will be in metric...

a better method that doesn't depend on the skin knowing which city is metric / english is doing something like this

in the config file


text,city1temp,°C
text,city1bar,mBar

text,city2temp,°F
text,city2bar,in


and in the skin:


today,realtemp,130,24,,,r
text,140,24,%city%var0%temp%,r
today,temp,130,12,,,r
text,140,12,%city%var0%temp%,r
today,barometer,140,36,,,r
text,140,36,%city%var0%bar%,r

Eddy

jhollin1138,

QuoteI am interested in seeing your skin and how you solve your problem with displaying 3 cities and mix of SI and English units.
I will take that as a compliment for a TD+ newbie like me. :D

I am using calendar skin currently, the only change I made is Region 3, page 100, and page 200. here is the code section that I touched.
//=================================================
// REGION 3 - PAGE 100
// Current Weather Details
//=================================================
region,3,100,-1
if,var,var0,1,><,1
imagebutton,226,2,back.png,t,3,3,,1
changefont,tahoma,11,b
text,23,0,[name],c
todayicon,8,11,,t
offsetadd,0,1
today,sky,145,0,,,c
today,realtemp,140,24,,°F,r
changefont,tahoma,11,
text,51,12,Temperature:,l
today,temp,140,12,,°F,r
text,51,24,Feels Like:,l
text,51,36,Barometer:,l
today,barometer,140,36,, in,r
changefont,tahoma,11,b
today,humidity,235,12,,%,r
changefont,tahoma,11,
text,150,12,Humidity:,l
text,150,24,UV:,l
today,uv,235,24,,,r
today,date,235,36,,,r
else
imagebutton,226,2,back.png,t,3,3,,1
changefont,tahoma,11,b
text,23,0,[name],c
todayicon,8,11,,t
offsetadd,0,1
today,sky,145,0,,,c
today,realtemp,140,24,,°C,r
changefont,tahoma,11,
text,51,12,Temperature:,l
today,temp,140,12,,°C,r
text,51,24,Feels Like:,l
text,51,36,Barometer:,l
today,barometer,140,36,, mm,r
changefont,tahoma,11,b
today,humidity,235,12,,%,r
changefont,tahoma,11,
text,150,12,Humidity:,l
text,150,24,UV:,l
today,uv,235,24,,,r
today,date,235,36,,,r
endif
offsetadd,0,53
endregion,3,100
//=================================================
// REGION 3 - PAGE 200
// Vars used: 1
//=================================================
region,3,200,-1
if,var,var0,1,><,1
imagebutton,226,2,back.png,t,3,3,,1
changefont,tahoma,11,b
forecast,date_ddd,%var1%,24,0,,,c
changefont,tahoma,11,
forecasticon,%var1%,8,11,,t
offsetadd,0,7
changefont,tahoma,11,b
forecast,text,%var1%,140,0,,,c
forecast,high,%var1%,125,12,,°F,r
forecast,low,%var1%,195,12,,°F,r
forecast,precipitation,%var1%,205,24,,%,r
changefont,tahoma,11,
text,75,12,High:,l
text,145,12,Low:,l
text,60,24,Chance of Precipitation:,l
else
imagebutton,226,2,back.png,t,3,3,,1
changefont,tahoma,11,b
forecast,date_ddd,%var1%,24,0,,,c
changefont,tahoma,11,
forecasticon,%var1%,8,11,,t
offsetadd,0,7
changefont,tahoma,11,b
forecast,text,%var1%,140,0,,,c
forecast,high,%var1%,125,12,,°C,r
forecast,low,%var1%,195,12,,°C,r
forecast,precipitation,%var1%,205,24,,%,r
changefont,tahoma,11,
text,75,12,High:,l
text,145,12,Low:,l
text,60,24,Chance of Precipitation:,l
endif
offsetadd,0,47
endregion,3,200

color,font,-1_4_-1

endregion,1,0

I have 3 cities in my list, the first city is using Farenheit and the rest are using Celsius, as long as I remember to group the cities together so that all Farenheit displayed first, and change the "if,var,var0,low,><,high" value accordingly, I would be fine.

I liked srs' 2nd approach better, I don't have to change skin file that way, just play with config file and the statement is cleaner. that would be my next revision. :P

thanks! ~Eddy

argh2000

Hi Guys,

being a newbie abd dum guy at todayplus.Can I ask a stupid question?

wat does region is for ?Is it something got to do with the weather region we retriving data from? If I'm from Asia.What is the region?

thanks :oops:

Eddy

argh2000,

I believe the region is the area on your screen, you can define different section on the PDA screen as different regions.

to retrieve weather or time data for your local area, you need to modify the city code in the "city" statement, and time zone code in the "time" statement.

thanks!

~Eddy

filmlessphotos

Do I need to change the calendarplus.txt file from °F to °C to display Celsius as well as the slider.txt file? (which I did)

I currently have Fahrenheit temperature but with a °C.

I was also wondering how often does it check the weather on the internet for updates when it's hocked up to the cradle?

Thanks

John

arbitrajeu

Quote from: filmlessphotosDo I need to change the calendarplus.txt file from °F to °C to display Celsius as well as the slider.txt file? (which I did)

I currently have Fahrenheit temperature but with a °C.
You only need to change the file which is your active skin - you can find this out by looking at the skin, command in your config.txt file.  For example, if you have this:

skin,Skins\slider.txt
Then you only need to change slider.txt.

Quote from: filmlessphotosI was also wondering how often does it check the weather on the internet for updates when it's hocked up to the cradle?
If you have TodayPlus set up to synch continuously in the cradle it will refresh every hour, or whatever is configured in your config.txt file.  For example:

rss,3,60,http://slashdot.org/slashdot.rss,Slashdot,0
The second parameter tells TodayPlus to synch only if the current data is more than 60 minutes old.

If you don't have it set to synch continuously you can either press the refresh button on your skin (or whatever other trigger the skinner uses) or it will refresh after the next synch which occurs, after the 60 minutes is up.
[size=14]arbitrajeu[/size]
[size=12]todayplus moderator[/size]
[size=10]
iPAQ 3970, Windows Mobile 2003, 256MB SD, AgendaFusion 5[/size]