当前位置: 首页>>代码示例>>C#>>正文


C# CyPhyML.Interfaces类代码示例

本文整理汇总了C#中ISIS.GME.Dsml.CyPhyML.Interfaces的典型用法代码示例。如果您正苦于以下问题:C# ISIS.GME.Dsml.CyPhyML.Interfaces类的具体用法?C# ISIS.GME.Dsml.CyPhyML.Interfaces怎么用?C# ISIS.GME.Dsml.CyPhyML.Interfaces使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ISIS.GME.Dsml.CyPhyML.Interfaces类属于命名空间,在下文中一共展示了ISIS.GME.Dsml.CyPhyML.Interfaces类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetCADModelTypesFromFilenames

 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;
             }
         }
     }
 }
开发者ID:neemask,项目名称:meta-core,代码行数:27,代码来源:CyphyMetaLinkUtils.cs

示例2: IsParent

 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;
 }
开发者ID:neemask,项目名称:meta-core,代码行数:11,代码来源:CommonTraversal.cs

示例3: CFDConfig

 public CFDConfig(CyPhy.CFDSolverSetting setting,
                  CyPhy.CFDTestBench testBench)
 {
     MeshFineness = (int)testBench.Attributes.MeshFineness + 1;
     SimulationTime = testBench.Attributes.SimulationTime;
     Core = testBench.Attributes.Core.ToString();
 }
开发者ID:neemask,项目名称:meta-core,代码行数:7,代码来源:CFDConfig.cs

示例4: VisitConnector

        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);
                }                 
                
            }
        }
开发者ID:neemask,项目名称:meta-core,代码行数:32,代码来源:CommonTraversal.cs

示例5: CollectLeafComponents

 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);
     }
 }
开发者ID:robertowens,项目名称:meta-core,代码行数:29,代码来源:FEATestBench.cs

示例6: InjectMetaLinkData

 /// <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;
     }
 }
开发者ID:neemask,项目名称:meta-core,代码行数:12,代码来源:CADContainer.cs

示例7: TBCadParameterMapping

 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;
 }
开发者ID:neemask,项目名称:meta-core,代码行数:8,代码来源:TBCadParameterMapping.cs

示例8: TestBenchTypeProcessor

        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;
        }
开发者ID:pombredanne,项目名称:metamorphosys-desktop,代码行数:8,代码来源:TestBenchTypeProcessor.cs

示例9: CommonTraversal

        public CommonTraversal(CyPhy.ConnectorComposition connection, CyPhy.ComponentAssembly topassembly)
        {
            Initialize();
            startNodeID = "";

            this.topAssembly = topassembly;

            VisitConnectorComposition(connection);
        }
开发者ID:metamorph-inc,项目名称:meta-core,代码行数:9,代码来源:CommonTraversal.cs

示例10: CreateFlatData

        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);
        }
开发者ID:neemask,项目名称:meta-core,代码行数:10,代码来源:CADFlatDataCreator.cs

示例11: CalmWaterSolverSettings

 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;
 }
开发者ID:neemask,项目名称:meta-core,代码行数:10,代码来源:CFDConfig.cs

示例12: GetParamUnitName

 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;
     }
 }
开发者ID:robertowens,项目名称:meta-core,代码行数:10,代码来源:FEATestBench.cs

示例13: CADComponent

        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);
        }
开发者ID:metamorph-inc,项目名称:meta-core,代码行数:55,代码来源:CADComponent.cs

示例14: Expand

        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();
            }
        }
开发者ID:metamorph-inc,项目名称:meta-core,代码行数:54,代码来源:TestBenchTypeProcessor.cs

示例15: EnsureComponentAssemblyFolder

        /// <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;
        }
开发者ID:neemask,项目名称:meta-core,代码行数:19,代码来源:ComponentLibraryManager.cs


注:本文中的ISIS.GME.Dsml.CyPhyML.Interfaces类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。