Salome HOME
add in yacsgen/hxx2salome the treatment of type DataArrayDouble
[tools/yacsgen.git] / module_generator / hxxcompo.py
index f49b00434b797dc3ad0227f4274d8ca770642ee1..94d8220e39d0bc615113a0e2f4c0359bf5966ca5 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2014  EDF R&D
+# Copyright (C) 2009-2015  EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -40,6 +40,7 @@ from hxx_tmpl_gui import hxxgui_cxx, hxxgui_h, hxxgui_icon_ts
 from hxx_tmpl_gui import hxxgui_message_en, hxxgui_message_fr
 from hxx_tmpl_gui import hxxgui_config, hxxgui_xml_fr, hxxgui_xml_en
 from gener import Library
+from gui_tmpl import cppsalomeapp
 
 # ------------------------------------------------------------------------------
 
@@ -279,7 +280,7 @@ class HXX2SALOMEComponent(Component):
         # find out if component uses medmem types and/or medcoupling types
         for (argname,argtype) in inports + outports + [("return",Return)]:
             if moduleTypes[argtype]=="MED":
-                if argtype.count("Coupling")>0:
+                if argtype.count("CorbaInterface")>0:
                     self.use_medcoupling=True
                 else:
                     self.use_medmem=True
@@ -327,11 +328,14 @@ class HXX2SALOMEComponent(Component):
 #include CORBA_CLIENT_HEADER(MEDCouplingCorbaServant)
 #include "MEDCouplingFieldDoubleServant.hxx"
 #include "MEDCouplingUMeshServant.hxx"
+#include "DataArrayDoubleServant.hxx"
 #include "MEDCouplingFieldDouble.hxx"
 #include "MEDCouplingUMesh.hxx"
 #include "MEDCouplingUMeshClient.hxx"
 #include "MEDCouplingFieldDouble.hxx"
 #include "MEDCouplingFieldDoubleClient.hxx"
+#include "MEDCouplingMemArray.hxx"
+#include "DataArrayDoubleClient.hxx"
 """
 
     Component.__init__(self, name, services, impl="CPP", libs=Libs,
@@ -454,6 +458,16 @@ class HXX2SALOMEComponent(Component):
       gui_config=hxxgui_config.substitute(component_name=self.name)
       gui_xml_fr=hxxgui_xml_fr.substitute(component_name=self.name)
       gui_xml_en=hxxgui_xml_en.substitute(component_name=self.name)
+      gui_salomeapp_gen=cppsalomeapp.substitute(module=self.name,
+                                                lmodule=self.name.lower())
+      # for a salome component generated by hxx2salome from a c++ component, 
+      # the documentation points at the c++ component documentation
+      salome_doc_path=os.path.join("%"+self.name+"_ROOT_DIR%","share",
+                                   "doc","salome","gui",self.name.lower(),
+                                   "index.html")
+      cpp_doc_path=os.path.join("%"+self.name+"CPP_ROOT_DIR%","share",
+                                "doc",self.name,"index.html")
+      gui_salomeapp=gui_salomeapp_gen.replace(salome_doc_path,cpp_doc_path)
       temp_dir=mkdtemp()
       gui_cxx_file_name=os.path.join(temp_dir,self.name+"GUI.cxx")
       gui_h_file_name=os.path.join(temp_dir,self.name+"GUI.h")
@@ -463,6 +477,7 @@ class HXX2SALOMEComponent(Component):
       gui_config_file_name=os.path.join(temp_dir,"config")
       gui_xml_fr_file_name=os.path.join(temp_dir,self.name+"_en.xml")
       gui_xml_en_file_name=os.path.join(temp_dir,self.name+"_fr.xml")
+      gui_salomeapp_file_name=os.path.join(temp_dir,"SalomeApp.xml")
 
       list_of_gui_names=[]
 
@@ -506,5 +521,8 @@ class HXX2SALOMEComponent(Component):
       gui_xml_en_file.close()
       list_of_gui_names.append(gui_xml_en_file_name)
 
-
+      gui_salomeapp_file=open(gui_salomeapp_file_name,"w")
+      gui_salomeapp_file.write(gui_salomeapp)
+      gui_salomeapp_file.close()
+      list_of_gui_names.append(gui_salomeapp_file_name)
       return list_of_gui_names