private void btnOK_Click(object sender, System.EventArgs e) { clsParameters1 = new clsParameters(); clsParameters1.strName = edtName.Text; clsParameters1.strThickness_High = edtThickness_High.Text; clsParameters1.strBulkDensity_High = edtBulkDensity_High.Text; clsParameters1.strStructureFactor_High = edtStructureFactor_High.Text; clsParameters1.strFlowResistivity_High = edtFlowResistivity_High.Text; clsParameters1.strPoissionsRatio_High = edtPoissionsRatio_High.Text; clsParameters1.strYoungsModulus_High = edtYoungsModulus_High.Text; clsParameters1.strLossFactor_High = edtLossFactor_High.Text; clsParameters1.strThickness_Low = edtThickness_Low.Text; clsParameters1.strThermalCharLength_High = edtThermalCharLength_High.Text; clsParameters1.strProsity_High = edtProsity_High.Text; clsParameters1.strViscousCharLength_High = edtViscousCharLength_High.Text; clsParameters1.strBulkDensity_Low = edtBulkDensity_Low.Text; clsParameters1.strStructureFactor_Low = edtStructureFactor_Low.Text; clsParameters1.strProsity_Low = edtProsity_Low.Text; clsParameters1.strFlowResistivity_Low = edtFlowResistivity_Low.Text; clsParameters1.strPoissionsRatio_Low = edtPoissionsRatio_Low.Text; clsParameters1.strYoungsModulus_Low = edtYoungsModulus_Low.Text; clsParameters1.strLossFactor_Low = edtLossFactor_Low.Text; clsParameters1.strThermalCharLength_Low = edtThermalCharLength_Low.Text; clsParameters1.strViscousCharLength_Low = edtViscousCharLength_Low.Text; this.DialogResult = DialogResult.OK; this.Close(); }
/// <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; }
private string ParametersCheck(DataSet ds,clsParameters cls) { string strIDs = ""; for(int i = 0 ; i < ds.Tables[0].Rows.Count ; i++) { bool bResult = true; #region �� �Ķ���� ���� üũ (�ش���� ������ false �Է�) // BulkDens if(cls.strBulkDensity_Low != "") { if(double.Parse(ds.Tables[0].Rows[i]["BulkDens"].ToString()) < double.Parse(cls.strBulkDensity_Low)) { bResult = false; } } if(cls.strBulkDensity_High != "") { if(double.Parse(ds.Tables[0].Rows[i]["BulkDens"].ToString()) > double.Parse(cls.strBulkDensity_High)) { bResult = false; } } // FlowRes if(cls.strFlowResistivity_Low != "") { if(double.Parse(ds.Tables[0].Rows[i]["FlowRes"].ToString()) < double.Parse(cls.strFlowResistivity_Low)) { bResult = false; } } if(cls.strFlowResistivity_High != "") { if(double.Parse(ds.Tables[0].Rows[i]["FlowRes"].ToString()) > double.Parse(cls.strFlowResistivity_High)) { bResult = false; } } // LossFactor if(cls.strLossFactor_Low != "") { if(double.Parse(ds.Tables[0].Rows[i]["LossFactor"].ToString()) < double.Parse(cls.strLossFactor_Low)) { bResult = false; } } if(cls.strLossFactor_High != "") { if(double.Parse(ds.Tables[0].Rows[i]["LossFactor"].ToString()) > double.Parse(cls.strLossFactor_High)) { bResult = false; } } // PoissionR if(cls.strPoissionsRatio_Low != "") { if(double.Parse(ds.Tables[0].Rows[i]["PoissionR"].ToString()) < double.Parse(cls.strPoissionsRatio_Low)) { bResult = false; } } if(cls.strPoissionsRatio_High != "") { if(double.Parse(ds.Tables[0].Rows[i]["PoissionR"].ToString()) > double.Parse(cls.strPoissionsRatio_High)) { bResult = false; } } // Prosity if(cls.strProsity_Low != "") { if(double.Parse(ds.Tables[0].Rows[i]["Prosity"].ToString()) < double.Parse(cls.strProsity_Low)) { bResult = false; } } if(cls.strProsity_High != "") { if(double.Parse(ds.Tables[0].Rows[i]["Prosity"].ToString()) > double.Parse(cls.strProsity_High)) { bResult = false; } } // Sfactor if(cls.strStructureFactor_Low != "") { if(double.Parse(ds.Tables[0].Rows[i]["Sfactor"].ToString()) < double.Parse(cls.strStructureFactor_Low)) { bResult = false; } } if(cls.strStructureFactor_High != "") { if(double.Parse(ds.Tables[0].Rows[i]["Sfactor"].ToString()) > double.Parse(cls.strStructureFactor_High)) { bResult = false; } } // ThermalCL if(cls.strThermalCharLength_Low != "") { if(double.Parse(ds.Tables[0].Rows[i]["ThermalCL"].ToString()) < double.Parse(cls.strThermalCharLength_Low)) { bResult = false; } } if(cls.strThermalCharLength_High != "") { if(double.Parse(ds.Tables[0].Rows[i]["ThermalCL"].ToString()) > double.Parse(cls.strThermalCharLength_High)) { bResult = false; } } // Thick if(cls.strThickness_Low != "") { if(double.Parse(ds.Tables[0].Rows[i]["Thick"].ToString()) < double.Parse(cls.strThickness_Low)) { bResult = false; } } if(cls.strThickness_High != "") { if(double.Parse(ds.Tables[0].Rows[i]["Thick"].ToString()) > double.Parse(cls.strThickness_High)) { bResult = false; } } // ViscousCL if(cls.strViscousCharLength_Low != "") { if(double.Parse(ds.Tables[0].Rows[i]["ViscousCL"].ToString()) < double.Parse(cls.strViscousCharLength_Low)) { bResult = false; } } if(cls.strViscousCharLength_High != "") { if(double.Parse(ds.Tables[0].Rows[i]["ViscousCL"].ToString()) > double.Parse(cls.strViscousCharLength_High)) { bResult = false; } } // Ymodulus if(cls.strYoungsModulus_Low != "") { if(double.Parse(ds.Tables[0].Rows[i]["Ymodulus"].ToString()) < double.Parse(cls.strYoungsModulus_Low)) { bResult = false; } } if(cls.strYoungsModulus_High != "") { if(double.Parse(ds.Tables[0].Rows[i]["Ymodulus"].ToString()) > double.Parse(cls.strYoungsModulus_High)) { bResult = false; } } #endregion if(bResult == true) // ���ǿ� �����ϸ�ID �� �߰��Ѵ� { strIDs = strIDs + ds.Tables[0].Rows[i][0].ToString() + ","; } } if(strIDs != "") { strIDs = strIDs.Substring(0,strIDs.Length - 1); } return strIDs; }