Beispiel #1
0
        private void ScriptFSM_WaitTimerDone(object sender, EventArgs e)
        {
            ScriptTrialMachine sm = (ScriptTrialMachine)sender;

            ResetMazeSafe();
            sm.RunNextTrial();
        }
Beispiel #2
0
        private void ScriptFSM_TrialComplete(object sender, int e)
        {
            ScriptTrialMachine sm = (ScriptTrialMachine)sender;

            if (sm.CurrentTrial < sm.TrialCount)
            {
                if (sm.PromptBetweenTrials)
                {
                    System.Windows.Forms.MessageBox.Show($"Click OK to start Trial {sm.CurrentTrial + 1} of {sm.TrialCount}");
                    ResetMaze();
                    sm.RunNextTrial();
                }
                else
                {
                    sm.StartWaitTimer();
                }
            }
        }
Beispiel #3
0
        public void LoadXml(XElement Xml)
        {
            var Root = Xml.Element("session");

            if (Root != null)
            {
                SessionCount = Root.AttributeValue <int>("count", 1);
                Rest         = Root.AttributeValue <int>("rest");
            }
            ScriptFSM = new ScriptTrialMachine(Root, CancelToken);
            ScriptFSM.StateChanged   += ScriptFSM_StateChanged;
            ScriptFSM.ScriptStart    += ScriptFSM_ScriptStart;
            ScriptFSM.DataPointReady += ScriptFSM_DataPointReady;

            ScriptFSM.TrialStart       += ScriptFSM_TrialStart;
            ScriptFSM.TrialComplete    += ScriptFSM_TrialComplete;
            ScriptFSM.TrialSetStart    += ScriptFSM_TrialSetStart;
            ScriptFSM.TrialSetComplete += ScriptFSM_TrialSetComplete;

            ScriptFSM.WaitTimerDone   += ScriptFSM_WaitTimerDone;
            ScriptFSM.WaitTimerUpdate += ScriptFSM_WaitTimerUpdate;
            //ScriptFSM.ScriptEnd += ScriptFSM_ScriptEnd;
        }