From c0e5fac12cf1839b0744e313b2ebd4172cafd66a Mon Sep 17 00:00:00 2001 From: Andrea Zoli Date: Thu, 22 May 2014 15:03:34 +0200 Subject: [PATCH] Use constvalue attribute name for fields (xmls). --- conf/telemetry.xsd | 3 ++- src/XmlConfig.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/conf/telemetry.xsd b/conf/telemetry.xsd index b1c1c34..3a2addb 100644 --- a/conf/telemetry.xsd +++ b/conf/telemetry.xsd @@ -104,8 +104,9 @@ but it could also be referenced using idrefs. --> - + + diff --git a/src/XmlConfig.cpp b/src/XmlConfig.cpp index 38df4d5..f04cee5 100644 --- a/src/XmlConfig.cpp +++ b/src/XmlConfig.cpp @@ -148,12 +148,12 @@ void XmlConfig::_writeFields(xml_node parent, fstream& fs) int nbits = atoi(typeStr.substr(spos, epos+1).c_str()); fs << nbits << endl; - xml_attribute defaultt = it->attribute("default"); - if(!defaultt) + xml_attribute constvalue = it->attribute("constvalue"); + if(!constvalue) fs << "none" << endl; else { - bitset<64> x(atoi(defaultt.value())); + bitset<64> x(atoi(constvalue.value())); fs << "0b" << x.to_string().substr(64-nbits, 64) << endl; } index++; -- GitLab