Example #1
0
        private void comboBoxMicroclimate_SelectionChangeCommitted(object sender, EventArgs e)
        {
            string key = comboBoxMicroclimate.SelectedItem as string;

            microclimateCoeff = Vars.MicroclimateTableDatabase[key];
            setStatuses();
        }
Example #2
0
        /// <summary>
        /// выбор микроклиматического коэффициента рельефа по средней скорости и стратификации атмосферы
        /// </summary>
        /// <param name="speed">скорость ветра </param>
        /// <param name="microclimateCoefficient"></param>
        /// <param name="atmosphereStratification"></param>
        /// <returns></returns>
        private static double selectMicroclimateCoefficient(double speed, MicroclimateItemInfo microclimateCoefficient, AtmosphereStratification atmosphereStratification)
        {
            Diapason <double> diap;
            double            res;

            if (speed <= 5)
            {
                diap = atmosphereStratification == AtmosphereStratification.Stable ? microclimateCoefficient.Stable_3_5 : microclimateCoefficient.Unstable_3_5;
                res  = LinearInterpolateMethod.LinearInterpolation(3, 5, diap.From, diap.To, speed);
            }
            else
            {
                diap = atmosphereStratification == AtmosphereStratification.Stable ? microclimateCoefficient.Stable_6_20 : microclimateCoefficient.Unstable_6_20;
                res  = LinearInterpolateMethod.LinearInterpolation(6, 20, diap.From, diap.To, speed);
            }

            if (res < 0)
            {
                throw new Exception("Отрицательный коэффициент после интерполяции");
            }
            return(res);
        }