summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevron Rees <kevron.m.rees@intel.com>2015-01-06 11:01:12 -0800
committerKevron Rees <kevron.m.rees@intel.com>2015-01-06 11:35:13 -0800
commit70cc0eecdc2b4e62d6f42e14c5a9cf47cd9017d5 (patch)
tree646e265a689f8322f1787c771bb7a2649d79327f
parent7a3cb2fc39a3b84307afbd79b352ae09f36bd0bf (diff)
downloadautomotive-message-broker-70cc0eecdc2b4e62d6f42e14c5a9cf47cd9017d5.tar.gz
[tools] - genmapping documentation improvement
-rwxr-xr-xtools/genmapping.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/tools/genmapping.py b/tools/genmapping.py
index 143a67fc..136f9db7 100755
--- a/tools/genmapping.py
+++ b/tools/genmapping.py
@@ -17,13 +17,22 @@ interfaces = []
class Member:
ambName = ""
memberName = ""
-
+ interfaceName = ""
+ def __init__(self, ifaceName):
+ self.interfaceName = ifaceName
def __repr__(self):
return "Member"
def toString(self):
return "{" + self.ambName + " => " + self.memberName + "}"
def toIdl(self):
- return ' const DOMString ' + self.ambName + ' = "' + self.memberName + '";\n'
+ idl = []
+ idl.append('')
+ idl.append('\t/*!')
+ idl.append('\t * \\brief corresponds with DBus property ' + self.memberName + ' for interface org.automotive.' + self.interfaceName)
+ idl.append('\t * AMB fulfills this member with VehicleProperty::' + self.ambName)
+ idl.append('\t */')
+ idl.append('\tconst DOMString ' + self.ambName + ' = "' + self.memberName + '";\n')
+ return '\n'.join(idl)
class Interface:
def __init__(self):
@@ -37,7 +46,7 @@ class Interface:
output += member.toString() + ","
return output
def toIdl(self):
- output = "interface " + self.name + " {\n"
+ output = "/*! \n * \\brief Corresponds with DBus Interface org.automotive." + self.name + "\n */\ninterface " + self.name + " {\n"
for member in self.members:
output += member.toIdl()
output += "\n};\n"
@@ -59,7 +68,7 @@ for input in args.mappingFiles:
wantPropertyVariant = 'wantPropertyVariant('
i = line.find(wantPropertyVariant)
if i!= -1:
- member = Member()
+ member = Member(interfaces[-1].name)
ambNameEnd = line.find(', "')-2
member.ambName = line[i+len(wantPropertyVariant) : i + ambNameEnd].replace("VehicleProperty::", "")
memberNameBeg = line.find(', "')+3
@@ -78,7 +87,9 @@ with outputFile:
" * \\brief This describes the AMB internal property names to AMB DBus interface property names\n"
" * AMB internal property names are designed to be flat variable names (ie, 'ConvertableRoofStatus'). The DBus\n"
" * properties however follow the naming scheme defined in the W3C automotive business group vehicle <a href='http://w3c.github.io/automotive-bg/data_spec.html'>data specification</a>\n"
- " * The pattern each interface is 'const DOMString AMBProperty = DBusProperty' where 'AMBProperty' is the internal name and 'DBusProperty' is the DBus property name")
+ " * The pattern each interface is 'const DOMString AMBProperty = DBusProperty' where 'AMBProperty' is the internal name and 'DBusProperty' is the DBus property name.\n"
+ " *\n"
+ " * For documentation on the interface and members, please see amb.fidl or the AMB DBus documentation.\n")
header += " */\n\n"
outputFile.write(header)
for iface in interfaces: