Basic script commands (1) 1. Simple RecStandard RecNewPics 2. Start / stop recording OpenRec CloseRec 3. Playing a stimulus DisplayPic / HidePicture PlaySound / StopSound DisplayMsg / HideMessage 4.

Download Report

Transcript Basic script commands (1) 1. Simple RecStandard RecNewPics 2. Start / stop recording OpenRec CloseRec 3. Playing a stimulus DisplayPic / HidePicture PlaySound / StopSound DisplayMsg / HideMessage 4.

Basic script commands (1)
1. Simple
RecStandard
RecNewPics
2. Start / stop recording
OpenRec
CloseRec
3. Playing a stimulus
DisplayPic / HidePicture
PlaySound / StopSound
DisplayMsg / HideMessage
4. Waiting for an event
WaitForKeyPress
WaitForTabZoneAt
Hands on scripts…
10-12 April 2012, Mshs, University of Poitiers, France
1. Simple
This is the only script command family that “internally” manages start and stop of recording.
1.1. RecStandard(AddToParticipantName)
Launches the Simple acquisition from script.
Data will be recorded into files named from the participant’s Id.
Replace optional parameters AddToParticipantName with something you want to
add to the participant’s Id to name data files.
The script command RecStandard(_trial) will record data into a file named
“testwin7_trial”.
10-12 April 2012, Mshs, University of Poitiers, France
1.2. RecNewPics(AddToParticipantName, BackPic, Pic1, Pic2)
Launches the Simple acquisition, specifying the background picture, pictures
associated with the first and second trigger zones.
Command example: RecNewPics(_P2,YellowBack.bmp,Capsela.bmp,car.bmp)
The editor Command | Simple acquisition | RecNewPics menu opens this dialog box:
Optional (no value required)
The dialog box retrieves
the Simple configuration
panel options
Insert resulting command in the script editor
10-12 April 2012, Mshs, University of Poitiers, France
Example of use:
Launching the Simple recording many times (same task), only changing pictures
used.
Script example:
RecNewPics(_Trial1,BackGnd.bmp,Stimulus1.bmp,nothing.bmp)
RecNewPics(_Trial2,BackGnd.bmp,Stimulus2.bmp,nothing.bmp)
RecNewPics(_Trial3,BackGnd.bmp,Stimulus3.bmp,nothing.bmp)
In this example, only picture associated with trigger zone 1 is changed.
Background picture and picture associated with trigger zone 2 is always the same.
For each participant, 3 recordings will be performed (3 data files):
<ParticipantName>_Trial1
<ParticipantName>_Trial2
<ParticipantName>_Trial3
10-12 April 2012, Mshs, University of Poitiers, France
2. Start / stop recording
These commands can be issued multiple times to perform several successive data acquisition.
2.1. OpenRec(AddToParticipantName)
Launches the acquisition: starts tablet (and optionally eye tracker) data recording.
The recording will go on until a command explicitly stop it or script is over.
Any command “pausing” script execution will not pause recording: recording is
performed in parallel with script execution.
Trying to open an acquisition while another is already in progress will close the
first one before opening the second.
Data will be recorded into files named from the participant’s Id.
Replace optional parameters AddToParticipantName with something you want to
add to the participant’s Id to name data files.
10-12 April 2012, Mshs, University of Poitiers, France
Example:
The script command OpenRec(_trial) will record data into files named “testwin7_trial”.
2.2. CloseRec
Stops the acquisition and closes data file.
10-12 April 2012, Mshs, University of Poitiers, France
OPenRec / CloseRec and the acquisition sequence…
Acquisition
starts
Script
Acquisition
stops
…
“OpenRec”
command
…
“CloseRec”
command
…
Script ends
(Pre-writing pause)
Tablet is
activated
Eye-tracker
is activated
…
Session log file
is opened
Recording
starts
…
(do something)
Recording
stops
…
Tablet is
deactivated
Eye-tracker is
deactivated
Log file is
closed
10-12 April 2012, Mshs, University of Poitiers, France
OPenRec/CloseRec and timing …
•
The recording timer starts immediately when the command OpenRec is activated
or when the “Simple” acquisition (RecStandard, etc.) is executed.
•
Each new data file (i.e. recording) starts at hour zero.
(Acquisition starts)
“Go”
“OpenRec”
Data files
0
“CloseRec” “OpenRec”
7814
0
“CloseRec”
4898
Time
10-12 April 2012, Mshs, University of Poitiers, France
3. Playing a stimulus
3.1. DisplayPic(PictureFileName,Duration,X,Y)
Displays the picture PictureFileName on screen at location X,Y for Duration
milliseconds.
Example: DisplayPic(MyPicture.bmp,5000,0,0)
Translation: the picture MyPicture.bmp is displayed on screen in the upper left hand
corner of the screen (coordinates 0,0) for 5 seconds.
Magic values
Script accepts the magic value ”-1” as a parameter value for:
 Duration : “-1” means “forever”
 Screen coordinates: “-1” means “auto-center in screen”
Example: DisplayPic(MyPicture.bmp,-1,-1,-1)
Translation: the picture MyPicture.bmp is displayed centered on screen. Script execution
will go on, leaving the picture on screen.
3.2. HidePicture
Removes pictures previously displayed with DisplayPic. Screen background is restored.
10-12 April 2012, Mshs, University of Poitiers, France
3.3. PlaySound(WaveFileName,Wait)
Plays the sound file WaveFileName.
If the parameter Wait is replaced with “TRUE”, the script interpretor will wait until
the sound is finished. Otherwise (“FALSE”), it will resume script execution.
Example: PlaySound(dictation.wav,FALSE)
Translation: the sound file Dictation.wav is played and script execution will
immediately continue.
Example of use: a (previously recorded) dictation is played, while tablet data is being
recorded.
3.4. StopSound
Stops the sound file currently played.
10-12 April 2012, Mshs, University of Poitiers, France
3.5. DisplayMsg(Message,Duration,X,Y,Transparent)
Displays the text Message on screen at location X,Y for Duration milliseconds.
If the parameter Transparent is replaced with “FALSE”, the message will be displayed
on a stripe colored with the font background color, otherwise (“FALSE”), only the
characters will be displayed on screen.
Example: DisplayMsg(Welcome to my lab !,4000,-1-1,FALSE)
Translation: the message “Welcome to my lab !” will be displayed centered on
screen for 4 seconds.
Peculiarities:
 The message is a single line of text.
 Only one message can be displayed at a time.
3.6. HideMessage
Removes the message previously displayed on screen.
10-12 April 2012, Mshs, University of Poitiers, France
4. Waiting for an event (participant action)
Some commands tells the script interpretor to stop reading script (pause) until a certain
event happens. These commands are mainly grouped into the “Wait” category.
These commands do not pause an acquisition / recording but only the script interpretor.
4.1. WaitForkeypress
Stops script execution until a key of the keyboard is pressed.
4.2. WaitForTabZoneAt(x1,y1,x2,y2,CanDraw,MustLeave)
Stops script execution until the pentip is pressed into the area located at tablet coordinates
X1,y1,x2,y2. If the parameter CanDraw is set to “TRUE”, the participant's writing is
displayed on screen. If the parameter CanDraw is set to “TRUE”, the pentip must be
removed from the area before the script execution can resume.
Figure: Command | Wait | WaitForTabZoneAt dialog box
10-12 April 2012, Mshs, University of Poitiers, France
Hands on scripts
Exercise 1
Write a script such that a dictation takes place.
An instruction is given to participant. (S)He’ll press a key when ready to write.
The dictation (pre-recorded sound file “dictation.wav”) will start and tablet data
will be recorded. Handwriting will be displayed on screen.
DisplayMsg(This is a dictation exercise.,4000,-1,-1,TRUE)
DisplayMsg(Press a key when ready to begin…,-1,-1,-1,TRUE)
WaitForKeyPress
OpenRec(_dictation)
PlaySound(Dictation.wav,FALSE)
HideMessage
Explain exercise
Get ready…
Wait until a keyboard key is pressed
Start tablet recording, play sound and
continue script execution
Remove message from screen
Script execution is suspended until the pen
WaitForTabZoneAt(35596,21022,44697,27932,TRUE,FALSE) is pressed into the area mentioned. During
this time, writing is displayed on screen.
CloseRec
Stop tablet recording
10-12 April 2012, Mshs, University of Poitiers, France
Exercise 2
Write a script such that a picture is displayed for 5 seconds,
then the participant writes a description of the picture.
An instruction should be given to the participant to explain what (s)he has to do.
We don’t want handwriting to be displayed on screen.
Tablet data will be recorded for the duration of description writing.
DisplayMsg(A picture will be displayed for 5 seconds.,4000,-1,-1,TRUE)
DisplayMsg(As soon as this picture will disappear\, you will write down a description.,5000,-1,-1,TRUE)
DisplayMsg(When you’re finished\, press the pentip in the area labeled “End”,4000,-1,-1,TRUE)
DisplayMsg(Press a key when ready to begin…,-1,-1,-1,TRUE)
WaitForKeypress
HideMessage
OpenRec(_island)
DisplayPic(ile.bmp,5000,0,0)
WaitForTabZoneAt(35596,21022,44697,27932,TRUE,FALSE)
CloseRec
10-12 April 2012, Mshs, University of Poitiers, France
Other commands of the Wait category (not presented here) are convenient
mixtures of basic commands.
For example, WaitForKeyPressPic is a combination of WaitForKeypress and
DisplayPic.
10-12 April 2012, Mshs, University of Poitiers, France
A few advices

Simple is better: complex script is prone to errors and participant may misunderstand the
task.
 Dirty-and-effective: sometimes, a good old cut-and-paste of blocs of script is more
effective and secure than spending hours building complex loops.
 Do not wait until whole script is written to test it. Probing for errors will be easier.
 Carefully check what data will be recorded.
For example, should time spend to watch a picture be included in pre-writing pause or not
(it may also depend whether eye movements are recorded or not). This will determine
where OpenRec command will be inserted in script.
 Displaying writing on screen is not always desirable. This is resources and time consuming
for the computer and it may perturb participant.
10-12 April 2012, Mshs, University of Poitiers, France