示例#1
0
        public void FileAllParsing(ucMaterialPropertiesEstimation ucMaterialPropertiesEstimation1, string strName)
        {
            bool result;

            for (int i = 0; i < lstFileList.Items.Count; i++)
            {
                MPEClass1 = new MPEClass();
                MPEData MPEData1 = MPEClass1.NewMPEData();

                result = MPEData1.FileLoad(lstFileList.Items[i].SubItems[1].Text);
                if (result == false)                // 유효한 화일이 아니면 삭제한다
                {
                    MPEClass1.DeleteMPEData(MPEData1);
                }
                else
                {
                    MPEClass1.Name = strName;
                    ParameterInput(MPEData1, ucMaterialPropertiesEstimation1);
                    MaterialTypeInput(MPEData1);


                    //MPEData1.Calc();
                }
            }

            if (MPEClass1 != null)
            {
                frmCalc frmCalc1 = new frmCalc();
                frmCalc1.MPEClass1 = MPEClass1;
                frmCalc1.ShowDialog();
            }
        }
示例#2
0
        private void DB_Load(MPEData MPEData1)
        {
            MPE_DB  MPE_DB1                  = new MPE_DB();
            DataSet ds                       = MPE_DB1.GetSingleMaterialGraph(lblDataBaseLoad_ID.Text);
            string  strGraphType             = ds.Tables[0].Rows[0]["GraphType"].ToString();
            string  strX_Axis                = ds.Tables[0].Rows[0]["X_Axis"].ToString();
            string  strY_RigidBacking        = ds.Tables[0].Rows[0]["Y_RigidBacking"].ToString();
            string  strY_AnechoicTermination = ds.Tables[0].Rows[0]["Y_AnechoicTermination"].ToString();

            if (strX_Axis != "")
            {
                string [] dstrX_Axis                = strX_Axis.Split(",".ToCharArray());
                string [] dstrY_RigidBacking        = strY_RigidBacking.Split(",".ToCharArray());
                string [] dstrY_AnechoicTermination = strY_AnechoicTermination.Split(",".ToCharArray());

                if (strGraphType == "1")
                {
                    for (int i = 0; i < dstrX_Axis.Length; i++)
                    {
                        MPEData1.Frequency.AddData(double.Parse(dstrX_Axis[i].ToString()));
                        MPEData1.MAbsorption.AddData(double.Parse(dstrY_RigidBacking[i].ToString()));
                    }
                }
//				else if(strGraphType == "2")
//				{
//					for(int i = 0 ; i < dstrX_Axis.Length ; i++)
//					{
//						MPEData1.Frequency.AddData(double.Parse(dstrX_Axis[i].ToString()));
//						MPEData1.MSurfaceImpedance.AddData(double.Parse(dstrY_AnechoicTermination[i].ToString()));
//					}
//				}
            }
        }
示例#3
0
        public void ParameterInput(MPEData MPEData1, ucMaterialPropertiesEstimation ucMaterialPropertiesEstimation1)
        {
            MPEData1.Thickness   = double.Parse(ucMaterialPropertiesEstimation1.strThickness);
            MPEData1.BulkDensity = double.Parse(ucMaterialPropertiesEstimation1.strBulkDensity);
            MPEData1.FResist     = double.Parse(ucMaterialPropertiesEstimation1.strFlowResistivity);
            MPEData1.SFactor     = double.Parse(ucMaterialPropertiesEstimation1.strStructureFactor);
            MPEData1.Porosity    = double.Parse(ucMaterialPropertiesEstimation1.strProsity);
            MPEData1.ViscousCL   = double.Parse(ucMaterialPropertiesEstimation1.strViscousCharLength) / 1000000;
            MPEData1.ThermalCL   = double.Parse(ucMaterialPropertiesEstimation1.strThermalCharLength) / 1000000;
            MPEData1.Ymodulus    = double.Parse(ucMaterialPropertiesEstimation1.strYoungsModulus);
            MPEData1.PoissonR    = double.Parse(ucMaterialPropertiesEstimation1.strPoissionsRatio);
            MPEData1.LossFactor  = double.Parse(ucMaterialPropertiesEstimation1.strLossFactor);

            //MPEData1.Name = ucMaterialPropertiesEstimation1.e;
            MPEData1.Temperature = double.Parse(this.edtTemperature.Text);
            MPEData1.SID         = MPEClass1.SID;

            MPEData1.FResistEst    = !ucMaterialPropertiesEstimation1.IsEnableFlowResistivity;
            MPEData1.SFactorEst    = !ucMaterialPropertiesEstimation1.IsEnableStructureFactor;
            MPEData1.ViscousCLEst  = !ucMaterialPropertiesEstimation1.IsEnableViscousCharLength;
            MPEData1.ThermalCLEst  = !ucMaterialPropertiesEstimation1.IsEnableThermalCharLength;
            MPEData1.PorosityEst   = !ucMaterialPropertiesEstimation1.IsEnableProsity;
            MPEData1.YmodulusEst   = !ucMaterialPropertiesEstimation1.IsEnableYoungsModulus;
            MPEData1.PoissonREst   = !ucMaterialPropertiesEstimation1.IsEnablePoissionsRatio;
            MPEData1.LossFactorEst = !ucMaterialPropertiesEstimation1.IsEnableLossFactor;
        }
示例#4
0
        public MPEData NewMPEData()
        {
            MPEData MPEData_Entity = new MPEData();

            EstData.Add(MPEData_Entity);

            return(MPEData_Entity);
        }
示例#5
0
        public MPEData CopyMPEData()
        {
            if (EstData.Count > 0)
            {
                MPEData MPEData_Entity = ((MPEData)EstData[0]).Copy();
                EstData.Add(MPEData_Entity);

                return(MPEData_Entity);
            }
            else
            {
                return(NewMPEData());
            }
        }
示例#6
0
        public void DataBaseLoad(ucMaterialPropertiesEstimation ucMaterialPropertiesEstimation1, string strName)
        {
            MPEClass1 = new MPEClass();
            MPEData MPEData1 = MPEClass1.NewMPEData();

            MPEData1.Name = strName;
            DB_Load(MPEData1);
            ParameterInput(MPEData1, ucMaterialPropertiesEstimation1);
            MaterialTypeInput(MPEData1);

            MPEClass1.SID  = int.Parse(lblDataBaseLoad_ID.Text);
            MPEClass1.Name = lblDataBaseLoadName.Text;

            frmCalc frmCalc1 = new frmCalc();

            frmCalc1.MPEClass1 = MPEClass1;
            frmCalc1.ShowDialog();

            //MPEData1.Calc();
            //MPEClass1.Temp();
            //MPEClass1.Calc();
        }
示例#7
0
 public void DeleteMPEData(MPEData obj)
 {
     EstData.Remove(obj);
 }
示例#8
0
 private void MaterialTypeInput(MPEData MPEData1)
 {
     MPEData1.MID = int.Parse(MaterialTypeds.Tables[0].Rows[cboMeterialType.SelectedIndex]["MID"].ToString());
 }
示例#9
0
        public void GraphDraw()
        {
            DataPlotter.DataSeries pSeries1;
            DataPlotter.DataSeries pSeries2;
            DataPlotter.DataSeries pSeries3;

            plotter1.ColorGrid   = Color.LightGray;
            plotter1.XRangeStart = 0;
            plotter1.XRangeEnd   = 6400;
            plotter1.XGrid       = 1000;
            plotter1.YRangeStart = 0;
            plotter1.YRangeEnd   = 1;
            plotter1.YGrid       = 0.2;
            plotter1.Series.Clear();

            plotter2.ColorGrid   = Color.LightGray;
            plotter2.XRangeStart = 0;
            plotter2.XRangeEnd   = 6400;
            plotter2.XGrid       = 1000;
            plotter2.YRangeStart = 0;
            plotter2.YRangeEnd   = 1;
            plotter2.YGrid       = 0.2;
            plotter2.Series.Clear();

            plotter3.ColorGrid   = Color.LightGray;
            plotter3.XRangeStart = 0;
            plotter3.XRangeEnd   = 6400;
            plotter3.XGrid       = 1000;
            plotter3.YRangeStart = 0;
            plotter3.YRangeEnd   = 60;
            plotter3.YGrid       = 10;
            plotter3.Series.Clear();

            bool DataExist = false;

            MPEData MPEData1;
            MD_DB   MD_DB1 = new MD_DB();

            int dGraph_ID = 0;

            for (int i = 0; i < strID.Length; i++)
            {
                dGraph_ID = MD_DB1.IsGraphExist(bIsSingle, Measured, Incidence, FreqBand, 1, int.Parse(strID[i]));
                if (dGraph_ID != -1)
                {
                    MPEData1 = new MPEData();

                    if (MPEData1.DBLoad(bIsSingle, dGraph_ID) == true)
                    {
                        DataExist = true;

                        pSeries1      = new DataPlotter.DataSeries();
                        pSeries1.Name = "Data " + i.ToString();

                        int dR = (30 * i * 1000) % 256;
                        int dG = (20 * i * 200) % 256;
                        int dB = (10 * i * 10) % 256;

                        pSeries1.Color = Color.FromArgb(dR, dG, dB);

//						switch(i)
//						{
//							case 0 :
//								pSeries1.Color = Color.Blue ;
//								break;
//							case 1 :
//								pSeries1.Color = Color.Red ;
//								break;
//							case 2 :
//								pSeries1.Color = Color.Yellow ;
//								break;
//							case 3 :
//								pSeries1.Color = Color.Green ;
//								break;
//						}

                        pSeries1.XData = MPEData1.Frequency.GetData();
                        pSeries1.YData = MPEData1.MAbsorption.GetData();


                        plotter1.YLabel = "Absorption Coefficient for Rigid Backing";
                        plotter1.XLabel = "Frequency [Hz]";



                        if (DataExist == true)
                        {
                            plotter1.Series.Add(pSeries1);
                        }
                    }
                }
            }

            //plotter1.AutoRange();
            plotter1.Refresh();

            for (int i = 0; i < strID.Length; i++)
            {
                dGraph_ID = MD_DB1.IsGraphExist(bIsSingle, Measured, Incidence, FreqBand, 2, int.Parse(strID[i]));
                if (dGraph_ID != -1)
                {
                    MPEData1 = new MPEData();

                    if (MPEData1.DBLoad(bIsSingle, dGraph_ID) == true)
                    {
                        DataExist = true;

                        pSeries2      = new DataPlotter.DataSeries();
                        pSeries2.Name = "Data " + i.ToString();

                        pSeries2.XData = MPEData1.Frequency.GetData();
                        pSeries2.YData = MPEData1.MAbsorption.GetData();

                        int dR = (30 * i * 1000) % 256;
                        int dG = (20 * i * 200) % 256;
                        int dB = (10 * i * 10) % 256;

                        pSeries2.Color = Color.FromArgb(dR, dG, dB);

//						switch(i)
//						{
//							case 0 :
//								pSeries2.Color = Color.Blue ;
//								break;
//							case 1 :
//								pSeries2.Color = Color.Red ;
//								break;
//							case 2 :
//								pSeries2.Color = Color.Yellow ;
//								break;
//							case 3 :
//								pSeries2.Color = Color.Green ;
//								break;
//						}

                        if (DataExist == true)
                        {
                            plotter2.Series.Add(pSeries2);
                        }

                        plotter2.YLabel = "Absotpyion Coefficient for Anechoic termiation";
                        plotter2.XLabel = "Frequency [Hz]";
                    }
                }

                //plotter2.AutoRange();
                plotter2.Refresh();
            }

            for (int i = 0; i < strID.Length; i++)
            {
                dGraph_ID = MD_DB1.IsGraphExist(bIsSingle, Measured, Incidence, FreqBand, 3, int.Parse(strID[i]));
                if (dGraph_ID != -1)
                {
                    MPEData1 = new MPEData();

                    if (MPEData1.DBLoad(bIsSingle, dGraph_ID) == true)
                    {
                        DataExist = true;

                        pSeries3      = new DataPlotter.DataSeries();
                        pSeries3.Name = "Data " + i.ToString();

                        int dR = (30 * i * 1000) % 256;
                        int dG = (20 * i * 200) % 256;
                        int dB = (10 * i * 10) % 256;

                        pSeries3.Color = Color.FromArgb(dR, dG, dB);

//						switch(i)
//						{
//							case 0 :
//								pSeries3.Color = Color.Blue ;
//								break;
//							case 1 :
//								pSeries3.Color = Color.Red ;
//								break;
//							case 2 :
//								pSeries3.Color = Color.Yellow ;
//								break;
//							case 3 :
//								pSeries3.Color = Color.Green ;
//								break;
//						}

                        pSeries3.XData = MPEData1.Frequency.GetData();
                        pSeries3.YData = MPEData1.MAbsorption.GetData();

                        plotter3.YLabel = "Transmission Loss [dB]";
                        plotter3.XLabel = "Frequency [Hz]";

                        if (DataExist == true)
                        {
                            plotter3.Series.Add(pSeries3);
                        }
                    }
                }
            }

            //plotter3.AutoRange();
            plotter3.Refresh();
        }