~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to gui/Pages/BoundaryConditionsVelocityInletView.py

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: iso-8859-1 -*-
2
 
#
 
1
# -*- coding: utf-8 -*-
 
2
 
3
3
#-------------------------------------------------------------------------------
4
 
#
5
 
#     This file is part of the Code_Saturne User Interface, element of the
6
 
#     Code_Saturne CFD tool.
7
 
#
8
 
#     Copyright (C) 1998-2009 EDF S.A., France
9
 
#
10
 
#     contact: saturne-support@edf.fr
11
 
#
12
 
#     The Code_Saturne User Interface is free software; you can redistribute it
13
 
#     and/or modify it under the terms of the GNU General Public License
14
 
#     as published by the Free Software Foundation; either version 2 of
15
 
#     the License, or (at your option) any later version.
16
 
#
17
 
#     The Code_Saturne User Interface is distributed in the hope that it will be
18
 
#     useful, but WITHOUT ANY WARRANTY; without even the implied warranty
19
 
#     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 
#     GNU General Public License for more details.
21
 
#
22
 
#     You should have received a copy of the GNU General Public License
23
 
#     along with the Code_Saturne Kernel; if not, write to the
24
 
#     Free Software Foundation, Inc.,
25
 
#     51 Franklin St, Fifth Floor,
26
 
#     Boston, MA  02110-1301  USA
27
 
#
 
4
 
 
5
# This file is part of Code_Saturne, a general-purpose CFD tool.
 
6
#
 
7
# Copyright (C) 1998-2011 EDF S.A.
 
8
#
 
9
# This program is free software; you can redistribute it and/or modify it under
 
10
# the terms of the GNU General Public License as published by the Free Software
 
11
# Foundation; either version 2 of the License, or (at your option) any later
 
12
# version.
 
13
#
 
14
# This program is distributed in the hope that it will be useful, but WITHOUT
 
15
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
16
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
17
# details.
 
18
#
 
19
# You should have received a copy of the GNU General Public License along with
 
20
# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
 
21
# Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
22
 
28
23
#-------------------------------------------------------------------------------
29
24
 
30
25
"""
45
40
from PyQt4.QtCore import *
46
41
from PyQt4.QtGui  import *
47
42
 
48
 
try:
49
 
    import mei
50
 
    _have_mei = True
51
 
except:
52
 
    _have_mei = False
53
 
 
54
43
#-------------------------------------------------------------------------------
55
44
# Application modules import
56
45
#-------------------------------------------------------------------------------
61
50
from Base.QtPage import DoubleValidator, ComboModel, setGreenColor
62
51
from Pages.LocalizationModel import LocalizationModel, Zone
63
52
from Pages.Boundary import Boundary
64
 
if _have_mei:
65
 
    from QMeiEditorView import QMeiEditorView
 
53
 
 
54
from Pages.QMeiEditorView import QMeiEditorView
66
55
 
67
56
#-------------------------------------------------------------------------------
68
57
# log config
132
121
        self.lineEditDirectionY.setValidator(validatorY)
133
122
        self.lineEditDirectionZ.setValidator(validatorZ)
134
123
 
135
 
        if _have_mei:
136
 
            self.connect(self.pushButtonVelocityFormula, SIGNAL("clicked()"), self.__slotVelocityFormula)
137
 
            self.connect(self.pushButtonDirectionFormula, SIGNAL("clicked()"), self.__slotDirectionFormula)
138
 
        else:
139
 
            self.pushButtonVelocityFormula.setEnabled(False)
140
 
            self.pushButtonDirectionFormula.setEnabled(False)
141
 
            self.modelVelocity.disableItem(str_model="norm_formula")
142
 
            self.modelVelocity.disableItem(str_model="flow1_formula")
143
 
            self.modelVelocity.disableItem(str_model="flow2_formula")
144
 
            self.modelDirection.disableItem(str_model="formula")
 
124
        self.connect(self.pushButtonVelocityFormula, SIGNAL("clicked()"), self.__slotVelocityFormula)
 
125
        self.connect(self.pushButtonDirectionFormula, SIGNAL("clicked()"), self.__slotDirectionFormula)
145
126
 
146
127
 
147
128
    def showWidget(self, boundary):
155
136
        self.modelVelocity.setItem(str_model=choice)
156
137
        self.__updateLabel()
157
138
 
158
 
        if not _have_mei:
159
 
            if self.__boundary.getVelocityChoice()[-7:] == "formula":
160
 
                c = self.__boundary.defaultValues()['velocityChoice']
161
 
                self.__boundary.setVelocityChoice(c)
162
 
            if self.__boundary.getDirectionChoice() == "formula":
163
 
                c = self.__boundary.defaultValues()['directionChoice']
164
 
                self.__boundary.setDirectionChoice(c)
165
 
 
166
139
        if choice[-7:] == "formula":
167
140
            self.pushButtonVelocityFormula.setEnabled(True)
168
141
            self.lineEditVelocity.setEnabled(False)