source: CPL/oasis3-mct/branches/OASIS3-MCT_2.0_branch/util/oasisgui/library/oasis3-mct/scripts/process_fielddef.py @ 4775

Last change on this file since 4775 was 4775, checked in by aclsce, 4 years ago
  • Imported oasis3-mct from Cerfacs svn server (not suppotred anymore).

The version has been extracted from https://oasis3mct.cerfacs.fr/svn/branches/OASIS3-MCT_2.0_branch/oasis3-mct@1818

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1from XDR import *
2
3###########################
4# INITIALIZATION
5
6init()
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 
14field_names_list = []
15after_field_names_list = []
16multiple_list = []
17for 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
42print(field_names_list, "field_names_list")
43setValue(field_names_list, "field_names_list")
44
45finish()
46
47
48
49
50
51
Note: See TracBrowser for help on using the repository browser.