예제 #1
0
파일: P0112.cs 프로젝트: slawer/sgt
        /// <summary>
        /// Вычисляет значение параметра Расход на входе по Ходам Насоса с Аналогового сигнала
        /// </summary>
        /// <param name="pump1">Ходы насоса 1</param>
        /// <param name="pump2">Ходы насоса 2</param>
        /// <param name="diameter1">Диаметр цилиндра насоса 1</param>
        /// <param name="diameter2">Диаметр цилиндра насоса 2</param>
        public void Calculate(P0011 pump1, P11_1 pump2, P0014 diameter1, P14_1 diameter2)
        {
            float v = float.NaN;

            if (!float.IsNaN(pump1.Value))
            {
                if (!float.IsNaN(diameter1.Value))
                {
                    v = CalculateFlow(pump1.Value, diameter1.Value) * scale_factor_1;
                }
            }

            if (!float.IsNaN(pump2.Value))
            {
                if (!float.IsNaN(diameter2.Value))
                {
                    float v2 = CalculateFlow(pump2.Value, diameter2.Value) * scale_factor_2;
                    if (!float.IsNaN(v2))
                    {
                        if (float.IsNaN(v))
                        {
                            v = 0;
                        }
                        v = v + v2;
                    }
                }
            }

            _value = v;
        }
예제 #2
0
        /// <summary>
        /// Инициализирует новый экземпляр класса
        /// </summary>
        public Technology()
        {
            c_slim   = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
            cal_slim = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);

            p1 = new SGT.P0001(Guid.Empty);
            p2 = new SGT.P0002(Guid.Empty);

            p3 = new SGT.P0003(Guid.Empty);
            p4 = new SGT.P0004(Guid.Empty);

            p5 = new SGT.P0005(Guid.Empty);

            p6   = new SGT.P0006(Guid.Empty);
            p6_1 = new SGT.P06_1(Guid.Empty);

            p6_2 = new SGT.P06_2(Guid.Empty);
            p6_3 = new SGT.P06_3(Guid.Empty);

            p6_4 = new SGT.P06_4(Guid.Empty);
            p6_5 = new SGT.P06_5(Guid.Empty);

            p6_6 = new SGT.P06_6(Guid.Empty);
            p6_7 = new SGT.P06_7(Guid.Empty);

            p6_8 = new SGT.P06_8(Guid.Empty);
            p6_9 = new SGT.P06_9(Guid.Empty);

            p7   = new SGT.P0007(Guid.Empty);
            p7_1 = new SGT.P07_1(Guid.Empty);

            p7_2 = new SGT.P07_2(Guid.Empty);
            p7_3 = new SGT.P07_3(Guid.Empty);

            p7_4 = new SGT.P07_4(Guid.Empty);
            p7_5 = new SGT.P07_5(Guid.Empty);

            p7_6 = new SGT.P07_6(Guid.Empty);
            p7_7 = new SGT.P07_7(Guid.Empty);

            p7_8 = new SGT.P07_8(Guid.Empty);
            p7_9 = new SGT.P07_9(Guid.Empty);

            p7_10 = new SGT.P7_10(Guid.Empty);
            p7_11 = new SGT.P7_11(Guid.Empty);

            p7_12 = new SGT.P7_12(Guid.Empty);
            p7_13 = new SGT.P7_13(Guid.Empty);

            p8   = new SGT.P0008(Guid.Empty);
            p8_1 = new SGT.P08_1(Guid.Empty);

            p9   = new SGT.P0009(Guid.Empty);
            p9_1 = new SGT.P09_1(Guid.Empty);

            p9_2 = new SGT.P09_2(Guid.Empty);
            p9_3 = new SGT.P09_3(Guid.Empty);

            p9_4 = new SGT.P09_4(Guid.Empty);
            p9_5 = new SGT.P09_5(Guid.Empty);

            p9_6 = new SGT.P09_6(Guid.Empty);
            p9_7 = new SGT.P09_7(Guid.Empty);

            p9_8 = new SGT.P09_8(Guid.Empty);
            p9_9 = new SGT.P09_9(Guid.Empty);

            p9_10 = new SGT.P9_10(Guid.Empty);
            p9_11 = new SGT.P9_11(Guid.Empty);

            p9_12 = new SGT.P9_12(Guid.Empty);
            p9_13 = new SGT.P9_13(Guid.Empty);

            p10 = new P0010(Guid.Empty);

            p11   = new P0011(Guid.Empty);
            p11_1 = new P11_1(Guid.Empty);

            p12 = new P0012(Guid.Empty);
            p13 = new P0013(Guid.Empty);

            p14   = new P0014(Guid.Empty);
            p14_1 = new P14_1(Guid.Empty);

            p15 = new P0015(Guid.Empty);
            p16 = new P0016(Guid.Empty);

            p17 = new P0017(Guid.Empty);
            p18 = new P0018(Guid.Empty);

            p101 = new P0101(Guid.Empty);
            p102 = new P0102(Guid.Empty);

            p103 = new P0103(Guid.Empty);
            p104 = new P0104(Guid.Empty);

            p105 = new P0105(Guid.Empty);
            p106 = new P0106(Guid.Empty);

            p107 = new P0107(Guid.Empty);
            p108 = new P0108(Guid.Empty);

            p109 = new P0109(Guid.Empty);
            p110 = new P0110(Guid.Empty);

            p112 = new P0112(Guid.Empty);
            p113 = new P0113(Guid.Empty);

            p114 = new P0114(Guid.Empty);
            p116 = new P0116(Guid.Empty);

            p117 = new P0117(Guid.Empty);
            p118 = new P0118(Guid.Empty);

            p200 = new P0200(Guid.Empty);
            p201 = new P0201(Guid.Empty);

            p202 = new P0202(Guid.Empty);
            p203 = new P0203(Guid.Empty);

            p204 = new P0204(Guid.Empty);
            p205 = new P0205(Guid.Empty);

            p206 = new P0206(Guid.Empty);
            p207 = new P0207(Guid.Empty);

            p208 = new P0208(Guid.Empty);
            p209 = new P0209(Guid.Empty);

            p210 = new P0210(Guid.Empty);
            p211 = new P0211(Guid.Empty);

            p212 = new P0212(Guid.Empty);
            p213 = new P0213(Guid.Empty);

            currentTime = DateTime.MinValue;

            driller_console = -1;
            driller_console_weight_column = -1;
        }
예제 #3
0
        /// <summary>
        /// Передать технологически параметры серверу данных
        /// </summary>
        protected void UpdateTechnologyParameters()
        {
            try
            {
                TParameter[] t_prms = SgtApplication.CreateInstance().Technology.Parameters;
                if (t_prms != null)
                {
                    foreach (TParameter parameter in t_prms)
                    {
                        if (parameter != null && parameter.IsSimple == false)
                        {
                            int dev_number = NumberTechOnDev(parameter.SNumber);
                            if (dev_number != -1)
                            {
                                DevManClient.UpdateParameter(dev_number, parameter.Value);
                            }
                        }
                        else
                        if (parameter != null && parameter.IsSimple == true)
                        {
                            switch (parameter.UnigueClassName)
                            {
                            case "P0014":

                                try
                                {
                                    P0014 par = parameter as P0014;
                                    if (par != null && par.Source == P0014Source.Own)
                                    {
                                        int dev_number = NumberTechOnDev(par.SNumber);
                                        if (dev_number != -1)
                                        {
                                            DevManClient.UpdateParameter(dev_number, parameter.Value);
                                        }
                                    }
                                }
                                catch { }
                                break;

                            case "P14_1":

                                try
                                {
                                    P14_1 par = parameter as P14_1;
                                    if (par != null && par.Source == P0014Source.Own)
                                    {
                                        int dev_number = NumberTechOnDev(par.SNumber);
                                        if (dev_number != -1)
                                        {
                                            DevManClient.UpdateParameter(dev_number, parameter.Value);
                                        }
                                    }
                                }
                                catch { }
                                break;

                            default:
                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorHandler.WriteToLog(this, new ErrorArgs(ex.Message, ErrorType.NotFatal));
            }
        }
예제 #4
0
파일: Technology.cs 프로젝트: slawer/sgt
        /// <summary>
        /// Инициализирует новый экземпляр класса
        /// </summary>
        public Technology()
        {
            c_slim = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
            cal_slim = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);

            p1 = new SGT.P0001(Guid.Empty);
            p2 = new SGT.P0002(Guid.Empty);

            p3 = new SGT.P0003(Guid.Empty);
            p4 = new SGT.P0004(Guid.Empty);

            p5 = new SGT.P0005(Guid.Empty);

            p6 = new SGT.P0006(Guid.Empty);
            p6_1 = new SGT.P06_1(Guid.Empty);

            p6_2 = new SGT.P06_2(Guid.Empty);
            p6_3 = new SGT.P06_3(Guid.Empty);

            p6_4 = new SGT.P06_4(Guid.Empty);
            p6_5 = new SGT.P06_5(Guid.Empty);

            p6_6 = new SGT.P06_6(Guid.Empty);
            p6_7 = new SGT.P06_7(Guid.Empty);

            p6_8 = new SGT.P06_8(Guid.Empty);
            p6_9 = new SGT.P06_9(Guid.Empty);

            p7 = new SGT.P0007(Guid.Empty);
            p7_1 = new SGT.P07_1(Guid.Empty);

            p7_2 = new SGT.P07_2(Guid.Empty);
            p7_3 = new SGT.P07_3(Guid.Empty);

            p7_4 = new SGT.P07_4(Guid.Empty);
            p7_5 = new SGT.P07_5(Guid.Empty);

            p7_6 = new SGT.P07_6(Guid.Empty);
            p7_7 = new SGT.P07_7(Guid.Empty);

            p7_8 = new SGT.P07_8(Guid.Empty);
            p7_9 = new SGT.P07_9(Guid.Empty);

            p7_10 = new SGT.P7_10(Guid.Empty);
            p7_11 = new SGT.P7_11(Guid.Empty);

            p7_12 = new SGT.P7_12(Guid.Empty);
            p7_13 = new SGT.P7_13(Guid.Empty);

            p8 = new SGT.P0008(Guid.Empty);
            p8_1 = new SGT.P08_1(Guid.Empty);

            p9 = new SGT.P0009(Guid.Empty);
            p9_1 = new SGT.P09_1(Guid.Empty);

            p9_2 = new SGT.P09_2(Guid.Empty);
            p9_3 = new SGT.P09_3(Guid.Empty);

            p9_4 = new SGT.P09_4(Guid.Empty);
            p9_5 = new SGT.P09_5(Guid.Empty);

            p9_6 = new SGT.P09_6(Guid.Empty);
            p9_7 = new SGT.P09_7(Guid.Empty);

            p9_8 = new SGT.P09_8(Guid.Empty);
            p9_9 = new SGT.P09_9(Guid.Empty);

            p9_10 = new SGT.P9_10(Guid.Empty);
            p9_11 = new SGT.P9_11(Guid.Empty);

            p9_12 = new SGT.P9_12(Guid.Empty);
            p9_13 = new SGT.P9_13(Guid.Empty);

            p10 = new P0010(Guid.Empty);

            p11 = new P0011(Guid.Empty);
            p11_1 = new P11_1(Guid.Empty);

            p12 = new P0012(Guid.Empty);
            p13 = new P0013(Guid.Empty);

            p14 = new P0014(Guid.Empty);
            p14_1 = new P14_1(Guid.Empty);

            p15 = new P0015(Guid.Empty);
            p16 = new P0016(Guid.Empty);

            p17 = new P0017(Guid.Empty);
            p18 = new P0018(Guid.Empty);

            p101 = new P0101(Guid.Empty);
            p102 = new P0102(Guid.Empty);

            p103 = new P0103(Guid.Empty);
            p104 = new P0104(Guid.Empty);

            p105 = new P0105(Guid.Empty);
            p106 = new P0106(Guid.Empty);

            p107 = new P0107(Guid.Empty);
            p108 = new P0108(Guid.Empty);

            p109 = new P0109(Guid.Empty);
            p110 = new P0110(Guid.Empty);

            p112 = new P0112(Guid.Empty);
            p113 = new P0113(Guid.Empty);

            p114 = new P0114(Guid.Empty);
            p116 = new P0116(Guid.Empty);

            p117 = new P0117(Guid.Empty);
            p118 = new P0118(Guid.Empty);

            p200 = new P0200(Guid.Empty);
            p201 = new P0201(Guid.Empty);

            p202 = new P0202(Guid.Empty);
            p203 = new P0203(Guid.Empty);

            p204 = new P0204(Guid.Empty);
            p205 = new P0205(Guid.Empty);

            p206 = new P0206(Guid.Empty);
            p207 = new P0207(Guid.Empty);

            p208 = new P0208(Guid.Empty);
            p209 = new P0209(Guid.Empty);

            p210 = new P0210(Guid.Empty);
            p211 = new P0211(Guid.Empty);

            p212 = new P0212(Guid.Empty);
            p213 = new P0213(Guid.Empty);

            currentTime = DateTime.MinValue;

            driller_console = -1;
            driller_console_weight_column = -1;
        }
예제 #5
0
파일: P0112.cs 프로젝트: slawer/sgt
        /// <summary>
        /// Вычисляет значение параметра Расход на входе по Ходам Насоса с Аналогового сигнала
        /// </summary>
        /// <param name="pump1">Ходы насоса 1</param>
        /// <param name="pump2">Ходы насоса 2</param>
        /// <param name="diameter1">Диаметр цилиндра насоса 1</param>
        /// <param name="diameter2">Диаметр цилиндра насоса 2</param>
        public void Calculate(P0011 pump1, P11_1 pump2, P0014 diameter1, P14_1 diameter2)
        {
            float v = float.NaN;

            if (!float.IsNaN(pump1.Value))
            {
                if (!float.IsNaN(diameter1.Value))
                {
                    v = CalculateFlow(pump1.Value, diameter1.Value) * scale_factor_1;
                }
            }

            if (!float.IsNaN(pump2.Value))
            {
                if (!float.IsNaN(diameter2.Value))
                {
                    float v2 = CalculateFlow(pump2.Value, diameter2.Value) * scale_factor_2;
                    if (!float.IsNaN(v2))
                    {
                        if (float.IsNaN(v)) v = 0;
                        v = v + v2;
                    }
                }
            }

            _value = v;
        }