Example #1
0
        public override void Execute(IExecutionContext context)
        {
            Add(new SetSpeciesInSpeciesDependentEntityCommand(_process, _species, context));

            var defaultIndividualRetriever = context.Resolve <IDefaultIndividualRetriever>();
            var defaultIndividual          = defaultIndividualRetriever.DefaultIndividualFor(_species);
            var compoundProcessParameterMappingRepository = context.Resolve <ICompoundProcessParameterMappingRepository>();

            var allProcessParametersWithDefaultValueInIndividual = _process.AllParameters()
                                                                   .Where(p => compoundProcessParameterMappingRepository.HasMappedParameterFor(_process.InternalName, p.Name)).ToList();

            foreach (var parameter in allProcessParametersWithDefaultValueInIndividual)
            {
                var objectPath          = compoundProcessParameterMappingRepository.MappedParameterPathFor(_process.InternalName, parameter.Name);
                var individualParameter = objectPath.Resolve <IParameter>(defaultIndividual);

                Add(new SetParameterValueCommand(parameter, individualParameter.Value)
                {
                    Visible = false
                });

                //Parameter updated from default individual should have the default value origin
                Add(new UpdateParameterValueOriginCommand(parameter, individualParameter.ValueOrigin)
                {
                    Visible = false
                });
            }

            base.Execute(context);


            _process = null;
            _species = null;
        }
 private void bindProcessParameters(CompoundProcess process)
 {
     using (new BatchUpdate(_parametersPresenter))
     {
         _parametersPresenter.EditParameters(process.AllParameters());
         View.AdjustParametersHeight(_parametersPresenter.OptimalHeight);
     }
 }
Example #3
0
        public ITransportBuilder PassiveTransportProcessFrom(CompoundProcess compoundProcess, string compoundName, IFormulaCache formulaCache)
        {
            var passiveProcess = _cloner.Clone(_simulationActiveProcessRepository.ProcessFor <PKSimTransport>(compoundProcess.InternalName));

            passiveProcess.Name   = compoundProcess.Name;
            passiveProcess.ForAll = false;
            passiveProcess.AddMoleculeName(compoundName);
            updateTransporterFormulaFromCache(passiveProcess, formulaCache);
            passiveProcess.Parameters.Where(x => !x.Formula.IsConstant()).Each(p => formulaCache.Add(p.Formula));
            _parameterSetUpdater.UpdateValuesByName(compoundProcess.AllParameters(), passiveProcess.Parameters);
            return(passiveProcess);
        }
Example #4
0
        public TransporterMoleculeContainer ActiveTransportFrom(CompoundProcess compoundProcess, IndividualTransporter transporter, IFormulaCache formulaCache)
        {
            var transporterMoleculeContainer = _objectBaseFactory.Create <TransporterMoleculeContainer>().WithName(compoundProcess.InternalName);

            transporterMoleculeContainer.Icon          = compoundProcess.Icon;
            transporterMoleculeContainer.TransportName = compoundProcess.Name;
            foreach (var inducedProcess in transporter.AllInducedProcesses())
            {
                var activeTransporterBuilder = activeTransportFrom(compoundProcess, inducedProcess, formulaCache);
                transporterMoleculeContainer.Icon      = activeTransporterBuilder.Icon;
                activeTransporterBuilder.TransportType = transporter.TransportType;
                transporterMoleculeContainer.AddActiveTransportRealization(activeTransporterBuilder);
                updateTransporterTagsFor(transporter, activeTransporterBuilder, inducedProcess);
            }

            _parameterContainerTask.AddProcessBuilderParametersTo(transporterMoleculeContainer);
            _parameterSetUpdater.UpdateValuesByName(compoundProcess.AllParameters(), transporterMoleculeContainer.Parameters);

            transporterMoleculeContainer.Name = transporter.Name;
            return(transporterMoleculeContainer);
        }