-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeotag.menu.cmd
More file actions
194 lines (168 loc) · 5.51 KB
/
geotag.menu.cmd
File metadata and controls
194 lines (168 loc) · 5.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
@ECHO OFF
REM.-- Prepare the Command Processor
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION&::(Don't pollute the global environment with the following)
::**********************************************************************
SET $NAME=%~n0
SET $DESCRIPTION=Main menu for Geonames reverse geotagging
SET $AUTHOR=Erik Bachmann, ClicketyClick.dk [ErikBachmann@ClicketyClick.dk]
SET $SOURCE=%~f0
::@(#)NAME
::@(-) The name of the command or function, followed by a one-line description of what it does.
::@(#) %$NAME% -- %$DESCRIPTION%
::@(#)
::@(#)SYNOPSIS
::@(-) In the case of a command, a formal description of how to run it and what command line options it takes.
::@(-) For program functions, a list of the parameters the function takes and which header file contains its definition.
::@(-)
::@(#) %$NAME%
::@(#)
::@ (#)OPTIONS
::@(-) Flags, parameters, arguments (NOT the Monty Python way)
::@ (#) -h Help page
::@ (#)
::@ (#)
::@(#)DESCRIPTION
::@(-) A textual description of the functioning of the command or function.
::@(#) Names and paths to
::@(#) - Utilities
::@(#) - Data files
::@(#) - Data base files
::@(#) - Temporary files
::@(#)
::@ (#)EXAMPLES
::@(-) Some examples of common usage.
::@ (#)
::@ (#)
::@ (#)
::@ (#)EXIT STATUS
::@(-) Exit status / errorlevel is 0 if OK, otherwise 1+.
::@ (#)
::@ (#)ENVIRONMENT
::@(-) Variables affected
::@ (#)
::@ (#)
::@ (#)FILES,
::@(-) Files used, required, affected
::@ (#)
::@ (#)
::@ (#)BUGS / KNOWN PROBLEMS
::@(-) If any known
::@ (#)
::@ (#)
::@(#)REQUIRES
::@(-) Dependencies
::@ (#)
::@ (#)SEE ALSO
::@(-) A list of related commands or functions.
::@ (#)
::@ (#)
::@ (#)REFERENCE
::@(-) References to inspiration, clips and other documentation
::@ (#) Author:
::@ (#) Menu build on example from
::@ (#) URL: http://www.dostips.com/DtTipsMenu.php
::@ (#)
::@ (#)
::@(#)SOURCE
::@(-) Where to find this source
::@(#) %$Source%
::@(#)
::@(#)AUTHOR
::@(-) Who did what
::@(#) %$AUTHOR%
::*** HISTORY **********************************************************
::SET $VERSION=YYYY-MM-DD&SET $REVISION=hh:mm:ss&SET $COMMENT=Description/init
::SET $VERSION=2016-03-11&SET $REVISION=00:00:00&SET $COMMENT=Initial/ErikBachmann
SET $VERSION=2016-03-24&SET $REVISION=14:39:00&SET $COMMENT=Optimized/ErikBachmann
::**********************************************************************
::@(#){COPY}%$VERSION:~0,4% %$Author%
::**********************************************************************
::ENDLOCAL
:init
:: Get configuration
CALL "%~dp0\bin\geotag.config.cmd"
:menuLOOP
IF /I "q"=="%_sel%" GOTO :EOF
SET _SET=
SET _Alternatives=
CALL "%~dp0\bin\_Banner"
:: If database is not found - force an install menu
IF NOT EXIST "%$SQLite.db.geoname%" (
CALL "bin\geotag.menu.preinstall.cmd"
IF ERRORLEVEL 1 CALL "%~dp0\bin\_Banner" & GOTO :MainMenu
GOTO :menuLoop
)
:MainMenu
SET _Menu.Level=2
TITLE %$NAME% - Main menu (Database found)
FOR /F "tokens=1,2,* delims=_ " %%A in ('"FINDSTR /b /c:":menu_" "%~f0""') do ECHO: %%B %%C & CALL :LocalSet _Alternatives %%B
:menuSelect
ECHO:
::ECHO:Alt[%_Alternatives%]
CHOICE /C %_Alternatives% /M "Menu %_Menu.Level% : Make a choice: "
ECHO:
SET _To=%Errorlevel%
SET /A _From=%_to% - 1
SET _TO=1
CALL SET _Sel=%%_Alternatives:~%_from%,%_To%%%%
CALL:MENU_%_sel%
GOTO:menuLOOP
::---------------------------------------------------------------------
::Append the menu number to choice alternatives
:LocalSet Menu
SET _LocalSet=%2
IF "#"=="%_LocalSet%" GOTO :EOF
CALL SET %1=%%%1%%%_LocalSet%
GOTO :EOF
::---------------------------------------------------------------------
:: menu functions follow below here
::---------------------------------------------------------------------
:: Menu 1 - Main menu --------------------------------------------------
::menu_# Database found
:menu_
:menu_R Read ME
CALL notepad ReadMe.md
GOTO:EOF
::---------------------------------------------------------------------
:menu_M iMport picture from SD card
CALL BIN\pics\pics.cmd
TIMEOUT /T 15
GOTO:EOF
::---------------------------------------------------------------------
:menu_G Reverse Geotag new images
ECHO:Adding location to your images based on stored GPS info
TIMEOUT /T 5
CALL BIN\revGeotagAll.cmd
TIMEOUT /T 15
GOTO:EOF
::---------------------------------------------------------------------
:menu_X eXtended functions (Import, convert, Export)
CALL BIN\geotag.menu.extended.cmd
::TIMEOUT /T 5
GOTO:EOF
::---------------------------------------------------------------------
:menu_B > Build index from images
SET _Menu.Level=3
CALL BIN\geotag.menu.index.cmd
::TIMEOUT /T 5
GOTO :EOF
::---------------------------------------------------------------------
:menu_I > Install
SET _Menu.Level=3
CALL BIN\geotag.menu.install.cmd
::TIMEOUT /T 3
GOTO:EOF
::---------------------------------------------------------------------
:menu_D > Database menu
SET _Menu.Level=3
CALL BIN\geotag.menu.database.cmd
GOTO :EOF
::---------------------------------------------------------------------
:menu_
:menu_Q Quit
CALL "%~dp0\bin\_Banner"
ECHO :quit
::TIMEOUT /T 5
EXIT /b
::*** End of File *****************************************************