private async Task updatePopulationComparisonSnapshot(SimulationComparison snapshot, ISimulationComparison simulationComparison) { var populationSimulationComparison = simulationComparison as PopulationSimulationComparison; if (populationSimulationComparison == null) { return; } snapshot.PopulationComparisons = await _populationAnalysisChartMapper.MapToSnapshots(populationSimulationComparison.Analyses.OfType <ModelPopulationAnalysisChart>()); snapshot.ReferenceGroupingItem = populationSimulationComparison.ReferenceGroupingItem; snapshot.ReferenceSimulation = populationSimulationComparison.ReferenceSimulation?.Name; }
public override async Task <SnapshotSimulation> MapToSnapshot(ModelSimulation simulation, PKSimProject project) { if (simulation.IsImported) { throw new OSPSuiteException(PKSimConstants.Error.OnlyPKSimSimulationCanBeExportedToSnapshot(simulation.Name, simulation.Origin.DisplayName)); } var snapshot = await SnapshotFrom(simulation); snapshot.Individual = usedSimulationSubject <Model.Individual>(simulation); snapshot.Population = usedSimulationSubject <Model.Population>(simulation); snapshot.Compounds = await usedCompoundsFrom(simulation, project); snapshot.ObserverSets = await _observerSetMappingMapper.MapToSnapshots(simulation.ObserverSetProperties.ObserverSetMappings, project); snapshot.Model = simulation.ModelConfiguration.ModelName; snapshot.AllowAging = SnapshotValueFor(simulation.AllowAging, false); snapshot.Solver = await _solverSettingsMapper.MapToSnapshot(simulation.Solver); snapshot.OutputSchema = await _outputSchemaMapper.MapToSnapshot(simulation.OutputSchema); snapshot.OutputSelections = await _outputSelectionsMapper.MapToSnapshot(simulation.OutputSelections); snapshot.Events = await _eventMappingMapper.MapToSnapshots(simulation.EventProperties.EventMappings, project); snapshot.ObservedData = usedObservedDataFrom(simulation, project); snapshot.Parameters = await allParametersChangedByUserFrom(simulation, project); snapshot.Interactions = await interactionSnapshotFrom(simulation.InteractionProperties); snapshot.AdvancedParameters = await advancedParametersFrom(simulation); snapshot.IndividualAnalyses = await _simulationTimeProfileChartMapper.MapToSnapshots(simulation.AnalysesOfType <SimulationTimeProfileChart>()); snapshot.PopulationAnalyses = await _populationAnalysisChartMapper.MapToSnapshots(simulation.AnalysesOfType <ModelPopulationAnalysisChart>()); snapshot.HasResults = simulation.HasResults; snapshot.AlteredBuildingBlocks = alteredBuildingBlocksIn(simulation); return(snapshot); }