private static void test22() { var g = new ElementGeometySlenderness() { b = 25, h = 25, izvijanje = Izvijanja.Pokretan_I_Ukljeste, d1 = 4, L = 400, }; var f = new ForcesSlenderness() { N = 85.725, M_top = 0, M_bottom = 0, }; var m = new Material() { beton = TabeleEC2.BetonClasses.GetBetonClassListEC().First(n => n.name == "C30/37"), armatura = ReinforcementType.GetArmatura().First(n => n.name == "B500B"), }; var v = new VitkostEC2_V2(g, f, m); v.Calculate(); v.KontrolaCentPritPreseka(); v.ProracunArmature(); }
private static void test12() { var g = new ElementGeometySlenderness() { b = 30, h = 40, izvijanje = Izvijanja.Ukljesten_Sa_Jedne, d1 = 4, L = 350, }; var f = new ForcesSlenderness() { N = 457.5, M_top = 20.25, //M_bottom = 50, }; var m = new Material() { beton = TabeleEC2.BetonClasses.GetBetonClassListEC().First(n => n.name == "C25/30"), armatura = ReinforcementType.GetArmatura().First(n => n.name == "B500B"), }; var v = new VitkostEC2_V2(g, f, m); //v.φ_ef = 3; v.Calculate(); v.KontrolaCentPritPreseka(); v.ProracunArmature(); }
public ActionResult PostIzracunaj([FromBody] VitkostModel model) { if (!ModelState.IsValid) { var allErrors = ModelState.Values.SelectMany(x => x.Errors); return(BadRequest( new { message = "Invalid model", error = allErrors.Select(x => x.ErrorMessage), modelExp = new VitkostModel() { Slenderness = "Ukljesten sa jedne", k = 2, N = 1620, M_top = -38.5, M_bottom = 38.5, L = 375, b = 30, h = 30, d1 = 4, armtype = "B500B", betonClass = "C25/30", result = null }, })); } try { var geo = new ElementGeometySlenderness() { b = model.b, h = model.h, d1 = model.d1, d2 = model.d1, L = model.L, k = model.k, unit = UnitDimesionType.cm }; var forces = new ForcesSlenderness(geo.li, geo.h) { NEd = model.N, M_bottom = model.M_bottom, M_top = model.M_top }; var beton = new BetonModelEC(model.betonClass); beton.ni = 0.85; var material = new Material() { beton = beton, armatura = ReinforcementType .GetArmatura() .Single(a => a.name == model.armtype) }; var v = new SlendernessEC2(geo, forces, material); v.Calculate(); v.KontrolaCentPritPreseka(); v.ProracunArmature(); model.result = v.ToString(); return(Ok(model)); } catch (System.Exception ex) { return(BadRequest(new { error = ex.Message })); } }