Exemplo n.º 1
0
 protected override void FillUpReport(Schema schema, ReportPart reportPart)
 {
     reportPart.Title = schema.Name;
     reportPart.AddToContent(_reportGenerator.ReportFor(schema.StartTime));
     reportPart.AddToContent(_reportGenerator.ReportFor(schema.TimeBetweenRepetitions));
     reportPart.AddToContent(_reportGenerator.ReportFor(schema.NumberOfRepetitions));
     schema.SchemaItems.Each(x => reportPart.AddPart(_reportGenerator.ReportFor(x)));
 }
Exemplo n.º 2
0
        protected override void FillUpReport(SimpleProtocol simpleProtocol, ReportPart reportPart)
        {
            reportPart.Title = PKSimConstants.UI.SimpleProtocolMode;
            reportPart.AddToContent(simpleProtocol.ApplicationType?.DisplayName);
            reportPart.AddToContent(PKSimConstants.UI.ReportIs(PKSimConstants.UI.DosingInterval, simpleProtocol.DosingInterval?.DisplayName));

            simpleProtocol.AllParameters().Where(simpleProtocol.ParameterShouldBeExported)
            .Each(x => reportPart.AddToContent(_reportGenerator.ReportFor(x)));
        }
Exemplo n.º 3
0
        protected override void FillUpReport(ISchemaItem schemaItem, ReportPart reportPart)
        {
            reportPart.Title = schemaItem.Name;
            reportPart.AddToContent(schemaItem.ApplicationType.DisplayName);

            if (schemaItem.ApplicationType.NeedsFormulation)
            {
                reportPart.AddToContent(PKSimConstants.UI.ReportIs(PKSimConstants.UI.PlaceholderFormulation, schemaItem.FormulationKey));
            }

            schemaItem.AllParameters().Each(x => reportPart.AddToContent(_reportGenerator.ReportFor(x)));
        }
        protected override void FillUpReport(ParameterAlternative parameterAlternative, ReportPart reportPart)
        {
            reportPart.Title = parameterAlternative.Name;

            parameterAlternative.AllVisibleParameters().Each(p => reportPart.AddToContent(_reportGenerator.ReportFor(p)));

            var speciesDependent = parameterAlternative as ISpeciesDependentEntity;

            if (speciesDependent != null)
            {
                reportPart.AddToContent(PKSimConstants.UI.ReportIs(PKSimConstants.UI.Species, speciesDependent.Species.DisplayName));
            }
        }
        protected override void FillUpReport(FixedLimitsGroupingDefinition fixedLimits, ReportPart reportPart)
        {
            //-1 because we have one label more that limits
            int i = 0;

            reportPart.AddToContent("].., {0}] is {1}", format(fixedLimits.Limits[i], fixedLimits), fixedLimits.Labels[i]);

            for (i = 1; i < fixedLimits.Labels.Count - 1; i++)
            {
                reportPart.AddToContent("]{0}, {1}] is {2}", format(fixedLimits.Limits[i - 1], fixedLimits), format(fixedLimits.Limits[i], fixedLimits), fixedLimits.Labels[i]);
            }

            reportPart.AddToContent("]{0}, ..[ is {1}", format(fixedLimits.Limits[i - 1], fixedLimits), fixedLimits.Labels[i]);
        }
 protected override void FillUpReport(ProcessSelectionGroup processSelectionGroup, ReportPart reportPart)
 {
     foreach (var proc in processSelectionGroup.AllEnabledProcesses())
     {
         var systemicProc = proc as SystemicProcessSelection;
         if (systemicProc != null)
         {
             reportPart.AddToContent("Using {0} {1}", systemicProc.ProcessType.DisplayName.ToLower(), systemicProc.ProcessName);
         }
         else
         {
             reportPart.AddToContent("Mapping {0} with {1}", proc.MoleculeName, proc.ProcessName);
         }
     }
 }
        protected override void FillUpReport(RandomPopulationSettings populationSettings, ReportPart reportPart)
        {
            var baseOnIndividualPart = new ReportPart().WithTitle(PKSimConstants.UI.BasedOnIndividual);

            baseOnIndividualPart.AddToContent(populationSettings.BaseIndividual.Name);

            var numberOfIndividualPart = new ReportPart().WithTitle(PKSimConstants.UI.NumberOfIndividuals);

            numberOfIndividualPart.AddToContent(populationSettings.NumberOfIndividuals.ToString(CultureInfo.InvariantCulture));

            var genderRatioPart = new ReportPart().WithTitle(PKSimConstants.UI.GenderRatio);

            foreach (var genderRatio in populationSettings.GenderRatios)
            {
                genderRatioPart.AddToContent(_reportGenerator.ReportFor(genderRatio).Content);
            }

            var parameterRangePart = new ReportPart().WithTitle(PKSimConstants.UI.PopulationParameterRanges);

            foreach (var parameterRange in populationSettings.ParameterRanges)
            {
                parameterRangePart.AddToContent(_reportGenerator.ReportFor(parameterRange).Content);
            }

            reportPart.AddPart(baseOnIndividualPart);
            reportPart.AddPart(numberOfIndividualPart);
            reportPart.AddPart(genderRatioPart);
            reportPart.AddPart(parameterRangePart);
        }
        public override void Build(SimulationProperties simulationProperties, OSPSuiteTracker buildTracker)
        {
            var objectsToReport = new List <object>();

            objectsToReport.Add(new SubSection(PKSimConstants.UI.ModelStructure));

            var part = new ReportPart {
                Title = PKSimConstants.UI.AllowAging
            };

            part.AddToContent(simulationProperties.AllowAging ? PKSimConstants.UI.Yes : PKSimConstants.UI.No);
            objectsToReport.Add(part);
            objectsToReport.Add(_reportGenerator.ReportFor(simulationProperties.ModelProperties));

            objectsToReport.Add(new SubSection(PKSimConstants.UI.SimulationCompoundsConfiguration));
            objectsToReport.AddRange(getObjectsToReport(simulationProperties, buildTracker, cp => cp));

            if (anyProcessesDefined(simulationProperties))
            {
                objectsToReport.Add(new SubSection(PKSimConstants.UI.Processes));
                objectsToReport.AddRange(getObjectsToReport(simulationProperties, buildTracker, cp => cp.Processes.Any() ? cp.Processes : null));
            }

            objectsToReport.Add(new SubSection(PKSimConstants.UI.Administration));
            objectsToReport.AddRange(getObjectsToReport(simulationProperties, buildTracker, cp => cp.ProtocolProperties.Protocol == null ? null : cp.ProtocolProperties));

            if (anyEventsDefined(simulationProperties))
            {
                objectsToReport.Add(new SubSection(PKSimConstants.UI.SimulationEventsConfiguration));
                objectsToReport.Add(simulationProperties.EventProperties);
            }

            _texBuilderRepository.Report(objectsToReport, buildTracker);
        }
 protected override void FillUpReport(ExtendedProperties extendedProperties, ReportPart reportPart)
 {
     foreach (var ep in extendedProperties)
     {
         reportPart.AddToContent(PKSimConstants.UI.ReportIs(ep.Name, ep.ValueAsObject));
     }
 }
Exemplo n.º 10
0
        public ReportPart BuildDifferenceBetween(Simulation sourceSimulation, Simulation targetSimulation)
        {
            //compare building blocks
            var reportPart   = new ReportPart();
            var sourceReport = BuildFor(sourceSimulation).ToStringReport().Split('\n').ToList();
            var targetReport = BuildFor(targetSimulation).ToStringReport().Split('\n').ToList();

            var tempSourceReport = new List <string>(sourceReport);

            foreach (var line in tempSourceReport)
            {
                if (!targetReport.Contains(line))
                {
                    continue;
                }

                targetReport.Remove(line);
                sourceReport.Remove(line);
            }

            var beforePart = new ReportPart().WithTitle("Before");

            beforePart.AddToContent(sourceReport.ToString("\n"));
            var afterPart = new ReportPart().WithTitle("After");

            afterPart.AddToContent(targetReport.ToString("\n"));

            reportPart.AddPart(beforePart);
            reportPart.AddPart(afterPart);
            return(reportPart);
        }
 protected override void FillUpReport(IEnumerable <UsedBuildingBlock> usedBuildingBlocks, ReportPart reportPart)
 {
     foreach (var usedBuildingBlock in usedBuildingBlocks)
     {
         reportPart.AddToContent("Using {0} {1}", usedBuildingBlock.BuildingBlockType.ToString().ToLowerInvariant(), usedBuildingBlock.Name);
     }
 }
 protected override void FillUpReport(T comparison, ReportPart reportPart)
 {
     reportPart.Title = PKSimConstants.UI.SimulationsUsedInComparison;
     foreach (var simulation in comparison.AllSimulations)
     {
         reportPart.AddToContent(simulation.Name);
     }
 }
Exemplo n.º 13
0
 protected override void FillUpReport(ObserverSet observerSet, ReportPart reportPart)
 {
     reportPart.Title = observerSet.Name;
     observerSet.Observers.Each(x =>
     {
         reportPart.AddToContent(x.Name);
     });
 }
        public IList <ToolTipPart> MapFrom(string input)
        {
            var report = new ReportPart {
                Title = PKSimConstants.UI.Description
            };

            report.AddToContent(input);
            return(MapFrom(report));
        }
        protected override void FillUpReport(PopulationSimulationComparison simulationComparison, ReportPart reportPart)
        {
            base.FillUpReport(simulationComparison, reportPart);
            var part = new ReportPart {
                Title = PKSimConstants.UI.ReferenceSimulation
            };

            if (simulationComparison.HasReference)
            {
                part.AddToContent(simulationComparison.ReferenceSimulation.Name);
            }
            else
            {
                part.AddToContent(PKSimConstants.UI.None);
            }

            reportPart.AddPart(part);
        }
Exemplo n.º 16
0
        protected override void FillUpReport(UsedBuildingBlock usedBuildingBlock, ReportPart reportPart)
        {
            var status = _buildingBlockInProjectManager.StatusFor(usedBuildingBlock);

            if (status == BuildingBlockStatus.Green)
            {
                return;
            }
            reportPart.Title = PKSimConstants.UI.Warning;
            reportPart.AddToContent(PKSimConstants.Information.BuildingBlockSettingsDoNotMatchWithTemplate(usedBuildingBlock.BuildingBlockType.ToString()));
        }
Exemplo n.º 17
0
        protected override void FillUpReport(SimulationProperties simulationProperties, ReportPart reportPart)
        {
            var part = new ReportPart {
                Title = PKSimConstants.UI.AllowAging
            };

            part.AddToContent(simulationProperties.AllowAging ? PKSimConstants.UI.Yes : PKSimConstants.UI.No);
            reportPart.AddPart(part);
            reportPart.AddPart(_reportGenerator.ReportFor(simulationProperties.ModelProperties));
            reportPart.AddPart(_reportGenerator.ReportFor(simulationProperties.EventProperties));
        }
Exemplo n.º 18
0
        protected override void FillUpReport(IEventMapping eventMapping, ReportPart reportPart)
        {
            var templateEvent = _buildingBlockRepository.FindById(eventMapping.TemplateEventId);

            if (templateEvent == null)
            {
                return;
            }

            reportPart.AddToContent(string.Format("{0}, {1}", PKSimConstants.UI.ReportIs("Event", templateEvent.Name), _reportGenerator.StringReportFor(eventMapping.StartTime)));
        }
Exemplo n.º 19
0
        protected override void FillUpReport(Formulation formulation, ReportPart reportPart)
        {
            reportPart.Title = _infoRepository.DisplayNameFor(RepresentationObjectType.CONTAINER, formulation.FormulationType);
            string parameterTableCaption = PKSimConstants.UI.ParametersDefinedIn(formulation.Name);

            if (formulation.IsDissolved)
            {
                reportPart.AddToContent(PKSimConstants.UI.NoParameter);
                return;
            }

            TablePart tablePart;

            if (!formulation.IsParticleDissolution)
            {
                var parameterList = new ParameterList(parameterTableCaption, formulation.AllVisibleParameters());
                tablePart = parameterList.ToTable(_infoRepository);
            }
            else
            {
                var particleDisperseSystem      = formulation.Parameter(Constants.Parameters.PARTICLE_DISPERSE_SYSTEM);
                var particleDistribution        = formulation.Parameter(Constants.Parameters.PARTICLE_SIZE_DISTRIBUTION);
                var displayParticleDistribution = _infoRepository.DisplayNameFor(particleDistribution);
                tablePart = new TablePart(PKSimConstants.UI.Parameter)
                {
                    Caption = parameterTableCaption
                };

                if (particleDisperseSystem.Value == CoreConstants.Parameters.MONODISPERSE)
                {
                    tablePart.AddIs(_infoRepository.DisplayNameFor(particleDisperseSystem), PKSimConstants.UI.Monodisperse);
                    tablePart.AddIs(formulation.Parameter(CoreConstants.Parameters.PARTICLE_RADIUS_MEAN), _infoRepository);
                }
                else
                {
                    tablePart.AddIs(_infoRepository.DisplayNameFor(particleDisperseSystem), PKSimConstants.UI.Polydisperse);
                    if (particleDistribution.Value == CoreConstants.Parameters.PARTICLE_SIZE_DISTRIBUTION_NORMAL)
                    {
                        tablePart.AddIs(displayParticleDistribution, PKSimConstants.UI.Normal);
                        tablePart.AddIs(formulation.Parameter(CoreConstants.Parameters.PARTICLE_RADIUS_MEAN), _infoRepository);
                        tablePart.AddIs(formulation.Parameter(CoreConstants.Parameters.PARTICLE_RADIUS_STD_DEVIATION), _infoRepository);
                    }
                    else
                    {
                        tablePart.AddIs(displayParticleDistribution, PKSimConstants.UI.LogNormal);
                        tablePart.AddIs(formulation.Parameter(CoreConstants.Parameters.PARTICLE_LOG_DISTRIBUTION_MEAN), _infoRepository);
                        tablePart.AddIs(formulation.Parameter(CoreConstants.Parameters.PARTICLE_LOG_VARIATION_COEFF), _infoRepository);
                    }
                }
            }

            tablePart.Title = reportPart.Title;
            reportPart.AddPart(tablePart);
        }
Exemplo n.º 20
0
        private ReportPart defaultReportFor <TObject>(TObject objectToReport)
        {
            var report     = new ReportPart();
            var objectBase = objectToReport as IObjectBase;

            if (objectBase != null)
            {
                report.AddToContent(_representationInfoRepository.DescriptionFor(objectBase));
            }

            return(report);
        }
Exemplo n.º 21
0
        protected override void FillUpReport(IParameter parameter, ReportPart reportPart)
        {
            var parameterDTO = _parameterMapper.MapFrom(parameter);
            var displayName  = _representationInfoRepository.DisplayNameFor(parameter);
            var displayValue = ParameterMessages.DisplayValueFor(parameter);

            if (parameterDTO.ListOfValues.Any())
            {
                displayValue = parameterDTO.ListOfValues[parameter.Value];
            }

            reportPart.AddToContent(PKSimConstants.UI.ReportIs(displayName, displayValue));
        }
Exemplo n.º 22
0
        protected override void FillUpReport(Compound compound, ReportPart reportPart)
        {
            reportPart.AddPart(_reportGenerator.ReportFor(compound.ParameterAlternativeGroup(CoreConstants.Groups.COMPOUND_LIPOPHILICITY)));
            reportPart.AddToContent(_reportGenerator.ReportFor(compound.Parameter(Constants.Parameters.MOL_WEIGHT)));
            reportPart.AddToContent(_reportGenerator.ReportFor(compound.Parameter(CoreConstants.Parameters.EFFECTIVE_MOLECULAR_WEIGHT)));
            reportPart.AddToContent(_reportGenerator.ReportFor(compound.Parameter(CoreConstants.Parameters.IS_SMALL_MOLECULE)));

            if (compound.IsNeutral)
            {
                reportPart.AddToContent(PKSimConstants.UI.CompoundTypeNeutral);
            }
            else
            {
                addCompoundTypePart(reportPart, compound, CoreConstants.Parameters.PARAMETER_PKA1, CoreConstants.Parameters.COMPOUND_TYPE1);
                addCompoundTypePart(reportPart, compound, CoreConstants.Parameters.PARAMETER_PKA2, CoreConstants.Parameters.COMPOUND_TYPE2);
                addCompoundTypePart(reportPart, compound, CoreConstants.Parameters.PARAMETER_PKA3, CoreConstants.Parameters.COMPOUND_TYPE3);
            }
            var fractionUnboundReport = _reportGenerator.ReportFor(compound.ParameterAlternativeGroup(CoreConstants.Groups.COMPOUND_FRACTION_UNBOUND));

            fractionUnboundReport.AddToContent(_reportGenerator.ReportFor(compound.Parameter(CoreConstants.Parameters.PLASMA_PROTEIN_BINDING_PARTNER)));
            reportPart.AddPart(fractionUnboundReport);
        }
Exemplo n.º 23
0
        protected override void FillUpReport(IPopulationAnalysisField populationAnalysisField, ReportPart reportPart)
        {
            reportPart.Title = _objectTypeResolver.TypeFor(populationAnalysisField);
            reportPart.AddToContent(populationAnalysisField.Name);

            var groupingField = populationAnalysisField as PopulationAnalysisGroupingField;

            if (groupingField == null)
            {
                return;
            }

            reportPart.AddPart(_reportGenerator.ReportFor(groupingField.GroupingDefinition));
        }
Exemplo n.º 24
0
 protected override void FillUpReport(ParameterRange parameterRange, ReportPart reportPart)
 {
     if (parameterRange.IsConstant)
     {
         reportPart.AddToContent("{0} = {1} [{2}]", parameterRange.ParameterDisplayName, parameterRange.MinValueInDisplayUnit, parameterRange.Unit);
     }
     else if (parameterRange.MinValue.HasValue && parameterRange.MaxValue.HasValue)
     {
         reportPart.AddToContent("{0} [{3}] in [{1};{2}]", parameterRange.ParameterDisplayName, parameterRange.MinValueInDisplayUnit, parameterRange.MaxValueInDisplayUnit, parameterRange.Unit);
     }
     else if (parameterRange.MinValue.HasValue)
     {
         reportPart.AddToContent("{0} [{2}] in [{1};∞[", parameterRange.ParameterDisplayName, parameterRange.MinValueInDisplayUnit, parameterRange.Unit);
     }
     else if (parameterRange.MaxValue.HasValue)
     {
         reportPart.AddToContent("{0} [{2}] in ]0;{1}]", parameterRange.ParameterDisplayName, parameterRange.MaxValueInDisplayUnit, parameterRange.Unit);
     }
     else
     {
         reportPart.AddToContent("{0} [{1}] in ]0;∞[", parameterRange.ParameterDisplayName, parameterRange.Unit);
     }
 }
Exemplo n.º 25
0
        protected override void FillUpReport(DataRepository dataRepository, ReportPart reportPart)
        {
            reportPart.Title = PKSimConstants.ObjectTypes.ObservedData;
            reportPart.AddToContent(dataRepository.Name);
            reportPart.AddPart(_reportGenerator.ReportFor(dataRepository.ExtendedProperties));

            foreach (var column in dataRepository.AllButBaseGrid())
            {
                if (column.DataInfo == null)
                {
                    continue;
                }

                reportPart.AddPart(_reportGenerator.ReportFor(column));
            }
        }
Exemplo n.º 26
0
        protected override void Context()
        {
            _context       = A.Fake <IExecutionContext>();
            _oldSimulation = A.Fake <Simulation>();
            _newSimulation = A.Fake <Simulation>();
            _project       = A.Fake <IPKSimProject>();
            _simulationDifferenceBuilder = A.Fake <ISimulationCommandDescriptionBuilder>();
            _simulationReferenceUpdater  = A.Fake <ISimulationReferenceUpdater>();
            A.CallTo(() => _context.CurrentProject).Returns(_project);
            A.CallTo(() => _context.Resolve <ISimulationCommandDescriptionBuilder>()).Returns(_simulationDifferenceBuilder);
            A.CallTo(() => _context.Resolve <ISimulationReferenceUpdater>()).Returns(_simulationReferenceUpdater);
            var reportPart = new ReportPart();

            reportPart.AddToContent("toto");
            A.CallTo(() => _simulationDifferenceBuilder.BuildDifferenceBetween(_oldSimulation, _newSimulation)).Returns(reportPart);
            sut = new SwapSimulationCommand(_oldSimulation, _newSimulation, _context);
        }
        protected override void FillUpReport(ImportPopulationSettings populationSettings, ReportPart reportPart)
        {
            var baseOnIndividualPart = new ReportPart().WithTitle(PKSimConstants.UI.BasedOnIndividual);

            baseOnIndividualPart.AddToContent(populationSettings.BaseIndividual.Name);

            var numberOfIndividuals    = populationSettings.AllFiles.Sum(x => x.NumberOfIndividuals);
            var numberOfIndividualPart = new ReportPart().WithTitle(PKSimConstants.UI.NumberOfIndividuals);

            numberOfIndividualPart.AddToContent(numberOfIndividuals.ToString(CultureInfo.InvariantCulture));

            var part = new ReportPart().WithTitle(PKSimConstants.UI.CreatedUsingFiles);

            foreach (var populationFiles in populationSettings.AllFiles)
            {
                part.AddToContent(FileHelper.ShortenPathName(populationFiles.FilePath, 50));
            }

            reportPart.AddPart(baseOnIndividualPart);
            reportPart.AddPart(numberOfIndividualPart);
            reportPart.AddPart(part);
        }
Exemplo n.º 28
0
        private void addCompoundTypePart(ReportPart reportPart, Compound compound, string parameterPka1, string parameterCompoundType1)
        {
            var compoundType = compound.Parameter(parameterCompoundType1).Value;

            if (compoundType == CoreConstants.Compound.COMPOUND_TYPE_NEUTRAL)
            {
                return;
            }
            var pka = compound.Parameter(parameterPka1).Value;

            string compoundTypeDisplay;

            if (compoundType == CoreConstants.Compound.COMPOUND_TYPE_ACID)
            {
                compoundTypeDisplay = PKSimConstants.UI.CompoundTypeAcid;
            }
            else
            {
                compoundTypeDisplay = PKSimConstants.UI.CompoundTypeBase;
            }

            reportPart.AddToContent("{0} ({1})", pka, compoundTypeDisplay);
        }
Exemplo n.º 29
0
 protected override void FillUpReport(CreationMetaData creationMetaData, ReportPart reportPart)
 {
     reportPart.AddToContent(creationMetaData.ToDisplayString());
 }
 protected override void FillUpReport(NumberOfBinsGroupingDefinition groupingDefinition, ReportPart reportPart)
 {
     reportPart.AddToContent(PKSimConstants.UI.ReportIs(PKSimConstants.UI.NumberOfBins, groupingDefinition.NumberOfBins));
 }