File: SEP_066_Xcos_multi_hooks.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 (48 lines) | stat: -rw-r--r-- 1,420 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
45
46
47
48
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) Scilab Enterprises - 201é - Clément DAVID
//
// This file is distributed under the same license as the Scilab package.
// <-- ENGLISH IMPOSED -->
// <-- XCOS TEST -->
//
// <-- Short Description -->
// Check the API of multiple Xcos hooks, see SEP_066_Xcos_hooks.odt
global status;
status = [];
function continueSimulation = pre1(scs_m, needcompile)
  global status;
  [linenum,mac]=where();
  status = [status mac(1)];
  continueSimulation=%t;
endfunction
function continueSimulation = pre2(scs_m, needcompile)
  global status;
  [linenum,mac]=where();
  status = [status mac(1)];
  continueSimulation=%t;
endfunction
function continueSimulation = pre3(scs_m, needcompile)
  global status;
  [linenum,mac]=where();
  status = [status mac(1)];
  continueSimulation=%t;
endfunction
function post1(%cpr, scs_m, needcompile)
  global status;
  [linenum,mac]=where();
  status = [status mac(1)];
endfunction
function post2(%cpr, scs_m, needcompile)
  global status;
  [linenum,mac]=where();
  status = [status mac(1)];
endfunction
// register the hooks
pre_xcos_simulate=list('pre1', 'pre2', 'pre3');
post_xcos_simulate=list('post1', 'post2');
assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/demos/Simple_Demo.zcos"));
xcos_simulate(scs_m, 4);
assert_checkequal(status, ['pre1', 'pre2', 'pre3', 'post1', 'post2'])
 ans  =
 
  T