1 | from XDR import * |
---|
2 | |
---|
3 | ########################### |
---|
4 | # INITIALIZATION |
---|
5 | |
---|
6 | init() |
---|
7 | |
---|
8 | ## |
---|
9 | # |
---|
10 | # Create the list (names of fields only used by the GUI) of the fields (single or multiple) |
---|
11 | # that will be used in the definition of transformations |
---|
12 | # for single fields, the label will be the field name entered by the user |
---|
13 | # for multiple fields, the label will be the name of the multiple |
---|
14 | field_names_list = [] |
---|
15 | after_field_names_list = [] |
---|
16 | multiple_list = [] |
---|
17 | for field in getChildrenName("flddef"): |
---|
18 | if (getValue("fldmult",field) == "single") : |
---|
19 | after_field_name = getValue("fldnameaft",field) |
---|
20 | # field_name=getValue("fldnamebef",field)+"-"+after_field_name |
---|
21 | field_name=getValue(field) |
---|
22 | #field_names_list.append(field_name) |
---|
23 | field_names_list.append(getValue(field)) |
---|
24 | if after_field_name in after_field_names_list: |
---|
25 | error("Name "+after_field_name+" is already in use") |
---|
26 | else: |
---|
27 | after_field_names_list.append(after_field_name) |
---|
28 | if field_name in after_field_names_list: |
---|
29 | error("Name "+field_name+" is already in use") |
---|
30 | else: |
---|
31 | after_field_names_list.append(field_name) |
---|
32 | else : |
---|
33 | if getValue("fldmult",field) in multiple_list: |
---|
34 | print ("Name of the multiple alreay define in the list") |
---|
35 | else : |
---|
36 | field_name=getValue("fldmult",field) |
---|
37 | field_names_list.append(field_name) |
---|
38 | multiple_list.append(field_name) |
---|
39 | setValue(field_name,"namefldgui",field) |
---|
40 | |
---|
41 | |
---|
42 | print(field_names_list, "field_names_list") |
---|
43 | setValue(field_names_list, "field_names_list") |
---|
44 | |
---|
45 | finish() |
---|
46 | |
---|
47 | |
---|
48 | |
---|
49 | |
---|
50 | |
---|
51 | |
---|