# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2011-2012 EDF R&D
+# Copyright (C) 2011-2015 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
from omniORB import CORBA
import SMESH
-import smesh
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
import MESHJOB
gui_states = ["CAN_SELECT", "CAN_COMPUTE", "CAN_REFRESH", "CAN_PUBLISH"]
# The SALOME launcher resource is specified by its name as defined in
# the file CatalogResources.xml (see root directory of the
# application). We could have a check box in the dialog to specify
-# wether we want a local execution or a remote one.
+# whether we want a local execution or a remote one.
resource_name = "localhost"
from salome.smesh.spadder.configreader import ConfigReader
name. This returns the filename.
'''
filename=str("/tmp/padder_inputfile_"+meshName+".med")
- meshObject.ExportToMEDX( filename, 0, SMESH.MED_V2_2, 1 )
+ meshObject.ExportToMEDX( filename, 0, SMESH.MED_V2_2, 1, 1 )
return filename
def clear(self):
self.__jobid = jobManager.initialize(meshJobParameterList, self.__configId)
if self.__jobid < 0:
self.__log("ERR: the job can't be initialized")
+ self.__log("ERR: %s"%jobManager.getLastErrorMessage())
return
self.__log("INF: the job has been initialized with jobid = "+str(self.__jobid))
startOk = jobManager.start(self.__jobid)
if not startOk:
self.__log("ERR: the job with jobid = "+str(self.__jobid)+" can't be started")
+ self.__log("ERR: %s"%jobManager.getLastErrorMessage())
return
self.__log("INF: the job "+str(self.__jobid)+" has been started")
self.__ui.lblStatusBar.setText("Submission OK")
if state not in end_states:
self.__log("ERR: jobid = "+str(self.__jobid)+" ended abnormally with state="+str(state))
+ self.__log("ERR: %s"%jobManager.getLastErrorMessage())
return
meshJobResults = jobManager.finalize(self.__jobid)
- if state == "ERROR":
- self.__log("ERR: jobid = "+str(self.__jobid)+" ended with error: "+meshJobResults.status)
+ logsdirname = os.path.join(meshJobResults.results_dirname, "logs")
+ if state == "ERROR" or meshJobResults.status is not True:
+ msgtemp = "ERR: jobid = %s ended with error: %s"
+ self.__log(msgtemp%(str(self.__jobid),jobManager.getLastErrorMessage()))
+ self.__log("ERR: see log files in %s"%logsdirname)
return
- logsdirname = os.path.join(meshJobResults.results_dirname, "logs")
- self.__log("INF: jobid="+str(self.__jobid)+" ended normally : "+meshJobResults.status)
- self.__log("INF: jobid="+str(self.__jobid)+" see log files in : "+logsdirname)
+ self.__log("INF: jobid=%s ended normally (see log files in %s)"%(str(self.__jobid),logsdirname))
medfilename = os.path.join(meshJobResults.results_dirname,
meshJobResults.outputmesh_filename)