예제 #1
0
    def __init__(self, callbacks_dict=None, interactive_callbacks=None):
        """Interactive callbacks handle Plugin-Frontend interaction hooks."""
        self.interactive_callbacks = {}

        # Are we running on CLI or knitlib web?
        # If no callbacks are registered, we set a CLI set as default.
        if interactive_callbacks is None:
            self.register_interactive_callbacks({
                "blocking_user_action": BaseKnittingPlugin.__cli_blocking_action,
                "message": BaseKnittingPlugin.__cli_emit_message,
                "progress": BaseKnittingPlugin.__cli_log_progress
            })
        else:
            self.register_interactive_callbacks(interactive_callbacks)

        # Fysom allows to set hooks before changing states, we set them here.
        if callbacks_dict is None:
            callbacks_dict = {
                'onknit': self.onknit,
                'onconfigure': self.onconfigure,
                'onfinish': self.onfinish,
            }
        Fysom.__init__(self, {
            'initial': 'activated',
            'events': [  # TODO: add more states for handling error management.
                         {'name': 'configure', 'src': 'activated', 'dst': 'configured'},
                         {'name': 'configure', 'src': 'configured', 'dst': 'configured'},
                         {'name': 'configure', 'src': 'finished', 'dst': 'configured'},
                         {'name': 'configure', 'src': 'error', 'dst': 'configured'},
                         {'name': 'knit', 'src': 'configured', 'dst': 'knitting'},
                         {'name': 'finish', 'src': 'knitting', 'dst': 'finished'},
                         {'name': 'finish', 'src': 'finished', 'dst': 'finished'},
                         {'name': 'fail', 'src': 'knitting', 'dst': 'error'}],
            'callbacks': callbacks_dict
        })
예제 #2
0
 def __init__(self, name, runner, references, config, **kwargs):
     """ Create a PrePostTask.
       @param str name: unique name of the task
       @param object runner: TaskRunner that manages this task
       @param dict references: contains references to all required modules
       @param dict config: configuration parameter dictionary
     """
     _default_callbacks = {'onprerun': self._pre, 'onpostrun': self._post}
     _stateList = {
         'initial':
         'stopped',
         'events': [{
             'name': 'prerun',
             'src': 'stopped',
             'dst': 'paused'
         }, {
             'name': 'postrun',
             'src': 'paused',
             'dst': 'stopped'
         }],
         'callbacks':
         _default_callbacks
     }
     if 'PyQt5' in sys.modules:
         super().__init__(cfg=_stateList, **kwargs)
     else:
         QtCore.QObject.__init__(self)
         Fysom.__init__(self, _stateList)
     self.lock = Mutex()
     self.name = name
     self.runner = runner
     self.ref = references
     self.config = config
예제 #3
0
    def __init__(self, callbacks_dict=None, interactive_callbacks=None):
        self.__NOT_IMPLEMENTED_ERROR = "Classes that inherit from KnittingPlugin should implment {0}"
        self.interactive_callbacks = {}

        if interactive_callbacks is None:
            self.register_interactive_callbacks({
                "info": BaseKnittingPlugin.__interactive_info,
                "user_action": BaseKnittingPlugin.__interactive_info,
                "warning": BaseKnittingPlugin.__interactive_warn,
                "error": BaseKnittingPlugin.__interactive_error,
                "progress": BaseKnittingPlugin.__log_progress
            })
        else:
            self.register_interactive_callbacks(interactive_callbacks)

        if callbacks_dict is None:
            callbacks_dict = {
                'onknit': self.onknit,
                'onconfigure': self.onconfigure,
                'onfinish': self.onfinish,
            }
        Fysom.__init__(self, {
            'initial': 'activated',
            'events': [  # TODO: add more states for handling error management.
                         {'name': 'configure', 'src': 'activated', 'dst': 'configured'},
                         {'name': 'configure', 'src': 'configured', 'dst': 'configured'},
                         {'name': 'configure', 'src': 'finished', 'dst': 'configured'},
                         {'name': 'configure', 'src': 'error', 'dst': 'configured'},
                         {'name': 'knit', 'src': 'configured', 'dst': 'knitting'},
                         {'name': 'finish', 'src': 'knitting', 'dst': 'finished'},
                         {'name': 'fail', 'src': 'knitting', 'dst': 'error'}],
            'callbacks': callbacks_dict
        })
예제 #4
0
    def __init__(self, fsm_table=setup_fsm.fsm_def.FSM_TABLE, options = None,
                 logger_name=sys.modules['__main__'].__name__,
                 logger_dir = '.'):
        """
        Initialise function of the generator FSM

        :param fsm_table: Table defining the FSM
        :param options  : A dictionary containing the necessary options
        :param : logger_name : the parent logger name
        :param fsm_table: Table defining the FSM
        """

        callbacks = {'onbeforeallocate': self.onbeforeallocate,
                     'onnot_ready': self.onnot_ready,
                     'onbeforeconfigure': self.onbeforeconfigure,
                     'onstand_by': self.onstand_by,
                     'onbeforestart_run': self.onbeforestart_run,
                     'onready': self.onready,
                     'onbeforestart_trigger': self.onbeforestart_trigger,
                     'onrunning': self.onrunning,
                     'onbeforestop_trigger': self.onbeforestop_trigger,
                     'onbeforestop_run': self.onbeforestop_run,
                     'onbeforereset': self.onbeforereset,
                     'onbeforedeallocate': self.onbeforedeallocate}


        Fysom.__init__(self, cfg = fsm_table, callbacks = callbacks)

        # Set up the logger
        self.logger = logging.getLogger(logger_name + '.camserver_fsm')
        self.logger.info('\t-|--|> Append the CameraServerFSM to the setup')
        self.options = options
        self.logger_dir = logger_dir
예제 #5
0
 def __init__(self, name, runner, references, config, **kwargs):
     """ Create a PrePostTask.
       @param str name: unique name of the task
       @param object runner: TaskRunner that manages this task
       @param dict references: contains references to all required modules
       @param dict config: configuration parameter dictionary
     """
     _default_callbacks = {'onprerun': self._pre, 'onpostrun': self._post}
     _stateList = {
         'initial': 'stopped',
         'events': [
             {'name': 'prerun', 'src': 'stopped', 'dst': 'paused'},
             {'name': 'postrun', 'src': 'paused', 'dst': 'stopped'}
         ],
         'callbacks': _default_callbacks
     }
     if 'PyQt5' in sys.modules:
         super().__init__(cfg=_stateList, **kwargs)
     else:
         QtCore.QObject.__init__(self)
         Fysom.__init__(self, _stateList)
     self.lock = Mutex()
     self.name = name
     self.runner = runner
     self.ref = references
     self.config = config
예제 #6
0
    def __init__(self, callbacks_dict):
        self.__NOT_IMPLEMENTED_ERROR = "Classes that inherit from KnittingPlugin should implment {0}"

        callbacks_dict = {
            'onknit': self.onknit,
            #'onknitting': self.onknitting,
            'onconfigure': self.onconfigure,
            'onfinish': self.onfinish,
        }
        Fysom.__init__(
            self,
            {
                'initial':
                'activated',
                'events': [
                    ## TODO: add more states for handling error management.
                    {
                        'name': 'configure',
                        'src': 'activated',
                        'dst': 'configured'
                    },
                    {
                        'name': 'configure',
                        'src': 'configured',
                        'dst': 'configured'
                    },
                    {
                        'name': 'configure',
                        'src': 'finished',
                        'dst': 'configured'
                    },
                    {
                        'name': 'configure',
                        'src': 'error',
                        'dst': 'configured'
                    },
                    {
                        'name': 'knit',
                        'src': 'configured',
                        'dst': 'knitting'
                    },
                    {
                        'name': 'finish',
                        'src': 'knitting',
                        'dst': 'finished'
                    },
                    {
                        'name': 'fail',
                        'src': 'knittng',
                        'dst': 'error'
                    }
                ],
                'callbacks':
                callbacks_dict
            })
예제 #7
0
    def __init__(self, plugin_id, current_state):
        Fysom.__init__(self, {
            'initial': current_state,
            'events': events,
            'callbacks': {
                'oninstall': self.install,
                'oninitialize': self.initialize
            }
        })

        self.plugin_id = plugin_id
        self.current_state = current_state
        self.onchangestate = self._onchangestate
예제 #8
0
파일: fsm.py 프로젝트: mahak/fuelweb
    def __init__(self, plugin_id, current_state):
        Fysom.__init__(self, {
            'initial': current_state,
            'events': events,
            'callbacks': {
                'oninstall': self.install,
                'oninitialize': self.initialize
            }
        })

        self.plugin_id = plugin_id
        self.current_state = current_state
        self.onchangestate = self._onchangestate
예제 #9
0
 def __init__(self, *args, **kwargs):
     logger.debug("PseudoDevice %s", kwargs)
     self.addr = kwargs.pop('addr', "0000")
     self.typemodule = kwargs.pop('typemodule', None)
     self.ser = kwargs.pop('ser', [])
     Fysom.__init__(
         self,
         {
             'initial':
             'idle',
             'events': [
                 {
                     'name': 'evt_askident',
                     'dst': 'ukn',
                     'src': [
                         'idle',
                     ]
                 },
                 {
                     'name': 'evt_giveident',
                     'dst': 'identified',
                     'src': [
                         'idle',
                         'ukn',
                     ]
                 },
                 {
                     'name': 'evt_newvalue',
                     'dst': 'newvalue',
                     'src': [
                         'identified',
                     ]
                 },
                 {
                     'name': 'evt_valueack',
                     'dst': 'identified',
                     'src': [
                         'newvalue',
                     ]
                 },
             ],
             "callbacks": {
                 #                        'onconnected':   self.connected_state,
                 'onidentified': self.identified_state,
                 'onnewvalue': self.newvalue_state,
                 #                        'onidle':        self.idle_state,
             }
         })
     logger.debug('Module of type %s at address %s detected',
                  self.typemodule, self.addr)
예제 #10
0
    def __init__(self, name, runner, references, config, **kwargs):
        """ Create an Interruptable task.
          @param str name: unique task name
          @param object runner: reference to the TaskRunner managing this task
          @param dict references: a dictionary of all required modules
          @param dict config: configuration dictionary
        """
        default_callbacks = {
                'onrun': self._start,
                'onpause': self._pause,
                'onresume': self._resume,
                'onfinish': self._finish
                }
        _stateDict = {
            'initial': 'stopped',
            'events': [
                {'name': 'run',                 'src': 'stopped',   'dst': 'starting'},
                {'name': 'startingFinished',    'src': 'starting',  'dst': 'running'},
                {'name': 'pause',               'src': 'running',   'dst': 'pausing'},
                {'name': 'pausingFinished',     'src': 'pausing',   'dst': 'paused'},
                {'name': 'finish',              'src': 'running',   'dst': 'finishing'},
                {'name': 'finishingFinished',   'src': 'finishing', 'dst': 'stopped'},
                {'name': 'resume',              'src': 'paused',    'dst': 'resuming'},
                {'name': 'resumingFinished',    'src': 'resuming',  'dst': 'running'},
                {'name': 'abort',               'src': 'pausing',   'dst': 'stopped'},
                {'name': 'abort',               'src': 'starting',  'dst': 'stopped'},
                {'name': 'abort',               'src': 'resuming',  'dst': 'stopped'}
            ],
            'callbacks': default_callbacks
        }
        if 'PyQt5' in sys.modules:
            super().__init__(cfg=_stateDict, **kwargs)
        else:
            QtCore.QObject.__init__(self)
            Fysom.__init__(self, _stateDict)

        self.lock = Mutex()
        self.name = name
        self.interruptable = False
        self.success = False
        self.runner = runner
        self.ref = references
        self.config = config

        self.sigDoStart.connect(self._doStart, QtCore.Qt.QueuedConnection)
        self.sigDoPause.connect(self._doPause, QtCore.Qt.QueuedConnection)
        self.sigDoResume.connect(self._doResume, QtCore.Qt.QueuedConnection)
        self.sigDoFinish.connect(self._doFinish, QtCore.Qt.QueuedConnection)
        self.sigNextTaskStep.connect(self._doTaskStep, QtCore.Qt.QueuedConnection)
  def __init__(self, callbacks_dict):
    self.__NOT_IMPLEMENTED_ERROR = "Classes that inherit from KnittingPlugin should implment {0}"

    callbacks_dict = {
        'onknit': self.onknit,
        #'onknitting': self.onknitting,
        'onconfigure': self.onconfigure,
        'onfinish': self.onfinish,
        }
    Fysom.__init__(self,
        {'initial': 'activated',
         'events': [
             ## TODO: add more states for handling error management.
             {'name': 'configure', 'src': 'activated', 'dst': 'configured'},
             {'name': 'configure', 'src': 'configured', 'dst': 'configured'},
             {'name': 'configure', 'src': 'finished', 'dst': 'configured'},
             {'name': 'configure', 'src': 'error', 'dst': 'configured'},
             {'name': 'knit', 'src': 'configured', 'dst': 'knitting'},
             {'name': 'finish', 'src': 'knitting', 'dst': 'finished'},
             {'name': 'fail', 'src': 'knittng', 'dst': 'error'}
         ],
         'callbacks':  callbacks_dict
         })
예제 #12
0
    def __init__(self, callbacks_dict=None, interactive_callbacks=None):
        self.__NOT_IMPLEMENTED_ERROR = "Classes that inherit from KnittingPlugin should implement {0}"
        """Interactive callbacks handle Plugin-Frontend interaction hooks."""
        self.interactive_callbacks = {}

        # Are we running on CLI or knitlib web?
        # If no callbacks are registered, we set a CLI set as default.
        if interactive_callbacks is None:
            self.register_interactive_callbacks({
                "blocking_user_action": BaseKnittingPlugin.__cli_blocking_action,
                "message": BaseKnittingPlugin.__cli_emit_message,
                "progress": BaseKnittingPlugin.__cli_log_progress
            })
        else:
            self.register_interactive_callbacks(interactive_callbacks)

        # Fysom allows to set hooks before changing states, we set them here.
        if callbacks_dict is None:
            callbacks_dict = {
                'onknit': self.onknit,
                'onconfigure': self.onconfigure,
                'onfinish': self.onfinish,
            }
        Fysom.__init__(self, {
            'initial': 'activated',
            'events': [  # TODO: add more states for handling error management.
                         {'name': 'configure', 'src': 'activated', 'dst': 'configured'},
                         {'name': 'configure', 'src': 'configured', 'dst': 'configured'},
                         {'name': 'configure', 'src': 'finished', 'dst': 'configured'},
                         {'name': 'configure', 'src': 'error', 'dst': 'configured'},
                         {'name': 'knit', 'src': 'configured', 'dst': 'knitting'},
                         {'name': 'finish', 'src': 'knitting', 'dst': 'finished'},
                         {'name': 'finish', 'src': 'finished', 'dst': 'finished'},
                         {'name': 'fail', 'src': 'knitting', 'dst': 'error'}],
            'callbacks': callbacks_dict
        })
예제 #13
0
    def __init__(self, name, runner, references, config, **kwargs):
        """ Create an Interruptable task.
          @param str name: unique task name
          @param object runner: reference to the TaskRunner managing this task
          @param dict references: a dictionary of all required modules
          @param dict config: configuration dictionary
        """
        default_callbacks = {
            'onrun': self._start,
            'onpause': self._pause,
            'onresume': self._resume,
            'onfinish': self._finish
        }
        _stateDict = {
            'initial':
            'stopped',
            'events': [{
                'name': 'run',
                'src': 'stopped',
                'dst': 'starting'
            }, {
                'name': 'startingFinished',
                'src': 'starting',
                'dst': 'running'
            }, {
                'name': 'pause',
                'src': 'running',
                'dst': 'pausing'
            }, {
                'name': 'pausingFinished',
                'src': 'pausing',
                'dst': 'paused'
            }, {
                'name': 'finish',
                'src': 'running',
                'dst': 'finishing'
            }, {
                'name': 'finishingFinished',
                'src': 'finishing',
                'dst': 'stopped'
            }, {
                'name': 'resume',
                'src': 'paused',
                'dst': 'resuming'
            }, {
                'name': 'resumingFinished',
                'src': 'resuming',
                'dst': 'running'
            }, {
                'name': 'abort',
                'src': 'pausing',
                'dst': 'stopped'
            }, {
                'name': 'abort',
                'src': 'starting',
                'dst': 'stopped'
            }, {
                'name': 'abort',
                'src': 'resuming',
                'dst': 'stopped'
            }],
            'callbacks':
            default_callbacks
        }
        if 'PyQt5' in sys.modules:
            super().__init__(cfg=_stateDict, **kwargs)
        else:
            QtCore.QObject.__init__(self)
            Fysom.__init__(self, _stateDict)

        self.lock = Mutex()
        self.name = name
        self.interruptable = False
        self.success = False
        self.runner = runner
        self.ref = references
        self.config = config

        self.sigDoStart.connect(self._doStart, QtCore.Qt.QueuedConnection)
        self.sigDoPause.connect(self._doPause, QtCore.Qt.QueuedConnection)
        self.sigDoResume.connect(self._doResume, QtCore.Qt.QueuedConnection)
        self.sigDoFinish.connect(self._doFinish, QtCore.Qt.QueuedConnection)
        self.sigNextTaskStep.connect(self._doTaskStep,
                                     QtCore.Qt.QueuedConnection)
예제 #14
0
    def __init__(self, name, runner, references, config, **kwargs):
        """ Create an Interruptable task.
          @param str name: unique task name
          @param object runner: reference to the TaskRunner managing this task
          @param dict references: a dictionary of all required modules
          @param dict config: configuration dictionary
        """
        default_callbacks = {
            'onrun': self._start,
            'onpause': self._pause,
            'onresume': self._resume,
            'onfinish': self._finish,
            'onabort': self._abort
        }
        _stateDict = {
            'initial':
            'stopped',
            'events': [
                {
                    'name': 'run',
                    'src': 'stopped',
                    'dst': 'starting'
                },
                {
                    'name': 'startingFinished',
                    'src': 'starting',
                    'dst': 'running'
                },
                {
                    'name': 'pause',
                    'src': 'running',
                    'dst': 'pausing'
                },
                {
                    'name': 'pausingFinished',
                    'src': 'pausing',
                    'dst': 'paused'
                },
                {
                    'name': 'finish',
                    'src': 'running',
                    'dst': 'finishing'
                },
                {
                    'name': 'finishingFinished',
                    'src': 'finishing',
                    'dst': 'stopped'
                },
                {
                    'name': 'resume',
                    'src': 'paused',
                    'dst': 'resuming'
                },
                {
                    'name': 'resumingFinished',
                    'src': 'resuming',
                    'dst': 'running'
                },
                {
                    'name': 'abort',
                    'src': 'pausing',
                    'dst': 'stopped'
                },
                {
                    'name': 'abort',
                    'src': 'starting',
                    'dst': 'stopped'
                },
                {
                    'name': 'abort',
                    'src': 'resuming',
                    'dst': 'stopped'
                },
                {
                    'name': 'abort',
                    'src': 'running',
                    'dst': 'stopped'
                }  # added FB
            ],
            'callbacks':
            default_callbacks
        }
        if 'PyQt5' in sys.modules:
            super().__init__(cfg=_stateDict, **kwargs)
        else:
            QtCore.QObject.__init__(self)
            Fysom.__init__(self, _stateDict)

        self.lock = Mutex()
        self.name = name
        self.interruptable = False
        self.success = False
        self.runner = runner
        self.ref = references
        self.config = config
        self.aborted = False
        # class attribute self.aborted switches to True if self._abort is called.
        # This attribute needs to be read in the runTaskStep method of child classes of generic Task to stop execution
        # of a task without waiting for runTaskStep to be finished.

        self.sigDoStart.connect(self._doStart, QtCore.Qt.QueuedConnection)
        self.sigDoPause.connect(self._doPause, QtCore.Qt.QueuedConnection)
        self.sigDoResume.connect(self._doResume, QtCore.Qt.QueuedConnection)
        self.sigDoFinish.connect(self._doFinish, QtCore.Qt.QueuedConnection)
        self.sigNextTaskStep.connect(self._doTaskStep,
                                     QtCore.Qt.QueuedConnection)
예제 #15
0
파일: master_fsm.py 프로젝트: superzerg/CTS
    def __init__(self, fsm_table=setup_fsm.fsm_def.FSM_TABLE, options = None, logger_name=sys.modules['__main__'].__name__):
        """
        Initialise function of the generator FSM

        :param fsm_table: Table defining the FSM
        :param url:       IP address of the generator
        """

        callbacks = {'onbeforeallocate': self.onbeforeallocate,
                     'onnot_ready': self.onnot_ready,
                     'onbeforeconfigure': self.onbeforeconfigure,
                     'onstand_by': self.onstand_by,
                     'onbeforestart_run': self.onbeforestart_run,
                     'onready': self.onready,
                     'onbeforestart_trigger': self.onbeforestart_trigger,
                     'onrunning': self.onrunning,
                     'onbeforestop_trigger': self.onbeforestop_trigger,
                     'onbeforestop_run': self.onbeforestop_run,
                     'onbeforereset': self.onbeforereset,
                     'onbeforedeallocate': self.onbeforedeallocate}


        Fysom.__init__(self, cfg = fsm_table, callbacks = callbacks)

        # Set up the logger
        self.options = options
        self.logger = logging.getLogger(logger_name + '.master_fsm')
        self.logger.info('\t-|> Start the Master FSM')
        if not os.path.isfile(self.options['steering']['output_directory_basis']+"/run.p"):
            pickle.dump({'run_number': 0},
                        open(self.options['steering']['output_directory_basis'] + '/run.p', "wb"))

        self.run_number = pickle.load( open( self.options['steering']['output_directory_basis']+"/run.p", "rb" ) )['run_number']
        self.elements = {}
        # Initialise the setup_components
        if 'writer_configuration' in self.options.keys():
            # Append the path to the writer
            self.options['writer_configuration']['output_dir'] = self.options['steering']['output_directory']
            # Update few other parameters
            self.options['writer_configuration']['suffix'] = 'run_%d'%self.run_number
            if 'compression' in self.options['writer_configuration'].keys():
                self.options['writer_configuration']['comp_scheme'] = self.options['writer_configuration'].pop('compression')
            if 'number_of_thread' in self.options['writer_configuration'].keys():
                self.options['writer_configuration']['num_comp_threads'] = self.options['writer_configuration'].pop('number_of_thread')
            if 'number_of_events_per_file' in self.options['writer_configuration'].keys():
                self.options['writer_configuration']['max_evts_per_file'] = self.options['writer_configuration'].pop('number_of_events_per_file')
            if 'maximum_file_size' in self.options['writer_configuration'].keys():
                self.options['writer_configuration']['max_file_size'] = self.options['writer_configuration'].pop('maximum_file_size')
            elif 'max_evts_per_file' in self.options['writer_configuration'] and not ('maximum_file_size' in self.options['writer_configuration'].keys() ):
                self.options['writer_configuration']['max_file_size'] = 5000

                # Initialise the componant

            self.logger.debug('\t |--|> Update the writer configuration')
            for k,v in options['writer_configuration'].items():
                self.logger.debug('\t |--|--|> %s : %s'%(k,v))
            self.elements['writer'] = writer_fsm.WriterFsm(options=options['writer_configuration'],
                                          logger_name=logger_name,logger_dir=self.options['steering']['output_directory'] )

        # Initialise the setup_components
        if 'cts_configuration' in self.options.keys():
            self.elements['cts_core'] = cts_fsm.CTSFsm(options = options['cts_configuration'] ,
                                                            logger_name=logger_name )

        if 'camera_server_configuration' in self.options.keys():
            # Build the fadc board mapping and the internal remapping
            options['camera_server_configuration']['M']= ''
            options['camera_server_configuration']['N']= ''
            opt ,optN= '',''
            trigger_readout = []
            for c,fadcs in enumerate( options['camera_configuration']['fadcs']):
                if 'trigger_trace' in options['camera_server_configuration'].keys():
                    trigger_readout+=[30+c,33+c,36+c]
                for fadc in fadcs:
                    options['camera_server_configuration']['N'] +=optN + '%d'%(c*10+fadc)
                    optN = ','
                    if fadc%10 == 0 : continue
                    options['camera_server_configuration']['M'] +=opt + '%d'%(c*10+fadc)
                    opt =','
            for c in range(3):
                for fadc in range(10):
                    if (str(c*10+fadc) in options['camera_server_configuration']['N'].split(',')): continue
                    options['camera_server_configuration']['N'] += optN + '%d' % (c * 10 + fadc)
            opt = ','
            trigger_readout.sort()
            for t in trigger_readout:
                options['camera_server_configuration']['M'] += opt +'%d'%t
                opt = ','

            # now reformat M
            i = 0
            start_cnt = 0
            end_cnt = -1
            list_b = [int(b) for b in options['camera_server_configuration']['M'].split(',')]
            lists_consecutive_board=[]
            while i < len(list_b):
                if i == 0 : lists_consecutive_board.append([list_b[i]])
                elif list_b[i] != list_b[i-1]+1:
                    lists_consecutive_board.append([])
                    lists_consecutive_board[-1].append(list_b[i])
                    start_cnt=list_b[i-1]
                elif list_b[i] == list_b[i-1]+1 :
                    lists_consecutive_board[-1].append(list_b[i])
                i+=1
            options['camera_server_configuration']['M'] = ''
            opt = ''
            for list_bs in lists_consecutive_board:
                if list_bs[0]==list_bs[-1]:
                    options['camera_server_configuration']['M']+= opt+'%d'%(list_bs[0])
                else:
                    options['camera_server_configuration']['M']+=opt+'%d-%d'%(list_bs[0],list_bs[-1])
                opt = ','
            #if 'trigger_trace' in options['camera_server_configuration'].keys():
            #    options['camera_server_configuration']['M']+=',30-37'

            self.elements['camera_server'] = camera_server_fsm.CameraServerFsm(options=options['camera_server_configuration'],
                                          logger_name=logger_name,logger_dir=self.options['steering']['output_directory'])



        if 'generator_configuration' in self.options.keys():
            self.elements['generator'] = generator_fsm.GeneratorFsm(options=options['generator_configuration'],
                                          logger_name=logger_name )