]> Creatis software - bbtk.git/blob - packages/toolsbbtk/bbs/appli/GUICreateBlackBox.bbs
GUICreateBlackBox.bbs fixed + Names harmonized with GUICreatePackage
[bbtk.git] / packages / toolsbbtk / bbs / appli / GUICreateBlackBox.bbs
1 description "Creates the XML or C++ code for a new black box"
2 author "eduardo.davila at creatis.insa-lyon.fr"
3 category "toolsbbtk"
4
5 load std 
6 load wx
7
8 new OutputText windowTitle
9   set windowTitle.In "Black box informations"
10
11 new DirectorySelector dir
12     set dir.Message "Select the location of your new black box"
13
14 new InputText nameBlackbox
15     set nameBlackbox.Title "Blackbox name         (1 word)"
16     set nameBlackbox.In "BLACKBOX_NAME"
17
18 new InputText namePackage
19     set namePackage.Title "Package name         (1 word)"
20     set namePackage.In "PACKAGE_NAME"
21
22
23 new InputText author
24     set author.Title "Author(s)           (caracters   '<',  '>' not accepted...)"
25     set author.In "_author_"
26
27 new InputText description
28     set description.Title "Description    (caracters   '<',  '>' not accepted...)"
29     set description.In "_description_"
30
31 #---------------------------------------------------------------------
32
33
34 new RadioButton typeBlackbox
35   set typeBlackbox.Title "Type of the blackbox :"
36   set typeBlackbox.In0 "std-template"
37   set typeBlackbox.In1 "VTK_PolyDataAlgorithm-template"
38   set typeBlackbox.In2 "VTK_ImageAlgorithm-template"
39   set typeBlackbox.In3 "widget-template "
40
41 new StringSelect stringselectorType
42   set stringselectorType.In0 "std"
43   set stringselectorType.In1 "VTK_PolyDataAlgorithm"
44   set stringselectorType.In2 "VTK_ImageAlgorithm"
45   set stringselectorType.In3 "widget"
46   connect  typeBlackbox.Out stringselectorType.In
47
48 #---------------------------------------------------------------------
49
50 new RadioButton formatBlackbox
51   set formatBlackbox.Title "Format of the output file :"
52   set formatBlackbox.In 0
53   set formatBlackbox.In0 "C++"
54   set formatBlackbox.In1 "XML"
55
56 new StringSelect stringselectorFormat
57   set stringselectorFormat.In0 "C++"
58   set stringselectorFormat.In1 "XML"
59   connect  formatBlackbox.Out stringselectorFormat.In
60
61 #---------------------------------------------------------------------
62
63 new OutputText dirOutput
64   connect dir.Out dirOutput.In
65
66 new LayoutLine layoutHor
67   set  layoutHor.Orientation H
68   connect typeBlackbox.Widget layoutHor.Widget1
69   connect formatBlackbox.Widget layoutHor.Widget2
70
71 #new CommandButton cancelButton
72 #    set cancelButton.In "quit"
73 #    set cancelButton.Label "Cancel"
74
75 new CommandButton createButton
76     set createButton.In "print $concatStr.Out$; exec command; "
77     set createButton.Label "Run"
78
79 new LayoutLine buttons
80     set buttons.Orientation Horizontal
81 #    connect cancelButton.Widget buttons.Widget1
82     connect createButton.Widget buttons.Widget2
83
84 new LayoutLine main
85     connect windowTitle.Widget main.Widget1
86     connect dirOutput.Widget main.Widget2
87     connect nameBlackbox.Widget main.Widget3
88     connect namePackage.Widget main.Widget4
89     connect author.Widget main.Widget5
90     connect description.Widget main.Widget6
91     connect layoutHor.Widget main.Widget7
92     connect buttons.Widget main.Widget8
93     set main.WinTitle "Create new black box"
94     set main.WinDialog true
95     set main.WinWidth 350 
96     set main.WinHeight 520 
97
98 #---------------------------------------------------------------------
99
100
101 #-----------------------------------------------------------------------------
102 new Configuration conf
103 # on windows : enclose paths between double quotes 
104 # if system==0 (Linux) dquote=space (ascci code 32)
105 # if system==1 (Win) dquote==" (ascii code 34)
106 new StringSelect onsystem
107 set onsystem.In0 "32"
108 set onsystem.In1 "34"
109 new ASCII dquote
110 connect conf.SystemType onsystem.In
111 connect onsystem.Out dquote.In
112 #set dquote.In 34
113
114 # directory
115 new ConcatStrings dirStr
116  set dirStr.In1 " "
117  connect dquote.Out dirStr.In2
118  connect dir.Out dirStr.In3
119  connect dquote.Out dirStr.In4
120  set dirStr.In5 " "
121
122 # package name
123 new ConcatStrings packageNameStr
124  set packageNameStr.In1 "  "
125  connect namePackage.Out packageNameStr.In2
126  set packageNameStr.In3 " "
127
128 # black box name
129 new ConcatStrings blackboxNameStr
130  set blackboxNameStr.In1 "  "
131  connect nameBlackbox.Out blackboxNameStr.In2
132  set blackboxNameStr.In3 " "
133
134 # type of black box
135 new ConcatStrings typeStr
136  set typeStr.In1 "  "
137  connect stringselectorType.Out typeStr.In2
138  set typeStr.In3 " "
139
140 # format of output 
141 new ConcatStrings formatStr
142  set formatStr.In1 "  "
143  connect stringselectorFormat.Out formatStr.In2
144  set formatStr.In3 " "
145
146 # author
147 new ConcatStrings authorStr
148  set authorStr.In1 " '"
149  connect author.Out authorStr.In2
150  set authorStr.In3 "' "
151
152 # description
153 new ConcatStrings descriptionStr
154  set descriptionStr.In1 " '"
155  connect description.Out descriptionStr.In2
156  set descriptionStr.In3 "' "
157
158 # Command string creation
159 new ConcatStrings concatStrCommand
160     set concatStrCommand.In1 " "
161     connect dquote.Out                  concatStrCommand.In2
162     connect conf.BinPath                concatStrCommand.In3
163     connect conf.FileSeparator  concatStrCommand.In4
164     set         concatStrCommand.In5  "bbCreateBlackBox"
165     connect dquote.Out                  concatStrCommand.In6
166     set         concatStrCommand.In7  " "
167
168 # Params string creation
169 new ConcatStrings concatStrParam
170     connect dirStr.Out                  concatStrParam.In1
171     connect packageNameStr.Out  concatStrParam.In2
172     connect blackboxNameStr.Out concatStrParam.In3
173     connect typeStr.Out                 concatStrParam.In4
174     connect formatStr.Out               concatStrParam.In5
175     connect authorStr.Out               concatStrParam.In6
176     connect descriptionStr.Out  concatStrParam.In7
177     
178 # Command + parameters string creation
179 new ConcatStrings concatStr
180     connect dquote.Out                          concatStr.In1
181     connect concatStrCommand.Out        concatStr.In2
182     connect concatStrParam.Out          concatStr.In3
183     connect dquote.Out                          concatStr.In4
184
185 # Box which executes the command
186 new ExecSystemCommand command
187     connect concatStr.Out command.In
188
189
190 exec dir
191 exec main
192