public void RectangularSection_Initialization_and_Basic_Properties_Check()
        {
            double width  = 0.375;
            double height = 1.5;

            RectangularSection section = new RectangularSection(width, height);

            Assert.AreEqual(0.5625, section.A_g, 0.0001);
            Assert.AreEqual(0, section.CentroidOffset_22, 0.0001);
            Assert.AreEqual(0, section.CentroidOffset_33, 0.0001);
            Assert.AreEqual(0.1055, section.I_major, 0.0001);
            Assert.AreEqual(0.0066, section.I_minor, 0.0001);
            Assert.AreEqual(0, section.I_product, 0.0001);
            Assert.AreEqual(0.4330, section.r_major, 0.0001);
            Assert.AreEqual(0.1083, section.r_minor, 0.0001);
            Assert.AreEqual(0.1406, section.S_majorPositive, 0.0001);
            Assert.AreEqual(0.1406, section.S_majorNegative, 0.0001);
            Assert.AreEqual(0.0352, section.S_minorPositive, 0.0001);
            Assert.AreEqual(0.0352, section.S_minorNegative, 0.0001);
            Assert.AreEqual(0, section.PlasticCentroidOffset_major, 0.0001);
            Assert.AreEqual(0, section.PlasticCentroidOffset_minor, 0.0001);
            Assert.AreEqual(0.2109, section.Z_major, 0.0001);
            Assert.AreEqual(0.0527, section.Z_minor, 0.0001);
            Assert.AreEqual(0.5625, section.A_vMajor, 0.0001);
            Assert.AreEqual(0.5625, section.A_vMinor, 0.0001);
            Assert.AreEqual(0, section.ShearCenterOffset_major, 0.0001);
            Assert.AreEqual(0, section.ShearCenterOffset_minor, 0.0001);
            Assert.AreEqual(0.4463, section.r_o, 0.0001);
            Assert.AreEqual(1, section.H, 0.0001);
            Assert.AreEqual(0.0222, section.J, 0.0001);
            Assert.AreEqual(0, section.C_w, 0.0001);
        }
Esempio n. 2
0
 public RectangularSectionViewModel()
 {
     _RectangularSection    = new RectangularSection(0, 0, 0, 0, 0, 0, Reinforcement.Pojedyncze);
     RectangularSectionList = rectangularSectionList;
     CalculateAndAddCommand = new CalculateAndAddCommand(this);
     DeleteItemCommand      = new DeleteCommand(this);
     ClearListItemsCommand  = new ClearListItemsCommand(this);
 }
Esempio n. 3
0
        public void SectionBrushChanged()
        {
            var section = new RectangularSection
            {
                Fill = new SolidColorPaint()
            };

            var chart = new TestCartesianChartView
            {
                Series = new List <ISeries>
                {
                    new LineSeries <int> {
                        Values = new List <int> {
                            1, 6, 4, 2
                        }
                    },
                },
                XAxes    = new[] { new Axis() },
                YAxes    = new[] { new Axis() },
                Sections = new[] { section }
            };

            var canvas = chart.CoreCanvas;

            void DrawChart()
            {
                while (!canvas.IsValid)
                {
                    canvas.DrawFrame(
                        new SkiaSharpDrawingContext(
                            canvas,
                            new SKImageInfo(100, 100),
                            SKSurface.CreateNull(100, 100),
                            new SKCanvas(new SKBitmap())));
                }
            }

            chart.Core.Update(new ChartUpdateParams {
                Throttling = false
            });
            DrawChart();

            var drawables  = canvas.DrawablesCount;
            var geometries = canvas.CountGeometries();

            section.Fill = new SolidColorPaint();

            chart.Core.Update(new ChartUpdateParams {
                Throttling = false
            });
            DrawChart();

            Assert.IsTrue(
                drawables == canvas.DrawablesCount &&
                geometries == canvas.CountGeometries());
        }
        public RcRectangularSection(RectangularSection Section, Concrete Concrete, Steel Steel, List <ReinforcingBar> ReinforcingBars)
        {
            this.Section         = Section;
            this.Concrete        = Concrete;
            this.Steel           = Steel;
            this.ReinforcingBars = ReinforcingBars;

            balancedCondition       = new BalancedCondition(Concrete, Steel, Section.b, Section.d);
            serviceabilityCondition = new ServiceabilityCondition(Concrete, Steel, Section.b, Section.d);
            cMax = ReinforcingBars.Max(bar => bar.di);
            //cMax = 0.90 * Section.h;
        }
Esempio n. 5
0
        public void CalculateAndAdd()
        {
            RectangularSection Rect = new RectangularSection(
                RectangularSection.Height,
                RectangularSection.Width,
                RectangularSection.Cover,
                RectangularSection.BarDiameter,
                RectangularSection.BarCount,
                RectangularSection.BendingMoment,
                RectangularSection.tensionReinforcement);

            rectangularSectionList.Add(Rect);
        }
        public void RectangularPropertiesCheck_Boundary_Returns_Coordinates_of_Shape_Boundary()
        {
            double width  = 0.375;
            double height = 1.5;

            RectangularSection          section  = new RectangularSection(width, height);
            IList <CartesianCoordinate> boundary = section.Boundary;

            Assert.AreEqual(width / 2, boundary[0].X);
            Assert.AreEqual(height / 2, boundary[0].Y);
            Assert.AreEqual(-width / 2, boundary[1].X);
            Assert.AreEqual(height / 2, boundary[1].Y);
            Assert.AreEqual(-width / 2, boundary[2].X);
            Assert.AreEqual(-height / 2, boundary[2].Y);
            Assert.AreEqual(width / 2, boundary[3].X);
            Assert.AreEqual(-height / 2, boundary[3].Y);
        }
Esempio n. 7
0
        public ISection Execute(IList <string> parameters)
        {
            double height;
            double width;

            try
            {
                height = double.Parse(parameters[0]);
                width  = double.Parse(parameters[1]);
            }
            catch
            {
                throw new ArgumentException("Failed to parse Rectangular command parameters.");
            }

            ISection frameSection = new RectangularSection(height, width);

            return(frameSection);
        }
Esempio n. 8
0
        public override Canal Convert(CanalConfiguration configuration)
        {
            Canal data = new Canal();

            data.Id = configuration.ConfigId;

            foreach (CanalNode node in configuration.Nodes)
            {
                if (node is SluiceGateNode sluiceGateNode)
                {
                    data.CanelEdges.Add(new SluiceCanalEdge()
                    {
                        Id                     = sluiceGateNode.NodeId,
                        WaterLevel             = sluiceGateNode.WaterLevel,
                        ContractionCoefficient = sluiceGateNode.ContractionCoefficient,
                        RetainedWaterLevel     = sluiceGateNode.RetainedWaterLevel,
                        GateOpening            = sluiceGateNode.GateOpening,
                        GateWidth              = sluiceGateNode.GateWidth
                    });
                }
                else
                {
                    data.CanelEdges.Add(new CanalEdge()
                    {
                        Id         = node.NodeId,
                        WaterLevel = node.WaterLevel
                    });
                }
            }

            foreach (CanalArrow arrow in configuration.Arrows)
            {
                CanalSection canalSection;

                if (arrow.CanalSection is RectangularSectionConfiguration rectangularSection)
                {
                    canalSection = new RectangularSection(rectangularSection.Width, rectangularSection.Roughness, rectangularSection.Slope);
                }
                else if (arrow.CanalSection is TrapezoidalSectionConfiguration trapezoidalSection)
                {
                    canalSection = new RectangularSection(trapezoidalSection.Width, trapezoidalSection.Roughness, trapezoidalSection.Slope);
                }
                else
                {
                    throw new ArgumentException($"Canal section for arrow {arrow.ArrowId} is not valid.");
                }

                ICanalEdge fromNode = data.CanelEdges.Single(ce => ce.Id == arrow.FromNodeId);
                ICanalEdge toNode   = data.CanelEdges.Single(ce => ce.Id == arrow.ToNodeId);

                data.CanalStretches.Add(new CanalStretch()
                {
                    Length       = arrow.Length,
                    Flow         = arrow.Flow,
                    CanalSection = canalSection,
                    FromNode     = fromNode,
                    ToNode       = toNode,
                    Id           = arrow.ArrowId
                });
            }

            return(data);
        }