The MP3car.com Store  

Welcome to the MP3Car.com forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Registering will also remove advertisements. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development > Front Ends > Road Runner

Reply
 
Thread Tools Display Modes
Old 05-09-2008, 11:19 PM   #1
FLAC
monkeyracer's CarPC Specs
 
monkeyracer's Avatar
 
Join Date: May 2007
Location: Lakehood, CO
Vehicle: 2007 PT Cruiser Touring
Posts: 981
My Photos: (63)
Slider for temperature from weather?

I'm trying to make a slider for the current temperature based on the code "w_tmp" in the skincommands.txt.

I've got it almost all the way working:

Code:
SETVARBYCODE;TEMPSLIDER;w_tmp||EVAL;TEMP;$TEMPSLIDER$*546

This is designed so that if the temp is 120, the slider would be at or close to 100%

Problem is the "w_tmp" label returns with the degrees symbol, and it doesn't calculate the slider's position because the label isn't strictly a number. (Can't calculate, so it always returns the position as 0, same as if you tried to divide 120 by orange, the answer is zero because the syntax is wrong.)

Is there a way to get just the numeric value from the "w_tmp" label so that this can be done?
__________________
2007 Chrysler PT Cruiser TE
Car PC Progress:
Planning.......[--------X--] 80%
Parts...........[------X----] 60%
Fabrication...[-----X-----] 50%
RR Skin........[---------X-] 95%
View my Worklog
Road Runner Skins
Website
Favorite thread EVER!
monkeyracer is offline   Reply With Quote
Sponsored Links
Old 05-10-2008, 01:01 AM   #2
Road Runner Moderator
JohnWPB's CarPC Specs
 
JohnWPB's Avatar
 
Join Date: Sep 2005
Location: West Palm Beach, Florida
Vehicle: 99 Mitsubishi Eclipse
Posts: 2,619
My Photos: (0)
Not sure if this will work, but in the RR.ini:
weatherdegress=º

Maybe changing that to have nothing, could possibly work.
__________________
.



CarPuter: 2.8Ghz P4 with 1 Gig Mem, 500 Gig HD, Iguidance 4.0, 7" Motorized Touchscreen, XM PCR1000, Visteon HDZ300 HD Radio, WIFI, Fusion Brain.
Powered By Road Runner & the DigitalFX 3.0 Skin
http://www.johnwpb.com
JohnWPB is offline   Reply With Quote
Old 05-10-2008, 08:06 AM   #3
FLAC
monkeyracer's CarPC Specs
 
monkeyracer's Avatar
 
Join Date: May 2007
Location: Lakehood, CO
Vehicle: 2007 PT Cruiser Touring
Posts: 981
My Photos: (63)
Doesn't seem like that works.

I had a label display the calculations, it always comes up as 0.

I had it display the $TEMPSLIDER$ variable, and it shows the temperature in this format:

##_º_F

So I basically need to find a way to delete the "space degrees symbol space F" from the tag...
__________________
2007 Chrysler PT Cruiser TE
Car PC Progress:
Planning.......[--------X--] 80%
Parts...........[------X----] 60%
Fabrication...[-----X-----] 50%
RR Skin........[---------X-] 95%
View my Worklog
Road Runner Skins
Website
Favorite thread EVER!

Last edited by monkeyracer : 05-10-2008 at 08:16 AM.
monkeyracer is offline   Reply With Quote
Old 05-10-2008, 09:36 AM   #4
MGD
FLAC
MGD's CarPC Specs
 
MGD's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Vehicle: 2005 Chrysler 300
Posts: 1,221
My Photos: (0)
you need to do this in Autoit and trim the sting of the degree symbol and then set a variable in RR and use that.
MGD is offline   Reply With Quote
Old 05-10-2008, 10:00 AM   #5
FLAC
monkeyracer's CarPC Specs
 
monkeyracer's Avatar
 
Join Date: May 2007
Location: Lakehood, CO
Vehicle: 2007 PT Cruiser Touring
Posts: 981
My Photos: (63)
Not familiar with autoit yet, but...

I guess I'll D/L and


off to learn...
__________________
2007 Chrysler PT Cruiser TE
Car PC Progress:
Planning.......[--------X--] 80%
Parts...........[------X----] 60%
Fabrication...[-----X-----] 50%
RR Skin........[---------X-] 95%
View my Worklog
Road Runner Skins
Website
Favorite thread EVER!
monkeyracer is offline   Reply With Quote
Old 05-10-2008, 10:14 AM   #6
MGD
FLAC
MGD's CarPC Specs
 
MGD's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Vehicle: 2005 Chrysler 300
Posts: 1,221
My Photos: (0)
Something like this should do it.

Code:
$rr = ObjCreate("RoadRunner.sdk") $var = $rr.getinfo("w_tmp") $var = StringTrimLeft($var, 3) $var = StringStripWS($var, 8) ;MsgBox(4096, "Result", $var) $rr.execute("SETVAR;MYTEMP; &$var")

Then you should have MYTEMP showing only 75 instead of 75*F
MGD is offline   Reply With Quote
Old 05-10-2008, 10:38 AM   #7
MGD
FLAC
MGD's CarPC Specs
 
MGD's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Vehicle: 2005 Chrysler 300
Posts: 1,221
My Photos: (0)
Ok, here is ascript what does exactly this. You can run it when ever you update the weather info. The VARIABLE is called "MYTEMP" and if you want to set a label then use
as label code "=$MYTEMP$"
Tested and working.
Just rename the file to WeatherTemp.exe
Attached Files
File Type: txt weatherTemp.txt (250.0 KB, 21 views)
MGD is offline   Reply With Quote
Old 05-10-2008, 10:57 AM   #8
FLAC
monkeyracer's CarPC Specs
 
monkeyracer's Avatar
 
Join Date: May 2007
Location: Lakehood, CO
Vehicle: 2007 PT Cruiser Touring
Posts: 981
My Photos: (63)
since i'm still new with autoit...

So, I would compile this into a script saved as an .exe and have the above code amended to look like this right?:

Code:
Run;$skinpath$myscript.exe||SETVARBYCODE;TEMPSLIDER;MYTEMP||EVAL;TEMP;$TEMPSLIDER$*546

Or just have myscript.exe load "ONSKINSTART" (So that it doesn't try to load it again when I go back and click the above button again...)

Edit:

Didn't see you posted the script. I'll try this when I get to my home computer.

Thanks
__________________
2007 Chrysler PT Cruiser TE
Car PC Progress:
Planning.......[--------X--] 80%
Parts...........[------X----] 60%
Fabrication...[-----X-----] 50%
RR Skin........[---------X-] 95%
View my Worklog
Road Runner Skins
Website
Favorite thread EVER!
monkeyracer is offline   Reply With Quote
Old 05-10-2008, 11:05 AM   #9
MGD
FLAC
MGD's CarPC Specs
 
MGD's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Vehicle: 2005 Chrysler 300
Posts: 1,221
My Photos: (0)
Just Rename it to weatherTemp.exe and put it in your scripts folder.
On you menu.skin where you call the weather.skin, run this script.
Code:
"LOAD;Weather.skin||RUN;$SKINPATH$myscripts\weatherTemp.exe||SETVARBYCODE;TEMPSLIDER;$MYTEMP$||EVAL;TEMP;$TEMPSLIDER$*546"

The script only returns the number, like 78 or 52 in the VARIABLE

Last edited by MGD : 05-10-2008 at 11:08 AM.
MGD is offline   Reply With Quote
Old 05-10-2008, 12:23 PM   #10
FLAC
monkeyracer's CarPC Specs
 
monkeyracer's Avatar
 
Join Date: May 2007
Location: Lakehood, CO
Vehicle: 2007 PT Cruiser Touring
Posts: 981
My Photos: (63)
Exactly what I was looking for, now it's a matter of time to wait for the official release of the RR update, so that weather AND solid slider styles work at the same time.
__________________
2007 Chrysler PT Cruiser TE
Car PC Progress:
Planning.......[--------X--] 80%
Parts...........[------X----] 60%
Fabrication...[-----X-----] 50%
RR Skin........[---------X-] 95%
View my Worklog
Road Runner Skins
Website
Favorite thread EVER!
monkeyracer is offline   Reply With Quote
Sponsored Links
Old 05-10-2008, 08:11 PM   #11
FLAC
monkeyracer's CarPC Specs
 
monkeyracer's Avatar
 
Join Date: May 2007
Location: Lakehood, CO
Vehicle: 2007 PT Cruiser Touring
Posts: 981
My Photos: (63)
That truncated the tag down to remove the extra stuff, but it kept the values as text rather than numbers, so EVAL doesn't do anything.

(I tried "EVAL;TESTTEMP;$MYTEMP$+5" and a label with "=$TESTTEMP$" and it just showed 5 in the label, rather than the temp plus 5.)

Is there a way to have the autoit script then convert the value into a number rather than text?
__________________
2007 Chrysler PT Cruiser TE
Car PC Progress:
Planning.......[--------X--] 80%
Parts...........[------X----] 60%
Fabrication...[-----X-----] 50%
RR Skin........[---------X-] 95%
View my Worklog
Road Runner Skins
Website
Favorite thread EVER!
monkeyracer is offline   Reply With Quote
Old 05-10-2008, 09:20 PM   #12
Raw Wave
Blue ZX3's CarPC Specs
 
Blue ZX3's Avatar
 
Join Date: Aug 2004
Location: Chicago area,IL
Vehicle: 01 Ford ZX3
Posts: 1,973
My Photos: (12)
The reason that happened was because you need to call the weather screen first before running that script as that label equals nothing until you go to the weathe scn to make RR populate the label with the info from the weather it found.
Blue ZX3 is offline   Reply With Quote
Old 05-10-2008, 10:44 PM   #13
MGD
FLAC
MGD's CarPC Specs
 
MGD's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Vehicle: 2005 Chrysler 300
Posts: 1,221
My Photos: (0)
Quote: Originally Posted by Blue ZX3 View Post
The reason that happened was because you need to call the weather screen first before running that script as that label equals nothing until you go to the weathe scn to make RR populate the label with the info from the weather it found.


You so smucking fart
MGD is offline   Reply With Quote
Old 05-10-2008, 11:01 PM   #14
FLAC
monkeyracer's CarPC Specs
 
monkeyracer's Avatar
 
Join Date: May 2007
Location: Lakehood, CO
Vehicle: 2007 PT Cruiser Touring
Posts: 981
My Photos: (63)
OK, I rearranged the code to look like this:

Code:
"WEATHER||wait;5||RUN;$skinpath$weatherTemp.exe||SETVAR;TEMPSLIDER;$MYTEMP$||EVAL;TEMP;$TEMPSLIDER$*546" .

And it works, but I have to load the weather skin, then go back to main, and load it again for it to calculate.

I basically have to run the code above, wait a few seconds, then load it again. I set a timer event so that every 5 seconds it evals the variables and set's the slider, because the first time it loads, it shows 0, then the second time it shows the correct amount.
I think this is because it takes a couple seconds to download the info from the .xml feed and it has to start from the WEATHER.skin (rather than having the skin pre-loaded) so the first time it tries, the label isn't set yet. (I've tried the wait; at 10 seconds though, and that didn't seem to affect it.)

We're getting closer to getting this working nicely though.

In skincommands.txt:

Quote: Originally Posted by skincommands.txt
This event is re-occurring, so every few XXX seconds it will re-execute the TIMER event.
You can use a simple variable switch to prevent it from executing your command more than once (if desired).

What variable switch would I use? Is there a way to execute the command only until the evaluated result is above 0?
__________________
2007 Chrysler PT Cruiser TE
Car PC Progress:
Planning.......[--------X--] 80%
Parts...........[------X----] 60%
Fabrication...[-----X-----] 50%
RR Skin........[---------X-] 95%
View my Worklog
Road Runner Skins
Website
Favorite thread EVER!

Last edited by monkeyracer : 05-10-2008 at 11:06 PM.
monkeyracer is offline   Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Retreiving Custom SLider value help needed JohnWPB Road Runner 6 02-21-2008 04:24 PM
Volume Slider garto Road Runner 0 05-13-2007 12:11 PM
How do i setup Weather? liquid_smoke RR FAQ 0 09-17-2006 02:32 AM
Weather Cache danl Road Runner 8 05-28-2006 04:50 AM
Weather program for Map Monkey warnockm Other Cool Stuff 5 12-10-2005 08:14 PM


All times are GMT -5. The time now is 06:19 PM.


Sponsored Links
The MP3car.com Store

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Copyright © 1999 - 2008 Mp3Car.com Inc.
Ad Management by RedTyger
Message Board Statistics