Source Code Edit and Compile

Home        Test Report        Install and Execution        Hardware Setup Support        Source Code Edit and Compile



Source Code and Compile
for the
April 23, 2008
Prepared for:
University at Buffalo
Department of Computer Science and Engineering
Spring 2008
Prepared by:
Abhishek Chatterjee
Thomas Gayvert
Vaibhav Jain
Timothy Russell
Victoria Kaiser
Kevin Zbrzezny
Abdul Khan

X Keys Switch Interface
X Keys drivers must be installed before proper execution.
The switch interface translates a jell bean switch into a keyboard stoke.
The application is designed on keyboard strokes.  Each Jelly Button connected to the Switch Interface is assigned a keyboard press.
The corresponding Keyboard presses are setup using the X-Keys MacroWorksII program which is included with the manufactures drivers.
For installation of Disco we first setup the Interface by loading our X-Keys 'pre-setup' profile using MacroWorksII.
This profile sets the Jelly Bean Button switches to the correct keyboard press necessary for Disco.
For DISCO, eight buttons were designed into the application.  The following pairs match the Switch Interface # to the corresponding Keyboard stroke. -- Both Key Down and Key Up strokes must be setup in order for Disco to work correctly.

1 - q
2 - w
3 - e
4 - r
5 - a
6 - s
7 - d
8 - f

USB ERB-24 Setup and Installation
Install the drivers for the Relay using manufacturers CD.  Drivers can also be found on the manufacturers website.

UBDISCO08 was programmed in C# using Visual Studio 2005.
The following steps can be used to load the project.
Copy all source Files to working directory of your choice and then open the solution using Visual Studio.
For the Relays to properly function, one .dll file needs to be referenced in the solution explorer using visual studio.
Add reference 'MccDaq' to the solution if not already included.

Visual studio will now compile and run using visual studio.

Running UBDISCO08
See User manual and included video.

Source Code Setup:
The whole application is based on a few classes and two forms.

Form 1:The main GUI for therapist to use.
Includes all buttons, check-boxes, and displays to run program, all user input will be done through this Form.
Directly sends output control all user input.

Form 2: Includes a panel which displays video.  This will appear full screen on second monitor (when connected.)

Program: Includes main! Starting point of code.

OutputControl: This is by far the most important class and contains the "guts" of the application.
Receives all input from user using Form1.
This class is designed using 8 Boolean arrays which hold the value of selected or not selected.  These directly correspond to the check boxes on Form1 and are updated when necessary. (before every button press)
Using these arrays, when ever necessary, the values are extracted when a button is presses, and either turns on or leaves off the appropriate outlet.
This is where all classes pass information between for audio, and video.
This is also where function calls to MccDaq are which turn on the selected outlets when appropriate.

SoundPlayer: Holds functionality to load, turn on/off audio.
VideoPlayer: Hold functionality to load, turn on/off audio.
WebCamPlayer: Hold functionality to load, turn on/off web-cam.
XML...: Holds functionality to save and load profiles. Profiles are saved in XML format using C# classes and functionality.