File: BandColorsMacro.net

package info (click to toggle)
dxsamples 4.4.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 26,340 kB
  • sloc: ansic: 10,079; sh: 8,445; java: 1,772; makefile: 1,102
file content (211 lines) | stat: -rw-r--r-- 7,400 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
//
// time: Wed Feb 12 11:23:06 1997
//
// version: 3.1.1 (format), 3.1.4 (DX Beta)
//
//
//
// macro reference (direct): ConvertColorNameList ConvertColorNameListMacro.net
include "ConvertColorNameListMacro.net"
//
// Begin MDF
// MODULE BandColors
// CATEGORY Macros
// DESCRIPTION Band a 2D data set with stepped color map
// INPUT data; value list or string list or object; (none);  2D data set
// INPUT scalar_values; scalar or scalar list; (none);  list of scalar values for band dividing points
// INPUT color_list; object; (none);  list of colors; should be one more than in list of scalar values
// OUTPUT banded; color field;  banded 2D field
// OUTPUT colormap; field;  colormap used
// End MDF
//
// comment: This macro takes as input a 2D scalar field, a scalar list with n items and a list of colornames with n+1 items. It creates as output a banded version of the 2D field, colored using the list of given colors from min_of_data to max_of_data. As a second output, it gives the colormap, for use with the ColorBar module, for example.
// comment: 
// comment: This macro requires the macro ConvertColorNameListMacro, also found in this directory.
// comment: 
// comment:  (C) COPYRIGHT International Business Machines Corp. 1996.
// comment:  All Rights Reserved.
// comment:  Licensed Materials - Property of IBM
// workspace: width = 682, height = 587
// layout: snap = 0, width = 50, height = 50, align = NN
//
macro BandColors(
 data
,scalar_values
,color_list
) -> (
 banded
,colormap
) {
    // 
    // node Input[3]: x = 124, y = 0, inputs = 0, label = Input
    // parameter: position = 2, name = 'scalar_values', value = ' ', descriptive = 0, description = ' list of scalar values for band dividing points', required = 1, visible = 1
    //
BandColors_Input_3_out_1 = scalar_values;
    // 
    // node Inquire[1]: x = 518, y = 208, inputs = 3, label = Inquire
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "items"
    //
BandColors_Inquire_1_out_1 = 
    Inquire(
    BandColors_Input_3_out_1,
    "items",
    NULL
    ) [instance: 1, cache: 1];
    // 
    // node Input[4]: x = 322, y = 1, inputs = 0, label = Input
    // parameter: position = 3, name = 'color_list', value = ' ', descriptive = 0, description = ' list of colors; should be one more than in list of scalar values', required = 1, visible = 1
    //
BandColors_Input_4_out_1 = color_list;
    // 
    // node Inquire[2]: x = 610, y = 204, inputs = 3, label = Inquire
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "items"
    //
BandColors_Inquire_2_out_1 = 
    Inquire(
    BandColors_Input_4_out_1,
    "items",
    NULL
    ) [instance: 2, cache: 1];
    // 
    // node Compute[1]: x = 532, y = 302, inputs = 3, label = Compute
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "$1 == $0 + 1 ? 1 : 2"
    // expression: value = colorlist_items == scalarlist_items + 1 ? 1 : 2
    // name[2]: value = scalarlist_items
    // name[3]: value = colorlist_items
    //
BandColors_Compute_1_out_1 = 
    Compute(
    "$1 == $0 + 1 ? 1 : 2",
    BandColors_Inquire_1_out_1,
    BandColors_Inquire_2_out_1
    ) [instance: 1, cache: 1];
    // 
    // node Input[2]: x = 463, y = 318, inputs = 0, label = Input
    // parameter: position = 1, name = 'data', value = ' ', descriptive = 0, description = ' 2D data set', required = 1, visible = 1
    //
BandColors_Input_2_out_1 = data;
    // 
    // node Route[1]: x = 528, y = 399, inputs = 2, outputs = 2, label = Route
    //
BandColors_Route_1_out_1,
BandColors_Route_1_out_2 = 
    Route(
    BandColors_Compute_1_out_1,
    BandColors_Input_2_out_1
    ) [instance: 1, cache: 1];
    // 
    // node Transmitter[1]: x = 499, y = 473, inputs = 1, label = data_xcvr
    //
data_xcvr = BandColors_Route_1_out_1;
    // 
    // node Receiver[1]: x = 8, y = 23, inputs = 1, label = data_xcvr
    //
BandColors_Receiver_1_out_1[cache: 0] = data_xcvr;
    // 
    // node Band[1]: x = 0, y = 137, inputs = 4, label = Band
    //
BandColors_Band_1_out_1 = 
    Band(
    BandColors_Receiver_1_out_1,
    BandColors_Input_3_out_1,
    NULL,
    NULL
    ) [instance: 1, cache: 1];
    // 
    // node Statistics[1]: x = 128, y = 131, inputs = 1, label = Statistics
    //
BandColors_Statistics_1_out_1,
BandColors_Statistics_1_out_2,
BandColors_Statistics_1_out_3,
BandColors_Statistics_1_out_4,
BandColors_Statistics_1_out_5 = 
    Statistics(
    BandColors_Receiver_1_out_1
    ) [instance: 1, cache: 1];
    // 
    // node List[2]: x = 223, y = 211, inputs = 3, label = List
    //
BandColors_List_2_out_1 = 
    List(
    BandColors_Statistics_1_out_4,
    BandColors_Input_3_out_1,
    BandColors_Statistics_1_out_5
    ) [instance: 2, cache: 1];
    // 
    // node ConvertColorNameList[1]: x = 333, y = 160, inputs = 1, label = ConvertColorNameList
    //
BandColors_ConvertColorNameList_1_out_1 = 
    ConvertColorNameList(
    BandColors_Input_4_out_1
    ) [instance: 1, cache: 1];
    // 
    // node Construct[2]: x = 341, y = 256, inputs = 4, label = Construct
    //
BandColors_Construct_2_out_1 = 
    Construct(
    BandColors_List_2_out_1,
    NULL,
    NULL,
    BandColors_ConvertColorNameList_1_out_1
    ) [instance: 2, cache: 1];
    // 
    // node Color[1]: x = 156, y = 313, inputs = 5, label = Color
    //
BandColors_Color_1_out_1 = 
    Color(
    BandColors_Band_1_out_1,
    BandColors_Construct_2_out_1,
    NULL,
    NULL,
    NULL
    ) [instance: 1, cache: 1];
    // 
    // node Route[2]: x = 590, y = 399, inputs = 2, outputs = 2, label = Route
    // input[2]: defaulting = 0, visible = 1, type = 16777248, value = {"number of items in colorlist must = number items in scalar list + 1"}
    //
BandColors_Route_2_out_1,
BandColors_Route_2_out_2 = 
    Route(
    BandColors_Compute_1_out_1,
    {"number of items in colorlist must = number items in scalar list + 1"}
    ) [instance: 2, cache: 1];
    // 
    // node Message[3]: x = 573, y = 525, inputs = 3, label = Message
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "error"
    // input[3]: defaulting = 0, visible = 1, type = 3, value = 1
    //
    Message(
    BandColors_Route_2_out_2,
    "error",
    1
    ) [instance: 3, cache: 1];
    // 
    // node Output[2]: x = 154, y = 433, inputs = 1, label = Output
    // parameter: position = 1, name = 'banded', value = ' ', descriptive = 0, description = ' banded 2D field', required = 0, visible = 1
    //
banded = BandColors_Color_1_out_1;
    // 
    // node Output[3]: x = 288, y = 441, inputs = 1, label = Output
    // parameter: position = 2, name = 'colormap', value = ' ', descriptive = 0, description = ' colormap used', required = 0, visible = 1
    //
colormap = BandColors_Construct_2_out_1;
// network: end of macro body
}
BandColors_Input_3_out_1 = NULL;
BandColors_Inquire_1_out_1 = NULL;
BandColors_Input_4_out_1 = NULL;
BandColors_Inquire_2_out_1 = NULL;
BandColors_Compute_1_out_1 = NULL;
BandColors_Input_2_out_1 = NULL;
BandColors_Route_1_out_1 = NULL;
BandColors_Transmitter_1_out_1 = NULL;
BandColors_Receiver_1_out_1 = NULL;
BandColors_Band_1_out_1 = NULL;
BandColors_Statistics_1_out_4 = NULL;
BandColors_Statistics_1_out_5 = NULL;
BandColors_List_2_out_1 = NULL;
BandColors_ConvertColorNameList_1_out_1 = NULL;
BandColors_Construct_2_out_1 = NULL;
BandColors_Color_1_out_1 = NULL;
BandColors_Route_2_out_2 = NULL;