act = sgPyQt.createAction(\
GUIcontext.CHECK_BOUNDARY_CONDITIONS_ID,
- "check boundary conditions",
- "check boundary conditions",
+ "Check boundary conditions",
+ "Check boundary conditions",
"display a graph with boundary conditions on the mesh",
"check_boundary_conditions.png")
sgPyQt.createMenu(act, mid)
self.rb_liqbcd.setChecked(True)
self.rb_allbcd.setChecked(False)
self.liqbcd = True
-
+
def on_med_file_browse(self):
"""
Select MED file
if not self.medFile:
return
self.le_medFile.setText(self.medFile)
-
+
def on_bcd_file_browse(self):
"""
Select bcd file
if not self.bcdFile:
return
self.le_bcdFile.setText(self.bcdFile)
-
+
def on_liqbcd(self):
"""
switch type of display
self.liqbcd = True
else:
self.liqbcd = False
-
+
def on_help(self):
"""
display a help message
<h2>Display boundarycondition dialog</h2>
This dialog is used to draw the mesh with colored boundary conditions on nodes.
- <br><br>
+ <br><br>
The boundary condition file (bcd) associates a type of boundary condition to each concerned group in the mesh.
- <br>
- The option "Liquid /solid boundaries" allows to distinguish all the differents boundary condition groups
- <br>
+ <br>
+ The option "Liquid /solid boundaries" allows to distinguish all the differents boundary condition groups
+ <br>
The option "All boundaries by Telemac type" allows to distinguish all the types of boundary conditions.
- <br><br>
+ <br><br>
The drawing computation Is launch in a separate process, without waiting.
It may be long, for a big mesh...
"""
QMessageBox.about(self, self.tr("About change coordinates dialog"), msg);
-
-
+
+
def on_accept(self):
print("accept")
#TODO check medfile in and out not empty
msgBox.setText( "Boundary condition file does not exist" )
msgBox.exec_()
return
- option = "--bnd"
+ bnd = True
+ liq_bnd = False
if self.liqbcd:
- option = "--liq-bnd"
- cmd = ["plot.py", "mesh2d", medFile, "-b", bcdFile, option]
- try:
- proc = subprocess.Popen(cmd)
- except OSError:
- print("invalid command")
- QMessageBox.critical(self, "command error", "%s is not found" % cmd[0])
+ bnd = False
+ liq_bnd = True
+ from postel.plot_actions import plot_mesh2d
+ from data_manip.extraction.telemac_file import TelemacFile
+
+ res = TelemacFile(medFile, bnd_file=bcdFile)
+ plot_mesh2d(res, display_bnd=bnd, display_liq_bnd=liq_bnd)
+ res.close()
self.accept()
-
+
def on_reject(self):
print("reject")
self.reject()
-
+
def execDialog(context):
print("execDialog")
study = context.study
sg = context.sg
dlg = checkBoundariesDialog()
- dlg.exec_()
+ dlg.exec_()