package.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # Copyright 2015 Airbus
00004 # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00005 #
00006 # Licensed under the Apache License, Version 2.0 (the "License");
00007 # you may not use this file except in compliance with the License.
00008 # You may obtain a copy of the License at
00009 #
00010 #   http://www.apache.org/licenses/LICENSE-2.0
00011 #
00012 # Unless required by applicable law or agreed to in writing, software
00013 # distributed under the License is distributed on an "AS IS" BASIS,
00014 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015 # See the License for the specific language governing permissions and
00016 # limitations under the License.
00017 
00018 
00019 from airbus_docgen.digraph.digraph import *
00020 
00021 class IoPackageModel(NODE):
00022     
00023     TOPICS   = "topics"
00024     ACTIONS  = "actions"
00025     SERVICES = "services"
00026     
00027     def __init__(self, node_name):
00028         NODE.__init__(self, node_name)
00029         
00030         table = TABLE()
00031         table.setAttrib(TABLE.BORDER, 0)
00032         table.setAttrib(TABLE.CELLBORDER, 1)
00033         table.setAttrib(TABLE.CELLSPACING, 0)
00034         table.setAttrib(TABLE.BGCOLOR, RgbColor.White)
00035         
00036         title = TD()
00037         title.setAttrib(TD.ALIGN, ALIGN.Center)
00038         title.setAttrib(TD.BGCOLOR, RgbColor.Tomato)
00039         title.setText(node_name)
00040         table.addTR(TR(title))
00041         
00042         topics = TD()
00043         topics.setAttrib(TD.ALIGN, ALIGN.Center)
00044         topics.setAttrib(TD.BGCOLOR, RgbColor.Turquoise)
00045         topics.setAttrib(TD.PORT, self.TOPICS)
00046         topics.setText("Topics")
00047         table.addTR(TR(topics))
00048         
00049         actions = TD()
00050         actions.setAttrib(TD.ALIGN, ALIGN.Center)
00051         actions.setAttrib(TD.BGCOLOR, RgbColor.LightGreen)
00052         actions.setAttrib(TD.PORT, self.ACTIONS)
00053         actions.setText("Actions")
00054         table.addTR(TR(actions))
00055         
00056         services = TD()
00057         services.setAttrib(TD.ALIGN, ALIGN.Center)
00058         services.setAttrib(TD.BGCOLOR, RgbColor.Violet)
00059         services.setAttrib(TD.PORT, self.SERVICES)
00060         services.setText("Services")
00061         table.addTR(TR(services))
00062         
00063         self.setHtml(table)
00064             
00065     def topics(self):
00066         return {self : self.TOPICS}
00067     
00068     def actions(self):
00069         return {self : self.ACTIONS}
00070     
00071     def services(self):
00072         return {self : self.SERVICES}
00073     
00074 class DepPackageModel(NODE):
00075     
00076     PACKAGES      = "packages"
00077     EXTERNAL_LIBS = "external_libs"
00078     INTERNAL_LIBS = "internal_libs"
00079     
00080     def __init__(self, node_name):
00081         NODE.__init__(self, node_name)
00082         
00083         table = TABLE()
00084         table.setAttrib(TABLE.BORDER, 0)
00085         table.setAttrib(TABLE.CELLBORDER, 1)
00086         table.setAttrib(TABLE.CELLSPACING, 0)
00087         table.setAttrib(TABLE.BGCOLOR, RgbColor.White)
00088         
00089         title = TD()
00090         title.setAttrib(TD.ALIGN, ALIGN.Center)
00091         title.setAttrib(TD.BGCOLOR, RgbColor.Aqua)
00092         title.setText(node_name)
00093         table.addTR(TR(title))
00094         
00095         packages = TD()
00096         packages.setAttrib(TD.ALIGN, ALIGN.Center)
00097         packages.setAttrib(TD.BGCOLOR, RgbColor.White)
00098         packages.setAttrib(TD.PORT, self.PACKAGES)
00099         packages.setText("Packages")
00100         table.addTR(TR(packages))
00101         
00102         external_libs = TD()
00103         external_libs.setAttrib(TD.ALIGN, ALIGN.Center)
00104         external_libs.setAttrib(TD.BGCOLOR, RgbColor.White)
00105         external_libs.setAttrib(TD.PORT, self.EXTERNAL_LIBS)
00106         external_libs.setText("External libraries")
00107         table.addTR(TR(external_libs))
00108         
00109         internal_libs = TD()
00110         internal_libs.setAttrib(TD.ALIGN, ALIGN.Center)
00111         internal_libs.setAttrib(TD.BGCOLOR, RgbColor.White)
00112         internal_libs.setAttrib(TD.PORT, self.INTERNAL_LIBS)
00113         internal_libs.setText("Internal libraries")
00114         table.addTR(TR(internal_libs))
00115         
00116         self.setHtml(table)
00117         
00118     def packages(self):
00119         return {self : self.PACKAGES}
00120     
00121     def internalLibs(self):
00122         return {self : self.INTERNAL_LIBS}
00123     
00124     def externalLibs(self):
00125         return {self : self.EXTERNAL_LIBS}
00126 
00127 if __name__ == '__main__':
00128     
00129     print str(IoPackageModel("iiwa_controller"))
00130     
00131     print str(DepPackageModel("iiwa_controller"))
00132     


airbus_docgen
Author(s): Matignon Martin
autogenerated on Thu Jun 6 2019 17:59:08