]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
180716
authorpascale.noyret <pascale.noyret@edf.fr>
Mon, 18 Jul 2016 08:21:54 +0000 (10:21 +0200)
committerpascale.noyret <pascale.noyret@edf.fr>
Mon, 18 Jul 2016 08:21:54 +0000 (10:21 +0200)
InterfaceQT4/gereIcones.py
InterfaceQT4/monChoixCode.py
InterfaceQT4/monViewRegles.py
PSEN_N1/mesScripts_PSEN_N1.py [new file with mode: 0644]
UiQT4/eficas_en.qm [deleted file]
UiQT4/eficas_fr.qm [deleted file]
UiQT5/desChoixCode.ui
UiQT5/desChoixCommandes.ui

index ea71360b6aae6bb503acfb2d045214e8ea086e65..088028006e3f0ca25ecfbbe893cf8a674ae69edb 100644 (file)
@@ -204,6 +204,7 @@ class FacultatifOuOptionnel:
 
 
   def ajoutScript(self):
+        if not hasattr(self,'CBScripts') : return # Cas des Widgets Plies
         self.dictCommandes={}
         listeCommandes=self.dict_commandes_mesScripts[self.obj.nom]
         if type(listeCommandes) != types.TupleType: listeCommandes=(listeCommandes,)
index 45babb13cb212ed97693bc385d895d7d5f680215..74f2fb4d2c640050bad32c17c3a9060a2fa0a43b 100644 (file)
@@ -24,7 +24,7 @@ import os,sys,re
 from desChoixCode import Ui_ChoixCode
 from determine import monEnvQT5
 if monEnvQT5:
-    from PyQt5.QtWidgets import QDialog, QRadioButton
+    from PyQt5.QtWidgets import QDialog, QRadioButton, QGroupBox, QButtonGroup
     from PyQt5.QtGui import QPalette
     from PyQt5.QtCore import QProcess, QFileInfo, Qt, QSize
 else :
@@ -61,30 +61,22 @@ class MonChoixCode(Ui_ChoixCode,QDialog):
       self.groupCodes=QButtonGroup(self.groupBox)
       vars=os.environ.items()
       listeCode=('Aster','Adao','Carmel3D','CarmelCND','CF','MAP','MT','PSEN','PSEN_N1','Telemac','ZCracks',)
-      i=1
       for code in listeCode:
-          nom='rB_'+code
           dirCode=os.path.abspath(os.path.join(os.path.abspath(__file__),'../..',code))
           try :
              l=os.listdir(dirCode)
-             bouton=QRadioButton(self)
-             bouton.setMinimumSize(QSize(0, 30))
+             bouton=QRadioButton(self.groupBox)
              bouton.setText(code)
-             bouton.setGeometry(QRect(10,20+30*i, 300, 30))
-             bouton.show()
              self.groupCodes.addButton(bouton)
-             i=i+1
+             self.vlBouton.addWidget(bouton)
           except :
              clef="PREFS_CATA_"+code
              try :
                 repIntegrateur=os.path.abspath(os.environ[clef])
                 l=os.listdir(repIntegrateur)
-                bouton=QRadioButton(self)
-                bouton.setGeometry(QRect(10,20+30*i, 300, 30))
-                bouton.setMinimumSize(QSize(0, 30))
+                bouton=QRadioButton(self.groupBox)
                 bouton.setText(code)
                 bouton.show()
-                i=i+1
                 self.groupCodes.addButton(bouton)
              except :
                 pass
@@ -98,9 +90,6 @@ class MonChoixCode(Ui_ChoixCode,QDialog):
               repIntegrateur=os.path.abspath(os.environ[clef])
               l=os.listdir(repIntegrateur)
               bouton=QRadioButton(self)
-              bouton.setGeometry(QRect(10,20+30*i, 300, 30))
-              i=i+1
-              bouton.setMinimumSize(QSize(0, 30))
               bouton.setText(code)
               bouton.show()
               self.groupCodes.addButton(bouton)
@@ -110,6 +99,7 @@ class MonChoixCode(Ui_ChoixCode,QDialog):
 
   def choisitCode(self):
       bouton=self.groupCodes.checkedButton()
+      if bouton==None : return
       code=str(bouton.text())
       codeUpper=code.upper()
       self.parentAppli.code=codeUpper
index 3eda61aded559814478af2c4a0bdadb360b3a467..b2a74597db26b2fe10b954741b35d4a4a0a66d00 100644 (file)
@@ -25,7 +25,7 @@ from Extensions.i18n import tr
 from determine import monEnvQT5
 if monEnvQT5:
    from PyQt5.QtCore import Qt
-   from PyQt5.QtWidgets import QDialog
+   from PyQt5.QtWidgets import QDialog, QListWidgetItem
 else :
    from PyQt4.QtGui import *
    from PyQt4.QtCore import *
diff --git a/PSEN_N1/mesScripts_PSEN_N1.py b/PSEN_N1/mesScripts_PSEN_N1.py
new file mode 100644 (file)
index 0000000..7ffd8d0
--- /dev/null
@@ -0,0 +1,56 @@
+def processXLS(listeparam) :
+    print "dans processXLS"
+    item=listeparam[0]
+    fileNameObj=item.object.get_child('XLS_file')
+    if fileNameObj : fileName=fileNameObj.get_valeur()
+    else : fileName = ""
+    if fileName == "" : return 0, 'Nom de fichier invalide'
+
+    ongletListObj=item.object.get_child('Onglets')
+    if ongletListObj : ongletList= ongletListObj.get_valeur()
+    else : ongletList = [] 
+    if ongletList == [] : return 0, 'ongletList invalide'
+
+    busListObj=item.object.get_child('BusList')
+    if busListObj : busList= busListObj.get_valeur()
+    else : busList = [] 
+    if busList == [] : return 0, 'BusList invalide'
+
+    contListObj=item.object.get_child('ContList')
+    if contListObj : contList=contListObj.get_valeur()
+    else : contList = []
+    if contList == [] : return 0, 'ContList invalide'
+
+    dicoBus={}
+    dicoCont={}
+    for onglet in ongletList:
+        recherche=str(" ("+ str(onglet) +" )")
+        listeBusPourOnglet=[]
+        listeContPourOnglet=[]
+        for bus  in busList :  
+            nomBusSplit=str(bus).split(recherche)
+            if len(nomBusSplit) == 2 : listeBusPourOnglet.append(nomBusSplit[0])
+        for cont in contList : 
+            nomContSplit=str(cont).split(recherche)
+            if len(nomContSplit) == 2 : listeContPourOnglet.append(nomContSplit[0])
+        if listeBusPourOnglet != []  : dicoBus[onglet]=listeBusPourOnglet
+        if listeContPourOnglet != [] : dicoCont[onglet]=listeContPourOnglet
+
+    from Processor import processXLS
+    processXLS(fileName,dicoBus,dicoCont)
+    #if nouvelleVal != [] : prob.set_valeur(nouvelleVal)
+
+# le dictionnaire des commandes a la structure suivante :
+# la clef est la commande qui va proposer l action
+# puis un tuple qui contient
+#      - la fonction a appeler
+#       - le label dans le menu du clic droit
+#      - un tuple contenant les parametres attendus par la fonction
+#      - appelable depuis Salome uniquement -)
+#      - appelable depuis un item valide uniquement 
+#      - toolTip
+dict_commandes={
+   'DATA_PROCESSING': ( 
+       (processXLS,"process",('item',),False,True,"process values "),
+                      ),
+  }
diff --git a/UiQT4/eficas_en.qm b/UiQT4/eficas_en.qm
deleted file mode 100644 (file)
index d54e6f9..0000000
Binary files a/UiQT4/eficas_en.qm and /dev/null differ
diff --git a/UiQT4/eficas_fr.qm b/UiQT4/eficas_fr.qm
deleted file mode 100644 (file)
index 9bfe425..0000000
Binary files a/UiQT4/eficas_fr.qm and /dev/null differ
index 33ea0f8b3f317bd11dd12698c0b238724e1d1a6e..d283155e252889b1fe75dac6e76136e3bea98fc4 100644 (file)
      <property name="title">
       <string/>
      </property>
+     <layout class="QVBoxLayout" name="vlBouton">
+      <item>
+       <spacer name="verticalSpacer">
+        <property name="orientation">
+         <enum>Qt::Vertical</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>20</width>
+          <height>40</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
     </widget>
    </item>
    <item>
index be67512df61fae4298f90da41a683d721dd46724..f048c3d2cf7a0da11b7725577061961de2d9ff2e 100644 (file)
    <property name="spacing">
     <number>0</number>
    </property>
-   <property name="margin">
+   <property name="leftMargin">
+    <number>2</number>
+   </property>
+   <property name="topMargin">
+    <number>2</number>
+   </property>
+   <property name="rightMargin">
+    <number>2</number>
+   </property>
+   <property name="bottomMargin">
     <number>2</number>
    </property>
    <item>
      <property name="frameShadow">
       <enum>QFrame::Raised</enum>
      </property>
-     <layout class="QHBoxLayout" name="horizontalLayout_3">
+     <layout class="QHBoxLayout" name="horizontalLayout_2">
+      <property name="spacing">
+       <number>0</number>
+      </property>
+      <property name="leftMargin">
+       <number>0</number>
+      </property>
+      <property name="topMargin">
+       <number>0</number>
+      </property>
+      <property name="rightMargin">
+       <number>0</number>
+      </property>
+      <property name="bottomMargin">
+       <number>0</number>
+      </property>
       <item>
        <layout class="QVBoxLayout" name="verticalLayout_2">
         <property name="spacing">
        </spacer>
       </item>
       <item>
-       <layout class="QVBoxLayout" name="verticalLayout_3">
-        <property name="spacing">
-         <number>5</number>
-        </property>
-        <item>
+       <layout class="QGridLayout" name="gridLayout">
+        <item row="0" column="0" colspan="3">
          <widget class="QLabel" name="textLabel6">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
           </property>
          </widget>
         </item>
-        <item>
+        <item row="1" column="0">
          <spacer name="verticalSpacer_2">
           <property name="orientation">
            <enum>Qt::Vertical</enum>
           <property name="sizeHint" stdset="0">
            <size>
             <width>20</width>
-            <height>2</height>
+            <height>13</height>
            </size>
           </property>
          </spacer>
         </item>
-        <item>
+        <item row="2" column="0" colspan="2">
          <widget class="QLineEdit" name="LEFiltre">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
           </property>
          </widget>
         </item>
-        <item>
-         <layout class="QHBoxLayout" name="horizontalLayout_2">
-          <property name="sizeConstraint">
-           <enum>QLayout::SetMinimumSize</enum>
+        <item row="3" column="0">
+         <widget class="QRadioButton" name="RBCasse">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
           </property>
-          <item>
-           <widget class="QRadioButton" name="RBCasse">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="text">
-             <string>Sensible à la casse</string>
-            </property>
-            <property name="autoExclusive">
-             <bool>false</bool>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="horizontalSpacer_3">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <widget class="QPushButton" name="RBClear">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>100</width>
-              <height>30</height>
-             </size>
-            </property>
-            <property name="maximumSize">
-             <size>
-              <width>70</width>
-              <height>40</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>ré-affiche toutes les commandes</string>
-            </property>
-            <property name="styleSheet">
-             <string notr="true">background-color:rgb(104,110,149);
+          <property name="text">
+           <string>Sensible à la casse</string>
+          </property>
+          <property name="autoExclusive">
+           <bool>false</bool>
+          </property>
+         </widget>
+        </item>
+        <item row="3" column="1">
+         <spacer name="horizontalSpacer_3">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item row="3" column="2">
+         <widget class="QPushButton" name="RBClear">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="minimumSize">
+           <size>
+            <width>100</width>
+            <height>30</height>
+           </size>
+          </property>
+          <property name="maximumSize">
+           <size>
+            <width>70</width>
+            <height>40</height>
+           </size>
+          </property>
+          <property name="toolTip">
+           <string>ré-affiche toutes les commandes</string>
+          </property>
+          <property name="styleSheet">
+           <string notr="true">background-color:rgb(104,110,149);
 color :white;
 border-radius : 12px
 </string>
-            </property>
-            <property name="text">
-             <string>Effacer </string>
-            </property>
-           </widget>
-          </item>
-         </layout>
+          </property>
+          <property name="text">
+           <string>Effacer </string>
+          </property>
+         </widget>
         </item>
        </layout>
       </item>