Ejemplo n.º 1
0
 public Window(double width, double height, Climate climate, Pressures pressures)
 {
     Area            = width * height;
     Width           = width;
     Height          = height;
     Climate         = climate;
     Pressures       = pressures;
     AirResistanceRn = (1 / BreathabilityGn) * Math.Pow(Pressures.OutsideDeltaPMax / 10, (double)2 / 3);
 }
Ejemplo n.º 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)}");
        }
Ejemplo n.º 3
0
        public void Dispose()
        {
            if (Positions != null)
            {
                Positions.Release();
                Positions = null;
            }

            if (Densities != null)
            {
                Densities.Release();
                Densities = null;
            }

            if (Pressures != null)
            {
                Pressures.Release();
                Pressures = null;
            }

            CBUtility.Release(Predicted);
            CBUtility.Release(Velocities);
            CBUtility.Release(ref m_argsBuffer);
        }
Ejemplo n.º 4
0
        List <VoiceDef> CreateBar1()
        {
            List <VoiceDef> bar = new List <VoiceDef>();

            byte channel = 0;

            foreach (Palette palette in _palettes)
            {
                TrkDef trkDef = new TrkDef(channel, new List <IUniqueDef>());
                bar.Add(trkDef);
                WriteVoiceMidiDurationDefs1(trkDef, palette);
                ++channel;
            }

            InputVoiceDef inputVoiceDef     = new InputVoiceDef();
            VoiceDef      bottomOutputVoice = bar[0];

            foreach (IUniqueDef iud in bottomOutputVoice.UniqueDefs)
            {
                MidiChordDef mcd = iud as MidiChordDef;
                RestDef      rd  = iud as RestDef;
                if (mcd != null)
                {
                    List <IUniqueDef> iuds = new List <IUniqueDef>()
                    {
                        (IUniqueDef)mcd
                    };

                    // Note that the msPosition of the trkDef is trkDef.StartMsPosition (= iuds[0].msPosition),
                    // which may be greater than the InputChordDef's msPosition
                    TrkDef trkDef = new TrkDef(bottomOutputVoice.MidiChannel, iuds);

                    // If non-null, arg2 overrides the inputControls attached to the InputNote or InputChord.
                    TrkOn        trkRef  = new TrkOn(trkDef, null);
                    List <TrkOn> trkRefs = new List <TrkOn>()
                    {
                        trkRef
                    };
                    TrkOns trkOns = new TrkOns(trkRefs, null);

                    byte      displayPitch = (byte)(mcd.NotatedMidiPitches[0] + 36);
                    Pressure  pressure     = new Pressure(0, null);
                    Pressures pressures    = new Pressures(new List <Pressure>()
                    {
                        pressure
                    }, null);
                    TrkOff        trkOff         = new TrkOff(trkRef.TrkMidiChannel, mcd.MsPosition, null);
                    List <TrkOff> noteOffTrkOffs = new List <TrkOff>()
                    {
                        trkOff
                    };
                    TrkOffs trkOffs = new TrkOffs(noteOffTrkOffs, null);

                    InputNoteDef inputNoteDef = new InputNoteDef(displayPitch,
                                                                 trkOns, null,
                                                                 pressures,
                                                                 null, trkOffs,
                                                                 null);

                    List <InputNoteDef> inputNoteDefs = new List <InputNoteDef>()
                    {
                        inputNoteDef
                    };

                    // The InputChordDef's msPosition must be <= the msPosition of any of the contained trkRefs
                    InputChordDef icd = new InputChordDef(mcd.MsPosition, mcd.MsDuration, inputNoteDefs);

                    inputVoiceDef.UniqueDefs.Add(icd);
                }
                else if (rd != null)
                {
                    RestDef newRest = new RestDef(rd.MsPosition, rd.MsDuration);
                    inputVoiceDef.UniqueDefs.Add(newRest);
                }
            }

            #region set cascading inputControls on the first InputChordDef  (for testing)
            InputChordDef inputChordDef1 = inputVoiceDef.UniqueDefs[0] as InputChordDef;             // no need to check for null here.

            InputControls chordInputControls = new InputControls();

            chordInputControls.VelocityOption  = VelocityOption.overridden;
            chordInputControls.MinimumVelocity = 19;
            inputChordDef1.InputControls       = chordInputControls;

            InputControls noteInputControls = new InputControls();
            noteInputControls.VelocityOption              = VelocityOption.scaled;
            noteInputControls.MinimumVelocity             = 20;
            inputChordDef1.InputNoteDefs[0].InputControls = noteInputControls;

            #endregion

            bar.Add(inputVoiceDef);

            return(bar);
        }
Ejemplo n.º 5
0
        public static async Task Main(string[] args)
        {
            var builder = WebAssemblyHostBuilder.CreateDefault(args);

            builder.RootComponents.Add <App>("#app");
            builder.Services.AddScoped(
                sp => new HttpClient {
                BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)
            });
            //регистрация классов, которые относятся к расчёту ПОДПОР В ЛЕСТНИЧНУЮ КЛЕТКУ. Функциональность некоторых классов повторяется, но решено всё равно для каждого расчёта создавать свои классы чтобы избежать путаницы
            Climate1 climate1 = new Climate1(-25, 20, 2);
            Floors1  floors1  = new Floors1(1, 10);

            floors1.AddRange((1, 10), 3.1);
            DoorOutside        doorOutside        = new DoorOutside(1.4, 2.4);
            DoorInside         doorInside         = new DoorInside(1.1, 2.1, DoorInside.Type.Usual, climate1);
            Pressures          pressures          = new Pressures(floors1, climate1);
            Window             window             = new Window(1.8, 1, climate1, pressures);
            StairCase          stair              = new StairCase(16, StairCase.Portal.Straight, floors1, doorOutside, 1, doorInside, window);
            MethodsSupplyStair methodsSupplyStair = new MethodsSupplyStair(stair, climate1);

            builder.Services.AddSingleton(climate1);
            builder.Services.AddSingleton(floors1);
            builder.Services.AddSingleton(doorOutside);
            builder.Services.AddSingleton(doorInside);
            builder.Services.AddSingleton(pressures);
            builder.Services.AddSingleton(window);
            builder.Services.AddSingleton(stair);
            builder.Services.AddSingleton(methodsSupplyStair);
            //регистрация классов, которые относятся к расчёту ДЫМОУДАЛЕНИЕ ИЗ КОРИДОРОВ
            Climate2       climate2 = new Climate2(26, 26, 2);
            List <Opening> openings = new List <Opening>();
            Room           room     = new Room(25, 2.8, openings, 14, 400, climate2);
            DoorHall       doorHall = new DoorHall(1.1, 2.1, DoorHall.Type.Usual, climate2);
            Hall           hall     = new Hall(30, 15, 2.8, doorHall, room, climate2, BuildingType.Residential);
            Network        network  = new Network(1, 10, 0, climate2, hall);

            builder.Services.AddSingleton(climate2);
            builder.Services.AddSingleton(room);
            builder.Services.AddSingleton(doorHall);
            builder.Services.AddSingleton(hall);
            builder.Services.AddSingleton(network);
            //регистрация классов, которые относятся к расчёту ПОДПОР В ЛИФТ
            Climate3 climate3 = new Climate3(-25, 18, 2);
            Floors3  floors3  = new Floors3(1, 10);

            floors3.AddRange((1, 10), 3.2);
            ElevatorDoor elevatorDoor = new ElevatorDoor(1, 2);
            HallDoor     hallDoor     = new HallDoor(1.1, 2.1);
            Elevator     elevator     = new Elevator(floors3, 4, 5, elevatorDoor, hallDoor, climate3, false);

            builder.Services.AddSingleton(climate3);
            builder.Services.AddSingleton(floors3);
            builder.Services.AddSingleton(elevatorDoor);
            builder.Services.AddSingleton(hallDoor);
            builder.Services.AddSingleton(elevator);
            builder.Services.AddMatToaster(config =>
            {
                config.Position             = MatToastPosition.BottomRight;
                config.PreventDuplicates    = true;
                config.NewestOnTop          = true;
                config.ShowCloseButton      = true;
                config.MaximumOpacity       = 100;
                config.VisibleStateDuration = 4000;
            });
            builder.Services.AddClipboard();
            await builder.Build().RunAsync();
        }
Ejemplo n.º 6
0
 public void Update(double temperature, double humidity, double pressure)
 {
     Humidities.Add(humidity);
     Temperatures.Add(temperature);
     Pressures.Add(pressure);
 }