Salome HOME
dialogue change coordinates
authorPaul RASCLE <paul.rascle@openfields.fr>
Fri, 14 Aug 2020 22:24:34 +0000 (00:24 +0200)
committerYOANN AUDOUIN <B61570@dsp0851742.postes.calibre.edf.fr>
Fri, 30 Oct 2020 16:04:18 +0000 (17:04 +0100)
src/HYDROGUI/HYDROSOLVERGUI.py
src/salome_hydro/CMakeLists.txt
src/salome_hydro/changeCoords.ui [new file with mode: 0644]
src/salome_hydro/changeCoordsDialog.py [new file with mode: 0644]

index 6facd594ce16dc68f7f9ef8b49b111ab7e48f22b..d80a6c5d782516b9ec1a2a07a8b12d7ce0148817 100755 (executable)
@@ -36,6 +36,7 @@ import HYDROSOLVER_ORB
 
 from salome.hydro.interpolz_gui import InterpolzDlg
 from salome.hydro.assignStrickler_gui import assignStricklerDlg
+from salome.hydro.changeCoordsDialog import changeCoordsDialog 
 from salome.hydro.gui_utils import HSGUIException, wait_cursor, \
                                    get_and_check_selected_file_path
 import salome.hydro.study as hydro_study
@@ -84,6 +85,8 @@ class GUIcontext:
     EDIT_PARAM_STUDY_ID = 964
     GEN_PARAM_STUDY_PYTHON_ID = 965
     GEN_PARAM_STUDY_YACS_ID = 966
+    
+    CHANGECOORDS_PY_ID = 967
 
     def __init__(self):
         # create top-level menu
@@ -92,6 +95,15 @@ class GUIcontext:
         # create toolbar
         tid = sgPyQt.createTool("Hydro")
         # create actions and fill menu and toolbar with actions
+        act = sgPyQt.createAction(\
+                GUIcontext.CHANGECOORDS_PY_ID,
+                "Change coordinates",
+                "Change coordinates",
+                "Change mesh coordinates",
+                "generate_interpolz_py.png")
+        sgPyQt.createMenu(act, mid)
+        sgPyQt.createTool(act, tid)
+
         act = sgPyQt.createAction(\
                 GUIcontext.GENERATE_INTERPOLZ_PY_ID,
                 "Generate interpolz.py",
@@ -483,6 +495,11 @@ def generate_assignStrickler_py():
     dlg = assignStricklerDlg(desktop)
     dlg.show()
 
+def changeCoords_py():
+    desktop = sgPyQt.getDesktop()
+    dlg = changeCoordsDialog(desktop)
+    dlg.show()
+    
 ###
 # Open dialog for boundary conditions edition
 ###
@@ -518,6 +535,7 @@ dict_command = {
     GUIcontext.EDIT_TELMA_CAS_ID: edit_telma_cas,
     GUIcontext.GENERATE_INTERPOLZ_PY_ID: generate_interpolz_py,
     GUIcontext.GENERATE_ASSIGNSTRICKLER_PY_ID: generate_assignStrickler_py,
+    GUIcontext.CHANGECOORDS_PY_ID: changeCoords_py, 
     GUIcontext.EDIT_LIQUID_BOUNDARY_FILE_ID: edit_liquid_boundary_file,
     GUIcontext.EDIT_BOUNDARY_CONDITIONS_FILE_ID: edit_boundary_conditions_file,
     GUIcontext.EDIT_BREACHES_FILE_ID: edit_breaches_file,
index f0b8cd921b243886d427c7eab25c7a9619a0677e..a8fdfdff96bdfd3dd96bfe947541853e5d81e531 100644 (file)
@@ -29,11 +29,13 @@ SET(PYFILES
   generate_interpolz.py
   assignStrickler_gui.py
   interpolz_gui.py
+  changeCoordsDialog.py
 )
 
 SET(UIFILES
   assignStrickler.ui
   interpolz.ui
+  changeCoords.ui
 )
 
 SET(TEMPLFILES
diff --git a/src/salome_hydro/changeCoords.ui b/src/salome_hydro/changeCoords.ui
new file mode 100644 (file)
index 0000000..1216cd9
--- /dev/null
@@ -0,0 +1,488 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>704</width>
+    <height>459</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Change Coordinates</string>
+  </property>
+  <property name="layoutDirection">
+   <enum>Qt::LeftToRight</enum>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_3">
+   <item>
+    <widget class="QCheckBox" name="cb_changeCoordSystem">
+     <property name="text">
+      <string>Change coordinates system</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBoxIn">
+     <property name="title">
+      <string>Input</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout">
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_2">
+        <item>
+         <widget class="QLabel" name="lb_medFileIn">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>MED file</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="le_medFileIn"/>
+        </item>
+        <item>
+         <widget class="QToolButton" name="pb_medFileIn">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>...</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QGridLayout" name="gridLayout">
+        <item row="0" column="0">
+         <widget class="QLabel" name="lb_offsetXin">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Offset X</string>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="1">
+         <widget class="QDoubleSpinBox" name="dsb_offsetXin">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="toolTip">
+           <string>X coordinate of origin of input mesh</string>
+          </property>
+          <property name="layoutDirection">
+           <enum>Qt::LeftToRight</enum>
+          </property>
+          <property name="decimals">
+           <number>0</number>
+          </property>
+          <property name="minimum">
+           <double>-10000000.000000000000000</double>
+          </property>
+          <property name="maximum">
+           <double>10000000.000000000000000</double>
+          </property>
+          <property name="singleStep">
+           <double>10000.000000000000000</double>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="2">
+         <spacer name="horizontalSpacer_2">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item row="1" column="0">
+         <widget class="QLabel" name="lb_offsetYin">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Offset Y</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="1">
+         <widget class="QDoubleSpinBox" name="dsb_offsetYin">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="toolTip">
+           <string>Y coordinate of origin of input mesh</string>
+          </property>
+          <property name="decimals">
+           <number>0</number>
+          </property>
+          <property name="minimum">
+           <double>-10000000.000000000000000</double>
+          </property>
+          <property name="maximum">
+           <double>10000000.000000000000000</double>
+          </property>
+          <property name="singleStep">
+           <double>10000.000000000000000</double>
+          </property>
+          <property name="stepType">
+           <enum>QAbstractSpinBox::DefaultStepType</enum>
+          </property>
+          <property name="value">
+           <double>0.000000000000000</double>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="2">
+         <spacer name="horizontalSpacer_3">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_4">
+        <item>
+         <widget class="QLabel" name="label">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Coord System</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="cmb_systemIn">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBoxOut">
+     <property name="title">
+      <string>Output</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_2">
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_3">
+        <item>
+         <widget class="QLabel" name="lb_medFileOut">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>MED File</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="le_medFileOut">
+          <property name="statusTip">
+           <string>directory to store shapefiles and output mesh file if kept</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QToolButton" name="pb_medFileOut">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>...</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QGridLayout" name="gridLayout_2">
+        <item row="0" column="0">
+         <widget class="QLabel" name="lb_offsetXout">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Offset X</string>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="1">
+         <widget class="QDoubleSpinBox" name="dsb_offsetXout">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="toolTip">
+           <string>X coordinate of origin of input mesh</string>
+          </property>
+          <property name="layoutDirection">
+           <enum>Qt::LeftToRight</enum>
+          </property>
+          <property name="decimals">
+           <number>0</number>
+          </property>
+          <property name="minimum">
+           <double>-10000000.000000000000000</double>
+          </property>
+          <property name="maximum">
+           <double>10000000.000000000000000</double>
+          </property>
+          <property name="singleStep">
+           <double>10000.000000000000000</double>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="2">
+         <spacer name="horizontalSpacer_4">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item row="1" column="0">
+         <widget class="QLabel" name="lb_offsetYout">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Offset Y</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="1">
+         <widget class="QDoubleSpinBox" name="dsb_offsetYout">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="toolTip">
+           <string>Y coordinate of origin of input mesh</string>
+          </property>
+          <property name="decimals">
+           <number>0</number>
+          </property>
+          <property name="minimum">
+           <double>-10000000.000000000000000</double>
+          </property>
+          <property name="maximum">
+           <double>10000000.000000000000000</double>
+          </property>
+          <property name="singleStep">
+           <double>10000.000000000000000</double>
+          </property>
+          <property name="stepType">
+           <enum>QAbstractSpinBox::DefaultStepType</enum>
+          </property>
+          <property name="value">
+           <double>0.000000000000000</double>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="2">
+         <spacer name="horizontalSpacer_5">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_5">
+        <item>
+         <widget class="QLabel" name="label_2">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Coord System</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="cmb_systemOut"/>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>66</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QDialogButtonBox" name="pb_ok">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="standardButtons">
+        <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pb_help">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>Help</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>cb_changeCoordSystem</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>cmb_systemIn</receiver>
+   <slot>setVisible(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>348</x>
+     <y>20</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>348</x>
+     <y>181</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>cb_changeCoordSystem</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>cmb_systemOut</receiver>
+   <slot>setVisible(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>348</x>
+     <y>20</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>348</x>
+     <y>355</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
diff --git a/src/salome_hydro/changeCoordsDialog.py b/src/salome_hydro/changeCoordsDialog.py
new file mode 100644 (file)
index 0000000..177a1c7
--- /dev/null
@@ -0,0 +1,179 @@
+#  Copyright (C) 2012-2013 EDF
+#
+#  This file is part of SALOME HYDRO module.
+#
+#  SALOME HYDRO module is free software: you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation, either version 3 of the License, or
+#  (at your option) any later version.
+#
+#  SALOME HYDRO module is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with SALOME HYDRO module.  If not, see <http://www.gnu.org/licenses/>.
+
+import os
+import sys
+
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
+from PyQt5.QtWidgets import *
+from PyQt5 import uic
+
+import pyproj
+from pyproj import CRS
+
+from salome.hydrotools.changeCoords import changeCoords
+
+import sysconfig
+pythonVersion = 'python' + sysconfig.get_python_version()
+hydro_solver_root = os.path.join(os.environ['HYDROSOLVER_ROOT_DIR'], 'lib', pythonVersion, 'site-packages', 'salome', 'salome', 'hydro')
+
+class changeCoordsDialog(QDialog):
+    """
+    """
+
+    def __init__(self, parent = None, modal = 0):
+        QDialog.__init__(self, parent)
+        uic.loadUi(os.path.join(hydro_solver_root, 'changeCoords.ui'), self )
+
+        # Connections
+        self.pb_medFileIn.clicked.connect(self.on_med_file_in_browse)
+        self.pb_medFileOut.clicked.connect(self.on_med_file_out_browse)
+        self.pb_help.clicked.connect(self.on_help)
+        self.pb_ok.accepted.connect(self.on_accept)
+        self.pb_ok.rejected.connect(self.on_reject)
+        self.medFileIn = None
+        self.medFileOut = None
+        EPSG_list = (2154, 27561, 27562, 27563, 27564, 27571, 27572, 27573, 27574 )
+        for epsg in EPSG_list:
+            crs_code = CRS.from_epsg(epsg)
+            codeName = str(epsg) + ' ' + crs_code.name
+            self.cmb_systemIn.addItem(codeName)
+            self.cmb_systemOut.addItem(codeName)
+        self.cb_changeCoordSystem.setChecked(True)
+        self.cb_changeCoordSystem.setChecked(False)
+        
+    def on_med_file_in_browse(self):
+        """
+        Select input MED file
+        """
+        print("on_med_file_in_browse")
+        self.medFileIn, filt = QFileDialog.getOpenFileName(self, self.tr("Input MED file"), "", self.tr("MED files (*.med)"))
+        print(self.medFileIn)
+        if not self.medFileIn:
+            return
+        self.le_medFileIn.setText(self.medFileIn)
+        a = os.path.splitext(self.medFileIn)
+        self.medFileOut = a[0] + '_coo' + a[1]
+        self.le_medFileOut.setText(self.medFileOut)
+        
+    def on_med_file_out_browse(self):
+        """
+        Select output MED file
+        """
+        print("on_med_file_out_browse")
+        self.medFileOut, filt = QFileDialog.getSaveFileName(self, self.tr("Output MED file"), "", self.tr("MED files (*.med)"))
+        print(self.medFileOut)
+        if not self.medFileOut:
+            return
+        self.le_medFileOut.setText(self.medFileOut)
+        
+    def on_help(self):
+        """
+        display a help message
+        """
+        msg = """
+        <h2>Change mesh coordinates dialog</h2>
+
+        This dialog is used to change the nodes coordinates in a mesh. It is used either for a simple translation, a change of coordinates system
+        (for instance from Lambert II to Lambert-93), or a combination.
+        <br><br>        
+        The modified mesh is saved in a new file.
+        <br> 
+        If there is a change of coordinates system, the input mesh is first translated, when it uses a local origin.
+        After the change of coordinates system, the output mesh can be translated (new local origin).
+        <br>     
+        When there is only a simple translation, the operation is: Xout = Xin + offsetXin -offsetXout, Yout = Yin + offsetYin -offsetYout.
+        <br><br>         
+        Below is the description of the dialog controls.
+
+        <h3>Change coordinates system</h3>
+        If this checkbox is checked, the output mesh will be removed after calculation of the shapes.
+
+        <h3>Input MED file</h3>
+        This field allows the selection of a med file (via the standard file open dialog).
+        The filling of this field is mandatory.
+        
+        <h3>Input offsetX, offsetY</h3>
+        These fields are used to set the Origin of the local coordinates system of the input mesh, if any. 
+
+        <h3>Input Coord System</h3>
+        This combo box is use to select the coordinate system of the input mesh. 
+
+        <h3>Output MED file</h3>
+        This field allows the definition of a med file (via the standard file save dialog).
+        The filling of this field is mandatory.
+        
+        <h3>Output offsetX, offsetY</h3>
+        These fields are used to set the Origin of the local coordinates system of the output mesh, if any. 
+
+        <h3>Output Coord System</h3>
+        This combo box is use to select the coordinate system of the output mesh. 
+        """
+        QMessageBox.about(self, self.tr("About mesh edges to shapes dialog"), msg);
+       
+   
+    def on_accept(self):
+        print("accept")
+        #TODO check medfile in and out not empty
+        #TODO preset for medFileOut
+        medFileIn = self.le_medFileIn.text()
+        medFileOut = self.le_medFileOut.text()
+        offsetXin = self.dsb_offsetXin.value()
+        offsetYin = self.dsb_offsetYin.value()
+        offsetXout = self.dsb_offsetXout.value()
+        offsetYout = self.dsb_offsetYout.value()
+        isChangeCoordSystem = self.cb_changeCoordSystem.isChecked()
+        epsgIn = 2154
+        epsgOut = 2154
+        if isChangeCoordSystem:
+            epsgIn = int(self.cmb_systemIn.currentText().split()[0])
+            epsgOut = int(self.cmb_systemOut.currentText().split()[0])
+        print(medFileIn)
+        print(medFileOut)
+        print(isChangeCoordSystem)
+        print(offsetXin, offsetYin)
+        print(offsetXout, offsetYout)
+        print(epsgIn, epsgOut)
+        if not os.path.isfile(medFileIn):
+            msgBox = QMessageBox()
+            msgBox.setText( "Input MED file does not exist" )
+            msgBox.exec_()
+            return
+        dir = os.path.dirname(medFileOut)
+        base = os.path.basename(medFileOut)
+        ext = os.path.splitext(medFileOut)[1]
+        if not os.path.isdir(dir) or (base == "") or (ext.lower() != ".med"):
+            msgBox = QMessageBox()
+            msgBox.setText( "Output MED file is not a valid path" )
+            msgBox.exec_()
+            return
+        self.accept()
+        changeCoords(medFileIn, medFileOut, epsgIn, epsgOut, offsetXin, offsetYin, offsetXout, offsetYout)
+
+    def on_reject(self):
+        print("reject")
+        self.reject()
+        
+
+def execDialog(context):
+    print("execDialog")
+  # get context study, salomeGui
+    study = context.study
+    sg = context.sg
+    dlg = changeCoordsDialog()
+    dlg.exec_()