コード例 #1
0
    bool CheckLimitations()
    {
        string Scope         = ProfileManager.Instance.currentEvaluationScope;
        string currentObject = GLPlayerPrefs.GetString(Scope, "CurrentInformationObject");

        if (currentObject.Equals("PlaneImage"))
        {
            int aux = GLPlayerPrefs.GetInt(Scope, "PlaneImageTest");
            if (aux > 1)
            {
                visualizationController.popUp.LaunchPopUpScrolldown("Changes not applied", "Plane visualization was not meant to be used with Test 3 or 4, please select Test 1, 2 or change the Visualization. Changes will not be applied.");
                return(false);
            }
        }
        return(true);
    }
コード例 #2
0
        public CsvCreator(string filePath)
        {
            _filePath = filePath;

            _actualPersonId = GLPlayerPrefs.GetInt(ProfileManager.Instance.currentEvaluationScope, "UserID");

            try
            {
                //Debug.Log("Entre al try del CsvCreator");
                AddLines("UserID", "-");
            }
            catch (Exception e)
            {
                Debug.Log(e);
            }
        }
コード例 #3
0
    public void LeapMotionRecognition()
    {
        Scope = ProfileManager.Instance.currentEvaluationScope;
        Debug.Log("Entre al leapMotionRecognition del leapmotionmanager");
        if (!GLPlayerPrefs.GetBool(Scope, "useLeapMotion") || (GLPlayerPrefs.GetBool(Scope, "useLeapMotion") && GLPlayerPrefs.GetBool(Scope, "useOcculusRift")))
        {
            Debug.Log("Entre al if del useLeapMotiongame falso");
            //leapHandController.gameObject.SetActive (true);
        }

        if (GLPlayerPrefs.GetBool(Scope, "useLeapMotion"))
        {
            Debug.Log("Entre al if del useLeapMotion true");
            //leapHandController.gameObject.SetActive (false);
        }
    }
コード例 #4
0
    public void LoadActions()
    {
        string Scope = ProfileManager.Instance.currentEvaluationScope;

        actionIndex       = new int[keyName.Length];
        triggerLevelIndex = new int[keyName.Length];

        for (int i = 0; i < keyName.Length; i++)
        {
            actionIndex[i]       = ActionManager.Instance.GetMappedActionIndex(interfaceName, keyName[i]);
            triggerLevelIndex[i] = GLPlayerPrefs.GetInt(Scope, interfaceName + keyName[i] + "TriggerLevel");
        }

        AddAction(0);
        AddAction(1);
        AddAction(2);
    }
コード例 #5
0
    public void ShowAllPairedActions()
    {
        string allActionsList = "";
        string Scope          = ProfileManager.Instance.currentEvaluationScope;

        foreach (string s in MOTIONSManager.Instance.interfacesWithInputNames)
        {
            if (GLPlayerPrefs.GetBool(Scope, "use" + s))
            {
                foreach (string a in GLPlayerPrefs.GetStringArray(Scope, s + "SummaryActions"))
                {
                    allActionsList = allActionsList + a + "\n";
                }
            }
        }
        fullListScrollView.LaunchScrollDown("Mapped actions list", allActionsList);
    }
コード例 #6
0
        public void OnGUI()
        {
            for (int i = 0; i < showItems.Length; i++)
            {
                showItems[i] = GUILayout.Toggle(showItems[i], "Show Item " + i + "?");

                if (showItems[i])
                {
                    GUILayout.Label("Item " + i);
                }
            }

            if (GUILayout.Button("Save"))
            {
                GLPlayerPrefs.SetBoolArray(NameSpace, ShowItemsKey, showItems);
            }
        }
コード例 #7
0
 public override void Execute()
 {
     if (!isChecked)
     {
         isChecked = true;
         string[] checkPoints = GLPlayerPrefs.GetStringArray(scope, LAST_CHECKPOINT);
         var      exists      = Array.Exists(checkPoints, x => x == GetCode());
         if (!exists)
         {
             Array.Resize(ref checkPoints, checkPoints.Length + 1);
             checkPoints[checkPoints.Length - 1] = GetCode();
             GLPlayerPrefs.SetStringArray(scope, LAST_CHECKPOINT, checkPoints);
             Debug.Log("Checkpoint saved: " + GetCode());
             lastCheckpoint = this;
         }
     }
 }
コード例 #8
0
    public void RespawnPlayerHere()
    {
        string[] checkPoints = GLPlayerPrefs.GetStringArray(scope, LAST_CHECKPOINT);
        if (checkPoints.Length == 0)
        {
            return;
        }

        string lastCode = checkPoints[checkPoints.Length - 1];

        if (lastCode == GetCode())
        {
            Debug.Log("Respawn player at: " + GetCode());
            player.transform.position = this.transform.position + player.transform.up * 0.5f;
            lastCheckpoint            = this;
        }
    }
コード例 #9
0
    private void OnEnable()
    {
        bool useEmotiv = GLPlayerPrefs.GetBool(ProfileManager.Instance.currentEvaluationScope, "UseEmotivInsight");

        if (!useEmotiv)
        {
            emotivButton.interactable = false;
        }
        else
        {
            emotivButton.interactable = true;
        }

        bool useNeuroSky = GLPlayerPrefs.GetBool(ProfileManager.Instance.currentEvaluationScope, "UseNeuroSkyMindwave");

        if (!useNeuroSky)
        {
            neuroskyButton.interactable = false;
        }
        else
        {
            neuroskyButton.interactable = true;
        }

        bool useEyeTribe = GLPlayerPrefs.GetBool(ProfileManager.Instance.currentEvaluationScope, "UseTheEyeTribe");

        if (!useEyeTribe)
        {
            eyetribeButton.interactable = false;
        }
        else
        {
            eyetribeButton.interactable = true;
        }

        bool useKinect = GLPlayerPrefs.GetBool(ProfileManager.Instance.currentEvaluationScope, "KinectInput");

        if (!useKinect)
        {
            kinectButton.interactable = false;
        }
        else
        {
            kinectButton.interactable = true;
        }
    }
コード例 #10
0
    public void SetVariables()
    {
        Scope = ProfileManager.Instance.currentEvaluationScope;
        useLeapMotionToggle.isOn = GLPlayerPrefs.GetBool(Scope, "UseLeapMotion");
        if (useLeapMotionToggle.isOn)
        {
            usePitchGrabToggle.enabled = true;
            usePitchGrabToggle.enabled = true;
            usePitchGrabToggle.isOn = GLPlayerPrefs.GetBool(Scope, "UsePitchGrab");
        }

        if (!(useLeapMotionToggle.isOn && useJoystickToggle.isOn) || !(mouseInput.isOn && kinectInput.isOn))
            useUnityOpenGlove.interactable = false;

        useJoystickToggle.isOn = GLPlayerPrefs.GetBool(Scope, "UseJoystic");

        useUnityOpenGlove.isOn = GLPlayerPrefs.GetBool(Scope, "useUnityOpenGlove");

        kinectInput.isOn = GLPlayerPrefs.GetBool(Scope, "KinectInput");
        mouseInput.isOn = GLPlayerPrefs.GetBool(Scope, "MouseInput");

        if (GLPlayerPrefs.GetBool(Scope, "BGIIESMode"))
            modeDropDown.value = 1;
        else
            modeDropDown.value = 0;

        if (GLPlayerPrefs.GetBool(Scope, "visualizationPlane"))
            visualization.value = 1;
        else
            visualization.value = 0;


        dataOutputText.text = GLPlayerPrefs.GetString(Scope, "DataOutput");


        userIdText.text = GLPlayerPrefs.GetInt(Scope, "UserID").ToString();

        imagesText.text = GLPlayerPrefs.GetString(Scope, "Images");
        folderImageAssetText.text = GLPlayerPrefs.GetString(Scope, "FolderImageAssetText");
        //folderSmallText.text = GLPlayerPrefs.GetString(Scope, "FolderSmallText");
        fileNameText.text = GLPlayerPrefs.GetString(Scope, "FileName");
        groupPathText.text = GLPlayerPrefs.GetString(Scope, "GroupPath");

        testDropdown.value = GLPlayerPrefs.GetInt(Scope, "Test");
    }
コード例 #11
0
    public void ChangeUserID(string userID)
    {
        popUpWindowView.ClosePopUp();
        int aux;

        if (int.TryParse(userID, out aux))
        {
            GLPlayerPrefs.SetInt(ProfileManager.Instance.currentEvaluationScope, "CurrentUserID", aux);
            aux--;
            GLPlayerPrefs.SetInt(ProfileManager.Instance.currentEvaluationScope, "LastUserIDUsed", aux);
            ReloadUserIDText();
            popUpWindowView.LaunchPopUpMessage("Successful", "New User ID was changed successfully");
        }
        else
        {
            popUpWindowView.LaunchPopUpMessage("Change failed", "There was an error trying to converse the input to a number, please try again");
        }
    }
コード例 #12
0
        public void LeapMotionRecognition()
        {
            Scope = ProfileManager.Instance.currentEvaluationScope;

            bool leapmotion = GLPlayerPrefs.GetBool(Scope, "useLeapMotion");

            Debug.Log("El booleano de leapmotion es:" + leapmotion);


            if (!GLPlayerPrefs.GetBool(Scope, "useLeapMotion"))
            {
                leapSpace.SetActive(false);
            }
            if (GLPlayerPrefs.GetBool(Scope, "useLeapMotion") && GLPlayerPrefs.GetBool(Scope, "useOcculusRift"))
            {
                leapSpace.SetActive(true);
            }
        }
コード例 #13
0
    /*
     * EEGManager.Instance.MentalCommandCurrentActionPower;
     * EEGManager.Instance.FacialExpressionIsRightEyeWinking;
     * EEGManager.Instance.FacialExpressionIsLeftEyeWinking;
     * EEGManager.Instance.FacialExpressionIsUserBlinking;
     * EEGManager.Instance.FacialExpressionUpperFaceActionPower;
     * EEGManager.Instance.FacialExpressionSmileExtent;
     * EEGManager.Instance.FacialExpressionLowerFaceActionPower;
     * EEGManager.Instance.FacialExpressionLowerFaceAction;
     * EEGManager.Instance.FacialExpressionUpperFaceAction;
     */



    void OnEnable()
    {
        currentVisualization = GLPlayerPrefs.GetString(Scope, "CurrentVisualization");
        currentObject        = GLPlayerPrefs.GetString(Scope, "CurrentInformationObject");
        Scope = ProfileManager.Instance.currentEvaluationScope;

        float aux = GLPlayerPrefs.GetFloat(Scope, "EmotivTickSensibility") * 10;

        SetTriggerValues((int)aux, tickSensibilityValue, tickSensibilityText);

        ActionManager.Instance.ReloadMappingActionsDropdown(facialExpresionActionsDropdown);
        ActionManager.Instance.ReloadMappingActionsDropdown(mentalCommandActionsDropdow);

        UpdateMappedActions(inputNamesForSummary);

        SetMentalCommandConfigMenuValues();
        SetFacialExpressionConfigMenuValues();
    }
コード例 #14
0
    void ReloadSummaryData()
    {
        ReloadUserIDText();
        informationObjectText.text = GLPlayerPrefs.GetString(ProfileManager.Instance.currentEvaluationScope, "CurrentInformationObject");
        visualizationText.text     = GLPlayerPrefs.GetString(ProfileManager.Instance.currentEvaluationScope, "CurrentVisualization");
        immersionText.text         = GLPlayerPrefs.GetString(ProfileManager.Instance.currentEvaluationScope, "CurrentImmersion");
        ActionManager.Instance.LoadMappingActionsNames();
        //Failsafe in case evaluation is new and timer isn't changed
        int aux = GLPlayerPrefs.GetInt(ProfileManager.Instance.currentEvaluationScope, "EvaluationTime");

        if (aux < 1)
        {
            aux = 1;
            GLPlayerPrefs.SetInt(ProfileManager.Instance.currentEvaluationScope, "EvaluationTime", aux);
        }
        evaluationTimeInputField.text = aux.ToString();
        ReloadOutputPath();
    }
コード例 #15
0
    public void LoadInstances()
    {
        InterfaceManager.Instance.leapMotionManager.leapMotionRig = leapMotionRig;
        //DestroyObject(this.gameObject);
        //Here are the interactions asigned, given the chosen visualization. They're in this script to
        //  relieve a bit of the work already done in each individual visualization manager, which is already large.
        string Scope = ProfileManager.Instance.currentEvaluationScope;

        if (GLPlayerPrefs.GetBool(Scope, "useMouse"))
        {
            InteractionManager.Instance.updateList.Add(() =>
                                                       InteractionManager.Instance.raycastingSpherePlane.CreateRay(
                                                           InterfaceManager.Instance.mouseManager.screenPointToRay, VisualizationManager.Instance.sphereVisualization.actualVisualization)
                                                       );
        }

        if (GLPlayerPrefs.GetBool(Scope, "useOcculusRift"))
        {
            InteractionManager.Instance.updateList.Add(() =>
                                                       InteractionManager.Instance.raycastingSpherePlane.CreateRay(
                                                           Camera.main.transform.position, Camera.main.transform.TransformDirection(Vector3.forward), VisualizationManager.Instance.sphereVisualization.actualVisualization)
                                                       );
        }

        if (GLPlayerPrefs.GetBool(Scope, "useTouchScreen"))
        {
            Debug.Log("Entre al LoadInstance del PlanceVisualization con la interfaz touch");
            InteractionManager.Instance.updateList.Add(() =>
                                                       InteractionManager.Instance.raycastingSpherePlane.CreateRayCategories(
                                                           InterfaceManager.Instance.touchScreenManager.screenPointToRay, VisualizationManager.Instance.planeVisualization.actualVisualization)
                                                       );
        }

        if (GLPlayerPrefs.GetBool(Scope, "useLeapMotion"))
        {
            leapHandController.gameObject.SetActive(true);
            Debug.Log("entre al LoadInstance del PlaneVisualization del TIIESVisualization con la opcion leapmotion");
            InteractionManager.Instance.updateList.Add(() =>
                                                       InteractionManager.Instance.raycastingSpherePlane.CreateRayCategories(
                                                           InterfaceManager.Instance.leapMotionManager.screenPointToRay, VisualizationManager.Instance.planeVisualization.actualVisualization)
                                                       );
        }
    }
コード例 #16
0
    public void InitializeManager(DIOManager fatherDioManager)
    {
        dioManager   = fatherDioManager;
        Scope        = ProfileManager.Instance.currentEvaluationScope;
        _useEyetribe = GLPlayerPrefs.GetBool(Scope, "UseTheEyeTribe");
        Debug.Log("Use eyetribe:" + GLPlayerPrefs.GetBool(Scope, "UseTheEyeTribe").ToString());
        _useMouse = GLPlayerPrefs.GetBool(Scope, "UseMouse");
        Debug.Log("Use mouse:" + GLPlayerPrefs.GetBool(Scope, "UseMouse").ToString());
        if (_useEyetribe)
        {
            GazeCamera.Instance.Initialize();
        }
        else
        {
            NegateEyeTribe();
        }

        initialized = true;
    }
コード例 #17
0
        private void SetVariables()
        {
            useLeapMotion  = GLPlayerPrefs.GetBool(Scope, "UseLeapMotion");
            usePitchGrab   = GLPlayerPrefs.GetBool(Scope, "UsePitchGrab");
            useHapticGlove = GLPlayerPrefs.GetBool(Scope, "UseHapticGlove");
            useJoystick    = GLPlayerPrefs.GetBool(Scope, "UseJoystic");

            csvCreatorPath = GLPlayerPrefs.GetString(Scope, "DataOutput");

            unityOpenGlove.leftComDevice  = GLPlayerPrefs.GetString(Scope, "LeftCom");
            unityOpenGlove.rightComDevice = GLPlayerPrefs.GetString(Scope, "RightCom");

            loadImageController.Initialize(this);
            loadImageController.images = Convert.ToInt32(GLPlayerPrefs.GetString(Scope, "Images"));
            loadImageController.LoadImageBehaviour.pathImageAssets = GLPlayerPrefs.GetString(Scope, "FolderImageAssetText");
            loadImageController.LoadImageBehaviour.pathSmall       = GLPlayerPrefs.GetString(Scope, "FolderSmallText");
            loadImageController.LoadImageBehaviour.filename        = GLPlayerPrefs.GetString(Scope, "FileName");

            OnValidate();
        }
コード例 #18
0
        public override void Initialize(LoadImagesController loadImagesController)
        {
            groupImageCsvPath = GLPlayerPrefs.GetString(ProfileManager.Instance.currentEvaluationScope, "PlaneImageGroupFilePath");
            base.Initialize(loadImagesController);
            //DELETE THIS bgiies mode can't exist
            if (!GLPlayerPrefs.GetBool(ProfileManager.Instance.currentEvaluationScope, "BGIIESMode"))
            {
                GenerateImageGroupDictionary();

                GenerateTestGroups();

                GenerateOrganizedItemList();
            }
            else
            {
                GenerateImageGroupDictionaryToBgiies();

                GenerateTestGroupsToBgiies();
            }
        }
コード例 #19
0
 public bool AddNewEvaluation(string newEvaluation)
 {
     if (CheckRepeatedEvaluationName(newEvaluation))
     {
         string[] aux = new string[evaluations.Length];
         evaluations.CopyTo(aux, 0);
         int newLength = evaluations.Length + 1;
         evaluations = new string[newLength];
         aux.CopyTo(evaluations, 0);
         evaluations[newLength - 1] = newEvaluation;
         GLPlayerPrefs.SetStringArray(profileScope, "EvaluationNamesList", evaluations);
         UpdateCurrentEvaluation(newLength - 1);
         SetEvaluationDefaultValues();
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #20
0
    public void UpdateBitalinoConfig()
    {
        //VALIDATE
        if (!ValidateInput())
        {
            return;
        }
        else
        {
            string comPort      = m_comPort.text;
            int    baudRate     = int.Parse(m_baudRate.text);
            int    samplingRate = int.Parse(m_samplingRate.text);
            int    buffSize     = int.Parse(m_buffSize.text);

            GLPlayerPrefs.SetString(scope, "BITalino ComPort", comPort);
            GLPlayerPrefs.SetInt(scope, "BITalino BaudRate", baudRate);
            GLPlayerPrefs.SetInt(scope, "BITalino SamplingRate", samplingRate);
            GLPlayerPrefs.SetInt(scope, "BITalino BuffSize", buffSize);
        }
    }
コード例 #21
0
    public void SelectThisVisualization()
    {
        string Scope = ProfileManager.Instance.currentEvaluationScope;

        if (!CheckLimitations())
        {
            return;
        }
        GLPlayerPrefs.SetString(Scope, "CurrentVisualization", visualizationName);
        visualizationController.UpdateCurrentSelectedVisualizationText();
        ActionManager.Instance.UpdateVisualizationActionNames(planeVisualizationActionsNames);
        //DELETE THIS
        GLPlayerPrefs.SetBool(Scope, "BGIIESMode", true);
        GLPlayerPrefs.SetBool(Scope, "TIIESMode", false);
        bool wea  = GLPlayerPrefs.GetBool(Scope, "BGIIESMode");
        bool wea2 = GLPlayerPrefs.GetBool(Scope, "TIIESMode");

        Debug.Log("el booleano de bgiiesMode es:" + wea);
        Debug.Log("el booleano de tiiesmode es:" + wea2);
    }
コード例 #22
0
    private void OnEnable()
    {
        string Scope = ProfileManager.Instance.currentEvaluationScope;

        UpdateCurrentSelectedObjectText();
        string currentObject = GLPlayerPrefs.GetString(Scope, "CurrentInformationObject");

        //Use the case equal to the information object key and the last object used variable as the index in the objectPlanesArray where said information object panel is referenced.
        switch (currentObject)
        {
        case "PlaneImage":
            currentObjectDropdown.value = 0;
            break;

        default:
            currentObjectDropdown.value = 0;
            break;
        }
        currentObjectDropdown.RefreshShownValue();
        UpdateCurrentObject();
    }
コード例 #23
0
ファイル: GazeCamera.cs プロジェクト: jh0nny1/Prototipo8
    public void Initialize()
    {
        Scope = ProfileManager.Instance.currentEvaluationScope;
        cam   = Camera.main;
        transform.SetParent(cam.transform);
        if (useGazeTracker)
        {
            GameObject go = Instantiate(uvplane, Vector3.zero, Quaternion.identity) as GameObject;
            go.transform.SetParent(Camera.main.transform);
            go.transform.position = Vector3.zero;
            gazeIndicator         = go.transform;
        }

        //initialising GazeData stabilizer
        gazeUtils = new GazeDataValidator(30);

        //activate C# TET client, default port
        GazeManager.Instance.Activate
        (
            GazeManager.ApiVersion.VERSION_1_0,
            GazeManager.ClientMode.Push
        );

        //register for gaze updates
        GazeManager.Instance.AddGazeListener(this);

        /*
         * Initializes the CvsCreator to store data in a log
         */
        dataLogPath = GLPlayerPrefs.GetString(Scope, "TheEyeTribeDataPath");
        Debug.Log("eyetribe path: " + GLPlayerPrefs.GetString(Scope, "TheEyeTribeDataPath"));
        if (dataLogPath.Equals(""))
        {
            csvCreator = new CsvCreator("EyeTribeDataLog\\data.csv");
        }
        else
        {
            csvCreator = new CsvCreator(dataLogPath);
        }
    }
コード例 #24
0
ファイル: PitchGrabObject.cs プロジェクト: jh0nny1/Prototipo8
        public void OnUnDetect()
        {
            //Debug.Log ("Entre al OnUnDetect");
            if (_isLookPointerOn)
            {
                //Debug.Log ("El valor de islookPointerOn en OnUnDetected es:" + _isLookPointerOn);
                if (GLPlayerPrefs.GetBool(ProfileManager.Instance.currentEvaluationScope, "BGIIESMode"))
                {
                    InformationObjectManager.Instance.planeImages.lookPointerInstanceBGIIES.LookPointerExit(this);
                    if (InformationObjectManager.Instance.planeImages.lookPointerInstanceBGIIES.actualPitchGrabObject == null)
                    {
                        _isLookPointerOn = false;
                    }
                    //DioManager.buttonPanel.DisableZoomIn();
                }
                else if (GLPlayerPrefs.GetBool(ProfileManager.Instance.currentEvaluationScope, "TIIESMode"))
                {
                    //Debug.Log ("Entre al lookPointerExit del OnUnDetect");
                    InformationObjectManager.Instance.planeImages.lookPointerInstanceTIIES.LookPointerExit(this);
                    if (InformationObjectManager.Instance.planeImages.lookPointerInstanceTIIES.actualPitchGrabObject == null)
                    {
                        //Debug.Log ("Entre al islookPointerOn = false");
                        _isLookPointerOn = false;
                    }
                }
                else
                {
                    InformationObjectManager.Instance.planeImages.lookPointerInstance.LookPointerExit(this);
                    if (InformationObjectManager.Instance.planeImages.lookPointerInstance.actualPitchGrabObject == null)
                    {
                        _isLookPointerOn = false;
                        //DELETE THIS tie to button panel when reimplemented
                        //DioManager.buttonPanel.DisableAccept();
                    }

                    //DioManager.buttonPanel.DisableZoomIn();
                }
            }
        }
コード例 #25
0
 public bool AddNewProfile(string newProfile)
 {
     if (CheckRepeatedProfileName(newProfile))
     {
         string[] aux = new string[profiles.Length];
         profiles.CopyTo(aux, 0);
         int newLength = profiles.Length + 1;
         profiles = new string[newLength];
         aux.CopyTo(profiles, 0);
         profiles[newLength - 1] = newProfile;
         GLPlayerPrefs.SetStringArray(profileManagerScope, "ProfileNamesList", profiles);
         aux    = new string[1];
         aux[0] = "Default Evaluation";
         GLPlayerPrefs.SetStringArray(newProfile, "EvaluationNamesList", aux);
         UpdateCurrentProfile(newLength - 1);
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #26
0
ファイル: ActionManager.cs プロジェクト: jh0nny1/Prototipo8
    //So, how the logic works. The first action of the array of actions of both the currentVisualization and currentInformationObject arrays is a null.
    //Then if both are zero, there is no action asigned.
    //The current available actions array is a combination of both the visualization and object actions array, always having the visualization first and the
    //      object array copied right after.
    //The first array is always the Visualization one, so his index always matches, from 0 (no action) to whatever limit (say 5, to say an example).
    //Following, the object index is always dependant on the length of the visualization index. For example if the size of the visualization index
    //      is 6 (0 to 5), the first action of the object index will be 6 in the current actions index. For that reason, the object index is transformed
    //      into an action available index by considering the length of the visualization index.
    //In the case someone changes the visualization, the configuration of the object actions will remain, because they're relative to the visualization index
    //      and not dependant of it.

    /// <summary>
    /// Returns the current action list index of the given input, 0 by default.
    /// </summary>
    /// <param name="interfaceName"></param>
    /// <param name="inputName"></param>
    /// <returns></returns>
    public int GetMappedActionIndex(string interfaceName, string inputName)
    {
        string Scope = ProfileManager.Instance.currentEvaluationScope;
        string currentVisualization = GLPlayerPrefs.GetString(Scope, "CurrentVisualization");
        string currentObject        = GLPlayerPrefs.GetString(Scope, "CurrentInformationObject");
        int    visIndex             = GLPlayerPrefs.GetInt(Scope, interfaceName + inputName + currentVisualization + "VisualizationIndex");
        int    objIndex             = GLPlayerPrefs.GetInt(Scope, interfaceName + inputName + currentObject + "ObjectIndex");

        if (visIndex != 0)
        {
            return(visIndex);
        }
        else if (objIndex != 0)
        {
            int aux = objIndex + currentVisualizationActionsNames.Length;
            return(aux);
        }
        else
        {
            return(0);
        }
    }
コード例 #27
0
    public void Awake()
    {
        useLeapMotionToggle.isOn  = GLPlayerPrefs.GetBool(Scope, "UseLeapMotion");
        usePitchGrabToggle.isOn   = GLPlayerPrefs.GetBool(Scope, "UsePitchGrab");
        useHapticGloveToggle.isOn = GLPlayerPrefs.GetBool(Scope, "UseHapticGlove");
        useJoystickToggle.isOn    = GLPlayerPrefs.GetBool(Scope, "UseJoystic");

        dataOutputText.text = GLPlayerPrefs.GetString(Scope, "DataOutput");

        leftComText.text  = GLPlayerPrefs.GetString(Scope, "LeftCom");
        rightComText.text = GLPlayerPrefs.GetString(Scope, "RightCom");

        userIdText.text = GLPlayerPrefs.GetInt(Scope, "PersonId").ToString();

        imagesText.text           = GLPlayerPrefs.GetString(Scope, "Images");
        folderImageAssetText.text = GLPlayerPrefs.GetString(Scope, "FolderImageAssetText");
        folderSmallText.text      = GLPlayerPrefs.GetString(Scope, "FolderSmallText");
        fileNameText.text         = GLPlayerPrefs.GetString(Scope, "FileName");
        groupPathText.text        = GLPlayerPrefs.GetString(Scope, "GroupPath");

        testDropdown.value = GLPlayerPrefs.GetInt(Scope, "Test");
    }
コード例 #28
0
    //The script that these objects hold will, upon enable, try to stablish a connection with their target service.
    //This action (try to stablish a connection) should occur under two circumstances:
    // 1) The device is going to be used in a scene.
    // 2) The device is going to be configured.

    //The InterfaceManager has a function that activates all the objects set to be used in an evaluation (OnNewScene function) to fulfill case one.
    //To fulfill case two, upon entering configuration of each device, the button to open the configuration should access the InterfaceManager, the manager of the
    //      device group and the specific device itself to try to stablish a connection.


    /// <summary>
    /// Activates objects of device managers to stablish a connection with their services. If the device belongs to a group, it will ask the group to check.
    /// </summary>
    public void OnNewScene()
    {
        Scope = ProfileManager.Instance.currentEvaluationScope;

        //List of devices that do not belong to a group
        if (GLPlayerPrefs.GetBool(Scope, "useMouse"))
        {
            mouseManager.gameObject.SetActive(true);
        }

        if (GLPlayerPrefs.GetBool(Scope, "useTouchScreen"))
        {
            touchScreenManager.gameObject.SetActive(true);
        }

        if (GLPlayerPrefs.GetBool(Scope, "useLeapMotion"))
        {
            leapMotionManager.gameObject.SetActive(true);
        }

        //List of groups of devices that are asked to check
        eegManager.CheckInterfaces();
    }
コード例 #29
0
    public void UpdateSettingsCanvas()
    {
        CleanSettingsCanvas();

        int physicalResponseIndex = physicalResponseDropdown.value;
        int triggerWithIndex      = triggerWithDropdown.value;

        string treshold = triggers[physicalResponseIndex][triggerWithIndex];

        switch (treshold)
        {
        case "Range":
            triggerWithSettings[0].SetActive(true);
            SetTriggerValues(GLPlayerPrefs.GetFloat(scope, interfaceName + physicalResponse[physicalResponseIndex] + "LowestRange"), lowestRangeSlider, lowestRangeNumber);
            SetTriggerValues(GLPlayerPrefs.GetFloat(scope, interfaceName + physicalResponse[physicalResponseIndex] + "HighestRange"), highestRangeSlider, highestRangeNumber);
            break;

        case "Treshold":
            triggerWithSettings[1].SetActive(true);
            SetTriggerValues(GLPlayerPrefs.GetFloat(scope, interfaceName + physicalResponse[physicalResponseIndex] + "Treshold"), tresholdSlider, tresholdNumber);
            break;
        }
    }
コード例 #30
0
 // Use this for initialization
 public void Awake()
 {
     Instance = this;
     DontDestroyOnLoad(this);
     //If there are no profiles found in the systems registry, it creates a new array of names. This is because there is no default value for arrays, but there are for all other data types used.
     if (!GLPlayerPrefs.GetBool(profileManagerScope, "RegistryFound"))
     {
         string[] aux = new string[1];
         aux[0] = "Default Profile";
         GLPlayerPrefs.SetStringArray(profileManagerScope, "ProfileNamesList", aux);
         GLPlayerPrefs.SetBool(profileManagerScope, "RegistryFound", true);
         aux    = new string[1];
         aux[0] = "Default Evaluation";
         GLPlayerPrefs.SetStringArray("Default Profile", "EvaluationNamesList", aux);
     }
     profiles               = GLPlayerPrefs.GetStringArray(profileManagerScope, "ProfileNamesList");
     currentProfile         = GLPlayerPrefs.GetInt(profileManagerScope, "CurrentProfile");
     profileScope           = profiles[currentProfile];
     currentEvaluation      = GLPlayerPrefs.GetInt(profileScope, "CurrentEvaluation");
     evaluations            = GLPlayerPrefs.GetStringArray(profileScope, "EvaluationNamesList");
     currentEvaluationScope = profileScope + evaluations[currentEvaluation];
     MOTIONSManager.Instance.initializeCsv();
 }