Exemplo 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;
        }
Exemplo n.º 2
0
        }//窗体载入

        private void button7_Click(object sender, EventArgs e)//间接测量量H的相关计算

        {
            for (int i = 0; i < fiveData.Length; i++)
            {
                if (fiveData[i] != i)
                {
                    MessageBox.Show("数据缺少,请返回回第一页将直接测量量计算完整!");//确保计算H所需数据全部计算完毕

                    return;
                }
            }

            double Hbuquedingdu;

            double Hxiangdui;

            Cal[6] = Calculate.Hcalculate(Cal[2], Cal[0], Cal[1]); //计算H的平均值

            Hbuquedingdu = Calculate.Hbuquedingdu(Cal);            //计算H的总不确定度

            Cal[10] = Hbuquedingdu;

            Hxiangdui = Calculate.Xiangduibuqueding1(Hbuquedingdu, Cal[6]);

            textBox6.Text = Convert.ToString(Calculate.A(Cal[6], 2));

            textBox7.Text = Convert.ToString(Calculate.A(Hbuquedingdu, 2));

            textBox8.Text = Convert.ToString(Calculate.A(Hxiangdui, 2)) + "%";

            button8.Enabled = true;//H计算完毕,激活I的计算按钮
        }
Exemplo n.º 3
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;//定义一个新数组,用来控制后面暂时计算不了的计算按钮失效或者激活,后面同理
        }
Exemplo n.º 4
0
        private void button14_Click(object sender, EventArgs e)//第六组
        {
            textBox9.Text = Convert.ToString(Calculate.A(iTheoryOutput[5], 5));

            textBox10.Text = Convert.ToString(Calculate.A(iRealityOutput[5], 5));

            textBox11.Text = Convert.ToString(Calculate.A(iBaifenwucha[5], 2)) + "%";
        }
Exemplo n.º 5
0
        private void button8_Click(object sender, EventArgs e)//间接测量量转动惯量I的相关计算
        {
            Cal[7] = Convert.ToDouble(Calculate.ExcelToString(path, 1, 26, 2));

            double Icalculate = Calculate.Icalculate(Cal);//计算I的平均值

            Cal[14] = Icalculate;

            double Ixiangduibuquedingdu = Calculate.Ixiangduibuqueding(Cal);         //计算I的相对不确定度

            double Ibuquedingdu = Calculate.A(Icalculate * Ixiangduibuquedingdu, 5); //计算I的总不确定度,以及保留小数(四舍六入五凑偶)

            textBox6.Text = Convert.ToString(Calculate.A(Icalculate, 5));

            textBox7.Text = Ibuquedingdu.ToString("0.00000");

            textBox8.Text = Convert.ToString(Calculate.A(Ixiangduibuquedingdu, 2)) + "%";

            button15.Enabled = true;
        }