Ignore:
Timestamp:
Jun 21, 2007, 3:01:27 PM (16 years ago)
Author:
gerson bicca
Message:

added documentation and updated HiloSelect? model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eml/controllers/HiLoSelect.mso

    r74 r293  
    1212* EMSO is distributed under the therms of the ALSOC LICENSE as
    1313* available at http://www.enq.ufrgs.br/alsoc.
    14 *
    15 *----------------------------------------------------------------------
    16 * Model HiLoSelect
    17 *-----------------------------------------------------------------------
    18 * - Inputs
    19 *               - Two different input signals
    20 *
    21 * - Outputs
    22 *               - One output signal
    23 *
    24 *
    2514*-----------------------------------------------------------------------
    2615* Author: Tiago Osório
     
    3221Model HiLoSelect
    3322
     23ATTRIBUTES
     24        Pallete         = true;
     25        Icon            = "HiLoSelect";
     26        Brief           = "Model HiLo Select.";
     27        Info            =
     28        "
     29        - Inputs:
     30        * Two different input signals.
     31       
     32        - Outputs:
     33        * One output signal.
     34       
     35        ";
     36       
    3437        PARAMETERS
    35         select as Real (Brief="HiLoSelect option: (1) output=higher input, (0) output=lower input");
     38        Select as Switcher (Brief="HiLoSelect option", Valid=["higher","lower"], Default="higher");
    3639
    3740        VARIABLES
     
    4245        EQUATIONS
    4346 
    44         if ((select>0 and input1 > input2) or (select<1  and input2>input1)) then
    45                 "Calculate output"     
    46                 output = input1;
    47         else
    48                 "Calculate output"
    49                 output = input2;
     47switch Select
     48               
     49        case "higher":
     50       
     51"Calculate output maximum"     
     52                output = max([input1,input2]);
     53               
     54case "lower":
     55                "Calculate output minimum"
     56                output = min([input1,input2]);
    5057        end
    5158       
Note: See TracChangeset for help on using the changeset viewer.