--- /dev/null
+# -*- coding: utf-8 -*-
+
+# --------------------------------------------------
+# debut entete
+# --------------------------------------------------
+
+import Accas
+from Accas import *
+
+JdC = JDC_CATA (code = 'ADAO',
+ execmodul = None,
+ regles = ( AU_MOINS_UN ('ASSIM_STUDY')),
+ )
+
+def F_VECTOR(statut) : return FACT(statut = statut,
+ FROM = SIMP(statut = "o", typ = "TXM", into=("String")),
+ DATA = SIMP(statut = "o", typ = "TXM"),
+ )
+
+def F_MATRIX(statut) : return FACT(statut = statut,
+ FROM = SIMP(statut = "o", typ = "TXM", into=("String")),
+ DATA = SIMP(statut = "o", typ = "TXM"),
+ )
+
+def F_BACKGROUND(statut) : return FACT(statut=statut,
+ regles = ( UN_PARMI ("VECTOR")),
+ VECTOR = F_VECTOR("o"),
+ )
+
+def F_BACKGROUND_ERROR(statut) : return FACT(statut=statut,
+ regles = ( UN_PARMI ("MATRIX")),
+ MATRIX = F_MATRIX("o"),
+ )
+
+def F_OBSERVATION(statut) : return FACT(statut=statut,
+ regles = ( UN_PARMI ("VECTOR")),
+ VECTOR = F_VECTOR("o"),
+ )
+
+def F_OBSERVATION_ERROR(statut) : return FACT(statut=statut,
+ regles = ( UN_PARMI ("MATRIX")),
+ MATRIX = F_MATRIX("o"),
+ )
+
+def F_OBSERVATION_OPERATOR(statut) : return FACT(statut=statut,
+ regles = ( UN_PARMI ("MATRIX", "FUNCTION")),
+ MATRIX = F_MATRIX("o"),
+ )
+
+def F_ANALYSIS(statut) : return FACT(statut = statut,
+ FROM = SIMP(statut = "o", typ = "TXM", into=("String", "File")),
+ STRING_DATA = BLOC ( condition = " FROM in ( 'String', ) ",
+
+ STRING = SIMP(statut = "o", typ = "TXM"),
+ ),
+ FILE_DATA = BLOC ( condition = " FROM in ( 'File', ) ",
+
+ FILE = SIMP(statut = "o", typ = "Fichier"),
+ ),
+ )
+
+
+ASSIM_STUDY = PROC(nom="ASSIM_STUDY",
+ op=None,
+ repetable = "n",
+ STUDY_NAME = SIMP(statut="o", typ = "TXM"),
+ ALGORITHM = FACT(statut='o',
+ regles = ( UN_PARMI ("Blue", "ENSEMBLEBLUE"),),
+
+ Blue = FACT(regles = ( ENSEMBLE ("Background", "BackgroundError",
+ "Observation", "ObservationError",
+ "ObservationOperator")),
+ Background = F_BACKGROUND("o"),
+ BackgroundError = F_BACKGROUND_ERROR("o"),
+ Observation = F_OBSERVATION("o"),
+ ObservationError = F_OBSERVATION_ERROR("o"),
+ ObservationOperator = F_OBSERVATION_OPERATOR("o"),
+ Analysis = F_ANALYSIS("f"),
+ ),
+ ENSEMBLEBLUE = FACT(BACKGROUND = F_BACKGROUND("o"),
+ ),
+ ),
+ )
+
+++ /dev/null
-# -*- coding: utf-8 -*-
-
-# --------------------------------------------------
-# debut entete
-# --------------------------------------------------
-
-import Accas
-from Accas import *
-
-JdC = JDC_CATA (code = 'DATASSIM',
- execmodul = None,
- regles = ( AU_MOINS_UN ('ASSIM_STUDY')),
- )
-
-def F_VECTOR(statut) : return FACT(statut = statut,
- FROM = SIMP(statut = "o", typ = "TXM", into=("String")),
- DATA = SIMP(statut = "o", typ = "TXM"),
- )
-
-def F_MATRIX(statut) : return FACT(statut = statut,
- FROM = SIMP(statut = "o", typ = "TXM", into=("String")),
- DATA = SIMP(statut = "o", typ = "TXM"),
- )
-
-def F_BACKGROUND(statut) : return FACT(statut=statut,
- regles = ( UN_PARMI ("VECTOR")),
- VECTOR = F_VECTOR("o"),
- )
-
-def F_BACKGROUND_ERROR(statut) : return FACT(statut=statut,
- regles = ( UN_PARMI ("MATRIX")),
- MATRIX = F_MATRIX("o"),
- )
-
-def F_OBSERVATION(statut) : return FACT(statut=statut,
- regles = ( UN_PARMI ("VECTOR")),
- VECTOR = F_VECTOR("o"),
- )
-
-def F_OBSERVATION_ERROR(statut) : return FACT(statut=statut,
- regles = ( UN_PARMI ("MATRIX")),
- MATRIX = F_MATRIX("o"),
- )
-
-def F_OBSERVATION_OPERATOR(statut) : return FACT(statut=statut,
- regles = ( UN_PARMI ("MATRIX", "FUNCTION")),
- MATRIX = F_MATRIX("o"),
- )
-
-def F_ANALYSIS(statut) : return FACT(statut = statut,
- FROM = SIMP(statut = "o", typ = "TXM", into=("String", "File")),
- STRING_DATA = BLOC ( condition = " FROM in ( 'String', ) ",
-
- STRING = SIMP(statut = "o", typ = "TXM"),
- ),
- FILE_DATA = BLOC ( condition = " FROM in ( 'File', ) ",
-
- FILE = SIMP(statut = "o", typ = "Fichier"),
- ),
- )
-
-
-ASSIM_STUDY = PROC(nom="ASSIM_STUDY",
- op=None,
- repetable = "n",
- STUDY_NAME = SIMP(statut="o", typ = "TXM"),
- ALGORITHM = FACT(statut='o',
- regles = ( UN_PARMI ("Blue", "ENSEMBLEBLUE"),),
-
- Blue = FACT(regles = ( ENSEMBLE ("Background", "BackgroundError",
- "Observation", "ObservationError",
- "ObservationOperator")),
- Background = F_BACKGROUND("o"),
- BackgroundError = F_BACKGROUND_ERROR("o"),
- Observation = F_OBSERVATION("o"),
- ObservationError = F_OBSERVATION_ERROR("o"),
- ObservationOperator = F_OBSERVATION_OPERATOR("o"),
- Analysis = F_ANALYSIS("f"),
- ),
- ENSEMBLEBLUE = FACT(BACKGROUND = F_BACKGROUND("o"),
- ),
- ),
- )
-
mypkgpythondir =$(salomepythondir)/daEficas
mypkgpython_PYTHON = \
- configuration_DATASSIM.py \
- convert_datassim.py \
- DATASSIM_Cata_V0.py \
- generator_datassim.py \
+ configuration_ADAO.py \
+ convert_adao.py \
+ ADAO_Cata_V0.py \
+ generator_adao.py \
__init__.py \
- prefs_DATASSIM.py \
+ prefs_ADAO.py \
prefs.py
-EXTRA_DIST = prefs_DATASSIM.py.in
+EXTRA_DIST = prefs_ADAO.py.in
--- /dev/null
+# -*- coding: utf-8 -*-
+"""
+ Ce module sert pour charger les paramètres de configuration d'EFICAS
+"""
+# Modules Python
+print "passage dans la surcharge de configuration pour Adao"
+import os, sys, string, types, re
+import traceback
+from PyQt4.QtGui import *
+
+# Modules Eficas
+from Editeur import utils
+
+# Classe de base permettant de lire, afficher
+# et sauvegarder les fichiers utilisateurs
+class CONFIG:
+
+ def __init__(self,appli,repIni):
+
+ self.rep_user = os.environ["HOME"]
+ self.appli = appli
+ self.code = appli.code
+ self.rep_ini = repIni
+ self.savedir = self.rep_user
+ self.generator_module = "generator_adao"
+ self.convert_module = "convert_adao"
+
+ # Format des catalogues...
+ # (code,version,catalogue,formatIn) et ,formatOut) ?
+ self.catalogues = []
+ self.catalogues.append(["ADAO", "V0", os.path.join(self.rep_ini, 'ADAO_Cata_V0.py'), "adao"])
+
+def make_config(appli,rep):
+
+ return CONFIG(appli,rep)
+
+def make_config_style(appli,rep):
+
+ return None
+++ /dev/null
-# -*- coding: utf-8 -*-
-"""
- Ce module sert pour charger les paramètres de configuration d'EFICAS
-"""
-# Modules Python
-print "passage dans la surcharge de configuration pour Datassim"
-import os, sys, string, types, re
-import traceback
-from PyQt4.QtGui import *
-
-# Modules Eficas
-from Editeur import utils
-
-# Classe de base permettant de lire, afficher
-# et sauvegarder les fichiers utilisateurs
-class CONFIG:
-
- def __init__(self,appli,repIni):
-
- self.rep_user = os.environ["HOME"]
- self.appli = appli
- self.code = appli.code
- self.rep_ini = repIni
- self.savedir = self.rep_user
- self.generator_module = "generator_datassim"
- self.convert_module = "convert_datassim"
-
- # Format des catalogues...
- # (code,version,catalogue,formatIn) et ,formatOut) ?
- self.catalogues = []
- self.catalogues.append(["DATASSIM", "V0", os.path.join(self.rep_ini, 'DATASSIM_Cata_V0.py'), "datassim"])
-
-def make_config(appli,rep):
-
- return CONFIG(appli,rep)
-
-def make_config_style(appli,rep):
-
- return None
--- /dev/null
+# -*- coding: utf-8 -*-
+print "import convert_adao"
+
+import convert.parseur_python
+from convert.convert_python import *
+
+def entryPoint():
+ """
+ Retourne les informations nécessaires pour le chargeur de plugins
+ Ces informations sont retournées dans un dictionnaire
+ """
+ return {
+ # Le nom du plugin
+ 'name' : 'adao',
+ # La factory pour créer une instance du plugin
+ 'factory' : PythonParser,
+ }
+
+
+++ /dev/null
-# -*- coding: utf-8 -*-
-print "import convert_datassim"
-
-import convert.parseur_python
-from convert.convert_python import *
-
-def entryPoint():
- """
- Retourne les informations nécessaires pour le chargeur de plugins
- Ces informations sont retournées dans un dictionnaire
- """
- return {
- # Le nom du plugin
- 'name' : 'datassim',
- # La factory pour créer une instance du plugin
- 'factory' : PythonParser,
- }
-
-
--- /dev/null
+# -*- coding: utf-8 -*-
+print "import generator_adao"
+
+from generator.generator_python import PythonGenerator
+
+def entryPoint():
+ """
+ Retourne les informations necessaires pour le chargeur de plugins
+
+ Ces informations sont retournees dans un dictionnaire
+ """
+ return {
+ # Le nom du plugin
+ 'name' : 'adao',
+ # La factory pour creer une instance du plugin
+ 'factory' : AdaoGenerator,
+ }
+
+class AdaoGenerator(PythonGenerator):
+
+ def __init__(self,cr=None):
+ PythonGenerator.__init__(self, cr)
+ self.dictMCVal={}
+ self.text_comm = ""
+ self.text_da = ""
+ self.text_da_status = False
+
+ def gener(self,obj,format='brut',config=None):
+ print "AdaoGenerator gener"
+ self.text_comm = PythonGenerator.gener(self, obj, format, config)
+
+ print "Dictionnaire"
+ print self.dictMCVal
+
+ try :
+ self.text_da_status = False
+ self.generate_da()
+ self.text_da_status = True
+ except:
+ print "Case seems not be correct"
+ pass
+ return self.text_comm
+
+ def writeDefault(self, fn):
+ if self.text_da_status:
+ print "write adao python command file"
+ filename = fn[:fn.rfind(".")] + '.py'
+ f = open( str(filename), 'wb')
+ f.write( self.text_da )
+ f.close()
+
+ def generMCSIMP(self,obj) :
+ """
+ Convertit un objet MCSIMP en texte python
+ """
+ clef=""
+ for i in obj.get_genealogie() :
+ clef=clef+"__"+i
+ self.dictMCVal[clef]=obj.valeur
+
+ s=PythonGenerator.generMCSIMP(self,obj)
+ return s
+
+ def generMCFACT(self,obj):
+
+ if obj.parent.nom == "ALGORITHM":
+ self.dictMCVal["ALGORITHM_NAME"] = obj.nom
+
+ s=PythonGenerator.generMCFACT(self,obj)
+ return s
+
+ def generate_da(self):
+
+ self.text_da += "#-*-coding:iso-8859-1-*- \n"
+ self.text_da += "study_config = {} \n"
+ self.text_da += "study_config[\"Name\"] = \"" + self.dictMCVal["__ASSIM_STUDY__STUDY_NAME"] + "\"\n"
+ self.text_da += "study_config[\"Algorithm\"] = \"" + self.dictMCVal["ALGORITHM_NAME"] + "\"\n"
+
+
+ self.add_data("Background")
+ self.add_data("BackgroundError")
+ self.add_data("Observation")
+ self.add_data("ObservationError")
+ self.add_data("ObservationOperator")
+ self.add_analysis()
+
+ def add_data(self, data_name):
+ search_text = "__ASSIM_STUDY__ALGORITHM__" + self.dictMCVal["ALGORITHM_NAME"] + "__"
+ back_search_text = search_text + data_name + "__"
+ try :
+ back_from = self.dictMCVal[back_search_text + "VECTOR__FROM"]
+ back_data = self.dictMCVal[back_search_text + "VECTOR__DATA"]
+
+ self.text_da += data_name + "_config = {} \n"
+ self.text_da += data_name + "_config[\"Type\"] = \"Vector\" \n"
+ self.text_da += data_name + "_config[\"From\"] = \"" + back_from + "\" \n"
+ self.text_da += data_name + "_config[\"Data\"] = \"" + back_data + "\" \n"
+ self.text_da += "study_config[\"" + data_name + "\"] = " + data_name + "_config \n"
+ except:
+ pass
+ try :
+ back_from = self.dictMCVal[back_search_text + "MATRIX__FROM"]
+ back_data = self.dictMCVal[back_search_text + "MATRIX__DATA"]
+
+ self.text_da += data_name + "_config = {} \n"
+ self.text_da += data_name + "_config[\"Type\"] = \"Matrix\" \n"
+ self.text_da += data_name + "_config[\"From\"] = \"" + back_from + "\" \n"
+ self.text_da += data_name + "_config[\"Data\"] = \"" + back_data + "\" \n"
+ self.text_da += "study_config[\"" + data_name + "\"] = " + data_name + "_config \n"
+ except:
+ pass
+
+ def add_analysis(self):
+ search_text = "__ASSIM_STUDY__ALGORITHM__" + self.dictMCVal["ALGORITHM_NAME"] + "__Analysis__"
+ try :
+ ana_from = self.dictMCVal[search_text + "FROM"]
+ print ana_from
+ if ana_from == "String":
+ ana_data = self.dictMCVal[search_text + "STRING_DATA__STRING"]
+ self.text_da += "Analysis_config = {} \n"
+ self.text_da += "Analysis_config[\"From\"] = \"String\" \n"
+ self.text_da += "Analysis_config[\"Data\"] = \"\"\"" + ana_data + "\"\"\" \n"
+ self.text_da += "study_config[\"Analysis\"] = Analysis_config \n"
+ pass
+ if ana_from == "File":
+ ana_data = self.dictMCVal[search_text + "FILE_DATA__FILE"]
+ self.text_da += "Analysis_config = {} \n"
+ self.text_da += "Analysis_config[\"From\"] = \"File\" \n"
+ self.text_da += "Analysis_config[\"Data\"] = \"" + ana_data + "\" \n"
+ self.text_da += "study_config[\"Analysis\"] = Analysis_config \n"
+ pass
+ except:
+ pass
+
+++ /dev/null
-# -*- coding: utf-8 -*-
-print "import generator_datassim"
-
-from generator.generator_python import PythonGenerator
-
-def entryPoint():
- """
- Retourne les informations necessaires pour le chargeur de plugins
-
- Ces informations sont retournees dans un dictionnaire
- """
- return {
- # Le nom du plugin
- 'name' : 'datassim',
- # La factory pour creer une instance du plugin
- 'factory' : DatassimGenerator,
- }
-
-class DatassimGenerator(PythonGenerator):
-
- def __init__(self,cr=None):
- PythonGenerator.__init__(self, cr)
- self.dictMCVal={}
- self.text_comm = ""
- self.text_da = ""
- self.text_da_status = False
-
- def gener(self,obj,format='brut',config=None):
- print "DatassimGenerator gener"
- self.text_comm = PythonGenerator.gener(self, obj, format, config)
-
- print "Dictionnaire"
- print self.dictMCVal
-
- try :
- self.text_da_status = False
- self.generate_da()
- self.text_da_status = True
- except:
- print "Case seems not be correct"
- pass
- return self.text_comm
-
- def writeDefault(self, fn):
- if self.text_da_status:
- print "write datassim python command file"
- filename = fn[:fn.rfind(".")] + '.py'
- f = open( str(filename), 'wb')
- f.write( self.text_da )
- f.close()
-
- def generMCSIMP(self,obj) :
- """
- Convertit un objet MCSIMP en texte python
- """
- clef=""
- for i in obj.get_genealogie() :
- clef=clef+"__"+i
- self.dictMCVal[clef]=obj.valeur
-
- s=PythonGenerator.generMCSIMP(self,obj)
- return s
-
- def generMCFACT(self,obj):
-
- if obj.parent.nom == "ALGORITHM":
- self.dictMCVal["ALGORITHM_NAME"] = obj.nom
-
- s=PythonGenerator.generMCFACT(self,obj)
- return s
-
- def generate_da(self):
-
- self.text_da += "#-*-coding:iso-8859-1-*- \n"
- self.text_da += "study_config = {} \n"
- self.text_da += "study_config[\"Name\"] = \"" + self.dictMCVal["__ASSIM_STUDY__STUDY_NAME"] + "\"\n"
- self.text_da += "study_config[\"Algorithm\"] = \"" + self.dictMCVal["ALGORITHM_NAME"] + "\"\n"
-
-
- self.add_data("Background")
- self.add_data("BackgroundError")
- self.add_data("Observation")
- self.add_data("ObservationError")
- self.add_data("ObservationOperator")
- self.add_analysis()
-
- def add_data(self, data_name):
- search_text = "__ASSIM_STUDY__ALGORITHM__" + self.dictMCVal["ALGORITHM_NAME"] + "__"
- back_search_text = search_text + data_name + "__"
- try :
- back_from = self.dictMCVal[back_search_text + "VECTOR__FROM"]
- back_data = self.dictMCVal[back_search_text + "VECTOR__DATA"]
-
- self.text_da += data_name + "_config = {} \n"
- self.text_da += data_name + "_config[\"Type\"] = \"Vector\" \n"
- self.text_da += data_name + "_config[\"From\"] = \"" + back_from + "\" \n"
- self.text_da += data_name + "_config[\"Data\"] = \"" + back_data + "\" \n"
- self.text_da += "study_config[\"" + data_name + "\"] = " + data_name + "_config \n"
- except:
- pass
- try :
- back_from = self.dictMCVal[back_search_text + "MATRIX__FROM"]
- back_data = self.dictMCVal[back_search_text + "MATRIX__DATA"]
-
- self.text_da += data_name + "_config = {} \n"
- self.text_da += data_name + "_config[\"Type\"] = \"Matrix\" \n"
- self.text_da += data_name + "_config[\"From\"] = \"" + back_from + "\" \n"
- self.text_da += data_name + "_config[\"Data\"] = \"" + back_data + "\" \n"
- self.text_da += "study_config[\"" + data_name + "\"] = " + data_name + "_config \n"
- except:
- pass
-
- def add_analysis(self):
- search_text = "__ASSIM_STUDY__ALGORITHM__" + self.dictMCVal["ALGORITHM_NAME"] + "__Analysis__"
- try :
- ana_from = self.dictMCVal[search_text + "FROM"]
- print ana_from
- if ana_from == "String":
- ana_data = self.dictMCVal[search_text + "STRING_DATA__STRING"]
- self.text_da += "Analysis_config = {} \n"
- self.text_da += "Analysis_config[\"From\"] = \"String\" \n"
- self.text_da += "Analysis_config[\"Data\"] = \"\"\"" + ana_data + "\"\"\" \n"
- self.text_da += "study_config[\"Analysis\"] = Analysis_config \n"
- pass
- if ana_from == "File":
- ana_data = self.dictMCVal[search_text + "FILE_DATA__FILE"]
- self.text_da += "Analysis_config = {} \n"
- self.text_da += "Analysis_config[\"From\"] = \"File\" \n"
- self.text_da += "Analysis_config[\"Data\"] = \"" + ana_data + "\" \n"
- self.text_da += "study_config[\"Analysis\"] = Analysis_config \n"
- pass
- except:
- pass
-
# Fichier obligatoire ne devant que contenir la variable code...
-code = "DATASSIM"
+code = "ADAO"
# -*- coding: utf-8 -*-
import os, sys
-print "import des prefs de Datassim"
+print "import des prefs de Adao"
# Configuration de Eficas
# INSTALLDIR, REPINI est obligatoire