aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/lustrev4_lv6-en-2cgc_heater_control/heater_control_heater_control_loop.c
blob: d1a012683130961c54cf433191c1fed755d03155 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* This file was generated by lv6 version master.737 (2727a7744111c84f7984634d2bd3ad6f7c6c7ff9). */
/*  lv6 -en -2cgc heater_control.lus -n heater_control */
/* on vanoise the 15/05/2019 at 13:20:10 */

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include "../dm_random.c"
#include "../clock.h"
#include "heater_control_heater_control.h" 

/* MACROS DEFINITIONS ****************/
#ifndef TT
#define TT "1"
#endif
#ifndef FF
#define FF "0"
#endif
#ifndef BB
#define BB "bottom"
#endif
#ifdef CKCHECK
/* set this macro for testing output clocks */
#endif

/* Standard Input procedures **************/
_real _get_real(char* n){
  return (dm_random_uint32()%70000U) * 1E-3 -20.0;
}
/* Standard Output procedures **************/
void _put_bool(char* n, _boolean b){
  printf("%s: %d\n", n, b);
}
/* Main procedure *************************/
int main(){
  _real T;
  _real T1;
  _real T2;
  _real T3;
  _boolean Heat_on;
  heater_control_heater_control_ctx_type ctx_struct;
  heater_control_heater_control_ctx_type* ctx = &ctx_struct;

  clock_prepare();
  clock_start();
  
  heater_control_heater_control_ctx_init(ctx);

  /* Main loop */
  for(int step=0; step<1000; step++){
     T = _get_real("T");
     T1 = _get_real("T1");
     T2 = _get_real("T2");
     T3 = _get_real("T3");
    heater_control_heater_control_step(T,T1,T2,T3,&Heat_on,ctx);
    // _put_bool("Heat_on", Heat_on);
  }

  clock_stop();
  print_total_clock();
  
  return 1; 
}