/*! \brief This function load all the products wich are in <Products> fields and store them in an ActiveTransportProprieties. \param node The XmlNode corresponding to <Products> </Products>. \param AT The ActiveTransportProprieties where to store the products \return Return true always (not really usefull) */ private bool loadActiveTransportReactionProducts(XmlNode node, ActiveTransportProprieties AT) { AT.products = new LinkedList<Product>(); foreach (XmlNode attr in node) { if (attr.Name == "name") { if (String.IsNullOrEmpty(attr.InnerText)) Debug.Log("Warning : Empty name field in ActiveTransport Reaction definition"); Product prod = new Product(); prod.setName(node.InnerText); AT.products.AddLast(prod); } } return true; }
/*! \brief Load all the attributes of an ActiveTransportProprieties. \return The ActiveTransportProprieties object corresponding to the reaction describe in the node. \param node The XmlNode corresponding to the <ATProp> </ATProp> node. */ private ActiveTransportProprieties loadActiveTransportProprieties(XmlNode node) { ActiveTransportProprieties prop = new ActiveTransportProprieties(); foreach (XmlNode attr in node) { switch (attr.Name) { case "name": prop.name = checkActiveTransportString(attr.InnerText); break; case "substrate": prop.substrate = checkActiveTransportString(attr.InnerText); break; case "enzyme": prop.enzyme = checkActiveTransportString(attr.InnerText); break; case "Kcat": prop.Kcat = checkActiveTransportFloat(attr.InnerText); break; case "effector": prop.effector = checkActiveTransportString(attr.InnerText); break; case "alpha": prop.alpha = checkActiveTransportFloat(attr.InnerText); break; case "beta": prop.beta = checkActiveTransportFloat(attr.InnerText); break; case "Km": prop.Km = checkActiveTransportFloat(attr.InnerText); break; case "Ki": prop.Ki = checkActiveTransportFloat(attr.InnerText); break; case "MediumSrc": prop.srcMediumId = checkActiveTransportInt(attr.InnerText); break; case "MediumDst": prop.dstMediumId = checkActiveTransportInt(attr.InnerText); break; case "Products": loadActiveTransportReactionProducts(attr, prop); break; } } return prop; }