예제 #1
0
        public EnergyCompositionChartCalculator(InputValues currentInputValues)
        {
            List <double> argumentChartList = new List <double>();
            List <double> listEc            = new List <double>();
            List <double> listElh           = new List <double>();
            List <double> listEhh           = new List <double>();
            List <double> listEsh           = new List <double>();

            var layerNumber = (int)currentInputValues.InputValuesList[13];
            var fixedParam  = (int)currentInputValues.InputValuesList[14];
            var fixedValue  = currentInputValues.InputValuesList[15];
            var resolution  = currentInputValues.InputValuesList[16];
            var step        = 1 / resolution;
            LayerInterpolation      newInterpolation           = new LayerInterpolation(layerNumber, fixedParam, fixedValue);
            LayerEnergiesCalculator newLayerEnergiesCalculator = new LayerEnergiesCalculator();

            for (double i = 0 + step; i < 1; i = i + step)
            {
                var interpolatedLayer  = newInterpolation.InterpolateLayerWithFixedParameter(currentInputValues, i);
                var calculatedEnergies = newLayerEnergiesCalculator.CalculateEnergiesSet(interpolatedLayer);
                argumentChartList.Add(i);
                listEc.Add(calculatedEnergies.E_c);
                listElh.Add(calculatedEnergies.E_lh);
                listEhh.Add(calculatedEnergies.E_hh);
                listEsh.Add(calculatedEnergies.E_sh);
            }
            ArgumentsList = argumentChartList;
            ListEc        = listEc;
            ListElh       = listElh;
            ListEhh       = listEhh;
            ListEsh       = listEsh;
        }
 private void EnergyChartCreationButton_Click(object sender, EventArgs e)
 {
     if (_newLayersSets != null)
     {
         LayerEnergiesCalculator newLayerEnergiesCalc = new LayerEnergiesCalculator(_newFoundationParameters.A);
         var foundationEnergies = newLayerEnergiesCalc.CalculateFoundationEnergiesSet(_newFoundationParameters);
         var energiesLayerOne   = newLayerEnergiesCalc.CalculateEnergiesSet(_newLayersSets.LayerOneSet);
         var energiesLayerTwo   = newLayerEnergiesCalc.CalculateEnergiesSet(_newLayersSets.LayerTwoSet);
         var energiesLayerThree = newLayerEnergiesCalc.CalculateEnergiesSet(_newLayersSets.LayerThreeSet);
         LayersEnergiesSets newLayersEnergySets = new LayersEnergiesSets(energiesLayerOne, energiesLayerTwo, energiesLayerThree);
         _newLayersEnergies     = newLayersEnergySets;
         _newFoundationEnergies = foundationEnergies;
         EnergyChartDataCalculator newEnergyChartDataCalculator = new EnergyChartDataCalculator(_currentInputValues, _newLayersEnergies, _newFoundationEnergies);
         _createdEnergySeries = newEnergyChartDataCalculator;
         var argumentsOfChart = newEnergyChartDataCalculator.ArgumentsOfChart;
         var seriesForEc      = newEnergyChartDataCalculator.SeriesForEc;
         var seriesForEhh     = newEnergyChartDataCalculator.SeriesForEhh;
         var seriesForElh     = newEnergyChartDataCalculator.SeriesForElh;
         var seriesForEsh     = newEnergyChartDataCalculator.SeriesForEsh;
         ChartSeriesCreator newChartCreator = new ChartSeriesCreator();
         newChartCreator.ClearAllChart(cartesianChart1);
         newChartCreator.FormateTheChart(cartesianChart1, argumentsOfChart, "thickness", "Energies");
         newChartCreator.AddSeriesToChart(cartesianChart1, "Ec", "Ehh", "Elh", "Esh", argumentsOfChart, seriesForEc, seriesForEhh, seriesForElh, seriesForEsh);
     }
     else
     {
         MessageBox.Show("Please calculate interpolation before you create energy chart");
     }
 }