Exemple #1
0
 def set(self,name,att,state):
     """
     This is called to set a coil's V or T or TR or I attribute to 
     the state argument.
     It simply looks up the instance in the coils vector and applies
     the coil's method with the state given as argument. Note that 
     the attribute is converted to an index to be passed to the coil's
     setFuncs vector to find the correct method to call.
     Once the user representation is updated, the bitMgr is called
     with the same arguments to update the NEXT bit vectors.
     usage:
     >>> a.set('M',State.Vol,State.l0)
     """
     self.coils[name].setFuncs[State.stateNeg2SetFuncIndex(att)](state)
     self.bitMgr.update(name,att,state)