Exemplo n.º 1
0
        private void dataGridView_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
        {
            var dataList = this.dataGridView.DataSource as List <TestPoint>;

            //
            if (dataList == null)
            {
                return;
            }
            TestPoint.FindMaxErrorData(dataList);
            if (e.RowIndex < this.dataGridView.Rows.Count)
            {
                DataGridViewRow dgrSingle = this.dataGridView.Rows[e.RowIndex];
                try
                {
                    var testPoint = dataList[e.RowIndex];
                    if (testPoint.LineError > _upError || testPoint.LineError < -1 * _downError)
                    {
                        dgrSingle.DefaultCellStyle.ForeColor = Color.Red;
                    }

                    //如果误差最大的话,就标记为蓝色
                    //if (testPoint.IsMaxError == true)
                    //{
                    //    dgrSingle.DefaultCellStyle.ForeColor = Color.Blue;
                    //}
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 对采集的数据进行分析处理
        /// </summary>
        /// <param name="chart"></param>
        /// <param name="number"></param>
        /// <param name="angleOne"></param>
        /// <param name="angleTwo"></param>
        /// <param name="offSetLine"></param>
        private void AnalyzeData(Chart chart, int number, decimal angleOne, decimal angleTwo, decimal offSetLine)
        {
            //读取到测试的结果
            var vList = GetTestDataList();
            var list  = TestPoint.GetTestPointList(vList, angleOne, 1 * angleTwo, offSetLine, _uMax, _uMin, _upError, _downError);

            this._dataSource = list;
            //查找误差最大的数据
            TestPoint.FindMaxErrorData(list);
        }