import os
import logging
-from PyQt4 import QtCore, QtGui
+from PyQt5 import QtCore, QtGui, QtWidgets
import salome
import SALOME
def CreateCase():
logger.debug("GENERICSOLVERGUI.CreateCase : enter")
default_case_name = str( sgPyQt.stringSetting( "GENERICSOLVER", "def_case_name",
- GUIcontext.DEFAULT_CASE_NAME ).trimmed() )
+ GUIcontext.DEFAULT_CASE_NAME ).strip() )
global __id__
try:
if sgPyQt.action( GUIcontext.OPTION_3_ID ).isChecked():
name, ok = QtGui.QInputDialog.getText(sgPyQt.getDesktop(),
"Create case",
"Enter case name:",
- QtGui.QLineEdit.Normal,
+ QtWidgets.QLineEdit.Normal,
default_case_name )
if not ok: return
- name = str( name.trimmed() )
+ name = str( name.strip() )
elif sgPyQt.action( GUIcontext.OPTION_2_ID ).isChecked():
# generate object name
__id__ = __id__ + 1
ed.setAttributeValue(varL, "AttributeReal", 1.5)
varI = ed.createItem(case, "I", typeId = GUIcontext.VARIABLE_ID)
ed.setAttributeValue(varI, "AttributeReal", 2.e-6)
-
+
inputVarList = [study_exchange_vars.Variable("E"),
study_exchange_vars.Variable("F"),
study_exchange_vars.Variable("L"),
error = exc.details.text
solver_engine.Finalize()
-
+
if error is not None:
QtGui.QMessageBox.critical(sgPyQt.getDesktop(), "Error", error)
elif param_output.returnCode != 0:
sobj = ed.study.FindObjectID(entry)
assert sobj
oldvalue = ed.getAttributeValue(sobj, "AttributeReal", 0.0)
- name, ok = QtGui.QInputDialog.getText(sgPyQt.getDesktop(),
+ name, ok = QtWidgets.QInputDialog.getText(sgPyQt.getDesktop(),
"Set a value",
"Enter new value:",
- QtGui.QLineEdit.Normal,
+ QtWidgets.QLineEdit.Normal,
str(oldvalue) )
- value = float( name.trimmed() )
+ value = float( name.strip() )
if not ok or not value: return
ed.setAttributeValue(sobj, "AttributeReal", value)
salome.sg.updateObjBrowser(0)