Browse Source

Support relative measurements in serialization/deserialization

Neal Wilson 11 years ago
parent
commit
f6ffb1ee34
1 changed files with 11 additions and 0 deletions
  1. 11
    0
      src/typica.w

+ 11
- 0
src/typica.w View File

11154
 	{
11154
 	{
11155
 		xmlout.writeStartElement("temperature");
11155
 		xmlout.writeStartElement("temperature");
11156
 		xmlout.writeAttribute("series", temperatureColumns.value(c));
11156
 		xmlout.writeAttribute("series", temperatureColumns.value(c));
11157
+		if(data->data(data->index(i, c), Qt::UserRole).toMap().contains("relative"))
11158
+		{
11159
+			if(data->data(data->index(i, c), Qt::UserRole).toMap().value("relative").toBool() == true)
11160
+			{
11161
+				xmlout.writeAttribute("relative", "true");
11162
+			}
11163
+		}
11157
 		xmlout.writeCharacters(data->data(data->index(i, c), Qt::DisplayRole).
11164
 		xmlout.writeCharacters(data->data(data->index(i, c), Qt::DisplayRole).
11158
 		                                  toString());
11165
 		                                  toString());
11159
 		xmlout.writeEndElement();
11166
 		xmlout.writeEndElement();
11413
 			                                   value("series").toString());
11420
 			                                   value("series").toString());
11414
 	tempval = xmlin.readElementText().toDouble();
11421
 	tempval = xmlin.readElementText().toDouble();
11415
 	Measurement measurement(tempval, timeval);
11422
 	Measurement measurement(tempval, timeval);
11423
+	if(xmlin.attributes().value("relative").toString() == "true")
11424
+	{
11425
+		measurement.insert("relative", true);
11426
+	}
11416
 	emit measure(measurement, column);
11427
 	emit measure(measurement, column);
11417
 }
11428
 }
11418
 else if(xmlin.name() == "control")
11429
 else if(xmlin.name() == "control")

Loading…
Cancel
Save