thermferm/rdconfig.c

changeset 191
c74bbc24a1c8
parent 185
4f34271cf1e7
child 194
9eaaba49450f
--- a/thermferm/rdconfig.c	Thu Aug 07 16:44:53 2014 +0200
+++ b/thermferm/rdconfig.c	Thu Aug 07 19:38:30 2014 +0200
@@ -434,6 +434,10 @@
 		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
+	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "INITTEMP", "%.1f", tmp4->inittemp)) < 0) {
+		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		return 1;
+	    }
 	    if (tmp4->steps) {
 		if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "STEPS")) < 0) {
 		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement");
@@ -924,12 +928,14 @@
     xmlChar     	*key;
     profiles_list	*profile, *tmp;
     int			ival;
+    float		fval;
 
     profile = (profiles_list *)malloc(sizeof(profiles_list));
     profile->next = NULL;
     profile->version = 1;
     profile->uuid = profile->name = NULL;
     profile->busy = 0;
+    profile->inittemp = 20.0;
     profile->steps = NULL;
 
     cur = cur->xmlChildrenNode;
@@ -955,6 +961,12 @@
 		profile->busy = ival;
 	    xmlFree(key);
 	}
+	if ((!xmlStrcmp(cur->name, (const xmlChar *)"INITTEMP"))) {
+	    key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
+	    if (sscanf((const char *)key, "%f", &fval) == 1)
+		profile->inittemp = fval;
+	    xmlFree(key);
+	}
 	if ((!xmlStrcmp(cur->name, (const xmlChar *)"STEPS"))) {
 	    parseSteps(doc, cur, &(profile)->steps);
 	}

mercurial