1401 */ |
1401 */ |
1402 if (unit->heater_address) { |
1402 if (unit->heater_address) { |
1403 UpdatePID(unit->PID_heat); |
1403 UpdatePID(unit->PID_heat); |
1404 |
1404 |
1405 if (debug) |
1405 if (debug) |
1406 fprintf(stdout, "Heat: sp=%.2f Input=%.2f InputD=%.2f Err=%.2f Out=%.2f\n", |
1406 fprintf(stdout, "Heat: sp=%.2f Input=%.2f iState=%.2f Err=%.2f Out=%.2f\n", |
1407 unit->PID_heat->SetP, unit->PID_heat->Input, unit->PID_heat->InputD, unit->PID_heat->Err, unit->PID_heat->OutP); |
1407 unit->PID_heat->SetP, unit->PID_heat->Input, unit->PID_heat->iState, unit->PID_heat->Err, unit->PID_heat->OutP); |
1408 if (((unit->PID_heat->OutP >= 1) && unit->heater_address) || (seconds == 60) || unit->heater_state) { |
1408 if (((unit->PID_heat->OutP >= 1) && unit->heater_address) || (seconds == 60) || unit->heater_state) { |
1409 syslog(LOG_NOTICE, "Heat: sp=%.2f Input=%.2f InputD=%.2f Err=%.2f Out=%.2f", |
1409 syslog(LOG_NOTICE, "Heat: sp=%.2f Input=%.2f iState=%.2f Err=%.2f Out=%.2f", |
1410 unit->PID_heat->SetP, unit->PID_heat->Input, unit->PID_heat->InputD, unit->PID_heat->Err, unit->PID_heat->OutP); |
1410 unit->PID_heat->SetP, unit->PID_heat->Input, unit->PID_heat->iState, unit->PID_heat->Err, unit->PID_heat->OutP); |
1411 } |
1411 } |
1412 } |
1412 } |
1413 if (unit->cooler_address) { |
1413 if (unit->cooler_address) { |
1414 UpdatePID(unit->PID_cool); |
1414 UpdatePID(unit->PID_cool); |
1415 |
1415 |
1416 if (debug) |
1416 if (debug) |
1417 fprintf(stdout, "Cool: sp=%.2f Input=%.2f InputD=%.2f Err=%.2f Out=%.2f\n", |
1417 fprintf(stdout, "Cool: sp=%.2f Input=%.2f iState=%.2f Err=%.2f Out=%.2f\n", |
1418 unit->PID_cool->SetP, unit->PID_cool->Input, unit->PID_cool->InputD, unit->PID_cool->Err, unit->PID_cool->OutP); |
1418 unit->PID_cool->SetP, unit->PID_cool->Input, unit->PID_cool->iState, unit->PID_cool->Err, unit->PID_cool->OutP); |
1419 if (((unit->PID_cool->OutP >= 1) && unit->cooler_address) || (seconds == 60) || unit->cooler_state) { |
1419 if (((unit->PID_cool->OutP >= 1) && unit->cooler_address) || (seconds == 60) || unit->cooler_state) { |
1420 syslog(LOG_NOTICE, "Cool: sp=%.2f Input=%.2f InputD=%.2f Err=%.2f Out=%.2f", |
1420 syslog(LOG_NOTICE, "Cool: sp=%.2f Input=%.2f iState=%.2f Err=%.2f Out=%.2f", |
1421 unit->PID_cool->SetP, unit->PID_cool->Input, unit->PID_cool->InputD, unit->PID_cool->Err, unit->PID_cool->OutP); |
1421 unit->PID_cool->SetP, unit->PID_cool->Input, unit->PID_cool->iState, unit->PID_cool->Err, unit->PID_cool->OutP); |
1422 } |
1422 } |
1423 } |
1423 } |
1424 |
1424 |
1425 if (unit->PID_cool->OutP && unit->PID_heat->OutP) { |
1425 if (unit->PID_cool->OutP && unit->PID_heat->OutP) { |
1426 syslog(LOG_NOTICE, "Heat and Cool lockdown"); |
1426 syslog(LOG_NOTICE, "Heat and Cool lockdown"); |