Пример #1
0
        protected override void OnUpdate(TimeSpan deltaTime)
        {
            if (Name.Equals("Neutral"))
            {
                trainButton.IsEnabled = !emoEngine.IsTraining; //TODO: // && headsetOnHead;
            }
            else
            {
                trainButton.IsEnabled = emoEngine.IsCognitivActionTrained(EdkDll.EE_CognitivAction_t.COG_NEUTRAL) &&
                                        !emoEngine.IsTraining;//TODO: && headsetOnHead;
            }

            eraseButton.IsEnabled = emoEngine.IsCognitivActionTrained(trainingAction) && !emoEngine.IsTraining;

            base.OnUpdate(deltaTime);
        }
Пример #2
0
        protected override void OnUpdate(TimeSpan deltaTime)
        {
            if (makeMainMenu)
            {
                MakeMainMenu();
                makeMainMenu = false;
            }
            else if (makePracticeMenu)
            {
                MakePracticeMenu();
                makePracticeMenu = false;
            }

            bool headsetOn                 = emoEngine.HeadsetOn();
            bool headsetOnHead             = emoEngine.HeadsetOnHead();
            bool allCognitivActionsTrained = emoEngine.AllCognitivActionsTrained();

            if (menu == MenuState.Main)
            {
                practiceButton.IsEnabled = headsetOn &&
                                           emoEngine.IsCognitivActionTrained(EdkDll.EE_CognitivAction_t.COG_NEUTRAL); //TODO: && headsetOnHead;
                rcCarButton.IsEnabled = headsetOn && allCognitivActionsTrained;                                       //TODO: && headsetOnHead;
                settings.IsEnabled    = headsetOn;                                                                    //TODO: && headsetOnHead;
            }
            else if (menu == MenuState.Practice)
            {
                forwardBackward.IsEnabled = headsetOn &&
                                            (emoEngine.IsCognitivActionTrained(EdkDll.EE_CognitivAction_t.COG_PUSH) ||
                                             emoEngine.IsCognitivActionTrained(EdkDll.EE_CognitivAction_t.COG_PULL));
                leftRight.IsEnabled = headsetOn &&
                                      (emoEngine.IsCognitivActionTrained(EdkDll.EE_CognitivAction_t.COG_LEFT) ||
                                       emoEngine.IsCognitivActionTrained(EdkDll.EE_CognitivAction_t.COG_RIGHT));

                allDirections.IsEnabled = headsetOn &&
                                          emoEngine.IsCognitivActionTrained(EdkDll.EE_CognitivAction_t.COG_PUSH) &&
                                          emoEngine.IsCognitivActionTrained(EdkDll.EE_CognitivAction_t.COG_PULL) &&
                                          emoEngine.IsCognitivActionTrained(EdkDll.EE_CognitivAction_t.COG_LEFT) &&
                                          emoEngine.IsCognitivActionTrained(EdkDll.EE_CognitivAction_t.COG_RIGHT);
            }

            base.OnUpdate(deltaTime);
        }