Commits

German Larrain committed 07f0c1e

simulator.Simulation: added 'sender' argument to 'dispatcher.send' calls.

Comments (0)

Files changed (1)

ars/model/simulator/__init__.py

 	def on_idle(self):
 		self.num_frame += 1
 
+		# before each visualization frame
 		try:
-			dispatcher.send(signals.SIM_PRE_FRAME) # before each visualization frame
+			dispatcher.send(signals.SIM_PRE_FRAME, sender=self)
 		except Exception as e:
 			print(e)
 
 		self.perform_sim_steps_per_frame()
 
+		# after each visualization frame
 		try:
-			dispatcher.send(signals.SIM_POST_FRAME) # after each visualization frame
+			dispatcher.send(signals.SIM_POST_FRAME, sender=self)
 		except Exception as e:
 			print(e)
 
 			# before each integration step of the physics engine
 			try:
 				# send the signal so subscribers do their stuff in time
-				dispatcher.send(signals.SIM_PRE_STEP)
+				dispatcher.send(signals.SIM_PRE_STEP, sender=self)
 				# call all registered functions before each step of the next frame
 				for callback_ in self.all_frame_steps_callbacks:
 					callback_()
 
 			# after each integration step of the physics engine
 			try:
-				dispatcher.send(signals.SIM_POST_STEP)
+				dispatcher.send(signals.SIM_POST_STEP, sender=self)
 			except Exception as e:
 				print(e)