Project

General

Profile

Download (661 Bytes) Statistics
| Branch: | Tag: | Revision:
1
const delay_on = 200;
2

    
3
const delay_off = 500;
4

    
5
node count(d : int; t : bool) returns (ok : bool)
6
var cpt:int;
7
let
8
  ok = (cpt = 0);
9
  cpt = 0 -> (if t then pre cpt + 1 else pre cpt) mod d;
10
tel
11

    
12
node command(millisecond : bool) returns (open_light, open_gas : bool)
13
let
14
  automaton command_control
15
    state Open :
16
          let
17
            open_light = true;
18
            open_gas = true;
19
          tel
20
          until count(delay_on, millisecond) restart Silent
21
    state Silent :
22
          let
23
            open_light = false;
24
            open_gas = false;
25
          tel
26
          until count(delay_off, millisecond) restart Open
27
tel
(6-6/17)