def preProcess(self, _edObject=None):
        """
        Gets the Configuration Parameters, if found, overrides default parameters
        """
        EDPluginControl.preProcess(self, _edObject)
        self.DEBUG("EDPluginControlIntegrationv10.preProcess...")

        xsDataIntegrationInput = self.getDataInput()
        xsDataSelectedIndexingSolution = xsDataIntegrationInput.getSelectedIndexingSolution()
        self.__xsDataExperimentalConditionRefined = xsDataIntegrationInput.getExperimentalConditionRefined()
        # To be changed (see bug #40)
        if (self.__xsDataExperimentalConditionRefined is None):
            self.__xsDataExperimentalConditionRefined = xsDataSelectedIndexingSolution.getExperimentalConditionRefined()
        xsDataCollection = xsDataIntegrationInput.getDataCollection()
        xsDataSubWedgeList = xsDataCollection.getSubWedge()

        self.__edPluginIntegrationList = []

        iIndex = 0
        for xsDataSubWedge in xsDataSubWedgeList:
            iSubWedgeNumber = iIndex
            if (xsDataSubWedge.getSubWedgeNumber() is not None):
                # Use the incoming subwedge number if it exists
                iSubWedgeNumber = xsDataSubWedge.getSubWedgeNumber().getValue()

            edPluginIntegration = self.loadPlugin(self.__strPluginIntegrationName)

            if (not edPluginIntegration is None):
                iIndex += 1
                xsDataIntegrationInputSubWedge = XSDataIntegrationInput()
                xsDataIntegrationInputSubWedge.setSelectedIndexingSolution(XSDataIndexingSolutionSelected.parseString(xsDataSelectedIndexingSolution.marshal()))
                xsDataIntegrationInputSubWedge.setExperimentalConditionRefined(XSDataExperimentalCondition.parseString(self.__xsDataExperimentalConditionRefined.marshal()))
                xsDataCollection = XSDataCollection()
                xsDataCollection.addSubWedge(xsDataSubWedge)
                xsDataIntegrationInputSubWedge.setDataCollection(xsDataCollection)
                try:
                    from EDHandlerXSDataMOSFLMv10 import EDHandlerXSDataMOSFLMv10
                    xsDataMOSFLMInputIntegration = EDHandlerXSDataMOSFLMv10.generateXSDataMOSFLMInputIntegration(xsDataIntegrationInputSubWedge)
                    edPluginIntegration.setDataInput(xsDataMOSFLMInputIntegration)
                    edPluginIntegration.setBaseName("%s-%02d" % (self.__strPluginIntegrationName, iIndex))
                    edPluginIntegration.connectSUCCESS(self.doSuccessActionIntegration)
                    edPluginIntegration.connectFAILURE(self.doFailureActionIntegration)
                    # Here we store the sub wedge number for use in the results
                    self.__edPluginIntegrationList.append([iSubWedgeNumber, edPluginIntegration])
                except Exception as strErrorMessage:
                    self.addErrorMessage(strErrorMessage)
                    self.ERROR(strErrorMessage)
                    self.setFailure()
            else:
                strErrorMessage = "EDPluginControlIntegrationv10.preProcess: could not load plugin %s" % self.__strPluginIntegrationName
                self.error(strErrorMessage)
                self.addErrorMessage(strErrorMessage)
                self.setFailure()
 def testGenerateXSDataMOSFLMInputIntegration(self):
     strFilename = "XSDataIntegrationInput_reference.xml"
     strPath = os.path.join(self.m_strDataPath, strFilename)
     strXMLIntegrationInput = EDUtilsTest.readAndParseFile(strPath)
     from XSDataMXv1 import XSDataIntegrationInput
     xsDataIntegrationInput = XSDataIntegrationInput.parseString(strXMLIntegrationInput)
     from EDHandlerXSDataMOSFLMv10 import EDHandlerXSDataMOSFLMv10
     xsDataMOSFLMInputIntegration = EDHandlerXSDataMOSFLMv10.generateXSDataMOSFLMInputIntegration(xsDataIntegrationInput)
     strReferenceFilename = "XSDataMOSFLMInputIntegration_reference.xml"
     strReferencePath = os.path.join(self.m_strDataPath, strReferenceFilename)
     strXMLIntegrationInputReference = EDUtilsTest.readAndParseFile(strReferencePath)
     EDFactoryPluginStatic.loadModule("XSDataMOSFLMv10")
     from XSDataMOSFLMv10 import XSDataMOSFLMInputIntegration
     xsDataMOSFLMInputIntegrationReference = XSDataMOSFLMInputIntegration.parseString(strXMLIntegrationInputReference)
     EDAssert.equal(xsDataMOSFLMInputIntegrationReference.marshal(), xsDataMOSFLMInputIntegration.marshal())
Exemple #3
0
 def testGenerateXSDataMOSFLMInputIntegration(self):
     strFilename = "XSDataIntegrationInput_reference.xml"
     strPath = os.path.join(self.m_strDataPath, strFilename)
     strXMLIntegrationInput = EDUtilsTest.readAndParseFile(strPath)
     from XSDataMXv1 import XSDataIntegrationInput
     xsDataIntegrationInput = XSDataIntegrationInput.parseString(
         strXMLIntegrationInput)
     from EDHandlerXSDataMOSFLMv10 import EDHandlerXSDataMOSFLMv10
     xsDataMOSFLMInputIntegration = EDHandlerXSDataMOSFLMv10.generateXSDataMOSFLMInputIntegration(
         xsDataIntegrationInput)
     strReferenceFilename = "XSDataMOSFLMInputIntegration_reference.xml"
     strReferencePath = os.path.join(self.m_strDataPath,
                                     strReferenceFilename)
     strXMLIntegrationInputReference = EDUtilsTest.readAndParseFile(
         strReferencePath)
     EDFactoryPluginStatic.loadModule("XSDataMOSFLMv10")
     from XSDataMOSFLMv10 import XSDataMOSFLMInputIntegration
     xsDataMOSFLMInputIntegrationReference = XSDataMOSFLMInputIntegration.parseString(
         strXMLIntegrationInputReference)
     EDAssert.equal(xsDataMOSFLMInputIntegrationReference.marshal(),
                    xsDataMOSFLMInputIntegration.marshal())
Exemple #4
0
    def preProcess(self, _edObject=None):
        """
        Gets the Configuration Parameters, if found, overrides default parameters
        """
        EDPluginControl.preProcess(self, _edObject)
        self.DEBUG("EDPluginControlIntegrationv10.preProcess...")

        xsDataIntegrationInput = self.getDataInput()
        xsDataSelectedIndexingSolution = xsDataIntegrationInput.getSelectedIndexingSolution(
        )
        self.__xsDataExperimentalConditionRefined = xsDataIntegrationInput.getExperimentalConditionRefined(
        )
        # To be changed (see bug #40)
        if (self.__xsDataExperimentalConditionRefined is None):
            self.__xsDataExperimentalConditionRefined = xsDataSelectedIndexingSolution.getExperimentalConditionRefined(
            )
        xsDataCollection = xsDataIntegrationInput.getDataCollection()
        xsDataSubWedgeList = xsDataCollection.getSubWedge()

        self.__edPluginIntegrationList = []

        iIndex = 0
        for xsDataSubWedge in xsDataSubWedgeList:
            iSubWedgeNumber = iIndex
            if (xsDataSubWedge.getSubWedgeNumber() is not None):
                # Use the incoming subwedge number if it exists
                iSubWedgeNumber = xsDataSubWedge.getSubWedgeNumber().getValue()

            edPluginIntegration = self.loadPlugin(
                self.__strPluginIntegrationName)

            if (not edPluginIntegration is None):
                iIndex += 1
                xsDataIntegrationInputSubWedge = XSDataIntegrationInput()
                xsDataIntegrationInputSubWedge.setSelectedIndexingSolution(
                    XSDataIndexingSolutionSelected.parseString(
                        xsDataSelectedIndexingSolution.marshal()))
                xsDataIntegrationInputSubWedge.setExperimentalConditionRefined(
                    XSDataExperimentalCondition.parseString(
                        self.__xsDataExperimentalConditionRefined.marshal()))
                xsDataCollection = XSDataCollection()
                xsDataCollection.addSubWedge(xsDataSubWedge)
                xsDataIntegrationInputSubWedge.setDataCollection(
                    xsDataCollection)
                try:
                    from EDHandlerXSDataMOSFLMv10 import EDHandlerXSDataMOSFLMv10
                    xsDataMOSFLMInputIntegration = EDHandlerXSDataMOSFLMv10.generateXSDataMOSFLMInputIntegration(
                        xsDataIntegrationInputSubWedge)
                    edPluginIntegration.setDataInput(
                        xsDataMOSFLMInputIntegration)
                    edPluginIntegration.setBaseName(
                        "%s-%02d" % (self.__strPluginIntegrationName, iIndex))
                    edPluginIntegration.connectSUCCESS(
                        self.doSuccessActionIntegration)
                    edPluginIntegration.connectFAILURE(
                        self.doFailureActionIntegration)
                    # Here we store the sub wedge number for use in the results
                    self.__edPluginIntegrationList.append(
                        [iSubWedgeNumber, edPluginIntegration])
                except Exception as strErrorMessage:
                    self.addErrorMessage(strErrorMessage)
                    self.ERROR(strErrorMessage)
                    self.setFailure()
            else:
                strErrorMessage = "EDPluginControlIntegrationv10.preProcess: could not load plugin %s" % self.__strPluginIntegrationName
                self.error(strErrorMessage)
                self.addErrorMessage(strErrorMessage)
                self.setFailure()