Esempio n. 1
0
        private void radioButtonStratification_CheckedChanged(object sender, EventArgs e)
        {
            RadioButton radio = sender as RadioButton;

            if (radio.Checked)
            {
                stratification = (AtmosphereStratification)radio.Tag;
            }
            setStatuses();
        }
Esempio n. 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);
        }