Closed HamishBrownPFR closed 5 years ago
How would the converter know which resource file to use for a given model?
Anything that is not under a replacements node?
I should say any plant model that is not under a replacement node. Not sure if this should extent to other types of models also.
I mean, the converter will need to replace the full XML structure of the released model with something like this:
<Plant>
<Name>Maize</Name>
<IncludeInDocumentation>true</IncludeInDocumentation>
<ResourceName>Maize</ResourceName>
<CropType>Maize</CropType>
</Plant>
Apsim uses the ResourceName
property to choose the xml file. In this case, it will look for a file at .../ApsimX/Models/Resources/Maize.xml
.
However, the converter will need to figure out which model it is looking at in order to choose the correct ResourceName for the file. We can't just use the name of the model, as the user can change this by renaming the model in the UI (or a text editor).
Use the
There is no Maize
element - do you mean the CropType
element?
Ahh. GitHub removed my xml tags that I had in the comment. I meant use the Name XML element.
Will do.
I have come across a few cases recently where simulations have the crops have full model configuration below them instead of using the released configuration. There was a bug at one stage that caused this. Should we write something into the converter so it strips out full configurations for released models and replaces them with the pointer to the released model