コード例 #1
0
ファイル: TouchRayPanel.cs プロジェクト: yong-ja/starodyssey
        protected void OnCompleted(object sender, BoxEventArgs e)
        {
            DateTime end = DateTime.Now;
            Label label = new Label
            {
                Position = new Vector2(400, 300),
                TextDescriptionClass = "Large",
                Content = "Session complete\nTrial " + (Test.Count+1)
            };

            Test.Count++;

            if (Test.Count > 0 && Test.Count % 8 == 0)
                label.Content += "\nPlease have a break.";

            if (Test.Count == BoxRenderer.ConditionsCount)
                label.Content = "Thanks, this task is now complete";

            completed = true;

            OdysseyUI.CurrentHud.BeginDesign();
            OdysseyUI.CurrentHud.Controls.Add(label);
            OdysseyUI.CurrentHud.EndDesign();

            BoxPerformance bp = new BoxPerformance();
            bp.SetData(BoxRenderer.startTime, end, events);

            bp.ShowDialog();

            if (Completed != null)
                Completed(sender, e);
        }
コード例 #2
0
ファイル: BoxRenderer.cs プロジェクト: yong-ja/starodyssey
        private void Stop(BoxEventArgs e)
        {
            endTime = DateTime.Now;
            stopwatch.Stop();
            countdown = 3;
            bNew.Position=new Vector2(1760, 0);
            #if TRACKER
            tracker.StopTracking();
            #endif
            //Participant, Rep, Axis, Arrow1, Arrow2, Arrow3, Time

            int[] condition = conditions[Test.BoxIndex % conditions.Count];
            bool[] arrowCondition = arrowConditions[condition[1]];
            TrackerEvent.BoxSessionEnd.Log(Test.Participant,
                condition[0], condition[2],
                arrowCondition[0] ? "Increasing" : "Decreasing",
                arrowCondition[1] ? "Increasing" : "Decreasing",
                arrowCondition[2] ? "Increasing" : "Decreasing",
                e.IsAborted ? -1 : e.Duration);
            started = false;

            //Test.BoxIndex++;

            foreach (IStopAndGo tl in Trace.Listeners.OfType<IStopAndGo>())
            {
                tl.StopAndGo();
            }

            foreach (ISave tl in Trace.Listeners.OfType<ISave>())
            {
                tl.Save();
            }
        }