-
Notifications
You must be signed in to change notification settings - Fork 52
Description
We need a function in the C API to read a casefile from disk and populate the inputs for a run. The function should take the path to a valid WindNinja casefile as an argument. All the functions to prepare the ninjaArmy need to be called based on the casefile .cfg, e.g.,:
err = NinjaSetCommunication(ninjaArmy, i, comType, papszOptions);
err = NinjaSetNumberCPUs(ninjaArmy, i, nCPUs, papszOptions);
err = NinjaSetInitializationMethod(ninjaArmy, i, initializationMethod, papszOptions);
err = NinjaSetDem(ninjaArmy, i, demFile, papszOptions);
.
.
.
These setters already exist in the API.
Conversely we need an API function to generate a casefile based on the current settings. This function should call a series of getters that get the values set in the function mentioned above (e.g., all of the data needed to reproduce the case). A few of these getters exist in the API, but most will need to be written. Fortunately the ninja class already has a lot of them implemented, they just need to be exposed through NinjaArmy and the C API.
This way we have a single interface to read/write casefiles from the GUI, CLI and any other users of the C API.