def setUp(self): bqs.initBQS() b = ColorChangerBehavior({'Id': 'color','ColorList':[(255,0,0)]}) c = ColorChangerBehavior({'Id': 'color2', 'ColorList':[(0,0,255)]}) bqs.addBehavior(b) bqs.addBehavior(c) b.addInput({'Location':(3,4)}) c.addInput({'Location':(5,12)}) b.timeStep() c.timeStep()
def setUp(self): bqs.initBQS() b = ColorChangerBehavior({'Id': 'color', 'ColorList': [(255, 0, 0)]}) c = ColorChangerBehavior({'Id': 'color2', 'ColorList': [(0, 0, 255)]}) bqs.addBehavior(b) bqs.addBehavior(c) b.addInput({'Location': (3, 4)}) c.addInput({'Location': (5, 12)}) b.timeStep() c.timeStep()
def __init__(self, configFileName): main_log.info("System Initialization began based on: " + str(configFileName)) self.timer = clock.Stopwatch() self.timer.start() self.inputs = {} # dict of inputs and their bound behaviors, keyed by InputId self.behaviors = {} self.lock = thread.allocate_lock() self.behaviorOutputs = {} # key: [list of output destinations] self.behaviorInputs = {} self.componentDict = {} self.inputBehaviorRegistry = {} # inputid -> behaviors listening to that self.dieNow = False # input self.screen = Screen() compReg.initRegistry() compReg.registerComponent(self.screen, "Screen") # TODO: move to constants file bqs.initBQS() # initialize the behavior query system # read configs from xml config = configGetter.loadConfigFile(configFileName) rendererConfig = config.find("RendererConfiguration") self.initializeRenderers(rendererConfig) pixelConfig = config.find("PixelConfiguration") self.initializeScreen(pixelConfig) inputConfig = config.find("InputConfiguration") self.initializeInputs(inputConfig) behaviorConfig = config.find("BehaviorConfiguration") self.initializeBehaviors(behaviorConfig) mapperConfig = config.find("PixelMapperConfiguration") self.initializeMapper(mapperConfig) # inits main_log.info("All components initialized") # self.registerAllComponents() installationConfig = config.find("InstallationConfiguration") self.configureInstallation(installationConfig) # Done initializing. Lets start this thing! self.timer.stop() # main_log.info('Initialization done. Time: ', self.timer.elapsed(), 'ms') self.mainLoop()
def __init__(self, configFileName): main_log.info("System Initialization began based on: " + str(configFileName)) self.timer = clock.Stopwatch() self.timer.start() self.inputs = {} #dict of inputs and their bound behaviors, keyed by InputId self.behaviors = {} self.lock = thread.allocate_lock() self.behaviorOutputs = {} #key: [list of output destinations] self.behaviorInputs = {} self.componentDict = {} self.inputBehaviorRegistry = {} #inputid -> behaviors listening to that self.dieNow = False #input self.screen = Screen() compReg.initRegistry() compReg.registerComponent(self.screen, 'Screen') #TODO: move to constants file bqs.initBQS() #initialize the behavior query system #read configs from xml config = configGetter.loadConfigFile(configFileName) rendererConfig = config.find('RendererConfiguration') self.initializeRenderers(rendererConfig) pixelConfig = config.find('PixelConfiguration') self.initializeScreen(pixelConfig) inputConfig = config.find('InputConfiguration') self.initializeInputs(inputConfig) behaviorConfig = config.find('BehaviorConfiguration') self.initializeBehaviors(behaviorConfig) mapperConfig = config.find('PixelMapperConfiguration') self.initializeMapper(mapperConfig) #inits main_log.info('All components initialized') # self.registerAllComponents() installationConfig = config.find('InstallationConfiguration') self.configureInstallation(installationConfig) #Done initializing. Lets start this thing! self.timer.stop() #main_log.info('Initialization done. Time: ', self.timer.elapsed(), 'ms') self.mainLoop()
def tearDown(self): bqs.initBQS()