示例#1
0
        public override void GenerateCADXMLOutput()
        {
            CAD.AssembliesType assembliesoutroot = cadDataContainer.ToCADXMLOutput(this);
            if (assembliesoutroot.Assembly.Length > 0)
            {
                AddAnalysisToXMLOutput(assembliesoutroot.Assembly[0]);

                // file location
                Survivability.FileLocation fileloc = new Survivability.FileLocation();
                if (blastConfig.analysis.tier > 1)
                {
                    fileloc.directory = "AP203_E2_SEPARATE_PART_FILES";
                }
                else
                {
                    fileloc.directory = "AP203_E2_SINGLE_FILE";
                }
                fileloc.name = assembliesoutroot.Assembly[0].CADComponent.Name + "_asm.stp";
                fileloc.type = Survivability.FileLocation.FileTypeEnum.STEPFile;
                blastConfig.fileLocations.Add(fileloc);
                AddStaticAnalysisMetrics(assembliesoutroot.Assembly[0]);
            }

            AddDataExchangeFormatToXMLOutput(assembliesoutroot);
            assembliesoutroot.SerializeToFile(Path.Combine(OutputDirectory, TestBenchBase.CADAssemblyFile));
        }
示例#2
0
        public override void GenerateCADXMLOutput()
        {
            CAD.AssembliesType assembliesoutroot = cadDataContainer.ToCADXMLOutput(this);
            if (ProcessingInstructions.Count != 0)
            {
                CAD.ProcessingInstructionsType  instr        = new CAD.ProcessingInstructionsType();
                CAD.ProcessingInstructionType[] instructions = new CAD.ProcessingInstructionType[ProcessingInstructions.Count];
                int j = 0;
                foreach (var i in ProcessingInstructions)
                {
                    instructions[j]           = new CAD.ProcessingInstructionType();
                    instructions[j].Primary   = i.Key;
                    instructions[j].Secondary = i.Value;
                }
                instr.ProcessingInstruction = instructions;
                assembliesoutroot.ProcessingInstructions = instr;
            }
            // R.O. 1/26/2015, InterferenceCheck deprecated. Now interference check is specified by adding a InterferenceCount to
            // a CADComputationComponent
            //if ((Computations.Any() || InterferenceCheck) && assembliesoutroot.Assembly.Length > 0)
            if (this.StaticAnalysisMetrics.Any() && assembliesoutroot.Assembly.Length > 0)
            {
                AddStaticAnalysisMetrics(assembliesoutroot.Assembly[0]);       //AddAnalysisToXMLOutput(assembliesoutroot.Assembly[0]);
            }

            AddDataExchangeFormatToXMLOutput(assembliesoutroot);
            assembliesoutroot.SerializeToFile(Path.Combine(OutputDirectory, TestBenchBase.CADAssemblyFile));
        }
示例#3
0
        public CAD.AssembliesType ToCADXMLOutput(TestBenchModel.TestBenchBase tb, bool metalink = false)
        {
            CAD.AssembliesType outputAssembliesType = new CAD.AssembliesType();
            outputAssembliesType.VersionInfo = "";

            List <CAD.AssemblyType> asmlist = new List <CAD.AssemblyType>();

            foreach (var item in assemblies.Values)
            {
                CAD.AssemblyType assembly = item.ToCADXMLOutput(tb);
                asmlist.Add(assembly);
                pointCoordinatesList.AddRange(item.PointCoordinatesList);
            }

            if (asmlist.Count > 1 && metalink)
            {
                Logger.Instance.AddLogMessage("There's more than one unconnected assembly in the model. Meta-Link may not work with this model.", Severity.Warning);
            }

            if (orphans.Any())
            {
                if (metalink)
                {
                    CAD.AssemblyType            topAssembly      = asmlist.First();
                    List <CAD.CADComponentType> cadcomponentlist = topAssembly.CADComponent.CADComponent.ToList();
                    foreach (var orphan in orphans)
                    {
                        cadcomponentlist.Add(orphan.ToCADXMLOutput(tb.GetRepresentation(orphan)));
                    }
                    topAssembly.CADComponent.CADComponent = cadcomponentlist.ToArray();
                }
                else
                {
                    List <CAD.CADComponentType>   orphanlist            = new List <CAD.CADComponentType>();
                    CAD.UnassembledComponentsType orphancomponentParent = new CAD.UnassembledComponentsType();
                    orphancomponentParent._id = UtilityHelpers.MakeUdmID();

                    foreach (var orphan in orphans)
                    {
                        orphanlist.Add(orphan.ToCADXMLOutput(tb.GetRepresentation(orphan)));
                    }
                    orphancomponentParent.CADComponent         = orphanlist.ToArray();
                    outputAssembliesType.UnassembledComponents = orphancomponentParent;
                }
            }

            outputAssembliesType.Assembly = asmlist.ToArray();

            return(outputAssembliesType);
        }
示例#4
0
        public CAD.AssembliesType ToCADXMLOutput(TestBenchModel.TestBenchBase tb, bool metalink = false)
        {
            CAD.AssembliesType outputAssembliesType = new CAD.AssembliesType();
            outputAssembliesType.VersionInfo = "";

            List<CAD.AssemblyType> asmlist = new List<CAD.AssemblyType>();
            foreach (var item in assemblies.Values)
            {
                CAD.AssemblyType assembly = item.ToCADXMLOutput(tb);
                asmlist.Add(assembly);
                pointCoordinatesList.AddRange(item.PointCoordinatesList);
            }

            if (asmlist.Count > 1 && metalink)
            {
                Logger.Instance.AddLogMessage("There's more than one unconnected assembly in the model. Meta-Link may not work with this model.", Severity.Warning);
            }

            if (orphans.Any())
            {
                if (metalink)
                {
                    CAD.AssemblyType topAssembly = asmlist.First();
                    List<CAD.CADComponentType> cadcomponentlist = topAssembly.CADComponent.CADComponent.ToList();
                    foreach (var orphan in orphans)
                    {
                        cadcomponentlist.Add(orphan.ToCADXMLOutput(tb.GetRepresentation(orphan)));
                    }
                    topAssembly.CADComponent.CADComponent = cadcomponentlist.ToArray();
                }
                else
                {
                    List<CAD.CADComponentType> orphanlist = new List<CAD.CADComponentType>();
                    CAD.UnassembledComponentsType orphancomponentParent = new CAD.UnassembledComponentsType();
                    orphancomponentParent._id = UtilityHelpers.MakeUdmID();

                    foreach (var orphan in orphans)
                    {
                        orphanlist.Add(orphan.ToCADXMLOutput(tb.GetRepresentation(orphan)));
                    }
                    orphancomponentParent.CADComponent = orphanlist.ToArray();
                    outputAssembliesType.UnassembledComponents = orphancomponentParent;
                }
            }

            outputAssembliesType.Assembly = asmlist.ToArray();

            return outputAssembliesType;
        }
示例#5
0
 public virtual void GenerateCADXMLOutput()
 {
     CAD.AssembliesType assembliesoutroot = cadDataContainer.ToCADXMLOutput(this, MetaLink);
     if (MetaLink)
     {
         CAD.ProcessingInstructionsType  instr        = new CAD.ProcessingInstructionsType();
         CAD.ProcessingInstructionType[] instructions = new CAD.ProcessingInstructionType[2];
         instructions[0]             = new CAD.ProcessingInstructionType();
         instructions[1]             = new CAD.ProcessingInstructionType();
         instructions[0].Primary     = "UNIQUELY_NAME_ALL_CAD_MODEL_INSTANCES";
         instructions[1].Primary     = "OUTPUT_JOINT_INFORMATION";
         instructions[0].Secondary   = "";
         instructions[1].Secondary   = "VALIDATE_JOINT_INFORMATION";
         instr.ProcessingInstruction = instructions;
         assembliesoutroot.ProcessingInstructions = instr;
     }
     AddDataExchangeFormatToXMLOutput(assembliesoutroot);
     assembliesoutroot.SerializeToFile(Path.Combine(OutputDirectory, TestBenchBase.CADAssemblyFile));
 }
示例#6
0
        public override void GenerateCADXMLOutput()
        {
            CAD.AssembliesType assembliesRoot = cadDataContainer.ToCADXMLOutput(this);
            if (assembliesRoot.Assembly.Length > 0)
            {
                if (assembliesRoot.Assembly[0].CADComponent != null)
                {
                    // META-2262: Modify orientation here instead of in CADData.cs
                    ModifyRootComponentOrientation(assembliesRoot.Assembly[0].CADComponent,
                                                   assembliesRoot.Assembly[0].CADComponent.ComponentID);
                }

                AddAnalysisToXMLOutput(assembliesRoot.Assembly[0]);
            }

            AddDataExchangeFormatToXMLOutput(assembliesRoot);

            assembliesRoot.SerializeToFile(Path.Combine(OutputDirectory, TestBenchBase.CADAssemblyFile));
        }
示例#7
0
 public override void GenerateCADXMLOutput()
 {
     CAD.AssembliesType              assembliesoutroot = cadDataContainer.ToCADXMLOutput(this, MetaLink);
     CAD.ProcessingInstructionsType  instr             = new CAD.ProcessingInstructionsType();
     CAD.ProcessingInstructionType[] instructions      = new CAD.ProcessingInstructionType[2];
     instructions[0] = new CAD.ProcessingInstructionType();
     instructions[1] = new CAD.ProcessingInstructionType();
     //instructions[2] = new CAD.ProcessingInstructionType();
     instructions[0].Primary = "COMPLETE_THE_HIERARCHY_FOR_LEAF_ASSEMBLIES";
     //instructions[1].Primary = "UNIQUELY_NAME_ALL_CAD_MODEL_INSTANCES";
     instructions[1].Primary     = "OUTPUT_JOINT_INFORMATION";
     instructions[0].Secondary   = instructions[1].Secondary = "";
     instructions[1].Secondary   = "VALIDATE_JOINT_INFORMATION";
     instr.ProcessingInstruction = instructions;
     assembliesoutroot.ProcessingInstructions = instr;
     AddDataExchangeFormatToXMLOutput(assembliesoutroot);
     if (assembliesoutroot.Assembly.Length > 0)
     {
         AddStaticAnalysisMetrics(assembliesoutroot.Assembly[0]);
     }
     assembliesoutroot.SerializeToFile(Path.Combine(OutputDirectory, TestBenchBase.CADAssemblyFile));
 }
示例#8
0
        public void AddDataExchangeFormatToXMLOutput(CAD.AssembliesType assembliesRoot)
        {
            if (STEP_DataExchangeFormats.Count > 0 || NonSTEP_DataExchangeFormats.Count > 0 || SpecialDataFormatInstructions.Count > 0)
            {
                CAD.DataExchangeType dataexchangeout = new CAD.DataExchangeType();
                dataexchangeout._id = UtilityHelpers.MakeUdmID();

                List <CAD.STEPFormatType> exchangelist = new List <CAD.STEPFormatType>();
                foreach (var item in STEP_DataExchangeFormats)
                {
                    CAD.STEPFormatType formatout = new CAD.STEPFormatType();
                    formatout._id  = UtilityHelpers.MakeUdmID();
                    formatout.Name = item;
                    exchangelist.Add(formatout);
                }

                List <CAD.NonSTEPFormatType> stllist = new List <CAD.NonSTEPFormatType>();
                foreach (var item in NonSTEP_DataExchangeFormats)
                {
                    CAD.NonSTEPFormatType formatout = new CAD.NonSTEPFormatType();
                    formatout._id = UtilityHelpers.MakeUdmID();

                    switch (item.ToLower())
                    {
                    case "inventor":
                    case "parasolid":
                        formatout.FormatType    = item;
                        formatout.FormatSubType = "";
                        break;

                    case "stereolithography_ascii":
                        formatout.FormatType    = "Stereolithography";
                        formatout.FormatSubType = "ASCII";
                        break;

                    case "stereolithography_binary":
                        formatout.FormatType    = "Stereolithography";
                        formatout.FormatSubType = "BINARY";
                        break;

                    case "dxf_2013":
                        formatout.FormatType    = "DXF";
                        formatout.FormatSubType = "2013";
                        break;

                    default:
                        Logger.Instance.AddLogMessage("AddDataExchangeFormatToXMLOutput received an unknown NonSTEP_DataExchangeFormat, recieved value: " + item
                                                      + "  This would be due to a programming error/bug.", Severity.Error);
                        break;
                    }
                    stllist.Add(formatout);
                }

                List <CAD.SpecialDataFormatInstructionType> specialInst = new List <CAD.SpecialDataFormatInstructionType>();
                foreach (var item in SpecialDataFormatInstructions)
                {
                    CAD.SpecialDataFormatInstructionType formatout = new CAD.SpecialDataFormatInstructionType();
                    formatout._id         = UtilityHelpers.MakeUdmID();
                    formatout.Instruction = item;
                    specialInst.Add(formatout);
                }

                if (exchangelist.Count > 0)
                {
                    dataexchangeout.STEPFormat = exchangelist.ToArray();
                }
                if (stllist.Count > 0)
                {
                    dataexchangeout.NonSTEPFormat = stllist.ToArray();
                }
                if (specialInst.Count > 0)
                {
                    dataexchangeout.SpecialDataFormatInstruction = specialInst.ToArray();
                }
                assembliesRoot.DataExchange = dataexchangeout;
            }
        }