Use standard demo figure number so that it is closed automatically 14/2014/2
Vincent COUVERT [Tue, 21 Sep 2010 09:58:21 +0000 (11:58 +0200)]
Change-Id: I61fbf4d478f790b1fd9e44cf0c95b0ae9afc06d3

scilab/modules/cacsd/demos/lqg/lqg.dem
scilab/modules/cacsd/demos/lqg/lqg2.dem
scilab/modules/cacsd/demos/lqg/scheme.dem
scilab/modules/cacsd/demos/mixed.dem
scilab/modules/cacsd/demos/pid.dem

index 78e5a3f..52efc76 100644 (file)
@@ -17,7 +17,7 @@ function demo_lqg()
   xx=[x([1 2 2 7 4 6 3 4 5 6 3 3 5 5]);x([3,2,7,7,5,8,3,4,5,6,4,4,6,6])];
   yy=[y([3,1,1,1,3,3,2,2,2,2,2,4,2,4]);y([3,3,1,3,3,3,4,4,4,4,2,4,2,4])];
 
-  scf(0);
+  scf(100001);
   clf();
   show_window();
   a=gca();
@@ -103,7 +103,7 @@ function demo_lqg()
       disp("LQG demo stops!");break;
     case 1 then
       mode(1)
-      scf(0);
+      scf(100001);
       clf();
       show_window();
       bode(Tlqg);
@@ -122,12 +122,12 @@ function demo_lqg()
         n1=x_choose(['Step response?';'Impulse response?'],'Simulation:');
         select n1
         case 1 then
-          scf(1);
+          scf(100002);
           clf();
           show_window();
           plot2d([t',t'],[(csim('step',t,Tlqg))',ones(t')]);
         case 2 then
-          scf(1);
+          scf(100002);
           clf();
           show_window();
           plot2d([t',t'],[(csim('impul',t,Tlqg))',0*t']);
@@ -148,13 +148,13 @@ function demo_lqg()
         case 1 then
           mode(1)
           u=ones(1,Tmax);u(1)=0;
-          scf(1);clf();show_window();
+          scf(100002);clf();show_window();
           plot2d([(1:Tmax)',(1:Tmax)'],[(dsimul(Tlqg,u))',(ones(1:Tmax)')])
           mode(-1)
         case 2 then
           mode(1)
           u=zeros(1,Tmax);u(1)=1;
-          scf(1);clf();show_window();
+          scf(100002);clf();show_window();
           plot2d((1:Tmax)',(dsimul(Tlqg,u))')
           mode(-1)
         end
index f7988c1..1f13001 100644 (file)
@@ -22,7 +22,7 @@ function demo_lqg2()
   frq=logspace(-3,3);     //10^-3  to 10^3 
   y=svplot(Slqg);       //Computes singular values;
   clf();
-  xset("window",0);
+  scf(100001);
   gainplot(frq,y)   //Plot sing. values
   w1=1/(s+1);
   w2=100;
@@ -31,7 +31,7 @@ function demo_lqg2()
   [Kinf,ro]=h_inf(Pinf,r,0,0.1,50);
   [Sinf,Rinf,Tinf]=sensi(P22,Kinf);  //Sensitivity functions
   y=svplot(Sinf);       //Computes singular values;
-  xset("window",1);
+  scf(100002);
   show_window();
   gainplot(frq,y)   //Plot sing. values
 
index 5c65584..aa64819 100644 (file)
@@ -13,7 +13,7 @@ function demo_scheme()
   xx=[xmin,xmin,x([1 2 2 7 4 6 3 4 5 6 3 3 5 5]);xmax,xmax,x([3,2,7,7,5,8,3,4,5,6,4,4,6,6])];
   yy=[ymin,ymax,y([3,1,1,1,3,3,2,2,2,2,2,4,2,4]);ymin,ymax,y([3,3,1,3,3,3,4,4,4,4,2,4,2,4])];
     
-  scf(0);
+  scf(100001);
   clf();
   show_window();
   a=gca();
index 053965e..c8b3a37 100644 (file)
@@ -15,7 +15,7 @@ function demo_mixed()
   xx=[xmin,xmin,x([1 2 2 7 4 6 3 4 5 6 3 3 5 5]);xmax,xmax,x([3,2,7,7,5,8,3,4,5,6,4,4,6,6])];
   yy=[ymin,ymax,y([3,1,1,1,3,3,2,2,2,2,2,4,2,4]);ymin,ymax,y([3,3,1,3,3,3,4,4,4,4,2,4,2,4])];
     
-  xset("window",0);clf();show_window();
+  scf(100001);clf();show_window();
   plot2d(xx,yy,ones(1,16),'022');
   xstring(28,30,'K');xstring(56,30,'Plant');xstring(12,28.80,'-');
   xtitle('PLANT   and   CONTROLLER')
@@ -61,21 +61,21 @@ function demo_mixed()
   
   ww1=part(www(1),1)=='Y';
   if ww1 then
-    scf(1);clf();show_window();
+    scf(100002);clf();show_window();
     gainplot(Ssens);
     xtitle('S = Sensitivity function');
   end
 
   ww2=part(www(2),1)=='Y';
   if ww2 then
-    scf(2);clf();show_window();
+    scf(100003);clf();show_window();
     gainplot(Rsens);
     xtitle('R (=G*S) Sensitivity function');
   end
 
   ww3=part(www(3),1)=='Y';
   if ww3 then
-    scf(3);clf();show_window();
+    scf(100004);clf();show_window();
     gainplot(Tsens);
     xtitle('T = Complementary Sensitivity function');
   end
index 22c9c09..d91d9cf 100644 (file)
@@ -16,7 +16,7 @@ function demo_pid()
   xx=[xmin,xmin,x([1 2 2 7 4 6 3 4 5 6 3 3 5 5]);xmax,xmax,x([3,2,7,7,5,8,3,4,5,6,4,4,6,6])];
   yy=[ymin,ymax,y([3,1,1,1,3,3,2,2,2,2,2,4,2,4]);ymin,ymax,y([3,3,1,3,3,3,4,4,4,4,2,4,2,4])];
 
-  xset("window",0);clf();show_window();
+  scf(100001);clf();show_window();
   plot2d(xx,yy,ones(1,16),'022');
   xstring(28,30,'K');xstring(56,30,'Plant');xstring(12,28.80,'-');
   xtitle('PLANT   and   CONTROLLER')
@@ -105,7 +105,7 @@ function demo_pid()
       break
     case 1
       mode(1)
-      clf(1);xset("window",1);show_window();bode(Tpid);
+      clf(100002);scf(100002);show_window();bode(Tpid);
       mode(-1)
     case 2
       if Plant(4)=='c' then
@@ -122,11 +122,11 @@ function demo_pid()
           warning('Demo stops!');return;
         end
         if n1==1 then 
-          clf(1);xset("window",1);show_window();
+          clf(100002);scf(100002);show_window();
           plot2d([t',t'],[(csim('step',t,Tpid))',ones(t')])
         end
         if n1==2 then
-          clf(1);xset("window",1);show_window();
+          clf(100002);scf(100002);show_window();
           plot2d([t',t'],[(csim('impul',t,Tpid))',0*t'])
         end
         mode(-1)
@@ -146,13 +146,13 @@ function demo_pid()
           case 1 then
             mode(1)
             u=ones(1,Tmax);u(1)=0;
-            clf(1);xset("window",1);show_window();
+            clf(100002);scf(100002);show_window();
             plot2d([(1:Tmax)',(1:Tmax)'],[(dsimul(Tpid,u))',(ones(1:Tmax)')])
             mode(-1)
           case 2 then
             mode(1)
             u=zeros(1,Tmax);u(1)=1;
-            clf(1);xset("window",1);show_window();
+            clf(100002);scf(100002);show_window();
             plot2d((1:Tmax)',(dsimul(Tpid,u))')
             mode(-1)
           end