File: cmscope.dia.ref

package info (click to toggle)
scilab 5.5.1-7
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 337,804 kB
  • ctags: 69,618
  • sloc: xml: 770,056; ansic: 295,010; java: 187,293; fortran: 155,805; cpp: 66,211; ml: 24,230; sh: 23,700; tcl: 14,792; makefile: 8,315; perl: 1,566; php: 690; cs: 614
file content (44 lines) | stat: -rw-r--r-- 1,803 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2013 - Scilab Enterprises - Clément DAVID
// Copyright (C) 2011 - DIGITEO - Clément DAVID
//
//  This file is distributed under the same license as the Scilab package.
// =============================================================================
// <-- XCOS TEST -->
// <-- TEST WITH GRAPHIC -->
// test scope values 
assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cmscope.zcos"));
xcos_simulate(scs_m, 4);
function assert_checkcmscope()
    f=gcf();
    assert_checkequal(size(f.children), [3 1])
    a1=f.children(1);
    a2=f.children(2);
    a3=f.children(3);
    assert_checkequal(size(a1.children), [2 1])
    assert_checkequal(size(a2.children), [1 1])
    assert_checkequal(size(a3.children), [1 1])
    p11=a1.children(1);
    p12=a1.children(2);
    p21=a2.children(1);
    p31=a3.children(1);
    assert_checkequal(f.figure_id, 20003);
    assert_checkequal(a1.data_bounds, [0 -30 ; 90 30]);
    assert_checkequal(a2.data_bounds, [0 -5 ; 60 5]);
    assert_checkequal(a3.data_bounds, [0 -1 ; 30 1]);
    assert_checkequal(a1.x_label.text, "t");
    assert_checkequal(a2.x_label.text, "t");
    assert_checkequal(a3.x_label.text, "t");
    assert_checkequal(a1.y_label.text, "y");
    assert_checkequal(a2.y_label.text, "y");
    assert_checkequal(a3.y_label.text, "y");
    assert_checkequal(size(p11.data), [299 2]);
    assert_checkequal(size(p12.data), [299 2]);
    assert_checkequal(size(p21.data), [299 2]);
    assert_checkequal(size(p31.data), [299 2]);
endfunction
assert_checkcmscope();
// Simulate again to check multi-simulations cases
xcos_simulate(scs_m, 4);
assert_checkcmscope();