remaining video,overrides-customizations,no-raw@video,just _random_ stuff :D - page 3 - General Discussion and Assistance - CHDK Forum

remaining video,overrides-customizations,no-raw@video,just _random_ stuff :D

  • 44 Replies
  • 28072 Views
*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Advertisements
note to self: implement ubasic command to find out type of camera OS (dryos vs vxworks).
reason: with this you can create scripts that really work on all platforms without modifying propcases before.
if cam_os == 0 then set_propcase(100,666) else set_propcase (105,666)

i suck at ubasic, but the message should have come across :D

reminder: i think i read somewhere that there are dryOs cams that use vxworks propcases, in this case this would be a little tougher.
« Last Edit: 16 / April / 2008, 14:06:54 by PhyrePhoX »

*

Offline fudgey

  • *****
  • 1705
  • a570is
IMO the ideal goal should be to provide functions for each useful feature that may now need to be called using a propcase and leave set/get_prop for newly found things and stuff nobody has found useful yet.

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
i dont know if i fully understand your statement  ???
well to be honest i dont like the wikias thousand scripts that are compatible only with particular series' only. if these checks that we currently do in C can be added to ubasic this would imho add a great deal of the idea of "universal" scripts. this way you could check for cam_has_nd or cam_has_diaphragm and cam_has_8_or_128_zoom_steps.
no matter what, adding these functions is a matter of minutes of coding.
i guess you are thinking about the impact of this "bloated" set of ubasic commands on the speed of execution of scripts. of course one has to do extensive benchmarks. on the other hand - each command is executed with a delay of 10ms anyways, so i *assume* the bigger code will have no impact. what scripts do we have that need the exra MILLIseconds? i only know of the MD scripts. this can easily be benchmarked :)
Thanks for your input :)
if it ever turns out that in ubasic there isnt enough space left for new and "and more useful" commands we have to reconsider my set of introduced commands - of course!
maybe one of the devs can shed some light on this issue - how will execution time be impacted by number of available commands? is there a limit? like i said, we'd probably have to run some extensive benchmarks :)
« Last Edit: 16 / April / 2008, 15:16:23 by PhyrePhoX »

*

Offline fudgey

  • *****
  • 1705
  • a570is
Sorry, I wasn't clear enough...

I just meant that (for ubasic scripting) the propcases are probably the largest group of differences between cameras we now have and having a generic and descriptive name (or command) for each useful one would be awesome. Having a way to check if the camera actually supports a feature that a script uses would be even more awesome!

Just being able to find out which camera model (and Digic version and OS) the script is running would indeed be useful, but to use that information in writing widely compatible scripts would need as much knowledge of each camera as is currently needed to write a separate script for each camera. I know I don't know much about the quirks of other models but my own and this is probably true for many others as well.

IHaving a way to execute more than one command in that 10 ms step would be great as well for doing any of these checks on the same ubasic line with the possibly offending command without any additional delay, but also for doing things like input parameter validity checks in one line ... I thought I had read of a way to do this but couldn't find it so maybe I've been dreaming :D).


Deleted
« Last Edit: 22 / April / 2008, 16:32:11 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 PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
yeah, the displaying code has to be tweaked, you're right. it's just a quick hack. though i dont understand why there is this uncleanly landing on whole stops.

anyways, me so stupid: up to now i never tested my build on my a620,well, turns out i should have done this: of course the "fast ev" switch is a b1tch on these kinda "cheap" models, as the up & down buttons set things like flash & macro :D so in order to raise ev correction you now cycle through the flash states :D come on betatesters, you could have reported this :p

however, about the propcases commands: yes, having universal commands instead of the non-descriptive propcases would be a good step towars userfriendlyness & noob-safety.
for example a ubasic command like get_ready_state would be "translated" in C via
#if CAM!=DRYOS etc. will do that.

Is there a page telling me which digicIII cams are still using digicII propcases?

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
found out there is already such a table:
in platform.h
Quote
#if CAM_PROPSET == 2
 #define PROPCASE_DRIVE_MODE               102
 #define PROPCASE_FOCUS_MODE               133
 #define PROPCASE_FLASH_MODE                  143
 #define PROPCASE_USER_TV                   264
 #define PROPCASE_TV                       262
 #define PROPCASE_USER_AV                     26
 #define PROPCASE_AV                        23
 #define PROPCASE_MIN_AV                      25
 #define PROPCASE_SV                        247
 #define PROPCASE_DELTA_SV                  79
 #define PROPCASE_SV_MARKET                 246
 #define PROPCASE_BV                        34
 #define PROPCASE_SUBJECT_DIST1             245
 #define PROPCASE_SUBJECT_DIST2             65
 #define PROPCASE_ISO_MODE                   149
 #define PROPCASE_SHOOTING                  206
 #define PROPCASE_IS_FLASH_READY               208
 #define PROPCASE_OVEREXPOSURE                103
 #define PROPCASE_SHOOTING_MODE               49
 #define PROPCASE_IS_MODE                   145

#define PROPCASE_EV_CORRECTION_1           107
 #define PROPCASE_EV_CORRECTION_2           207
 #define PROPCASE_ORIENTATION_SENSOR           219

#elif CAM_PROPSET == 1
 #define PROPCASE_DRIVE_MODE                6
 #define PROPCASE_FOCUS_MODE                12
 #define PROPCASE_FLASH_MODE                   16

// need corresponding values for propset2!!!
// #define PROPCASE_FLASH_ADJUST_MODE          15
// #define PROPCASE_FLASH_CORRECTION               28     
// #define PROPCASE_FLASH_MANUAL_OUTPUT    29
//  #define PROPCASE_FOCUS_OK           67
// also need max. zoom steps for each cam

 #define PROPCASE_USER_TV                   40
 #define PROPCASE_TV                       69
 #define PROPCASE_USER_AV                   39
 #define PROPCASE_AV                        68
 #define PROPCASE_MIN_AV                    77
 #define PROPCASE_SV                        73
 #define PROPCASE_DELTA_SV                  70
 #define PROPCASE_SV_MARKET                 72
 #define PROPCASE_BV                        71
 #define PROPCASE_ISO_MODE                  21
 #define PROPCASE_SUBJECT_DIST1             65
 #define PROPCASE_SUBJECT_DIST2             66
 #define PROPCASE_SHOOTING                    205
 #define PROPCASE_IS_FLASH_READY               221
 #define PROPCASE_OVEREXPOSURE                76
 #define PROPCASE_SHOOTING_MODE               0
 #define PROPCASE_IS_MODE                    229

#define PROPCASE_EV_CORRECTION_1           25
 #define PROPCASE_EV_CORRECTION_2           26
 #define PROPCASE_ORIENTATION_SENSOR           37
 

#else
 #error unknown camera processor
#endif
the ones marked red were added by me. i'm missing a few propcase on the digicIII side, maybe y'all can help me out.
anyways, i'm compiling a special build right now that has the following new ubasic commands:
Code: [Select]
get_focus_mode
get_drive_mode
get_flash_mode
get_ready
get_flash_ready
get_IS_mode
set_ev
get_ev
get_orientation_sensor
an example script (not really functional, but shows how to use the commands):
Code: (freebasic) [Select]
rem Author: phyrephox
rem should work on all cameras?
@title test0r
print "-------------"
get_focus_mode a
print "get_focus_mode "a
sleep 2000
print "-------------"
get_drive_mode a
print "get_drive_mode "a
sleep 2000
print "-------------"
get_flash_mode c
print "get_flash_mode "c
sleep 2000
print "-------------"
get_ready d
print "get_ready "d
sleep 2000
print "-------------"
get_flash_ready e
print "get_flash_ready "e
sleep 2000
print "-------------"
get_IS_mode f
print "get_IS_mode "f
sleep 2000
print "-------------"
g=320
set_ev g
print "set_ev "
sleep 2000
print "-------------"
get_ev h
print "get_ev "h
sleep 2000
print "-------------"
get_orientation_sensor i
print "get_orientation_sensor "i
sleep 2000
print "-------------"
end
attached diff (sorry, not only diff of ubasic changes but my whole diff, look in the tokenizer.* & ubasic.* files), example script and s3is build. zshare link to all builds will follow.

Important:[/color] this experimental build is likely to break compatibility with your other scripts - reason: in the ubasic parser (in c code) i have to specify an order in which the commands will be parsed.i didnt have the time and not really the energy to do that properly this time. i HAD to do it for get_focus_mode because get_focus is an already defined command, so i had to move my new command in front of that. your scripts might as well run through without problems - please test. in any case, if your scripts do NOT run through, this can & will be fixed. you can play around with the new commands and if the "bloated" code does in any way effect speed of execution.

one other thing: i would like to also implement a command like "get_max_zoom", so that you can have camera independent zoom scripts (my a620 hast 8 zoom steps, the s3is 128) - would be useful for loops & checks.
if you have suggestions regarding other, better or whole different commands - tell me. i think a few of those new get_ statements can also be transformed to set_ statements.
oh and one other thing, i dont know if this actually will up the performance, but what about a command like that: "sleep_until_ready". cam would sleep until ready. that would rid you of a loop to detect if it is ready. imo.

regards, phox

link to binaries: zSHARE - r384_phyrephox_ubasic.zip

edit: reminder to self:
add shortcut to quickly disable grid. also in grid options: add new checkbox: "always load on startup".
reason: the "antitheft" grids will be much better appreciated among chdk folks if there is an option to quickly disable grids (when loaded) - and have an option to always display on boot.
by the way i havent found a setting which would allow the grid to be drawn in playback mode - i guess this was on purpose, maybe we should introduce that. edit: maybe use the current shortcut (that disabled OSD alltogether) to cycle through the grid states AND osd. the antitheft osd looks much better (and way more serious) withouth the other OSD icons.
next idea along those lines: setting of different grids. one "startup" grid (e.g. antitheft) that will be loaded in rec & playmode (of course configurable) and one "everyday script". with the shortcut you easily cycle through "on (first), on (second) and off". this *should* be easy to implement.
summing up:
a) alter fast ev switch shortcuts for cams like a620 (cams without the bunch of dedicated buttons)
b) sort the ubasic commands in order - make benchmarks
c) find new & improved ubasic commands
d) find out zoom_max for each cameramodel and define it in platform.h
e) play with the grid settings
f) look @sdm source and copy things like orientation sensor-driven menu

b,c & d will finally make way for "universal scripts". one script to rule them all *chuckle*
« Last Edit: 18 / April / 2008, 12:26:04 by PhyrePhoX »

Deleted
« Last Edit: 22 / April / 2008, 16:32:35 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 PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Old scripts wont be incompatible,but they *might* be in my first experimental build.if done properly,all old scripts will run fine - plus you can use the new commands,so that one day there wont be scripts for specific digics or even cam models.maybe you can test your fav scripts using my build?
edit: still like to find an "enhanced" camera features chart with information regarding zoom steps possible on each camera.
« Last Edit: 18 / April / 2008, 02:06:08 by PhyrePhoX »

Deleted
« Last Edit: 22 / April / 2008, 16:32:59 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

 

Related Topics