Commit Graph

514 Commits

Author SHA1 Message Date
BzKevin
58ca70c511 Tab to Space 2019-03-05 09:11:28 -05:00
BzKevin
ee59540648 Refactored
I was having issue wit this script periodically. The original version of this was real a hack-job of Holger Klemms original. This new version utilizes tables in a manner that I hope will make the code easier to follow and understand, but also allows for certain functions to be re-used throughout (and potentially in different scripts as well). In general:

Each program (align image stack, enfuse, exiftool) how has a table that contains information about that program, this includes a sub-table that contains argument data for the program.
There is a GUI table which contains all gui elements. Those elements are split into sub-tables within GUI based on what aspect of the scrpt behavior they relate to (AIS, ENF, Target File, Presets, etc...)
These two structures (and the similarities between them) have allows me to create loops which populate the arguments from the GUI and vice-versa, this is all done through an intermediary preference, the "active" preference. 
Whenever a change to a GUI element occurs the associated member of hte active preference is updated. then when it becomes time to build an argument string for a program command the active preference is read from and the value contained within is used. This works fine for all GUI elements that have a "changed" or "clicked" callback, as they can remain up-to-date real time. Sliders and Entry boxes do not have this, so at a certain point withing the script the GUI values are read directly for these elements and written to the associated active preference field.

As you will see about 50% of this code is simply building all the GUI elements and making sure that the initialization value for that element is valid (via the InRange() function). The actual heart of the program and it's functions really only takes up about 300 lines (starting at 180 and going through 476). That is broken down into multiple fairly concise functions. Hopefully this makes maintenance, feature enhancement, and troubleshooting much easier in the future.

I also made a few UI tweaks. This script use to create such a massive list of GUI elements that it was a nuisance when actually using it. They are now grouped into three containers for AIS options, Enfuse options, and target options. Only one of these options containers is displayed at a time. Additionally, I removed all the registered preferences I had before, so now I only register 3 options to enable user to point towards the program binaries.
2019-03-04 13:13:49 -05:00
wpferguson
cc4e7197ba Merge pull request #156 from wpferguson/readme_update
Update README.md
2019-01-14 23:56:00 -05:00
Bill Ferguson
fc5677e7b5 Added enfusedAdvanced and gen_i18n_mo descriptions 2019-01-14 23:53:26 -05:00
wpferguson
19542c1640 Merge pull request #148 from wpferguson/translation_tool
Translation tool
2019-01-14 23:33:52 -05:00
Bill Ferguson
68b5acc154 Updated comments to reflect name change 2019-01-12 22:27:06 -05:00
Bill Ferguson
5c2c9e2a8f Changed name to gen_18n_mo to further clarify what the program does. 2019-01-12 22:21:48 -05:00
wpferguson
0376e11544 Merge pull request #130 from BzKevin/master
Add enfuseAdvanced
2019-01-12 22:05:12 -05:00
supertobi
6d910ffb60 Merge pull request #154 from Hofer-Julian/patch-1
Typo
2019-01-11 15:17:25 +01:00
Hofer-Julian
e3d755fb9a Typo 2019-01-07 13:10:06 +01:00
wpferguson
b7ff1cd579 Merge pull request #151 from wpferguson/fix_script_manager_activate_script
Fix script manager script activation bug
2018-11-21 21:31:34 -05:00
Bill Ferguson
0550f4e28a Fixed bug where the wrong script could be activated, because the script to activate was found by string matching. Replaced string match with value of category selector and script name to avoid any ambiguity. 2018-11-21 21:24:28 -05:00
wpferguson
3456dc90d8 Merge pull request #150 from wpferguson/hugin_windows_fix
Hugin windows fix
2018-11-19 16:28:27 -05:00
Bill Ferguson
8e006cf853 Changed windows path quoting to double quotes instead of single. Changed dt.control.execute to dtsys.external_command to handle the windows quoted arguments. 2018-11-19 15:56:24 -05:00
supertobi
0e36af38d8 Merge pull request #146 from simon04/i18n-update
Update German translation of hugin and kml_export
2018-11-07 09:52:36 +01:00
supertobi
e10f3e2285 Merge pull request #149 from schwerdf/master
'LabelsToTags' is standalone.
2018-11-03 10:48:26 +01:00
August Schwerdfeger
31f1614679 'LabelsToTags' is standalone. 2018-11-02 20:47:09 -05:00
Bill Ferguson
80e7eca064 Added tool to compile source translation files and place the results in the correct locale directory 2018-09-26 23:59:42 -04:00
BzKevin
adb85e349a Update enfuseAdvanced.lua
Fixing accidental "invalid escape" at line 133
2018-09-18 11:54:24 -04:00
BzKevin
52a241c1ec Delete enfuse_pro_2
enfuse_pro_2 is now enfuseAdvanced
2018-09-18 10:55:23 -04:00
BzKevin
d092016729 Add enfuseAdvanced
enfuseAdvanced replaces what was previously known as enfuse_pro_2. This incorporates changes requested by wpferguson on previous versions.
2018-09-18 10:54:16 -04:00
Simon Legner
2d01f801bc Update German translation of hugin and kml_export 2018-09-18 10:25:34 +02:00
wpferguson
6e15373ce9 Merge pull request #145 from wpferguson/rename_tags_speed_up
rename-tags speed up
2018-09-13 10:55:04 -04:00
Bill Ferguson
e95ed5ad2b Found a way to access only the images tagged with the old tag instead of searching through all the images in the database. This results in a huge decrease in execution speed, depending on the size of the database. 2018-09-12 16:41:42 -04:00
wpferguson
dc9324f322 Merge pull request #144 from wpferguson/script_manager_dash_bug
script manager dash bug
2018-08-26 00:44:03 -04:00
Bill Ferguson
e7adf8cfb2 string.match on a filename with a - resulted in a failed match. Added a check for the dash and escaped it. 2018-08-26 00:39:58 -04:00
wpferguson
5f7c49ca85 Merge pull request #143 from wpferguson/script_manager_win_bug
fixed buy on windows where preferences were not getting saved
2018-08-23 13:10:58 -04:00
Bill Ferguson
f724335b91 fixed buy on windows where preferences wee not getting saved 2018-08-23 12:50:50 -04:00
wpferguson
3a5dfbc842 Merge pull request #135 from wpferguson/image_stack
Image Stacking
2018-08-23 11:45:16 -04:00
Bill Ferguson
380a1b66e6 Added path separator constant and used it where necessary. Added comment to attribute copy 2018-08-22 19:33:11 -04:00
wpferguson
c6cccf2d93 Merge pull request #141 from wpferguson/revert_script_manager_and
reverted change from nested if statements to a multiple and statement
2018-08-20 23:50:36 -04:00
Bill Ferguson
0858a19138 reverted change from nested if statements to a multiple and statement because it didn't work 2018-08-20 23:47:30 -04:00
wpferguson
f42199aec0 Merge pull request #140 from wpferguson/script_manager_typo
fixed typo in preferences
2018-08-20 23:28:04 -04:00
Bill Ferguson
8d746427a6 fixed typo in preferences 2018-08-20 23:24:30 -04:00
wpferguson
3c9b2b90d4 Merge pull request #139 from wpferguson/script_manager
darktable script management interface
2018-08-20 21:29:32 -04:00
Bill Ferguson
abc959a814 enabled link to lua-scripts version 2018-08-20 21:28:54 -04:00
wpferguson
c71c289547 Merge pull request #138 from wpferguson/executable_manager
Manage external executables used by the lua scripts
2018-08-20 21:22:47 -04:00
Bill Ferguson
02bb942abd Cleaned up the code and incorporated Tobias Jakob's comments 2018-08-20 21:12:07 -04:00
Bill Ferguson
a37c33ec36 Fixed enable preference not saved 2018-08-19 12:30:45 -04:00
Bill Ferguson
0e4926426f Added error feedback when script doesn't load 2018-08-19 01:11:54 -04:00
Bill Ferguson
a309db8739 Created tools/script_manager.lua to provide an interface from darktable for managing the lua scripts. Updated README.md to reflect the added script. 2018-08-18 15:04:43 -04:00
Bill Ferguson
1a998581ef Created tools/executable_manager.lua for managing external executables used by the lua scripts. Updated the README to reflect the new script. 2018-08-17 19:30:43 -04:00
wpferguson
f49b951331 Merge pull request #137 from wpferguson/enfuse_version_aware
Alter enfuse arguments based on version
2018-08-15 11:25:05 -04:00
Bill Ferguson
26e16ffeda Added a version check to modify the arguments based on the version of enfuse. Enfuse 4.2 no longer accepts the exposure-mu argument. The closest function is exposure-optimum. For versions of enfuse less than 4.2 exposure-mu is used. For versions of enfuse greater than 4.2, exposure-optimum is used. 2018-08-15 00:30:18 -04:00
Bill Ferguson
9e4a72e098 Creeated image_stack.lua based on Pat David's blog entry, https://patdavid.net/2013/05/noise-removal-in-photos-with-median_6.html. Updated README.md to reflect the new script. 2018-08-08 22:41:25 -04:00
wpferguson
a7d053648a Merge pull request #134 from wpferguson/multi_os_example
Multiple OS Example
2018-08-08 21:24:23 -04:00
Bill Ferguson
61a55f71f5 Created a cross platform script that calls an external executable. It also performs a service that some users might find useful, extracting the embedded jpeg image from a raw file, then importing and grouping it with the raw. Updated README.md to reflect the new file 2018-08-07 22:08:09 -04:00
wpferguson
9979d4abda Merge pull request #132 from wpferguson/windows_work_arounds
Cross platform external command capability
2018-08-07 11:02:04 -04:00
Bill Ferguson
5a2af47eda Removed unneeded require for yield, since it now in lib/dtutils.system 2018-08-07 11:00:16 -04:00
wpferguson
eab6b99155 Merge pull request #133 from sjjh/patch-1
corrected "dt" to "darktable" in line 63 of cr2hdr
2018-08-03 22:28:31 -04:00