Welcome Guest, you are in: Login

EventIDE Wiki

RSSRSS

Navigation




Search the wiki


PoweredBy

Page History: Code snippets

Compare Page Revisions



« Older Revision - Back to Page History - Newer Revision »


Page Revision: 2011/08/08 10:08


Coding requirements are minimal due to the feature-based build of EventIDE, but some simple coding is required in order to manipulate parameters and to create conditional events.


Description

The code language used in EventIDE is C# (C sharp). See Wikipedia for basic information and syntax. In the bottom middle panel of the EventIDE window sits the Code Snippet boxes. Double clicking on these boxes will bring up the code in the main central panel. The snippet boxes at the level of Experiment are always visible. Clicking on different events will display the snippet boxes relating to that particular event (and any Button or Serial port elements that may be attached to this event).

Practical Use

Experimental Level

Header: In the Experiment Header, all global variables are defined. Any variables that are defined here by keywords (boolean, integer, string etc - see Wikipedia for all C# keywords) can then be used in other snippets. Adding the key word 'public' before any variable means that it will then be displayed in the parameter list.

Special (XAML): XAML code can be used to bind statistics and display this information on an operator screen.

Initializing: At this level, the values of any counters that are used in the experiment should be set to an appropriate value (i.e 0).

Running:

Finalizing:



Event Level

Condition: Any event that is set to be triggered by a condition becoming true, should have this condition made explicit in this code snippet box. For example, if 8 pictures are to be shown one after the other, and all these pictures are listed as elements within the same event, the event should be initialised only whilst the counter is less than 8. In this condition box then would be something of the form 'Counter1<8' and Counter1 would have been defined in the Experiment Header, and set to 0 in the Experiment Initializing code snippet box.

Initializing (Preparing):

Activating: Code in this snippet box outlines what any counters etc should do after being activated. Counter++ for example will mean that the counter goes up by one. Any parameters manipulation should also be defined in this code snippet box.

Activated: Any conditions that determine which element within a particular event should be activated should be coded here. If this event were a feedback event, where correct or incorrect feedback would be given depending on the trial result, then this would be coded in this box in the form of, for example:

 if (TrialResult==1)
Feedback=1
 
if(TrialResult==2)
Feedback=2 

Running: The outcome of any button presses etc should be defined in these code snippets, for example if a participant has to choose between responding left or right, then the reaction time for either button may be recorded and defined as RT, and the response button will determine which feedback a participant may receive. Thus it is necessary to define what each button press means.

Deactivated: In this code snippet box, the outcome of the experiment is defined and the trial result recorded.

ScrewTurn Wiki version 5.2.0.8. Some of the icons created by FamFamFam.