Magic Lantern Forum

Developing Magic Lantern => Scripting Corner => Scripting Q&A => Topic started by: Whr on April 28, 2021, 04:50:22 PM

Title: Is there any way to automatically load the ADTG config?
Post by: Whr on April 28, 2021, 04:50:22 PM
Is there a way to automatically load the ADTG config?For example, automatic loading is done through Lua scripts.Turning off the ADTG gain via ADTG registers to get the lowest ISO for shooting is very helpful for my older camera. It would be even better if it could configure it with a one-click load via a script. I hope to get some ideas to achieve purpose. Or has anyone tried?

(https://i.loli.net/2021/04/28/k6teUA9W2spLcKQ.jpg)

(https://i.loli.net/2021/04/28/qPCOktV145Fia8X.jpg)

(https://i.loli.net/2021/04/28/CxfLs9lZmbauhWw.jpg)

(https://i.loli.net/2021/04/28/JPInXiaeTWvRUZk.jpg)
Title: Re: Is there any way to automatically load the ADTG config?
Post by: a1ex on April 28, 2021, 08:05:16 PM
Other than recording the sequence of button presses required to achieve the config... probably not. The ADTG menus are generated dynamically, as the registers are discovered; internally, they are an array of menu entries with the same name. As such, they are not accessible from Lua's menu API (at least, not at the time of writing).

The easiest way is to hardcode the preset directly in adtg_gui.c. There are a few examples in the source code, including a 3K preset for 5D3.
Title: Re: Is there any way to automatically load the ADTG config?
Post by: Whr on April 30, 2021, 06:18:26 PM
Maybe I could have done the configuration a simpler way, simulating the keystrokes with the press(key) parameter in the Lua API.
Where can I find the table comparison for the camera keys?thx.
Even though it is a "blind" method, I think it is effective.
Title: Re: Is there any way to automatically load the ADTG config?
Post by: Whr on May 02, 2021, 01:59:08 PM
Quote from: a1ex on April 28, 2021, 08:05:16 PM
Other than recording the sequence of button presses required to achieve the config... probably not. The ADTG menus are generated dynamically, as the registers are discovered; internally, they are an array of menu entries with the same name. As such, they are not accessible from Lua's menu API (at least, not at the time of writing).

The easiest way is to hardcode the preset directly in adtg_gui.c. There are a few examples in the source code, including a 3K preset for 5D3.
(https://i.loli.net/2021/05/02/gXfzphxO4juclFn.jpg)
Hello a1ex, unfortunately I don't have the basis of C language.When I was studying the example of 5D3, I didn't know how to replace the register address of 5D3 with the address of 500D.Is there a solution?