ó
ø`9Sc           @   s-   d  d l  Td g Z d e f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   *t   MatlabMultiProcessc           B   s˜   e  Z d  Z e ƒ  Z e e ƒ Z e e ƒ Z d „  Z	 d d „ Z d „  Z d „  Z d d „ Z d „  Z d „  Z d	 „  Z d
 „  Z d „  Z d „  Z RS(   sˆ   A class with the same interface as that of 'MatlabProcess', but
    capable of invoking several Matlab optimization procedures in a row.c         C   s,   t  j |  ƒ d  |  _ d  |  _ g  |  _ d  S(   N(   t   QObjectt   __init__t   Nonet   matlabProcessGeneratort   matlabProcesst   retrievalOutputs(   t   self(    (    s   code\MatlabMultiProcess.pyR   !   s    		c         C   s&   g  |  _  |  j ƒ  |  _ |  j ƒ  d  S(   N(   R   t   getMatlabProcessGeneratorR   t   launchSubRetrieval(   R   t   errorMessage(    (    s   code\MatlabMultiProcess.pyt   startRetrieval)   s    	c         C   sB   |  j  d  k	 r |  j  j ƒ  n  |  j d  k	 r> |  j j ƒ  n  d  S(   N(   R   R   t   closeR   t   cancelRetrieval(   R   (    (    s   code\MatlabMultiProcess.pyR   3   s    c         C   s    |  j  d  k r d  S|  j  j ƒ  S(   N(   R   R   t   getErrorMessage(   R   (    (    s   code\MatlabMultiProcess.pyR   =   s    iÿÿÿÿc         C   s$   t  |  j ƒ d k r d  S|  j | S(   Ni    (   t   lenR   R   (   R   t	   iteration(    (    s   code\MatlabMultiProcess.pyt   getRetrievalOutputD   s    c         C   s   |  j  S(   N(   R   (   R   (    (    s   code\MatlabMultiProcess.pyt   getAllRetrievalOutputsK   s    c         C   s   d S(   sá  Construct and return a generator object that will yield
        'MatlabProcess' instances to be invoked.

        Whenever the generator function runs into a 'yield' statement, its
        execution will be paused until the yielded 'MatlabProcess' is finished.
        If that process terminates with an error, the generator function will
        be closed with 'GeneratorExit' exception. Otherwise, it will resume its
        execution from the point where it had been interrupted.

        Warning: the generator function should not take 'self' (or any
        structure containing a reference to 'self') as either of its
        arguments, as otherwise a circular reference would occur between 'self'
        and the generator object.N(   R   (   R   (    (    s   code\MatlabMultiProcess.pyR	   P   s    c         C   s‹   y |  j  j ƒ  |  _ Wn t k
 r7 |  j j ƒ  d  SX|  j j j |  j ƒ |  j j j |  j	 ƒ |  j j
 j |  j
 ƒ |  j j ƒ  d  S(   N(   R   t   nextR   t   StopIterationt   retrievalFinishedt   emitt   connectt   onSubRetrievalFinishedt   outputAvailablet   onOutputAvailablet   iterationCompletedR   (   R   (    (    s   code\MatlabMultiProcess.pyR
   b   s    

c         C   sX   |  j  j ƒ  d  k	 r2 |  j j ƒ  |  j j ƒ  n" |  j |  j  j ƒ  7_ |  j	 ƒ  d  S(   N(
   R   R   R   R   R   R   R   R   R   R
   (   R   (    (    s   code\MatlabMultiProcess.pyR   x   s    c         C   s   |  j  j | ƒ d  S(   N(   R   R   (   R   t
   outputLine(    (    s   code\MatlabMultiProcess.pyR      s    c         C   s   |  j  j | ƒ d  S(   N(   R   R   (   R   t   iterationCount(    (    s   code\MatlabMultiProcess.pyt   onIterationCompleted“   s    N(   t   __name__t
   __module__t   __doc__t
   pyqtSignalR   t   QStringR   t   intR   R   R   R   R   R   R   R   R	   R
   R   R   R   (    (    (    s   code\MatlabMultiProcess.pyR      s   		
	
						N(   t   PyQt4.QtCoret   __all__R   R   (    (    (    s   code\MatlabMultiProcess.pyt   <module>   s   
	