예제 #1
0
        protected override void AddAnalysisToXMLOutput(CAD.AssemblyType cadassembly)
        {
            base.AddAnalysisToXMLOutput(cadassembly);
            CAD.AnalysesType cadanalysis = GetCADAnalysis(cadassembly);

            CAD.BallisticType ballisticanalysis = new CAD.BallisticType();
            ballisticanalysis._id        = UtilityHelpers.MakeUdmID();
            ballisticanalysis.AnalysisID = AnalysisID;

            if (referencePlaneType != Survivability.ReferencePlaneTypeEnum.None)
            {
                CAD.ReferencePlaneType refplane = new CAD.ReferencePlaneType();
                refplane._id  = UtilityHelpers.MakeUdmID();
                refplane.Type = referencePlaneType.ToString();
                ballisticanalysis.ReferencePlane = refplane;
            }

            if (customShotlineList.Any())
            {
                CAD.ShotlinesType cadshotlinesuite = new CAD.ShotlinesType();
                cadshotlinesuite._id = UtilityHelpers.MakeUdmID();
                List <CAD.ShotlineType> shotlineList = new List <CAD.ShotlineType>();
                foreach (var shotline in customShotlineList)
                {
                    CAD.ShotlineType cadshotline = new CAD.ShotlineType();
                    cadshotline._id                = UtilityHelpers.MakeUdmID();
                    cadshotline.Azimuth            = shotline.Azimuth;
                    cadshotline.Elevation          = shotline.Elevation;
                    cadshotline.BallisticThreatRef = shotline.BallisticThreatRef;
                    cadshotline.ComponentID        = shotline.ComponentID;
                    cadshotline.DatumPoint         = shotline.DatumPoint;
                    cadshotline.ShotlineName       = shotline.ShotlineName;
                    shotlineList.Add(cadshotline);
                }

                cadshotlinesuite.Shotline   = shotlineList.ToArray();
                ballisticanalysis.Shotlines = cadshotlinesuite;
            }


            List <CAD.MetricType> metrics = MetricsToCADXMLOutput(Computations, cadassembly.ConfigurationID);

            if (metrics.Count > 0)
            {
                ballisticanalysis.Metrics        = new CAD.MetricsType();
                ballisticanalysis.Metrics._id    = UtilityHelpers.MakeUdmID();
                ballisticanalysis.Metrics.Metric = metrics.ToArray();
            }

            if (ballisticanalysis.Metrics != null || ballisticanalysis.ReferencePlane != null || ballisticanalysis.Shotlines != null)
            {
                cadanalysis.Ballistic = new CAD.BallisticType[] { ballisticanalysis };
            }
        }
예제 #2
0
        protected override void AddAnalysisToXMLOutput(CAD.AssemblyType cadassembly)
        {
            base.AddAnalysisToXMLOutput(cadassembly);
            CAD.AnalysesType cadanalysis = GetCADAnalysis(cadassembly);

            CAD.BallisticType ballisticanalysis = new CAD.BallisticType();
            ballisticanalysis._id = UtilityHelpers.MakeUdmID();
            ballisticanalysis.AnalysisID = AnalysisID;

            if (referencePlaneType != Survivability.ReferencePlaneTypeEnum.None)
            {
                CAD.ReferencePlaneType refplane = new CAD.ReferencePlaneType();
                refplane._id = UtilityHelpers.MakeUdmID();
                refplane.Type = referencePlaneType.ToString();
                ballisticanalysis.ReferencePlane = refplane;
            }

            if (customShotlineList.Any())
            {
                CAD.ShotlinesType cadshotlinesuite = new CAD.ShotlinesType();
                cadshotlinesuite._id = UtilityHelpers.MakeUdmID();
                List<CAD.ShotlineType> shotlineList = new List<CAD.ShotlineType>();
                foreach (var shotline in customShotlineList)
                {
                    CAD.ShotlineType cadshotline = new CAD.ShotlineType();
                    cadshotline._id = UtilityHelpers.MakeUdmID();
                    cadshotline.Azimuth = shotline.Azimuth;
                    cadshotline.Elevation = shotline.Elevation;
                    cadshotline.BallisticThreatRef = shotline.BallisticThreatRef;
                    cadshotline.ComponentID = shotline.ComponentID;
                    cadshotline.DatumPoint = shotline.DatumPoint;
                    cadshotline.ShotlineName = shotline.ShotlineName;
                    shotlineList.Add(cadshotline);
                }

                cadshotlinesuite.Shotline = shotlineList.ToArray();
                ballisticanalysis.Shotlines = cadshotlinesuite;
            }


            List<CAD.MetricType> metrics = MetricsToCADXMLOutput(Computations, cadassembly.ConfigurationID);
            if (metrics.Count > 0)
            {
                ballisticanalysis.Metrics = new CAD.MetricsType();
                ballisticanalysis.Metrics._id = UtilityHelpers.MakeUdmID();
                ballisticanalysis.Metrics.Metric = metrics.ToArray();
            }

            if (ballisticanalysis.Metrics != null || ballisticanalysis.ReferencePlane != null || ballisticanalysis.Shotlines != null)
            {
                cadanalysis.Ballistic = new CAD.BallisticType[] { ballisticanalysis };
            }
        }