Example #1
0
            private static void WriteIntoPG(string FGCode, string PGName, string PinYinSuffix, PGComponents PGComp, double areaBase)
            {
                int index;

                if (_dictionary.TryGetValue(FGCode + _direction.ToString(), out index))
                {
                    _PGItems.ElementAt(index).Num[_floor_bottom] += _area / areaBase;
                }
                else
                {
                    PGItem pgItem = new PGItem();
                    pgItem.PGName              = PGName;
                    pgItem.PinYinSuffix        = PinYinSuffix;
                    pgItem.Code                = FGCode;
                    pgItem.direction           = _direction;
                    pgItem.Num[_floor_bottom] += ((byte)_finishType % 2 == 1 ? 1:2) * _area / areaBase;
                    pgItem.Price               = _addiInfo.prices[(byte)PGComp];
                    if (pgItem.Price == 0.0)
                    {
                        pgItem.IfDefinePrice = false;
                    }
                    else
                    {
                        pgItem.IfDefinePrice = true;
                    }
                    _PGItems.Add(pgItem);
                    _dictionary.Add(FGCode + _direction.ToString(), _PGItems.Count - 1);
                }
            }
Example #2
0
            public static void UpdateToPGs()
            {
                string FGCode = "C2011.0";
                int    temp   = ds_matl == 2 ? ds_joint - 2 : ds_joint;

                FGCode += ds_matl.ToString() + "1" + ConstSet.Alphabet[temp];

                int index;

                if (_dictionary.TryGetValue(FGCode + _direction.ToString(), out index))
                {
                    _PGItems.ElementAt(index).Num[_floor] += 1.0;
                }
                else
                {
                    PGItem pgItem = new PGItem();
                    pgItem.PGName       = "楼梯";
                    pgItem.PinYinSuffix = "LouTi";
                    pgItem.Code         = FGCode;
                    pgItem.direction    = _direction;
                    pgItem.Num[_floor] += 1.0;
                    pgItem.Price        = _addiInfo.prices[(byte)PGComponents.Stair];
                    if (pgItem.Price == 0.0)
                    {
                        pgItem.IfDefinePrice = false;
                    }
                    else
                    {
                        pgItem.IfDefinePrice = true;
                    }
                    _PGItems.Add(pgItem);
                    _dictionary.Add(FGCode + _direction.ToString(), _PGItems.Count - 1);
                }
            }
Example #3
0
        public static List <PGItem> GetPG(Document doc, AdditionalInfo addiInfo)
        {
            _doc           = doc;
            _addiInfo      = addiInfo;
            _myLevel       = MyLevel.GetMyLevel();
            _abandonWriter = AbandonmentWriter.GetWriter();
            _PGItems       = new List <PGItem>(4);
            _Storefronts   = new List <Wall>(10);
            _isSetPGItem   = new bool[4];

            double Price         = addiInfo.prices[(byte)PGComponents.Storefront];
            bool   IfDefinePrice = Price == 0.0 ? false : true;

            string[]    temp_code = { "B2023.001", "B2023.002" };
            Direction[] temp_dire = { Direction.X, Direction.Y };
            for (int i = 0; i < 2; ++i)
            {
                for (int j = 0; j < 2; ++j)
                {
                    PGItem pgItem = new PGItem();
                    pgItem.Code          = temp_code[i];
                    pgItem.direction     = temp_dire[j];
                    pgItem.PGName        = "店面";
                    pgItem.PinYinSuffix  = "DianMian";
                    pgItem.IfDefinePrice = IfDefinePrice;
                    pgItem.Price         = Price;

                    _PGItems.Add(pgItem);
                }
            }

            ExtractObjects();
            Process();
            return(_PGItems);
        }
Example #4
0
            public static void UpdateToPGs()
            {
                string FGCode;

                if (TryGetFGCode(out FGCode))
                {
                    int index;
                    if (_dictionary.TryGetValue(FGCode, out index))
                    {
                        _PGItems.ElementAt(index).Num[_floor] += 1.0;
                    }
                    else
                    {
                        PGItem pgItem = new PGItem();
                        pgItem.PGName       = "无梁楼盖";
                        pgItem.PinYinSuffix = "WuLiangLouGai";
                        pgItem.Code         = FGCode;
                        pgItem.direction    = Direction.Undefined;
                        pgItem.Num[_floor] += 1.0;
                        pgItem.Price        = _addiInfo.prices[(byte)PGComponents.FlatSlab];
                        if (pgItem.Price == 0.0)
                        {
                            pgItem.IfDefinePrice = false;
                        }
                        else
                        {
                            pgItem.IfDefinePrice = true;
                        }
                        _PGItems.Add(pgItem);
                        _dictionary.Add(FGCode, _PGItems.Count - 1);
                    }
                }
            }
Example #5
0
            public static void UpdateToPGs()
            {
                string FGCode         = "B1035.0";
                int    connectionType = _addiInfo.defaultSet[(byte)DefaultSet.SteelBCJoint_ConnectionType];

                for (int i = 0; i < 4; ++i)
                {
                    for (int j = 0; j < 2; ++j)
                    {
                        PGItem pgItem = new PGItem();
                        for (int k = 1; k < _numLevel; ++k)
                        {
                            pgItem.Num[k - 1] = _record[i, j, k];
                        }
                        if (pgItem.Num.Sum() == 0.0)
                        {
                            continue;
                        }
                        pgItem.Code         = FGCode + (connectionType * 2 + (i % 2)).ToString() + (j + 1).ToString();
                        pgItem.direction    = ((i <= 1) ? Direction.X : Direction.Y);
                        pgItem.PGName       = "钢结构梁柱结点";
                        pgItem.PinYinSuffix = "GangJieGouLiangZhuJieDian";
                        pgItem.Price        = _addiInfo.prices[(byte)PGComponents.SteelBCJoint];
                        if (pgItem.Price == 0.0)
                        {
                            pgItem.IfDefinePrice = false;
                        }
                        else
                        {
                            pgItem.IfDefinePrice = true;
                        }
                        _PGItems.Add(pgItem);
                    }
                }
            }
Example #6
0
            public static void UpdateToPGs()
            {
                string FGCode = "B1041.";

                switch (_addiInfo.mfType)
                {
                case MomentFrameType.SMF:
                    FGCode += "00";
                    break;

                case MomentFrameType.confirmedMF:
                    FGCode += "01";
                    break;

                case MomentFrameType.IMF:
                    FGCode += "02";
                    break;

                case MomentFrameType.OMF:
                    FGCode += "03";
                    break;

                case MomentFrameType.unconfirmedMF:
                    FGCode += "08";
                    break;
                }

                for (int i = 0; i < 4; ++i)
                {
                    for (int j = 0; j < 3; ++j)
                    {
                        PGItem pgItem = new PGItem();
                        for (int k = 1; k < _numLevel; ++k)
                        {
                            pgItem.Num[k - 1] = _record[i, j, k];
                        }
                        if (pgItem.Num.Sum() == 0.0)
                        {
                            continue;
                        }
                        pgItem.Code         = FGCode + (j + 1).ToString() + ((i % 2 == 0) ? "a" : "b");
                        pgItem.direction    = ((i <= 1) ? Direction.X : Direction.Y);
                        pgItem.PGName       = "梁柱结点";
                        pgItem.PinYinSuffix = "LiangZhuJieDian";
                        pgItem.Price        = _addiInfo.prices[(byte)PGComponents.BeamColumnJoint];
                        if (pgItem.Price == 0.0)
                        {
                            pgItem.IfDefinePrice = false;
                        }
                        else
                        {
                            pgItem.IfDefinePrice = true;
                        }
                        _PGItems.Add(pgItem);
                    }
                }
            }
Example #7
0
            public static void UpdateToPGs()
            {
                int i = _floor_bottom + 1;
                int index;

                while (i <= _floor_top)
                {
                    string FGCode;
                    _floor_bottom = i - 1;
                    try
                    {
                        _height = _myLevel.GetElevation(i) - _myLevel.GetElevation(i - 1);
                    }
                    catch
                    {
                        return;
                    };
                    _area        = _height * _length;
                    _aspectRatio = _length / _height;
                    GetBoundCond_and_Rein(i);
                    ++i;
                    if (!TryGetFGCode(out FGCode))
                    {
                        continue;
                    }
                    if (_dictionary.TryGetValue(FGCode + _direction.ToString(), out index))
                    {
                        _PGItems.ElementAt(index).Num[_floor_bottom] += _area / _areaBase;
                    }
                    else
                    {
                        PGItem pgItem = new PGItem();
                        pgItem.PGName              = "剪力墙";
                        pgItem.PinYinSuffix        = "JianLiQiang";
                        pgItem.Code                = FGCode;
                        pgItem.direction           = _direction;
                        pgItem.Num[_floor_bottom] += _area / _areaBase;
                        pgItem.Price               = _addiInfo.prices[(byte)PGComponents.ShearWall];
                        if (pgItem.Price == 0.0)
                        {
                            pgItem.IfDefinePrice = false;
                        }
                        else
                        {
                            pgItem.IfDefinePrice = true;
                        }
                        _PGItems.Add(pgItem);
                        _dictionary.Add(FGCode + _direction.ToString(), _PGItems.Count - 1);
                    }
                }
            }
Example #8
0
            public override void UpdateToPGs()
            {
                int installValue  = _addiInfo.defaultSet[(byte)DefaultSet.LVS_Install];
                int capacityValue = _addiInfo.defaultSet[(byte)DefaultSet.LVS_Capacity];
                int dmValue       = _addiInfo.defaultSet[(byte)DefaultSet.LVS_DamageMode];
                int factor        = 3;

                if (installValue == 0)
                {
                    if (dmValue != 1)
                    {
                        _abandonWriter.WriteAbandonment(_fi, AbandonmentTable.LVS_InsDMConflict);
                        return;
                    }
                    else
                    {
                        --installValue;
                        dmValue = 0;
                        factor  = 1;
                    }
                }
                string FGCode = "D5012.02" + (installValue + 2).ToString() + ConstSet.Alphabet[factor * capacityValue + dmValue];

                int index;

                if (_dictionary.TryGetValue(FGCode, out index))
                {
                    _PGItems.ElementAt(index).Num[_floor] += 1.0;
                }
                else
                {
                    PGItem pgItem = new PGItem();
                    pgItem.PGName       = "低压开关";
                    pgItem.PinYinSuffix = "DiYaKaiGuan";
                    pgItem.Code         = FGCode;
                    pgItem.direction    = Direction.Undefined;
                    pgItem.Num[_floor] += 1.0;
                    pgItem.Price        = _addiInfo.prices[(byte)PGComponents.LVS];
                    if (pgItem.Price == 0.0)
                    {
                        pgItem.IfDefinePrice = false;
                    }
                    else
                    {
                        pgItem.IfDefinePrice = true;
                    }
                    _PGItems.Add(pgItem);
                    _dictionary.Add(FGCode, _PGItems.Count - 1);
                }
            }
Example #9
0
            public override void UpdateToPGs()
            {
                int installValue = _addiInfo.defaultSet[(byte)DefaultSet.BatteryRack_Install];
                int dmValue      = _addiInfo.defaultSet[(byte)DefaultSet.BatteryRack_DamageMode];

                if (installValue == 0)
                {
                    if (dmValue != 1)
                    {
                        _abandonWriter.WriteAbandonment(_fi, AbandonmentTable.BatteryRack_InsDMConflict);
                        return;
                    }
                    else
                    {
                        --installValue;
                        dmValue = 0;
                    }
                }
                string FGCode = "D5092.01";

                FGCode += (installValue + 2).ToString();
                FGCode += ConstSet.Alphabet[dmValue];

                int index;

                if (_dictionary.TryGetValue(FGCode, out index))
                {
                    _PGItems.ElementAt(index).Num[_floor] += 1.0;
                }
                else
                {
                    PGItem pgItem = new PGItem();
                    pgItem.PGName       = "电池架";
                    pgItem.PinYinSuffix = "DianChiJia";
                    pgItem.Code         = FGCode;
                    pgItem.direction    = Direction.Undefined;
                    pgItem.Num[_floor] += 1.0;
                    pgItem.Price        = _addiInfo.prices[(byte)PGComponents.BatteryRack];
                    if (pgItem.Price == 0.0)
                    {
                        pgItem.IfDefinePrice = false;
                    }
                    else
                    {
                        pgItem.IfDefinePrice = true;
                    }
                    _PGItems.Add(pgItem);
                    _dictionary.Add(FGCode, _PGItems.Count - 1);
                }
            }
Example #10
0
            private static Dictionary <string, int> _dictionary = new Dictionary <string, int>(13);       //num = 12
            private static void UpdateToPGs(Element beam, int floor, Direction direction, double width, double aspectRatio)
            {
                string FGCode = "B1042.0";

                if (width < 16 / 12 * ConstSet.FeetToMeter)
                {
                    FGCode += "0";
                }
                else if (width <= 24 / 12 * ConstSet.FeetToMeter)
                {
                    FGCode += "1";
                }
                else
                {
                    FGCode += "2";
                }
                FGCode += (ds_rein + 1).ToString() + ConstSet.Alphabet[(int)(aspectRatio / 2.0)];

                int index;

                if (_dictionary.TryGetValue(FGCode + direction.ToString(), out index))
                {
                    _PGItems.ElementAt(index).Num[floor] += 1.0;
                }
                else
                {
                    PGItem pgItem = new PGItem();
                    pgItem.PGName       = "混凝土连梁";
                    pgItem.PinYinSuffix = "HunNingTuLianLiang";
                    pgItem.Code         = FGCode;
                    pgItem.direction    = direction;
                    pgItem.Num[floor]  += 1.0;
                    pgItem.Price        = _addiInfo.prices[(byte)PGComponents.LinkBeam];
                    if (pgItem.Price == 0.0)
                    {
                        pgItem.IfDefinePrice = false;
                    }
                    else
                    {
                        pgItem.IfDefinePrice = true;
                    }
                    _PGItems.Add(pgItem);
                    _dictionary.Add(FGCode + direction.ToString(), _PGItems.Count - 1);
                }
            }
Example #11
0
            public override void UpdateToPGs()
            {
                if (_addiInfo.defaultSet[(byte)DefaultSet.CoolingTower_Install] == 0 &&
                    _addiInfo.defaultSet[(byte)DefaultSet.CoolingTower_DamageMode] != 1)
                {
                    _abandonWriter.WriteAbandonment(_fi, AbandonmentTable.CoolingTower_InsDMConflict);
                    return;
                }
                else
                {
                    string FGCode = "D3031.02";
                    FGCode += (_addiInfo.defaultSet[(byte)DefaultSet.CoolingTower_Install] + 1).ToString();
                    int index_letter = _addiInfo.defaultSet[(byte)DefaultSet.CoolingTower_Install] == 0 ?
                                       _addiInfo.defaultSet[(byte)DefaultSet.CoolingTower_Capacity] :
                                       _addiInfo.defaultSet[(byte)DefaultSet.CoolingTower_Capacity] * 3
                                       + _addiInfo.defaultSet[(byte)DefaultSet.CoolingTower_DamageMode];
                    FGCode += ConstSet.Alphabet[index_letter];

                    int index;
                    if (_dictionary.TryGetValue(FGCode, out index))
                    {
                        _PGItems.ElementAt(index).Num[_floor] += 1.0;
                    }
                    else
                    {
                        PGItem pgItem = new PGItem();
                        pgItem.PGName       = "冷却塔";
                        pgItem.PinYinSuffix = "LengQueTa";
                        pgItem.Code         = FGCode;
                        pgItem.direction    = Direction.Undefined;
                        pgItem.Num[_floor] += 1.0;
                        pgItem.Price        = _addiInfo.prices[(byte)PGComponents.CoolingTower];
                        if (pgItem.Price == 0.0)
                        {
                            pgItem.IfDefinePrice = false;
                        }
                        else
                        {
                            pgItem.IfDefinePrice = true;
                        }
                        _PGItems.Add(pgItem);
                        _dictionary.Add(FGCode, _PGItems.Count - 1);
                    }
                }
            }
Example #12
0
            public override void UpdateToPGs()
            {
                string FGCode       = "D3041.03";
                int    ceilingValue = _addiInfo.defaultSet[(byte)DefaultSet.Diffuser_Ceiling];
                int    sdcIndex     = SDCConverter.Get4LevelIndex(_addiInfo.sdc);

                if (ceilingValue == 0 && 2 <= sdcIndex)
                {
                    _abandonWriter.WriteAbandonment(_fi, AbandonmentTable.Diffuser_InsSDCConflict);
                    return;
                }
                else
                {
                    FGCode += (ceilingValue + 1).ToString();
                    FGCode += ConstSet.Alphabet[sdcIndex];

                    int index;
                    if (_dictionary.TryGetValue(FGCode, out index))
                    {
                        _PGItems.ElementAt(index).Num[_floor] += 0.1;       //costing per 10 units
                    }
                    else
                    {
                        PGItem pgItem = new PGItem();
                        pgItem.PGName       = "散流器";
                        pgItem.PinYinSuffix = "SanLiuQi";
                        pgItem.Code         = FGCode;
                        pgItem.direction    = Direction.Undefined;
                        pgItem.Num[_floor] += 0.1;
                        pgItem.Price        = _addiInfo.prices[(byte)PGComponents.Diffuser];
                        if (pgItem.Price == 0.0)
                        {
                            pgItem.IfDefinePrice = false;
                        }
                        else
                        {
                            pgItem.IfDefinePrice = true;
                        }
                        _PGItems.Add(pgItem);
                        _dictionary.Add(FGCode, _PGItems.Count - 1);
                    }
                }
            }
Example #13
0
            public override void UpdateToPGs()
            {
                int bracingValue = _addiInfo.defaultSet[(byte)DefaultSet.FireSprinkler_Bracing];
                int ceilingValue = _addiInfo.defaultSet[(byte)DefaultSet.FireSprinkler_Ceilling];
                int sdcIndex     = SDCConverter.Get4LevelIndex(_addiInfo.sdc);

                if ((bracingValue == 0 && ceilingValue == 1) || (bracingValue == 1 && ceilingValue == 0) ||
                    (bracingValue == 1 && 2 <= sdcIndex) || (bracingValue == 2 && sdcIndex <= 1))
                {
                    _abandonWriter.WriteAbandonment(_fi, AbandonmentTable.FireSprinkler_Conflict);
                    return;
                }
                else
                {
                    string FGCode = "D4011.0" + (bracingValue + 3).ToString() + sdcIndex.ToString() + "a";

                    int index;
                    if (_dictionary.TryGetValue(FGCode, out index))
                    {
                        _PGItems.ElementAt(index).Num[_floor] += 0.01;          //costing per 100 units
                    }
                    else
                    {
                        PGItem pgItem = new PGItem();
                        pgItem.PGName       = "消防喷淋";
                        pgItem.PinYinSuffix = "XiaoFangPenLin";
                        pgItem.Code         = FGCode;
                        pgItem.direction    = Direction.Undefined;
                        pgItem.Num[_floor] += 0.01;
                        pgItem.Price        = _addiInfo.prices[(byte)PGComponents.FireSprinkler];
                        if (pgItem.Price == 0.0)
                        {
                            pgItem.IfDefinePrice = false;
                        }
                        else
                        {
                            pgItem.IfDefinePrice = true;
                        }
                        _PGItems.Add(pgItem);
                        _dictionary.Add(FGCode, _PGItems.Count - 1);
                    }
                }
            }
Example #14
0
            public override void UpdateToPGs()
            {
                int installValue = _addiInfo.defaultSet[(byte)DefaultSet.LVS_Install];
                int capacityValue = _addiInfo.defaultSet[(byte)DefaultSet.LVS_Capacity];
                int dmValue = _addiInfo.defaultSet[(byte)DefaultSet.LVS_DamageMode];
                int factor = 3;
                if (installValue == 0)
                {
                    if (dmValue != 1)
                    {
                        _abandonWriter.WriteAbandonment(_fi, AbandonmentTable.LVS_InsDMConflict);
                        return;
                    }
                    else
                    {
                        --installValue;
                        dmValue = 0;
                        factor = 1;
                    }
                }
                string FGCode = "D5012.02" + (installValue + 2).ToString() + ConstSet.Alphabet[factor * capacityValue + dmValue];

                int index;
                if (_dictionary.TryGetValue(FGCode, out index))
                {
                    _PGItems.ElementAt(index).Num[_floor] += 1.0;
                }
                else
                {
                    PGItem pgItem = new PGItem();
                    pgItem.PGName = "低压开关";
                    pgItem.PinYinSuffix = "DiYaKaiGuan";
                    pgItem.Code = FGCode;
                    pgItem.direction = Direction.Undefined;
                    pgItem.Num[_floor] += 1.0;
                    pgItem.Price = _addiInfo.prices[(byte)PGComponents.LVS];
                    if (pgItem.Price == 0.0) pgItem.IfDefinePrice = false;
                    else pgItem.IfDefinePrice = true;
                    _PGItems.Add(pgItem);
                    _dictionary.Add(FGCode, _PGItems.Count - 1);
                }
            }
Example #15
0
            public override void UpdateToPGs()
            {
                int sdcIndex = SDCConverter.Get4LevelIndex(_addiInfo.sdc);

                if (2 <= sdcIndex)
                {
                    _abandonWriter.WriteAbandonment(_fi, AbandonmentTable.VAV_SDCNonABC);
                    return;
                }
                else
                {
                    string FGCode = "D3041.041";
                    FGCode += ConstSet.Alphabet[sdcIndex];

                    int index;
                    if (_dictionary.TryGetValue(FGCode, out index))
                    {
                        _PGItems.ElementAt(index).Num[_floor] += 0.1;       //costing per 10 units
                    }
                    else
                    {
                        PGItem pgItem = new PGItem();
                        pgItem.PGName       = "变风量箱";
                        pgItem.PinYinSuffix = "BianFengLiangXiang";
                        pgItem.Code         = FGCode;
                        pgItem.direction    = Direction.Undefined;
                        pgItem.Num[_floor] += 0.1;
                        pgItem.Price        = _addiInfo.prices[(byte)PGComponents.VAV];
                        if (pgItem.Price == 0.0)
                        {
                            pgItem.IfDefinePrice = false;
                        }
                        else
                        {
                            pgItem.IfDefinePrice = true;
                        }
                        _PGItems.Add(pgItem);
                        _dictionary.Add(FGCode, _PGItems.Count - 1);
                    }
                }
            }
Example #16
0
            public override void UpdateToPGs()
            {
                int installValue = _addiInfo.defaultSet[(byte)DefaultSet.BatteryRack_Install];
                int dmValue = _addiInfo.defaultSet[(byte)DefaultSet.BatteryRack_DamageMode];
                if (installValue == 0)
                {
                    if (dmValue != 1)
                    {
                        _abandonWriter.WriteAbandonment(_fi, AbandonmentTable.BatteryRack_InsDMConflict);
                        return;
                    }
                    else
                    {
                        --installValue;
                        dmValue = 0;
                    }
                }
                string FGCode = "D5092.01";
                FGCode += (installValue + 2).ToString();
                FGCode += ConstSet.Alphabet[dmValue];

                int index;
                if (_dictionary.TryGetValue(FGCode, out index))
                {
                    _PGItems.ElementAt(index).Num[_floor] += 1.0;
                }
                else
                {
                    PGItem pgItem = new PGItem();
                    pgItem.PGName = "电池架";
                    pgItem.PinYinSuffix = "DianChiJia";
                    pgItem.Code = FGCode;
                    pgItem.direction = Direction.Undefined;
                    pgItem.Num[_floor] += 1.0;
                    pgItem.Price = _addiInfo.prices[(byte)PGComponents.BatteryRack];
                    if (pgItem.Price == 0.0) pgItem.IfDefinePrice = false;
                    else pgItem.IfDefinePrice = true;
                    _PGItems.Add(pgItem);
                    _dictionary.Add(FGCode, _PGItems.Count - 1);
                }
            }
Example #17
0
            public static void UpdateToPGs()
            {
                string FGCode = "B3011.01" + ((ds_secure * 2) + _matlIndex).ToString();
                PGItem pgItem = new PGItem();

                pgItem.PGName       = "屋顶";
                pgItem.PinYinSuffix = "WuDing";
                pgItem.Code         = FGCode;
                pgItem.direction    = Direction.Undefined;
                pgItem.Num[_floor] += _area / _areaBase;
                pgItem.Price        = _addiInfo.prices[(byte)PGComponents.Roof];
                if (pgItem.Price == 0.0)
                {
                    pgItem.IfDefinePrice = false;
                }
                else
                {
                    pgItem.IfDefinePrice = true;
                }
                _PGItems.Add(pgItem);
            }
Example #18
0
            public override void UpdateToPGs()
            {
                if (_addiInfo.defaultSet[(byte)DefaultSet.CoolingTower_Install] == 0
                    && _addiInfo.defaultSet[(byte)DefaultSet.CoolingTower_DamageMode] != 1)
                {
                    _abandonWriter.WriteAbandonment(_fi, AbandonmentTable.CoolingTower_InsDMConflict);
                    return;
                }
                else
                {
                    string FGCode = "D3031.02";
                    FGCode += (_addiInfo.defaultSet[(byte)DefaultSet.CoolingTower_Install] + 1).ToString();
                    int index_letter = _addiInfo.defaultSet[(byte)DefaultSet.CoolingTower_Install] == 0 ?
                        _addiInfo.defaultSet[(byte)DefaultSet.CoolingTower_Capacity] :
                        _addiInfo.defaultSet[(byte)DefaultSet.CoolingTower_Capacity] * 3
                                     + _addiInfo.defaultSet[(byte)DefaultSet.CoolingTower_DamageMode];
                    FGCode += ConstSet.Alphabet[index_letter];

                    int index;
                    if (_dictionary.TryGetValue(FGCode, out index))
                    {
                        _PGItems.ElementAt(index).Num[_floor] += 1.0;
                    }
                    else
                    {
                        PGItem pgItem = new PGItem();
                        pgItem.PGName = "冷却塔";
                        pgItem.PinYinSuffix = "LengQueTa";
                        pgItem.Code = FGCode;
                        pgItem.direction = Direction.Undefined;
                        pgItem.Num[_floor] += 1.0;
                        pgItem.Price = _addiInfo.prices[(byte)PGComponents.CoolingTower];
                        if (pgItem.Price == 0.0) pgItem.IfDefinePrice = false;
                        else pgItem.IfDefinePrice = true;
                        _PGItems.Add(pgItem);
                        _dictionary.Add(FGCode, _PGItems.Count - 1);
                    }
                }
            }
Example #19
0
            static CeilingRecognizer()
            {
                if (_addiInfo.requiredComp[(byte)PGComponents.CeilingLighting])
                {
                    _rece      = new PGItem();
                    _rece.Code = _addiInfo.defaultSet[(byte)DefaultSet.Lighting_Support] == 0 ?
                                 "C3033.001" : "C3033.002";
                    _rece.PGName       = "嵌入灯";
                    _rece.PinYinSuffix = "QianRuDeng";
                    _rece.direction    = Direction.Undefined;
                    _rece.Price        = _addiInfo.prices[(byte)PGComponents.CeilingLighting];
                    if (_rece.Price == 0.0)
                    {
                        _rece.IfDefinePrice = false;
                    }
                    else
                    {
                        _rece.IfDefinePrice = true;
                    }

                    _pend      = new PGItem();
                    _pend.Code = _addiInfo.defaultSet[(byte)DefaultSet.Lighting_SeisRated] == 0 ?
                                 "C3034.001" : "C3034.002";
                    _pend.PGName       = "吊灯";
                    _pend.PinYinSuffix = "DiaoDeng";
                    _pend.direction    = Direction.Undefined;
                    _pend.Price        = _addiInfo.prices[(byte)PGComponents.CeilingLighting];
                    if (_pend.Price == 0.0)
                    {
                        _pend.IfDefinePrice = false;
                    }
                    else
                    {
                        _pend.IfDefinePrice = true;
                    }
                }
            }
Example #20
0
            public override void UpdateToPGs()
            {
                int installValue = _addiInfo.defaultSet[(byte)DefaultSet.MCC_Install];
                int dmValue = _addiInfo.defaultSet[(byte)DefaultSet.MCC_DamageMode];
                if (installValue == 0)
                {
                    if (dmValue != 1)
                    {
                        _abandonWriter.WriteAbandonment(_fi, AbandonmentTable.MCC_InsDMConflict);
                        return;
                    }
                    else dmValue = 0;
                }
                string FGCode = "D5012.013";
                FGCode += ConstSet.Alphabet[installValue + dmValue];

                int index;
                if (_dictionary.TryGetValue(FGCode, out index))
                {
                    _PGItems.ElementAt(index).Num[_floor] += 1.0;
                }
                else
                {
                    PGItem pgItem = new PGItem();
                    pgItem.PGName = "电动机控制中心";
                    pgItem.PinYinSuffix = "DianDongJiKongZhiZhongXin";
                    pgItem.Code = FGCode;
                    pgItem.direction = Direction.Undefined;
                    pgItem.Num[_floor] += 1.0;
                    pgItem.Price = _addiInfo.prices[(byte)PGComponents.MCC];
                    if (pgItem.Price == 0.0) pgItem.IfDefinePrice = false;
                    else pgItem.IfDefinePrice = true;
                    _PGItems.Add(pgItem);
                    _dictionary.Add(FGCode, _PGItems.Count - 1);
                }
            }
Example #21
0
            public override void UpdateToPGs()
            {
                string FGCode = "D3041.00";

                FGCode += (_addiInfo.defaultSet[(byte)DefaultSet.HVACFan_InLine_Install] + 1).ToString();
                int sdcIndex = SDCConverter.Get4LevelIndex(_addiInfo.sdc);

                FGCode += ConstSet.Alphabet[sdcIndex];

                int index;

                if (_dictionary.TryGetValue(FGCode, out index))
                {
                    _PGItems.ElementAt(index).Num[_floor] += 0.1;       //costing per 10 units
                }
                else
                {
                    PGItem pgItem = new PGItem();
                    pgItem.PGName       = "管道风机";
                    pgItem.PinYinSuffix = "GuanDaoFengJi";
                    pgItem.Code         = FGCode;
                    pgItem.direction    = Direction.Undefined;
                    pgItem.Num[_floor] += 0.1;
                    pgItem.Price        = _addiInfo.prices[(byte)PGComponents.HVACFan_InLine];
                    if (pgItem.Price == 0.0)
                    {
                        pgItem.IfDefinePrice = false;
                    }
                    else
                    {
                        pgItem.IfDefinePrice = true;
                    }
                    _PGItems.Add(pgItem);
                    _dictionary.Add(FGCode, _PGItems.Count - 1);
                }
            }
Example #22
0
            public override void UpdateToPGs()
            {
                int bracingValue = _addiInfo.defaultSet[(byte)DefaultSet.FireSprinkler_Bracing];
                int ceilingValue = _addiInfo.defaultSet[(byte)DefaultSet.FireSprinkler_Ceilling];
                int sdcIndex = SDCConverter.Get4LevelIndex(_addiInfo.sdc);
                if((bracingValue == 0 && ceilingValue == 1) || (bracingValue == 1 && ceilingValue == 0)
                    || (bracingValue == 1 && 2 <= sdcIndex) || (bracingValue == 2 && sdcIndex <= 1))
                {
                    _abandonWriter.WriteAbandonment(_fi, AbandonmentTable.FireSprinkler_Conflict);
                    return;
                }
                else
                {
                    string FGCode = "D4011.0" + (bracingValue + 3).ToString() + sdcIndex.ToString() + "a";

                    int index;
                    if (_dictionary.TryGetValue(FGCode, out index))
                    {
                        _PGItems.ElementAt(index).Num[_floor] += 0.01;          //costing per 100 units
                    }
                    else
                    {
                        PGItem pgItem = new PGItem();
                        pgItem.PGName = "消防喷淋";
                        pgItem.PinYinSuffix = "XiaoFangPenLin";
                        pgItem.Code = FGCode;
                        pgItem.direction = Direction.Undefined;
                        pgItem.Num[_floor] += 0.01;
                        pgItem.Price = _addiInfo.prices[(byte)PGComponents.FireSprinkler];
                        if (pgItem.Price == 0.0) pgItem.IfDefinePrice = false;
                        else pgItem.IfDefinePrice = true;
                        _PGItems.Add(pgItem);
                        _dictionary.Add(FGCode, _PGItems.Count - 1);
                    }
                }
            }
Example #23
0
            public override void UpdateToPGs()
            {
                int installValue = _addiInfo.defaultSet[(byte)DefaultSet.MCC_Install];
                int dmValue = _addiInfo.defaultSet[(byte)DefaultSet.MCC_DamageMode];
                if (installValue == 0)
                {
                    if (dmValue != 1)
                    {
                        _abandonWriter.WriteAbandonment(_fi, AbandonmentTable.MCC_InsDMConflict);
                        return;
                    }
                    else dmValue = 0;
                }
                string FGCode = "D5012.013";
                FGCode += ConstSet.Alphabet[installValue + dmValue];

                int index;
                if (_dictionary.TryGetValue(FGCode, out index))
                {
                    _PGItems.ElementAt(index).Num[_floor] += 1.0;
                }
                else
                {
                    PGItem pgItem = new PGItem();
                    pgItem.PGName = "电动机控制中心";
                    pgItem.PinYinSuffix = "DianDongJiKongZhiZhongXin";
                    pgItem.Code = FGCode;
                    pgItem.direction = Direction.Undefined;
                    pgItem.Num[_floor] += 1.0;
                    pgItem.Price = _addiInfo.prices[(byte)PGComponents.MCC];
                    if (pgItem.Price == 0.0) pgItem.IfDefinePrice = false;
                    else pgItem.IfDefinePrice = true;
                    _PGItems.Add(pgItem);
                    _dictionary.Add(FGCode, _PGItems.Count - 1);
                }
            }
Example #24
0
 public static void UpdateToPGs()
 {
     string FGCode;
     if (TryGetFGCode(out FGCode))
     {
         int index;
         if (_dictionary.TryGetValue(FGCode, out index))
         {
             _PGItems.ElementAt(index).Num[_floor] += 1.0;
         }
         else
         {
             PGItem pgItem = new PGItem();
             pgItem.PGName = "无梁楼盖";
             pgItem.PinYinSuffix = "WuLiangLouGai";
             pgItem.Code = FGCode;
             pgItem.direction = Direction.Undefined;
             pgItem.Num[_floor] += 1.0;
             pgItem.Price = _addiInfo.prices[(byte)PGComponents.FlatSlab];
             if (pgItem.Price == 0.0) pgItem.IfDefinePrice = false;
             else pgItem.IfDefinePrice = true;
             _PGItems.Add(pgItem);
             _dictionary.Add(FGCode, _PGItems.Count - 1);
         }
     }
 }
Example #25
0
 private static void Process()
 {
     if (_StruColumns.Count() * _StruBeams.Count() == 0) return;
     string FGCode;
     if (!TryGetFGCode(out FGCode)) return;
     int floorNum = MyLevel.GetLevelNum() - 1;
     int[] num = new int[floorNum];
     int totalNum = 0;
     for (int i = 0; i < floorNum; ++i)
     {
         int n, m, k;
         double lowerLevel = _myLevel.GetElevation(i);
         double upperLevel = _myLevel.GetElevation(i + 1);
         double deltaHi = upperLevel - lowerLevel;
         double columnLL = lowerLevel + deltaHi * 0.3;
         double columnUL = upperLevel - deltaHi * 0.3;
         XYZ columnBottom = new XYZ(_maxBB.Min.X, _maxBB.Min.Y, columnLL);
         XYZ columnTop = new XYZ(_maxBB.Max.X, _maxBB.Max.Y, columnUL);
         BoundingBoxIntersectsFilter columnBBFilter = new BoundingBoxIntersectsFilter(new Outline(columnBottom, columnTop));
         FilteredElementCollector columnFec = new FilteredElementCollector(_doc, _StruColumns);
         columnFec.WherePasses(columnBBFilter);
         double beamLL = lowerLevel + deltaHi * 0.7;
         double beamUL = upperLevel + deltaHi * 0.3;
         XYZ beamBottom = new XYZ(_maxBB.Min.X, _maxBB.Min.Y, beamLL);
         XYZ beamTop = new XYZ(_maxBB.Max.X, _maxBB.Max.Y, beamUL);
         BoundingBoxIntersectsFilter beamBBFilter = new BoundingBoxIntersectsFilter(new Outline(beamBottom, beamTop));
         FilteredElementCollector beamFec = new FilteredElementCollector(_doc, _StruBeams);
         beamFec.WherePasses(beamBBFilter);
         if (columnFec.Count() * beamFec.Count() == 0) continue;
         GetNMK(columnFec.ToElementIds().ToList(), beamFec.ToElementIds().ToList(), out n, out m, out k);
         num[i] = m - n + k;
         totalNum += num[i];
     }
     if (totalNum != 0)
     {
         PGItem pgItem = new PGItem();
         pgItem.Code = FGCode;
         pgItem.direction = Direction.Undefined;
         pgItem.PGName = "支撑刚架";
         pgItem.PinYinSuffix = "ZhiChengGangJia";
         pgItem.Price = _addiInfo.prices[(byte)PGComponents.BracedFrame];
         if (pgItem.Price == 0.0) pgItem.IfDefinePrice = false;
         else pgItem.IfDefinePrice = true;
         for (int i = 0; i < floorNum; ++i)
         {
             pgItem.Num[i] = num[i];
         }
         _PGItems.Add(pgItem);
     }
 }
Example #26
0
        private static void Process()
        {
            if (_StruColumns.Count() * _StruBeams.Count() == 0)
            {
                return;
            }
            string FGCode;

            if (!TryGetFGCode(out FGCode))
            {
                return;
            }
            int floorNum = MyLevel.GetLevelNum() - 1;

            int[] num      = new int[floorNum];
            int   totalNum = 0;

            for (int i = 0; i < floorNum; ++i)
            {
                int    n, m, k;
                double lowerLevel   = _myLevel.GetElevation(i);
                double upperLevel   = _myLevel.GetElevation(i + 1);
                double deltaHi      = upperLevel - lowerLevel;
                double columnLL     = lowerLevel + deltaHi * 0.3;
                double columnUL     = upperLevel - deltaHi * 0.3;
                XYZ    columnBottom = new XYZ(_maxBB.Min.X, _maxBB.Min.Y, columnLL);
                XYZ    columnTop    = new XYZ(_maxBB.Max.X, _maxBB.Max.Y, columnUL);
                BoundingBoxIntersectsFilter columnBBFilter = new BoundingBoxIntersectsFilter(new Outline(columnBottom, columnTop));
                FilteredElementCollector    columnFec      = new FilteredElementCollector(_doc, _StruColumns);
                columnFec.WherePasses(columnBBFilter);
                double beamLL     = lowerLevel + deltaHi * 0.7;
                double beamUL     = upperLevel + deltaHi * 0.3;
                XYZ    beamBottom = new XYZ(_maxBB.Min.X, _maxBB.Min.Y, beamLL);
                XYZ    beamTop    = new XYZ(_maxBB.Max.X, _maxBB.Max.Y, beamUL);
                BoundingBoxIntersectsFilter beamBBFilter = new BoundingBoxIntersectsFilter(new Outline(beamBottom, beamTop));
                FilteredElementCollector    beamFec      = new FilteredElementCollector(_doc, _StruBeams);
                beamFec.WherePasses(beamBBFilter);
                if (columnFec.Count() * beamFec.Count() == 0)
                {
                    continue;
                }
                GetNMK(columnFec.ToElementIds().ToList(), beamFec.ToElementIds().ToList(), out n, out m, out k);
                num[i]    = m - n + k;
                totalNum += num[i];
            }
            if (totalNum != 0)
            {
                PGItem pgItem = new PGItem();
                pgItem.Code         = FGCode;
                pgItem.direction    = Direction.Undefined;
                pgItem.PGName       = "支撑刚架";
                pgItem.PinYinSuffix = "ZhiChengGangJia";
                pgItem.Price        = _addiInfo.prices[(byte)PGComponents.BracedFrame];
                if (pgItem.Price == 0.0)
                {
                    pgItem.IfDefinePrice = false;
                }
                else
                {
                    pgItem.IfDefinePrice = true;
                }
                for (int i = 0; i < floorNum; ++i)
                {
                    pgItem.Num[i] = num[i];
                }
                _PGItems.Add(pgItem);
            }
        }
Example #27
0
 private static void WriteIntoPG(string FGCode, string PGName, string PinYinSuffix, PGComponents PGComp, double areaBase)
 {
     int index;
     if (_dictionary.TryGetValue(FGCode + _direction.ToString(), out index))
     {
         _PGItems.ElementAt(index).Num[_floor_bottom] += _area / areaBase;
     }
     else
     {
         PGItem pgItem = new PGItem();
         pgItem.PGName = PGName;
         pgItem.PinYinSuffix = PinYinSuffix;
         pgItem.Code = FGCode;
         pgItem.direction = _direction;
         pgItem.Num[_floor_bottom] += ((byte)_finishType % 2 == 1 ? 1:2) * _area / areaBase;
         pgItem.Price = _addiInfo.prices[(byte)PGComp];
         if (pgItem.Price == 0.0) pgItem.IfDefinePrice = false;
         else pgItem.IfDefinePrice = true;
         _PGItems.Add(pgItem);
         _dictionary.Add(FGCode + _direction.ToString(), _PGItems.Count - 1);
     }
 }
Example #28
0
            public static void UpdateToPGs()
            {
                string FGCode = "C2011.0";
                int temp = ds_matl == 2 ? ds_joint - 2 : ds_joint;
                FGCode += ds_matl.ToString() + "1" + ConstSet.Alphabet[temp];

                int index;
                if (_dictionary.TryGetValue(FGCode + _direction.ToString(), out index))
                {
                    _PGItems.ElementAt(index).Num[_floor] += 1.0;
                }
                else
                {
                    PGItem pgItem = new PGItem();
                    pgItem.PGName = "楼梯";
                    pgItem.PinYinSuffix = "LouTi";
                    pgItem.Code = FGCode;
                    pgItem.direction = _direction;
                    pgItem.Num[_floor] += 1.0;
                    pgItem.Price = _addiInfo.prices[(byte)PGComponents.Stair];
                    if (pgItem.Price == 0.0) pgItem.IfDefinePrice = false;
                    else pgItem.IfDefinePrice = true;
                    _PGItems.Add(pgItem);
                    _dictionary.Add(FGCode + _direction.ToString(), _PGItems.Count - 1);
                }
            }
Example #29
0
            public static void UpdateToPGs()
            {
                //assert: all materials are valid
                if ((_pipeType == PipeType.SanitaryWater && (_material != _addiInfo.materialTypes[(byte)PGMaterialType.CastIron_FC] && _material != _addiInfo.materialTypes[(byte)PGMaterialType.CastIron_BSC])) ||
                    (_pipeType == PipeType.FireSprinkler && (_material != _addiInfo.materialTypes[(byte)PGMaterialType.ThreadedSteel] && _material != _addiInfo.materialTypes[(byte)PGMaterialType.VitaulicSteel])))
                {
                    _abandonWriter.WriteAbandonment(_pipe, AbandonmentTable.Pipe_TypeMateConflict);
                    return;
                }
                if (_pipeType == PipeType.SanitaryWater && _material == _addiInfo.materialTypes[(byte)PGMaterialType.CastIron_FC])
                {
                    if (_addiInfo.defaultSet[(byte)DefaultSet.Pipe_FragilityType] == 0)
                    {
                        _abandonWriter.WriteAbandonment(_pipe, AbandonmentTable.Pipe_MateFragConflict);
                        return;
                    }
                }
                if (_pipeType != PipeType.ColdWater &&
                    ((_material == _addiInfo.materialTypes[(byte)PGMaterialType.ThreadedSteel] && 2.5 < _diameter) ||
                     (_material == _addiInfo.materialTypes[(byte)PGMaterialType.WeldedSteel] && _diameter <= 2.5)))
                {
                    _abandonWriter.WriteAbandonment(_pipe, AbandonmentTable.Pipe_DiameterMateConflict);
                    return;
                }
                string FGCode = _typeMap[(byte)_pipeType];

                if (_pipeType == PipeType.ColdWater)
                {
                    if (_diameter <= 2.5)
                    {
                        _abandonWriter.WriteAbandonment(_pipe, AbandonmentTable.Pipe_DiameterOOR);
                        return;
                    }
                    else
                    {
                        FGCode += "1";
                    }
                }
                else
                {
                    if (_material == _addiInfo.materialTypes[(byte)PGMaterialType.ThreadedSteel])
                    {
                        FGCode += "1";
                    }
                    else if (_material == _addiInfo.materialTypes[(byte)PGMaterialType.VitaulicSteel])
                    {
                        FGCode += "1";
                    }
                    else if (_material == _addiInfo.materialTypes[(byte)PGMaterialType.WeldedSteel])
                    {
                        FGCode += "2";
                    }
                    else if (_material == _addiInfo.materialTypes[(byte)PGMaterialType.CastIron_FC])
                    {
                        FGCode += "1";
                    }
                    else if (_material == _addiInfo.materialTypes[(byte)PGMaterialType.CastIron_BSC])
                    {
                        FGCode += "2";
                    }
                }

                FGCode += (SDCConverter.Get4LevelIndex(_addiInfo.sdc) + 1).ToString();
                FGCode += ConstSet.Alphabet[_addiInfo.defaultSet[(byte)DefaultSet.Pipe_FragilityType]];
                int index_pipeType = (byte)_pipeType;

                int index;

                if (_dictionary.TryGetValue(FGCode, out index))
                {
                    _PGItems.ElementAt(index).Num[_floor] += _length / _lengthBase;
                }
                else
                {
                    PGItem pgItem = new PGItem();
                    pgItem.PGName       = _nameZH[index_pipeType];
                    pgItem.PinYinSuffix = _namePY[index_pipeType];
                    pgItem.Code         = FGCode;
                    pgItem.direction    = Direction.Undefined;
                    pgItem.Num[_floor] += _length / _lengthBase;
                    pgItem.Price        = _addiInfo.prices[(byte)PGComponents.Pipe];
                    if (pgItem.Price == 0.0)
                    {
                        pgItem.IfDefinePrice = false;
                    }
                    else
                    {
                        pgItem.IfDefinePrice = true;
                    }
                    _PGItems.Add(pgItem);
                    _dictionary.Add(FGCode, _PGItems.Count - 1);
                }
            }
Example #30
0
            public static void UpdateToPGs()
            {
                string FGCode = "D3041.";

                if (_addiInfo.defaultSet[(byte)DefaultSet.Duct_Material] == 0)
                {
                    FGCode += "01";
                }
                else
                {
                    FGCode += "02";
                }
                if (_area <= 6.0)
                {
                    FGCode += "1";
                }
                else
                {
                    FGCode += "2";
                }
                if (_addiInfo.sdc == SDC.A || _addiInfo.sdc == SDC.B)
                {
                    FGCode += "a";
                }
                else if (_addiInfo.sdc == SDC.C)
                {
                    FGCode += "b";
                }
                else if (_addiInfo.sdc == SDC.OSHPD)
                {
                    FGCode += "d";
                }
                else
                {
                    FGCode += "c";
                }

                int index;

                if (_dictionary.TryGetValue(FGCode, out index))
                {
                    _PGItems.ElementAt(index).Num[_floor] += _length / _lengthBase;
                }
                else
                {
                    PGItem pgItem = new PGItem();
                    pgItem.PGName       = "风管";
                    pgItem.PinYinSuffix = "FengGuan";
                    pgItem.Code         = FGCode;
                    pgItem.direction    = Direction.Undefined;
                    pgItem.Num[_floor] += _length / _lengthBase;
                    pgItem.Price        = _addiInfo.prices[(byte)PGComponents.Duct];
                    if (pgItem.Price == 0.0)
                    {
                        pgItem.IfDefinePrice = false;
                    }
                    else
                    {
                        pgItem.IfDefinePrice = true;
                    }
                    _PGItems.Add(pgItem);
                    _dictionary.Add(FGCode, _PGItems.Count - 1);
                }
            }
Example #31
0
            public static void UpdateToPGs()
            {
                if (_addiInfo.requiredComp[(byte)PGComponents.Ceiling])
                {
                    while (true)
                    {
                        string FGCode = "C3032.";
                        if (_addiInfo.defaultSet[(byte)DefaultSet.Ceiling_LateralSupport] == 0)     //w/o lat support
                        {
                            if (_addiInfo.sdc == SDC.A || _addiInfo.sdc == SDC.B)
                            {
                                FGCode += "001";
                            }
                            else if (_addiInfo.sdc == SDC.C)
                            {
                                FGCode += "002";
                            }
                            else
                            {
                                _abandonWriter.WriteAbandonment(_ceiling, AbandonmentTable.Ceiling_SDCConflictLatSupport);
                                break;
                            }
                        }
                        else
                        {
                            if (_addiInfo.sdc == SDC.A || _addiInfo.sdc == SDC.B || _addiInfo.sdc == SDC.C)
                            {
                                _abandonWriter.WriteAbandonment(_ceiling, AbandonmentTable.Ceiling_SDCConflictLatSupport);
                                break;
                            }
                            if (_addiInfo.defaultSet[(byte)DefaultSet.Ceiling_Ip] == 0)             //Ip = 1.0
                            {
                                if (_addiInfo.sdc == SDC.F)
                                {
                                    _abandonWriter.WriteAbandonment(_ceiling, AbandonmentTable.Ceiling_SDCConflictIp);
                                    break;
                                }
                                else
                                {
                                    FGCode += "003";
                                }
                            }
                            else
                            {
                                FGCode += "004";
                            }
                        }

                        if (_area < 250)
                        {
                            FGCode   += "a";
                            _areaBase = 250;
                        }
                        else if (250 < _area && _area < 1000)
                        {
                            FGCode   += "b";
                            _areaBase = 600;
                        }
                        else if (1000 < _area && _area < 2500)
                        {
                            FGCode   += "c";
                            _areaBase = 1800;
                        }
                        else
                        {
                            FGCode   += "d";
                            _areaBase = 2500;
                        }

                        int index;
                        if (_dictionary.TryGetValue(FGCode, out index))
                        {
                            _PGItems.ElementAt(index).Num[_floor] += _area / _areaBase;
                        }
                        else
                        {
                            PGItem pgItem = new PGItem();
                            pgItem.PGName       = "天花板";
                            pgItem.PinYinSuffix = "TianHuaBan";
                            pgItem.Code         = FGCode;
                            pgItem.direction    = Direction.Undefined;
                            pgItem.Num[_floor] += _area / _areaBase;
                            pgItem.Price        = _addiInfo.prices[(byte)PGComponents.Ceiling];
                            if (pgItem.Price == 0.0)
                            {
                                pgItem.IfDefinePrice = false;
                            }
                            else
                            {
                                pgItem.IfDefinePrice = true;
                            }
                            _PGItems.Add(pgItem);
                            _dictionary.Add(FGCode, _PGItems.Count - 1);
                        }
                        break;
                    }
                }

                if (_addiInfo.requiredComp[(byte)PGComponents.CeilingLighting])
                {
                    FilteredElementCollector lightingCollector = new FilteredElementCollector(_doc);
                    BoundingBoxXYZ           bbCeiling         = _ceiling.get_BoundingBox(_doc.ActiveView);
                    Outline ceilingOutline = new Outline(bbCeiling.Min, bbCeiling.Max);
                    BoundingBoxIntersectsFilter bbFilter       = new BoundingBoxIntersectsFilter(ceilingOutline);
                    ElementCategoryFilter       lightingFilter = new ElementCategoryFilter(BuiltInCategory.OST_LightingFixtures);
                    lightingCollector.WherePasses(bbFilter).WherePasses(lightingFilter);
                    int num_Rece = 0;
                    int num_Pend = 0;
                    foreach (Element lighting in lightingCollector)
                    {
                        BoundingBoxXYZ bbLighting = lighting.get_BoundingBox(_doc.ActiveView);
                        if (bbLighting.Max.Z - bbLighting.Min.Z < ErrorCtrl_Lighting)
                        {
                            ++num_Rece;
                            isFoundLighting[0] = true;
                        }
                        else
                        {
                            ++num_Pend;
                            isFoundLighting[1] = true;
                        }
                    }

                    _rece.Num[_floor] += num_Rece;
                    _pend.Num[_floor] += num_Pend;
                }
            }
Example #32
0
            public static void UpdateToPGs()
            {
                string FGCode = "D3041.";
                if (_addiInfo.defaultSet[(byte)DefaultSet.Duct_Material] == 0) FGCode += "01";
                else FGCode += "02";
                if (_area <= 6.0) FGCode += "1";
                else FGCode += "2";
                if (_addiInfo.sdc == SDC.A || _addiInfo.sdc == SDC.B) FGCode += "a";
                else if (_addiInfo.sdc == SDC.C) FGCode += "b";
                else if (_addiInfo.sdc == SDC.OSHPD) FGCode += "d";
                else FGCode += "c";

                int index;
                if (_dictionary.TryGetValue(FGCode, out index))
                {
                    _PGItems.ElementAt(index).Num[_floor] += _length / _lengthBase;
                }
                else
                {
                    PGItem pgItem = new PGItem();
                    pgItem.PGName = "风管";
                    pgItem.PinYinSuffix = "FengGuan";
                    pgItem.Code = FGCode;
                    pgItem.direction = Direction.Undefined;
                    pgItem.Num[_floor] += _length / _lengthBase;
                    pgItem.Price = _addiInfo.prices[(byte)PGComponents.Duct];
                    if (pgItem.Price == 0.0) pgItem.IfDefinePrice = false;
                    else pgItem.IfDefinePrice = true;
                    _PGItems.Add(pgItem);
                    _dictionary.Add(FGCode, _PGItems.Count - 1);
                }
            }
Example #33
0
            public static void UpdateToPGs()
            {
                int i = _floor_bottom + 1;
                int index;
                while (i <= _floor_top)
                {
                    string FGCode;
                    _floor_bottom = i - 1;
                    _height = _myLevel.GetElevation(i) - _myLevel.GetElevation(i - 1);
                    _area = _height * _length;
                    ++i;
                    if (!TryGetFGCode(out FGCode)) continue;
                    if (_dictionary.TryGetValue(FGCode + _direction.ToString(), out index))
                    {
                        _PGItems.ElementAt(index).Num[_floor_bottom] += _area / _areaBase;
                    }
                    else
                    {
                        PGItem pgItem = new PGItem();
                        pgItem.PGName = "砌体墙";
                        pgItem.PinYinSuffix = "QiTiQiang";
                        pgItem.Code = FGCode;
                        pgItem.direction = _direction;
                        pgItem.Num[_floor_bottom] += _area / _areaBase;
                        pgItem.Price = _addiInfo.prices[(byte)PGComponents.MasonryWall];
                        if (pgItem.Price == 0.0) pgItem.IfDefinePrice = false;
                        else pgItem.IfDefinePrice = true;
                        _PGItems.Add(pgItem);
                        _dictionary.Add(FGCode + _direction.ToString(), _PGItems.Count - 1);
                    }

                }
            }