Ejemplo n.º 1
0
        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()));
        }
Ejemplo n.º 2
0
        private static IDocumentationRow ClemDocsRow()
        {
            string             clem                = Path.Combine(examples, "CLEM");
            string             croppingFile        = Path.Combine(clem, "CLEM_Example_Cropping.apsimx");
            string             grazingFile         = Path.Combine(clem, "CLEM_Example_Grazing.apsimx");
            IDocumentationFile scienceDocs         = new ExternalDocument("Science Documentation", "https://www.apsim.info/clem");
            IDocumentationFile croppingExample     = new DocsFromFile(croppingFile, "CLEM_Example_Cropping.pdf", options);
            IDocumentationFile grazingExample      = new DocsFromFile(grazingFile, "CLEM_Example_Grazing.pdf", options);
            IEnumerable <IDocumentationCell> cells = new IDocumentationCell[3]
            {
                new DocumentationCell(new[] { scienceDocs }),
                new DocumentationCell(new[] { croppingExample }),
                new DocumentationCell(new[] { grazingExample })
            };

            return(new DocumentationRow("CLEM", cells));
        }
Ejemplo n.º 3
0
        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()));
        }
Ejemplo n.º 4
0
        private static IDocumentationRow StandardDocsRow(string name, string modelResourceFile, string validationFile, string outFile, IEnumerable <IDocumentationCell> extraCells = null)
        {
            string model               = Path.Combine(resources, modelResourceFile);
            string validation          = Path.Combine(Program.validation, Path.GetFileNameWithoutExtension(validationFile), validationFile);
            IEnumerable <string> files = new string[2] {
                model, validation
            };

            string paramsFileName = $"{Path.GetFileNameWithoutExtension(outFile)}-parameters.pdf";

            IDocumentationFile autodoc = new DocsFromFile(files, outFile, options);
            IDocumentationFile param   = new ParamsDocsFromFile(model, paramsFileName, options);

            List <IDocumentationCell> cells = new List <IDocumentationCell>();

            cells.Add(new DocumentationCell(autodoc));
            cells.Add(new DocumentationCell(param));
            if (extraCells != null)
            {
                cells.AddRange(extraCells);
            }

            return(new DocumentationRow(name, cells));
        }