~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to macros/scicos_blocks/REGISTER_f.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function [x,y,typ]=REGISTER_f(job,arg1,arg2)
 
2
// Copyright INRIA
 
3
x=[];y=[];typ=[]
 
4
select job
 
5
case 'plot' then
 
6
  standard_draw(arg1)
 
7
case 'getinputs' then
 
8
  [x,y,typ]=standard_inputs(arg1)
 
9
case 'getoutputs' then
 
10
  [x,y,typ]=standard_outputs(arg1)
 
11
case 'getorigin' then
 
12
  [x,y]=standard_origin(arg1)
 
13
case 'set' then
 
14
  x=arg1;
 
15
  graphics=arg1(2);label=graphics(4)
 
16
  model=arg1(3);
 
17
  while %t do
 
18
    [ok,z0,label]=getvalue('Set delay parameters',..
 
19
        'Register initial condition',list('vec',-1),label)
 
20
    if ~ok then break,end
 
21
    if prod(size(z0))<2 then
 
22
      message('Register length must be at least 2')
 
23
      ok=%f
 
24
    end
 
25
    if ok then
 
26
      graphics(4)=label;
 
27
      model(7)=z0
 
28
      x(2)=graphics;x(3)=model
 
29
      break
 
30
    end
 
31
  end
 
32
  x(3)(11)=[] //compatibility
 
33
case 'define' then
 
34
  z0=zeros(10,1)
 
35
  model=list('delay',1,1,1,[],[],z0,[],[],'d',-1,[%f %f],' ',list())
 
36
  label=strcat(string(z0),';')
 
37
  gr_i=['dly=model(8);';
 
38
    'txt=[''Shift'';''Register'';string(dly)];';
 
39
    'xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'')']
 
40
  x=standard_define([2.5 2.5],model,label,gr_i)
 
41
end
 
42
 
 
43
 
 
44
 
 
45