diff --git a/src/Meshing/Mage.py b/src/Meshing/Mage.py index 6150e59c..bd60ed1c 100644 --- a/src/Meshing/Mage.py +++ b/src/Meshing/Mage.py @@ -294,7 +294,7 @@ class MeshingWithMageMailleurTT(AMeshingTool): proc = QProcess() proc.setWorkingDirectory(tmp) - logger.debug(f"! mailleurTT {st_file} {m_file} {str(step)}") + logger.info(f"! mailleurTT {st_file} {m_file} {str(step)}") proc.start( self._exe_path(), [st_file, m_file, str(step)] ) diff --git a/src/View/Geometry/UndoCommand.py b/src/View/Geometry/UndoCommand.py index 86f3d3ea..aafd2b50 100644 --- a/src/View/Geometry/UndoCommand.py +++ b/src/View/Geometry/UndoCommand.py @@ -237,7 +237,10 @@ class MeshingCommand(QUndoCommand): def redo(self): if self._new_profiles is None: - self._mesher.meshing(self._reach) + self._mesher.meshing( + self._reach, + step=self._step + ) self._new_profiles = self._reach.profiles.copy() self._new_profiles.reverse() diff --git a/src/View/Geometry/Window.py b/src/View/Geometry/Window.py index b69531bd..7c35818e 100644 --- a/src/View/Geometry/Window.py +++ b/src/View/Geometry/Window.py @@ -54,6 +54,7 @@ from View.Geometry.Table import GeometryReachTableModel from View.Geometry.PlotXY import PlotXY from View.Geometry.PlotAC import PlotAC from View.Geometry.PlotKPZ import PlotKPZ +from View.Geometry.MeshingDialog import MeshingDialog from View.Geometry.Translate import GeometryTranslate from View.Geometry.Profile.Window import ProfileWindow @@ -260,14 +261,17 @@ class GeometryWindow(PamhyrWindow): def edit_meshing(self): try: - self._edit_meshing() - except Exception: + dlg = MeshingDialog(parent=self) + if dlg.exec(): + step = dlg.space_step + self._edit_meshing(step) + except Exception as e: return - def _edit_meshing(self): + def _edit_meshing(self, step): try: mesher = MeshingWithMageMailleurTT() - self._table.meshing(mesher, -1) + self._table.meshing(mesher, step) except Exception as e: logger_exception(e) raise ExternFileMissingError( diff --git a/src/View/Tools/ASubWindow.py b/src/View/Tools/ASubWindow.py index 7ef5f964..b0eee20c 100644 --- a/src/View/Tools/ASubWindow.py +++ b/src/View/Tools/ASubWindow.py @@ -35,7 +35,7 @@ from PyQt5.QtWidgets import ( QRadioButton, QComboBox, QFileDialog, QMessageBox, QTableView, QAction, QDateTimeEdit, QWidget, QPlainTextEdit, - QLabel, + QLabel, QDoubleSpinBox, ) from PyQt5.QtCore import ( QTime, QDateTime, @@ -324,6 +324,29 @@ class ASubWindowFeatures(object): """ return self.find(QSpinBox, name).value() + def set_double_spin_box(self, name: str, value: int): + """Set value of spinbox component + + Args: + name: The spinbox component name + value: The new value + + Returns: + Nothing + """ + self.find(QDoubleSpinBox, name).setValue(value) + + def get_double_spin_box(self, name: str): + """Get time of spin box component + + Args: + name: The spin box component + + Returns: + The value of spin box + """ + return self.find(QDoubleSpinBox, name).value() + def set_action_checkable(self, name: str, checked: bool): """Set value of action diff --git a/src/View/ui/MeshingOptions.ui b/src/View/ui/MeshingOptions.ui new file mode 100644 index 00000000..315a171e --- /dev/null +++ b/src/View/ui/MeshingOptions.ui @@ -0,0 +1,237 @@ + + + Dialog + + + + 0 + 0 + 416 + 234 + + + + Dialog + + + + + + + + + + false + + + First cross section + + + + + + + false + + + + + + + + + + + false + + + Last cross section + + + + + + + false + + + + + + + + + + + + + + + false + + + First guide line + + + + + + + false + + + + + + + + + + + false + + + Last guide line + + + + + + + false + + + + + + + + + + + + + Section space step + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + false + + + lm + + + + + + + false + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + false + + + Lplan + + + + + + + false + + + Linear + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + Dialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +