thermferm/simulator.c

changeset 362
c92651a54969
parent 265
63a003914b72
child 363
468ec0d96cce
equal deleted inserted replaced
361:308f6a436779 362:c92651a54969
27 27
28 extern int my_shutdown; 28 extern int my_shutdown;
29 extern int debug; 29 extern int debug;
30 extern sys_config Config; 30 extern sys_config Config;
31 31
32 int SIMcooling = 0;
33 int SIMheating = 0;
32 34
33 35
34 #ifdef HAVE_WIRINGPI_H 36 #ifdef HAVE_WIRINGPI_H
35 PI_THREAD (my_simulator_loop) 37 PI_THREAD (my_simulator_loop)
36 #else 38 #else
76 /* 78 /*
77 * If heating, calculate temperature of the heating plate. If heating is off but 79 * If heating, calculate temperature of the heating plate. If heating is off but
78 * the plate is warmer then the air, calculate the cooling down temperature. 80 * the plate is warmer then the air, calculate the cooling down temperature.
79 * Finally, calculate the new air and plate temperature. 81 * Finally, calculate the new air and plate temperature.
80 */ 82 */
83 if (SIMheating) {
84 simulator->air_temperature += 0.01;
85 }
81 86
82 /* 87 /*
83 * If cooling, calculate temperature of the cooling plate. If cooling is off but 88 * If cooling, calculate temperature of the cooling plate. If cooling is off but
84 * the plate is colder then the air, calculate the warming up temperature. 89 * the plate is colder then the air, calculate the warming up temperature.
85 * Finsally, calculate the new air and plate temperature. 90 * Finsally, calculate the new air and plate temperature.
86 */ 91 */
92 if (SIMcooling) {
93 simulator->air_temperature -= 0.01;
94 }
87 95
88 /* 96 /*
89 * Calculate the extra beer temperatur rise to simulate the heat produced by the 97 * Calculate the extra beer temperatur rise to simulate the heat produced by the
90 * fermentation process. Peak about one day after start and slowly decrease after 98 * fermentation process. Peak about one day after start and slowly decrease after
91 * that. 99 * that.

mercurial