# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2011-2016 EDF R&D
+# Copyright (C) 2011-2024 CEA, EDF
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
from qtsalome import QIcon, QStandardItemModel, QStandardItem, QMessageBox, pyqtSignal
-from inputframe_ui import Ui_InputFrame
-from inputdata import InputData
+from salome.smesh.spadder.gui.inputframe_ui import Ui_InputFrame
+from salome.smesh.spadder.gui.inputdata import InputData
DEBUG_MODE=True
GROUPNAME_MAXLENGTH=8
GenericDialog.__init__(self, parent, name, modal)
# Set up the user interface from Designer.
self.__ui = Ui_InputFrame()
- # BE CAREFULL HERE, the ui form is NOT drawn in the global
+ # BE CAREFUL HERE, the ui form is NOT drawn in the global
# dialog (already containing some generic widgets) but in the
# center panel created in the GenericDialog as a void
# container for the form. The InputFrame form is supposed
self.__selectedMesh = None
return
- self.smeshStudyTool.updateStudy(studyedit.getActiveStudyId())
+ self.smeshStudyTool.updateStudy()
self.__selectedMesh = self.smeshStudyTool.getMeshObjectFromSObject(mySObject)
if CORBA.is_nil(self.__selectedMesh):
self.__ui.txtSmeshObject.setText("The selected object is not a mesh")
"""
# if the entry already exists, we remove it to replace by a
# new one
- if self.__dictInputFiles.has_key(meshName):
+ if meshName in self.__dictInputFiles:
self.__delInputFromMap(meshName)
inputData = InputData()
else:
self.__nbSteelbarMesh += 1
- print inputData
- print "meshType = ",inputData.meshType
- print "nb concrete mesh ",self.__nbConcreteMesh
- print "nb steelbar mesh ",self.__nbSteelbarMesh
+ print(inputData)
+ print("meshType = ",inputData.meshType)
+ print("nb concrete mesh ",self.__nbConcreteMesh)
+ print("nb steelbar mesh ",self.__nbSteelbarMesh)
def onDeleteInput(self):
else:
self.__nbSteelbarMesh -= 1
- print inputData
- print "nb concrete mesh ",self.__nbConcreteMesh
- print "nb steelbar mesh ",self.__nbSteelbarMesh
+ print(inputData)
+ print("nb concrete mesh ",self.__nbConcreteMesh)
+ print("nb steelbar mesh ",self.__nbSteelbarMesh)
def setData(self, dictInputData={}):
the specified data list.
"""
self.clear()
- if dictInputData.has_key(INPUTDATA_KEY_FILES):
+ if INPUTDATA_KEY_FILES in dictInputData:
listInputData = dictInputData["meshfiles"]
for inputData in listInputData:
- meshName = inputData.meshName
+ meshName = inputData.meshName
meshObject = inputData.meshObject
- meshType = inputData.meshType
- groupName = inputData.groupName
+ meshType = inputData.meshType
+ groupName = inputData.groupName
self.__addInputInGui(meshName, meshObject, meshType, groupName)
self.__addInputInMap(meshName, meshObject, meshType, groupName)
if not DEBUG_MODE:
self.onSelectSmeshObject()
- if dictInputData.has_key(INPUTDATA_KEY_PARAM):
- dictInputParameters = dictInputData[INPUTDATA_KEY_PARAM]
- if dictInputParameters.has_key(PARAM_KEY_NBITER):
+ if INPUTDATA_KEY_PARAM in dictInputData:
+ dictInputParameters = dictInputData[INPUTDATA_KEY_PARAM]
+ if PARAM_KEY_NBITER in dictInputParameters:
self.__ui.txtParamNbIter.setValue(dictInputParameters[PARAM_KEY_NBITER])
- if dictInputParameters.has_key(PARAM_KEY_RMAXRMIN):
- self.__ui.txtParamRmaxRmin.setValue(dictInputParameters[PARAM_KEY_RMAXRMIN])
+ if PARAM_KEY_RMAXRMIN in dictInputParameters:
+ self.__ui.txtParamRminRmax.setValue(dictInputParameters[PARAM_KEY_RMAXRMIN])
def getData(self):
"""
dlg=InputDialog()
dlg.displayAndWait()
if dlg.wasOk():
- print "OK has been pressed"
+ print("OK has been pressed")
def TEST_InputDialog_setData():
import sys
dlg=InputDialog()
- from inputdata import InputData
+ from .inputdata import InputData
inputData = InputData()
inputData.meshName = "myMesh"
inputData.meshObject = None
dlg.displayAndWait()
if dlg.wasOk():
- print "OK has been pressed"
+ print("OK has been pressed")
outputListInputData = dlg.getData2()
- print outputListInputData
+ print(outputListInputData)
if __name__ == "__main__":