• Welcome to TodayPlus Boards v2.
 

Moon Phases

Started by Broesel, December 26, 2003, 05:41:28 AM

Previous topic - Next topic

Broesel

For those who want to play with the moonphases I made some
transparent moon-icons. They are 25x25 px.

The command to get the moonphase is:

calcvar,varx,moonphase,1

You get values from 0 to 7 where 0 is newmoon and 4 is fullmoon
(the pictures are named like the values - moon0.bmp ... moon7.bmp)

Here is a pic of the phases :


Greetings Broesel

Edit: Reattached the moonphases

joelw135

How do you call the images.
Dell Axim X3i, Windows Mobile 2003
512mb Kingston SD card
256mb Lexar SD card
Today Plus
WisBar Advanced
PIEPlus
DotPocket

Broesel

Quote from: joelw135How do you call the images.

Well, it should be made with the new imagemeter-command, but because
I dont know the syntax, i made it with the if-command as follows:

calcvar,var10,moonphase
if,var,var10,,=,0
image,6,2,Moon0.bmp,t
endif
else
if,var,var10,,=,1
image,6,2,Moon1.bmp,t
endif
else
if,var,var10,,=,2
image,6,2,Moon2.bmp,t
endif
else
if,var,var10,,=,3
image,6,2,Moon3.bmp,t
endif
else
if,var,var10,,=,4
image,6,2,Moon4.bmp,t
endif
else
if,var,var10,,=,5
image,6,2,Moon5.bmp,t
endif
else
if,var,var10,,=,6
image,6,2,Moon6.bmp,t
endif
else
if,var,var10,,=,7
image,6,2,Moon7.bmp,t
endif
else
endif


Greetings Broesel

joelw135

Real strange, I pasted the code into my skin and changed the X & Y to position it where I wanted. The moon showed up for one second and blanked out the complete region. I tried to reload TodayPlus, and it wouldn't load until I copied the old skin on top of this revised code. Never had that happen before.  My X & Y were a little off because the moon showed up on top of the Sunrise icon.
Dell Axim X3i, Windows Mobile 2003
512mb Kingston SD card
256mb Lexar SD card
Today Plus
WisBar Advanced
PIEPlus
DotPocket

Barbaros

Dear Broesel,

I was wondering is you could tell us how you where able to display the moonrise(MA), moonset(MU), and moonillumination(sichtbar) values as they are displayed in this post?

http://www.dark-mojo.com/todayplus/viewtopic.php?t=1061&start=0&postdays=0&postorder=asc&highlight=moonphase

I have tried guessing the commands but I've had no luck. Could you give us an example of how to display these?

Also for joelw135,

I am not sure if this helps, but there's one thing you can try. My region with the moonphases has its refresh rate set to 60, not -1. Maybe try changing that and see if it helps.

Thanks.

joelw135

Are you talking about the regions command? If that is the case, I tried it , no luck.

region,0,0,-1
Dell Axim X3i, Windows Mobile 2003
512mb Kingston SD card
256mb Lexar SD card
Today Plus
WisBar Advanced
PIEPlus
DotPocket

Broesel

@joel: don't know, if the commands i made are wrong or right.
They work for  me in region 0 and I can't give any support for this, because I was only trying around with the commands. Even if some commands work, I don't  know if they are official and without bugs, so please dont ask for support with them (srs please don't beat me, if it is too early for trying with them)  :oops:
moonrise:
moontime,1,rise,official,24,42,HH:mm,,,l

moonset:
moontime,1,set,official,80,42,HH:mm,,,l

illumination:
moontime,1,visible,,35,55,,, % sichtbar,l

You can play with them but please on your own risk !

Greetings Broesel

joelw135

No problem, I was putting it in region 0 also, but I will wait till srs gets back and lets us know.
Dell Axim X3i, Windows Mobile 2003
512mb Kingston SD card
256mb Lexar SD card
Today Plus
WisBar Advanced
PIEPlus
DotPocket

sdmaino

Quote from: joelw135No problem, I was putting it in region 0 also, but I will wait till srs gets back and lets us know.

Hey joelw135, I have an idea... but I do not know enough about the code to do what I want... maybe you can help me   :)

What do you think to place  the moon illumination in region 0 in the same place of the sunrise and sunset, switching from moon to sun and viceversa with the same approach of the system/storage card memory ...?(images and text automatically change from one to the other with a certain interval)

I tried it, but I had no success.

Maybe you can do something better ? :lol:

Thanks
Dave

joelw135

Sounds like a nice idea, I wanted to put it alongside the Sunrise and Sunset and above the elevation of the sun. I left a space on my skin. If I was able to get the basic working on would give it a try. But as of now there is something in the code that won't let me use it.
Dell Axim X3i, Windows Mobile 2003
512mb Kingston SD card
256mb Lexar SD card
Today Plus
WisBar Advanced
PIEPlus
DotPocket

Timmy

Quote from: joelw135Real strange, I pasted the code into my skin and changed the X & Y to position it where I wanted. The moon showed up for one second and blanked out the complete region. I tried to reload TodayPlus, and it wouldn't load until I copied the old skin on top of this revised code. Never had that happen before.

I also pasted the code in my skin, and had the same result as joelw. Even in different regions...  
Toshiba e750BT, WM 2003, Today Plus 0.11.0, WISbar Adv, Agenda Fusion, Pocket Slides, TomTom

Broesel

I think, it could have to do with the if then else ...

Maybe this works:

calcvar,var10,moonphase

if,var,var10,,=,0
image,6,2,Moon0.bmp,t
else
endif

if,var,var10,,=,1
image,6,2,Moon1.bmp,t
else
endif

if,var,var10,,=,2
image,6,2,Moon2.bmp,t
else
endif

if,var,var10,,=,3
image,6,2,Moon3.bmp,t
else
endif

if,var,var10,,=,4
image,6,2,Moon4.bmp,t
else
endif

if,var,var10,,=,5
image,6,2,Moon5.bmp,t
else
endif

if,var,var10,,=,6
image,6,2,Moon6.bmp,t
else
endif

if,var,var10,,=,7
image,6,2,Moon7.bmp,t
else
endif

Greetings Broesel

joelw135

No, that didn't do it either. I can't figure out why it works in yours and not others. Maybe if one of the brains comes on tonight, they could figure it out.
Dell Axim X3i, Windows Mobile 2003
512mb Kingston SD card
256mb Lexar SD card
Today Plus
WisBar Advanced
PIEPlus
DotPocket

Barbaros

Thanks for the help, Broesel.  

Joelw135, Im starting to believe your problems isnt in the if/else statements. If you want to try another method of writing it, this is how I write mine:

if,var,var9,,=,0
image,160,14,moonphase\0.png,t
else
if,var,var9,,=,1
image,158,14,moonphase\1.png,t
else
if,var,var9,,=,2
image,158,14,moonphase\2.png,t
else
if,var,var9,,=,3
image,158,14,moonphase\3.png,t
else
if,var,var9,,=,4
image,158,14,moonphase\4.png,t
else
if,var,var9,,=,5
image,158,14,moonphase\5.png,t
else
if,var,var9,,=,6
image,158,14,moonphase\6.png,t
else
if,var,var9,,=,7
image,158,14,moonphase\7.png,t
endif
endif
endif
endif
endif
endif
endif
endif

It may look sloppy but it hets the job done!

joelw135

No luck there either, Here is my skin region 0 please look and see if I am missing anything. The one above was incorrect.

//=================================================
// REGION 0 - PAGE 0
//   Date section
//  Dimensions: 240 x 70
//=================================================
   region,0,0,-1
   defregion,0,0,0,240,70,1
updateregions,14
   offset,offset_-1,offset_-1
offsetadd,0,2
changefont,tahoma,8,

color,font,255_255_0
suntime,%var0%,elevation,,72,59,%05.2f,Ele: ,°,l
color,font,_-1_4_-1


image,113,44,sunrise.png,
suntime,1,sunrise,official,111,59,hh:mm,,,l

image,135,44,sunset.png,
suntime,1,sunset,official,134,59,hh:mm,,,l

calcvar,var9,moonphase
if,var,var9,,=,0
image,85,44,moonphase\Moon0.bmp,t
else
if,var,var9,,=,1
image,85,44,moonphase\Moon1.bmp,t
else
if,var,var9,,=,2
image,85,44,moonphase\Moon2.bmp,t
else
if,var,var9,,=,3
image,85,44,moonphase\Moon3.bmp,t
else
if,var,var9,,=,4
image,85,44,moonphase\Moon4.bmp,t
else
if,var,var9,,=,5
image,85,44,moonphase\Moon5.bmp,t
else
if,var,var9,,=,6
image,85,44,moonphase\Moon6.bmp,t
else
if,var,var9,,=,7
image,85,44,moonphase\Moon7.bmp,t
endif
endif
endif
endif
endif
endif
endif
endif






changefont,tahoma,11,   
//Puts Date on today screen
changefont,tahoma,24,b
color,font,192_192_192
time,65,-1,-1,5,cs,"dddd",
changefont,tahoma,13,
color,font,255_255_0
time,65,20,-1,5,cs,"d MMMM,yyyy"

changefont,tahoma,11,
color,font,255_0_0
//Puts month calendar and update time on today screen
load,city,%var0%
text,24,35,Updated:,l
text,85,35,[updatetime],c,hh:mm:tt

      color,font,255_0_0
      changefont,tahoma,12,b
               color,font,255_255_0
               imagebutton,128,12,reset.png,t,-1,10,0,0
      imagebutton,142,0,right_arrow.png,t,-1,8,1,0
      button,142,0,11,11,-1,8,0
      imagebutton,128,0,left_arrow.png,t,-1,9,0,0
      button,128,0,11,11,-1,9,1
      changefont,tahoma,11,b
      calendarheader,153,9,12
               //Red Saturday
               color,font,255_0_0
               text,155,9,S,l
               //Red Sunday
               color,font,2_11_251
               text,227,9,S,l
               changefont,tahoma,10,
      color,font,-1_4_-1
      calendar,0,0,153,20,12,8,l
      color,font,-1_4_-1
      changefont,tahoma,12,b
      text,160,0,[caldate],0,l,"MMMM, yy"

//Puts owner info on today screen
changefont,tahoma,13,b
text,1,45,%owner name%,l
changefont,tahoma,12,
text,1,56,%owner phone%,l
//Puts Memory and Brightness shortcut on desktop
shortcut,126,24,Memory,s
button,126,24,16,16,-1,0,%Memory,
//shortcut,114,29,Brightness,s
//button,114,29,16,16,-1,0,%Brightness,

   offsetadd,0,68
   endregion,0,0
Dell Axim X3i, Windows Mobile 2003
512mb Kingston SD card
256mb Lexar SD card
Today Plus
WisBar Advanced
PIEPlus
DotPocket