예제 #1
0
파일: Program.cs 프로젝트: lie112/ApsimX
        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()));
        }
예제 #2
0
파일: Program.cs 프로젝트: lie112/ApsimX
        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));
        }
예제 #3
0
파일: Program.cs 프로젝트: lie112/ApsimX
        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()));
        }
예제 #4
0
파일: Program.cs 프로젝트: lie112/ApsimX
        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));
        }