#
from __future__ import absolute_import
from Noyau import N_TUPLE
+from Ihm import I_TUPLE
class Tuple (N_TUPLE.N_Tuple): pass
-class Matrice(N_TUPLE.N_Matrice): pass
+class Matrice (I_TUPLE.I_Matrice,N_TUPLE.N_Matrice):pass
+# def __init__(self,*tup,**args):
+# I_TUPLE.I_Matrice.__init__(self)
+# N_TUPLE.N_Matrice(self,*tup,**args)
+# print (tup)
+# print (args)
#print "#CMD", parent, nom
elif val.label == 'FACT':
val.checkDefinition(parent)
- #PNPNPN surcharge
- # CALC_SPEC !
- #assert self.label != 'FACT', \
- # 'Commande %s : Mot-clef facteur present sous un mot-clef facteur : interdit !' \
- # % parent
else:
continue
del args[nom]
# % (parent, tuple(mcs.intersection(mcbloc)))
return mcs
-# def enregistreXML(self,root,catalogueXml):
-# import xml.etree.ElementTree as ET
-# import types
-# moi=ET.SubElement(root,str(self.__class__))
-# nom=ET.SubElement(moi,'nom')
-# nom.text=self.nom
-#
-# if hasattr(self,'validators') and (self.validators != () and self.validators != None):
-# valid=ET.SubElement(moi,'validators')
-# valid.text= str(self.validators.__class__)
-# catalogueXml.validatorsUtilises.append(self.validators)
-#
-# if hasattr(self,'regles') and (self.regles !=() and self.regles != None):
-# for regle in self.regles:
-# regle.enregistreXML(moi,catalogueXml)
-# catalogueXml.reglesUtilisees.append(self.regles)
-#
-# if ((self.getDocu() !="" and self.getDocu() !=None) or \
-# (self.fr != "" and self.fr != None) or \
-# (self.ang != "" and self.ang != None) ):
-# dico={}
-# if self.getDocu() !=None : dico["docu"]=self.getDocu()
-# if self.fr != None : dico["fr"]=six.text_type(self.fr,"iso-8859-1")
-# if self.ang != None : dico["ang"]=self.ang
-# doc=ET.SubElement(moi,'doc')
-# doc.attrib=dico
-#
-# if ((self.getSug() !=None) or \
-# (hasattr(self,'defaut') and (self.defaut != None) and (self.defaut != 'None'))) :
-# # il faut ajouter des sug dans le catalogue
-# # les attributs sont toujours du texte
-# dico={}
-# if (self.defaut != None) and (self.defaut != 'None') :
-# if isinstance(self.defaut,str ) : dico["defaut"]=six.text_type(self.defaut,"iso-8859-1")
-# else :dico["defaut"]=str(self.defaut)
-# if self.getSug() !=None:
-# if isinstance(self.getSug(),str ) : dico["sug"]=six.text_type(self.getSug(),"iso-8859-1")
-# else :dico["sug"]=str(self.getSug())
-#
-# doc=ET.SubElement(moi,'ValeurDef')
-# doc.attrib=dico
-#
-# dico={}
-# if hasattr(self,'into') and self.into!=None: dico['into']=str(self.into)
-# if hasattr(self,'val_max') and self.val_max != "**" : dico['max']=str(self.val_max)
-# if hasattr(self,'val_min') and self.val_min != "**" : dico['min']=str(self.val_min)
-# if dico != {} :
-# PV=ET.SubElement(moi,'PlageValeur')
-# PV.attrib=dico
-#
-# dico={}
-# if hasattr(self,'max') and self.max != 1 : dico['max']=str(self.max)
-# if hasattr(self,'min') and self.min != 1 : dico['max']=str(self.min)
-# if dico != {} :
-# Card=ET.SubElement(moi,'Cardinalite')
-# Card.attrib=dico
-#
-# dico={}
-# if hasattr(self,'reentrant') and self.reentrant not in ('f','n') : dico['reentrant']=str(self.reentrant)
-# if hasattr(self,'position') and self.position != "local": dico['position']=str(self.position)
-# if hasattr(self,'homo') and self.homo != 1 : dico['homogene']=str(self.homo)
-# if hasattr(self,'statut') : dico['statut']=str(self.statut)
-# if hasattr(self,'repetable') : dico['repetable']=str(self.repetable)
-# if dico != {} :
-# pos=ET.SubElement(moi,'situation')
-# pos.attrib=dico
-#
-# if hasattr(self,'type') and self.type != ():
-# typeAttendu=ET.SubElement(moi,'typeAttendu')
-# l=[]
-# for t in self.type:
-# if type(t) == type : l.append(t.__name__)
-# else : l.append(t)
-# typeAttendu.text=str(l)
-#
-# if hasattr(self,'sd_prod') and self.sd_prod != () and self.sd_prod !=None:
-# typeCree=ET.SubElement(moi,'typeCree')
-# typeCree.text=str(self.sd_prod.__name__)
-#
-# if hasattr(self,'op') and self.op !=None :
-# subRoutine=ET.SubElement(moi,'subRoutine')
-# subRoutine.text=str(self.op)
-#
-# if hasattr(self,'proc') and self.proc != None :
-# construction=ET.SubElement(moi,'Construction')
-# construction.text=self.proc.uri
-#
-# for nomFils, fils in self.entites.items() :
-# fils.enregistreXML(moi,catalogueXml)
-#
-# def enregistreXMLStructure(self,root,catalogueXml):
-# import xml.etree.ElementTree as ET
-# import types
-# moi=ET.SubElement(root,str(self.__class__))
-#
-# if hasattr(self,'into') and self.into!=None:
-# INTO=ET.SubElement(moi,'into')
-# INTO.text='into'
-#
-# dico={}
-# if hasattr(self,'val_max') and self.val_max != "**" : dico['max']=str(self.val_max)
-# if hasattr(self,'val_min') and self.val_min != "**" : dico['min']=str(self.val_min)
-# if dico != {} :
-# PV=ET.SubElement(moi,'maxOrMin')
-# PV.text='maxOrMin'
-#
-# dico={}
-# if hasattr(self,'max') and self.max != 1 : dico['max']=str(self.max)
-# if hasattr(self,'min') and self.min != 1 : dico['max']=str(self.min)
-# if dico != {} :
-# Card=ET.SubElement(moi,'liste')
-# Card.text="liste"
-#
-# dico={}
-# if hasattr(self,'statut') and self.statut=="f" :
-# statut=ET.SubElement(moi,'facultatif')
-# statut.text='facultatif'
-# if hasattr(self,'statut') and self.statut !="f" :
-# statut=ET.SubElement(moi,'obligatoire')
-# statut.text='obligatoire'
-#
-# if hasattr(self,'type') and self.type != ():
-# try :
-# if 'Fichier' in self.type : ty=ET.SubElement(moi,'Fichier')
-# ty.text='type'
-# except :
-# try :
-# if 'Repertoire' in self.type : ty=ET.SubElement(moi,'Repertoire')
-# ty.text='type'
-# except :
-# for t in self.type:
-# if t == "I" : ty=ET.SubElement(moi,'typeEntier')
-# elif t == "R" : ty=ET.SubElement(moi,'typeReel')
-# elif t == "TXM" : ty=ET.SubElement(moi,'typeTXM')
-# else :
-# try :
-# ty=ET.SubElement(moi,t.__name__)
-# except :
-# ty=ET.SubElement(moi,'autre')
-# ty.text='type'
-#
-# if hasattr(self,'sd_prod') and self.sd_prod != () and self.sd_prod !=None:
-# typeCree=ET.SubElement(moi,'typeCree')
-# typeCree.text='sd_prod'
-#
-# if hasattr(self,'op') and self.op !=None :
-# subRoutine=ET.SubElement(moi,'subRoutine')
-# subRoutine.text='op'
-#
-# if hasattr(self,'proc') and self.proc != None :
-# construction=ET.SubElement(moi,'Construction')
-# construction.text='proc'
-#
-# for nomFils, fils in self.entites.items() :
-# fils.enregistreXMLStructure(moi,catalogueXml)
#
--- /dev/null
+# -*- coding: utf-8 -*-
+# Copyright (C) 2007-2021 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
+#
+
+class I_Matrice:
+ def activeCouleur(self):
+ self.dictCouleurs={}
+ self.indiceCouleur=1
+ self.listeCouleurs=((10, 186, 181),(204, 204, 255),(121, 248, 248),(254, 231, 240),(250, 234, 115), (254, 191, 210),(248, 142, 85),(133, 193, 126),(210, 202, 236),(225, 206, 154), (187, 174, 152),(240, 195, 0),(242, 255, 255),(239, 239, 239),(149, 165, 149), (150, 131, 236),(201, 160, 220),(103, 159, 90),(176, 242, 182),(233, 201, 177))
+
from .editorSsIhm import JDCEditorSsIhm
monEditeur=JDCEditorSsIhm(monEficasSsIhm,fichier)
+ print (options)
if options.fichierXMLOut == None :
fichierXMLOut=fichier[:fichier.rfind(".")]+'.xml'
else :
from PyQt5.QtCore import QSize, Qt
from PyQt5.QtWidgets import QTableWidgetItem, QTableWidget
-from PyQt5.QtGui import QIcon
+from PyQt5.QtGui import QIcon, QColor
from PyQt5.QtWidgets import QMessageBox
self.editor.afficheInfos(tr(commentaire),Qt.red)
monItem.setText("")
return
+ if self.monType.coloree : self.coloreItem(monItem,texte)
+
+
+ def coloreItem(self,monItem,texte):
+ if texte in self.monType.dictCouleurs.keys() :
+ monItem.setBackground(self.monType.dictCouleurs[texte])
+ else :
+ i=self.monType.indiceCouleur%20
+ newCouleur=QColor(*self.monType.listeCouleurs[i])
+ #monItem.setBackground(Qt.red)
+ monItem.setBackground(newCouleur)
+ self.monType.dictCouleurs[texte]=newCouleur
+ self.monType.indiceCouleur+=1
+
def creeColonnes(self):
else :
self.nbLigs=self.monType.nbLigs
self.nbCols=self.monType.nbCols
- self.TBMatrice.setColumnCount(self.nbLigs)
- self.TBMatrice.setRowCount(self.nbCols)
+ self.TBMatrice.setColumnCount(self.nbCols)
+ self.TBMatrice.setRowCount(self.nbLigs)
+ if self.nbLigs <15 : taille = 50
+ else : taille = 30
+ for i in range(self.nbLigs) :
+ self.TBMatrice.setRowHeight(i,taille)
+ for i in range(self.nbCols) :
+ self.TBMatrice.setColumnWidth(i,taille)
if self.monType.listeHeaders != None :
- self.TBMatrice.setVerticalHeaderLabels(self.monType.listeHeaders[0])
- self.TBMatrice.setHorizontalHeaderLabels(self.monType.listeHeaders[1])
+ self.TBMatrice.setHorizontalHeaderLabels(self.monType.listeHeaders[0])
+ self.TBMatrice.setVerticalHeaderLabels(self.monType.listeHeaders[1])
else :
self.TBMatrice.verticalHeader().hide()
self.TBMatrice.horizontalHeader().hide()
+ # self.TBMatrice.setFixedSize(self.nbCols*20+10,self.nbLigs*20+10)
def initialValeur(self):
raise EficasException('dimension')
for j in range(self.nbCols):
self.TBMatrice.setItem(i,j,QTableWidgetItem(str(liste[i][j])))
+ if self.monType.coloree : self.coloreItem(self.TBMatrice.item(i,j),str(liste[i][j]))
def acceptVal(self):
liste=[]
def ajoutLineEdit(self,valeur=None,):
- #print ('ajoutLineEdit plusieursBase')
+ print ('ajoutLineEdit plusieursBase')
#print ('self.indexDernierLabel', self.indexDernierLabel)
self.indexDernierLabel=self.indexDernierLabel+1
nomLineEdit="lineEditVal"+str(self.indexDernierLabel)
return self.finCommentaireListe()
def ajout1Valeur(self,valeur=None):
- #print ('ajout1Valeur plusieursBase')
+ print ('ajout1Valeur plusieursBase')
if valeur == None : return
liste,validite=SaisieValeur.TraiteLEValeur(self,str(valeur))
if validite == 0 : return
self.QWParent.informe('environnement', 'please source pyxb environment')
exit()
try :
- #if 1 :
nomCataXsd = os.path.splitext(os.path.basename(self.fichierCata))[0]
fichierCataTrunc=os.path.splitext(os.path.basename(self.fichierCata))[0]
nomCataXsd = fichierCataTrunc+'_driver'
pathCata = os.path.dirname(self.fichierCata)+'/raw/'+nomCataXsd+'.py'
+ print ('nomCataXsd , pathCata ',nomCataXsd,pathCata)
import imp
modeleMetier= imp.load_source(nomCataXsd,pathCata)
- #print ('nomCataXsd , pathCata ',nomCataXsd,pathCata)
+ print ('nomCataXsd , pathCata ',nomCataXsd,pathCata)
try :
#if 1 :
#monObjetAnnotation = getattr(modeleMetier,'PNEFdico_'+self.code)
#print ('dans readerCata _________', dicoEltDif)
except :
- #else :
if self.appliEficas.ssIhm == False :print ('______________ poum import cata_genere ')
self.QWParent.informe('XSD driver', 'unable to load xsd driver',critique=False)
modeleMetier = None
#else : print (niveau+1)*" ", nom
- def dumpToXsdEficas(self):
+ #def dumpToXsdEficas(self):
# Pas sur qu on ait jamais besoin de cela
- pass
+ # pass
#from Efi2Xsd import readerEfficas
#newSchema= xml = open('Cata_MED_FAM.xml').read()
#SchemaMed = efficas.CreateFromDocument(xml)
def __init__(self, nbLigs=None, nbCols=None,
methodeCalculTaille=None, formatSortie="ligne",
valSup=None, valMin=None, structure=None, typElt='R',
- typEltInto=None, listeHeaders=None):
+ typEltInto=None, listeHeaders=None, coloree=False):
self.nbLigs = nbLigs
self.nbCols = nbCols
self.methodeCalculTaille = methodeCalculTaille
self.listeHeaders = listeHeaders
self.typEltInto = typEltInto
self.jdc=None
+ self.coloree=coloree
+ self.coloree=True
+ if self.coloree : self.activeCouleur()
def __convert__(self, valeur):
# Attention ne verifie pas grand chose
<rect>
<x>0</x>
<y>0</y>
- <width>1067</width>
- <height>770</height>
+ <width>399</width>
+ <height>226</height>
</rect>
</property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="minimumSize">
<size>
<width>0</width>
- <height>250</height>
+ <height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
- <property name="spacing">
- <number>4</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">
<number>0</number>
</property>
+ <property name="sizeConstraint">
+ <enum>QLayout::SetFixedSize</enum>
+ </property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
</property>
<property name="icon">
<iconset theme="view-refresh">
- <normaloff>.</normaloff>.</iconset>
+ <normaloff/>
+ </iconset>
</property>
</widget>
</item>
</property>
<property name="maximumSize">
<size>
- <width>178</width>
+ <width>100</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item>
- <widget class="QTableWidget" name="TBMatrice"/>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>2</width>
+ <height>2</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QTableWidget" name="TBMatrice">
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>200</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::Box</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <property name="sizeAdjustPolicy">
+ <enum>QAbstractScrollArea::AdjustToContents</enum>
+ </property>
+ <property name="dragEnabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Ignored</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>2</height>
+ </size>
+ </property>
+ </spacer>
+ </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>2</width>
+ <height>2</height>
+ </size>
+ </property>
+ </spacer>
</item>
</layout>
+ <zorder>label</zorder>
+ <zorder>horizontalSpacer_2</zorder>
+ <zorder>TBMatrice</zorder>
</widget>
<customwidgets>
<customwidget>