public void AFloorLevels()
 {
     counter++;
     try
     {
         if (ChipsFloors.Count() < counter)
         {
             counter = ChipsFloors.Count();
             Console.WriteLine($"counter : {counter}");
             Console.WriteLine($"chipses : {ChipsFloors.Count()}");
             if (ranges.First().Contains("-"))
             {
                 Floors.RemoveRange((Convert.ToInt32(ranges.First().Split("-")[0]), Convert.ToInt32(ranges.First().Split("-")[1])));
             }
             else
             {
                 Floors.RemoveSingle(Convert.ToInt32(ranges.First()));
             }
             ranges.Pop();
             foreach (var item in ranges)
             {
                 Console.WriteLine($"ranges: {item}");
             }
             return;
         }
         Console.WriteLine($"counter : {counter}");
         Console.WriteLine($"chipses : {ChipsFloors.Count()}");
         var    lch = ChipsFloors.Last();
         int    rangeStart, rangeEnd, single;
         double height;
         if (ChipsFloors.Last().Contains("-"))
         {
             rangeStart = Convert.ToInt32(lch.Split("-")[0]);
             rangeEnd   = Convert.ToInt32(lch.Split(";")[0].Split("-")[1]);
             height     = Convert.ToDouble(lch.Split(";")[1]);
             Floors.AddRange((rangeStart, rangeEnd), height);
             ranges.Push(lch.Split(";")[0]);
         }
         else
         {
             single = Convert.ToInt32(lch.Split(";")[0]);
             height = Convert.ToDouble(lch.Split(";")[1]);
             Floors.AddSingle(single, height);
             ranges.Push(lch.Split(";")[0]);
         }
         foreach (var item in ranges)
         {
             Console.WriteLine($"ranges: {item}");
         }
     }
     catch (Exception e)
     {
         Console.WriteLine($"{e.Message}");
         Toaster.Add(e.Message, MatToastType.Danger);
     }
 }
Example #2
0
        static void Main(string[] args)
        {
            Climate climate = new Climate(-25, 20, 2);
            Floors  floors  = new Floors(1, 16, 1);

            floors.AddSingle(1, 5);
            floors.AddRange((2, 16), 3);
            Pressures pressures = new Pressures(floors, climate);

            Console.WriteLine($"ROOF LEVEL : {floors.RoofFloorLevel}");
            Console.WriteLine($"PRESSURE OUTSIDE MAX : {pressures.OutsideDeltaPMax}");
            Window window = new Window(1.8, 1, climate, pressures);

            Console.WriteLine($"WINDOW AREA : {window.Area}");
            DoorOutside doorO = new DoorOutside(1.36, 2.4);
            DoorInside  doorI = new DoorInside(1.1, 2.1, 196000);
            StairCase   stair = new StairCase(16, StairCase.Portal.Straight, floors, doorO, 1, doorI, window);

            MethodsSupplyStair meth = new MethodsSupplyStair(stair, climate);

            meth.CompCollect();
            Console.WriteLine($"Pwind : {meth.Pwind}");
            Console.WriteLine($"Ps2 : {meth.Ps2_23}");
            Console.WriteLine($"Gsa : {meth.Gsa_24}");
            Console.WriteLine($"Door smoke resistance : {doorI.SmokeResistance}");
            Console.WriteLine($"---------------------------------");
            var results = meth.EachFloorResults.OrderByDescending(x => x.LevelKey);

            foreach (var item in results)
            {
                var lk   = String.Format("{0:0.##}", item.LevelKey);
                var v    = String.Format("{0:0.##}", item.V);
                var p    = String.Format("{0:0.##}", item.P);
                var gsd  = String.Format("{0:0.##}", item.Gsd);
                var gsw  = String.Format("{0:0.##}", item.Gsw);
                var gsum = String.Format("{0:0.##}", item.Gsum);

                Console.WriteLine($"{lk}  |  {item.LevelValue}  |  {v}  |  {p}  |  {gsd}  |  {gsw}  |  {gsum}");
            }
            Console.WriteLine("-----------------");
            Console.WriteLine($"Fan capacity : {Math.Round(meth.Lv)}");
        }