thermferm/rdconfig.c

changeset 194
9eaaba49450f
parent 191
c74bbc24a1c8
child 206
78fb6f99e473
equal deleted inserted replaced
193:4136193a0c22 194:9eaaba49450f
384 if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROFILE", "%s", tmp3->profile)) < 0) { 384 if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROFILE", "%s", tmp3->profile)) < 0) {
385 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); 385 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
386 return 1; 386 return 1;
387 } 387 }
388 if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_STARTED", "%d", (unsigned int)tmp3->prof_started)) < 0) { 388 if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_STARTED", "%d", (unsigned int)tmp3->prof_started)) < 0) {
389 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
390 return 1;
391 }
392 if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_PAUSED", "%d", (unsigned int)tmp3->prof_paused)) < 0) {
389 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); 393 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
390 return 1; 394 return 1;
391 } 395 }
392 if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_STATE", "%s", PROFSTATE[tmp3->prof_state] )) < 0) { 396 if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_STATE", "%s", PROFSTATE[tmp3->prof_state] )) < 0) {
393 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement"); 397 syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
681 unit->heater_state = unit->cooler_state = unit->fan_state = unit->door_state = unit->mode = unit->prof_state = 0; 685 unit->heater_state = unit->cooler_state = unit->fan_state = unit->door_state = unit->mode = unit->prof_state = 0;
682 unit->temp_set_min = 1.0; 686 unit->temp_set_min = 1.0;
683 unit->temp_set_max = 30.0; 687 unit->temp_set_max = 30.0;
684 unit->idle_rangeH = 1.0; 688 unit->idle_rangeH = 1.0;
685 unit->idle_rangeL = -1.0; 689 unit->idle_rangeL = -1.0;
686 unit->prof_started = (time_t)0; 690 unit->prof_started = unit->prof_paused = (time_t)0;
687 unit->PID_err_old = unit->PID_I_err = 0.0; 691 unit->PID_err_old = unit->PID_I_err = 0.0;
688 692
689 cur = cur->xmlChildrenNode; 693 cur = cur->xmlChildrenNode;
690 while (cur != NULL) { 694 while (cur != NULL) {
691 if ((!xmlStrcmp(cur->name, (const xmlChar *)"VERSION"))) { 695 if ((!xmlStrcmp(cur->name, (const xmlChar *)"VERSION"))) {
802 } 806 }
803 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROF_STARTED"))) { 807 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROF_STARTED"))) {
804 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); 808 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
805 if (sscanf((const char *)key, "%d", &ival) == 1) 809 if (sscanf((const char *)key, "%d", &ival) == 1)
806 unit->prof_started = ival; 810 unit->prof_started = ival;
811 xmlFree(key);
812 }
813 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROF_PAUSED"))) {
814 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
815 if (sscanf((const char *)key, "%d", &ival) == 1)
816 unit->prof_paused = ival;
807 xmlFree(key); 817 xmlFree(key);
808 } 818 }
809 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROF_STATE"))) { 819 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROF_STATE"))) {
810 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); 820 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
811 for (i = 0; i < 4; i++) { 821 for (i = 0; i < 4; i++) {

mercurial