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();
 }
        private void CreateButton_Click(object sender, EventArgs e)
        {
            InputValues inputParameters = new InputValues(SequanceChoiceNumber, aParamNumericUpDown, bParamNumericUpDown, xParamLay2, yParamLay2, xParamLay3, yParamLay3, TemperatureUpDown, LayerIThicknessUpDown, LayerIIThicknessUpDown, LayerIIIThicknessUpDown, LayerIVThicknessUpDown, LayerVThicknessUpDown, InterChartUpDown1, InterChartUpDown2, InterChartUpDown3, interChartResolution, EnergyChartResolution);

            if (!inputParameters.InputValuesList.Contains(0))
            {
                ChartCalculator    newChartCalculator = new ChartCalculator(inputParameters.InputValuesList);
                var                arguments          = newChartCalculator.ArgumentsOfChart;
                var                values             = newChartCalculator.ValuesOfChart;
                ChartDraughtsClass chartPainter       = new ChartDraughtsClass();
                chartPainter.FillChart(cartesianChart1, arguments, values);
            }
        }
        private void InterpolateButton_Click(object sender, EventArgs e)
        {
            InputValues inputParameters = new InputValues(SequanceChoiceNumber, xParamLay1, yParamLay1, xParamLay2, yParamLay2, xParamLay3, yParamLay3, TemperatureUpDown, LayerIThicknessUpDown, LayerIIThicknessUpDown, LayerIIIThicknessUpDown, LayerIVThicknessUpDown, LayerVThicknessUpDown, InterChartUpDown1, InterChartUpDown2, InterChartUpDown3, interChartResolution, EnergyChartResolution);

            _currentInputValues = inputParameters;

            if (!inputParameters.InputValuesList.Contains(0))
            {
                FoundationGaSbParameters newFoundationParameters = new FoundationGaSbParameters();
                LayerInterpolation       newInterpolation        = new LayerInterpolation();
                var layer1Set = newInterpolation.InterpolateLayer(inputParameters, 1);
                var layer2Set = newInterpolation.InterpolateLayer(inputParameters, 2);
                var layer3Set = newInterpolation.InterpolateLayer(inputParameters, 3);
                MessageBox.Show($"Thin layers interpolation calculated");
                LayersInterpolationSets newLayersSets = new LayersInterpolationSets(layer1Set, layer2Set, layer3Set);
                _newLayersSets           = newLayersSets;
                _newFoundationParameters = newFoundationParameters;
            }
        }
        public InterpolatedParametersSet InterpolateLayer(InputValues inputParameters, int layerNumber)
        {
            double        x;
            double        y;
            var           materialSwitch            = inputParameters.InputValuesList[0];
            var           temperature               = inputParameters.InputValuesList[7];
            List <double> outcomesList              = new List <double>();
            BandStructureParametersNames paramNames = new BandStructureParametersNames();

            switch (layerNumber)
            {
            case 1:
                x = inputParameters.InputValuesList[1];
                y = inputParameters.InputValuesList[2];
                break;

            case 2:
                x = inputParameters.InputValuesList[3];
                y = inputParameters.InputValuesList[4];
                break;

            case 3:
                x = inputParameters.InputValuesList[5];
                y = inputParameters.InputValuesList[6];
                break;

            default:
                MessageBox.Show("Fatal:there is no such layer");
                x = y = 2;
                break;
            }
            foreach (var paramName in paramNames.ListOfBandStructureParameters)
            {
                Interpolator interpolator = new Interpolator(paramName, temperature);
                var          outcome      = interpolator.InterpolateFourElements(x, y, materialSwitch, layerNumber);
                outcomesList.Add(outcome);
            }
            InterpolatedParametersSet layer1Set = new InterpolatedParametersSet(outcomesList);

            return(layer1Set);
        }
        public InterpolationChartCalculator(InputValues currentInputValues)
        {
            List <double> ArgumentInterChartList = new List <double>();
            List <double> listA        = new List <double>();
            List <double> listEg       = new List <double>();
            List <double> listAlpha    = new List <double>();
            List <double> listBetha    = new List <double>();
            List <double> listDelta_so = new List <double>();
            List <double> listMass_e   = new List <double>();
            List <double> listMass_hh  = new List <double>();
            List <double> listMass_lh  = new List <double>();
            List <double> listA_c      = new List <double>();
            List <double> listA_v      = new List <double>();
            List <double> listB        = new List <double>();
            List <double> listVBO      = new List <double>();
            List <double> listC_11     = new List <double>();
            List <double> listC_12     = 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 newLayerInterpolation = new LayerInterpolation(layerNumber, fixedParam, fixedValue);

            for (double i = 0 + step; i < 1; i = i + step)
            {
                var layerSet = newLayerInterpolation.InterpolateLayerWithFixedParameter(currentInputValues, i);
                ArgumentInterChartList.Add(i);
                listA.Add(layerSet.A);
                listEg.Add(layerSet.Eg);
                listAlpha.Add(layerSet.Alpha);
                listBetha.Add(layerSet.Betha);
                listDelta_so.Add(layerSet.Delta_so);
                listMass_e.Add(layerSet.Mass_e);
                listMass_hh.Add(layerSet.Mass_hh);
                listMass_lh.Add(layerSet.Mass_lh);
                listA_c.Add(layerSet.A_c);
                listA_v.Add(layerSet.A_v);
                listB.Add(layerSet.B);
                listVBO.Add(layerSet.VBO);
                listC_11.Add(layerSet.C_11);
                listC_12.Add(layerSet.C_12);
            }

            ArgumentsList = ArgumentInterChartList;
            ListA         = listA;
            ListEg        = listEg;
            ListAlpha     = listAlpha;
            ListBetha     = listBetha;
            ListDelta_so  = listDelta_so;
            ListMass_e    = listMass_e;
            ListMass_hh   = listMass_hh;
            ListMass_lh   = listMass_lh;
            ListA_c       = listA_c;
            ListA_v       = listA_v;
            ListB         = listB;
            ListVBO       = listVBO;
            ListC_11      = listC_11;
            ListC_12      = listC_12;
        }