Improved Calendar - General Discussion and Assistance - CHDK Forum

Improved Calendar

  • 19 Replies
  • 8557 Views
Improved Calendar
« on: 28 / June / 2012, 16:32:23 »
Advertisements
I've added a feature to the calendar so that one now can make notes in it (for every hour max 60 chars).
To test it you need to copy (and overwrite the old) the attached calend.flt to A/CHDK/MODULES.
The controls are:
  • Month Mode:
    • Func. Set / Shutter half: Enter day
    • Jogdial / Zoom: change selection (day)
    • All others: old function
  • Day Mode:
    • Up / Down / Jogdial: Change selection (hour)
    • Func. Set: Edit / create entry
    • Shutter half / Erase / Disp: Back to month mode
    • All others: old function

The entries are saved in "A/CHDK/DATA/calend.cld" (CALENDAR_FILE). If everyone intrested in the fileformat i can describe it (or look into the code).

TobiMarg

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Improved Calendar
« Reply #1 on: 29 / June / 2012, 06:14:15 »
Nice idea!

I made a few short tests with your .flt file. Not everything is working correctly.

A test entry 'TEST' produced a calendar.cld with a long line of numbers. At the end of this line I can find the 'TEST' entry. The CHDK calendar displays the first numbers of this line (60 chars?).

When I scroll down to the next hour entries (I've made the test at '00'.) the line at '00' will be not completely erased.


Another thing:

Some days ago in German forum we had a discussion about sunset/sunrise data for all. genie01 had made a CHDK version for displaying astronomic data based on GPS. So the mathematical basics are available.

Non GPS cameras need coordinates for the calculation of sunset/sunrise data. We could use the text box or a text file for the coordinates.

The sunrise and sunset times in the calendar view would be a very good improvement.

msl
CHDK-DE:  CHDK-DE links

Re: Improved Calendar
« Reply #2 on: 29 / June / 2012, 06:52:10 »
A test entry 'TEST' produced a calendar.cld with a long line of numbers. At the end of this line I can find the 'TEST' entry.
That's correct.
- The first 100 bytes are year header offsets for 10 years (10 * (4 bytes year + 6 bytes offset)).
- The next 96 bytes are month offsets for the first year (12 * (2 bytes month + 6 bytes offset)).
- The next 248 bytes are the day offsets (31 * (2 bytes day + 6 bytes offset)).
- The next 192 bytes are the hour offsets (24 * (2 bytes hour + 6 bytes offset)).
- The last 60 bytes are the entry ('TEST\0'+55*' ').
All unused offsets are 000000. If you add a new entry it search for the needed year header then the needed month header and so on to the hour/entry. If any of the needed headers aren't available it creates the needed headers / entry at the end of the file and sets the offsets to the needed values (end of file).

The CHDK calendar displays the first numbers of this line (60 chars?).
No, it displays the entry (see above, with only one entry the last 60 bytes of the file).

When I scroll down to the next hour entries (I've made the test at '00'.) the line at '00' will be not completely erased.
That's an error and I will try to fix it (i wonted anyway rewrite the draw functions for that part).

Some days ago in German forum we had a discussion about sunset/sunrise data for all. genie01 had made a CHDK version for displaying astronomic data based on GPS. So the mathematical basics are available.
I've read that, but my camera hasn't started with that version, so I couldn't test it.

Non GPS cameras need coordinates for the calculation of sunset/sunrise data. We could use the text box or a text file for the coordinates.
I've made a number box for this purpose (look here).

The sunrise and sunset times in the calendar view would be a very good improvement.
That's a good idea, I hope we can combine this.

TobiMarg

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Improved Calendar
« Reply #3 on: 29 / June / 2012, 07:12:21 »
The CHDK calendar displays the first numbers of this line (60 chars?).
No, it displays the entry (see above, with only one entry the last 60 bytes of the file).

See the screenshot. That's what I mean. I see no 'TEST' entry.

msl
CHDK-DE:  CHDK-DE links

Re: Improved Calendar
« Reply #4 on: 29 / June / 2012, 07:23:55 »
Code: [Select]
I've made a number box for this purpose (look here).

Has the number box been added to the trunk? I like to use it, but I guess it's not in the official CHDK trunk? Or I missed it.
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

Re: Improved Calendar
« Reply #5 on: 29 / June / 2012, 07:52:31 »
@msl
I have no idea why it doesn't work. On my camera there is written TEST and not such numbers. If you have enough time, try to delete the the calend.cld file and retest it, compile it with applied patch or look at the code to find the problem. Otherwise i will try to find any possible errors.
(How do you make this screenshots???)

@outslider
The numberbox is not in trunk (no one was intrested in it  :'(), but you can get a patch here

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Improved Calendar
« Reply #6 on: 29 / June / 2012, 08:26:24 »
I have no idea why it doesn't work. On my camera there is written TEST and not such numbers. If you have enough time, try to delete the the calend.cld file and retest it, compile it with applied patch or look at the code to find the problem. Otherwise i will try to find any possible errors.
(How do you make this screenshots???)

Ok, I will make some tests.

Since we have live view (reyalp's chdkptp) is a screenshot not a big thing.  :)

msl
CHDK-DE:  CHDK-DE links

Re: Improved Calendar
« Reply #7 on: 29 / June / 2012, 18:31:25 »
I was interested a little, but forgot about that then. You can post a patch to the thread, where patches are submitted to be added to the trunk.
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Improved Calendar
« Reply #8 on: 29 / June / 2012, 18:48:38 »
The numberbox is not in trunk (no one was intrested in it  :'(), but you can get a patch here

Post patches to be added to SVN here - http://chdk.setepontos.com/index.php?topic=650

Patches in other threads are assumed to be for testing/review and are easily missed.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Improved Calendar
« Reply #9 on: 30 / June / 2012, 02:21:49 »
Post patches to be added to SVN here - http://chdk.setepontos.com/index.php?topic=650

Patches in other threads are assumed to be for testing/review and are easily missed.
I knew that, but it was for testing and no one has tested it :(. Now I will update the patch to the newest CHDK-revision and post it in the right thread.

Edit:
Should I post this calendar (after a few fixes) also there or is there anyone that could test it before.
« Last Edit: 30 / June / 2012, 02:27:00 by TobiMarg »

 

Related Topics


SimplePortal © 2008-2014, SimplePortal