Jump to content

Programming Reference:BCI2000 Source Code: Difference between revisions

From BCI2000 Wiki
Mellinger (talk | contribs)
Mellinger (talk | contribs)
No edit summary
Line 10: Line 10:
== TortoiseSVN Client ==
== TortoiseSVN Client ==
For Win32 platforms, we recommend [http://www.tortoisesvn.org TortoiseSVN], a comfortable-to-use SVN client integrated into the Explorer shell.
For Win32 platforms, we recommend [http://www.tortoisesvn.org TortoiseSVN], a comfortable-to-use SVN client integrated into the Explorer shell.
==Downloading the BCI2000 source as an archive==
For users who have difficulties accessing the BCI2000 source via SVN, there is a copy of the source repository available for download at http://{{SERVERNAME}}/downloads/src/BCI2000src.tgz . This copy reflects the current revision of the BCI2000 source, and is updated daily.


==Howto Pages==
==Howto Pages==

Revision as of 14:20, 18 May 2010

Version Management

The BCI2000 source code is managed with the help of Subversion, an open-source cross-platform versioning tool widely used in various kinds of projects.

Subversion (SVN) uses the HTTP-based WebDAV protocol, so even web browsers may be used to browse directories and files. Still, a true SVN client software is required to access all features of the versioning system.

Browsing the Source Code Repository Online

Online viewing, and comparison of different versions of all source code files, is possible with a web browser (http://www.bci2000.org/tracproj/browser). (If you get a message about "viewing privileges", click the "login" link at the top right to log in.)

TortoiseSVN Client

For Win32 platforms, we recommend TortoiseSVN, a comfortable-to-use SVN client integrated into the Explorer shell.

Downloading the BCI2000 source as an archive

For users who have difficulties accessing the BCI2000 source via SVN, there is a copy of the source repository available for download at http://www.bci2000.org/downloads/src/BCI2000src.tgz . This copy reflects the current revision of the BCI2000 source, and is updated daily.

Howto Pages

Directory Layout

The SVN directory layout matches that of the BCI2000 binary distribution, and is as follows:

batch on-line system startup scripts
data online data output
doc information, HTML help files
parms on-line system parameter files
prog on-line system executables
tools off-line analysis tools
src source code

The src subtree is not present in the binary distribution--it holds the BCI2000 source code. Below src, there should be no end-user executables, compiled LaTeX files, or pdf files converted from editable formats. Rather, their source files should go below src, and their end-user versions go into either prog, doc, or the appropriate end-user directory below tools. In all makefiles or project files that are relevant to the binary distribution, the compiled output is directed into the appropriate executable directory (prog or tools/mytool).

The organization of the src subtree itself is as follows:

src/buildutils

Holds small utility programs that are used for maintenance.

src/buildutils/tests

Scripts and data used to test executables during the build phase (make test).

src/contrib

Source code and project files from the Contributions section. Paralleling organization of the core directory, there are subdirectories for application, signal processing, and source modules, and for tools. An additional directory, AppConnector, contains programs connecting via the App Connector interface.

Each project from the contrib directory should have its own documentation page accessible through the Contributions:Contents hierarchy.

By default, contrib projects are excluded from the build process. For information about how to compile and use a piece of software located in the contrib directory, see the Building BCI2000 Howto page.

src/core

Source code and project files for the BCI2000 core distribution. Below this directory, there are subdirectories for the Operator module, core modules, and tools.

src/shared

Core and contrib directories only contain project files (resp. make files), and source code that is unique to the respective piece of software. BCI2000 framework code is contained below the "shared" directory.

Inside the "shared" directory, code is organized into subdirectories as follows:

  • accessors
contains code related to the Environment accessor layer,
  • bcistream
provides code for the bcierr, bciout, and bcidbg output streams, and error handling,
  • config
contains configuration and versioning information in form of header files,
  • fileio
contains code dealing with directories and files, and its subdirectories represent data formats used for output and input,
  • gui
provides a very basic platform-independent interface layer to graphical elements.
  • modules
holds code that is common to core modules, and one subdirectory for common code from each application, signal processing, and source modules. Most BCI2000 filters are located inside those subdirectories.
  • obj
holds pre-compiled header files during make and build processes,
  • types
contains BCI2000-specific data types that may be sent through BCI2000 messages, such as signals, parameters, and states.
  • utils
contains miscellaneous utility classes and functions.

src/extlib

Unlike the shared directory, this directory contains libraries, or interfaces to libraries, that are used by BCI2000 but not part of BCI2000 itself. Typically, the code in extlib is independent of BCI2000, and in most cases external to the BCI2000 project, e.g. provided by library vendors.

src/doc

Contents of this directory are related to the production of documentation, they do not represent documentation itself. Its figures subdirectory holds original vector format versions of PNG files uploaded into the wiki, and additional versioned copies of those PNG files. wiki2help contains maintenance software related to the conversion of Wiki pages into the HTML help files located in the BCI2000 distribution's doc/htmlhelp directory.

Coding Guidelines

We maintain a loose set of guidelines/rules that is aimed at readability and maintenance efficiency. These rules are not obligatory but we ask contributors to consider them before handing in their code.

See also

SVN Client Setup, Using TortoiseSVN, Building BCI2000