~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/scicos_blocks/Misc/BACKLASH.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function [x,y,typ]=BACKLASH(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.graphics;exprs=graphics.exprs
 
16
    model=arg1.model;
 
17
    rpar=model.rpar
 
18
    while %t do
 
19
      [ok,ini,gap,zcr,exprs]=getvalue('Set backlash parameters',..
 
20
                                      ['initial output';
 
21
                    'gap';'use zero-crossing (0:no, 1:yes)'],..
 
22
                    list('vec',1,'vec',1,'vec',1),exprs)
 
23
      
 
24
      
 
25
      if ~ok then break,end
 
26
      if ok then
 
27
        graphics.exprs=exprs;
 
28
        rpar(1)=ini;rpar(2)=gap;
 
29
        if zcr<>0 then
 
30
          model.nzcross=2
 
31
        else
 
32
          model.nzcross=0
 
33
        end
 
34
        model.rpar=rpar
 
35
        x.graphics=graphics;x.model=model
 
36
        break
 
37
      end
 
38
    end
 
39
   case 'define' then
 
40
    exprs=['0';'1';'1']
 
41
    model=scicos_model()
 
42
    model.sim=list('backlash',4)
 
43
    model.in=1
 
44
    model.out=1
 
45
    model.rpar=[0;1]
 
46
    model.nzcross=2;
 
47
    model.blocktype='c'
 
48
    model.dep_ut=[%t %f]
 
49
    
 
50
    gr_i=['xstringb(orig(1),orig(2),[''backlash''],sz(1),sz(2),''fill'')']
 
51
    
 
52
    x=standard_define([2.5 2],model,exprs,gr_i)
 
53
  end
 
54
endfunction