Ejemplo n.º 1
0
        public override IEnumerable <CrossSection> GetCrossSections()
        {
            // Nasty pass by reference bug here!
            //var noseSections = new List<CrossSection>(Nose.GetCrossSections().ToList());
            var centreFuselageSections = new List <CrossSection>(CentreFuselage.GetCrossSections().ToList());
            var afterBodySections      = new List <CrossSection>(Afterbody.GetCrossSections().Skip(1).ToList());

            //centreFuselageSections
            //    .ForEach(x => x.Distance += noseSections.Last().Distance);

            //afterBodySections
            //   .ForEach(x => x.Distance += CentreFuselage.Length);

            var crossSections = centreFuselageSections
                                .Concat(afterBodySections);

            crossSections.Last().Distance = Diameter * Afterbody.AfterbodyLengthDiameterRatio + CentreFuselage.Length;

            return(crossSections);
        }
Ejemplo n.º 2
0
        public Fuselage()
        {
            //Nose = new Nose();
            CentreFuselage = new CentreFuselage();
            Afterbody      = new Afterbody();

            Diameter = Constants.Defaults.Fuselage.Diameter;

            //Nose.Diameter = Diameter;
            //Nose.NoseLengthDiameterRatio = Constants.Defaults.NoseLengthDiameterRatio;
            //Nose.UpdateSections();

            CentreFuselage.Diameter = Diameter;
            CentreFuselage.Length   = Constants.Defaults.Fuselage.CentreFuselageLength;
            CentreFuselage.UpdateSections();

            Afterbody.Diameter = Diameter;
            Afterbody.AfterbodyLengthDiameterRatio = Constants.Defaults.Fuselage.AfterbodyLengthDiameterRatio;
            Afterbody.UpdateSections();
        }
Ejemplo n.º 3
0
 public void UpdateSections()
 {
     //Nose.UpdateSections();
     CentreFuselage.UpdateSections();
     Afterbody.UpdateSections();
 }