diff -r c92651a54969 -r 468ec0d96cce thermferm/rdconfig.c --- a/thermferm/rdconfig.c Sat May 16 17:39:30 2015 +0200 +++ b/thermferm/rdconfig.c Sun May 17 19:34:55 2015 +0200 @@ -22,6 +22,7 @@ #include "rdconfig.h" #include "thermferm.h" +#include "pid.h" #include "futil.h" #include "xutil.h" @@ -516,14 +517,6 @@ syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } - if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_INPUTD", "%.2f", tmp3->PID_cool->InputD)) < 0) { - syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); - return 1; - } - if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_INPUTLAST", "%.2f", tmp3->PID_cool->InputLast)) < 0) { - syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); - return 1; - } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_ERR", "%.2f", tmp3->PID_cool->Err)) < 0) { syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; @@ -532,7 +525,7 @@ syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } - if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_ERRLASTLAST", "%.2f", tmp3->PID_cool->ErrLastLast)) < 0) { + if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDC_ISTATE", "%.2f", tmp3->PID_cool->iState)) < 0) { syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } @@ -578,14 +571,6 @@ syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } - if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_INPUTD", "%.2f", tmp3->PID_heat->InputD)) < 0) { - syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); - return 1; - } - if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_INPUTLAST", "%.2f", tmp3->PID_heat->InputLast)) < 0) { - syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); - return 1; - } if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_ERR", "%.2f", tmp3->PID_heat->Err)) < 0) { syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; @@ -594,7 +579,7 @@ syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } - if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_ERRLASTLAST", "%.2f", tmp3->PID_heat->ErrLastLast)) < 0) { + if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PIDH_ISTATE", "%.2f", tmp3->PID_heat->iState)) < 0) { syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); return 1; } @@ -1247,18 +1232,6 @@ unit->PID_cool->Input = val; xmlFree(key); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_INPUTD"))) { - key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); - if (sscanf((const char *)key, "%f", &val) == 1) - unit->PID_cool->InputD = val; - xmlFree(key); - } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_INPUTLAST"))) { - key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); - if (sscanf((const char *)key, "%f", &val) == 1) - unit->PID_cool->InputLast = val; - xmlFree(key); - } if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_ERR"))) { key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); if (sscanf((const char *)key, "%f", &val) == 1) @@ -1271,10 +1244,10 @@ unit->PID_cool->ErrLast = val; xmlFree(key); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_ERRLASTLAST"))) { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_ISTATE"))) { key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); if (sscanf((const char *)key, "%f", &val) == 1) - unit->PID_cool->ErrLastLast = val; + unit->PID_cool->iState = val; xmlFree(key); } if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDC_SETP"))) { @@ -1335,18 +1308,6 @@ unit->PID_heat->Input = val; xmlFree(key); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_INPUTD"))) { - key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); - if (sscanf((const char *)key, "%f", &val) == 1) - unit->PID_heat->InputD = val; - xmlFree(key); - } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_INPUTLAST"))) { - key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); - if (sscanf((const char *)key, "%f", &val) == 1) - unit->PID_heat->InputLast = val; - xmlFree(key); - } if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_ERR"))) { key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); if (sscanf((const char *)key, "%f", &val) == 1) @@ -1359,10 +1320,10 @@ unit->PID_heat->ErrLast = val; xmlFree(key); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_ERRLASTLAST"))) { + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_ISTATE"))) { key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); if (sscanf((const char *)key, "%f", &val) == 1) - unit->PID_heat->ErrLastLast = val; + unit->PID_heat->iState = val; xmlFree(key); } if ((!xmlStrcmp(cur->name, (const xmlChar *)"PIDH_SETP"))) {