Package SmootLight :: Package behaviors :: Module MobileShakeBehavior
[hide private]
[frames] | no frames]

Source Code for Module SmootLight.behaviors.MobileShakeBehavior

 1  from operationscore.Behavior import * 
 2  import util.ComponentRegistry as compReg 
 3  import util.Strings as Strings 
 4   
5 -class MobileShakeBehavior(Behavior):
6 - def behaviorInit(self):
7 self.mapper = None
8
9 - def processResponse(self, sensorInputs, recursiveInputs):
10 if self.mapper == None: 11 try: 12 self.mapper = compReg.getComponent('mobilegaussmap') 13 except KeyError: 14 pass 15 16 #print sensorInputs 17 for sInput in sensorInputs: 18 if 'Shake' in sInput and sInput['Shake'] == 1: 19 #print 'increase!' 20 self.mapper.argDict['Width'] += 30 21 #self.mapper.argDict['CutoffDist'] += 20 22 sInput['Shake'] = 0 23 print 'Width:' + str(compReg.getComponent('mobilegaussmap').argDict['Width']) 24 #print 'CutoffDist: '+ str(compReg.getComponent('mobilegaussmap').argDict['CutoffDist']) 25 26 return (sensorInputs, recursiveInputs)
27