]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
Première version de modèle Atmo généré
authorEric Fayolle <eric.fayolle@edf.fr>
Mon, 26 Mar 2018 14:12:54 +0000 (16:12 +0200)
committerEric Fayolle <eric.fayolle@edf.fr>
Mon, 26 Mar 2018 14:12:54 +0000 (16:12 +0200)
Atmo/README.txt [new file with mode: 0644]
Atmo/atmo.png [new file with mode: 0755]
Atmo/atmo.py [new file with mode: 0644]
Atmo/cata-v0.xml [new file with mode: 0755]
Atmo/cata-v0_test.xml [new file with mode: 0755]
Atmo/ex_jdc.xml [new file with mode: 0755]
Atmo/lire_ex.py [new file with mode: 0644]
Atmo/modele_atmo.xsd [new file with mode: 0755]

diff --git a/Atmo/README.txt b/Atmo/README.txt
new file mode 100644 (file)
index 0000000..d76a510
--- /dev/null
@@ -0,0 +1,7 @@
+pyxbgen -u modele_atmo.xsd -m atmo --write-for-customization
+/local/PyXB-1.2.6/scripts/pyxbgen  -u modele_atmo.xsd -m atmo --write-for-customization
+/local/PyXB-1.2.6/scripts/pyxbgen  -u model_atmo_ext.xsd -m atmo_ext --write-for-customization
+
+
+/local/PyXB-1.2.6/scripts/pyxbgen  -u modele_atmo.xsd -m atmo --write-for-customization --default-namespace-public --archive-to-file=model_atmo.wxsd 
+/local/PyXB-1.2.6/scripts/pyxbgen  -u model_atmo_ext.xsd -m atmo_ext --write-for-customization --archive-path=.:+
diff --git a/Atmo/atmo.png b/Atmo/atmo.png
new file mode 100755 (executable)
index 0000000..2e8d4a5
Binary files /dev/null and b/Atmo/atmo.png differ
diff --git a/Atmo/atmo.py b/Atmo/atmo.py
new file mode 100644 (file)
index 0000000..bd5f081
--- /dev/null
@@ -0,0 +1,2 @@
+# -*- coding: utf-8 -*-
+from raw.atmo import *
diff --git a/Atmo/cata-v0.xml b/Atmo/cata-v0.xml
new file mode 100755 (executable)
index 0000000..bf1f56f
--- /dev/null
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--Sample XML file generated by XMLSpy v2015 rel. 4 (http://www.altova.com)-->\r
+<cata efficas:nom="Atmo" xmlns="http://chercheurs.edf.com/logiciels/efficas" xmlns:efficas="http://chercheurs.edf.com/logiciels/efficas" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://chercheurs.edf.com/logiciels/efficas ../Efi2Xsd/ModeleEficas/Model%20Efficas%20(1.1)%20%20v9.xsd">\r
+<commandes>\r
+\r
+<PROC efficas:nom="Atmos">\r
+<doc efficas:fr="Définition d'un cas d'étude atmosphérique" efficas:ang="Definition of study case"></doc>\r
+               <FACT efficas:nom="Wind">\r
+                       <SIMP efficas:nom="Wind_Speed">\r
+                               <nomTypeAttendu>I</nomTypeAttendu>\r
+                       </SIMP>\r
+                       <SIMP efficas:nom="Speed_Unit">\r
+                           <plageValeur><into><TXM>knots</TXM></into><into><TXM>mph</TXM></into><into><TXM>m/s</TXM></into></plageValeur>\r
+                               <nomTypeAttendu>TXM</nomTypeAttendu>\r
+                       </SIMP>\r
+                       <SIMP efficas:nom="Measurement">\r
+                           <plageValeur><into><TXM>manual</TXM></into><into><TXM>typeA</TXM></into><into><TXM>typeB</TXM></into></plageValeur>         \r
+                               <nomTypeAttendu>TXM</nomTypeAttendu>\r
+                       </SIMP>\r
+                       <BLOC efficas:nom="B_enter_mesure">\r
+                               <SIMP efficas:nom="Value">\r
+                                       <nomTypeAttendu>I</nomTypeAttendu>\r
+                               </SIMP>\r
+                               <SIMP efficas:nom="Unit">\r
+                                   <plageValeur><into><TXM>feet</TXM></into><into><TXM>meters</TXM></into></plageValeur>\r
+                                       <nomTypeAttendu>TXM</nomTypeAttendu>\r
+                               </SIMP>\r
+                               <condition>Measurement == 'manual'</condition>\r
+                       </BLOC>\r
+               </FACT>\r
+               <FACT efficas:nom="Ground">\r
+                       <SIMP efficas:nom="Ground_roughness">\r
+                           <plageValeur><into><TXM>open country</TXM></into><into><TXM>urban or forest</TXM></into><into><TXM>open water</TXM></into><into><TXM>manual</TXM></into></plageValeur>\r
+                               <nomTypeAttendu>TXM</nomTypeAttendu>\r
+                       </SIMP>\r
+                       <BLOC efficas:nom="B_enter_ground">\r
+                               <SIMP efficas:nom="Value">\r
+                                       <nomTypeAttendu>I</nomTypeAttendu>\r
+                               </SIMP>\r
+                               <SIMP efficas:nom="Unit">\r
+                                   <valeurDef><TXM>cm</TXM></valeurDef>\r
+                                   <plageValeur><into><TXM>in</TXM></into><into><TXM>cm</TXM></into></plageValeur>\r
+                                       <nomTypeAttendu>TXM</nomTypeAttendu>\r
+                               </SIMP>\r
+                               <condition>Ground_roughness == 'manual'</condition>\r
+                       </BLOC>\r
+               </FACT>\r
+               <FACT efficas:nom="Cover">\r
+                       <SIMP efficas:nom="Cover_type">\r
+                           <plageValeur><into><TXM>clear</TXM></into><into><TXM>partly clouded</TXM></into><into><TXM>overclouded</TXM></into><into><TXM>manual</TXM></into></plageValeur>\r
+                               <nomTypeAttendu>TXM</nomTypeAttendu>\r
+                       </SIMP>\r
+                       <BLOC efficas:nom="B_enter_cover">\r
+                               <SIMP efficas:nom="Value">\r
+                                   <plageValeur><borneSup><typesimple>10</typesimple></borneSup></plageValeur>\r
+                                       <nomTypeAttendu>I</nomTypeAttendu>\r
+                               </SIMP>\r
+                               <condition>Cover_type == 'manual'</condition>\r
+                       </BLOC>\r
+               </FACT>\r
+</PROC>\r
+</commandes>\r
+</cata>\r
diff --git a/Atmo/cata-v0_test.xml b/Atmo/cata-v0_test.xml
new file mode 100755 (executable)
index 0000000..6bcffb8
--- /dev/null
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--Sample XML file generated by XMLSpy v2015 rel. 4 (http://www.altova.com)-->\r
+<cata efficas:nom="Atmo" xmlns="http://chercheurs.edf.com/logiciels/efficas" xmlns:efficas="http://chercheurs.edf.com/logiciels/efficas" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://chercheurs.edf.com/logiciels/efficas ../Efi2Xsd/ModeleEficas/Model%20Efficas%20(1.1)%20%20v9.xsd">\r
+<commandes>\r
+\r
+<PROC efficas:nom="Atmos">\r
+<doc efficas:fr="Définition d'un cas d'étude atmosphérique" efficas:ang="Definition of study case"></doc>\r
+               <FACT efficas:nom="Wind">\r
+                       <SIMP efficas:nom="Wind_Speed">\r
+                               <nomTypeAttendu>I</nomTypeAttendu>\r
+                       </SIMP>\r
+                       <SIMP efficas:nom="Speed_Unit">\r
+                           <plageValeur><into><TXM>knots</TXM></into><into><TXM>mph</TXM></into><into><TXM>m/s</TXM></into></plageValeur>\r
+                               <nomTypeAttendu>TXM</nomTypeAttendu>\r
+                       </SIMP>\r
+                       <SIMP efficas:nom="Measurement">\r
+                           <plageValeur><into><TXM>manual</TXM></into><into><TXM>typeA</TXM></into><into><TXM>typeB</TXM></into></plageValeur>         \r
+                               <nomTypeAttendu>TXM</nomTypeAttendu>\r
+                       </SIMP>\r
+                       <FACT efficas:nom="B_enter_mesure">\r
+                               <SIMP efficas:nom="Value">\r
+                                       <nomTypeAttendu>I</nomTypeAttendu>\r
+                               </SIMP>\r
+                               <SIMP efficas:nom="Unit">\r
+                                   <plageValeur><into><TXM>feet</TXM></into><into><TXM>meters</TXM></into></plageValeur>\r
+                                       <nomTypeAttendu>TXM</nomTypeAttendu>\r
+                               </SIMP>\r
+                       </FACT>\r
+               </FACT>\r
+               <FACT efficas:nom="Ground">\r
+                       <SIMP efficas:nom="Ground_roughness">\r
+                           <plageValeur><into><TXM>open country</TXM></into><into><TXM>urban or forest</TXM></into><into><TXM>open water</TXM></into><into><TXM>manual</TXM></into></plageValeur>\r
+                               <nomTypeAttendu>TXM</nomTypeAttendu>\r
+                       </SIMP>\r
+                       <FACT efficas:nom="B_enter_ground">\r
+                               <SIMP efficas:nom="Value">\r
+                                       <nomTypeAttendu>I</nomTypeAttendu>\r
+                               </SIMP>\r
+                               <SIMP efficas:nom="Unit">\r
+                                   <valeurDef><TXM>cm</TXM></valeurDef>\r
+                                   <plageValeur><into><TXM>in</TXM></into><into><TXM>cm</TXM></into></plageValeur>\r
+                                       <nomTypeAttendu>TXM</nomTypeAttendu>\r
+                               </SIMP>\r
+                       </FACT>\r
+               </FACT>\r
+               <FACT efficas:nom="Cover">\r
+                       <SIMP efficas:nom="Cover_type">\r
+                           <plageValeur><into><TXM>clear</TXM></into><into><TXM>partly clouded</TXM></into><into><TXM>overclouded</TXM></into><into><TXM>manual</TXM></into></plageValeur>\r
+                               <nomTypeAttendu>TXM</nomTypeAttendu>\r
+                       </SIMP>\r
+                       <FACT efficas:nom="B_enter_cover">\r
+                               <SIMP efficas:nom="Value">\r
+                                   <plageValeur><borneSup><typesimple>10</typesimple></borneSup></plageValeur>\r
+                                       <nomTypeAttendu>I</nomTypeAttendu>\r
+                               </SIMP>\r
+                       </FACT>\r
+               </FACT>\r
+</PROC>\r
+</commandes>\r
+</cata>\r
diff --git a/Atmo/ex_jdc.xml b/Atmo/ex_jdc.xml
new file mode 100755 (executable)
index 0000000..e0743ea
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--Sample XML file generated by XMLSpy v2015 rel. 4 (http://www.altova.com)-->\r
+<Atmos xmlns="http://chercheurs.edf.com/logiciels/atmos" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://chercheurs.edf.com/logiciels/atmos modele_atmo.xsd">\r
+       <Wind>\r
+               <Wind_Speed>20</Wind_Speed>\r
+               <Speed_Unit>mph</Speed_Unit>\r
+               <Measurement>manual</Measurement>\r
+               <B_enter_mesure>\r
+                       <Value>10</Value>\r
+                       <Unit>meters</Unit>\r
+               </B_enter_mesure>\r
+       </Wind>\r
+       <Ground>\r
+               <Ground_roughness>manual</Ground_roughness>\r
+               <B_enter_ground>\r
+                       <Value>30</Value>\r
+                       <Unit>cm</Unit>\r
+               </B_enter_ground>\r
+       </Ground>\r
+       <Cover>\r
+               <Cover_type>clear</Cover_type>\r
+       </Cover>\r
+</Atmos>\r
diff --git a/Atmo/lire_ex.py b/Atmo/lire_ex.py
new file mode 100644 (file)
index 0000000..47abf2c
--- /dev/null
@@ -0,0 +1,16 @@
+from atmo import *
+
+myatmo=CreateFromDocument(open('./ex_jdc.xml').read())
+myatmo.toxml()
+
+print myatmo.toDOM().toprettyxml()
+print myatmo.Wind.Wind_Speed
+
+myWind=myatmo.Wind
+myWind.Wind_Speed=50
+myatmo.Wind=myWind
+print myatmo.toDOM().toprettyxml()
+
+file=open('./ex_jdc_bis.xml','w');file.write(myatmo.toxml());file.close()
+myatmobis=CreateFromDocument(open('./ex_jdc_bis.xml').read())
+print myatmobis.toDOM().toprettyxml()
diff --git a/Atmo/modele_atmo.xsd b/Atmo/modele_atmo.xsd
new file mode 100755 (executable)
index 0000000..1678dc9
--- /dev/null
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XMLSpy v2015 rel. 4 (http://www.altova.com) by USER1 (EDF-DSP) -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:atmos="http://chercheurs.edf.com/logiciels/atmos" targetNamespace="http://chercheurs.edf.com/logiciels/atmos" elementFormDefault="qualified" attributeFormDefault="qualified">
+       <simpleType name="T_Wind_Speed">
+               <restriction base="int"/>
+       </simpleType>
+       <simpleType name="T_Speed_Unit">
+               <restriction base="string"/>
+       </simpleType>
+       <simpleType name="T_Measurement">
+               <restriction base="string"/>
+       </simpleType>
+       <simpleType name="T_Value">
+               <restriction base="int"/>
+       </simpleType>
+       <simpleType name="T_Ground_roughness">
+               <restriction base="string"/>
+       </simpleType>
+       <simpleType name="T_Unit">
+               <restriction base="string"/>
+       </simpleType>
+       <simpleType name="T_Cover_type">
+               <restriction base="string"/>
+       </simpleType>
+       <complexType name="T_Atmos">
+               <sequence>
+                       <element name="Wind" type="atmos:T_Wind" minOccurs="1" maxOccurs="1"/>
+                       <element name="Ground" type="atmos:T_Ground" minOccurs="1" maxOccurs="1"/>
+                       <element name="Cover" type="atmos:T_Cover" minOccurs="1" maxOccurs="1"/>
+               </sequence>
+       </complexType>
+       <complexType name="T_Wind">
+               <sequence>
+                       <element name="Wind_Speed" type="atmos:T_Wind_Speed" minOccurs="1"/>
+                       <element name="Speed_Unit" type="atmos:T_Speed_Unit" minOccurs="1"/>
+                       <element name="Measurement" type="atmos:T_Measurement" minOccurs="1"/>
+                       <element name="B_enter_mesure" type="atmos:T_B_enter_mesure" minOccurs="0" maxOccurs="1"/>
+               </sequence>
+       </complexType>
+       <complexType name="T_B_enter_mesure">
+               <sequence>
+                       <element name="Value" type="atmos:T_Value" minOccurs="1"/>
+                       <element name="Unit" type="atmos:T_Unit" minOccurs="1"/>
+               </sequence>
+       </complexType>
+       <complexType name="T_Ground">
+               <sequence>
+                       <element name="Ground_roughness" type="atmos:T_Ground_roughness" minOccurs="1"/>
+                       <element name="B_enter_ground" type="atmos:T_B_enter_ground" minOccurs="0" maxOccurs="1"/>
+               </sequence>
+       </complexType>
+       <complexType name="T_B_enter_ground">
+               <sequence>
+                       <element name="Value" type="atmos:T_Value" minOccurs="1"/>
+                       <element name="Unit" type="atmos:T_Unit" minOccurs="1"/>
+               </sequence>
+       </complexType>
+       <complexType name="T_Cover">
+               <sequence>
+                       <element name="Cover_type" type="atmos:T_Cover_type" minOccurs="1"/>
+                       <element name="B_enter_cover" type="atmos:T_B_enter_cover" minOccurs="0" maxOccurs="1"/>
+               </sequence>
+       </complexType>
+       <complexType name="T_B_enter_cover">
+               <sequence>
+                       <element name="Value" type="atmos:T_Value" minOccurs="1"/>
+               </sequence>
+       </complexType>
+       <element name="Atmos" type="atmos:T_Atmos"/>
+</schema>