Exemplo n.º 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()
Exemplo n.º 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
Exemplo n.º 3
0
 def start(self):
     timestamp = PeriodicColumn()
     timestamp.configure({'parent':self.get_child('groups'),
                          'name':'timestamp',
                          'position':0,
                          'sort_order':'ascending',
                          'args':(),
                          'function':'self.scheduled_time'})
     self.collector.add_column(timestamp)
     self._groups = []
     for child in self.get_child('groups').children_nodes():
         if child.name != 'timestamp':
             self._groups.append(child)
     configs = [ColumnConfiguration()]
     configs[0].configure(timestamp.configuration())
     self._sort_groups()
     for i in range(0,len(self._groups)):
         group = self._groups[i]
         group.position = i+1
         self.collector.add_column(group)
         mata = {}
         if hasattr(group,'meta'):
             meta = group.meta
         configs.append(ColumnConfiguration(group.name,
                                            group.position,None,
                                            meta))
     self.log.configure(configs, self.minimum_size, self.maximum_size)
     column_data = self.log.data_manager.get_data()
     self._seqs = column_data.keys()
     self._seqs.sort()
     self._seqs.reverse()
     # seqs is list of config seqs starting with latest.
     self._configs = {}
     for seq in self._seqs:
         self._configs[seq] = {}
         for position in column_data[seq]:
             column = column_data[seq][position]
             if column['name'] in ('_seq','timestamp'):
                 continue
             self._configs[seq][column['name']] = column['meta']
     self.collector.start()
     CompositeNode.start(self)
Exemplo n.º 4
0
 def __init__(self,position,id,name,node):
     self._node = node
     self._label = name
     ColumnConfiguration.__init__(self,(id + '_' + str(position)),position)