Ejemplo n.º 1
0
        private void button6_Click(object sender, EventArgs e)//圆柱体半径r相关计算
        {
            Calculate.ExcelToString(path, 1, 10, 5, true);

            Calculate.StringToDouble(temp);

            Calculate.Avgn(Convert1, 2);

            double Avg = Calculate.AvgDouble(Convert1); //求平均值

            Cal[15] = Avg;                              //将半径r的平均值保留到Cal数组中,以便后面计算

            textBox1.Text = Convert.ToString(Calculate.A(Avg, 2));

            double Axiangdui1 = Calculate.Axiangdui(Convert1);//求A类不确定度

            textBox2.Text = Convert.ToString(Calculate.A(Axiangdui1, 2));

            double Bxiangdui1 = Calculate.Bxiangdui(0.02);//求B类不确定度

            textBox3.Text = Convert.ToString(Calculate.A(Bxiangdui1, 2));

            double Zongbuqueding1 = Calculate.Zongbuqueding(Axiangdui1, Bxiangdui1);//求总不确定度

            textBox4.Text = Convert.ToString(Calculate.A(Zongbuqueding1, 2));

            double Xiangduibuqueding = Calculate.Xiangduibuqueding1(Zongbuqueding1, Avg); //求相对不确定度

            textBox5.Text = Convert.ToString(Calculate.A(Xiangduibuqueding, 2)) + "%";

            fiveData[4] = 4;
        }
Ejemplo n.º 2
0
        public void button2_Click(object sender, EventArgs e) //周期T相关计算
        {
            Calculate.ExcelToString(path, 1, 4, 2, false);    //读取对应数据,保存到公共变量中,后面同理

            Calculate.StringToDouble(temp);                   //将读取的string数组进行转换,后面同理

            Calculate.Avgn(Convert1, 20);                     //求平均值

            double Avg = Calculate.AvgDouble(Convert1);

            Cal[8] = Avg;//将周期T的平均值保留到Cal数组中,以便后面计算

            textBox1.Text = Convert.ToString(Calculate.A(Avg, 3));

            double Axiangdui1 = Calculate.Axiangdui(Convert1);//求A类不确定度

            textBox2.Text = Convert.ToString(Calculate.A(Axiangdui1, 3));

            double Bxiangdui1 = Calculate.Bxiangdui(0.002);//求B类不确定度

            textBox3.Text = Convert.ToString(Calculate.A(Bxiangdui1, 3));


            double Zongbuqueding1 = Calculate.Zongbuqueding(Axiangdui1, Bxiangdui1); //求总不确定度

            Cal[9] = Zongbuqueding1;                                                 //将周期T的总不确定度保留到Cal数组中,以便后面计算

            textBox4.Text = Convert.ToString(Calculate.A(Zongbuqueding1, 3));

            double Xiangduibuqueding = Calculate.Xiangduibuqueding1(Zongbuqueding1, Avg); //求相对不确定度

            textBox5.Text = Convert.ToString(Calculate.A(Xiangduibuqueding, 2)) + "%";

            fiveData[0] = 0;//定义一个新数组,用来控制后面暂时计算不了的计算按钮失效或者激活,后面同理
        }