本文整理汇总了C#中Connector.getMentalEffortEnable方法的典型用法代码示例。如果您正苦于以下问题:C# Connector.getMentalEffortEnable方法的具体用法?C# Connector.getMentalEffortEnable怎么用?C# Connector.getMentalEffortEnable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connector
的用法示例。
在下文中一共展示了Connector.getMentalEffortEnable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public void Main()
{
Regex regex = new Regex(@"</?\w+((\s+\w+(\s*=\s*(?:"".*?""|'.*?'|[^'"">\s]+))?)+\s*|\s*)/?>", RegexOptions.Singleline);
SpeechRecognitionEngine speechEngine = new SpeechRecognitionEngine(new System.Globalization.CultureInfo("en-US"));
speechEngine.LoadGrammar(new Grammar(new GrammarBuilder("quit")));
speechEngine.SpeechRecognized += speechEngine_SpeechRecognized;
speechEngine.SetInputToDefaultAudioDevice(); // set input to default audio device
speechEngine.RecognizeAsync(RecognizeMode.Multiple); // recognize speech
speechEngine.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(speechEngine_SpeechRecognized);
connector = new Connector();
connector.DeviceConnected += new EventHandler(OnDeviceConnected);
connector.DeviceFound += new EventHandler(OnDeviceFound);
connector.DeviceNotFound += new EventHandler(OnDeviceNotFound);
connector.DeviceConnectFail += new EventHandler(OnDeviceNotFound);
connector.DeviceDisconnected += new EventHandler(OnDeviceDisconnected);
connector.DeviceValidating += new EventHandler(OnDeviceValidating);
connector.setMentalEffortEnable(true);
connector.setAppreciationEnabled(true);
connector.setBlinkDetectionEnabled(false);
connector.setMentalEffortRunContinuous(true);
connector.setPositivityEnable(true);
connector.setRespirationRateEnable(true);
AvatarDescription.CreateRandom(AvatarBodyType.Female);
//connector.Find();
//connector.thinkGearPorts("COM5");
//connector.Connect("COM5");
//connector.Connect("COM6");
// Scan for devices across COM ports
// The COM port named will be the first COM port that is checked.
connector.ConnectScan("COM29");
// Blink detection needs to be manually turned on
// connector.setBlinkDetectionEnabled(true);
// Thread.Sleep(450000);
if (connector.setMentalEffortEnable(true))
{ // return true, means success
Console.WriteLine("HelloEEG: MentalEffort is Enabled");
}
else
{
// return false, meaning not supported because:
// + connected hardware doesn't support
// + conflict with another option already set
Console.WriteLine("Connected hardware doesn't support, or a conflict with another option already set.");
}
if (connector.getMentalEffortEnable())
{ // return true, means it is enabled
Console.WriteLine("HelloEEG: MentalEffort is configured");
}
else
{ // return false, meaning not currently configured
Console.WriteLine("HelloEEG: MentalEffort is NOT configured");
}
if (connector.setMentalEffortRunContinuous(true))
{ // return true, means success
Console.WriteLine("HelloEEG: MentalEffort Continuous operation");
}
else
{ // return false, meaning not supported because: // + connected hardware doesn't support // + conflict with another option already set // + not support by this version of the SDK
Console.WriteLine("HelloEEG: MentalEffort normal operation ");
}
if (connector.getMentalEffortRunContinuous())
{ // return true, means it is enabled
Console.WriteLine("HelloEEG: MentalEffort Continuous operation");
}
else
{
// return false, meaning not currently configured
Console.WriteLine("HelloEEG: MentalEffort normal operation");
}
}