private void InitiateGSR() { bool connected = false; foreach (string port in COMHandler.Ports()) { if (port != hrCollect.MyPort()) { Log.LogMessage("Trying to bind GSR to port: " + port); gsrCollect = new GSRCollector(port, fusionData); if (gsrCollect.TestPort()) { connected = true; gsrPort.Text = "(" + port + ")"; Log.LogMessageSameLine("Trying to bind GSR to port: " + port + " - SUCCES"); } else { Log.LogMessageSameLine("Trying to bind GSR to port: " + port + " - FAILED"); } } } if (!connected) { Log.LogMessage("GSR not found"); gsrReady.BackColor = Color.Red; } else { gsrReady.BackColor = Color.Green; GSRDeviceReady = true; } }
private void btnVerifySensors_Click(object sender, EventArgs e) { SensorsPending(); Application.DoEvents(); /* * EEG Initiation */ eegCollect = new EEGCollector(fusionData); eegCollect.Connect(); eegCollect.DeviceReady += EEGReady; // Event that fires if a user is added to the EEG i.e. the headset is ready for use eegCollect.FindUsers(); /* * Heart rate initiation */ hrCollect = new HRCollector(fusionData); if (hrCollect.Connect()) { HRDeviceReady = true; hrReady.BackColor = Color.Green; hrPort.Text = "(" + hrCollect.MyPort() + ")"; } else { hrReady.BackColor = Color.Red; } /* * GSR Initiation */ InitiateGSR(); //kinect time InitiateFACE(); }