Пример #1
0
 public CFDConfig(CyPhy.CFDSolverSetting setting,
                  CyPhy.CFDTestBench testBench)
 {
     MeshFineness = (int)testBench.Attributes.MeshFineness + 1;
     SimulationTime = testBench.Attributes.SimulationTime;
     Core = testBench.Attributes.Core.ToString();
 }
Пример #2
0
 public static void SetCADModelTypesFromFilenames(CyPhyML.Component c)
 {
     foreach (CyPhyML.CADModel cadModel in c.Children.CADModelCollection)
     {
         List<ISIS.GME.Common.Interfaces.FCO> resources = new List<ISIS.GME.Common.Interfaces.FCO>();
         foreach (var usesResource in cadModel.DstConnections.UsesResourceCollection)
         {
             resources.Add(usesResource.DstEnd);
         }
         foreach (var usesResource in cadModel.SrcConnections.UsesResourceCollection)
         {
             resources.Add(usesResource.SrcEnd);
         }
         foreach (var resource in resources.Where(f => f.Impl.MetaBase.Name == "Resource")
             .Select(f => CyPhyMLClasses.Resource.Cast(f.Impl)))
         {
             if (resource.Attributes.Path.EndsWith(".prt") || resource.Attributes.Path.EndsWith(".PRT"))
             {
                 cadModel.Attributes.FileType = CyPhyMLClasses.CADModel.AttributesClass.FileType_enum.Part;
             }
             if (resource.Attributes.Path.EndsWith(".asm") || resource.Attributes.Path.EndsWith(".ASM"))
             {
                 cadModel.Attributes.FileType = CyPhyMLClasses.CADModel.AttributesClass.FileType_enum.Assembly;
             }
         }
     }
 }
Пример #3
0
        private void VisitConnector(CyPhy.Connector connector, MgaFCO parent)
        { 
            if (!visitedPorts.Contains(connector.ID + "_" + parent.ID))
            {
                visitedPorts.Add(connector.ID + "_" + parent.ID);
                
                bool parentIsComponent = (connector.ParentContainer is CyPhy.Component);
                bool isStart = (connector.ID == startNodeID);

                if (!isStart && parentIsComponent)
                {
                    FoundConnectedNodes.Add(connector);
                }

                foreach (CyPhy.ConnectorComposition conn in connector.SrcConnections.ConnectorCompositionCollection)
                {
                    if (topAssembly != null && !IsParent(conn, topAssembly)) continue;
                    if (parent.ObjType != GME.MGA.Meta.objtype_enum.OBJTYPE_REFERENCE ||
                        GetRefportOrParent((MgaConnection) conn.Impl, "src").ID == parent.ID)
                        VisitConnector(conn.SrcEnds.Connector, parent);
                }

                foreach (CyPhy.ConnectorComposition conn in connector.DstConnections.ConnectorCompositionCollection)
                {
                    if (topAssembly != null && !IsParent(conn, topAssembly)) continue;
                    if (parent.ObjType != GME.MGA.Meta.objtype_enum.OBJTYPE_REFERENCE ||
                        GetRefportOrParent((MgaConnection)conn.Impl, "dst").ID == parent.ID)
                    VisitConnector(conn.DstEnds.Connector, parent);
                }                 
                
            }
        }
Пример #4
0
 private void CollectLeafComponents(List<CyPhy.Component> result, CyPhy.ComponentAssembly assembly)
 {
     foreach (var compref in assembly.Children.ComponentRefCollection)
     {
         if (compref.AllReferred != null)
         {
             if (compref.AllReferred is CyPhy.ComponentAssemblyRef)
             {
                 CollectLeafComponents(result, compref.AllReferred as CyPhy.ComponentAssembly);
             }
             else if (compref.AllReferred is CyPhy.Component)
             {
                 // Interested in components with CAD Model only
                 if ((compref.AllReferred as CyPhy.Component).Children.CADModelCollection.Any())
                     result.Add(compref as CyPhy.Component);
             }
         }
     }
     foreach (var compass in assembly.Children.ComponentAssemblyCollection)
     {
         CollectLeafComponents(result, compass);
     }
     foreach (var comp in assembly.Children.ComponentCollection)
     {
         // Interested in components with CAD Model only
         if ((comp as CyPhy.Component).Children.CADModelCollection.Any())
             result.Add(comp);
     }
 }
Пример #5
0
 /// <summary>
 /// Injects Meta-Link related data into a pre-existing structure
 /// </summary>
 /// <param name="assembly"></param>
 public void InjectMetaLinkData(CyPhy.ComponentAssembly assembly, MetaLinkData data)
 {
     // There's only one cadassembly in case of Meta-Link!!
     foreach (DataRep.CADAssembly a in assemblies.Values)
     {
         a.MetaLinkData = data;
     }
 }
Пример #6
0
 public TBCadParameterMapping(CyPhy.CADParameter cadParam,
                              string tbParamName)
 {
     ComponentCADParameterName = cadParam.Attributes.ParameterName;
     if (cadParam.ParentContainer.ParentContainer.Kind == "Component")
         ComponentInstanceGUID = CyPhyClasses.Component.Cast(cadParam.ParentContainer.ParentContainer.Impl).Attributes.InstanceGUID;
     TestBenchParameterName = tbParamName;
 }
        public TestBenchTypeProcessor(CyPhy.TestBenchType testBenchType)
        {
            this.testBenchType = testBenchType;
            this.OriginalSystemUnderTest = testBenchType.Children.TopLevelSystemUnderTestCollection.FirstOrDefault();

            // HACK: used by PET, SoT and CyPhy2Modelica_v2 [old code]
            this.GetInvokedObject().RegistryValue["TestBenchUniqueName"] = this.testBenchType.Name;
        }
Пример #8
0
        public CommonTraversal(CyPhy.ConnectorComposition connection, CyPhy.ComponentAssembly topassembly)
        {
            Initialize();
            startNodeID = "";

            this.topAssembly = topassembly;

            VisitConnectorComposition(connection);
        }
Пример #9
0
        public void CreateFlatData(CyPhy.ComponentAssembly cyphyasm)
        {
            List<CyPhy.Component> regular = new List<CyPhy.Component>();
            List<CyPhy.Component> size2fitcomponents = new List<CyPhy.Component>();

            // [1] Grabs all components
            FindComponents(cyphyasm, regular, size2fitcomponents);

            ProcessComponents(regular, size2fitcomponents, cyphyasm);
        }
Пример #10
0
 public CalmWaterSolverSettings(CyPhy.CalmWaterSolverSettings settings,
                                CyPhy.CFDTestBench testBench)
     : base(settings,
            testBench)
 {
     Tier = 3;
     FluidMaterial = (MaterialType)(int)settings.Attributes.FluidMaterial;
     FluidTemperature = settings.Attributes.FluidTemperature;
     VehicleVelocity = settings.Attributes.VehicleVelocity;
 }
Пример #11
0
 private bool GetParamUnitName(CyPhy.Parameter param, ref string unit)
 {
     if (param.AllReferred as CyPhy.unit != null)
     {
         unit = (param.AllReferred as CyPhy.unit).Attributes.Symbol;
         return true;
     } else {
         return false;
     }
 }
Пример #12
0
        public CADComponent(CyPhy.Component cyphycomp, string ProjectDirectory, bool size2fit = false, string format = "Creo")
        {
            Type = CADDataType.Component;
            StructuralInterfaceNodes = new Dictionary<string, StructuralInterfaceConstraint>();
            DisplayID = cyphycomp.Attributes.InstanceGUID;
            Id = cyphycomp.ID;
            GraphvizID = UtilityHelpers.CleanString2(cyphycomp.ID, 50, "-");
            AVMID = cyphycomp.Attributes.AVMID;
            RevID = "";
            VersionID = cyphycomp.Attributes.Version;
            CADFormat = format;
            Name = cyphycomp.Name;
            CadParameters = new List<CADParameter>();
            ModelType = "Part";
            Size2Fit = size2fit;
            MaterialName = "";
            CyPhyModelPath = cyphycomp.GetDirectoryPath(ProjectDirectory: ProjectDirectory);
            Classification = cyphycomp.Attributes.Classifications;
            HyperLink = cyphycomp.ToHyperLink();
            CadElementsList = new List<CAD.ElementType>();
            pointCoordinatesList = new List<TestBenchModel.TBComputation>();

            CreateStructuralInterfaceEquivalent(cyphycomp);

            AddManufacturingParameters(cyphycomp);

            var specialinstr = cyphycomp.Children.ParameterCollection.Where(p => p.Name.ToUpper() == SpecialInstrParamStr);
            if (specialinstr.Any())
            {
                SpecialInstructions = specialinstr.First().Attributes.Value.Replace("\"", "");
            }

            // META-3555 hack
            if (cyphycomp.Children.CADModelCollection.Any())
            {
                foreach (var datum in cyphycomp.Children.CADModelCollection.First().Children.CADDatumCollection)
                {
                    if (datum.Name == "FRONT" || datum.Name == "TOP" || datum.Name == "RIGHT")
                    {
                        SpecialDatums.Add(new Datum(datum, "", false));
                    }
                }
            }

            foreach (var prop in cyphycomp.Children.PropertyCollection)
            {
                if (prop.Name.StartsWith("METADATA."))
                {
                    MetaData.Add(prop.Name.Substring(9), prop.Attributes.Value);
                }
            }

            TraverseComposites(cyphycomp);
            CreatePointCoordinatesList(cyphycomp);
        }
        public override void Expand(CyPhy.ComponentAssembly configuration)
        {
            this.Configuration = configuration;

            if (this.OriginalSystemUnderTest.Referred.DesignEntity.ID == configuration.ID)
            {
                this.expandedTestBenchType = this.testBenchType;
            }
            else
            {
                // create temp folder for test bench
                CyPhy.Testing testing = CyPhyClasses.Testing.Cast(this.testBenchType.ParentContainer.Impl);

                var tempFolderName = AnalysisModelProcessor.GetTemporaryFolderName(this.testBenchType.Impl);

                CyPhy.Testing tempFolder = testing.Children.TestingCollection.FirstOrDefault(x => x.Name == tempFolderName);
                if (tempFolder == null)
                {
                    tempFolder = CyPhyClasses.Testing.Create(testing);
                    tempFolder.Name = tempFolderName;

                    this.AddToTraceabilityAndTemporary(tempFolder.Impl, testing.Impl, recursive: false);
                }

                // copy test bench
                var tempCopy = (tempFolder.Impl as MgaFolder).CopyFCODisp(this.testBenchType.Impl as MgaFCO);
                // fix name
                tempCopy.Name = AnalysisModelProcessor.GetTemporaryObjectName(this.testBenchType.Impl, configuration.Impl);

                this.AddToTraceabilityAndTemporary(tempCopy, this.testBenchType.Impl);

                // set expanded property to the expanded element
                this.expandedTestBenchType = CyPhyClasses.TestBenchType.Cast(tempCopy);

                var tlsut = this.expandedTestBenchType.Children.TopLevelSystemUnderTestCollection.FirstOrDefault();

                // switch references
                try
                {
                    // redirect SUT
                    var switcher = new ReferenceSwitcher.ReferenceSwitcherInterpreter();
                    switcher.SwitchReference(configuration.Impl as MgaFCO, tlsut.Impl as IMgaReference);
                }
                catch (Exception ex)
                {
                    // handle failures for this (use case we can lose ports/connections/
                    // what if something is an instance/subtype/readonly etc...
                    throw new AnalysisModelExpandFailedException("ReferenceSwitcher failed.", ex);
                }

                // redirect TIPs
                this.SwitchAllTipReferences();
            }
        }
Пример #14
0
 private bool IsParent(CyPhy.ConnectorComposition conn, CyPhy.ComponentAssembly topassembly)
 {
     GmeCommon.Interfaces.Container container = conn.ParentContainer;
     while (container != null)
     {
         if (container.Guid == topAssembly.Guid)
             return true;
         container = container.ParentContainer;
     }
     return false;
 }
Пример #15
0
        /// <summary>
        /// Given a component assembly, ensures that the component assembly has a backend folder
        /// for storing resources. Creates a folder if necessary.
        /// </summary>
        /// <param name="ProjectDirectory">Directory in which the /designs/ folder resides. Defaults to project directory of <paramref name="componentAssembly"/></param>
        /// <returns>The path of the ComponentAssembly folder, relative to the project root</returns>
        public static String EnsureComponentAssemblyFolder(CyPhy.ComponentAssembly componentAssembly, string ProjectDirectory = null)
        {
            var mp_MgaProject = componentAssembly.Impl.Project;
            String p_ProjectRoot = ProjectDirectory ?? mp_MgaProject.GetRootDirectoryPath();

            if (string.IsNullOrEmpty(componentAssembly.Attributes.Path))
            {
                componentAssembly.Attributes.Path = GetRandomComponentAssemblyDir();
            }
            Directory.CreateDirectory(Path.Combine(p_ProjectRoot, componentAssembly.Attributes.Path));

            return componentAssembly.Attributes.Path;
        }
Пример #16
0
 public HydrostaticsSolverSettings(CyPhy.HydrostaticsSolverSettings settings,
                                   CyPhy.CFDTestBench testBench)
     : base(settings,
            testBench)
 {
     FluidMaterial = (MaterialType)(int)settings.Attributes.FluidMaterial;
     FluidTemperature = settings.Attributes.FluidTemperature;
     RollAngleStart = settings.Attributes.RollAngleStart;
     RollAngleEnd = settings.Attributes.RollAngleEnd;
     RollAngleStep = settings.Attributes.RollAngleStepSize;
     PitchAngleStart = settings.Attributes.PitchAngleStart;
     PitchAngleEnd = settings.Attributes.PitchAngleEnd;
     PitchAngleStep = settings.Attributes.PitchAngleStepSize;
 }
        public ParametricExplorationProcessor(CyPhy.ParametricExploration parametricExploration)
        {
            this.parametricExploration = parametricExploration;

            this.OriginalSystemUnderTest = parametricExploration
                .Children
                .TestBenchRefCollection
                .FirstOrDefault()
                .Referred
                .TestBenchType
                .Children
                .TopLevelSystemUnderTestCollection
                .FirstOrDefault();
        }
        public TestBenchSuiteProcessor(CyPhy.TestBenchSuite testBenchSuite)
        {
            this.testBenchSuite = testBenchSuite;

            this.OriginalSystemUnderTest = testBenchSuite
                .Children
                .TestBenchRefCollection
                .FirstOrDefault()
                .Referred
                .TestBenchType
                .Children
                .TopLevelSystemUnderTestCollection
                .FirstOrDefault();
        }
Пример #19
0
        List<CyPhy.Component> GetAllComponents(CyPhy.Components componentsFolder)
        {
            List<CyPhy.Component> componentList = new List<CyPhy.Component>();
            foreach (CyPhy.Components childComponentsFolder in componentsFolder.Children.ComponentsCollection)
            {
                componentList.AddRange(GetAllComponents(childComponentsFolder));
            }

            foreach (CyPhy.Component childComponent in componentsFolder.Children.ComponentCollection)
            {
                componentList.Add(childComponent);
            }
            return componentList;
        }
Пример #20
0
        public static HashSet<CyPhyML.Component> getCyPhyMLComponentSet(CyPhyML.ComponentAssembly cyPhyMLComponentAssembly) {

            HashSet<CyPhyML.Component> cyPhyMLComponentSet = new HashSet<CyPhyML.Component>();

            foreach (CyPhyML.ComponentAssembly childComponentAssemblyFolder in cyPhyMLComponentAssembly.Children.ComponentAssemblyCollection) {
                cyPhyMLComponentSet.UnionWith(getCyPhyMLComponentSet(childComponentAssemblyFolder));
            }

            foreach (CyPhyML.Component childComponent in cyPhyMLComponentAssembly.Children.ComponentCollection) {
                cyPhyMLComponentSet.Add(childComponent);
            }

            return cyPhyMLComponentSet;
        }
        public override void Expand(CyPhy.ComponentAssembly configuration)
        {
            this.Configuration = configuration;

            if (this.OriginalSystemUnderTest.Referred.DesignEntity.ID == configuration.ID)
            {
                this.expandedTestBenchSuite = this.testBenchSuite;
            }
            else
            {
                // create temp folder for test bench suite
                CyPhy.TestBenchSuiteFolder testing = CyPhyClasses.TestBenchSuiteFolder.Cast(this.testBenchSuite.ParentContainer.Impl);

                var tempFolderName = AnalysisModelProcessor.GetTemporaryFolderName(this.testBenchSuite.Impl);

                CyPhy.TestBenchSuiteFolder tempFolder = testing.Children.TestBenchSuiteFolderCollection.FirstOrDefault(x => x.Name == tempFolderName);
                if (tempFolder == null)
                {
                    tempFolder = CyPhyClasses.TestBenchSuiteFolder.Create(testing);
                    tempFolder.Name = tempFolderName;

                    this.AddToTraceabilityAndTemporary(tempFolder.Impl, testing.Impl, recursive: false);
                }

                // copy test bench suite
                var tempCopy = (tempFolder.Impl as MgaFolder).CopyFCODisp(this.testBenchSuite.Impl as MgaFCO);
                // fix name
                tempCopy.Name = AnalysisModelProcessor.GetTemporaryObjectName(this.testBenchSuite.Impl, configuration.Impl);

                this.AddToTraceabilityAndTemporary(tempCopy, this.testBenchSuite.Impl);

                // set expanded property to the expanded element
                this.expandedTestBenchSuite = CyPhyClasses.TestBenchSuite.Cast(tempCopy);
            }

            // expand all test benches
            foreach (var testBenchRef in this.expandedTestBenchSuite.Children.TestBenchRefCollection)
            {
                var testBenchTypeExpander = new TestBenchTypeProcessor(testBenchRef.Referred.TestBenchType);
                testBenchTypeExpander.Expand(configuration);

                // switch references
                var switcher = new ReferenceSwitcher.ReferenceSwitcherInterpreter();
                // TODO: handle failures for this
                switcher.SwitchReference(testBenchTypeExpander.expandedTestBenchType.Impl as MgaFCO, testBenchRef.Impl as IMgaReference);

                this.InnerExpanders.Push(testBenchTypeExpander);
            }
        }
Пример #22
0
        public static HashSet<CyPhyML.Component> getCyPhyMLComponentSet(CyPhyML.RootFolder cyPhyMLRootFolder) {

            HashSet<CyPhyML.Component> cyPhyMLComponentSet = new HashSet<CyPhyML.Component>();

            foreach (CyPhyML.Components childComponentsFolder in cyPhyMLRootFolder.Children.ComponentsCollection) {
                cyPhyMLComponentSet.UnionWith(getCyPhyMLComponentSet(childComponentsFolder));
            }

            foreach (CyPhyML.ComponentAssemblies childComponentAssembliesFolder in cyPhyMLRootFolder.Children.ComponentAssembliesCollection) {
                cyPhyMLComponentSet.UnionWith(getCyPhyMLComponentSet(childComponentAssembliesFolder));
            }

            return cyPhyMLComponentSet;

        }
        public CommonTraversal(GmeCommon.Interfaces.FCO start, CyPhy.ComponentAssembly topassembly)
        {
            Initialize();
            startNodeID = start.ID;

            this.topAssembly = topassembly;

            if (start is CyPhy.Connector)
            {
                VisitConnector(start as CyPhy.Connector, (MgaFCO)start.ParentContainer.Impl);
            }
            else if (start is CyPhy.CADDatum)
            {
                VisitCADDatum(start as CyPhy.CADDatum);
            }
        }
Пример #24
0
        public static String ExportToFile(CyPhy.Component c, String s_outFolder)
        {
            try
            {
                avm.Component avmComponent = CyPhy2ComponentModel.Convert.CyPhyML2AVMComponent(c);
                String s_outFilePath = String.Format("{0}\\{1}.component.acm", s_outFolder, System.IO.Path.GetRandomFileName());
                SerializeAvmComponent(avmComponent, s_outFilePath);

                return s_outFilePath;
            }
            catch (Exception ex)
            {
                var console = GMEConsole.CreateFromProject(c.Impl.Project);
                console.Error.WriteLine("Exception Parsing {0}: {1}", Safeify(c.Name), ex.Message);
                return null;
            }
        }
Пример #25
0
        public static HashSet<CyPhyML.Component> getCyPhyMLComponentSet(CyPhyML.TestBench cyPhyMLTestBench) {

            HashSet<CyPhyML.Component> cyPhyMLComponentSet = new HashSet<CyPhyML.Component>();

            foreach( CyPhyML.TopLevelSystemUnderTest cyPhyMLTopLevelSystemUnderTest in cyPhyMLTestBench.Children.TopLevelSystemUnderTestCollection ) {
                CyPhyML.DesignEntity cyPhyMLDesignEntity = cyPhyMLTopLevelSystemUnderTest.Referred as CyPhyML.DesignEntity;
                if (cyPhyMLDesignEntity is CyPhyML.ComponentAssembly) {
                    cyPhyMLComponentSet.UnionWith(getCyPhyMLComponentSet(cyPhyMLDesignEntity as CyPhyML.ComponentAssembly));
                }
            }

            foreach (CyPhyML.ComponentAssembly cyPhyMLComponentAssembly in cyPhyMLTestBench.Children.ComponentAssemblyCollection) {
                if ((cyPhyMLComponentAssembly.Impl as MgaFCO).MetaRole.Name != "TopLevelSystemUnderTest") continue;
                cyPhyMLComponentSet.UnionWith(getCyPhyMLComponentSet(cyPhyMLComponentAssembly));
            }

            return cyPhyMLComponentSet;
        }
Пример #26
0
        public Datum(CyPhy.CADDatum datum,
                     string compid, bool guide)
        {
            DatumName = datum.Attributes.DatumName;
            if (datum.Kind == "CoordinateSystem")
                Type = DatumType.CSYS;
            else if (datum.Kind == "Point")
                Type = DatumType.Point;
            else if (datum.Kind == "Surface")
                Type = DatumType.Surface;
            else if (datum.Kind == "Axis")
                Type = DatumType.Axis;

            ComponentID = compid;
            DatumID = datum.ID;
            Guide = guide;
            if (!String.IsNullOrEmpty(datum.Attributes.GeometricMarker))
                Marker = new GeometryMarkerRep(datum.Attributes.GeometricMarker);
        }
Пример #27
0
 private CyPhy.Parameter GetForceLoadParam(CyPhy.ForceLoadParam forceload, string name, out double param)
 {
     try
     {
         CyPhy.Parameter prm = forceload.Children.ParameterCollection.Where(p => ((MgaFCO)p.Impl).MetaRole.Name == name).First();
         param = String.IsNullOrEmpty(prm.Attributes.Value)?0:double.Parse(prm.Attributes.Value);
         return prm;
     }
     catch (InvalidOperationException)
     {
         Logger.Instance.AddLogMessage("Parameter" + name + " was not found in ForceLoad.", Severity.Error);
     }
     catch (FormatException)
     {
         Logger.Instance.AddLogMessage("Parameter" + name + " is not a valid floating point value.", Severity.Error);
     }
     param = 0;
     return null;
 }
Пример #28
0
 public CADParameter(CyPhy.CADParameter parameter)
 {
     Name = (parameter.Attributes.ParameterName == "") ? parameter.Name : parameter.Attributes.ParameterName;
     Type = parameter.Attributes.CADParameterType.ToString();
     Value = (parameter.Attributes.Value == "") ? (parameter.Attributes.DefaultValue == "") ? "0" : parameter.Attributes.DefaultValue : parameter.Attributes.Value;       
     Unit = "";
     if (parameter.Attributes.Unit == "")
     {
         if (parameter.Referred != null && parameter.Referred.unit != null)
         {
             Unit = parameter.Referred.unit.Attributes.Symbol;
         }
     }
     else
     {
         Unit = parameter.Attributes.Unit;
     }
 
 }
Пример #29
0
 private void VerifyBallisticThreat(CyPhy.BallisticThreat threat)
 {
     if (threat is CyPhy.ProjectileBallisticThreat)
     {
         CyPhy.ProjectileBallisticThreat t = threat as CyPhy.ProjectileBallisticThreat;
         if (t.Attributes.Diameter <= 0)
         {
             Logger.Instance.AddLogMessage("ProjectileBallisticThreat [" + threat.Name + "] diameter is <= 0", Severity.Warning);
         }
         if (t.Attributes.Length <= 0)
         {
             Logger.Instance.AddLogMessage("ProjectileBallisticThreat [" + threat.Name + "] length is <= 0", Severity.Warning);
         }
         if (t.Attributes.Mass <= 0)
         {
             Logger.Instance.AddLogMessage("ProjectileBallisticThreat [" + threat.Name + "] mass is <= 0", Severity.Warning);
         }
         if (t.Attributes.Speed <= 0)
         {
             Logger.Instance.AddLogMessage("ProjectileBallisticThreat [" + threat.Name + "] speed is <= 0", Severity.Warning);
         }
     }
     else if (threat is CyPhy.ShapedChargeJetBallisticThreat)
     {
         CyPhy.ShapedChargeJetBallisticThreat t = threat as CyPhy.ShapedChargeJetBallisticThreat;
         if (t.Attributes.Diameter <= 0)
         {
             Logger.Instance.AddLogMessage("ShapedChargeJetBallisticThreat [" + threat.Name + "] diameter is <= 0", Severity.Warning);
         }
         if (t.Attributes.Length <= 0)
         {
             Logger.Instance.AddLogMessage("ShapedChargeJetBallisticThreat [" + threat.Name + "] length is <= 0", Severity.Warning);
         }
         if (t.Attributes.Mass <= 0)
         {
             Logger.Instance.AddLogMessage("ShapedChargeJetBallisticThreat [" + threat.Name + "] mass is <= 0", Severity.Warning);
         }
         if (t.Attributes.Speed <= 0)
         {
             Logger.Instance.AddLogMessage("ShapedChargeJetBallisticThreat [" + threat.Name + "] speed is <= 0", Severity.Warning);
         }
     }
 }
        private CyPhy.Components GetImportFolder(CyPhy.RootFolder rf)
        {
            CyPhy.Components rtn = null;
            foreach (CyPhy.Components c in rf.Children.ComponentsCollection)
            {
                if (c.Name == ImportedComponentsFolderName)
                {
                    rtn = c;
                    break;
                }
            }

            if (rtn == null)
            {
                rtn = CyPhyClasses.Components.Create(rf);
                rtn.Name = ImportedComponentsFolderName;
            }

            return rtn;
        }