Ignore:
Timestamp:
May 26, 2010, 11:21:51 PM (13 years ago)
Author:
Rafael de Pelegrini Soares
Message:

Added a simple open/close timer sample

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/sample/miscellaneous/sample_timer.mso

    r925 r926  
    1010
    1111        VARIABLES
    12         Clock as time_h;
     12        Clock as Real;
    1313        flow as flow_vol;
    1414       
     
    2323                flow = 0 * 'm^3/h';
    2424               
    25                 diff(Clock) = 1*'s'/TimeClosed;
    26                 when Clock/'s' > 1 switchto "opened";
     25                diff(Clock) = 1/TimeClosed;
     26                when Clock > 1 switchto "opened";
    2727
    2828        case "opened":
    2929                flow = 1 * 'm^3/h';
    3030               
    31                 diff(Clock) = -1*'s'/TimeOpened;
    32                 when Clock/'s' < 0 switchto "closed";
     31                diff(Clock) = -1/TimeOpened;
     32                when Clock < 0 switchto "closed";
    3333        end
    3434       
    3535        INITIAL
    36         Clock = 0*'s';
     36        Clock = 0;
    3737       
    3838        OPTIONS
Note: See TracChangeset for help on using the changeset viewer.