本文整理汇总了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;
}
}
}
}
示例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;
}
示例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();
}
示例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);
}
}
}
示例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);
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例9: CommonTraversal
public CommonTraversal(CyPhy.ConnectorComposition connection, CyPhy.ComponentAssembly topassembly)
{
Initialize();
startNodeID = "";
this.topAssembly = topassembly;
VisitConnectorComposition(connection);
}
示例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);
}
示例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;
}
示例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;
}
}
示例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);
}
示例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();
}
}
示例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;
}