Пример #1
0
        public override async Task <ModelCompoundProperties> MapToModel(SnapshotCompoundProperties snapshot, CompoundPropertiesContext context)
        {
            var simulation         = context.Simulation;
            var compoundProperties = simulation.CompoundPropertiesFor(snapshot.Name);

            await _calculationMethodCacheMapper.MapToModel(snapshot.CalculationMethods, compoundProperties.CalculationMethodCache);

            updateAlternativeSelections(snapshot.Alternatives, compoundProperties);
            compoundProperties.Processes = await modelProcessSelectionFrom(snapshot.Processes, compoundProperties.Compound);

            compoundProperties.ProtocolProperties = modelProtocolPropertiesFrom(snapshot.Protocol, context.Project);

            return(compoundProperties);
        }
Пример #2
0
        public override async Task <ModelCompoundProperties> MapToModel(SnapshotCompoundProperties snapshot, SnapshotContextWithSimulation snapshotContext)
        {
            var simulation         = snapshotContext.Simulation;
            var compoundProperties = simulation.CompoundPropertiesFor(snapshot.Name);
            var simulationSubject  = simulation.BuildingBlock <ISimulationSubject>();

            await _calculationMethodCacheMapper.MapToModel(snapshot.CalculationMethods, new CalculationMethodCacheSnapshotContext(compoundProperties.CalculationMethodCache, snapshotContext));

            updateAlternativeSelections(snapshot.Alternatives, compoundProperties);
            compoundProperties.Processes = await modelProcessSelectionFrom(snapshot.Processes, compoundProperties.Compound, simulationSubject, snapshotContext);

            compoundProperties.ProtocolProperties = modelProtocolPropertiesFrom(snapshot.Protocol, snapshotContext.Project);

            return(compoundProperties);
        }