Example #1
0
        public void Remove(AirfoilManager airfoil, String label)
        {
            // Remove specified airfoil.
            AirfoilGroup.Remove(airfoil);

            // Decrement number of airfoils
            --NumberOfAirfoils;

            // Issue the Event removed specified airfoil from AirfoilGroupList
            AirfoilRemoved?.Invoke(this, new AirfoilRemovedEventArgs(airfoil, label));
        }
Example #2
0
        /// <summary>
        /// Add airfoil.
        /// </summary>
        /// <param name="specification"></param>
        public void Add(AirfoilManager specification)
        {
            // Add new Airfoil Collection
            AirfoilGroup.Add(specification);

            // Increment number of airfoils
            ++NumberOfAirfoils;

            // Issue the Event added new airfoil to AirfoilGroupList
            AirfoilAdded?.Invoke(this, new AirfoilAddedEventArgs(specification));
        }
Example #3
0
        public void ExportAirfoilCoordinate(AirfoilManager airfoil, int resolution)
        {
            String CSV = General.CsvManager.CreateCSV(airfoil.InterpolatedCoordinate.ToDouleArray());

            String filePath = outputDirectory + "\\" + airfoil.AirfoilName + ".csv";

            using (System.IO.StreamWriter streamWriter = new System.IO.StreamWriter(filePath, false, Encoding.UTF8))
            {
                streamWriter.Write(CSV);
            }
        }
        public void Add(AirfoilManager airfoil, double[] coefficients)
        {
            // Format Check (Check number of basis airfoils)
            if (_numberOfBasisAirfoils != coefficients.Length)
            {
                throw new FormatException("The combined airfoil that has different basis airfoils from defined in this instance are passed.");
            }

            // Add coefficients of new airfoil
            _coefficientsOfCombination ??= new CoefficientOfCombination(_numberOfBasisAirfoils);
            _coefficientsOfCombination.AddCoefficient(coefficients);

            // Add new combined airfoil
            _combinedAirfoils ??= new List <AirfoilManager>();
            _combinedAirfoils.Add(airfoil);

            // Increment number of combined airfoils
            _numberOfAirfoils++;
        }