Author Topic: PicoC scripting API  (Read 51571 times)

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: PicoC scripting API
« Reply #50 on: April 04, 2013, 12:08:32 AM »

sorry :)

engardeknave

  • Senior
  • ****
  • Posts: 339
Re: PicoC scripting API
« Reply #51 on: April 07, 2013, 07:43:10 AM »
I've been waiting for some sort of update to the API. Has anything been added?

I'm especially interested in getting the location of the focus box in LV.

Would it be possible to make a function that "clicks" specific Canon menus?

sfmurph

  • New to the forum
  • *
  • Posts: 8
Scripting the programming of adapter chips
« Reply #52 on: May 07, 2013, 11:31:56 PM »
So I'd like to script the programming of the Optix focus conformation chip I have. I bet folks with the Dandelion chip would also like to. The main things I'd need to do are to check that the camera is in the right mode (M or A, I believe), activate the DOF Preview button and adjust the aperture setting (for Optix) plus set exposure time to 11 seconds (or more) and release the shutter (for Dandelion).

From the API listing, I don't see a way to do the DOF Preview, which would be required for the Optix chips (which I have). There's no "key" for that. My camera doesn't have that key, so I'd need a direct api to activate the DPF preview. The rest do seem available.

Would this be possible?

Here are the Optix programming instructions.
And the Dandelion programming instructions.

Francis

  • Hero Member
  • *****
  • Posts: 818
Re: PicoC scripting API
« Reply #53 on: May 07, 2013, 11:43:30 PM »
There is work in progress to change the scripting language to TCC for a number of performance issues. It is unlikely that the PicoC API will be updated. Unsure if the DOF button press can be emulated but probably. Sticky DOF seems like it would work like that.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12173
  • Maintenance mode
Re: PicoC scripting API
« Reply #54 on: May 07, 2013, 11:45:31 PM »
You can emulate a DOF press with dofp_set, look in tweaks.c.

To add it to PicoC, look in library_ml.c. Half-shutter and AF_ON are implemented in a similar way.

arossbach

  • New to the forum
  • *
  • Posts: 2
  • 60D
Re: PicoC scripting API
« Reply #55 on: May 23, 2013, 02:20:04 PM »
When will PicoC be available to use?

I'd like to get the value from a custom WB with get_kelvin(). Is there another way to do this without PicoC?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12173
  • Maintenance mode
Re: PicoC scripting API
« Reply #56 on: May 23, 2013, 02:24:28 PM »
Grab the ufraw source code and port the RGB_to_Temperature. Don't be afraid of matrix math.

arossbach

  • New to the forum
  • *
  • Posts: 2
  • 60D
Re: PicoC scripting API
« Reply #57 on: May 24, 2013, 01:34:39 AM »
I'm not a programmer but can try it :)

I had a first look and imported the code from ufraw to ML. It compiled successfully.
The parameters from WBGain_* have to be converted, but I cannot see any porting issues at the moment.

I have some problems to link the binary on my system (cygwin), so I can't test it and measure the performance.

palark93

  • New to the forum
  • *
  • Posts: 4
Re: PicoC scripting API
« Reply #58 on: May 25, 2013, 03:26:07 AM »
cant seem to get this to work right, every time i try it it just takes pics at 1/125
uuuggghhhh >:(

Code: [Select]
// Custom bracket sequence

console_hide();set_aperture(22);
set_iso(100);
set_shutter(1./2000);
takepic();
set_shutter(1./1000);
takepic();
set_shutter(1./500);
takepic();
set_shutter(1./250);
takepic();
set_shutter(1./125);
takepic();
etc.....

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: PicoC scripting API
« Reply #59 on: May 25, 2013, 03:38:49 PM »
cant seem to get this to work right, every time i try it it just takes pics at 1/125
uuuggghhhh >:(

Code: [Select]
// Custom bracket sequence

console_hide();set_aperture(22);
set_iso(100);
set_shutter(1./2000);
takepic();
set_shutter(1./1000);
takepic();
set_shutter(1./500);
takepic();
set_shutter(1./250);
takepic();
set_shutter(1./125);
takepic();
etc.....

Make sure you are not using a compile where the PicoC has been disabled.  All RAW video compiles do not have PicoC enable.  But.. I know nothing else about PicoC
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

sfmurph

  • New to the forum
  • *
  • Posts: 8
Re: PicoC scripting API
« Reply #60 on: May 28, 2013, 06:06:42 AM »
So I tried adding PicoC functions so I could "press" the DOF preview on my T3 (that doesn't have a hardware DOF preview). This compiled fine previously, but I've been having other issues with my compiled binaries. I'm on a Mac with the yagarto compiler. It doesn't seem like it's my problem, but it makes it hard to figure out what's going on.

Here's my diff to

$ hg diff library_ml.c
diff -r 7fdfc08ac9ad picoc/library_ml.c
--- a/picoc/library_ml.c   Mon May 27 23:01:29 2013 +0300
+++ b/picoc/library_ml.c   Mon May 27 20:59:19 2013 -0700
@@ -6,6 +6,7 @@
 #define UNPRESS -10000 // generic unpress code
 #define NO_KEY -1
 #define AF_ON 12345
+#define DOF_PREVIEW 23456  // making this up
 
 static char camera_model[32];
 static char firmware_version[32];
@@ -139,6 +140,13 @@
         case BGMT_PRESS_FULLSHUTTER:
             SW2(1,50);
             return;
+        case DOF_PREVIEW:
+        {
+            int x = 1;
+            prop_request_change(PROP_DOF_PREVIEW_MAYBE, &x, 2);
+            msleep(50);
+            return;
+        }
         default:
             if (btn >= 0) fake_simple_button(btn);
     }
@@ -200,6 +208,13 @@
             unpress = BGMT_UNPRESS_DOWN;
             break;
         #endif
+        case DOF_PREVIEW:
+        {
+            int x = 0;
+            prop_request_change(PROP_DOF_PREVIEW_MAYBE, &x, 2);
+            msleep(50);
+            return;
+        }
         
         default:
             // this button does not have an unpress code
@@ -1347,6 +1362,7 @@
     CONST0(UNPRESS)
     CONST0(NO_KEY)
     CONST0(AF_ON)
+    CONST0(DOF_PREVIEW)
     CONST0(HALFSHUTTER_PRESSED)
 
     /** Color codes */

trsaunders

  • New to the forum
  • *
  • Posts: 41
Re: PicoC scripting API
« Reply #61 on: June 06, 2013, 05:05:56 PM »
Is there a way to set AF focus at infinity / nearest?

I'm trying to write a script that takes several photos at different AFMA values, to load into Reikan. Before it takes each photo I want to set focus to infinity.
50D, 5D3

marci

  • New to the forum
  • *
  • Posts: 2
Re: PicoC scripting API
« Reply #62 on: June 09, 2013, 04:47:43 PM »
set_flash(0)/set_flash(1)  does not work en 5DMKII with canon speedlite 580 EX. the flash fire each time.
It seems that this function works only for canon with build-in flash.

Is there another solution for 5DMKII ?

Rotate the mode dial to no flash mode! :)

marci

  • New to the forum
  • *
  • Posts: 2
Re: PicoC scripting API
« Reply #63 on: June 09, 2013, 04:57:48 PM »
Would anyone mind extending beep() to beep(int msecs, int frequency)? ;)

I have added the beep_custom(int duration, int frequency, int wait) function! If wait is 1, it will wait until the beep has ended. If not, the script continues.
It will be in the jun10 nightly :)

pravdomil

  • Member
  • ***
  • Posts: 166
Re: PicoC scripting API
« Reply #64 on: September 30, 2013, 12:18:04 AM »
A1ex could you please send your script, that generates this API from comments? I would like to make ML modules API.

nitrosito

  • New to the forum
  • *
  • Posts: 13
Re: PicoC scripting API
« Reply #65 on: December 15, 2014, 06:36:55 PM »
I have a question... (Sorry for my english, i'm spanish)

¿Any guide or tutorial to write modules/script for ML?

¿How we test the script? Only in the camera?

Thanks and regards