示例#1
0
        private string GetAdjoiningSurfaceTreatment(TestBenchModel.FEATestBench testBench)
        {
            CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum src = CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Testbench_Default;
            CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum dst = CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Testbench_Default;
            bool srcset = false;
            bool dstset = false;

            // Are the 2 settings compatible?
            if (SrcIntf.AdjSurfTreatment.HasValue)
            {
                srcset = true;
                src    = CombineAdjoiningValue(SrcIntf.AdjSurfTreatment.Value, testBench);
            }
            if (DstIntf.AdjSurfTreatment.HasValue)
            {
                dstset = true;
                dst    = CombineAdjoiningValue(DstIntf.AdjSurfTreatment.Value, testBench);
            }
            if (srcset && dstset)
            {
                if (src != dst)
                {
                    Logger.Instance.AddLogMessage("Conflicting adjoning surface settings. Component A: " + SrcIntf.CyPhyImpl.ToHyperLink() + ", Type: " + src.ToString() + "; Component B: " + DstIntf.CyPhyImpl.ToHyperLink() + ", Type: " + dst.ToString(), Severity.Error);
                    return(null);
                }
                else
                {
                    return(AdjoiningEnumToCADString(src));
                }
            }
            else if (srcset && !dstset)
            {
                return(AdjoiningEnumToCADString(src));
            }
            else if (!srcset && dstset)
            {
                return(AdjoiningEnumToCADString(dst));
            }
            else
            {
                switch (testBench.AdjSurfTreatment)
                {
                case CyPhyClasses.CADTestBench.AttributesClass.AdjoiningTreatment_enum.Bonded:
                    return(AdjoiningEnumToCADString(CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Bonded));

                case CyPhyClasses.CADTestBench.AttributesClass.AdjoiningTreatment_enum.Contacted:
                    return(AdjoiningEnumToCADString(CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Contacted));

                case CyPhyClasses.CADTestBench.AttributesClass.AdjoiningTreatment_enum.Free:
                    return(AdjoiningEnumToCADString(CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Free));

                case CyPhyClasses.CADTestBench.AttributesClass.AdjoiningTreatment_enum.Joint_Implied:
                    return(AdjoiningEnumToCADString(SrcIntf.ImliedSurfTreatment));
                }
            }
            // Shouldn't get here
            return(null);
        }
示例#2
0
        private CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum CombineAdjoiningValue(CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum input, TestBenchModel.FEATestBench testBench)
        {
            switch (input)
            {
            case CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Testbench_Default:
                switch (testBench.AdjSurfTreatment)
                {
                case CyPhyClasses.CADTestBench.AttributesClass.AdjoiningTreatment_enum.Bonded:
                    return(CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Bonded);

                case CyPhyClasses.CADTestBench.AttributesClass.AdjoiningTreatment_enum.Contacted:
                    return(CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Contacted);

                case CyPhyClasses.CADTestBench.AttributesClass.AdjoiningTreatment_enum.Free:
                    return(CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Free);

                case CyPhyClasses.CADTestBench.AttributesClass.AdjoiningTreatment_enum.Joint_Implied:
                    return(SrcIntf.ImliedSurfTreatment);
                }
                break;

            case CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Joint_Implied:
                return(SrcIntf.ImliedSurfTreatment);

            case CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Bonded:
                return(CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Bonded);

            case CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Contacted:
                return(CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Contacted);

            case CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Free:
                return(CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Free);
            }
            // Shouldn't get here
            return(CyPhyClasses.AdjoiningSurfacesTreatment.AttributesClass.Type_enum.Free);
        }
示例#3
0
        public static TestBenchModel.TestBenchBase CreateTestBenchModel(string type,
                                                                        CyPhy2CADSettings cadSetting,
                                                                        string outputdir,
                                                                        string projectdir,
                                                                        bool Automation)
        {
            TestBenchModel.TestBenchBase testBenchModel = null;

            if (type == "TestBench")
            {
                testBenchModel = new TestBenchModel.TestBench(cadSetting,
                                                              outputdir,
                                                              projectdir,
                                                              Automation);
                return(testBenchModel);
            }

            if (type == "BallisticTestBench")
            {
                testBenchModel = new TestBenchModel.BallisticTestBench(cadSetting,
                                                                       outputdir,
                                                                       projectdir,
                                                                       Automation);
                return(testBenchModel);
            }

            if (type == "CFDTestBench")
            {
                testBenchModel = new TestBenchModel.CFDTestBenchData(cadSetting,
                                                                     outputdir,
                                                                     projectdir,
                                                                     Automation);
                return(testBenchModel);
            }

            if (type == "BlastTestBench")
            {
                testBenchModel = new TestBenchModel.BlastTestBench(cadSetting,
                                                                   outputdir,
                                                                   projectdir,
                                                                   Automation);
                return(testBenchModel);
            }
            if (type == "CADTestBench")
            {
                testBenchModel = new TestBenchModel.FEATestBench(cadSetting,
                                                                 outputdir,
                                                                 projectdir,
                                                                 Automation);
                return(testBenchModel);
            }


            if (type == "KinematicTestBench")
            {
                testBenchModel = new TestBenchModel.KinematicTestBench(cadSetting,
                                                                       outputdir,
                                                                       projectdir,
                                                                       Automation);
                return(testBenchModel);
            }


            return(testBenchModel);
        }