File: DataDrivenSelector.net

package info (click to toggle)
dxsamples 4.4.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 26,340 kB
  • sloc: ansic: 10,079; sh: 8,445; java: 1,772; makefile: 1,102
file content (480 lines) | stat: -rw-r--r-- 16,242 bytes parent folder | download | duplicates (5)
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
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
//
// time: Wed Apr  9 15:26:04 1997
//
// version: 3.1.1 (format), 3.1.4 (DX Beta)
//
//
// MODULE main
//
// comment: This visual program shows how you can use data-driven selector interactors.  A non-data-driven selector interactor chooses whether you import a general import format data file or a data explorer format file. In each case, the imported object is a group. This group is passed to a data-driven selector interactor, which uses the names of the members of the group to label the interactor. Notice that if you change between "General Import file" and "Data Explorer file", the labels on the other Selector interactor change (after the next execution). 
// comment: 
// comment: Because the general import wind data contain invalid data values (data values whose x or y components are greater than a value of 100 signify invalid data), the Include module is used conditionally (only if this is the data under consideration).
// comment: 
// comment: Inquire is used to determine if the data is two- or three-dimensional. If it is three-dimensional, a plane is taken using MapToPlane.
// page assignment: caption	order=4, windowed=0, showing=0
// page assignment: display	order=6, windowed=0, showing=0
// page assignment: import	order=2, windowed=0, showing=1
// page assignment: maptoplane	order=5, windowed=0, showing=0
// page assignment: select	order=3, windowed=0, showing=0
// workspace: width = 581, height = 531
// layout: snap = 0, width = 50, height = 50, align = UL
//
macro main(
) -> (
) {
    // 
    // node Selector[2]: x = 0, y = 100, inputs = 7, label = Selector
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "Selector_2"
    // input[2]: defaulting = 0, visible = 0, type = 32, value = "General Import file" 
    // input[3]: defaulting = 0, visible = 0, type = 29, value = 2 
    // input[4]: defaulting = 1, visible = 1, type = 16777248, value = { "Data Explorer file" "General Import file" }
    // input[5]: defaulting = 1, visible = 0, type = 16777245, value = { 1 2 }
    // output[1]: visible = 1, type = 29, value = 2 
    // output[2]: visible = 1, type = 32, value = "General Import file" 
    // page group: import
    //
    // 
    // node Import[1]: x = 109, y = 148, inputs = 6, label = Import
    // input[1]: defaulting = 0, visible = 1, type = 32, value = "storm_data"
    // page group: import
    //
main_Import_1_out_1 = 
    Import(
    main_Import_1_in_1,
    main_Import_1_in_2,
    main_Import_1_in_3,
    main_Import_1_in_4,
    main_Import_1_in_5,
    main_Import_1_in_6
    ) [instance: 1, cache: 1];
    // 
    // node Import[2]: x = 207, y = 147, inputs = 6, label = Import
    // input[1]: defaulting = 0, visible = 1, type = 32, value = "temp_wind.general"
    // input[3]: defaulting = 1, visible = 1, type = 32, value = "general"
    // page group: import
    //
main_Import_2_out_1 = 
    Import(
    main_Import_2_in_1,
    main_Import_2_in_2,
    main_Import_2_in_3,
    main_Import_2_in_4,
    main_Import_2_in_5,
    main_Import_2_in_6
    ) [instance: 2, cache: 1];
    // 
    // node Switch[1]: x = 23, y = 351, inputs = 3, label = Switch
    // page group: import
    //
main_Switch_1_out_1 = 
    Switch(
    main_Selector_2_out_1,
    main_Import_1_out_1,
    main_Import_2_out_1
    ) [instance: 1, cache: 1];
    // 
    // node Transmitter[5]: x = 36, y = 469, inputs = 1, label = imported
    // page group: import
    //
imported = main_Switch_1_out_1;
    // 
    // node Receiver[8]: x = 373, y = 103, inputs = 1, label = imported
    // page group: display
    //
main_Receiver_8_out_1[cache: 0] = imported;
    // 
    // node AutoCamera[1]: x = 316, y = 342, inputs = 9, label = AutoCamera
    // page group: display
    //
main_AutoCamera_1_out_1 = 
    AutoCamera(
    main_Receiver_8_out_1,
    main_AutoCamera_1_in_2,
    main_AutoCamera_1_in_3,
    main_AutoCamera_1_in_4,
    main_AutoCamera_1_in_5,
    main_AutoCamera_1_in_6,
    main_AutoCamera_1_in_7,
    main_AutoCamera_1_in_8,
    main_AutoCamera_1_in_9
    ) [instance: 1, cache: 1];
    // 
    // node Receiver[6]: x = 91, y = 111, inputs = 1, label = imported
    // page group: select
    //
main_Receiver_6_out_1[cache: 0] = imported;
    // 
    // node Selector[1]: x = 301, y = 204, inputs = 7, label = Selector
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "Selector_1"
    // input[2]: defaulting = 0, visible = 0, type = 32, value = "wind_velocity" 
    // input[3]: defaulting = 0, visible = 0, type = 29, value = 1 
    // input[4]: defaulting = 1, visible = 1, type = 16777248, value = { "temperature" "wind_velocity" }
    // input[5]: defaulting = 1, visible = 0, type = 16777245, value = { 0 1 }
    // output[1]: visible = 1, type = 29, value = 1 
    // output[2]: visible = 1, type = 32, value = "wind_velocity" 
    // page group: select
    //
main_Selector_1_out_1[cache: 2],
main_Selector_1_out_2[cache: 2] = 
    Selector(
    main_Selector_1_in_1,
    main_Selector_1_in_2,
    main_Selector_1_in_3,
    main_Receiver_6_out_1,
    main_Selector_1_in_5,
    main_Selector_1_in_6,
    main_Selector_1_in_7
    ) [instance: 1, cache: 1];
    // 
    // node Select[1]: x = 204, y = 234, inputs = 3, label = Select
    // page group: select
    //
main_Select_1_out_1 = 
    Select(
    main_Receiver_6_out_1,
    main_Selector_1_out_1,
    main_Select_1_in_3
    ) [instance: 1, cache: 1];
    // 
    // node Inquire[2]: x = 45, y = 348, inputs = 3, label = Inquire
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "is scalar + 1"
    // page group: select
    //
main_Inquire_2_out_1 = 
    Inquire(
    main_Select_1_out_1,
    main_Inquire_2_in_2,
    main_Inquire_2_in_3
    ) [instance: 2, cache: 1];
    // 
    // node Include[2]: x = 170, y = 344, inputs = 6, label = Include
    // input[2]: defaulting = 0, visible = 1, type = 8, value = [-100 -100]
    // input[3]: defaulting = 0, visible = 1, type = 8, value = [100 100]
    // page group: select
    //
main_Include_2_out_1 = 
    Include(
    main_Select_1_out_1,
    main_Include_2_in_2,
    main_Include_2_in_3,
    main_Include_2_in_4,
    main_Include_2_in_5,
    main_Include_2_in_6
    ) [instance: 2, cache: 1];
    // 
    // node Switch[3]: x = 220, y = 444, inputs = 3, label = Switch
    // page group: select
    //
main_Switch_3_out_1 = 
    Switch(
    main_Inquire_2_out_1,
    main_Include_2_out_1,
    main_Select_1_out_1
    ) [instance: 3, cache: 1];
    // 
    // node Transmitter[6]: x = 214, y = 534, inputs = 1, label = ready
    // page group: select
    //
ready = main_Switch_3_out_1;
    // 
    // node Receiver[7]: x = 169, y = 91, inputs = 1, label = ready
    // page group: maptoplane
    //
main_Receiver_7_out_1[cache: 0] = ready;
    // 
    // node Inquire[1]: x = 143, y = 184, inputs = 3, label = Inquire
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "is 3d positions"
    // page group: maptoplane
    //
main_Inquire_1_out_1 = 
    Inquire(
    main_Receiver_7_out_1,
    main_Inquire_1_in_2,
    main_Inquire_1_in_3
    ) [instance: 1, cache: 1];
    // 
    // node Compute[7]: x = 142, y = 256, inputs = 2, label = Compute
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0+1"
    // page group: maptoplane
    // expression: value = a+1
    // name[2]: value = a
    //
main_Compute_7_out_1 = 
    Compute(
    main_Compute_7_in_1,
    main_Inquire_1_out_1
    ) [instance: 7, cache: 1];
    // 
    // node MapToPlane[1]: x = 313, y = 199, inputs = 3, label = MapToPlane
    // page group: maptoplane
    //
main_MapToPlane_1_out_1 = 
    MapToPlane(
    main_Receiver_7_out_1,
    main_MapToPlane_1_in_2,
    main_MapToPlane_1_in_3
    ) [instance: 1, cache: 1];
    // 
    // node Switch[2]: x = 224, y = 347, inputs = 3, label = Switch
    // page group: maptoplane
    //
main_Switch_2_out_1 = 
    Switch(
    main_Compute_7_out_1,
    main_Receiver_7_out_1,
    main_MapToPlane_1_out_1
    ) [instance: 2, cache: 1];
    // 
    // node AutoColor[1]: x = 226, y = 438, inputs = 10, label = AutoColor
    // page group: maptoplane
    //
main_AutoColor_1_out_1,
main_AutoColor_1_out_2 = 
    AutoColor(
    main_Switch_2_out_1,
    main_AutoColor_1_in_2,
    main_AutoColor_1_in_3,
    main_AutoColor_1_in_4,
    main_AutoColor_1_in_5,
    main_AutoColor_1_in_6,
    main_AutoColor_1_in_7,
    main_AutoColor_1_in_8,
    main_AutoColor_1_in_9,
    main_AutoColor_1_in_10
    ) [instance: 1, cache: 1];
    // 
    // node Transmitter[2]: x = 200, y = 467, inputs = 1, label = label1
    // page group: import
    //
label1 = main_Selector_2_out_2;
    // 
    // node Receiver[2]: x = 139, y = 152, inputs = 1, label = label1
    // page group: caption
    //
main_Receiver_2_out_1[cache: 0] = label1;
    // 
    // node Transmitter[3]: x = 368, y = 527, inputs = 1, label = label2
    // page group: select
    //
label2 = main_Selector_1_out_2;
    // 
    // node Receiver[3]: x = 202, y = 150, inputs = 1, label = label2
    // page group: caption
    //
main_Receiver_3_out_1[cache: 0] = label2;
    // 
    // node List[1]: x = 185, y = 229, inputs = 2, label = List
    // page group: caption
    //
main_List_1_out_1 = 
    List(
    main_Receiver_2_out_1,
    main_Receiver_3_out_1
    ) [instance: 1, cache: 1];
    // 
    // node Caption[2]: x = 157, y = 313, inputs = 9, label = Caption
    // page group: caption
    //
main_Caption_2_out_1 = 
    Caption(
    main_List_1_out_1,
    main_Caption_2_in_2,
    main_Caption_2_in_3,
    main_Caption_2_in_4,
    main_Caption_2_in_5,
    main_Caption_2_in_6,
    main_Caption_2_in_7,
    main_Caption_2_in_8,
    main_Caption_2_in_9
    ) [instance: 2, cache: 1];
    // 
    // node Transmitter[7]: x = 221, y = 521, inputs = 1, label = maptoplane
    // page group: maptoplane
    //
maptoplane = main_AutoColor_1_out_1;
    // 
    // node Receiver[9]: x = 66, y = 102, inputs = 1, label = maptoplane
    // page group: display
    //
main_Receiver_9_out_1[cache: 0] = maptoplane;
    // 
    // node Transmitter[4]: x = 161, y = 396, inputs = 1, label = caption
    // page group: caption
    //
caption = main_Caption_2_out_1;
    // 
    // node Receiver[4]: x = 210, y = 101, inputs = 1, label = caption
    // page group: display
    //
main_Receiver_4_out_1[cache: 0] = caption;
    // 
    // node Collect[4]: x = 156, y = 392, inputs = 2, label = Collect
    // page group: display
    //
main_Collect_4_out_1 = 
    Collect(
    main_Receiver_9_out_1,
    main_Receiver_4_out_1
    ) [instance: 4, cache: 1];
    // 
    // node Display[2]: x = 234, y = 510, inputs = 8, label = Display
    // page group: display
    // depth: value = 24
    // window: position = (0.3953,0.0664), size = 0.5109x0.5117
    //
main_Display_2_out_1[cache: 2] = 
    Display(
    main_Collect_4_out_1,
    main_AutoCamera_1_out_1,
    main_Display_2_in_3,
    main_Display_2_in_4,
    main_Display_2_in_5,
    main_Display_2_in_6,
    main_Display_2_in_7,
    main_Display_2_in_8
    ) [instance: 2, cache: 1];
    //
    // decorator Annotate	pos=(81,35) size=500x44 style(Label), font=bold, value = <NULL>
    // annotation user_begin: 92
    // annotation user: this page imports one of two data sets, depending on the setting of the
    // annotation user: selector interactor.
    // annotation user_end: <NULL>
    // resource *decorator.alignment:XmALIGNMENT_BEGINNING
    // page group: import
    //
    // decorator Annotate	pos=(80,26) size=587x76 style(Label), font=bold, value = <NULL>
    // annotation user_begin: 306
    // annotation user: This page contains the data driven Selector interactor which presents the
    // annotation user: field names to the user to choose from. Also, because the vector data in the
    // annotation user: general array format file contains some invalid values, Include is used conditionally
    // annotation user: to remove them. The result is ready to be passed on to other modules.
    // annotation user_end: <NULL>
    // resource *decorator.alignment:XmALIGNMENT_BEGINNING
    // page group: select
    //
    // decorator Annotate	pos=(69,29) size=296x28 style(Label), font=bold, value = <NULL>
    // annotation user_begin: 40
    // annotation user: This page creates an appropriate caption
    // annotation user_end: <NULL>
    // page group: caption
    //
    // decorator Annotate	pos=(22,37) size=566x44 style(Label), font=bold, value = <NULL>
    // annotation user_begin: 121
    // annotation user: This page passes the data through to AutoColor, unless it is three-dimensional,
    // annotation user: in which case MapToPlane is called first.
    // annotation user_end: <NULL>
    // resource *decorator.alignment:XmALIGNMENT_BEGINNING
    // page group: maptoplane
    //
    // decorator Annotate	pos=(78,24) size=437x28 style(Label), font=bold, value = <NULL>
    // annotation user_begin: 61
    // annotation user: This page displays the maptoplane collected with the caption.
    // annotation user_end: <NULL>
    // page group: display
// network: end of macro body
}
main_Selector_2_in_1 = "Selector_2";
main_Selector_2_in_2 = "General Import file" ;
main_Selector_2_in_3 = 2 ;
main_Selector_2_in_4 = NULL;
main_Selector_2_in_5 = NULL;
main_Selector_2_in_6 = NULL;
main_Selector_2_in_7 = NULL;
main_Selector_2_out_1 = 2 ;
main_Selector_2_out_2 = "General Import file" ;
main_Import_1_in_1 = "storm_data";
main_Import_1_in_2 = NULL;
main_Import_1_in_3 = NULL;
main_Import_1_in_4 = NULL;
main_Import_1_in_5 = NULL;
main_Import_1_in_6 = NULL;
main_Import_1_out_1 = NULL;
main_Import_2_in_1 = "temp_wind.general";
main_Import_2_in_2 = NULL;
main_Import_2_in_3 = NULL;
main_Import_2_in_4 = NULL;
main_Import_2_in_5 = NULL;
main_Import_2_in_6 = NULL;
main_Import_2_out_1 = NULL;
main_Switch_1_out_1 = NULL;
main_Transmitter_5_out_1 = NULL;
main_Receiver_8_out_1 = NULL;
main_AutoCamera_1_in_2 = NULL;
main_AutoCamera_1_in_3 = NULL;
main_AutoCamera_1_in_4 = NULL;
main_AutoCamera_1_in_5 = NULL;
main_AutoCamera_1_in_6 = NULL;
main_AutoCamera_1_in_7 = NULL;
main_AutoCamera_1_in_8 = NULL;
main_AutoCamera_1_in_9 = NULL;
main_AutoCamera_1_out_1 = NULL;
main_Receiver_6_out_1 = NULL;
main_Selector_1_in_1 = "Selector_1";
main_Selector_1_in_2 = "wind_velocity" ;
main_Selector_1_in_3 = 1 ;
main_Selector_1_in_5 = NULL;
main_Selector_1_in_6 = NULL;
main_Selector_1_in_7 = NULL;
main_Selector_1_out_1 = 1 ;
main_Selector_1_out_2 = "wind_velocity" ;
main_Select_1_in_3 = NULL;
main_Select_1_out_1 = NULL;
main_Inquire_2_in_2 = "is scalar + 1";
main_Inquire_2_in_3 = NULL;
main_Inquire_2_out_1 = NULL;
main_Include_2_in_2 = [-100 -100];
main_Include_2_in_3 = [100 100];
main_Include_2_in_4 = NULL;
main_Include_2_in_5 = NULL;
main_Include_2_in_6 = NULL;
main_Include_2_out_1 = NULL;
main_Switch_3_out_1 = NULL;
main_Transmitter_6_out_1 = NULL;
main_Receiver_7_out_1 = NULL;
main_Inquire_1_in_2 = "is 3d positions";
main_Inquire_1_in_3 = NULL;
main_Inquire_1_out_1 = NULL;
main_Compute_7_in_1 = "$0+1";
main_Compute_7_out_1 = NULL;
main_MapToPlane_1_in_2 = NULL;
main_MapToPlane_1_in_3 = NULL;
main_MapToPlane_1_out_1 = NULL;
main_Switch_2_out_1 = NULL;
main_AutoColor_1_in_2 = NULL;
main_AutoColor_1_in_3 = NULL;
main_AutoColor_1_in_4 = NULL;
main_AutoColor_1_in_5 = NULL;
main_AutoColor_1_in_6 = NULL;
main_AutoColor_1_in_7 = NULL;
main_AutoColor_1_in_8 = NULL;
main_AutoColor_1_in_9 = NULL;
main_AutoColor_1_in_10 = NULL;
main_AutoColor_1_out_1 = NULL;
main_Transmitter_2_out_1 = NULL;
main_Receiver_2_out_1 = NULL;
main_Transmitter_3_out_1 = NULL;
main_Receiver_3_out_1 = NULL;
main_List_1_out_1 = NULL;
main_Caption_2_in_2 = NULL;
main_Caption_2_in_3 = NULL;
main_Caption_2_in_4 = NULL;
main_Caption_2_in_5 = NULL;
main_Caption_2_in_6 = NULL;
main_Caption_2_in_7 = NULL;
main_Caption_2_in_8 = NULL;
main_Caption_2_in_9 = NULL;
main_Caption_2_out_1 = NULL;
main_Transmitter_7_out_1 = NULL;
main_Receiver_9_out_1 = NULL;
main_Transmitter_4_out_1 = NULL;
main_Receiver_4_out_1 = NULL;
main_Collect_4_out_1 = NULL;
main_Display_2_in_3 = "X24,,";
main_Display_2_in_4 = NULL;
main_Display_2_in_5 = NULL;
main_Display_2_in_6 = NULL;
main_Display_2_in_7 = NULL;
main_Display_2_in_8 = NULL;
Executive("product version 3 1 4");
$sync
main();