Exemplo n.º 1
0
        private void btnMeanView_Click(object sender, EventArgs e)
        {
            DrawDelegate method        = new DrawDelegate(this.Draw);
            int          selectedIndex = this.comboBox1.SelectedIndex;

            JSDU.Spectrometer.Data[] dataArray = new JSDU.Spectrometer.Data[1];
            if (this.Data != null)
            {
                dataArray[0].DataX = this.Data[selectedIndex].DataX;
                dataArray[0].DataY = new double[dataArray[0].DataX.Length];
                for (int i = 0; i < dataArray[0].DataX.Length; i++)
                {
                    dataArray[0].DataY[i] = this.MeanY[selectedIndex, i];
                }
                this.ViewStylemy = ViewStyle.Mean;
                base.BeginInvoke(method, new object[] { "平均谱图", dataArray, 0 });
            }
        }
Exemplo n.º 2
0
        private void btnStdErrView_Click(object sender, EventArgs e)
        {
            DrawDelegate method        = new DrawDelegate(this.Draw);
            int          selectedIndex = this.comboBox1.SelectedIndex;

            JSDU.Spectrometer.Data[] dataArray = new JSDU.Spectrometer.Data[1];
            if (this.Data != null)
            {
                dataArray[0].DataX = this.Data[selectedIndex].DataX;
                dataArray[0].DataY = new double[dataArray[0].DataX.Length];
                for (int i = 0; i < dataArray[0].DataX.Length; i++)
                {
                    dataArray[0].DataY[i] = this.StdErrY[selectedIndex, i];
                }
                this.ViewStylemy = ViewStyle.StdErr;
                base.BeginInvoke(method, new object[] { "标准差图", dataArray, 0 });
                this.txtMeanErr.Text   = this.DataHandlingmy.MeanValue(dataArray[0].DataY).ToString("0.000e0");
                this.txtMaxStdErr.Text = this.DataHandlingmy.MaxValue(dataArray[0].DataY).ToString("0.000e0");
            }
        }
Exemplo n.º 3
0
        private void ReDraw(object sender, EventArgs e)
        {
            DrawDelegate delegate2;
            int          num;

            if (this.ViewStylemy == ViewStyle.Spec)
            {
                delegate2 = new DrawDelegate(this.Draw);
                num       = (this.comboBox1.SelectedIndex < 0) ? 0 : this.comboBox1.SelectedIndex;
                if (this.Data.Length > 0)
                {
                    base.BeginInvoke(delegate2, new object[] { "光谱图", this.Data, num });
                }
                JSDU.Spectrometer.Data[] dataArray = new JSDU.Spectrometer.Data[1];
                dataArray[0].DataX = this.Data[num].DataX;
                dataArray[0].DataY = new double[dataArray[0].DataX.Length];
                for (int i = 0; i < dataArray[0].DataX.Length; i++)
                {
                    dataArray[0].DataY[i] = this.StdErrY[num, i];
                }
                this.txtMeanErr.Text   = this.DataHandlingmy.MeanValue(dataArray[0].DataY).ToString("0.000e0");
                this.txtMaxStdErr.Text = this.DataHandlingmy.MaxValue(dataArray[0].DataY).ToString("0.000e0");
            }
            else if (this.ViewStylemy == ViewStyle.Energy)
            {
                delegate2 = new DrawDelegate(this.Draw);
                num       = (this.comboBox1.SelectedIndex < 0) ? 0 : this.comboBox1.SelectedIndex;
                if (this.Data != null)
                {
                    base.BeginInvoke(delegate2, new object[] { "能量图", this.Data, num });
                }
            }
            else if (this.ViewStylemy == ViewStyle.Mean)
            {
                this.btnMeanView_Click(sender, e);
            }
            else if (this.ViewStylemy == ViewStyle.StdErr)
            {
                this.btnStdErrView_Click(sender, e);
            }
        }