Ejemplo n.º 1
0
 public PopulationPKAnalysesTeXBuilder(IPKAnalysesTask pkAnalysisTask, ITeXBuilderRepository builderRepository,
                                       IPopulationPKAnalysisToDataTableMapper pkAnalysisToDataTableMapper, IPresentationSettingsTask presentationSettingsTask, IDisplayUnitRetriever displayUnitRetriever) : base(presentationSettingsTask, displayUnitRetriever)
 {
     _pkAnalysisTask              = pkAnalysisTask;
     _builderRepository           = builderRepository;
     _pkAnalysisToDataTableMapper = pkAnalysisToDataTableMapper;
 }
Ejemplo n.º 2
0
 public CompoundTeXBuilder(ITeXBuilderRepository builderRepository, IReportGenerator reportGenerator, ILazyLoadTask lazyLoadTask,
                           IRepresentationInfoRepository representationRepository, ICompoundAlternativeTask compoundAlternativeTask)
     : base(builderRepository, reportGenerator, lazyLoadTask)
 {
     _representationRepository = representationRepository;
     _compoundAlternativeTask  = compoundAlternativeTask;
 }
Ejemplo n.º 3
0
 public ObservedDataTeXBuilder(
     IReportGenerator reportGenerator,
     IDataRepositoryExportTask dataRepositoryTask,
     ITeXBuilderRepository builderRepository)
 {
     _reportGenerator    = reportGenerator;
     _dataRepositoryTask = dataRepositoryTask;
     _builderRepository  = builderRepository;
 }
Ejemplo n.º 4
0
 public ReportCreator(ITeXBuilderRepository builderRepository, IReportCompiler reportCompiler, IBuildTrackerFactory buildTrackerFactory,
                      IArtifactsManager artifactsManager, IEventPublisher eventPublisher)
 {
     _builderRepository   = builderRepository;
     _reportCompiler      = reportCompiler;
     _buildTrackerFactory = buildTrackerFactory;
     _artifactsManager    = artifactsManager;
     _eventPublisher      = eventPublisher;
 }
Ejemplo n.º 5
0
 public IndividualPKAnalysesTeXBuilder(IGlobalPKAnalysisTask globalPKAnalysisTask,
                                       IPKAnalysesTask pkAnalysisTask, ITeXBuilderRepository builderRepository, IGlobalPKAnalysisToDataTableMapper globalPKAnalysisToDataTableMapper,
                                       IIndividualPKAnalysisToDataTableMapper pkAnalysisToDataTableMapper, IPresentationSettingsTask presentationSettingsTask, IDisplayUnitRetriever displayUnitRetriever) : base(presentationSettingsTask, displayUnitRetriever)
 {
     _globalPKAnalysisTask = globalPKAnalysisTask;
     _pkAnalysisTask       = pkAnalysisTask;
     _builderRepository    = builderRepository;
     _globalPKAnalysisToDataTableMapper = globalPKAnalysisToDataTableMapper;
     _pkAnalysisToDataTableMapper       = pkAnalysisToDataTableMapper;
 }
Ejemplo n.º 6
0
        /// <summary>
        ///    This method generates a simple table without caption and label from a given data view object.
        /// </summary>
        /// <param name="data">Data to be shown in table.</param>
        /// <param name="converter">Tex converter.</param>
        /// <param name="builderRepository">Repository builder needed to get chunks of tex objects.</param>
        /// <returns>TEX Chunk.</returns>
        public static string SimpleTable(DataView data, ITeXConverter converter, ITeXBuilderRepository builderRepository)
        {
            if (data.Count == 0)
            {
                return(String.Empty);
            }

            var hasNotes   = HasNotes(data.Table);
            var tableNotes = getTableNotes(data);
            var header     = longTableHeader(data, tableNotes, converter);

            return(createTable(data, converter, builderRepository, hasNotes, header, tableNotes));
        }
Ejemplo n.º 7
0
        private static string createTable(DataView data, ITeXConverter converter, ITeXBuilderRepository builderRepository, bool hasNotes, string header, Dictionary <string, char> tableNotes, int spaceNeeded = 6, string caption = null, string label = null)
        {
            var tex = new StringBuilder();

            //if the available space is less than 6 lines the table starts on next page to avoid page breaks for with no lines.
            tex.Append(Helper.Needspace(Helper.BaseLineSkip(spaceNeeded)));
            tex.Append(Helper.Begin(Helper.Environments.center));
            tex.Append(arrayStretch(ARRAY_STRETCH));

            if (hasNotes)
            {
                tex.Append(Helper.Begin(Helper.Environments.ThreePartTable));
            }

            tex.Append(Helper.Begin(Helper.Environments.longtabu));
            tex.AppendFormat(" to {0}\\linewidth", TABLE_WIDTH);
            tex.Append(createColumnDesign(data));

            //Create header
            tex.Append(header);

            // rows
            tex.Append(createRows(data, tableNotes, converter, builderRepository));
            tex.Append(HLine());

            if (caption != null)
            {
                tex.Append(Helper.Caption(caption));
                tex.Append(Helper.Label(label));
                tex.Append(Helper.LineBreak());
            }

            tex.Append(Helper.End(Helper.Environments.longtabu));

            if (caption == null)
            {
                //the longtable package always increases the table counter. If no caption is set that is not wanted.
                tex.Append(decreaseTableCounter());
            }

            if (hasNotes)
            {
                tex.Append(TableWriter.tableNotes(tableNotes, converter));
                tex.Append(Helper.End(Helper.Environments.ThreePartTable));
            }

            tex.Append(Helper.End(Helper.Environments.center));
            return(tex.ToString());
        }
        protected override void Context()
        {
            _pdfReportFullPath   = string.Empty;
            _reportSettings      = A.Fake <ReportSettings>();
            _buildSettings       = new BuildSettings();
            _builderRepository   = A.Fake <ITeXBuilderRepository>();
            _reportCompiler      = A.Fake <IReportCompiler>();
            _buildTrackerFactory = A.Fake <IBuildTrackerFactory>();
            _artifactsManager    = A.Fake <IArtifactsManager>();
            _eventPublisher      = A.Fake <IEventPublisher>();
            var task = Task.Run(() => { });

            A.CallTo(_reportCompiler).WithReturnType <Task>().Returns(task);
            sut = new ReportCreator(_builderRepository, _reportCompiler, _buildTrackerFactory, _artifactsManager, _eventPublisher);
        }
 public NeighborhoodBuilderTEXBuilder(ITeXBuilderRepository builderRepository)
 {
     _builderRepository = builderRepository;
 }
Ejemplo n.º 10
0
 public ExplicitFormulaTEXBuilder(ITeXBuilderRepository builderRepository)
 {
     _builderRepository = builderRepository;
 }
 public SideBySideTeXBuilder(ITeXBuilderRepository builderRepository)
 {
     _builderRepository = builderRepository;
 }
Ejemplo n.º 12
0
        private static string createRows(DataView data, Dictionary <string, char> tableNotes, ITeXConverter converter, ITeXBuilderRepository builderRepository, DataRelation relation = null, int?level = null)
        {
            var tex = new StringBuilder();

            foreach (DataRowView row in data)
            {
                tex.Append(createRow(row, tableNotes, converter, builderRepository, relation, level));
            }
            tex.Append(phantomline());
            return(tex.ToString());
        }
Ejemplo n.º 13
0
 protected IndividualMoleculeTEXBuilder(ITeXBuilderRepository builderRepository, IRepresentationInfoRepository representationInfoRepository)
 {
     _builderRepository            = builderRepository;
     _representationInfoRepository = representationInfoRepository;
     _formatter = new PercentFormatter();
 }
Ejemplo n.º 14
0
 public SimulationAnalysesTeXBuilder(ITeXBuilderRepository builderRepository)
 {
     _builderRepository = builderRepository;
 }
 public LogNormalDistributionFormulaTEXBuilder(ITeXBuilderRepository builderRepository)
 {
     _builderRepository = builderRepository;
 }
Ejemplo n.º 16
0
 public DiscreteDistributionFormulaTEXBuilder(ITeXBuilderRepository builderRepository)
 {
     _builderRepository = builderRepository;
 }
Ejemplo n.º 17
0
 public SimpleProtocolTeXBuilder(ITeXBuilderRepository builderRepository, IReportGenerator reportGenerator, ILazyLoadTask lazyLoadTask) : base(builderRepository, reportGenerator, lazyLoadTask)
 {
 }
Ejemplo n.º 18
0
 public CompoundProcessTeXBuilder(ITeXBuilderRepository builderRepository, IRepresentationInfoRepository representationInfoRepository) : base(builderRepository, representationInfoRepository)
 {
 }
 public IndividualTransporterTeXBuilder(ITeXBuilderRepository builderRepository, IRepresentationInfoRepository representationInfoRepository)
     : base(builderRepository, representationInfoRepository)
 {
 }
Ejemplo n.º 20
0
 protected CompoundProcessTEXBuilder(ITeXBuilderRepository builderRepository, IRepresentationInfoRepository representationInfoRepository)
 {
     _builderRepository            = builderRepository;
     _representationInfoRepository = representationInfoRepository;
 }
Ejemplo n.º 21
0
        private static string createChildTable(DataView childView, Dictionary <string, char> tableNotes, DataRelation relation, ITeXConverter converter, ITeXBuilderRepository builderRepository, ref int?level)
        {
            var childTable = new StringBuilder();

            if (level == null)
            {
                level = 1;
            }

            childTable.Append(Helper.Begin(Helper.Environments.tabu));
            level++;
            childTable.AppendFormat(" to {0}\\linewidth ", Math.Pow(TABLE_WIDTH, (double)level));
            childTable.Append(createColumnDesign(childView, relation));

            var childHeader = new StringBuilder();

            childHeader.Append(header(childView, tableNotes, converter, relation));
            var columnsCount = childView.Table.Columns.Cast <DataColumn>().Count(col => !col.IsHidden() && !relation.ChildColumns.Contains(col));

            childHeader.Append(CLine(1, columnsCount));
            childTable.Append(childHeader);

            childTable.Append(createRows(childView, tableNotes, converter, builderRepository, relation, level));
            childTable.Append(CLine(1, columnsCount));
            childTable.Append(Helper.End(Helper.Environments.tabu));
            level--;

            return(childTable.ToString());
        }
Ejemplo n.º 22
0
        private static string createRow(DataRowView row, Dictionary <string, char> tableNotes, ITeXConverter converter, ITeXBuilderRepository builderRepository, DataRelation relation = null, int?level = null)
        {
            var rowLine = new StringBuilder();

            rowLine.Append(setPagebreakDesirability(getPagebreakDesirability(row, level)));

            var columnsCount = 0;

            foreach (DataColumn col in row.DataView.Table.Columns)
            {
                if (col.IsHidden())
                {
                    continue;
                }
                if (relation != null)
                {
                    if (relation.ChildColumns.Contains(col))
                    {
                        continue;
                    }
                }
                columnsCount++;
                if (columnsCount > 1)
                {
                    rowLine.AppendFormat(" {0} ", VALUE_SEPARATOR);
                }
                var colValue = row[col.ColumnName];
                if (colValue == null || colValue == DBNull.Value)
                {
                    continue;
                }
                // datatype specifics
                string value;
                if (col.DataType == typeof(double) || col.DataType == typeof(float))
                {
                    value = converter.StringToTeX(_numericFormatter.Format(Convert.ToDouble(colValue)));
                }
                else if (col.DataType == typeof(DateTime))
                {
                    value = converter.StringToTeX(((DateTime)colValue).ToShortTimeString());
                }
                else if (col.DataType == typeof(Text))
                {
                    value = builderRepository.ChunkFor(colValue);
                }
                else
                {
                    value = converter.StringToTeX(colValue.ToString());
                }
                rowLine.Append(value);
            }
            rowLine.Append(Helper.LineBreak());
            rowLine.Append(phantomline());
            var first = true;

            foreach (DataRelation childrelation in row.DataView.Table.ChildRelations)
            {
                var childView = row.CreateChildView(childrelation);
                if (childView.Count == 0)
                {
                    continue;
                }
                if (first)
                {
                    rowLine.Append(CLine(1, columnsCount));
                    first = false;
                }

                rowLine.Append(multiFirstColumn(columnsCount, ColumnAlignments.c,
                                                createChildTable(childView, tableNotes, childrelation, converter, builderRepository, ref level)));
                rowLine.Append(Helper.LineBreak());
                rowLine.Append(phantomline());
            }
            if (row.DataView.Table.ChildRelations.Count > 0)
            {
                rowLine.Append(CLine(1, columnsCount));
            }

            return(rowLine.ToString());
        }
 public ReactionBuilderTEXBuilder(ITeXBuilderRepository builderRepository, IStoichiometricStringCreator stoichiometricStringCreator)
 {
     _builderRepository           = builderRepository;
     _stoichiometricStringCreator = stoichiometricStringCreator;
 }
Ejemplo n.º 24
0
 public ReportPartTeXBuilder(ITeXBuilderRepository builderRepository)
 {
     _builderRepository = builderRepository;
 }
Ejemplo n.º 25
0
 public IndividualProteinTeXBuilder(ITeXBuilderRepository builderRepository, IRepresentationInfoRepository representationInfoRepository) : base(builderRepository, representationInfoRepository)
 {
 }
Ejemplo n.º 26
0
 public DataTableTeXBuilder(ITeXBuilderRepository builderRepository)
 {
     _builderRepository = builderRepository;
 }
 public SimulationPropertiesTeXBuilder(ITeXBuilderRepository texBuilderRepository, IReportGenerator reportGenerator)
 {
     _texBuilderRepository = texBuilderRepository;
     _reportGenerator      = reportGenerator;
 }
 public EventGroupBuilderTEXBuilder(ITeXBuilderRepository builderRepository)
 {
    _builderRepository = builderRepository;
 }
Ejemplo n.º 29
0
 public CompoundPropertiesTeXBuilder(IRepresentationInfoRepository representationInfoRepository, ICompoundAlternativeTask compoundAlternativeTask, ITeXBuilderRepository builderRepository)
 {
     _representationInfoRepository = representationInfoRepository;
     _compoundAlternativeTask      = compoundAlternativeTask;
     _builderRepository            = builderRepository;
 }
Ejemplo n.º 30
0
        /// <summary>
        ///    This method generates a tabular from a given data view object.
        /// </summary>
        /// <seealso cref="SimpleTable" />
        /// <remarks>
        /// </remarks>
        /// <param name="caption">>Text for table caption.</param>
        /// <param name="label">Text for table lable. Should start with tab:.</param>
        /// <param name="data">Data to be shown in table.</param>
        /// <param name="pivotInfo">Information about pivotation.</param>
        /// <param name="texTranslations">For used aggregations a tex conform string can be set.</param>
        /// <param name="converter">Converter.</param>
        /// <param name="builderRepository">Repository builder needed to get chunks of tex objects.</param>
        /// <param name="rawData">Data which has been pivoted.</param>
        public static string PivotTable(string caption, string label, DataView data, DataTable rawData, PivotInfo pivotInfo, Cache <Aggregate, string> texTranslations, ITeXConverter converter, ITeXBuilderRepository builderRepository)
        {
            if (data.Count == 0)
            {
                return(String.Empty);
            }

            var tableNotes = getTableNotes(rawData, pivotInfo);
            var hasNotes   = tableNotes.Any();
            var header     = headerForPivot(rawData.DefaultView, tableNotes, pivotInfo, texTranslations, converter);

            return(createTable(data, converter, builderRepository, hasNotes, header, tableNotes, spaceNeeded: 12, caption: caption, label: label));
        }