changelog of trunk including comments / devtalk - page 19 - General Discussion and Assistance - CHDK Forum

changelog of trunk including comments / devtalk

  • 299 Replies
  • 242714 Views
*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: changelog of trunk including comments / devtalk
« Reply #180 on: 19 / August / 2014, 08:33:40 »
Advertisements
And what is the sense of this renaming?

Sorry, but the new name is not quite user friendly.  It's more a renaming for developers than for  end users. I think a name of a script function should say a little bit about the sense of the function. This is very important for end users! A developer can check the source code for the background story of a function.

The boolean return-value is a good change. This should be a standard for all new Lua functions. Also set_mf() is a candidate for that.

msl
CHDK-DE:  CHDK-DE links

Re: changelog of trunk including comments / devtalk
« Reply #181 on: 19 / August / 2014, 09:04:03 »
And what is the sense of this renaming?
I think the concern was that the old name implied that the function would enable faster USB communications. Or even USB2.0 or USB3.0.   

We had a fairly long debate over a couple of days on IRC about a replacement name.  This was the best we could come up with but I'm sure there would be no objection if there is a better suggestion?

Quote
Also set_mf() is a candidate for that.
Agreed.   

As an educational note, I've learned that for something to test as false in a Lua if statement, it needs to be actually boolean false or nil.   

So if you run this :
Code: [Select]
i=0
if( i ) then print("true') else print("false") end
the result will print out true.    The equivalent code in C would print out false.

Fortunately, I would normally not code it that way - preferring to be explicit :
Code: [Select]
i=0
if( i ~= 0) then print("true') else print("false") end
so I don't think I've noticed this before.  But I'm going to scan some of my scripts just in case.

Maybe this is obvious to everyone else but I think that I'll update the Lua wiki page somewhere with a note.

Edit : changing the return of set_mf() from int to boolean will break the 2000+ copies of kap_uav.lua, yass4.lua and meteor2.lua that have been downloaded so far.  Not to mention the various version of the MF test script.
« Last Edit: 19 / August / 2014, 09:39:34 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: changelog of trunk including comments / devtalk
« Reply #182 on: 19 / August / 2014, 10:28:32 »
... the old name implied that the function would enable faster USB communications. Or even USB2.0 or USB3.0. ...
Hmm... This is far-fetched. But it is an argument. And what tells us the new name? I can already see the questions. What is hp? Which timer?

What do you think about: fast_usb_power_detection()

set_mf():
2000+ downloads is a big argument (respect!!!). On the other hand CHDK 1.3 is the developer branch. The question is, what is more important?

msl
CHDK-DE:  CHDK-DE links

*

Offline reyalp

  • ******
  • 14125
Re: changelog of trunk including comments / devtalk
« Reply #183 on: 19 / August / 2014, 16:37:56 »
... the old name implied that the function would enable faster USB communications. Or even USB2.0 or USB3.0. ...
Hmm... This is far-fetched. But it is an argument.
Aside from that confusion, my feeling was that the original name was very uninformative. I thought the new one was better, but perhaps for normal users it isn't.

Quote
And what tells us the new name? I can already see the questions. What is hp? Which timer?
What do you think about: fast_usb_power_detection()
That may be better

Quote
set_mf():
2000+ downloads is a big argument (respect!!!). On the other hand CHDK 1.3 is the developer branch. The question is, what is more important?
I would like to standardize on booleans for this kind of thing, but we are already pretty inconsistent.

I worry about the last two since they weren't in really wide use yet. So I'm not sure...
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: changelog of trunk including comments / devtalk
« Reply #184 on: 21 / August / 2014, 17:18:23 »
My "UI properties" patch includes some additions that I'm uncertain about. So, I'm asking here before committing it.
1) I'm introducing a new macro that enables the sigfinder to output values that are not found directly in the firmware. The stubs files can't contain #defines, so I figured the only way is this:
#define FW_CONST(n, m) \
    .globl n; n: ;\
    .long m


My main problem is the name (I don't like it), could I name the macro "VAR" or "CONST" instead? I'm not sure if these kind of words can/should be used as macro name.

2) I'm currently using "CmpUIPrp" as the name of the new debug shortcut action ("CmpUIPr" what's actually visible). Does anyone have a better idea for this piece of text?

*

Offline reyalp

  • ******
  • 14125
Re: changelog of trunk including comments / devtalk
« Reply #185 on: 21 / August / 2014, 23:00:17 »
My main problem is the name (I don't like it), could I name the macro "VAR" or "CONST" instead? I'm not sure if these kind of words can/should be used as macro name.
how about DEF_CONST to go with the existing DEF? I'd also be ok with DEFCONTS, CONSTDEF etc.

Quote
2) I'm currently using "CmpUIPrp" as the name of the new debug shortcut action ("CmpUIPr" what's actually visible). Does anyone have a better idea for this piece of text?
"CmpUPrp" ? or just CmpUIP"
with that much space you aren't going get much better.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: changelog of trunk including comments / devtalk
« Reply #186 on: 22 / August / 2014, 13:18:58 »
My main problem is the name (I don't like it), could I name the macro "VAR" or "CONST" instead? I'm not sure if these kind of words can/should be used as macro name.
how about DEF_CONST to go with the existing DEF? I'd also be ok with DEFCONTS, CONSTDEF etc.
Quote
2) I'm currently using "CmpUIPrp" as the name of the new debug shortcut action ("CmpUIPr" what's actually visible). Does anyone have a better idea for this piece of text?
"CmpUPrp" ? or just CmpUIP"
with that much space you aren't going get much better.
Thanks, I checked this in with 'DEF_CONST' and 'CmpUIP': https://www.assembla.com/code/chdk/subversion/commit/3590

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: changelog of trunk including comments / devtalk
« Reply #187 on: 05 / September / 2014, 05:44:43 »
There are still some open points.

- renaming of enable_highspeed_usb()
- return values ​​of set_mf()

A script function name should be understandable. But this renaming was a bad attempt - sorry.

Despite the many downloads I would plead for a change of the return values. set_focus() also returns a boolean value. That's quite a mess when two related functions different principles represented.

msl
CHDK-DE:  CHDK-DE links

Re: changelog of trunk including comments / devtalk
« Reply #188 on: 05 / September / 2014, 08:06:23 »
Despite the many downloads I would plead for a change of the return values. set_focus() also returns a boolean value. That's quite a mess when two related functions different principles represented.
Are there other Lua functions that return 0/1 rather than false/true ?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: changelog of trunk including comments / devtalk
« Reply #189 on: 05 / September / 2014, 15:14:03 »
We have four types of return values ​​in set _ * - functions

  • without return values
    e.g.
    set_aflock
    set_aelock
  • get/set principle
    most of the script functions
  • number
    e.g.
    get_focus_state
    get_focus_ok
  • boolean
    e.g.
    get_flash_ready
    enable_remote_hp_timer

I think this needs a standardized regulation.

msl
CHDK-DE:  CHDK-DE links

 

Related Topics


SimplePortal © 2008-2014, SimplePortal