当前位置: 首页>>代码示例>>C#>>正文


C# Connector.getMentalEffortRunContinuous方法代码示例

本文整理汇总了C#中Connector.getMentalEffortRunContinuous方法的典型用法代码示例。如果您正苦于以下问题:C# Connector.getMentalEffortRunContinuous方法的具体用法?C# Connector.getMentalEffortRunContinuous怎么用?C# Connector.getMentalEffortRunContinuous使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Connector的用法示例。


在下文中一共展示了Connector.getMentalEffortRunContinuous方法的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");
            }
        }
开发者ID:andrehendriks,项目名称:AutonomousComputerProgram-Missy,代码行数:79,代码来源:MainWindow.xaml.cs


注:本文中的Connector.getMentalEffortRunContinuous方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。