]> Creatis software - bbtk.git/blob - packages/toolsbbtk/bbs/appli/CreateBlackBox.bbs
12547923efd52ca4830b70e22fd14b3739db02c8
[bbtk.git] / packages / toolsbbtk / bbs / appli / CreateBlackBox.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 "NEW_BLACKBOX"
17
18 new InputText namePackage
19     set namePackage.Title "Package name         (1 word)"
20     set namePackage.In "__PACKAGE__"
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 LayoutLine layoutHor
64   set  layoutHor.Orientation H
65   connect typeBlackbox.Widget layoutHor.Widget1
66   connect formatBlackbox.Widget layoutHor.Widget2
67
68 #new CommandButton cancelButton
69 #    set cancelButton.In "quit"
70 #    set cancelButton.Label "Cancel"
71
72 new CommandButton createButton
73     set createButton.In "print $concatStr.Out$; exec command; "
74     set createButton.Label "Run"
75
76 new LayoutLine buttons
77     set buttons.Orientation Horizontal
78 #    connect cancelButton.Widget buttons.Widget1
79     connect createButton.Widget buttons.Widget2
80
81 new LayoutLine main
82     connect windowTitle.Widget main.Widget1
83     connect nameBlackbox.Widget main.Widget2
84     connect namePackage.Widget main.Widget3
85     connect author.Widget main.Widget4
86     connect description.Widget main.Widget5
87     connect layoutHor.Widget main.Widget6
88     connect buttons.Widget main.Widget7
89     set main.WinTitle "Create new black box"
90     set main.WinDialog true
91     set main.WinWidth 350 
92     set main.WinHeight 500 
93
94 #---------------------------------------------------------------------
95
96 new ASCII ascii
97   set ascii.In 34
98
99 new ConcatStrings dirStr
100  set dirStr.In1 " "
101  connect ascii.Out dirStr.In2
102  connect dir.Out dirStr.In3
103  connect ascii.Out dirStr.In4
104  set dirStr.In5 " "
105
106 new ConcatStrings packageNameStr
107  connect namePackage.Out packageNameStr.In1
108  set packageNameStr.In2 " "
109
110 new ConcatStrings blackboxNameStr
111  connect nameBlackbox.Out blackboxNameStr.In1
112  set blackboxNameStr.In2 " "
113
114 new ConcatStrings typeStr
115  connect stringselectorType.Out typeStr.In1
116  set typeStr.In2 " "
117
118 new ConcatStrings formatStr
119  connect stringselectorFormat.Out formatStr.In1
120  set formatStr.In2 " "
121
122 new ConcatStrings authorStr
123  set authorStr.In1 " '"
124  connect author.Out authorStr.In2
125  set authorStr.In3 "' "
126
127 new ConcatStrings descriptionStr
128  set descriptionStr.In1 " '"
129  connect description.Out descriptionStr.In2
130  set descriptionStr.In3 "' "
131
132 new Configuration conf
133
134 new ConcatStrings commandStr
135     set                                         commandStr.In1 " "
136     connect ascii.Out                   commandStr.In2
137     connect conf.BinPath                commandStr.In3
138     connect conf.FileSeparator  commandStr.In4
139     set                                         commandStr.In5 "bbCreateBlackBox"
140     connect ascii.Out                   commandStr.In6
141     set                                         commandStr.In7 " "
142
143
144 new ConcatStrings concatStr
145     connect  commandStr.Out             concatStr.In1 
146     connect dirStr.Out                          concatStr.In2 
147     connect packageNameStr.Out  concatStr.In3 
148     connect blackboxNameStr.Out concatStr.In4
149     connect typeStr.Out                         concatStr.In5
150     connect formatStr.Out                       concatStr.In6
151     connect authorStr.Out                       concatStr.In7
152     connect descriptionStr.Out          concatStr.In8
153
154 new ConcatStrings concatStr2
155     connect  ascii.Out                          concatStr2.In1 
156     connect concatStr.Out                       concatStr2.In2 
157     connect ascii.Out                           concatStr2.In3
158
159 new ExecSystemCommand command
160     connect concatStr2.Out command.In
161
162 exec dir
163 exec main
164