Changeset 13805 for fact


Ignore:
Timestamp:
05/21/12 16:14:18 (12 years ago)
Author:
neise
Message:
FactDimServers keep a list of 10000 state changes and store the time of the last state change
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/PyDimCtrl/fpydim.py

    r13793 r13805  
    2222        """ sets name of instance to name of server, all uppercase
    2323        """
     24        self.list_of_states = []
    2425        self.name = name.upper()
    2526        self.print_state = False
     
    8990        except ValueError:
    9091            self.stn = None
     92           
     93        self.last_st_change = time.time()
     94        self.list_of_states.append( (self.last_st_change, self.stn) )
     95        if len(self.list_of_states) > 10000:
     96            print "list_of_states too long, truncating..."
     97            self.list_of_states = self.list_of_states[1000:]
    9198        if self.print_state:
    9299            print state
     
    290297            add_getter(FactDimServerClasses[-1], cmd)
    291298
     299
     300
    292301# create an instace of each of the classes
    293302# and make it globally known, i.e. known to the Python interpreter
Note: See TracChangeset for help on using the changeset viewer.