thermferm/simulator.c

changeset 553
4091d4fe217f
parent 552
8b56f1b4e7ec
child 571
6f8eda55ec2c
equal deleted inserted replaced
552:8b56f1b4e7ec 553:4091d4fe217f
29 extern int debug; 29 extern int debug;
30 extern sys_config Config; 30 extern sys_config Config;
31 31
32 int SIMcooling = 0; 32 int SIMcooling = 0;
33 int SIMheating = 0; 33 int SIMheating = 0;
34 int SIMfan = 0;
35 int SIMlight = 0;
34 36
35 37
36 #ifdef HAVE_WIRINGPI_H 38 #ifdef HAVE_WIRINGPI_H
37 PI_THREAD (my_simulator_loop) 39 PI_THREAD (my_simulator_loop)
38 #else 40 #else
122 * Calculate final temperature of the beer and the air. 124 * Calculate final temperature of the beer and the air.
123 */ 125 */
124 // Cheap trick, just follow slowly the air temp. 126 // Cheap trick, just follow slowly the air temp.
125 simulator->beer_temperature += ((simulator->air_temperature - simulator->beer_temperature) / 500.0); 127 simulator->beer_temperature += ((simulator->air_temperature - simulator->beer_temperature) / 500.0);
126 simulator->air_temperature += ((simulator->beer_temperature - simulator->air_temperature) / 2500.0); 128 simulator->air_temperature += ((simulator->beer_temperature - simulator->air_temperature) / 2500.0);
129 simulator->chiller_temperature = simulator->cooler_temp; // Libk these
127 130
128 if ((seconds % 15) == 0) 131 if ((seconds % 15) == 0)
129 syslog(LOG_NOTICE, "air=%.3f beer=%.3f heater=%.3f cooler=%.3f", simulator->air_temperature, simulator->beer_temperature, 132 syslog(LOG_NOTICE, "air=%.3f beer=%.3f heater=%.3f cooler=%.3f", simulator->air_temperature, simulator->beer_temperature,
130 simulator->s_heat_temp, simulator->s_cool_temp); 133 simulator->s_heat_temp, simulator->s_cool_temp);
131 134

mercurial