Of course, symbolic data attached to box can be
{\bf queried}: what are the inputs/outputs of the box ?
-what are their type ? description ? etc.
+what are their type ? their description ? etc.
This allows {\bf automatic documentation} of boxes.
The abstract definition of black boxes is the most basic
Try typing in the input zone (in this manual,
-the commands entered by the user will be preceded by a prompt '>') :
+the commands entered by the user will be preceded by a prompt '(>)') :
\begin{verbatim}
> help
\end{verbatim}
category
config
connect
+ debug
define
delete
description
include
index
input
+ kind
load
message
new
+ newgui
output
package
print
quit
reset
set
- unload
+ unload
\end{verbatim}
To get help on a particular command type \texttt{help <command-name>},
\begin{verbatim}
std
Add
- ...
+ ConcatStrings
+ Configuration
+ Div
+ ...
+ StringRelay
+ StringSelect
user
workspace
>
\end{verbatim}
Now \bbi knows the package \texttt{std} and the black boxes it provides,
-such as the \texttt{'Add'} box. Remark that the
+such as the \texttt{'Add'} box, the \texttt{'ConcatStrings'}. Remark that the
content of \texttt{std} may vary from one version to another
as new black boxes might be added to it.
If you type:
You get:
\begin{verbatim}
Black Box <std::Add>
- Adds its inputs
- By: laurent.guigues at creatis.insa-lyon.fr
- Categories : atomic box;math;
- * Inputs:
- 'BoxExecute' <bbtk::Void> : Any signal received by this input executes the box
- 'BoxProcessMode' <String> : Sets the processing mode of the box (Pipeline | Always | Reactive)
- 'In1' <Double> : First number to add
- 'In2' <Double> : Second number to add
+ Adds its inputs
+ By : laurent.guigues@creatis.insa-lyon.fr
+ Categories : atomic box;math;
+ * Inputs :
+ 'BoxExecute' <bbtk::Void> [signal] : Any signal received by this input executes the box
+ 'BoxProcessMode' <String> [] : Sets the processing mode of the box (Pipeline | Always | Reactive)
+ 'In1' <Double> [] : First number to add
+ 'In2' <Double> [] : Second number to add
* Outputs :
- 'BoxChange' <bbtk::Void> : Signal modifications of the box
- 'Out' <Double> : Result'In1' <double>: First number to add
+ 'BoxChange' <bbtk::Void> [signal] : Signals modifications of the box
+ 'Out' <Double> [] : Result
\end{verbatim}
Like previously,
The \texttt{'a'} at the end is the \emph{name} of the instance,
which will be used to reference it later.
-It is important to make the difference between box \emph{types}
-and \emph{instances} of box types.
-The \texttt{Add} box of the package \texttt{std} is in fact
-a \emph{type} of box, like \texttt{int} is a type of data
+It is important to distinguish a box \emph{types}
+and an \emph{instance} of a box type.
+The \texttt{Add} box of the package \texttt{std} is actually
+a \emph{box type} , like \texttt{int} is a data type
in \texttt{C} langage. The \texttt{new} command allows to create
an instance of a box type, exactly like \texttt{int i;} in
a \texttt{C} code declares a variable of type \texttt{int} whose
'a' <std::Add>
\end{verbatim}
-which means that \bbi's workspace now contains a black box
-of type \texttt{std::Add} and name \texttt{a}.
+which means that \bbi workspace now contains a black box named \texttt{a},
+of type \texttt{std::Add}.
Now look back at the help on \texttt{Add} boxes:
you can see that this type of box has two inputs,
\item Converts the output of the box to a string if possible
(see below)
\item Substitutes the result in the string to print
+\item postpone an implicit 'new line' character to the string
\end{enumerate}
Box processing is needed if:
\item In all \bbi, to reference the input called \texttt{i}
of a black box called \texttt{b} you must type \texttt{'b.i'}.
The same syntax holds for outputs.
-\item \texttt{print} prints a string, substituting each substring of the form \$b.o\$ by the value of the output \texttt{o} of the black box \texttt{b}.
+\item \texttt{print} prints a string, substituting each substring of the form \$b.o\$ by the value of the output \texttt{o} of the black box \texttt{b}. Note that an
+implicit trailing 'new line character' is added at the final string.
\item \texttt{exec} runs the process of a box if needed.
\item \texttt{quit} quits \bbi.
\end{itemize}