1 description "Creates the XML or C++ code for a new black box (interface for bbCreateBlackBox)"
2 author "eduardo.davila@creatis.insa-lyon.fr"
8 new OutputText windowTitle
9 set windowTitle.In "Create new black box in folder :"
11 new DirectorySelector dir
12 set dir.Message "Select the location of your new black box"
14 new InputText nameBlackbox
15 set nameBlackbox.Title "Black box name (1 word)"
16 set nameBlackbox.In "BLACKBOX_NAME"
18 new InputText namePackage
19 set namePackage.Title "Package name (1 word)"
20 set namePackage.In "PACKAGE_NAME"
24 set author.Title "Author(s) (caracters '<', '>' not accepted...)"
25 set author.In "_author_"
27 new InputText description
28 set description.Title "Description (caracters '<', '>' not accepted...)"
29 set description.In "_description_"
31 #---------------------------------------------------------------------
34 new RadioButton typeBlackbox
35 set typeBlackbox.Title "Type of the black box :"
36 set typeBlackbox.In0 "Basic (inherits AtomicBlackBox, no particular Input/Output)"
37 set typeBlackbox.In1 "Widget (inherits WxBlackBox, has output 'Widget' of type 'wxWindow*')"
38 set typeBlackbox.In2 "VTK PolyDataAlgorithm (inherits AtomicBlackBox and a vtkPolyDataAlgorithm, has standard vtk I/O)"
39 set typeBlackbox.In3 "VTK ImageAlgorithm (inherits AtomicBlackBox and a vtkImageAlgorithm, has standard vtk I/O)"
42 new StringSelect stringselectorType
43 set stringselectorType.In0 "std"
44 set stringselectorType.In1 "widget"
45 set stringselectorType.In2 "VTK_PolyDataAlgorithm"
46 set stringselectorType.In3 "VTK_ImageAlgorithm"
47 connect typeBlackbox.Out stringselectorType.In
49 #---------------------------------------------------------------------
51 new RadioButton formatBlackbox
52 set formatBlackbox.Title "Format of the output file :"
53 set formatBlackbox.In 0
54 set formatBlackbox.In0 "C++"
55 set formatBlackbox.In1 "XML"
57 new StringSelect stringselectorFormat
58 set stringselectorFormat.In0 "C++"
59 set stringselectorFormat.In1 "XML"
60 connect formatBlackbox.Out stringselectorFormat.In
62 #---------------------------------------------------------------------
64 new OutputText dirOutput
65 connect dir.Out dirOutput.In
67 new LayoutLine layoutTop
68 connect windowTitle.Widget layoutTop.Widget1
69 connect dirOutput.Widget layoutTop.Widget2
70 connect nameBlackbox.Widget layoutTop.Widget3
71 connect namePackage.Widget layoutTop.Widget4
72 connect author.Widget layoutTop.Widget5
73 connect description.Widget layoutTop.Widget6
75 new LayoutSplit layoutTypeFormat
76 connect typeBlackbox.Widget layoutTypeFormat.Widget1
77 connect formatBlackbox.Widget layoutTypeFormat.Widget2
78 set layoutTypeFormat.Proportion 60
80 new CommandButton createButton
81 set createButton.In "print $concatStr.Out$; exec command; "
82 set createButton.Label "Run"
84 new LayoutLine layoutButtons
85 set layoutButtons.Orientation Horizontal
86 # connect cancelButton.Widget buttons.Widget1
87 connect createButton.Widget layoutButtons.Widget2
89 new LayoutSplit layoutBot
90 connect layoutTypeFormat.Widget layoutBot.Widget1
91 connect layoutButtons.Widget layoutBot.Widget2
92 set layoutBot.Proportion 70
95 connect layoutTop.Widget main.Widget1
96 connect layoutBot.Widget main.Widget2
97 set main.Proportion 50
98 set main.WinTitle "Create new black box"
99 # set main.WinDialog true
100 set main.WinWidth 700
101 set main.WinHeight 600
103 #---------------------------------------------------------------------
106 #-----------------------------------------------------------------------------
107 new Configuration conf
108 # on windows : enclose paths between double quotes
109 # if system==0 (Linux) dquote=space (ascci code 32)
110 # if system==1 (Win) dquote==" (ascii code 34)
111 new StringSelect onsystem
112 set onsystem.In0 "32"
113 set onsystem.In1 "34"
115 connect conf.SystemType onsystem.In
116 connect onsystem.Out dquote.In
120 new ConcatStrings dirStr
122 connect dquote.Out dirStr.In2
123 connect dir.Out dirStr.In3
124 connect dquote.Out dirStr.In4
128 new ConcatStrings packageNameStr
129 set packageNameStr.In1 " "
130 connect namePackage.Out packageNameStr.In2
131 set packageNameStr.In3 " "
134 new ConcatStrings blackboxNameStr
135 set blackboxNameStr.In1 " "
136 connect nameBlackbox.Out blackboxNameStr.In2
137 set blackboxNameStr.In3 " "
140 new ConcatStrings typeStr
142 connect stringselectorType.Out typeStr.In2
146 new ConcatStrings formatStr
147 set formatStr.In1 " "
148 connect stringselectorFormat.Out formatStr.In2
149 set formatStr.In3 " "
152 new ConcatStrings authorStr
153 set authorStr.In1 " '"
154 connect author.Out authorStr.In2
155 set authorStr.In3 "' "
158 new ConcatStrings descriptionStr
159 set descriptionStr.In1 " '"
160 connect description.Out descriptionStr.In2
161 set descriptionStr.In3 "' "
163 # Command string creation
164 new ConcatStrings concatStrCommand
165 set concatStrCommand.In1 " "
166 connect dquote.Out concatStrCommand.In2
167 connect conf.BinPath concatStrCommand.In3
168 connect conf.FileSeparator concatStrCommand.In4
169 set concatStrCommand.In5 "bbCreateBlackBox"
170 connect dquote.Out concatStrCommand.In6
171 set concatStrCommand.In7 " "
173 # Params string creation
174 new ConcatStrings concatStrParam
175 connect dirStr.Out concatStrParam.In1
176 connect packageNameStr.Out concatStrParam.In2
177 connect blackboxNameStr.Out concatStrParam.In3
178 connect typeStr.Out concatStrParam.In4
179 connect formatStr.Out concatStrParam.In5
180 connect authorStr.Out concatStrParam.In6
181 connect descriptionStr.Out concatStrParam.In7
183 # Command + parameters string creation
184 new ConcatStrings concatStr
185 connect dquote.Out concatStr.In1
186 connect concatStrCommand.Out concatStr.In2
187 connect concatStrParam.Out concatStr.In3
188 connect dquote.Out concatStr.In4
190 # Box which executes the command
191 new ExecSystemCommand command
192 connect concatStr.Out command.In