thermferm/server.c

changeset 313
8448fcf3d799
parent 312
7b0f819a3805
child 325
35b6f6605ae3
equal deleted inserted replaced
312:7b0f819a3805 313:8448fcf3d799
1503 unit->temp_set_max = 30.0; 1503 unit->temp_set_max = 30.0;
1504 unit->idle_rangeH = 1.0; 1504 unit->idle_rangeH = 1.0;
1505 unit->idle_rangeL = -1.0; 1505 unit->idle_rangeL = -1.0;
1506 unit->prof_started = unit->prof_paused = unit->prof_primary_done = (time_t)0; 1506 unit->prof_started = unit->prof_paused = unit->prof_primary_done = (time_t)0;
1507 unit->prof_percent = 0; 1507 unit->prof_percent = 0;
1508 unit->PID_err_old = unit->PID_I_err = unit->PID_Kp = unit->PID_Kd = unit->PID_Ki = 0.0; 1508 unit->PID_dState = unit->PID_iState = unit->PID_Kp = unit->PID_Kd = unit->PID_Ki = 0.0;
1509 1509
1510 /* 1510 /*
1511 * Block main process 1511 * Block main process
1512 */ 1512 */
1513 run_pause = TRUE; 1513 run_pause = TRUE;
1849 if ((unit->mode == UNITMODE_OFF) && (i != UNITMODE_OFF)) 1849 if ((unit->mode == UNITMODE_OFF) && (i != UNITMODE_OFF))
1850 initlog(unit->name); 1850 initlog(unit->name);
1851 syslog(LOG_NOTICE, "Fermenter unit %s mode %s to %s", unit->uuid, UNITMODE[unit->mode], UNITMODE[i]); 1851 syslog(LOG_NOTICE, "Fermenter unit %s mode %s to %s", unit->uuid, UNITMODE[unit->mode], UNITMODE[i]);
1852 unit->mode = i; 1852 unit->mode = i;
1853 /* Allways turn everything off after a mode change */ 1853 /* Allways turn everything off after a mode change */
1854 unit->PID_I_err = unit->PID_err_old = 0.0; 1854 unit->PID_iState = unit->PID_dState = 0.0;
1855 unit->heater_state = unit->cooler_state = unit->fan_state = unit->light_state = 0; 1855 unit->heater_state = unit->cooler_state = unit->fan_state = unit->light_state = 0;
1856 unit->heater_wait = unit->cooler_wait = unit->fan_wait = unit->light_wait = 0; 1856 unit->heater_wait = unit->cooler_wait = unit->fan_wait = unit->light_wait = 0;
1857 device_out(unit->heater_address, unit->heater_state); 1857 device_out(unit->heater_address, unit->heater_state);
1858 device_out(unit->cooler_address, unit->cooler_state); 1858 device_out(unit->cooler_address, unit->cooler_state);
1859 device_out(unit->fan_address, unit->fan_state); 1859 device_out(unit->fan_address, unit->fan_state);
1919 else 1919 else
1920 unit->profile = NULL; 1920 unit->profile = NULL;
1921 /* 1921 /*
1922 * Reset all output devices 1922 * Reset all output devices
1923 */ 1923 */
1924 unit->PID_I_err = unit->PID_err_old = 0.0; 1924 unit->PID_iState = unit->PID_dState = 0.0;
1925 unit->heater_state = unit->cooler_state = unit->fan_state = unit->light_state = 0; 1925 unit->heater_state = unit->cooler_state = unit->fan_state = unit->light_state = 0;
1926 unit->heater_wait = unit->cooler_wait = unit->fan_wait = unit->light_wait = 0; 1926 unit->heater_wait = unit->cooler_wait = unit->fan_wait = unit->light_wait = 0;
1927 device_out(unit->heater_address, unit->heater_state); 1927 device_out(unit->heater_address, unit->heater_state);
1928 device_out(unit->cooler_address, unit->cooler_state); 1928 device_out(unit->cooler_address, unit->cooler_state);
1929 device_out(unit->fan_address, unit->fan_state); 1929 device_out(unit->fan_address, unit->fan_state);

mercurial