maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Flip clock pre pre pre pre release (https://talk.maemo.org/showthread.php?t=25582)

WilsonBradley 2009-02-09 11:23

Re: Flip clock pre pre pre pre release
 
ciroip,

How did you get those custom Panel tabs on left side?

Rassilon7 2009-02-09 13:22

Re: Flip clock pre pre pre pre release
 
Someone please make a deb of this... pretty please!

jolouis 2009-02-09 16:19

Re: Flip clock pre pre pre pre release
 
ciroip, the progress looks awesome, can't wait to give the thing a try on my tablet here! Did you ever get around to solving the power issues (stop updating/etc when the tablet dims) or was that part of the battery monitoring stuff that you gave up on? Just curious...

In any event, awesome stuff, hope there's a final deb being released soon so everyone can enjoy this!

(and when's the "widget" based on this badboy for that new awesome looking liqbase coming out?? ;o) )

ciroip 2009-02-09 17:13

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by WilsonBradley (Post 263127)
How did you get those custom Panel tabs on left side?

Is part of the theme I made to 'match' a bit the clock's window mode (is a bit too uncomplete to made a deb out of that...maybe after Ill feel the clock complete I can spend a bit more time on that)

Quote:

Originally Posted by Rassilon7 (Post 263139)
Someone please make a deb of this... pretty please!

well, I would wait at least 1 week before beginning to beg qwerty12 to for a .deb. Im not such a great tester and Im not sure about some new issues that could show up and how it works on different tablets(led on n800, access to the OS wallpaper, writing permissions)...

Quote:

Originally Posted by jolouis (Post 263178)
ciroip, the progress looks awesome, can't wait to give the thing a try on my tablet here! Did you ever get around to solving the power issues (stop updating/etc when the tablet dims) or was that part of the battery monitoring stuff that you gave up on? Just curious...
[...]..

(and when's the "widget" based on this badboy for that new awesome looking liqbase coming out?? ;o) )

I just gave up :), I wasnt able to decide a definitive reliable (and simple ebough for me to understand) way to access that batteries numbers. The clock now check the time each 60 seconds (it have to compare it with the 'alarms set' anyway). Ill give a look at the canola sources to see how they managed the situtation (I want mess no more with root access and weird os call that works only on some tablet or with particular conditions) probably the pybatterystatus bar was the most complete piece of code to look at but is a bit too complex for me at the moment to completely grasp every aspect. Thanks to everyone for all the suggestions on the thread anyway, I learned a lot and tried as much solutions I was able to :)
In case someone have something to suggest should probably just take a look at the flipclock.py piece (where the actual main loop reside)
and see how put there some decent battery check to call the 'clock' functions. Anyway I dont think anyone is insane enough to wanted to mess with my messy codes.

liqbase: I salivate everytime I watch Gary's works. I really wish I could use some of his code, (or let him use something ) but I believe he is a perfectionist and he probably dont want release his beasts too early

jolouis 2009-02-09 21:46

Re: Flip clock pre pre pre pre release
 
Hey Ciro,
Just been playing around with your latest build, fc99, and it's pretty awesome. A few points... I did go digging around in your code (yea, it's messy, but not IMPOSSIBLE ;-) ), as I noticed your were updating the clock display every 10 seconds which was wasting CPU:
in ci_init.py, you had
Code:

pygame.time.set_timer(CLOCK_EVENT, 10000)  # Main LOOP 'trigger event' each 60 secs
last time I looked 10,000 milliseconds != 60 seconds ;-) Anyways, not sure why you went to that approach instead of the more accurate one suggested earlier:

Code:

ctime = time.ctime()
pygame.time.set_timer(CLOCK_EVENT, (60-int(str(ctime[17])+str(ctime[18])))*1000)

And then update the main loop in flipclock.py to recalculate the next time needed to redraw to be more accurate:
Code:

elif event.type == ci.CLOCK_EVENT:
                        #######################  UPDATE ###############
                        # And again, here clear the old timer, and update it after clock redraw to make sure it occurs
                        # again at exactly the right time
                        #Clear the current timer
                        ci.pygame.time.set_timer(ci.CLOCK_EVENT, 0)
                       
                        ci_clock.clock()
                 
                        #OK, update has done, so recalculate time till next minute and use that to set next event
                        ctime = time.ctime()
                        ci.pygame.time.set_timer(ci.CLOCK_EVENT, (60-int(str(ctime[17])+str(ctime[18])))*1000)
                        ###################### DONE  UPDATE #############

(don't forget to "import time" at the top of the flipclock.py file to make sure the calls work). Anyways, maybe there's some reason not to use that code, but with it in place CPU use is 1/6th of what it was and clock/alarm is just as accurate.

I'm working on the device state code, it's pretty straight forward (tz1 figured it out for the python status bar applet, same concept goes here) but have to spend some time to make it work (figure out what needs to run and what doesn't based on device state). I'll let you know once I get it sorted out hopefully in the next day or so.

lcuk 2009-02-09 21:59

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by ciroip (Post 263189)

liqbase: I salivate everytime I watch Gary's works. I really wish I could use some of his code, (or let him use something ) but I believe he is a perfectionist and he probably dont want release his beasts too early

not a perfectionist, I just make sure I can handle everything required first.
The little clock you see on the video is actually called "ciroclock.c" in source here.

It will be filled up with your data and stuff and will be your own personalized example of using liqbase :)

ciroip 2009-02-10 01:17

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by jolouis (Post 263282)
Hey Ciro,
, as I noticed your were updating the clock display every 10 seconds which was wasting CPU:
in ci_init.py, you had
Code:

pygame.time.set_timer(CLOCK_EVENT, 10000)  # Main LOOP 'trigger event' each 60 secs
last time I looked 10,000 milliseconds != 60 seconds ;-) Anyways, not sure why you went to that approach instead of the more accurate one suggested earlier:
[...]

I keep changing the update time for a faster debug and I keep forget to reset to 60 before upload in garage :(.
I dont always follow the suggestions because Im a goat. I set the priority to other parts of the code and I forget the core (anyway the clock+alarm is just an excuse to play with python and graphic :) ).

I warned about the code quality... I beginned to feel guilty about when qwerty had to touch it to adapt for the .deb. I really need someone that keep an eye on the important part of the thing :)

ciroip 2009-02-10 01:42

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by lcuk (Post 263287)
not a perfectionist, I just make sure I can handle everything required first.
The little clock you see on the video is actually called "ciroclock.c" in source here.

It will be filled up with your data and stuff and will be your own personalized example of using liqbase :)

Finally I found someone that write that clock for me :)
[reading the very 1st post of this thread]
http://www.internettablettalk.com/fo...ad.php?t=25582
Let me know if u need different resolutions, or more frame for the animations or whatever.

Im working to 'pimp' a bit the clock building some eyecandies:
it seem they can work decently even in python.
Could they make sense for something a bit more ambitious?
A collections of themable finger friendly animated gadgets (with transparencies, sound, cinetics, etc) heavely connected with the code (a step a bit above over the usual 2 state bitmap): again python seem perfect for prototyping things like these, then a serious programmer (I hear in uk there are this kind of animals) could just port the code in c and use the graphics:
https://garage.maemo.org/frs/downloa...48/gadgets.jpg
https://garage.maemo.org/frs/downloa...47/gadgets.tgz

ciroip 2009-02-15 00:09

Re: Flip clock pre pre pre pre release
 
Finally used the jolouis's suggestions for the clock update.
Trying 2 versions of the new slide button for the alarm switch
1 in full screen (sliding with snaps)
1 in window mode (just on - off)
I personally prefer the 1st version but could be a bit tricky sometime (that maybe is not bad in this case to avoid false engaging...)
https://garage.maemo.org/frs/download.php/5489/fc10.tgz

http://files.myopera.com/ciroip/albums/695073/fc10.jpg

like usual: happy sunday

ciroip 2009-02-17 21:26

Re: Flip clock pre pre pre pre release
 
Ok, my kung fu is growing. Now thanks to Kerthan's pypackager I can nearly manage the .deb beast.
https://garage.maemo.org/frs/downloa....1.0.armel.deb


All times are GMT. The time now is 09:08.

vBulletin® Version 3.8.8