Hey dmilligan,
thanks a lot for your tip. I optimized the script now. It is working perfectly:
The only thing which I am struggling with is the menu. I tryed it but so far I have no clue how this is working. By using my approach it is not relevant what arrow key is pressed on the camera, the menu selection every time selects the next value like in a circle. This is working fine, but it would be much nicer if I could use the arrow key to directly select the entry.
A little example:
Off
> On
Only 160s
If I want to select Off I have to press a key twice, because currently the state machine is: Off > On > Only 160s > Off > On > ... and so on.
It would be much nicer if I could use the arrow up key to directly select "Off". But I do not know how to implement this. Does this have to be a Submenu? Or could I also get it to work without a submenu?
thanks a lot for your tip. I optimized the script now. It is working perfectly:
Code Select
-- Bad ISO Skipper
-- This script allows to skip certain ISO values when selecting ISO via the Canon menu or dials
-- Developed and tested for Canon 6D 1.1.6
require("config")
-- ISO values for RAW/VALUE/APEX (Canon 6D 1.1.6)
--
-- RAW VALUE APEX
-- ISO Automatic 0 0 -40
-- ISO L 64 50 40
-- ISO 100 72 100 50
-- ISO 125 75 125 53
-- ISO 160 77 160 56
-- ISO 200 80 200 60
-- ISO 250 83 250 63
-- ISO 320 85 320 66
-- ISO 400 88 400 70
-- ISO 500 91 500 73
-- ISO 640 93 640 76
-- ISO 800 96 800 80
-- ISO 1000 99 1000 83
-- ISO 1250 101 1250 86
-- ISO 1600 104 1600 90
-- ISO 2000 107 2000 93
-- ISO 2500 109 2500 96
-- ISO 3200 112 3200 100
-- ISO 4000 115 4000 103
-- ISO 5000 117 5000 106
-- ISO 6400 120 6400 110
-- ISO 8000 123 8000 113
-- ISO 10000 125 10000 116
-- ISO 12800 128 12800 120
-- ISO 16000 131 16000 123
-- ISO 20000 133 20000 126
-- ISO 25600 136 25600 130
-- ISO H1 144 51200 140
-- ISO H2 152 102000 150
--will be set as the prop handler for property.ISO, when enabled
local old_value = camera.iso.raw
local new_value = camera.iso.raw
local ISO_step_up={}
local ISO_to_skip={}
local ISO_step_dn={}
function iso_mode_handler(self,value)
for i,v in ipairs(ISO_to_skip) do
if (value == old_value) then
break
elseif (value == v and value > old_value) then
camera.iso.raw = ISO_step_up[i]
break
elseif (value == v and value < old_value) then
camera.iso.raw = ISO_step_dn[i]
break
end
end
old_value = value
end
skipbadiso_menu = menu.new
{
parent = "Expo",
name = "Bad ISO skipping",
help = "Skips bad ISO values",
choices = {"OFF","ON","Only 160s"},
value = "OFF"
}
function skipbadiso_menu:select(delta)
if self.value == "OFF" then self.value = "ON"
elseif self.value == "ON" then self.value = "Only 160s"
else self.value = "OFF" end
skipbadiso_update(self.value)
end
--start/stop the prop handlers to enable/disable this script's functionality
function skipbadiso_update(value)
if value == "ON" then
ISO_step_up={77,77,85,85,93,93,101,109,117} -- ISO values skipped to when increasing ISO
ISO_to_skip={72,75,80,83,88,91,99,107,115} -- ISO values to skip
ISO_step_dn={77,77,77,77,85,85,96,104,112} -- ISO values skipped to when decreasing ISO
property.ISO.handler = iso_mode_handler
elseif value == "Only 160s" then
ISO_step_up={77,77,85,85,93,93,101,101,109,109,117,117,125,125,125}
ISO_to_skip={72,75,80,83,88,91,96,99,104,107,112,115,120,123,128}
ISO_step_dn={77,77,77,77,85,85,93,93,101,101,109,109,117,117,125}
property.ISO.handler = iso_mode_handler
else
property.ISO.handler = nil
end
end
config.create_from_menu(skipbadiso_menu)
skipbadiso_update(skipbadiso_menu.value)
The only thing which I am struggling with is the menu. I tryed it but so far I have no clue how this is working. By using my approach it is not relevant what arrow key is pressed on the camera, the menu selection every time selects the next value like in a circle. This is working fine, but it would be much nicer if I could use the arrow key to directly select the entry.
A little example:
Off
> On
Only 160s
If I want to select Off I have to press a key twice, because currently the state machine is: Off > On > Only 160s > Off > On > ... and so on.
It would be much nicer if I could use the arrow up key to directly select "Off". But I do not know how to implement this. Does this have to be a Submenu? Or could I also get it to work without a submenu?