Exemple #1
0
        private void ThicknessGaugeInit(AppConfigController configController, XMLMaterialsController materialsController)
        {
            var      nameMaterialPEC = configController.GetStrValue("materialPEC");
            Material materialPEC     = materialsController.GetMaterial(nameMaterialPEC);

            double       radiusPEC    = configController.GetDoubleValue("radiusPEC");
            double       amplitude    = configController.GetDoubleValue("amplitude");
            double       frequency    = configController.GetDoubleValue("frequency");
            AcousticWave acousticWave = new AcousticWave(amplitude, frequency);
            RoundPEC     roundPEC     = new RoundPEC(radiusPEC, materialPEC, acousticWave);

            var      nameMaterialTO = configController.GetStrValue("materialTO");
            Material materialTO     = materialsController.GetMaterial(nameMaterialTO);

            double     thicknessTO = configController.GetDoubleValue("thicknessTO");
            TestObject testObject  = new TestObject(materialTO, thicknessTO);

            this.thicknessGauge = new UltrasonicThicknessGauge(roundPEC, testObject);

            if (this.thicknessGauge.IsFresnelZone)
            {
                templatePath = @"Templates\ThicknessGaugeFresnel";
            }
            else
            {
                templatePath = @"Templates\ThicknessGaugeFraunhofer";
            }

            this.thicknessGauge.StartTesting();
        }
        public void UltrasonicThicknessGaugeTestInialize()
        {
            // arrange
            double   speedOfSound = 340;
            double   density      = 1.2;
            double   fspl         = 1.1;
            Material materialPEC  = new Material(speedOfSound, density, fspl);

            double       amplitude    = 15;
            double       frequency    = 4000;
            AcousticWave acousticWave = new AcousticWave(amplitude, frequency);

            double   radius   = 0.02;
            RoundPEC roundPEC = new RoundPEC(radius, materialPEC, acousticWave);

            double   speedOfSound2 = 3000;
            double   density2      = 1.2;
            double   fspl2         = 1.1;
            Material materialTO    = new Material(speedOfSound2, density2, fspl2);

            TestObject testObject = new TestObject(materialTO, 0.2);

            thicknessGauge = new UltrasonicThicknessGauge(roundPEC, testObject);
            thicknessGauge.StartTesting();
        }
        public static void RoundPECTestInitialize(TestContext testContext)
        {
            // arrange
            double radius = 0.02;

            double   speedOfSound = 340;
            double   density      = 1.2;
            double   fspl         = 1.1;
            Material material     = new Material(speedOfSound, density, fspl);

            double       amplitude    = 15;
            double       frequency    = 4000;
            AcousticWave acousticWave = new AcousticWave(amplitude, frequency);

            roundPEC = new RoundPEC(radius, material, acousticWave);
        }
Exemple #4
0
 private void WriteValuesToDocx(RoundPEC _converter, AcousticWave _acousticWave, TestObject _testObject, string _wavelength, AcousticAttenuation _attenuation)
 {
     wordController.Replace(Resources.RadiusPEC, _converter.Radius.ToString());
     wordController.Replace(Resources.WaveAmplitude, _acousticWave.Amplitude.ToString());
     wordController.Replace(Resources.Frequency, _acousticWave.Frequency.ToString());
     wordController.Replace(Resources.ThicknessTO, _testObject.Thickness.ToString());
     wordController.Replace(Resources.MaterialPEC, _converter.Material.Name);
     wordController.Replace(Resources.SpeedOfSoundPEC, _converter.Material.SpeedOfSound.ToString());
     wordController.Replace(Resources.DensityPEC, _converter.Material.Density.ToString());
     wordController.Replace(Resources.AcousticImpedancePEC, _converter.Material.AcousticImpedance.ToString());
     wordController.Replace(Resources.MaterialTO, _testObject.Material.Name);
     wordController.Replace(Resources.SpeedOfSoundTO, _testObject.Material.SpeedOfSound.ToString());
     wordController.Replace(Resources.DensityTO, _testObject.Material.Density.ToString());
     wordController.Replace(Resources.FsplTO, _testObject.Material.FSPL.ToString());
     wordController.Replace(Resources.AcousticImpedanceTO, _testObject.Material.AcousticImpedance.ToString());
     wordController.Replace(Resources.Wavelength, _wavelength);
     wordController.Replace(Resources.FresnelDistance, _converter.CalcFresnelDistance(_testObject.Material).ToString());
     wordController.Replace(Resources.FraunhoferDistance, _converter.CalcFraunhoferDistance(_testObject.Material).ToString());
     wordController.Replace(Resources.AreaPEC, _converter.Area.ToString());
     wordController.Replace(Resources.IntensityTransmittance, _attenuation.IntensityTransmittance.ToString());
     wordController.Replace(Resources.AcousticAttenuation, _attenuation.Сalculate().ToString());
     wordController.Replace(Resources.InAmplitude, thicknessGauge.ResponseAmplitude.ToString());
 }
        public void AttenuationFraunhoferPlaneTestInitialize()
        {
            // arrange
            double   speedOfSound = 340;
            double   density      = 1.2;
            double   fspl         = 1.1;
            Material materialPEC  = new Material(speedOfSound, density, fspl);

            double       amplitude    = 15;
            double       frequency    = 4000;
            AcousticWave acousticWave = new AcousticWave(amplitude, frequency);

            double   radius   = 0.02;
            RoundPEC roundPEC = new RoundPEC(radius, materialPEC, acousticWave);

            double   speedOfSound2 = 3000;
            double   density2      = 1.2;
            double   fspl2         = 1.1;
            Material materialTO    = new Material(speedOfSound2, density2, fspl2);

            TestObject testObject = new TestObject(materialTO, 0.2);

            attenuation = new AttenuationFresnelPlane(roundPEC, testObject);
        }