예제 #1
0
 public void RecordTriggerEventAndSetNewTarget(Vector3 pos, FittsTime time, bool trialIsError)
 {
     // Return true when the last selection of the sequence have been made
     if (currentFittsSequence.AddTriggerEvent(pos, time, trialIsError))
     {
         // The sequence is added to statistic
         FittsStatistic.AddFittsSequence(currentFittsSequence);
         TargetsCreator.DestroyTargets();
         if (fittsIndex.Count != 0)
         {
             // There is still fitts sequence to be done
             // A new sequence is started
             currentFittsSequence = fittsSequences[fittsIndex.Pop()];
             currentFittsSequence.StartSequence();
         }
         else
         {
             // All sequences are done
             FittsExport.ExportFittsToCSV();
             EyeExport.ExportEyeToCSV();
         }
     }
     else
     {
         TargetsCreator.SetNextTargetIndexAndColor();
     }
 }
예제 #2
0
 private void CheckForTargetReEntry(List <Collider> targetsColliding)
 {
     if (!isInTarget && (isInTarget = TargetsCreator.IsTouchingSelectTarget(targetsColliding)))
     {
         trajectory.targetReEntry++;
     }
     else
     {
         isInTarget = TargetsCreator.IsTouchingSelectTarget(targetsColliding);
     }
 }
예제 #3
0
    public void StartTest()
    {
        TargetsCreator.StartNewTest(float.Parse(distanceToTarget.text));

        // Create a new Fitts test with the parameter from the menu
        controller.GetComponent <VRController>().AddNewFittsTest(GetFittsTestParameter());

        // Set up new stats for the Fitts Test
        GameObject.Find("Fitts").GetComponent <EyeTracking>().CreateNewEyesStatistic();
        FittsStatistic.CreateNewStatistic();

        SetDregradationActive();
    }
예제 #4
0
        public bool AddTriggerEvent(Vector3 pos, FittsTime time, bool trialIsError)
        {
            // Check if first selection because it is not recorded
            if (!TargetsCreator.IsFirstTarget())
            {
                AddTrial(pos, time, trialIsError);
            }

            // Start a new trajectory for the new target because each trial has his trajectory
            trajectory = new FittsTrajectory();

            return(parameter.nbOfTarget == fittsTrials.Count);
        }
예제 #5
0
 public SequenceStatistic(FittsSequence _sequence)
 {
     trialsStats = new List <TrialStatistic>();
     sequence    = _sequence;
     foreach (FittsTrial trial in sequence.fittsTrials)
     {
         trialsStats.Add(new TrialStatistic(trial));
     }
     // We
     effectiveWidth = 4.133 * CalculateStandardDeviation(new List <double>(trialsStats.Select(x => x.dx)));
     // Ae (mean)
     effectiveAmplitudeMean = trialsStats.Sum(x => x.effectiveAmplitude) / trialsStats.Count;
     // IDe
     effectiveIndexDifficulty = Math.Log((effectiveAmplitudeMean / effectiveWidth) + 1, 2);
     // TP
     throughput = effectiveIndexDifficulty / (sequence.fittsTrials.Sum(x => x.time.movementTime) / sequence.fittsTrials.Count);
     // MT
     timeMean = new FittsTime(sequence.fittsTrials.Sum(x => x.time.pointingTime) / sequence.fittsTrials.Count, sequence.fittsTrials.Sum(x => x.time.selectionTime) / sequence.fittsTrials.Count);
     // ER(%)
     errorMean  = (double)sequence.fittsTrials.Where(x => x.isError).Count() / (double)sequence.fittsTrials.Count;
     errorMean *= 100;
     // Eye Data
     eyeData = TargetsCreator.GetEyeData();
 }
예제 #6
0
 public void ClearTest()
 {
     controller.GetComponent <VRController>().ft = null;
     TargetsCreator.DestroyTargets();
 }
예제 #7
0
        public void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            this.projectDir = replacementsDictionary["$destinationdirectory$"];

            try
            {
                EnvDTE80.DTE2 dte     = null;
                VsTheme       vsTheme = VsTheme.Unknown;
                try
                {
                    dte = automationObject as EnvDTE80.DTE2;
                }
                catch { }
                if (dte != null)
                {
                    ThemeManager tManager = new ThemeManager(dte);
                    vsTheme = tManager.GetCurrentTheme();
                }
                ConfigureForm form = new ConfigureForm(vsTheme, replacementsDictionary["$type$"]);
                if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    bool cancel = true;

                    this.selectedVersions = form.SelectedVersions;
                    DirectoryInfo dir;
                    string        targetFolder = "";
                    if (form.GlobalTargets)
                    {
                        replacementsDictionary.Add("$targetvar$", "$([System.Environment]::GetEnvironmentVariable('localappdata'))\\bonus630\\");
                        dir = new DirectoryInfo(System.Environment.GetEnvironmentVariable("localappdata") + "\\bonus630");
                        if (!dir.Exists)
                        {
                            dir.Create();
                        }
                        targetFolder = dir.FullName;
                    }
                    else
                    {
                        replacementsDictionary.Add("$targetvar$", "$(SolutionDir)");
                        dir = new DirectoryInfo(this.projectDir);
                        if (dir.Exists)
                        {
                            targetFolder = dir.Parent.FullName;
                        }
                    }

                    if (!string.IsNullOrEmpty(targetFolder))
                    {
                        TargetsCreator targetsCreator = new TargetsCreator();
                        targetsCreator.WriteTargetsFile(targetFolder);
                    }
                    for (int i = CorelVersionInfo.MinVersion; i < CorelVersionInfo.MaxVersion; i++)
                    {
                        replacementsDictionary.Add("$corel" + i.ToString() + "$", "");
                    }
                    foreach (var item in ProjectTypeGuid)
                    {
                        replacementsDictionary.Add(item.Key, item.Value);
                    }
                    for (int i = CorelVersionInfo.MinVersion; i < CorelVersionInfo.MaxVersion; i++)
                    {
                        CorelVersionInfo corel = new CorelVersionInfo(i);
                        //CorelVersionInfo corel = selectedVersions[i];
                        //string corelAddonsPath = "";
                        //if (corel.Corel64Bit == CorelVersionInfo.CorelIs64Bit.Corel32)
                        //    corel.CorelAddonsPath(out corelAddonsPath);
                        //else
                        //    corel.CorelAddonsPath64(out corelAddonsPath);

                        string projectKind = replacementsDictionary["$lang$"];
                        if (projectKind.Equals("cs"))
                        {
                            replacementsDictionary["$corel" + corel.CorelVersion.ToString() + "$"] = Helper.buildConfigurationCS(corel);
                        }
                        else if (projectKind.Equals("vb"))
                        {
                            replacementsDictionary["$corel" + corel.CorelVersion.ToString() + "$"] = Helper.buildConfigurationVB(corel);
                        }
                        else
                        {
                            throw new WizardCancelledException();
                        }
                        if (!corel.CorelInstallationNotFound)
                        {
                            cancel = false;
                        }
                        //if (corel.CorelInstallationNotFound)
                        //{
                        //    System.Windows.Forms.MessageBox.Show(string.Format("{0} not found", corel.CorelFullName));
                        //}
                        //else
                        //{
                        //    cancel = false;
                        //}
                    }

                    if (cancel)
                    {
                        //System.Windows.Forms.MessageBox.Show("Operation is canceled!");

                        throw new WizardCancelledException("Operation is canceled!");
                    }



                    replacementsDictionary.Add("$GuidA$", Guid.NewGuid().ToString());
                    replacementsDictionary.Add("$GuidB$", Guid.NewGuid().ToString());
                    replacementsDictionary.Add("$GuidC$", Guid.NewGuid().ToString());
                    replacementsDictionary.Add("$Caption$", form.DockerCaption);

                    finish = true;
                }
                else
                {
                    finish = false;
                    throw new WizardCancelledException();
                }
            }
            catch (WizardCancelledException)
            {
                finish = false;
            }
            catch (Exception)
            {
                finish = false;
            }
        }
예제 #8
0
    private void RecordTrigger()
    {
        lastTriggerTime = Time.realtimeSinceStartup;

        if (colliders.Find(x => x.gameObject.CompareTag("detectionPlane")) != null)
        {
            ft.RecordTriggerEventAndSetNewTarget(transform.position, new FittsTime(pointingTime, selectionTime), TargetsCreator.IsTouchingSelectTarget(colliders));
        }
    }
예제 #9
0
        private void AddTrial(Vector3 pos, FittsTime time, bool trialIsError)
        {
            FittsCoordinate coord = new FittsCoordinate(TargetsCreator.GetLastTargetPosition(), TargetsCreator.GetCurrentTargetPosition(), new Vector2(pos.x, pos.y));

            fittsTrials.Add(new FittsTrial(time, coord, trialIsError, trajectory));
        }
예제 #10
0
 public void StartSequence()
 {
     TargetsCreator.CreateTargets(parameter);
     // Timestamp is recorded to analyse the eye data with the sequence
     timestamp = DateTime.Now.ToString("HH:mm:ss:fff");
 }