Setting up SigLab
SigLab was developped and tested under Linux (RedHat 5.1 and 5.2) and Solaris 2.5, 2.5.1, 2.6. I will test it soon under Irix and HP-UX. I hope that some users will try to do a port to windows 95 and NT. Basically, if the tcl/tk binding works under windows it should be simple (just look at the small notes hereunder).
1. SigLab
SigLab comes in a .tgz file. Please go in the directory where your Scilab is setup :
>which scilab /soft1/scilab-2.5/bin/scilab > cd /soft1/scilab > tar -xvzf siglab-1.3.tgzThe following file appears in /soft1/scilab :
bin/siglab bin/ptdel.tcl siglab2/siglab siglab2/siglab.linux siglab2/siglab.solaris siglab2/FREEALTER.TXT siglab2/scilab3_ui_test.tcl siglab2/bugs.txt siglab2/create_file_list.sci siglab2/signal_names.txt.ori siglab2/create_test_file.sci siglab2/startup_tkdf.sci debug.sci siglab2/go_dialog2_ui.tcl siglab2/test_file_bin.sci siglab2/graphic_list.sci siglab2/test_file_list.sci siglab2/graphic_tkdf.sci siglab2/test_file_matrix.sci siglab2/init_tkdf.sci siglabtest_go_dialog.tcl siglab2/load_file.sci siglab2/test_graphic.sci siglab2/load_file_list.sci siglab2/test_order_list.tcl siglab2/math_tkdf.sci siglab2/test_synchronize.sci siglab2/matrix_list.sci siglab2/tkdf.sci siglab2/.scilab siglab2/.tkdf.sci siglab2/ptdel.tcl siglab2/save_dialog.tcl siglab2/copy_dialog.tcl siglab2/write_file.sci siglab2/combobox.tcl siglab2/ptolemy/SDFSciGraph.pl siglab2/ptolemy/SDFSciDisplay.h siglab2/ptolemy/SDFSciDisplay.cc siglab2/ptolemy/ptsiglab siglab2/doc/... siglab2/test/sinus.txt siglab2/test/rand.txt
You now need to find a siglab.linux or siglab.solaris file in the directory siglab. You just need to customize this file and to do link of this file to bin/siglab.
Basically, under linux, change the variable SCI in the file siglab.linux for having it reflecting the directory where scilab is set up. Then go into the directory bin and :
ln -s ../siglab2/siglab.linux siglabUnder Solaris, you will need to change the information above in the file siglab.solaris but also to give the path where tcl/tk stuff and X11R6 libs are stored.
So change the TCLTK variable into what fits, and also the X11R6 variable. For example on my system, I have tcl/tk8.0 in the repertory /free0/tcltk-8.0
I find there the repertory : bin/ include/ lib/ man/
And X11R6 is in /home/X11R6 where I find : bin/ include/ lib/
Now you just have to go in the bin directory of scilab. In my case :
cd /soft1/scilab-2.5/bin
And create the symbolic link :
ln -s ../siglab2/siglab.solaris siglabIf you are neither under linux or solaris. Copy the siglab.solaris file to siglab.myarch, change it as explained above for solaris, and finally change the ARCH variable for reflecting your architecture.
By the way, you may change the PRINTER list in the scilab file (bin/scilab) if it was not done before. You may know the list of available printer in looking at the list at the bottom of the printer tool in solaris or in taking the list of directory in /var/spool/lpd under linux.
A last detail, you need to have the command "wc -l" working. It is used when signal in txt format are loaded to determine the length of the file. This is standard, so you should not worry much about that.
Well now, everything should be fine. Just go in some directory and type siglab. Everything should start up. In the test directory you will find the 2 signals for playing around. You will have a quick introduction in reading the 20' guide in the siglab2/doc directory.
If you have problem, in fact, the best thing is first to test the tcl/tk scilab interface in launching scilab, and then typing :
TK_EvalStr('tk_getSaveFile')
If you get a save dialog window, and if you can click on "Cancel" and having the window disappearing, then it means that the tcl/tk interface is working fine. So if something is not running, it is another problem. The very first thing to suspect is the presence and the value of the TCL_LIBRARY and TK_LIBRARY. You can get these values directly from scilab in asking getenv('TCL_LIBRARY') on the command line. You may have a lot of debug information in putting 1 after each DEBUG_XXX variables that are at the start of tkdf.sci. However these informations will be related to the siglab program behaviour and not the tcl/tk interfaces behaviour.
2. Siglab under well, you know, the, hem, near the door, well you know (please, break 95, 98, NT or 2000 of them)
There is an installer. Just use it. Scilab must be setup on your machine.If you want to do it manually, just untar the sources in the scilab directory. It creates a siglab2 directory.
Just create a shortcut on your desktop in creating a new shortcut for runscilab.exe, then modify the properties in :
Target : "C:/InstallDirOfScilab/bin/runscilab.exe" -f siglab.sci
to be able to start Siglab.
3. Ptolemy
SigLab was created for Ptolemy users. As a heavy Ptolemy user , I was feeling (and all customers for which I do Ptolemy support) that Ptolemy was really missing a tool for analysing simulation results. SigLab is this tool.
Basically, you just need to install the ptsiglab file in $PTOLEMY/bin.
But there is a bad news. Ptolemy is (till now) using tcl7.6/tk4.2 and Scilab requires tcl/tk8.0. It means that both tcl/tk must be setup (this is not a problem) but that when siglab is started from Ptolemy all environment variables must be switched from the "Ptolemy" tcl/tk to tcl/tk8.0.
It means that you must edit the file $PTOLEMY/bin/ptsiglab . You normally just have to change the basic values (X11R6, TCLTK, SCI).
As you certainly remarked, I am a lazy guy that do not like to do again something that exists. So in the file SciDisplay.cc , I need for a strange processing the grep -Fv command. Very unlikely -v is not a standard grep option, it exists in the gnu version of grep. So you MUST have this grep command set up on your system, and you must replace grep by /the/good/gnu/path/grep. (obviously if you have our cds Free&ALter Soft for Solaris or Irix or HP-UX you have that or you just need a couple of minutes to set it up). You certainly can easily find a precompiled gnu grep for your system.
Once you have ptsiglab set up, you certainly wish to have access to the SDFSciGraph and SDFSciGraphC stars. You have here 2 solutions. The first one is to copy that in your usual star development directory, to make a star (*) in vem, and to choose your usual palette there. This is good for a test and bad if you wish to have a lot of people working with SigLab. In this case, the best choice is to :
- copy the files SDFSciGraph.pl, SDFSciGraphC.pl, SciDisplay.h, SciDisplay.cc to $PTOLEMY/src/domains/sdf/stars,
- add the 2 stars in the make.template PL_SRCS list (look at the make.template that I provided),
- cd $PTOLEMY/obj.$PTARCH/domains/sdf/stars
- make depend
- make
- make install

You should now have a SciGraph icon in the sinks palette. Just edit the sink palette, and place the icons where you wish (I personnaly placed it, just near the matlab icon, there is a hole there and scilab is close to matlab). Do not forget to change the rights of the different files in order to have them readable by everybody.
3.1. Scilab configuration part 2
Before creating the siglab.linux and siglab.solaris files, I used to modify the scilab startup files. It should no more be necessary, however, I detail hereunder what I was doing. It could be useful in case of problems especially with tcl/tk.
SigLab relies heavily on Tcl/Tk 8.0 and its interface to scilab. In order to have this interface working fine you must know where the tcl/tk libraries are. In fact not the librarie parts that are written in tcl/tk. For example, in my case, I have :
which tclsh8.0 /free0/tcltk-8.0/bin/tclsh8.0And if I look in /free0/tcltk-8.0/lib, I found all shared libraries such as : libtk8.0.so, libtcl8.0.so. But then they are 2 directories hereunder tk8.0 and tcl8.0 where you can find stuff as : history.tcl, init.tcl, ... (tcl8.0) and bgerror.tcl button.tcl dialog.tcl ... (tk8.0). This 2 directories are very important and must be known to scilab. You must then edit the scilab script and add :
TK_LIBRARY=/free0/tcltk-8.0/lib/tk8.0 TCL_LIBRARY=/free0/tcltk-8.0/lib/tcl8.0 export TK_LIBRARY export TCL_LIBRARYJust after the lines :
if test "$SCI" = ""; then SCI="/free1/scilab-2.4" fi export SCII know that this is tedious but it is very important, if you do not do that you may have strange problems such as no reactions to your mouse click, or save dialog refusing to show. And these bugs are difficult to explain (when you do not know what it is).



