public void RunScript(ScriptEngine scriptEngine)
        {
            if (_ScriptRenderer != null)
            {
                _ScriptRenderer.Dispose();
            }

            _ScriptRenderer = new TestScriptRenderer(this, scriptEngine);

            DrawPressureMode = scriptEngine.PressureFeedback;
            DrawInk          = scriptEngine.CognitiveFeedback;
        }
        public void RunTest(object state, TestScript script)
        {
            if (TestRunning)    //don't allow a new test to be run while one is already running
            {
                throw new InvalidOperationException("A script is already running.");
            }

            if (_ScriptRenderer != null)    //clean up any existing script renderer
            {
                _ScriptRenderer.Dispose();
            }

            ScriptEngine ScriptEngine = new ScriptEngine(script.ScriptBody);

            //create a new script renderer for this control
            _ScriptRenderer = new TestScriptRenderer(this, ScriptEngine, ScriptEngine.Cognitive);

            if (ScriptEngine.Cognitive)
            {
                _CognitiveDisplay = new CognitiveMapForm();
                _CognitiveDisplay.Show();
                _CognitiveDisplay.RunScript(this, ScriptEngine);

                DrawPressureMode = ScriptEngine.PressureFeedback;
                DrawInk          = ScriptEngine.DirectFeedback;
            }
            else /*IsDirect*/
            {
                DrawPressureMode = ScriptEngine.PressureFeedback;
                DrawInk          = ScriptEngine.DirectFeedback;
            }

            mLabelInstructions.Text = ScriptEngine.Instructions;

            _CallbackScriptID = script.TestScriptID;
            _CallbackState    = state;

            //clear collected samples
            Clear();

            _TestTimeout    = ScriptEngine.TimeLimit;
            _TestLastSample = _TestStart = DateTime.UtcNow;
            StartCapture();
        }
Ejemplo n.º 3
0
        public void ReplayTest(TestScript script, List <Capture.CalibratedInkSample> samples)
        {
            Clear();

            if (_ScriptRenderer != null)    //clean up any existing script renderer
            {
                _ScriptRenderer.Dispose();
            }

            ScriptEngine ScriptEngine = new ScriptEngine(script.ScriptBody);

            _ScriptRenderer = new TestScriptRenderer(this, ScriptEngine);

            DrawPressureMode = ScriptEngine.PressureFeedback;
            if (DrawPressureMode == InkPressureFeedbackMode.None)
            {
                DrawPressureMode = InkPressureFeedbackMode.Color;
            }

            base.Play(samples);
        }