#include "StructureCalculation/StrengthCalculation.h" namespace strength_set { nlohmann::json JsonSection::to_json(const Section &obj) { return { {"id", obj.Id()}, {"deck_node", obj.DeckNode()}, {"org_plate", obj.OrgPlate()}, {"deck_plate", obj.DeckPlate()}, {"bilge_plate", obj.BilgePlate()}, {"open_sec", obj.OpenSec().get()}, {"structure_sec_id", obj.StructureSecId().get()}}; } Section JsonSection::from_json(const nlohmann::json &j) { int id = j.at("id").get(); int deck_node = j.at("deck_node").get(); int org_plate = j.at("org_plate").get(); int deck_plate = j.at("deck_plate").get(); int bilge_plate = j.at("bilge_plate").get(); bool open_sec = j.at("open_sec").get(); long structure_sec_id = j.at("structure_sec_id").get(); Section obj(id, deck_node, org_plate, deck_plate, bilge_plate); obj.OpenSec(open_sec); obj.StructureSecId(structure_sec_id); return obj; } nlohmann::json JsonSecNode::to_json(const SecNode &obj) { return { {"id", obj.Id()}, {"sec_id", obj.SecId()}, {"gen_code", obj.GenCode().get()}, {"y", obj.Y()}, {"z", obj.Z()}, {"a", obj.A()}, {"structure_node_id", obj.StructureNodeId().get()}, {"structure_stiffener_id", obj.StructureStiffenerId().get()}}; } SecNode JsonSecNode::from_json(const nlohmann::json &j) { int id = j.at("id").get(); int sec_id = j.at("sec_id").get(); int gen_code = j.at("gen_code").get(); double y = j.at("y").get(); double z = j.at("z").get(); double a = j.at("a").get(); long structure_node_id = j.at("structure_node_id").get(); long structure_stiffener_id = j.at("structure_stiffener_id").get(); SecNode obj(id, sec_id, y, z, a); obj.GenCode(gen_code); obj.StructureNodeId(structure_node_id); obj.StructureStiffenerId(structure_stiffener_id); return obj; } nlohmann::json JsonSecPlate::to_json(const SecPlate &obj) { return { {"id", obj.Id()}, {"sec_id", obj.SecId()}, {"gen_code", obj.GenCode().get()}, {"node1", obj.Node1()}, {"node2", obj.Node2()}, {"t", obj.T()}, {"close_to_open", obj.CloseToOpen()}, {"structure_plate_id", obj.StructurePlateId().get()}, { "structure_stiffener_id", obj.StructureStiffenerId().get(), }}; } SecPlate JsonSecPlate::from_json(const nlohmann::json &j) { int id = j.at("id").get(); int sec_id = j.at("sec_id").get(); int gen_code = j.at("gen_code").get(); int node1 = j.at("node1").get(); int node2 = j.at("node2").get(); double t = j.at("t").get(); int close_to_open = j.at("close_to_open").get(); long structure_plate_id = j.at("structure_plate_id").get(); long structure_stiffener_id = j.at("structure_stiffener_id").get(); SecPlate obj(id, sec_id, node1, node2, t, close_to_open); obj.GenCode(gen_code); obj.StructurePlateId(structure_plate_id); obj.StructureStiffenerId(structure_stiffener_id); return obj; } nlohmann::json JsonSecOpenroom::to_json(const SecOpenroom &obj) { return { {"id", obj.Id()}, {"sec_id", obj.SecId()}, {"plate_count", obj.PlateCount()}, {"link_list", obj.LinkList()}}; } SecOpenroom JsonSecOpenroom::from_json(const nlohmann::json &j) { int id = j.at("id").get(); int sec_id = j.at("sec_id").get(); int plate_count = j.at("plate_count").get(); std::string link_list = j.at("link_list").get(); SecOpenroom obj(id, sec_id, plate_count, link_list); return obj; } nlohmann::json JsonSecCloseroom::to_json(const SecCloseroom &obj) { return { {"id", obj.Id()}, {"sec_id", obj.SecId()}, {"link_list", obj.LinkList()}}; } SecCloseroom JsonSecCloseroom::from_json(const nlohmann::json &j) { int id = j.at("id").get(); int sec_id = j.at("sec_id").get(); std::string link_list = j.at("link_list").get(); SecCloseroom obj(id, sec_id, link_list); return obj; } nlohmann::json JsonSecShell::to_json(const SecShell &obj) { return { {"sec_id", obj.SecId()}, {"id", obj.Id()}}; } SecShell JsonSecShell::from_json(const nlohmann::json &j) { int sec_id = j.at("sec_id").get(); int id = j.at("id").get(); SecShell obj(sec_id, id); return obj; } nlohmann::json JsonSubnode::to_json(const Subnode &obj) { return { {"id", obj.Id()}, {"x", obj.X()}, {"ux", obj.Ux()}, {"uy", obj.Uy()}, {"uz", obj.Uz()}, {"rx", obj.Rx()}, {"ry", obj.Ry()}, {"rz", obj.Rz()}, {"wx", obj.Wx()}, {"fr", obj.Fr().get()}}; } Subnode JsonSubnode::from_json(const nlohmann::json &j) { int id = j.at("id").get(); double x = j.at("x").get(); bool ux = j.at("ux").get(); bool uy = j.at("uy").get(); bool uz = j.at("uz").get(); bool rx = j.at("rx").get(); bool ry = j.at("ry").get(); bool rz = j.at("rz").get(); bool wx = j.at("wx").get(); Subnode obj(id, x, ux, uy, uz, rx, ry, rz, wx); return obj; } nlohmann::json JsonMat::to_json(const Mat &obj) { return { {"id", obj.Id()}, {"e", obj.E()}, {"mu", obj.Mu()}, {"ro", obj.Ro()}, {"re_h", obj.ReH()}, {"k", obj.K()}, {"re_hd", obj.ReHd().get()}, {"kd", obj.Kd().get()}, {"re_hb", obj.ReHb().get()}, {"kb", obj.Kb().get()}, {"re_hh", obj.ReHh().get()}, {"kh", obj.Kh().get()}}; } Mat JsonMat::from_json(const nlohmann::json &j) { int id = j.at("id").get(); double e = j.at("e").get(); double mu = j.at("mu").get(); double ro = j.at("ro").get(); double re_h = j.at("re_h").get(); double k = j.at("k").get(); Mat obj(id, e, mu, ro, re_h, k); return obj; } nlohmann::json JsonSubgirder::to_json(const Subgirder &obj) { return { {"id", obj.Id()}, {"sec_id", obj.SecId()}, {"node_i", obj.NodeI()}, {"node_j", obj.NodeJ()}, {"next_sec_id", obj.NextSecId()}, {"sym", obj.Sym()}, {"attach_id", obj.AttachId()}, {"mat_id", obj.MatId().get()}, {"fd", obj.Fd().get()}, {"fb", obj.Fb().get()}}; } Subgirder JsonSubgirder::from_json(const nlohmann::json &j) { int id = j.at("id").get(); int sec_id = j.at("sec_id").get(); int node_i = j.at("node_i").get(); int node_j = j.at("node_j").get(); int next_sec_id = j.at("next_sec_id").get(); bool sym = j.at("sym").get(); int attach_id = j.at("attach_id").get(); Subgirder obj(id, sec_id, node_i, node_j, next_sec_id, sym, attach_id); return obj; } nlohmann::json JsonAttach::to_json(const Attach &obj) { return { {"id", obj.Id()}, {"type", obj.Type()}, {"sec_node_id", obj.SecNodeId()}, {"width", obj.Width()}, {"height", obj.Height()}, {"t", obj.T()}, {"tw", obj.Tw()}, {"len", obj.Len()}, {"dist_i", obj.DistI()}}; } Attach JsonAttach::from_json(const nlohmann::json &j) { int id = j.at("id").get(); std::string type = j.at("type").get(); int sec_node_id = j.at("sec_node_id").get(); double width = j.at("width").get(); double height = j.at("height").get(); double t = j.at("t").get(); double tw = j.at("tw").get(); double len = j.at("len").get(); double dist_i = j.at("dist_i").get(); Attach obj(id, type, sec_node_id, width, height, t, tw, len, dist_i); return obj; } nlohmann::json JsonGirder::to_json(const Girder &obj) { return { {"subgirder_count", obj.SubgirderCount()}, {"sec_shear_correct", obj.SecShearCorrect()}, {"bh_aft_node_id", obj.BhAftNodeId()}, {"bh_for_node_id", obj.BhForNodeId()}, {"hatch_aft_node_id", obj.HatchAftNodeId()}, {"hatch_for_node_id", obj.HatchForNodeId()}, {"open_aft_node_id", obj.OpenAftNodeId()}, {"open_for_node_id", obj.OpenForNodeId()}}; } Girder JsonGirder::from_json(const nlohmann::json &j) { int subgirder_count = j.at("subgirder_count").get(); bool sec_shear_correct = j.at("sec_shear_correct").get(); int bh_aft_node_id = j.at("bh_aft_node_id").get(); int bh_for_node_id = j.at("bh_for_node_id").get(); int hatch_aft_node_id = j.at("hatch_aft_node_id").get(); bool hatch_for_node_id = j.at("hatch_for_node_id").get(); int open_aft_node_id = j.at("open_aft_node_id").get(); int open_for_node_id = j.at("open_for_node_id").get(); Girder obj(subgirder_count, sec_shear_correct, bh_aft_node_id, bh_for_node_id, hatch_aft_node_id, hatch_for_node_id, open_aft_node_id, open_for_node_id); return obj; } nlohmann::json JsonLoads::to_json(const Loads &obj) { return { {"buoy_type", obj.BuoyType()}, {"weight_type", obj.WeightType()}, {"zs", obj.Zs()}}; } Loads JsonLoads::from_json(const nlohmann::json &j) { std::string buoy_type = j.at("buoy_type").get(); std::string weight_type = j.at("weight_type").get(); double zs = j.at("zs").get(); Loads obj(buoy_type, weight_type, zs); return obj; } nlohmann::json JsonOffset::to_json(const Offset &obj) { return { {"id", obj.Id()}, {"st0", obj.St0()}, {"st1", obj.St1()}, {"st2", obj.St2()}, {"st3", obj.St3()}, {"st4", obj.St4()}, {"st5", obj.St5()}, {"st6", obj.St6()}, {"st7", obj.St7()}, {"st8", obj.St8()}, {"st9", obj.St9()}, {"st10", obj.St10()}, {"st11", obj.St11()}, {"st12", obj.St12()}, {"st13", obj.St13()}, {"st14", obj.St14()}, {"st15", obj.St15()}, {"st16", obj.St16()}, {"st17", obj.St17()}, {"st18", obj.St18()}, {"st19", obj.St19()}, {"st20", obj.St20()}}; } Offset JsonOffset::from_json(const nlohmann::json &j) { std::string id = j.at("id").get(); bool st0 = j.at("st0").get(); bool st1 = j.at("st1").get(); bool st2 = j.at("st2").get(); bool st3 = j.at("st3").get(); bool st4 = j.at("st4").get(); bool st5 = j.at("st5").get(); bool st6 = j.at("st6").get(); bool st7 = j.at("st7").get(); bool st8 = j.at("st8").get(); bool st9 = j.at("st9").get(); bool st10 = j.at("st10").get(); bool st11 = j.at("st11").get(); bool st12 = j.at("st12").get(); bool st13 = j.at("st13").get(); bool st14 = j.at("st14").get(); bool st15 = j.at("st15").get(); bool st16 = j.at("st16").get(); bool st17 = j.at("st17").get(); bool st18 = j.at("st18").get(); bool st19 = j.at("st19").get(); bool st20 = j.at("st20").get(); Offset obj(id, st0, st1, st2, st3, st4, st5, st6, st7, st8, st9, st10, st11, st12, st13, st14, st15, st16, st17, st18, st19, st20); return obj; } nlohmann::json JsonWL::to_json(const WL &obj) { return { {"id", obj.Id()}, {"height", obj.Height().get()}}; } WL JsonWL::from_json(const nlohmann::json &j) { std::string id = j.at("id").get(); WL obj(id); return obj; } nlohmann::json JsonBonjean::to_json(const Bonjean &obj) { return { {"id", obj.Id()}, {"st0", obj.St0()}, {"st1", obj.St1()}, {"st2", obj.St2()}, {"st3", obj.St3()}, {"st4", obj.St4()}, {"st5", obj.St5()}, {"st6", obj.St6()}, {"st7", obj.St7()}, {"st8", obj.St8()}, {"st9", obj.St9()}, {"st10", obj.St10()}, {"st11", obj.St11()}, {"st12", obj.St12()}, {"st13", obj.St13()}, {"st14", obj.St14()}, {"st15", obj.St15()}, {"st16", obj.St16()}, {"st17", obj.St17()}, {"st18", obj.St18()}, {"st19", obj.St19()}, {"st20", obj.St20()}}; } Bonjean JsonBonjean::from_json(const nlohmann::json &j) { std::string id = j.at("id").get(); bool st0 = j.at("st0").get(); bool st1 = j.at("st1").get(); bool st2 = j.at("st2").get(); bool st3 = j.at("st3").get(); bool st4 = j.at("st4").get(); bool st5 = j.at("st5").get(); bool st6 = j.at("st6").get(); bool st7 = j.at("st7").get(); bool st8 = j.at("st8").get(); bool st9 = j.at("st9").get(); bool st10 = j.at("st10").get(); bool st11 = j.at("st11").get(); bool st12 = j.at("st12").get(); bool st13 = j.at("st13").get(); bool st14 = j.at("st14").get(); bool st15 = j.at("st15").get(); bool st16 = j.at("st16").get(); bool st17 = j.at("st17").get(); bool st18 = j.at("st18").get(); bool st19 = j.at("st19").get(); bool st20 = j.at("st20").get(); Bonjean obj(id, st0, st1, st2, st3, st4, st5, st6, st7, st8, st9, st10, st11, st12, st13, st14, st15, st16, st17, st18, st19, st20); return obj; } nlohmann::json JsonKL::to_json(const KL &obj) { return { {"id", obj.Id()}, {"st0", obj.St0()}, {"st1", obj.St1()}, {"st2", obj.St2()}, {"st3", obj.St3()}, {"st4", obj.St4()}, {"st5", obj.St5()}, {"st6", obj.St6()}, {"st7", obj.St7()}, {"st8", obj.St8()}, {"st9", obj.St9()}, {"st10", obj.St10()}, {"st11", obj.St11()}, {"st12", obj.St12()}, {"st13", obj.St13()}, {"st14", obj.St14()}, {"st15", obj.St15()}, {"st16", obj.St16()}, {"st17", obj.St17()}, {"st18", obj.St18()}, {"st19", obj.St19()}, {"st20", obj.St20()}}; } KL JsonKL::from_json(const nlohmann::json &j) { std::string id = j.at("id").get(); bool st0 = j.at("st0").get(); bool st1 = j.at("st1").get(); bool st2 = j.at("st2").get(); bool st3 = j.at("st3").get(); bool st4 = j.at("st4").get(); bool st5 = j.at("st5").get(); bool st6 = j.at("st6").get(); bool st7 = j.at("st7").get(); bool st8 = j.at("st8").get(); bool st9 = j.at("st9").get(); bool st10 = j.at("st10").get(); bool st11 = j.at("st11").get(); bool st12 = j.at("st12").get(); bool st13 = j.at("st13").get(); bool st14 = j.at("st14").get(); bool st15 = j.at("st15").get(); bool st16 = j.at("st16").get(); bool st17 = j.at("st17").get(); bool st18 = j.at("st18").get(); bool st19 = j.at("st19").get(); bool st20 = j.at("st20").get(); KL obj(id, st0, st1, st2, st3, st4, st5, st6, st7, st8, st9, st10, st11, st12, st13, st14, st15, st16, st17, st18, st19, st20); return obj; } nlohmann::json JsonLoadCase::to_json(const LoadCase &obj) { return { {"id", obj.Id()}, {"type", obj.Type().get()}}; } LoadCase JsonLoadCase::from_json(const nlohmann::json &j) { std::string id = j.at("id").get(); LoadCase obj(id); return obj; } nlohmann::json JsonStWeight::to_json(const StWeight &obj) { return { {"case_id", obj.CaseId()}, {"st0", obj.St0()}, {"st1", obj.St1()}, {"st2", obj.St2()}, {"st3", obj.St3()}, {"st4", obj.St4()}, {"st5", obj.St5()}, {"st6", obj.St6()}, {"st7", obj.St7()}, {"st8", obj.St8()}, {"st9", obj.St9()}, {"st10", obj.St10()}, {"st11", obj.St11()}, {"st12", obj.St12()}, {"st13", obj.St13()}, {"st14", obj.St14()}, {"st15", obj.St15()}, {"st16", obj.St16()}, {"st17", obj.St17()}, {"st18", obj.St18()}, {"st19", obj.St19()}}; } StWeight JsonStWeight::from_json(const nlohmann::json &j) { std::string case_id = j.at("case_id").get(); bool st0 = j.at("st0").get(); bool st1 = j.at("st1").get(); bool st2 = j.at("st2").get(); bool st3 = j.at("st3").get(); bool st4 = j.at("st4").get(); bool st5 = j.at("st5").get(); bool st6 = j.at("st6").get(); bool st7 = j.at("st7").get(); bool st8 = j.at("st8").get(); bool st9 = j.at("st9").get(); bool st10 = j.at("st10").get(); bool st11 = j.at("st11").get(); bool st12 = j.at("st12").get(); bool st13 = j.at("st13").get(); bool st14 = j.at("st14").get(); bool st15 = j.at("st15").get(); bool st16 = j.at("st16").get(); bool st17 = j.at("st17").get(); bool st18 = j.at("st18").get(); bool st19 = j.at("st19").get(); StWeight obj(case_id, st0, st1, st2, st3, st4, st5, st6, st7, st8, st9, st10, st11, st12, st13, st14, st15, st16, st17, st18, st19); return obj; } nlohmann::json JsonItemWeight::to_json(const ItemWeight &obj) { return { {"case_id", obj.CaseId()}, {"name", obj.Name()}, {"weight", obj.Weight().get()}, {"xg", obj.Xg().get()}, {"x0", obj.X0().get()}, {"x1", obj.X1().get()}, }; } ItemWeight JsonItemWeight::from_json(const nlohmann::json &j) { std::string case_id = j.at("case_id").get(); std::string name = j.at("name").get(); ItemWeight obj(case_id, name); return obj; } nlohmann::json JsonMTC::to_json(const MTC &obj) { return { {"case_id", obj.CaseId()}, {"type", obj.Type().get()}, {"g", obj.G().get()}, {"b", obj.b().get()}, {"ns", obj.Ns().get()}, {"nt", obj.Nt().get()}}; } MTC JsonMTC::from_json(const nlohmann::json &j) { std::string case_id = j.at("case_id").get(); MTC obj(case_id); return obj; } nlohmann::json JsonLiftedCargo::to_json(const LiftedCargo &obj) { return { {"case_id", obj.CaseId()}, {"g", obj.G().get()}, {"a", obj.a().get()}, {"b", obj.b().get()}, {"hd", obj.Hd().get()}}; } LiftedCargo JsonLiftedCargo::from_json(const nlohmann::json &j) { std::string case_id = j.at("case_id").get(); LiftedCargo obj(case_id); return obj; } nlohmann::json JsonChkSubgirder::to_json(const ChkSubgirder &obj) { return { {"id", obj.Id()}, {"feature", obj.Feature()}, {"tos", obj.Tos()}, {"tis", obj.Tis()}, {"tcs", obj.Tcs()}, {"b", obj.B()}, {"frame", obj.Frame().get()}, {"tos_id", obj.TosId().get()}, {"tis_id", obj.TisId().get()}, {"tcs_id", obj.TcsId().get()}, {"a1", obj.A1().get()}, {"a2", obj.A2().get()}, {"d", obj.D().get()}}; } ChkSubgirder JsonChkSubgirder::from_json(const nlohmann::json &j) { int id = j.at("id").get(); std::string feature = j.at("feature").get(); double tos = j.at("tos").get(); double tis = j.at("tis").get(); double tcs = j.at("tcs").get(); double b = j.at("b").get(); ChkSubgirder obj(id, feature, tos, tis, tcs, b); return obj; } nlohmann::json JsonChkPlate::to_json(const ChkPlate &obj) { return { {"id", obj.Id()}, {"name", obj.Name()}, {"t", obj.T()}, {"lx", obj.Lx()}, {"kmat", obj.Kmat()}, {"re_h", obj.ReH()}, {"sec_plate_id", obj.SecPlateId().get()}, {"type_mat", obj.TypeMat().get()}, {"type", obj.Type().get()}, {"z", obj.Z().get()}, {"ly", obj.Ly().get()}, {"h", obj.H().get()}, {"k", obj.K().get()}, {"n_beam", obj.nBeam().get()}, {"u0", obj.u0().get()}, {"model_beam", obj.ModelBeam() ? obj.ModelBeam().get() : ""}, {"i_beam", obj.IBeam().get()}}; } ChkPlate JsonChkPlate::from_json(const nlohmann::json &j) { int id = j.at("id").get(); std::string name = j.at("name").get(); double t = j.at("t").get(); double lx = j.at("lx").get(); int kmat = j.at("kmat").get(); double re_h = j.at("re_h").get(); ChkPlate obj(id, name, t, lx, kmat, re_h); return obj; } nlohmann::json JsonChkLongitudinal::to_json(const ChkLongitudinal &obj) { return { {"id", obj.Id()}, {"name", obj.Name()}, {"l", obj.L()}, {"a", obj.A()}, {"i", obj.I()}, {"kmat", obj.Kmat()}, {"re_h", obj.ReH()}, {"sec_node_id", obj.SecNodeId().get()}, {"type_mat", obj.TypeMat() ? obj.TypeMat().get() : ""}, {"model", obj.Model().get()}, {"z", obj.Z().get()}, {"room_type", obj.RoomType() ? obj.RoomType().get() : ""}, {"attached_plate", obj.AttachedPlate() ? obj.AttachedPlate().get() : ""}}; } ChkLongitudinal JsonChkLongitudinal::from_json(const nlohmann::json &j) { int id = j.at("id").get(); std::string name = j.at("name").get(); double l = j.at("l").get(); double a = j.at("a").get(); double i = j.at("i").get(); int kmat = j.at("kmat").get(); double re_h = j.at("re_h").get(); ChkLongitudinal obj(id, name, l, a, i, kmat, re_h); return obj; } nlohmann::json JsonStaticLoad::to_json(const StaticLoad &obj) { return { {"case_id", obj.CaseId()}, {"type", obj.Type()}, {"st0", obj.St0()}, {"st1", obj.St1()}, {"st2", obj.St2()}, {"st3", obj.St3()}, {"st4", obj.St4()}, {"st5", obj.St5()}, {"st6", obj.St6()}, {"st7", obj.St7()}, {"st8", obj.St8()}, {"st9", obj.St9()}, {"st10", obj.St10()}, {"st11", obj.St11()}, {"st12", obj.St12()}, {"st13", obj.St13()}, {"st14", obj.St14()}, {"st15", obj.St15()}, {"st16", obj.St16()}, {"st17", obj.St17()}, {"st18", obj.St18()}, {"st19", obj.St19()}, {"st20", obj.St20()}}; } StaticLoad JsonStaticLoad::from_json(const nlohmann::json &j) { std::string case_id = j.at("case_id").get(); std::string type = j.at("type").get(); double st0 = j.at("st0").get(); double st1 = j.at("st1").get(); double st2 = j.at("st2").get(); double st3 = j.at("st3").get(); double st4 = j.at("st4").get(); double st5 = j.at("st5").get(); double st6 = j.at("st6").get(); double st7 = j.at("st7").get(); double st8 = j.at("st8").get(); double st9 = j.at("st9").get(); double st10 = j.at("st10").get(); double st11 = j.at("st11").get(); double st12 = j.at("st12").get(); double st13 = j.at("st13").get(); double st14 = j.at("st14").get(); double st15 = j.at("st15").get(); double st16 = j.at("st16").get(); double st17 = j.at("st17").get(); double st18 = j.at("st18").get(); double st19 = j.at("st19").get(); double st20 = j.at("st20").get(); StaticLoad obj(case_id, type, st0, st1, st2, st3, st4, st5, st6, st7, st8, st9, st10, st11, st12, st13, st14, st15, st16, st17, st18, st19, st20); return obj; } nlohmann::json JsonAllowLoad::to_json(const AllowLoad &obj) { return { {"case_id", obj.CaseId()}, {"type", obj.Type()}, {"st0", obj.St0()}, {"st1", obj.St1()}, {"st2", obj.St2()}, {"st3", obj.St3()}, {"st4", obj.St4()}, {"st5", obj.St5()}, {"st6", obj.St6()}, {"st7", obj.St7()}, {"st8", obj.St8()}, {"st9", obj.St9()}, {"st10", obj.St10()}, {"st11", obj.St11()}, {"st12", obj.St12()}, {"st13", obj.St13()}, {"st14", obj.St14()}, {"st15", obj.St15()}, {"st16", obj.St16()}, {"st17", obj.St17()}, {"st18", obj.St18()}, {"st19", obj.St19()}, {"st20", obj.St20()}}; } AllowLoad JsonAllowLoad::from_json(const nlohmann::json &j) { std::string case_id = j.at("case_id").get(); std::string type = j.at("type").get(); double st0 = j.at("st0").get(); double st1 = j.at("st1").get(); double st2 = j.at("st2").get(); double st3 = j.at("st3").get(); double st4 = j.at("st4").get(); double st5 = j.at("st5").get(); double st6 = j.at("st6").get(); double st7 = j.at("st7").get(); double st8 = j.at("st8").get(); double st9 = j.at("st9").get(); double st10 = j.at("st10").get(); double st11 = j.at("st11").get(); double st12 = j.at("st12").get(); double st13 = j.at("st13").get(); double st14 = j.at("st14").get(); double st15 = j.at("st15").get(); double st16 = j.at("st16").get(); double st17 = j.at("st17").get(); double st18 = j.at("st18").get(); double st19 = j.at("st19").get(); double st20 = j.at("st20").get(); AllowLoad obj(case_id, type, st0, st1, st2, st3, st4, st5, st6, st7, st8, st9, st10, st11, st12, st13, st14, st15, st16, st17, st18, st19, st20); return obj; } nlohmann::json JsonAddtionalLoad::to_json(const AddtionalLoad& obj) { return { {"case_id", obj.CaseId()}, {"st0", obj.St0()}, {"st1", obj.St1()}, {"st2", obj.St2()}, {"st3", obj.St3()}, {"st4", obj.St4()}, {"st5", obj.St5()}, {"st6", obj.St6()}, {"st7", obj.St7()}, {"st8", obj.St8()}, {"st9", obj.St9()}, {"st10", obj.St10()}, {"st11", obj.St11()}, {"st12", obj.St12()}, {"st13", obj.St13()}, {"st14", obj.St14()}, {"st15", obj.St16()}, {"st17", obj.St17()}, {"st18", obj.St18()}, {"st19", obj.St19()}, {"st20", obj.St20()}}; } AddtionalLoad JsonAddtionalLoad::from_json(const nlohmann::json &j) { std::string case_id = j.at("case_id").get(); double st0 = j.at("st0").get(); double st1 = j.at("st1").get(); double st2 = j.at("st2").get(); double st3 = j.at("st3").get(); double st4 = j.at("st4").get(); double st5 = j.at("st5").get(); double st6 = j.at("st6").get(); double st7 = j.at("st7").get(); double st8 = j.at("st8").get(); double st9 = j.at("st9").get(); double st10 = j.at("st10").get(); double st11 = j.at("st11").get(); double st12 = j.at("st12").get(); double st13 = j.at("st13").get(); double st14 = j.at("st14").get(); double st15 = j.at("st15").get(); double st16 = j.at("st16").get(); double st17 = j.at("st17").get(); double st18 = j.at("st18").get(); double st19 = j.at("st19").get(); double st20 = j.at("st20").get(); AddtionalLoad obj(case_id, st0, st1, st2, st3, st4, st5, st6, st7, st8, st9, st10, st11, st12, st13, st14, st15, st16, st17, st18, st19, st20); return obj; } nlohmann::json JsonProjectInfo::to_json(const ProjectInfo &obj) { return {}; } ProjectInfo JsonProjectInfo::from_json(const nlohmann::json &j) { ProjectInfo obj; return obj; } nlohmann::json JsonPub::to_json(const Pub &obj) { return { {"ship_type", obj.ShipType().get()}, {"nav_area", obj.NavArea().get()}, {"nav_reach", obj.NavReach().get()}, {"lpp", obj.Lpp().get()}, {"l", obj.L().get()}, {"b", obj.B().get()}, {"d", obj.D().get()}, {"dmax", obj.dmax().get()}, {"cb", obj.Cb().get()}, {"super_struct", obj.SuperStruct().get()}, {"double_deck", obj.DoubleDeck().get()}, {"a", obj.a().get()}, {"y", obj.y().get()}, {"yd", obj.yd().get()}, {"sigma_deck", obj.SigmaDeck().get()}, {"sigma_bottom", obj.SigmaBottom().get()}, {"open_type", obj.OpenType().get()}, {"hatch_coam", obj.HatchCoam().get()}, {"torsion", obj.Torsion().get()}, {"hatch_board", obj.HatchBoard().get()}, {"gama", obj.Gama().get()}, {"hatch_width", obj.HatchWidth().get()}, {"hatch_length", obj.HatchLength().get()}, {"bulkhead_space", obj.BulkheadSpace().get()}, {"lifted_cargo", obj.LiftedCargo().get()}, {"p", obj.P().get()}, {"l0", obj.l0().get()}, {"shore", obj.Shore().get()}, {"disp", obj.Disp().get()}, {"cargo_load", obj.CargoLoad().get()}, {"super_struct_coef", obj.SuperStructCoef().get()}, {"lh", obj.lH().get()}, {"self_nav", obj.SelfNav().get()}, {"cargo_roro", obj.CargoRORO().get()}, {"bulbous_bow", obj.BulbousBow().get()}}; } Pub JsonPub::from_json(const nlohmann::json &j) { Pub obj; return obj; } }