hystheresis.c File Reference

#include "scicos_block.h"
#include <math.h>

Include dependency graph for hystheresis.c:

Go to the source code of this file.

Functions

void hystheresis (scicos_block *block, int flag)


Function Documentation

void hystheresis ( scicos_block block,
int  flag 
)

Definition at line 4 of file hystheresis.c.

References scicos_block::g, get_phase_simulation(), scicos_block::inptr, scicos_block::mode, scicos_block::ng, scicos_block::outptr, and scicos_block::rpar.

00005 {
00006   if (flag==1){
00007     if (get_phase_simulation()==1||block->ng==0) {
00008       if (*block->inptr[0]>=block->rpar[0]){
00009         block->outptr[0][0]=block->rpar[2];
00010       }else if (*block->inptr[0]<=block->rpar[1]){
00011         block->outptr[0][0]=block->rpar[3];
00012       }
00013     }else{
00014       if (block->mode[0]<2){
00015         block->outptr[0][0]=block->rpar[3];
00016       }else{
00017         block->outptr[0][0]=block->rpar[2];
00018       }
00019     } 
00020   } else if (flag==9){
00021     block->g[0]=*block->inptr[0]-(block->rpar[0]);
00022     block->g[1]=*block->inptr[0]-(block->rpar[1]);
00023     if (get_phase_simulation()==1) {
00024       if (block->g[0]>=0){
00025         block->mode[0]=2;
00026       }else if (block->g[1]<=0){
00027         block->mode[0]=1;
00028       }
00029     }
00030   }
00031 }

Here is the call graph for this function:


Generated on Sun Mar 4 16:12:04 2007 for Scilab [trunk] by  doxygen 1.5.1