private static IDocumentationRow StandardTutorialRow(string rowName, string fileName) { string inputFile = Path.Combine(examples, "Tutorials", $"{fileName}.apsimx"); IDocumentationFile file = new DocsFromFile(inputFile, $"{fileName}.pdf", options); IDocumentationCell cell = new DocumentationCell(file); return(new DocumentationRow(rowName, cell.ToEnumerable())); }
private static IDocumentationRow SugarcaneRow() { IDocumentationFile cane = new DocsFromModel <Sugarcane>("Sugarcane.pdf", options); IDocumentationCell cell = new DocumentationCell(new[] { cane }); IDocumentationFile paramsFile = new ParamsDocsFromModel <Sugarcane>("Sugarcane-params.pdf", options); IDocumentationCell paramsCell = new DocumentationCell(paramsFile); return(new DocumentationRow("Sugarcane", new[] { cell, paramsCell })); }
private static IDocumentationRow CreateUnderReviewPlantRow(string modelName) { string validationFile = Path.Combine(underReview, modelName, $"{modelName}.apsimx"); string modelPath = $"[Replacements].{modelName}"; IDocumentationFile file = new DocsFromModelPath(validationFile, modelPath, $"{modelName}.pdf", options, true); IDocumentationCell cell = new DocumentationCell(new[] { file }); IDocumentationFile parameters = new ParamsDocsFromFile(validationFile, $"{modelName}-parameters.pdf", options, modelPath); IDocumentationCell paramsCell = new DocumentationCell(parameters); return(new DocumentationRow(modelName, new[] { cell, paramsCell })); }
private static IDocumentationRow StockRow() { string validationFile = Path.Combine(validation, "Stock", "Stock.apsimx"); IDocumentationFile paramsDoc = new ParamsDocsFromFile(validationFile, $"Stock-parameters.pdf", options, "[Supplement]"); IDocumentationCell paramsCell = new DocumentationCell(paramsDoc); IDocumentationFile grazPlanDoc = new ExternalDocument("GRAZPLAN Animal Biology Model", grazPlan); IDocumentationCell detailsCell = new DocumentationCell(grazPlanDoc); return(CustomDocsRow("Stock", validationFile.ToEnumerable(), "Stock.pdf", new [] { paramsCell, detailsCell })); }
private static IDocumentationRow ModelWithNoResourceRow(string modelName, IEnumerable <IDocumentationCell> extraCells = null) { string validationFile = Path.Combine(validation, modelName, $"{modelName}.apsimx"); IEnumerable <string> inputs = new string[1] { validationFile }; IDocumentationFile paramsDocs = new ParamsDocsFromFile(validationFile, $"{modelName}-params.pdf", options); IDocumentationCell paramsCell = new DocumentationCell(paramsDocs); extraCells = extraCells == null?paramsCell.ToEnumerable() : extraCells.Prepend(paramsCell); return(CustomDocsRow(modelName, inputs, $"{modelName}.pdf", extraCells)); }
private static IDocumentationRow SoilWaterDocs() { // This is almost like StandardPmfModelRow() except that the resource // file is WaterBalance.json rather than SoilWater.json. string modelName = "SoilWater"; string model = Path.Combine(resources, "WaterBalance.json"); string validationFile = Path.Combine(validation, modelName, $"{modelName}.apsimx"); IEnumerable <string> inputs = new string[2] { model, validationFile }; IDocumentationFile parameters = new ParamsDocsFromFile(validationFile, $"SoilWater-parameters.pdf", options); IDocumentationCell paramsCell = new DocumentationCell(parameters); return(CustomDocsRow("SoilWater", inputs, $"{modelName}.pdf", paramsCell.ToEnumerable())); }
private static IDocumentationRow AgPastureDocsRow(string name, string resourceFile, string validationFile, string outFile, bool documentSpeciesTable) { string speciesFile = Path.Combine(validation, "AgPasture", "SpeciesTable.apsimx"); IDocumentationFile speciesParams = new DocsFromFile(speciesFile, "SpeciesTable.pdf", options); IDocumentationFile scienceDocs = new ExternalDocument("Science Documentation", agpScience); List <IDocumentationFile> files = new List <IDocumentationFile>(); files.Add(scienceDocs); if (documentSpeciesTable) { files.Add(speciesParams); } IDocumentationCell detailsCells = new DocumentationCell(files); return(StandardDocsRow(name, resourceFile, validationFile, outFile, detailsCells.ToEnumerable())); }
private static IDocumentationRow MicroClimateRow() { IDocumentationCell scienceCell = new DocumentationCell(new ExternalDocument("Science Documentation", microClimateScience)); return(ModelWithNoResourceRow("MicroClimate", new[] { scienceCell })); }