Reorganization
Allan Cornet [Tue, 3 Oct 2006 08:49:39 +0000 (08:49 +0000)]
update demos

21 files changed:
scilab/modules/metanet/demos/meta.dem
scilab/modules/metanet/demos/metro.sci
scilab/modules/metanet/etc/metanet.start
scilab/modules/optimization/etc/optimization.start
scilab/modules/others/demos/alldems.dem [deleted file]
scilab/modules/others/demos/simulation/bike/bike2.dem
scilab/modules/others/demos/simulation/npend/macros.sci
scilab/modules/others/demos/simulation/npend/n_pendulum.sci
scilab/modules/others/demos/simulation/ode/ode.dem
scilab/modules/others/demos/simulation/ode/odenew.dem
scilab/modules/others/demos/simulation/ode/odenew1.dem
scilab/modules/others/demos/simulation/ode/odenew2.dem
scilab/modules/others/demos/simulation/ode/odeold.dem
scilab/modules/others/demos/simulation/wheel2/show.sci
scilab/modules/others/demos/velpic/velpic.dem
scilab/modules/others/etc/others.start
scilab/modules/pvm/demos/pvm.dem
scilab/modules/pvm/demos/pvm1.sce
scilab/modules/pvm/etc/pvm.start
scilab/modules/scilab2fortran/demos/demotrad.dem
scilab/modules/scilab2fortran/etc/scilab2fortran.start

index dd5584d..91529f1 100644 (file)
@@ -1,4 +1,4 @@
-getf(SCI+'/demos/metanet/metro.sci','c');
+getf(SCI+'/modules/metanet/demos/metro.sci','c');
 // Copyright INRIA
 mode(0);
 num=x_message([' ';
index 5978692..3f21779 100644 (file)
@@ -4,7 +4,7 @@ function []=metro()
 //of the stations
 //needs the execution of the program 'metrostart' for the data of the graph
 // Copyright INRIA
-  inin=file('open',SCI+'/demos/metanet/node2station','old');
+  inin=file('open',SCI+'/modules/metanet/demos/node2station','old');
   mamat=read(inin,388,1,'(a40)');
   file('close',inin);
   La=['Abbesses','Alesia','Alexandre Dumas','Alfort-Ecole Veterinaire',..
@@ -148,8 +148,8 @@ function []=metro()
          Lnode(Arrivee)=-1;  
        end
       end
-      g=load_graph(SCI+'/demos/metanet/paris');
-      gg=load_graph(SCI+'/demos/metanet/paris2');
+      g=load_graph(SCI+'/modules/metanet/demos/paris');
+      gg=load_graph(SCI+'/modules/metanet/demos/paris2');
       gg.default_font_size=8;
       gg.node_y=abs(gg.node_y-max(gg.node_y))
       win=show_graph(gg,'rep');
index 87378aa..497c3e2 100644 (file)
@@ -10,14 +10,17 @@ global LANGUAGE
 
 path = get_absolute_file_path('metanet.start');
 path = getshortpathname(path);
+pathdemos = pathconvert(part(path,1:(length(path)-5))+'/demos/meta.dem',%f,%f);
 
 if LANGUAGE == 'fr' then
-       path = pathconvert(part(path,1:(length(path)-5))+'/help/fr',%f,%f);
-       add_help_chapter("Metanet : Graphes & Reseaux",path);
+       pathhelp = pathconvert(part(path,1:(length(path)-5))+'/help/fr',%f,%f);
+       add_help_chapter("Metanet : Graphes & Reseaux",pathhelp);
+       add_demo("Metanet : Graphes & Reseaux",pathdemos);
 elseif LANGUAGE == 'eng' then
-       path = pathconvert(part(path,1:(length(path)-5))+'/help/eng',%f,%f);
-       add_help_chapter("Metanet : Graph and Network toolbox",path);
+       pathhelp = pathconvert(part(path,1:(length(path)-5))+'/help/eng',%f,%f);
+       add_help_chapter("Metanet : Graph and Network toolbox",pathhelp);
+       add_demo("Metanet : Graph and Network toolbox",pathdemos);
 end
 
-clear path get_absolute_file_path add_help_chapter LANGUAGE;
+clear pathhelp pathdemos get_absolute_file_path add_help_chapter LANGUAGE;
 // ====================================================================
index 21ac0d0..775f737 100644 (file)
@@ -10,14 +10,17 @@ global LANGUAGE
 
 path = get_absolute_file_path('optimization.start');
 path = getshortpathname(path);
+pathdemos = pathconvert(part(path,1:(length(path)-5))+'/demos/optimization.dem',%f,%f);
 
 if LANGUAGE == 'fr' then
-       path = pathconvert(part(path,1:(length(path)-5))+'/help/fr',%f,%f);
-       add_help_chapter("Optimisation et Simulation",path);
+       pathhelp = pathconvert(part(path,1:(length(path)-5))+'/help/fr',%f,%f);
+       add_help_chapter("Optimisation et Simulation",pathhelp);
+       add_demo("Optimisation et Simulation",pathdemos);
 elseif LANGUAGE == 'eng' then
-       path = pathconvert(part(path,1:(length(path)-5))+'/help/eng',%f,%f);
-       add_help_chapter("Optimization and Simulation",path);
+       pathhelp = pathconvert(part(path,1:(length(path)-5))+'/help/eng',%f,%f);
+       add_help_chapter("Optimization and Simulation",pathhelp);
+       add_demo("Optimization and Simulation",pathdemos);
 end
 
-clear path get_absolute_file_path add_help_chapter LANGUAGE;
+clear pathhelp pathdemos get_absolute_file_path add_help_chapter LANGUAGE;
 // ====================================================================
diff --git a/scilab/modules/others/demos/alldems.dem b/scilab/modules/others/demos/alldems.dem
deleted file mode 100644 (file)
index d94b42f..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-mode(-1)
-// Copyright INRIA
-oldln=lines();
-lines(0)
-global demolist
-// Demos list is defined in scilab.start
-deff('[]=demoex(num)','exec(demolist(num,2),-1)')
-while %t then
-  num=tk_choose(demolist(:,1),['Click to choose a demo';
-'(see also in SCIDIR/demos/...)']);
-  if num==0 then 
-     lines(oldln(1))
-     return
-  else
-     demoex(num)
-  end,
-end
index 8975e21..24c45b3 100644 (file)
@@ -1,6 +1,6 @@
 mode(0);
 // Copyright INRIA
-path='SCI/demos/bike/';
+path='SCI/modules/others/demos/simulation/bike/';
 xbasc();
 fs = get('figure_style');
 set("figure_style","old");
index 84dad44..03594cf 100644 (file)
@@ -91,16 +91,16 @@ function []=npend_build_and_load()
 // we use TMPDIR 
 
   if ~c_link('npend') then
-    cd = getcwd(); 
+    cdpath = getcwd(); 
     chdir(TMPDIR); 
-    fcode=mgetl(SCI+'/demos/npend/Maple/dlslv.f');mputl(fcode,'dlslv.f')
-    fcode=mgetl(SCI+'/demos/npend/Maple/ener.f');mputl(fcode,'ener.f')
-    fcode=mgetl(SCI+'/demos/npend/Maple/np.f');mputl(fcode,'np.f')
-    fcode=mgetl(SCI+'/demos/npend/Maple/npend.f');mputl(fcode,'npend.f')
+    fcode=mgetl(SCI+'/modules/others/demos/simulation/npend/Maple/dlslv.f');mputl(fcode,'dlslv.f')
+    fcode=mgetl(SCI+'/modules/others/demos/simulation/npend/Maple/ener.f');mputl(fcode,'ener.f')
+    fcode=mgetl(SCI+'/modules/others/demos/simulation/npend/Maple/np.f');mputl(fcode,'np.f')
+    fcode=mgetl(SCI+'/modules/others/demos/simulation/npend/Maple/npend.f');mputl(fcode,'npend.f')
     files = ['npend.o','np.o','ener.o','dlslv.o' ];
     ilib_for_link(['npend';'np';'ener'],files,[],"f");
     exec loader.sce 
-    chdir(cd) 
+    chdir(cdpath) 
   end
 endfunction 
 
index df7db52..66add4e 100644 (file)
@@ -24,8 +24,8 @@ function []=npend_build_and_load()
 // we use TMPDIR 
 
   if ~c_link('npend') then
-    path='SCI/demos/simulation/npend/Maple/'
-    cd = getcwd(); 
+    path=SCI+'/modules/others/demos/simulation/npend/Maple/'
+    cdpath = getcwd(); 
     chdir(TMPDIR); 
     fcode=mgetl(path+'dlslv.f');mputl(fcode,'dlslv.f')
     fcode=mgetl(path+'ener.f');mputl(fcode,'ener.f')
@@ -34,7 +34,7 @@ function []=npend_build_and_load()
     files = ['npend.o','np.o','ener.o','dlslv.o' ];
     ilib_for_link(['npend';'np';'ener'],files,[],"f");
     exec loader.sce 
-    chdir(cd) 
+    chdir(cdpath) 
   end
 endfunction 
 
index 9752bdc..bf82b27 100644 (file)
@@ -2,7 +2,7 @@ mode(-1)
 // Copyright INRIA
 oldln=lines();
 lines(0)
-deff('[]=demoex(num)','exec(''SCI/demos/simulation/ode/''+demolist(num,2),-1)')
+deff('[]=demoex(num)','exec(''SCI/modules/others/demos/simulation/ode/''+demolist(num,2),-1)')
 
 demolist=[
 'Simple ODE','ode1.dem';
index eb41641..54355e1 100644 (file)
@@ -1,7 +1,7 @@
 // Copyright INRIA
 
 mode(-1)
-deff("[]=demoexc(fil)","exec(""SCI/demos/ode/""+fil)")
+deff("[]=demoexc(fil)","exec(""SCI/modules/others/demos/simulation/ode/""+fil)")
 
 while %t do
   n=tk_choose(["ODE 1D","ODE 2D"],"Select a demo");
index d8ba36c..e1a687d 100644 (file)
@@ -1,7 +1,7 @@
 // Copyright INRIA
 
 mode(-1)
-deff("[]=demoexc(fil)","exec(""SCI/demos/ode/""+fil)")
+deff("[]=demoexc(fil)","exec(""SCI/modules/others/demos/simulation/ode/""+fil)")
 
 x_message(["Examples of ODE''s in 1 dimension";" ";
            "A trajectory is plotted by clicking on the";
index f0b5a85..64810ab 100644 (file)
@@ -1,7 +1,7 @@
 // Copyright INRIA
 
 mode(-1)
-deff("[]=demoexc(fil)","exec(""SCI/demos/ode/""+fil)")
+deff("[]=demoexc(fil)","exec(""SCI/modules/others/demos/simulation/ode/""+fil)")
 
 x_message(["Examples of autonomous ODE''s in 2 dimensions";" ";
            "A trajectory is plotted on the plane phase";
index 608886a..ec1fad5 100644 (file)
@@ -2,7 +2,7 @@ mode(-1)
 // Copyright INRIA
 oldln=lines();
 lines(0)
-deff('[]=demoex(num)','exec(''SCI/demos/ode/''+demolist(num,2),-1)')
+deff('[]=demoex(num)','exec(''SCI/modules/others/demos/simulation/ode/''+demolist(num,2),-1)')
 demolist=[
 'Simple ODE','ode1.dem';
 'Chemical process (Stiff)','ode2.dem';
index 6c140e4..7f02541 100644 (file)
@@ -129,7 +129,7 @@ function []=wheel_build_and_load()
   if ~c_link('wheel') then
     cd = getcwd(); 
     chdir(TMPDIR); 
-    path='SCI/demos/simulation/wheel2/Maple/'
+    path=SCI+'/modules/others/demos/simulation/wheel2/Maple/'
     fcode=mgetl(path+'/dlslv.f');mputl(fcode,'dlslv.f')
     fcode=mgetl(path+'/wheel.f');mputl(fcode,'wheel.f')
     fcode=mgetl(path+'/wheelg.f');mputl(fcode,'wheelg.f')
index d1fe4cc..8b8ff49 100644 (file)
@@ -6,7 +6,12 @@ function []=velpic_build_and_load()
   if ~c_link('testpt') then
     curdir = getcwd(); 
     chdir(TMPDIR); 
-    unix_s('cp '+SCI+'/demos/velpic/*.f .'); 
+    if MSDOS then
+     unix_s('copy /Y '+pathconvert(SCI+'/modules/others/demos/velpic',%f,%f,'w')+'\*.f *.f'); 
+    else
+     unix_s('cp '+SCI+'/modules/others/demos/velpic/*.f .'); 
+    end
+    
     files = ['id_rgn.o','testpt.o' ];
     ilib_for_link(['testpt';'idrgn'],files,[],"f");
     exec loader.sce 
@@ -17,7 +22,7 @@ velpic_build_and_load()
 
 // Copyright INRIA
 
-getf('SCI/demos/velpic/velpic.sci')
+getf('SCI/modules/others/demos/velpic/velpic.sci')
 
 xselect()
 x=velpic(20,20);
index 6f36f1d..f1deb92 100644 (file)
@@ -10,14 +10,20 @@ global LANGUAGE
 
 path = get_absolute_file_path('others.start');
 path = getshortpathname(path);
+pathdemos1 = pathconvert(part(path,1:(length(path)-5))+'/demos/simulation/simulation.dem',%f,%f);
+pathdemos2 = pathconvert(part(path,1:(length(path)-5))+'/demos/velpic/velpic.dem',%f,%f);
 
 if LANGUAGE == 'fr' then
-       path = pathconvert(part(path,1:(length(path)-5))+'/help/fr',%f,%f);
-       add_help_chapter("Autres",path);
+       pathhelp = pathconvert(part(path,1:(length(path)-5))+'/help/fr',%f,%f);
+       add_help_chapter("Autres",pathhelp);
+       add_demo("Simulation",pathdemos1);
+       add_demo("Autres",pathdemos2);
 elseif LANGUAGE == 'eng' then
-       path = pathconvert(part(path,1:(length(path)-5))+'/help/eng',%f,%f);
-       add_help_chapter("Others",path);
+       pathhelp = pathconvert(part(path,1:(length(path)-5))+'/help/eng',%f,%f);
+       add_help_chapter("Others",pathhelp);
+       add_demo("Simulation",pathdemos1);
+       add_demo("Others",pathdemos2);
 end
 
-clear path get_absolute_file_path add_help_chapter LANGUAGE;
+clear pathhelp pathdemos1 pathdemos2 get_absolute_file_path add_help_chapter LANGUAGE;
 // ====================================================================
index 3674196..ecbfb24 100644 (file)
@@ -24,7 +24,7 @@ end
 demos_name=[
     'Master and slave'
     ]
-exec('SCI/demos/pvm/pvm1.sce');
+exec('SCI/modules/pvm/demos/pvm1.sce');
 return
 while %t do
   n=tk_choose(demos_name,'Choose a demo')
@@ -32,7 +32,7 @@ while %t do
   case 0 then 
     break
   case 1 then  
-    exec('SCI/demos/pvm/pvm1.sce');
+    exec('SCI/modules/pvm/demos/pvm1.sce');
 
   end
 end
index 7ae13b8..47236b0 100644 (file)
@@ -10,15 +10,15 @@ if ok<>0 then disp('pvm daemon already active'),end;
 
 mes=x_message(['Start another Scilab process under PVM with the following instruction:';
            ' '
-          '[task_id,numt] = pvm_spawn(SCI+''/demos/pvm/script.sce'',1)'
+          '[task_id,numt] = pvm_spawn(SCI+''/modules/pvm/demos/script.sce'',1)'
           ' '
-          'SCI+''/demos/pvm/script.sce'' file is: '
+          'SCI+''/modules/pvm/demos/script.sce'' file is: '
           '======================================='
-          read(SCI+'/demos/pvm/script.sce',-1,1,'(a)')],..
+          read(SCI+'/modules/pvm/demos/script.sce',-1,1,'(a)')],..
            ['Ok','Cancel'])
 if mes==2 then return, end   
 
-[task_id,numt] = pvm_spawn(SCI+'/demos/pvm/script.sce',1)
+[task_id,numt] = pvm_spawn(SCI+'/modules/pvm/demos/script.sce',1)
 if numt<0 then
   x_message(['pvm_spawn aborts to create a new process'])
   return
index b5c3e56..9917076 100644 (file)
@@ -10,13 +10,16 @@ global LANGUAGE
 
 path = get_absolute_file_path('pvm.start');
 path = getshortpathname(path);
+pathdemos = pathconvert(part(path,1:(length(path)-5))+'/demos/pvm.dem',%f,%f);
 
 if LANGUAGE == 'fr' then
-       path = pathconvert(part(path,1:(length(path)-5))+'/help/fr',%f,%f);
-       add_help_chapter("Calculs Parallele avec PVM",path);
+       pathhelp = pathconvert(part(path,1:(length(path)-5))+'/help/fr',%f,%f);
+       add_help_chapter("Calculs Parallele avec PVM",pathhelp);
+       add_demo("Calculs Parallele avec PVM",pathdemos);
 elseif LANGUAGE == 'eng' then
-       path = pathconvert(part(path,1:(length(path)-5))+'/help/eng',%f,%f);
-       add_help_chapter("PVM parallel Toolbox",path);
+       pathhelp = pathconvert(part(path,1:(length(path)-5))+'/help/eng',%f,%f);
+       add_help_chapter("PVM parallel Toolbox",pathhelp);
+       add_demo("PVM parallel Toolbox",pathdemos);
 end
 // ====================================================================
 if MSDOS then
@@ -26,5 +29,5 @@ if MSDOS then
   end
 end
 // ====================================================================
-clear path get_absolute_file_path add_help_chapter LANGUAGE;
+clear pathhelp pathdemos get_absolute_file_path add_help_chapter LANGUAGE;
 // ====================================================================
index 9ae61c8..a80c41a 100644 (file)
@@ -1,8 +1,8 @@
 mode(-1)
 // Copyright INRIA
-getf('SCI/demos/sci2for/printspecs.sci','c')
+getf('SCI/modules/scilab2fortran/demos/printspecs.sci','c')
 deff('[]=message(txt)','write(%io(2),txt,''(a)'')')
-path='SCI/demos/sci2for/'
+path='SCI/modules/scilab2fortran/demos/'
 deff('[]=demoexc(fil)','exec(path+fil,-1)')
 
 while %t do
index 7d95bea..c74a905 100644 (file)
@@ -10,14 +10,17 @@ global LANGUAGE
 
 path = get_absolute_file_path('scilab2fortran.start');
 path = getshortpathname(path);
+pathdemos = pathconvert(part(path,1:(length(path)-5))+'/demos/demotrad.dem',%f,%f);
 
 if LANGUAGE == 'fr' then
-       path = pathconvert(part(path,1:(length(path)-5))+'/help/fr',%f,%f);
-       add_help_chapter("Scilab vers Fortran",path);
+       pathhelp = pathconvert(part(path,1:(length(path)-5))+'/help/fr',%f,%f);
+       add_help_chapter("Scilab vers Fortran",pathhelp);
+       add_demo("Scilab vers Fortran",pathdemos);
 elseif LANGUAGE == 'eng' then
-       path = pathconvert(part(path,1:(length(path)-5))+'/help/eng',%f,%f);
-       add_help_chapter("Scilab to Fortran",path);
+       pathhelp = pathconvert(part(path,1:(length(path)-5))+'/help/eng',%f,%f);
+       add_help_chapter("Scilab to Fortran",pathhelp);
+       add_demo("Scilab to Fortran",pathdemos);
 end
 
-clear path get_absolute_file_path add_help_chapter LANGUAGE;
+clear pathhelp pathdemos get_absolute_file_path add_help_chapter LANGUAGE;
 // ====================================================================