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(); }
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); }
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(); }
private void RunNextTest() { if (_Scripts.Count == 0) { mLabelStatus.Text = "Testing complete."; if (TestBatchComplete != null) { TestBatchComplete(); } return; } TestScript NextScript = _Scripts.Dequeue(); mLabelStatus.Text = string.Format("Running test script ID {0}. {1} test(s) remaining.", NextScript.TestScriptID, _Scripts.Count); RunTest(_CallbackState, NextScript); }
public TestScriptPreviewControl(TestScript script) : this() { Script = script; }
public TestScriptPreviewControl(TestScript script) : this() { Script = script; }