]> Creatis software - bbtk.git/blob - packages/toolsbbtk/bbs/appli/CreateBlackBox.bbs
Create Black Box bbs + .bat + Bug interface Windows
[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 "- - - - - - - - - - - - - -  Create Blackbox  - - - - - - - - - - - - - -"
10
11 new DirectorySelector dir
12     set dir.Title "Select the location of your new package"
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 LayoutLine info
69     connect windowTitle.Widget info.Widget1
70     connect nameBlackbox.Widget info.Widget2
71     connect namePackage.Widget info.Widget3
72     connect author.Widget info.Widget4
73     connect description.Widget info.Widget5
74     connect layoutHor.Widget info.Widget6
75     set info.WinDialog true
76     set info.WinWidth 350 
77     set info.WinHeight 500 
78 exec info
79
80
81 #---------------------------------------------------------------------
82
83 new ConcatStrings dirStr
84  connect dir.Out dirStr.In1
85  set dirStr.In2 " "
86
87 new ConcatStrings packageNameStr
88  connect namePackage.Out packageNameStr.In1
89  set packageNameStr.In2 " "
90
91 new ConcatStrings blackboxNameStr
92  connect nameBlackbox.Out blackboxNameStr.In1
93  set blackboxNameStr.In2 " "
94
95 new ConcatStrings typeStr
96  connect stringselectorType.Out typeStr.In1
97  set typeStr.In2 " "
98
99 new ConcatStrings formatStr
100  connect stringselectorFormat.Out formatStr.In1
101  set formatStr.In2 " "
102
103 new ConcatStrings authorStr
104  connect author.Out authorStr.In1
105  set authorStr.In2 " "
106
107 new ConcatStrings descriptionStr
108  connect description.Out descriptionStr.In1
109  set descriptionStr.In2 " "
110
111 new Configuration conf
112
113 new ConcatStrings commandStr
114     set commandStr.In1 "."
115     connect conf.FileSeparator commandStr.In2 
116     set commandStr.In3 "bbCreateBlackBox "
117
118 new ConcatStrings concatStr
119     connect  commandStr.Out             concatStr.In1 
120     connect dirStr.Out                          concatStr.In2 
121     connect packageNameStr.Out  concatStr.In3 
122     connect blackboxNameStr.Out concatStr.In4
123     connect typeStr.Out                         concatStr.In5
124     connect formatStr.Out                       concatStr.In6
125     connect authorStr.Out                       concatStr.In7
126     connect descriptionStr.Out          concatStr.In8
127
128
129 new ExecSystemCommand command
130     connect concatStr.Out command.In
131     print $concatStr.Out$
132
133 exec command
134
135 #seg fault :
136 #quit