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); } }
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); }
public void abmTests_defConst_returnsNOtNull() { double meshSize = .005; AbMachParameters parms = AbMachParamBuilder.Build( AbMachOperation.ROCKETCHANNEL, new RunInfo(), new RemovalRate(), new AWJModel.Material(), new AbMachJet(), new DepthInfo(), meshSize); Assert.IsNotNull(parms); }
void initParms() { meshSize = .005; diameter = .04; double nominalSurfaceSpeed = 40; double depthPerPass = .001; int runs = 1; int iterations = 1; int equationIndex = 2; double searchRadius = diameter * .1; 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 Vector3(1, 1, 0), DepthSearchType.FindAveDepth, searchRadius); var op = AbMachOperation.ROCKETCHANNEL; var mat = new AWJModel.Material(AWJModel.MaterialType.Metal, "Aluminum", .25, 123, 456, 789, 143, 345, 543, 1); parms = AbMachParamBuilder.Build(op, runInfo, removalRate, mat, jet, depthInfo, meshSize); }
public void abmTests_Const_valuesAreCorrect() { 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, 1, 1, 1, 1, 1, 1, 1); AbMachParameters parms = AbMachParamBuilder.Build(op, runInfo, removalRate, mat, jet, depthInfo, meshSize); Assert.AreEqual(nominalSurfaceSpeed, parms.RemovalRate.SurfaceSpeed, "surfspeed"); }