Conformité python

This commit is contained in:
GERALD NICOLAS 2021-01-26 16:54:49 +01:00
parent a37f701f67
commit d6d7f3ffb4
2 changed files with 143 additions and 147 deletions

View File

@ -34,8 +34,8 @@ class fissureCoude_ihm(fissureCoude):
# ---------------------------------------------------------------------------
def setParamGeometrieSaine(self):
"""
Paramètres géométriques du tuyau coudé sain:
"""Paramètres géométriques du tuyau coudé sain:
angleCoude
r_cintr
l_tube_p1
@ -43,26 +43,26 @@ class fissureCoude_ihm(fissureCoude):
epais
de
"""
self.geomParams = dict(angleCoude = self.dico['angle'],
r_cintr = self.dico['rCintr'],
l_tube_p1 = self.dico['lTubeP1'],
l_tube_p2 = self.dico['lTubeP2'],
epais = self.dico['epais'],
self.geomParams = dict(angleCoude = self.dico['angle'], \
r_cintr = self.dico['rCintr'], \
l_tube_p1 = self.dico['lTubeP1'], \
l_tube_p2 = self.dico['lTubeP2'], \
epais = self.dico['epais'], \
de = self.dico['dext'])
# ---------------------------------------------------------------------------
def setParamMaillageSain(self):
self.meshParams = dict(n_long_p1 = self.dico['nbAxeTubeP1'],
n_ep = self.dico['nbEpaisseur'],
n_long_coude = self.dico['nbAxeCoude'],
n_circ_g = self.dico['nbCirconf'],
n_circ_d = self.dico['nbCirconf'],
self.meshParams = dict(n_long_p1 = self.dico['nbAxeTubeP1'], \
n_ep = self.dico['nbEpaisseur'], \
n_long_coude = self.dico['nbAxeCoude'], \
n_circ_g = self.dico['nbCirconf'], \
n_circ_d = self.dico['nbCirconf'], \
n_long_p2 = self.dico['nbAxeTubeP2'])
# ---------------------------------------------------------------------------
def setParamShapeFissure(self):
"""
paramètres de la fissure pour le tuyau coude
"""paramètres de la fissure pour le tuyau coude
profondeur : 0 < profondeur <= épaisseur
rayonPipe : rayon du pipe correspondant au maillage rayonnant
lenSegPipe : longueur des mailles rayonnantes le long du fond de fissure (= rayonPipe par défaut)
@ -76,43 +76,43 @@ class fissureCoude_ihm(fissureCoude):
externe : True : fissure face externe, False : fissure face interne
"""
print("setParamShapeFissure", self.nomCas)
self.shapeFissureParams = dict(profondeur = self.dico['profondeur'],
rayonPipe = self.dico['rayonTore'],
lenSegPipe = self.dico['lenSegPipe'],
azimut = self.dico['azimut'],
alpha = self.dico['posiAngul'],
longueur = self.dico['longueur'],
orientation = self.dico['orientation'],
lgInfluence = self.dico['influence'],
elliptique = self.dico['cbForceEllipse'],
self.shapeFissureParams = dict(profondeur = self.dico['profondeur'], \
rayonPipe = self.dico['rayonTore'], \
lenSegPipe = self.dico['lenSegPipe'], \
azimut = self.dico['azimut'], \
alpha = self.dico['posiAngul'], \
longueur = self.dico['longueur'], \
orientation = self.dico['orientation'], \
lgInfluence = self.dico['influence'], \
elliptique = self.dico['cbForceEllipse'], \
externe = self.dico['rbFissExt'])
# ---------------------------------------------------------------------------
def setParamMaillageFissure(self):
"""
Paramètres du maillage de la fissure pour le tuyau coudé
"""Paramètres du maillage de la fissure pour le tuyau coudé
Voir également setParamShapeFissure, paramètres rayonPipe et lenSegPipe.
nbSegRad = nombre de couronnes
nbSegCercle = nombre de secteurs
areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
"""
self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas,
nomFicFissure = 'fissure_' + self.nomCas,
nbsegRad = self.dico['nbCouronnes'],
nbsegCercle = self.dico['nbSecteurs'],
self.maillageFissureParams = dict(nomRep = os.curdir, \
nomFicSain = self.nomCas, \
nomFicFissure = 'fissure_' + self.nomCas, \
nbsegRad = self.dico['nbCouronnes'], \
nbsegCercle = self.dico['nbSecteurs'], \
areteFaceFissure = self.dico['aretesFaceFissure'])
# ---------------------------------------------------------------------------
def setReferencesMaillageFissure(self):
self.referencesMaillageFissure = dict( \
Entity_Quad_Pyramid = 0,
Entity_Quad_Quadrangle = 0, \
Entity_Quad_Hexa = 0, \
Entity_Node = 0, \
Entity_Quad_Edge = 0, \
Entity_Quad_Triangle = 0, \
Entity_Quad_Tetra = 0, \
Entity_Quad_Pyramid = 0, \
Entity_Quad_Penta = 0 \
)

View File

@ -35,7 +35,6 @@ def fissureCoudeDlg(context):
study = context.study
sg = context.sg
import os
#import subprocess
#import tempfile
from qtsalome import QFileDialog, QMessageBox, QPalette, QColor, QDialog
@ -84,35 +83,35 @@ def fissureCoudeDlg(context):
self.ui.buttonBox.accepted.connect(self.execute)
def initDefaut(self):
self.defaut = dict(
angle = -181.0,
rCintr = 0.0,
lTubeP1 = 0.0,
lTubeP2 = 0.0,
epais = 0.0,
dext = 0.0,
profondeur = 0.0,
longueur = 0.0,
azimut = -181.0,
orientation = -1.0,
posiAngul = -181.0,
absCurv = 0.0,
nbTranches = 7,
nbCouronnes = 1,
nbSecteurs = 3,
cbOptDiscrSain = False,
cbOptDiscrFiss = False,
rbPosiAngul = True,
rbFissExt = True,
cbForceEllipse = False,
nbAxeTubeP1 = 15,
nbAxeTubeP2 = 15,
nbAxeCoude = 10,
nbCirconf = 20,
nbEpaisseur = 3,
rayonTore = 2.0,
aretesFaceFissure = 0.0,
influence = 0.0,
self.defaut = dict( \
angle = -181.0, \
rCintr = 0.0, \
lTubeP1 = 0.0, \
lTubeP2 = 0.0, \
epais = 0.0, \
dext = 0.0, \
profondeur = 0.0, \
longueur = 0.0, \
azimut = -181.0, \
orientation = -1.0, \
posiAngul = -181.0, \
absCurv = 0.0, \
nbTranches = 7, \
nbCouronnes = 1, \
nbSecteurs = 3, \
cbOptDiscrSain = False, \
cbOptDiscrFiss = False, \
rbPosiAngul = True, \
rbFissExt = True, \
cbForceEllipse = False, \
nbAxeTubeP1 = 15, \
nbAxeTubeP2 = 15, \
nbAxeCoude = 10, \
nbCirconf = 20, \
nbEpaisseur = 3, \
rayonTore = 2.0, \
aretesFaceFissure = 0.0, \
influence = 0.0, \
)
def initDialog(self, dico):
@ -222,13 +221,13 @@ def fissureCoudeDlg(context):
else:
self.ui.dsb_orientation.setPalette(self.blackPalette)
if dico['posiAngul'] < -180.0 and dico['rbPosiAngul'] == True:
if ( ( dico['posiAngul'] < -180.0 ) and dico['rbPosiAngul'] ):
self.ui.dsb_posiAngul.setPalette(self.redPalette)
incomplet = True
else:
self.ui.dsb_posiAngul.setPalette(self.blackPalette)
if dico['absCurv'] == 0.0 and dico['rbPosiAngul'] == False:
if ( ( dico['absCurv'] == 0.0 ) and ( not dico['rbPosiAngul'] ) ):
self.ui.dsb_absCurv.setPalette(self.redPalette)
incomplet = True
else:
@ -309,35 +308,35 @@ def fissureCoudeDlg(context):
self.initDialog(dico)
def creeDico(self):
dico = dict(
angle = self.ui.dsb_angle.value(),
rCintr = self.ui.dsb_rCintr.value(),
lTubeP1 = self.ui.dsb_lTubeP1.value(),
lTubeP2 = self.ui.dsb_lTubeP2.value(),
epais = self.ui.dsb_epais.value(),
dext = self.ui.dsb_dext.value(),
profondeur = self.ui.dsb_profondeur.value(),
longueur = self.ui.dsb_longueur.value(),
azimut = self.ui.dsb_azimut.value(),
orientation = self.ui.dsb_orientation.value(),
posiAngul = self.ui.dsb_posiAngul.value(),
absCurv = self.ui.dsb_absCurv.value(),
nbTranches = self.ui.sb_nbTranches.value(),
nbCouronnes = self.ui.sb_nbCouronne.value(),
nbSecteurs = self.ui.sb_nbSecteur.value(),
cbOptDiscrSain = self.ui.cb_optDiscrSain.isChecked(),
cbOptDiscrFiss = self.ui.cb_optDiscrFiss.isChecked(),
rbPosiAngul = self.ui.rb_posiAngul.isChecked(),
rbFissExt = self.ui.rb_fissExt.isChecked(),
cbForceEllipse = self.ui.cb_forceEllipse.isChecked(),
nbAxeTubeP1 = self.ui.sb_nbAxeTubeP1.value(),
nbAxeTubeP2 = self.ui.sb_nbAxeTubeP2.value(),
nbAxeCoude = self.ui.sb_nbAxeCoude.value(),
nbCirconf = self.ui.sb_nbCirconf.value(),
nbEpaisseur = self.ui.sb_nbEpaisseur.value(),
rayonTore = self.ui.dsb_rayonTore.value(),
aretesFaceFissure = self.ui.dsb_aretesFaceFissure.value(),
influence = self.ui.dsb_influence.value(),
dico = dict( \
angle = self.ui.dsb_angle.value(), \
rCintr = self.ui.dsb_rCintr.value(), \
lTubeP1 = self.ui.dsb_lTubeP1.value(), \
lTubeP2 = self.ui.dsb_lTubeP2.value(), \
epais = self.ui.dsb_epais.value(), \
dext = self.ui.dsb_dext.value(), \
profondeur = self.ui.dsb_profondeur.value(), \
longueur = self.ui.dsb_longueur.value(), \
azimut = self.ui.dsb_azimut.value(), \
orientation = self.ui.dsb_orientation.value(), \
posiAngul = self.ui.dsb_posiAngul.value(), \
absCurv = self.ui.dsb_absCurv.value(), \
nbTranches = self.ui.sb_nbTranches.value(), \
nbCouronnes = self.ui.sb_nbCouronne.value(), \
nbSecteurs = self.ui.sb_nbSecteur.value(), \
cbOptDiscrSain = self.ui.cb_optDiscrSain.isChecked(), \
cbOptDiscrFiss = self.ui.cb_optDiscrFiss.isChecked(), \
rbPosiAngul = self.ui.rb_posiAngul.isChecked(), \
rbFissExt = self.ui.rb_fissExt.isChecked(), \
cbForceEllipse = self.ui.cb_forceEllipse.isChecked(), \
nbAxeTubeP1 = self.ui.sb_nbAxeTubeP1.value(), \
nbAxeTubeP2 = self.ui.sb_nbAxeTubeP2.value(), \
nbAxeCoude = self.ui.sb_nbAxeCoude.value(), \
nbCirconf = self.ui.sb_nbCirconf.value(), \
nbEpaisseur = self.ui.sb_nbEpaisseur.value(), \
rayonTore = self.ui.dsb_rayonTore.value(), \
aretesFaceFissure = self.ui.dsb_aretesFaceFissure.value(), \
influence = self.ui.dsb_influence.value(), \
)
print(dico)
return dico
@ -370,10 +369,10 @@ def fissureCoudeDlg(context):
if dico['aretesFaceFissure'] == 0:
dico['aretesFaceFissure'] = (areteMinAngle + areteMinCirco)/2.0
print('aretesFaceFissure', dico['aretesFaceFissure'])
if dico['rbPosiAngul'] == False:
if not dico['rbPosiAngul']:
rmoy = (dico['dext'] - dico['epais'])/2.0
eta = 1
if dico['rbFissExt'] == False:
if not dico['rbFissExt']:
eta = -1
dico['posiAngul'] = (180.0/math.pi)*dico['absCurv']/(dico['rCintr']+(rmoy+eta*dico['epais']/2.0)*math.cos(math.pi*dico['azimut']/180.))
print('posiAngul' , dico['posiAngul'])
@ -386,8 +385,6 @@ def fissureCoudeDlg(context):
self.NOK = NOK
self.accept()
pass
# ----------------------------------------------------------------------------
window = fissureCoudeDialog()
@ -403,5 +400,4 @@ def fissureCoudeDlg(context):
retry = window.checkValues()
else:
print("dialog rejected, exit")
pass