Пример #1
0
        protected override void Calculate(OverLimitConfigEntity overLimitConfig, List <TagValue> tagAttributeList)
        {
            OverLimitConfigParameter parameter = InitOverLimitParameter(overLimitConfig);

            if (parameter.High4 != double.MaxValue)
            {
                H4(overLimitConfig, tagAttributeList, parameter.High4);
            }
            if (parameter.High3 != double.MaxValue)
            {
                H3(overLimitConfig, tagAttributeList, parameter.High3, parameter.High4);
            }
            if (parameter.High2 != double.MaxValue)
            {
                H2(overLimitConfig, tagAttributeList, parameter.High2, parameter.High3);
            }
            if (parameter.High1 != double.MaxValue)
            {
                H1(overLimitConfig, tagAttributeList, parameter.High1, parameter.High2);
            }

            if (parameter.Low1 != double.MinValue)
            {
                L1(overLimitConfig, tagAttributeList, parameter.Low2, parameter.Low1);
            }
            if (parameter.Low2 != double.MinValue)
            {
                L2(overLimitConfig, tagAttributeList, parameter.Low3, parameter.Low2);
            }
            if (parameter.Low3 != double.MinValue)
            {
                L3(overLimitConfig, tagAttributeList, parameter.Low3);
            }
        }
Пример #2
0
        private OverLimitConfigParameter InitOverLimitParameter(OverLimitConfigEntity faultConfiguration)
        {
            OverLimitConfigParameter parameter = new OverLimitConfigParameter();

            if (faultConfiguration.LowLimit1Value != null)
            {
                parameter.Low1 = Convert.ToDouble(faultConfiguration.LowLimit1Value.Value);                                           //低1限值
            }
            if (faultConfiguration.LowLimit2Value != null)
            {
                parameter.Low2 = Convert.ToDouble(faultConfiguration.LowLimit2Value.Value);                                           //低2限值
            }
            if (faultConfiguration.LowLimit3Value != null)
            {
                parameter.Low3 = Convert.ToDouble(faultConfiguration.LowLimit3Value.Value);                                           //低3限值
            }
            if (faultConfiguration.FirstLimitingValue != null)
            {
                parameter.High1 = Convert.ToDouble(faultConfiguration.FirstLimitingValue.Value);                                               //高1限值
            }
            if (faultConfiguration.SecondLimitingValue != null)
            {
                parameter.High2 = Convert.ToDouble(faultConfiguration.SecondLimitingValue.Value);                                                //高2限值
            }
            if (faultConfiguration.ThirdLimitingValue != null)
            {
                parameter.High3 = Convert.ToDouble(faultConfiguration.ThirdLimitingValue.Value);                                               //高3限值
            }
            if (faultConfiguration.FourthLimitingValue != null)
            {
                parameter.High4 = Convert.ToDouble(faultConfiguration.FourthLimitingValue.Value);                                                //高4限值
            }
            return(parameter);
        }
        private OverLimitConfigParameter InitOverLimitParameter(OverLimitConfigEntity faultConfiguration)
        {
            OverLimitConfigParameter parameter = new OverLimitConfigParameter();

            if (faultConfiguration.LowLimit1Value != null) parameter.Low1 = Convert.ToDouble(faultConfiguration.LowLimit1Value.Value);//低1限值
            if (faultConfiguration.LowLimit2Value != null) parameter.Low2 = Convert.ToDouble(faultConfiguration.LowLimit2Value.Value);//低2限值
            if (faultConfiguration.LowLimit3Value != null) parameter.Low3 = Convert.ToDouble(faultConfiguration.LowLimit3Value.Value);//低3限值

            if (faultConfiguration.FirstLimitingValue != null) parameter.High1 = Convert.ToDouble(faultConfiguration.FirstLimitingValue.Value);//高1限值
            if (faultConfiguration.SecondLimitingValue != null) parameter.High2 = Convert.ToDouble(faultConfiguration.SecondLimitingValue.Value);//高2限值
            if (faultConfiguration.ThirdLimitingValue != null) parameter.High3 = Convert.ToDouble(faultConfiguration.ThirdLimitingValue.Value);//高3限值
            if (faultConfiguration.FourthLimitingValue != null) parameter.High4 = Convert.ToDouble(faultConfiguration.FourthLimitingValue.Value);//高4限值

            return parameter;
        }