Example #1
0
    def __init__(self, _strPluginName=None, _strConfigurationFileName=None, _ccp4DataInputControlPipelineCalcDiffMap=None):
        """
        @param _strPluginName: name of control plugin to load
        @type  _strPluginName: string
        @param _strConfigurationFileName: the configuration file to use  
        @type _strConfigurationFileName: string
        @param _ccp4DataInputControlPipelineCalcDiffMap: the input object to use  
        @type _ccp4DataInputControlPipelineCalcDiffMap: CCP4DataInputControlPipelineCalcDiffMap
        """
        EDApplication.__init__(self, _strName=EDApplicationDimplev0.APPLICATION_NAME, \
                                _strVersion=EDApplicationDimplev0.APPLICATION_VERSION, \
                                _strPluginName=_strPluginName, \
                                _strConfigurationFileName=_strConfigurationFileName)
        
        self.colLabelI = None
        self.colLabelSIGI = None

        self.strPDBIn = None
        self.strPDBOut = None
        self.strMTZIn = None
        self.strMTZOut = None

        self.inputXMLFile = None
        self.inputXMLFileName = None

        self.ccp4DataInputControlPipelineCalcDiffMap = _ccp4DataInputControlPipelineCalcDiffMap
        self.strPluginName = _strPluginName
        self.strDatasetFileName = None

        self.xsDataOutput = None
    def configure(self):
        """
        
        Configuration step of the plugin: mainly extend the timeout by 5 seconds to let the plugin finish. 

        """
        self.DEBUG("EDPluginWaitFile.configure : %s" % self.getClassName())
        xsPluginItem = self.getConfiguration()
        if xsPluginItem is None:
            xsPluginItem = EDApplication.getApplicationPluginConfiguration(self.getPluginName())
            if (xsPluginItem is None):
                # No application wide configuration file found! Try to find a project specific config file:
                xsPluginItem = EDApplication.getProjectPluginConfiguration(self.getPluginName())

            if (xsPluginItem is None):
                self.DEBUG("EDPlugin.execute: No plugin configuration found for " + self.getPluginName())
                xsPluginItem = XSPluginItem()
            else:
                self.setConfiguration(xsPluginItem)
        # Try to get time out from plugin configuration
        iTimeOut = EDConfiguration.getIntegerParamValue(xsPluginItem, EDPlugin.CONF_TIME_OUT)
        if iTimeOut is not None:
            self.DEBUG("EDPlugin.configure: Setting time out to %d s from plugin configuration." % iTimeOut)
            self.__timeout = iTimeOut
            self.setTimeOut(iTimeOut + EDPluginWaitFile.EXTRA_TIME)
    def __init__(self, _strTestName=None):
        EDTestCasePluginExecute.__init__(self, _strTestName)
        self.setConfigurationFile(self.getRefConfigFile())
        edPluginMOSFLM = self.createPlugin()
        xsPluginItem = edPluginMOSFLM.getConfiguration()
        if xsPluginItem is None:
            xsPluginItem = EDApplication.getApplicationPluginConfiguration(self.getPluginName())
            if xsPluginItem is None:
                # No application wide configuration file found! Try to find a project specific config file:
                xsPluginItem = EDApplication.getProjectPluginConfiguration(self.getPluginName())

            if xsPluginItem is None:
                EDVerbose.DEBUG("EDPlugin.configure: No plugin configuration found for " + self.getPluginName())
                xsPluginItem = XSPluginItem()
            else:
                edPluginMOSFLM.setConfiguration(xsPluginItem)
        # edPluginMOSFLM.configure()
        strMOSFLMVersion = edPluginMOSFLM.getStringConfigurationParameterValue("execProcessScriptVersionString")
        if strMOSFLMVersion.find("7.0.1") != -1:
            strResultDir = "executionTestResult_v701_20070820"
        elif strMOSFLMVersion.find("7.0.5") != -1:
            strResultDir = "executionTestResult_v706_20090812"
        elif strMOSFLMVersion.find("7.0.6") != -1:
            strResultDir = "executionTestResult_v706_20100126"
        else:
            strResultDir = "executionTestResult_v707_20101220"
        strPluginTestDataHome = self.getPluginTestsDataHome()
        self.strExecutionTestDataInputHome = os.path.join(strPluginTestDataHome, "executionTestInput")
        self.strExecutionTestDataResultHome = os.path.join(strPluginTestDataHome, strResultDir)
 def __init__(self, _strPluginName=None, _strConfigurationFileName=None):
     """
     @param _strPluginName: name of control plugin to load
     @type  _strPluginName: string
     @param _strConfigurationFileName: the configuration file to use  
     @type _strConfigurationFileName: string
     """
     EDApplication.__init__(self, _strName=EDApplicationSASPipeline.APPLICATION_NAME, \
                             _strVersion=EDApplicationSASPipeline.APPLICATION_VERSION, \
                             _strPluginName=_strPluginName, \
                             _strConfigurationFileName=_strConfigurationFileName)
     self.__strDatasetFileName = None
     self.__strNxsQ = None
     self.__strNxsData = None
     self.__strDatasetFileName = None
     self.__bProcess = True
     self.__strPluginName = None
     self.__strDataInputFilePath = None
     self.__fRMaxStart = 10.0
     self.__fRMaxStop = 200.0
     self.__iRMaxIntervals = 10
     self.__fRMaxAbsTol = 0.1
     
     self.__strMode = "Fast"
     self.__strSymmetry = "P1"
     self.__bOnlyGnom = False
     self.__bPlotFit = False
     self.__iThreads = None
     self.__iUnit = 1
     self.__iColumns = 1
     self.__fQMin = None
     self.__fQMax = None
 def __init__(self, _strPluginName=None, _strConfigurationFileName=None, _bUseWSGI=False):
     """
     @param _strPluginName: name of control plugin to load
     @type  _strPluginName: string
     @param _strConfigurationFileName: the configuration file to use  
     @type _strConfigurationFileName: string
     """
     EDApplication.__init__(self, _strName=EDApplicationXAFSBatchProcessing.APPLICATION_NAME, \
                             _strVersion=EDApplicationXAFSBatchProcessing.APPLICATION_VERSION, \
                             _strPluginName=_strPluginName, \
                             _strConfigurationFileName=_strConfigurationFileName)
     self.__strDatasetFileName = None
     self.__strDataInputFilePath = None
     
     self.__strNxsEnergy = '/entry1/counterTimer01/Energy'
     self.__strNxsI0 = '/entry1/counterTimer01/I0'
     self.__strNxsIref = '/entry1/counterTimer01/Iref'
     self.__strNxsIt = '/entry1/counterTimer01/It'
     self.__strNxsTime = '/entry1/counterTimer01/Time'
     self.__strNxsLnI0Iref = '/entry1/counterTimer01/lnI0Iref'
     self.__strNxsLnI0It = '/entry1/counterTimer01/lnI0It'
     self.__strNxsScanIndex = '/entry1/entry_identifier'
     
     self.__fRbkg = 1.0
     self.__fftfKmin = 2.0
     self.__fftfKmax = 17.0
     self.__fftfDk = 1.0
     self.__fftfKweight = 2.0
     
     self.__bProcess = True
     self.__bUseWSGI = _bUseWSGI
     
     self.__edPlugin = None
Example #6
0
    def __init__(self,
                 _strPluginName=None,
                 _strConfigurationFileName=None,
                 _ccp4DataInputControlPipelineCalcDiffMap=None):
        """
        @param _strPluginName: name of control plugin to load
        @type  _strPluginName: string
        @param _strConfigurationFileName: the configuration file to use  
        @type _strConfigurationFileName: string
        @param _ccp4DataInputControlPipelineCalcDiffMap: the input object to use  
        @type _ccp4DataInputControlPipelineCalcDiffMap: CCP4DataInputControlPipelineCalcDiffMap
        """
        EDApplication.__init__(self, _strName=EDApplicationDimplev0.APPLICATION_NAME, \
                                _strVersion=EDApplicationDimplev0.APPLICATION_VERSION, \
                                _strPluginName=_strPluginName, \
                                _strConfigurationFileName=_strConfigurationFileName)

        self.colLabelI = None
        self.colLabelSIGI = None

        self.strPDBIn = None
        self.strPDBOut = None
        self.strMTZIn = None
        self.strMTZOut = None

        self.inputXMLFile = None
        self.inputXMLFileName = None

        self.ccp4DataInputControlPipelineCalcDiffMap = _ccp4DataInputControlPipelineCalcDiffMap
        self.strPluginName = _strPluginName
        self.strDatasetFileName = None

        self.xsDataOutput = None
Example #7
0
    def preProcess(self):
        """
        Processes the command line, creates the plugins
        """
        EDApplication.preProcess(self)
        EDVerbose.DEBUG("EDApplicationXAFSDataProcessing.preProcess")

        # Read command line parameters and check if they are ok
        self.__bProcess = self.readAndProcessCommandLine()
 def testSendEmail(self):
     pluginMXCuBE = self.createPlugin()
     strPathToTestConfig = os.path.join(self.getPluginTestsDataHome(),
                                                     "XSConfiguration.xml")
     edConfiguration = EDConfiguration(strPathToTestConfig)
     edConfiguration.load()
     EDApplication.setConfiguration(edConfiguration)
     pluginMXCuBE.configure()
     pluginMXCuBE.sendEmail("EDTestCasePluginUnitControlInterfaceToMXCuBEv1_2sendEmail: Test subject", "EDTestCasePluginUnitControlInterfaceToMXCuBEv1_2sendEmail: Test message")
    def preProcess(self):
        """
        Processes the command line, creates the plugins
        """
        EDApplication.preProcess(self)
        EDVerbose.DEBUG("EDApplicationSASPipeline.preProcess")

        # Read command line parameters and check if they are ok
        self.__bProcess = self.readAndProcessCommandLine()
    def preProcess(self):
        """
        Processes the command line, creates the plugins
        """
        EDApplication.preProcess(self)
        EDVerbose.DEBUG("EDApplicationXAFSBatchProcessing.preProcess")

        # Read command line parameters and check if they are ok
        if not self.__bUseWSGI:
            self.__bProcess = self.readAndProcessCommandLine()
    def doFailureActionPlugin(self, _edPlugin=None):
        """
        retrieve the potential warning messages
        retrieve the potential error messages
        """
        EDApplication.doFailureActionPlugin(self, _edPlugin)

        EDVerbose.DEBUG("EDApplicationXAFSBatchProcessing.doFailureActionPlugin")
        EDVerbose.screen("Execution of " + _edPlugin.getPluginName() + " failed.")
        EDVerbose.screen("Please inspect the log file for further information.")
Example #12
0
 def testSendEmail(self):
     pluginMXCuBE = self.createPlugin()
     strPathToTestConfig = os.path.join(self.getPluginTestsDataHome(),
                                        "XSConfiguration.xml")
     edConfiguration = EDConfiguration(strPathToTestConfig)
     edConfiguration.load()
     EDApplication.setConfiguration(edConfiguration)
     pluginMXCuBE.configure()
     pluginMXCuBE.sendEmail(
         "EDTestCasePluginUnitControlInterfaceToMXCuBEv1_2sendEmail: Test subject",
         "EDTestCasePluginUnitControlInterfaceToMXCuBEv1_2sendEmail: Test message"
     )
    def doSuccessActionPlugin(self, _edPlugin=None):
        """
        retrieve the potential warning messages
        """
        EDApplication.doSuccessActionPlugin(self, _edPlugin)

        EDVerbose.DEBUG("EDApplicationXAFSBatchProcessing.doSuccessActionPlugin")

        if (_edPlugin.getListOfErrorMessages() != []):
            self.doFailureActionPlugin(_edPlugin)
        elif (_edPlugin.getListOfWarningMessages() != []):
            EDVerbose.screen("XAFS data processing successful with warning messages, please check the log file.")
        else:
            EDVerbose.screen("XAFS data processing successful!")
 def testGenerateXSDataResultPowderIntegration(self):
     strReferenceInputFile = os.path.join(self.m_strDataPath, "XSDataResultFIT2DCake_reference.xml")
     strXMLInput = EDUtilsTest.readAndParseFile(strReferenceInputFile)
     EDApplication.loadModule("XSDataFIT2Dv1_0")
     from XSDataFIT2Dv1_0 import XSDataResultFIT2DCake
     xsDataResultFIT2DCake = XSDataResultFIT2DCake.parseString(strXMLInput)
     from EDHandlerXSDataFIT2Dv1_0 import EDHandlerXSDataFIT2Dv1_0
     edHandlerXSDataFIT2Dv1_0 = EDHandlerXSDataFIT2Dv1_0()
     xsDataResultPowderDiffraction = edHandlerXSDataFIT2Dv1_0.getXSDataResultPowderIntegration(xsDataResultFIT2DCake)
     strReferencePath = os.path.join(self.m_strDataPath, "XSDataResultPowderIntegration_reference.xml")
     strXMLResultReference = EDUtilsTest.readAndParseFile(strReferencePath)
     EDApplication.loadModule("XSDataDiffractionCTv1")
     from XSDataDiffractionCTv1 import XSDataResultPowderIntegration
     xsDataResultPowderIntegrationReference = XSDataResultPowderIntegration.parseString(strXMLResultReference)
     EDAssert.equal(xsDataResultPowderIntegrationReference.marshal(), xsDataResultPowderDiffraction.marshal())
Example #15
0
    def doSuccessActionPlugin(self, _edPlugin=None):
        """
        retrieve the potential warning messages and set the output
        """
        EDApplication.doSuccessActionPlugin(self, _edPlugin)

        EDVerbose.DEBUG("EDApplicationDimplev0.doSuccessActionPlugin")

        xsDataOutput = _edPlugin.getDataOutput()

        if (_edPlugin.getListOfErrorMessages() != []):
            self.doFailureActionPlugin(_edPlugin)
        elif (_edPlugin.getListOfWarningMessages() != []):
            EDVerbose.screen("Dimplev0 successful with warning messages, please check the log file.")
        else:
            EDVerbose.screen("Dimplev0 successful!")
 def __init__(self,
              _strPluginName=None,
              _strConfigurationFileName=None,
              _xsDataInputCharacterisation=None,
              _strComments=None,
              _strShortComments=None):
     """
     @param _strPluginName: name of control plugin to load
     @type  _strPluginName: string
     @param _strConfigurationFileName: the configuration file to use  
     @type _strConfigurationFileName: string
     @param _xsDataInputCharacterisation: the input characterisation object to use  
     @type _xsDataInputCharacterisation: XSDataInputCharacterisation
     """
     EDApplication.__init__(self, _strName=EDApplicationMXv1Characterisation.APPLICATION_NAME, \
                             _strVersion=EDApplicationMXv1Characterisation.APPLICATION_VERSION, \
                             _strPluginName=_strPluginName, \
                             _strConfigurationFileName=_strConfigurationFileName)
     self.__listImagePaths = None
     self.__strDatasetFileName = None
     self.__fFlux = None
     self.__fMaxExposureTimePerDataCollection = 10000  # s, default MXv1 value
     self.__fMinExposureTimePerImage = None
     self.__fBeamSize = None
     self.__bTemplateMode = False
     self.__strGeneratedTemplateFile = None
     self.__strComplexity = "none"
     self.__strResultsFilePath = None
     self.__strForcedSpaceGroup = None
     self.__bAnomalousData = False
     self.__fBeamPosX = None
     self.__fBeamPosY = None
     self.__strStrategyOption = None
     self.__fDoseLimit = None
     self.__fAimedResolution = None
     self.__fAimedCompleteness = None
     self.__fAimedMultiplicity = None
     self.__bProcess = True
     self.__iDataCollectionId = None
     self.__xsDataInputCharacterisation = _xsDataInputCharacterisation
     self.__strPluginName = None
     self.__strDataInputFilePath = None
     self.__strShortComments = _strShortComments
     self.__strComments = _strComments
     self.__fTransmission = None
Example #17
0
    def doSuccessActionPlugin(self, _edPlugin=None):
        """
        retrieve the potential warning messages and set the output
        """
        EDApplication.doSuccessActionPlugin(self, _edPlugin)

        EDVerbose.DEBUG("EDApplicationDimplev0.doSuccessActionPlugin")

        xsDataOutput = _edPlugin.getDataOutput()

        if (_edPlugin.getListOfErrorMessages() != []):
            self.doFailureActionPlugin(_edPlugin)
        elif (_edPlugin.getListOfWarningMessages() != []):
            EDVerbose.screen(
                "Dimplev0 successful with warning messages, please check the log file."
            )
        else:
            EDVerbose.screen("Dimplev0 successful!")
Example #18
0
    def preProcess(self):
        """
        Processes the command line, creates the plugins
        """
        EDApplication.preProcess(self)
        EDVerbose.DEBUG("EDApplicationDimplev0.preProcess")

        if self.ccp4DataInputControlPipelineCalcDiffMap == None:
            # Read command line parameters and check if they are ok
            self.__bProcess = self.readAndProcessCommandLine()

            if (self.__bProcess) and not (self.strDatasetFileName is None):
                # Check if XML data is given as input :
                if (self.strDatasetFileName is not None):
                    try:
                        self.ccp4DataInputControlPipelineCalcDiffMap = CCP4DataInputControlPipelineCalcDiffMap.parseFile(self.strDatasetFileName)
                    except Exception:
                        errorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % ("EDApplicationDimplev0.process", self.strDatasetFileName)
                        EDVerbose.error(errorMessage)
                        raise RuntimeError, errorMessage
 def testGenerateXSDataResultPowderIntegration(self):
     strReferenceInputFile = os.path.join(
         self.m_strDataPath, "XSDataResultFIT2DCake_reference.xml")
     strXMLInput = EDUtilsTest.readAndParseFile(strReferenceInputFile)
     EDApplication.loadModule("XSDataFIT2Dv1_0")
     from XSDataFIT2Dv1_0 import XSDataResultFIT2DCake
     xsDataResultFIT2DCake = XSDataResultFIT2DCake.parseString(strXMLInput)
     from EDHandlerXSDataFIT2Dv1_0 import EDHandlerXSDataFIT2Dv1_0
     edHandlerXSDataFIT2Dv1_0 = EDHandlerXSDataFIT2Dv1_0()
     xsDataResultPowderDiffraction = edHandlerXSDataFIT2Dv1_0.getXSDataResultPowderIntegration(
         xsDataResultFIT2DCake)
     strReferencePath = os.path.join(
         self.m_strDataPath, "XSDataResultPowderIntegration_reference.xml")
     strXMLResultReference = EDUtilsTest.readAndParseFile(strReferencePath)
     EDApplication.loadModule("XSDataDiffractionCTv1")
     from XSDataDiffractionCTv1 import XSDataResultPowderIntegration
     xsDataResultPowderIntegrationReference = XSDataResultPowderIntegration.parseString(
         strXMLResultReference)
     EDAssert.equal(xsDataResultPowderIntegrationReference.marshal(),
                    xsDataResultPowderDiffraction.marshal())
Example #20
0
    def preProcess(self):
        """
        Processes the command line, creates the plugins
        """
        EDApplication.preProcess(self)
        EDVerbose.DEBUG("EDApplicationMXv1Characterisation.preProcess")

        if self.__xsDataInputCharacterisation == None:
            # Read command line parameters and check if they are ok
            self.__bProcess = self.readAndProcessCommandLine()

            if (self.__bProcess) and not (self.__strDatasetFileName is None):
                # Check if XML data is given as input :
                if (self.__strDatasetFileName is not None):
                    try:
                        self.__xsDataInputCharacterisation = XSDataInputCharacterisation.parseFile(self.__strDatasetFileName)
                    except:
                        errorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % ("EDApplicationMXv1Characterisation.process", self.__strDatasetFileName)
                        EDVerbose.error(errorMessage)
                        raise RuntimeError, errorMessage
 def getPluginConfiguration(self, _strPluginName=None):
     # Load the configuration file if provided
     if _strPluginName == None:
         _strPluginName = self.getPluginName()
     if _strPluginName in self.__dictConfigurations :
         xsConfiguration = self.__dictConfigurations[_strPluginName]
     else:
         xsConfiguration = None
         if (self.__strConfigurationFile is not None):
             edConfigurationTest = EDConfiguration(self.__strConfigurationFile)
             edConfigurationTest.load()
             if (edConfigurationTest is not None):
                 xsConfiguration = edConfigurationTest.getPluginItem(_strPluginName)
         if xsConfiguration is None:
             xsConfiguration = EDApplication.getApplicationPluginConfiguration(_strPluginName)
         if xsConfiguration is None:
             # No application wide configuration file found! Try to find a project specific config file:
             xsConfiguration = EDApplication.getProjectPluginConfiguration(_strPluginName)
         if xsConfiguration is None:
             EDVerbose.WARNING("EDTestCasePlugin.getPluginConfiguration: xsConfiguration is still None after all guesses: Expect to fail soon")
         self.__dictConfigurations[_strPluginName] = xsConfiguration
     return xsConfiguration
Example #22
0
    def preProcess(self):
        """
        Processes the command line, creates the plugins
        """
        EDApplication.preProcess(self)
        EDVerbose.DEBUG("EDApplicationDimplev0.preProcess")

        if self.ccp4DataInputControlPipelineCalcDiffMap == None:
            # Read command line parameters and check if they are ok
            self.__bProcess = self.readAndProcessCommandLine()

            if (self.__bProcess) and not (self.strDatasetFileName is None):
                # Check if XML data is given as input :
                if (self.strDatasetFileName is not None):
                    try:
                        self.ccp4DataInputControlPipelineCalcDiffMap = CCP4DataInputControlPipelineCalcDiffMap.parseFile(
                            self.strDatasetFileName)
                    except Exception:
                        errorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % (
                            "EDApplicationDimplev0.process",
                            self.strDatasetFileName)
                        EDVerbose.error(errorMessage)
                        raise RuntimeError, errorMessage
 def __init__(self, _strPluginName=None, _strConfigurationFileName=None, _xsDataInputCharacterisation=None, _strComments = None, _strShortComments = None):
     """
     @param _strPluginName: name of control plugin to load
     @type  _strPluginName: string
     @param _strConfigurationFileName: the configuration file to use  
     @type _strConfigurationFileName: string
     @param _xsDataInputCharacterisation: the input characterisation object to use  
     @type _xsDataInputCharacterisation: XSDataInputCharacterisation
     """
     EDApplication.__init__(self, _strName=EDApplicationMXv1Characterisation.APPLICATION_NAME, \
                             _strVersion=EDApplicationMXv1Characterisation.APPLICATION_VERSION, \
                             _strPluginName=_strPluginName, \
                             _strConfigurationFileName=_strConfigurationFileName)
     self.__listImagePaths = None
     self.__strDatasetFileName = None
     self.__fFlux = None
     self.__fMaxExposureTimePerDataCollection = 10000 # s, default MXv1 value
     self.__fMinExposureTimePerImage = None
     self.__fBeamSize = None
     self.__bTemplateMode = False
     self.__strGeneratedTemplateFile = None
     self.__strComplexity = "none"
     self.__strResultsFilePath = None
     self.__strForcedSpaceGroup = None
     self.__bAnomalousData = False
     self.__fBeamPosX = None
     self.__fBeamPosY = None
     self.__strStrategyOption = None
     self.__bProcess = True
     self.__iDataCollectionId = None
     self.__xsDataInputCharacterisation = _xsDataInputCharacterisation
     self.__strPluginName = None
     self.__strDataInputFilePath = None
     self.__strShortComments = _strShortComments
     self.__strComments = _strComments
     self.__fTransmission = None
Example #24
0
    def getStringConfigurationParameterValue(self, _strConfigurationParameterName):
        """
        This method returns a configuration parameter value if a corresponding configuration
        parameter name can be found in the configuration file.
        
        If an application wide configuration file is provided via EDApplication it will
        override the product configuration file.
        
        The configuration parameter is then searched in the configration file in following order:
          - If a plugin configuration item exists and the configration parameter name is present it will be used.
          - Otherwise if a product-wide (e.g. "mxPluginExec") configuration value exists it will be used.         
        """
        self.DEBUG("EDPlugin.getConfigurationParameterValue")
        strParameteValue = None
        xsPluginItem = self.getConfiguration()
        bFoundConfigurationParameter = False
        if xsPluginItem:
            strParameteValue = EDConfiguration.getParamItem(xsPluginItem, _strConfigurationParameterName).getValue()
            if strParameteValue:
                bFoundConfigurationParameter = True

        if not bFoundConfigurationParameter:
            xsPluginItem = EDApplication.getApplicationPluginConfiguration(self.getPluginName())
            if xsPluginItem:
                strParameteValue = EDConfiguration.getParamItem(xsPluginItem, _strConfigurationParameterName).getValue()
                if strParameteValue:
                    bFoundConfigurationParameter = True

        if not bFoundConfigurationParameter:
            xsPluginItem = EDApplication.getProjectPluginConfiguration(self.getPluginName())
            if xsPluginItem:
                strParameteValue = EDConfiguration.getParamItem(xsPluginItem, _strConfigurationParameterName).getValue()
                if strParameteValue:
                    bFoundConfigurationParameter = True

        return strParameteValue
Example #25
0
	def __init__(self, cl, name):
		PyTango.Device_3Impl.__init__(self, cl, name)
		EDTangoServer.init_device(self)
		# Initialise the plugin factory
		self.m_edFactoryPlugin = EDApplication.getFactoryPlugin()
		EDVerbose.setVerboseDebugOn()
Example #26
0
import os, shutil
from EDVerbose      import EDVerbose
from XSDataCommon   import XSDataInput
from XSDataCommon   import XSDataResult
from XSDataCommon   import XSDataFile
from XSDataCommon   import XSDataString
from EDMessage      import EDMessage
from EDConfiguration import EDConfiguration
from EDPluginExecProcessScript import EDPluginExecProcessScript
from XSDataFIT2Dv1_0 import XSDataInputFIT2DCake
from XSDataFIT2Dv1_0 import XSDataResultFIT2DCake


# Use the EDF image header reader plugin for localising the EdfFile module
from EDApplication import EDApplication
EDApplication.loadModule("EDPluginEDFReadHeaderv1_0")
import  EdfFile as EDF
import  CIFfile
import  numpy as NP


class EDPluginFIT2DCakev1_1(EDPluginExecProcessScript):
    """
    The purpose of this plugin is to use FIT2D to do "cake" integration,
    i.e. azimutal integration of powder diffraction images.
    version 1.1 correspond to the first trial to get rid of the null-X-server  
    """


    def __init__(self):
        """
__authors__ = ["Olof Svensson", "Jerome Kieffer"]
__contact__ = "*****@*****.**"
__license__ = "GPLv3"
__date__ = "2010-02-02"
__copyright__ = "ESRF"

#
# Set up PYTHON path for the EDNA kernel
#
# First locate EDNA_HOME
#


import sys, os.path
pyStrProgramPath = os.path.abspath(sys.argv[0])
pyStrBinPath = os.path.split(pyStrProgramPath)[0]
pyStrKernelPath = os.path.split(pyStrBinPath)[0]
pyStrEdnaHomePath = os.path.split(pyStrKernelPath)[0]
os.environ["EDNA_HOME"] = pyStrEdnaHomePath
#
# Then add kernel/src to PYTHONPATH
#
sys.path.append(os.path.join(pyStrEdnaHomePath, "edna-kernel", "src"))
#
# Now the EDApplication can be imported and started
#
from EDApplication import EDApplication
edApplication = EDApplication()
edApplication.execute()
Example #28
0
 def __init__ (self):
     EDApplication.__init__(self)
     self.__edTestCase = None
     EDVerbose.setTestOn()
Example #29
0
    def configure(self):
        """
        Should be overridden by the Final Plugin If needed
        This method should set its proper members attributes from a Plugin configuration Object
        """
        self.DEBUG("EDPlugin.configure : %s" % self.getClassName())
        xsPluginItem = self.getConfiguration()

        if xsPluginItem is None:
            xsPluginItem = EDApplication.getApplicationPluginConfiguration(self.getPluginName())
            if (xsPluginItem is None):
                # No application wide configuration file found! Try to find a project specific config file:
                xsPluginItem = EDApplication.getProjectPluginConfiguration(self.getPluginName())

            if (xsPluginItem is None):
                self.DEBUG("EDPlugin.configure: No plugin configuration found for " + self.getPluginName())
                xsPluginItem = XSPluginItem()
            else:
                self.setConfiguration(xsPluginItem)

        # set Timeout if different from default one
        if self.getTimeOut() == self.getDefaultTimeOut():
            # Try to get time out from plugin configuration
            iTimeOut = EDConfiguration.getIntegerParamValue(xsPluginItem, EDPlugin.CONF_TIME_OUT)
            if iTimeOut is not None:
                self.DEBUG("EDPlugin.configure: Setting time out to %d s from plugin configuration." % iTimeOut)
                self.setTimeOut(iTimeOut)
        else:
            self.DEBUG("EDPlugin.configure: Working directory already set before plugin is configured.")
        # Base directory
        strBaseDirectory = self.getBaseDirectory()
        if (strBaseDirectory is None):
            # Try to get base directory from plugin configuration
            strBaseDirectory = EDConfiguration.getStringParamValue(xsPluginItem, EDPlugin.CONF_BASE_DIR_LABEL)
            if(strBaseDirectory is None):
                # Try to get working directory from environment variable
                strBaseDirectory = os.environ.get("EDNA_BASE_DIRECTORY")
                if (strBaseDirectory is None):
                    self.DEBUG("EDPlugin.configure: Using current base directory as working directory.")
                    strBaseDirectory = os.getcwd()
                else:
                    self.DEBUG("EDPlugin.configure: Setting base directory from $EDNA_WORKING_DIRECTORY.")
            else:
                if (strBaseDirectory == "."):
                    self.DEBUG("EDPlugin.configure: Using current base directory as working directory.")
                    strBaseDirectory = os.getcwd()
                else:
                    strBaseDirectory = os.path.abspath(strBaseDirectory)
                    self.DEBUG("EDPlugin.configure: Setting base directory from plugin configuration.")
            self.setBaseDirectory(strBaseDirectory)
        else:
            self.DEBUG("EDPlugin.configure: Base directory already set before plugin is configured.")
        # Working directory
        strWorkingDirectory = self.getWorkingDirectory()
        if (strWorkingDirectory is None):
            # Try to get working directory from plugin configuration
            strWorkingDirectory = EDConfiguration.getStringParamValue(xsPluginItem, EDPlugin.CONF_WORKING_DIR_LABEL)
            if(strWorkingDirectory is not None):
                self.DEBUG("EDPlugin.configure: Setting working directory from plugin configuration.")
            else:
                self.DEBUG("EDPlugin.configure: Setting working directory as base directory + base name.")
                strWorkingDirectory = os.path.join(self.getBaseDirectory(), self.getBaseName())
            self.setWorkingDirectory(strWorkingDirectory)
        else:
            self.DEBUG("EDPlugin.configure: Working directory already set before plugin is configured.")
        #
        strWriteXMLInputOutput = EDConfiguration.getStringParamValue(xsPluginItem, EDPlugin.CONF_WRITE_XML_INPUT_OUTPUT)
        if strWriteXMLInputOutput != None:
            if strWriteXMLInputOutput.lower().strip() in ["false", "0"]:
                self.__bWriteDataXMLInputOutput = False
            else:
                self.__bWriteDataXMLInputOutput = True

        strWriteXMLOutput = EDConfiguration.getStringParamValue(xsPluginItem, EDPlugin.CONF_WRITE_XML_OUTPUT)
        if strWriteXMLOutput != None:
            if strWriteXMLOutput.lower().strip()  in ["false", "0"]:
                self.__bWriteDataXMLOutput = False
            else:
                self.__bWriteDataXMLOutput = True
        strWriteXMLInput = EDConfiguration.getStringParamValue(xsPluginItem, EDPlugin.CONF_WRITE_XML_INPUT)
        if strWriteXMLInput != None:
            if strWriteXMLInput.lower().strip() in ["false", "0"]:
                self.__bWriteDataXMLInput = False
            else:
                self.__bWriteDataXMLInput = True
Example #30
0
#

__authors__ = ["Olof Svensson", "Jerome Kieffer"]
__contact__ = "*****@*****.**"
__license__ = "GPLv3"
__date__ = "2010-02-02"
__copyright__ = "ESRF"

#
# Set up PYTHON path for the EDNA kernel
#
# First locate EDNA_HOME
#

import sys, os.path
pyStrProgramPath = os.path.abspath(sys.argv[0])
pyStrBinPath = os.path.split(pyStrProgramPath)[0]
pyStrKernelPath = os.path.split(pyStrBinPath)[0]
pyStrEdnaHomePath = os.path.split(pyStrKernelPath)[0]
os.environ["EDNA_HOME"] = pyStrEdnaHomePath
#
# Then add kernel/src to PYTHONPATH
#
sys.path.append(os.path.join(pyStrEdnaHomePath, "kernel", "src"))
#
# Now the EDApplication can be imported and started
#
from EDApplication import EDApplication
edApplication = EDApplication()
edApplication.execute()
Example #31
0
 def __init__(self, cl, name):
     PyTango.Device_3Impl.__init__(self, cl, name)
     EDTangoServer.init_device(self)
     # Initialise the plugin factory
     self.m_edFactoryPlugin = EDApplication.getFactoryPlugin()
     EDVerbose.setVerboseDebugOn()