Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
This instance was upgraded to Heptapod 0.20.1 today
Open sidebar
magic-lantern
magic-lantern
Commits
7c4b8c433e47
Commit
707c40e3
authored
Dec 15, 2019
by
Alessandro Profiti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lens.lua: updated line comments to latest changes
--HG-- branch : manual_lens_info
parent
d79e65dbc2aa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
scripts/lens.lua
scripts/lens.lua
+12
-12
No files found.
scripts/lens.lua
View file @
7c4b8c43
...
...
@@ -117,7 +117,7 @@ lenses =
-- { name = "Kiron Macro 100mm f/2.8", focal_length = 105, manual_aperture = 2.8 },
}
-- f-number values. Mostly 1/2 Stop
-- f-number values. Mostly 1/2 Stop
increments
Fnumbers
=
{
"1.0"
,
"1.2"
,
"1.4"
,
"1.6"
,
"1.7"
,
"1.8"
,
"2"
,
"2.2"
,
"2.4"
,
"2.8"
,
"3.3"
,
"3.5"
,
"4"
,
"4.5"
,
"4.8"
,
"5"
,
"5.6"
,
"6.3"
,
"6.7"
,
"7.1"
,
"8"
,
"9.5"
,
"11"
,
"13"
,
"16"
,
"19"
,
"22"
,
"27"
,
"32"
}
selector_instance
=
selector
.
create
(
"Select Manual Lens"
,
lenses
,
function
(
l
)
return
l
.
name
end
,
600
)
...
...
@@ -136,7 +136,7 @@ xmp:add_property(xmp.lens_serial, function() return lens.serial end)
-- Helper function
function
is_manual_lens
()
-- Adapter with no AF Chip -> ID = 0
-- Adapter with AF confirm Chip -> name and focal length
"1-65535
mm"
-- Adapter with AF confirm Chip -> name
is usually reported as "1-65535mm"
and focal length
as "50
mm"
if
(
lens
.
id
==
0
or
lens
.
name
==
"1-65535mm"
or
lens
.
name
==
"(no lens)"
)
then
return
true
else
...
...
@@ -145,7 +145,7 @@ function is_manual_lens()
end
-- Function used to make sure all additional attributes are correct when switching lens,
-- as if the new lens doesn't have the same attribute declared in lenses table, old values don't get overwritten in lens_info resulting in wrong infos
-- Get called in update_lens() before setting value of the new lens
function
reset_lens_values
()
lens
.
focal_length
=
0
...
...
@@ -188,7 +188,7 @@ function restore_lens_values()
lens
[
k
]
=
v
end
update_aperture_focal_range
()
-- Restore last Aperture and Focal Length used from lens.cf
g
-- Restore last Aperture and Focal Length used from lens.
l
cf
lens
.
focal_length
=
lens_config
[
"Focal Length"
]
lens
.
manual_aperture
=
lens_config
[
"Aperture"
]
lens
.
exists
=
true
...
...
@@ -214,7 +214,7 @@ function property.LENS_NAME:handler(value)
selector_instance
.
cancel
=
true
end
xmp
:
stop
()
-- Reset selection in lens.cf
g
. Note: ML will save automatically new .cf
g
-- Reset selection in lens.
l
cf. Note: ML will save automatically new .
l
cf
lens_menu
.
submenu
[
"Lens"
].
value
=
0
-- Clear flag for next run
lensSelected
=
false
...
...
@@ -256,7 +256,7 @@ function select_lens()
end
-- Copy lens attribute from lenses and write to .xmp file
-- Note: Content of lens.cf
g
is automatically saved by ML after closing ML menu
-- Note: Content of lens.
l
cf is automatically saved by ML after closing ML menu
function
update_lens
()
-- Reset lens_info structure to get correct values in Lens Info Menu and Metadata
reset_lens_values
()
...
...
@@ -292,7 +292,7 @@ lens_menu = menu.new
task
.
create
(
select_lens
)
end
end
,
update
=
function
(
this
)
-- Update integer value to be saved in lens.cf
g
-- Update integer value to be saved in lens.
l
cf
this
.
value
=
selector_instance
.
index
end
,
rinfo
=
function
()
...
...
@@ -367,7 +367,7 @@ autoload_menu = menu.new
{
parent
=
"Lens Info Prefs"
,
name
=
"Autoload Lens"
,
help
=
"Restore lens
config from .
cf
g
after camera Power On/Wake Up"
,
help
=
"Restore lens
info from lens.l
cf after camera Power On/Wake Up"
,
choices
=
{
"OFF"
,
"ON"
}
}
...
...
@@ -397,7 +397,7 @@ function update_menu(copy)
-- Update field "Choices" in menu for aperture selection
if
lenses
[
index
].
f_values
then
-- Lens selected has custom aperture value. Use .f_values table from lens instead of generic f-numbers
-- Lens selected has custom aperture value. Use .f_values table from
selected
lens instead of generic f-numbers
lens_menu
.
submenu
[
"Aperture"
].
choices
=
lenses
[
index
].
f_values
else
local
tmp
=
{}
-- Used to save value from table.move
...
...
@@ -409,9 +409,9 @@ function update_menu(copy)
lens_menu
.
submenu
[
"Aperture"
].
choices
=
table.move
(
Fnumbers
,
start
,
size
,
1
,
tmp
)
end
-- Check whenever need to load values from .cf
g
or not
-- Check whenever need to load values from .
l
cf or not
if
copy
==
1
then
-- Assign Aperture and Focal Length from .cf
g
-- Assign Aperture and Focal Length from .
l
cf
lens_menu
.
submenu
[
"Focal Length"
].
value
=
lens_config
[
"Focal Length"
]
lens_menu
.
submenu
[
"Aperture"
].
value
=
lens_config
[
"Aperture"
]
else
...
...
@@ -421,7 +421,7 @@ function update_menu(copy)
end
end
-- Create lens.cf
g
base on "Manual Lens" menu field
-- Create lens.
l
cf base on "Manual Lens" menu field
lens_config
=
config
.
create_from_menu
(
lens_menu
)
autoload_config
=
config
.
create_from_menu
(
autoload_menu
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment