update databasexml change format message send in yaml output

This commit is contained in:
AleaJactaEst 2020-11-28 18:06:55 +01:00
parent 7501c7fca1
commit eda02f65b4

View file

@ -146,16 +146,16 @@ class LeafDatabase():
if self.type[0] == 'I': # Unsigned
logging.getLogger(LOGGER).debug("Read:" + str (self.type))
value = int(self.type[1:])
_ = msgin.readSerialUint64(value, name=tmp, typeName=self.type)
_ = msgin.readSerialUint64(value, name=tmp, typeName="Uint" + str(value))
elif self.type[0] == 'S': # Signed
logging.getLogger(LOGGER).debug("Read:" + str (self.type))
value = int(self.type[1:])
# _ = msgin.readNbChar(value, name='DatabaseXML' + tmp)
_ = msgin.readSerialUint64(value, name=tmp)
_ = msgin.readSerialUint64(value, name=tmp, typeName="Sint" + str(value))
elif self.type == 'TEXT':
logging.getLogger(LOGGER).debug("type:" + str (self.type))
value = 32
_ = msgin.readSerialSint64(value, name=idname)
_ = msgin.readSerialSint64(value, name=idname, typeName="Uint32/TEXT")
else:
logging.getLogger(LOGGER).error("Type inconnu:" + str (self.type))
raise "type not managed"
@ -183,16 +183,18 @@ class LeafDatabase():
if value > 64:
raise "type not managed"
logging.getLogger(LOGGER).debug('value:' + str(value))
_ = msgin.readSerialUint64(value, name=idname, typeName=self.type)
_ = msgin.readSerialUint64(value, name=idname, typeName="Uint" + str(value))
return level+1
elif self.type[0] == 'S':
logging.getLogger(LOGGER).debug("type:" + str (self.type))
value = int(self.type[1:])
_ = msgin.readSerialSint64(value, name=idname)
_ = msgin.readSerialSint64(value, name=idname, typeName="Sint" + str(value))
return level+1
elif self.type == 'TEXT':
logging.getLogger(LOGGER).debug("type:" + str (self.type))
value = 32
_ = msgin.readSerialUint64(value, name=idname)
_ = msgin.readSerialUint64(value, name=idname, typeName="Uint32/TEXT")
return level+1
else:
logging.getLogger(LOGGER).debug("Type inconnu:", self.type)
raise "type not managed"
@ -402,7 +404,7 @@ class BranchDatabase():
idname = parent + self.name +'/'
else:
idname = parent
cBitSet = msgin.readCBitSet(nbchild, idname + ":Param", typeName = 'I' + str(nbchild))
cBitSet = msgin.readCBitSet(nbchild, idname + ":Param", typeName = 'Uint' + str(nbchild))
#cBitSet = CBitSet.CBitSet()
#cBitSet.readSerialExtra(msgin, nbchild, self.name + "/Param")
logging.getLogger(LOGGER).debug(msgin.showAllData())