Salome HOME
Update copyrights
[modules/smesh.git] / src / Tools / Verima / Base / tableGroupesRef.py
1 # Copyright (C) 2013-2019  CEA/DEN, EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 from qtsalome import QSqlQuery
21 from Base.tableDeBase import TableDeBase
22
23 class TableGroupesRef (TableDeBase):
24     def __init__(self):
25         TableDeBase.__init__(self,"GroupesRef")
26         self.setField(("nomGroupe","idMaillage"))
27         self.setTypeField(('str','int'),('nomGroupe'))
28
29     def createSqlTable(self):
30         query=QSqlQuery()
31         texteQuery ="create table GroupesRef(nomGroupe varchar(40), idMaillage int,"
32         texteQuery+="foreign key (idMaillage) references Maillages(idMaillage),"
33         texteQuery+="primary key (nomGroupe,idMaillage));"
34         print("Creation de TableGroupesRef : " , query.exec_(texteQuery))
35
36     def getVals(self,idMaillage):
37         query=QSqlQuery()
38         texteQuery ='select NomGroupe from GroupesRef where idMaillage='+str(idMaillage) +";"
39         listeGroupes=[]
40         query.exec_(texteQuery)
41         while (query.next()) :
42             listeGroupes.append(str(query.value(0).toString()))
43         return listeGroupes
44
45
46 #        def remplit(self):
47
48 # Groupe pour le script du tunnel (fiche 7566)
49 #            self.insereLigne(('FRONT_07',1))
50 #            self.insereLigne(('FOND_07',1))
51 #            self.insereLigne(('PAROI_07',1))
52 #            self.insereLigne(('ROCHE_07',1))
53 #            self.insereLigne(('FOND_16',1))
54 #            self.insereLigne(('PAROI_16',1))
55 #            self.insereLigne(('ROCHE_16',1))
56 # Groupe pour le script de l'attache d'une ailette (fiche 7957)
57 #            self.insereLigne(('RAIN_JONC',2))
58 #            self.insereLigne(('EXT_CRAN',2))
59 #            self.insereLigne(('ENV_E',2))
60 #            self.insereLigne(('ENV_I',2))