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 > Coders Corner

Reply
 
Thread Tools Display Modes
Old 09-11-2005, 10:40 PM   #1
FLAC
 
IntellaWorks's Avatar
 
Join Date: Jun 2004
Location: NH
Vehicle: 2005 Toyota Tacoma
Posts: 1,173
My Photos: (0)
Night / Day Skin Code:

I don't know if this might be helpful to anyone but I struggled with the logic for quite sometime. I needed code to change skins from day to night or from night to day depending on when my app considered day or night.


This code was added to a timer which already kept trac of the system time for other reasons.


Code:
'gui.day = 6:00 AM 'gui.night = 5:45 PM '* '* Check to see if current time falls between 6AM and 5:45PM or 5:45PM and 6AM '* If buffer.Compare(System.DateTime.Now.TimeOfDay, gui.night.TimeOfDay) = 1 Or buffer.Compare(System.DateTime.Now.TimeOfDay, gui.day.TimeOfDay) = -1 Then '* '* Ok we're in night so lets see if we really need to change the skin over '* If Not gui.current_skin = "nightSKIN" Then '* '* Looks like we're going to have to change the skin, call the sub '* gui.change_skin("night") End If Else '* '* Hmm, must be the morning, boy that night flew by! '* '* '* Check to see if we need to change the skin to day '* If Not gui.current_skin = "daySKIN" Then '* '* Change skin over to day time '* gui.change_skin("day") End If End If

__________________
Progress [I will seriously never be done!]
Via EPIA MII
512MB RAM
OEM GPS (embedded)
nLite WinXP pro on
1GB Extreme III CF card
Carnetix 1260 startup/ DC-DC regulator
Software: Still, re-Writing my existing front end in .Net

Last edited by IntellaWorks; 09-12-2005 at 07:51 AM.
IntellaWorks is offline   Reply With Quote
Sponsored Links
Old 09-12-2005, 10:32 AM   #2
Maximum Bitrate
zPilott's CarPC Specs
 
zPilott's Avatar
 
Join Date: Jul 2004
Location: Austin
Vehicle: 2003 Nissan 350Z
Posts: 502
My Photos: (0)
Why not calculate the sunrise/sunset time, and then switch based on that (say +/- x mins from sunrise and +/- y mins from sunset)

http://www.freevbcode.com/ShowCode.asp?ID=341

all you need is latitude and longitude and a date
__________________

|V1 Virtual Display|

Hard work often pays off over time, laziness always pays off right now.
zPilott is offline   Reply With Quote
Old 09-12-2005, 10:38 AM   #3
FLAC
 
IntellaWorks's Avatar
 
Join Date: Jun 2004
Location: NH
Vehicle: 2005 Toyota Tacoma
Posts: 1,173
My Photos: (0)
.

You could do that, just add sunrise date instead of gui.day and sunset date instead of gui.night


I posted this code because for what ever the reason the logic just wasn't popping into my head... It's pretty bad when my non-programming non-computer literate fiencee figures out the logic before me in a discussion we had about it...

This code is just the base code... probably some day some random person will find it using google and will be very thankful !!!!
__________________
Progress [I will seriously never be done!]
Via EPIA MII
512MB RAM
OEM GPS (embedded)
nLite WinXP pro on
1GB Extreme III CF card
Carnetix 1260 startup/ DC-DC regulator
Software: Still, re-Writing my existing front end in .Net

Last edited by IntellaWorks; 09-12-2005 at 10:41 AM.
IntellaWorks is offline   Reply With Quote
Old 09-12-2005, 08:36 PM   #4
Variable Bitrate
 
Join Date: Sep 2004
Location: was Boston -> now Canada!
Vehicle: 2002/Toyota/Highlander
Posts: 376
My Photos: (0)
Funny to see this post. I was just wondering how to get the skins too change automatically from day to night. I have not been able to figure it out.

Have you got it working?

Chuck
chuckster is offline   Reply With Quote
Old 09-12-2005, 09:29 PM   #5
FLAC
 
IntellaWorks's Avatar
 
Join Date: Jun 2004
Location: NH
Vehicle: 2005 Toyota Tacoma
Posts: 1,173
My Photos: (0)
.

The logic I've posted is working. :-)
__________________
Progress [I will seriously never be done!]
Via EPIA MII
512MB RAM
OEM GPS (embedded)
nLite WinXP pro on
1GB Extreme III CF card
Carnetix 1260 startup/ DC-DC regulator
Software: Still, re-Writing my existing front end in .Net
IntellaWorks is offline   Reply With Quote
Old 09-13-2005, 02:00 AM   #6
FLAC
GizmoQ's CarPC Specs
 
GizmoQ's Avatar
 
Join Date: Nov 2004
Location: St Louis
Vehicle: Several
Posts: 1,337
My Photos: (82)
Why not just use GammaControl 1.7? and switch the skin and the GPS.
GizmoQ is offline   Reply With Quote
Old 09-13-2005, 02:19 AM   #7
My Village Called
0l33l's CarPC Specs
 
0l33l's Avatar
 
Join Date: Jul 2004
Location: Berkeley, CA
Vehicle: 1995 Lexus SC300 1997 Mazda Miata
Posts: 10,763
My Photos: (0)
Quote: Originally Posted by GizmoQ
Why not just use GammaControl 1.7? and switch the skin and the GPS.

Exactly

I'm accepting feature requests, and some features are making it to the program, as you can see with the MM support
__________________
PowerVoice v1 | NaviVoice Source
GammaControl v2.4
SKINbedder v3

1995 Lexus SC300 <-- Weekend Car
1997 Mazda Miata <-- Daily Driver
0l33l is offline   Reply With Quote
Old 09-13-2005, 06:18 AM   #8
FLAC
 
IntellaWorks's Avatar
 
Join Date: Jun 2004
Location: NH
Vehicle: 2005 Toyota Tacoma
Posts: 1,173
My Photos: (0)
.

Well for starters, gamma control is an external application which I didn't write. It's much easier to encorperate code already in my app.

This is the "coders corner" and its a peice of code I thought may be helpful to some so I just posted it. Use freely.
__________________
Progress [I will seriously never be done!]
Via EPIA MII
512MB RAM
OEM GPS (embedded)
nLite WinXP pro on
1GB Extreme III CF card
Carnetix 1260 startup/ DC-DC regulator
Software: Still, re-Writing my existing front end in .Net
IntellaWorks is offline   Reply With Quote
Old 09-21-2005, 08:32 AM   #9
lbk
Low Bitrate
 
Join Date: Feb 2003
Location: Chicago
Vehicle: 02' Mazda Protege5
Posts: 87
My Photos: (0)
So what are you doing then to change the interface? Just switching colors? I'm not to a point where I'm even ready to do this yet, but it would be nice to have ideas for when I get there.
lbk is offline   Reply With Quote
Old 10-30-2005, 11:04 AM   #10
lez
FLAC
lez's CarPC Specs
 
lez's Avatar
 
Join Date: Jan 2004
Location: UK
Vehicle: XM 2.1 TD
Posts: 1,282
My Photos: (0)
Quote: Originally Posted by zPilott
Why not calculate the sunrise/sunset time, and then switch based on that (say +/- x mins from sunrise and +/- y mins from sunset)

http://www.freevbcode.com/ShowCode.asp?ID=341

all you need is latitude and longitude and a date

I just looked at that sounded interesting.

Then I looked at it again and went to cry in a corner because my head hurt.

It has pages of 'stuff' about citys and lists of citys and numbers of citys.

I need a drink.
Doh!
lez is offline   Reply With Quote
Sponsored Links
Old 01-06-2006, 02:58 PM   #11
Variable Bitrate
 
DeltaFX's Avatar
 
Join Date: Sep 2004
Location: France
Vehicle: 2002 Mux'd 206 peugeot
Posts: 399
My Photos: (0)
I can post a Sunset/sunrise/civilian-twilight function written in delphi, if usefull to someone.
__________________
Now Galileo is real. Muhahahahaha :p
DeltaFX 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

BB 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
Roadrunner Skinning Tutorial Meelobee RR Skins 14 12-30-2005 07:28 PM
On line my skin for Map Monkey update whit the volume control mauri MM Skins 36 12-13-2005 07:38 AM
Head Unit 'code' - help! Laidback Car Audio 41 06-10-2005 08:53 AM
[RELEASE] Feb23 day skin for NMC 0.7 alpha1c febsperanza NeoCar Media Center 10 12-17-2004 06:17 AM
finnaly skin uploaded liquid_smoke ME Archive 5 12-31-2003 09:13 PM


All times are GMT -5. The time now is 05:20 AM.


Sponsored Links
The MP3car.com Store

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 1999 - 2008 Mp3Car.com Inc.
Ad Management by RedTyger
Message Board Statistics