# Attention l ordre des if est important
# Attention il faut gerer les blocs et les facteurs
# a gerer comme dans composimp
- # Gerer les matrices --> Actuellement pas dans ce type de panneau
+ # Gestion des matrices
+ if self.item.wait_matrice ():
+ from monWidgetMatrice import MonWidgetMatrice
+ widget=MonWidgetMatrice(self,maDefinition,monNom,monObjet,parentQt,maCommande)
+ self.widget=widget
+ return widget
#print "____________________________", monNom, self.item.wait_co()
#print "____________________________", monNom, self.item.wait_assd()
--- /dev/null
+# -*- coding: utf-8 -*-
+# Copyright (C) 2007-2013 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
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Modules Python
+import string,types,os
+
+# Modules Eficas
+from PyQt4.QtGui import *
+from PyQt4.QtCore import *
+from Extensions.i18n import tr
+from feuille import Feuille
+
+
+from desWidgetMatrice import Ui_desWidgetMatrice
+
+
+class MonWidgetMatrice (Ui_desWidgetMatrice,Feuille):
+# c est juste la taille des differents widgets de base qui change
+
+ def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+ Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
+ self.monType= self.node.item.object.definition.type[0]
+ parentQt.commandesLayout.insertWidget(-1,self)
+ self.nbLigs=0
+ self.nbCols=0
+ self.nomVariables={}
+ self.creeColonnes()
+ self.connecterSignaux()
+ if self.node.item.get_valeur()== None: self.initialSsValeur()
+ else :
+ try : self.initialValeur()
+ except : self.initialSsValeur()
+
+
+ def connecterSignaux(self) :
+ self.connect(self.TBMatrice,SIGNAL("itemChanged(QTableWidgetItem *)"),self.itemChanged)
+
+ def itemChanged(self):
+ monItem=self.TBMatrice.currentItem()
+ if monItem==None : return
+ texte=monItem.text()
+ if texte=="" : return
+ val,ok=texte.toDouble()
+ if ok == False :
+ self.editor.affiche_infos(tr("Entrer un float SVP"),Qt.red)
+ monItem.setText("")
+ return
+ if self.monType.valSup != None :
+ if val > self.monType.valSup :
+ self.editor.affiche_infos(tr("Entrer un float inferieur a ") + repr(self.monType.valSup),Qt.red)
+ monItem.setText("")
+ return
+ if self.monType.valMin != None :
+ if val < self.monType.valMin :
+ self.editor.affiche_infos(tr("Entrer un float superieur a ") + repr(self.monType.valMin),Qt.red)
+ monItem.setText("")
+ return
+ self.editor.affiche_infos("")
+ if self.monType.structure != None: apply (MonWidgetMatrice.__dict__[self.monType.structure],(self,))
+ self.acceptVal()
+
+
+ def symetrique(self):
+ monItem=self.TBMatrice.currentItem()
+ texte=monItem.text()
+ if monItem.row() != monItem.column():
+ print monItem.row(), monItem.column()
+ monItemSym=self.TBMatrice.item(monItem.column(), monItem.row())
+ monItemSym.setText(texte)
+
+ def creeColonnes(self):
+ if self.monType.methodeCalculTaille != None :
+ #try:
+ if 1 :
+ apply (MonWidgetMatrice.__dict__[self.monType.methodeCalculTaille],(self,))
+ else :
+ #except :
+ QMessageBox.critical( self, tr("Mauvaise execution "),tr( "impossible d executer la methode ") + monType.methodeCalculTaille )
+ return
+ else :
+ self.nbLigs=self.monType.nbLigs
+ self.nbCols=self.monType.nbCols
+
+
+ def NbDeVariables(self):
+ jdc=self.node.item.object.jdc
+ etape=self.node.item.object.etape
+ self.listeVariables=jdc.get_variables(etape)
+ if self.listeVariables == [] :
+ QMessageBox.critical( self, tr("Mauvaise Commande "),tr( "Aucune variable connue"))
+ return
+ self.TBMatrice.setColumnCount(len(self.listeVariables))
+ self.TBMatrice.setRowCount(len(self.listeVariables))
+ self.nbLigs=len(self.listeVariables)
+ self.nbCols=len(self.listeVariables)
+
+ def NbDeDistributions(self):
+ jdc=self.node.item.object.jdc
+ etape=self.node.item.object.etape
+ self.listeVariables=jdc.get_distributions(etape)
+ if self.listeVariables == [] :
+ QMessageBox.critical( self, tr("Mauvaise Commande "),tr( "Aucune variable connue"))
+ return
+ self.TBMatrice.setColumnCount(len(self.listeVariables))
+ self.TBMatrice.setRowCount(len(self.listeVariables))
+ self.nbLigs=len(self.listeVariables)
+ self.nbCols=len(self.listeVariables)
+
+ def initialSsValeur(self):
+ for row in range(self.nbLigs):
+ for column in range(self.nbCols):
+ if row == column :
+ initialFloat=1
+ else :
+ initialFloat=0
+ self.TBMatrice.setItem(row,column,QTableWidgetItem(str(initialFloat)))
+ header=QStringList()
+ for var in self.listeVariables :
+ header << var
+ self.TBMatrice.setVerticalHeaderLabels(header)
+ self.TBMatrice.setHorizontalHeaderLabels(header)
+
+ def initialValeur(self):
+ liste=self.node.item.get_valeur()
+ dejaAffiche=0
+ if (len(liste)) != self.nbLigs +1 :
+ QMessageBox.critical( self,tr( "Mauvaise dimension de matrice"),tr( "le nombre de ligne n est pas egal a ") + str(self.nbLigs))
+ dejaAffiche=1
+ for i in range(self.nbLigs):
+ inter=liste[i+1]
+ if (len(inter)) != self.nbCols and (dejaAffiche == 0 ) :
+ QMessageBox.critical( self, tr("Mauvaise dimension de matrice"), tr("le nombre de colonne n est pas egal a ") + str(self.nbCols))
+ dejaAffiche=1
+ for j in range(self.nbCols):
+ self.TBMatrice.setItem(i,j,QTableWidgetItem(str(liste[i+1][j])))
+ header=QStringList()
+ for var in liste[0]:
+ header << var
+ self.TBMatrice.setVerticalHeaderLabels(header)
+ self.TBMatrice.setHorizontalHeaderLabels(header)
+
+ def acceptVal(self):
+ liste=[]
+ liste.append(self.listeVariables)
+ if self.TBMatrice.rowCount() != self.nbLigs :
+ QMessageBox.critical( self, tr("Mauvaise dimension de matrice"),tr( "le nombre de ligne n est pas egal a ") + str(self.nbLigs))
+ if self.TBMatrice.columnCount() != self.nbCols :
+ QMessageBox.critical( self, tr("Mauvaise dimension de matrice"), tr("le nombre de colonne n est pas egal a ") + str(self.nbCols))
+ for i in range(self.nbLigs):
+ listeCol=[]
+ for j in range(self.nbCols):
+ monItem=self.TBMatrice.item(i,j)
+ texte=monItem.text()
+ val,ok=texte.toDouble()
+ if ok == False :
+ QMessageBox.critical( self, tr("Mauvaise Valeur"),tr( "l element ") + str(i) + "," +str(j) +tr("n est pas correct"))
+ listeCol.append(val)
+ liste.append(listeCol)
+ # on ajoute l ordre des variables aux valeurs
+ self.node.item.set_valeur(liste)
eficas_compile_ui ( desWidgetFactPlie.ui )
eficas_compile_ui ( desWidgetHeure.ui )
eficas_compile_ui ( desWidgetInformation.ui )
+eficas_compile_ui ( desWidgetMatrice.ui )
eficas_compile_ui ( desWidgetParam.ui )
eficas_compile_ui ( desWidgetPlusieursBase.ui )
eficas_compile_ui ( desWidgetPlusieursInto.ui )
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>desWidgetMatrice</class>
+ <widget class="QDialog" name="desWidgetMatrice">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>802</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="sizeConstraint">
+ <enum>QLayout::SetFixedSize</enum>
+ </property>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="MonBoutonValide" name="RBValide">
+ <property name="minimumSize">
+ <size>
+ <width>21</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>21</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>Qt::ClickFocus</enum>
+ </property>
+ <property name="toolTip">
+ <string>Affiche le rapport de validation du mot-clef</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">border : 0px</string>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>../../../../../../home/A96028/GitEficasTravail/eficas/Editeur/icons/ast-green-ball.png</normaloff>../../../../../../home/A96028/GitEficasTravail/eficas/Editeur/icons/ast-green-ball.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>5</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="MonLabelClic" name="label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>300</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>178</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="text">
+ <string><html><head/><body><p>aaa</p><p>dqsklmdqm</p></body></html></string>
+ </property>
+ <property name="scaledContents">
+ <bool>false</bool>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTableWidget" name="TBMatrice"/>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>MonBoutonValide</class>
+ <extends>QToolButton</extends>
+ <header>monBoutonValide.h</header>
+ </customwidget>
+ <customwidget>
+ <class>MonLabelClic</class>
+ <extends>QLabel</extends>
+ <header>monLabelClic.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>WidgetUniqueSDCO</class>
+ <widget class="QWidget" name="WidgetUniqueSDCO">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>1069</width>
+ <height>56</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <property name="spacing">
+ <number>1</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="sizeConstraint">
+ <enum>QLayout::SetFixedSize</enum>
+ </property>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="MonBoutonValide" name="RBValide">
+ <property name="minimumSize">
+ <size>
+ <width>21</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>21</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>Qt::ClickFocus</enum>
+ </property>
+ <property name="toolTip">
+ <string>Affiche le rapport de validation du mot-clef</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">border : 0px</string>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>../Editeur/icons/ast-green-ball.png</normaloff>../Editeur/icons/ast-green-ball.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>2</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="MonLabelClic" name="label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>300</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>178</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="text">
+ <string><html><head/><body><p>aaa</p><p>dqsklmdqm</p></body></html></string>
+ </property>
+ <property name="scaledContents">
+ <bool>false</bool>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLineEdit" name="LESDCO">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>805</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background:rgb(235,235,235);
+border:0px;</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Attend un objet de type CO </string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>79</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QToolButton" name="RBPoubelle">
+ <property name="minimumSize">
+ <size>
+ <width>21</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>21</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>Qt::ClickFocus</enum>
+ </property>
+ <property name="toolTip">
+ <string>Détruit le mot-clef</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">border : 0px</string>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>../Editeur/icons/deleteRond.png</normaloff>../Editeur/icons/deleteRond.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>2</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>MonBoutonValide</class>
+ <extends>QToolButton</extends>
+ <header>monBoutonValide.h</header>
+ </customwidget>
+ <customwidget>
+ <class>MonLabelClic</class>
+ <extends>QLabel</extends>
+ <header>monLabelClic.h</header>
+ </customwidget>
+ </customwidgets>
+ <tabstops>
+ <tabstop>LESDCO</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
desChoixCata.py desWidgetPlusieursInto.py desWidgetPlusieursIntoOrdonne.py desBaseWidget.py desWidgetOptionnel.py \
desWidgetSimpFichier.py desWidgetSimpTxt.py desRecherche.py desWidgetCommentaire.py\
desWidgetTuple2.py desWidgetTuple3.py desWidgetCreeParam.py desWidgetParam.py desWidgetHeure.py desWidgetDate.py\
- desWidgetVide.py desWidgetInformation.py desVisu.py desSelectVal.py desWidgetUniqueSDCO.py desWidgetSDCOInto.py
+ desWidgetVide.py desWidgetInformation.py desVisu.py desSelectVal.py desWidgetUniqueSDCO.py desWidgetSDCOInto.py\
+ desWidgetMatrice.py
QM_FILES=eficas_en.qm