diff options
author | Sylvestre Ledru <sylvestre.ledru@scilab.org> | 2009-02-12 12:18:35 +0100 |
---|---|---|
committer | Sylvestre Ledru <sylvestre.ledru@scilab.org> | 2009-02-12 12:18:35 +0100 |
commit | 91fbfb81b72b3d09175fec6a06a5567dac820bd5 (patch) | |
tree | aac8be503cc990a028930ae5865d01736d8f6480 | |
parent | 632d50208152dd420b67bf26954c18c46f3f4302 (diff) | |
parent | c3ebdaa47b35459e0bc4c6eca899ef149fc344d3 (diff) | |
download | scilab-91fbfb81b72b3d09175fec6a06a5567dac820bd5.zip scilab-91fbfb81b72b3d09175fec6a06a5567dac820bd5.tar.gz |
Merge branch '5.1' of git@git.scilab.org:scilab into 5.15.1
34 files changed, 223 insertions, 274 deletions
diff --git a/scilab/RELEASE_NOTES_5.1.X b/scilab/RELEASE_NOTES_5.1.X index 2276e9c..31c574c 100644 --- a/scilab/RELEASE_NOTES_5.1.X +++ b/scilab/RELEASE_NOTES_5.1.X | |||
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | - input('xxx') from Scipad (bug #2578): | 12 | - input('xxx') from Scipad (bug #2578): |
13 | The function input('xxx') called from scipad is crashing Scilab. | 13 | The function input('xxx') called from scipad is crashing Scilab. |
14 | Due to internal issues, this bug | 14 | This bug is due to internal issues and will be fixed in a future version. |
15 | 15 | ||
16 | - Scipad Debugger: | 16 | - Scipad Debugger: |
17 | The Scipad debugger is still broken because of code reorganization that has | 17 | The Scipad debugger is still broken because of code reorganization that has |
diff --git a/scilab/modules/fileio/tests/nonreg_tests/bug_4097.dia.ref b/scilab/modules/fileio/tests/nonreg_tests/bug_4097.dia.ref new file mode 100644 index 0000000..d2ab0b3 --- /dev/null +++ b/scilab/modules/fileio/tests/nonreg_tests/bug_4097.dia.ref | |||
@@ -0,0 +1,24 @@ | |||
1 | // ============================================================================= | ||
2 | // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab | ||
3 | // Copyright (C) 2009 - DIGITEO - Pierre MARECHAL | ||
4 | // | ||
5 | // This file is distributed under the same license as the Scilab package. | ||
6 | // ============================================================================= | ||
7 | // <-- JVM NOT MANDATORY --> | ||
8 | // <-- Non-regression test for bug 4097 --> | ||
9 | // | ||
10 | // <-- Bugzilla URL --> | ||
11 | // http://bugzilla.scilab.org/show_bug.cgi?id=4097 | ||
12 | // | ||
13 | // <-- Short Description --> | ||
14 | // fscanfMat() crashes Scilab. It doesn't occur with scilab-5.0.3 | ||
15 | n = 50; | ||
16 | a = rand(n,n,"u"); | ||
17 | fd = mopen(TMPDIR+"/bug_4097.mat","w"); | ||
18 | for i=1:n , | ||
19 | for j=1:n, mfprintf(fd,"%5.2f ",a(i,j));end; | ||
20 | mfprintf(fd,'\n'); | ||
21 | end | ||
22 | mclose(fd); | ||
23 | b = fscanfMat(TMPDIR+"/bug_4097.mat"); | ||
24 | if size(b)<> [50,50] then bugmes();quit;end | ||
diff --git a/scilab/modules/fileio/tests/nonreg_tests/bug_4097.tst b/scilab/modules/fileio/tests/nonreg_tests/bug_4097.tst new file mode 100644 index 0000000..2c94191 --- /dev/null +++ b/scilab/modules/fileio/tests/nonreg_tests/bug_4097.tst | |||
@@ -0,0 +1,31 @@ | |||
1 | // ============================================================================= | ||
2 | // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab | ||
3 | // Copyright (C) 2009 - DIGITEO - Pierre MARECHAL | ||
4 | // | ||
5 | // This file is distributed under the same license as the Scilab package. | ||
6 | // ============================================================================= | ||
7 | |||
8 | // <-- JVM NOT MANDATORY --> | ||
9 | |||
10 | // <-- Non-regression test for bug 4097 --> | ||
11 | // | ||
12 | // <-- Bugzilla URL --> | ||
13 | // http://bugzilla.scilab.org/show_bug.cgi?id=4097 | ||
14 | // | ||
15 | // <-- Short Description --> | ||
16 | // fscanfMat() crashes Scilab. It doesn't occur with scilab-5.0.3 | ||
17 | |||
18 | n = 50; | ||
19 | a = rand(n,n,"u"); | ||
20 | fd = mopen(TMPDIR+"/bug_4097.mat","w"); | ||
21 | |||
22 | for i=1:n , | ||
23 | for j=1:n, mfprintf(fd,"%5.2f ",a(i,j));end; | ||
24 | mfprintf(fd,'\n'); | ||
25 | end | ||
26 | |||
27 | mclose(fd); | ||
28 | |||
29 | b = fscanfMat(TMPDIR+"/bug_4097.mat"); | ||
30 | |||
31 | if size(b)<> [50,50] then pause,end | ||
diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_4081.tst b/scilab/modules/graphics/tests/nonreg_tests/bug_4081.tst new file mode 100644 index 0000000..1667296 --- /dev/null +++ b/scilab/modules/graphics/tests/nonreg_tests/bug_4081.tst | |||
@@ -0,0 +1,45 @@ | |||
1 | // ============================================================================= | ||
2 | // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab | ||
3 | // Copyright (C) 2008-2008 - Digiteo - Jean-Baptiste Silvy | ||
4 | // | ||
5 | // This file is distributed under the same license as the Scilab package. | ||
6 | // ============================================================================= | ||
7 | |||
8 | // <-- INTERACTIVE TEST --> | ||
9 | |||
10 | // <-- Non-regression test for bug 4081 --> | ||
11 | // | ||
12 | // <-- Bugzilla URL --> | ||
13 | // http://bugzilla.scilab.org/show_bug.cgi?id=4081 | ||
14 | // | ||
15 | // <-- Short Description --> | ||
16 | // Colormap is sometime not updated when using new interpoated colors. | ||
17 | |||
18 | |||
19 | clf() | ||
20 | f=gcf(); | ||
21 | a=gca();a.data_bounds=[0,-10;40,30]; | ||
22 | x1=[0,10,20,10]'; | ||
23 | y1=[10,0,10,20]'; | ||
24 | c=linspace(2,100,4)'; | ||
25 | xpols=[x1 x1+20 x1+10 x1+10]; | ||
26 | ypols=[y1 y1 y1+10 y1-10]; | ||
27 | cols= [c c($:-1:1) c([3 4 1 2]) c] | ||
28 | f.color_map=jetcolormap(max(cols)); | ||
29 | xfpolys(xpols,ypols,cols) | ||
30 | // interpolated colors | ||
31 | clf() | ||
32 | f=gcf(); | ||
33 | x11=[0;20;20;0];y11=[10;10;30;30];c11=[10;10;30;30]; | ||
34 | x12=x11;y12=y11+20;c12=[20;20;1;1];c12=[30;30;10;10]; | ||
35 | x21=[0;30;30;0]+22;y21=[20;20;30;30];c21=[20;20;30;30]; | ||
36 | x22=x21;y22=y21+10;c22=[30;30;20;20]; | ||
37 | x31=[0;40;40;0]+55;y31=[0;0;30;30];c31=[0;0;30;30]; | ||
38 | x32=x31;y32=y31+30;c32=[30;30;0;0]; | ||
39 | X=[x11 x12 x21 x22 x31 x32];Y=[y11 y12 y21 y22 y31 y32];C=([c11 c12 c21 c22 c31 c32]+1)*5; | ||
40 | a=gca(); | ||
41 | a.data_bounds=[min(X),min(Y);max(X),max(Y)]; | ||
42 | f=gcf();f.color_map=graycolormap(max(C)); | ||
43 | xfpolys(X,Y,C) | ||
44 | |||
45 | // the rectangles should be gray and not using the jetcolormap | ||
diff --git a/scilab/modules/gui/locales/fr_FR/gui.po b/scilab/modules/gui/locales/fr_FR/gui.po index c8b2f18..7cc3ea2 100644 --- a/scilab/modules/gui/locales/fr_FR/gui.po +++ b/scilab/modules/gui/locales/fr_FR/gui.po | |||
@@ -867,7 +867,7 @@ msgid "" | |||
867 | msgstr "" | 867 | msgstr "" |
868 | "disp(\"ATTENTION : A cause des limitations de votre configuration, Scilab " | 868 | "disp(\"ATTENTION : A cause des limitations de votre configuration, Scilab " |
869 | "est passé dans un mode dans lequel mélanger des uicontrols et des graphiques " | 869 | "est passé dans un mode dans lequel mélanger des uicontrols et des graphiques " |
870 | "n'est pas possible. Tapez \"\"help usecanvas\"\" pour plus d'information.\")" | 870 | "n''est pas possible. Tapez \"\"help usecanvas\"\" pour plus d''information.\")" |
871 | 871 | ||
872 | msgid "" | 872 | msgid "" |
873 | "disp(\"WARNING: Due to your video card drivers limitations, that are not " | 873 | "disp(\"WARNING: Due to your video card drivers limitations, that are not " |
@@ -885,7 +885,7 @@ msgid "" | |||
885 | msgstr "" | 885 | msgstr "" |
886 | "disp(\"ATTENTION : Malgré notre avertissement précédent, vous avez choisi " | 886 | "disp(\"ATTENTION : Malgré notre avertissement précédent, vous avez choisi " |
887 | "d'utiliser Scilab avec des fonctionnalités graphiques avancées. Tapez " | 887 | "d'utiliser Scilab avec des fonctionnalités graphiques avancées. Tapez " |
888 | "\"\"help usecanvas\"\" pour plus d'information.\")" | 888 | "\"\"help usecanvas\"\" pour plus d''information.\")" |
889 | 889 | ||
890 | msgid "Loading help browser..." | 890 | msgid "Loading help browser..." |
891 | msgstr "Chargement du navigateur d'aide..." | 891 | msgstr "Chargement du navigateur d'aide..." |
diff --git a/scilab/modules/output_stream/tests/nonreg_tests/bug_438.dia.ref b/scilab/modules/output_stream/tests/nonreg_tests/bug_438.dia.ref index 408ea07..cdca5d5 100644 --- a/scilab/modules/output_stream/tests/nonreg_tests/bug_438.dia.ref +++ b/scilab/modules/output_stream/tests/nonreg_tests/bug_438.dia.ref | |||
@@ -4,6 +4,7 @@ | |||
4 | // | 4 | // |
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | // <-- JVM NOT MANDATORY --> | ||
7 | // <-- Non-regression test for bug 438 --> | 8 | // <-- Non-regression test for bug 438 --> |
8 | // | 9 | // |
9 | // <-- Bugzilla URL --> | 10 | // <-- Bugzilla URL --> |
@@ -27,5 +28,5 @@ dummy3 =sprintf('%e', 10000); | |||
27 | if MSDOS then | 28 | if MSDOS then |
28 | if dummy3 <> "1.000000e+004" then bugmes();quit;end | 29 | if dummy3 <> "1.000000e+004" then bugmes();quit;end |
29 | else | 30 | else |
30 | if dummy2 <> "1.000000e+04" then bugmes();quit;end | 31 | if dummy3 <> "1.000000e+04" then bugmes();quit;end |
31 | end | 32 | end |
diff --git a/scilab/modules/output_stream/tests/nonreg_tests/bug_438.tst b/scilab/modules/output_stream/tests/nonreg_tests/bug_438.tst index 1331b91..864ab56 100644 --- a/scilab/modules/output_stream/tests/nonreg_tests/bug_438.tst +++ b/scilab/modules/output_stream/tests/nonreg_tests/bug_438.tst | |||
@@ -5,6 +5,8 @@ | |||
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | 7 | ||
8 | // <-- JVM NOT MANDATORY --> | ||
9 | |||
8 | // <-- Non-regression test for bug 438 --> | 10 | // <-- Non-regression test for bug 438 --> |
9 | // | 11 | // |
10 | // <-- Bugzilla URL --> | 12 | // <-- Bugzilla URL --> |
@@ -31,5 +33,5 @@ dummy3 =sprintf('%e', 10000); | |||
31 | if MSDOS then | 33 | if MSDOS then |
32 | if dummy3 <> "1.000000e+004" then pause, end | 34 | if dummy3 <> "1.000000e+004" then pause, end |
33 | else | 35 | else |
34 | if dummy2 <> "1.000000e+04" then pause, end | 36 | if dummy3 <> "1.000000e+04" then pause, end |
35 | end | 37 | end |
diff --git a/scilab/modules/polynomials/tests/nonreg_tests/bug_201.dia.ref b/scilab/modules/polynomials/tests/nonreg_tests/bug_201.dia.ref index f63df18..e4e1842 100644 --- a/scilab/modules/polynomials/tests/nonreg_tests/bug_201.dia.ref +++ b/scilab/modules/polynomials/tests/nonreg_tests/bug_201.dia.ref | |||
@@ -4,6 +4,7 @@ | |||
4 | // | 4 | // |
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | // <-- JVM NOT MANDATORY --> | ||
7 | // <-- Non-regression test for bug 201 --> | 8 | // <-- Non-regression test for bug 201 --> |
8 | // | 9 | // |
9 | // <-- Bugzilla URL --> | 10 | // <-- Bugzilla URL --> |
diff --git a/scilab/modules/polynomials/tests/nonreg_tests/bug_201.tst b/scilab/modules/polynomials/tests/nonreg_tests/bug_201.tst index b3d5939..61b936c 100644 --- a/scilab/modules/polynomials/tests/nonreg_tests/bug_201.tst +++ b/scilab/modules/polynomials/tests/nonreg_tests/bug_201.tst | |||
@@ -5,6 +5,8 @@ | |||
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | 7 | ||
8 | // <-- JVM NOT MANDATORY --> | ||
9 | |||
8 | // <-- Non-regression test for bug 201 --> | 10 | // <-- Non-regression test for bug 201 --> |
9 | // | 11 | // |
10 | // <-- Bugzilla URL --> | 12 | // <-- Bugzilla URL --> |
diff --git a/scilab/modules/polynomials/tests/nonreg_tests/bug_205.dia.ref b/scilab/modules/polynomials/tests/nonreg_tests/bug_205.dia.ref index ecdc847..0137f6f 100644 --- a/scilab/modules/polynomials/tests/nonreg_tests/bug_205.dia.ref +++ b/scilab/modules/polynomials/tests/nonreg_tests/bug_205.dia.ref | |||
@@ -4,6 +4,7 @@ | |||
4 | // | 4 | // |
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | // <-- JVM NOT MANDATORY --> | ||
7 | // <-- Non-regression test for bug 205 --> | 8 | // <-- Non-regression test for bug 205 --> |
8 | // | 9 | // |
9 | // <-- Bugzilla URL --> | 10 | // <-- Bugzilla URL --> |
@@ -27,6 +28,7 @@ | |||
27 | // | 28 | // |
28 | // Gaubert on Linux PPC version 2.2.13 distribution with X/kde as window manager | 29 | // Gaubert on Linux PPC version 2.2.13 distribution with X/kde as window manager |
29 | // France February 10, 2001 at 11:55:40 | 30 | // France February 10, 2001 at 11:55:40 |
31 | // <-- ENGLISH IMPOSED --> | ||
30 | N = 30; | 32 | N = 30; |
31 | A = rand(N,N); | 33 | A = rand(N,N); |
32 | s = poly(0,'s'); | 34 | s = poly(0,'s'); |
diff --git a/scilab/modules/polynomials/tests/nonreg_tests/bug_205.tst b/scilab/modules/polynomials/tests/nonreg_tests/bug_205.tst index 6166614..99d876b 100644 --- a/scilab/modules/polynomials/tests/nonreg_tests/bug_205.tst +++ b/scilab/modules/polynomials/tests/nonreg_tests/bug_205.tst | |||
@@ -5,6 +5,8 @@ | |||
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | 7 | ||
8 | // <-- JVM NOT MANDATORY --> | ||
9 | |||
8 | // <-- Non-regression test for bug 205 --> | 10 | // <-- Non-regression test for bug 205 --> |
9 | // | 11 | // |
10 | // <-- Bugzilla URL --> | 12 | // <-- Bugzilla URL --> |
diff --git a/scilab/modules/polynomials/tests/nonreg_tests/bug_2264.dia.ref b/scilab/modules/polynomials/tests/nonreg_tests/bug_2264.dia.ref index 5555d3c..c48aae5 100644 --- a/scilab/modules/polynomials/tests/nonreg_tests/bug_2264.dia.ref +++ b/scilab/modules/polynomials/tests/nonreg_tests/bug_2264.dia.ref | |||
@@ -1,3 +1,10 @@ | |||
1 | // ============================================================================= | ||
2 | // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab | ||
3 | // Copyright (C) 2007-2008 - INRIA - Serge STEER <serge.steer@inria.fr> | ||
4 | // | ||
5 | // This file is distributed under the same license as the Scilab package. | ||
6 | // ============================================================================= | ||
7 | // <-- JVM NOT MANDATORY --> | ||
1 | // <-- Non-regression test for bug 2264 --> | 8 | // <-- Non-regression test for bug 2264 --> |
2 | // | 9 | // |
3 | // <-- Bugzilla URL --> | 10 | // <-- Bugzilla URL --> |
@@ -5,9 +12,6 @@ | |||
5 | // | 12 | // |
6 | // <-- Short Description --> | 13 | // <-- Short Description --> |
7 | // lcm gives wrong value for 3-element vectors(cf bug 666) | 14 | // lcm gives wrong value for 3-element vectors(cf bug 666) |
8 | // Serge Steer - Scilab Project | ||
9 | // Copyright INRIA | ||
10 | // 2 janv 2007 | ||
11 | [q,fact]=lcm(int32([-6 5 7 12 4])); | 15 | [q,fact]=lcm(int32([-6 5 7 12 4])); |
12 | if q<>int32(420) then bugmes();quit;end | 16 | if q<>int32(420) then bugmes();quit;end |
13 | [q,fact]=lcm(int32([6 5 7 3 4])) ; | 17 | [q,fact]=lcm(int32([6 5 7 3 4])) ; |
diff --git a/scilab/modules/polynomials/tests/nonreg_tests/bug_2264.tst b/scilab/modules/polynomials/tests/nonreg_tests/bug_2264.tst index 9566369..2b36a08 100644 --- a/scilab/modules/polynomials/tests/nonreg_tests/bug_2264.tst +++ b/scilab/modules/polynomials/tests/nonreg_tests/bug_2264.tst | |||
@@ -5,6 +5,8 @@ | |||
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | 7 | ||
8 | // <-- JVM NOT MANDATORY --> | ||
9 | |||
8 | // <-- Non-regression test for bug 2264 --> | 10 | // <-- Non-regression test for bug 2264 --> |
9 | // | 11 | // |
10 | // <-- Bugzilla URL --> | 12 | // <-- Bugzilla URL --> |
diff --git a/scilab/modules/polynomials/tests/nonreg_tests/bug_2391.dia.ref b/scilab/modules/polynomials/tests/nonreg_tests/bug_2391.dia.ref index ed3169a..ec24522 100644 --- a/scilab/modules/polynomials/tests/nonreg_tests/bug_2391.dia.ref +++ b/scilab/modules/polynomials/tests/nonreg_tests/bug_2391.dia.ref | |||
@@ -4,6 +4,7 @@ | |||
4 | // | 4 | // |
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | // <-- JVM NOT MANDATORY --> | ||
7 | // <-- Non-regression test for bug 2391 --> | 8 | // <-- Non-regression test for bug 2391 --> |
8 | // | 9 | // |
9 | // <-- Bugzilla URL --> | 10 | // <-- Bugzilla URL --> |
diff --git a/scilab/modules/polynomials/tests/nonreg_tests/bug_2391.tst b/scilab/modules/polynomials/tests/nonreg_tests/bug_2391.tst index a65c6df..2d60ef6 100644 --- a/scilab/modules/polynomials/tests/nonreg_tests/bug_2391.tst +++ b/scilab/modules/polynomials/tests/nonreg_tests/bug_2391.tst | |||
@@ -5,6 +5,8 @@ | |||
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | 7 | ||
8 | // <-- JVM NOT MANDATORY --> | ||
9 | |||
8 | // <-- Non-regression test for bug 2391 --> | 10 | // <-- Non-regression test for bug 2391 --> |
9 | // | 11 | // |
10 | // <-- Bugzilla URL --> | 12 | // <-- Bugzilla URL --> |
diff --git a/scilab/modules/polynomials/tests/nonreg_tests/bug_2492.dia.ref b/scilab/modules/polynomials/tests/nonreg_tests/bug_2492.dia.ref index 37605b1..c32048d 100644 --- a/scilab/modules/polynomials/tests/nonreg_tests/bug_2492.dia.ref +++ b/scilab/modules/polynomials/tests/nonreg_tests/bug_2492.dia.ref | |||
@@ -4,6 +4,7 @@ | |||
4 | // | 4 | // |
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | // <-- JVM NOT MANDATORY --> | ||
7 | // <-- Non-regression test for bug 2492 --> | 8 | // <-- Non-regression test for bug 2492 --> |
8 | // | 9 | // |
9 | // <-- Bugzilla URL --> | 10 | // <-- Bugzilla URL --> |
diff --git a/scilab/modules/polynomials/tests/nonreg_tests/bug_2492.tst b/scilab/modules/polynomials/tests/nonreg_tests/bug_2492.tst index 3d96dc0..0f3278d 100644 --- a/scilab/modules/polynomials/tests/nonreg_tests/bug_2492.tst +++ b/scilab/modules/polynomials/tests/nonreg_tests/bug_2492.tst | |||
@@ -5,6 +5,8 @@ | |||
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | 7 | ||
8 | // <-- JVM NOT MANDATORY --> | ||
9 | |||
8 | // <-- Non-regression test for bug 2492 --> | 10 | // <-- Non-regression test for bug 2492 --> |
9 | // | 11 | // |
10 | // <-- Bugzilla URL --> | 12 | // <-- Bugzilla URL --> |
diff --git a/scilab/modules/polynomials/tests/nonreg_tests/bug_2834.dia.ref b/scilab/modules/polynomials/tests/nonreg_tests/bug_2834.dia.ref index f0062e8..4956357 100644 --- a/scilab/modules/polynomials/tests/nonreg_tests/bug_2834.dia.ref +++ b/scilab/modules/polynomials/tests/nonreg_tests/bug_2834.dia.ref | |||
@@ -4,6 +4,7 @@ | |||
4 | // | 4 | // |
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | // <-- JVM NOT MANDATORY --> | ||
7 | // <-- Non-regression test for bug 2834 --> | 8 | // <-- Non-regression test for bug 2834 --> |
8 | // | 9 | // |
9 | // <-- Bugzilla URL --> | 10 | // <-- Bugzilla URL --> |
diff --git a/scilab/modules/polynomials/tests/nonreg_tests/bug_2834.tst b/scilab/modules/polynomials/tests/nonreg_tests/bug_2834.tst index 9cd951f..8be272a 100644 --- a/scilab/modules/polynomials/tests/nonreg_tests/bug_2834.tst +++ b/scilab/modules/polynomials/tests/nonreg_tests/bug_2834.tst | |||
@@ -5,6 +5,8 @@ | |||
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | 7 | ||
8 | // <-- JVM NOT MANDATORY --> | ||
9 | |||
8 | // <-- Non-regression test for bug 2834 --> | 10 | // <-- Non-regression test for bug 2834 --> |
9 | // | 11 | // |
10 | // <-- Bugzilla URL --> | 12 | // <-- Bugzilla URL --> |
diff --git a/scilab/modules/polynomials/tests/nonreg_tests/bug_3006.dia.ref b/scilab/modules/polynomials/tests/nonreg_tests/bug_3006.dia.ref index 01958cc..18e7917 100644 --- a/scilab/modules/polynomials/tests/nonreg_tests/bug_3006.dia.ref +++ b/scilab/modules/polynomials/tests/nonreg_tests/bug_3006.dia.ref | |||
@@ -4,6 +4,7 @@ | |||
4 | // | 4 | // |
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | // <-- JVM NOT MANDATORY --> | ||
7 | // <-- Non-regression test for bug 3006 --> | 8 | // <-- Non-regression test for bug 3006 --> |
8 | // | 9 | // |
9 | // <-- Bugzilla URL --> | 10 | // <-- Bugzilla URL --> |
diff --git a/scilab/modules/polynomials/tests/nonreg_tests/bug_3006.tst b/scilab/modules/polynomials/tests/nonreg_tests/bug_3006.tst index 4943449..9e8f72c 100644 --- a/scilab/modules/polynomials/tests/nonreg_tests/bug_3006.tst +++ b/scilab/modules/polynomials/tests/nonreg_tests/bug_3006.tst | |||
@@ -5,6 +5,8 @@ | |||
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | 7 | ||
8 | // <-- JVM NOT MANDATORY --> | ||
9 | |||
8 | // <-- Non-regression test for bug 3006 --> | 10 | // <-- Non-regression test for bug 3006 --> |
9 | // | 11 | // |
10 | // <-- Bugzilla URL --> | 12 | // <-- Bugzilla URL --> |
diff --git a/scilab/modules/polynomials/tests/nonreg_tests/bug_415.tst b/scilab/modules/polynomials/tests/nonreg_tests/bug_415.tst index 0ddb017..029c93c 100644 --- a/scilab/modules/polynomials/tests/nonreg_tests/bug_415.tst +++ b/scilab/modules/polynomials/tests/nonreg_tests/bug_415.tst | |||
@@ -5,7 +5,7 @@ | |||
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | 7 | ||
8 | 8 | // <-- JVM NOT MANDATORY --> | |
9 | 9 | ||
10 | // <-- NO CHECK REF --> | 10 | // <-- NO CHECK REF --> |
11 | // <-- Non-regression test for bug 415 --> | 11 | // <-- Non-regression test for bug 415 --> |
diff --git a/scilab/modules/polynomials/tests/unit_tests/polelm.dia.ref b/scilab/modules/polynomials/tests/unit_tests/polelm.dia.ref index c326b64..935c574 100644 --- a/scilab/modules/polynomials/tests/unit_tests/polelm.dia.ref +++ b/scilab/modules/polynomials/tests/unit_tests/polelm.dia.ref | |||
@@ -4,6 +4,7 @@ | |||
4 | // | 4 | // |
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | // <-- JVM NOT MANDATORY --> | ||
7 | //poly (coeff) | 8 | //poly (coeff) |
8 | v=[1 2 3];nam='s';job='c';p=1+2*%s+3*%s^2; | 9 | v=[1 2 3];nam='s';job='c';p=1+2*%s+3*%s^2; |
9 | if poly(v,'s','c')<>p then bugmes();quit;end | 10 | if poly(v,'s','c')<>p then bugmes();quit;end |
diff --git a/scilab/modules/polynomials/tests/unit_tests/polelm.tst b/scilab/modules/polynomials/tests/unit_tests/polelm.tst index cba4ed3..8ac7874 100644 --- a/scilab/modules/polynomials/tests/unit_tests/polelm.tst +++ b/scilab/modules/polynomials/tests/unit_tests/polelm.tst | |||
@@ -5,6 +5,8 @@ | |||
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | 7 | ||
8 | // <-- JVM NOT MANDATORY --> | ||
9 | |||
8 | //poly (coeff) | 10 | //poly (coeff) |
9 | 11 | ||
10 | v=[1 2 3];nam='s';job='c';p=1+2*%s+3*%s^2; | 12 | v=[1 2 3];nam='s';job='c';p=1+2*%s+3*%s^2; |
diff --git a/scilab/modules/polynomials/tests/unit_tests/polops.dia.ref b/scilab/modules/polynomials/tests/unit_tests/polops.dia.ref index f0f4d33..df0d543 100644 --- a/scilab/modules/polynomials/tests/unit_tests/polops.dia.ref +++ b/scilab/modules/polynomials/tests/unit_tests/polops.dia.ref | |||
@@ -4,6 +4,7 @@ | |||
4 | // | 4 | // |
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | // <-- JVM NOT MANDATORY --> | ||
7 | mode(5) | 8 | mode(5) |
8 | lines(0) | 9 | lines(0) |
9 | s=poly(0,'s'); | 10 | s=poly(0,'s'); |
diff --git a/scilab/modules/polynomials/tests/unit_tests/polops.tst b/scilab/modules/polynomials/tests/unit_tests/polops.tst index 4f1dc55..e632eca 100644 --- a/scilab/modules/polynomials/tests/unit_tests/polops.tst +++ b/scilab/modules/polynomials/tests/unit_tests/polops.tst | |||
@@ -5,6 +5,8 @@ | |||
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | 7 | ||
8 | // <-- JVM NOT MANDATORY --> | ||
9 | |||
8 | mode(5) | 10 | mode(5) |
9 | lines(0) | 11 | lines(0) |
10 | s=poly(0,'s'); | 12 | s=poly(0,'s'); |
diff --git a/scilab/modules/polynomials/tests/unit_tests/poly_roots.dia.ref b/scilab/modules/polynomials/tests/unit_tests/poly_roots.dia.ref index 204e41a..15bb5a2 100644 --- a/scilab/modules/polynomials/tests/unit_tests/poly_roots.dia.ref +++ b/scilab/modules/polynomials/tests/unit_tests/poly_roots.dia.ref | |||
@@ -4,6 +4,15 @@ | |||
4 | // | 4 | // |
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | // <-- JVM NOT MANDATORY --> | ||
8 | // poly_roots.tst -- | ||
9 | // Check the computation of the roots of a polynomial | ||
10 | // with different kinds of polynomials and different | ||
11 | // kinds of roots : | ||
12 | // - real poly, | ||
13 | // - complex poly, | ||
14 | // - real roots, | ||
15 | // - complex roots. | ||
7 | //roots : 3 real roots -> RPOLY | 16 | //roots : 3 real roots -> RPOLY |
8 | p=-6+11*%s-6*%s^2+%s^3; | 17 | p=-6+11*%s-6*%s^2+%s^3; |
9 | myroots=roots(p); | 18 | myroots=roots(p); |
@@ -76,6 +85,22 @@ myroots=roots(p,"e"); | |||
76 | computedroots = sort(myroots); | 85 | computedroots = sort(myroots); |
77 | expectedroots = [%pi;%pi]; | 86 | expectedroots = [%pi;%pi]; |
78 | if (abs(computedroots-expectedroots)>10*%eps) then bugmes();quit;end | 87 | if (abs(computedroots-expectedroots)>10*%eps) then bugmes();quit;end |
88 | // | ||
89 | // Caution ! | ||
90 | // The following are difficult root-finding problems | ||
91 | // with expected precision problems. | ||
92 | // See "Principles for testing polynomial | ||
93 | // zerofinding programs" | ||
94 | // Jenkins, Traub | ||
95 | // 1975 | ||
96 | // p.28 | ||
97 | // "The accuracy which one may expect to achieve in calculating | ||
98 | // zeros is limited by the condition of these zeros. In particular, | ||
99 | // for multiple zeros perturbations of size epsilon in the | ||
100 | // coefficients cause perturbations of size epsilon^(1/m) | ||
101 | // in the zeros." | ||
102 | // | ||
103 | // | ||
79 | // 3 real roots with a zero derivate at the root -> RPOLY | 104 | // 3 real roots with a zero derivate at the root -> RPOLY |
80 | // *** PRECISION PROBLEM : only simple precision computed, instead of double precision *** | 105 | // *** PRECISION PROBLEM : only simple precision computed, instead of double precision *** |
81 | p=(%s-%pi)^3 | 106 | p=(%s-%pi)^3 |
diff --git a/scilab/modules/polynomials/tests/unit_tests/poly_roots.tst b/scilab/modules/polynomials/tests/unit_tests/poly_roots.tst index 70a18d1..2b22f1a 100644 --- a/scilab/modules/polynomials/tests/unit_tests/poly_roots.tst +++ b/scilab/modules/polynomials/tests/unit_tests/poly_roots.tst | |||
@@ -5,6 +5,8 @@ | |||
5 | // This file is distributed under the same license as the Scilab package. | 5 | // This file is distributed under the same license as the Scilab package. |
6 | // ============================================================================= | 6 | // ============================================================================= |
7 | 7 | ||
8 | // <-- JVM NOT MANDATORY --> | ||
9 | |||
8 | // poly_roots.tst -- | 10 | // poly_roots.tst -- |
9 | // Check the computation of the roots of a polynomial | 11 | // Check the computation of the roots of a polynomial |
10 | // with different kinds of polynomials and different | 12 | // with different kinds of polynomials and different |
diff --git a/scilab/modules/renderer/src/java/org/scilab/modules/renderer/utils/TexturedColorMap.java b/scilab/modules/renderer/src/java/org/scilab/modules/renderer/utils/TexturedColorMap.java index 8626d57..3a97a02 100644 --- a/scilab/modules/renderer/src/java/org/scilab/modules/renderer/utils/TexturedColorMap.java +++ b/scilab/modules/renderer/src/java/org/scilab/modules/renderer/utils/TexturedColorMap.java | |||
@@ -152,7 +152,7 @@ public class TexturedColorMap extends ColorMap { | |||
152 | * @return The buffered image used to draw the texture | 152 | * @return The buffered image used to draw the texture |
153 | */ | 153 | */ |
154 | private BufferedImage getImage() { | 154 | private BufferedImage getImage() { |
155 | if (textureImage == null) { | 155 | if (textureImage == null || hasChanged) { |
156 | // create a new image | 156 | // create a new image |
157 | int colorMapSize = getSize(); | 157 | int colorMapSize = getSize(); |
158 | textureImage = new BufferedImage(colorMapSize + 2, 1, BufferedImage.TYPE_INT_RGB); | 158 | textureImage = new BufferedImage(colorMapSize + 2, 1, BufferedImage.TYPE_INT_RGB); |
@@ -193,7 +193,6 @@ public class TexturedColorMap extends ColorMap { | |||
193 | * @return a new texture data. | 193 | * @return a new texture data. |
194 | */ | 194 | */ |
195 | private TextureData createTextureData() { | 195 | private TextureData createTextureData() { |
196 | textureImage = null; | ||
197 | return getTextureData(); | 196 | return getTextureData(); |
198 | } | 197 | } |
199 | 198 | ||
diff --git a/scilab/modules/scicos/tests/unit_tests/lincos.tst b/scilab/modules/scicos/tests/unit_tests/lincos.tst index 10766a5..75f120e 100644 --- a/scilab/modules/scicos/tests/unit_tests/lincos.tst +++ b/scilab/modules/scicos/tests/unit_tests/lincos.tst | |||
@@ -1,6 +1,16 @@ | |||
1 | exec(fullfile(SCI,'modules','scicos','tests','unit_tests','PENDULUM_ANIM.sci')) | 1 | // ============================================================================= |
2 | exec(fullfile(SCI,'modules','scicos','tests','unit_tests','anim_pen.sci')) | 2 | // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab |
3 | load(fullfile(SCI,'modules','scicos','tests','unit_tests','pendulum_anim45.cos')) | 3 | // Copyright (C) 2008 - INRIA |
4 | // Copyright (C) 2009 - DIGITEO | ||
5 | // | ||
6 | // This file is distributed under the same license as the Scilab package. | ||
7 | // ============================================================================= | ||
8 | |||
9 | // <-- ENGLISH IMPOSED --> | ||
10 | |||
11 | exec(fullfile(SCI,'modules','scicos','tests','unit_tests','PENDULUM_ANIM.sci')); | ||
12 | exec(fullfile(SCI,'modules','scicos','tests','unit_tests','anim_pen.sci')); | ||
13 | load(fullfile(SCI,'modules','scicos','tests','unit_tests','pendulum_anim45.cos')); | ||
4 | M=10; | 14 | M=10; |
5 | m=3; | 15 | m=3; |
6 | l=3; | 16 | l=3; |
diff --git a/scilab/modules/scicos/tests/unit_tests/lincos.unix.dia.ref b/scilab/modules/scicos/tests/unit_tests/lincos.unix.dia.ref index 28e12ac..1c275d9 100644 --- a/scilab/modules/scicos/tests/unit_tests/lincos.unix.dia.ref +++ b/scilab/modules/scicos/tests/unit_tests/lincos.unix.dia.ref | |||
@@ -1,120 +1,12 @@ | |||
1 | 1 | // ============================================================================= | |
2 | ///withoutPrompt | 2 | // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab |
3 | 3 | // Copyright (C) 2008 - INRIA | |
4 | function [x,y,typ]=PENDULUM_ANIM(job,arg1,arg2) | 4 | // Copyright (C) 2009 - DIGITEO |
5 | // Animation of the cart-pendulum problem | 5 | // |
6 | x=[];y=[];typ=[] | 6 | // This file is distributed under the same license as the Scilab package. |
7 | select job | 7 | // ============================================================================= |
8 | case 'plot' then | 8 | // <-- ENGLISH IMPOSED --> |
9 | standard_draw(arg1) | 9 | load(fullfile(SCI,'modules','scicos','tests','unit_tests','pendulum_anim45.cos')); |
10 | case 'getinputs' then | ||
11 | [x,y,typ]=standard_inputs(o) | ||
12 | case 'getoutputs' then | ||
13 | x=[];y=[];typ=[]; | ||
14 | case 'getorigin' then | ||
15 | [x,y]=standard_origin(arg1) | ||
16 | case 'set' then | ||
17 | x=arg1; | ||
18 | graphics=arg1.graphics;exprs=graphics.exprs | ||
19 | model=arg1.model;dstate=model.dstate | ||
20 | while %t do | ||
21 | [ok,plen,csiz,phi,xmin,xmax,ymin,ymax,exprs]=getvalue(.. | ||
22 | 'Set Scope parameters',.. | ||
23 | ['pendulum length';'cart size (square side)';'slope'; | ||
24 | 'Xmin';'Xmax'; 'Ymin'; 'Ymax'; ],.. | ||
25 | list('vec',1,'vec',1,'vec',1,'vec',1,'vec',1,'vec',1,'vec',1),exprs) | ||
26 | if ~ok then break,end | ||
27 | mess=[] | ||
28 | if plen<=0|csiz<=0 then | ||
29 | mess=[mess;'Pendulum lenght and cart size must be positive.';' '] | ||
30 | ok=%f | ||
31 | end | ||
32 | if ymin>=ymax then | ||
33 | mess=[mess;'Ymax must be greater than Ymin';' '] | ||
34 | ok=%f | ||
35 | end | ||
36 | if xmin>=xmax then | ||
37 | mess=[mess;'Xmax must be greater than Xmin';' '] | ||
38 | ok=%f | ||
39 | end | ||
40 | if ~ok then | ||
41 | message(mess) | ||
42 | else | ||
43 | rpar=[plen;csiz;phi;xmin;xmax;ymin;ymax] | ||
44 | model.rpar=rpar; | ||
45 | graphics.exprs=exprs; | ||
46 | x.graphics=graphics;x.model=model | ||
47 | break | ||
48 | end | ||
49 | end | ||
50 | case 'define' then | ||
51 | plen=2; csiz=2; phi=0; | ||
52 | xmin=-5;xmax=5;ymin=-5;ymax=5 | ||
53 | model=scicos_model() | ||
54 | model.sim=list('anim_pen',5) | ||
55 | model.in=[1;1] | ||
56 | model.evtin=1 | ||
57 | model.dstate=0 | ||
58 | model.rpar=[plen;csiz;phi;xmin;xmax;ymin;ymax] | ||
59 | model.blocktype='d' | ||
60 | model.dep_ut=[%f %f] | ||
61 | exprs=string(model.rpar) | ||
62 | gr_i=['thick=xget(''thickness'');xset(''thickness'',2);'; | ||
63 | 'xx=orig(1)+sz(1)*[.4 .6 .6 .4 .4]' | ||
64 | 'yy=orig(2)+sz(2)*[.2 .2 .4 .4 .2]' | ||
65 | 'xpoly(xx,yy,''lines'')' | ||
66 | 'xx=orig(1)+sz(1)*[.5 .6]' | ||
67 | 'yy=orig(2)+sz(2)*[.4 .8]' | ||
68 | 'xpoly(xx,yy)' | ||
69 | 'xset(''thickness'',thick);'] | ||
70 | x=standard_define([3 3],model,exprs,gr_i) | ||
71 | end | ||
72 | endfunction | ||
73 | |||
74 | |||
75 | |||
76 | ///withoutPrompt | ||
77 | |||
78 | function [blocks] = anim_pen(blocks,flag) | ||
79 | win=20000+curblock() | ||
80 | if flag<>4 then H=scf(win), end | ||
81 | xold=blocks.z | ||
82 | rpar=blocks.rpar | ||
83 | plen=rpar(1);csiz=rpar(2);phi=rpar(3); | ||
84 | if flag==4 then | ||
85 | xset("window",win) | ||
86 | set("figure_style","new") | ||
87 | H=scf(win) | ||
88 | clf(H) | ||
89 | H.pixmap='on' | ||
90 | Axe=H.children | ||
91 | Axe.data_bounds=rpar(4:7) | ||
92 | Axe.isoview='on' | ||
93 | S=[cos(phi),-sin(phi);sin(phi),cos(phi)] | ||
94 | XY=S*[rpar(4),rpar(5);-csiz/2,-csiz/2] | ||
95 | xsegs(XY(1,:),XY(2,:)) | ||
96 | x=0;theta=0; | ||
97 | x1=x-csiz/2;x2=x+csiz/2;y1=-csiz/2;y2=csiz/2 | ||
98 | XY=S*[x1 x2 x2 x1 x1;y1,y1,y2,y2,y1] | ||
99 | xpoly(XY(1,:),XY(2,:),"lines",1) | ||
100 | XY=S*[x,x+plen*sin(theta);0,0+plen*cos(theta)] | ||
101 | xsegs(XY(1,:),XY(2,:)) | ||
102 | elseif flag==2 then | ||
103 | Axe=H.children | ||
104 | x=blocks.inptr(1)(1) | ||
105 | theta=blocks.inptr(2)(1) | ||
106 | XY=Axe.children(2).data'+.. | ||
107 | [cos(phi)*(x-xold);sin(phi)*(x-xold)]*ones(1,5) | ||
108 | Axe.children(2).data=XY' | ||
109 | x1=x*cos(phi);y1=x*sin(phi) | ||
110 | XY=[x1,x1+plen*sin(theta);y1,y1+plen*cos(theta)] | ||
111 | Axe.children(1).data=XY' | ||
112 | blocks.z=x | ||
113 | show_pixmap() | ||
114 | end | ||
115 | endfunction | ||
116 | |||
117 | load(fullfile(SCI,'modules','scicos','tests','unit_tests','pendulum_anim45.cos')) | ||
118 | M=10; | 10 | M=10; |
119 | m=3; | 11 | m=3; |
120 | l=3; | 12 | l=3; |
diff --git a/scilab/modules/scicos/tests/unit_tests/steadycos.tst b/scilab/modules/scicos/tests/unit_tests/steadycos.tst index 3085191..cdc0356 100644 --- a/scilab/modules/scicos/tests/unit_tests/steadycos.tst +++ b/scilab/modules/scicos/tests/unit_tests/steadycos.tst | |||
@@ -1,6 +1,16 @@ | |||
1 | exec(fullfile(SCI,'modules','scicos','tests','unit_tests','PENDULUM_ANIM.sci')) | 1 | // ============================================================================= |
2 | exec(fullfile(SCI,'modules','scicos','tests','unit_tests','anim_pen.sci')) | 2 | // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab |
3 | load(fullfile(SCI,'modules','scicos','tests','unit_tests','pendulum_anim45.cos')) | 3 | // Copyright (C) 2008 - INRIA |
4 | // Copyright (C) 2009 - DIGITEO | ||
5 | // | ||
6 | // This file is distributed under the same license as the Scilab package. | ||
7 | // ============================================================================= | ||
8 | |||
9 | // <-- ENGLISH IMPOSED --> | ||
10 | |||
11 | exec(fullfile(SCI,'modules','scicos','tests','unit_tests','PENDULUM_ANIM.sci')); | ||
12 | exec(fullfile(SCI,'modules','scicos','tests','unit_tests','anim_pen.sci')); | ||
13 | load(fullfile(SCI,'modules','scicos','tests','unit_tests','pendulum_anim45.cos')); | ||
4 | M=10; | 14 | M=10; |
5 | m=3; | 15 | m=3; |
6 | l=3; | 16 | l=3; |
diff --git a/scilab/modules/scicos/tests/unit_tests/steadycos.unix.dia.ref b/scilab/modules/scicos/tests/unit_tests/steadycos.unix.dia.ref index 09286ec..f97d02f 100644 --- a/scilab/modules/scicos/tests/unit_tests/steadycos.unix.dia.ref +++ b/scilab/modules/scicos/tests/unit_tests/steadycos.unix.dia.ref | |||
@@ -1,120 +1,12 @@ | |||
1 | 1 | // ============================================================================= | |
2 | ///withoutPrompt | 2 | // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab |
3 | 3 | // Copyright (C) 2008 - INRIA | |
4 | function [x,y,typ]=PENDULUM_ANIM(job,arg1,arg2) | 4 | // Copyright (C) 2009 - DIGITEO |
5 | // Animation of the cart-pendulum problem | 5 | // |
6 | x=[];y=[];typ=[] | 6 | // This file is distributed under the same license as the Scilab package. |
7 | select job | 7 | // ============================================================================= |
8 | case 'plot' then | 8 | // <-- ENGLISH IMPOSED --> |
9 | standard_draw(arg1) | 9 | load(fullfile(SCI,'modules','scicos','tests','unit_tests','pendulum_anim45.cos')); |
10 | case 'getinputs' then | ||
11 | [x,y,typ]=standard_inputs(o) | ||
12 | case 'getoutputs' then | ||
13 | x=[];y=[];typ=[]; | ||
14 | case 'getorigin' then | ||
15 | [x,y]=standard_origin(arg1) | ||
16 | case 'set' then | ||
17 | x=arg1; | ||
18 | graphics=arg1.graphics;exprs=graphics.exprs | ||
19 | model=arg1.model;dstate=model.dstate | ||
20 | while %t do | ||
21 | [ok,plen,csiz,phi,xmin,xmax,ymin,ymax,exprs]=getvalue(.. | ||
22 | 'Set Scope parameters',.. | ||
23 | ['pendulum length';'cart size (square side)';'slope'; | ||
24 | 'Xmin';'Xmax'; 'Ymin'; 'Ymax'; ],.. | ||
25 | list('vec',1,'vec',1,'vec',1,'vec',1,'vec',1,'vec',1,'vec',1),exprs) | ||
26 | if ~ok then break,end | ||
27 | mess=[] | ||
28 | if plen<=0|csiz<=0 then | ||
29 | mess=[mess;'Pendulum lenght and cart size must be positive.';' '] | ||
30 | ok=%f | ||
31 | end | ||
32 | if ymin>=ymax then | ||
33 | mess=[mess;'Ymax must be greater than Ymin';' '] | ||
34 | ok=%f | ||
35 | end | ||
36 | if xmin>=xmax then | ||
37 | mess=[mess;'Xmax must be greater than Xmin';' '] | ||
38 | ok=%f | ||
39 | end | ||
40 | if ~ok then | ||
41 | message(mess) | ||
42 | else | ||
43 | rpar=[plen;csiz;phi;xmin;xmax;ymin;ymax] | ||
44 | model.rpar=rpar; | ||
45 | graphics.exprs=exprs; | ||
46 | x.graphics=graphics;x.model=model | ||
47 | break | ||
48 | end | ||
49 | end | ||
50 | case 'define' then | ||
51 | plen=2; csiz=2; phi=0; | ||
52 | xmin=-5;xmax=5;ymin=-5;ymax=5 | ||
53 | model=scicos_model() | ||
54 | model.sim=list('anim_pen',5) | ||
55 | model.in=[1;1] | ||
56 | model.evtin=1 | ||
57 | model.dstate=0 | ||
58 | model.rpar=[plen;csiz;phi;xmin;xmax;ymin;ymax] | ||
59 | model.blocktype='d' | ||
60 | model.dep_ut=[%f %f] | ||
61 | exprs=string(model.rpar) | ||
62 | gr_i=['thick=xget(''thickness'');xset(''thickness'',2);'; | ||
63 | 'xx=orig(1)+sz(1)*[.4 .6 .6 .4 .4]' | ||
64 | 'yy=orig(2)+sz(2)*[.2 .2 .4 .4 .2]' | ||
65 | 'xpoly(xx,yy,''lines'')' | ||
66 | 'xx=orig(1)+sz(1)*[.5 .6]' | ||
67 | 'yy=orig(2)+sz(2)*[.4 .8]' | ||
68 | 'xpoly(xx,yy)' | ||
69 | 'xset(''thickness'',thick);'] | ||
70 | x=standard_define([3 3],model,exprs,gr_i) | ||
71 | end | ||
72 | endfunction | ||
73 | |||
74 | |||
75 | |||
76 | ///withoutPrompt | ||
77 | |||
78 | function [blocks] = anim_pen(blocks,flag) | ||
79 | win=20000+curblock() | ||
80 | if flag<>4 then H=scf(win), end | ||
81 | xold=blocks.z | ||
82 | rpar=blocks.rpar | ||
83 | plen=rpar(1);csiz=rpar(2);phi=rpar(3); | ||
84 | if flag==4 then | ||
85 | xset("window",win) | ||
86 | set("figure_style","new") | ||
87 | H=scf(win) | ||
88 | clf(H) | ||
89 | H.pixmap='on' | ||
90 | Axe=H.children | ||
91 | Axe.data_bounds=rpar(4:7) | ||
92 | Axe.isoview='on' | ||
93 | S=[cos(phi),-sin(phi);sin(phi),cos(phi)] | ||
94 | XY=S*[rpar(4),rpar(5);-csiz/2,-csiz/2] | ||
95 | xsegs(XY(1,:),XY(2,:)) | ||
96 | x=0;theta=0; | ||
97 | x1=x-csiz/2;x2=x+csiz/2;y1=-csiz/2;y2=csiz/2 | ||
98 | XY=S*[x1 x2 x2 x1 x1;y1,y1,y2,y2,y1] | ||
99 | xpoly(XY(1,:),XY(2,:),"lines",1) | ||
100 | XY=S*[x,x+plen*sin(theta);0,0+plen*cos(theta)] | ||
101 | xsegs(XY(1,:),XY(2,:)) | ||
102 | elseif flag==2 then | ||
103 | Axe=H.children | ||
104 | x=blocks.inptr(1)(1) | ||
105 | theta=blocks.inptr(2)(1) | ||
106 | XY=Axe.children(2).data'+.. | ||
107 | [cos(phi)*(x-xold);sin(phi)*(x-xold)]*ones(1,5) | ||
108 | Axe.children(2).data=XY' | ||
109 | x1=x*cos(phi);y1=x*sin(phi) | ||
110 | XY=[x1,x1+plen*sin(theta);y1,y1+plen*cos(theta)] | ||
111 | Axe.children(1).data=XY' | ||
112 | blocks.z=x | ||
113 | show_pixmap() | ||
114 | end | ||
115 | endfunction | ||
116 | |||
117 | load(fullfile(SCI,'modules','scicos','tests','unit_tests','pendulum_anim45.cos')) | ||
118 | M=10; | 10 | M=10; |
119 | m=3; | 11 | m=3; |
120 | l=3; | 12 | l=3; |
diff --git a/scilab/modules/shell/src/c/others/zzledt.c b/scilab/modules/shell/src/c/others/zzledt.c index 96b0541..e7bd5c3 100644 --- a/scilab/modules/shell/src/c/others/zzledt.c +++ b/scilab/modules/shell/src/c/others/zzledt.c | |||
@@ -817,7 +817,6 @@ static void TermCompletionOnFiles(char **dictionaryFiles, int sizedictionaryFile | |||
817 | if (new_line[l-1] == '.') strcat(new_line, &(dictionaryFiles[0][1])); | 817 | if (new_line[l-1] == '.') strcat(new_line, &(dictionaryFiles[0][1])); |
818 | else if (ptr_strrchar1) strcat(new_line, ptr_strrchar1); | 818 | else if (ptr_strrchar1) strcat(new_line, ptr_strrchar1); |
819 | 819 | ||
820 | |||
821 | CopyLineAtPrompt(wk_buf, new_line, cursor, cursor_max); | 820 | CopyLineAtPrompt(wk_buf, new_line, cursor, cursor_max); |
822 | FREE(new_line); | 821 | FREE(new_line); |
823 | return; | 822 | return; |
@@ -847,23 +846,15 @@ static void TermCompletionOnFiles(char **dictionaryFiles, int sizedictionaryFile | |||
847 | if (ptr_strrchar1) | 846 | if (ptr_strrchar1) |
848 | { | 847 | { |
849 | char *ptr_strrchar2 = NULL; | 848 | char *ptr_strrchar2 = NULL; |
850 | char *new_line = NULL; | ||
851 | ptr_strrchar2 = strrstr(currentline, defaultPattern); | 849 | ptr_strrchar2 = strrstr(currentline, defaultPattern); |
852 | new_line = (char*)MALLOC(sizeof(char)*(strlen(currentline)+ strlen(ptr_strrchar1))); | ||
853 | 850 | ||
854 | if (new_line) | 851 | int l = strlen(currentline)- strlen(ptr_strrchar2); |
855 | { | 852 | if (l < 0) l = 0 - l; |
856 | int l = strlen(currentline)- strlen(ptr_strrchar2); | ||
857 | if (l < 0) l = 0 - l; | ||
858 | 853 | ||
859 | strncpy(new_line,currentline, l); | 854 | strncpy(wk_buf,currentline, l); |
860 | new_line[l] = '\0'; | 855 | wk_buf[l] = '\0'; |
861 | strcat(new_line, ptr_strrchar1); | ||
862 | |||
863 | CopyLineAtPrompt(wk_buf, new_line, cursor, cursor_max); | ||
864 | 856 | ||
865 | FREE(new_line); | 857 | CopyLineAtPrompt(wk_buf, strcat(wk_buf, ptr_strrchar1), cursor, cursor_max); |
866 | } | ||
867 | } | 858 | } |
868 | else | 859 | else |
869 | { | 860 | { |
@@ -977,19 +968,13 @@ static void TermCompletionOnAll(char *currentline, char *defaultPattern, | |||
977 | { | 968 | { |
978 | char *result = NULL; | 969 | char *result = NULL; |
979 | char *partResult = NULL; | 970 | char *partResult = NULL; |
980 | char *new_line = NULL; | ||
981 | 971 | ||
982 | result = commonAll; | 972 | result = commonAll; |
983 | partResult = &result[strlen(defaultPattern)]; | 973 | partResult = &result[strlen(defaultPattern)]; |
984 | new_line = (char*)MALLOC(sizeof(char)*(strlen(currentline)+ strlen(partResult))); | ||
985 | 974 | ||
986 | if (new_line) | 975 | strcpy(wk_buf, currentline); |
987 | { | 976 | CopyLineAtPrompt(wk_buf, strcat(wk_buf,partResult), cursor, cursor_max); |
988 | strcpy(new_line, currentline); | 977 | |
989 | strcat(new_line,partResult); | ||
990 | CopyLineAtPrompt(wk_buf, new_line, cursor, cursor_max); | ||
991 | FREE(new_line); | ||
992 | } | ||
993 | FREE(commonAll); | 978 | FREE(commonAll); |
994 | commonAll = NULL; | 979 | commonAll = NULL; |
995 | } | 980 | } |