예제 #1
0
        private void FormAutoCalc_Load(object sender, EventArgs e)
        {
            DataSourceEditor calcedValueEditor = new DataSourceEditor(WaitCalcValues);
            DataSourceEditor RefValueEditor = new DataSourceEditor(RefValues);
            CoefEditor coefValueEditor = new CoefEditor(CoeffValues);
            InaccuracyEditor inaccuracyEditor = new InaccuracyEditor(WaitCalcValues, RefValues);

            this.gridValueView.Redim(10, 12);
            this.gridValueView[titleRow, chNameCol] = new SourceGrid.Cells.ColumnHeader("ͨ��\r\n����");
            this.gridValueView[titleRow, chNameCol].RowSpan = 2;
            this.gridValueView[titleRow, calcedAmpliCol] = new SourceGrid.Cells.ColumnHeader("��У׼��");
            this.gridValueView[titleRow, calcedAmpliCol].ColumnSpan = 3;
            this.gridValueView[titleRow, refAmpliCol] = new SourceGrid.Cells.ColumnHeader("��׼��");
            this.gridValueView[titleRow, refAmpliCol].ColumnSpan = 3;
            this.gridValueView[titleRow, freq1700CoefCol] = new SourceGrid.Cells.ColumnHeader("ϵ��");
            this.gridValueView[titleRow, freq1700CoefCol].ColumnSpan = 4;
            this.gridValueView[titleRow, inaccuracyCol] = new SourceGrid.Cells.ColumnHeader("���");
            this.gridValueView[titleRow, inaccuracyCol].RowSpan = 2;
            this.gridValueView[detailedTitleRow, calcedAmpliCol] = new SourceGrid.Cells.ColumnHeader("����");
            this.gridValueView[detailedTitleRow, calcedFreqCol] = new SourceGrid.Cells.ColumnHeader("��Ƶ");
            this.gridValueView[detailedTitleRow, calcedLowFreqCol] = new SourceGrid.Cells.ColumnHeader("��Ƶ");
            this.gridValueView[detailedTitleRow, refAmpliCol] = new SourceGrid.Cells.ColumnHeader("����");
            this.gridValueView[detailedTitleRow, refFreqCol] = new SourceGrid.Cells.ColumnHeader("��Ƶ");
            this.gridValueView[detailedTitleRow, refLowFreqCol] = new SourceGrid.Cells.ColumnHeader("��Ƶ");

            this.gridValueView[detailedTitleRow, freq1700CoefCol] = new SourceGrid.Cells.ColumnHeader("1700Hz");
            this.gridValueView[detailedTitleRow, freq2000CoefCol] = new SourceGrid.Cells.ColumnHeader("2000Hz");
            this.gridValueView[detailedTitleRow, freq2300CoefCol] = new SourceGrid.Cells.ColumnHeader("2300Hz");
            this.gridValueView[detailedTitleRow, freq2600CoefCol] = new SourceGrid.Cells.ColumnHeader("2600Hz");

            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, chNameCol] = new SourceGrid.Cells.RowHeader("ͨ��" + (i + 1).ToString());

            }

            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, calcedAmpliCol] = new SourceGrid.Cells.Cell(i * 3);
                this.gridValueView[i + detailedTitleRow + 1, calcedAmpliCol].Editor = calcedValueEditor;
            }
            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, calcedFreqCol] = new SourceGrid.Cells.Cell(i * 3 + 1);
                this.gridValueView[i + detailedTitleRow + 1, calcedFreqCol].Editor = calcedValueEditor;

            }
            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, calcedLowFreqCol] = new SourceGrid.Cells.Cell(i * 3 + 2);
                this.gridValueView[i + detailedTitleRow + 1, calcedLowFreqCol].Editor = calcedValueEditor;

            }

            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, refAmpliCol] = new SourceGrid.Cells.Cell(i * 3);
                this.gridValueView[i + detailedTitleRow + 1, refAmpliCol].Editor = RefValueEditor;

            }

            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, refFreqCol] = new SourceGrid.Cells.Cell(i * 3 + 1);
                this.gridValueView[i + detailedTitleRow + 1, refFreqCol].Editor = RefValueEditor;

            }

            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, refLowFreqCol] = new SourceGrid.Cells.Cell(i * 3 + 2);
                this.gridValueView[i + detailedTitleRow + 1, refLowFreqCol].Editor = RefValueEditor;

            }
            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, inaccuracyCol] = new SourceGrid.Cells.Cell(i * 3);
                this.gridValueView[i + detailedTitleRow + 1, inaccuracyCol].Editor = inaccuracyEditor;

            }
            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, freq1700CoefCol] = new SourceGrid.Cells.Cell(i * 4);
                this.gridValueView[i + detailedTitleRow + 1, freq1700CoefCol].Editor = coefValueEditor;

            }

            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, freq2000CoefCol] = new SourceGrid.Cells.Cell(i * 4 + 1);
                this.gridValueView[i + detailedTitleRow + 1, freq2000CoefCol].Editor = coefValueEditor;

            }
            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, freq2300CoefCol] = new SourceGrid.Cells.Cell(i * 4 + 2);
                this.gridValueView[i + detailedTitleRow + 1, freq2300CoefCol].Editor = coefValueEditor;

            }
            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, freq2600CoefCol] = new SourceGrid.Cells.Cell(i * 4 + 3);
                this.gridValueView[i + detailedTitleRow + 1, freq2600CoefCol].Editor = coefValueEditor;

            }

            this.gridValueView.AutoSize = true;
            this.gridValueView.AutoSizeCells();
            this.gridValueView.Columns.StretchToFit();
            this.gridValueView.Rows.StretchToFit();
        }
예제 #2
0
        private void FormAutoCalc_Load(object sender, EventArgs e)
        {
            DataSourceEditor calcedValueEditor = new DataSourceEditor(WaitCalcValues);
            DataSourceEditor RefValueEditor    = new DataSourceEditor(RefValues);
            CoefEditor       coefValueEditor   = new CoefEditor(CoeffValues);
            InaccuracyEditor inaccuracyEditor  = new InaccuracyEditor(WaitCalcValues, RefValues);


            this.gridValueView.Redim(10, 12);
            this.gridValueView[titleRow, chNameCol]                  = new SourceGrid.Cells.ColumnHeader("通道\r\n名称");
            this.gridValueView[titleRow, chNameCol].RowSpan          = 2;
            this.gridValueView[titleRow, calcedAmpliCol]             = new SourceGrid.Cells.ColumnHeader("待校准板");
            this.gridValueView[titleRow, calcedAmpliCol].ColumnSpan  = 3;
            this.gridValueView[titleRow, refAmpliCol]                = new SourceGrid.Cells.ColumnHeader("基准板");
            this.gridValueView[titleRow, refAmpliCol].ColumnSpan     = 3;
            this.gridValueView[titleRow, freq1700CoefCol]            = new SourceGrid.Cells.ColumnHeader("系数");
            this.gridValueView[titleRow, freq1700CoefCol].ColumnSpan = 4;
            this.gridValueView[titleRow, inaccuracyCol]              = new SourceGrid.Cells.ColumnHeader("误差");
            this.gridValueView[titleRow, inaccuracyCol].RowSpan      = 2;
            this.gridValueView[detailedTitleRow, calcedAmpliCol]     = new SourceGrid.Cells.ColumnHeader("幅度");
            this.gridValueView[detailedTitleRow, calcedFreqCol]      = new SourceGrid.Cells.ColumnHeader("载频");
            this.gridValueView[detailedTitleRow, calcedLowFreqCol]   = new SourceGrid.Cells.ColumnHeader("低频");
            this.gridValueView[detailedTitleRow, refAmpliCol]        = new SourceGrid.Cells.ColumnHeader("幅度");
            this.gridValueView[detailedTitleRow, refFreqCol]         = new SourceGrid.Cells.ColumnHeader("载频");
            this.gridValueView[detailedTitleRow, refLowFreqCol]      = new SourceGrid.Cells.ColumnHeader("低频");

            this.gridValueView[detailedTitleRow, freq1700CoefCol] = new SourceGrid.Cells.ColumnHeader("1700Hz");
            this.gridValueView[detailedTitleRow, freq2000CoefCol] = new SourceGrid.Cells.ColumnHeader("2000Hz");
            this.gridValueView[detailedTitleRow, freq2300CoefCol] = new SourceGrid.Cells.ColumnHeader("2300Hz");
            this.gridValueView[detailedTitleRow, freq2600CoefCol] = new SourceGrid.Cells.ColumnHeader("2600Hz");

            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, chNameCol] = new SourceGrid.Cells.RowHeader("通道" + (i + 1).ToString());
            }


            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, calcedAmpliCol]        = new SourceGrid.Cells.Cell(i * 3);
                this.gridValueView[i + detailedTitleRow + 1, calcedAmpliCol].Editor = calcedValueEditor;
            }
            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, calcedFreqCol]        = new SourceGrid.Cells.Cell(i * 3 + 1);
                this.gridValueView[i + detailedTitleRow + 1, calcedFreqCol].Editor = calcedValueEditor;
            }
            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, calcedLowFreqCol]        = new SourceGrid.Cells.Cell(i * 3 + 2);
                this.gridValueView[i + detailedTitleRow + 1, calcedLowFreqCol].Editor = calcedValueEditor;
            }

            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, refAmpliCol]        = new SourceGrid.Cells.Cell(i * 3);
                this.gridValueView[i + detailedTitleRow + 1, refAmpliCol].Editor = RefValueEditor;
            }

            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, refFreqCol]        = new SourceGrid.Cells.Cell(i * 3 + 1);
                this.gridValueView[i + detailedTitleRow + 1, refFreqCol].Editor = RefValueEditor;
            }

            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, refLowFreqCol]        = new SourceGrid.Cells.Cell(i * 3 + 2);
                this.gridValueView[i + detailedTitleRow + 1, refLowFreqCol].Editor = RefValueEditor;
            }
            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, inaccuracyCol]        = new SourceGrid.Cells.Cell(i * 3);
                this.gridValueView[i + detailedTitleRow + 1, inaccuracyCol].Editor = inaccuracyEditor;
            }
            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, freq1700CoefCol]        = new SourceGrid.Cells.Cell(i * 4);
                this.gridValueView[i + detailedTitleRow + 1, freq1700CoefCol].Editor = coefValueEditor;
            }

            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, freq2000CoefCol]        = new SourceGrid.Cells.Cell(i * 4 + 1);
                this.gridValueView[i + detailedTitleRow + 1, freq2000CoefCol].Editor = coefValueEditor;
            }
            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, freq2300CoefCol]        = new SourceGrid.Cells.Cell(i * 4 + 2);
                this.gridValueView[i + detailedTitleRow + 1, freq2300CoefCol].Editor = coefValueEditor;
            }
            for (int i = 0; i < 8; i++)
            {
                this.gridValueView[i + detailedTitleRow + 1, freq2600CoefCol]        = new SourceGrid.Cells.Cell(i * 4 + 3);
                this.gridValueView[i + detailedTitleRow + 1, freq2600CoefCol].Editor = coefValueEditor;
            }

            this.gridValueView.AutoSize = true;
            this.gridValueView.AutoSizeCells();
            this.gridValueView.Columns.StretchToFit();
            this.gridValueView.Rows.StretchToFit();
        }