Ejemplo n.º 1
0
        private void btnOK_Click(object sender, System.EventArgs e)
        {
            this.DialogResult = DialogResult.OK;

            clsAbsorptionCoefficient_Find1 = new clsAbsorptionCoefficient_Find();

            clsAbsorptionCoefficient_Find1.strName = edtName.Text;

            clsAbsorptionCoefficient_Find1.strAlpha = edtAlpha.Text;
            //clsAbsorptionCoefficient_Find1.str16 = edt16.Text;
            clsAbsorptionCoefficient_Find1.str2000 = edt2000.Text;
            clsAbsorptionCoefficient_Find1.str4000 = edt4000.Text;
            clsAbsorptionCoefficient_Find1.str1000 = edt1000.Text;
            clsAbsorptionCoefficient_Find1.str500  = edt500.Text;
            //clsAbsorptionCoefficient_Find1.str250 = edt250.Text;
            //clsAbsorptionCoefficient_Find1.str125 = edt125.Text;
            //clsAbsorptionCoefficient_Find1.str63 = edt63.Text;
            //clsAbsorptionCoefficient_Find1.str31_5 = edt31_5.Text;
            clsAbsorptionCoefficient_Find1.str8000  = edt8000.Text;
            clsAbsorptionCoefficient_Find1.str10000 = edt10000.Text;

            this.Close();
        }
Ejemplo n.º 2
0
        private string AbsorptionCoefficient_RigidBackingCheck(DataSet ds,clsAbsorptionCoefficient_Find cls)
        {
            string strIDs = "";
            string strFreq = "";
            string strY = "";
            string [] arrFreq;
            string [] arrY;

            string Y_16 = ""; // ���ļ��� 16 �϶� Y ��
            string Y_31_5 = "";
            string Y_63 = "";
            string Y_125 = "";
            string Y_250 = "";
            string Y_500 = "";
            string Y_1000 = "";
            string Y_2000 = "";
            string Y_4000 = "";
            string Y_8000 = "";
            string Y_10000 = "";

            for(int i = 0 ; i < ds.Tables[0].Rows.Count ; i++)
            {
                bool bResult = true;

                strFreq = ds.Tables[0].Rows[i]["X_Axis"].ToString();
                strY = ds.Tables[0].Rows[i]["Y_RigidBacking"].ToString();
                if(strFreq != "")
                {
                    arrFreq = strFreq.Split(",".ToCharArray());
                    arrY = strY.Split(",".ToCharArray());

                    if(arrFreq.Length == arrY.Length)
                    {
                        for(int j = 0 ; j < arrFreq.Length ; j++)
                        {
                            #region DB ���� �� ���ļ����� Y �� ������ ����
                            switch(arrFreq[j].ToString())
                            {
                                case "16" :
                                    Y_16 = arrY[j].ToString();
                                    break;
                                case "31.5" :
                                    Y_31_5 = arrY[j].ToString();
                                    break;
                                case "63" :
                                    Y_63 = arrY[j].ToString();
                                    break;
                                case "125" :
                                    Y_125 = arrY[j].ToString();
                                    break;
                                case "250" :
                                    Y_250 = arrY[j].ToString();
                                    break;
                                case "500" :
                                    Y_500 = arrY[j].ToString();
                                    break;
                                case "1000" :
                                    Y_1000 = arrY[j].ToString();
                                    break;
                                case "2000" :
                                    Y_2000 = arrY[j].ToString();
                                    break;
                                case "4000" :
                                    Y_4000 = arrY[j].ToString();
                                    break;
                                case "8000" :
                                    Y_8000 = arrY[j].ToString();
                                    break;
                                case "10000" :
                                    Y_10000 = arrY[j].ToString();
                                    break;
                            }
                            #endregion
                        }

                        #region ������ ����� üũ ������ ���� �ʴ°� �ϳ��� ������ false
                        double temp_cls = 0.0;
                        double temp_db = 0.0;

            //						if(cls.str16 != "")
            //						{
            //							temp_cls = double.Parse(cls.str16);
            //							temp_db = double.Parse(Y_16);
            //							if(temp_cls > temp_db)
            //							{
            //								bResult = false;
            //							}
            //						}
            //						if(cls.str31_5 != "")
            //						{
            //							temp_cls = double.Parse(cls.str31_5);
            //							temp_db = double.Parse(Y_31_5);
            //							if(temp_cls > temp_db)
            //							{
            //								bResult = false;
            //							}
            //						}
            //						if(cls.str63 != "")
            //						{
            //							temp_cls = double.Parse(cls.str63);
            //							temp_db = double.Parse(Y_63);
            //							if(temp_cls > temp_db)
            //							{
            //								bResult = false;
            //							}
            //						}
            //						if(cls.str125 != "")
            //						{
            //							temp_cls = double.Parse(cls.str125);
            //							temp_db = double.Parse(Y_125);
            //							if(temp_cls > temp_db)
            //							{
            //								bResult = false;
            //							}
            //						}
            //						if(cls.str250 != "")
            //						{
            //							temp_cls = double.Parse(cls.str250);
            //							temp_db = double.Parse(Y_250);
            //							if(temp_cls > temp_db)
            //							{
            //								bResult = false;
            //							}
            //						}
                        if(cls.str500 != "")
                        {
                            temp_cls = double.Parse(cls.str500);
                            temp_db = double.Parse(Y_500);
                            if(temp_cls > temp_db)
                            {
                                bResult = false;
                            }
                        }
                        if(cls.str1000 != "")
                        {
                            temp_cls = double.Parse(cls.str1000);
                            temp_db = double.Parse(Y_1000);
                            if(temp_cls > temp_db)
                            {
                                bResult = false;
                            }
                        }
                        if(cls.str2000 != "")
                        {
                            temp_cls = double.Parse(cls.str2000);
                            temp_db = double.Parse(Y_2000);
                            if(temp_cls > temp_db)
                            {
                                bResult = false;
                            }
                        }
                        if(cls.str4000 != "")
                        {
                            temp_cls = double.Parse(cls.str4000);
                            temp_db = double.Parse(Y_4000);
                            if(temp_cls > temp_db)
                            {
                                bResult = false;
                            }
                        }
                        if(cls.str8000 != "")
                        {
                            temp_cls = double.Parse(cls.str8000);
                            temp_db = double.Parse(Y_8000);
                            if(temp_cls > temp_db)
                            {
                                bResult = false;
                            }
                        }
                        if(cls.str10000 != "")
                        {
                            if(Y_10000 == "")
                            {
                                Y_10000 = "0";
                            }

                            temp_cls = double.Parse(cls.str10000);
                            temp_db = double.Parse(Y_10000);
                            if(temp_cls > temp_db)
                            {
                                bResult = false;
                            }
                        }
                        #endregion
                    }
                    else
                    {
                        bResult = false;
                    }
                }
                else
                {
                    bResult = false;
                }

                if(bResult == true) // ���ǿ� �����ϸ�ID �� �߰��Ѵ�
                {
                    strIDs = strIDs + ds.Tables[0].Rows[i][0].ToString() + ",";
                }
            }

            if(strIDs != "")
            {
                strIDs = strIDs.Substring(0,strIDs.Length - 1);
            }

            return strIDs;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// ��ȸ �Լ�
        /// </summary>
        /// <param name="Category"></param>
        /// <param name="IncidenceCondition"></param>
        /// <param name="MaterialType"></param>
        /// <param name="Option"></param>
        /// <param name="Frequency">1,Narrow band 2,Octave 3,1/3 Octav</param>
        public void Search(string Category,string IncidenceCondition,string MaterialType,string Option,string Frequency,
			clsAbsorptionCoefficient_Find clsAbsorptionCoefficient_RB,clsAbsorptionCoefficient_Find clsAbsorptionCoefficient_AT,
			clsAbsorptionCoefficient_Find clsAbsorptionCoefficient_TL,clsParameters clsParameters1,clsMultiLayer_Find clsMultiLayer_Find1,string strVendor,
			string strProducing,string strDate,int dMeasured)
        {
            string strIDs = "";
            bool bFlag = false;
            string strSID_Temp = "";

            MD_DB MD_DB1 = new MD_DB();

            switch(Option)
            {
                case "Absorption coefficient-rigid backing":
                    dsSearchResult = MD_DB1.Search(Category,IncidenceCondition,MaterialType,Frequency,clsAbsorptionCoefficient_RB.strName,strVendor,strProducing,strDate,dMeasured);
                    strIDs = AbsorptionCoefficient_RigidBackingCheck(dsSearchResult,clsAbsorptionCoefficient_RB);
                    break;
                case "Absorption coefficient-anechoic termination":
                    dsSearchResult = MD_DB1.Search(Category,IncidenceCondition,MaterialType,Frequency,clsAbsorptionCoefficient_AT.strName,strVendor,strProducing,strDate,dMeasured);
                    strIDs = AbsorptionCoefficient_AnechoicTerminationCheck(dsSearchResult,clsAbsorptionCoefficient_AT);
                    break;
                case "Transmission Loss":
                    dsSearchResult = MD_DB1.Search(Category,IncidenceCondition,MaterialType,Frequency,clsAbsorptionCoefficient_TL.strName,strVendor,strProducing,strDate,dMeasured);
                    strIDs = TransmissionLossCheck(dsSearchResult,clsAbsorptionCoefficient_TL);
                    break;
                case "Parameters":
                    dsSearchResult = MD_DB1.Search_Parameter(Category,IncidenceCondition,MaterialType,"0",clsParameters1.strName,strVendor,strProducing,strDate,dMeasured);
                    strIDs = ParametersCheck(dsSearchResult,clsParameters1);

                    bFlag = true;
                    break;
                case "MultiLayer":
                    dsSearchResult = MD_DB1.Search("Multi",IncidenceCondition,MaterialType,Frequency,"",strVendor,strProducing,strDate,dMeasured);
                    Category = "Multi";
                    strIDs = MultiLayerCheck(dsSearchResult,clsMultiLayer_Find1.strName,clsMultiLayer_Find1.strTotalThick);
                    bFlag = true;
                    break;
                case "Select":
                    dsSearchResult = MD_DB1.Search(Category,IncidenceCondition,MaterialType,"0","",strVendor,strProducing,strDate,dMeasured);
                    bFlag = true;
                    break;
            }
            if(bFlag == false)
            {
                dsSearchResult = MD_DB1.Search_IDs(Category,strIDs);
            }

            strSingle_Multi = Category;

            lstSearchResultList.Items.Clear();

            if(dsSearchResult != null)
            {
                if(Category != "Single")
                {
                    MultiListSetting();
                }
                else
                {
                    SearchResultList_Init();

                    MeterialTypeChange(this.strMeterialTypeChange);
                }

                for(int i = 0 ; i < dsSearchResult.Tables[0].Rows.Count ; i++)
                {
                    ListViewItem item = new ListViewItem();

                    if(Category == "Single")
                    {
                        if(strSID_Temp != dsSearchResult.Tables[0].Rows[i]["SID"].ToString())
                        {
                            strSID_Temp = dsSearchResult.Tables[0].Rows[i]["SID"].ToString();

                            item.SubItems[0].Text = dsSearchResult.Tables[0].Rows[i]["SID"].ToString();

                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["Name"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["Thick"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["FlowRes"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["LossFactor"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["BulkDens"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["Ymodulus"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["PoissionR"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["ThermalCL"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["ViscousCL"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["Prosity"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["Sfactor"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["EmP1"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["PRatioP1"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["DensityP1"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["EmP2"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["HP2"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["HP2"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["HP1"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["PRatioP2"].ToString());
                            item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["MID"].ToString());

                            lstSearchResultList.Items.Add(item);
                        }

                        bIsSingle = true;
                    }
                    else
                    {
                        item.SubItems[0].Text = dsSearchResult.Tables[0].Rows[i]["LID"].ToString();

                        item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["MultiLayer.Name"].ToString());
                        item.SubItems.Add(dsSearchResult.Tables[0].Rows[i]["TotalThick"].ToString());

                        bIsSingle = false;

                        lstSearchResultList.Items.Add(item);
                    }

                    //strSearchResult_Selected_ID = item.SubItems[0].Text;
                }
            }

            if(dsSearchResult == null || dsSearchResult.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("�˻� ����� �����ϴ�");
            }

            //pnlGraphOption.Enabled = false;
        }
Ejemplo n.º 4
0
        private void btnOK_Click(object sender, System.EventArgs e)
        {
            this.DialogResult = DialogResult.OK;

            clsAbsorptionCoefficient_Find1 = new clsAbsorptionCoefficient_Find();

            clsAbsorptionCoefficient_Find1.strName = edtName.Text;

            clsAbsorptionCoefficient_Find1.strAlpha = edtAlpha.Text;
            //clsAbsorptionCoefficient_Find1.str16 = edt16.Text;
            clsAbsorptionCoefficient_Find1.str2000 = edt2000.Text;
            clsAbsorptionCoefficient_Find1.str4000 = edt4000.Text;
            clsAbsorptionCoefficient_Find1.str1000 = edt1000.Text;
            clsAbsorptionCoefficient_Find1.str500 = edt500.Text;
            //clsAbsorptionCoefficient_Find1.str250 = edt250.Text;
            //clsAbsorptionCoefficient_Find1.str125 = edt125.Text;
            //clsAbsorptionCoefficient_Find1.str63 = edt63.Text;
            //clsAbsorptionCoefficient_Find1.str31_5 = edt31_5.Text;
            clsAbsorptionCoefficient_Find1.str8000 = edt8000.Text;
            clsAbsorptionCoefficient_Find1.str10000 = edt10000.Text;

            this.Close();
        }
Ejemplo n.º 5
0
        private string AbsorptionCoefficient_AnechoicTerminationCheck(DataSet ds,clsAbsorptionCoefficient_Find cls)
        {
            string strIDs = "";
            string strFreq = "";
            string strY = "";
            string [] arrFreq;
            string [] arrY;

            string Y_16 = ""; // ���ļ��� 16 �϶� Y ��
            string Y_31_5 = "";
            string Y_63 = "";
            string Y_125 = "";
            string Y_250 = "";
            string Y_500 = "";
            string Y_1000 = "";
            string Y_2000 = "";
            string Y_4000 = "";
            string Y_8000 = "";
            string Y_10000 = "";

            pSeries_Search = new DataPlotter.DataSeries();
            double [] dimdf_X = new double[11];
            double [] dimdf_Y = new double[11];

            pSeries_Search.Color = Color.SkyBlue;
            pSeries_Search.Name = "Search Axis";

            for(int i = 0 ; i < ds.Tables[0].Rows.Count ; i++)
            {
                bool bResult = true;

                strFreq = ds.Tables[0].Rows[i]["X_Axis"].ToString();
                strY = ds.Tables[0].Rows[i]["Y_AnechoicTermination"].ToString();
                if(strFreq != "")
                {
                    arrFreq = strFreq.Split(",".ToCharArray());
                    arrY = strY.Split(",".ToCharArray());

                    if(arrFreq.Length == arrY.Length)
                    {
                        for(int j = 0 ; j < arrFreq.Length ; j++)
                        {
                            #region DB ���� �� ���ļ����� Y �� ������ ����
                            switch(arrFreq[j].ToString())
                            {
                                case "16" :
                                    Y_16 = arrY[j].ToString();
                                    break;
                                case "31.5" :
                                    Y_31_5 = arrY[j].ToString();
                                    break;
                                case "63" :
                                    Y_63 = arrY[j].ToString();
                                    break;
                                case "125" :
                                    Y_125 = arrY[j].ToString();
                                    break;
                                case "250" :
                                    Y_250 = arrY[j].ToString();
                                    break;
                                case "500" :
                                    Y_500 = arrY[j].ToString();
                                    break;
                                case "1000" :
                                    Y_1000 = arrY[j].ToString();
                                    break;
                                case "2000" :
                                    Y_2000 = arrY[j].ToString();
                                    break;
                                case "4000" :
                                    Y_4000 = arrY[j].ToString();
                                    break;
                                case "8000" :
                                    Y_8000 = arrY[j].ToString();
                                    break;
                                case "10000" :
                                    Y_10000 = arrY[j].ToString();
                                    break;
                            }
                            #endregion
                        }

                        #region ������ ����� üũ ������ ���� �ʴ°� �ϳ��� ������ false
                        double temp_cls = 0.0;
                        double temp_db = 0.0;

                        if(cls.str500 != "")
                        {
                            temp_cls = double.Parse(cls.str500);
                            temp_db = double.Parse(Y_500);
                            if(temp_cls > temp_db)
                            {
                                bResult = false;
                            }

                            dimdf_X[5] = 500;
                            dimdf_Y[5] = temp_db;
                        }
                        if(cls.str1000 != "")
                        {
                            temp_cls = double.Parse(cls.str1000);
                            temp_db = double.Parse(Y_1000);
                            if(temp_cls > temp_db)
                            {
                                bResult = false;
                            }

                            dimdf_X[6] = 1000;
                            dimdf_Y[6] = temp_db;
                        }
                        if(cls.str2000 != "")
                        {
                            temp_cls = double.Parse(cls.str2000);
                            temp_db = double.Parse(Y_2000);
                            if(temp_cls > temp_db)
                            {
                                bResult = false;
                            }

                            dimdf_X[7] = 2000;
                            dimdf_Y[7] = temp_db;
                        }
                        if(cls.str4000 != "")
                        {
                            temp_cls = double.Parse(cls.str4000);
                            temp_db = double.Parse(Y_4000);
                            if(temp_cls > temp_db)
                            {
                                bResult = false;
                            }

                            dimdf_X[8] = 4000;
                            dimdf_Y[8] = temp_db;
                        }
                        if(cls.str8000 != "")
                        {
                            temp_cls = double.Parse(cls.str8000);
                            temp_db = double.Parse(Y_8000);
                            if(temp_cls > temp_db)
                            {
                                bResult = false;
                            }

                            dimdf_X[9] = 8000;
                            dimdf_Y[9] = temp_db;
                        }
                        if(cls.str10000 != "")
                        {
                            temp_cls = double.Parse(cls.str10000);
                            temp_db = double.Parse(Y_10000);
                            if(temp_cls > temp_db)
                            {
                                bResult = false;
                            }

                            dimdf_X[10] = 10000;
                            dimdf_Y[10] = temp_db;
                        }
                        #endregion
                    }
                    else
                    {
                        bResult = false;
                    }
                }
                else
                {
                    bResult = false;
                }

                if(bResult == true) // ���ǿ� �����ϸ�ID �� �߰��Ѵ�
                {
                    strIDs = strIDs + ds.Tables[0].Rows[i]["SGID"].ToString() + ",";
                }
            }

            pSeries_Search.XData = dimdf_X;
            pSeries_Search.YData = dimdf_Y;

            if(strIDs != "")
            {
                strIDs = strIDs.Substring(0,strIDs.Length - 1);
            }

            return strIDs;
        }