Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 import os
00019 from airbus_docgen.common import html
00020 from airbus_docgen.common.html import HtmlElement
00021
00022 from airbus_docgen.docgen.pkg.node.description import NodeDescription
00023 from airbus_docgen.docgen.pkg.node.ios import NodeInputOutput
00024 from airbus_docgen.docgen.pkg.node.params import NodeParameters
00025
00026
00027 class RosNode(HtmlElement):
00028
00029 def __init__(self):
00030 HtmlElement.__init__(self,
00031 tag=html.Sections.article,
00032 attrib={"class":"node"})
00033
00034 def read(self, node_name, node_xml, isection, iarticle):
00035
00036 item_index = 0
00037
00038 try:
00039 node_desc = NodeDescription()
00040 if node_desc.read(node_name, node_xml) is True:
00041 item_index += 1
00042 title = HtmlElement(html.Sections.h4)
00043 title.text = "%i.%i.%i. Description"%(isection, iarticle, item_index)
00044 self.append(title)
00045 self.append(node_desc)
00046 except Exception as ex:
00047 html.HTMLException(ex,self)
00048
00049 try:
00050 node_io = NodeInputOutput()
00051 if node_io.read(node_name, node_xml) is True:
00052 item_index += 1
00053 title = HtmlElement(html.Sections.h4)
00054 title.text = "%i.%i.%i. Input/Output"%(isection, iarticle, item_index)
00055 self.append(title)
00056 self.append(node_io)
00057 except Exception as ex:
00058 html.HTMLException(ex,self)
00059
00060 try:
00061 node_params = NodeParameters()
00062 if node_params.read(node_name, node_xml) is True:
00063 item_index += 1
00064 title = HtmlElement(html.Sections.h4)
00065 title.text = "%i.%i.%i. Parameter(s)"%(isection, iarticle, item_index)
00066 self.append(title)
00067 self.append(node_params)
00068 except Exception as ex:
00069 html.HTMLException(ex,self)
00070
00071 if item_index is 0:
00072 return False
00073 else:
00074 return True
00075