Beispiel #1
0
 def configure(self,config):
     # Use the register maps to create all of the SCD2000's inherent
     # children.
     CachedION.configure(self,config)
     # Scale the system_frequency from 'raw' values to Hz.
     h = self.ScaledION()
     h.configure({'name':'Hz','parent':self.get_child('system_frequency'),
                  'multiplier':100.0})
Beispiel #2
0
 def configure(self,config):
     # Use the register maps to create all of the inherent children.
     CachedION.configure(self,config)
     # Scale the system_frequency from 'raw' values to Hz.
     h = self.ScaledION()
     h.configure({'name':'scaler',
                  'parent':self.get_child('avr_vscale'),
                  'multiplier':1000.0})
     h = self.ScaledION()
     h.configure({'name':'V',
                  'parent':self.get_child('batt_volts'),
                  'multiplier':10.0})
     h = self.ScaledION()
     h.configure({'name':'V',
                  'parent':self.get_child('batt_volts_h'),
                  'multiplier':10.0})
     h = self.ScaledION()
     h.configure({'name':'V',
                  'parent':self.get_child('batt_volts_hsp'),
                  'multiplier':10.0})
     h = self.ScaledION()
     h.configure({'name':'V',
                  'parent':self.get_child('batt_volts_l'),
                  'multiplier':10.0})
     h = self.ScaledION()
     h.configure({'name':'V',
                  'parent':self.get_child('batt_volts_lsp'),
                  'multiplier':10.0})
     h = self.ScaledION()
     h.configure({'name':'Hz',
                  'parent':self.get_child('freq'),
                  'multiplier':10.0})
     h = self.ScaledION()
     h.configure({'name':'Hz',
                  'parent':self.get_child('freq_h'),
                  'multiplier':10.0})
     h = self.ScaledION()
     h.configure({'name':'Hz',
                  'parent':self.get_child('freq_hsp'),
                  'multiplier':10.0})
     h = self.ScaledION()
     h.configure({'name':'Hz',
                  'parent':self.get_child('freq_l'),
                  'multiplier':10.0})
     h = self.ScaledION()
     h.configure({'name':'Hz',
                  'parent':self.get_child('freq_lsp'),
                  'multiplier':10.0})
     h = self.ScaledION()
     h.configure({'name':'scaler',
                  'parent':self.get_child('gvscale'),
                  'multiplier':10.0})
Beispiel #3
0
 def start(self):
     if self.debug: print 'start generic device: ', self.name
     self.maps = {}
     # insert the default boundries due to point type ranges
     self.maps[1]     = ([], 1.0)
     self.maps[10001] = ([], 1.0)
     self.maps[30001] = ([], 1.0)
     self.maps[40001] = ([], 1.0)
     if self.debug: print self.maps 
     for b in self.boundries:
         if self.debug: print b
         self.maps[int(b['register'])] = ([], float(b['ttl'])) #overwrite any default 1 sec TTL if desired
     if self.debug: print self.maps
     #todo:
     # deal with excludes
     CachedION.start(self) #let the children play (and ask find_cache_for)
     self.split_long_caches()
     if self.debug: print self.maps
     self._register_maps = self.maps.values()
     self._define_caches(self.holding_register_maps())
     #del self.maps
     if self.debug: print 'started generic device: ', self.name
Beispiel #4
0
 def start(self):
     if self.debug: print 'start generic device: ', self.name
     self.maps = {}
     # insert the default boundries due to point type ranges
     self.maps[1] = ([], 1.0)
     self.maps[10001] = ([], 1.0)
     self.maps[30001] = ([], 1.0)
     self.maps[40001] = ([], 1.0)
     if self.debug: print self.maps
     for b in self.boundries:
         if self.debug: print b
         self.maps[int(b['register'])] = ([], float(
             b['ttl']))  #overwrite any default 1 sec TTL if desired
     if self.debug: print self.maps
     #todo:
     # deal with excludes
     CachedION.start(self)  #let the children play (and ask find_cache_for)
     self.split_long_caches()
     if self.debug: print self.maps
     self._register_maps = self.maps.values()
     self._define_caches(self.holding_register_maps())
     #del self.maps
     if self.debug: print 'started generic device: ', self.name
Beispiel #5
0
 def configuration(self):
     config = CachedION.configuration(self)
     get_attribute(self, 'address', config, str)
     get_attribute(self, 'line_handler', config, str)
     get_attribute(self, 'boundries', config, str)
     get_attribute(self, 'exclude', config, str)
     get_attribute(self, 'debug', config, str)
     get_attribute(self, 'split_cache_at_gaps', config, str)
     get_attribute(self, 'use_batch_manager', config, str)
     get_attribute(self, 'maximum_coils', config, str)
     get_attribute(self, 'maximum_input_status', config, str)
     get_attribute(self, 'maximum_holding_registers', config, str)
     get_attribute(self, 'maximum_input_registers', config, str)
     get_attribute(self, 'maps', config, str)
     return config
Beispiel #6
0
 def configuration(self):
     config = CachedION.configuration(self)
     get_attribute(self, 'address', config, str)
     get_attribute(self, 'line_handler', config, str)
     get_attribute(self, 'boundries', config, str)
     get_attribute(self, 'exclude', config, str)
     get_attribute(self, 'debug', config, str)
     get_attribute(self, 'split_cache_at_gaps', config, str)
     get_attribute(self, 'use_batch_manager', config, str)
     get_attribute(self, 'maximum_coils', config, str)
     get_attribute(self, 'maximum_input_status', config, str)
     get_attribute(self, 'maximum_holding_registers', config, str)
     get_attribute(self, 'maximum_input_registers', config, str)
     get_attribute(self, 'maps', config, str)
     return config
Beispiel #7
0
 def configure(self, config):
     # Use the register maps to create all of the inherent children.
     CachedION.configure(self, config)
     # Scale the system_frequency from 'raw' values to Hz.
     h = self.ScaledION()
     h.configure({
         'name': 'scaler',
         'parent': self.get_child('avr_vscale'),
         'multiplier': 1000.0
     })
     h = self.ScaledION()
     h.configure({
         'name': 'V',
         'parent': self.get_child('batt_volts'),
         'multiplier': 10.0
     })
     h = self.ScaledION()
     h.configure({
         'name': 'V',
         'parent': self.get_child('batt_volts_h'),
         'multiplier': 10.0
     })
     h = self.ScaledION()
     h.configure({
         'name': 'V',
         'parent': self.get_child('batt_volts_hsp'),
         'multiplier': 10.0
     })
     h = self.ScaledION()
     h.configure({
         'name': 'V',
         'parent': self.get_child('batt_volts_l'),
         'multiplier': 10.0
     })
     h = self.ScaledION()
     h.configure({
         'name': 'V',
         'parent': self.get_child('batt_volts_lsp'),
         'multiplier': 10.0
     })
     h = self.ScaledION()
     h.configure({
         'name': 'Hz',
         'parent': self.get_child('freq'),
         'multiplier': 10.0
     })
     h = self.ScaledION()
     h.configure({
         'name': 'Hz',
         'parent': self.get_child('freq_h'),
         'multiplier': 10.0
     })
     h = self.ScaledION()
     h.configure({
         'name': 'Hz',
         'parent': self.get_child('freq_hsp'),
         'multiplier': 10.0
     })
     h = self.ScaledION()
     h.configure({
         'name': 'Hz',
         'parent': self.get_child('freq_l'),
         'multiplier': 10.0
     })
     h = self.ScaledION()
     h.configure({
         'name': 'Hz',
         'parent': self.get_child('freq_lsp'),
         'multiplier': 10.0
     })
     h = self.ScaledION()
     h.configure({
         'name': 'scaler',
         'parent': self.get_child('gvscale'),
         'multiplier': 10.0
     })
Beispiel #8
0
 def __init__(self):
     CachedION.__init__(self)
     self.debug = 0
     self.use_batch_manager = 0
Beispiel #9
0
 def __init__(self):
     CachedION.__init__(self)
     self.debug = 0
     self.use_batch_manager = 0