Destructor calls in Preflight
Posted: 11 Mar 2010, 06:08
I'm using a Datatranslation board to control custom hardware. To control the hardware I've written a class that I've tested and it works.
However, when I use this class in my BCI2000 Application, I get one of my own exception thrown at me. The problem is that when I press Set Config, both Preflight and Initialization are called on the application, which causes the initialization of the hardware (once for Preflight, once for initialization), but the hardware only gets closed for the preflight. When pressing the Set Config button again, the hardware is still in use by the last initialization. What is a good place to stop the hardware to prevent an error with re-configuring?
However, when I use this class in my BCI2000 Application, I get one of my own exception thrown at me. The problem is that when I press Set Config, both Preflight and Initialization are called on the application, which causes the initialization of the hardware (once for Preflight, once for initialization), but the hardware only gets closed for the preflight. When pressing the Set Config button again, the hardware is still in use by the last initialization. What is a good place to stop the hardware to prevent an error with re-configuring?