Example #1
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;
        }
Example #2
0
File: P0202.cs Project: slawer/sgt
        /// <summary>
        /// Вычисляет текущее значение параметра Длина инструмента
        /// </summary>
        /// <param name="v1">Положение тальблока в текущий момент</param>
        /// <param name="v2">Вес на крюке в текущий момент</param>
        /// <param name="v3">Положение клиньев в текущий момент</param>
        /// <param name="v4">Положение инструмента (долота) в текущий момент</param>
        /// <param name="v5">Глубина забоя в текущий момент</param>
        /// <param name="v6">Количество опущенных свеч</param>
        /// <param name="currentTime">Текущее технологическое время</param>
        /// <param name="locking_weight_hook">Блокировочное значение веса на крюке</param>
        /// <param name="size_layout_bottom_column">Размер компоновки низа колонны</param>
        /// <param name="r_weight">Метод расчета веса на крюке</param>
        public void Calculate(P0005 v1, P0102 v2, P0012 v3, P0204 v4, P0205 v5, P0203 v6,
            DateTime currentTime, float locking_weight_hook, float size_layout_bottom_column, 
            float size_layout_top_column, TechnologicalRegimeWeightHook r_weight)
        {
            if (slim.TryEnterWriteLock(300))
            {
                try
                {
                    switch (mode_proccess)
                    {
                        case TModeProcess.mpBase:

                            _value = current_length_instrument(v1, v3, v2, locking_weight_hook, r_weight);
                            break;

                        case TModeProcess.mpSetUser:

                            mode_proccess = TModeProcess.mpBase;
                            if (WeightHookForWeightOrWedges(v2, v3, locking_weight_hook, r_weight)
                                != TProcResult.True || float.IsNaN(v1.Value))
                            {
                                v4.Calculate(_value);
                            }

                            if (_value <= (size_layout_bottom_column + size_layout_top_column))
                            {
                                v6.CorrectLenghtInstrument(0.0f);
                                v6.Calculate(0.0f);
                            }
                            else
                            {
                                float _tmp = _value - (size_layout_bottom_column + size_layout_top_column);
                                v6.CorrectLenghtInstrument(_tmp);
                            }
                            break;

                        case TModeProcess.mpCMDzaboi:

                            mode_proccess = TModeProcess.mpBase;

                            if (WeightHookForWeightOrWedges(v2, v3, locking_weight_hook, r_weight)
                                != TProcResult.True || float.IsNaN(v1.Value))
                            {
                                _value = current_length_instrument(v1, v3, v2, locking_weight_hook, r_weight);
                            }
                            else
                            {
                                last_talblock = v1.Value;
                                weight_status = WeightStatus.wsWeight;

                                _value = v5.Value + v1.Value;

                                if (_value <= (size_layout_bottom_column + size_layout_top_column))
                                {
                                    v6.CorrectLenghtInstrument(0.0f);
                                    v6.Calculate(0.0f);
                                }
                                else
                                {
                                    float _tmp = _value - (size_layout_bottom_column + size_layout_top_column);
                                    v6.CorrectLenghtInstrument(_tmp);
                                }
                            }
                            break;

                        case TModeProcess.mpCMDmodifyDepth:

                            if (WeightHookForWeightOrWedges(v2, v3, locking_weight_hook, r_weight)
                                != TProcResult.True || float.IsNaN(v1.Value))
                            {
                                weight_status = WeightStatus.wsClear;
                                if (v5.Value < _value)
                                {
                                    _value = v5.Value;
                                    if (_value <= (size_layout_bottom_column + size_layout_top_column))
                                    {
                                        v6.CorrectLenghtInstrument(0.0f);
                                        v6.Calculate(0.0f);
                                    }
                                    else
                                    {
                                        float _tmp = _value - (size_layout_bottom_column + size_layout_top_column);
                                        v6.CorrectLenghtInstrument(_tmp);
                                    }
                                }

                                v4.Calculate(_value);
                            }
                            else
                            {
                                last_talblock = v1.Value;
                                weight_status = WeightStatus.wsWeight;

                                if (v5.Value < (_value - v1.Value))
                                {
                                    _value = v5.Value + v1.Value;
                                    if (_value <= (size_layout_bottom_column + size_layout_top_column))
                                    {
                                        v6.CorrectLenghtInstrument(0.0f);
                                        v6.Calculate(0.0f);
                                    }
                                    else
                                    {
                                        float _tmp = _value - (size_layout_bottom_column + size_layout_top_column);
                                        v6.CorrectLenghtInstrument(_tmp);
                                    }
                                }
                            }

                            mode_proccess = TModeProcess.mpBase;
                            break;

                        default:
                            break;
                    }
                }
                finally
                {
                    slim.ExitWriteLock();
                }
            }
        }
Example #3
0
File: P0202.cs Project: slawer/sgt
        /// <summary>
        /// Вычисляет текущее значение параметра Длина инструмента
        /// </summary>
        /// <param name="v1">Положение тальблока в текущий момент</param>
        /// <param name="v2">Вес на крюке в текущий момент</param>
        /// <param name="v3">Положение клиньев в текущий момент</param>
        /// <param name="v4">Положение инструмента (долота) в текущий момент</param>
        /// <param name="v5">Глубина забоя в текущий момент</param>
        /// <param name="v6">Количество опущенных свеч</param>
        /// <param name="currentTime">Текущее технологическое время</param>
        /// <param name="locking_weight_hook">Блокировочное значение веса на крюке</param>
        /// <param name="size_layout_bottom_column">Размер компоновки низа колонны</param>
        /// <param name="r_weight">Метод расчета веса на крюке</param>
        public void Calculate(P0005 v1, P0102 v2, P0012 v3, P0204 v4, P0205 v5, P0203 v6,
                              DateTime currentTime, float locking_weight_hook, float size_layout_bottom_column,
                              float size_layout_top_column, TechnologicalRegimeWeightHook r_weight)
        {
            if (slim.TryEnterWriteLock(300))
            {
                try
                {
                    switch (mode_proccess)
                    {
                    case TModeProcess.mpBase:

                        _value = current_length_instrument(v1, v3, v2, locking_weight_hook, r_weight);
                        break;

                    case TModeProcess.mpSetUser:

                        mode_proccess = TModeProcess.mpBase;
                        if (WeightHookForWeightOrWedges(v2, v3, locking_weight_hook, r_weight)
                            != TProcResult.True || float.IsNaN(v1.Value))
                        {
                            v4.Calculate(_value);
                        }

                        if (_value <= (size_layout_bottom_column + size_layout_top_column))
                        {
                            v6.CorrectLenghtInstrument(0.0f);
                            v6.Calculate(0.0f);
                        }
                        else
                        {
                            float _tmp = _value - (size_layout_bottom_column + size_layout_top_column);
                            v6.CorrectLenghtInstrument(_tmp);
                        }
                        break;

                    case TModeProcess.mpCMDzaboi:

                        mode_proccess = TModeProcess.mpBase;

                        if (WeightHookForWeightOrWedges(v2, v3, locking_weight_hook, r_weight)
                            != TProcResult.True || float.IsNaN(v1.Value))
                        {
                            _value = current_length_instrument(v1, v3, v2, locking_weight_hook, r_weight);
                        }
                        else
                        {
                            last_talblock = v1.Value;
                            weight_status = WeightStatus.wsWeight;

                            _value = v5.Value + v1.Value;

                            if (_value <= (size_layout_bottom_column + size_layout_top_column))
                            {
                                v6.CorrectLenghtInstrument(0.0f);
                                v6.Calculate(0.0f);
                            }
                            else
                            {
                                float _tmp = _value - (size_layout_bottom_column + size_layout_top_column);
                                v6.CorrectLenghtInstrument(_tmp);
                            }
                        }
                        break;

                    case TModeProcess.mpCMDmodifyDepth:

                        if (WeightHookForWeightOrWedges(v2, v3, locking_weight_hook, r_weight)
                            != TProcResult.True || float.IsNaN(v1.Value))
                        {
                            weight_status = WeightStatus.wsClear;
                            if (v5.Value < _value)
                            {
                                _value = v5.Value;
                                if (_value <= (size_layout_bottom_column + size_layout_top_column))
                                {
                                    v6.CorrectLenghtInstrument(0.0f);
                                    v6.Calculate(0.0f);
                                }
                                else
                                {
                                    float _tmp = _value - (size_layout_bottom_column + size_layout_top_column);
                                    v6.CorrectLenghtInstrument(_tmp);
                                }
                            }

                            v4.Calculate(_value);
                        }
                        else
                        {
                            last_talblock = v1.Value;
                            weight_status = WeightStatus.wsWeight;

                            if (v5.Value < (_value - v1.Value))
                            {
                                _value = v5.Value + v1.Value;
                                if (_value <= (size_layout_bottom_column + size_layout_top_column))
                                {
                                    v6.CorrectLenghtInstrument(0.0f);
                                    v6.Calculate(0.0f);
                                }
                                else
                                {
                                    float _tmp = _value - (size_layout_bottom_column + size_layout_top_column);
                                    v6.CorrectLenghtInstrument(_tmp);
                                }
                            }
                        }

                        mode_proccess = TModeProcess.mpBase;
                        break;

                    default:
                        break;
                    }
                }
                finally
                {
                    slim.ExitWriteLock();
                }
            }
        }
Example #4
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;
        }