WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-25-2016, 06:47 PM
Vaquero Vaquero is offline
Member
 
Join Date: Nov 2015
Posts: 62
Question saving proximity events (onEnter,onExit) to file

Hey!
I've scripted an experiment based on the experiment framework in the examples. I have set up my sensor and targets and added them to the manager. Now I want to save the onEnter and onExit events to a file only when the experiment is in the testphase , but I'm lost on how to do that.

Code:
def EnterSensor(e):
    print 'Enter',e.sensor.name, contactManager.getActiveTargets(sensor=e.sensor) #DEBUG

def ExitSensor(e):
    print 'Exit',e.sensor.name, contactManager.getActiveTargets(sensor=e.sensor) #DEBUG
    
manager.onEnter(sensor, EnterSensor)
manager.onExit(sensor, ExitSensor)
Can I just move this code inside the experiment definition ( def experiment(): ) just before yielding the testphase? And instead of printing to console saving to a file that I opened in the experiment function before? I can only test it when I'm back in the lab and on a tight schedule.
Reply With Quote
 

Tags
proximity sensor


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fade in and fade out an audio file helena35 Vizard 5 05-30-2016 06:04 AM
Closing of an imported .py file Uttama_vizard Vizard 2 05-04-2010 06:18 AM
IVEx file extenstion unrecognised. sindi Vizard 2 12-10-2009 01:20 AM
Read file....many issues Uttama_vizard Vizard 9 07-08-2008 02:16 PM
File Management Uttama_vizard Vizard 2 07-01-2008 09:44 AM


All times are GMT -7. The time now is 12:57 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC