Questions about chdk source code ... for Devs. - General Discussion and Assistance - CHDK Forum supplierdeeply

Questions about chdk source code ... for Devs.

  • 15 Replies
  • 4506 Views
*

Offline m2tk

  • **
  • 50
  • Sheet happens ...
Questions about chdk source code ... for Devs.
« on: 12 / April / 2008, 12:23:32 »
Advertisements
Q1: why don't you guys put some comments on it? is it so secret to not let others know what fun or variable stands for? maybe some comments on the flow control... it's much easier to read 2 lines of comments than 20 of code to find interesting point.

Q2: why menu width is fixed? shouldn't be min(max(menuitems.text), screen_width) so the longer menu labels would fit?
and what about the '30' shouldn't be defined as constant variable? so we could easily change menu width?
Code: (c) [Select]
gui_menu.c
void gui_menu_init(CMenu *menu_ptr) {
    if (menu_ptr) {
        gui_menu_set_curr_menu(menu_ptr, 0, -1);
        gui_menu_stack_ptr = 0;
    }
   
    num_lines = screen_height/rbf_font_height()-1;
    w = screen_width-30-30; // menu_width = screen_width - 2*MENU_BORDER_HORIZONTAL_SPACE;
    x = (screen_width-w)>>1; // x = MENU_BORDER_HORIZONTAL_SPACE;

Q3: why in menu some options are tuned by KEY_SET and other by KEY_RIGHT? can't they have the same action/changing/selecting/choosing?

Q4: why file browser is using 8.3 filenames? can't be longer?

Q5: why there is no 'scroll by one line'  or 'by page - 1 line' button in text reader? it is sometimes easier to read when you have previous content partialy on the screen.

sorry for those 'why' but asking is fastest way to learn... i am java programmer who wants to learn/recall some C stuff and would like to modify/apply some of my ideas to make chdk more and more astonishing... if get some spare time.

that's for now, will ask more...  ;)

no offends and thx.
« Last Edit: 12 / April / 2008, 12:37:23 by m2tk »
S5IS 1.01bc

Re: Questions about chdk source code ... for Devs.
« Reply #1 on: 12 / April / 2008, 13:09:54 »
asking is fastest way to learn

That is not how it works ....

Everyone is busy  ..........

To understand CHDK you have to put in a lot of effort, lack of comments means you will learn more.

I am not an expert programmer, I study CHDK to learn 'C' programming.

Right now, I cannot compile a new firmware version for the TX1 because the compiler complains there is no rule to make target 'stubs_min.o'.

I will have to study the Makefiles to find-out why.

If more expert developers think you are asking questions because it is easier, and you are busy anyway, I doubt that you will get an answer.



David

*

Offline m2tk

  • **
  • 50
  • Sheet happens ...
Re: Questions about chdk source code ... for Devs.
« Reply #2 on: 12 / April / 2008, 13:47:11 »
i know that all hard work i should and doing myself.
it is not easier it is faster to get into project than starting from scrach.
that's the point of community to share the knowlegde, why do we need to do porting by each of us if someone already made it? let's find/do new things..
the point of my questions is to not open opened doors, some of them are just feature requests/hints also for myself
and want to know if there are some limits about compatibility of models i.e why file browser is only 8 lines high? because of other cams smaller screens or...? so i could make some conditional checking to make it common not camera specific.

Q5: why can't we use unicode in menu, text reader, just windows-125x? is it limited by rbf fonts or sthing else?

but i can't agree with you about the comments, its like in mastercard advertisement :
new camera : 400$
dumping, porting : 400h
comments in code: ... priceless
(even for code author few weeks after)

thx.
btw. from time to time i have free time ;)
« Last Edit: 12 / April / 2008, 13:51:36 by m2tk »
S5IS 1.01bc

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: Questions about chdk source code ... for Devs.
« Reply #3 on: 12 / April / 2008, 14:06:17 »
Q4: why file browser is using 8.3 filenames? can't be longer?

For VxWorks cameras filenames in file browser is longer. Function to read long filenames still not found in DRYOS (if it exists there).
Read also this discussion.
« Last Edit: 12 / April / 2008, 14:07:52 by ewavr »


*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: Questions about chdk source code ... for Devs.
« Reply #4 on: 12 / April / 2008, 15:39:35 »
Q1: why don't you guys put some comments on it?
One word - laziness. :) And even if comments had been there they would not have helped, because they would have been in Russian. :)

Q2: why menu width is fixed?
For some historical reasons. It was implemented more than year ago and has not been changed since that.

Q3: why in menu some options are tuned by KEY_SET and other by KEY_RIGHT? can't they have the same action/changing/selecting/choosing?
To be comfortable in using.

Q5: why there is no 'scroll by one line'  or 'by page - 1 line' button in text reader?
Just nobody requested this before.
CHDK Developer.

*

Offline m2tk

  • **
  • 50
  • Sheet happens ...
Re: Questions about chdk source code ... for Devs.
« Reply #5 on: 12 / April / 2008, 16:17:50 »
Q3: why in menu some options are tuned by KEY_SET and other by KEY_RIGHT? can't they have the same action/changing/selecting/choosing?
To be comfortable in using.

as for me on S5is it's better when i don't have to use SET at all, and LEFT key is also underused, it could act as BACK.
i have to look at it...

thanks for answers
S5IS 1.01bc

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: Questions about chdk source code ... for Devs.
« Reply #6 on: 12 / April / 2008, 17:11:47 »
Ok, I see. Only S-series has separated [set] button. In other cameras this button is located in the center of 4-way joystick and it is much comfortable.
CHDK Developer.

Re: Questions about chdk source code ... for Devs.
« Reply #7 on: 12 / April / 2008, 19:09:04 »
Deleted
« Last Edit: 22 / April / 2008, 17:38:10 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye


*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: Questions about chdk source code ... for Devs.
« Reply #8 on: 13 / April / 2008, 03:20:37 »
Too often it's easy to hit a direction instead of pressing in the center, sometimes taking many times to hit the "set" position, and instead end up changing some feature (with the directional clicks) that has to be changed back before you can try to hit the "set" position again.

It seems you have big fingers. :D
I've never missed buttons on my A610 (while playing in Reveresi and Sokoban many times :)).
CHDK Developer.

*

Offline jetzt

  • ****
  • 316
  • [A710IS,(SD200)]
Re: Questions about chdk source code ... for Devs.
« Reply #9 on: 13 / April / 2008, 07:15:56 »
Anything is dependent of environment conditions.
I often typed the wrong keys while it was let's say a bit cool outside...
But I've learned to handle it now. :D

 

Related Topics