new time/date display plugin

jdgordon

New member
gday all...
i think ive figured out the plugin stuff which means lots of fun coding for me :) (btw not being able to debug plugins the "normal" way really sux..)

so my first plugin lets u choose exactly how u want to display the date/time..

look here for info on how to display the time (everything there down to tt apart from z and zzz are available) but currently only 24 hour time works...

eg u could display the time on the first row as "hh:nn:ss" or "h:nn.ss" etc.. and the date as "dd mmm yy"...

any letters that arnt on that page will get copied directly into displayed string... (if u want to display a letter which can be converted u need to put a % in front of it)

ok so how do u use this?
dump the attached dll into the service folder with the rest of them then make a screen which has something like this in it
[from00]
from="jdg_time.ini"
sec="time-#"
opt01="id=@01"
opt02="format=dd mmm yyyy"
id and format are the only 2 options available (i will add translation support for the month and day names if ppl want it)

im 90% sure it doesnt crash or freeze the service, but because it is such a pain to test every combination i havnt...

new version...

recompiled wiith the new libs
fixed 12pm being shown as am (as in lunch time, not midnight...)
________
Big tits porn
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

Attachments

Last edited:

jdgordon

New member
ok, ive updated it to use 12 hour time.. but u have to have one of the 4 am/pm charcters after the time in the format string to work...

to show am or pm add "ampm" to the format sring... "ap" is the same but only the letter a or p.. "AMPM" and "AP" is the same but capitals...

this is what my display screen
[pre]
rows=2
cols=16

[screen]
screen_name="Date/Time"
options=0
alt_delay=5000

[from00]
from="jdg_time.ini"
sec="time-#"
opt01="id=@01"
opt02="format=ddd dd mmm yyyy"

[from01]
from="cc2_time.ini"
sec="time-#"
opt01="id=@02"
opt02="format=hh:nn:ss AMPM"

[r00]
options=5

[r00-i00]
id=@01

[r01]
options=5

[r01-i00]
id=@02
which shows "Sun 27 Feb 2005" "10:01:40 AM"

(grab it from the first post)
________
Bone disorders advice
 
Last edited:

jc634

Administrator
Perfect!

"Sun 27Feb05" is the format that I prefer and this does it nicely. Your plug-in has found a home on my computer.

You now make me want to go out and get a C compiler (well, almost:) ).

Anyway, congrats on a nice routine to compliment CC2.

You better watch out, tho. You may be inundated with plug-in requests, now.:D

Jim
 

CF Mark

Administrator
Well done :)

jdgordon said:
btw not being able to debug plugins the "normal" way really sux..
That it does :(
Using the "log_log" function is the easiest way.
If your building a big plugin and do really need to step through it, make it into a simple console app first.
I did with with my game server plugin to make debugging easier, then just copied the code into a plugin when it was ready.
 

jc634

Administrator
jdgordon,

I am using your time routine with the following format:

format="h:mm AMPM"

It displays the hour and AM/PM correctly. The minutes stays "stuck" at :01. Any ideas as to the problem?

Jim
 

jc634

Administrator
jdgordon said:
<sarcasm> are u waiting longer than 1 min for it to change??? </sarcasm>

Actually, i watched it *patiently* for an hour to watch the hour digit turn over!:D

And if you believe that, I do have a certain bridge to sell...:p

Jim
 

daks001

New member
jdgordon said:

so my first plugin lets u choose exactly how u want to display the date/time..

look here for info on how to display the time (everything there down to tt apart from z and zzz are available) but currently only 24 hour time works...

eg u could display the time on the first row as "hh:mm:ss" or "h:mm.ss" etc.. and the date as "dd mmm yy"...

any letters that arnt on that page will get copied directly into displayed string... (if u want to display a letter which can be converted u need to put a % in front of it)

Are all the output data types strings? If so, is it possible to get output as a number instead? Specifically the h to start off with?
 

jdgordon

New member
im going to change it to output the first number as a number, so if u want to use bigchars for the clock u will need to setup 1 time for just the hour, and one for just the minutes... no other way im afraid
________
DRUGTEST
 
Last edited:

daks001

New member
jdgordon said:
im going to change it to output the first number as a number, so if u want to use bigchars for the clock u will need to setup 1 time for just the hour, and one for just the minutes... no other way im afraid
Actually I was just using bigchars because I thought it would only display numerical data and not strings. BUT it turns out that if your h and hh outputs do work in bignums! So I then was trying to plug the hour into another "section" that only accepts numerical data... ;)

It will be quite the event once we can trap time.
 

jc634

Administrator
jdgordon said:
yep that to :)
actually.. what ill do is add some statis ID's to the plugin to get all the current date/time info without setting anything up manually..
Actually, it would be nice if you and CC admin could roll both your time libraries into 1.

Jim

Eventually...
 

jc634

Administrator
jdgordon said:
mines better than his so his will die.. :p

JOKE... relaaax
Hey, when you're better, admit it!:D

Once you fix the :01 thingy...

FWIW, here is date/time screen. Tell me if anything looks funny...

[pre]
rows=4
cols=20

[screen]
screen_name="Date/Time & Uptime"
options=0
alt_delay=5000

[from00]
from="cc2_time.ini"
sec="time-#"
opt01="id=@01"
opt02="format=ddd ddmmmyy"

[from01]
from="cc2_time.ini"
sec="time-#"
opt01="id=@02"
opt02="format=h:mm AMPM"

[r00]
options=5

[r00-i00]
id=@01

[r01]
options=5

[r01-i00]
id=@02

[r02]
options=5

[r03]
options=5

[r03-i00]
string="Uptime: "

[r03-i01]
id=3451264379
 

daks001

New member
jc634 said:
Hey, when you're better, admit it!:D

Once you fix the :01 thingy...

FWIW, here is date/time screen. Tell me if anything looks funny...

Move the screen paragraph to underneath the second from paragraph.


[pre]
[from]
[from]
[screen]
[r]
 

jc634

Administrator
daks001 said:
Move the screen paragraph to underneath the second from paragraph.


[pre]
[from]
[from]
[screen]
[r]
You are correct, but the cc2_service.ini file corrects it?:

[m01-s01]
screen_name="Date/Time & Uptime"
options=0
alt_delay=5000

[m01-s01-r00]
options=5
scroll_speed=250

[m01-s01-r00-i00]
id=1410480285
options=0
length=0

[m01-s01-r01]
options=5
scroll_speed=250

[m01-s01-r01-i00]
id=1887909493
options=0
length=0

[m01-s01-r02]
options=5
scroll_speed=250

[m01-s01-r03]
options=5
scroll_speed=250

[m01-s01-r03-i00]
string="Uptime: "
options=0
length=0

[m01-s01-r03-i01]
id=3451264379
options=0
length=0

Anyway, I will rerun with screen add and see if it changes anything.

Jim
 

jdgordon

New member
hahaha i found the problem...
mm is for the month NOT the minutes....
its showing 01 coz ur in feb still (00 is jan)
change it to nn and it will work...
________
MEXICO HOTELS
 
Last edited:
Top