Base project for MSVC

Forum for software developers to discuss BCI2000 software development
Locked
alenhardt
Posts: 11
Joined: 29 Nov 2007, 09:31

Base project for MSVC

Post by alenhardt » 08 Jun 2009, 11:26

Hello community!

I thought it might be worth posting my base project for Visual C++ that can be used to implement your own BCI2k modules.
Be aware that QMake (part of Qt build environment) is used but it is not really a prerequisit. If you dont have QMake and neither want to install it, there is a seperate file that does not depend on QMake. You will have to modify all the path settings manually though (which is a bit painful). Its much easier with QMake.

Instructions for QMake (.pro/.pri files are documented):
  • Modify bci2k.pri to point to your source path of BCI2000
  • Change the MODTYPE variable inBCI2kSkeleton.pro to match the type of module your want to implement
  • Compile using MSVC IDE or run "qmake && nmake" on the commandline
Instructions for pure MSVC:
  • Modify all your include paths to point to the correct BCI2000 source location
  • Change the MODTYPE define under the preprocessor tab to match your module
Anyway, here is the link (rename the files to .zip after downloading):
http://ni.www.techfak.uni-bielefeld.de/ ... ndSnippets

If you encounter any issues, let me know.

Best,
Alex

griffin.milsap
Posts: 58
Joined: 08 Jun 2009, 12:42

Wonderful!

Post by griffin.milsap » 08 Jun 2009, 12:49

Hey Alex,

I'm currently working on just the same thing, though it appears that you've beat me to it :P.

I'm working at the Wadsworth center toward the next (minor) version of BCI2000. We're aiming to have cross compiler support for all projects.

I've already got all of the signal processing modules and signal generator compiling in Borland/MSVC/GCC, via CMake, but I couldn't help but notice that you're using qmake to generate the project files. Does this mean that you've been using Qt as well?

See, I'm stuck on a few of the modules because they have VCL dependencies, and we're investigating and leaning toward Qt to replace this. I'm having difficulty merging the Qt and BCI2000 main loop, and I was wondering if you had done anything of the sort.

Anyway, great work on the MSVC Skeleton. It looks pretty polished!

-Griff

alenhardt
Posts: 11
Joined: 29 Nov 2007, 09:31

Re: Wonderful!

Post by alenhardt » 09 Jun 2009, 08:22

griffin.milsap wrote: See, I'm stuck on a few of the modules because they have VCL dependencies, and we're investigating and leaning toward Qt to replace this. I'm having difficulty merging the Qt and BCI2000 main loop, and I was wondering if you had done anything of the sort.
Ohh, I'd love to see BCI2k using Qt! And to be honest, I already tried to hack around the existing mainloop and run it from Qt's eventloop. I didnt continue the development because I'm pretty tight on my dissertations schedule.
But basically thats the same problem I was stuck on. It is possible but to make it releasable code, you really want to completely rewrite the codebase (at least the CoreModule stuff) to make full use of Qt.
Unfortunatly, when you rewrite parts of the CoreModule for Qt compatibility it also means that other classes need rewrites because they depend on certain implementations in the CoreModule.
So it is a time intensive task.

In the long run I think the project would surely benefit from a complete port to Qt. And if I had the time, I'd really love to help porting it. Lets see if I get my dissertation finished this year :wink:

I think know the Qt framework quite well (I'm not an expert but i used it alot), so if you have specific questions dont hestitate to ask.

Best,
Alex

alenhardt
Posts: 11
Joined: 29 Nov 2007, 09:31

Re: Wonderful!

Post by alenhardt » 21 Jul 2009, 11:06

griffin.milsap wrote: See, I'm stuck on a few of the modules because they have VCL dependencies, and we're investigating and leaning toward Qt to replace this. I'm having difficulty merging the Qt and BCI2000 main loop, and I was wondering if you had done anything of the sort.
I recently reinvestigated how Qt can be easily incorporated into the BCI2000 mainloop. It turned out it is quite simple, though not 100% optimal.
All I do is calling

Code: Select all

qApp->processEvents()
whenever it is needed (mainly in the process() method of a module). This way i dont have to run Qt's own eventloop at all.
But be aware that there are some drawbacks. Some widgets use a deferred delete via deleteLater() method. These methods wont work unless you start Qt's main eventloop.

But in general it is an acceptable solution for me. I'm happily using my opengl widgets from within a BCI2000 CoreModule.

Alex

Locked

Who is online

Users browsing this forum: No registered users and 0 guests