示例#1
0
 /// <summary>
 /// Upgrades to version 57. Adds a RetranslocateNonStructural node to
 /// all GenericOrgans which do not have a child called
 /// RetranslocateNitrogen.
 /// </summary>
 /// <param name="root">The root JSON token.</param>
 /// <param name="fileName">The name of the apsimx file.</param>
 private static void UpgradeToVersion57(JObject root, string fileName)
 {
     foreach (JObject organ in JsonUtilities.ChildrenRecursively(root, "GenericOrgan"))
     {
         if (JsonUtilities.ChildWithName(organ, "RetranslocateNitrogen") == null)
         {
             JsonUtilities.AddModel(organ, typeof(RetranslocateNonStructural), "RetranslocateNitrogen");
         }
     }
 }