示例#1
0
        void buildParmsFromValues()
        {
            try
            {
                meshSize    = .003;
                jetDiameter = .110;
                double nominalSurfaceSpeed = 50.0;
                double depthPerPass        = .005;
                int    runs          = 10;
                int    iterations    = 1;
                int    equationIndex = 4;
                double searchRadius  = jetDiameter * .1;

                var jet         = new AbMachJet(meshSize, jetDiameter, equationIndex);
                var runInfo     = new RunInfo(runs, iterations, ModelRunType.RunAsIs);
                var removalRate = new RemovalRate(nominalSurfaceSpeed, depthPerPass);
                var depthInfo   = new DepthInfo(new Vector3(.456, .8254, 0), DepthSearchType.FindAveDepth, searchRadius);
                var op          = AbMachOperation.ROCKETCHANNEL;
                var mat         = new Material(
                    MaterialType.Metal,
                    "Aluminum",
                    thickness: .25,
                    millMachinabilityIndex: 1,
                    cutMachinabilityIndex: 1,
                    criticalAngleRadians: Math.PI * 70.0 / 180);
                parms = AbMachParamBuilder.Build(op, runInfo, removalRate, mat, jet, depthInfo, meshSize);
                AbMachParametersFile.Save(parms, "params.xml");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#2
0
        public void paramFile_openSavedFile_parmsOK()
        {
            double meshSize            = .005;
            double diameter            = .04;
            double nominalSurfaceSpeed = 40;
            double depthPerPass        = .001;
            int    runs          = 3;
            int    iterations    = 1;
            int    equationIndex = 2;

            var jet         = new AbMachJet(diameter, equationIndex);
            var runInfo     = new RunInfo(runs, iterations, ModelRunType.NewFeedrates);
            var removalRate = new RemovalRate(nominalSurfaceSpeed, depthPerPass);
            var depthInfo   = new DepthInfo(new GeometryLib.Vector3(1, 1, 0), DepthSearchType.FindAveDepth, diameter / 10);
            var op          = AbMachOperation.ROCKETCHANNEL;
            var mat         = new AWJModel.Material(AWJModel.MaterialType.Metal, "Aluminum", .25, 123, 456, 789, 143, 345, 543, 1);

            AbMachParameters parms    = AbMachParamBuilder.Build(op, runInfo, removalRate, mat, jet, depthInfo, meshSize);
            string           fileName = "paramSaveTest.prx";

            AbMachParametersFile.Save(parms, fileName);
            AbMachParameters parmsOpen = AbMachParametersFile.Open(fileName);

            Assert.AreEqual(parms.Material.CriticalRemovalAngle, parmsOpen.Material.CriticalRemovalAngle);
        }