Ejemplo n.º 1
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)));
        }
Ejemplo n.º 2
0
        public UsedBuildingBlock MapFrom(IPKSimBuildingBlock buildingBlock, UsedBuildingBlock previousUsedBuildingBlock)
        {
            //check if the given building block is a real template building block.
            //If not, this is a modified building block in a simulation that should be used as is
            bool isTemplate = (_buildingBlockRepository.FindById(buildingBlock.Id) != null || previousUsedBuildingBlock == null);

            if (isTemplate)
            {
                return(new UsedBuildingBlock(buildingBlock.Id, buildingBlock.BuildingBlockType)
                {
                    BuildingBlock = usedCloneInSimulationFrom(buildingBlock),
                    Version = buildingBlock.Version,
                    StructureVersion = buildingBlock.StructureVersion,
                    Name = buildingBlock.Name,
                });
            }

            //the building block is not a template building block. Return the previously used building block
            return(previousUsedBuildingBlock);
        }