This instance will be upgraded to Heptapod 0.19.0 (final) on 2021-01-20 at 14:00 UTC+1

Commit 707c40e3 authored by Alessandro Profiti's avatar Alessandro Profiti

lens.lua: updated line comments to latest changes

--HG--
branch : manual_lens_info
parent d79e65dbc2aa
......@@ -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-65535mm"
-- Adapter with AF confirm Chip -> name is usually reported as "1-65535mm" and focal length as "50mm"
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.cfg
-- Restore last Aperture and Focal Length used from lens.lcf
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.cfg. Note: ML will save automatically new .cfg
-- Reset selection in lens.lcf. Note: ML will save automatically new .lcf
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.cfg is automatically saved by ML after closing ML menu
-- Note: Content of lens.lcf 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.cfg
-- Update integer value to be saved in lens.lcf
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 .cfg after camera Power On/Wake Up",
help = "Restore lens info from lens.lcf 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 .cfg or not
-- Check whenever need to load values from .lcf or not
if copy == 1 then
-- Assign Aperture and Focal Length from .cfg
-- Assign Aperture and Focal Length from .lcf
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.cfg base on "Manual Lens" menu field
-- Create lens.lcf base on "Manual Lens" menu field
lens_config = config.create_from_menu(lens_menu)
autoload_config = config.create_from_menu(autoload_menu)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment