예제 #1
0
 def start(self):
     CompositeNode.start(self)
     next_position = 0
     timestamp = PeriodicColumn()
     timestamp.configure({'parent':self.get_child('recorders'),
                          'name':'timestamp',
                          'position':next_position,
                          'sort_order':'ascending',
                          'args':(),
                          'function':self.scheduled_time})
     timestamp.sequence = 0
     sequences = []
     for child in self.get_child('recorders').children_nodes():
         if child.__class__ == Recorder:
             if child.sequence in sequences:
                 raise EConfiguration(
                     'Conflicting RecorderSet sequence %s on %r' %
                     (child.sequence, child.name))
         sequences.append(child.sequence)
     # Force Timestamp as column '0'.
     self.collector.add_column(timestamp)
     children = self.get_child('recorders').children_nodes()
     children.sort(_sort)
     for child in children:
         if child.__class__ == Recorder:
             for channel in child.channels():
                 next_position += 1
                 channel.position = next_position
                 self.collector.add_column(channel)
     cc = ColumnConfiguration()
     cc.configure(timestamp.configuration())
     self.log.configure([cc]+self.collector.columns[1:],
                        self.minimum_size,self.maximum_size)
     self.collector.start()
예제 #2
0
 def start(self):
     if self.has_child('columns'):
         _positions = []
         columns = []
         for child in self.get_child('columns').children_nodes():
             if child.position in _positions:
                 raise EConfiguration(('One or more columns ' + 
                                       'have the same position'))
             _positions.append(child.position)
             column = ColumnConfiguration()
             column.configure(child.configuration())
             columns.append(column)
         _positions.sort()
         if _positions != range(0,len(_positions)):
             raise EConfiguration((
                 'Columns do not have consecutive positions this '
                 'can be caused by having two columns with the same name.'
                 ))
         self.log.configure(columns,self.minimum_size,self.maximum_size)
     else:
         self.log.set_limits(self.minimum_size,self.maximum_size)
     self.log.start_trimming() # Turn log trimming on now that sizes are set
     self.forwarder.start_forwarding(self.log)
     ServiceNode.start(self)
     return