コード例 #1
0
 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");
     }
 }
 public EnergyChartDataCalculator(InputValues inputValuesFromUser, LayersEnergiesSets setsOfLayersEnergies, LayerEnergiesSet setOfFoundationEnergies)
 {
     _inputValuesFromUser          = inputValuesFromUser;
     _setsOfLayersEnergies         = setsOfLayersEnergies;
     _setOfFoundationLayerEnergies = setOfFoundationEnergies;
     _resolution      = inputValuesFromUser.InputValuesList[17];
     ArgumentsOfChart = DefineXDomaine();
     SeriesForEc      = CalculateEcSeries();
     SeriesForEhh     = CalculateEhhSeries();
     SeriesForElh     = CalculateElhSeries();
     SeriesForEsh     = CalculateEshSeries();
 }