-
Notifications
You must be signed in to change notification settings - Fork 0
/
module.xml
402 lines (363 loc) · 13.9 KB
/
module.xml
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
<?xml version="1.0" ?>
<!--@POSTPROC: ./postproc.sh-->
<module>
<User f="nodata">
<User f="noscroll">
<User t="list" f="user" l="Start"/>
</User>
</User>
<Start f="nodata">
<Main>
<Create_new_Feature t="button" l="Shelter"/>
<autonum/>
<GPS_Diagnostics t="gpsdiag"/>
</Main>
<search>
Records
</search>
<Map f="noscroll">
<Map t="map"/>
<Create_Shape t="button" l="Shape"/>
</Map>
</Start>
<Shelter>
<fmt>{{Feature_ID}}-{{Feature_Type}}</fmt>
<General>
<author/>
<timestamp/>
<Feature_ID f="autonum notnull"/>
<Feature_Source>
<desc>What led you to the shelter or feature?</desc>
<opts>
<opt>Informant</opt>
<opt>Serendipity</opt>
<opt>Rosannas list</opt>
<opt>Map</opt>
<opt>Other</opt>
<opt>NA</opt>
</opts>
</Feature_Source>
<Feature_Type f="notnull">
<desc>
Shelter is the most common type of civil defense struture in Aarhus. Types refer to the plan of the shelter below ground. Indicate which is the likely type if you can make it out during the visit. Use the certainty slider in case of uncertainty!
</desc>
<opts>
<opt p="gallery/types/Type1.jpg">Shelter Type I</opt>
<opt p="gallery/types/Type2.jpg">Shelter Type II</opt>
<opt p="gallery/types/Type3.jpg">Shelter Type III</opt>
<opt p="gallery/types/Type4.jpg">Shelter Type IV</opt>
<opt p="gallery/types/Type5.jpg">Shelter Type V</opt>
<opt p="gallery/types/Type6.jpg">Shelter Type VI</opt>
<opt>Bunker</opt>
<opt>Emergency hospital</opt>
<opt>Observation post</opt>
<opt>Other</opt>
</opts>
</Feature_Type>
<Number_of_Iterations_Subtype f="htmldesc">
Number of Iterations/Subtype
<desc>
<![CDATA[
<p>Please list the number of times that the basic shelter design repeats at your location and indicate if you can reliably gauge it. Each iteration should eventually be recorded separately, so we a have GPS for each entryway.</p>
<i>Glossary:</i>
<ul>
<li><b>1</b><img src="files/data/gallery/subtypes/Subtypes1.jpg" style="width:100%" /></li>
<li><b>2</b><img src="files/data/gallery/subtypes/Subtypes2e_m.jpg" style="width:100%" />
<img src="files/data/gallery/subtypes/Subtypes2a_d.jpg" style="width:100%" /></li>
<li><b>3</b><img src="files/data/gallery/subtypes/Subtypes3.jpg" style="width:100%" /></li>
<li><b>4</b><img src="files/data/gallery/subtypes/Subtypes4.jpg" style="width:100%" /></li>
<li><b>5</b><img src="files/data/gallery/subtypes/Subtypes5.jpg" style="width:100%" /></li>
<li><b>6</b><img src="files/data/gallery/subtypes/Subtypes6.jpg" style="width:100%" /></li>
</ul>
]]>
</desc>
<opts>
<opt>NA</opt>
<opt>1</opt>
<opt>2</opt>
<opt>3</opt>
<opt>4</opt>
<opt>5</opt>
<opt>Indeterminate</opt>
<opt>Other</opt>
</opts>
</Number_of_Iterations_Subtype>
<Feature_Description>
<desc>
Comment on feature preservation and, if the feature is not a shelter, describe its characteristics, such as shape, external markers and dimensions here. Authors should explicitly comment on feature subtype listed in the previous box.
</desc>
</Feature_Description>
<Guide t="webview" f="nolabel"/>
<gps f="notnull"/>
<Landuse_on_Top f="notnull">
<desc>
Describe what covers the surface of the shelter. Is it overgrown with grass, covered with shrubs, or converted into a playground or ashpalted area?
</desc>
<opts>
<opt>Grass</opt>
<opt>Shrubs</opt>
<opt>Trees</opt>
<opt>Concrete slabs</opt>
<opt> Asphalt</opt>
<opt> Street</opt>
<opt> Playground</opt>
<opt>Structure</opt>
<opt>Other</opt>
</opts>
</Landuse_on_Top>
<Landuse_Around>
<desc>
Describe briefly the setting of the shelter. If multiple different kinds of landuse co-occur, choose the majority and then add the rest in annotation
</desc>
<opts>
<opt>Other</opt>
<opt>Urban structures</opt>
<opt>Street</opt>
<opt>Playground or schoolyard</opt>
<opt>Forest</opt>
<opt>Agricultural field</opt>
<opt>Grassland or park</opt>
<opt>Motorway</opt>
</opts>
</Landuse_Around>
<Overview_Photo f="notnull" t="camera">
<desc>
Take a photo of the entire extent of the feature with a scale within.
</desc>
</Overview_Photo>
<Locale_Description>
<desc>
Describe the environs of the shelter or feature, and specify its address so that others can find it easily after you.
</desc>
</Locale_Description>
</General>
<Access>
<Entryway_Type f="notnull">
<desc>
Select from the list or define the type using Other + Annotation
</desc>
<opts>
<opt>Concrete slabs</opt>
<opt>Doorway</opt>
<opt>Access buried or indeterminate</opt>
<opt>Other</opt>
<opt>NA</opt>
</opts>
</Entryway_Type>
<Accessiblity_of_Shelter_During_Visit f="notnull">
<desc>
Choose a field from the dropdown
</desc>
<opts>
<opt>NA</opt>
<opt>Other</opt>
<opt>Barred (concrete slabs or earthen cover bar access fully or partially)</opt>
<opt>Sealed (as in a layer of concrete seals a doorway)</opt>
<opt>Locked</opt>
<opt>Open</opt>
</opts>
</Accessiblity_of_Shelter_During_Visit>
<Entryway_Faces_Direction f="notnull">
<desc>
Use a compass to measure which way the doorway is facing. Use this terminology: West-northwest (WNW) North-northwest (NNW) North-northeast (NNE) East-northeast (ENE) East-southeast (ESE) South-southeast (SSE) South-southwest (SSW) West-southwest (WSW)
</desc>
<opts>
<opt>NNW</opt>
<opt>NW</opt>
<opt>WNW</opt>
<opt>W</opt>
<opt>WSW</opt>
<opt>SW</opt>
<opt>SSW</opt>
<opt>S</opt>
<opt>SSE</opt>
<opt>SE</opt>
<opt>ESE</opt>
<opt>E</opt>
<opt>ENE</opt>
<opt>NE</opt>
<opt>NNE</opt>
<opt>N</opt>
<opt>NOT AVAILABLE</opt>
<opt>OTHER</opt>
</opts>
</Entryway_Faces_Direction>
<Comments_on_Entryway_and_Access>
<desc>
Indicate whether there is easy pedestrian access to the shelter. (eg. that it is not in the middle of a two-lane thoroughfare)
</desc>
</Comments_on_Entryway_and_Access>
<Entryway_Photo t="camera"/>
<Emergency_Exit_Shape f="notnull">
<desc>
Indicate the shape of emergency exit. If not detectable, select NA.
</desc>
<opts>
<opt>Round</opt>
<opt>Square</opt>
<opt>Other</opt>
<opt>NA</opt>
</opts>
</Emergency_Exit_Shape>
<Emergency_Exit_Location f="notnull">
<desc>
The specific location of an emergency exit will vary with shelter type. A round shelter will have this exit on the top center, while a square shelter will have it off center, to the side or a corner. Please indicate its location relative to shelter plan and use Annotation or pictures for more detail
</desc>
<opts>
<opt>Central</opt>
<opt>Side</opt>
<opt>Corner</opt>
<opt>Other</opt>
<opt>NA</opt>
</opts>
</Emergency_Exit_Location>
<Notes_on_Emergency_Exit/>
<Emergency_Exit_Photo t="camera">
<desc>
Take an extra photo of the emergency exit if it is obscured in the Overview photo
</desc>
</Emergency_Exit_Photo>
<Distance_from_Swan_neck_to_Emergency_Exit_m b="decimal">
Distance from Swan-neck to Emergency Exit (m)
<desc>
Can you find a turned tube "swan neck ventilation" near the foot of the shelter? If so, measure its distance to the emergency exit in METERS
</desc>
</Distance_from_Swan_neck_to_Emergency_Exit_m>
</Access>
<Interior>
<Interior_Description>
<desc>
If the shelter is accessible, look inside and provide a description of internal shape, contents, condition and status.
</desc>
</Interior_Description>
<Interior_Photo t="camera"/>
<Comments_and_Recommendations/>
</Interior>
</Shelter>
<Shape>
<Shape_Note>
<Label f="id"/>
<Note/>
</Shape_Note>
</Shape>
<logic><![CDATA[
/********************************* CUSTOM SEARCH ******************************/
addOnEvent("Start/Search", "show", "populateSelectAuthor()");
addOnEvent("Start/Search/Select_Author", "click", "search()");
void populateSelectAuthor(){
String refSearchUsers = "Start/Search/Select_Author";
String getNonDeletedUsersQuery = "SELECT userid, fname || ' ' || lname "+
" FROM user "+
" WHERE userdeleted is null "+
" UNION " +
"SELECT -1, '{All}'";
fetchAll(getNonDeletedUsersQuery, new FetchCallback() {
onFetch(result) {
populateDropDown(refSearchUsers, result, false);
search();
}
});
}
// Overrides auto-generated definition
void search(){
String refEntityList = "Start/Search/Entity_List";
String refSearchTerm = "Start/Search/Search_Term";
String refEntityTypes = "Start/Search/Entity_Types";
String refSelectAuthor = "Start/Search/Select_Author";
String type = getFieldValue(refEntityTypes);
String term = getFieldValue(refSearchTerm);
String user = getFieldValue(refSelectAuthor);
String searchQuery = "SELECT uuid, response "+
" FROM latestNonDeletedArchEntFormattedIdentifiers "+
" WHERE uuid in (SELECT uuid "+
" FROM latestNonDeletedArchEntIdentifiers "+
" WHERE measure LIKE {term}||'%' "+
" AND ( aenttypename = {type} OR '' = {type} ) "+
" AND ( userid = {user} OR -1 = {user}) " +
" ) "+
" ORDER BY substr(uuid, 7, 13) DESC "+
" LIMIT ? "+
"OFFSET ? ";
searchQuery = dbReplaceFirst(searchQuery, "{term}", term);
searchQuery = dbReplaceFirst(searchQuery, "{type}", type);
searchQuery = dbReplaceFirst(searchQuery, "{type}", type);
searchQuery = replaceFirst(searchQuery, "{user}", user);
searchQuery = replaceFirst(searchQuery, "{user}", user);
populateCursorList(refEntityList, searchQuery, 25);
refreshTabgroupCSS("Start");
Log.d("Module", "Search query: " + searchQuery);
}
/************************************ MAP *************************************/
DATA_ENTRY_LAYER = "Data Entry Layer";
DATA_ENTRY_LAYER_ID = 0;
void initMap() {
// Data entry layer
DATA_ENTRY_LAYER_ID = createCanvasLayer(MAP_REF, DATA_ENTRY_LAYER);
setSelectedLayer(MAP_REF, DATA_ENTRY_LAYER);
// Shape
isEntity = true;
queryName = "Shape";
querySQL = "SELECT uuid, aenttimestamp FROM latestNonDeletedArchEnt join aenttype using (aenttypeid) where aenttypename = 'Shape'";
ps = createPointStyle(10, Color.YELLOW, 0.2f, 0.5f);
ls = createLineStyle(10, Color.YELLOW, 0.05f, 0.3f, null);
pos = createPolygonStyle(10, Color.parseColor("#440000FF"), createLineStyle(10, Color.parseColor("#AA000000"), 0.01f, 0.3f, null));
ts = createTextStyle(10, Color.YELLOW, 30, Typeface.SANS_SERIF);
showDatabaseLayer(MAP_REF, "Shape Layer", isEntity, queryName, querySQL, ps, ls, pos, ts);
// Shelter
isEntity = true;
queryName = "Shelter";
querySQL = "SELECT uuid, aenttimestamp FROM latestNonDeletedArchEnt join aenttype using (aenttypeid) where aenttypename = 'Shelter'";
ps = createPointStyle(10, Color.BLUE, 0.2f, 0.5f);
ls = createLineStyle(10, Color.BLUE, 0.05f, 0.3f, null);
pos = createPolygonStyle(10, Color.parseColor("#440000FF"), createLineStyle(10, Color.parseColor("#AA000000"), 0.01f, 0.3f, null));
ts = createTextStyle(10, Color.BLUE, 30, Typeface.SANS_SERIF);
showDatabaseLayer(MAP_REF, "Shelter Layer", isEntity, queryName, querySQL, ps, ls, pos, ts);
// Base Map
showBaseMap(MAP_REF, "Base Map", "files/data/map/c10km_1m4_3857.tif");
setMapZoom(MAP_REF, 13.0f);
}
void clearGeometry() {
List geometry = getGeometryList(MAP_REF, DATA_ENTRY_LAYER_ID);
if (geometry == null) return;
if (geometry.size() == 0) return;
for (geom : geometry) {
print("Geometry cleared:" + geom.userData.geomId);
clearGeometry(MAP_REF, geom.userData.geomId);
}
}
boolean checkForGeometry() {
List geometry = getGeometryList(MAP_REF, DATA_ENTRY_LAYER_ID);
if (geometry == null || geometry.size() == 0) {
String head = "Cannot Create Shape";
String body = "At least one shape must be present on the data entry layer.";
showWarning(head, body);
return false;
} else {
return true;
}
}
void centreMe() {
if(!isExternalGPSOn() && !isInternalGPSOn()) {
showToast("{GPS_Not_Initialised}");
} else {
centerOnCurrentPosition(MAP_REF);
}
}
void refreshMap() {
refreshMap(MAP_REF);
}
addOnEventCond("Start/Map/Create_Shape", "click", "checkForGeometry()");
addOnEvent(
"Start/Map/Create_Shape",
"click",
"setAutoSaveGeometry(getGeometryList(MAP_REF, DATA_ENTRY_LAYER_ID))",
PRECEDENCE_MID+1);
addOnEvent("Shape", "save", "clearGeometry()");
addOnEvent("module", "load", "initMap()");
addOnEvent("Start/Map", "show", "refreshMap()");
delOnEvents("Start/Map/Save_Map_Settings_1", "click");
/************************************ WEB *************************************/
String REF_WEBVIEW = "Shelter/General/Guide";
populateWebViewHtml(REF_WEBVIEW, "<h2>Take GPS point at entryway</h2>");
]]></logic>
</module>