Esempio n. 1
0
        //Patient History List Box
        private void lst_tests_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lst_tests.SelectedIndex >= 0)
            {
                DataTable grid_data = new DataTable();
                DataRow   rows;
                grid_data.Columns.Add("Metric");
                grid_data.Columns.Add("Mean");
                grid_data.Columns.Add("Std Dev");
                grid_data.Columns.Add("Min");
                grid_data.Columns.Add("Max");

                for (int k = 0; k < history_test_list[lst_tests.SelectedIndex].anal.Length; k++)
                {
                    rows            = grid_data.NewRow();
                    rows["Metric"]  = history_test_list[lst_tests.SelectedIndex].anal[k].metric;
                    rows["Mean"]    = history_test_list[lst_tests.SelectedIndex].anal[k].mean;
                    rows["Std Dev"] = history_test_list[lst_tests.SelectedIndex].anal[k].stdDev;
                    rows["Min"]     = history_test_list[lst_tests.SelectedIndex].anal[k].min;
                    rows["Max"]     = history_test_list[lst_tests.SelectedIndex].anal[k].max;
                    grid_data.Rows.Add(rows);
                }

                dataGrid.DataSource = grid_data;

                hand.Text      = history_test_list[lst_tests.SelectedIndex].hand.ToString();
                mode.Text      = history_test_list[lst_tests.SelectedIndex].mode.ToString();
                rotation.Text  = history_test_list[lst_tests.SelectedIndex].rotation.ToString();
                test_name.Text = history_test_list[lst_tests.SelectedIndex].script.type.ToString();
                normal.Text    = history_test_list[lst_tests.SelectedIndex].isNormal.ToString();

                List <Data> samples = test.RetrieveTestData(history_test_list[lst_tests.SelectedIndex].ID);
                List <global::Movement.TestEngine.Capture.CalibratedInkSample> testSamples = samples.ConvertAll <global::Movement.TestEngine.Capture.CalibratedInkSample>(
                    new Converter <Data, global::Movement.TestEngine.Capture.CalibratedInkSample>(
                        delegate(Data d)
                {
                    global::Movement.TestEngine.Capture.CalibratedInkSample sample = new global::Movement.TestEngine.Capture.CalibratedInkSample();
                    sample.X        = d.x;
                    sample.Y        = d.y;
                    sample.Time     = d.time;
                    sample.Pressure = d.pressure;
                    return(sample);
                }));

                analysis_control.ShowAnalysis(global::Movement.Analysis.AnalysisMetric.Pressure,
                                              testSamples);

                ScriptInfo si = new ScriptInfo();
                si.scriptID = history_test_list[lst_tests.SelectedIndex].script.scriptID;
                Script s = test.GetScript(si);
                global::Movement.TestEngine.Testing.TestScript ts = new global::Movement.TestEngine.Testing.TestScript(si.scriptID, s.scriptData);

                replay_control.ReplayTest(ts, testSamples);
            }
        }
        public TestPatient(List<Script> tests, String batch_name, UserObject user, PatientObject patient, char sender)
        {
            InitializeComponent();
            this.patient = patient;
            this.user = user;
            this.t = new Test();
            this.sender = sender;

            TestEngine.Testing.TestScript s;
            test_scripts = new List<global::Movement.TestEngine.Testing.TestScript>();

            //Display the name of the batch as the form's title
            this.Text = "Running " + batch_name;

            //put the tests in a list in the form used by the test batch capture controle
            for (int x = 0; x < tests.Count; x++)
                test_scripts.Add(s = new global::Movement.TestEngine.Testing.TestScript(tests[x].scriptID, tests[x].scriptData));

            //callback functions for test completion and batch completion
            tbcc_test_patient.TestBatchComplete += new global::Movement.TestEngine.Testing.TestBatchCompleteHandler(testBatchCaptureControl1_TestBatchComplete);
            tbcc_test_patient.TestComplete += new global::Movement.TestEngine.Testing.TestCompleteHandler(testBatchCaptureControl1_TestComplete);
        }
Esempio n. 3
0
        /// <summary>
        /// Display the selected batch's description
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmb_batches_SelectedIndexChanged(object sender, EventArgs e)
        {
            String description = "";
            Script temp;

            TestEngine.Testing.TestScript p = new global::Movement.TestEngine.Testing.TestScript();

            //get the description of the selected item
            if (states.Peek() == (int)state.PracticeTest)
            {
                description = ((ScriptInfo)cmb_batches.SelectedItem).description;

                //display the script preview
                temp                  = test.GetScript((ScriptInfo)cmb_batches.SelectedItem);
                p.ScriptBody          = temp.scriptData;
                p.TestScriptID        = temp.scriptID;
                script_preview.Script = p;

                if (cmb_batches.SelectedIndex != -1 && !pnl_content.Controls.Contains(script_preview))
                {
                    pnl_content.Controls.Add(script_preview);
                }
            }
            else if (states.Peek() == (int)state.BatchSelection)
            {
                description = ((Batch)cmb_batches.SelectedItem).description;
            }


            //set the description if none is available
            if (description.Equals(""))
            {
                description = "No description available.";
            }

            //display description
            lbl_batch_description.Text = description;
        }
Esempio n. 4
0
        public TestPreview(ListBox.SelectedObjectCollection tests)
        {
            InitializeComponent();

            Script temp;
            Test   t = new Test();

            TestEngine.Testing.TestScript p = new global::Movement.TestEngine.Testing.TestScript();
            TestEngine.Testing.TestScriptPreviewControl script_preview;
            const int MAX_PER_ROW = 4;
            const int MAX_PER_COL = 4;

            for (int x = 0; x < tests.Count; x++)
            {
                temp = t.GetScript((ScriptInfo)tests[x]);
                if (temp == null)
                {
                    MessageBox.Show(t.Error, "Error Creating Preview", MessageBoxButtons.OK, t.ErrorType);
                    return;
                }

                p.ScriptBody   = temp.scriptData;
                p.TestScriptID = temp.scriptID;

                script_preview          = new global::Movement.TestEngine.Testing.TestScriptPreviewControl();
                script_preview.Script   = p;
                script_preview.Location = new Point((x % MAX_PER_ROW) * 135, ((x / MAX_PER_COL) * 135) + 8);

                Label script_label = new Label();
                script_label.Text     = ((ScriptInfo)tests[x]).name;
                script_label.Location = new Point(script_preview.Location.X, script_preview.Location.Y - 8);
                script_label.AutoSize = true;

                this.Controls.Add(script_label);
                this.Controls.Add(script_preview);
            }
        }
        public TestPatient(List <Script> tests, String batch_name, UserObject user, PatientObject patient, char sender)
        {
            InitializeComponent();
            this.patient = patient;
            this.user    = user;
            this.t       = new Test();
            this.sender  = sender;

            TestEngine.Testing.TestScript s;
            test_scripts = new List <global::Movement.TestEngine.Testing.TestScript>();

            //Display the name of the batch as the form's title
            this.Text = "Running " + batch_name;

            //put the tests in a list in the form used by the test batch capture controle
            for (int x = 0; x < tests.Count; x++)
            {
                test_scripts.Add(s = new global::Movement.TestEngine.Testing.TestScript(tests[x].scriptID, tests[x].scriptData));
            }

            //callback functions for test completion and batch completion
            tbcc_test_patient.TestBatchComplete += new global::Movement.TestEngine.Testing.TestBatchCompleteHandler(testBatchCaptureControl1_TestBatchComplete);
            tbcc_test_patient.TestComplete      += new global::Movement.TestEngine.Testing.TestCompleteHandler(testBatchCaptureControl1_TestComplete);
        }
        public TestPreview(ListBox.SelectedObjectCollection tests)
        {
            InitializeComponent();

            Script temp;
            Test t = new Test();
            TestEngine.Testing.TestScript p = new global::Movement.TestEngine.Testing.TestScript();
            TestEngine.Testing.TestScriptPreviewControl script_preview;
            const int MAX_PER_ROW = 4;
            const int MAX_PER_COL = 4;

            for (int x = 0; x < tests.Count; x++)
            {
                temp = t.GetScript((ScriptInfo)tests[x]);
                if (temp == null)
                {
                    MessageBox.Show(t.Error, "Error Creating Preview", MessageBoxButtons.OK, t.ErrorType);
                    return;
                }

                p.ScriptBody = temp.scriptData;
                p.TestScriptID = temp.scriptID;

                script_preview = new global::Movement.TestEngine.Testing.TestScriptPreviewControl();
                script_preview.Script = p;
                script_preview.Location = new Point((x % MAX_PER_ROW) * 135, ((x / MAX_PER_COL) * 135) + 8);

                Label script_label = new Label();
                script_label.Text = ((ScriptInfo)tests[x]).name;
                script_label.Location = new Point(script_preview.Location.X, script_preview.Location.Y - 8);
                script_label.AutoSize = true;

                this.Controls.Add(script_label);
                this.Controls.Add(script_preview);
            }
        }
        //Patient History List Box
        private void lst_tests_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lst_tests.SelectedIndex >=0 )
            {
                DataTable grid_data = new DataTable();
                DataRow rows;
                grid_data.Columns.Add("Metric");
                grid_data.Columns.Add("Mean");
                grid_data.Columns.Add("Std Dev");
                grid_data.Columns.Add("Min");
                grid_data.Columns.Add("Max");

                for (int k = 0; k < history_test_list[lst_tests.SelectedIndex].anal.Length; k++)
                {
                    rows = grid_data.NewRow();
                    rows["Metric"] = history_test_list[lst_tests.SelectedIndex].anal[k].metric;
                    rows["Mean"] = history_test_list[lst_tests.SelectedIndex].anal[k].mean;
                    rows["Std Dev"] = history_test_list[lst_tests.SelectedIndex].anal[k].stdDev;
                    rows["Min"] = history_test_list[lst_tests.SelectedIndex].anal[k].min;
                    rows["Max"] = history_test_list[lst_tests.SelectedIndex].anal[k].max;
                    grid_data.Rows.Add(rows);
                }

                dataGrid.DataSource = grid_data;

                hand.Text = history_test_list[lst_tests.SelectedIndex].hand.ToString();
                mode.Text = history_test_list[lst_tests.SelectedIndex].mode.ToString();
                rotation.Text = history_test_list[lst_tests.SelectedIndex].rotation.ToString();
                test_name.Text = history_test_list[lst_tests.SelectedIndex].script.type.ToString();
                normal.Text = history_test_list[lst_tests.SelectedIndex].isNormal.ToString();

                List<Data> samples = test.RetrieveTestData(history_test_list[lst_tests.SelectedIndex].ID);
                List<global::Movement.TestEngine.Capture.CalibratedInkSample> testSamples = samples.ConvertAll<global::Movement.TestEngine.Capture.CalibratedInkSample>(
                    new Converter<Data, global::Movement.TestEngine.Capture.CalibratedInkSample>(
                    delegate(Data d)
                    {
                        global::Movement.TestEngine.Capture.CalibratedInkSample sample = new global::Movement.TestEngine.Capture.CalibratedInkSample();
                        sample.X = d.x;
                        sample.Y = d.y;
                        sample.Time = d.time;
                        sample.Pressure = d.pressure;
                        return sample;
                    }));

                analysis_control.ShowAnalysis(global::Movement.Analysis.AnalysisMetric.Pressure,
                    testSamples);

                ScriptInfo si = new ScriptInfo();
                si.scriptID = history_test_list[lst_tests.SelectedIndex].script.scriptID;
                Script s = test.GetScript(si);
                global::Movement.TestEngine.Testing.TestScript ts = new global::Movement.TestEngine.Testing.TestScript(si.scriptID, s.scriptData);

                replay_control.ReplayTest(ts, testSamples);
            }
        }
        /// <summary>
        /// Display the selected batch's description
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmb_batches_SelectedIndexChanged(object sender, EventArgs e)
        {
            String description = "";
            Script temp;
            TestEngine.Testing.TestScript p = new global::Movement.TestEngine.Testing.TestScript();

            //get the description of the selected item
            if (states.Peek() == (int)state.PracticeTest)
            {
                description = ((ScriptInfo)cmb_batches.SelectedItem).description;

                //display the script preview
                temp = test.GetScript((ScriptInfo)cmb_batches.SelectedItem);
                p.ScriptBody = temp.scriptData;
                p.TestScriptID = temp.scriptID;
                script_preview.Script = p;

                if (cmb_batches.SelectedIndex != -1 && !pnl_content.Controls.Contains(script_preview))
                    pnl_content.Controls.Add(script_preview);

            }
            else if (states.Peek() == (int)state.BatchSelection)
                description = ((Batch)cmb_batches.SelectedItem).description;

            //set the description if none is available
            if (description.Equals(""))
                description = "No description available.";

            //display description
            lbl_batch_description.Text = description;
        }