From: pascale.noyret Date: Wed, 14 Feb 2018 14:37:42 +0000 (+0100) Subject: Lct X-Git-Tag: V8_5_0rc2a2~39 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d795fc8597c60fd6d6befef499ddca357e5abf41;p=modules%2Feficas.git Lct --- diff --git a/CataTestXSD/cata_test1.xml b/CataTestXSD/cata_test1.xml index dea7d312..6c748380 100755 --- a/CataTestXSD/cata_test1.xml +++ b/CataTestXSD/cata_test1.xml @@ -27,10 +27,12 @@ 42 I + diff --git a/CataTestXSD/configuration_TestXSD.py b/CataTestXSD/configuration_TestXSD.py new file mode 100644 index 00000000..0ce59dad --- /dev/null +++ b/CataTestXSD/configuration_TestXSD.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2008-2016 EDF R&D +# +# This file is part of SALOME ADAO module +# +# 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 +# + +""" + Ce module sert pour charger les paramètres de configuration d'EFICAS +""" +# Modules Python +import os, sys, string, types, re + + +# Modules Eficas +from InterfaceQT4 import configuration + +# Classe de base permettant de lire, afficher +# et sauvegarder les fichiers utilisateurs + +class CONFIG(configuration.configBase): + + def __init__(self,appli,repIni): + + self.labels_eficas=['lang','rep_cata','catalogues','closeAutreCommande','closeFrameRechercheCommande','closeEntete','taille'] + configuration.configBase.__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 + +def make_config(appli,rep): + return CONFIG(appli,rep) + diff --git a/CataTestXSD/prefs.py b/CataTestXSD/prefs.py new file mode 100644 index 00000000..e3fb9913 --- /dev/null +++ b/CataTestXSD/prefs.py @@ -0,0 +1,22 @@ +# Copyright (C) 2007-2012 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 +# +code="TestXSD" +import sys, os +if os.path.dirname(os.path.abspath(__file__)) not in sys.path : + sys.path.insert(0,os.path.dirname(os.path.abspath(__file__))) diff --git a/CataTestXSD/prefs_TestXSD.py b/CataTestXSD/prefs_TestXSD.py new file mode 100644 index 00000000..1fc5d23e --- /dev/null +++ b/CataTestXSD/prefs_TestXSD.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM 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 +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + +import os,sys +# repIni sert a localiser le fichier editeur.ini +# Obligatoire +repIni=os.path.dirname(os.path.abspath(__file__)) +INSTALLDIR=os.path.join(repIni,'..') +sys.path[:0]=[INSTALLDIR] + + +# lang indique la langue utilisee pour les chaines d'aide : fr ou ang +lang='en' + +# Codage des strings qui accepte les accents (en remplacement de 'ascii') +encoding='iso-8859-1' +docPath=repIni + +# +typeDeCata='XML' +catalogues=( + ('TestXSD','TestXSD',os.path.join(repIni,'cata_test1.xml'),'dico','xml'), +) + diff --git a/CataTestXSD/properties.py b/CataTestXSD/properties.py new file mode 100644 index 00000000..1d328a46 --- /dev/null +++ b/CataTestXSD/properties.py @@ -0,0 +1,24 @@ +#@ MODIF properties Accas DATE 11/06/2008 AUTEUR aster M.ADMINISTRATEUR +# RESPONSABLE D6BHHHH J-P.LEFEBVRE +# ====================================================================== +# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM 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 +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# ====================================================================== +# IDENTIFICATION DU GESTIONNAIRE DE COMMANDE ACCAS A PARTIR +# DE LA VERSION DU CODE_ASTER ASSOCIE +#---------------------------------------------------------------------- +version = "1.2" +date = "25/05/2010" +exploit = False diff --git a/CataTestXSD/qtEficas_TestXSD.py b/CataTestXSD/qtEficas_TestXSD.py new file mode 100755 index 00000000..05eaee9a --- /dev/null +++ b/CataTestXSD/qtEficas_TestXSD.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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 + +# Modules Eficas +import prefs +name='prefs_'+prefs.code +__import__(name) + +#import sys +#reload(sys) +#sys.setdefaultencoding('latin1') + +from InterfaceQT4 import eficas_go +print eficas_go +eficas_go.lanceEficas(code=prefs.code) diff --git a/InterfaceQT4/composimp.py b/InterfaceQT4/composimp.py index 0a6abfc7..2e83209e 100644 --- a/InterfaceQT4/composimp.py +++ b/InterfaceQT4/composimp.py @@ -28,11 +28,11 @@ import types,os from copy import copy,deepcopy import traceback -from . import typeNode +from InterfaceQT4 import typeNode # Modules Eficas -from Editeur import Objecttreeitem -from . import browser +from Editeur import Objecttreeitem +from InterfaceQT4 import browser from Noyau.N_CR import justifyText from Accas import SalomeEntry @@ -49,7 +49,7 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): # label informatif if monObjet.isInformation(): - from .monWidgetInfo import MonWidgetInfo + from InterfaceQT4.monWidgetInfo import MonWidgetInfo widget=MonWidgetInfo(self,maDefinition,monNom,monObjet,parentQt,maCommande) self.widget=widget return widget @@ -60,7 +60,7 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): # a gerer comme dans composimp # Gestion des matrices if self.item.waitMatrice (): - from .monWidgetMatrice import MonWidgetMatrice + from InterfaceQT4.monWidgetMatrice import MonWidgetMatrice widget=MonWidgetMatrice(self,maDefinition,monNom,monObjet,parentQt,maCommande) self.widget=widget return widget @@ -77,117 +77,120 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): # A verifier if maDefinition.intoSug != [] and maDefinition.intoSug != None: - from .monWidgetCBIntoSug import MonWidgetCBIntoSug + from InterfaceQT4.monWidgetCBIntoSug import MonWidgetCBIntoSug widget=MonWidgetCBIntoSug(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif maDefinition.into != [] and maDefinition.into != None: if len(monInto) < 4 : - from .monWidgetRadioButton import MonWidgetRadioButton + from InterfaceQT4.monWidgetRadioButton import MonWidgetRadioButton widget=MonWidgetRadioButton(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif len(monInto) < 7 : - from .monWidget4a6RadioButton import MonWidget4a6RadioButton + from InterfaceQT4.monWidget4a6RadioButton import MonWidget4a6RadioButton widget=MonWidget4a6RadioButton(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : - from .monWidgetCB import MonWidgetCB + from InterfaceQT4.monWidgetCB import MonWidgetCB widget=MonWidgetCB(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.waitBool() : - from .monWidgetSimpBool import MonWidgetSimpBool + from InterfaceQT4.monWidgetSimpBool import MonWidgetSimpBool widget=MonWidgetSimpBool(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.waitFichier(): - from .monWidgetSimpFichier import MonWidgetSimpFichier + from InterfaceQT4.monWidgetSimpFichier import MonWidgetSimpFichier widget=MonWidgetSimpFichier(self,maDefinition,monNom,monObjet,parentQt,maCommande) # PNPNPN - a faire elif self.item.waitDate(): - from .monWidgetDate import MonWidgetDate + from InterfaceQT4.monWidgetDate import MonWidgetDate widget=MonWidgetDate(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.waitHeure(): - from .monWidgetHeure import MonWidgetHeure + from InterfaceQT4.monWidgetHeure import MonWidgetHeure widget=MonWidgetHeure(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.waitTuple() : if self.item.object.definition.type[0].ntuple == 2: - from .monWidgetSimpTuple2 import MonWidgetSimpTuple2 + from InterfaceQT4.monWidgetSimpTuple2 import MonWidgetSimpTuple2 widget=MonWidgetSimpTuple2(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.object.definition.type[0].ntuple == 3 : - from .monWidgetSimpTuple3 import MonWidgetSimpTuple3 + from InterfaceQT4.monWidgetSimpTuple3 import MonWidgetSimpTuple3 widget=MonWidgetSimpTuple3(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : print ("Pas de Tuple de longueur > 3") print ("Prevenir la maintenance ") elif self.item.waitComplex(): - from .monWidgetSimpComplexe import MonWidgetSimpComplexe + from InterfaceQT4.monWidgetSimpComplexe import MonWidgetSimpComplexe widget=MonWidgetSimpComplexe(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.waitCo(): if len(self.item.getSdAvantDuBonType()) == 0 : - from .monWidgetUniqueSDCO import MonWidgetUniqueSDCO + from InterfaceQT4.monWidgetUniqueSDCO import MonWidgetUniqueSDCO widget=MonWidgetUniqueSDCO(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : - from .monWidgetSDCOInto import MonWidgetSDCOInto + from InterfaceQT4.monWidgetSDCOInto import MonWidgetSDCOInto widget=MonWidgetSDCOInto(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.waitAssd(): if len(self.item.getSdAvantDuBonType()) == 0 : - from .monWidgetVide import MonWidgetVide + from InterfaceQT4.monWidgetVide import MonWidgetVide widget=MonWidgetVide(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif len(self.item.getSdAvantDuBonType()) < 4 : - from .monWidgetRadioButton import MonWidgetRadioButtonSD + from InterfaceQT4.monWidgetRadioButton import MonWidgetRadioButtonSD widget=MonWidgetRadioButtonSD(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif len(self.item.getSdAvantDuBonType()) < 7 : - from .monWidget4a6RadioButton import MonWidget4a6RadioButtonSD + from InterfaceQT4.monWidget4a6RadioButton import MonWidget4a6RadioButtonSD widget=MonWidget4a6RadioButtonSD(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : - from .monWidgetCB import MonWidgetCBSD + from InterfaceQT4.monWidgetCB import MonWidgetCBSD widget=MonWidgetCBSD(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.waitSalome() and self.editor.salome: - from .monWidgetSimpSalome import MonWidgetSimpSalome + from InterfaceQT4.monWidgetSimpSalome import MonWidgetSimpSalome widget=MonWidgetSimpSalome(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.waitTxm(): - from .monWidgetSimpTxt import MonWidgetSimpTxt + from InterfaceQT4.monWidgetSimpTxt import MonWidgetSimpTxt widget=MonWidgetSimpTxt(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : - from .monWidgetSimpBase import MonWidgetSimpBase + from InterfaceQT4.monWidgetSimpBase import MonWidgetSimpBase widget=MonWidgetSimpBase(self,maDefinition,monNom,monObjet,parentQt,maCommande) # Gestion des listes else : if maDefinition.intoSug != [] and maDefinition.intoSug != None: if self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) : - from .monWidgetIntoSug import MonWidgetIntoSug + from InterfaceQT4.monWidgetIntoSug import MonWidgetIntoSug widget=MonWidgetIntoSug(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : - from .monWidgetPlusieursPlie import MonWidgetPlusieursPlie + from InterfaceQT4.monWidgetPlusieursPlie import MonWidgetPlusieursPlie widget=MonWidgetPlusieursPlie(self,maDefinition,monNom,monObjet,parentQt,maCommande) #if maDefinition.into != [] and maDefinition.into != None: # Attention pas fini --> on attend une liste de ASSD avec ordre elif self.item.waitAssd() and self.item.isListSansOrdreNiDoublon(): listeAAfficher = self.item.getSdAvantDuBonType() if len(listeAAfficher) == 0: - from .monWidgetVide import MonWidgetVide + from InterfaceQT4.monWidgetVide import MonWidgetVide widget = MonWidgetVide(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : - from .monWidgetPlusieursInto import MonWidgetPlusieursInto + from InterfaceQT4.monWidgetPlusieursInto import MonWidgetPlusieursInto widget=MonWidgetPlusieursInto(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.waitAssd() : listeAAfficher = self.item.getSdAvantDuBonType() if len(listeAAfficher) == 0: - from .monWidgetVide import MonWidgetVide + from InterfaceQT4.monWidgetVide import MonWidgetVide widget = MonWidgetVide(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) : - from .monWidgetPlusieursASSDIntoOrdonne import MonWidgetPlusieursASSDIntoOrdonne + from InterfaceQT4.monWidgetPlusieursASSDIntoOrdonne import MonWidgetPlusieursASSDIntoOrdonne widget=MonWidgetPlusieursASSDIntoOrdonne(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : - from .monWidgetPlusieursPlie import MonWidgetPlusieursPlieASSD + from InterfaceQT4.monWidgetPlusieursPlie import MonWidgetPlusieursPlieASSD widget=MonWidgetPlusieursPlieASSD(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.waitTuple() : - if self.item.object.definition.type[0].ntuple == 2: - from .monWidgetPlusieursTuple2 import MonWidgetPlusieursTuple2 + if self.item.object.definition.fenetreIhm == 'Tableau' : + from InterfaceQT4.monWidgetPlusieursTuple2 import MonWidgetTableau + widget=MonWidgetTableau(self,maDefinition,monNom,monObjet,parentQt,maCommande) + elif self.item.object.definition.type[0].ntuple == 2: + from InterfaceQT4.monWidgetPlusieursTuple2 import MonWidgetPlusieursTuple2 widget=MonWidgetPlusieursTuple2(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.object.definition.type[0].ntuple == 3 : - from .monWidgetPlusieursTuple3 import MonWidgetPlusieursTuple3 + from InterfaceQT4.monWidgetPlusieursTuple3 import MonWidgetPlusieursTuple3 widget=MonWidgetPlusieursTuple3(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : print ("Pas de Tuple de longueur > 3") @@ -196,25 +199,25 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): if self.item.isListSansOrdreNiDoublon(): if self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) : - from .monWidgetPlusieursInto import MonWidgetPlusieursInto + from InterfaceQT4.monWidgetPlusieursInto import MonWidgetPlusieursInto widget=MonWidgetPlusieursInto(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : - from .monWidgetPlusieursPlie import MonWidgetPlusieursPlie + from InterfaceQT4.monWidgetPlusieursPlie import MonWidgetPlusieursPlie widget=MonWidgetPlusieursPlie(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : if self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) : - from .monWidgetPlusieursIntoOrdonne import MonWidgetPlusieursIntoOrdonne + from InterfaceQT4.monWidgetPlusieursIntoOrdonne import MonWidgetPlusieursIntoOrdonne widget=MonWidgetPlusieursIntoOrdonne(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : - from .monWidgetPlusieursPlie import MonWidgetPlusieursPlie + from InterfaceQT4.monWidgetPlusieursPlie import MonWidgetPlusieursPlie widget=MonWidgetPlusieursPlie(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : #print 8 if self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) : - from .monWidgetPlusieursBase import MonWidgetPlusieursBase + from InterfaceQT4.monWidgetPlusieursBase import MonWidgetPlusieursBase widget=MonWidgetPlusieursBase(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : - from .monWidgetPlusieursPlie import MonWidgetPlusieursPlie + from InterfaceQT4.monWidgetPlusieursPlie import MonWidgetPlusieursPlie widget=MonWidgetPlusieursPlie(self,maDefinition,monNom,monObjet,parentQt,maCommande) self.widget=widget diff --git a/InterfaceQT4/gereListe.py b/InterfaceQT4/gereListe.py index 2dcdf5e7..2b2de3f0 100644 --- a/InterfaceQT4/gereListe.py +++ b/InterfaceQT4/gereListe.py @@ -57,7 +57,7 @@ class LECustom(QLineEdit): def focusInEvent(self,event): #print "dans focusInEvent de LECustom" self.parentQt.LineEditEnCours=self - self.parentQt.NumLineEditEnCours=self.num + self.parentQt.numLineEditEnCours=self.num self.parentQt.textSelected=self.text() self.setStyleSheet("border: 2px solid gray") QLineEdit.focusInEvent(self,event) @@ -169,17 +169,17 @@ class GereListe(object): self.prepareListeResultat() def hautPushed(self): - if self.NumLineEditEnCours == 1 : return - else : numEchange=self.NumLineEditEnCours-1 - self.echange(self.NumLineEditEnCours,numEchange) + if self.numLineEditEnCours == 1 : return + else : numEchange=self.numLineEditEnCours-1 + self.echange(self.numLineEditEnCours,numEchange) self.LineEditEnCours.setFocus(True) self.scrollArea.ensureWidgetVisible(self.LineEditEnCours) def basPushed(self): - if self.NumLineEditEnCours == self.indexDernierLabel : return - else : numEchange=self.NumLineEditEnCours+1 - self.echange(self.NumLineEditEnCours,numEchange) + if self.numLineEditEnCours == self.indexDernierLabel : return + else : numEchange=self.numLineEditEnCours+1 + self.echange(self.numLineEditEnCours,numEchange) self.LineEditEnCours.setFocus(True) self.scrollArea.ensureWidgetVisible(self.LineEditEnCours) @@ -196,20 +196,20 @@ class GereListe(object): courant.setText(courant2.text()) courant2.setText(valeurAGarder) self.changeValeur(changeDePlace=False) - self.NumLineEditEnCours=num2 + self.numLineEditEnCours=num2 self.LineEditEnCours=courant2 self.LineEditEnCours.setFocus(True) def moinsPushed(self): # on supprime le dernier - if self.NumLineEditEnCours == 0 : return + if self.numLineEditEnCours == 0 : return if self.indexDernierLabel == 0 : return - if self.NumLineEditEnCours==self.indexDernierLabel : + if self.numLineEditEnCours==self.indexDernierLabel : nomLineEdit=self.nomLine+str(self.indexDernierLabel) courant=getattr(self,nomLineEdit) courant.clean() else : - for i in range (self.NumLineEditEnCours, self.indexDernierLabel): + for i in range (self.numLineEditEnCours, self.indexDernierLabel): aRemonter=i+1 nomLineEdit=self.nomLine+str(aRemonter) courant=getattr(self,nomLineEdit) @@ -241,12 +241,12 @@ class GereListe(object): def descendLesLignes(self): - if self.NumLineEditEnCours==self.indexDernierLabel : return - nomLineEdit=self.nomLine+str(self.NumLineEditEnCours+1) + if self.numLineEditEnCours==self.indexDernierLabel : return + nomLineEdit=self.nomLine+str(self.numLineEditEnCours+1) courant=getattr(self,nomLineEdit) valeurADescendre=courant.getValeur() courant.clean() - for i in range (self.NumLineEditEnCours+1, self.indexDernierLabel): + for i in range (self.numLineEditEnCours+1, self.indexDernierLabel): aDescendre=i+1 nomLineEdit=self.nomLine+str(aDescendre) courant=getattr(self,nomLineEdit) diff --git a/InterfaceQT4/monWidgetNiveauFact.py b/InterfaceQT4/monWidgetNiveauFact.py index 29bcd889..8cb60966 100644 --- a/InterfaceQT4/monWidgetNiveauFact.py +++ b/InterfaceQT4/monWidgetNiveauFact.py @@ -28,7 +28,6 @@ import types from desWidgetNiveauFact import Ui_WidgetNiveauFact from InterfaceQT4.groupe import Groupe -from InterfaceQT4.monWidgetTableau import MonFactTableauCommun from PyQt5.QtWidgets import QWidget @@ -159,7 +158,6 @@ class MonWidgetNiveauFact(Ui_WidgetNiveauFact,Groupe): self.monGroupe=self.monOptionnel.afficheOptionnel(liste,liste_rouge,self) -class MonWidgetNiveauFactTableau(MonWidgetNiveauFact, MonFactTableauCommun): +class MonWidgetNiveauFactTableau(MonWidgetNiveauFact): def __init__(self,node,editor,definition,obj): MonWidgetNiveauFact.__init__(self,node,editor,definition,obj) - MonFactTableauCommun.__init__(self) diff --git a/InterfaceQT4/monWidgetPlusieursASSDIntoOrdonne.py b/InterfaceQT4/monWidgetPlusieursASSDIntoOrdonne.py index 430c1c79..3498fe85 100644 --- a/InterfaceQT4/monWidgetPlusieursASSDIntoOrdonne.py +++ b/InterfaceQT4/monWidgetPlusieursASSDIntoOrdonne.py @@ -39,7 +39,7 @@ from PyQt5.QtWidgets import QScrollBar class MonWidgetPlusieursASSDIntoOrdonne (MonWidgetPlusieursIntoOrdonne): def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande): - self.NumLineEditEnCours=0 + self.numLineEditEnCours=0 MonWidgetPlusieursIntoOrdonne.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande) diff --git a/InterfaceQT4/monWidgetPlusieursBase.py b/InterfaceQT4/monWidgetPlusieursBase.py index b002a4e5..0a35f871 100644 --- a/InterfaceQT4/monWidgetPlusieursBase.py +++ b/InterfaceQT4/monWidgetPlusieursBase.py @@ -54,7 +54,7 @@ class MonWidgetPlusieursBase (Ui_WidgetPlusieursBase,Feuille,GereListe,GerePlie) self.nomLine="lineEditVal" self.inInit=True self.indexDernierLabel=0 - self.NumLineEditEnCours=0 + self.numLineEditEnCours=0 self.listeAffichageWidget=[] Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande) GereListe.__init__(self) @@ -193,27 +193,6 @@ class MonWidgetPlusieursBase (Ui_WidgetPlusieursBase,Feuille,GereListe,GerePlie) # A priori, on ne fait rien pass - #def ajoutNValeur(self,liste) : - # for val in liste : - # i=1 - # ajoute=False - # while i < self.indexDernierLabel+1: - # nomLineEdit="lineEditVal"+str(i) - # courant=getattr(self,nomLineEdit) - # valeur=courant.text() - # if valeur == None or valeur == "" : - # ajoute=True - # courant.setText(str(val)) - # commentaire=self.ajout1Valeur(val) - # if (commentaire != None ): - # self.editor.afficheInfos(commentaire,Qt.red) - # courant.setText("") - # break - # else : - # i=i+1 - # if ajoute : continue - # self.ajoutLineEdit(valeur=str(val)) - # self.changeValeur() def ajoutNValeur(self,liste): #---------------------------- diff --git a/InterfaceQT4/monWidgetPlusieursTuple.py b/InterfaceQT4/monWidgetPlusieursTuple.py index 5eb7237a..c289b9e8 100644 --- a/InterfaceQT4/monWidgetPlusieursTuple.py +++ b/InterfaceQT4/monWidgetPlusieursTuple.py @@ -29,19 +29,19 @@ import types,os,sys from six.moves import range from PyQt5.QtWidgets import QFrame,QApplication, QFrame, QWidget -from PyQt5.QtGui import QIcon -from PyQt5.QtCore import QSize, Qt, QTimer +from PyQt5.QtGui import QIcon +from PyQt5.QtCore import QSize, Qt, QTimer from Extensions.i18n import tr -from .feuille import Feuille -from .politiquesValidation import PolitiquePlusieurs -from .qtSaisie import SaisieValeur -from .gereListe import GereListe -from .gereListe import LECustom -from Tuple2 import Ui_Tuple2 -from Tuple3 import Ui_Tuple3 +from InterfaceQT4.feuille import Feuille +from InterfaceQT4.politiquesValidation import PolitiquePlusieurs +from InterfaceQT4.qtSaisie import SaisieValeur +from InterfaceQT4.gereListe import GereListe +from InterfaceQT4.gereListe import LECustom +from Tuple2 import Ui_Tuple2 +from Tuple3 import Ui_Tuple3 #-------------------------- @@ -173,10 +173,11 @@ class TupleCustom3(QWidget,Ui_Tuple3,TupleCustom): class MonWidgetPlusieursTuple(Feuille,GereListe): # -------------------------------------------- # - def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande): + def __init__(self, node, monSimpDef, nom, objSimp, parentQt, commande): #----------------------------------------------------- self.indexDernierLabel=0 + self.numLineEditEnCours=0 self.nomLine="TupleVal" self.listeAffichageWidget=[] Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande) @@ -199,8 +200,8 @@ class MonWidgetPlusieursTuple(Feuille,GereListe): self.BSelectFichier.setIcon(icon3) self.BSelectFichier.setIconSize(QSize(32, 32)) self.BSelectFichier.clicked.connect(self.selectInFile) - - + + def ajoutLineEdit(self,valeur=None,inInit=False): @@ -239,7 +240,7 @@ class MonWidgetPlusieursTuple(Feuille,GereListe): def setValeurs(self): # --------------------- - self.RBListePush() + if self.editor.code == 'PSEN' : self.RBListePush() valeurs=self.node.item.getValeur() min,max=self.node.item.getMinMax() if max == "**" or max > 5 : aCreer=5 diff --git a/InterfaceQT4/monWidgetPlusieursTuple2.py b/InterfaceQT4/monWidgetPlusieursTuple2.py index 564e388d..36ebed45 100644 --- a/InterfaceQT4/monWidgetPlusieursTuple2.py +++ b/InterfaceQT4/monWidgetPlusieursTuple2.py @@ -23,9 +23,10 @@ import types,os # Modules Eficas -from .feuille import Feuille -from .monWidgetPlusieursTuple import MonWidgetPlusieursTuple -from desWidgetPlusieursTuple import Ui_WidgetPlusieursTuple +from InterfaceQT4.feuille import Feuille +from InterfaceQT4.monWidgetPlusieursTuple import MonWidgetPlusieursTuple +from desWidgetPlusieursTuple import Ui_WidgetPlusieursTuple +from desWidgetTableau import Ui_WidgetTableau class MonWidgetPlusieursTuple2 (Ui_WidgetPlusieursTuple,MonWidgetPlusieursTuple): @@ -34,3 +35,13 @@ class MonWidgetPlusieursTuple2 (Ui_WidgetPlusieursTuple,MonWidgetPlusieursTuple) self.nbValeurs=2 MonWidgetPlusieursTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande) +class MonWidgetTableau (Ui_WidgetTableau,MonWidgetPlusieursTuple): + def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande): + self.nbValeurs=len(monSimpDef.homo) + MonWidgetPlusieursTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande) + self.resize(self.width(),1800) + + def ajoutLineEdit(self,valeur=None,inInit=False): + hauteurAvant=(self.frame.height()) + MonWidgetPlusieursTuple.ajoutLineEdit(self,valeur,inInit) + diff --git a/InterfaceQT4/monWidgetTableau.py b/InterfaceQT4/monWidgetTableau.py deleted file mode 100644 index d0bafc80..00000000 --- a/InterfaceQT4/monWidgetTableau.py +++ /dev/null @@ -1,325 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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 -from __future__ import absolute_import -try : - from builtins import str - from builtins import range - from builtins import object -except : pass - -import types,os,sys - -from six.moves import range -from PyQt5.QtGui import QIcon -from PyQt5.QtWidgets import QApplication, QMessageBox -from PyQt5.QtCore import QTimer, QSize, Qt - -# Modules Eficas -from Extensions.i18n import tr - -from .feuille import Feuille -from desWidgetPlusieursBase import Ui_WidgetPlusieursBase -from .politiquesValidation import PolitiquePlusieurs -from .qtSaisie import SaisieValeur -from .gereListe import GereListe -from .gereListe import GerePlie -from .gereListe import LECustom - - -class MonFactTableauCommun : - - def __init__(self): - print "MonFactTableauCommun" - -#,GereListe,GerePlie): -# -# def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande): -# #print "MonWidgetPlusieursBase", nom -# self.inFocusOutEvent=False -# self.nomLine="lineEditVal" -# self.inInit=True -# self.indexDernierLabel=0 -# self.NumLineEditEnCours=0 -# self.listeAffichageWidget=[] -# Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande) -# GereListe.__init__(self) -# self.gereIconePlier() -# self.BSelectFichier.clicked.connect(self.selectInFile) -# -# if sys.platform[0:5]!="linux": -# repIcon=self.node.editor.appliEficas.repIcon -# fichier=os.path.join(repIcon, 'arrow_up.png') -# icon = QIcon(fichier) -# self.RBHaut.setIcon(icon) -# self.RBHaut.setIconSize(QSize(32, 32)) -# fichier2=os.path.join(repIcon, 'arrow_down.png') -# icon2 = QIcon(fichier2) -# self.RBBas.setIcon(icon2) -# fichier3=os.path.join(repIcon, 'file-explorer.png') -# icon3 = QIcon(fichier2) -# self.BSelectFichier.setIcon(icon3) -# self.BSelectFichier.setIconSize(QSize(32, 32)) -# icon=QIcon(self.repIcon+"/MoinsBleu.png") -# self.RBMoins.setIcon(icon) -# icon=QIcon(self.repIcon+"/PlusBleu.png") -# self.RBPlus.setIcon(icon) -# icon=QIcon(self.repIcon+"/verre-loupe-icone-6087-64.png") -# self.RBVoisListe.setIcon(icon) -# -# -# self.listeValeursCourantes=self.node.item.getListeValeurs() -# if self.monSimpDef.max != "**" and self.monSimpDef.max < 7: -# hauteurMax=dicoLongueur[self.monSimpDef.max] -# else : -# hauteurMax=220 -# # if self.monSimpDef.max == self.monSimpDef.min : self.setMaximumHeight(hauteur) -# self.resize(self.width(),hauteurMax) -# self.setMinimumHeight(hauteurMax) -# self.finCommentaireListe() -# self.parentQt.commandesLayout.insertWidget(-1,self) -# self.maCommande.listeAffichageWidget.append(self.lineEditVal1) -# self.AAfficher=self.lineEditVal1 -# self.inInit=False -# # PNPN a completer __ si tuple le type des tuples sinon le tuple -# self.monCommentaireLabel.setText(self.finCommentaireListe()) -# -# -# def setValeurs(self): -# self.vScrollBar = self.scrollArea.verticalScrollBar() -# self.politique=PolitiquePlusieurs(self.node,self.editor) -# # construction du min de valeur a entrer -# if self.monSimpDef.max == "**" : aConstruire=7 -# elif self.monSimpDef.max == float('inf'): aConstruire=7 -# else : aConstruire=self.monSimpDef.max -# -# for i in range(1,aConstruire): -# self.ajoutLineEdit() -# QApplication.processEvents() -# self.scrollArea.ensureWidgetVisible(self.lineEditVal1) -# self.listeValeursCourantes=self.node.item.getListeValeurs() -# index=1 -# for valeur in self.listeValeursCourantes : -# val=self.politique.getValeurTexte(valeur) -# nomLineEdit="lineEditVal"+str(index) -# if hasattr(self,nomLineEdit) : -# courant=getattr(self,nomLineEdit) -# if 'R' in self.objSimp.definition.type and str(val) != repr(val) : courant.setText(repr(val)) -# else : courant.setText(str(val)) -# else : -# self.ajoutLineEdit(val) -# index=index+1 -# # ajout d'une ligne vide ou affichage commentaire -# if self.indexDernierLabel < self.monSimpDef.max : self.ajoutLineEdit() -# else : self.scrollArea.setToolTip('nb max de valeurs atteint') -# #self.adjustSize() -# #self.vScrollBar.triggerAction(QScrollBar.SliderToMinimum) -# -# -# def ajoutLineEdit(self,valeur=None,): -# self.indexDernierLabel=self.indexDernierLabel+1 -# nomLineEdit="lineEditVal"+str(self.indexDernierLabel) -# if hasattr(self,nomLineEdit) : -# self.indexDernierLabel=self.indexDernierLabel-1 -# return -# nouveauLE = LECustom(self.scrollArea,self,self.indexDernierLabel) -# self.verticalLayoutLE.insertWidget(self.indexDernierLabel-1,nouveauLE) -# nouveauLE.setText("") -# if self.indexDernierLabel % 2 == 1 : nouveauLE.setStyleSheet("background:rgb(210,210,210)") -# else : nouveauLE.setStyleSheet("background:rgb(235,235,235)") -# nouveauLE.setFrame(False) -# nouveauLE.returnPressed.connect(self.changeValeur) -# -# setattr(self,nomLineEdit,nouveauLE) -# self.listeAffichageWidget.append(nouveauLE) -# self.etablitOrdre() -# if valeur != None : nouveauLE.setText(str(valeur)) -# # deux lignes pour que le ensureVisible fonctionne -# self.estVisible=nouveauLE -# if self.inInit==False :QTimer.singleShot(1, self.rendVisibleLigne) -# #if donneLeFocus==True : nouveauLE.setFocus() -# -# def etablitOrdre(self): -# i=0 -# while(i +1 < len(self.listeAffichageWidget)): -# self.listeAffichageWidget[i].setFocusPolicy(Qt.StrongFocus) -# self.setTabOrder(self.listeAffichageWidget[i],self.listeAffichageWidget[i+1]) -# i=i+1 -# # si on boucle on perd l'ordre -# -# -# def rendVisibleLigne(self): -# QApplication.processEvents() -# self.estVisible.setFocus() -# self.scrollArea.ensureWidgetVisible(self.estVisible,0,0) -# -# -# def finCommentaire(self): -# return self.finCommentaireListe() -# -# def ajout1Valeur(self,valeur=None): -# if valeur == None : return -# liste,validite=SaisieValeur.TraiteLEValeur(self,str(valeur)) -# if validite == 0 : return -# if liste ==[] : return -# listeVal=[] -# for valeur in self.listeValeursCourantes : listeVal.append(valeur) -# validite,comm,comm2,listeRetour=self.politique.ajoutValeurs(liste,-1,listeVal) -# if (comm2 != "" and comm != None) : return comm2 -# if validite : -# self.listeValeursCourantes=self.listeValeursCourantes+listeRetour -# if len(self.listeValeursCourantes) > self.monSimpDef.min : -# self.node.item.setValeur(self.listeValeursCourantes) -# self.reaffiche() -# return None -# else : -# return(comm2+" "+comm) -# -# def reaffiche(self): -# # A priori, on ne fait rien -# pass -# -# #def ajoutNValeur(self,liste) : -# # for val in liste : -# # i=1 -# # ajoute=False -# # while i < self.indexDernierLabel+1: -# # nomLineEdit="lineEditVal"+str(i) -# # courant=getattr(self,nomLineEdit) -# # valeur=courant.text() -# # if valeur == None or valeur == "" : -# # ajoute=True -# # courant.setText(str(val)) -# # commentaire=self.ajout1Valeur(val) -# # if (commentaire != None ): -# # self.editor.afficheInfos(commentaire,Qt.red) -# # courant.setText("") -# # break -# # else : -# # i=i+1 -# # if ajoute : continue -# # self.ajoutLineEdit(valeur=str(val)) -# # self.changeValeur() -# -# def ajoutNValeur(self,liste): -# #---------------------------- -# # attention quand on charge par un fichier, on ne peut pas se contenter d ajouter N fois 1 valeur -# # car alors le temps de verification devient prohibitif reconstructu=ion et verification a -# # chaque valeur. d ou l ajout de ajoutNTuple a politique plusieurs -# -# -# listeFormatee=list(liste) -# -# min,max=self.node.item.getMinMax() -# if self.objSimp.valeur == None : listeComplete=listeFormatee -# else : listeComplete =self.objSimp.valeur + listeFormatee -# -# if len(listeComplete) > max : -# texte=tr("Nombre maximum de valeurs ")+str(max)+tr(" atteint") -# self.editor.afficheInfos(texte,Qt.red) -# return -# -# validite,comm,comm2,listeRetour= self.politique.ajoutNTuple(listeComplete) -# if not validite : -# self.editor.affiche_infos(texte,Qt.red) -# return -# -# # on calcule le dernier lineedit rempli avant de changer la valeur -# if self.objSimp.valeur != None : indexDernierRempli=len(self.objSimp.valeur) -# else : indexDernierRempli=0 -# -# self.politique.recordValeur(listeComplete) -# -# indexDernierRempli=0 -# while ( indexDernierRempli < len(liste) ) : -# texte=liste[indexDernierRempli] -# if indexDernierRempli < self.indexDernierLabel: -# nomLineEdit="lineEditVal"+str(indexDernierRempli+1) -# courant=getattr(self,nomLineEdit) -# courant.setText(str(texte)) -# else : -# self.ajoutLineEdit(texte) -# indexDernierRempli = indexDernierRempli + 1 -# -# -# def changeValeur(self,changeDePlace=True,oblige=False): -# donneFocus=None -# derniereValeur=None -# self.listeValeursCourantes = [] -# fin=self.indexDernierLabel -# for i in range (1, fin): -# nomLineEdit="lineEditVal"+str(i) -# courant=getattr(self,nomLineEdit) -# valeur=courant.text() -# lval=valeur.split(',') -# if len (lval) > 1 : -# msgBox=QMessageBox() -# msgBox.setText("separator ',' ") -# msgBox.setInformativeText("Do you want to enter " + str (lval) + "?") -# msgBox.setStandardButtons( QMessageBox.Ok | QMessageBox.Cancel) -# msgBox.setDefaultButton(QMessageBox.Ok) -# ret = msgBox.exec_() -# if ret != 1024 : -# courant.setText("") -# return -# courant.setText(lval[0]) -# self.ajoutNValeur(lval[1:]) -# self.listeValeursCourantes = [] -# -# for i in range (1, self.indexDernierLabel+1): -# nomLineEdit="lineEditVal"+str(i) -# courant=getattr(self,nomLineEdit) -# valeur=courant.text() -# if valeur != None and valeur != "" : -# commentaire=self.ajout1Valeur(valeur) -# if (commentaire != None ): -# self.editor.afficheInfos(commentaire,Qt.red) -# courant.setText("") -# donneFocus=courant -# self.reaffiche() -# return -# else : -# self.editor.afficheInfos("") -# elif donneFocus==None : donneFocus=courant -# -# nomDernierLineEdit="lineEditVal"+str(self.indexDernierLabel) -# dernier=getattr(self,nomDernierLineEdit) -# derniereValeur=dernier.text() -# if changeDePlace: -# if donneFocus != None : -# donneFocus.setFocus() -# self.scrollArea.ensureWidgetVisible(donneFocus) -# elif self.indexDernierLabel < self.monSimpDef.max : -# self.ajoutLineEdit() -# if self.listeValeursCourantes == [] : return -# min,max = self.node.item.getMinMax() -# if len(self.listeValeursCourantes) < self.monSimpDef.min : -# self.editor.afficheInfos(tr('nb min de valeurs : ')+str( self.monSimpDef.min)) -# if len(self.listeValeursCourantes) < min and oblige==True: return -# if len(self.listeValeursCourantes) > max : return -# self.node.item.setValeur(self.listeValeursCourantes) -# if len(self.listeValeursCourantes) == self.monSimpDef.max : -# self.editor.afficheInfos(tr('nb max de valeurs atteint')) -# self.setValide() -# self.reaffiche() -# -# -# -## Avertissement quand on quitte le widget diff --git a/InterfaceQT4/qtEficas.py b/InterfaceQT4/qtEficas.py index 7864a01b..c05c0e4d 100755 --- a/InterfaceQT4/qtEficas.py +++ b/InterfaceQT4/qtEficas.py @@ -73,7 +73,7 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow): self.suiteTelemac=False if hasattr (self, 'maConfiguration') : if self.maConfiguration.force_langue : - from InterfaceQt4.monChoixLangue import MonChoixLangue + from InterfaceQT4.monChoixLangue import MonChoixLangue widgetLangue = MonChoixLangue(self) ret=widgetLangue.exec_() self.suiteTelemac=self.maConfiguration.suiteTelemac @@ -162,7 +162,7 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow): self.ssCode=ssCode if self.code==None : self.cleanPath() - from InterfaceQt4.monChoixCode import MonChoixCode + from InterfaceQT4.monChoixCode import MonChoixCode widgetChoix = MonChoixCode(self) #ret=widgetChoix.exec_() widgetChoix.show()